rivet-design 0.13.2 → 0.13.4

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 (92) hide show
  1. package/README.md +5 -1
  2. package/README.npm.md +5 -1
  3. package/dist/agent-variants/SessionStore.d.ts +22 -2
  4. package/dist/agent-variants/SessionStore.d.ts.map +1 -1
  5. package/dist/agent-variants/SessionStore.js +31 -0
  6. package/dist/agent-variants/SessionStore.js.map +1 -1
  7. package/dist/agent-variants/VariantWorkspaceManager.d.ts +43 -0
  8. package/dist/agent-variants/VariantWorkspaceManager.d.ts.map +1 -0
  9. package/dist/agent-variants/VariantWorkspaceManager.js +216 -0
  10. package/dist/agent-variants/VariantWorkspaceManager.js.map +1 -0
  11. package/dist/agent-variants/WorktreeOrchestrator.d.ts +27 -2
  12. package/dist/agent-variants/WorktreeOrchestrator.d.ts.map +1 -1
  13. package/dist/agent-variants/WorktreeOrchestrator.js +370 -60
  14. package/dist/agent-variants/WorktreeOrchestrator.js.map +1 -1
  15. package/dist/agent-variants/contracts.d.ts +62 -1
  16. package/dist/agent-variants/contracts.d.ts.map +1 -1
  17. package/dist/agent-variants/contracts.js +10 -1
  18. package/dist/agent-variants/contracts.js.map +1 -1
  19. package/dist/agent-variants/workItemBriefing.d.ts +26 -0
  20. package/dist/agent-variants/workItemBriefing.d.ts.map +1 -0
  21. package/dist/agent-variants/workItemBriefing.js +110 -0
  22. package/dist/agent-variants/workItemBriefing.js.map +1 -0
  23. package/dist/cli/client.d.ts +2 -0
  24. package/dist/cli/client.d.ts.map +1 -1
  25. package/dist/cli/client.js +1 -1
  26. package/dist/cli/client.js.map +1 -1
  27. package/dist/cli/commands/mcpServe.d.ts.map +1 -1
  28. package/dist/cli/commands/mcpServe.js +36 -8
  29. package/dist/cli/commands/mcpServe.js.map +1 -1
  30. package/dist/cli/commands/status.d.ts.map +1 -1
  31. package/dist/cli/commands/status.js +3 -1
  32. package/dist/cli/commands/status.js.map +1 -1
  33. package/dist/cli/commands/variants.d.ts.map +1 -1
  34. package/dist/cli/commands/variants.js +45 -8
  35. package/dist/cli/commands/variants.js.map +1 -1
  36. package/dist/cli/hostWorkNextAction.d.ts +33 -26
  37. package/dist/cli/hostWorkNextAction.d.ts.map +1 -1
  38. package/dist/cli/hostWorkNextAction.js +47 -24
  39. package/dist/cli/hostWorkNextAction.js.map +1 -1
  40. package/dist/hosts/workerDefaults.d.ts +62 -0
  41. package/dist/hosts/workerDefaults.d.ts.map +1 -0
  42. package/dist/hosts/workerDefaults.js +77 -0
  43. package/dist/hosts/workerDefaults.js.map +1 -0
  44. package/dist/install/codexGuidance.d.ts.map +1 -1
  45. package/dist/install/codexGuidance.js +5 -4
  46. package/dist/install/codexGuidance.js.map +1 -1
  47. package/dist/install/harnesses.d.ts.map +1 -1
  48. package/dist/install/harnesses.js +44 -16
  49. package/dist/install/harnesses.js.map +1 -1
  50. package/dist/install/mcpRegistration.d.ts +1 -1
  51. package/dist/install/mcpRegistration.d.ts.map +1 -1
  52. package/dist/install/mcpRegistration.js +23 -10
  53. package/dist/install/mcpRegistration.js.map +1 -1
  54. package/dist/routes/agentVariants.js +2 -2
  55. package/dist/routes/agentVariants.js.map +1 -1
  56. package/dist/services/TelemetryService.d.ts +8 -0
  57. package/dist/services/TelemetryService.d.ts.map +1 -1
  58. package/dist/services/TelemetryService.js +24 -0
  59. package/dist/services/TelemetryService.js.map +1 -1
  60. package/dist/services/VariantGenerationService.d.ts.map +1 -1
  61. package/dist/services/VariantGenerationService.js +8 -0
  62. package/dist/services/VariantGenerationService.js.map +1 -1
  63. package/dist/services/VariantRunService.d.ts +5 -2
  64. package/dist/services/VariantRunService.d.ts.map +1 -1
  65. package/dist/services/VariantRunService.js +39 -14
  66. package/dist/services/VariantRunService.js.map +1 -1
  67. package/dist/services/WorktreeManager.d.ts.map +1 -1
  68. package/dist/services/WorktreeManager.js +7 -2
  69. package/dist/services/WorktreeManager.js.map +1 -1
  70. package/dist/types/change-request-types.d.ts +3 -0
  71. package/dist/types/change-request-types.d.ts.map +1 -1
  72. package/dist/utils/cloneOrCopyDirSync.d.ts +14 -0
  73. package/dist/utils/cloneOrCopyDirSync.d.ts.map +1 -0
  74. package/dist/utils/cloneOrCopyDirSync.js +72 -0
  75. package/dist/utils/cloneOrCopyDirSync.js.map +1 -0
  76. package/dist/utils/skillWriter.d.ts +8 -0
  77. package/dist/utils/skillWriter.d.ts.map +1 -1
  78. package/dist/utils/skillWriter.js +35 -0
  79. package/dist/utils/skillWriter.js.map +1 -1
  80. package/dist/utils/skills/claude-skill.d.ts +2 -2
  81. package/dist/utils/skills/claude-skill.d.ts.map +1 -1
  82. package/dist/utils/skills/claude-skill.js +1 -1
  83. package/dist/utils/skills/cli-guidance.d.ts +2 -2
  84. package/dist/utils/skills/cli-guidance.d.ts.map +1 -1
  85. package/dist/utils/skills/cli-guidance.js +8 -8
  86. package/dist/utils/skills/cursor-rules.d.ts +1 -1
  87. package/dist/utils/skills/cursor-rules.d.ts.map +1 -1
  88. package/package.json +12 -9
  89. package/scripts/verify-node-version.cjs +52 -0
  90. package/src/ui/dist/assets/main-T3U4Gt16.js +419 -0
  91. package/src/ui/dist/index.html +1 -1
  92. package/src/ui/dist/assets/main-BBHg643G.js +0 -419
@@ -1,419 +0,0 @@
1
- var $M=Object.defineProperty;var dS=t=>{throw TypeError(t)};var HM=(t,e,n)=>e in t?$M(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var bo=(t,e,n)=>HM(t,typeof e!="symbol"?e+"":e,n),rv=(t,e,n)=>e.has(t)||dS("Cannot "+n);var W=(t,e,n)=>(rv(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?dS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ae=(t,e,n,r)=>(rv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ot=(t,e,n)=>(rv(t,e,"access private method"),n);var Ch=(t,e,n,r)=>({set _(s){Ae(t,e,s,n)},get _(){return W(t,e,r)}});function zM(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 a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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)}})();function $m(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sv={exports:{}},Dc={},iv={exports:{}},rt={};/**
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 fS;function UM(){if(fS)return rt;fS=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"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function v(D){return D===null||typeof D!="object"?null:(D=p&&D[p]||D["@@iterator"],typeof D=="function"?D:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function b(D,q,re){this.props=D,this.context=q,this.refs=_,this.updater=re||y}b.prototype.isReactComponent={},b.prototype.setState=function(D,q){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,q,"setState")},b.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=b.prototype;function C(D,q,re){this.props=D,this.context=q,this.refs=_,this.updater=re||y}var P=C.prototype=new E;P.constructor=C,x(P,b.prototype),P.isPureReactComponent=!0;var T=Array.isArray,A=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function R(D,q,re){var se,oe={},ue=null,de=null;if(q!=null)for(se in q.ref!==void 0&&(de=q.ref),q.key!==void 0&&(ue=""+q.key),q)A.call(q,se)&&!M.hasOwnProperty(se)&&(oe[se]=q[se]);var ie=arguments.length-2;if(ie===1)oe.children=re;else if(1<ie){for(var ae=Array(ie),me=0;me<ie;me++)ae[me]=arguments[me+2];oe.children=ae}if(D&&D.defaultProps)for(se in ie=D.defaultProps,ie)oe[se]===void 0&&(oe[se]=ie[se]);return{$$typeof:t,type:D,key:ue,ref:de,props:oe,_owner:O.current}}function L(D,q){return{$$typeof:t,type:D.type,key:q,ref:D.ref,props:D.props,_owner:D._owner}}function N(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function j(D){var q={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(re){return q[re]})}var V=/\/+/g;function G(D,q){return typeof D=="object"&&D!==null&&D.key!=null?j(""+D.key):q.toString(36)}function Y(D,q,re,se,oe){var ue=typeof D;(ue==="undefined"||ue==="boolean")&&(D=null);var de=!1;if(D===null)de=!0;else switch(ue){case"string":case"number":de=!0;break;case"object":switch(D.$$typeof){case t:case e:de=!0}}if(de)return de=D,oe=oe(de),D=se===""?"."+G(de,0):se,T(oe)?(re="",D!=null&&(re=D.replace(V,"$&/")+"/"),Y(oe,q,re,"",function(me){return me})):oe!=null&&(N(oe)&&(oe=L(oe,re+(!oe.key||de&&de.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+D)),q.push(oe)),1;if(de=0,se=se===""?".":se+":",T(D))for(var ie=0;ie<D.length;ie++){ue=D[ie];var ae=se+G(ue,ie);de+=Y(ue,q,re,ae,oe)}else if(ae=v(D),typeof ae=="function")for(D=ae.call(D),ie=0;!(ue=D.next()).done;)ue=ue.value,ae=se+G(ue,ie++),de+=Y(ue,q,re,ae,oe);else if(ue==="object")throw q=String(D),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return de}function K(D,q,re){if(D==null)return D;var se=[],oe=0;return Y(D,se,"","",function(ue){return q.call(re,ue,oe++)}),se}function B(D){if(D._status===-1){var q=D._result;q=q(),q.then(function(re){(D._status===0||D._status===-1)&&(D._status=1,D._result=re)},function(re){(D._status===0||D._status===-1)&&(D._status=2,D._result=re)}),D._status===-1&&(D._status=0,D._result=q)}if(D._status===1)return D._result.default;throw D._result}var X={current:null},$={transition:null},ee={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:$,ReactCurrentOwner:O};function H(){throw Error("act(...) is not supported in production builds of React.")}return rt.Children={map:K,forEach:function(D,q,re){K(D,function(){q.apply(this,arguments)},re)},count:function(D){var q=0;return K(D,function(){q++}),q},toArray:function(D){return K(D,function(q){return q})||[]},only:function(D){if(!N(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},rt.Component=b,rt.Fragment=n,rt.Profiler=s,rt.PureComponent=C,rt.StrictMode=r,rt.Suspense=c,rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,rt.act=H,rt.cloneElement=function(D,q,re){if(D==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+D+".");var se=x({},D.props),oe=D.key,ue=D.ref,de=D._owner;if(q!=null){if(q.ref!==void 0&&(ue=q.ref,de=O.current),q.key!==void 0&&(oe=""+q.key),D.type&&D.type.defaultProps)var ie=D.type.defaultProps;for(ae in q)A.call(q,ae)&&!M.hasOwnProperty(ae)&&(se[ae]=q[ae]===void 0&&ie!==void 0?ie[ae]:q[ae])}var ae=arguments.length-2;if(ae===1)se.children=re;else if(1<ae){ie=Array(ae);for(var me=0;me<ae;me++)ie[me]=arguments[me+2];se.children=ie}return{$$typeof:t,type:D.type,key:oe,ref:ue,props:se,_owner:de}},rt.createContext=function(D){return D={$$typeof:a,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},D.Provider={$$typeof:i,_context:D},D.Consumer=D},rt.createElement=R,rt.createFactory=function(D){var q=R.bind(null,D);return q.type=D,q},rt.createRef=function(){return{current:null}},rt.forwardRef=function(D){return{$$typeof:u,render:D}},rt.isValidElement=N,rt.lazy=function(D){return{$$typeof:h,_payload:{_status:-1,_result:D},_init:B}},rt.memo=function(D,q){return{$$typeof:f,type:D,compare:q===void 0?null:q}},rt.startTransition=function(D){var q=$.transition;$.transition={};try{D()}finally{$.transition=q}},rt.unstable_act=H,rt.useCallback=function(D,q){return X.current.useCallback(D,q)},rt.useContext=function(D){return X.current.useContext(D)},rt.useDebugValue=function(){},rt.useDeferredValue=function(D){return X.current.useDeferredValue(D)},rt.useEffect=function(D,q){return X.current.useEffect(D,q)},rt.useId=function(){return X.current.useId()},rt.useImperativeHandle=function(D,q,re){return X.current.useImperativeHandle(D,q,re)},rt.useInsertionEffect=function(D,q){return X.current.useInsertionEffect(D,q)},rt.useLayoutEffect=function(D,q){return X.current.useLayoutEffect(D,q)},rt.useMemo=function(D,q){return X.current.useMemo(D,q)},rt.useReducer=function(D,q,re){return X.current.useReducer(D,q,re)},rt.useRef=function(D){return X.current.useRef(D)},rt.useState=function(D){return X.current.useState(D)},rt.useSyncExternalStore=function(D,q,re){return X.current.useSyncExternalStore(D,q,re)},rt.useTransition=function(){return X.current.useTransition()},rt.version="18.3.1",rt}var hS;function U_(){return hS||(hS=1,iv.exports=UM()),iv.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 BM(){if(pS)return Dc;pS=1;var t=U_(),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 a(u,c,f){var h,p={},v=null,y=null;f!==void 0&&(v=""+f),c.key!==void 0&&(v=""+c.key),c.ref!==void 0&&(y=c.ref);for(h in c)r.call(c,h)&&!i.hasOwnProperty(h)&&(p[h]=c[h]);if(u&&u.defaultProps)for(h in c=u.defaultProps,c)p[h]===void 0&&(p[h]=c[h]);return{$$typeof:e,type:u,key:v,ref:y,props:p,_owner:s.current}}return Dc.Fragment=n,Dc.jsx=a,Dc.jsxs=a,Dc}var mS;function WM(){return mS||(mS=1,sv.exports=BM()),sv.exports}var S=WM(),g=U_();const ve=$m(g),B_=zM({__proto__:null,default:ve},[g]);var uf=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(){}},Ga,To,mu,GC,GM=(GC=class extends uf{constructor(){super();Ue(this,Ga);Ue(this,To);Ue(this,mu);Ae(this,mu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,To)||this.setEventListener(W(this,mu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,To))==null||e.call(this),Ae(this,To,void 0))}setEventListener(e){var n;Ae(this,mu,e),(n=W(this,To))==null||n.call(this),Ae(this,To,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){W(this,Ga)!==e&&(Ae(this,Ga,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof W(this,Ga)=="boolean"?W(this,Ga):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ga=new WeakMap,To=new WeakMap,mu=new WeakMap,GC),W_=new GM,KM={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Ao,z_,KC,ZM=(KC=class{constructor(){Ue(this,Ao,KM);Ue(this,z_,!1)}setTimeoutProvider(t){Ae(this,Ao,t)}setTimeout(t,e){return W(this,Ao).setTimeout(t,e)}clearTimeout(t){W(this,Ao).clearTimeout(t)}setInterval(t,e){return W(this,Ao).setInterval(t,e)}clearInterval(t){W(this,Ao).clearInterval(t)}},Ao=new WeakMap,z_=new WeakMap,KC),Ha=new ZM;function qM(t){setTimeout(t,0)}var YM=typeof window>"u"||"Deno"in globalThis;function _r(){}function XM(t,e){return typeof t=="function"?t(e):t}function P1(t){return typeof t=="number"&&t>=0&&t!==1/0}function n8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function zo(t,e){return typeof t=="function"?t(e):t}function Nr(t,e){return typeof t=="function"?t(e):t}function gS(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==G_(a,e.options))return!1}else if(!Cd(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||s&&s!==e.state.fetchStatus||i&&!i(e))}function vS(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(kd(e.options.mutationKey)!==kd(i))return!1}else if(!Cd(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function G_(t,e){return((e==null?void 0:e.queryKeyHashFn)||kd)(t)}function kd(t){return JSON.stringify(t,(e,n)=>A1(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Cd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Cd(t[n],e[n])):!1}var QM=Object.prototype.hasOwnProperty;function r8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=yS(t)&&yS(e);if(!r&&!(A1(t)&&A1(e)))return e;const i=(r?t:Object.keys(t)).length,a=r?e:Object.keys(e),u=a.length,c=r?new Array(u):{};let f=0;for(let h=0;h<u;h++){const p=r?h:a[h],v=t[p],y=e[p];if(v===y){c[p]=v,(r?h<i:QM.call(t,p))&&f++;continue}if(v===null||y===null||typeof v!="object"||typeof y!="object"){c[p]=y;continue}const x=r8(v,y,n+1);c[p]=x,x===v&&f++}return i===u&&f===i?t:c}function T1(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 yS(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function A1(t){if(!_S(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!_S(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function _S(t){return Object.prototype.toString.call(t)==="[object Object]"}function JM(t){return new Promise(e=>{Ha.setTimeout(e,t)})}function R1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?r8(t,e):e}function eL(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function tL(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var K_=Symbol();function s8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===K_?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function i8(t,e){return typeof t=="function"?t(...e):!!t}function nL(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}var Pd=(()=>{let t=()=>YM;return{isServer(){return t()},setIsServer(e){t=e}}})();function I1(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var rL=qM;function sL(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=rL;const i=u=>{e?t.push(u):s(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&s(()=>{r(()=>{u.forEach(c=>{n(c)})})})};return{batch:u=>{let c;e++;try{c=u()}finally{e--,e||a()}return c},batchCalls:u=>(...c)=>{i(()=>{u(...c)})},schedule:i,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{s=u}}}var Fn=sL(),gu,Ro,vu,ZC,iL=(ZC=class extends uf{constructor(){super();Ue(this,gu,!0);Ue(this,Ro);Ue(this,vu);Ae(this,vu,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(){W(this,Ro)||this.setEventListener(W(this,vu))}onUnsubscribe(){var e;this.hasListeners()||((e=W(this,Ro))==null||e.call(this),Ae(this,Ro,void 0))}setEventListener(e){var n;Ae(this,vu,e),(n=W(this,Ro))==null||n.call(this),Ae(this,Ro,e(this.setOnline.bind(this)))}setOnline(e){W(this,gu)!==e&&(Ae(this,gu,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return W(this,gu)}},gu=new WeakMap,Ro=new WeakMap,vu=new WeakMap,ZC),Fp=new iL;function oL(t){return Math.min(1e3*2**t,3e4)}function o8(t){return(t??"online")==="online"?Fp.isOnline():!0}var M1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function a8(t){let e=!1,n=0,r;const s=I1(),i=()=>s.status!=="pending",a=_=>{var b;if(!i()){const E=new M1(_);v(E),(b=t.onCancel)==null||b.call(t,E)}},u=()=>{e=!0},c=()=>{e=!1},f=()=>W_.isFocused()&&(t.networkMode==="always"||Fp.isOnline())&&t.canRun(),h=()=>o8(t.networkMode)&&t.canRun(),p=_=>{i()||(r==null||r(),s.resolve(_))},v=_=>{i()||(r==null||r(),s.reject(_))},y=()=>new Promise(_=>{var b;r=E=>{(i()||f())&&_(E)},(b=t.onPause)==null||b.call(t)}).then(()=>{var _;r=void 0,i()||(_=t.onContinue)==null||_.call(t)}),x=()=>{if(i())return;let _;const b=n===0?t.initialPromise:void 0;try{_=b??t.fn()}catch(E){_=Promise.reject(E)}Promise.resolve(_).then(p).catch(E=>{var O;if(i())return;const C=t.retry??(Pd.isServer()?0:3),P=t.retryDelay??oL,T=typeof P=="function"?P(n,E):P,A=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(e||!A){v(E);return}n++,(O=t.onFail)==null||O.call(t,n,E),JM(T).then(()=>f()?void 0:y()).then(()=>{e?v(E):x()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?x():y().then(x),s)}}var Ka,qC,l8=(qC=class{constructor(){Ue(this,Ka)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),P1(this.gcTime)&&Ae(this,Ka,Ha.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Pd.isServer()?1/0:300*1e3))}clearGcTimeout(){W(this,Ka)!==void 0&&(Ha.clearTimeout(W(this,Ka)),Ae(this,Ka,void 0))}},Ka=new WeakMap,qC);function aL(t){return{onFetch:(e,n)=>{var h,p,v,y,x;const r=e.options,s=(v=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,i=((y=e.state.data)==null?void 0:y.pages)||[],a=((x=e.state.data)==null?void 0:x.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const f=async()=>{let _=!1;const b=P=>{nL(P,()=>e.signal,()=>_=!0)},E=s8(e.options,e.fetchOptions),C=async(P,T,A)=>{if(_)return Promise.reject(e.signal.reason);if(T==null&&P.pages.length)return Promise.resolve(P);const M=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:T,direction:A?"backward":"forward",meta:e.options.meta};return b(j),j})(),R=await E(M),{maxPages:L}=e.options,N=A?tL:eL;return{pages:N(P.pages,R,L),pageParams:N(P.pageParams,T,L)}};if(s&&i.length){const P=s==="backward",T=P?lL:xS,A={pages:i,pageParams:a},O=T(r,A);u=await C(A,O,P)}else{const P=t??i.length;do{const T=c===0?a[0]??r.initialPageParam:xS(r,u);if(c>0&&T==null)break;u=await C(u,T),c++}while(c<P)}return u};e.options.persister?e.fetchFn=()=>{var _,b;return(b=(_=e.options).persister)==null?void 0:b.call(_,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function xS(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 lL(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 yu,Za,_u,is,qa,Pn,rf,Ya,Or,u8,Mi,YC,uL=(YC=class extends l8{constructor(e){super();Ue(this,Or);Ue(this,yu);Ue(this,Za);Ue(this,_u);Ue(this,is);Ue(this,qa);Ue(this,Pn);Ue(this,rf);Ue(this,Ya);Ae(this,Ya,!1),Ae(this,rf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ae(this,qa,e.client),Ae(this,is,W(this,qa).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ae(this,Za,bS(this.options)),this.state=e.state??W(this,Za),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return W(this,yu)}get promise(){var e;return(e=W(this,Pn))==null?void 0:e.promise}setOptions(e){if(this.options={...W(this,rf),...e},e!=null&&e._type&&Ae(this,yu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=bS(this.options);n.data!==void 0&&(this.setState(wS(n.data,n.dataUpdatedAt)),Ae(this,Za,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&W(this,is).remove(this)}setData(e,n){const r=R1(this.state.data,e,this.options);return ot(this,Or,Mi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){ot(this,Or,Mi).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=W(this,Pn))==null?void 0:r.promise;return(s=W(this,Pn))==null||s.cancel(e),n?n.then(_r).catch(_r):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return W(this,Za)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Nr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===K_||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>zo(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:!n8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=W(this,Pn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=W(this,Pn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),W(this,is).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(W(this,Pn)&&(W(this,Ya)||ot(this,Or,u8).call(this)?W(this,Pn).cancel({revert:!0}):W(this,Pn).cancelRetry()),this.scheduleGc()),W(this,is).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ot(this,Or,Mi).call(this,{type:"invalidate"})}async fetch(e,n){var f,h,p,v,y,x,_,b,E,C,P;if(this.state.fetchStatus!=="idle"&&((f=W(this,Pn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Pn))return W(this,Pn).continueRetry(),W(this,Pn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(A=>A.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Ae(this,Ya,!0),r.signal)})},i=()=>{const T=s8(this.options,n),O=(()=>{const M={client:W(this,qa),queryKey:this.queryKey,meta:this.meta};return s(M),M})();return Ae(this,Ya,!1),this.options.persister?this.options.persister(T,O,this):T(O)},u=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:W(this,qa),state:this.state,fetchFn:i};return s(T),T})(),c=W(this,yu)==="infinite"?aL(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),Ae(this,_u,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&ot(this,Or,Mi).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Ae(this,Pn,a8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof M1&&T.revert&&this.setState({...W(this,_u),fetchStatus:"idle"}),r.abort()},onFail:(T,A)=>{ot(this,Or,Mi).call(this,{type:"failed",failureCount:T,error:A})},onPause:()=>{ot(this,Or,Mi).call(this,{type:"pause"})},onContinue:()=>{ot(this,Or,Mi).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await W(this,Pn).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(v=W(this,is).config).onSuccess)==null||y.call(v,T,this),(_=(x=W(this,is).config).onSettled)==null||_.call(x,T,this.state.error,this),T}catch(T){if(T instanceof M1){if(T.silent)return W(this,Pn).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw ot(this,Or,Mi).call(this,{type:"error",error:T}),(E=(b=W(this,is).config).onError)==null||E.call(b,T,this),(P=(C=W(this,is).config).onSettled)==null||P.call(C,this.state.data,T,this),T}finally{this.scheduleGc()}}},yu=new WeakMap,Za=new WeakMap,_u=new WeakMap,is=new WeakMap,qa=new WeakMap,Pn=new WeakMap,rf=new WeakMap,Ya=new WeakMap,Or=new WeakSet,u8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Mi=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,...c8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...wS(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ae(this,_u,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),Fn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),W(this,is).notify({query:this,type:"updated",action:e})})},YC);function c8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:o8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function wS(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bS(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 gr,ut,sf,rr,Xa,xu,$i,Io,of,wu,bu,Qa,Ja,Mo,Su,pt,ed,L1,O1,N1,D1,j1,F1,V1,d8,XC,cL=(XC=class extends uf{constructor(e,n){super();Ue(this,pt);Ue(this,gr);Ue(this,ut);Ue(this,sf);Ue(this,rr);Ue(this,Xa);Ue(this,xu);Ue(this,$i);Ue(this,Io);Ue(this,of);Ue(this,wu);Ue(this,bu);Ue(this,Qa);Ue(this,Ja);Ue(this,Mo);Ue(this,Su,new Set);this.options=n,Ae(this,gr,e),Ae(this,Io,null),Ae(this,$i,I1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,ut).addObserver(this),SS(W(this,ut),this.options)?ot(this,pt,ed).call(this):this.updateResult(),ot(this,pt,D1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return $1(W(this,ut),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return $1(W(this,ut),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,pt,j1).call(this),ot(this,pt,F1).call(this),W(this,ut).removeObserver(this)}setOptions(e){const n=this.options,r=W(this,ut);if(this.options=W(this,gr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Nr(this.options.enabled,W(this,ut))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ot(this,pt,V1).call(this),W(this,ut).setOptions(this.options),n._defaulted&&!T1(this.options,n)&&W(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,ut),observer:this});const s=this.hasListeners();s&&ES(W(this,ut),r,this.options,n)&&ot(this,pt,ed).call(this),this.updateResult(),s&&(W(this,ut)!==r||Nr(this.options.enabled,W(this,ut))!==Nr(n.enabled,W(this,ut))||zo(this.options.staleTime,W(this,ut))!==zo(n.staleTime,W(this,ut)))&&ot(this,pt,L1).call(this);const i=ot(this,pt,O1).call(this);s&&(W(this,ut)!==r||Nr(this.options.enabled,W(this,ut))!==Nr(n.enabled,W(this,ut))||i!==W(this,Mo))&&ot(this,pt,N1).call(this,i)}getOptimisticResult(e){const n=W(this,gr).getQueryCache().build(W(this,gr),e),r=this.createResult(n,e);return fL(this,r)&&(Ae(this,rr,r),Ae(this,xu,this.options),Ae(this,Xa,W(this,ut).state)),r}getCurrentResult(){return W(this,rr)}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&W(this,$i).status==="pending"&&W(this,$i).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){W(this,Su).add(e)}getCurrentQuery(){return W(this,ut)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=W(this,gr).defaultQueryOptions(e),r=W(this,gr).getQueryCache().build(W(this,gr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ot(this,pt,ed).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,rr)))}createResult(e,n){var L;const r=W(this,ut),s=this.options,i=W(this,rr),a=W(this,Xa),u=W(this,xu),f=e!==r?e.state:W(this,sf),{state:h}=e;let p={...h},v=!1,y;if(n._optimisticResults){const N=this.hasListeners(),j=!N&&SS(e,n),V=N&&ES(e,r,n,s);(j||V)&&(p={...p,...c8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:_,status:b}=p;y=p.data;let E=!1;if(n.placeholderData!==void 0&&y===void 0&&b==="pending"){let N;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(N=i.data,E=!0):N=typeof n.placeholderData=="function"?n.placeholderData((L=W(this,bu))==null?void 0:L.state.data,W(this,bu)):n.placeholderData,N!==void 0&&(b="success",y=R1(i==null?void 0:i.data,N,n),v=!0)}if(n.select&&y!==void 0&&!E)if(i&&y===(a==null?void 0:a.data)&&n.select===W(this,of))y=W(this,wu);else try{Ae(this,of,n.select),y=n.select(y),y=R1(i==null?void 0:i.data,y,n),Ae(this,wu,y),Ae(this,Io,null)}catch(N){Ae(this,Io,N)}W(this,Io)&&(x=W(this,Io),y=W(this,wu),_=Date.now(),b="error");const C=p.fetchStatus==="fetching",P=b==="pending",T=b==="error",A=P&&C,O=y!==void 0,R={status:b,fetchStatus:p.fetchStatus,isPending:P,isSuccess:b==="success",isError:T,isInitialLoading:A,isLoading:A,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!P,isLoadingError:T&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:T&&O,isStale:Z_(e,n),refetch:this.refetch,promise:W(this,$i),isEnabled:Nr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const N=R.data!==void 0,j=R.status==="error"&&!N,V=K=>{j?K.reject(R.error):N&&K.resolve(R.data)},G=()=>{const K=Ae(this,$i,R.promise=I1());V(K)},Y=W(this,$i);switch(Y.status){case"pending":e.queryHash===r.queryHash&&V(Y);break;case"fulfilled":(j||R.data!==Y.value)&&G();break;case"rejected":(!j||R.error!==Y.reason)&&G();break}}return R}updateResult(){const e=W(this,rr),n=this.createResult(W(this,ut),this.options);if(Ae(this,Xa,W(this,ut).state),Ae(this,xu,this.options),W(this,Xa).data!==void 0&&Ae(this,bu,W(this,ut)),T1(n,e))return;Ae(this,rr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!W(this,Su).size)return!0;const a=new Set(i??W(this,Su));return this.options.throwOnError&&a.add("error"),Object.keys(W(this,rr)).some(u=>{const c=u;return W(this,rr)[c]!==e[c]&&a.has(c)})};ot(this,pt,d8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,pt,D1).call(this)}},gr=new WeakMap,ut=new WeakMap,sf=new WeakMap,rr=new WeakMap,Xa=new WeakMap,xu=new WeakMap,$i=new WeakMap,Io=new WeakMap,of=new WeakMap,wu=new WeakMap,bu=new WeakMap,Qa=new WeakMap,Ja=new WeakMap,Mo=new WeakMap,Su=new WeakMap,pt=new WeakSet,ed=function(e){ot(this,pt,V1).call(this);let n=W(this,ut).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(_r)),n},L1=function(){ot(this,pt,j1).call(this);const e=zo(this.options.staleTime,W(this,ut));if(Pd.isServer()||W(this,rr).isStale||!P1(e))return;const r=n8(W(this,rr).dataUpdatedAt,e)+1;Ae(this,Qa,Ha.setTimeout(()=>{W(this,rr).isStale||this.updateResult()},r))},O1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,ut)):this.options.refetchInterval)??!1},N1=function(e){ot(this,pt,F1).call(this),Ae(this,Mo,e),!(Pd.isServer()||Nr(this.options.enabled,W(this,ut))===!1||!P1(W(this,Mo))||W(this,Mo)===0)&&Ae(this,Ja,Ha.setInterval(()=>{(this.options.refetchIntervalInBackground||W_.isFocused())&&ot(this,pt,ed).call(this)},W(this,Mo)))},D1=function(){ot(this,pt,L1).call(this),ot(this,pt,N1).call(this,ot(this,pt,O1).call(this))},j1=function(){W(this,Qa)!==void 0&&(Ha.clearTimeout(W(this,Qa)),Ae(this,Qa,void 0))},F1=function(){W(this,Ja)!==void 0&&(Ha.clearInterval(W(this,Ja)),Ae(this,Ja,void 0))},V1=function(){const e=W(this,gr).getQueryCache().build(W(this,gr),this.options);if(e===W(this,ut))return;const n=W(this,ut);Ae(this,ut,e),Ae(this,sf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},d8=function(e){Fn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(W(this,rr))}),W(this,gr).getQueryCache().notify({query:W(this,ut),type:"observerResultsUpdated"})})},XC);function dL(t,e){return Nr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Nr(e.retryOnMount,t)===!1)}function SS(t,e){return dL(t,e)||t.state.data!==void 0&&$1(t,e,e.refetchOnMount)}function $1(t,e,n){if(Nr(e.enabled,t)!==!1&&zo(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Z_(t,e)}return!1}function ES(t,e,n,r){return(t!==e||Nr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Z_(t,n)}function Z_(t,e){return Nr(e.enabled,t)!==!1&&t.isStaleByTime(zo(e.staleTime,t))}function fL(t,e){return!T1(t.getCurrentResult(),e)}var af,Xs,Zn,el,Qs,ko,QC,hL=(QC=class extends l8{constructor(e){super();Ue(this,Qs);Ue(this,af);Ue(this,Xs);Ue(this,Zn);Ue(this,el);Ae(this,af,e.client),this.mutationId=e.mutationId,Ae(this,Zn,e.mutationCache),Ae(this,Xs,[]),this.state=e.state||pL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){W(this,Xs).includes(e)||(W(this,Xs).push(e),this.clearGcTimeout(),W(this,Zn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ae(this,Xs,W(this,Xs).filter(n=>n!==e)),this.scheduleGc(),W(this,Zn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){W(this,Xs).length||(this.state.status==="pending"?this.scheduleGc():W(this,Zn).remove(this))}continue(){var e;return((e=W(this,el))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,f,h,p,v,y,x,_,b,E,C,P,T,A,O,M;const n=()=>{ot(this,Qs,ko).call(this,{type:"continue"})},r={client:W(this,af),meta:this.options.meta,mutationKey:this.options.mutationKey};Ae(this,el,a8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,L)=>{ot(this,Qs,ko).call(this,{type:"failed",failureCount:R,error:L})},onPause:()=>{ot(this,Qs,ko).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>W(this,Zn).canRun(this)}));const s=this.state.status==="pending",i=!W(this,el).canStart();try{if(s)n();else{ot(this,Qs,ko).call(this,{type:"pending",variables:e,isPaused:i}),W(this,Zn).config.onMutate&&await W(this,Zn).config.onMutate(e,this,r);const L=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));L!==this.state.context&&ot(this,Qs,ko).call(this,{type:"pending",context:L,variables:e,isPaused:i})}const R=await W(this,el).start();return await((f=(c=W(this,Zn).config).onSuccess)==null?void 0:f.call(c,R,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,R,e,this.state.context,r)),await((y=(v=W(this,Zn).config).onSettled)==null?void 0:y.call(v,R,null,this.state.variables,this.state.context,this,r)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,R,null,e,this.state.context,r)),ot(this,Qs,ko).call(this,{type:"success",data:R}),R}catch(R){try{await((E=(b=W(this,Zn).config).onError)==null?void 0:E.call(b,R,e,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((P=(C=this.options).onError)==null?void 0:P.call(C,R,e,this.state.context,r))}catch(L){Promise.reject(L)}try{await((A=(T=W(this,Zn).config).onSettled)==null?void 0:A.call(T,void 0,R,this.state.variables,this.state.context,this,r))}catch(L){Promise.reject(L)}try{await((M=(O=this.options).onSettled)==null?void 0:M.call(O,void 0,R,e,this.state.context,r))}catch(L){Promise.reject(L)}throw ot(this,Qs,ko).call(this,{type:"error",error:R}),R}finally{W(this,Zn).runNext(this)}}},af=new WeakMap,Xs=new WeakMap,Zn=new WeakMap,el=new WeakMap,Qs=new WeakSet,ko=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),Fn.batch(()=>{W(this,Xs).forEach(r=>{r.onMutationUpdate(e)}),W(this,Zn).notify({mutation:this,type:"updated",action:e})})},QC);function pL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hi,Ps,lf,JC,mL=(JC=class extends uf{constructor(e={}){super();Ue(this,Hi);Ue(this,Ps);Ue(this,lf);this.config=e,Ae(this,Hi,new Set),Ae(this,Ps,new Map),Ae(this,lf,0)}build(e,n,r){const s=new hL({client:e,mutationCache:this,mutationId:++Ch(this,lf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){W(this,Hi).add(e);const n=Ph(e);if(typeof n=="string"){const r=W(this,Ps).get(n);r?r.push(e):W(this,Ps).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(W(this,Hi).delete(e)){const n=Ph(e);if(typeof n=="string"){const r=W(this,Ps).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&W(this,Ps).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Ph(e);if(typeof n=="string"){const r=W(this,Ps).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Ph(e);if(typeof n=="string"){const s=(r=W(this,Ps).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Fn.batch(()=>{W(this,Hi).forEach(e=>{this.notify({type:"removed",mutation:e})}),W(this,Hi).clear(),W(this,Ps).clear()})}getAll(){return Array.from(W(this,Hi))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>vS(n,r))}findAll(e={}){return this.getAll().filter(n=>vS(e,n))}notify(e){Fn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Fn.batch(()=>Promise.all(e.map(n=>n.continue().catch(_r))))}},Hi=new WeakMap,Ps=new WeakMap,lf=new WeakMap,JC);function Ph(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Js,e8,gL=(e8=class extends uf{constructor(e={}){super();Ue(this,Js);this.config=e,Ae(this,Js,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??G_(s,n);let a=this.get(i);return a||(a=new uL({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){W(this,Js).has(e.queryHash)||(W(this,Js).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=W(this,Js).get(e.queryHash);n&&(e.destroy(),n===e&&W(this,Js).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Fn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return W(this,Js).get(e)}getAll(){return[...W(this,Js).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>gS(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>gS(e,r)):n}notify(e){Fn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Fn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Fn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Js=new WeakMap,e8),Qt,Lo,Oo,Eu,ku,No,Cu,Pu,t8,vL=(t8=class{constructor(t={}){Ue(this,Qt);Ue(this,Lo);Ue(this,Oo);Ue(this,Eu);Ue(this,ku);Ue(this,No);Ue(this,Cu);Ue(this,Pu);Ae(this,Qt,t.queryCache||new gL),Ae(this,Lo,t.mutationCache||new mL),Ae(this,Oo,t.defaultOptions||{}),Ae(this,Eu,new Map),Ae(this,ku,new Map),Ae(this,No,0)}mount(){Ch(this,No)._++,W(this,No)===1&&(Ae(this,Cu,W_.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Qt).onFocus())})),Ae(this,Pu,Fp.subscribe(async t=>{t&&(await this.resumePausedMutations(),W(this,Qt).onOnline())})))}unmount(){var t,e;Ch(this,No)._--,W(this,No)===0&&((t=W(this,Cu))==null||t.call(this),Ae(this,Cu,void 0),(e=W(this,Pu))==null||e.call(this),Ae(this,Pu,void 0))}isFetching(t){return W(this,Qt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return W(this,Lo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Qt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=W(this,Qt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(zo(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return W(this,Qt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=W(this,Qt).get(r.queryHash),i=s==null?void 0:s.state.data,a=XM(e,i);if(a!==void 0)return W(this,Qt).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Fn.batch(()=>W(this,Qt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=W(this,Qt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=W(this,Qt);Fn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=W(this,Qt);return Fn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Fn.batch(()=>W(this,Qt).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(_r).catch(_r)}invalidateQueries(t,e={}){return Fn.batch(()=>(W(this,Qt).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=Fn.batch(()=>W(this,Qt).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(_r)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(_r)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=W(this,Qt).build(this,e);return n.isStaleByTime(zo(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(_r).catch(_r)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(_r).catch(_r)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Fp.isOnline()?W(this,Lo).resumePausedMutations():Promise.resolve()}getQueryCache(){return W(this,Qt)}getMutationCache(){return W(this,Lo)}getDefaultOptions(){return W(this,Oo)}setDefaultOptions(t){Ae(this,Oo,t)}setQueryDefaults(t,e){W(this,Eu).set(kd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...W(this,Eu).values()],n={};return e.forEach(r=>{Cd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){W(this,ku).set(kd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...W(this,ku).values()],n={};return e.forEach(r=>{Cd(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...W(this,Oo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=G_(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===K_&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...W(this,Oo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){W(this,Qt).clear(),W(this,Lo).clear()}},Qt=new WeakMap,Lo=new WeakMap,Oo=new WeakMap,Eu=new WeakMap,ku=new WeakMap,No=new WeakMap,Cu=new WeakMap,Pu=new WeakMap,t8),f8=g.createContext(void 0),h8=t=>{const e=g.useContext(f8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},yL=({client:t,children:e})=>(g.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(f8.Provider,{value:t,children:e})),p8=g.createContext(!1),_L=()=>g.useContext(p8);p8.Provider;function xL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var wL=g.createContext(xL()),bL=()=>g.useContext(wL),SL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?i8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},EL=t=>{g.useEffect(()=>{t.clearReset()},[t])},kL=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||i8(n,[t.error,r])),CL=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))}},PL=(t,e)=>t.isLoading&&t.isFetching&&!e,TL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,kS=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function AL(t,e,n){var y,x,_,b;const r=_L(),s=bL(),i=h8(),a=i.defaultQueryOptions(t);(x=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||x.call(y,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,CL(a),SL(a,s,u),EL(s);const f=!i.getQueryCache().get(a.queryHash),[h]=g.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),v=!r&&c;if(g.useSyncExternalStore(g.useCallback(E=>{const C=v?h.subscribe(Fn.batchCalls(E)):_r;return h.updateResult(),C},[h,v]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),g.useEffect(()=>{h.setOptions(a)},[a,h]),TL(a,p))throw kS(a,h,s);if(kL({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((b=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||b.call(_,a,p),a.experimental_prefetchInRender&&!Pd.isServer()&&PL(p,r)){const E=f?kS(a,h,s):u==null?void 0:u.promise;E==null||E.catch(_r).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function H1(t,e){return AL(t,cL)}var te=typeof window<"u"?window:void 0,_n=typeof globalThis<"u"?globalThis:te;typeof self>"u"&&(_n.self=_n),typeof File>"u"&&(_n.File=function(){});var sr=_n==null?void 0:_n.navigator,Ee=_n==null?void 0:_n.document,on=_n==null?void 0:_n.location,z1=_n==null?void 0:_n.fetch,U1=_n!=null&&_n.XMLHttpRequest&&"withCredentials"in new _n.XMLHttpRequest?_n.XMLHttpRequest:void 0,CS=_n==null?void 0:_n.AbortController,RL=_n==null?void 0:_n.CompressionStream,vr=sr==null?void 0:sr.userAgent,$e=te??{};function m8(){return!(!te||te.navigator.onLine===!1)}var PS="1.399.2",Vt={DEBUG:!1,LIB_VERSION:PS,LIB_NAME:"web",JS_SDK_VERSION:PS};function TS(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(f){return void n(f)}u.done?e(c):Promise.resolve(c).then(r,s)}function en(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){TS(i,r,s,a,u,"next",c)}function u(c){TS(i,r,s,a,u,"throw",c)}a(void 0)}))}}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pe.apply(null,arguments)}function g8(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var AS=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function RS(t){return typeof t=="string"||t}function IS(t){return typeof t=="string"?t:void 0}var jc,Di=(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.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.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),MS=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),IL=["$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"],ML=["token"],v8="NativeGzipValidationError",B1=t=>t.length>=2&&t[0]===31&&t[1]===139,LS=(t,e)=>t===MS.GZipJS||e===MS.GZipJS||e==="gzip",OS=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Th=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=v8,e},LL=(function(){var t=en((function*(e,n){18>e.size&&Th("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());B1(r)&&r[2]===8||Th("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(jc)return jc;jc=[];for(var h=0;256>h;h++){for(var p=h,v=0;8>v;v++)p=1&p?3988292384^p>>>1:p>>>1;jc[h]=p>>>0}return jc})(),c=4294967295,f=0;a.length>f;f++)c=u[255&(c^a[f])]^c>>>8;return(4294967295^c)>>>0})(n)&&Th("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Th("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function W1(){return W1=en((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var f=en((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return f.apply(this,arguments)}})()),u=new Response(s.readable).blob(),[c]=yield Promise.all([u,a]);return yield LL(c,r),c}catch(f){if(n!=null&&n.rethrow)throw f;return e&&console.error("Failed to gzip compress data",f),null}})),W1.apply(this,arguments)}var OL=["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","pinterest","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"],NS=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return OL.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Be(t,e){return t.indexOf(e)!==-1}var Hm=function(t){return t.trim()},G1=function(t){return t.replace(/^\$/,"")},y8=Object.prototype,_8=y8.hasOwnProperty,zm=y8.toString,tt=Array.isArray||function(t){return zm.call(t)==="[object Array]"},Ts=t=>typeof t=="function",Ot=t=>t===Object(t)&&!tt(t),Do=t=>{if(Ot(t)){for(var e in t)if(_8.call(t,e))return!1;return!0}return!1},be=t=>t===void 0,_t=t=>zm.call(t)=="[object String]",K1=t=>_t(t)&&t.trim().length===0,ar=t=>t===null,Ye=t=>be(t)||ar(t),$n=t=>zm.call(t)=="[object Number]"&&t==t,Li=t=>$n(t)&&t>0,ai=t=>zm.call(t)==="[object Boolean]",NL=t=>t instanceof FormData,DL=t=>Be(IL,t),jL=t=>Be(ML,t);function x8(t){return t===null||typeof t!="object"}function Vp(t,e){return{}.toString.call(t)==="[object "+e+"]"}function q_(t){return typeof Event<"u"&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var FL=[!0,"true",1,"1","yes"],ov=t=>Be(FL,t),VL=[!1,"false",0,"0","no"];function si(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),$n(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),si(s||n,e,n,r))}class $L{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=si(e.bucketSize,0,100,e.Ae),this.De=si(e.refillRate,0,this.Fe,e.Ae),this.$e=si(e.refillInterval,0,864e5,e.Ae)}Ne(e,n){var r=Math.floor((n-e.lastAccess)/this.$e);r>0&&(e.tokens=Math.min(e.tokens+r*this.De,this.Fe),e.lastAccess=e.lastAccess+r*this.$e)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.Ee[s];return i?this.Ne(i,r):this.Ee[s]=i={tokens:this.Fe,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.Pe)==null||n.call(this,e)),i.tokens===0)}stop(){this.Ee={}}}var zr="Mobile",$p="iOS",Wi="Android",Tu="Tablet",w8=Wi+" "+Tu,b8="iPad",S8="Apple",E8=S8+" Watch",ud="Safari",Au="BlackBerry",k8="Samsung",C8=k8+"Browser",P8=k8+" Internet",tl="Chrome",HL=tl+" OS",T8=tl+" "+$p,Y_="Internet Explorer",A8=Y_+" "+zr,X_="Opera",zL=X_+" Mini",Q_="Edge",R8="Microsoft "+Q_,ou="Firefox",I8=ou+" "+$p,Td="Nintendo",Ad="PlayStation",au="Xbox",M8=Wi+" "+zr,L8=zr+" "+ud,td="Windows",Z1=td+" Phone",DS="Nokia",q1="Ouya",O8="Generic",UL=O8+" "+zr.toLowerCase(),N8=O8+" "+Tu.toLowerCase(),Y1="Konqueror",D8="Oculus Browser",Hp="Vivaldi",j8="Yandex",zp="Whale",X1="DuckDuckGo",F8="Pale Moon",Up="Waterfox",cd="Brave",V8="Google Search App",Ft="(\\d+(\\.\\d+)?)",av=new RegExp("Version/"+Ft),BL=new RegExp(au,"i"),WL=new RegExp(Ad+" \\w+","i"),GL=new RegExp(Td+" \\w+","i"),J_=new RegExp(Au+"|PlayBook|BB10","i"),KL={"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"},$8=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?cd:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Be(t,"GSA/")?V8:Be(t," OPR/")&&Be(t,"Mini")?zL:Be(t," OPR/")?X_:J_.test(t)?Au:Be(t,"IE"+zr)||Be(t,"WPDesktop")?A8:Be(t,"OculusBrowser")?D8:Be(t,C8)?P8:Be(t,Q_)||Be(t,"Edg/")?R8:Be(t,Hp+"/")?Hp:Be(t,"YaBrowser/")?j8:Be(t,zp+"/")?zp:Be(t,X1+"/")||Be(t,"Ddg/")?X1:Be(t,"FBIOS")?"Facebook "+zr:Be(t,"UCWEB")||Be(t,"UCBrowser")?"UC Browser":Be(t,"CriOS")?T8:Be(t,"CrMo")||Be(t,tl)?tl:Be(t,Wi)&&Be(t,ud)?M8:Be(t,"FxiOS")?I8:Be(t.toLowerCase(),Y1.toLowerCase())?Y1:Be(t,cd+"/")?cd:((i,a)=>a&&Be(a,S8)||(function(u){return Be(u,ud)&&!Be(u,tl)&&!Be(u,Wi)})(i))(t,e)?Be(t,zr)?L8:ud:Be(t,"PaleMoon/")?F8:Be(t,Up+"/")?Up:Be(t,ou)?ou:Be(t,"MSIE")||Be(t,"Trident/")?Y_:Be(t,"Gecko")?ou:"")},ZL={[A8]:[new RegExp("rv:"+Ft)],[R8]:[new RegExp(Q_+"?\\/"+Ft)],[tl]:[new RegExp("("+tl+"|CrMo)\\/"+Ft)],[T8]:[new RegExp("CriOS\\/"+Ft)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ft)],[ud]:[av],[L8]:[av],[X_]:[new RegExp("(Opera|OPR)\\/"+Ft)],[ou]:[new RegExp(ou+"\\/"+Ft)],[I8]:[new RegExp("FxiOS\\/"+Ft)],[Y1]:[new RegExp("Konqueror[:/]?"+Ft,"i")],[Au]:[new RegExp(Au+" "+Ft),av],[M8]:[new RegExp("android\\s"+Ft,"i")],[P8]:[new RegExp(C8+"\\/"+Ft)],[D8]:[new RegExp("OculusBrowser\\/"+Ft)],[Hp]:[new RegExp(Hp+"\\/"+Ft)],[j8]:[new RegExp("YaBrowser\\/"+Ft)],[zp]:[new RegExp(zp+"\\/"+Ft)],[cd]:[new RegExp(cd+"\\/"+Ft)],[X1]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ft)],[F8]:[new RegExp("PaleMoon\\/"+Ft)],[Up]:[new RegExp(Up+"\\/"+Ft)],[V8]:[new RegExp("GSA\\/"+Ft)],[Y_]:[new RegExp("(rv:|MSIE )"+Ft)],Mozilla:[new RegExp("rv:"+Ft)]},qL=function(t,e,n,r){var s=$8(t,e,n,r),i=ZL[s];if(be(i))return null;for(var a=0;i.length>a;a++){var u=t.match(i[a]);if(u)return parseFloat(u[u.length-2])}return null},jS=[[new RegExp(au+"; "+au+" (.*?)[);]","i"),t=>[au,t&&t[1]||""]],[new RegExp(Td,"i"),[Td,""]],[new RegExp(Ad,"i"),[Ad,""]],[J_,[Au,""]],[new RegExp(td,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Z1,""];if(new RegExp(zr).test(e)&&!/IEMobile\b/.test(e))return[td+" "+zr,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=KL[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[td,r]}return[td,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[$p,[t[3],t[4],t[5]||"0"].join(".")]:[$p,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=be(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Wi+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Wi+")","i"),t=>t&&t[2]?[Wi,[t[2],t[3],t[4]||"0"].join(".")]:[Wi,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var 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/,[HL,""]],[/Linux|debian/i,["Linux",""]]],FS=function(t){return GL.test(t)?Td:WL.test(t)?Ad:BL.test(t)?au:new RegExp(q1,"i").test(t)?q1:new RegExp("("+Z1+"|WPDesktop)","i").test(t)?Z1:/iPad/.test(t)?b8:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?E8:J_.test(t)?Au:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(DS,"i").test(t)?DS:/(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(zr).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)?Wi:w8:new RegExp("(pda|"+zr+")","i").test(t)?UL:new RegExp(Tu,"i").test(t)&&!new RegExp(Tu+" pc","i").test(t)?N8:""},YL=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function VS(t,e){return typeof(n=t)=="string"&&YL.test(n)?t:e();var n}function Wo(t){return t&&t.split("#")[0]}function ap(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}var XL=t=>t instanceof Error,H8={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}},QL=H8.info;function z8(t){if(ai(t))return{boolValue:t};if(typeof t=="number")return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if(typeof t=="string")return{stringValue:t};if(tt(t))return{arrayValue:{values:t.map((e=>z8(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function Bp(t){var e=[];for(var n in t){var r=t[n];ar(r)||be(r)||e.push({key:n,value:z8(r)})}return e}function JL(t,e){var n=t.level||"info",{text:r,number:s}=H8[n]||QL,i=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),Ye(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Ye(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var u=pe({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:Bp(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),be(t.trace_flags)||(c.flags=t.trace_flags),c}function U8(t,e,n){return pe({},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})}function B8(t,e,n,r){return{resourceLogs:[{resource:{attributes:Bp(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let eO=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Se=e,this.Ae=n,this.qe=r,this.Be=s,this.je=i,this.He=a,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=e.maxBufferSize,this.Je=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.Ke=e.flushIntervalMs,this.Ye=e.maxBatchRecordsPerPost,this.Xe=e.rateCapWindowMs,this.et=e.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ye=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.it(t);if(e!==null)if(e.body){if(this.nt()){var n={record:JL(e,this.qe())};this.Be((()=>this.st(n)))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=tt(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ae.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.Ae.error("Error in beforeSend function for log:",a),null}return r}nt(){if(this.et===void 0)return!0;var t=Date.now(),e=t-this.We;return this.Xe>e&&e>=0||(this.We=t,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var t=this;return en((function*(){if(!t._instance.isDisabled)return t.Ue||(t.Ue=t.ot().finally((()=>{t.Ue=null}))),t.Ue}))()}ot(){var t=this;return en((function*(){var e;t.tt();var n=(e=t._instance.getPersistedProperty(Di.LogsQueue))!==null&&e!==void 0?e:[];if(n.length!==0)for(var r=n.length,s=0;n.length>0&&r>s;){var i,a;t.ze=0;var u=Math.min(n.length,t.Ye),c=n.slice(0,u),f=B8(c.map((p=>p.record)),t.ut(),(i=t.He)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.ht(f);if(h.kind==="too-large"&&c.length>1)t.Ye=Math.max(1,Math.floor(c.length/2)),t.Ae.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.Ye);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):h.kind==="ok"&&t.Se.maxBatchRecordsPerPost>t.Ye&&(t.Ye=Math.min(t.Se.maxBatchRecordsPerPost,t.Ye+1)),yield t.dt(c.length),n=(a=t._instance.getPersistedProperty(Di.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}dt(t){var e=this;return en((function*(){var n,r=Math.max(0,t-e.ze),s=(n=e._instance.getPersistedProperty(Di.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Di.LogsQueue,s.slice(r)),yield e.je()}))()}ut(){return U8(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Di.LogsQueue))!==null&&e!==void 0?e:[];this.Je>n.length||(n.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Di.LogsQueue,n),this.Qe>n.length?this.ct():this.rt()}}ct(t){t===void 0&&(t=this.Ke),this.vt||(this.vt=ap((()=>{this.vt=void 0,this.rt()}),t))}ft(){var t=Math.min(Math.max(0,this.Ve-1),6);return this.Ke*Math.pow(2,t)}yt(){var t=this._instance.getPersistedProperty(Di.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return en((function*(){e.tt();var n=e.flush().catch((()=>{}));t!==void 0?yield Promise.race([n,new Promise((r=>ap(r,t)))]):yield n}))()}flushWithTimeout(t){var e=this;return en((function*(){var n=!1,r=e.flush(),s=new Promise((i=>ap((()=>{n=!0,i()}),t)));try{yield Promise.race([r,s])}finally{n&&r.catch((()=>{}))}}))()}rt(){this.flush().then((()=>{this.Ve=0}),(t=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())}))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};var lv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function $S(t){return String(t)+"000000"}function HS(t,e,n,r){var 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}let tO=class{constructor(t,e,n){this._instance=t,this.Se=e,this.Ae=n,this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}count(t,e,n){e===void 0&&(e=1),this.kt({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.kt({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.kt({name:t,type:"histogram",value:e,unit:n==null?void 0:n.unit,attributes:n==null?void 0:n.attributes})}flush(){var t=this,e=this.Ue,n=(function(){var s=en((function*(){e&&(yield e.catch((()=>{}))),yield t.St()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.Ue===r&&(this.Ue=null)}));return this.Ue=r,r}drainWindow(){if(this.bt.size===0)return null;var t=this.bt;return this.bt=new Map,this._t=!1,this.wt=new Map,this.xt=new Set,this.Ct(t)}reset(){this.tt(),this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}kt(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.it(t);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.Ae.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n=this.wt.get(e.name);n===void 0?this.wt.set(e.name,e.type):n===e.type||this.xt.has(e.name)||(this.xt.add(e.name),this.Ae.warn("Metric name '"+e.name+"' is already used as a "+n+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name."));var r=HS(e.type,e.name,e.unit,e.attributes),s=this.bt.get(r);if(!s){if(this.bt.size>=this.Se.maxSeriesPerFlush)return void(this._t||(this._t=!0,this.Ae.warn("Metric series cap reached ("+this.Se.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")));s={name:e.name,type:e.type,unit:e.unit,attributes:e.attributes?pe({},e.attributes):void 0,windowStartMs:Date.now()},this.bt.set(r,s)}this.It(s,e.value),this.ct()}else this.Ae.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.Ae.warn("Dropping metric with empty name")}}It(t,e){var n;switch(t.type){case"count":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(lv.length+1).fill(0)});var 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(var a=0;i.length>a;a++)if(i[a]>=s)return a;return i.length})(e,lv)]+=1}}it(t){var e=this.Se.beforeSend;if(!e)return t;var n=tt(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.Ae.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.Ae.error("Error in beforeSend function for metric:",a),null}return r}ct(){this.vt||(this.vt=ap((()=>{this.vt=void 0,this.flush().catch((()=>{}))}),this.Se.flushIntervalMs))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}St(){var t=this;return en((function*(){if(t.bt.size!==0){var e=t.bt;t.bt=new Map,t._t=!1,t.wt=new Map,t.xt=new Set;var n=yield t._instance.Tt(t.Ct(e));switch(n.kind){case"ok":return;case"retry-later":return t.Mt(e),void t.ct();case"too-large":return void t.Ae.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.Ae.error("Failed to send metrics batch:",n.error)}}}))()}Ct(t){return(function(s,i,a,u){return{resourceMetrics:[{resource:{attributes:Bp(i)},scopeMetrics:[{scope:{name:a,version:u},metrics:s}]}]}})(this.Et(t),(e=this.Se,n=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),pe({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":n,"telemetry.sdk.version":r})),this._instance.getLibraryId(),this._instance.getLibraryVersion());var e,n,r}Et(t){var e=$S(Date.now()),n=new Map;for(var r of t.values()){var s,i=HS(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=pe({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},n.set(i,a));var u=Bp((s=r.attributes)!==null&&s!==void 0?s:{}),c=$S(r.windowStartMs);if(r.type==="count"){var f,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(f=r.total)!==null&&f!==void 0?f:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,v={attributes:u,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(v)}else r.hist&&a.histogram.dataPoints.push({attributes:u,startTimeUnixNano:c,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:lv})}return Array.from(n.values())}Mt(t){var e,n;for(var[r,s]of t){var i=this.bt.get(r);if(i)switch(i.windowStartMs=Math.min(i.windowStartMs,s.windowStartMs),i.type){case"count":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(var a=0;i.hist.bucketCounts.length>a;a++)i.hist.bucketCounts[a]+=s.hist.bucketCounts[a]}else i.hist=s.hist}else this.bt.set(r,s)}}};var Ah,zS,uv;function nO(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return uv&&n.length===zS||(zS=n.length,uv=n.reduce(((r,s)=>{Ah||(Ah={});var i=Ah[s];if(i)r[i[0]]=i[1];else for(var a=t(s),u=a.length-1;u>=0;u--){var c=a[u],f=c==null?void 0:c.filename,h=e[s];if(f&&h){r[f]=h,Ah[s]=[f,h];break}}return r}),{})),uv}}class rO{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var n=this;return en((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&tt(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),pe({},e,{cause:r,stack:s})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return en((function*(){var r=e;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(e,n){var r,s,i,a={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var u=[a];return e.cause!=null&&u.push(...this.convertToExceptionList(e.cause,pe({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:nO(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var s=(i,a)=>{if(4>=a){var u=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,u)}};return pe({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var Ru="?";function Q1(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?Ru:n,in_app:!0};return be(r)||(i.lineno=r),be(s)||(i.colno=s),i}var W8=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Ru,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},sO=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,iO=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,oO=/\((\S*)(?::(\d+))(?::(\d+))\)/,aO=(t,e)=>{var n=sO.exec(t);if(n){var[,r,s,i]=n;return Q1(e,r,Ru,+s,+i)}var a=iO.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var u=oO.exec(a[2]);u&&(a[2]=u[1],a[3]=u[2],a[4]=u[3])}var[c,f]=W8(a[1]||Ru,a[2]);return Q1(e,f,c,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},lO=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,uO=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,cO=(t,e)=>{var n=lO.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=uO.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||Ru;return[i,s]=W8(i,s),Q1(e,s,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},US=/\(error: (.*)\)/;class dO{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=_t(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Vp(e,"DOMException")}isDOMError(e){return Vp(e,"DOMError")}}class fO{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class hO{constructor(){}match(e){return Vp(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r;return n.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var pO=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class mO{match(e){return typeof e=="string"}coerce(e,n){var r,[s,i]=this.getInfos(e);return{type:s??"Error",value:i??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(pO);return s&&(n=s[1],r=s[2]),[n,r]}}var gO=["fatal","error","warning","log","info","debug"];function G8(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(e>=s.length)return r===n.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class vO{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s=this.getErrorPropertyFromObject(e);return s?n.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return q_(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+G8(e)}isSeverityLevel(e){return _t(e)&&!K1(e)&&gO.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(XL(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class yO{match(e){return q_(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+G8(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class _O{match(e){return x8(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class xO{match(e){return Vp(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!q_(e))return!1;try{var n=e.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(e,n){var r,s=this.getUnhandledRejectionReason(e);return x8(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var Wp="$message",Gp="$timestamp",wO=new Set([Wp,Gp]),cv={enabled:!0,max_bytes:32768};function Kp(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:cv.enabled,max_bytes:SO(t.max_bytes,cv.max_bytes)}:pe({},cv)}class bO{constructor(e){this.Pt=[],this.Rt=0,this.Se=Kp(e)}setConfig(e){this.Se=Kp(e),this.Ot()}add(e){var n=(function(s){var i,a,u;try{u=[],i=(a=JSON.stringify(s,(function(v,y){if(typeof y=="bigint")return y.toString();if(typeof y!="function"&&typeof y!="symbol"){if(y instanceof Error)return{name:y.name,message:y.message,stack:y.stack};if(y&&typeof y=="object"){for(;u.length>0&&u[u.length-1]!==this;)u.pop();if(u.includes(y))return"[Circular]";u.push(y)}return y}})))!==null&&a!==void 0?a:"null"}catch{return}try{var c=JSON.parse(i);if(!Ot(c))return;var f=c,h=f[Wp],p=f[Gp];return!_t(h)||h.trim().length===0||!_t(p)&&!$n(p)?void 0:{step:f,json:i}}catch{return}})(e);if(n){var r=(function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var i=encodeURIComponent(s),a=0,u=0;i.length>u;u++)i[u]==="%"?(a+=1,u+=2):a+=1;return a})(n.json);r>this.Se.max_bytes||(this.Pt.push({step:n.step,bytes:r}),this.Rt+=r,this.Ot())}}getAttachable(){return this.Pt.map((e=>e.step))}clear(){this.Pt=[],this.Rt=0}size(){return this.Pt.length}Ot(){for(;this.Rt>this.Se.max_bytes&&this.Pt.length>0;){var e=this.Pt.shift();e&&(this.Rt-=e.bytes)}}}function SO(t,e){if(!$n(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var K8=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k(s){if(te&&(Vt.DEBUG||$e.POSTHOG_DEBUG||n)&&!be(te.console)&&te.console){for(var i=("__rrweb_original__"in te.console[s])?te.console[s].__rrweb_original__:te.console[s],a=arguments.length,u=new Array(a>1?a-1:0),c=1;a>c;c++)u[c-1]=arguments[c];i(t,...u)}},debug(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.k("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>K8(t+" "+s,i)};return r},_e=K8("[PostHog.js]"),Dt=_e.createLogger,EO=Dt("[ExternalScriptsLoader]"),dv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return EO.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Ee==null?void 0:Ee.querySelectorAll("script");if(r){for(var s,i=function(){if(r[a].src===e){var c=r[a];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(f=>{c.__posthog_loading_callback_fired=!0,n(void 0,f)})),c.onerror=f=>n(f),{v:void 0})}},a=0;r.length>a;a++)if(s=i())return s.v}var u=()=>{if(!Ee)return n("document not found");var c=Ee.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=e,c.onload=p=>{c.__posthog_loading_callback_fired=!0,n(void 0,p)},c.onerror=p=>n(p),t.config.prepare_external_dependency_script&&(c=t.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")Ee.head.appendChild(c);else{var f,h=Ee.querySelectorAll("body > script");h.length>0?(f=h[0].parentNode)==null||f.insertBefore(c,h[0]):Ee.body.appendChild(c)}};Ee!=null&&Ee.body?u():Ee==null||Ee.addEventListener("DOMContentLoaded",u)};$e.__PosthogExtensions__=$e.__PosthogExtensions__||{},$e.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var i=3e5;s=s+"&t="+Math.floor(Date.now()/i)*i}r=t.requestRouter.endpointFor("assets",s)}dv(t,r,n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");dv(t,a,n)}},$e.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);dv(t,r,n)};var Z8="$people_distinct_id",Zp="$device_id",fv="$device_model",nd="__alias",rd="__timers",J1="$autocapture_disabled_server_side",ey="$heatmaps_enabled_server_side",ty="$exception_capture_enabled_server_side",ny="$error_tracking_suppression_rules",ry="$error_tracking_capture_extension_exceptions",sy="$web_vitals_enabled_server_side",e2="$dead_clicks_enabled_server_side",t2="$product_tours_enabled_server_side",iy="$web_vitals_allowed_metrics",za="$session_recording_remote_config",q8="$replay_sample_rate",Y8="$replay_override_sampling",X8="$replay_override_linked_flag",Q8="$replay_override_url_trigger",J8="$replay_override_event_trigger",Jl="$sesid",n2="$session_is_sampled",Va="$enabled_feature_flags",lp="$active_feature_flags",sd="$early_access_features",oy="$feature_flag_details",up="$feature_flag_payloads",ay="$feature_flag_request_id",Oi="$override_feature_flags",ql="$override_feature_flag_payloads",Oa="$stored_person_properties",Na="$stored_group_properties",ly="$surveys",qp="$surveys_loaded_at",uy="$surveys_activated",id="ph_product_tours",dd="$flag_call_reported",cy="$flag_call_reported_session_id",dy="$feature_flag_errors",Rd="$feature_flag_evaluated_at",Es="$user_state",fy="$client_session_props",hy="$capture_rate_limit",py="$initial_campaign_params",my="$initial_referrer_info",Yp="$initial_person_info",Xp="$epp",e6="__POSTHOG_TOOLBAR__",Rh="$posthog_cookieless",t6="$sdk_debug_extensions_init_method",n6="$sdk_debug_extensions_init_time_ms",r6="$sdk_debug_recording_script_not_loaded",r2="PostHog loadExternalDependency extension not found.",Da="on_reject",zi="always",Vl="anonymous",$l="identified",gy="identified_only",Qp="visibilitychange",Jp="beforeunload",Yl="$pageview",hv="$pageleave",pv="$identify",BS="$groupidentify";function Ih(t,e){tt(t)&&t.forEach(e)}function bt(t,e){if(!Ye(t))if(tt(t))t.forEach(e);else if(NL(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)_8.call(t,n)&&e(t[n],n)}var At=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;e>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(t[i]=s[i]);return t};function cp(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var WS=function(t){try{return t()}catch{return}},kO=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return t.apply(this,n)}catch(s){_e.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),_e.critical(s)}}},s2=function(t){var e={};return bt(t,(function(n,r){(_t(n)&&n.length>0||$n(n))&&(e[r]=n)})),e},CO=["herokuapp.com","vercel.app","netlify.app"];function PO(t){var e=t==null?void 0:t.hostname;if(!_t(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of CO)if(n===r)return!1;return!0}function $t(t,e,n,r){var{capture:s=!1,passive:i=!0}=r??{};t==null||t.addEventListener(e,n,{capture:s,passive:i})}function s6(t){return t.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return $n(t)&&isFinite(t)&&Math.floor(t)===t});class em{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");var 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/Math.pow(2,8),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 em(i)}toString(){for(var e="",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 em(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;16>n;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class TO{constructor(){this.S=0,this.C=0,this.I=new AO}generate(){var e=this.generateOrAbort();if(be(e)){this.S=0;var n=this.generateOrAbort();if(be(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return em.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var GS,i6=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};te&&!be(te.crypto)&&crypto.getRandomValues&&(i6=t=>crypto.getRandomValues(t));class AO{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(i6(this.R),this.O=0),this.R[this.O++]}}var Fi=()=>RO().toString(),RO=()=>(GS||(GS=new TO)).generate(),Fc="",IO=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ti={N:()=>!!Ee,D(t){_e.error("cookieStore error: "+t)},A(t){if(Ee){try{for(var e=t+"=",n=Ee.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];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}},F(t){var e;try{e=JSON.parse(ti.A(t))||{}}catch{}return e},q(t,e,n,r,s){if(!Ee)return!1;try{var i="",a="",u=(function(h,p){if(p){var v=(function(x,_){if(_===void 0&&(_=Ee),Fc)return Fc;if(!_||["localhost","127.0.0.1"].includes(x))return"";for(var b=x.split("."),E=Math.min(b.length,8),C="dmn_chk_"+Fi();!Fc&&E--;){var P=b.slice(E).join("."),T=C+"=1;domain=."+P+";path=/";_.cookie=T+";max-age=3",_.cookie.includes(C)&&(_.cookie=T+";max-age=0",Fc=P)}return Fc})(h);if(!v){var y=(x=>{var _=x.match(IO);return _?_[0]:""})(h);y!==v&&_e.info("Warning: cookie subdomain discovery mismatch",y,v),v=y}return v?"; domain=."+v:""}return""})(Ee.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var f=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return f.length>3686.4&&_e.warn("cookieStore warning: large cookie, len="+f.length),Ee.cookie=f,!0}catch{return!1}},P(t,e){if(Ee!=null&&Ee.cookie)try{ti.q(t,"",-1,e)}catch{return}}},mv=null,wt={N(){if(!ar(mv))return mv;var t=!0;if(be(te))t=!1;else try{var e="__mplssupport__";wt.q(e,"xyz"),wt.A(e)!=='"xyz"'&&(t=!1),wt.P(e)}catch{t=!1}return t||_e.error("localStorage unsupported; falling back to cookie store"),mv=t,t},D(t){_e.error("localStorage error: "+t)},A(t){try{return te==null?void 0:te.localStorage.getItem(t)}catch(e){wt.D(e)}return null},F(t){try{return JSON.parse(wt.A(t))||{}}catch{}return null},q(t,e){try{return te==null||te.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){wt.D(n)}return!1},P(t){try{te==null||te.localStorage.removeItem(t)}catch(e){wt.D(e)}}},MO=[Zp,"distinct_id",Jl,n2,Xp,Yp,Es],Mh={},LO={N:()=>!0,D(t){_e.error("memoryStorage error: "+t)},A:t=>Mh[t]||null,F:t=>Mh[t]||null,q:(t,e)=>(Mh[t]=e,!0),P(t){delete Mh[t]}},ba=null,jn={N(){if(!ar(ba))return ba;if(ba=!0,be(te))ba=!1;else try{var t="__support__";jn.q(t,"xyz"),jn.A(t)!=='"xyz"'&&(ba=!1),jn.P(t)}catch{ba=!1}return ba},D(t){_e.error("sessionStorage error: ",t)},A(t){try{return te==null?void 0:te.sessionStorage.getItem(t)}catch(e){jn.D(e)}return null},F(t){try{return JSON.parse(jn.A(t))||null}catch{}return null},q(t,e){try{return te==null||te.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){jn.D(n)}return!1},P(t){try{te==null||te.sessionStorage.removeItem(t)}catch(e){jn.D(e)}}};class OO{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.Ft()?0:this.At}isOptedOut(){return this.Se.cookieless_mode===zi||this.isRejected()||this.consent===-1&&this.Se.cookieless_mode===Da}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Dt.q(this.$t,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Dt.P(this.$t,this.Se.cross_subdomain_cookie)}get $t(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get At(){var e=this.Dt.A(this.$t);return ov(e)?1:Be(VL,e)?0:-1}get Dt(){var e=this.Se.opt_out_capturing_persistence_type,n=e==="localStorage"?wt:ti;if(!this.Nt||this.Nt!==n){this.Nt=n;var r=e==="localStorage"?ti:wt;r.A(this.$t)&&(this.Nt.A(this.$t)||this.optInOut(ov(r.A(this.$t))),r.P(this.$t,this.Se.cross_subdomain_cookie))}return this.Nt}Ft(){return!!this.Se.respect_dnt&&[sr==null?void 0:sr.doNotTrack,sr==null?void 0:sr.msDoNotTrack,$e.doNotTrack].some((e=>ov(e)))}}function o6(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!Ts(r))return e;try{var s=r(e);return _t(s)&&s?s:e}catch(i){return _e.error("Error in get_current_url, falling back to window.location.href",i),e}}var NO=1,DO=3,jO=11;function KS(t){return t instanceof Element&&(t.id===e6||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Go(t){return!!t&&t.nodeType===NO}function Vr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function a6(t){return!!t&&t.nodeType===DO}function l6(t){return!!t&&t.nodeType===jO&&Go(t.host)}function i2(t){return t?Hm(t).split(/\s+/):[]}function ZS(t,e){var n=(function(r){var s,i=te==null||(s=te.location)==null?void 0:s.href;return be(i)?void 0:o6(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function tm(t){var 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 i2(e)}function u6(t){return Ye(t)?null:Hm(t).split(/(\s+)/).filter((e=>fd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Id(t){var e="";return yy(t)&&!h6(t)&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;a6(n)&&n.textContent&&(e+=(r=u6(n.textContent))!==null&&r!==void 0?r:"")})),Hm(e)}function gv(t){return be(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var o2=["a","button","form","input","select","textarea","label"];function vy(t,e){if(be(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var f=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!f&&f.call(u,c)}catch{return!1}})(i,a))))return{v:!0}};for(var s of t)if(n=r(s))return n.v;return!1}function c6(t){var e=t.parentNode;return!(!e||!Go(e))&&e}var FO=[".ph-no-autocapture","[data-ph-no-autocapture]"],d6=["next","previous","prev",">","<"],VO=[...d6,"+","-","−","–"],qS=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,YS=[".ph-no-rageclick",".ph-no-capture"],$O=["","text","search","email","password","url","tel","number"];function XS(t,e){if(!te||a2(t))return!1;var n,r,s,i,a;if(ai(e)?(n=!!e&&YS,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:YS,r=e==null?void 0:e.content_ignorelist,s=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),n===!1||s&&(function(c){return!(!c||!Go(c))&&(!!Vr(c,"textarea")||(Vr(c,"input")?Be($O,(c.getAttribute("type")||"").toLowerCase()):(function(f){if(f.isContentEditable)return!0;var h=f.getAttribute==null?void 0:f.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var{targetElementList:u}=f6(t,!1);return!(function(c,f){if(c===!1||be(c))return!1;var h;if(c===!0)h=d6;else{if(!tt(c))return!1;if(c.length>10)return _e.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;h=c.map((p=>p.toLowerCase()))}return f.some((p=>{var{safeText:v,ariaLabel:y}=p;return h.some((x=>qS(v,x)||qS(y,x)))}))})(r,u.map((c=>{var f;return{safeText:Id(c).toLowerCase(),ariaLabel:((f=c.getAttribute("aria-label"))==null?void 0:f.toLowerCase().trim())||""}})))&&!vy(u,n)}var a2=t=>!t||Vr(t,"html")||!Go(t),f6=(t,e)=>{if(!te||a2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!Vr(s,"body");)if(l6(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=c6(s);if(!i)break;if(e||o2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=te.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function yy(t){for(var e=t;e.parentNode&&!Vr(e,"body");e=e.parentNode){var n=tm(e);if(Be(n,"ph-sensitive")||Be(n,"ph-no-capture"))return!1}if(Be(tm(t),"ph-include"))return!0;var r=t.type||"";if(_t(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=t.name||t.id||"";return!_t(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 h6(t){return!!(Vr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Vr(t,"select")||Vr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var p6="(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})",HO=new RegExp("^(?:"+p6+")$"),zO=new RegExp(p6),m6="\\d{3}-?\\d{2}-?\\d{4}",UO=new RegExp("^("+m6+")$"),BO=new RegExp("("+m6+")");function fd(t,e){return e===void 0&&(e=!0),!(Ye(t)||_t(t)&&(t=Hm(t),(e?HO:zO).test((t||"").replace(/[- ]/g,""))||(e?UO:BO).test(t)))}function QS(t){var e=Id(t);return fd(e=(e+" "+g6(t)).trim())?e:""}function g6(t){var e="";return t&&t.childNodes&&t.childNodes.length&&bt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Id(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+g6(n)).trim())}catch(i){_e.error("[AutoCapture]",i)}})),e}function JS(t){return t.replace(/"|\\"/g,'\\"')}function WO(t){var e=t.attr__class;return e?tt(e)?e:i2(e):void 0}var Lh=Dt("[Dead Clicks]"),GO=()=>!0,KO=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(e2)),r=t.instance.config.capture_dead_clicks;return ai(r)?r:!!Ot(r)||n};class eE{get lazyLoadedDeadClicksAutocapture(){return this.qt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[e2]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bt((()=>{this.jt()})):this.stop()}Bt(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Lh.error("failed to load script",s):e()}))}jt(){var e;if(Ee){if(!this.qt&&(e=$e.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Ot(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.qt=$e.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.qt.start(Ee),Lh.info("starting...")}}else Lh.error("`document` not found. Cannot start.")}stop(){this.qt&&(this.qt.stop(),this.qt=void 0,Lh.info("stopping..."))}}var vv=Dt("[SegmentIntegration]"),v6="posthog-js";function y6(t,e){var{organization:n,projectId:r,prefix:s,severityAllowList:i=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return u=>{var c,f,h,p,v;if(i!=="*"&&!i.includes(u.level)||!t.__loaded)return u;u.tags||(u.tags={});var y=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());u.tags["PostHog Person URL"]=y,t.sessionRecordingStarted()&&(u.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var x,_=((c=u.exception)==null?void 0:c.values)||[],b=_.map((C=>pe({},C,{stacktrace:C.stacktrace?pe({},C.stacktrace,{type:"raw",frames:(C.stacktrace.frames||[]).map((P=>pe({},P,{platform:"web:javascript"})))}):void 0}))),E={$exception_message:((f=_[0])==null?void 0:f.value)||u.message,$exception_type:(h=_[0])==null?void 0:h.type,$exception_level:u.level,$exception_list:b,$sentry_event_id:u.event_id,$sentry_exception:u.exception,$sentry_exception_message:((p=_[0])==null?void 0:p.value)||u.message,$sentry_exception_type:(v=_[0])==null?void 0:v.type,$sentry_tags:u.tags};return n&&r&&(E.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+u.event_id),a&&((x=t.exceptions)==null||x.sendExceptionEvent(E)),u}}class ZO{constructor(e,n,r,s,i,a){this.name=v6,this.setupOnce=function(u){u(y6(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class tE{constructor(e){this.Ht=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(_e.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.Ut=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.zt()}zt(){var e;this.Vt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Ht)}destroy(){var e;(e=this.Vt)==null||e.call(this),this.Vt=void 0}doPageView(e,n){var r,s=this.Wt(e,n);return this.Ut={pathname:(r=te==null?void 0:te.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.Wt(e,(n=this.Ut)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Ut)==null?void 0:e.pageViewId}}Wt(e,n){var r=this.Ut;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:u,maxScrollY:c,maxContentHeight:f,lastContentY:h,maxContentY:p}=i;if(!(be(a)||be(u)||be(c)||be(f)||be(h)||be(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),f=Math.ceil(f),h=Math.ceil(h),p=Math.ceil(p);var v=a>1?si(u/a,0,1,_e):1,y=a>1?si(c/a,0,1,_e):1,x=f>1?si(h/f,0,1,_e):1,_=f>1?si(p/f,0,1,_e):1;s=At(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var Oh=["flags","surveys"],qO={[Z8]:{exposure:"hidden"},[nd]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[rd]:{exposure:"hidden"},[J1]:{exposure:"event"},[ey]:{exposure:"hidden"},[ty]:{exposure:"event"},[ny]:{exposure:"hidden"},[ry]:{exposure:"event"},[sy]:{exposure:"event"},[e2]:{exposure:"event"},[t2]:{exposure:"hidden"},[iy]:{exposure:"event"},[za]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Jl]:{exposure:"hidden"},[n2]:{exposure:"event"},[q8]:{exposure:"event",shouldSkipFromEventProperties:t=>ar(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Va]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!Ot(t))return{};for(var e={},n=Object.keys(t),r=0;n.length>r;r++)e["$feature/"+n[r]]=t[n[r]];return e}},[lp]:{exposure:"event",storageGroup:"flags"},[sd]:{exposure:"hidden"},[oy]:{exposure:"hidden",storageGroup:"flags"},[up]:{exposure:"event",storageGroup:"flags"},[ay]:{exposure:"event",storageGroup:"flags",volatile:!0},[Oi]:{exposure:"event"},[ql]:{exposure:"hidden"},[Oa]:{exposure:"hidden"},[Na]:{exposure:"hidden"},[ly]:{exposure:"hidden",storageGroup:"surveys"},[qp]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[uy]:{exposure:"event"},[id]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[dd]:{exposure:"hidden"},[cy]:{exposure:"hidden"},[dy]:{exposure:"hidden"},[Rd]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Es]:{exposure:"hidden"},[fy]:{exposure:"hidden"},[hy]:{exposure:"hidden"},[py]:{exposure:"hidden"},[my]:{exposure:"hidden"},[Yp]:{exposure:"hidden"},[Xp]:{exposure:"hidden"},[Y8]:{exposure:"event"},[X8]:{exposure:"event"},[Q8]:{exposure:"event"},[J8]:{exposure:"event"},[t6]:{exposure:"event"},[n6]:{exposure:"event"},[r6]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},YO=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Sa=t=>{var e=qO[t];if(e)return e;for(var[n,r]of YO)if(t.indexOf(n)===0)return r},Md=t=>{var e=Ee==null?void 0:Ee.createElement("a");return be(e)?null:(e.href=t,e)},Iu=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===e){n=i;break}}if(!tt(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{_e.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Ld=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],i=(r[0]||"").split("?"),a=i[1],u=i[0],c=(a||"").split("&"),f=[],h=0;c.length>h;h++){var p=c[h].split("=");tt(p)&&(e.includes(p[0])?f.push(p[0]+"="+n):f.push(c[h]))}var v=u;return a!=null&&(v+="?"+f.join("&")),s!=null&&(v+="#"+s),v},nm=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},_6=(t,e)=>t>=e&&m8(),x6=(t,e,n,r)=>{if(t===0){if(m8()){var s=e+1;return s===n&&r(),s}return e}return 0},Nh="https?://(.*)",Mu=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],XO=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Mu],Od="<masked>",QO=["li_fat_id"];function w6(t,e,n){if(!Ee)return{};var r,s=e?[...Mu,...n||[]]:[],i=b6(Ld(Ee.URL,s,Od),t),a=(r={},bt(QO,(function(u){var c=ti.A(u);r[u]=c||null})),r);return At(a,i)}function b6(t,e){var n=XO.concat(e||[]),r={};return bt(n,(function(s){var i=Iu(t,s);r[s]=i||null})),r}function S6(t){var e=(function(i){return i?i.search(Nh+"google.([^/?]*)")===0?"google":i.search(Nh+"bing.com")===0?"bing":i.search(Nh+"yahoo.com")===0?"yahoo":i.search(Nh+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!ar(e)){r.$search_engine=e;var s=Ee?Iu(Ee.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function nE(){return navigator.language||navigator.userLanguage}var rm="$direct";function E6(){return(Ee==null?void 0:Ee.referrer)||rm}function k6(t,e,n){n===void 0&&(n=!1);var r=t?[...Mu,...e||[]]:[],s=n?Wo(on==null?void 0:on.href):on==null?void 0:on.href,i=s==null?void 0:s.substring(0,1e3);return{r:E6().substring(0,1e3),u:i?Ld(i,r,Od):void 0}}function C6(t,e){var n;e===void 0&&(e=!1);var{r,u:s}=t,i=e?Wo(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==rm?rm:(n=Md(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=Md(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=b6(i);At(a,c)}if(r){var f=S6(r);At(a,f)}return a}function P6(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function JO(){try{return new Date().getTimezoneOffset()}catch{return}}var eN={flags:Rd,surveys:qp},tN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Hl="main";class yv{constructor(e,n,r){if(r===void 0&&(r=!0),this.Gt={},this.Zt=!1,this.Qt=!1,this.Se=e,this.Jt=r,this.props={},this.Kt=!1,this.Yt=(i=>{var a="";return i.token&&(a=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+a+"_posthog"})(e),this.Dt=this.Xt(e),this.Qt=this.er(e),this.load(),e.debug&&_e.info("Persistence loaded",e.persistence,pe({},this.props)),this.update_config(e,e,n),this.save(),te){var s=()=>this.flush();$t(te,"beforeunload",s,{capture:!1}),$t(te,"pagehide",s,{capture:!1})}}tr(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return $n(n)&&n>0?n:0}isDisabled(){return!!this.rr}Xt(e){tN.indexOf(e.persistence.toLowerCase())===-1&&(_e.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n,r=(function(a,u){a===void 0&&(a=[]),u===void 0&&(u=!1);var c=[...MO,...a];return pe({},wt,{F(f){try{var h={};try{h=ti.F(f)||{}}catch{}var p,v=JSON.parse(wt.A(f)||"{}");if(u){var y={};for(var x in h){var _=h[x];ar(_)||_===""||(y[x]=_)}p=At(v,y)}else p=At(h,v);return wt.q(f,p),p}catch{}return null},q(f,h,p,v,y,x){var _=wt.q(f,h,void 0,void 0,x);try{var b={};c.forEach((E=>{h[E]&&(b[E]=h[E])})),Object.keys(b).length&&ti.q(f,b,p,v,y,x)}catch(E){wt.D(E)}return _},P(f,h){try{te==null||te.localStorage.removeItem(f),ti.P(f,h)}catch(p){wt.D(p)}}})})(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&wt.N()?(n=wt,s=!0):i==="localstorage+cookie"&&r.N()?(n=r,s=!0):i==="sessionstorage"&&jn.N()?n=jn:i==="memory"?n=LO:i==="cookie"?n=ti:r.N()?(n=r,s=!0):n=ti,this.Zt=s,n}ir(e){return this.Yt+"__"+e}er(e){return this.Zt&&!!e.split_storage}nr(e){var n=e??this.Se.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[Rd];return!r||typeof r!="number"||Date.now()-r>n}properties(){var e={};return bt(this.props,((n,r)=>{var s=Sa(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,r===Va?()=>this.nr():()=>!1))return;s.transformToEventProperties&&At(e,s.transformToEventProperties(n))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n,(()=>!1)))return;e[r]=n}})),e}load(){if(!this.rr){var e=this.Dt.F(this.Yt);e&&(this.props=At({},e)),this.Qt&&this.sr()}}sr(){for(var e of Oh){var n=wt.F(this.ir(e));if(n&&!Do(n)){var r=this.ar(e);r.persisted=!0,this.lr(e)||(r.fingerprint=this.ur(n,e)),this.hr(e,n)||At(this.props,n)}}}lr(e){return Object.keys(this.props).some((n=>{var r;return((r=Sa(n))==null?void 0:r.storageGroup)===e}))}hr(e,n){var r=eN[e];if(!r)return!1;var s=n[r],i=this.props[r];return $n(s)&&$n(i)&&i>s}refreshKey(e){var n;if(!this.rr){var r=this.Qt?(n=Sa(e))==null?void 0:n.storageGroup:void 0,s=r?wt.F(this.ir(r)):this.Dt.F(this.Yt);if(s&&e in s)this.dr(e,s[e]);else{if(r){var i=this.Dt.F(this.Yt);if(i&&e in i)return void this.dr(e,i[e])}this.cr(e)}}}save(){if(!this.rr){var e=this.tr();e>0?be(this.vr)&&(this.vr=setTimeout((()=>{this.vr=void 0,this.pr()}),e)):this.pr()}}flush(){be(this.vr)||(clearTimeout(this.vr),this.vr=void 0,this.pr())}pr(){this.rr||(this.Qt?this.gr():this.mr(this.Dt,this.Yt,this.props,Hl))}gr(){var{main:e,groups:n}=this.yr();for(var r of(this.mr(this.Dt,this.Yt,e,Hl),Oh)){var s,i=n[r];(!Do(i)||(s=this.Gt[r])!=null&&s.persisted)&&this.mr(wt,this.ir(r),i,r)}}yr(){var e={},n={};for(var r of Oh)n[r]={};return bt(this.props,((s,i)=>{var a,u=(a=Sa(i))==null?void 0:a.storageGroup;u?n[u][i]=s:e[i]=s})),{main:e,groups:n}}ur(e,n){if(n===Hl)return JSON.stringify(e)+"|"+this.br+"|"+this._r+"|"+this.wr;var r={};return bt(e,((s,i)=>{var a;r[i]=(a=Sa(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}mr(e,n,r,s){var i=this.ar(s);if(s===Hl||i.dirty||be(i.fingerprint)){var a;try{if((a=this.ur(r,s))===i.fingerprint)return void(i.dirty=!1)}catch{a=void 0}e.q(n,r,this.br,this._r,this.wr,this.Se.debug)?(i.dirty=!1,s!==Hl&&(i.persisted=!0),be(a)||(i.fingerprint=a)):this.Se.debug&&_e.warn('failed to persist storage entry "'+n+'"; will retry on next save')}}remove(e){var{keepGroupEntries:n=!1}=e===void 0?{}:e;if(be(this.vr)||(clearTimeout(this.vr),this.vr=void 0),this.Dt.P(this.Yt,!1),this.Dt.P(this.Yt,!0),!n&&this.Jt)for(var r of Oh)wt.P(this.ir(r));n?delete this.Gt[Hl]:this.Gt={}}clear(){this.remove(),this.props={}}register_once(e,n,r){if(Ot(e)){be(n)&&(n="None"),this.br=be(r)?this.kr:r;var s=!1;if(bt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.dr(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(Ot(e)){this.br=be(n)?this.kr:n;var r=!1;if(bt(e,((s,i)=>{e.hasOwnProperty(i)&&this.props[i]!==s&&(this.dr(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.cr(e),this.save())}update_campaign_params(){if(!this.Kt){var e=w6(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);Do(s2(e))||this.register(e),this.Kt=!0}}update_search_keyword(){var e;this.register((e=Ee==null?void 0:Ee.referrer)?S6(e):{})}update_referrer_info(){var e;this.register_once({$referrer:E6(),$referring_domain:Ee!=null&&Ee.referrer&&((e=Md(Ee.referrer))==null?void 0:e.host)||rm},void 0)}set_initial_person_info(){this.props[py]||this.props[my]||this.register_once({[Yp]:k6(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};bt([my,py],(s=>{var i=this.props[s];i&&bt(i,(function(a,u){e["$initial_"+G1(u)]=a}))}));var n=this.props[Yp];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=C6(s,i),u={};return bt(a,(function(c,f){u["$initial_"+G1(f)]=c})),u})(n,this.Se.disable_capture_url_hashes);At(e,r)}return e}safe_merge(e){return bt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){this.kr=this.br=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==n.persistence||!((c,f)=>{if(c.length!==f.length)return!1;var h=[...c].sort(),p=[...f].sort();return h.every(((v,y)=>v===p[y]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),i=s?this.Xt(e):this.Dt,a=this.er(e);if(s||a!==this.Qt){var u=this.props;this.clear(),this.Dt=i,this.Qt=a,this.props=u,this.save()}}set_disabled(e){this.rr=e,this.rr?this.remove():this.save()}set_cross_subdomain(e){e!==this._r&&(this._r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.wr&&(this.wr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[rd]||{};r[e]=n,this.dr(rd,r),this.save()}remove_event_timer(e){var n=this.props[rd]||{},r=n[e];return be(r)||(delete n[e],this.dr(rd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.dr(e,n),this.save()}dr(e,n){var r;this.props[e]=n,(r=Sa(e))!=null&&r.volatile||this.Sr(e)}cr(e){delete this.props[e],this.Sr(e)}Sr(e){var n,r=(n=Sa(e))==null?void 0:n.storageGroup;r&&(this.ar(r).dirty=!0)}ar(e){return this.Gt[e]||(this.Gt[e]={})}}var Vc={Activation:"events",Cancellation:"cancelEvents"},_v={Popover:"popover",API:"api",Widget:"widget"},nN={Always:"always"},Ui={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},xv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},_y={Popover:"popover",Inline:"inline"},rN={SHOWN:"product tour shown"},rE={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},sE=Dt("[RateLimiter]");class sN{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{sE.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void sE.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,r,s;e===void 0&&(e=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:a}=this,u=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(hy))!==null&&n!==void 0?n:{tokens:i,last:u};c.tokens+=(u-c.last)/1e3*a,c.last=u,c.tokens>i&&(c.tokens=i);var f=1>c.tokens;return f||e||(c.tokens=Math.max(0,c.tokens-1)),!f||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=f,(s=this.instance.persistence)==null||s.set_property(hy,c),{isRateLimited:f,remainingTokens:c.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var $c=Dt("[RemoteConfig]");class T6{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=$e._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Cr(e){var n,r;(n=$e.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Ir(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){e(n.json)}})}load(){try{if(this.remoteConfig)return $c.info("Using preloaded remote config",this.remoteConfig),this.Tr(this.remoteConfig),void this.Mr();if(this._instance.Er())return void $c.warn("Remote config is disabled. Falling back to local config.");this.Cr((e=>{if(!e)return $c.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ir((n=>{this.Tr(n),this.Mr()}));this.Tr(e),this.Mr()}))}catch(e){$c.error("Error loading remote config",e)}}stop(){this.Pr&&(clearInterval(this.Pr),this.Pr=void 0)}refresh(){!this._instance.Er()&&Ee&&Ee.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Mr(){var e;if(!this.Pr){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.Pr=setInterval((()=>{this.refresh()}),n))}}Tr(e){var n;e||$c.error("Failed to fetch remote config from PostHog."),this._instance.Tr(e??{}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var os={GZipJS:"gzip-js",Base64:"base64"},ds=Uint8Array,wr=Uint16Array,Lu=Uint32Array,l2=new ds([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]),u2=new ds([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]),iE=new ds([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A6=function(t,e){for(var n=new wr(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new Lu(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]},R6=A6(l2,2),xy=R6[1];R6[0][28]=258,xy[258]=28;for(var oE=A6(u2,0)[1],I6=new wr(32768),Nt=0;32768>Nt;++Nt){var zl=(43690&Nt)>>>1|(21845&Nt)<<1;I6[Nt]=((65280&(zl=(61680&(zl=(52428&zl)>>>2|(13107&zl)<<2))>>>4|(3855&zl)<<4))>>>8|(255&zl)<<8)>>>1}var hd=function(t,e,n){for(var r=t.length,s=0,i=new wr(e);r>s;++s)++i[t[s]-1];var a,u=new wr(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new wr(r),s=0;r>s;++s)a[s]=I6[u[t[s]-1]++]>>>15-t[s];return a},cl=new ds(288);for(Nt=0;144>Nt;++Nt)cl[Nt]=8;for(Nt=144;256>Nt;++Nt)cl[Nt]=9;for(Nt=256;280>Nt;++Nt)cl[Nt]=7;for(Nt=280;288>Nt;++Nt)cl[Nt]=8;var sm=new ds(32);for(Nt=0;32>Nt;++Nt)sm[Nt]=5;var iN=hd(cl,9),oN=hd(sm,5),M6=function(t){return(t/8>>0)+(7&t&&1)},L6=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof wr?wr:t instanceof Lu?Lu:ds)(n-e);return r.set(t.subarray(e,n)),r},Ci=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},Hc=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},wv=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 ds(0),0];if(s==1){var a=new ds(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(A,O){return A.f-O.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],f=0,h=1,p=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};h!=s-1;)u=n[n[p].f>n[f].f?f++:p++],c=n[f!=h&&n[p].f>n[f].f?f++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var v=i[0].s;for(r=1;s>r;++r)i[r].s>v&&(v=i[r].s);var y=new wr(v+1),x=wy(n[h-1],y,0);if(x>e){r=0;var _=0,b=x-e,E=1<<b;for(i.sort((function(A,O){return y[O.s]-y[A.s]||A.f-O.f}));s>r;++r){var C=i[r].s;if(e>=y[C])break;_+=E-(1<<x-y[C]),y[C]=e}for(_>>>=b;_>0;){var P=i[r].s;e>y[P]?_-=1<<e-y[P]++-1:++r}for(;r>=0&&_;--r){var T=i[r].s;y[T]==e&&(--y[T],++_)}x=e}return[new ds(y),x]},wy=function(t,e,n){return t.s==-1?Math.max(wy(t.l,e,n+1),wy(t.r,e,n+1)):e[t.s]=n},aE=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new wr(++e),r=0,s=t[0],i=1,a=function(c){n[r++]=c},u=1;e>=u;++u)if(t[u]==s&&u!=e)++i;else{if(!s&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(s),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(s);i=1,s=t[u]}return[n.subarray(0,r),e]},zc=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},by=function(t,e,n){var r=n.length,s=M6(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)},lE=function(t,e,n,r,s,i,a,u,c,f,h){Ci(e,h++,n),++s[256];for(var p=wv(s,15),v=p[0],y=p[1],x=wv(i,15),_=x[0],b=x[1],E=aE(v),C=E[0],P=E[1],T=aE(_),A=T[0],O=T[1],M=new wr(19),R=0;C.length>R;++R)M[31&C[R]]++;for(R=0;A.length>R;++R)M[31&A[R]]++;for(var L=wv(M,7),N=L[0],j=L[1],V=19;V>4&&!N[iE[V-1]];--V);var G,Y,K,B,X=f+5<<3,$=zc(s,cl)+zc(i,sm)+a,ee=zc(s,v)+zc(i,_)+a+14+3*V+zc(M,N)+(2*M[16]+3*M[17]+7*M[18]);if($>=X&&ee>=X)return by(e,h,t.subarray(c,c+f));if(Ci(e,h,1+($>ee)),h+=2,$>ee){G=hd(v,y),Y=v,K=hd(_,b),B=_;var H=hd(N,j);for(Ci(e,h,P-257),Ci(e,h+5,O-1),Ci(e,h+10,V-4),h+=14,R=0;V>R;++R)Ci(e,h+3*R,N[iE[R]]);h+=3*V;for(var D=[C,A],q=0;2>q;++q){var re=D[q];for(R=0;re.length>R;++R)Ci(e,h,H[se=31&re[R]]),h+=N[se],se>15&&(Ci(e,h,re[R]>>>5&127),h+=re[R]>>>12)}}else G=iN,Y=cl,K=oN,B=sm;for(R=0;u>R;++R)if(r[R]>255){var se;Hc(e,h,G[257+(se=r[R]>>>18&31)]),h+=Y[se+257],se>7&&(Ci(e,h,r[R]>>>23&31),h+=l2[se]);var oe=31&r[R];Hc(e,h,K[oe]),h+=B[oe],oe>3&&(Hc(e,h,r[R]>>>5&8191),h+=u2[oe])}else Hc(e,h,G[r[R]]),h+=Y[r[R]];return Hc(e,h,G[256]),h+Y[256]},aN=new Lu([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lN=(function(){for(var t=new Lu(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),bv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function uN(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(v){for(var y=p,x=0;v.length>x;++x)y=lN[255&y^v[x]]^y>>>8;p=y},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,f=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,v,y,x,_,b){var E=p.length,C=new ds(x+E+5*(1+Math.floor(E/7e3))+_),P=C.subarray(x,C.length-_),T=0;if(!v||8>E)for(var A=0;E>=A;A+=65535){var O=A+65535;E>O?T=by(P,T,p.subarray(A,O)):(P[A]=!0,T=by(P,T,p.subarray(A,E)))}else{for(var M=aN[v-1],R=M>>>13,L=8191&M,N=(1<<y)-1,j=new wr(32768),V=new wr(N+1),G=Math.ceil(y/3),Y=2*G,K=function(vt){return(p[vt]^p[vt+1]<<G^p[vt+2]<<Y)&N},B=new Lu(25e3),X=new wr(288),$=new wr(32),ee=0,H=0,D=(A=0,0),q=0,re=0;E>A;++A){var se=K(A),oe=32767&A,ue=V[se];if(j[oe]=ue,V[se]=oe,A>=q){var de=E-A;if((ee>7e3||D>24576)&&de>423){T=lE(p,P,0,B,X,$,H,D,re,A-re,T),D=ee=H=0,re=A;for(var ie=0;286>ie;++ie)X[ie]=0;for(ie=0;30>ie;++ie)$[ie]=0}var ae=2,me=0,Se=L,Re=oe-ue&32767;if(de>2&&se==K(A-Re))for(var Ke=Math.min(R,de)-1,it=Math.min(32767,A),Oe=Math.min(258,de);it>=Re&&--Se&&oe!=ue;){if(p[A+ae]==p[A+ae-Re]){for(var at=0;Oe>at&&p[A+at]==p[A+at-Re];++at);if(at>ae){if(ae=at,me=Re,at>Ke)break;var It=Math.min(Re,at-2),mt=0;for(ie=0;It>ie;++ie){var je=A-Re+ie+32768&32767,Qe=je-j[je]+32768&32767;Qe>mt&&(mt=Qe,ue=je)}}}Re+=(oe=ue)-(ue=j[oe])+32768&32767}if(me){B[D++]=268435456|xy[ae]<<18|oE[me];var lt=31&xy[ae],Je=31&oE[me];H+=l2[lt]+u2[Je],++X[257+lt],++$[Je],q=A+ae,++ee}else B[D++]=p[A],++X[p[A]]}}T=lE(p,P,!0,B,X,$,H,D,re,A-re,T)}return L6(C,0,x+M6(T)+_)})(i=t,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,u,c)),h=f.length;return(function(p,v){var y=v.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>v.level?4:v.level==9?2:0,p[9]=3,v.mtime!=0&&bv(p,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),y){p[3]=8;for(var x=0;y.length>=x;++x)p[x+10]=y.charCodeAt(x)}})(f,e),bv(f,h-8,n.d()),bv(f,h-4,r),f}var cN=!!U1||!!z1,O6="text/plain",dp=!1,Sy=(t,e)=>{var[n,r]=t.split("#"),[s,i]=n.split("?");if(!i)return t;var a=i.split("&").filter((u=>u.split("=")[0]!==e)).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},N6=function(t,e,n){var r;n===void 0&&(n=!0);var[s,i]=t.split("?"),a=pe({},e),u=(r=i==null?void 0:i.split("&").map((f=>{var h,[p,v]=f.split("="),y=n&&(h=a[p])!==null&&h!==void 0?h:v;return delete a[p],p+"="+y})))!==null&&r!==void 0?r:[],c=(function(f,h){var p,v;h===void 0&&(h="&");var y=[];return bt(f,(function(x,_){be(x)||be(_)||_==="undefined"||(p=encodeURIComponent((b=>b instanceof File)(x)?x.name:x.toString()),v=encodeURIComponent(_),y[y.length]=v+"="+p)})),y.join(h)})(a);return c&&u.push(c),s+"?"+u.join("&")},eu=(t,e)=>JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e),uE=t=>{if(t.Lt)return t.Lt;var{data:e,compression:n}=t;if(e){if(n===os.GZipJS){var r=uN((function(u,c){var f=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new ds(u.length+(u.length>>>1)),p=0,v=function(b){h[p++]=b},y=0;f>y;++y){if(p+5>h.length){var x=new ds(p+8+(f-y<<1));x.set(h),h=x}var _=u.charCodeAt(y);128>_?v(_):2048>_?(v(192|_>>>6),v(128|63&_)):_>55295&&57344>_?(v(240|(_=65536+(1047552&_)|1023&u.charCodeAt(++y))>>>18),v(128|_>>>12&63),v(128|_>>>6&63),v(128|63&_)):(v(224|_>>>12),v(128|_>>>6&63),v(128|63&_))}return L6(h,0,p)})(eu(e)),{mtime:0});return{contentType:O6,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===os.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,f)=>String.fromCharCode(parseInt(f,16)))))})(eu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:eu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=eu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},D6=t=>{var e,n,r=()=>({url:Sy(t.url,"compression"),encodedBody:uE(pe({},t,{compression:void 0,Lt:void 0}))});try{e=uE(t)}catch(s){if(LS(t.compression,Iu(t.url,"compression")))return _e.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&LS(t.compression,Iu(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?B1(new Uint8Array(n)):ArrayBuffer.isView(n)&&B1(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(dp=!0,r()):{url:t.url,encodedBody:e}},cE=t=>{try{return D6(t)}catch(e){return _e.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},dN=(function(){var t=en((function*(e){var n=eu(e.data),r=yield(function(i,a,u){return W1.apply(this,arguments)})(n,Vt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return pe({},e,{Lt:{contentType:O6,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),fN=["/e/","/s/"],dE=(t,e)=>{var n=(s=>{var i=(a=>{var u=Md(a),c=(u==null?void 0:u.pathname)||a.split(/[?#]/)[0];return c?c[0]==="/"?c:"/"+c:"/"})(s);return fN.some((a=>((u,c)=>u.slice(u.length-c.length)===c)(i,a)))})(t),r=n?Sy(t,"ver"):t;return N6(e===os.GZipJS?Sy(r,"compression"):r,pe({_:new Date().getTime().toString()},n?{}:{ver:Vt.JS_SDK_VERSION},e===os.GZipJS?{}:{compression:e}))},fp=[];z1&&fp.push({transport:"fetch",method(t){var e,n=cE(t);if(n){var{url:r,encodedBody:s}=n,{contentType:i,body:a,estimatedSize:u}=s??{},c=new Headers;bt(t.headers,(function(v,y){c.append(y,v)})),i&&c.append("Content-Type",i);var f=null,h=!1;if(CS){var p=new CS;f={signal:p.signal,timeout:setTimeout((()=>{var v,y;h=!0,p.abort((v=t.timeout,(y=new Error("PostHog request timed out"+(v?" after "+v+"ms":""))).name="AbortError",y))}),t.timeout)}}z1(r,pe({method:(t==null?void 0:t.method)||"GET",headers:c,keepalive:t.method==="POST"&&52428.8>(u||0),body:a,signal:(e=f)==null?void 0:e.signal},t.fetchOptions)).then((v=>v.text().then((y=>{var x={statusCode:v.status,text:y};if(v.status===200)try{x.json=JSON.parse(y)}catch(_){_e.error(_)}t.callback==null||t.callback(x)})))).catch((v=>{h&&(v==null?void 0:v.name)==="AbortError"?_e.warn(v):_e.error(v),t.callback==null||t.callback({statusCode:0,error:v})})).finally((()=>f?clearTimeout(f.timeout):null))}}}),U1&&fp.push({transport:"XHR",method(t){var e=cE(t);if(e){var n=new U1,{url:r,encodedBody:s}=e;n.open(t.method||"GET",r,!0);var{contentType:i,body:a}=s??{};bt(t.headers,(function(u,c){n.setRequestHeader(c,u)})),i&&n.setRequestHeader("Content-Type",i),t.timeout&&(n.timeout=t.timeout),n.onreadystatechange=()=>{if(n.readyState===4){var u={statusCode:n.status,text:n.responseText};if(n.status===200)try{u.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(u)}},n.send(a)}}}),sr!=null&&sr.sendBeacon&&fp.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:n}=D6(t),{contentType:r,body:s}=n??{};if(!s)return;var i=s instanceof Blob?s:new Blob([s],{type:r});sr.sendBeacon(e,i)}catch{}}});var Ey=3e3;class hN{constructor(e,n){this.Rr=!0,this.Or=[],this.Lr=si((n==null?void 0:n.flush_interval_ms)||Ey,250,5e3,_e.createLogger("flush interval"),Ey),this.Fr=e}enqueue(e){this.Or.push(e),this.Ar||this.Dr()}unload(){this.$r();var e=this.Or.length>0?this.Nr():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.qr(pe({},r,{transport:"sendBeacon"}))}))}enable(){this.Rr=!1,this.Dr()}Dr(){var e=this;this.Rr||(this.Ar=setTimeout((()=>{if(this.$r(),this.Or.length>0){var n=this.Nr(),r=function(){var i=n[s],a=new Date().getTime();i.data&&tt(i.data)&&bt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.qr(i)};for(var s in n)r()}}),this.Lr))}qr(e){try{this.Fr(e)}catch(n){_e.error(n)}}$r(){clearTimeout(this.Ar),this.Ar=void 0}Nr(){var e={};return bt(this.Or,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;be(e[i])&&(e[i]=pe({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.Or=[],e}}var pN=["retriesPerformedSoFar"];class mN{constructor(e){this.Br=!1,this.jr=3e3,this.Or=[],this._instance=e,this.Or=[],this.Hr=!0,!be(te)&&"onLine"in te.navigator&&(this.Hr=te.navigator.onLine,this.Ur=()=>{this.Hr=!0,this.zr()},this.Vr=()=>{this.Hr=!1},$t(te,"online",this.Ur),$t(te,"offline",this.Vr))}get length(){return this.Or.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=g8(e,pN);Li(n)&&(r.url=N6(r.url,{retry_count:n})),this._instance._send_request(pe({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.st(pe({retriesPerformedSoFar:n},r));s.statusCode===0&&_e.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.")}r.callback==null||r.callback(s)}}))}st(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var u=3e3*Math.pow(2,a),c=u/2,f=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(f+h*(f-c))})(n),s=Date.now()+r;this.Or.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),_e.warn(i),this.Br||(this.Br=!0,this.Wr())}Wr(){if(this.Gr&&clearTimeout(this.Gr),this.Or.length===0)return this.Br=!1,void(this.Gr=void 0);this.Gr=setTimeout((()=>{this.Hr&&this.Or.length>0&&this.zr(),this.Wr()}),this.jr)}zr(){var e=Date.now(),n=[],r=this.Or.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.Or=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Gr&&(clearTimeout(this.Gr),this.Gr=void 0),this.Br=!1,be(te)||(this.Ur&&(te.removeEventListener("online",this.Ur),this.Ur=void 0),this.Vr&&(te.removeEventListener("offline",this.Vr),this.Vr=void 0)),this.Or))try{this._instance._send_request(pe({},e,{transport:"sendBeacon"}))}catch(n){_e.error(n)}this.Or=[]}}class gN{constructor(e){this.Zr=()=>{var n,r,s,i;this.Qr||(this.Qr={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,f=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this.Qr.lastScrollY=Math.ceil(u),this.Qr.maxScrollY=Math.max(u,(n=this.Qr.maxScrollY)!==null&&n!==void 0?n:0),this.Qr.maxScrollHeight=Math.max(c,(r=this.Qr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Qr.lastContentY=f,this.Qr.maxContentY=Math.max(f,(s=this.Qr.maxContentY)!==null&&s!==void 0?s:0),this.Qr.maxContentHeight=Math.max(h,(i=this.Qr.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get Jr(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Zr,0),e}startMeasuringScrollPosition(){$t(te,"scroll",this.Zr,{capture:!0}),$t(te,"scrollend",this.Zr,{capture:!0}),$t(te,"resize",this.Zr)}scrollElement(){if(!this.Jr)return te==null?void 0:te.document.documentElement;var e=tt(this.Jr)?this.Jr:[this.Jr];for(var n of e){var r=te==null?void 0:te.document.querySelector(n);if(r)return r}}Kr(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.Jr){var r=this.scrollElement();return r&&r[n]||0}return te?e==="y"?te.scrollY||te.pageYOffset||te.document.documentElement.scrollTop||0:te.scrollX||te.pageXOffset||te.document.documentElement.scrollLeft||0:0}scrollY(){return this.Kr("y")}scrollX(){return this.Kr("x")}}var vN=t=>k6(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);class fE{constructor(e,n,r,s){this.Yr=i=>{var a=this.Xr();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.ei(this._instance)};this.ti.register({[fy]:u})}},this._instance=e,this.ri=n,this.ti=r,this.ei=s||vN,this.ri.onSessionId(this.Yr)}Xr(){return this.ti.props[fy]}getSetOnceProps(){var e,n=(e=this.Xr())==null?void 0:e.props;return n?"r"in n?C6(n,this._instance.config.disable_capture_url_hashes):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return bt(s2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+G1(r)]=n})),e}}class c2{constructor(){this.ii={}}on(e,n){return this.ii[e]||(this.ii[e]=[]),this.ii[e].push(n),()=>{this.ii[e]=this.ii[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.ii[e]||[])r(n);for(var s of this.ii["*"]||[])s(e,n)}}var Uc=Dt("[SessionId]");class hE{on(e,n){return this.ni.on(e,n)}constructor(e,n,r){var s;if(this.si=null,this.oi=[],this.ai=void 0,this.li=!1,this.ni=new c2,this.ui=(f,h)=>!(!Li(f)||!Li(h))&&Math.abs(f-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===zi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.ti=e.persistence,this.hi=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ci=n||Fi,this.vi=r||Fi;var i=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*si(this.Se.session_idle_timeout_seconds||1800,60,36e3,Uc.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.fi(),this.pi="ph_"+i+"_window_id",this.gi="ph_"+i+"_primary_window_exists",this.mi()){var a=jn.F(this.pi),u=jn.F(this.gi);a&&!u?this.hi=a:jn.P(this.pi),jn.q(this.gi,!0)}if((s=this.Se.bootstrap)!=null&&s.sessionID)try{var c=(f=>{var h=this.Se.bootstrap.sessionID.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})();this.yi(this.Se.bootstrap.sessionID,new Date().getTime(),c)}catch(f){Uc.error("Invalid sessionID in bootstrap",f)}this.bi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return be(this.oi)&&(this.oi=[]),this.oi.push(e),this.di&&e(this.di,this.hi),()=>{this.oi=this.oi.filter((n=>n!==e))}}mi(){return this.Se.persistence!=="memory"&&!this.ti.rr&&jn.N()}wi(e){e!==this.hi&&(this.hi=e,this.mi()&&jn.q(this.pi,e))}xi(){return this.hi?this.hi:this.mi()?jn.F(this.pi):null}ki(e){var n=this.si;return!ar(n)&&!ar(e)&&5e3>Math.abs(e-n)}yi(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this.di||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.di=e,i&&!s||i&&this.ki(n)||(this.si=n,this.ti.register({[Jl]:[n,e,r]}))}Si(){var e,n=(e=this.Se)==null?void 0:e.persistence_save_debounce_ms;return Li(n)&&n>0}Ci(){this.Si()?this.ti.refreshKey(Jl):(this.ti.flush(),this.ti.load())}Ii(){var e;if(!ar(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.si){this.Ci();var[,n,r]=this.Ti();n===this.di&&r===this._sessionStartTimestamp&&(this.si=this._sessionActivityTimestamp,this.ti.register({[Jl]:[this._sessionActivityTimestamp,(e=this.di)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.ti.flush())}}Mi(){var[e]=this.Ti(),n=Li(e)?e:0,r=Li(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Ei(e){return this.Ci(),this.ui(e,this.Mi())}Ti(){var e=this.ti.props[Jl];return tt(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.si=null,clearTimeout(this.Pi),this.Pi=void 0,this.yi(null,null,null)}destroy(){this.li=!0,this.Ii(),clearTimeout(this.Pi),this.Pi=void 0,this.ai&&te&&(te.removeEventListener(Jp,this.ai,{capture:!1}),this.ai=void 0),this.oi=[]}bi(){this.ai=()=>{this.Ii(),this.mi()&&jn.P(this.gi)},$t(te,Jp,this.ai,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.Se.cookieless_mode===zi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[,s,i]=this.Ti(),a=this.Mi(),u=this.xi(),c=Li(i)&&Math.abs(r-i)>864e5,f=!1,h=!1,p=!s,v=s,y=!p&&!e&&this.ui(r,a);y&&((y=this.Ei(r))||Uc.info("cross-tab refresh kept the session alive",{sessionId:s}),[,s,i]=this.Ti()),p||y||c?(s=this.ci(),u=this.vi(),Uc.info("new session ID generated",{sessionId:s,windowId:u,changeReason:{noSessionId:p,activityTimeout:y,sessionPastMaximumLength:c}}),i=r,f=!0):(u||(u=this.vi(),f=!0),(h=s!==v)&&(Uc.info("adopted cross-tab session id",{sessionId:s,windowId:u}),f=!0));var x=Li(a)&&e&&!c?a:r,_=Li(i)?i:new Date().getTime();this.wi(u),this.yi(s,x,_),e||this.fi();var b={noSessionId:p,activityTimeout:y,sessionPastMaximumLength:c,crossTabAdoption:h};return f&&this.oi.forEach((E=>E(s,u,b))),{sessionId:s,windowId:u,sessionStartTimestamp:_,changeReason:f?b:void 0,lastActivityTimestamp:a}}fi(){this.li||(clearTimeout(this.Pi),this.Pi=setTimeout((()=>{if(!this.li)if(this.Ei(new Date().getTime())){var e=this.di;this.resetSessionId(),this.ni.emit("forcedIdleReset",{idleSessionId:e})}else this.fi()}),1.1*this.sessionTimeoutMs))}}var j6=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&NS(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>NS(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function F6(){return(F6=en((function*(){var t=sr==null?void 0:sr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return _t(n)&&n.length>0?n:void 0}catch(r){return void _e.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var im=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function pE(t,e,n){return eu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var V6={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=>im(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!im(n,r))))),icontains:(t,e)=>e.map(Dh).some((n=>t.map(Dh).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(Dh).every((n=>t.map(Dh).every((r=>!n.includes(r))))),gt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r>parseFloat(s)))})),lt:(t,e)=>e.some((n=>{var r=parseFloat(n);return!isNaN(r)&&t.some((s=>r<parseFloat(s)))}))},Dh=t=>t.toLowerCase();function $6(t,e){return!t||Object.entries(t).every((n=>{var[r,s]=n,i=e==null?void 0:e[r];if(be(i)||ar(i))return!1;var a=[String(i)],u=V6[s.operator];return!!u&&u(s.values,a)}))}var ky="custom",mE="i.posthog.com",yN=/^\/static\//;class _N{constructor(e){this.Ri={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+mE,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Ri[this.apiHost]||(this.Ri[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":ky),this.Ri[this.apiHost]}Oi(e){if(yN.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(e==="assets"){var r=this.Oi(n);if(r)return""+r+n}if(this.region===ky)return this.apiHost+n;var s=mE+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var yt=Dt("[Surveys]"),Cy="seenSurvey_",H6=t=>{try{var e=(n=>((r,s)=>{var i=""+Cy+s.id;return s.current_iteration&&s.current_iteration>0&&(i=""+Cy+s.id+"_"+s.current_iteration),i})(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){yt.error("Failed to persist survey seen state",n)}},xN=[_v.Popover,_v.Widget,_v.API],wN={ignoreConditions:!1,ignoreDelay:!1,displayType:_y.Popover},bN=Dt("[PostHog ExternalIntegrations]"),SN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class EN{constructor(e){this._instance=e}Bt(e,n){var r;(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return bN.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(a){var u,c,f;!s||(u=$e.__PosthogExtensions__)!=null&&(u=u.integrations)!=null&&u[a]||e.Bt(SN[a],(()=>{var h;(h=$e.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[a])==null||h.start(e._instance)})),!s&&(c=$e.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[a]&&((f=$e.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[a])==null||f.stop())};for(var[r,s]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var pd={},Sv=0,om=()=>{},gE='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Bc="Surveys module not available",vE="sanitize_properties is deprecated. Use before_send instead",z6="Invalid value for property_denylist config: ",Xl="posthog",U6=!cN&&(vr==null?void 0:vr.indexOf("MSIE"))===-1&&(vr==null?void 0:vr.indexOf("Mozilla"))===-1,yE=t=>{var e;return pe({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:PO(Ee==null?void 0:Ee.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:om,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&&_t(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,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(te==null||(e=te.location)==null?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,surveys_request_timeout_ms:1e4,on_request_error(n){_e.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:gy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Ey},error_tracking:{},_onCapture:om},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:VO,ignore_text_selection:!0}:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:n&&n>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},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)}))(t))},kN=[["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"]],_E=t=>{var e={};for(var[n,r]of kN)be(t[n])||(e[r]=t[n]);var s=At({},e,t),i=t.__preview_external_dependency_versioned_paths;return be(i)||(be(t.strict_script_versioning)&&(s.strict_script_versioning=!!i),_t(i)&&be(t.asset_host)&&(s.asset_host=i)),tt(t.property_blacklist)&&(be(t.property_denylist)?s.property_denylist=t.property_blacklist:tt(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:_e.error(z6+t.property_denylist)),s};class CN{constructor(){this.__forceAllowLocalhost=!1}get Li(){return this.__forceAllowLocalhost}set Li(e){_e.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class as{Fi(e,n){if(e){var r=this.Ai.indexOf(e);r!==-1&&this.Ai.splice(r,1)}return this.Ai.push(n),n.initialize==null||n.initialize(),n}Di(){return this.config.cookieless_mode===zi||this.config.cookieless_mode===Da&&this.consent.isRejected()}get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new CN,this.$i=!1,this.version=Vt.LIB_VERSION,this.Ni=new c2,this.Ai=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=yE(),this.SentryIntegration=ZO,this.sentryIntegration=r=>(function(s,i){var a=y6(s,i);return{name:v6,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.qi=!1,this.Bi=null,this.ji=null,this.Hi=null,this.scrollManager=new gN(this),this.pageViewManager=new tE(this),this.rateLimiter=new sN(this),this.requestRouter=new _N(this),this.consent=new OO(this),this.externalIntegrations=new EN(this);var n=(e=as.__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)=>{var a=_t(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=_t(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>_e.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==Xl){var s,i=(s=pd[r])!==null&&s!==void 0?s:new as;return i._init(e,n,r),pd[r]=i,pd[Xl][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a=_t(e)?e.trim():"";if(!a)return _e.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Ui(n.debug),this.zi=n,this.Vi=[],n.person_profiles?this.ji=n.person_profiles:n.process_person&&(this.ji=n.process_person);var u=yE(n.defaults),c=_E(n),f=At({},u,c,{name:r,token:a});Ot(u.rageclick)&&Ot(c.rageclick)&&(f.rageclick=At({},u.rageclick,c.rageclick)),Ot(u.session_recording)&&Ot(c.session_recording)&&(f.session_recording=At({},u.session_recording,c.session_recording)),this.set_config(f),this.config.on_xhr_error&&_e.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:os.GZipJS;var h=this.Wi();this.persistence=new yv(this.config,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new yv(pe({},this.config,{persistence:"sessionStorage"}),h,!1);var p=pe({},this.persistence.props),v=pe({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Gi=new hN((T=>this.Zi(T)),this.config.request_queue_config),this.Qi=new mN(this),this.__request_queue=[];var y=this.Di();if(y||(this.sessionManager=new hE(this),this.sessionPropsManager=new fE(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(_e.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ji(y)}),0)):(_e.info("Initializing extensions synchronously"),this.Ji(y)),Vt.DEBUG=Vt.DEBUG||this.config.debug,Vt.DEBUG&&_e.info("Starting in debug mode",{this:this,config:n,thisC:pe({},this.config),p,s:v}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=pe({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var x=n.bootstrap.distinctID,_=this.get_distinct_id(),b=this.persistence.get_property(Es);if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&b===Vl)this.identify(x);else if(n.bootstrap.isIdentifiedID&&_!=null&&_!==x&&b===$l)_e.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{var E=this.config.get_device_id(Fi()),C=n.bootstrap.isIdentifiedID?E:x;this.persistence.set_property(Es,n.bootstrap.isIdentifiedID?$l:Vl),this.register({distinct_id:x,$device_id:C})}}if(y)this.register_once({distinct_id:Rh,$device_id:null},"");else if(!this.get_distinct_id()){var P=this.config.get_device_id(Fi());this.register_once({distinct_id:P,$device_id:P},""),this.persistence.set_property(Es,Vl)}return $t(te,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(T,A){var O=T.config.segment;if(!O)return A();(function(M,R){var L=M.config.segment;if(!L)return R();var N=V=>{var G=()=>V.anonymousId()||Fi();M.config.get_device_id=G,V.id()&&(M.register({distinct_id:V.id(),$device_id:G()}),M.persistence.set_property(Es,$l)),R()},j=L.user();"then"in j&&Ts(j.then)?j.then(N):N(j)})(T,(()=>{O.register((M=>{typeof Promise<"u"&&Promise.resolve||vv.warn("This browser does not have Promise support, and can not use the segment integration");var R=(L,N)=>{if(!N)return L;L.event.userId||L.event.anonymousId===M.get_distinct_id()||(vv.info("No userId set, resetting PostHog"),M.reset()),L.event.userId&&L.event.userId!==M.get_distinct_id()&&(vv.info("UserId set, identifying with PostHog"),M.identify(L.event.userId));var j=M.calculateEventProperties(N,L.event.properties);return L.event.properties=Object.assign({},j,L.event.properties),L};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:L=>R(L,L.event.event),page:L=>R(L,Yl),identify:L=>R(L,pv),screen:L=>R(L,"$screen")}})(T)).then((()=>{A()}))}))})(this,(()=>this.Ki())):this.Ki(),Ts(this.config._onCapture)&&this.config._onCapture!==om&&(_e.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(T=>this.config._onCapture(T.event,T)))),this.config.ip&&_e.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 F6.apply(this,arguments)})().then((T=>{T&&this.register({[fv]:T})})).catch(om),this}Ji(e){var n,r,s,i,a,u,c,f,h=performance.now(),p=pe({},as.__defaultExtensionClasses,this.config.__extensionClasses),v=[];p.featureFlags&&this.Ai.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new p.featureFlags(this)),p.exceptions&&this.Ai.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new p.exceptions(this)),p.historyAutocapture&&this.Ai.push(this.historyAutocapture=new p.historyAutocapture(this)),p.tracingHeaders&&this.Ai.push(this.tracingHeaders=new p.tracingHeaders(this)),p.siteApps&&this.Ai.push(this.siteApps=new p.siteApps(this)),p.sessionRecording&&!e&&this.Ai.push(this.sessionRecording=new p.sessionRecording(this)),this.config.disable_scroll_properties||v.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),p.autocapture&&this.Ai.push(this.autocapture=new p.autocapture(this)),p.surveys&&this.Ai.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new p.surveys(this)),p.logs&&this.Ai.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new p.logs(this)),p.metrics&&this.Ai.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new p.metrics(this)),p.conversations&&this.Ai.push(this.conversations=(u=this.conversations)!==null&&u!==void 0?u:new p.conversations(this)),p.productTours&&this.Ai.push(this.productTours=new p.productTours(this)),p.heatmaps&&this.Ai.push(this.heatmaps=new p.heatmaps(this)),p.webVitalsAutocapture&&this.Ai.push(this.webVitalsAutocapture=new p.webVitalsAutocapture(this)),p.exceptionObserver&&this.Ai.push(this.exceptionObserver=new p.exceptionObserver(this)),p.deadClicksAutocapture&&this.Ai.push(this.deadClicksAutocapture=new p.deadClicksAutocapture(this,KO)),p.toolbar&&this.Ai.push(this.toolbar=(c=this.toolbar)!==null&&c!==void 0?c:new p.toolbar(this)),p.experiments&&this.Ai.push(this.experiments=(f=this.experiments)!==null&&f!==void 0?f:new p.experiments(this)),this.Ai.forEach((y=>{y.initialize&&v.push((()=>{y.initialize==null||y.initialize()}))})),v.push((()=>{if(this.Yi){var y=this.Yi;this.Yi=void 0,this.Tr(y)}})),this.Xi(v,h)}Xi(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Xi(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){_e.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[t6]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[n6]:s}),this.config.__preview_deferred_init_extensions&&_e.info("PostHog extensions initialized ("+s+"ms)")}Tr(e){var n;if(!Ee||!Ee.body)return _e.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Tr(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.en=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Be(e.supportedCompression,os.GZipJS)?os.GZipJS:Be(e.supportedCompression,os.Base64)?os.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ji?this.ji:gy}),this.Ai.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(e)))}Ki(){try{this.config.loaded(this)}catch(r){_e.critical("`loaded` function failed",r)}if(this.tn(),this.config.internal_or_test_user_hostname&&on!=null&&on.hostname){var 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.Di())&&this.rn()}),1),this.nn=new T6(this),this.nn.load()}tn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Gi)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Ih(this.__request_queue,(e=>this.Zi(e))),this.__request_queue=[],this.tn()}_handle_unload(){var e,n,r,s,i;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(n=this.metrics)==null||n.flush("sendBeacon"),this.config.request_batching?(this.sn()&&this.capture(hv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.Gi)==null||s.unload(),(i=this.Qi)==null||i.unload()):this.sn()&&this.capture(hv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?U6?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=pe({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(be(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,a=pe({},n);a.timeout=a.timeout||6e4,a.url=dE(a.url,a.compression);var u=(r=a.transport)!==null&&r!==void 0?r:"fetch",c=fp.filter((h=>!a.disableTransport||!h.transport||!a.disableTransport.includes(h.transport))),f=(s=(i=(function(h,p){for(var v=0;h.length>v;v++)if(h[v].transport===u)return h[v]})(c))==null?void 0:i.method)!==null&&s!==void 0?s:c[0].method;if(!f)throw new Error("No available transport method");u!=="sendBeacon"&&a.data&&a.compression===os.GZipJS&&RL&&typeof Promise<"u"&&!dp?dN(a).then((h=>{f(h)})).catch((h=>{if(OS(h))return dp=!0,void f(pe({},a,{compression:void 0,url:dE(n.url,void 0)}));(p=>{if(!p||typeof p!="object")return!1;var v="name"in p?String(p.name):"";return OS(p)||v===v8})(h)&&(dp=!0),f(a)})):f(a)})(pe({},e,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),e.callback==null||e.callback(n)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}Zi(e){this.Qi?this.Qi.retriableRequest(e):this._send_request(e)}_execute_array(e){Sv++;try{var n,r=[],s=[],i=[];Ih(e,(u=>{if(u)if(tt(n=u[0]))i.push(u);else if(Ts(u))try{u.call(this)}catch(c){_e.error("Error executing queued PostHog call",u,c)}else tt(u)&&n==="alias"?r.push(u):tt(u)&&n.indexOf("capture")!==-1&&Ts(this[n])?i.push(u):s.push(u)}));var a=function(u,c){Ih(u,(function(f){try{if(tt(f[0])){var h=c;bt(f,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[f[0]].apply(c,f.slice(1))}catch(p){_e.error("Error executing queued PostHog call",f,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Sv--}}push(e){if(Sv>0&&tt(e)&&_t(e[0])){var n=as.prototype[e[0]];Ts(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,r){var s,i,a,u,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Gi){if(this.is_capturing())if(!be(e)&&_t(e)){var f=!this.config.opt_out_useragent_filter&&this._is_bot();if(!f||this.config.__preview_capture_bot_pageviews){var h=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){n!=null&&n.$current_url&&!_t(n==null?void 0:n.$current_url)&&(_e.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.an||_e.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&&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();var p=new Date,v=(r==null?void 0:r.timestamp)||p,y=VS(r==null?void 0:r.uuid,Fi),x={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},v,y)};e===Yl&&this.config.__preview_capture_bot_pageviews&&f&&(x.event="$bot_pageview",x.properties.$browser_type="bot"),h&&(x.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),r!=null&&r.$set&&(x.$set=r==null?void 0:r.$set);var _=r==null?void 0:r.$unset;_&&(x.$unset=_);var b,E,C,P=this.ln(r==null?void 0:r.$set_once,e!==BS,e===pv);if(P&&(x.$set_once=P),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=x,u=N=>_t(N)?N.slice(0,i):N,c=new Set,x=(function N(j,V){return j!==Object(j)?u?u(j):j:c.has(j)?void 0:(c.add(j),tt(j)?(G=[],Ih(j,(Y=>{G.push(N(Y))}))):(G={},bt(j,((Y,K)=>{c.has(Y)||(G[K]=N(Y))}))),G);var G})(a)),x.timestamp=v,be(r==null?void 0:r.timestamp)||(x.properties.$event_time_override_provided=!0,x.properties.$event_time_override_system_time=p),e===Ui.DISMISSED||e===Ui.SENT){var T=n==null?void 0:n[xv.SURVEY_ID],A=n==null?void 0:n[xv.SURVEY_ITERATION];H6({id:T,current_iteration:A}),x.$set=pe({},x.$set,{[(b={id:T,current_iteration:A},E=e===Ui.SENT?"responded":"dismissed",C="$survey_"+E+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(C="$survey_"+E+"/"+b.id+"/"+b.current_iteration),C)]:!0})}else e===Ui.SHOWN&&(x.$set=pe({},x.$set,{[xv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===rN.SHOWN){var O=n==null?void 0:n[rE.TOUR_TYPE];O&&(x.$set=pe({},x.$set,{[rE.TOUR_LAST_SEEN_DATE+"/"+O]:new Date().toISOString()}))}var M=pe({},x.properties.$set,x.$set);if(Do(M)||this.setPersonPropertiesForFlags(M),!Ye(this.config.before_send)){var R=this.it(x);if(!R)return;(x=R).uuid=VS(x.uuid,Fi)}this.Ni.emit("eventCaptured",x);var L={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:x,compression:"best-available",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Zi(L):this.Gi.enqueue(L),x}_e.critical("This capture call is ignored due to client rate limiting.")}}else _e.error("No event name provided to posthog.capture")}else _e.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),u=pe({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Di()&&(u.$cookieless_mode=!0),e==="$snapshot"){var c=pe({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!_t(u.distinct_id)&&!$n(u.distinct_id)||K1(u.distinct_id))&&_e.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var f,h=(function(E,C,P,T){var A,O,M,R;if(T===void 0&&(T=!1),!vr)return{};var L,N,j,V,G,Y,K,B,X,$=E?[...Mu,...C||[]]:[],[ee,H]=(function(se){for(var oe=0;jS.length>oe;oe++){var[ue,de]=jS[oe],ie=ue.exec(se),ae=ie&&(Ts(de)?de(ie,se):de);if(ae)return ae}return["",""]})(vr),D=(L=typeof navigator<"u"?navigator:void 0)!=null&&L.brave?{brave:!0}:{},q={detectGoogleSearchApp:P},re=At(s2({$os:ee,$os_version:H,$browser:$8(vr,navigator.vendor,D,q),$device:FS(vr),$device_type:(j=vr,V={userAgentDataPlatform:(A=navigator)==null||(A=A.userAgentData)==null?void 0:A.platform,maxTouchPoints:(O=navigator)==null?void 0:O.maxTouchPoints,screenWidth:te==null||(M=te.screen)==null?void 0:M.width,screenHeight:te==null||(R=te.screen)==null?void 0:R.height,devicePixelRatio:te==null?void 0:te.devicePixelRatio},X=FS(j),X===b8||X===w8||X==="Kobo"||X==="Kindle Fire"||X===N8?Tu:X===Td||X===au||X===Ad||X===q1?"Console":X===E8?"Wearable":X?zr:(V==null?void 0:V.userAgentDataPlatform)==="Android"&&((G=V==null?void 0:V.maxTouchPoints)!==null&&G!==void 0?G:0)>0?600>Math.min((Y=V==null?void 0:V.screenWidth)!==null&&Y!==void 0?Y:0,(K=V==null?void 0:V.screenHeight)!==null&&K!==void 0?K:0)/((B=V==null?void 0:V.devicePixelRatio)!==null&&B!==void 0?B:1)?zr:Tu:"Desktop"),$timezone:P6(),$timezone_offset:JO()}),{$current_url:Ld(T?Wo(on==null?void 0:on.href):on==null?void 0:on.href,$,Od),$host:on==null?void 0:on.host,$pathname:on==null?void 0:on.pathname,$raw_user_agent:vr.length>1e3?vr.substring(0,997)+"...":vr,$browser_version:qL(vr,navigator.vendor,D,q),$browser_language:nE(),$browser_language_prefix:(N=nE(),typeof N=="string"?N.split("-")[0]:void 0),$screen_height:te==null?void 0:te.screen.height,$screen_width:te==null?void 0:te.screen.width,$viewport_height:te==null?void 0:te.innerHeight,$viewport_width:te==null?void 0:te.innerWidth,$lib:Vt.LIB_NAME,$lib_version:Vt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Vt.SDK_DIST_CHANNEL&&(re.$sdk_dist_channel=Vt.SDK_DIST_CHANNEL),re})(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){var{sessionId:p,windowId:v}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());u.$session_id=p,u.$window_id=v}this.sessionPropsManager&&At(u,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&At(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(y=this.Qi)==null?void 0:y.length}catch(E){u.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===ky&&(u.$lib_custom_api_host=this.config.api_host),f=e!==Yl||i?e!==hv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=At(u,f),e===Yl&&Ee&&(u.title=Ee.title),!be(a)){var x=r.getTime()-a;u.$duration=parseFloat((x/1e3).toFixed(3))}vr&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=At({},h,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),tt(this.config.property_denylist)?bt(this.config.property_denylist,(function(E){delete u[E]})):_e.error(z6+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(_e.error(vE),u=_(u,e));var b=this.un();return u.$process_person_profile=b,b&&!i&&this.hn("_calculate_event_properties"),u}ln(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.un()||this.$i&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=At({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(_e.error(vE),u=c(u,"$set_once")),n&&(this.$i=!0),Do(u)?void 0:u}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var s;(s=this.persistence)==null||s.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}dn(e,n){this.register({[e]:n})}getFeatureFlag(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,n)}getAllFeatureFlags(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(e,n)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,n,r)}updateEarlyAccessFeatureEnrollment(e,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Ni.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:Bc}),()=>{})}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(e,n):e([],{isLoaded:!1,error:Bc})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:Bc})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=wN),(r=this.surveys)==null||r.displaySurvey(e,n)}cancelPendingSurvey(e){var n;(n=this.surveys)==null||n.cancelPendingSurvey(e)}canRenderSurvey(e){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&n!==void 0?n:{visible:!1,disabledReason:Bc}}canRenderSurveyAsync(e,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Bc})}cn(e){return!e||K1(e)?(_e.critical("Unique user id has not been set in posthog.identify"),!1):e===Rh?(_e.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())||(_e.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 _e.uninitializedWarning("posthog.identify");if($n(e)&&(e=e.toString(),_e.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.cn(e)&&this.hn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Zp)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(nd)&&(this.unregister(nd),this.register({distinct_id:e}));var i,a=(this.persistence.get_property(Es)||Vl)===Vl;e!==s&&a?(this.persistence.set_property(Es,$l),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(pv,{distinct_id:e,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Hi=pE(e,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(dd))}}setPersonProperties(e,n){if((e||n)&&this.hn("posthog.setPersonProperties")){var r=pE(this.get_distinct_id(),e,n);this.Hi!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Hi=r):_e.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(tt(e)?e:[e]).filter((s=>_t(s)&&s.length>0));r.length!==0&&this.hn("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Hi=null)}group(e,n,r){if(e&&n){var s=this.getGroups(),i=s[e]!==n;if(i&&this.resetGroupPropertiesForFlags(e),this.register({$groups:pe({},s,{[e]:n})}),i||r){var a={$group_type:e,$group_key:n};r&&(a.$group_set=r),this.capture(BS,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),i&&!r&&this.reloadFeatureFlags()}else _e.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(e){var n;e===void 0&&(e=!0),(n=this.featureFlags)==null||n.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,n){var r;n===void 0&&(n=!0),this.hn("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,n))}resetGroupPropertiesForFlags(e){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(e)}reset(e){var n,r,s,i,a,u,c,f,h,p;if(_e.info("reset"),!this.__loaded)return _e.uninitializedWarning("posthog.reset");var v,y=this.get_property(Zp),x=this.get_property(fv),_=this.get_property(za);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),be(_)||(v=this.persistence)==null||v.register({[za]:_}),(s=this.surveys)==null||s.reset(),(i=this.nn)==null||i.stop(),(a=this.featureFlags)==null||a.reset(),(u=this.conversations)==null||u.reset(),(c=this.logs)==null||c.reset(),(f=this.metrics)==null||f.reset(),(h=this.persistence)==null||h.set_property(Es,Vl),(p=this.sessionManager)==null||p.resetSessionId(),this.Hi=null,this.config.cookieless_mode===zi)this.register_once({distinct_id:Rh,$device_id:null},"");else{var b=this.config.get_device_id(Fi());this.register_once({distinct_id:b,$device_id:e?b:y},""),e||be(x)||this.register({[fv]:x})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var n=this;return en((function*(){var r,s,i,a,u;n.__loaded?((r=n.logs)==null||r.flushLogs("sendBeacon"),(s=n.metrics)==null||s.flush("sendBeacon"),(i=n.Gi)==null||i.unload(),(a=n.Qi)==null||a.unload(),(u=n.featureFlags)==null||u.destroy()):_e.uninitializedWarning("posthog.shutdown")}))()}setIdentity(e,n){var r;this.config.identity_distinct_id=e,this.config.identity_hash=n,this.alias(e),(r=this.conversations)==null||r.vn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.fn()}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?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var i,a=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return s}alias(e,n){return e===this.get_property(Z8)?(_e.critical("Attempting to create alias for existing People user - aborting."),-2):this.hn("posthog.alias")?(be(n)&&(n=this.get_distinct_id()),e!==n?(this.dn(nd,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(_e.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=pe({},this.config);if(Ot(e)){var r,s,i,a,u,c,f,h,p,v,y;At(this.config,_E(e));var x=this.Wi();(r=this.persistence)==null||r.update_config(this.config,n,x),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new yv(pe({},this.config,{persistence:"sessionStorage"}),x,!1);var _=this.Ui(this.config.debug);ai(_)&&(this.config.debug=_),ai(this.config.debug)&&(this.config.debug?(Vt.DEBUG=!0,wt.N()&&wt.q("ph_debug",!0),_e.info("set_config",{config:e,oldConfig:n,newConfig:pe({},this.config)})):(Vt.DEBUG=!1,wt.N()&&wt.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.exceptions)==null||i.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(u=this.tracingHeaders)==null||u.startIfEnabledOrStop(),(c=this.autocapture)==null||c.startIfEnabled(),(f=this.heatmaps)==null||f.startIfEnabled(),(h=this.exceptionObserver)==null||h.startIfEnabledOrStop(),(p=this.deadClicksAutocapture)==null||p.startIfEnabledOrStop(),(v=this.surveys)==null||v.loadIfEnabled(),this.pn(),(y=this.externalIntegrations)==null||y.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){Vt.LIB_NAME=e,Vt.LIB_VERSION=n}startSessionRecording(e){var n,r,s,i,a,u=e===!0,c={sampling:u||!(e==null||!e.sampling),linked_flag:u||!(e==null||!e.linked_flag),url_trigger:u||!(e==null||!e.url_trigger),event_trigger:u||!(e==null||!e.event_trigger)};Object.values(c).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),c.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),c.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),c.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),c.event_trigger&&((a=this.sessionRecording)==null||a.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.started)}captureException(e,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(pe({},s,n))}}addExceptionStep(e,n){var r;(r=this.exceptions)==null||r.addExceptionStep(e,n)}captureLog(e){var n;(n=this.logs)==null||n.captureLog(e)}get logger(){var e,n;return(e=(n=this.logs)==null?void 0:n.logger)!==null&&e!==void 0?e:as.gn}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?void 0:r.loadToolbar(e))!==null&&n!==void 0&&n}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:Xl;return n!==Xl&&(n=Xl+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Es))===$l||((n=this.sessionPersistence)==null?void 0:n.get_property(Es))===$l}un(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===gy&&!this._isIdentified()&&Do(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[nd])&&((n=this.persistence)==null||(n=n.props)==null||!n[Xp]))}sn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.un()||this.hn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.hn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}hn(e){return this.config.person_profiles==="never"?(_e.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.dn(Xp,!0),!0)}Wi(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Da)}pn(){var e,n,r,s,i=this.Wi();return((e=this.persistence)==null?void 0:e.rr)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.rr)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==zi){if(this.Di()){var r,s,i,a,u;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new hE(this),this.pageViewManager=new tE(this),this.persistence&&(this.sessionPropsManager=new fE(this,this.sessionManager,this.persistence));var c,f=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=as.__defaultExtensionClasses)==null?void 0:u.sessionRecording;f&&(this.sessionRecording=this.Fi(this.sessionRecording,new f(this)),this.en&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.en)))}var h,p;this.consent.optInOut(!0),this.pn(),this.tn(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==Da&&((h=this.surveys)==null||h.loadIfEnabled()),(be(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((p=e==null?void 0:e.captureEventName)!==null&&p!==void 0?p:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.rn()}else _e.warn(gE)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==zi?(this.config.cookieless_mode===Da&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.pn(),this.config.cookieless_mode===Da&&(this.register({distinct_id:Rh,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(n=this.sessionManager)==null||n.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.rn(),this.tn())):_e.warn(gE)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===zi||(this.config.cookieless_mode===Da?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.pn()}_is_bot(){return sr?j6(sr,this.config.custom_blocked_useragents):void 0}rn(){Ee&&(Ee.visibilityState==="visible"?this.qi||(this.qi=!0,this.capture(Yl,{title:Ee.title},{send_instantly:!0}),this.Bi&&(Ee.removeEventListener(Qp,this.Bi),this.Bi=null)):this.Bi||(this.Bi=this.rn.bind(this),$t(Ee,Qp,this.Bi)))}debug(e){e===!1?(te==null||te.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(te==null||te.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}))}Er(){var e,n,r,s,i,a,u=this.zi||{};return"advanced_disable_flags"in u?!!u.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(_e.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):(r="advanced_disable_decide",s=_e,i=(n="advanced_disable_flags")in(e=u)&&!Ye(e[n]),a=r in e&&!Ye(e[r]),i?e[n]:!!a&&(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]))}it(e){var n;if(Ye(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(jL),s=tt(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s){if(i=a(i),Ye(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return DL(e.event)?_e.warn(u+". This can cause unexpected behavior."):_e.info(u),null}i.properties&&!Do(i.properties)||_e.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var c of r)if(i.properties&&Ye(i.properties[c]))return _e.warn("Event '"+e.event+"' had its '"+c+"' 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.Ut)==null?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)})}Ui(e){var n=ai(e)&&!e,r=wt.N()&&wt.A("ph_debug")==="true";return!n&&(!!r||e)}}as.__defaultExtensionClasses={},as.gn=(()=>{var t=()=>{};return{trace:t,debug:t,info:t,warn:t,error:t,fatal:t}})(),(function(t,e){for(var n=0;e.length>n;n++)t.prototype[e[n]]=kO(t.prototype[e[n]])})(as,["identify"]);class xE{constructor(e){this.disabled=e===!1;var n=Ot(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}}var Ev="$copy_autocapture",kv=Dt("[AutoCapture]");function Cv(t,e){return e.length>t?e.slice(0,t)+"...":e}function PN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Go(e));return e}function TN(t,e){var n,r,{e:s,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:u,elementsChainAsString:c,disableCaptureUrlHashes:f}=e;if(!Go(t))return{props:{}};for(var h=[t],p=t;p.parentNode&&!Vr(p,"body");)if(l6(p.parentNode))h.push(p.parentNode.host),p=p.parentNode.host;else{if(!Go(p.parentNode))break;h.push(p.parentNode),p=p.parentNode}var v,y,x=[],_={},b=!1,E=!1;if(bt(h,(O=>{var M=yy(O);if(Vr(O,"a")){var R=O.getAttribute("href");b=!!(M&&R&&fd(R))&&(f?Wo(R):R)}Be(tm(O),"ph-no-capture")&&(E=!0),x.push((function(N,j,V,G,Y){Y===void 0&&(Y=!1);var K=N.tagName.toLowerCase(),B={tag_name:K};o2.indexOf(K)>-1&&!V&&(B.$el_text=K.toLowerCase()==="a"||K.toLowerCase()==="button"?Cv(1024,QS(N)):Cv(1024,Id(N)));var X=tm(N);X.length>0&&(B.classes=X.filter((function(D){return D!==""}))),bt(N.attributes,(function(D){var q;if((!h6(N)||["name","id","class","aria-label"].indexOf(D.name)!==-1)&&(G==null||!G.includes(D.name))&&!j&&fd(D.value)&&(!_t(q=D.name)||q.substring(0,10)!=="_ngcontent"&&q.substring(0,7)!=="_nghost")){var re=D.value;D.name==="class"&&(re=i2(re).join(" ")),B["attr__"+D.name]=Cv(1024,D.name==="href"&&Y?Wo(re):re)}}));for(var $=1,ee=1,H=N;H=PN(H);)$++,H.tagName===N.tagName&&ee++;return B.nth_child=$,B.nth_of_type=ee,B})(O,i,a,u,f));var L=(function(N){if(!yy(N))return{};var j={};return bt(N.attributes,(function(V){if(V.name&&V.name.indexOf("data-ph-capture-attribute")===0){var G=V.name.replace("data-ph-capture-attribute-",""),Y=V.value;G&&Y&&fd(Y)&&(j[G]=Y)}})),j})(O);At(_,L)})),E)return{props:{},explicitNoCapture:E};if(a||(x[0].$el_text=Vr(t,"a")||Vr(t,"button")?QS(t):Id(t)),b){var C,P;x[0].attr__href=b;var T=(C=Md(b))==null?void 0:C.host,A=te==null||(P=te.location)==null?void 0:P.host;T&&A&&T!==A&&(v=b)}return{props:At({$event_type:s.type,$ce_version:1},c?{}:{$elements:x},{$elements_chain:(y=x,(function(O){return O.map((M=>{var R,L,N="";if(M.tag_name&&(N+=M.tag_name),M.attr_class)for(var j of(M.attr_class.sort(),M.attr_class))N+="."+j.replace(/"/g,"");var V=pe({},M.text?{text:M.text}:{},{"nth-child":(R=M.nth_child)!==null&&R!==void 0?R:0,"nth-of-type":(L=M.nth_of_type)!==null&&L!==void 0?L:0},M.href?{href:M.href}:{},M.attr_id?{attr_id:M.attr_id}:{},M.attributes),G={};return cp(V).sort(((Y,K)=>{var[B]=Y,[X]=K;return B.localeCompare(X)})).forEach((Y=>{var[K,B]=Y;return G[JS(K.toString())]=JS(B.toString())})),(N+=":")+cp(G).map((Y=>{var[K,B]=Y;return K+'="'+B+'"'})).join("")})).join(";")})((function(O){return O.map((M=>{var R,L,N={text:(R=M.$el_text)==null?void 0:R.slice(0,400),tag_name:M.tag_name,href:(L=M.attr__href)==null?void 0:L.slice(0,2048),attr_class:WO(M),attr_id:M.attr__id,nth_child:M.nth_child,nth_of_type:M.nth_of_type,attributes:{}};return cp(M).filter((j=>{var[V]=j;return V.indexOf("attr__")===0})).forEach((j=>{var[V,G]=j;return N.attributes[V]=G})),N}))})(y)))},(n=x[0])!=null&&n.$el_text?{$el_text:(r=x[0])==null?void 0:r.$el_text}:{},v&&s.type==="click"?{$external_click_url:v}:{},_)}}var Wc=Dt("[ExceptionAutocapture]"),wE=()=>{},AN=Dt("[TracingHeaders]"),Ea=Dt("[Web Vitals]"),bE=9e5,SE="disabled",EE="lazy_loading",Gc="awaiting_config",jh="missing_config";Dt("[SessionRecording]"),Dt("[SessionRecording]");var Py="[SessionRecording]",Pi=Dt(Py),RN=Dt("[Heatmaps]");function kE(t){return Ot(t)&&"clientX"in t&&"clientY"in t&&$n(t.clientX)&&$n(t.clientY)}var Pv=Dt("[Product Tours]"),Tv=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(t2))},IN=["$set_once","$set"],Ws=Dt("[SiteApps]"),CE="Error while initializing PostHog app with config id ";function Ul(t,e,n){if(Ye(t))return!1;switch(n){case"exact":return t===e;case"contains":var 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}}class MN{constructor(e){this.mn=new c2,this.yn=(n,r)=>this.bn(n,r)&&this._n(n,r)&&this.wn(n,r)&&this.xn(n,r),this.bn=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.kn=new Set,this.Sn=new Set}init(){var e,n;be((e=this._instance)==null?void 0:e._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(e){var n,r;if(!be((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.Sn)==null||u.add(a),(c=a.steps)==null||c.forEach((f=>{var h;(h=this.kn)==null||h.add((f==null?void 0:f.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;e.forEach((a=>{var u;(u=a.steps)==null||u.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(e,n){var r;n!=null&&e.length!=0&&(this.kn.has(e)||this.kn.has(n==null?void 0:n.event))&&this.Sn&&((r=this.Sn)==null?void 0:r.size)>0&&this.Sn.forEach((s=>{this.Cn(n,s)&&this.mn.emit("actionCaptured",s.name)}))}In(e){this.onAction("actionCaptured",(n=>e(n)))}Cn(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.yn(e,r))return!0;return!1}onAction(e,n){return this.mn.on(e,n)}_n(e,n){if(n!=null&&n.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!Ul(s,n.url,n.url_matching||"contains"))return!1}return!0}wn(e,n){return!!this.Tn(e,n)&&!!this.Mn(e,n)&&!!this.En(e,n)}Tn(e,n){var r;if(n==null||!n.href)return!0;var s=this.Pn(e);if(s.length>0)return s.some((u=>Ul(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&Ul((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}Mn(e,n){var r;if(n==null||!n.text)return!0;var s=this.Pn(e);if(s.length>0)return s.some((f=>Ul(f.text,n.text,n.text_matching||"exact")||Ul(f.$el_text,n.text,n.text_matching||"exact")));var i,a,u,c=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(f){for(var h,p=[],v=/(?::|")text="(.*?)"/g;!Ye(h=v.exec(f));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((f=>Ul(f,a,u))))}En(e,n){var r,s;if(n==null||!n.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}Pn(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}xn(e,n){return n==null||!n.properties||n.properties.length===0||$6(n.properties.reduce(((r,s)=>{var i=tt(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),e==null?void 0:e.properties)}}class LN{constructor(e){this.Rn=[],this._instance=e,this.On=new Map,this.Ln=new Map,this.Fn=new Map}An(e,n){return!!e&&$6(e.propertyFilters,n==null?void 0:n.properties)}Dn(e,n){var r=new Map;return e.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((a=>{if(a!=null&&a.name){var u=r.get(a.name)||[];u.push(s.id),r.set(a.name,u)}}))})),r}$n(e,n,r){var s=(r===Vc.Activation?this.On:this.Ln).get(e),i=[];return this.Nn((a=>{i=a.filter((u=>s==null?void 0:s.includes(u.id)))})),i.filter((a=>{var u,c=(u=a.conditions)==null||(u=u[r])==null||(u=u.values)==null?void 0:u.find((f=>f.name===e));return this.An(c,n)}))}register(e){var n;be((n=this._instance)==null?void 0:n._addCaptureHook)||(this.qn(e),this.Bn(e))}Bn(e){var n=e.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.jn==null&&(this.jn=new MN(this._instance),this.jn.init(),this.jn.In((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,a,u,c;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((u=this.jn)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((f=>{if(f&&f.name){var h=this.Fn.get(f.name);h&&h.push(r.id),this.Fn.set(f.name,h||[r.id])}})))})))}qn(e){var n,r=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.events)&&((u=i.conditions)==null||(u=u.events)==null||(u=u.values)==null?void 0:u.length)>0})),s=e.filter((i=>{var a,u;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((u=i.conditions)==null||(u=u.cancelEvents)==null||(u=u.values)==null?void 0:u.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,a)=>{this.onEvent(i,a)})),this.On=this.Dn(e,Vc.Activation),this.Ln=this.Dn(e,Vc.Cancellation))}onEvent(e,n){var r,s,i=this.Hn(),a=(n==null||(r=n.properties)==null?void 0:r.$survey_id)||(n==null||(s=n.properties)==null?void 0:s.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var u=this.Un(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.zn([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.Vn(a)}if(this.Ln.has(e)){var c=this.$n(e,n,Vc.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.zn(c.map((h=>h.id))),c.forEach((h=>this.Wn(h.id))))}if(this.On.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.On.get(e)});var f=this.$n(e,n,Vc.Activation);this.Gn(f.map((h=>h.id)))}}onAction(e){this.Fn.has(e)&&this.Gn(this.Fn.get(e)||[])}Gn(e){e.length!==0&&(this.Rn=[...new Set([...this.Rn,...e])],this.Hn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Vn(e){this.Rn=this.Rn.filter((r=>r!==e));var n=this.Zn();n.includes(e)||this.Qn([...n,e])}zn(e){var n=new Set(e);this.Rn=this.Rn.filter((i=>!n.has(i)));var r=this.Zn(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&this.Qn(s)}Zn(){var e,n=this.Jn();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}getActivatedIds(){return[...new Set([...this.Zn(),...this.Rn])].filter((e=>!this.Kn(e)))}reset(){this.Rn=[],this.Zn().length>0&&this.Qn([])}getEventToItemsMap(){return this.On}Yn(){return this.jn}}class ON extends LN{constructor(e){super(e)}Jn(){return uy}Xn(){return Ui.SHOWN}Nn(e){var n;(n=this._instance)==null||n.getSurveys(e)}Wn(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Hn(){return yt}Qn(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[uy]:e})}Kn(){return!1}Un(e,n){var r;this.Nn((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a,u,c,f=((a=(u=i.conditions)==null||(u=u.events)==null||(u=u.values)==null?void 0:u.length)!==null&&a!==void 0?a:0)>0;return i.schedule===nN.Always||!((c=i.conditions)==null||(c=c.events)==null||!c.repeatedActivation||!f)})(r);return s?e===Ui.SHOWN?"consume":"ignore":e===Ui.SHOWN?"persist":e===Ui.DISMISSED||e===Ui.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Av="SDK is not enabled or survey functionality is not yet loaded",PE="Disabled. Not loading surveys.",NN=te!=null&&te.location?nm(te.location.hash,"__posthog")||nm(location.hash,"state"):null,TE="_postHogToolbarParams",AE=Dt("[Toolbar]"),un=Dt("[FeatureFlags]"),ka=Dt("[FeatureFlags]",{debugEnabled:!0}),Rv=`" failed. Feature flags didn't load in time.`,RE=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},IE=t=>{var e={};for(var[n,r]of cp(t||{}))r&&(e[n]=r);return e},Ti=Dt("[Error tracking]"),ME="Refusing to render web experiment since the viewer is a likely bot",DN={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>im(e,t),not_regex:(t,e)=>!im(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class Kn{get Se(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{Kn.es("retrieved web experiments from the server"),n.ts=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.ts&&(Kn.es("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.ts)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);_t(u)&&i.variants[u]&&n.rs(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var f=i.variants[c];Kn.ns(f,n._instance)&&n.rs(i.name,c,f.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())Kn.es(ME);else if(!this.Se.disable_web_experiments){if(Ye(this.ts))return this.ts=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Kn.es("applying feature flags",e),e.forEach((n=>{var r;if(this.ts&&(r=this.ts)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.ts)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.rs(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=Kn.getWindowLocation();if(e!=null&&e.search){var n=Iu(e==null?void 0:e.search,"__experiment_id"),r=Iu(e==null?void 0:e.search,"__experiment_variant");n&&r&&(Kn.es("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.ss(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Se.disable_web_experiments&&!r)return e([]);var 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.Se.token),method:"GET",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}ss(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(Kn.es("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.rs(s[0].name,n,s[0].variants[n].transforms))}static ns(e,n){return!Ye(e.conditions)&&Kn.os(e,n)&&Kn.ls(e)}static os(e,n){var r;if(Ye(e.conditions)||Ye((r=e.conditions)==null?void 0:r.url))return!0;var s=Kn.getWindowLocation();if(s){var i,a,u,c=o6(n,s.href);return(i=e.conditions)==null||!i.url||DN[(a=(u=e.conditions)==null?void 0:u.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return te==null?void 0:te.location}static ls(e){var n;if(Ye(e.conditions)||Ye((n=e.conditions)==null?void 0:n.utm))return!0;var r=w6();if(r.utm_source){var s,i,a,u,c,f,h,p,v=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,y=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_source)==r.utm_source,x=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_medium)==r.utm_medium,_=(h=e.conditions)==null||(h=h.utm)==null||!h.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return v&&x&&_&&y}return!1}static es(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];_e.info("[WebExperiments] "+e,r)}rs(e,n,r){this._is_bot()?Kn.es(ME):n!=="control"?r.forEach((s=>{if(s.selector){var i;Kn.es("applying transform of variant "+n+" for experiment "+e+" ",s);var a=(i=document)==null?void 0:i.querySelectorAll(s.selector);a==null||a.forEach((u=>{var c=u;s.html&&(c.innerHTML=s.html),s.css&&c.setAttribute("style",s.css)}))}})):Kn.es("Control variants leave the page unmodified.")}_is_bot(){return sr&&this._instance?j6(sr,this.Se.custom_blocked_useragents):void 0}}var rs=Dt("[Conversations]"),Ca="Conversations not available yet.",LE="console",Um={featureFlags:class{constructor(t){this.us=!1,this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=0,this.bs=()=>{var e=this._s();this.ys=0,e&&this.reloadFeatureFlags()},this._instance=t,this.featureFlagEventHandlers=[],te&&$t(te,"online",this.bs)}destroy(){te==null||te.removeEventListener("online",this.bs)}get Se(){return this._instance.config}get ti(){return this._instance.persistence}ws(t){return this._instance.get_property(t)}xs(){var t,e;return(t=(e=this.ti)==null?void 0:e.nr(this.Se.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}ks(){return!!this.xs()&&(this.gs||this.ds||(this.gs=!0,un.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ss(){var t,e=(t=this.Se.evaluation_contexts)!==null&&t!==void 0?t:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.ps||(un.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ps=!0),e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||un.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Cs(){return this.Ss().length>0}Is(){var t=this.Se.flag_keys;if(!be(t)){if(tt(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||un.error("Invalid flag key found:",e,"Expected non-empty string"),n}));un.error("Invalid flag_keys found:",t,"Expected array of non-empty strings")}}initialize(){var t,e,{config:n}=this._instance,r=(t=(e=n.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(r).length){var s,i,a=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},u=Object.keys(r).filter((f=>!!r[f])).reduce(((f,h)=>(f[h]=r[h]||!1,f)),{}),c=Object.keys(a).filter((f=>u[f])).reduce(((f,h)=>(a[h]&&(f[h]=a[h]),f)),{});this.receivedFeatureFlags({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.ws(Va))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.ws(up))!==null&&s!==void 0?s:{},u=pe({},i,t),c=pe({},a,e),f={};for(var[h,p]of Object.entries(u))f[h]={key:h,enabled:RS(p),variant:IS(p),reason:void 0,metadata:be(c==null?void 0:c[h])?void 0:{id:0,version:void 0,description:void 0,payload:c[h]}};this.receivedFeatureFlags({flags:f})}get hasLoadedFlags(){return this.hs}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.ws(oy),e=this.ws(Oi),n=this.ws(ql);if(!n&&!e)return t||{};var r=At({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,u,c=r[i],f=e==null?void 0:e[i],h=be(f)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!f,p=be(f)?c.variant:typeof f=="string"?f:void 0,v=n==null?void 0:n[i],y=pe({},c,{enabled:h,variant:h?p??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(y.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(y.original_variant=c==null?void 0:c.variant),v&&(y.metadata=pe({},c==null?void 0:c.metadata,{payload:v,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=y}return this.us||(un.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.us=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:RS(r),variant:IS(r),payload:AS(e[n])}}))}getFlagVariants(){var t=this.ws(Va),e=this.ws(Oi);if(!e)return t||{};for(var n=At({},t),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.us||(un.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.us=!0),n}getFlagPayloads(){var t=this.ws(up),e=this.ws(ql);if(!e)return t||{};for(var n=At({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.us||(un.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.us=!0),n}reloadFeatureFlags(){this.cs||this.Se.advanced_disable_feature_flags||this._s()||this.Ts||(this._instance.Ni.emit("featureFlagsReloading",!0),this.Ts=setTimeout((()=>{this.Ms()}),5))}Es(){clearTimeout(this.Ts),this.Ts=void 0}ensureFlagsLoaded(){this.hs||this.ds||this.Ts||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.cs=t}Ms(t){var e;if(this.Es(),!this._instance.Er()&&!this._s())if(this.ds)this.vs=!0;else{var n=this.Se.token,r=this.ws(Zp),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:pe({},((e=this.ti)==null?void 0:e.get_initial_props())||{},this.ws(Oa)||{}),group_properties:this.ws(Na),timezone:P6()};ar(r)||be(r)||(s.$device_id=r),(t!=null&&t.disableFlags||this.Se.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Cs()&&(s.evaluation_contexts=this.Ss());var i=this.Is();be(i)||(s.flag_keys=i);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,u=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.ds=!0,this._instance._send_request({method:"POST",url:u,data:s,compression:this.Se.disable_compression?void 0:os.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:c=>{var f,h,p,v=!0;if(this.Ps(c.statusCode),c.statusCode===200&&(this.vs||(this.$anon_distinct_id=void 0),v=!1),this.ds=!1,!s.disable_flags||this.vs){this.fs=!v;var y=[];c.error?c.error instanceof Error?y.push(c.error.name==="AbortError"?"timeout":"connection_error"):y.push("unknown_error"):c.statusCode!==200&&y.push("api_error_"+c.statusCode),(f=c.json)!=null&&f.errorsWhileComputingFlags&&y.push("errors_while_computing_flags");var x,_=!((h=c.json)==null||(h=h.quotaLimited)==null||!h.includes("feature_flags"));_&&y.push("quota_limited"),(p=this.ti)==null||p.register({[dy]:y}),_?un.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."):(s.disable_flags||this.receivedFeatureFlags((x=c.json)!==null&&x!==void 0?x:{},v,{partialResponse:a}),this.vs&&(this.vs=!1,this.Ms()))}}})}}_s(){return _6(this.ys,3)}Ps(t){this.ys=x6(t,this.ys,3,(()=>un.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===void 0&&(e={}),!e.fresh||this.fs)if(this.hs||this.getFlags()&&this.getFlags().length>0){if(!this.ks()){var r=this.getFeatureFlagResult(t,e);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else un.warn('getFeatureFlag for key "'+t+Rv)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.fs)if(this.hs||this.getFlags()&&this.getFlags().length>0){if(!this.ks()){var n=this.getFlagVariants(),r=t in n,s=n[t],i=this.getFlagPayloads()[t],a=String(s),u=this.ws(ay)||void 0,c=this.ws(Rd)||void 0,f=this.ws(dd)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var h,p=this._instance.get_session_id(),v=this.ws(cy);p&&p!==v&&(f={},(h=this.ti)==null||h.register({[dd]:f,[cy]:p}))}if((e.send_event||!("send_event"in e))&&(!(t in f)||!f[t].includes(a))){var y,x,_,b,E,C,P,T,A,O;tt(f[t])?f[t].push(a):f[t]=[a],(y=this.ti)==null||y.register({[dd]:f});var M=this.getFeatureFlagDetails(t),R=[...(x=this.ws(dy))!==null&&x!==void 0?x:[]];be(s)&&R.push("flag_missing");var L={$feature_flag:t,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:u,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((_=this.Se.bootstrap)==null||(_=_.featureFlags)==null?void 0:_[t])||null,$feature_flag_bootstrapped_payload:((b=this.Se.bootstrap)==null||(b=b.featureFlagPayloads)==null?void 0:b[t])||null,$used_bootstrap_value:!this.fs};be(M==null||(E=M.metadata)==null?void 0:E.version)||(L.$feature_flag_version=M.metadata.version);var N,j=(C=M==null||(P=M.reason)==null?void 0:P.description)!==null&&C!==void 0?C:M==null||(T=M.reason)==null?void 0:T.code;j&&(L.$feature_flag_reason=j),M!=null&&(A=M.metadata)!=null&&A.id&&(L.$feature_flag_id=M.metadata.id),be(M==null?void 0:M.original_variant)&&be(M==null?void 0:M.original_enabled)||(L.$feature_flag_original_response=be(M.original_variant)?M.original_enabled:M.original_variant),M!=null&&(O=M.metadata)!=null&&O.original_payload&&(L.$feature_flag_original_payload=M==null||(N=M.metadata)==null?void 0:N.original_payload),R.length&&(L.$feature_flag_error=R.join(",")),this._instance.capture("$feature_flag_called",L)}if(r)return{key:t,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:AS(i)}}}else un.warn('getFeatureFlagResult for key "'+t+Rv)}getRemoteConfigPayload(t,e){var n=this.Se.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Cs()&&(r.evaluation_contexts=this.Ss());var s=this.Is();be(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Se.disable_compression?void 0:os.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback(i){var a,u=(a=i.json)==null?void 0:a.featureFlagPayloads;e((u==null?void 0:u[t])||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.fs){if(this.hs||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(t,e);return be(n)?void 0:!!n}un.warn('isFeatureEnabled for key "'+t+Rv)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){if(this.ti){this.hs=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,u,c,f,h,p){c===void 0&&(c={}),f===void 0&&(f={}),h===void 0&&(h={});var v=(R=>{var L=R.flags;return L?(R.featureFlags=Object.fromEntries(Object.keys(L).map((N=>{var j;return[N,(j=L[N].variant)!==null&&j!==void 0?j:L[N].enabled]}))),R.featureFlagPayloads=Object.fromEntries(Object.keys(L).filter((N=>L[N].enabled)).filter((N=>{var j;return(j=L[N].metadata)==null?void 0:j.payload})).map((N=>{var j;return[N,(j=L[N].metadata)==null?void 0:j.payload]})))):R.featureFlags&&un.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),R})(a),y=v.flags,x=v.featureFlags,_=v.featureFlagPayloads;if(x){var b=a.requestId,E=a.evaluatedAt;if(tt(x)){un.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var C={};if(x)for(var P=0;x.length>P;P++)C[x[P]]=!0;u&&u.register({[lp]:x,[Va]:C})}else{var T=x,A=_,O=y;if(p!=null&&p.partialResponse)T=pe({},c,T),A=pe({},f,A),O=pe({},h,O);else if(a.errorsWhileComputingFlags)if(y){var M=new Set(Object.keys(y).filter((R=>{var L;return!((L=y[R])!=null&&L.failed)})));T=pe({},c,Object.fromEntries(Object.entries(T).filter((R=>{var[L]=R;return M.has(L)})))),A=pe({},f,Object.fromEntries(Object.entries(A||{}).filter((R=>{var[L]=R;return M.has(L)})))),O=pe({},h,Object.fromEntries(Object.entries(O||{}).filter((R=>{var[L]=R;return M.has(L)}))))}else T=pe({},c,T),A=pe({},f,A),O=pe({},h,O);u&&u.register(pe({[lp]:Object.keys(IE(T)),[Va]:T||{},[up]:A||{},[oy]:O||{}},b?{[ay]:b}:{},E?{[Rd]:E}:{}))}}})(t,this.ti,r,s,i,n),e||(this.gs=!1),this.Rs(e)}}override(t,e){e===void 0&&(e=!1),un.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this.ti)return un.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.ti.unregister(Oi),this.ti.unregister(ql),this.Rs(),ka.info("All overrides cleared");if(tt(t)){var e=RE(t);return this.ti.register({[Oi]:e}),this.Rs(),ka.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.us=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.ti.unregister(Oi),ka.info("Flag overrides cleared");else if(r.flags){if(tt(r.flags)){var s=RE(r.flags);this.ti.register({[Oi]:s})}else this.ti.register({[Oi]:r.flags});ka.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.ti.unregister(ql),ka.info("Payload overrides cleared")):r.payloads&&(this.ti.register({[ql]:r.payloads}),ka.info("Payload overrides set",{payloads:r.payloads}))),void this.Rs()}if(t&&typeof t=="object")return this.ti.register({[Oi]:t}),this.Rs(),ka.info("Flag overrides set",{flags:t});un.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.hs){var{flags:e,flagVariants:n}=this.Os();try{t(e,n)}catch(r){un.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r,s=(this.ws(sd)||[]).find((c=>c.flagKey===t)),i={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:i};s&&(a.$early_access_feature_name=s.name),n&&(a.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var u=pe({},this.getFlagVariants(),{[t]:e});(r=this.ti)==null||r.register({[lp]:Object.keys(IE(u)),[Va]:u}),this.Rs()}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.ws(sd),s=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!e)return t(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+s),method:"GET",callback:i=>{var a,u;if(i.json){var c=i.json.earlyAccessFeatures;return(a=this.ti)==null||a.unregister(sd),(u=this.ti)==null||u.register({[sd]:c}),t(c)}}})}Os(){var 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)),{})}}Rs(t){var{flags:e,flagVariants:n}=this.Os();this.featureFlagEventHandlers.forEach((r=>{try{r(e,n,{errorsLoading:t})}catch(s){un.error("Error while running feature flags callback",s)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.ws(Oa)||{},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(var a in s)({}).hasOwnProperty.call(s,a)&&(a in n||(i[a]=s[a]));this._instance.register({[Oa]:pe({},n,i,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=pe({},this.ws(Oa)||{});t.forEach((r=>{delete n[r]})),this._instance.register({[Oa]:n}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this._instance.unregister(Oa),t&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.ws(Na)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=pe({},n[r],t[r]),delete t[r]})),this._instance.register({[Na]:pe({},n,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.ws(Na)||{};this._instance.register({[Na]:pe({},e,{[t]:{}})})}else this._instance.unregister(Na)}reset(){this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.$anon_distinct_id=void 0,this.Es(),this.us=!1,this.ys=0}}},jN={sessionRecording:class{get Se(){return this._instance.config}get ti(){return this._instance.persistence}get started(){var t;return!((t=this.Ls)==null||!t.isStarted)}get status(){var t,e;return this.Fs===Gc||this.Fs===jh?this.Fs:(t=(e=this.Ls)==null?void 0:e.status)!==null&&t!==void 0?t:this.Fs}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Fs=SE,this.As=void 0,this._instance=t,!this._instance.sessionManager)throw Pi.error("started without valid sessionManager"),new Error(Py+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===zi)throw new Error(Py+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ds(){var t,e=!((t=this._instance.get_property(za))==null||!t.enabled),n=!this.Se.disable_session_recording,r=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return te&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!this.Ds||(e=this.Ls)==null||!e.isStarted){var n=!be(Object.assign)&&!be(Array.from);this.Ds&&n?(this.$s(t),Pi.info("starting")):(this.Fs=SE,this.stopRecording())}}$s(t){var e,n,r;this.Ds&&(this.Fs!==Gc&&this.Fs!==jh&&(this.Fs=EE),$e!=null&&(e=$e.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=$e.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Ns(t):(r=$e.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.qs,(s=>{if(s)return Pi.error("could not load recorder",s);this.Ns(t)})))}stopRecording(){var t,e;(t=this.As)==null||t.call(this),this.As=void 0,(e=this.Ls)==null||e.stop()}Bs(){var t,e;(t=this.As)==null||t.call(this),this.As=void 0,(e=this.Ls)==null||e.discard()}js(){var t,e;(t=this.ti)==null||t.unregister(n2),(e=this.ti)==null||e.unregister(q8)}Hs(t,e){if(Ye(t))return null;var n,r=$n(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Pi.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}Us(t){if(this.ti){var e,n,r=this.ti,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.Hs((i=this.Se.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.Hs(a==null?void 0:a.sampleRate,"remote config sampleRate"),f=u??c;Ye(f)&&this.js();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[za]:pe({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:pe({capturePerformance:t.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:f,minimumDurationMilliseconds:be(h)?null:h,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.As)==null||e.call(this),this.As=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.Us(t),void this.Bs()):(this.Us(t),void this.startIfEnabledOrStop()):(this.Fs===Gc&&(this.Fs=jh,Pi.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var n;e===void 0&&(e="log"),(n=this.Ls)!=null&&n.log?this.Ls.log(t,e):Pi.warn("log called before recorder was ready")}get qs(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(za);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}zs(){var t,e,n=this._instance.get_property(za);if(!n)return!1;try{e=typeof n=="object"?n:JSON.parse(n)}catch(s){return Pi.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var r=(t=e.cache_timestamp)!==null&&t!==void 0?t:Date.now();return 36e5>=Date.now()-r}Ns(t){var e,n;if((e=$e.__PosthogExtensions__)==null||!e.initSessionRecording)return Pi.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[r6]:!0});if(this.Ls||(this.Ls=(n=$e.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.Ls._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.zs())return this.Fs===jh||this.Fs===Gc?void 0:(this.Fs=Gc,Pi.info("persisted remote config is stale, requesting fresh config before starting"),void new T6(this._instance).load());this.Fs=EE,this.Ls.start(t)}onRRwebEmit(t){var e;(e=this.Ls)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Ls||(e=this.ti)==null||e.register({[X8]:!0}),(t=this.Ls)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Ls||(e=this.ti)==null||e.register({[Y8]:!0}),(t=this.Ls)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.Ls||(n=this.ti)==null||n.register({[t==="url"?Q8:J8]:!0}),(e=this.Ls)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Ls)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.Ls)==null||!n.tryAddCustomEvent(t,e))}}},FN={autocapture:class{constructor(t){this.Vs=!1,this.Ws=null,this.Gs=!1,this.instance=t,this.rageclicks=new xE(t.config.rageclick),this.Zs=null}initialize(){this.startIfEnabled()}get Se(){var t,e,n=Ot(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map((r=>new RegExp(r))),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map((r=>new RegExp(r))),n}Qs(){if(this.isBrowserSupported()){if(te&&Ee){var t=n=>{n=n||(te==null?void 0:te.event);try{this.Js(n)}catch(r){kv.error("Failed to capture event",r)}};if($t(Ee,"submit",t,{capture:!0}),$t(Ee,"change",t,{capture:!0}),$t(Ee,"click",t,{capture:!0}),this.Se.capture_copied_text){var e=n=>{n=n||(te==null?void 0:te.event);try{this.Js(n,Ev)}catch(r){kv.error("Failed to capture copy/cut event",r)}};$t(Ee,"copy",e,{capture:!0}),$t(Ee,"cut",e,{capture:!0})}}}else kv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Vs&&(this.Qs(),this.Vs=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Gs=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[J1]:!!t.autocapture_opt_out}),this.Ws=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Zs=t}getElementSelectors(t){var e,n=[];return(e=this.Zs)==null||e.forEach((r=>{var s=Ee==null?void 0:Ee.querySelectorAll(r);s==null||s.forEach((i=>{t===i&&n.push(r)}))})),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[J1];if(ar(this.Ws)&&!ai(n)&&!this.instance.Er())return!1;var r=(e=this.Ws)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!r}Js(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=gv(t);a6(r)&&(r=r.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&XS(r,this.instance.config.rageclick)&&this.Js(t,"$rageclick");var s=e===Ev;if(r&&(function(p,v,y,x,_,b){var E,C,P,T,A,O;if(y===void 0&&(y=void 0),!te||a2(p)||(E=y)!=null&&E.url_allowlist&&!ZS(y.url_allowlist,b)||(C=y)!=null&&C.url_ignorelist&&ZS(y.url_ignorelist,b))return!1;if((P=y)!=null&&P.dom_event_allowlist){var M=y.dom_event_allowlist;if(M&&!M.some((V=>v.type===V)))return!1}var{parentIsUsefulElement:R,targetElementList:L}=f6(p,x);if(!(function(V,G){var Y=G==null?void 0:G.element_allowlist;if(be(Y))return!0;var K,B=function($){if(Y.some((ee=>$.tagName.toLowerCase()===ee)))return{v:!0}};for(var X of V)if(K=B(X))return K.v;return!1})(L,y)||!vy(L,(T=y)==null?void 0:T.css_selector_allowlist)||vy(L,(A=(O=y)==null?void 0:O.css_selector_ignorelist)!==null&&A!==void 0?A:FO))return!1;try{var N=te.getComputedStyle(p);if(N&&N.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0}catch{}var j=p.tagName.toLowerCase();switch(j){case"html":return!1;case"form":return(_||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(v.type)>=0;default:return R?(_||["click"]).indexOf(v.type)>=0:(_||["click"]).indexOf(v.type)>=0&&(o2.indexOf(j)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Se,s,s?["copy","cut"]:void 0,this.instance)){var{props:i,explicitNoCapture:a}=TN(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Gs,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(a)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(i.$element_selectors=u),e===Ev){var c,f=u6(te==null||(c=te.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!f)return!1;i.$selected_content=f,i.$copy_type=h}return this.instance.capture(e,i),!0}}}isBrowserSupported(){return Ts(Ee==null?void 0:Ee.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Ks=(te==null||(e=te.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(_e.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ys&&this.Ys(),this.Ys=void 0,_e.info("History API monitoring stopped")}monitorHistoryChanges(){te&&te.history&&(this.Xs("pushState"),this.Xs("replaceState"),this.eo())}Xs(t){var e;if(te&&((e=te.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return wE;var a={next:r[s]},u=i((function(){for(var c=arguments.length,f=new Array(c),h=0;c>h;h++)f[h]=arguments[h];return a.next.apply(this,f)}));return Ts(u)&&(u.prototype=u.prototype||{},Object.defineProperties(u,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=u,()=>{if(r[s]!==u)for(var c=r[s];Ts(c)&&c.__posthog_layer__;){var f=c.__posthog_layer__;if(f.next===u)return void(f.next=a.next);c=f.next}else r[s]=a.next}}catch{return wE}})(te.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n.ro(t)}))}}ro(t){try{var e,n=te==null||(e=te.location)==null?void 0:e.pathname;if(!n)return;n!==this.Ks&&this.isEnabled&&this._instance.capture(Yl,{navigation_type:t}),this.Ks=n}catch(r){_e.error("Error capturing "+t+" pageview",r)}}eo(){if(!this.Ys){var t=()=>{this.ro("popstate")};$t(te,"popstate",t),this.Ys=()=>{te&&te.removeEventListener("popstate",t)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(t){var e;this.io=!1,this.Vs=!1,this.no=null,this.instance=t,this.io=!((e=this.instance.persistence)==null||!e.props[ey]),this.rageclicks=new xE(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return Ot(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(t=this.Se.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Ye(this.Se.capture_heatmaps)?Ye(this.Se.enable_heatmaps)?this.io:this.Se.enable_heatmaps:this.Se.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Vs)return;RN.info("starting..."),this.so(),this.ke()}else{var t;clearInterval((t=this.no)!==null&&t!==void 0?t:void 0),this.oo(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ey]:e}),this.io=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}ao(t){this.fe(t.originalEvent,"deadclick")}ke(){this.no&&clearInterval(this.no),this.no=(Ee==null?void 0:Ee.visibilityState)==="visible"?setInterval(this.zr.bind(this),this.flushIntervalMilliseconds):null}so(){te&&Ee&&(this.lo=this.zr.bind(this),$t(te,Jp,this.lo),this.uo=t=>this.fe(t||(te==null?void 0:te.event)),$t(Ee,"click",this.uo,{capture:!0}),this.ho=t=>this.do(t||(te==null?void 0:te.event)),$t(Ee,"mousemove",this.ho,{capture:!0}),this.co=new eE(this.instance,GO,this.ao.bind(this)),this.co.startIfEnabledOrStop(),this.vo=this.ke.bind(this),$t(Ee,Qp,this.vo),this.Vs=!0)}oo(){var t;te&&Ee&&(this.lo&&te.removeEventListener(Jp,this.lo),this.uo&&Ee.removeEventListener("click",this.uo,{capture:!0}),this.ho&&Ee.removeEventListener("mousemove",this.ho,{capture:!0}),this.vo&&Ee.removeEventListener(Qp,this.vo),clearTimeout(this.fo),(t=this.co)==null||t.stop(),this.Vs=!1)}po(t,e){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(a,u,c){for(var f=a;f&&Go(f)&&!Vr(f,"body");){if(f===c)return!1;var h=void 0;try{var p,v,y;h=(p=(v=(y=f.ownerDocument)==null?void 0:y.defaultView)!==null&&v!==void 0?v:te)==null?void 0:p.getComputedStyle(f).position}catch{return!1}if(Be(u,h))return!0;f=c6(f)}return!1})(gv(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}fe(t,e){var n;if(e===void 0&&(e="click"),!KS(t.target)&&kE(t)){var r=this.po(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&XS(gv(t),this.instance.config.rageclick)&&this.kt(pe({},r,{type:"rageclick"})),this.kt(r)}}do(t){!KS(t.target)&&kE(t)&&(clearTimeout(this.fo),this.fo=setTimeout((()=>{this.kt(this.po(t,"mousemove"))}),500))}kt(t){if(te){var e=this.Se.disable_capture_url_hashes?Wo(te.location.href):te.location.href,n=this.Se.custom_personal_data_properties,r=this.Se.mask_personal_data_properties?[...Mu,...n||[]]:[],s=Ld(e,r,Od);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(t)}}zr(){this.R&&!Do(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:eE,webVitalsAutocapture:class{constructor(t){var e;this.io=!1,this.Vs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.mo=()=>{clearTimeout(this.yo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>pe({},n,{["$web_vitals_"+r.name+"_event"]:pe({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.bo=n=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this._o();if(!be(s))if(Ye(n==null?void 0:n.name)||Ye(n==null?void 0:n.value))Ea.error("Invalid metric received",n);else if(!this.wo||this.wo>n.value){this.R.url!==s&&(this.mo(),this.yo=setTimeout(this.mo,this.flushToCaptureTimeoutMs)),be(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=be(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var i=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),a=pe({},n,{$current_url:s,timestamp:Date.now()});be(i)||(a.$session_id=i.sessionId,a.$window_id=i.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.mo()}else Ea.error("Ignoring metric with value >= "+this.wo,n)},this.xo=()=>{if(!this.Vs){var n,r,s,i,a=$e.__PosthogExtensions__;be(a)||be(a.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:i}=a.postHogWebVitalsCallbacks),n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.bo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.bo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.bo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.bo.bind(this)),this.Vs=!0):Ea.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.io=!((e=this._instance.persistence)==null||!e.props[sy]),this.startIfEnabled()}get ko(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=Ot(this.ko)?(t=this.ko)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Ye(n)?((e=this._instance.persistence)==null?void 0:e.props[iy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Ot(this.ko)?this.ko.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Ot(this.ko)?this.ko.web_vitals_attribution:void 0;return t!=null&&t}get wo(){var t=Ot(this.ko)&&$n(this.ko.__web_vitals_max_value)?this.ko.__web_vitals_max_value:bE;return t>0&&6e4>=t?bE:t}get isEnabled(){var t=on==null?void 0:on.protocol;if(t!=="http:"&&t!=="https:")return Ea.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Ot(this.ko)?this.ko.web_vitals:ai(this.ko)?this.ko:void 0;return ai(e)?e:this.io}startIfEnabled(){this.isEnabled&&!this.Vs&&(Ea.info("enabled, starting..."),this.Bt(this.xo))}onRemoteConfig(t){if("capturePerformance"in t){var e=Ot(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=Ot(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[sy]:e}),this._instance.persistence.register({[iy]:n})),this.io=e,this.startIfEnabled()}}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?Ea.error("failed to load script",r):t()}))}_o(){var t=te?this._instance.config.disable_capture_url_hashes?Wo(te.location.href):te.location.href:void 0;if(t){var e=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Mu,...e||[]]:[];return Ld(t,n,Od)}Ea.error("Could not determine current URL")}}},VN={exceptionObserver:class{constructor(t){var e,n,r;this.xo=()=>{var s;if(te&&this.isEnabled&&(s=$e.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var i=$e.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=$e.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,u=$e.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.So&&this.Se.capture_unhandled_errors&&(this.So=i(this.captureException.bind(this))),!this.Co&&this.Se.capture_unhandled_rejections&&(this.Co=a(this.captureException.bind(this))),!this.Io&&this.Se.capture_console_errors&&(this.Io=u(this.captureException.bind(this)))}catch(c){Wc.error("failed to start",c),this.To()}}},this._instance=t,this.Mo=!((e=this._instance.persistence)==null||!e.props[ty]),this.Eo=new $L({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,Ae:Wc}),this.Se=this.Po(),this.startIfEnabledOrStop()}Po(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ot(t)?e=pe({},e,t):(be(t)?this.Mo:t)&&(e=pe({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Wc.info("enabled"),this.To(),this.Bt(this.xo)):this.To()}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Wc.error("failed to load script",r);t()}))}To(){var t,e,n;(t=this.So)==null||t.call(this),this.So=void 0,(e=this.Co)==null||e.call(this),this.Co=void 0,(n=this.Io)==null||n.call(this),this.Io=void 0}onRemoteConfig(t){"autocaptureExceptions"in t&&(this.Mo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[ty]:this.Mo}),this.Se=this.Po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.Po()}captureException(t){var e,n,r,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.Eo.consumeRateLimit(s)?Wc.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,n;this.Ro=[],this.Oo=new rO([new dO,new xO,new hO,new fO,new yO,new vO,new mO,new _O],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),a=1;s>a;a++)i[a-1]=arguments[a];return function(u,c){c===void 0&&(c=0);for(var f=[],h=u.split(`
18
- `),p=c;h.length>p;p++){var v=h[p];if(1024>=v.length){var y=US.test(v)?v.replace(US,"$1"):v;if(!y.match(/\S*Error: /)){for(var x of i){var _=x(y,r);if(_){f.push(_);break}}if(f.length>=50)break}}}return(function(b){if(!b.length)return[];var E=Array.from(b);return E.reverse(),E.slice(0,50).map((C=>{return pe({},C,{filename:C.filename||(P=E,P[P.length-1]||{}).filename,function:C.function||Ru});var P}))})(f)}})("web:javascript",aO,cO)),this._instance=t,this.Ro=(e=(n=this._instance.persistence)==null?void 0:n.get_property(ny))!==null&&e!==void 0?e:[],this.Lo=Kp(this.Fo()),this.Ao=new bO(this.Lo)}onConfigChange(){this.Lo=Kp(this.Fo()),this.Ao.setConfig(this.Lo)}onRemoteConfig(t){var e,n,r;if("errorTracking"in t){var s=(e=(n=t.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],i=(r=t.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Ro=s,this._instance.persistence&&this._instance.persistence.register({[ny]:this.Ro,[ry]:i})}}get Do(){var t,e=!!this._instance.get_property(ry),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Oo.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Lo.enabled)try{if(!_t(t)||t.trim().length===0)return void Ti.warn("Ignoring exception step because message must be a non-empty string");var n=this.$o(e),{sanitizedProperties:r,droppedKeys:s}=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(i).reduce(((u,c)=>wO.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(n);s.length>0&&Ti.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Ao.add(pe({[Wp]:t,[Gp]:new Date().toISOString()},r))}catch(i){Ti.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.No(e)){if(this.qo(e))return this.Bo("Exception dropped: matched a suppression rule"),void Ti.info("Skipping exception capture because a suppression rule matched");if(!this.Do&&this.jo(e))return this.Bo("Exception dropped: thrown by a browser extension"),void Ti.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ho(e))return this.Bo("Exception dropped: thrown by the PostHog SDK"),void Ti.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.Lo.enabled&&Ye(t.$exception_steps)?this.Uo(t):t;try{var r=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",an:!0});return r&&this.Ao.clear(),r}catch(s){return Ti.error("Failed to capture exception event. Dropping this exception.",s),void this.Ao.clear()}}catch(s){return void Ti.error("Failed to process exception event. Ignoring this exception.",s)}}Uo(t){try{var e=this.Ao.getAttachable();return e.length===0?t:pe({},t,{$exception_steps:e})}catch(n){return Ti.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}Bo(t){this.Lo.enabled&&this.Ao.add({[Wp]:t,[Gp]:new Date().toISOString()})}$o(t){return Ot(t)?pe({},t):{}}Fo(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}qo(t){if(t.length===0)return!1;var e=t.reduce(((n,r)=>{var{type:s,value:i}=r;return _t(s)&&s.length>0&&n.$exception_types.push(s),_t(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Ro.some((n=>{var r=n.values.map((s=>{var i,a=V6[s.operator],u=tt(s.value)?s.value:[s.value],c=(i=e[s.key])!==null&&i!==void 0?i:[];return u.length>0&&a(u,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}jo(t){return t.flatMap((e=>{var n,r;return(n=(r=e.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Ho(t){if(t.length>0){var e,n,r,s,i=(e=(n=t[0].stacktrace)==null?void 0:n.frames)!==null&&e!==void 0?e:[],a=i[i.length-1];return(r=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}No(t){return!Ye(t)&&tt(t)}}},$N=pe({productTours:class{get ti(){return this._instance.persistence}constructor(t){this.zo=null,this.Vo=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if("productTours"in t){var e,n;if(this.ti&&this.ti.register({[t2]:!!t.productTours}),!Tv(this._instance))return!this.zo&&Ye((e=this.ti)==null?void 0:e.props[id])||Pv.info("product tours disabled; stopping and clearing cached tours"),(n=this.zo)==null||n.stop(),this.zo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.zo&&Tv(this._instance)&&this.Bt((()=>this.Wo()))}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?Pv.error("Could not load product tours script",r):t()}))}Wo(){var t;!this.zo&&(t=$e.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.zo=$e.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!tt(this.Vo)||e){var n=this.ti;if(n){var r=n.props[id];if(tt(r)&&!e)return this.Vo=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",callback:s=>{if(Tv(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return Pv.error(a),void t([],{isLoaded:!1,error:a})}var u=tt(s.json.product_tours)?s.json.product_tours:[];this.Vo=u,n&&n.register({[id]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.Vo,{isLoaded:!0})}getActiveProductTours(t){Ye(this.zo)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.zo.getActiveProductTours(t)}showProductTour(t){var e;(e=this.zo)==null||e.showTourById(t)}previewTour(t){this.zo?this.zo.previewTour(t):this.Bt((()=>{var e;this.Wo(),(e=this.zo)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.zo)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.zo)==null||t.nextStep()}previousStep(){var t;(t=this.zo)==null||t.previousStep()}clearCache(){var t;this.Vo=null,(t=this.ti)==null||t.unregister(id)}resetTour(t){var e;(e=this.zo)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.zo)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.zo)==null||e.cancelPendingTour(t)}}},Um),HN={siteApps:class{constructor(t){this.Go=0,this._instance=t,this.Zo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qo(t,e){if(e){var n=this.globalsForEvent(e);this.Zo.push(n),this.Zo.length>1e3&&(this.Zo=this.Zo.slice(10))}}get siteAppLoaders(){var t;return(t=$e._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.Qo.bind(this));this.Jo=()=>{t(),this.Zo=[],this.Jo=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},f=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[p,v]of Object.entries(h))c[p]={id:f[p],type:p,properties:v};var{$set_once:y,$set:x}=t;return{event:pe({},g8(t,IN),{properties:pe({},t.properties,x?{$set:pe({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},x)}:{},y?{$set_once:pe({},(r=(s=t.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},y)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(u=t.properties)==null?void 0:u.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}Ko(t){var e,n=(e=t.tagName)==null?void 0:e.toLowerCase();return n==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(t)||(Ws.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)||(Ws.error("prepare_external_dependency_script returned null"),null):t}Yo(){var t,e,n,r,s,i,a,u;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var c=Ee==null?void 0:Ee.defaultView,f=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!f)return()=>{};if(this.Go++,this.Xo)return this.ea();var h=[],p=this,v=new WeakSet,y=(b,E,C)=>{if(b!=null&&b[E]){var P=b[E];b[E]=C(P),h.push((()=>{b[E]=P}))}},x=b=>{if(v.has(b))return b;var E=p.Ko(b);return E&&v.add(E),E},_=b=>b.map((E=>typeof E=="string"?E:x(E))).filter((E=>!ar(E)));return y(f,"appendChild",(b=>function(E){var C=x(E);return C?b.call(this,C):E})),y(f,"insertBefore",(b=>function(E,C){var P=x(E);return P?b.call(this,P,C):E})),y(f,"replaceChild",(b=>function(E,C){var P=x(E);return P?b.call(this,P,C):C})),[(e=c.Element)==null?void 0:e.prototype,(n=c.Document)==null?void 0:n.prototype,(r=c.DocumentFragment)==null?void 0:r.prototype].forEach((b=>{y(b,"append",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"prepend",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))}))})),[(s=c.Element)==null?void 0:s.prototype,(i=c.CharacterData)==null?void 0:i.prototype,(a=c.DocumentType)==null?void 0:a.prototype].forEach((b=>{y(b,"before",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"after",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];return E.apply(this,_(P))})),y(b,"replaceWith",(E=>function(){for(var C=arguments.length,P=new Array(C),T=0;C>T;T++)P[T]=arguments[T];var A=_(P);return P.length&&!A.length?void 0:E.apply(this,A)}))})),y((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(b=>function(E,C){var P=x(C);return P?b.call(this,E,P):null})),this.Xo=()=>{h.forEach((b=>b())),this.Xo=void 0},this.ea()}ea(){var t=!1;return()=>{var e;t||(t=!0,this.Go--,this.Go===0&&((e=this.Xo)==null||e.call(this)))}}ta(t,e){e===void 0&&(e=!0);var n=this.Yo();try{var r=t(n);return e&&n(),r}catch(s){throw n(),s}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var a;!e.errored&&this.Zo.length&&(Ws.info("Processing "+this.Zo.length+" events for site app with id "+t.id),this.Zo.forEach((u=>this.ta((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.Jo)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,Ws.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var{processEvent:i}=this.ta((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1);i&&(e.processEvent=i),r=!0}catch(a){Ws.error(CE+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){Ws.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}ra(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}ia(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e.ta((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){Ws.error("Error while processing event "+t.event+" for site app "+i.id,a)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(t){var e,n,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ra(),void this._instance.on("eventCaptured",(c=>this.ia(c)))):void Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.Jo)==null||n.call(this),(r=t.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(c){var f;$e["__$$ph_site_app_"+c]=s._instance,(f=$e.__PosthogExtensions__)==null||f.loadSiteApp==null||f.loadSiteApp(s._instance,u,(h=>{if(h)return Ws.error(CE+c,h)}))};for(var{id:a,url:u}of t.siteApps)i(a)}else Ws.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},zN={tracingHeaders:class{constructor(t){this.na=void 0,this.sa=void 0,this.oa=void 0,this.xo=()=>{var e,n,r=this.aa();r?(be(this.na)&&(this.na=(e=$e.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),be(this.sa)&&(this.sa=(n=$e.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.To()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Bt(t){var e,n;(e=$e.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=$e.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return AN.error("failed to load script",r);t()}))}la(){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}aa(){var t=this.la();return tt(t)?(tt(this.oa)?this.oa.splice(0,this.oa.length,...t):this.oa=[...t],t.length>0?this.oa:void 0):(tt(this.oa)&&this.oa.splice(0),this.oa=t||void 0,this.oa)}To(){var t,e;(t=this.na)==null||t.call(this),(e=this.sa)==null||e.call(this),this.na=void 0,this.sa=void 0}startIfEnabledOrStop(){this.aa()?this.Bt(this.xo):this.To()}}},UN=pe({surveys:class{get Se(){return this._instance.config}constructor(t){this.ua=void 0,this._surveyManager=null,this.ha=!1,this.da=[],this.ca=null,this.va=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Se.disable_surveys){var e=t.surveys;if(Ye(e))return yt.warn("Flags not loaded yet. Not loading surveys.");var n=tt(e);this.ua=n?e.length>0:e,yt.info("flags response received, isSurveysEnabled: "+this.ua),this.loadIfEnabled()}}reset(){try{var t;(t=this._surveyEventReceiver)==null||t.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Cy)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.ha)yt.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)yt.info(PE);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())yt.info("Not loading surveys in cookieless mode without consent.");else{var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){if(!be(this.ua)||this.Se.advanced_enable_surveys){var e=this.ua||this.Se.advanced_enable_surveys;this.ha=!0;try{var n=t.generateSurveys;if(n)return void this.fa(n,e);var r=t.loadExternalDependency;if(!r)return void this.pa(r2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.pa("Could not load surveys script",s):this.fa(t.generateSurveys,e)}))}catch(s){throw this.pa("Error initializing surveys",s),s}finally{this.ha=!1}}}else yt.error("PostHog Extensions not found.")}}fa(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new ON(this._instance),yt.info("Surveys loaded successfully"),this.ga({isLoaded:!0})}pa(t,e){yt.error(t,e),this.ga({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.da.push(t),this._surveyManager&&this.ga({isLoaded:!0}),()=>{this.da=this.da.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Se.disable_surveys)return yt.info(PE),t([]);var n,r=this._instance.get_property(ly);if(r&&!e)return t(r,{isLoaded:!0}),void(this.ma()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.ca?this.ca.then((s=>{var{surveys:i,context:a}=s;return t(i,a)})):(typeof Promise<"u"&&(this.ca=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:s=>{var i;this.ca=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;yt.error(u),this.va=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.va=null;var f,h=s.json.surveys||[],p=h.filter((y=>(function(x){return!(!x.start_date||x.end_date)})(y)&&((function(x){var _;return!((_=x.conditions)==null||(_=_.events)==null||(_=_.values)==null||!_.length)})(y)||(function(x){var _;return!((_=x.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)})(y))));p.length>0&&((f=this._surveyEventReceiver)==null||f.register(p)),(i=this._instance.persistence)==null||i.register({[ly]:h,[qp]:Date.now()});var v={isLoaded:!0};t(h,v),n==null||n({surveys:h,context:v})}}))}ma(){return this.ya()&&!this.ca&&!this.ba()}ya(){var t=this._instance.get_property(qp);return $n(t)&&Date.now()-t>3e5}ba(){return $n(this.va)&&3e5>Date.now()-this.va}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};H6(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ga(t){for(var e of this.da)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){yt.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Ye(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);yt.warn("init was not called")}_a(t){var e=null;return this.getSurveys((n=>{var r;e=(r=n.find((s=>s.id===t)))!==null&&r!==void 0?r:null})),e}wa(t){if(Ye(this._surveyManager))return{eligible:!1,reason:Av};var e=typeof t=="string"?this._a(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Ye(this._surveyManager))return yt.warn("init was not called"),{visible:!1,disabledReason:Av};var e=this.wa(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Ye(this._surveyManager)?(yt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Av})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((u=>u.id===t)))!==null&&s!==void 0?s:null;if(i){var a=this.wa(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Ye(this._surveyManager))yt.warn("init was not called");else{var s=typeof t=="string"?this._a(t):t;if(s!=null&&s.id)if(xN.includes(s.type)){var i=Ee==null?void 0:Ee.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(yt.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;yt.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(u=this._surveyManager)==null||u.renderSurvey(s,i,n),yt.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);yt.warn("Survey element not found")}else yt.warn("Surveys of type "+s.type+" cannot be rendered in the app");else yt.warn("Survey not found")}}displaySurvey(t,e){var n;if(Ye(this._surveyManager))yt.warn("init was not called");else{var r=this._a(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=pe({},r,{appearance:pe({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==_y.Popover&&e.initialResponses&&yt.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void yt.warn("Survey is not eligible to be displayed: ",i.disabledReason)}e.displayType!==_y.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else yt.warn("Survey not found")}}cancelPendingSurvey(t){Ye(this._surveyManager)?yt.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},Um),BN={toolbar:class{constructor(t){this.instance=t}xa(t){$e.ph_toolbar_state=t}ka(){var t;return(t=$e.ph_toolbar_state)!==null&&t!==void 0?t:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,n){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),s6(this.instance.config)||!te||!Ee)return!1;t=t??te.location,n=n??te.history;try{if(!e){try{te.localStorage.setItem("test","test"),te.localStorage.removeItem("test")}catch{return!1}e=te==null?void 0:te.localStorage}var r,s=NN||nm(t.hash,"__posthog")||nm(t.hash,"state"),i=s?WS((()=>JSON.parse(atob(decodeURIComponent(s)))))||WS((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?t.hash=i.desiredHash:n?n.replaceState(n.state,"",t.pathname+t.search):t.hash="")):((r=JSON.parse(e.getItem(TE)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Sa(t){var e=$e.ph_load_toolbar||$e.ph_load_editor;!Ye(e)&&Ts(e)?e(t,this.instance):AE.warn("No toolbar load function found")}loadToolbar(t){var e=!(Ee==null||!Ee.getElementById(e6));if(!te||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=pe({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(te.localStorage.setItem(TE,JSON.stringify(pe({},r,{source:void 0}))),this.ka()===2)this.Sa(r);else if(this.ka()===0){var s;this.xa(1),(s=$e.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return AE.error("[Toolbar] Failed to load",i),void this.xa(0);this.xa(2),this.Sa(r)})),$t(te,"turbolinks:load",(()=>{this.xa(0),this.loadToolbar(r)}))}return!0}Ca(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,n){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(t,e,n)}}},WN=pe({experiments:Kn},Um),GN={conversations:class{constructor(t){this.Ia=void 0,this._conversationsManager=null,this.Ta=!1,this.Ma=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;Ye(e)||(ai(e)?this.Ia=e:(this.Ia=e.enabled,this.Ma=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ia=void 0,this.Ma=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ta||this._instance.config.disable_conversations||s6(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t&&!be(this.Ia)&&this.Ia)if(this.Ma&&this.Ma.token){this.Ta=!0;try{var e=t.initConversations;if(e)return this.Ea(e),void(this.Ta=!1);var n=t.loadExternalDependency;if(!n)return void this.Pa(r2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.Pa("Could not load conversations script",r):this.Ea(t.initConversations),this.Ta=!1}))}catch(r){this.Pa("Error initializing conversations",r),this.Ta=!1}}else rs.error("Conversations enabled but missing token in remote config.")}}Ea(t){if(this.Ma)try{this._conversationsManager=t(this.Ma,this._instance),rs.info("Conversations loaded successfully")}catch(e){this.Pa("Error completing conversations initialization",e)}else rs.error("Cannot complete initialization: remote config is null")}Pa(t,e){rs.error(t,e),this._conversationsManager=null,this.Ta=!1}show(){this._conversationsManager?this._conversationsManager.show():rs.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ia===!0&&!ar(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,n){var r=this;return en((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(rs.warn(Ca),null)}))()}getMessages(t,e){var n=this;return en((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(rs.warn(Ca),null)}))()}markAsRead(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(rs.warn(Ca),null)}))()}getTickets(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(rs.warn(Ca),null)}))()}requestRestoreLink(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(rs.warn(Ca),null)}))()}restoreFromToken(t){var e=this;return en((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(rs.warn(Ca),null)}))()}restoreFromUrlToken(){var t=this;return en((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(rs.warn(Ca),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}vn(){var t;(t=this._conversationsManager)==null||t.setIdentity()}fn(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},KN={logs:class{constructor(t){var e;this.Ra=!1,this.Oa=!1,this.Ae=Dt("[logs]"),this.Or=[],this.La=[],this.ys=0,this.Fa=()=>{var n,r;this.ys=0,(n=this.Aa)==null||n.onReconnect(),(r=this.Da)==null||r.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Ra=!0),te&&$t(te,"online",this.Fa)}$a(t,e,n,r){var s,i=(function(a,u){var c,f,h,p,v,y,x,_=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,b=(f=a==null?void 0:a.maxBufferSize)!==null&&f!==void 0?f:100,E=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,C=be(E)?Math.max(b,2048):Math.max(b,E),P=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(v=P==null?void 0:P["service.name"])!==null&&v!==void 0?v:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(y=P==null?void 0:P["service.version"])!==null&&y!==void 0?y:a==null?void 0:a.serviceVersion,environment:(x=P==null?void 0:P["deployment.environment"])!==null&&x!==void 0?x:a==null?void 0:a.environment,resourceAttributes:P,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:_,maxBufferSize:b,maxQueueSize:C,maxBatchRecordsPerPost:100,rateCapWindowMs:_,maxLogsPerInterval:E,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new eO(this.Na(t,e),i,this.Ae,(()=>this.qa()),(a=>a()),void 0,r),i]}Ba(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;return this.Aa&&this.ja===n||((e=this.Aa)==null||e.reset(),this.ja=n,[this.Aa,this.Ha]=this.$a((()=>this.Or),(r=>{this.Or=r}))),this.Aa}Ua(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;return this.Da&&this.za===n||((e=this.Da)==null||e.reset(),this.za=n,[this.Da,this.Va]=this.$a((()=>this.La),(r=>{this.La=r}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},LE)),this.Da}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,n=(e=t.logs)==null?void 0:e.captureConsoleLogs;!Ye(n)&&n&&(this.Ra=!0,this.loadIfEnabled())}reset(){var t,e;this.Or=[],(t=this.Aa)==null||t.reset(),this.La=[],(e=this.Da)==null||e.reset(),this.ys=0}captureLog(t){this.Ba().captureLog(t)}le(t){this.Ua().captureLog(t)}get logger(){return this.Wa||(this.Wa={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.Wa}flushLogs(t){t?this.Ga(t):(this.Aa&&this.Aa.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))),this.Da&&this.Da.flush().catch((e=>this.Ae.error("PostHog logs flush failed:",e))))}loadIfEnabled(){if(this.Ra&&!this.Oa){var t=$e==null?void 0:$e.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.Ae.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.Oa=!0)})):this.Ae.error(r2)}else this.Ae.error("PostHog Extensions not found.")}}Na(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Di.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Di.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},ht:r=>this.ht(r),getLibraryId:()=>Vt.LIB_NAME,getLibraryVersion:()=>Vt.LIB_VERSION}}ht(t){return new Promise((e=>{if(_6(this.ys,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>r({kind:"retry-later",error:new Error("logs request timed out")})),9e4);this._instance._send_request({method:"POST",url:this.Za(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.Qa(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var u;r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}Qa(t){(t!==0||this._instance.__loaded)&&(this.ys=x6(t,this.ys,3,(()=>this.Ae.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."))))}Ga(t){this.Or.length>0&&this.Ja(t,this.Or,this.Ha,Vt.LIB_NAME,(e=>{this.Or=e})),this.La.length>0&&this.Ja(t,this.La,this.Va,LE,(e=>{this.La=e}))}Ja(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=B8(i,U8(n,Vt.LIB_NAME,Vt.LIB_VERSION),r,Vt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Za(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}Za(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}qa(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n,windowId:r,sessionStartTimestamp:s,lastActivityTimestamp:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);e.sessionId=n,e.windowId=r,Ye(s)||(e.sessionStartTimestamp=s),Ye(i)||(e.lastActivityTimestamp=i)}if($e!=null&&(t=$e.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Wo($e.location.href):$e.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},ZN={metrics:class{constructor(t){this.Ae=Dt("[metrics]"),this._instance=t}initialize(){}Ba(){var t,e,n,r,s,i,a,u,c,f=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.Aa&&this.ja===f||((e=this.Aa)==null||e.reset(),this.ja=f,this.Aa=new tO(this.Na(),{serviceName:(r=(c=(n=f)==null?void 0:n.resourceAttributes)==null?void 0:c["service.name"])!==null&&r!==void 0?r:n==null?void 0:n.serviceName,serviceVersion:(s=c==null?void 0:c["service.version"])!==null&&s!==void 0?s:n==null?void 0:n.serviceVersion,environment:(i=c==null?void 0:c["deployment.environment"])!==null&&i!==void 0?i:n==null?void 0:n.environment,resourceAttributes:c,beforeSend:n==null?void 0:n.beforeSend,flushIntervalMs:(a=n==null?void 0:n.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(u=n==null?void 0:n.maxSeriesPerFlush)!==null&&u!==void 0?u:1e3},this.Ae)),this.Aa}count(t,e,n){e===void 0&&(e=1),this.Ba().count(t,e,n)}gauge(t,e,n){this.Ba().gauge(t,e,n)}histogram(t,e,n){this.Ba().histogram(t,e,n)}flush(t){if(!this.Aa)return Promise.resolve();if(t){var e=this.Aa.drainWindow();return e&&this.Tt(e,t),Promise.resolve()}return this.Aa.flush().catch((n=>this.Ae.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.Aa)==null||t.reset()}Na(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Tt:n=>e.Tt(n),getLibraryId:()=>Vt.LIB_NAME,getLibraryVersion:()=>Vt.LIB_VERSION}}Tt(t,e){return new Promise((n=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(i),n(a))},i=setTimeout((()=>s({kind:"retry-later",error:new Error("metrics request timed out")})),9e4);this._instance._send_request(pe({method:"POST",url:this.Ka(),data:t,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var u=a.statusCode;if(u>=200&&300>u)s({kind:"ok"});else if(u===413)s({kind:"too-large"});else if(u!==0&&u!==429&&500>u)s({kind:"fatal",error:new Error("metrics request failed with status "+u)});else{var c;s({kind:"retry-later",error:(c=a.error)!==null&&c!==void 0?c:new Error("metrics request failed with status "+u)})}}}))}))}Ka(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},qN=pe({},Um,jN,FN,VN,$N,HN,UN,zN,BN,WN,GN,KN,ZN);as.__defaultExtensionClasses=pe({},qN);var Te=(function(){Vt.SDK_DIST_CHANNEL="npm";var t=pd[Xl]=new as;return(function(){function e(){e.done||(e.done=!0,U6=!1,bt(pd,(function(n){n._dom_loaded()})))}Ee!=null&&Ee.addEventListener?Ee.readyState==="complete"?e():$t(Ee,"DOMContentLoaded",e,{capture:!1}):te&&_e.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),B6;function YN(t){B6=t}function Ty(){return B6}var d2=g.createContext({get client(){return Ty()},bootstrap:void 0});function W6(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,a=r;i<a.length;i++){var u=a[i];if(!s.includes(u)||!W6(t[u],e[u],n))return!1}return!0}function XN(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,u=g.useRef(null),c=g.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`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),s;var f=Ty();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."),f},[s,i,JSON.stringify(a)]);return g.useEffect(function(){if(!(s||!i)){var f=Ty(),h=u.current;h?(i!==h.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."),a&&!W6(a,h.options)&&f.set_config(a),u.current={apiKey:i,options:a??{}}):(f.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),f.init(i,a),u.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ve.createElement(d2.Provider,{value:{client:c,bootstrap:(e=a==null?void 0:a.bootstrap)!==null&&e!==void 0?e:(n=s==null?void 0:s.config)===null||n===void 0?void 0:n.bootstrap}},r)}var Iv=function(t){return typeof t=="function"},QN=function(){var t=g.useContext(d2).client;return t},Ay=function(t,e){return Ay=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Ay(t,e)};function JN(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ay(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var eD={componentStack:null,exceptionEvent:null,error:null},tD={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},nD=(function(t){JN(e,t);function e(n){var r=t.call(this,n)||this;return r.state=eD,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;Iv(s)?i=s(n):typeof s=="object"&&(i=s);var a=this.context.client,u=a.captureException(n,i),c=r.componentStack;this.setState({error:n,componentStack:c??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 Iv(r)?r():r;var a=Iv(s)?ve.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ve.isValidElement(a)?a:(console.warn(tD.INVALID_FALLBACK),ve.createElement(ve.Fragment,null))},e.contextType=d2,e})(ve.Component);YN(Te);var Fh={},Mv={exports:{}},mr={},Lv={exports:{}},Ov={};/**
19
- * @license React
20
- * scheduler.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var OE;function rD(){return OE||(OE=1,(function(t){function e($,ee){var H=$.length;$.push(ee);e:for(;0<H;){var D=H-1>>>1,q=$[D];if(0<s(q,ee))$[D]=ee,$[H]=q,H=D;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var ee=$[0],H=$.pop();if(H!==ee){$[0]=H;e:for(var D=0,q=$.length,re=q>>>1;D<re;){var se=2*(D+1)-1,oe=$[se],ue=se+1,de=$[ue];if(0>s(oe,H))ue<q&&0>s(de,oe)?($[D]=de,$[ue]=H,D=ue):($[D]=oe,$[se]=H,D=se);else if(ue<q&&0>s(de,H))$[D]=de,$[ue]=H,D=ue;else break e}}return ee}function s($,ee){var H=$.sortIndex-ee.sortIndex;return H!==0?H:$.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var c=[],f=[],h=1,p=null,v=3,y=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function P($){for(var ee=n(f);ee!==null;){if(ee.callback===null)r(f);else if(ee.startTime<=$)r(f),ee.sortIndex=ee.expirationTime,e(c,ee);else break;ee=n(f)}}function T($){if(_=!1,P($),!x)if(n(c)!==null)x=!0,B(A);else{var ee=n(f);ee!==null&&X(T,ee.startTime-$)}}function A($,ee){x=!1,_&&(_=!1,E(R),R=-1),y=!0;var H=v;try{for(P(ee),p=n(c);p!==null&&(!(p.expirationTime>ee)||$&&!j());){var D=p.callback;if(typeof D=="function"){p.callback=null,v=p.priorityLevel;var q=D(p.expirationTime<=ee);ee=t.unstable_now(),typeof q=="function"?p.callback=q:p===n(c)&&r(c),P(ee)}else r(c);p=n(c)}if(p!==null)var re=!0;else{var se=n(f);se!==null&&X(T,se.startTime-ee),re=!1}return re}finally{p=null,v=H,y=!1}}var O=!1,M=null,R=-1,L=5,N=-1;function j(){return!(t.unstable_now()-N<L)}function V(){if(M!==null){var $=t.unstable_now();N=$;var ee=!0;try{ee=M(!0,$)}finally{ee?G():(O=!1,M=null)}}else O=!1}var G;if(typeof C=="function")G=function(){C(V)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,K=Y.port2;Y.port1.onmessage=V,G=function(){K.postMessage(null)}}else G=function(){b(V,0)};function B($){M=$,O||(O=!0,G())}function X($,ee){R=b(function(){$(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($){$.callback=null},t.unstable_continueExecution=function(){x||y||(x=!0,B(A))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function($){switch(v){case 1:case 2:case 3:var ee=3;break;default:ee=v}var H=v;v=ee;try{return $()}finally{v=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,ee){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=v;v=$;try{return ee()}finally{v=H}},t.unstable_scheduleCallback=function($,ee,H){var D=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?D+H:D):H=D,$){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=H+q,$={id:h++,callback:ee,priorityLevel:$,startTime:H,expirationTime:q,sortIndex:-1},H>D?($.sortIndex=H,e(f,$),n(c)===null&&$===n(f)&&(_?(E(R),R=-1):_=!0,X(T,H-D))):($.sortIndex=q,e(c,$),x||y||(x=!0,B(A))),$},t.unstable_shouldYield=j,t.unstable_wrapCallback=function($){var ee=v;return function(){var H=v;v=ee;try{return $.apply(this,arguments)}finally{v=H}}}})(Ov)),Ov}var NE;function sD(){return NE||(NE=1,Lv.exports=rD()),Lv.exports}/**
27
- * @license React
28
- * react-dom.production.min.js
29
- *
30
- * Copyright (c) Facebook, Inc. and its affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var DE;function iD(){if(DE)return mr;DE=1;var t=U_(),e=sD();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+l+" 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(o,l){a(o,l),a(o+"Capture",l)}function a(o,l){for(s[o]=l,o=0;o<l.length;o++)r.add(l[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function v(o){return c.call(p,o)?!0:c.call(h,o)?!1:f.test(o)?p[o]=!0:(h[o]=!0,!1)}function y(o,l,d,m){if(d!==null&&d.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return m?!1:d!==null?!d.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function x(o,l,d,m){if(l===null||typeof l>"u"||y(o,l,d,m))return!0;if(m)return!1;if(d!==null)switch(d.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function _(o,l,d,m,w,k,I){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=m,this.attributeNamespace=w,this.mustUseProperty=d,this.propertyName=o,this.type=l,this.sanitizeURL=k,this.removeEmptyString=I}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){b[o]=new _(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var l=o[0];b[l]=new _(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){b[o]=new _(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){b[o]=new _(o,2,!1,o,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(o){b[o]=new _(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){b[o]=new _(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){b[o]=new _(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){b[o]=new _(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){b[o]=new _(o,5,!1,o.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function C(o){return o[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(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var l=o.replace(E,C);b[l]=new _(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){b[o]=new _(o,1,!1,o.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){b[o]=new _(o,1,!1,o.toLowerCase(),null,!0,!0)});function P(o,l,d,m){var w=b.hasOwnProperty(l)?b[l]:null;(w!==null?w.type!==0:m||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(x(l,d,w,m)&&(d=null),m||w===null?v(l)&&(d===null?o.removeAttribute(l):o.setAttribute(l,""+d)):w.mustUseProperty?o[w.propertyName]=d===null?w.type===3?!1:"":d:(l=w.attributeName,m=w.attributeNamespace,d===null?o.removeAttribute(l):(w=w.type,d=w===3||w===4&&d===!0?"":""+d,m?o.setAttributeNS(m,l,d):o.setAttribute(l,d))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),O=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),j=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),$=Symbol.iterator;function ee(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,D;function q(o){if(D===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);D=l&&l[1]||""}return`
35
- `+D+o}var re=!1;function se(o,l){if(!o||re)return"";re=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ne){var m=ne}Reflect.construct(o,[],l)}else{try{l.call()}catch(ne){m=ne}o.call(l.prototype)}else{try{throw Error()}catch(ne){m=ne}o()}}catch(ne){if(ne&&m&&typeof ne.stack=="string"){for(var w=ne.stack.split(`
36
- `),k=m.stack.split(`
37
- `),I=w.length-1,F=k.length-1;1<=I&&0<=F&&w[I]!==k[F];)F--;for(;1<=I&&0<=F;I--,F--)if(w[I]!==k[F]){if(I!==1||F!==1)do if(I--,F--,0>F||w[I]!==k[F]){var U=`
38
- `+w[I].replace(" at new "," at ");return o.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",o.displayName)),U}while(1<=I&&0<=F);break}}}finally{re=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?q(o):""}function oe(o){switch(o.tag){case 5:return q(o.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("SuspenseList");case 0:case 2:case 15:return o=se(o.type,!1),o;case 11:return o=se(o.type.render,!1),o;case 1:return o=se(o.type,!0),o;default:return""}}function ue(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case M:return"Fragment";case O:return"Portal";case L:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case Y:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case j:return(o.displayName||"Context")+".Consumer";case N:return(o._context.displayName||"Context")+".Provider";case V:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case K:return l=o.displayName||null,l!==null?l:ue(o.type)||"Memo";case B:l=o._payload,o=o._init;try{return ue(o(l))}catch{}}return null}function de(o){var l=o.type;switch(o.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=l.render,o=o.displayName||o.name||"",l.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(l);case 8:return l===R?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ie(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ae(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function me(o){var l=ae(o)?"checked":"value",d=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),m=""+o[l];if(!o.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var w=d.get,k=d.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return w.call(this)},set:function(I){m=""+I,k.call(this,I)}}),Object.defineProperty(o,l,{enumerable:d.enumerable}),{getValue:function(){return m},setValue:function(I){m=""+I},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Se(o){o._valueTracker||(o._valueTracker=me(o))}function Re(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),m="";return o&&(m=ae(o)?o.checked?"true":"false":o.value),o=m,o!==d?(l.setValue(o),!0):!1}function Ke(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function it(o,l){var d=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??o._wrapperState.initialChecked})}function Oe(o,l){var d=l.defaultValue==null?"":l.defaultValue,m=l.checked!=null?l.checked:l.defaultChecked;d=ie(l.value!=null?l.value:d),o._wrapperState={initialChecked:m,initialValue:d,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function at(o,l){l=l.checked,l!=null&&P(o,"checked",l,!1)}function It(o,l){at(o,l);var d=ie(l.value),m=l.type;if(d!=null)m==="number"?(d===0&&o.value===""||o.value!=d)&&(o.value=""+d):o.value!==""+d&&(o.value=""+d);else if(m==="submit"||m==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?je(o,l.type,d):l.hasOwnProperty("defaultValue")&&je(o,l.type,ie(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function mt(o,l,d){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var m=l.type;if(!(m!=="submit"&&m!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,d||l===o.value||(o.value=l),o.defaultValue=l}d=o.name,d!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,d!==""&&(o.name=d)}function je(o,l,d){(l!=="number"||Ke(o.ownerDocument)!==o)&&(d==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+d&&(o.defaultValue=""+d))}var Qe=Array.isArray;function lt(o,l,d,m){if(o=o.options,l){l={};for(var w=0;w<d.length;w++)l["$"+d[w]]=!0;for(d=0;d<o.length;d++)w=l.hasOwnProperty("$"+o[d].value),o[d].selected!==w&&(o[d].selected=w),w&&m&&(o[d].defaultSelected=!0)}else{for(d=""+ie(d),l=null,w=0;w<o.length;w++){if(o[w].value===d){o[w].selected=!0,m&&(o[w].defaultSelected=!0);return}l!==null||o[w].disabled||(l=o[w])}l!==null&&(l.selected=!0)}}function Je(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function vt(o,l){var d=l.value;if(d==null){if(d=l.children,l=l.defaultValue,d!=null){if(l!=null)throw Error(n(92));if(Qe(d)){if(1<d.length)throw Error(n(93));d=d[0]}l=d}l==null&&(l=""),d=l}o._wrapperState={initialValue:ie(d)}}function xn(o,l){var d=ie(l.value),m=ie(l.defaultValue);d!=null&&(d=""+d,d!==o.value&&(o.value=d),l.defaultValue==null&&o.defaultValue!==d&&(o.defaultValue=d)),m!=null&&(o.defaultValue=""+m)}function zt(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function An(o){switch(o){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 Xn(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?An(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Pr,Qn=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,d,m,w){MSApp.execUnsafeLocalFunction(function(){return o(l,d,m,w)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(Pr=Pr||document.createElement("div"),Pr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Pr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function wn(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var Os={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},Ns=["Webkit","ms","Moz","O"];Object.keys(Os).forEach(function(o){Ns.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),Os[l]=Os[o]})});function Rn(o,l,d){return l==null||typeof l=="boolean"||l===""?"":d||typeof l!="number"||l===0||Os.hasOwnProperty(o)&&Os[o]?(""+l).trim():l+"px"}function pi(o,l){o=o.style;for(var d in l)if(l.hasOwnProperty(d)){var m=d.indexOf("--")===0,w=Rn(d,l[d],m);d==="float"&&(d="cssFloat"),m?o.setProperty(d,w):o[d]=w}}var mi=H({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 ps(o,l){if(l){if(mi[o]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Ds(o,l){if(o.indexOf("-")===-1)return typeof l.is=="string";switch(o){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 ur=null;function In(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var oa=null,Zr=null,Tr=null;function gi(o){if(o=wc(o)){if(typeof oa!="function")throw Error(n(280));var l=o.stateNode;l&&(l=Hf(l),oa(o.stateNode,o.type,l))}}function Ze(o){Zr?Tr?Tr.push(o):Tr=[o]:Zr=o}function Pt(){if(Zr){var o=Zr,l=Tr;if(Tr=Zr=null,gi(o),l)for(o=0;o<l.length;o++)gi(l[o])}}function nn(o,l){return o(l)}function bn(){}var js=!1;function Ut(o,l,d){if(js)return o(l,d);js=!0;try{return nn(o,l,d)}finally{js=!1,(Zr!==null||Tr!==null)&&(bn(),Pt())}}function rn(o,l){var d=o.stateNode;if(d===null)return null;var m=Hf(d);if(m===null)return null;d=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(n(231,l,typeof d));return d}var ms=!1;if(u)try{var fn={};Object.defineProperty(fn,"passive",{get:function(){ms=!0}}),window.addEventListener("test",fn,fn),window.removeEventListener("test",fn,fn)}catch{ms=!1}function Jn(o,l,d,m,w,k,I,F,U){var ne=Array.prototype.slice.call(arguments,3);try{l.apply(d,ne)}catch(fe){this.onError(fe)}}var Fs=!1,er=null,aa=!1,Qu=null,Ju={onError:function(o){Fs=!0,er=o}};function E0(o,l,d,m,w,k,I,F,U){Fs=!1,er=null,Jn.apply(Ju,arguments)}function k0(o,l,d,m,w,k,I,F,U){if(E0.apply(this,arguments),Fs){if(Fs){var ne=er;Fs=!1,er=null}else throw Error(n(198));aa||(aa=!0,Qu=ne)}}function vi(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function wf(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function ml(o){if(vi(o)!==o)throw Error(n(188))}function ec(o){var l=o.alternate;if(!l){if(l=vi(o),l===null)throw Error(n(188));return l!==o?null:o}for(var d=o,m=l;;){var w=d.return;if(w===null)break;var k=w.alternate;if(k===null){if(m=w.return,m!==null){d=m;continue}break}if(w.child===k.child){for(k=w.child;k;){if(k===d)return ml(w),o;if(k===m)return ml(w),l;k=k.sibling}throw Error(n(188))}if(d.return!==m.return)d=w,m=k;else{for(var I=!1,F=w.child;F;){if(F===d){I=!0,d=w,m=k;break}if(F===m){I=!0,m=w,d=k;break}F=F.sibling}if(!I){for(F=k.child;F;){if(F===d){I=!0,d=k,m=w;break}if(F===m){I=!0,m=k,d=w;break}F=F.sibling}if(!I)throw Error(n(189))}}if(d.alternate!==m)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?o:l}function tc(o){return o=ec(o),o!==null?bf(o):null}function bf(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=bf(o);if(l!==null)return l;o=o.sibling}return null}var nc=e.unstable_scheduleCallback,eo=e.unstable_cancelCallback,Sf=e.unstable_shouldYield,rc=e.unstable_requestPaint,Bt=e.unstable_now,Ef=e.unstable_getCurrentPriorityLevel,to=e.unstable_ImmediatePriority,gl=e.unstable_UserBlockingPriority,la=e.unstable_NormalPriority,kf=e.unstable_LowPriority,sc=e.unstable_IdlePriority,ua=null,z=null;function le(o){if(z&&typeof z.onCommitFiberRoot=="function")try{z.onCommitFiberRoot(ua,o,void 0,(o.current.flags&128)===128)}catch{}}var xe=Math.clz32?Math.clz32:Ce,ge=Math.log,we=Math.LN2;function Ce(o){return o>>>=0,o===0?32:31-(ge(o)/we|0)|0}var We=64,ke=4194304;function hn(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Mn(o,l){var d=o.pendingLanes;if(d===0)return 0;var m=0,w=o.suspendedLanes,k=o.pingedLanes,I=d&268435455;if(I!==0){var F=I&~w;F!==0?m=hn(F):(k&=I,k!==0&&(m=hn(k)))}else I=d&~w,I!==0?m=hn(I):k!==0&&(m=hn(k));if(m===0)return 0;if(l!==0&&l!==m&&(l&w)===0&&(w=m&-m,k=l&-l,w>=k||w===16&&(k&4194240)!==0))return l;if((m&4)!==0&&(m|=d&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=m;0<l;)d=31-xe(l),w=1<<d,m|=o[d],l&=~w;return m}function Vs(o,l){switch(o){case 1:case 2:case 4:return l+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 l+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 $s(o,l){for(var d=o.suspendedLanes,m=o.pingedLanes,w=o.expirationTimes,k=o.pendingLanes;0<k;){var I=31-xe(k),F=1<<I,U=w[I];U===-1?((F&d)===0||(F&m)!==0)&&(w[I]=Vs(F,l)):U<=l&&(o.expiredLanes|=F),k&=~F}}function qr(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Sn(){var o=We;return We<<=1,(We&4194240)===0&&(We=64),o}function Yr(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Ar(o,l,d){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-xe(l),o[l]=d}function aI(o,l){var d=o.pendingLanes&~l;o.pendingLanes=l,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=l,o.mutableReadLanes&=l,o.entangledLanes&=l,l=o.entanglements;var m=o.eventTimes;for(o=o.expirationTimes;0<d;){var w=31-xe(d),k=1<<w;l[w]=0,m[w]=-1,o[w]=-1,d&=~k}}function C0(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var m=31-xe(d),w=1<<m;w&l|o[m]&l&&(o[m]|=l),d&=~w}}var gt=0;function Ux(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Bx,P0,Wx,Gx,Kx,T0=!1,Cf=[],no=null,ro=null,so=null,ic=new Map,oc=new Map,io=[],lI="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 Zx(o,l){switch(o){case"focusin":case"focusout":no=null;break;case"dragenter":case"dragleave":ro=null;break;case"mouseover":case"mouseout":so=null;break;case"pointerover":case"pointerout":ic.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":oc.delete(l.pointerId)}}function ac(o,l,d,m,w,k){return o===null||o.nativeEvent!==k?(o={blockedOn:l,domEventName:d,eventSystemFlags:m,nativeEvent:k,targetContainers:[w]},l!==null&&(l=wc(l),l!==null&&P0(l)),o):(o.eventSystemFlags|=m,l=o.targetContainers,w!==null&&l.indexOf(w)===-1&&l.push(w),o)}function uI(o,l,d,m,w){switch(l){case"focusin":return no=ac(no,o,l,d,m,w),!0;case"dragenter":return ro=ac(ro,o,l,d,m,w),!0;case"mouseover":return so=ac(so,o,l,d,m,w),!0;case"pointerover":var k=w.pointerId;return ic.set(k,ac(ic.get(k)||null,o,l,d,m,w)),!0;case"gotpointercapture":return k=w.pointerId,oc.set(k,ac(oc.get(k)||null,o,l,d,m,w)),!0}return!1}function qx(o){var l=ca(o.target);if(l!==null){var d=vi(l);if(d!==null){if(l=d.tag,l===13){if(l=wf(d),l!==null){o.blockedOn=l,Kx(o.priority,function(){Wx(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Pf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=R0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(d===null){d=o.nativeEvent;var m=new d.constructor(d.type,d);ur=m,d.target.dispatchEvent(m),ur=null}else return l=wc(d),l!==null&&P0(l),o.blockedOn=d,!1;l.shift()}return!0}function Yx(o,l,d){Pf(o)&&d.delete(l)}function cI(){T0=!1,no!==null&&Pf(no)&&(no=null),ro!==null&&Pf(ro)&&(ro=null),so!==null&&Pf(so)&&(so=null),ic.forEach(Yx),oc.forEach(Yx)}function lc(o,l){o.blockedOn===l&&(o.blockedOn=null,T0||(T0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,cI)))}function uc(o){function l(w){return lc(w,o)}if(0<Cf.length){lc(Cf[0],o);for(var d=1;d<Cf.length;d++){var m=Cf[d];m.blockedOn===o&&(m.blockedOn=null)}}for(no!==null&&lc(no,o),ro!==null&&lc(ro,o),so!==null&&lc(so,o),ic.forEach(l),oc.forEach(l),d=0;d<io.length;d++)m=io[d],m.blockedOn===o&&(m.blockedOn=null);for(;0<io.length&&(d=io[0],d.blockedOn===null);)qx(d),d.blockedOn===null&&io.shift()}var vl=T.ReactCurrentBatchConfig,Tf=!0;function dI(o,l,d,m){var w=gt,k=vl.transition;vl.transition=null;try{gt=1,A0(o,l,d,m)}finally{gt=w,vl.transition=k}}function fI(o,l,d,m){var w=gt,k=vl.transition;vl.transition=null;try{gt=4,A0(o,l,d,m)}finally{gt=w,vl.transition=k}}function A0(o,l,d,m){if(Tf){var w=R0(o,l,d,m);if(w===null)K0(o,l,m,Af,d),Zx(o,m);else if(uI(w,o,l,d,m))m.stopPropagation();else if(Zx(o,m),l&4&&-1<lI.indexOf(o)){for(;w!==null;){var k=wc(w);if(k!==null&&Bx(k),k=R0(o,l,d,m),k===null&&K0(o,l,m,Af,d),k===w)break;w=k}w!==null&&m.stopPropagation()}else K0(o,l,m,null,d)}}var Af=null;function R0(o,l,d,m){if(Af=null,o=In(m),o=ca(o),o!==null)if(l=vi(o),l===null)o=null;else if(d=l.tag,d===13){if(o=wf(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return Af=o,null}function Xx(o){switch(o){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(Ef()){case to:return 1;case gl:return 4;case la:case kf:return 16;case sc:return 536870912;default:return 16}default:return 16}}var oo=null,I0=null,Rf=null;function Qx(){if(Rf)return Rf;var o,l=I0,d=l.length,m,w="value"in oo?oo.value:oo.textContent,k=w.length;for(o=0;o<d&&l[o]===w[o];o++);var I=d-o;for(m=1;m<=I&&l[d-m]===w[k-m];m++);return Rf=w.slice(o,1<m?1-m:void 0)}function If(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Mf(){return!0}function Jx(){return!1}function Rr(o){function l(d,m,w,k,I){this._reactName=d,this._targetInst=w,this.type=m,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var F in o)o.hasOwnProperty(F)&&(d=o[F],this[F]=d?d(k):k[F]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Mf:Jx,this.isPropagationStopped=Jx,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Mf)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Mf)},persist:function(){},isPersistent:Mf}),l}var yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},M0=Rr(yl),cc=H({},yl,{view:0,detail:0}),hI=Rr(cc),L0,O0,dc,Lf=H({},cc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:D0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==dc&&(dc&&o.type==="mousemove"?(L0=o.screenX-dc.screenX,O0=o.screenY-dc.screenY):O0=L0=0,dc=o),L0)},movementY:function(o){return"movementY"in o?o.movementY:O0}}),ew=Rr(Lf),pI=H({},Lf,{dataTransfer:0}),mI=Rr(pI),gI=H({},cc,{relatedTarget:0}),N0=Rr(gI),vI=H({},yl,{animationName:0,elapsedTime:0,pseudoElement:0}),yI=Rr(vI),_I=H({},yl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),xI=Rr(_I),wI=H({},yl,{data:0}),tw=Rr(wI),bI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},SI={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"},EI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kI(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=EI[o])?!!l[o]:!1}function D0(){return kI}var CI=H({},cc,{key:function(o){if(o.key){var l=bI[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=If(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?SI[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:D0,charCode:function(o){return o.type==="keypress"?If(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?If(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),PI=Rr(CI),TI=H({},Lf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nw=Rr(TI),AI=H({},cc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:D0}),RI=Rr(AI),II=H({},yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),MI=Rr(II),LI=H({},Lf,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),OI=Rr(LI),NI=[9,13,27,32],j0=u&&"CompositionEvent"in window,fc=null;u&&"documentMode"in document&&(fc=document.documentMode);var DI=u&&"TextEvent"in window&&!fc,rw=u&&(!j0||fc&&8<fc&&11>=fc),sw=" ",iw=!1;function ow(o,l){switch(o){case"keyup":return NI.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aw(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var _l=!1;function jI(o,l){switch(o){case"compositionend":return aw(l);case"keypress":return l.which!==32?null:(iw=!0,sw);case"textInput":return o=l.data,o===sw&&iw?null:o;default:return null}}function FI(o,l){if(_l)return o==="compositionend"||!j0&&ow(o,l)?(o=Qx(),Rf=I0=oo=null,_l=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return rw&&l.locale!=="ko"?null:l.data;default:return null}}var VI={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 lw(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!VI[o.type]:l==="textarea"}function uw(o,l,d,m){Ze(m),l=Ff(l,"onChange"),0<l.length&&(d=new M0("onChange","change",null,d,m),o.push({event:d,listeners:l}))}var hc=null,pc=null;function $I(o){Pw(o,0)}function Of(o){var l=El(o);if(Re(l))return o}function HI(o,l){if(o==="change")return l}var cw=!1;if(u){var F0;if(u){var V0="oninput"in document;if(!V0){var dw=document.createElement("div");dw.setAttribute("oninput","return;"),V0=typeof dw.oninput=="function"}F0=V0}else F0=!1;cw=F0&&(!document.documentMode||9<document.documentMode)}function fw(){hc&&(hc.detachEvent("onpropertychange",hw),pc=hc=null)}function hw(o){if(o.propertyName==="value"&&Of(pc)){var l=[];uw(l,pc,o,In(o)),Ut($I,l)}}function zI(o,l,d){o==="focusin"?(fw(),hc=l,pc=d,hc.attachEvent("onpropertychange",hw)):o==="focusout"&&fw()}function UI(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Of(pc)}function BI(o,l){if(o==="click")return Of(l)}function WI(o,l){if(o==="input"||o==="change")return Of(l)}function GI(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var gs=typeof Object.is=="function"?Object.is:GI;function mc(o,l){if(gs(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),m=Object.keys(l);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var w=d[m];if(!c.call(l,w)||!gs(o[w],l[w]))return!1}return!0}function pw(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function mw(o,l){var d=pw(o);o=0;for(var m;d;){if(d.nodeType===3){if(m=o+d.textContent.length,o<=l&&m>=l)return{node:d,offset:l-o};o=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=pw(d)}}function gw(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?gw(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function vw(){for(var o=window,l=Ke();l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Ke(o.document)}return l}function $0(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}function KI(o){var l=vw(),d=o.focusedElem,m=o.selectionRange;if(l!==d&&d&&d.ownerDocument&&gw(d.ownerDocument.documentElement,d)){if(m!==null&&$0(d)){if(l=m.start,o=m.end,o===void 0&&(o=l),"selectionStart"in d)d.selectionStart=l,d.selectionEnd=Math.min(o,d.value.length);else if(o=(l=d.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var w=d.textContent.length,k=Math.min(m.start,w);m=m.end===void 0?k:Math.min(m.end,w),!o.extend&&k>m&&(w=m,m=k,k=w),w=mw(d,k);var I=mw(d,m);w&&I&&(o.rangeCount!==1||o.anchorNode!==w.node||o.anchorOffset!==w.offset||o.focusNode!==I.node||o.focusOffset!==I.offset)&&(l=l.createRange(),l.setStart(w.node,w.offset),o.removeAllRanges(),k>m?(o.addRange(l),o.extend(I.node,I.offset)):(l.setEnd(I.node,I.offset),o.addRange(l)))}}for(l=[],o=d;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d<l.length;d++)o=l[d],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var ZI=u&&"documentMode"in document&&11>=document.documentMode,xl=null,H0=null,gc=null,z0=!1;function yw(o,l,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;z0||xl==null||xl!==Ke(m)||(m=xl,"selectionStart"in m&&$0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),gc&&mc(gc,m)||(gc=m,m=Ff(H0,"onSelect"),0<m.length&&(l=new M0("onSelect","select",null,l,d),o.push({event:l,listeners:m}),l.target=xl)))}function Nf(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var wl={animationend:Nf("Animation","AnimationEnd"),animationiteration:Nf("Animation","AnimationIteration"),animationstart:Nf("Animation","AnimationStart"),transitionend:Nf("Transition","TransitionEnd")},U0={},_w={};u&&(_w=document.createElement("div").style,"AnimationEvent"in window||(delete wl.animationend.animation,delete wl.animationiteration.animation,delete wl.animationstart.animation),"TransitionEvent"in window||delete wl.transitionend.transition);function Df(o){if(U0[o])return U0[o];if(!wl[o])return o;var l=wl[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in _w)return U0[o]=l[d];return o}var xw=Df("animationend"),ww=Df("animationiteration"),bw=Df("animationstart"),Sw=Df("transitionend"),Ew=new Map,kw="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 ao(o,l){Ew.set(o,l),i(l,[o])}for(var B0=0;B0<kw.length;B0++){var W0=kw[B0],qI=W0.toLowerCase(),YI=W0[0].toUpperCase()+W0.slice(1);ao(qI,"on"+YI)}ao(xw,"onAnimationEnd"),ao(ww,"onAnimationIteration"),ao(bw,"onAnimationStart"),ao("dblclick","onDoubleClick"),ao("focusin","onFocus"),ao("focusout","onBlur"),ao(Sw,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("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 vc="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(" "),XI=new Set("cancel close invalid load scroll toggle".split(" ").concat(vc));function Cw(o,l,d){var m=o.type||"unknown-event";o.currentTarget=d,k0(m,l,void 0,o),o.currentTarget=null}function Pw(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var m=o[d],w=m.event;m=m.listeners;e:{var k=void 0;if(l)for(var I=m.length-1;0<=I;I--){var F=m[I],U=F.instance,ne=F.currentTarget;if(F=F.listener,U!==k&&w.isPropagationStopped())break e;Cw(w,F,ne),k=U}else for(I=0;I<m.length;I++){if(F=m[I],U=F.instance,ne=F.currentTarget,F=F.listener,U!==k&&w.isPropagationStopped())break e;Cw(w,F,ne),k=U}}}if(aa)throw o=Qu,aa=!1,Qu=null,o}function Mt(o,l){var d=l[J0];d===void 0&&(d=l[J0]=new Set);var m=o+"__bubble";d.has(m)||(Tw(l,o,2,!1),d.add(m))}function G0(o,l,d){var m=0;l&&(m|=4),Tw(d,o,m,l)}var jf="_reactListening"+Math.random().toString(36).slice(2);function yc(o){if(!o[jf]){o[jf]=!0,r.forEach(function(d){d!=="selectionchange"&&(XI.has(d)||G0(d,!1,o),G0(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[jf]||(l[jf]=!0,G0("selectionchange",!1,l))}}function Tw(o,l,d,m){switch(Xx(l)){case 1:var w=dI;break;case 4:w=fI;break;default:w=A0}d=w.bind(null,l,d,o),w=void 0,!ms||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(w=!0),m?w!==void 0?o.addEventListener(l,d,{capture:!0,passive:w}):o.addEventListener(l,d,!0):w!==void 0?o.addEventListener(l,d,{passive:w}):o.addEventListener(l,d,!1)}function K0(o,l,d,m,w){var k=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var I=m.tag;if(I===3||I===4){var F=m.stateNode.containerInfo;if(F===w||F.nodeType===8&&F.parentNode===w)break;if(I===4)for(I=m.return;I!==null;){var U=I.tag;if((U===3||U===4)&&(U=I.stateNode.containerInfo,U===w||U.nodeType===8&&U.parentNode===w))return;I=I.return}for(;F!==null;){if(I=ca(F),I===null)return;if(U=I.tag,U===5||U===6){m=k=I;continue e}F=F.parentNode}}m=m.return}Ut(function(){var ne=k,fe=In(d),he=[];e:{var ce=Ew.get(o);if(ce!==void 0){var Pe=M0,Ne=o;switch(o){case"keypress":if(If(d)===0)break e;case"keydown":case"keyup":Pe=PI;break;case"focusin":Ne="focus",Pe=N0;break;case"focusout":Ne="blur",Pe=N0;break;case"beforeblur":case"afterblur":Pe=N0;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=ew;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=mI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=RI;break;case xw:case ww:case bw:Pe=yI;break;case Sw:Pe=MI;break;case"scroll":Pe=hI;break;case"wheel":Pe=OI;break;case"copy":case"cut":case"paste":Pe=xI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=nw}var Fe=(l&4)!==0,sn=!Fe&&o==="scroll",Q=Fe?ce!==null?ce+"Capture":null:ce;Fe=[];for(var Z=ne,J;Z!==null;){J=Z;var ye=J.stateNode;if(J.tag===5&&ye!==null&&(J=ye,Q!==null&&(ye=rn(Z,Q),ye!=null&&Fe.push(_c(Z,ye,J)))),sn)break;Z=Z.return}0<Fe.length&&(ce=new Pe(ce,Ne,null,d,fe),he.push({event:ce,listeners:Fe}))}}if((l&7)===0){e:{if(ce=o==="mouseover"||o==="pointerover",Pe=o==="mouseout"||o==="pointerout",ce&&d!==ur&&(Ne=d.relatedTarget||d.fromElement)&&(ca(Ne)||Ne[yi]))break e;if((Pe||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,Pe?(Ne=d.relatedTarget||d.toElement,Pe=ne,Ne=Ne?ca(Ne):null,Ne!==null&&(sn=vi(Ne),Ne!==sn||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(Pe=null,Ne=ne),Pe!==Ne)){if(Fe=ew,ye="onMouseLeave",Q="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(Fe=nw,ye="onPointerLeave",Q="onPointerEnter",Z="pointer"),sn=Pe==null?ce:El(Pe),J=Ne==null?ce:El(Ne),ce=new Fe(ye,Z+"leave",Pe,d,fe),ce.target=sn,ce.relatedTarget=J,ye=null,ca(fe)===ne&&(Fe=new Fe(Q,Z+"enter",Ne,d,fe),Fe.target=J,Fe.relatedTarget=sn,ye=Fe),sn=ye,Pe&&Ne)t:{for(Fe=Pe,Q=Ne,Z=0,J=Fe;J;J=bl(J))Z++;for(J=0,ye=Q;ye;ye=bl(ye))J++;for(;0<Z-J;)Fe=bl(Fe),Z--;for(;0<J-Z;)Q=bl(Q),J--;for(;Z--;){if(Fe===Q||Q!==null&&Fe===Q.alternate)break t;Fe=bl(Fe),Q=bl(Q)}Fe=null}else Fe=null;Pe!==null&&Aw(he,ce,Pe,Fe,!1),Ne!==null&&sn!==null&&Aw(he,sn,Ne,Fe,!0)}}e:{if(ce=ne?El(ne):window,Pe=ce.nodeName&&ce.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&ce.type==="file")var Ve=HI;else if(lw(ce))if(cw)Ve=WI;else{Ve=UI;var He=zI}else(Pe=ce.nodeName)&&Pe.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ve=BI);if(Ve&&(Ve=Ve(o,ne))){uw(he,Ve,d,fe);break e}He&&He(o,ce,ne),o==="focusout"&&(He=ce._wrapperState)&&He.controlled&&ce.type==="number"&&je(ce,"number",ce.value)}switch(He=ne?El(ne):window,o){case"focusin":(lw(He)||He.contentEditable==="true")&&(xl=He,H0=ne,gc=null);break;case"focusout":gc=H0=xl=null;break;case"mousedown":z0=!0;break;case"contextmenu":case"mouseup":case"dragend":z0=!1,yw(he,d,fe);break;case"selectionchange":if(ZI)break;case"keydown":case"keyup":yw(he,d,fe)}var ze;if(j0)e:{switch(o){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else _l?ow(o,d)&&(Ge="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Ge="onCompositionStart");Ge&&(rw&&d.locale!=="ko"&&(_l||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&_l&&(ze=Qx()):(oo=fe,I0="value"in oo?oo.value:oo.textContent,_l=!0)),He=Ff(ne,Ge),0<He.length&&(Ge=new tw(Ge,o,null,d,fe),he.push({event:Ge,listeners:He}),ze?Ge.data=ze:(ze=aw(d),ze!==null&&(Ge.data=ze)))),(ze=DI?jI(o,d):FI(o,d))&&(ne=Ff(ne,"onBeforeInput"),0<ne.length&&(fe=new tw("onBeforeInput","beforeinput",null,d,fe),he.push({event:fe,listeners:ne}),fe.data=ze))}Pw(he,l)})}function _c(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Ff(o,l){for(var d=l+"Capture",m=[];o!==null;){var w=o,k=w.stateNode;w.tag===5&&k!==null&&(w=k,k=rn(o,d),k!=null&&m.unshift(_c(o,k,w)),k=rn(o,l),k!=null&&m.push(_c(o,k,w))),o=o.return}return m}function bl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Aw(o,l,d,m,w){for(var k=l._reactName,I=[];d!==null&&d!==m;){var F=d,U=F.alternate,ne=F.stateNode;if(U!==null&&U===m)break;F.tag===5&&ne!==null&&(F=ne,w?(U=rn(d,k),U!=null&&I.unshift(_c(d,U,F))):w||(U=rn(d,k),U!=null&&I.push(_c(d,U,F)))),d=d.return}I.length!==0&&o.push({event:l,listeners:I})}var QI=/\r\n?/g,JI=/\u0000|\uFFFD/g;function Rw(o){return(typeof o=="string"?o:""+o).replace(QI,`
39
- `).replace(JI,"")}function Vf(o,l,d){if(l=Rw(l),Rw(o)!==l&&d)throw Error(n(425))}function $f(){}var Z0=null,q0=null;function Y0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var X0=typeof setTimeout=="function"?setTimeout:void 0,eM=typeof clearTimeout=="function"?clearTimeout:void 0,Iw=typeof Promise=="function"?Promise:void 0,tM=typeof queueMicrotask=="function"?queueMicrotask:typeof Iw<"u"?function(o){return Iw.resolve(null).then(o).catch(nM)}:X0;function nM(o){setTimeout(function(){throw o})}function Q0(o,l){var d=l,m=0;do{var w=d.nextSibling;if(o.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(m===0){o.removeChild(w),uc(l);return}m--}else d!=="$"&&d!=="$?"&&d!=="$!"||m++;d=w}while(d);uc(l)}function lo(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return o}function Mw(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return o;l--}else d==="/$"&&l++}o=o.previousSibling}return null}var Sl=Math.random().toString(36).slice(2),Hs="__reactFiber$"+Sl,xc="__reactProps$"+Sl,yi="__reactContainer$"+Sl,J0="__reactEvents$"+Sl,rM="__reactListeners$"+Sl,sM="__reactHandles$"+Sl;function ca(o){var l=o[Hs];if(l)return l;for(var d=o.parentNode;d;){if(l=d[yi]||d[Hs]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=Mw(o);o!==null;){if(d=o[Hs])return d;o=Mw(o)}return l}o=d,d=o.parentNode}return null}function wc(o){return o=o[Hs]||o[yi],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function El(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function Hf(o){return o[xc]||null}var eg=[],kl=-1;function uo(o){return{current:o}}function Lt(o){0>kl||(o.current=eg[kl],eg[kl]=null,kl--)}function Tt(o,l){kl++,eg[kl]=o.current,o.current=l}var co={},Un=uo(co),cr=uo(!1),da=co;function Cl(o,l){var d=o.type.contextTypes;if(!d)return co;var m=o.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===l)return m.__reactInternalMemoizedMaskedChildContext;var w={},k;for(k in d)w[k]=l[k];return m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=w),w}function dr(o){return o=o.childContextTypes,o!=null}function zf(){Lt(cr),Lt(Un)}function Lw(o,l,d){if(Un.current!==co)throw Error(n(168));Tt(Un,l),Tt(cr,d)}function Ow(o,l,d){var m=o.stateNode;if(l=l.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var w in m)if(!(w in l))throw Error(n(108,de(o)||"Unknown",w));return H({},d,m)}function Uf(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||co,da=Un.current,Tt(Un,o),Tt(cr,cr.current),!0}function Nw(o,l,d){var m=o.stateNode;if(!m)throw Error(n(169));d?(o=Ow(o,l,da),m.__reactInternalMemoizedMergedChildContext=o,Lt(cr),Lt(Un),Tt(Un,o)):Lt(cr),Tt(cr,d)}var _i=null,Bf=!1,tg=!1;function Dw(o){_i===null?_i=[o]:_i.push(o)}function iM(o){Bf=!0,Dw(o)}function fo(){if(!tg&&_i!==null){tg=!0;var o=0,l=gt;try{var d=_i;for(gt=1;o<d.length;o++){var m=d[o];do m=m(!0);while(m!==null)}_i=null,Bf=!1}catch(w){throw _i!==null&&(_i=_i.slice(o+1)),nc(to,fo),w}finally{gt=l,tg=!1}}return null}var Pl=[],Tl=0,Wf=null,Gf=0,Xr=[],Qr=0,fa=null,xi=1,wi="";function ha(o,l){Pl[Tl++]=Gf,Pl[Tl++]=Wf,Wf=o,Gf=l}function jw(o,l,d){Xr[Qr++]=xi,Xr[Qr++]=wi,Xr[Qr++]=fa,fa=o;var m=xi;o=wi;var w=32-xe(m)-1;m&=~(1<<w),d+=1;var k=32-xe(l)+w;if(30<k){var I=w-w%5;k=(m&(1<<I)-1).toString(32),m>>=I,w-=I,xi=1<<32-xe(l)+w|d<<w|m,wi=k+o}else xi=1<<k|d<<w|m,wi=o}function ng(o){o.return!==null&&(ha(o,1),jw(o,1,0))}function rg(o){for(;o===Wf;)Wf=Pl[--Tl],Pl[Tl]=null,Gf=Pl[--Tl],Pl[Tl]=null;for(;o===fa;)fa=Xr[--Qr],Xr[Qr]=null,wi=Xr[--Qr],Xr[Qr]=null,xi=Xr[--Qr],Xr[Qr]=null}var Ir=null,Mr=null,jt=!1,vs=null;function Fw(o,l){var d=ns(5,null,null,0);d.elementType="DELETED",d.stateNode=l,d.return=o,l=o.deletions,l===null?(o.deletions=[d],o.flags|=16):l.push(d)}function Vw(o,l){switch(o.tag){case 5:var d=o.type;return l=l.nodeType!==1||d.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Ir=o,Mr=lo(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Ir=o,Mr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(d=fa!==null?{id:xi,overflow:wi}:null,o.memoizedState={dehydrated:l,treeContext:d,retryLane:1073741824},d=ns(18,null,null,0),d.stateNode=l,d.return=o,o.child=d,Ir=o,Mr=null,!0):!1;default:return!1}}function sg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function ig(o){if(jt){var l=Mr;if(l){var d=l;if(!Vw(o,l)){if(sg(o))throw Error(n(418));l=lo(d.nextSibling);var m=Ir;l&&Vw(o,l)?Fw(m,d):(o.flags=o.flags&-4097|2,jt=!1,Ir=o)}}else{if(sg(o))throw Error(n(418));o.flags=o.flags&-4097|2,jt=!1,Ir=o}}}function $w(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Ir=o}function Kf(o){if(o!==Ir)return!1;if(!jt)return $w(o),jt=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!Y0(o.type,o.memoizedProps)),l&&(l=Mr)){if(sg(o))throw Hw(),Error(n(418));for(;l;)Fw(o,l),l=lo(l.nextSibling)}if($w(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(n(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"){if(l===0){Mr=lo(o.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++}o=o.nextSibling}Mr=null}}else Mr=Ir?lo(o.stateNode.nextSibling):null;return!0}function Hw(){for(var o=Mr;o;)o=lo(o.nextSibling)}function Al(){Mr=Ir=null,jt=!1}function og(o){vs===null?vs=[o]:vs.push(o)}var oM=T.ReactCurrentBatchConfig;function bc(o,l,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(n(309));var m=d.stateNode}if(!m)throw Error(n(147,o));var w=m,k=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===k?l.ref:(l=function(I){var F=w.refs;I===null?delete F[k]:F[k]=I},l._stringRef=k,l)}if(typeof o!="string")throw Error(n(284));if(!d._owner)throw Error(n(290,o))}return o}function Zf(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function zw(o){var l=o._init;return l(o._payload)}function Uw(o){function l(Q,Z){if(o){var J=Q.deletions;J===null?(Q.deletions=[Z],Q.flags|=16):J.push(Z)}}function d(Q,Z){if(!o)return null;for(;Z!==null;)l(Q,Z),Z=Z.sibling;return null}function m(Q,Z){for(Q=new Map;Z!==null;)Z.key!==null?Q.set(Z.key,Z):Q.set(Z.index,Z),Z=Z.sibling;return Q}function w(Q,Z){return Q=xo(Q,Z),Q.index=0,Q.sibling=null,Q}function k(Q,Z,J){return Q.index=J,o?(J=Q.alternate,J!==null?(J=J.index,J<Z?(Q.flags|=2,Z):J):(Q.flags|=2,Z)):(Q.flags|=1048576,Z)}function I(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function F(Q,Z,J,ye){return Z===null||Z.tag!==6?(Z=Xg(J,Q.mode,ye),Z.return=Q,Z):(Z=w(Z,J),Z.return=Q,Z)}function U(Q,Z,J,ye){var Ve=J.type;return Ve===M?fe(Q,Z,J.props.children,ye,J.key):Z!==null&&(Z.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&zw(Ve)===Z.type)?(ye=w(Z,J.props),ye.ref=bc(Q,Z,J),ye.return=Q,ye):(ye=yh(J.type,J.key,J.props,null,Q.mode,ye),ye.ref=bc(Q,Z,J),ye.return=Q,ye)}function ne(Q,Z,J,ye){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==J.containerInfo||Z.stateNode.implementation!==J.implementation?(Z=Qg(J,Q.mode,ye),Z.return=Q,Z):(Z=w(Z,J.children||[]),Z.return=Q,Z)}function fe(Q,Z,J,ye,Ve){return Z===null||Z.tag!==7?(Z=wa(J,Q.mode,ye,Ve),Z.return=Q,Z):(Z=w(Z,J),Z.return=Q,Z)}function he(Q,Z,J){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=Xg(""+Z,Q.mode,J),Z.return=Q,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case A:return J=yh(Z.type,Z.key,Z.props,null,Q.mode,J),J.ref=bc(Q,null,Z),J.return=Q,J;case O:return Z=Qg(Z,Q.mode,J),Z.return=Q,Z;case B:var ye=Z._init;return he(Q,ye(Z._payload),J)}if(Qe(Z)||ee(Z))return Z=wa(Z,Q.mode,J,null),Z.return=Q,Z;Zf(Q,Z)}return null}function ce(Q,Z,J,ye){var Ve=Z!==null?Z.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Ve!==null?null:F(Q,Z,""+J,ye);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return J.key===Ve?U(Q,Z,J,ye):null;case O:return J.key===Ve?ne(Q,Z,J,ye):null;case B:return Ve=J._init,ce(Q,Z,Ve(J._payload),ye)}if(Qe(J)||ee(J))return Ve!==null?null:fe(Q,Z,J,ye,null);Zf(Q,J)}return null}function Pe(Q,Z,J,ye,Ve){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return Q=Q.get(J)||null,F(Z,Q,""+ye,Ve);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case A:return Q=Q.get(ye.key===null?J:ye.key)||null,U(Z,Q,ye,Ve);case O:return Q=Q.get(ye.key===null?J:ye.key)||null,ne(Z,Q,ye,Ve);case B:var He=ye._init;return Pe(Q,Z,J,He(ye._payload),Ve)}if(Qe(ye)||ee(ye))return Q=Q.get(J)||null,fe(Z,Q,ye,Ve,null);Zf(Z,ye)}return null}function Ne(Q,Z,J,ye){for(var Ve=null,He=null,ze=Z,Ge=Z=0,Cn=null;ze!==null&&Ge<J.length;Ge++){ze.index>Ge?(Cn=ze,ze=null):Cn=ze.sibling;var ft=ce(Q,ze,J[Ge],ye);if(ft===null){ze===null&&(ze=Cn);break}o&&ze&&ft.alternate===null&&l(Q,ze),Z=k(ft,Z,Ge),He===null?Ve=ft:He.sibling=ft,He=ft,ze=Cn}if(Ge===J.length)return d(Q,ze),jt&&ha(Q,Ge),Ve;if(ze===null){for(;Ge<J.length;Ge++)ze=he(Q,J[Ge],ye),ze!==null&&(Z=k(ze,Z,Ge),He===null?Ve=ze:He.sibling=ze,He=ze);return jt&&ha(Q,Ge),Ve}for(ze=m(Q,ze);Ge<J.length;Ge++)Cn=Pe(ze,Q,Ge,J[Ge],ye),Cn!==null&&(o&&Cn.alternate!==null&&ze.delete(Cn.key===null?Ge:Cn.key),Z=k(Cn,Z,Ge),He===null?Ve=Cn:He.sibling=Cn,He=Cn);return o&&ze.forEach(function(wo){return l(Q,wo)}),jt&&ha(Q,Ge),Ve}function Fe(Q,Z,J,ye){var Ve=ee(J);if(typeof Ve!="function")throw Error(n(150));if(J=Ve.call(J),J==null)throw Error(n(151));for(var He=Ve=null,ze=Z,Ge=Z=0,Cn=null,ft=J.next();ze!==null&&!ft.done;Ge++,ft=J.next()){ze.index>Ge?(Cn=ze,ze=null):Cn=ze.sibling;var wo=ce(Q,ze,ft.value,ye);if(wo===null){ze===null&&(ze=Cn);break}o&&ze&&wo.alternate===null&&l(Q,ze),Z=k(wo,Z,Ge),He===null?Ve=wo:He.sibling=wo,He=wo,ze=Cn}if(ft.done)return d(Q,ze),jt&&ha(Q,Ge),Ve;if(ze===null){for(;!ft.done;Ge++,ft=J.next())ft=he(Q,ft.value,ye),ft!==null&&(Z=k(ft,Z,Ge),He===null?Ve=ft:He.sibling=ft,He=ft);return jt&&ha(Q,Ge),Ve}for(ze=m(Q,ze);!ft.done;Ge++,ft=J.next())ft=Pe(ze,Q,Ge,ft.value,ye),ft!==null&&(o&&ft.alternate!==null&&ze.delete(ft.key===null?Ge:ft.key),Z=k(ft,Z,Ge),He===null?Ve=ft:He.sibling=ft,He=ft);return o&&ze.forEach(function(VM){return l(Q,VM)}),jt&&ha(Q,Ge),Ve}function sn(Q,Z,J,ye){if(typeof J=="object"&&J!==null&&J.type===M&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case A:e:{for(var Ve=J.key,He=Z;He!==null;){if(He.key===Ve){if(Ve=J.type,Ve===M){if(He.tag===7){d(Q,He.sibling),Z=w(He,J.props.children),Z.return=Q,Q=Z;break e}}else if(He.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===B&&zw(Ve)===He.type){d(Q,He.sibling),Z=w(He,J.props),Z.ref=bc(Q,He,J),Z.return=Q,Q=Z;break e}d(Q,He);break}else l(Q,He);He=He.sibling}J.type===M?(Z=wa(J.props.children,Q.mode,ye,J.key),Z.return=Q,Q=Z):(ye=yh(J.type,J.key,J.props,null,Q.mode,ye),ye.ref=bc(Q,Z,J),ye.return=Q,Q=ye)}return I(Q);case O:e:{for(He=J.key;Z!==null;){if(Z.key===He)if(Z.tag===4&&Z.stateNode.containerInfo===J.containerInfo&&Z.stateNode.implementation===J.implementation){d(Q,Z.sibling),Z=w(Z,J.children||[]),Z.return=Q,Q=Z;break e}else{d(Q,Z);break}else l(Q,Z);Z=Z.sibling}Z=Qg(J,Q.mode,ye),Z.return=Q,Q=Z}return I(Q);case B:return He=J._init,sn(Q,Z,He(J._payload),ye)}if(Qe(J))return Ne(Q,Z,J,ye);if(ee(J))return Fe(Q,Z,J,ye);Zf(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,Z!==null&&Z.tag===6?(d(Q,Z.sibling),Z=w(Z,J),Z.return=Q,Q=Z):(d(Q,Z),Z=Xg(J,Q.mode,ye),Z.return=Q,Q=Z),I(Q)):d(Q,Z)}return sn}var Rl=Uw(!0),Bw=Uw(!1),qf=uo(null),Yf=null,Il=null,ag=null;function lg(){ag=Il=Yf=null}function ug(o){var l=qf.current;Lt(qf),o._currentValue=l}function cg(o,l,d){for(;o!==null;){var m=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),o===d)break;o=o.return}}function Ml(o,l){Yf=o,ag=Il=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(fr=!0),o.firstContext=null)}function Jr(o){var l=o._currentValue;if(ag!==o)if(o={context:o,memoizedValue:l,next:null},Il===null){if(Yf===null)throw Error(n(308));Il=o,Yf.dependencies={lanes:0,firstContext:o}}else Il=Il.next=o;return l}var pa=null;function dg(o){pa===null?pa=[o]:pa.push(o)}function Ww(o,l,d,m){var w=l.interleaved;return w===null?(d.next=d,dg(l)):(d.next=w.next,w.next=d),l.interleaved=d,bi(o,m)}function bi(o,l){o.lanes|=l;var d=o.alternate;for(d!==null&&(d.lanes|=l),d=o,o=o.return;o!==null;)o.childLanes|=l,d=o.alternate,d!==null&&(d.childLanes|=l),d=o,o=o.return;return d.tag===3?d.stateNode:null}var ho=!1;function fg(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gw(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Si(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function po(o,l,d){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(dt&2)!==0){var w=m.pending;return w===null?l.next=l:(l.next=w.next,w.next=l),m.pending=l,bi(o,d)}return w=m.interleaved,w===null?(l.next=l,dg(m)):(l.next=w.next,w.next=l),m.interleaved=l,bi(o,d)}function Xf(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194240)!==0)){var m=l.lanes;m&=o.pendingLanes,d|=m,l.lanes=d,C0(o,d)}}function Kw(o,l){var d=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var w=null,k=null;if(d=d.firstBaseUpdate,d!==null){do{var I={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};k===null?w=k=I:k=k.next=I,d=d.next}while(d!==null);k===null?w=k=l:k=k.next=l}else w=k=l;d={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:k,shared:m.shared,effects:m.effects},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}function Qf(o,l,d,m){var w=o.updateQueue;ho=!1;var k=w.firstBaseUpdate,I=w.lastBaseUpdate,F=w.shared.pending;if(F!==null){w.shared.pending=null;var U=F,ne=U.next;U.next=null,I===null?k=ne:I.next=ne,I=U;var fe=o.alternate;fe!==null&&(fe=fe.updateQueue,F=fe.lastBaseUpdate,F!==I&&(F===null?fe.firstBaseUpdate=ne:F.next=ne,fe.lastBaseUpdate=U))}if(k!==null){var he=w.baseState;I=0,fe=ne=U=null,F=k;do{var ce=F.lane,Pe=F.eventTime;if((m&ce)===ce){fe!==null&&(fe=fe.next={eventTime:Pe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Ne=o,Fe=F;switch(ce=l,Pe=d,Fe.tag){case 1:if(Ne=Fe.payload,typeof Ne=="function"){he=Ne.call(Pe,he,ce);break e}he=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Fe.payload,ce=typeof Ne=="function"?Ne.call(Pe,he,ce):Ne,ce==null)break e;he=H({},he,ce);break e;case 2:ho=!0}}F.callback!==null&&F.lane!==0&&(o.flags|=64,ce=w.effects,ce===null?w.effects=[F]:ce.push(F))}else Pe={eventTime:Pe,lane:ce,tag:F.tag,payload:F.payload,callback:F.callback,next:null},fe===null?(ne=fe=Pe,U=he):fe=fe.next=Pe,I|=ce;if(F=F.next,F===null){if(F=w.shared.pending,F===null)break;ce=F,F=ce.next,ce.next=null,w.lastBaseUpdate=ce,w.shared.pending=null}}while(!0);if(fe===null&&(U=he),w.baseState=U,w.firstBaseUpdate=ne,w.lastBaseUpdate=fe,l=w.shared.interleaved,l!==null){w=l;do I|=w.lane,w=w.next;while(w!==l)}else k===null&&(w.shared.lanes=0);va|=I,o.lanes=I,o.memoizedState=he}}function Zw(o,l,d){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var m=o[l],w=m.callback;if(w!==null){if(m.callback=null,m=d,typeof w!="function")throw Error(n(191,w));w.call(m)}}}var Sc={},zs=uo(Sc),Ec=uo(Sc),kc=uo(Sc);function ma(o){if(o===Sc)throw Error(n(174));return o}function hg(o,l){switch(Tt(kc,l),Tt(Ec,o),Tt(zs,Sc),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Xn(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Xn(l,o)}Lt(zs),Tt(zs,l)}function Ll(){Lt(zs),Lt(Ec),Lt(kc)}function qw(o){ma(kc.current);var l=ma(zs.current),d=Xn(l,o.type);l!==d&&(Tt(Ec,o),Tt(zs,d))}function pg(o){Ec.current===o&&(Lt(zs),Lt(Ec))}var Wt=uo(0);function Jf(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||d.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var mg=[];function gg(){for(var o=0;o<mg.length;o++)mg[o]._workInProgressVersionPrimary=null;mg.length=0}var eh=T.ReactCurrentDispatcher,vg=T.ReactCurrentBatchConfig,ga=0,Gt=null,pn=null,En=null,th=!1,Cc=!1,Pc=0,aM=0;function Bn(){throw Error(n(321))}function yg(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!gs(o[d],l[d]))return!1;return!0}function _g(o,l,d,m,w,k){if(ga=k,Gt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,eh.current=o===null||o.memoizedState===null?dM:fM,o=d(m,w),Cc){k=0;do{if(Cc=!1,Pc=0,25<=k)throw Error(n(301));k+=1,En=pn=null,l.updateQueue=null,eh.current=hM,o=d(m,w)}while(Cc)}if(eh.current=sh,l=pn!==null&&pn.next!==null,ga=0,En=pn=Gt=null,th=!1,l)throw Error(n(300));return o}function xg(){var o=Pc!==0;return Pc=0,o}function Us(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return En===null?Gt.memoizedState=En=o:En=En.next=o,En}function es(){if(pn===null){var o=Gt.alternate;o=o!==null?o.memoizedState:null}else o=pn.next;var l=En===null?Gt.memoizedState:En.next;if(l!==null)En=l,pn=o;else{if(o===null)throw Error(n(310));pn=o,o={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},En===null?Gt.memoizedState=En=o:En=En.next=o}return En}function Tc(o,l){return typeof l=="function"?l(o):l}function wg(o){var l=es(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var m=pn,w=m.baseQueue,k=d.pending;if(k!==null){if(w!==null){var I=w.next;w.next=k.next,k.next=I}m.baseQueue=w=k,d.pending=null}if(w!==null){k=w.next,m=m.baseState;var F=I=null,U=null,ne=k;do{var fe=ne.lane;if((ga&fe)===fe)U!==null&&(U=U.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),m=ne.hasEagerState?ne.eagerState:o(m,ne.action);else{var he={lane:fe,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};U===null?(F=U=he,I=m):U=U.next=he,Gt.lanes|=fe,va|=fe}ne=ne.next}while(ne!==null&&ne!==k);U===null?I=m:U.next=F,gs(m,l.memoizedState)||(fr=!0),l.memoizedState=m,l.baseState=I,l.baseQueue=U,d.lastRenderedState=m}if(o=d.interleaved,o!==null){w=o;do k=w.lane,Gt.lanes|=k,va|=k,w=w.next;while(w!==o)}else w===null&&(d.lanes=0);return[l.memoizedState,d.dispatch]}function bg(o){var l=es(),d=l.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=o;var m=d.dispatch,w=d.pending,k=l.memoizedState;if(w!==null){d.pending=null;var I=w=w.next;do k=o(k,I.action),I=I.next;while(I!==w);gs(k,l.memoizedState)||(fr=!0),l.memoizedState=k,l.baseQueue===null&&(l.baseState=k),d.lastRenderedState=k}return[k,m]}function Yw(){}function Xw(o,l){var d=Gt,m=es(),w=l(),k=!gs(m.memoizedState,w);if(k&&(m.memoizedState=w,fr=!0),m=m.queue,Sg(eb.bind(null,d,m,o),[o]),m.getSnapshot!==l||k||En!==null&&En.memoizedState.tag&1){if(d.flags|=2048,Ac(9,Jw.bind(null,d,m,w,l),void 0,null),kn===null)throw Error(n(349));(ga&30)!==0||Qw(d,l,w)}return w}function Qw(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Gt.updateQueue,l===null?(l={lastEffect:null,stores:null},Gt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function Jw(o,l,d,m){l.value=d,l.getSnapshot=m,tb(l)&&nb(o)}function eb(o,l,d){return d(function(){tb(l)&&nb(o)})}function tb(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!gs(o,d)}catch{return!0}}function nb(o){var l=bi(o,1);l!==null&&ws(l,o,1,-1)}function rb(o){var l=Us();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Tc,lastRenderedState:o},l.queue=o,o=o.dispatch=cM.bind(null,Gt,o),[l.memoizedState,o]}function Ac(o,l,d,m){return o={tag:o,create:l,destroy:d,deps:m,next:null},l=Gt.updateQueue,l===null?(l={lastEffect:null,stores:null},Gt.updateQueue=l,l.lastEffect=o.next=o):(d=l.lastEffect,d===null?l.lastEffect=o.next=o:(m=d.next,d.next=o,o.next=m,l.lastEffect=o)),o}function sb(){return es().memoizedState}function nh(o,l,d,m){var w=Us();Gt.flags|=o,w.memoizedState=Ac(1|l,d,void 0,m===void 0?null:m)}function rh(o,l,d,m){var w=es();m=m===void 0?null:m;var k=void 0;if(pn!==null){var I=pn.memoizedState;if(k=I.destroy,m!==null&&yg(m,I.deps)){w.memoizedState=Ac(l,d,k,m);return}}Gt.flags|=o,w.memoizedState=Ac(1|l,d,k,m)}function ib(o,l){return nh(8390656,8,o,l)}function Sg(o,l){return rh(2048,8,o,l)}function ob(o,l){return rh(4,2,o,l)}function ab(o,l){return rh(4,4,o,l)}function lb(o,l){if(typeof l=="function")return o=o(),l(o),function(){l(null)};if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function ub(o,l,d){return d=d!=null?d.concat([o]):null,rh(4,4,lb.bind(null,l,o),d)}function Eg(){}function cb(o,l){var d=es();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&yg(l,m[1])?m[0]:(d.memoizedState=[o,l],o)}function db(o,l){var d=es();l=l===void 0?null:l;var m=d.memoizedState;return m!==null&&l!==null&&yg(l,m[1])?m[0]:(o=o(),d.memoizedState=[o,l],o)}function fb(o,l,d){return(ga&21)===0?(o.baseState&&(o.baseState=!1,fr=!0),o.memoizedState=d):(gs(d,l)||(d=Sn(),Gt.lanes|=d,va|=d,o.baseState=!0),l)}function lM(o,l){var d=gt;gt=d!==0&&4>d?d:4,o(!0);var m=vg.transition;vg.transition={};try{o(!1),l()}finally{gt=d,vg.transition=m}}function hb(){return es().memoizedState}function uM(o,l,d){var m=yo(o);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},pb(o))mb(l,d);else if(d=Ww(o,l,d,m),d!==null){var w=nr();ws(d,o,m,w),gb(d,l,m)}}function cM(o,l,d){var m=yo(o),w={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(pb(o))mb(l,w);else{var k=o.alternate;if(o.lanes===0&&(k===null||k.lanes===0)&&(k=l.lastRenderedReducer,k!==null))try{var I=l.lastRenderedState,F=k(I,d);if(w.hasEagerState=!0,w.eagerState=F,gs(F,I)){var U=l.interleaved;U===null?(w.next=w,dg(l)):(w.next=U.next,U.next=w),l.interleaved=w;return}}catch{}finally{}d=Ww(o,l,w,m),d!==null&&(w=nr(),ws(d,o,m,w),gb(d,l,m))}}function pb(o){var l=o.alternate;return o===Gt||l!==null&&l===Gt}function mb(o,l){Cc=th=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function gb(o,l,d){if((d&4194240)!==0){var m=l.lanes;m&=o.pendingLanes,d|=m,l.lanes=d,C0(o,d)}}var sh={readContext:Jr,useCallback:Bn,useContext:Bn,useEffect:Bn,useImperativeHandle:Bn,useInsertionEffect:Bn,useLayoutEffect:Bn,useMemo:Bn,useReducer:Bn,useRef:Bn,useState:Bn,useDebugValue:Bn,useDeferredValue:Bn,useTransition:Bn,useMutableSource:Bn,useSyncExternalStore:Bn,useId:Bn,unstable_isNewReconciler:!1},dM={readContext:Jr,useCallback:function(o,l){return Us().memoizedState=[o,l===void 0?null:l],o},useContext:Jr,useEffect:ib,useImperativeHandle:function(o,l,d){return d=d!=null?d.concat([o]):null,nh(4194308,4,lb.bind(null,l,o),d)},useLayoutEffect:function(o,l){return nh(4194308,4,o,l)},useInsertionEffect:function(o,l){return nh(4,2,o,l)},useMemo:function(o,l){var d=Us();return l=l===void 0?null:l,o=o(),d.memoizedState=[o,l],o},useReducer:function(o,l,d){var m=Us();return l=d!==void 0?d(l):l,m.memoizedState=m.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},m.queue=o,o=o.dispatch=uM.bind(null,Gt,o),[m.memoizedState,o]},useRef:function(o){var l=Us();return o={current:o},l.memoizedState=o},useState:rb,useDebugValue:Eg,useDeferredValue:function(o){return Us().memoizedState=o},useTransition:function(){var o=rb(!1),l=o[0];return o=lM.bind(null,o[1]),Us().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,d){var m=Gt,w=Us();if(jt){if(d===void 0)throw Error(n(407));d=d()}else{if(d=l(),kn===null)throw Error(n(349));(ga&30)!==0||Qw(m,l,d)}w.memoizedState=d;var k={value:d,getSnapshot:l};return w.queue=k,ib(eb.bind(null,m,k,o),[o]),m.flags|=2048,Ac(9,Jw.bind(null,m,k,d,l),void 0,null),d},useId:function(){var o=Us(),l=kn.identifierPrefix;if(jt){var d=wi,m=xi;d=(m&~(1<<32-xe(m)-1)).toString(32)+d,l=":"+l+"R"+d,d=Pc++,0<d&&(l+="H"+d.toString(32)),l+=":"}else d=aM++,l=":"+l+"r"+d.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},fM={readContext:Jr,useCallback:cb,useContext:Jr,useEffect:Sg,useImperativeHandle:ub,useInsertionEffect:ob,useLayoutEffect:ab,useMemo:db,useReducer:wg,useRef:sb,useState:function(){return wg(Tc)},useDebugValue:Eg,useDeferredValue:function(o){var l=es();return fb(l,pn.memoizedState,o)},useTransition:function(){var o=wg(Tc)[0],l=es().memoizedState;return[o,l]},useMutableSource:Yw,useSyncExternalStore:Xw,useId:hb,unstable_isNewReconciler:!1},hM={readContext:Jr,useCallback:cb,useContext:Jr,useEffect:Sg,useImperativeHandle:ub,useInsertionEffect:ob,useLayoutEffect:ab,useMemo:db,useReducer:bg,useRef:sb,useState:function(){return bg(Tc)},useDebugValue:Eg,useDeferredValue:function(o){var l=es();return pn===null?l.memoizedState=o:fb(l,pn.memoizedState,o)},useTransition:function(){var o=bg(Tc)[0],l=es().memoizedState;return[o,l]},useMutableSource:Yw,useSyncExternalStore:Xw,useId:hb,unstable_isNewReconciler:!1};function ys(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var d in o)l[d]===void 0&&(l[d]=o[d]);return l}return l}function kg(o,l,d,m){l=o.memoizedState,d=d(m,l),d=d==null?l:H({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var ih={isMounted:function(o){return(o=o._reactInternals)?vi(o)===o:!1},enqueueSetState:function(o,l,d){o=o._reactInternals;var m=nr(),w=yo(o),k=Si(m,w);k.payload=l,d!=null&&(k.callback=d),l=po(o,k,w),l!==null&&(ws(l,o,w,m),Xf(l,o,w))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var m=nr(),w=yo(o),k=Si(m,w);k.tag=1,k.payload=l,d!=null&&(k.callback=d),l=po(o,k,w),l!==null&&(ws(l,o,w,m),Xf(l,o,w))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=nr(),m=yo(o),w=Si(d,m);w.tag=2,l!=null&&(w.callback=l),l=po(o,w,m),l!==null&&(ws(l,o,m,d),Xf(l,o,m))}};function vb(o,l,d,m,w,k,I){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,k,I):l.prototype&&l.prototype.isPureReactComponent?!mc(d,m)||!mc(w,k):!0}function yb(o,l,d){var m=!1,w=co,k=l.contextType;return typeof k=="object"&&k!==null?k=Jr(k):(w=dr(l)?da:Un.current,m=l.contextTypes,k=(m=m!=null)?Cl(o,w):co),l=new l(d,k),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=ih,o.stateNode=l,l._reactInternals=o,m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=w,o.__reactInternalMemoizedMaskedChildContext=k),l}function _b(o,l,d,m){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,m),l.state!==o&&ih.enqueueReplaceState(l,l.state,null)}function Cg(o,l,d,m){var w=o.stateNode;w.props=d,w.state=o.memoizedState,w.refs={},fg(o);var k=l.contextType;typeof k=="object"&&k!==null?w.context=Jr(k):(k=dr(l)?da:Un.current,w.context=Cl(o,k)),w.state=o.memoizedState,k=l.getDerivedStateFromProps,typeof k=="function"&&(kg(o,l,k,d),w.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(l=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),l!==w.state&&ih.enqueueReplaceState(w,w.state,null),Qf(o,d,w,m),w.state=o.memoizedState),typeof w.componentDidMount=="function"&&(o.flags|=4194308)}function Ol(o,l){try{var d="",m=l;do d+=oe(m),m=m.return;while(m);var w=d}catch(k){w=`
40
- Error generating stack: `+k.message+`
41
- `+k.stack}return{value:o,source:l,stack:w,digest:null}}function Pg(o,l,d){return{value:o,source:null,stack:d??null,digest:l??null}}function Tg(o,l){try{console.error(l.value)}catch(d){setTimeout(function(){throw d})}}var pM=typeof WeakMap=="function"?WeakMap:Map;function xb(o,l,d){d=Si(-1,d),d.tag=3,d.payload={element:null};var m=l.value;return d.callback=function(){fh||(fh=!0,Ug=m),Tg(o,l)},d}function wb(o,l,d){d=Si(-1,d),d.tag=3;var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var w=l.value;d.payload=function(){return m(w)},d.callback=function(){Tg(o,l)}}var k=o.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(d.callback=function(){Tg(o,l),typeof m!="function"&&(go===null?go=new Set([this]):go.add(this));var I=l.stack;this.componentDidCatch(l.value,{componentStack:I!==null?I:""})}),d}function bb(o,l,d){var m=o.pingCache;if(m===null){m=o.pingCache=new pM;var w=new Set;m.set(l,w)}else w=m.get(l),w===void 0&&(w=new Set,m.set(l,w));w.has(d)||(w.add(d),o=TM.bind(null,o,l,d),l.then(o,o))}function Sb(o){do{var l;if((l=o.tag===13)&&(l=o.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return o;o=o.return}while(o!==null);return null}function Eb(o,l,d,m,w){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(l=Si(-1,1),l.tag=2,po(d,l,1))),d.lanes|=1),o):(o.flags|=65536,o.lanes=w,o)}var mM=T.ReactCurrentOwner,fr=!1;function tr(o,l,d,m){l.child=o===null?Bw(l,null,d,m):Rl(l,o.child,d,m)}function kb(o,l,d,m,w){d=d.render;var k=l.ref;return Ml(l,w),m=_g(o,l,d,m,k,w),d=xg(),o!==null&&!fr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,Ei(o,l,w)):(jt&&d&&ng(l),l.flags|=1,tr(o,l,m,w),l.child)}function Cb(o,l,d,m,w){if(o===null){var k=d.type;return typeof k=="function"&&!Yg(k)&&k.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(l.tag=15,l.type=k,Pb(o,l,k,m,w)):(o=yh(d.type,null,m,l,l.mode,w),o.ref=l.ref,o.return=l,l.child=o)}if(k=o.child,(o.lanes&w)===0){var I=k.memoizedProps;if(d=d.compare,d=d!==null?d:mc,d(I,m)&&o.ref===l.ref)return Ei(o,l,w)}return l.flags|=1,o=xo(k,m),o.ref=l.ref,o.return=l,l.child=o}function Pb(o,l,d,m,w){if(o!==null){var k=o.memoizedProps;if(mc(k,m)&&o.ref===l.ref)if(fr=!1,l.pendingProps=m=k,(o.lanes&w)!==0)(o.flags&131072)!==0&&(fr=!0);else return l.lanes=o.lanes,Ei(o,l,w)}return Ag(o,l,d,m,w)}function Tb(o,l,d){var m=l.pendingProps,w=m.children,k=o!==null?o.memoizedState:null;if(m.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(Dl,Lr),Lr|=d;else{if((d&1073741824)===0)return o=k!==null?k.baseLanes|d:d,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Tt(Dl,Lr),Lr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=k!==null?k.baseLanes:d,Tt(Dl,Lr),Lr|=m}else k!==null?(m=k.baseLanes|d,l.memoizedState=null):m=d,Tt(Dl,Lr),Lr|=m;return tr(o,l,w,d),l.child}function Ab(o,l){var d=l.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(l.flags|=512,l.flags|=2097152)}function Ag(o,l,d,m,w){var k=dr(d)?da:Un.current;return k=Cl(l,k),Ml(l,w),d=_g(o,l,d,m,k,w),m=xg(),o!==null&&!fr?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~w,Ei(o,l,w)):(jt&&m&&ng(l),l.flags|=1,tr(o,l,d,w),l.child)}function Rb(o,l,d,m,w){if(dr(d)){var k=!0;Uf(l)}else k=!1;if(Ml(l,w),l.stateNode===null)ah(o,l),yb(l,d,m),Cg(l,d,m,w),m=!0;else if(o===null){var I=l.stateNode,F=l.memoizedProps;I.props=F;var U=I.context,ne=d.contextType;typeof ne=="object"&&ne!==null?ne=Jr(ne):(ne=dr(d)?da:Un.current,ne=Cl(l,ne));var fe=d.getDerivedStateFromProps,he=typeof fe=="function"||typeof I.getSnapshotBeforeUpdate=="function";he||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(F!==m||U!==ne)&&_b(l,I,m,ne),ho=!1;var ce=l.memoizedState;I.state=ce,Qf(l,m,I,w),U=l.memoizedState,F!==m||ce!==U||cr.current||ho?(typeof fe=="function"&&(kg(l,d,fe,m),U=l.memoizedState),(F=ho||vb(l,d,F,m,ce,U,ne))?(he||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(l.flags|=4194308)):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=U),I.props=m,I.state=U,I.context=ne,m=F):(typeof I.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{I=l.stateNode,Gw(o,l),F=l.memoizedProps,ne=l.type===l.elementType?F:ys(l.type,F),I.props=ne,he=l.pendingProps,ce=I.context,U=d.contextType,typeof U=="object"&&U!==null?U=Jr(U):(U=dr(d)?da:Un.current,U=Cl(l,U));var Pe=d.getDerivedStateFromProps;(fe=typeof Pe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(F!==he||ce!==U)&&_b(l,I,m,U),ho=!1,ce=l.memoizedState,I.state=ce,Qf(l,m,I,w);var Ne=l.memoizedState;F!==he||ce!==Ne||cr.current||ho?(typeof Pe=="function"&&(kg(l,d,Pe,m),Ne=l.memoizedState),(ne=ho||vb(l,d,ne,m,ce,Ne,U)||!1)?(fe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(m,Ne,U),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(m,Ne,U)),typeof I.componentDidUpdate=="function"&&(l.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof I.componentDidUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=Ne),I.props=m,I.state=Ne,I.context=U,m=ne):(typeof I.componentDidUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||F===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),m=!1)}return Rg(o,l,d,m,k,w)}function Rg(o,l,d,m,w,k){Ab(o,l);var I=(l.flags&128)!==0;if(!m&&!I)return w&&Nw(l,d,!1),Ei(o,l,k);m=l.stateNode,mM.current=l;var F=I&&typeof d.getDerivedStateFromError!="function"?null:m.render();return l.flags|=1,o!==null&&I?(l.child=Rl(l,o.child,null,k),l.child=Rl(l,null,F,k)):tr(o,l,F,k),l.memoizedState=m.state,w&&Nw(l,d,!0),l.child}function Ib(o){var l=o.stateNode;l.pendingContext?Lw(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Lw(o,l.context,!1),hg(o,l.containerInfo)}function Mb(o,l,d,m,w){return Al(),og(w),l.flags|=256,tr(o,l,d,m),l.child}var Ig={dehydrated:null,treeContext:null,retryLane:0};function Mg(o){return{baseLanes:o,cachePool:null,transitions:null}}function Lb(o,l,d){var m=l.pendingProps,w=Wt.current,k=!1,I=(l.flags&128)!==0,F;if((F=I)||(F=o!==null&&o.memoizedState===null?!1:(w&2)!==0),F?(k=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(w|=1),Tt(Wt,w&1),o===null)return ig(l),o=l.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((l.mode&1)===0?l.lanes=1:o.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(I=m.children,o=m.fallback,k?(m=l.mode,k=l.child,I={mode:"hidden",children:I},(m&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=I):k=_h(I,m,0,null),o=wa(o,m,d,null),k.return=l,o.return=l,k.sibling=o,l.child=k,l.child.memoizedState=Mg(d),l.memoizedState=Ig,o):Lg(l,I));if(w=o.memoizedState,w!==null&&(F=w.dehydrated,F!==null))return gM(o,l,I,m,F,w,d);if(k){k=m.fallback,I=l.mode,w=o.child,F=w.sibling;var U={mode:"hidden",children:m.children};return(I&1)===0&&l.child!==w?(m=l.child,m.childLanes=0,m.pendingProps=U,l.deletions=null):(m=xo(w,U),m.subtreeFlags=w.subtreeFlags&14680064),F!==null?k=xo(F,k):(k=wa(k,I,d,null),k.flags|=2),k.return=l,m.return=l,m.sibling=k,l.child=m,m=k,k=l.child,I=o.child.memoizedState,I=I===null?Mg(d):{baseLanes:I.baseLanes|d,cachePool:null,transitions:I.transitions},k.memoizedState=I,k.childLanes=o.childLanes&~d,l.memoizedState=Ig,m}return k=o.child,o=k.sibling,m=xo(k,{mode:"visible",children:m.children}),(l.mode&1)===0&&(m.lanes=d),m.return=l,m.sibling=null,o!==null&&(d=l.deletions,d===null?(l.deletions=[o],l.flags|=16):d.push(o)),l.child=m,l.memoizedState=null,m}function Lg(o,l){return l=_h({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function oh(o,l,d,m){return m!==null&&og(m),Rl(l,o.child,null,d),o=Lg(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function gM(o,l,d,m,w,k,I){if(d)return l.flags&256?(l.flags&=-257,m=Pg(Error(n(422))),oh(o,l,I,m)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(k=m.fallback,w=l.mode,m=_h({mode:"visible",children:m.children},w,0,null),k=wa(k,w,I,null),k.flags|=2,m.return=l,k.return=l,m.sibling=k,l.child=m,(l.mode&1)!==0&&Rl(l,o.child,null,I),l.child.memoizedState=Mg(I),l.memoizedState=Ig,k);if((l.mode&1)===0)return oh(o,l,I,null);if(w.data==="$!"){if(m=w.nextSibling&&w.nextSibling.dataset,m)var F=m.dgst;return m=F,k=Error(n(419)),m=Pg(k,m,void 0),oh(o,l,I,m)}if(F=(I&o.childLanes)!==0,fr||F){if(m=kn,m!==null){switch(I&-I){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(m.suspendedLanes|I))!==0?0:w,w!==0&&w!==k.retryLane&&(k.retryLane=w,bi(o,w),ws(m,o,w,-1))}return qg(),m=Pg(Error(n(421))),oh(o,l,I,m)}return w.data==="$?"?(l.flags|=128,l.child=o.child,l=AM.bind(null,o),w._reactRetry=l,null):(o=k.treeContext,Mr=lo(w.nextSibling),Ir=l,jt=!0,vs=null,o!==null&&(Xr[Qr++]=xi,Xr[Qr++]=wi,Xr[Qr++]=fa,xi=o.id,wi=o.overflow,fa=l),l=Lg(l,m.children),l.flags|=4096,l)}function Ob(o,l,d){o.lanes|=l;var m=o.alternate;m!==null&&(m.lanes|=l),cg(o.return,l,d)}function Og(o,l,d,m,w){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:w}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=m,k.tail=d,k.tailMode=w)}function Nb(o,l,d){var m=l.pendingProps,w=m.revealOrder,k=m.tail;if(tr(o,l,m.children,d),m=Wt.current,(m&2)!==0)m=m&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Ob(o,d,l);else if(o.tag===19)Ob(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}m&=1}if(Tt(Wt,m),(l.mode&1)===0)l.memoizedState=null;else switch(w){case"forwards":for(d=l.child,w=null;d!==null;)o=d.alternate,o!==null&&Jf(o)===null&&(w=d),d=d.sibling;d=w,d===null?(w=l.child,l.child=null):(w=d.sibling,d.sibling=null),Og(l,!1,w,d,k);break;case"backwards":for(d=null,w=l.child,l.child=null;w!==null;){if(o=w.alternate,o!==null&&Jf(o)===null){l.child=w;break}o=w.sibling,w.sibling=d,d=w,w=o}Og(l,!0,d,null,k);break;case"together":Og(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function ah(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function Ei(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),va|=l.lanes,(d&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,d=xo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=xo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function vM(o,l,d){switch(l.tag){case 3:Ib(l),Al();break;case 5:qw(l);break;case 1:dr(l.type)&&Uf(l);break;case 4:hg(l,l.stateNode.containerInfo);break;case 10:var m=l.type._context,w=l.memoizedProps.value;Tt(qf,m._currentValue),m._currentValue=w;break;case 13:if(m=l.memoizedState,m!==null)return m.dehydrated!==null?(Tt(Wt,Wt.current&1),l.flags|=128,null):(d&l.child.childLanes)!==0?Lb(o,l,d):(Tt(Wt,Wt.current&1),o=Ei(o,l,d),o!==null?o.sibling:null);Tt(Wt,Wt.current&1);break;case 19:if(m=(d&l.childLanes)!==0,(o.flags&128)!==0){if(m)return Nb(o,l,d);l.flags|=128}if(w=l.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Tt(Wt,Wt.current),m)break;return null;case 22:case 23:return l.lanes=0,Tb(o,l,d)}return Ei(o,l,d)}var Db,Ng,jb,Fb;Db=function(o,l){for(var d=l.child;d!==null;){if(d.tag===5||d.tag===6)o.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Ng=function(){},jb=function(o,l,d,m){var w=o.memoizedProps;if(w!==m){o=l.stateNode,ma(zs.current);var k=null;switch(d){case"input":w=it(o,w),m=it(o,m),k=[];break;case"select":w=H({},w,{value:void 0}),m=H({},m,{value:void 0}),k=[];break;case"textarea":w=Je(o,w),m=Je(o,m),k=[];break;default:typeof w.onClick!="function"&&typeof m.onClick=="function"&&(o.onclick=$f)}ps(d,m);var I;d=null;for(ne in w)if(!m.hasOwnProperty(ne)&&w.hasOwnProperty(ne)&&w[ne]!=null)if(ne==="style"){var F=w[ne];for(I in F)F.hasOwnProperty(I)&&(d||(d={}),d[I]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(s.hasOwnProperty(ne)?k||(k=[]):(k=k||[]).push(ne,null));for(ne in m){var U=m[ne];if(F=w!=null?w[ne]:void 0,m.hasOwnProperty(ne)&&U!==F&&(U!=null||F!=null))if(ne==="style")if(F){for(I in F)!F.hasOwnProperty(I)||U&&U.hasOwnProperty(I)||(d||(d={}),d[I]="");for(I in U)U.hasOwnProperty(I)&&F[I]!==U[I]&&(d||(d={}),d[I]=U[I])}else d||(k||(k=[]),k.push(ne,d)),d=U;else ne==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,F=F?F.__html:void 0,U!=null&&F!==U&&(k=k||[]).push(ne,U)):ne==="children"?typeof U!="string"&&typeof U!="number"||(k=k||[]).push(ne,""+U):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(s.hasOwnProperty(ne)?(U!=null&&ne==="onScroll"&&Mt("scroll",o),k||F===U||(k=[])):(k=k||[]).push(ne,U))}d&&(k=k||[]).push("style",d);var ne=k;(l.updateQueue=ne)&&(l.flags|=4)}},Fb=function(o,l,d,m){d!==m&&(l.flags|=4)};function Rc(o,l){if(!jt)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function Wn(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,m=0;if(l)for(var w=o.child;w!==null;)d|=w.lanes|w.childLanes,m|=w.subtreeFlags&14680064,m|=w.flags&14680064,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)d|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=m,o.childLanes=d,l}function yM(o,l,d){var m=l.pendingProps;switch(rg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wn(l),null;case 1:return dr(l.type)&&zf(),Wn(l),null;case 3:return m=l.stateNode,Ll(),Lt(cr),Lt(Un),gg(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(o===null||o.child===null)&&(Kf(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,vs!==null&&(Gg(vs),vs=null))),Ng(o,l),Wn(l),null;case 5:pg(l);var w=ma(kc.current);if(d=l.type,o!==null&&l.stateNode!=null)jb(o,l,d,m,w),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!m){if(l.stateNode===null)throw Error(n(166));return Wn(l),null}if(o=ma(zs.current),Kf(l)){m=l.stateNode,d=l.type;var k=l.memoizedProps;switch(m[Hs]=l,m[xc]=k,o=(l.mode&1)!==0,d){case"dialog":Mt("cancel",m),Mt("close",m);break;case"iframe":case"object":case"embed":Mt("load",m);break;case"video":case"audio":for(w=0;w<vc.length;w++)Mt(vc[w],m);break;case"source":Mt("error",m);break;case"img":case"image":case"link":Mt("error",m),Mt("load",m);break;case"details":Mt("toggle",m);break;case"input":Oe(m,k),Mt("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!k.multiple},Mt("invalid",m);break;case"textarea":vt(m,k),Mt("invalid",m)}ps(d,k),w=null;for(var I in k)if(k.hasOwnProperty(I)){var F=k[I];I==="children"?typeof F=="string"?m.textContent!==F&&(k.suppressHydrationWarning!==!0&&Vf(m.textContent,F,o),w=["children",F]):typeof F=="number"&&m.textContent!==""+F&&(k.suppressHydrationWarning!==!0&&Vf(m.textContent,F,o),w=["children",""+F]):s.hasOwnProperty(I)&&F!=null&&I==="onScroll"&&Mt("scroll",m)}switch(d){case"input":Se(m),mt(m,k,!0);break;case"textarea":Se(m),zt(m);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(m.onclick=$f)}m=w,l.updateQueue=m,m!==null&&(l.flags|=4)}else{I=w.nodeType===9?w:w.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=An(d)),o==="http://www.w3.org/1999/xhtml"?d==="script"?(o=I.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof m.is=="string"?o=I.createElement(d,{is:m.is}):(o=I.createElement(d),d==="select"&&(I=o,m.multiple?I.multiple=!0:m.size&&(I.size=m.size))):o=I.createElementNS(o,d),o[Hs]=l,o[xc]=m,Db(o,l,!1,!1),l.stateNode=o;e:{switch(I=Ds(d,m),d){case"dialog":Mt("cancel",o),Mt("close",o),w=m;break;case"iframe":case"object":case"embed":Mt("load",o),w=m;break;case"video":case"audio":for(w=0;w<vc.length;w++)Mt(vc[w],o);w=m;break;case"source":Mt("error",o),w=m;break;case"img":case"image":case"link":Mt("error",o),Mt("load",o),w=m;break;case"details":Mt("toggle",o),w=m;break;case"input":Oe(o,m),w=it(o,m),Mt("invalid",o);break;case"option":w=m;break;case"select":o._wrapperState={wasMultiple:!!m.multiple},w=H({},m,{value:void 0}),Mt("invalid",o);break;case"textarea":vt(o,m),w=Je(o,m),Mt("invalid",o);break;default:w=m}ps(d,w),F=w;for(k in F)if(F.hasOwnProperty(k)){var U=F[k];k==="style"?pi(o,U):k==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&Qn(o,U)):k==="children"?typeof U=="string"?(d!=="textarea"||U!=="")&&wn(o,U):typeof U=="number"&&wn(o,""+U):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(s.hasOwnProperty(k)?U!=null&&k==="onScroll"&&Mt("scroll",o):U!=null&&P(o,k,U,I))}switch(d){case"input":Se(o),mt(o,m,!1);break;case"textarea":Se(o),zt(o);break;case"option":m.value!=null&&o.setAttribute("value",""+ie(m.value));break;case"select":o.multiple=!!m.multiple,k=m.value,k!=null?lt(o,!!m.multiple,k,!1):m.defaultValue!=null&&lt(o,!!m.multiple,m.defaultValue,!0);break;default:typeof w.onClick=="function"&&(o.onclick=$f)}switch(d){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Wn(l),null;case 6:if(o&&l.stateNode!=null)Fb(o,l,o.memoizedProps,m);else{if(typeof m!="string"&&l.stateNode===null)throw Error(n(166));if(d=ma(kc.current),ma(zs.current),Kf(l)){if(m=l.stateNode,d=l.memoizedProps,m[Hs]=l,(k=m.nodeValue!==d)&&(o=Ir,o!==null))switch(o.tag){case 3:Vf(m.nodeValue,d,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&Vf(m.nodeValue,d,(o.mode&1)!==0)}k&&(l.flags|=4)}else m=(d.nodeType===9?d:d.ownerDocument).createTextNode(m),m[Hs]=l,l.stateNode=m}return Wn(l),null;case 13:if(Lt(Wt),m=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(jt&&Mr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)Hw(),Al(),l.flags|=98560,k=!1;else if(k=Kf(l),m!==null&&m.dehydrated!==null){if(o===null){if(!k)throw Error(n(318));if(k=l.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[Hs]=l}else Al(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Wn(l),k=!1}else vs!==null&&(Gg(vs),vs=null),k=!0;if(!k)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=d,l):(m=m!==null,m!==(o!==null&&o.memoizedState!==null)&&m&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(Wt.current&1)!==0?mn===0&&(mn=3):qg())),l.updateQueue!==null&&(l.flags|=4),Wn(l),null);case 4:return Ll(),Ng(o,l),o===null&&yc(l.stateNode.containerInfo),Wn(l),null;case 10:return ug(l.type._context),Wn(l),null;case 17:return dr(l.type)&&zf(),Wn(l),null;case 19:if(Lt(Wt),k=l.memoizedState,k===null)return Wn(l),null;if(m=(l.flags&128)!==0,I=k.rendering,I===null)if(m)Rc(k,!1);else{if(mn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(I=Jf(o),I!==null){for(l.flags|=128,Rc(k,!1),m=I.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),l.subtreeFlags=0,m=d,d=l.child;d!==null;)k=d,o=m,k.flags&=14680066,I=k.alternate,I===null?(k.childLanes=0,k.lanes=o,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=I.childLanes,k.lanes=I.lanes,k.child=I.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=I.memoizedProps,k.memoizedState=I.memoizedState,k.updateQueue=I.updateQueue,k.type=I.type,o=I.dependencies,k.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),d=d.sibling;return Tt(Wt,Wt.current&1|2),l.child}o=o.sibling}k.tail!==null&&Bt()>jl&&(l.flags|=128,m=!0,Rc(k,!1),l.lanes=4194304)}else{if(!m)if(o=Jf(I),o!==null){if(l.flags|=128,m=!0,d=o.updateQueue,d!==null&&(l.updateQueue=d,l.flags|=4),Rc(k,!0),k.tail===null&&k.tailMode==="hidden"&&!I.alternate&&!jt)return Wn(l),null}else 2*Bt()-k.renderingStartTime>jl&&d!==1073741824&&(l.flags|=128,m=!0,Rc(k,!1),l.lanes=4194304);k.isBackwards?(I.sibling=l.child,l.child=I):(d=k.last,d!==null?d.sibling=I:l.child=I,k.last=I)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=Bt(),l.sibling=null,d=Wt.current,Tt(Wt,m?d&1|2:d&1),l):(Wn(l),null);case 22:case 23:return Zg(),m=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==m&&(l.flags|=8192),m&&(l.mode&1)!==0?(Lr&1073741824)!==0&&(Wn(l),l.subtreeFlags&6&&(l.flags|=8192)):Wn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function _M(o,l){switch(rg(l),l.tag){case 1:return dr(l.type)&&zf(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Ll(),Lt(cr),Lt(Un),gg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return pg(l),null;case 13:if(Lt(Wt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Al()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Lt(Wt),null;case 4:return Ll(),null;case 10:return ug(l.type._context),null;case 22:case 23:return Zg(),null;case 24:return null;default:return null}}var lh=!1,Gn=!1,xM=typeof WeakSet=="function"?WeakSet:Set,Me=null;function Nl(o,l){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){Xt(o,l,m)}else d.current=null}function Dg(o,l,d){try{d()}catch(m){Xt(o,l,m)}}var Vb=!1;function wM(o,l){if(Z0=Tf,o=vw(),$0(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var w=m.anchorOffset,k=m.focusNode;m=m.focusOffset;try{d.nodeType,k.nodeType}catch{d=null;break e}var I=0,F=-1,U=-1,ne=0,fe=0,he=o,ce=null;t:for(;;){for(var Pe;he!==d||w!==0&&he.nodeType!==3||(F=I+w),he!==k||m!==0&&he.nodeType!==3||(U=I+m),he.nodeType===3&&(I+=he.nodeValue.length),(Pe=he.firstChild)!==null;)ce=he,he=Pe;for(;;){if(he===o)break t;if(ce===d&&++ne===w&&(F=I),ce===k&&++fe===m&&(U=I),(Pe=he.nextSibling)!==null)break;he=ce,ce=he.parentNode}he=Pe}d=F===-1||U===-1?null:{start:F,end:U}}else d=null}d=d||{start:0,end:0}}else d=null;for(q0={focusedElem:o,selectionRange:d},Tf=!1,Me=l;Me!==null;)if(l=Me,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Me=o;else for(;Me!==null;){l=Me;try{var Ne=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Fe=Ne.memoizedProps,sn=Ne.memoizedState,Q=l.stateNode,Z=Q.getSnapshotBeforeUpdate(l.elementType===l.type?Fe:ys(l.type,Fe),sn);Q.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var J=l.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ye){Xt(l,l.return,ye)}if(o=l.sibling,o!==null){o.return=l.return,Me=o;break}Me=l.return}return Ne=Vb,Vb=!1,Ne}function Ic(o,l,d){var m=l.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var w=m=m.next;do{if((w.tag&o)===o){var k=w.destroy;w.destroy=void 0,k!==void 0&&Dg(l,d,k)}w=w.next}while(w!==m)}}function uh(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&o)===o){var m=d.create;d.destroy=m()}d=d.next}while(d!==l)}}function jg(o){var l=o.ref;if(l!==null){var d=o.stateNode;switch(o.tag){case 5:o=d;break;default:o=d}typeof l=="function"?l(o):l.current=o}}function $b(o){var l=o.alternate;l!==null&&(o.alternate=null,$b(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Hs],delete l[xc],delete l[J0],delete l[rM],delete l[sM])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Hb(o){return o.tag===5||o.tag===3||o.tag===4}function zb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Hb(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Fg(o,l,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,l?d.nodeType===8?d.parentNode.insertBefore(o,l):d.insertBefore(o,l):(d.nodeType===8?(l=d.parentNode,l.insertBefore(o,d)):(l=d,l.appendChild(o)),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=$f));else if(m!==4&&(o=o.child,o!==null))for(Fg(o,l,d),o=o.sibling;o!==null;)Fg(o,l,d),o=o.sibling}function Vg(o,l,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(m!==4&&(o=o.child,o!==null))for(Vg(o,l,d),o=o.sibling;o!==null;)Vg(o,l,d),o=o.sibling}var Ln=null,_s=!1;function mo(o,l,d){for(d=d.child;d!==null;)Ub(o,l,d),d=d.sibling}function Ub(o,l,d){if(z&&typeof z.onCommitFiberUnmount=="function")try{z.onCommitFiberUnmount(ua,d)}catch{}switch(d.tag){case 5:Gn||Nl(d,l);case 6:var m=Ln,w=_s;Ln=null,mo(o,l,d),Ln=m,_s=w,Ln!==null&&(_s?(o=Ln,d=d.stateNode,o.nodeType===8?o.parentNode.removeChild(d):o.removeChild(d)):Ln.removeChild(d.stateNode));break;case 18:Ln!==null&&(_s?(o=Ln,d=d.stateNode,o.nodeType===8?Q0(o.parentNode,d):o.nodeType===1&&Q0(o,d),uc(o)):Q0(Ln,d.stateNode));break;case 4:m=Ln,w=_s,Ln=d.stateNode.containerInfo,_s=!0,mo(o,l,d),Ln=m,_s=w;break;case 0:case 11:case 14:case 15:if(!Gn&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){w=m=m.next;do{var k=w,I=k.destroy;k=k.tag,I!==void 0&&((k&2)!==0||(k&4)!==0)&&Dg(d,l,I),w=w.next}while(w!==m)}mo(o,l,d);break;case 1:if(!Gn&&(Nl(d,l),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(F){Xt(d,l,F)}mo(o,l,d);break;case 21:mo(o,l,d);break;case 22:d.mode&1?(Gn=(m=Gn)||d.memoizedState!==null,mo(o,l,d),Gn=m):mo(o,l,d);break;default:mo(o,l,d)}}function Bb(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new xM),l.forEach(function(m){var w=RM.bind(null,o,m);d.has(m)||(d.add(m),m.then(w,w))})}}function xs(o,l){var d=l.deletions;if(d!==null)for(var m=0;m<d.length;m++){var w=d[m];try{var k=o,I=l,F=I;e:for(;F!==null;){switch(F.tag){case 5:Ln=F.stateNode,_s=!1;break e;case 3:Ln=F.stateNode.containerInfo,_s=!0;break e;case 4:Ln=F.stateNode.containerInfo,_s=!0;break e}F=F.return}if(Ln===null)throw Error(n(160));Ub(k,I,w),Ln=null,_s=!1;var U=w.alternate;U!==null&&(U.return=null),w.return=null}catch(ne){Xt(w,l,ne)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)Wb(l,o),l=l.sibling}function Wb(o,l){var d=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(xs(l,o),Bs(o),m&4){try{Ic(3,o,o.return),uh(3,o)}catch(Fe){Xt(o,o.return,Fe)}try{Ic(5,o,o.return)}catch(Fe){Xt(o,o.return,Fe)}}break;case 1:xs(l,o),Bs(o),m&512&&d!==null&&Nl(d,d.return);break;case 5:if(xs(l,o),Bs(o),m&512&&d!==null&&Nl(d,d.return),o.flags&32){var w=o.stateNode;try{wn(w,"")}catch(Fe){Xt(o,o.return,Fe)}}if(m&4&&(w=o.stateNode,w!=null)){var k=o.memoizedProps,I=d!==null?d.memoizedProps:k,F=o.type,U=o.updateQueue;if(o.updateQueue=null,U!==null)try{F==="input"&&k.type==="radio"&&k.name!=null&&at(w,k),Ds(F,I);var ne=Ds(F,k);for(I=0;I<U.length;I+=2){var fe=U[I],he=U[I+1];fe==="style"?pi(w,he):fe==="dangerouslySetInnerHTML"?Qn(w,he):fe==="children"?wn(w,he):P(w,fe,he,ne)}switch(F){case"input":It(w,k);break;case"textarea":xn(w,k);break;case"select":var ce=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!k.multiple;var Pe=k.value;Pe!=null?lt(w,!!k.multiple,Pe,!1):ce!==!!k.multiple&&(k.defaultValue!=null?lt(w,!!k.multiple,k.defaultValue,!0):lt(w,!!k.multiple,k.multiple?[]:"",!1))}w[xc]=k}catch(Fe){Xt(o,o.return,Fe)}}break;case 6:if(xs(l,o),Bs(o),m&4){if(o.stateNode===null)throw Error(n(162));w=o.stateNode,k=o.memoizedProps;try{w.nodeValue=k}catch(Fe){Xt(o,o.return,Fe)}}break;case 3:if(xs(l,o),Bs(o),m&4&&d!==null&&d.memoizedState.isDehydrated)try{uc(l.containerInfo)}catch(Fe){Xt(o,o.return,Fe)}break;case 4:xs(l,o),Bs(o);break;case 13:xs(l,o),Bs(o),w=o.child,w.flags&8192&&(k=w.memoizedState!==null,w.stateNode.isHidden=k,!k||w.alternate!==null&&w.alternate.memoizedState!==null||(zg=Bt())),m&4&&Bb(o);break;case 22:if(fe=d!==null&&d.memoizedState!==null,o.mode&1?(Gn=(ne=Gn)||fe,xs(l,o),Gn=ne):xs(l,o),Bs(o),m&8192){if(ne=o.memoizedState!==null,(o.stateNode.isHidden=ne)&&!fe&&(o.mode&1)!==0)for(Me=o,fe=o.child;fe!==null;){for(he=Me=fe;Me!==null;){switch(ce=Me,Pe=ce.child,ce.tag){case 0:case 11:case 14:case 15:Ic(4,ce,ce.return);break;case 1:Nl(ce,ce.return);var Ne=ce.stateNode;if(typeof Ne.componentWillUnmount=="function"){m=ce,d=ce.return;try{l=m,Ne.props=l.memoizedProps,Ne.state=l.memoizedState,Ne.componentWillUnmount()}catch(Fe){Xt(m,d,Fe)}}break;case 5:Nl(ce,ce.return);break;case 22:if(ce.memoizedState!==null){Zb(he);continue}}Pe!==null?(Pe.return=ce,Me=Pe):Zb(he)}fe=fe.sibling}e:for(fe=null,he=o;;){if(he.tag===5){if(fe===null){fe=he;try{w=he.stateNode,ne?(k=w.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(F=he.stateNode,U=he.memoizedProps.style,I=U!=null&&U.hasOwnProperty("display")?U.display:null,F.style.display=Rn("display",I))}catch(Fe){Xt(o,o.return,Fe)}}}else if(he.tag===6){if(fe===null)try{he.stateNode.nodeValue=ne?"":he.memoizedProps}catch(Fe){Xt(o,o.return,Fe)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===o)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===o)break e;for(;he.sibling===null;){if(he.return===null||he.return===o)break e;fe===he&&(fe=null),he=he.return}fe===he&&(fe=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:xs(l,o),Bs(o),m&4&&Bb(o);break;case 21:break;default:xs(l,o),Bs(o)}}function Bs(o){var l=o.flags;if(l&2){try{e:{for(var d=o.return;d!==null;){if(Hb(d)){var m=d;break e}d=d.return}throw Error(n(160))}switch(m.tag){case 5:var w=m.stateNode;m.flags&32&&(wn(w,""),m.flags&=-33);var k=zb(o);Vg(o,k,w);break;case 3:case 4:var I=m.stateNode.containerInfo,F=zb(o);Fg(o,F,I);break;default:throw Error(n(161))}}catch(U){Xt(o,o.return,U)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function bM(o,l,d){Me=o,Gb(o)}function Gb(o,l,d){for(var m=(o.mode&1)!==0;Me!==null;){var w=Me,k=w.child;if(w.tag===22&&m){var I=w.memoizedState!==null||lh;if(!I){var F=w.alternate,U=F!==null&&F.memoizedState!==null||Gn;F=lh;var ne=Gn;if(lh=I,(Gn=U)&&!ne)for(Me=w;Me!==null;)I=Me,U=I.child,I.tag===22&&I.memoizedState!==null?qb(w):U!==null?(U.return=I,Me=U):qb(w);for(;k!==null;)Me=k,Gb(k),k=k.sibling;Me=w,lh=F,Gn=ne}Kb(o)}else(w.subtreeFlags&8772)!==0&&k!==null?(k.return=w,Me=k):Kb(o)}}function Kb(o){for(;Me!==null;){var l=Me;if((l.flags&8772)!==0){var d=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Gn||uh(5,l);break;case 1:var m=l.stateNode;if(l.flags&4&&!Gn)if(d===null)m.componentDidMount();else{var w=l.elementType===l.type?d.memoizedProps:ys(l.type,d.memoizedProps);m.componentDidUpdate(w,d.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var k=l.updateQueue;k!==null&&Zw(l,k,m);break;case 3:var I=l.updateQueue;if(I!==null){if(d=null,l.child!==null)switch(l.child.tag){case 5:d=l.child.stateNode;break;case 1:d=l.child.stateNode}Zw(l,I,d)}break;case 5:var F=l.stateNode;if(d===null&&l.flags&4){d=F;var U=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&d.focus();break;case"img":U.src&&(d.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var ne=l.alternate;if(ne!==null){var fe=ne.memoizedState;if(fe!==null){var he=fe.dehydrated;he!==null&&uc(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Gn||l.flags&512&&jg(l)}catch(ce){Xt(l,l.return,ce)}}if(l===o){Me=null;break}if(d=l.sibling,d!==null){d.return=l.return,Me=d;break}Me=l.return}}function Zb(o){for(;Me!==null;){var l=Me;if(l===o){Me=null;break}var d=l.sibling;if(d!==null){d.return=l.return,Me=d;break}Me=l.return}}function qb(o){for(;Me!==null;){var l=Me;try{switch(l.tag){case 0:case 11:case 15:var d=l.return;try{uh(4,l)}catch(U){Xt(l,d,U)}break;case 1:var m=l.stateNode;if(typeof m.componentDidMount=="function"){var w=l.return;try{m.componentDidMount()}catch(U){Xt(l,w,U)}}var k=l.return;try{jg(l)}catch(U){Xt(l,k,U)}break;case 5:var I=l.return;try{jg(l)}catch(U){Xt(l,I,U)}}}catch(U){Xt(l,l.return,U)}if(l===o){Me=null;break}var F=l.sibling;if(F!==null){F.return=l.return,Me=F;break}Me=l.return}}var SM=Math.ceil,ch=T.ReactCurrentDispatcher,$g=T.ReactCurrentOwner,ts=T.ReactCurrentBatchConfig,dt=0,kn=null,ln=null,On=0,Lr=0,Dl=uo(0),mn=0,Mc=null,va=0,dh=0,Hg=0,Lc=null,hr=null,zg=0,jl=1/0,ki=null,fh=!1,Ug=null,go=null,hh=!1,vo=null,ph=0,Oc=0,Bg=null,mh=-1,gh=0;function nr(){return(dt&6)!==0?Bt():mh!==-1?mh:mh=Bt()}function yo(o){return(o.mode&1)===0?1:(dt&2)!==0&&On!==0?On&-On:oM.transition!==null?(gh===0&&(gh=Sn()),gh):(o=gt,o!==0||(o=window.event,o=o===void 0?16:Xx(o.type)),o)}function ws(o,l,d,m){if(50<Oc)throw Oc=0,Bg=null,Error(n(185));Ar(o,d,m),((dt&2)===0||o!==kn)&&(o===kn&&((dt&2)===0&&(dh|=d),mn===4&&_o(o,On)),pr(o,m),d===1&&dt===0&&(l.mode&1)===0&&(jl=Bt()+500,Bf&&fo()))}function pr(o,l){var d=o.callbackNode;$s(o,l);var m=Mn(o,o===kn?On:0);if(m===0)d!==null&&eo(d),o.callbackNode=null,o.callbackPriority=0;else if(l=m&-m,o.callbackPriority!==l){if(d!=null&&eo(d),l===1)o.tag===0?iM(Xb.bind(null,o)):Dw(Xb.bind(null,o)),tM(function(){(dt&6)===0&&fo()}),d=null;else{switch(Ux(m)){case 1:d=to;break;case 4:d=gl;break;case 16:d=la;break;case 536870912:d=sc;break;default:d=la}d=iS(d,Yb.bind(null,o))}o.callbackPriority=l,o.callbackNode=d}}function Yb(o,l){if(mh=-1,gh=0,(dt&6)!==0)throw Error(n(327));var d=o.callbackNode;if(Fl()&&o.callbackNode!==d)return null;var m=Mn(o,o===kn?On:0);if(m===0)return null;if((m&30)!==0||(m&o.expiredLanes)!==0||l)l=vh(o,m);else{l=m;var w=dt;dt|=2;var k=Jb();(kn!==o||On!==l)&&(ki=null,jl=Bt()+500,_a(o,l));do try{CM();break}catch(F){Qb(o,F)}while(!0);lg(),ch.current=k,dt=w,ln!==null?l=0:(kn=null,On=0,l=mn)}if(l!==0){if(l===2&&(w=qr(o),w!==0&&(m=w,l=Wg(o,w))),l===1)throw d=Mc,_a(o,0),_o(o,m),pr(o,Bt()),d;if(l===6)_o(o,m);else{if(w=o.current.alternate,(m&30)===0&&!EM(w)&&(l=vh(o,m),l===2&&(k=qr(o),k!==0&&(m=k,l=Wg(o,k))),l===1))throw d=Mc,_a(o,0),_o(o,m),pr(o,Bt()),d;switch(o.finishedWork=w,o.finishedLanes=m,l){case 0:case 1:throw Error(n(345));case 2:xa(o,hr,ki);break;case 3:if(_o(o,m),(m&130023424)===m&&(l=zg+500-Bt(),10<l)){if(Mn(o,0)!==0)break;if(w=o.suspendedLanes,(w&m)!==m){nr(),o.pingedLanes|=o.suspendedLanes&w;break}o.timeoutHandle=X0(xa.bind(null,o,hr,ki),l);break}xa(o,hr,ki);break;case 4:if(_o(o,m),(m&4194240)===m)break;for(l=o.eventTimes,w=-1;0<m;){var I=31-xe(m);k=1<<I,I=l[I],I>w&&(w=I),m&=~k}if(m=w,m=Bt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*SM(m/1960))-m,10<m){o.timeoutHandle=X0(xa.bind(null,o,hr,ki),m);break}xa(o,hr,ki);break;case 5:xa(o,hr,ki);break;default:throw Error(n(329))}}}return pr(o,Bt()),o.callbackNode===d?Yb.bind(null,o):null}function Wg(o,l){var d=Lc;return o.current.memoizedState.isDehydrated&&(_a(o,l).flags|=256),o=vh(o,l),o!==2&&(l=hr,hr=d,l!==null&&Gg(l)),o}function Gg(o){hr===null?hr=o:hr.push.apply(hr,o)}function EM(o){for(var l=o;;){if(l.flags&16384){var d=l.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var m=0;m<d.length;m++){var w=d[m],k=w.getSnapshot;w=w.value;try{if(!gs(k(),w))return!1}catch{return!1}}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function _o(o,l){for(l&=~Hg,l&=~dh,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var d=31-xe(l),m=1<<d;o[d]=-1,l&=~m}}function Xb(o){if((dt&6)!==0)throw Error(n(327));Fl();var l=Mn(o,0);if((l&1)===0)return pr(o,Bt()),null;var d=vh(o,l);if(o.tag!==0&&d===2){var m=qr(o);m!==0&&(l=m,d=Wg(o,m))}if(d===1)throw d=Mc,_a(o,0),_o(o,l),pr(o,Bt()),d;if(d===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,xa(o,hr,ki),pr(o,Bt()),null}function Kg(o,l){var d=dt;dt|=1;try{return o(l)}finally{dt=d,dt===0&&(jl=Bt()+500,Bf&&fo())}}function ya(o){vo!==null&&vo.tag===0&&(dt&6)===0&&Fl();var l=dt;dt|=1;var d=ts.transition,m=gt;try{if(ts.transition=null,gt=1,o)return o()}finally{gt=m,ts.transition=d,dt=l,(dt&6)===0&&fo()}}function Zg(){Lr=Dl.current,Lt(Dl)}function _a(o,l){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==-1&&(o.timeoutHandle=-1,eM(d)),ln!==null)for(d=ln.return;d!==null;){var m=d;switch(rg(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&zf();break;case 3:Ll(),Lt(cr),Lt(Un),gg();break;case 5:pg(m);break;case 4:Ll();break;case 13:Lt(Wt);break;case 19:Lt(Wt);break;case 10:ug(m.type._context);break;case 22:case 23:Zg()}d=d.return}if(kn=o,ln=o=xo(o.current,null),On=Lr=l,mn=0,Mc=null,Hg=dh=va=0,hr=Lc=null,pa!==null){for(l=0;l<pa.length;l++)if(d=pa[l],m=d.interleaved,m!==null){d.interleaved=null;var w=m.next,k=d.pending;if(k!==null){var I=k.next;k.next=w,m.next=I}d.pending=m}pa=null}return o}function Qb(o,l){do{var d=ln;try{if(lg(),eh.current=sh,th){for(var m=Gt.memoizedState;m!==null;){var w=m.queue;w!==null&&(w.pending=null),m=m.next}th=!1}if(ga=0,En=pn=Gt=null,Cc=!1,Pc=0,$g.current=null,d===null||d.return===null){mn=1,Mc=l,ln=null;break}e:{var k=o,I=d.return,F=d,U=l;if(l=On,F.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var ne=U,fe=F,he=fe.tag;if((fe.mode&1)===0&&(he===0||he===11||he===15)){var ce=fe.alternate;ce?(fe.updateQueue=ce.updateQueue,fe.memoizedState=ce.memoizedState,fe.lanes=ce.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var Pe=Sb(I);if(Pe!==null){Pe.flags&=-257,Eb(Pe,I,F,k,l),Pe.mode&1&&bb(k,ne,l),l=Pe,U=ne;var Ne=l.updateQueue;if(Ne===null){var Fe=new Set;Fe.add(U),l.updateQueue=Fe}else Ne.add(U);break e}else{if((l&1)===0){bb(k,ne,l),qg();break e}U=Error(n(426))}}else if(jt&&F.mode&1){var sn=Sb(I);if(sn!==null){(sn.flags&65536)===0&&(sn.flags|=256),Eb(sn,I,F,k,l),og(Ol(U,F));break e}}k=U=Ol(U,F),mn!==4&&(mn=2),Lc===null?Lc=[k]:Lc.push(k),k=I;do{switch(k.tag){case 3:k.flags|=65536,l&=-l,k.lanes|=l;var Q=xb(k,U,l);Kw(k,Q);break e;case 1:F=U;var Z=k.type,J=k.stateNode;if((k.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(go===null||!go.has(J)))){k.flags|=65536,l&=-l,k.lanes|=l;var ye=wb(k,F,l);Kw(k,ye);break e}}k=k.return}while(k!==null)}tS(d)}catch(Ve){l=Ve,ln===d&&d!==null&&(ln=d=d.return);continue}break}while(!0)}function Jb(){var o=ch.current;return ch.current=sh,o===null?sh:o}function qg(){(mn===0||mn===3||mn===2)&&(mn=4),kn===null||(va&268435455)===0&&(dh&268435455)===0||_o(kn,On)}function vh(o,l){var d=dt;dt|=2;var m=Jb();(kn!==o||On!==l)&&(ki=null,_a(o,l));do try{kM();break}catch(w){Qb(o,w)}while(!0);if(lg(),dt=d,ch.current=m,ln!==null)throw Error(n(261));return kn=null,On=0,mn}function kM(){for(;ln!==null;)eS(ln)}function CM(){for(;ln!==null&&!Sf();)eS(ln)}function eS(o){var l=sS(o.alternate,o,Lr);o.memoizedProps=o.pendingProps,l===null?tS(o):ln=l,$g.current=null}function tS(o){var l=o;do{var d=l.alternate;if(o=l.return,(l.flags&32768)===0){if(d=yM(d,l,Lr),d!==null){ln=d;return}}else{if(d=_M(d,l),d!==null){d.flags&=32767,ln=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{mn=6,ln=null;return}}if(l=l.sibling,l!==null){ln=l;return}ln=l=o}while(l!==null);mn===0&&(mn=5)}function xa(o,l,d){var m=gt,w=ts.transition;try{ts.transition=null,gt=1,PM(o,l,d,m)}finally{ts.transition=w,gt=m}return null}function PM(o,l,d,m){do Fl();while(vo!==null);if((dt&6)!==0)throw Error(n(327));d=o.finishedWork;var w=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var k=d.lanes|d.childLanes;if(aI(o,k),o===kn&&(ln=kn=null,On=0),(d.subtreeFlags&2064)===0&&(d.flags&2064)===0||hh||(hh=!0,iS(la,function(){return Fl(),null})),k=(d.flags&15990)!==0,(d.subtreeFlags&15990)!==0||k){k=ts.transition,ts.transition=null;var I=gt;gt=1;var F=dt;dt|=4,$g.current=null,wM(o,d),Wb(d,o),KI(q0),Tf=!!Z0,q0=Z0=null,o.current=d,bM(d),rc(),dt=F,gt=I,ts.transition=k}else o.current=d;if(hh&&(hh=!1,vo=o,ph=w),k=o.pendingLanes,k===0&&(go=null),le(d.stateNode),pr(o,Bt()),l!==null)for(m=o.onRecoverableError,d=0;d<l.length;d++)w=l[d],m(w.value,{componentStack:w.stack,digest:w.digest});if(fh)throw fh=!1,o=Ug,Ug=null,o;return(ph&1)!==0&&o.tag!==0&&Fl(),k=o.pendingLanes,(k&1)!==0?o===Bg?Oc++:(Oc=0,Bg=o):Oc=0,fo(),null}function Fl(){if(vo!==null){var o=Ux(ph),l=ts.transition,d=gt;try{if(ts.transition=null,gt=16>o?16:o,vo===null)var m=!1;else{if(o=vo,vo=null,ph=0,(dt&6)!==0)throw Error(n(331));var w=dt;for(dt|=4,Me=o.current;Me!==null;){var k=Me,I=k.child;if((Me.flags&16)!==0){var F=k.deletions;if(F!==null){for(var U=0;U<F.length;U++){var ne=F[U];for(Me=ne;Me!==null;){var fe=Me;switch(fe.tag){case 0:case 11:case 15:Ic(8,fe,k)}var he=fe.child;if(he!==null)he.return=fe,Me=he;else for(;Me!==null;){fe=Me;var ce=fe.sibling,Pe=fe.return;if($b(fe),fe===ne){Me=null;break}if(ce!==null){ce.return=Pe,Me=ce;break}Me=Pe}}}var Ne=k.alternate;if(Ne!==null){var Fe=Ne.child;if(Fe!==null){Ne.child=null;do{var sn=Fe.sibling;Fe.sibling=null,Fe=sn}while(Fe!==null)}}Me=k}}if((k.subtreeFlags&2064)!==0&&I!==null)I.return=k,Me=I;else e:for(;Me!==null;){if(k=Me,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:Ic(9,k,k.return)}var Q=k.sibling;if(Q!==null){Q.return=k.return,Me=Q;break e}Me=k.return}}var Z=o.current;for(Me=Z;Me!==null;){I=Me;var J=I.child;if((I.subtreeFlags&2064)!==0&&J!==null)J.return=I,Me=J;else e:for(I=Z;Me!==null;){if(F=Me,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:uh(9,F)}}catch(Ve){Xt(F,F.return,Ve)}if(F===I){Me=null;break e}var ye=F.sibling;if(ye!==null){ye.return=F.return,Me=ye;break e}Me=F.return}}if(dt=w,fo(),z&&typeof z.onPostCommitFiberRoot=="function")try{z.onPostCommitFiberRoot(ua,o)}catch{}m=!0}return m}finally{gt=d,ts.transition=l}}return!1}function nS(o,l,d){l=Ol(d,l),l=xb(o,l,1),o=po(o,l,1),l=nr(),o!==null&&(Ar(o,1,l),pr(o,l))}function Xt(o,l,d){if(o.tag===3)nS(o,o,d);else for(;l!==null;){if(l.tag===3){nS(l,o,d);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(go===null||!go.has(m))){o=Ol(d,o),o=wb(l,o,1),l=po(l,o,1),o=nr(),l!==null&&(Ar(l,1,o),pr(l,o));break}}l=l.return}}function TM(o,l,d){var m=o.pingCache;m!==null&&m.delete(l),l=nr(),o.pingedLanes|=o.suspendedLanes&d,kn===o&&(On&d)===d&&(mn===4||mn===3&&(On&130023424)===On&&500>Bt()-zg?_a(o,0):Hg|=d),pr(o,l)}function rS(o,l){l===0&&((o.mode&1)===0?l=1:(l=ke,ke<<=1,(ke&130023424)===0&&(ke=4194304)));var d=nr();o=bi(o,l),o!==null&&(Ar(o,l,d),pr(o,d))}function AM(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),rS(o,d)}function RM(o,l){var d=0;switch(o.tag){case 13:var m=o.stateNode,w=o.memoizedState;w!==null&&(d=w.retryLane);break;case 19:m=o.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(l),rS(o,d)}var sS;sS=function(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps||cr.current)fr=!0;else{if((o.lanes&d)===0&&(l.flags&128)===0)return fr=!1,vM(o,l,d);fr=(o.flags&131072)!==0}else fr=!1,jt&&(l.flags&1048576)!==0&&jw(l,Gf,l.index);switch(l.lanes=0,l.tag){case 2:var m=l.type;ah(o,l),o=l.pendingProps;var w=Cl(l,Un.current);Ml(l,d),w=_g(null,l,m,o,w,d);var k=xg();return l.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,dr(m)?(k=!0,Uf(l)):k=!1,l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,fg(l),w.updater=ih,l.stateNode=w,w._reactInternals=l,Cg(l,m,o,d),l=Rg(null,l,m,!0,k,d)):(l.tag=0,jt&&k&&ng(l),tr(null,l,w,d),l=l.child),l;case 16:m=l.elementType;e:{switch(ah(o,l),o=l.pendingProps,w=m._init,m=w(m._payload),l.type=m,w=l.tag=MM(m),o=ys(m,o),w){case 0:l=Ag(null,l,m,o,d);break e;case 1:l=Rb(null,l,m,o,d);break e;case 11:l=kb(null,l,m,o,d);break e;case 14:l=Cb(null,l,m,ys(m.type,o),d);break e}throw Error(n(306,m,""))}return l;case 0:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:ys(m,w),Ag(o,l,m,w,d);case 1:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:ys(m,w),Rb(o,l,m,w,d);case 3:e:{if(Ib(l),o===null)throw Error(n(387));m=l.pendingProps,k=l.memoizedState,w=k.element,Gw(o,l),Qf(l,m,null,d);var I=l.memoizedState;if(m=I.element,k.isDehydrated)if(k={element:m,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},l.updateQueue.baseState=k,l.memoizedState=k,l.flags&256){w=Ol(Error(n(423)),l),l=Mb(o,l,m,d,w);break e}else if(m!==w){w=Ol(Error(n(424)),l),l=Mb(o,l,m,d,w);break e}else for(Mr=lo(l.stateNode.containerInfo.firstChild),Ir=l,jt=!0,vs=null,d=Bw(l,null,m,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Al(),m===w){l=Ei(o,l,d);break e}tr(o,l,m,d)}l=l.child}return l;case 5:return qw(l),o===null&&ig(l),m=l.type,w=l.pendingProps,k=o!==null?o.memoizedProps:null,I=w.children,Y0(m,w)?I=null:k!==null&&Y0(m,k)&&(l.flags|=32),Ab(o,l),tr(o,l,I,d),l.child;case 6:return o===null&&ig(l),null;case 13:return Lb(o,l,d);case 4:return hg(l,l.stateNode.containerInfo),m=l.pendingProps,o===null?l.child=Rl(l,null,m,d):tr(o,l,m,d),l.child;case 11:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:ys(m,w),kb(o,l,m,w,d);case 7:return tr(o,l,l.pendingProps,d),l.child;case 8:return tr(o,l,l.pendingProps.children,d),l.child;case 12:return tr(o,l,l.pendingProps.children,d),l.child;case 10:e:{if(m=l.type._context,w=l.pendingProps,k=l.memoizedProps,I=w.value,Tt(qf,m._currentValue),m._currentValue=I,k!==null)if(gs(k.value,I)){if(k.children===w.children&&!cr.current){l=Ei(o,l,d);break e}}else for(k=l.child,k!==null&&(k.return=l);k!==null;){var F=k.dependencies;if(F!==null){I=k.child;for(var U=F.firstContext;U!==null;){if(U.context===m){if(k.tag===1){U=Si(-1,d&-d),U.tag=2;var ne=k.updateQueue;if(ne!==null){ne=ne.shared;var fe=ne.pending;fe===null?U.next=U:(U.next=fe.next,fe.next=U),ne.pending=U}}k.lanes|=d,U=k.alternate,U!==null&&(U.lanes|=d),cg(k.return,d,l),F.lanes|=d;break}U=U.next}}else if(k.tag===10)I=k.type===l.type?null:k.child;else if(k.tag===18){if(I=k.return,I===null)throw Error(n(341));I.lanes|=d,F=I.alternate,F!==null&&(F.lanes|=d),cg(I,d,l),I=k.sibling}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===l){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}tr(o,l,w.children,d),l=l.child}return l;case 9:return w=l.type,m=l.pendingProps.children,Ml(l,d),w=Jr(w),m=m(w),l.flags|=1,tr(o,l,m,d),l.child;case 14:return m=l.type,w=ys(m,l.pendingProps),w=ys(m.type,w),Cb(o,l,m,w,d);case 15:return Pb(o,l,l.type,l.pendingProps,d);case 17:return m=l.type,w=l.pendingProps,w=l.elementType===m?w:ys(m,w),ah(o,l),l.tag=1,dr(m)?(o=!0,Uf(l)):o=!1,Ml(l,d),yb(l,m,w),Cg(l,m,w,d),Rg(null,l,m,!0,o,d);case 19:return Nb(o,l,d);case 22:return Tb(o,l,d)}throw Error(n(156,l.tag))};function iS(o,l){return nc(o,l)}function IM(o,l,d,m){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ns(o,l,d,m){return new IM(o,l,d,m)}function Yg(o){return o=o.prototype,!(!o||!o.isReactComponent)}function MM(o){if(typeof o=="function")return Yg(o)?1:0;if(o!=null){if(o=o.$$typeof,o===V)return 11;if(o===K)return 14}return 2}function xo(o,l){var d=o.alternate;return d===null?(d=ns(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function yh(o,l,d,m,w,k){var I=2;if(m=o,typeof o=="function")Yg(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case M:return wa(d.children,w,k,l);case R:I=8,w|=8;break;case L:return o=ns(12,d,l,w|2),o.elementType=L,o.lanes=k,o;case G:return o=ns(13,d,l,w),o.elementType=G,o.lanes=k,o;case Y:return o=ns(19,d,l,w),o.elementType=Y,o.lanes=k,o;case X:return _h(d,w,k,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case N:I=10;break e;case j:I=9;break e;case V:I=11;break e;case K:I=14;break e;case B:I=16,m=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=ns(I,d,l,w),l.elementType=o,l.type=m,l.lanes=k,l}function wa(o,l,d,m){return o=ns(7,o,m,l),o.lanes=d,o}function _h(o,l,d,m){return o=ns(22,o,m,l),o.elementType=X,o.lanes=d,o.stateNode={isHidden:!1},o}function Xg(o,l,d){return o=ns(6,o,null,l),o.lanes=d,o}function Qg(o,l,d){return l=ns(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function LM(o,l,d,m,w){this.tag=l,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Yr(0),this.expirationTimes=Yr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yr(0),this.identifierPrefix=m,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function Jg(o,l,d,m,w,k,I,F,U){return o=new LM(o,l,d,F,U),l===1?(l=1,k===!0&&(l|=8)):l=0,k=ns(3,null,null,l),o.current=k,k.stateNode=o,k.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},fg(k),o}function OM(o,l,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:m==null?null:""+m,children:o,containerInfo:l,implementation:d}}function oS(o){if(!o)return co;o=o._reactInternals;e:{if(vi(o)!==o||o.tag!==1)throw Error(n(170));var l=o;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(dr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var d=o.type;if(dr(d))return Ow(o,d,l)}return l}function aS(o,l,d,m,w,k,I,F,U){return o=Jg(d,m,!0,o,w,k,I,F,U),o.context=oS(null),d=o.current,m=nr(),w=yo(d),k=Si(m,w),k.callback=l??null,po(d,k,w),o.current.lanes=w,Ar(o,w,m),pr(o,m),o}function xh(o,l,d,m){var w=l.current,k=nr(),I=yo(w);return d=oS(d),l.context===null?l.context=d:l.pendingContext=d,l=Si(k,I),l.payload={element:o},m=m===void 0?null:m,m!==null&&(l.callback=m),o=po(w,l,I),o!==null&&(ws(o,w,I,k),Xf(o,w,I)),I}function wh(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function lS(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function ev(o,l){lS(o,l),(o=o.alternate)&&lS(o,l)}function NM(){return null}var uS=typeof reportError=="function"?reportError:function(o){console.error(o)};function tv(o){this._internalRoot=o}bh.prototype.render=tv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));xh(o,l,null,null)},bh.prototype.unmount=tv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;ya(function(){xh(null,o,null,null)}),l[yi]=null}};function bh(o){this._internalRoot=o}bh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Gx();o={blockedOn:null,target:o,priority:l};for(var d=0;d<io.length&&l!==0&&l<io[d].priority;d++);io.splice(d,0,o),d===0&&qx(o)}};function nv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Sh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function cS(){}function DM(o,l,d,m,w){if(w){if(typeof m=="function"){var k=m;m=function(){var ne=wh(I);k.call(ne)}}var I=aS(l,m,o,0,null,!1,!1,"",cS);return o._reactRootContainer=I,o[yi]=I.current,yc(o.nodeType===8?o.parentNode:o),ya(),I}for(;w=o.lastChild;)o.removeChild(w);if(typeof m=="function"){var F=m;m=function(){var ne=wh(U);F.call(ne)}}var U=Jg(o,0,!1,null,null,!1,!1,"",cS);return o._reactRootContainer=U,o[yi]=U.current,yc(o.nodeType===8?o.parentNode:o),ya(function(){xh(l,U,d,m)}),U}function Eh(o,l,d,m,w){var k=d._reactRootContainer;if(k){var I=k;if(typeof w=="function"){var F=w;w=function(){var U=wh(I);F.call(U)}}xh(l,I,o,w)}else I=DM(d,l,o,w,m);return wh(I)}Bx=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var d=hn(l.pendingLanes);d!==0&&(C0(l,d|1),pr(l,Bt()),(dt&6)===0&&(jl=Bt()+500,fo()))}break;case 13:ya(function(){var m=bi(o,1);if(m!==null){var w=nr();ws(m,o,1,w)}}),ev(o,1)}},P0=function(o){if(o.tag===13){var l=bi(o,134217728);if(l!==null){var d=nr();ws(l,o,134217728,d)}ev(o,134217728)}},Wx=function(o){if(o.tag===13){var l=yo(o),d=bi(o,l);if(d!==null){var m=nr();ws(d,o,l,m)}ev(o,l)}},Gx=function(){return gt},Kx=function(o,l){var d=gt;try{return gt=o,l()}finally{gt=d}},oa=function(o,l,d){switch(l){case"input":if(It(o,d),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<d.length;l++){var m=d[l];if(m!==o&&m.form===o.form){var w=Hf(m);if(!w)throw Error(n(90));Re(m),It(m,w)}}}break;case"textarea":xn(o,d);break;case"select":l=d.value,l!=null&&lt(o,!!d.multiple,l,!1)}},nn=Kg,bn=ya;var jM={usingClientEntryPoint:!1,Events:[wc,El,Hf,Ze,Pt,Kg]},Nc={findFiberByHostInstance:ca,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},FM={bundleType:Nc.bundleType,version:Nc.version,rendererPackageName:Nc.rendererPackageName,rendererConfig:Nc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=tc(o),o===null?null:o.stateNode},findFiberByHostInstance:Nc.findFiberByHostInstance||NM,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 kh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!kh.isDisabled&&kh.supportsFiber)try{ua=kh.inject(FM),z=kh}catch{}}return mr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jM,mr.createPortal=function(o,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nv(l))throw Error(n(200));return OM(o,l,null,d)},mr.createRoot=function(o,l){if(!nv(o))throw Error(n(299));var d=!1,m="",w=uS;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onRecoverableError!==void 0&&(w=l.onRecoverableError)),l=Jg(o,1,!1,null,null,d,!1,m,w),o[yi]=l.current,yc(o.nodeType===8?o.parentNode:o),new tv(l)},mr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(n(188)):(o=Object.keys(o).join(","),Error(n(268,o)));return o=tc(l),o=o===null?null:o.stateNode,o},mr.flushSync=function(o){return ya(o)},mr.hydrate=function(o,l,d){if(!Sh(l))throw Error(n(200));return Eh(null,o,l,!0,d)},mr.hydrateRoot=function(o,l,d){if(!nv(o))throw Error(n(405));var m=d!=null&&d.hydratedSources||null,w=!1,k="",I=uS;if(d!=null&&(d.unstable_strictMode===!0&&(w=!0),d.identifierPrefix!==void 0&&(k=d.identifierPrefix),d.onRecoverableError!==void 0&&(I=d.onRecoverableError)),l=aS(l,null,o,1,d??null,w,!1,k,I),o[yi]=l.current,yc(o),m)for(o=0;o<m.length;o++)d=m[o],w=d._getVersion,w=w(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,w]:l.mutableSourceEagerHydrationData.push(d,w);return new bh(l)},mr.render=function(o,l,d){if(!Sh(l))throw Error(n(200));return Eh(null,o,l,!1,d)},mr.unmountComponentAtNode=function(o){if(!Sh(o))throw Error(n(40));return o._reactRootContainer?(ya(function(){Eh(null,null,o,!1,function(){o._reactRootContainer=null,o[yi]=null})}),!0):!1},mr.unstable_batchedUpdates=Kg,mr.unstable_renderSubtreeIntoContainer=function(o,l,d,m){if(!Sh(d))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Eh(o,l,d,!1,m)},mr.version="18.3.1-next-f1338f8080-20240426",mr}var jE;function G6(){if(jE)return Mv.exports;jE=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(),Mv.exports=iD(),Mv.exports}var FE;function oD(){if(FE)return Fh;FE=1;var t=G6();return Fh.createRoot=t.createRoot,Fh.hydrateRoot=t.hydrateRoot,Fh}var aD=oD();const lD=$m(aD),Bi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function K6(t){return"init"in t}function Ry(t){return typeof t.write=="function"}function uD(t){return!!t.onMount}function VE(t){return"v"in t||"e"in t}function am(t){if("e"in t)throw t.e;if((Bi?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function lm(t){return typeof(t==null?void 0:t.then)=="function"}function cD(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 Z6(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function q6(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 a=new Set(s);for(const u of i)a.add(u);return a}function dD(t){return!!t.INTERNAL_onInit}const fD=(t,e,n,...r)=>n.read(...r),hD=(t,e,n,...r)=>n.write(...r),pD=(t,e,n)=>n.INTERNAL_onInit(e),mD=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},gD=(t,e,n)=>{var r;const s=t[0];let i=s.get(n);if(!i){const a=t[6],u=t[9];i={d:new Map,p:new Set,n:0},s.set(n,i),(r=a.i)==null||r.call(a,n),dD(n)&&u(t,e,n)}return i},vD=(t,e)=>{var n;const r=t[1],s=t[3],i=t[4],a=t[5],u=t[6],c=t[13];if(!u.f&&!s.size&&!i.size&&!a.size)return;const f=[],h=p=>{try{p()}catch(v){f.push(v)}};do{u.f&&h(u.f);const p=new Set;for(const v of s){const y=(n=r.get(v))==null?void 0:n.l;if(y)for(const x of y)p.add(x)}s.clear();for(const v of a)p.add(v);a.clear();for(const v of i)p.add(v);i.clear();for(const v of p)h(v);s.size&&c(t,e)}while(s.size||a.size||i.size);if(f.length)throw new AggregateError(f)},yD=(t,e)=>{const n=t[1],r=t[2],s=t[3],i=t[11],a=t[14],u=t[17];if(!s.size)return;const c=[],f=[],h=new WeakSet,p=new WeakSet,v=[],y=[];for(const x of s)v.push(x),y.push(i(t,e,x));for(;v.length;){const x=v.length-1,_=v[x],b=y[x];if(p.has(_)){v.pop(),y.pop();continue}if(h.has(_)){if(r.get(_)===b.n)c.push(_),f.push(b);else if((Bi?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),v.pop(),y.pop();continue}h.add(_);for(const E of q6(_,b,n))h.has(E)||(v.push(E),y.push(i(t,e,E)))}for(let x=c.length-1;x>=0;--x){const _=c[x],b=f[x];let E=!1;for(const C of b.d.keys())if(C!==_&&s.has(C)){E=!0;break}E&&(r.set(_,b.n),a(t,e,_),u(t,e,_)),r.delete(_)}},Iy=new WeakSet,_D=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],f=t[7],h=t[11],p=t[12],v=t[13],y=t[14],x=t[16],_=t[17],b=t[20],E=t[26],C=t[28],P=h(t,e,n),T=C[0];if(VE(P)){if(i.has(n)&&a.get(n)!==P.n||P.m===T)return P.m=T,P;let K=!1;for(const[B,X]of P.d)if(y(t,e,B).n!==X){K=!0;break}if(!K)return P.m=T,P}let A=!0;const O=new Set(P.d.keys()),M=()=>{for(const K of O)P.d.delete(K)},R=()=>{if(i.has(n)){const K=!u.size;_(t,e,n),K&&(v(t,e),p(t,e))}},L=K=>{var B;if(K===n){const $=h(t,e,K);if(!VE($))if(K6(K))b(t,e,K,K.init);else throw new Error("no atom init");return am($)}const X=y(t,e,K);try{return am(X)}finally{O.delete(K),P.d.set(K,X.n),lm(P.v)&&Z6(n,P.v,X),i.has(n)&&((B=i.get(K))==null||B.t.add(n)),A||R()}};let N,j;const V={get signal(){return N||(N=new AbortController),N.signal},get setSelf(){return(Bi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Bi?"production":void 0)!=="production"&&!Ry(n)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&Ry(n)&&(j=(...K)=>{if((Bi?"production":void 0)!=="production"&&A&&console.warn("setSelf function cannot be called in sync"),!A)try{return x(t,e,n,K)}finally{v(t,e),p(t,e)}}),j}},G=P.n,Y=a.get(n)===G;try{(Bi?"production":void 0)!=="production"&&Iy.delete(e);const K=f(t,e,n,L,V);if((Bi?"production":void 0)!=="production"&&Iy.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),b(t,e,n,K),lm(K)){E(t,e,K,()=>N==null?void 0:N.abort());const B=()=>{M(),R()};K.then(B,B)}else M();return(r=c.r)==null||r.call(c,n),P.m=T,P}catch(K){if(cD(K))throw K;return delete P.v,P.e=K,++P.n,P.m=T,P}finally{A=!1,P.n!==G&&Y&&(a.set(n,P.n),u.add(n),(s=c.c)==null||s.call(c,n))}},xD=(t,e,n)=>{const r=t[1],s=t[2],i=t[11],a=[n];for(;a.length;){const u=a.pop(),c=i(t,e,u);for(const f of q6(u,c,r)){const h=i(t,e,f);s.get(f)!==h.n&&(s.set(f,h.n),a.push(f))}}},wD=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],f=t[13],h=t[14],p=t[15],v=t[16],y=t[17],x=t[20],_=t[28];let b=!0;const E=P=>am(h(t,e,P)),C=(P,...T)=>{var A;const O=u(t,e,P);try{if(P===n){if(!K6(P))throw new Error("atom not writable");(Bi?"production":void 0)!=="production"&&Iy.add(e);const M=O.n,R=T[0];x(t,e,P,R),y(t,e,P),M!==O.n&&(++_[0],s.add(P),p(t,e,P),(A=i.c)==null||A.call(i,P));return}else return v(t,e,P,T)}finally{b||(f(t,e),c(t,e))}};try{return a(t,e,n,E,C,...r)}finally{b=!1}},bD=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],f=t[18],h=t[19],p=u(t,e,n),v=s.get(n);if(v&&p.d.size>0){for(const[y,x]of p.d)if(!v.d.has(y)){const _=u(t,e,y);f(t,e,y).t.add(n),v.d.add(y),x!==_.n&&(i.add(y),c(t,e,y),(r=a.c)==null||r.call(a,y))}for(const y of v.d)if(!p.d.has(y)){v.d.delete(y);const x=h(t,e,y);x==null||x.t.delete(n)}}},SD=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],f=t[12],h=t[13],p=t[14],v=t[16],y=t[18],x=c(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const b of x.d.keys())y(t,e,b).t.add(n);if(_={l:new Set,d:new Set(x.d.keys()),t:new Set},s.set(n,_),Ry(n)&&uD(n)){const b=()=>{let E=!0;const C=(...P)=>{try{return v(t,e,n,P)}finally{E||(h(t,e),f(t,e))}};try{const P=u(t,e,n,C);P&&(_.u=()=>{E=!0;try{P()}finally{E=!1}})}finally{E=!1}};i.add(b)}(r=a.m)==null||r.call(a,n)}return _},ED=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],f=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let v=!1;for(const y of p.t)if((r=i.get(y))!=null&&r.d.has(n)){v=!0;break}if(!v){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const y of h.d.keys()){const x=f(t,e,y);x==null||x.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},kD=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(lm(r))for(const f of a.d.keys())Z6(n,r,s(t,e,f));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,lm(c)&&i(t,e,c))},CD=(t,e,n)=>{const r=t[14];return am(r(t,e,n))},PD=(t,e,n,...r)=>{const s=t[3],i=t[12],a=t[13],u=t[16],c=s.size;try{return u(t,e,n,r)}finally{s.size!==c&&(a(t,e),i(t,e))}},TD=(t,e,n,r)=>{const s=t[12],i=t[18],a=t[19],c=i(t,e,n).l;return c.add(r),s(t,e),()=>{c.delete(r),a(t,e,n),s(t,e)}},AD=(t,e,n,r)=>{const s=t[25];let i=s.get(n);if(!i){i=new Set,s.set(n,i);const a=()=>s.delete(n);n.then(a,a)}i.add(r)},RD=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},Y6=new WeakMap;function ID(t){const e=Y6.get(t);if((Bi?"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 MD(...t){const e={get(a){return r(n,e,a)},set(a,...u){return s(n,e,a,...u)},sub(a,u){return i(n,e,a,u)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},fD,hD,pD,mD,gD,vD,yD,_D,xD,wD,bD,SD,ED,kD,CD,PD,TD,void 0,new WeakMap,AD,RD,[0]].map((a,u)=>t[u]||a);Y6.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const X6={};let LD=0;function et(t,e){const n=`atom${++LD}`,r={toString(){return(X6?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=OD,r.write=ND),e&&(r.write=e),r}function OD(t){return t(this)}function ND(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function DD(){return MD()}let Kc;function jD(){return Kc||(Kc=DD(),(X6?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Kc),globalThis.__JOTAI_DEFAULT_STORE__!==Kc&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Kc}const FD={},VD=g.createContext(void 0);function f2(t){return g.useContext(VD)||jD()}const My=t=>typeof(t==null?void 0:t.then)=="function",Ly=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},$D=ve.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Ly(t),t)}),Nv=new WeakMap,$E=(t,e,n)=>{const r=ID(t),s=r[26];let i=Nv.get(e);return i||(i=new Promise((a,u)=>{let c=e;const f=v=>y=>{c===v&&a(y)},h=v=>y=>{c===v&&u(y)},p=()=>{try{const v=n();My(v)?(Nv.set(v,i),c=v,v.then(f(v),h(v)),s(r,t,v,p)):a(v)}catch(v){u(v)}};e.then(f(e),h(e)),s(r,t,e,p)}),Nv.set(e,i)),i};function Xe(t,e){const{delay:n,unstable_promiseStatus:r=!ve.use}={},s=f2(),[[i,a,u],c]=g.useReducer(h=>{const p=s.get(t);return Object.is(h[0],p)&&h[1]===s&&h[2]===t?h:[p,s,t]},void 0,()=>[s.get(t),s,t]);let f=i;if((a!==s||u!==t)&&(c(),f=s.get(t)),g.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);My(p)&&Ly($E(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
42
-
43
- Migration guide:
44
-
45
- Create a custom hook like the following.
46
-
47
- function useAtomValueWithDelay<Value>(
48
- atom: Atom<Value>,
49
- options: { delay: number },
50
- ): Value {
51
- const { delay } = options
52
- const store = useStore(options)
53
- const [value, setValue] = useState(() => store.get(atom))
54
- useEffect(() => {
55
- const unsub = store.sub(atom, () => {
56
- setTimeout(() => setValue(store.get(atom)), delay)
57
- })
58
- return unsub
59
- }, [store, atom, delay])
60
- return value
61
- }
62
- `),setTimeout(c,n);return}c()});return c(),h},[s,t,n,r]),g.useDebugValue(f),My(f)){const h=$E(s,f,()=>s.get(t));return r&&Ly(h),$D(h)}return f}function st(t,e){const n=f2();return g.useCallback((...s)=>{if((FD?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function Q6(t,e){return[Xe(t),st(t)]}const h2=g.createContext({});function p2(t){const e=g.useRef(null);return e.current===null&&(e.current=t()),e.current}const HD=typeof window<"u",m2=HD?g.useLayoutEffect:g.useEffect,Bm=g.createContext(null);function g2(t,e){t.indexOf(e)===-1&&t.push(e)}function um(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const di=(t,e,n)=>n>e?e:n<t?t:n;let v2=()=>{};const Ko={},J6=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),eP=t=>typeof t=="object"&&t!==null,tP=t=>/^0[^.\s]+$/u.test(t);function nP(t){let e;return()=>(e===void 0&&(e=t()),e)}const fs=t=>t,cf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Nd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class y2{constructor(){this.subscriptions=[]}add(e){return g2(this.subscriptions,e),()=>um(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 a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ur=t=>t*1e3,ls=t=>t/1e3,rP=(t,e)=>e?t*(1e3/e):0,sP=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,zD=1e-7,UD=12;function BD(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=sP(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>zD&&++u<UD);return a}function df(t,e,n,r){if(t===e&&n===r)return fs;const s=i=>BD(i,0,1,t,n);return i=>i===0||i===1?i:sP(s(i),e,r)}const iP=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,oP=t=>e=>1-t(1-e),aP=df(.33,1.53,.69,.99),_2=oP(aP),lP=iP(_2),uP=t=>t>=1?1:(t*=2)<1?.5*_2(t):.5*(2-Math.pow(2,-10*(t-1))),x2=t=>1-Math.sin(Math.acos(t)),cP=oP(x2),dP=iP(x2),WD=df(.42,0,1,1),GD=df(0,0,.58,1),fP=df(.42,0,.58,1),KD=t=>Array.isArray(t)&&typeof t[0]!="number",hP=t=>Array.isArray(t)&&typeof t[0]=="number",ZD={linear:fs,easeIn:WD,easeInOut:fP,easeOut:GD,circIn:x2,circInOut:dP,circOut:cP,backIn:_2,backInOut:lP,backOut:aP,anticipate:uP},qD=t=>typeof t=="string",HE=t=>{if(hP(t)){v2(t.length===4);const[e,n,r,s]=t;return df(e,n,r,s)}else if(qD(t))return ZD[t];return t},Vh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function YD(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(f){i.has(f)&&(c.schedule(f),t()),f(a)}const c={schedule:(f,h=!1,p=!1)=>{const y=p&&r?e:n;return h&&i.add(f),y.add(f),f},cancel:f=>{n.delete(f),i.delete(f)},process:f=>{if(a=f,r){s=!0;return}r=!0;const h=e;e=n,n=h,e.forEach(u),e.clear(),r=!1,s&&(s=!1,c.process(f))}};return c}const XD=40;function pP(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Vh.reduce((P,T)=>(P[T]=YD(i),P),{}),{setup:u,read:c,resolveKeyframes:f,preUpdate:h,update:p,preRender:v,render:y,postRender:x}=a,_=()=>{const P=Ko.useManualTiming,T=P?s.timestamp:performance.now();n=!1,P||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,XD),1)),s.timestamp=T,s.isProcessing=!0,u.process(s),c.process(s),f.process(s),h.process(s),p.process(s),v.process(s),y.process(s),x.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},b=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:Vh.reduce((P,T)=>{const A=a[T];return P[T]=(O,M=!1,R=!1)=>(n||b(),A.schedule(O,M,R)),P},{}),cancel:P=>{for(let T=0;T<Vh.length;T++)a[Vh[T]].cancel(P)},state:s,steps:a}}const{schedule:Ct,cancel:Zo,state:Dn,steps:Dv}=pP(typeof requestAnimationFrame<"u"?requestAnimationFrame:fs,!0);let hp;function QD(){hp=void 0}const ir={now:()=>(hp===void 0&&ir.set(Dn.isProcessing||Ko.useManualTiming?Dn.timestamp:performance.now()),hp),set:t=>{hp=t,queueMicrotask(QD)}},mP=t=>e=>typeof e=="string"&&e.startsWith(t),gP=mP("--"),JD=mP("var(--"),w2=t=>JD(t)?e9.test(t.split("/*")[0].trim()):!1,e9=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zE(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const Gu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Dd={...Gu,transform:t=>di(0,1,t)},$h={...Gu,default:1},md=t=>Math.round(t*1e5)/1e5,b2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function t9(t){return t==null}const n9=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,S2=(t,e)=>n=>!!(typeof n=="string"&&n9.test(n)&&n.startsWith(t)||e&&!t9(n)&&Object.prototype.hasOwnProperty.call(n,e)),vP=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(b2);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},r9=t=>di(0,255,t),jv={...Gu,transform:t=>Math.round(r9(t))},Ua={test:S2("rgb","red"),parse:vP("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+jv.transform(t)+", "+jv.transform(e)+", "+jv.transform(n)+", "+md(Dd.transform(r))+")"};function s9(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 Oy={test:S2("#"),parse:s9,transform:Ua.transform},ff=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ni=ff("deg"),li=ff("%"),De=ff("px"),i9=ff("vh"),o9=ff("vw"),UE={...li,parse:t=>li.parse(t)/100,transform:t=>li.transform(t*100)},tu={test:S2("hsl","hue"),parse:vP("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+li.transform(md(e))+", "+li.transform(md(n))+", "+md(Dd.transform(r))+")"},cn={test:t=>Ua.test(t)||Oy.test(t)||tu.test(t),parse:t=>Ua.test(t)?Ua.parse(t):tu.test(t)?tu.parse(t):Oy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ua.transform(t):tu.transform(t),getAnimatableNone:t=>{const e=cn.parse(t);return e.alpha=0,cn.transform(e)}},a9=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function l9(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(b2))==null?void 0:e.length)||0)+(((n=t.match(a9))==null?void 0:n.length)||0)>0}const yP="number",_P="color",u9="var",c9="var(",BE="${}",d9=/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 Ou(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(d9,c=>(cn.test(c)?(r.color.push(i),s.push(_P),n.push(cn.parse(c))):c.startsWith(c9)?(r.var.push(i),s.push(u9),n.push(c)):(r.number.push(i),s.push(yP),n.push(parseFloat(c))),++i,BE)).split(BE);return{values:n,split:u,indexes:r,types:s}}function f9(t){return Ou(t).values}function xP({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 a=e[i];a===yP?s+=md(r[i]):a===_P?s+=cn.transform(r[i]):s+=r[i]}return s}}function h9(t){return xP(Ou(t))}const p9=t=>typeof t=="number"?0:cn.test(t)?cn.getAnimatableNone(t):t,m9=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:p9(t);function g9(t){const e=Ou(t);return xP(e)(e.values.map((r,s)=>m9(r,e.split[s])))}const As={test:l9,parse:f9,createTransformer:h9,getAnimatableNone:g9};function Fv(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 v9({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,a=0;if(!e)s=i=a=n;else{const u=n<.5?n*(1+e):n+e-n*e,c=2*n-u;s=Fv(c,u,t+1/3),i=Fv(c,u,t),a=Fv(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function cm(t,e){return n=>n>0?e:t}const kt=(t,e,n)=>t+(e-t)*n,Vv=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},y9=[Oy,Ua,tu],_9=t=>y9.find(e=>e.test(t));function WE(t){const e=_9(t);if(!e)return!1;let n=e.parse(t);return e===tu&&(n=v9(n)),n}const GE=(t,e)=>{const n=WE(t),r=WE(e);if(!n||!r)return cm(t,e);const s={...n};return i=>(s.red=Vv(n.red,r.red,i),s.green=Vv(n.green,r.green,i),s.blue=Vv(n.blue,r.blue,i),s.alpha=kt(n.alpha,r.alpha,i),Ua.transform(s))},Ny=new Set(["none","hidden"]);function x9(t,e){return Ny.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function w9(t,e){return n=>kt(t,e,n)}function E2(t){return typeof t=="number"?w9:typeof t=="string"?w2(t)?cm:cn.test(t)?GE:E9:Array.isArray(t)?wP:typeof t=="object"?cn.test(t)?GE:b9:cm}function wP(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>E2(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function b9(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=E2(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function S9(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],a=t.indexes[i][r[i]],u=t.values[a]??0;n[s]=u,r[i]++}return n}const E9=(t,e)=>{const n=As.createTransformer(e),r=Ou(t),s=Ou(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?Ny.has(t)&&!s.values.length||Ny.has(e)&&!r.values.length?x9(t,e):cf(wP(S9(r,s),s.values),n):cm(t,e)};function bP(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?kt(t,e,n):E2(t)(t,e)}const k9=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Ct.update(e,n),stop:()=>Zo(e),now:()=>Dn.isProcessing?Dn.timestamp:ir.now()}},SP=(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)})`},dm=2e4;function k2(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<dm;)e+=n,r=t.next(e);return e>=dm?1/0:e}function C9(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(k2(r),dm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:ls(s)}}const Jt={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 Dy(t,e){return t*Math.sqrt(1-e*e)}const P9=12;function T9(t,e,n){let r=n;for(let s=1;s<P9;s++)r=r-t(r)/e(r);return r}const $v=.001;function A9({duration:t=Jt.duration,bounce:e=Jt.bounce,velocity:n=Jt.velocity,mass:r=Jt.mass}){let s,i,a=1-e;a=di(Jt.minDamping,Jt.maxDamping,a),t=di(Jt.minDuration,Jt.maxDuration,ls(t)),a<1?(s=f=>{const h=f*a,p=h*t,v=h-n,y=Dy(f,a),x=Math.exp(-p);return $v-v/y*x},i=f=>{const p=f*a*t,v=p*n+n,y=Math.pow(a,2)*Math.pow(f,2)*t,x=Math.exp(-p),_=Dy(Math.pow(f,2),a);return(-s(f)+$v>0?-1:1)*((v-y)*x)/_}):(s=f=>{const h=Math.exp(-f*t),p=(f-n)*t+1;return-$v+h*p},i=f=>{const h=Math.exp(-f*t),p=(n-f)*(t*t);return h*p});const u=5/t,c=T9(s,i,u);if(t=Ur(t),isNaN(c))return{stiffness:Jt.stiffness,damping:Jt.damping,duration:t};{const f=Math.pow(c,2)*r;return{stiffness:f,damping:a*2*Math.sqrt(r*f),duration:t}}}const R9=["duration","bounce"],I9=["stiffness","damping","mass"];function KE(t,e){return e.some(n=>t[n]!==void 0)}function M9(t){let e={velocity:Jt.velocity,stiffness:Jt.stiffness,damping:Jt.damping,mass:Jt.mass,isResolvedFromDuration:!1,...t};if(!KE(t,I9)&&KE(t,R9))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*di(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Jt.mass,stiffness:s,damping:i}}else{const n=A9({...t,velocity:0});e={...e,...n,mass:Jt.mass},e.isResolvedFromDuration=!0}return e}function fm(t=Jt.visualDuration,e=Jt.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],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:i},{stiffness:c,damping:f,mass:h,duration:p,velocity:v,isResolvedFromDuration:y}=M9({...n,velocity:-ls(n.velocity||0)}),x=v||0,_=f/(2*Math.sqrt(c*h)),b=a-i,E=ls(Math.sqrt(c/h)),C=Math.abs(b)<5;r||(r=C?Jt.restSpeed.granular:Jt.restSpeed.default),s||(s=C?Jt.restDelta.granular:Jt.restDelta.default);let P,T,A,O,M,R;if(_<1)A=Dy(E,_),O=(x+_*E*b)/A,P=N=>{const j=Math.exp(-_*E*N);return a-j*(O*Math.sin(A*N)+b*Math.cos(A*N))},M=_*E*O+b*A,R=_*E*b-O*A,T=N=>Math.exp(-_*E*N)*(M*Math.sin(A*N)+R*Math.cos(A*N));else if(_===1){P=j=>a-Math.exp(-E*j)*(b+(x+E*b)*j);const N=x+E*b;T=j=>Math.exp(-E*j)*(E*N*j-x)}else{const N=E*Math.sqrt(_*_-1);P=Y=>{const K=Math.exp(-_*E*Y),B=Math.min(N*Y,300);return a-K*((x+_*E*b)*Math.sinh(B)+N*b*Math.cosh(B))/N};const j=(x+_*E*b)/N,V=_*E*j-b*N,G=_*E*b-j*N;T=Y=>{const K=Math.exp(-_*E*Y),B=Math.min(N*Y,300);return K*(V*Math.sinh(B)+G*Math.cosh(B))}}const L={calculatedDuration:y&&p||null,velocity:N=>Ur(T(N)),next:N=>{if(!y&&_<1){const V=Math.exp(-_*E*N),G=Math.sin(A*N),Y=Math.cos(A*N),K=a-V*(O*G+b*Y),B=Ur(V*(M*G+R*Y));return u.done=Math.abs(B)<=r&&Math.abs(a-K)<=s,u.value=u.done?a:K,u}const j=P(N);if(y)u.done=N>=p;else{const V=Ur(T(N));u.done=Math.abs(V)<=r&&Math.abs(a-j)<=s}return u.value=u.done?a:j,u},toString:()=>{const N=Math.min(k2(L),dm),j=SP(V=>L.next(N*V).value,N,30);return N+"ms "+j},toTransition:()=>{}};return L}fm.applyToOptions=t=>{const e=C9(t,100,fm);return t.ease=e.ease,t.duration=Ur(e.duration),t.type="keyframes",t};const L9=5;function EP(t,e,n){const r=Math.max(e-L9,0);return rP(n-t(r),e-r)}function jy({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:f=.5,restSpeed:h}){const p=t[0],v={done:!1,value:p},y=R=>u!==void 0&&R<u||c!==void 0&&R>c,x=R=>u===void 0?c:c===void 0||Math.abs(u-R)<Math.abs(c-R)?u:c;let _=n*e;const b=p+_,E=a===void 0?b:a(b);E!==b&&(_=E-p);const C=R=>-_*Math.exp(-R/r),P=R=>E+C(R),T=R=>{const L=C(R),N=P(R);v.done=Math.abs(L)<=f,v.value=v.done?E:N};let A,O;const M=R=>{y(v.value)&&(A=R,O=fm({keyframes:[v.value,x(v.value)],velocity:EP(P,R,v.value),damping:s,stiffness:i,restDelta:f,restSpeed:h}))};return M(0),{calculatedDuration:null,next:R=>{let L=!1;return!O&&A===void 0&&(L=!0,T(R),M(R)),A!==void 0&&R>=A?O.next(R-A):(!L&&T(R),v)}}}function O9(t,e,n){const r=[],s=n||Ko.mix||bP,i=t.length-1;for(let a=0;a<i;a++){let u=s(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||fs:e;u=cf(c,u)}r.push(u)}return r}function N9(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(v2(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const u=O9(e,r,s),c=u.length,f=h=>{if(a&&h<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(h<t[p+1]);p++);const v=Nd(t[p],t[p+1],h);return u[p](v)};return n?h=>f(di(t[0],t[i-1],h)):f}function D9(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Nd(0,e,r);t.push(kt(n,1,s))}}function j9(t){const e=[0];return D9(e,t.length-1),e}function F9(t,e){return t.map(n=>n*e)}function V9(t,e){return t.map(()=>e||fP).splice(0,t.length-1)}function gd({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=KD(r)?r.map(HE):HE(r),i={done:!1,value:e[0]},a=F9(n&&n.length===e.length?n:j9(e),t),u=N9(a,e,{ease:Array.isArray(s)?s:V9(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const $9=t=>t!==null;function Wm(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter($9),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const H9={decay:jy,inertia:jy,tween:gd,keyframes:gd,spring:fm};function kP(t){typeof t.type=="string"&&(t.type=H9[t.type])}class C2{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 z9=t=>t/100;class hm extends C2{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!==ir.now()&&this.tick(ir.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;kP(e);const{type:n=gd,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||gd;c!==gd&&typeof u[0]!="number"&&(this.mixKeyframes=cf(z9,bP(u[0],u[1])),u=[0,100]);const f=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),f.calculatedDuration===null&&(f.calculatedDuration=k2(f));const{calculatedDuration:h}=f;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=f}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:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:f=0,keyframes:h,repeat:p,repeatType:v,repeatDelay:y,type:x,onUpdate:_,finalKeyframe:b}=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 E=this.currentTime-f*(this.playbackSpeed>=0?1:-1),C=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let P=this.currentTime,T=r;if(p){const R=Math.min(this.currentTime,s)/u;let L=Math.floor(R),N=R%1;!N&&R>=1&&(N=1),N===1&&L--,L=Math.min(L,p+1),!!(L%2)&&(v==="reverse"?(N=1-N,y&&(N-=y/u)):v==="mirror"&&(T=a)),P=di(0,1,N)*u}let A;C?(this.delayState.value=h[0],A=this.delayState):A=T.next(P),i&&!C&&(A.value=i(A.value));let{done:O}=A;!C&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return M&&x!==jy&&(A.value=Wm(h,this.options,b,this.speed)),_&&_(A.value),M&&this.finish(),A}then(e,n){return this.finished.then(e,n)}get duration(){return ls(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ls(e)}get time(){return ls(this.currentTime)}set time(e){e=Ur(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 EP(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(ir.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=ls(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=k9,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),(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(ir.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 U9(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ba=t=>t*180/Math.PI,Fy=t=>{const e=Ba(Math.atan2(t[1],t[0]));return Vy(e)},B9={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Fy,rotateZ:Fy,skewX:t=>Ba(Math.atan(t[1])),skewY:t=>Ba(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Vy=t=>(t=t%360,t<0&&(t+=360),t),ZE=Fy,qE=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),YE=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),W9={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qE,scaleY:YE,scale:t=>(qE(t)+YE(t))/2,rotateX:t=>Vy(Ba(Math.atan2(t[6],t[5]))),rotateY:t=>Vy(Ba(Math.atan2(-t[2],t[0]))),rotateZ:ZE,rotate:ZE,skewX:t=>Ba(Math.atan(t[4])),skewY:t=>Ba(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function $y(t){return t.includes("scale")?1:0}function Hy(t,e){if(!t||t==="none")return $y(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=W9,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=B9,s=u}if(!s)return $y(e);const i=r[e],a=s[1].split(",").map(K9);return typeof i=="function"?i(a):a[i]}const G9=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Hy(n,e)};function K9(t){return parseFloat(t.trim())}const Ku=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zu=new Set([...Ku,"pathRotation"]),XE=t=>t===Gu||t===De,Z9=new Set(["x","y","z"]),q9=Ku.filter(t=>!Z9.has(t));function Y9(t){const e=[];return q9.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const jo={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})=>Hy(e,"x"),y:(t,{transform:e})=>Hy(e,"y")};jo.translateX=jo.x;jo.translateY=jo.y;const nl=new Set;let zy=!1,Uy=!1,By=!1;function CP(){if(Uy){const t=Array.from(nl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Y9(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,a])=>{var u;(u=r.getValue(i))==null||u.set(a)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Uy=!1,zy=!1,nl.forEach(t=>t.complete(By)),nl.clear()}function PP(){nl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Uy=!0)})}function X9(){By=!0,PP(),CP(),By=!1}class P2{constructor(e,n,r,s,i,a=!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=a}scheduleResolve(){this.state="scheduled",this.isAsync?(nl.add(this),zy||(zy=!0,Ct.read(PP),Ct.resolveKeyframes(CP))):(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(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const u=r.readValue(n,a);u!=null&&(e[0]=u)}e[0]===void 0&&(e[0]=a),s&&i===void 0&&s.set(e[0])}U9(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),nl.delete(this)}cancel(){this.state==="scheduled"&&(nl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Q9=t=>t.startsWith("--");function TP(t,e,n){Q9(e)?t.style.setProperty(e,n):t.style[e]=n}const J9={};function AP(t,e){const n=nP(t);return()=>J9[e]??n()}const e7=AP(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),RP=AP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),od=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,QE={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:od([0,.65,.55,1]),circOut:od([.55,0,1,.45]),backIn:od([.31,.01,.66,-.59]),backOut:od([.33,1.53,.69,.99])};function IP(t,e){if(t)return typeof t=="function"?RP()?SP(t,e):"ease-out":hP(t)?od(t):Array.isArray(t)?t.map(n=>IP(n,e)||QE.easeOut):QE[t]}function t7(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},f=void 0){const h={[e]:n};c&&(h.offset=c);const p=IP(u,s);Array.isArray(p)&&(h.easing=p);const v={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return f&&(v.pseudoElement=f),t.animate(h,v)}function MP(t){return typeof t=="function"&&"applyToOptions"in t}function n7({type:t,...e}){return MP(t)&&RP()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class LP extends C2{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:a=!1,finalKeyframe:u,onComplete:c}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,v2(typeof e.type!="string");const f=n7(e);this.animation=t7(n,r,s,f,i),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=Wm(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),TP(n,r,h),this.animation.cancel()}c==null||c(),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 ls(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ls(e)}get time(){return ls(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ur(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&&e7()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),fs):s(this)}}const OP={anticipate:uP,backInOut:lP,circInOut:dP};function r7(t){return t in OP}function s7(t){typeof t.ease=="string"&&r7(t.ease)&&(t.ease=OP[t.ease])}const Hv=10;class i7 extends LP{constructor(e){s7(e),kP(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,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const u=new hm({...a,autoplay:!1}),c=Math.max(Hv,ir.now()-this.startTime),f=di(0,Hv,c-Hv),h=u.sample(c).value,{name:p}=this.options;i&&p&&TP(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-f)).value,h,f),u.stop()}}const JE=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(As.test(t)||t==="0")&&!t.startsWith("url("));function o7(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 a7(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],a=JE(s,e),u=JE(i,e);return!a||!u?!1:o7(t)||(n==="spring"||MP(n))&&r}function Wy(t){t.duration=0,t.type="keyframes"}const NP=new Set(["opacity","clipPath","filter","transform"]),l7=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function u7(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&l7.test(t[e]))return!0;return!1}const c7=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),d7=nP(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function f7(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t;if(!(((p=e==null?void 0:e.owner)==null?void 0:p.current)instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:h}=e.owner.getProps();return d7()&&n&&(NP.has(n)||c7.has(n)&&u7(u))&&(n!=="transform"||!h)&&!f&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const h7=40;class p7 extends C2{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:f,element:h,...p}){var x;super(),this.stop=()=>{var _,b;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=ir.now();const v={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:f,element:h,...p},y=(h==null?void 0:h.KeyframeResolver)||P2;this.keyframeResolver=new y(u,(_,b,E)=>this.onKeyframesResolved(_,b,v,!E),c,f,h),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(e,n,r,s){var E,C;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:f,onUpdate:h}=r;this.resolvedAt=ir.now();let p=!0;a7(e,i,a,u)||(p=!1,(Ko.instantAnimations||!c)&&(h==null||h(Wm(e,r,n))),e[0]=e[e.length-1],Wy(r),r.repeat=0);const y={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},x=p&&!f&&f7(y),_=(C=(E=y.motionValue)==null?void 0:E.owner)==null?void 0:C.current;let b;if(x)try{b=new i7({...y,element:_})}catch{b=new hm(y)}else b=new hm(y);b.finished.then(()=>{this.notifyFinished()}).catch(fs),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}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(),X9()),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 DP(t,e,n,r=0,s=1){const i=Array.from(t).sort((f,h)=>f.sortNodePosition(h)).indexOf(e),a=t.size,u=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:u-i*r}const e4=30,m7=t=>!isNaN(parseFloat(t));class g7{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=ir.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 a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=ir.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=m7(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 y2);const r=this.events[e].add(n);return e==="change"?()=>{r(),Ct.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=ir.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>e4)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,e4);return rP(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 Nu(t,e){return new g7(t,e)}function jP(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function T2(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?jP(n,t):n}const v7={type:"spring",stiffness:500,damping:25,restSpeed:10},y7=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),_7={type:"keyframes",duration:.8},x7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},w7=(t,{keyframes:e})=>e.length>2?_7:Zu.has(t)?t.startsWith("scale")?y7(e[1]):v7:x7,b7=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function S7(t){for(const e in t)if(!b7.has(e))return!0;return!1}const A2=(t,e,n,r={},s,i)=>a=>{const u=T2(r,t)||{},c=u.delay||r.delay||0;let{elapsed:f=0}=r;f=f-Ur(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-f,onUpdate:v=>{e.set(v),u.onUpdate&&u.onUpdate(v)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};S7(u)||Object.assign(h,w7(t,h)),h.duration&&(h.duration=Ur(h.duration)),h.repeatDelay&&(h.repeatDelay=Ur(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(Wy(h),h.delay===0&&(p=!0)),(Ko.instantAnimations||Ko.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,Wy(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const v=Wm(h.keyframes,u);if(v!==void 0){Ct.update(()=>{h.onUpdate(v),h.onComplete()});return}}return u.isSync?new hm(h):new p7(h)},E7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function k7(t){const e=E7.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function FP(t,e,n=1){const[r,s]=k7(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return J6(a)?parseFloat(a):a}return w2(s)?FP(s,e,n+1):s}function t4(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function R2(t,e,n,r){if(typeof e=="function"){const[s,i]=t4(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]=t4(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function rl(t,e,n){const r=t.getProps();return R2(r,e,n!==void 0?n:r.custom,t)}const VP=new Set(["width","height","top","left","right","bottom",...Ku]),Gy=t=>Array.isArray(t);function C7(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Nu(n))}function P7(t){return Gy(t)?t[t.length-1]||0:t}function T7(t,e){const n=rl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=P7(i[a]);C7(t,a,u)}}const Vn=t=>!!(t&&t.getVelocity);function A7(t){return!!(Vn(t)&&t.add)}function Ky(t,e){const n=t.getValue("willChange");if(A7(n))return n.add(e);if(!n&&Ko.WillChange){const r=new Ko.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function I2(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const R7="framerAppearId",$P="data-"+I2(R7);function HP(t){return t.props[$P]}function I7({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function zP(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?jP(i,c):c;const f=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],v=s&&t.animationState&&t.animationState.getState()[s],y=i==null?void 0:i.path;y&&y.animateVisualElement(t,u,i,n,p);for(const x in u){const _=t.getValue(x,t.latestValues[x]??null),b=u[x];if(b===void 0||v&&I7(v,x))continue;const E={delay:n,...T2(i||{},x)};h&&(E.skipAnimations=!0);const C=_.get();if(C!==void 0&&!_.isAnimating()&&!Array.isArray(b)&&b===C&&!E.velocity){Ct.update(()=>_.set(b));continue}let P=!1;if(window.MotionHandoffAnimation){const O=HP(t);if(O){const M=window.MotionHandoffAnimation(O,x,Ct);M!==null&&(E.startTime=M,P=!0)}}Ky(t,x);const T=f??t.shouldReduceMotion;_.start(A2(x,_,b,T&&VP.has(x)?{type:!1}:E,t,P));const A=_.animation;A&&p.push(A)}if(a){const x=()=>Ct.update(()=>{a&&T7(t,a)});p.length?Promise.all(p).then(x):x()}return p}function Zy(t,e,n={}){var c;const r=rl(t,e,n.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(zP(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(f=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:v}=s;return M7(t,e,f,h,p,v,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[f,h]=u==="beforeChildren"?[i,a]:[a,i];return f().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function M7(t,e,n=0,r=0,s=0,i=1,a){const u=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),u.push(Zy(c,e,{...a,delay:n+(typeof r=="function"?0:r)+DP(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function L7(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Zy(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Zy(t,e,n);else{const s=typeof e=="function"?rl(t,e,n.custom):e;r=Promise.all(zP(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const O7={test:t=>t==="auto",parse:t=>t},UP=t=>e=>e.test(t),BP=[Gu,De,li,Ni,o9,i9,O7],n4=t=>BP.find(UP(t));function N7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||tP(t):!0}const D7=new Set(["brightness","contrast","saturate","opacity"]);function j7(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(b2)||[];if(!r)return t;const s=n.replace(r,"");let i=D7.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const F7=/\b([a-z-]*)\(.*?\)/gu,qy={...As,getAnimatableNone:t=>{const e=t.match(F7);return e?e.map(j7).join(" "):t}},Yy={...As,getAnimatableNone:t=>{const e=As.parse(t);return As.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},r4={...Gu,transform:Math.round},V7={rotate:Ni,pathRotation:Ni,rotateX:Ni,rotateY:Ni,rotateZ:Ni,scale:$h,scaleX:$h,scaleY:$h,scaleZ:$h,skew:Ni,skewX:Ni,skewY:Ni,distance:De,translateX:De,translateY:De,translateZ:De,x:De,y:De,z:De,perspective:De,transformPerspective:De,opacity:Dd,originX:UE,originY:UE,originZ:De},pm={borderWidth:De,borderTopWidth:De,borderRightWidth:De,borderBottomWidth:De,borderLeftWidth:De,borderRadius:De,borderTopLeftRadius:De,borderTopRightRadius:De,borderBottomRightRadius:De,borderBottomLeftRadius:De,width:De,maxWidth:De,height:De,maxHeight:De,top:De,right:De,bottom:De,left:De,inset:De,insetBlock:De,insetBlockStart:De,insetBlockEnd:De,insetInline:De,insetInlineStart:De,insetInlineEnd:De,padding:De,paddingTop:De,paddingRight:De,paddingBottom:De,paddingLeft:De,paddingBlock:De,paddingBlockStart:De,paddingBlockEnd:De,paddingInline:De,paddingInlineStart:De,paddingInlineEnd:De,margin:De,marginTop:De,marginRight:De,marginBottom:De,marginLeft:De,marginBlock:De,marginBlockStart:De,marginBlockEnd:De,marginInline:De,marginInlineStart:De,marginInlineEnd:De,fontSize:De,backgroundPositionX:De,backgroundPositionY:De,...V7,zIndex:r4,fillOpacity:Dd,strokeOpacity:Dd,numOctaves:r4},$7={...pm,color:cn,backgroundColor:cn,outlineColor:cn,fill:cn,stroke:cn,borderColor:cn,borderTopColor:cn,borderRightColor:cn,borderBottomColor:cn,borderLeftColor:cn,filter:qy,WebkitFilter:qy,mask:Yy,WebkitMask:Yy},WP=t=>$7[t],H7=new Set([qy,Yy]);function GP(t,e){let n=WP(t);return H7.has(n)||(n=As),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const z7=new Set(["auto","none","0"]);function U7(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!z7.has(i)&&Ou(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=GP(n,s)}class B7 extends P2{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 h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),w2(p))){const v=FP(p,n.current);v!==void 0&&(e[h]=v),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!VP.has(r)||e.length!==2)return;const[s,i]=e,a=n4(s),u=n4(i),c=zE(s),f=zE(i);if(c!==f&&jo[r]){this.needsMeasurement=!0;return}if(a!==u)if(XE(a)&&XE(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else jo[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||N7(e[s]))&&r.push(s);r.length&&U7(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=jo[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 u;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,a=r[i];r[i]=jo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(u=this.removedTransforms)!=null&&u.length&&this.removedTransforms.forEach(([c,f])=>{e.getValue(c).set(f)}),this.resolveNoneKeyframes()}}const M2=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function KP(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 Xy=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function pp(t){return eP(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:L2}=pP(queueMicrotask,!1),ks={x:!1,y:!1};function ZP(){return ks.x||ks.y}function W7(t){return t==="x"||t==="y"?ks[t]?null:(ks[t]=!0,()=>{ks[t]=!1}):ks.x||ks.y?null:(ks.x=ks.y=!0,()=>{ks.x=ks.y=!1})}function qP(t,e){const n=KP(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function G7(t){return!(t.pointerType==="touch"||ZP())}function K7(t,e,n={}){const[r,s,i]=qP(t,n);return r.forEach(a=>{let u=!1,c=!1,f;const h=()=>{a.removeEventListener("pointerleave",x)},p=b=>{f&&(f(b),f=void 0),h()},v=b=>{u=!1,window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",v),c&&(c=!1,p(b))},y=()=>{u=!0,window.addEventListener("pointerup",v,s),window.addEventListener("pointercancel",v,s)},x=b=>{if(b.pointerType!=="touch"){if(u){c=!0;return}p(b)}},_=b=>{if(!G7(b))return;c=!1;const E=e(a,b);typeof E=="function"&&(f=E,a.addEventListener("pointerleave",x,s))};a.addEventListener("pointerenter",_,s),a.addEventListener("pointerdown",y,s)}),i}const YP=(t,e)=>e?t===e?!0:YP(t,e.parentElement):!1,O2=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Z7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function q7(t){return Z7.has(t.tagName)||t.isContentEditable===!0}const Y7=new Set(["INPUT","SELECT","TEXTAREA"]);function X7(t){return Y7.has(t.tagName)||t.isContentEditable===!0}const mp=new WeakSet;function s4(t){return e=>{e.key==="Enter"&&t(e)}}function zv(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Q7=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=s4(()=>{if(mp.has(n))return;zv(n,"down");const s=s4(()=>{zv(n,"up")}),i=()=>zv(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 i4(t){return O2(t)&&!ZP()}const o4=new WeakSet;function J7(t,e,n={}){const[r,s,i]=qP(t,n),a=u=>{const c=u.currentTarget;if(!i4(u)||o4.has(u))return;mp.add(c),n.stopPropagation&&o4.add(u);const f=e(c,u),h={...s,capture:!0},p=(x,_)=>{window.removeEventListener("pointerup",v,h),window.removeEventListener("pointercancel",y,h),mp.has(c)&&mp.delete(c),i4(x)&&typeof f=="function"&&f(x,{success:_})},v=x=>{p(x,c===window||c===document||n.useGlobalTarget||YP(c,x.target))},y=x=>{p(x,!1)};window.addEventListener("pointerup",v,h),window.addEventListener("pointercancel",y,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),pp(u)&&(u.addEventListener("focus",f=>Q7(f,s)),!q7(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function N2(t){return eP(t)&&"ownerSVGElement"in t}const gp=new WeakMap;let Co;const XP=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:N2(r)&&"getBBox"in r?r.getBBox()[e]:r[n],ej=XP("inline","width","offsetWidth"),tj=XP("block","height","offsetHeight");function nj({target:t,borderBoxSize:e}){var n;(n=gp.get(t))==null||n.forEach(r=>{r(t,{get width(){return ej(t,e)},get height(){return tj(t,e)}})})}function rj(t){t.forEach(nj)}function sj(){typeof ResizeObserver>"u"||(Co=new ResizeObserver(rj))}function ij(t,e){Co||sj();const n=KP(t);return n.forEach(r=>{let s=gp.get(r);s||(s=new Set,gp.set(r,s)),s.add(e),Co==null||Co.observe(r)}),()=>{n.forEach(r=>{const s=gp.get(r);s==null||s.delete(e),s!=null&&s.size||Co==null||Co.unobserve(r)})}}const vp=new Set;let nu;function oj(){nu=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};vp.forEach(e=>e(t))},window.addEventListener("resize",nu)}function aj(t){return vp.add(t),nu||oj(),()=>{vp.delete(t),!vp.size&&typeof nu=="function"&&(window.removeEventListener("resize",nu),nu=void 0)}}function a4(t,e){return typeof t=="function"?aj(t):ij(t,e)}function lj(t){return N2(t)&&t.tagName==="svg"}const uj=[...BP,cn,As],cj=t=>uj.find(UP(t)),l4=()=>({translate:0,scale:1,origin:0,originPoint:0}),ru=()=>({x:l4(),y:l4()}),u4=()=>({min:0,max:0}),yn=()=>({x:u4(),y:u4()}),dj=new WeakMap;function Gm(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function jd(t){return typeof t=="string"||Array.isArray(t)}const D2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],j2=["initial",...D2];function Km(t){return Gm(t.animate)||j2.some(e=>jd(t[e]))}function QP(t){return!!(Km(t)||t.variants)}function fj(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Vn(s))t.addValue(r,s);else if(Vn(i))t.addValue(r,Nu(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const a=t.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=t.getStaticValue(r);t.addValue(r,Nu(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const mm={current:null},F2={current:!1},hj=typeof window<"u";function JP(){if(F2.current=!0,!!hj)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>mm.current=t.matches;t.addEventListener("change",e),e()}else mm.current=!1}const c4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let gm={};function e3(t){gm=t}function pj(){return gm}class mj{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:u},c={}){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=P2,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 y=ir.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Ct.render(this.render,!1,!0))};const{latestValues:f,renderState:h}=u;this.latestValues=f,this.baseTarget={...f},this.initialValues=n.initial?{...f}:{},this.renderState=h,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=c,this.blockInitialAnimation=!!a,this.isControllingVariants=Km(n),this.isVariantNode=QP(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in v){const x=v[y];f[y]!==void 0&&Vn(x)&&x.set(f[y])}}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,dj.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:(F2.current||JP(),this.shouldReduceMotion=mm.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(),Zo(this.notifyUpdate),Zo(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&&NP.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:f,duration:h}=n.accelerate,p=new LP({element:this.current,name:e,keyframes:u,times:c,ease:f,duration:Ur(h)}),v=a(p);this.valueSubscriptions.set(e,()=>{v(),p.cancel()});return}const r=Zu.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Ct.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 gm){const n=gm[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<c4.length;r++){const s=c4[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,a=e[i];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=fj(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=Nu(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"&&(J6(r)||tP(r))?r=parseFloat(r):!cj(r)&&As.test(n)&&(r=GP(e,n)),this.setBaseTarget(e,Vn(r)?r.get():r)),Vn(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 a=R2(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Vn(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 y2),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){L2.render(this.render)}}class t3 extends mj{constructor(){super(...arguments),this.KeyframeResolver=B7}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;Vn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ta{constructor(e){this.isMounted=!1,this.node=e}update(){}}function n3({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function gj({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function vj(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 Uv(t){return t===void 0||t===1}function Qy({scale:t,scaleX:e,scaleY:n}){return!Uv(t)||!Uv(e)||!Uv(n)}function ja(t){return Qy(t)||r3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function r3(t){return d4(t.x)||d4(t.y)}function d4(t){return t&&t!=="0%"}function vm(t,e,n){const r=t-n,s=e*r;return n+s}function f4(t,e,n,r,s){return s!==void 0&&(t=vm(t,s,r)),vm(t,n,r)+e}function Jy(t,e=0,n=1,r,s){t.min=f4(t.min,e,n,r,s),t.max=f4(t.max,e,n,r,s)}function s3(t,{x:e,y:n}){Jy(t.x,e.translate,e.scale,e.originPoint),Jy(t.y,n.translate,n.scale,n.originPoint)}const h4=.999999999999,p4=1.0000000000001;function yj(t,e,n,r=!1){var u;const s=n.length;if(!s)return;e.x=e.y=1;let i,a;for(let c=0;c<s;c++){i=n[c],a=i.projectionDelta;const{visualElement:f}=i.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(ei(t.x,-i.scroll.offset.x),ei(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,s3(t,a)),r&&ja(i.latestValues)&&yp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<p4&&e.x>h4&&(e.x=1),e.y<p4&&e.y>h4&&(e.y=1)}function ei(t,e){t.min+=e,t.max+=e}function m4(t,e,n,r,s=.5){const i=kt(t.min,t.max,s);Jy(t,e,n,i,r)}function g4(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function yp(t,e,n){const r=n??t;m4(t.x,g4(e.x,r.x),e.scaleX,e.scale,e.originX),m4(t.y,g4(e.y,r.y),e.scaleY,e.scale,e.originY)}function i3(t,e){return n3(vj(t.getBoundingClientRect(),e))}function _j(t,e,n){const r=i3(t,n),{scroll:s}=e;return s&&(ei(r.x,s.offset.x),ei(r.y,s.offset.y)),r}const xj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wj=Ku.length;function bj(t,e,n){let r="",s=!0;for(let a=0;a<wj;a++){const u=Ku[a],c=t[u];if(c===void 0)continue;let f=!0;if(typeof c=="number")f=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);f=u.startsWith("scale")?h===1:h===0}if(!f||n){const h=Xy(c,pm[u]);if(!f){s=!1;const p=xj[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${Xy(i,pm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function V2(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const f=e[c];if(Zu.has(c)){a=!0;continue}else if(gP(c)){s[c]=f;continue}else{const h=Xy(f,pm[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=bj(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:f="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${f} ${h}`}}function o3(t,{style:e,vars:n},r,s){const i=t.style;let a;for(a in e)i[a]=e[a];s==null||s.applyProjectionStyles(i,r);for(a in n)i.setProperty(a,n[a])}function v4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Zc={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(De.test(t))t=parseFloat(t);else return t;const n=v4(t,e.target.x),r=v4(t,e.target.y);return`${n}% ${r}%`}},Sj={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=As.parse(t);if(s.length>5)return r;const i=As.createTransformer(t),a=typeof s[0]!="number"?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;s[0+a]/=u,s[1+a]/=c;const f=kt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=f),typeof s[3+a]=="number"&&(s[3+a]/=f),i(s)}},e_={borderRadius:{...Zc,applyTo:[...M2]},borderTopLeftRadius:Zc,borderTopRightRadius:Zc,borderBottomLeftRadius:Zc,borderBottomRightRadius:Zc,boxShadow:Sj};function a3(t,{layout:e,layoutId:n}){return Zu.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!e_[t]||t==="opacity")}function $2(t,e,n){var a;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const u in r)(Vn(r[u])||s&&Vn(s[u])||a3(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function Ej(t){return window.getComputedStyle(t)}class kj extends t3{constructor(){super(...arguments),this.type="html",this.renderInstance=o3}readValueFromInstance(e,n){var r;if(Zu.has(n))return(r=this.projection)!=null&&r.isProjecting?$y(n):G9(e,n);{const s=Ej(e),i=(gP(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return i3(e,n)}build(e,n,r){V2(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return $2(e,n,r)}}const Cj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pj={offset:"strokeDashoffset",array:"strokeDasharray"};function Tj(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?Cj:Pj;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const Aj=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function l3(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,f,h){if(V2(t,u,f),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:v}=t;p.transform&&(v.transform=p.transform,delete p.transform),(v.transform||p.transformOrigin)&&(v.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),v.transform&&(v.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const y of Aj)p[y]!==void 0&&(v[y]=p[y],delete p[y]);e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),s!==void 0&&Tj(p,s,i,a,!1)}const u3=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"]),c3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Rj(t,e,n,r){o3(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(u3.has(s)?s:I2(s),e.attrs[s])}function d3(t,e,n){const r=$2(t,e,n);for(const s in t)if(Vn(t[s])||Vn(e[s])){const i=Ku.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class Ij extends t3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Zu.has(n)){const r=WP(n);return r&&r.default||0}return n=u3.has(n)?n:I2(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return d3(e,n,r)}build(e,n,r){l3(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){Rj(e,n,r,s)}mount(e){this.isSVGTag=c3(e.tagName),super.mount(e)}}const Mj=j2.length;function f3(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?f3(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Mj;n++){const r=j2[n],s=t.props[r];(jd(s)||s===!1)&&(e[r]=s)}return e}function h3(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 Lj=[...D2].reverse(),Oj=D2.length;function Nj(t){return e=>Promise.all(e.map(({animation:n,options:r})=>L7(t,n,r)))}function Dj(t){let e=Nj(t),n=y4(),r=!0,s=!1;const i=f=>(h,p)=>{var y;const v=rl(t,p,f==="exit"?(y=t.presenceContext)==null?void 0:y.custom:void 0);if(v){const{transition:x,transitionEnd:_,...b}=v;h={...h,...b,..._}}return h};function a(f){e=f(t)}function u(f){const{props:h}=t,p=f3(t.parent)||{},v=[],y=new Set;let x={},_=1/0;for(let E=0;E<Oj;E++){const C=Lj[E],P=n[C],T=h[C]!==void 0?h[C]:p[C],A=jd(T),O=C===f?P.isActive:null;O===!1&&(_=E);let M=T===p[C]&&T!==h[C]&&A;if(M&&(r||s)&&t.manuallyAnimateOnMount&&(M=!1),P.protectedKeys={...x},!P.isActive&&O===null||!T&&!P.prevProp||Gm(T)||typeof T=="boolean")continue;if(C==="exit"&&P.isActive&&O!==!0){P.prevResolvedValues&&(x={...x,...P.prevResolvedValues});continue}const R=jj(P.prevProp,T);let L=R||C===f&&P.isActive&&!M&&A||E>_&&A,N=!1;const j=Array.isArray(T)?T:[T];let V=j.reduce(i(C),{});O===!1&&(V={});const{prevResolvedValues:G={}}=P,Y={...G,...V},K=$=>{L=!0,y.has($)&&(N=!0,y.delete($)),P.needsAnimating[$]=!0;const ee=t.getValue($);ee&&(ee.liveStyle=!1)};for(const $ in Y){const ee=V[$],H=G[$];if(x.hasOwnProperty($))continue;let D=!1;Gy(ee)&&Gy(H)?D=!h3(ee,H)||R:D=ee!==H,D?ee!=null?K($):y.add($):ee!==void 0&&y.has($)?K($):P.protectedKeys[$]=!0}P.prevProp=T,P.prevResolvedValues=V,P.isActive&&(x={...x,...V}),(r||s)&&t.blockInitialAnimation&&(L=!1);const B=M&&R;L&&(!B||N)&&v.push(...j.map($=>{const ee={type:C};if(typeof $=="string"&&(r||s)&&!B&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,D=rl(H,$);if(H.enteringChildren&&D){const{delayChildren:q}=D.transition||{};ee.delay=DP(H.enteringChildren,t,q)}}return{animation:$,options:ee}}))}if(y.size){const E={};if(typeof h.initial!="boolean"){const C=rl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);C&&C.transition&&(E.transition=C.transition)}y.forEach(C=>{const P=t.getBaseTarget(C),T=t.getValue(C);T&&(T.liveStyle=!0),E[C]=P??null}),v.push({animation:E})}let b=!!v.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?e(v):Promise.resolve()}function c(f,h){var v;if(n[f].isActive===h)return Promise.resolve();(v=t.variantChildren)==null||v.forEach(y=>{var x;return(x=y.animationState)==null?void 0:x.setActive(f,h)}),n[f].isActive=h;const p=u(f);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=y4(),s=!0}}}function jj(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!h3(e,t):!1}function Pa(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function y4(){return{animate:Pa(!0),whileInView:Pa(),whileHover:Pa(),whileTap:Pa(),whileDrag:Pa(),whileFocus:Pa(),exit:Pa()}}function t_(t,e){t.min=e.min,t.max=e.max}function bs(t,e){t_(t.x,e.x),t_(t.y,e.y)}function _4(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const p3=1e-4,Fj=1-p3,Vj=1+p3,m3=.01,$j=0-m3,Hj=0+m3;function or(t){return t.max-t.min}function zj(t,e,n){return Math.abs(t-e)<=n}function x4(t,e,n,r=.5){t.origin=r,t.originPoint=kt(e.min,e.max,t.origin),t.scale=or(n)/or(e),t.translate=kt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Fj&&t.scale<=Vj||isNaN(t.scale))&&(t.scale=1),(t.translate>=$j&&t.translate<=Hj||isNaN(t.translate))&&(t.translate=0)}function vd(t,e,n,r){x4(t.x,e.x,n.x,r?r.originX:void 0),x4(t.y,e.y,n.y,r?r.originY:void 0)}function w4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+or(e)}function Uj(t,e,n,r){w4(t.x,e.x,n.x,r==null?void 0:r.x),w4(t.y,e.y,n.y,r==null?void 0:r.y)}function b4(t,e,n,r=0){const s=r?kt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+or(e)}function ym(t,e,n,r){b4(t.x,e.x,n.x,r==null?void 0:r.x),b4(t.y,e.y,n.y,r==null?void 0:r.y)}function S4(t,e,n,r,s){return t-=e,t=vm(t,1/n,r),s!==void 0&&(t=vm(t,1/s,r)),t}function Bj(t,e=0,n=1,r=.5,s,i=t,a=t){if(li.test(e)&&(e=parseFloat(e),e=kt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=kt(i.min,i.max,r);t===i&&(u-=e),t.min=S4(t.min,e,n,u,s),t.max=S4(t.max,e,n,u,s)}function E4(t,e,[n,r,s],i,a){Bj(t,e[n],e[r],e[s],e.scale,i,a)}const Wj=["x","scaleX","originX"],Gj=["y","scaleY","originY"];function k4(t,e,n,r){E4(t.x,e,Wj,n?n.x:void 0,r?r.x:void 0),E4(t.y,e,Gj,n?n.y:void 0,r?r.y:void 0)}function C4(t){return t.translate===0&&t.scale===1}function g3(t){return C4(t.x)&&C4(t.y)}function P4(t,e){return t.min===e.min&&t.max===e.max}function Kj(t,e){return P4(t.x,e.x)&&P4(t.y,e.y)}function T4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function v3(t,e){return T4(t.x,e.x)&&T4(t.y,e.y)}function A4(t){return or(t.x)/or(t.y)}function R4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function qs(t){return[t("x"),t("y")]}function Zj(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:f,rotate:h,pathRotation:p,rotateX:v,rotateY:y,skewX:x,skewY:_}=n;f&&(r=`perspective(${f}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),v&&(r+=`rotateX(${v}deg) `),y&&(r+=`rotateY(${y}deg) `),x&&(r+=`skewX(${x}deg) `),_&&(r+=`skewY(${_}deg) `)}const u=t.x.scale*e.x,c=t.y.scale*e.y;return(u!==1||c!==1)&&(r+=`scale(${u}, ${c})`),r||"none"}const qj=M2.length,I4=t=>typeof t=="string"?parseFloat(t):t,M4=t=>typeof t=="number"||De.test(t);function Yj(t,e,n,r,s,i){s?(t.opacity=kt(0,n.opacity??1,Xj(r)),t.opacityExit=kt(e.opacity??1,0,Qj(r))):i&&(t.opacity=kt(e.opacity??1,n.opacity??1,r));for(let a=0;a<qj;a++){const u=M2[a];let c=L4(e,u),f=L4(n,u);if(c===void 0&&f===void 0)continue;c||(c=0),f||(f=0),c===0||f===0||M4(c)===M4(f)?(t[u]=Math.max(kt(I4(c),I4(f),r),0),(li.test(f)||li.test(c))&&(t[u]+="%")):t[u]=f}(e.rotate||n.rotate)&&(t.rotate=kt(e.rotate||0,n.rotate||0,r))}function L4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Xj=y3(0,.5,cP),Qj=y3(.5,.95,fs);function y3(t,e,n){return r=>r<t?0:r>e?1:n(Nd(t,e,r))}function Jj(t,e,n){const r=Vn(t)?t:Nu(t);return r.start(A2("",r,e,n)),r.animation}function Fd(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const eF=(t,e)=>t.depth-e.depth;class tF{constructor(){this.children=[],this.isDirty=!1}add(e){g2(this.children,e),this.isDirty=!0}remove(e){um(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(eF),this.isDirty=!1,this.children.forEach(e)}}function nF(t,e){const n=ir.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Zo(r),t(i-e))};return Ct.setup(r,!0),()=>Zo(r)}function _p(t){return Vn(t)?t.get():t}class rF{constructor(){this.members=[]}add(e){g2(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&&(um(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(um(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:a}=e.options;(i===void 0||i!==a)&&(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,a;(r=(n=e.options).onExitComplete)==null||r.call(n),(a=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.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 xp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Bv=["","X","Y","Z"],sF=1e3;let iF=0;function Wv(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function _3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=HP(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Ct,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&_3(r)}function x3({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=iF++,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(lF),this.nodes.forEach(pF),this.nodes.forEach(mF),this.nodes.forEach(uF)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new tF)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new y2),this.eventHandlers.get(a).add(u)}notifyListeners(a,...u){const c=this.eventHandlers.get(a);c&&c.notify(...u)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=N2(a)&&!lj(a),this.instance=a;const{layoutId:u,layout:c,visualElement:f}=this.options;if(f&&!f.current&&f.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||u)&&(this.isLayoutDirty=!0),t){let h,p=0;const v=()=>this.root.updateBlockedByResize=!1;Ct.read(()=>{p=window.innerWidth}),t(a,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,h&&h(),h=nF(v,250),xp.hasAnimatedSinceResize&&(xp.hasAnimatedSinceResize=!1,this.nodes.forEach(D4)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:v,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||f.getDefaultTransition()||xF,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=f.getProps(),E=!this.targetLayout||!v3(this.targetLayout,y),C=!p&&v;if(this.options.layoutRoot||this.resumeFrom||C||p&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const P={...T2(x,"layout"),onPlay:_,onComplete:b};(f.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P),this.setAnimationOrigin(h,C,P.path)}else p||D4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Zo(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(gF),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const p=this.path[h];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:u,layout:c}=this.options;if(u===void 0&&!c)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(dF),this.nodes.forEach(O4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(N4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fF),this.nodes.forEach(hF),this.nodes.forEach(oF),this.nodes.forEach(aF)):this.nodes.forEach(N4),this.clearAllSnapshots();const u=ir.now();Dn.delta=di(0,1e3/60,u-Dn.timestamp),Dn.timestamp=u,Dn.isProcessing=!0,Dv.update.process(Dn),Dv.preRender.process(Dn),Dv.render.process(Dn),Dn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,L2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cF),this.sharedNodes.forEach(vF)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ct.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!or(this.snapshot.measuredBox.x)&&!or(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 c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=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:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(u=!1),u&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!g3(this.projectionDelta),c=this.getTransformTemplate(),f=c?c(this.latestValues,""):void 0,h=f!==this.prevTransformTemplateValue;a&&this.instance&&(u||ja(this.latestValues)||h)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),wF(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var f;const{visualElement:a}=this.options;if(!a)return yn();const u=a.measureViewportBox();if(!(((f=this.scroll)==null?void 0:f.wasRoot)||this.path.some(bF))){const{scroll:h}=this.root;h&&(ei(u.x,h.offset.x),ei(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=yn();if(bs(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let f=0;f<this.path.length;f++){const h=this.path[f],{scroll:p,options:v}=h;h!==this.root&&p&&v.layoutScroll&&(p.wasRoot&&bs(u,a),ei(u.x,p.offset.x),ei(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const f=c||yn();bs(f,a);for(let v=0;v<this.path.length;v++){const y=this.path[v];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(ei(f.x,-y.scroll.offset.x),ei(f.y,-y.scroll.offset.y)),ja(y.latestValues)&&yp(f,y.latestValues,(h=y.layout)==null?void 0:h.layoutBox)}return ja(this.latestValues)&&yp(f,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),f}removeTransform(a){var c;const u=yn();bs(u,a);for(let f=0;f<this.path.length;f++){const h=this.path[f];if(!ja(h.latestValues))continue;let p;h.instance&&(Qy(h.latestValues)&&h.updateSnapshot(),p=yn(),bs(p,h.measurePageBox())),k4(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return ja(this.latestValues)&&k4(u,this.latestValues),u}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.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!==Dn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var y;const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==u;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:p}=this.options;if(!this.layout||!(h||p))return;this.resolvedRelativeTargetAt=Dn.timestamp;const v=this.getClosestProjectingParent();v&&this.linkedParentVersion!==v.layoutVersion&&!v.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&v&&v.layout?this.createRelativeTarget(v,this.layout.layoutBox,v.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(),Uj(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):bs(this.target,this.layout.layoutBox),s3(this.target,this.targetDelta)):bs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?this.createRelativeTarget(v,this.target,v.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Qy(this.parent.latestValues)||r3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,u,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=yn(),this.relativeTargetOrigin=yn(),ym(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),bs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var x;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Dn.timestamp&&(c=!1),c)return;const{layout:f,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||h))return;bs(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,v=this.treeScale.y;yj(this.layoutCorrected,this.treeScale,this.path,u),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=yn());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_4(this.prevProjectionDelta.x,this.projectionDelta.x),_4(this.prevProjectionDelta.y,this.projectionDelta.y)),vd(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==v||!R4(this.projectionDelta.x,this.prevProjectionDelta.x)||!R4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var u;if((u=this.options.visualElement)==null||u.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ru(),this.projectionDelta=ru(),this.projectionDeltaWithTransform=ru()}setAnimationOrigin(a,u=!1,c){const f=this.snapshot,h=f?f.latestValues:{},p={...this.latestValues},v=ru();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const y=yn(),x=f?f.source:void 0,_=this.layout?this.layout.source:void 0,b=x!==_,E=this.getStack(),C=!E||E.members.length<=1,P=!!(b&&!C&&this.options.crossfade===!0&&!this.path.some(_F));this.animationProgress=0;let T;const A=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=O=>{const M=O/1e3,R=A==null?void 0:A(M);R?(v.x.translate=R.x,v.x.scale=kt(a.x.scale,1,M),v.x.origin=a.x.origin,v.x.originPoint=a.x.originPoint,v.y.translate=R.y,v.y.scale=kt(a.y.scale,1,M),v.y.origin=a.y.origin,v.y.originPoint=a.y.originPoint):(j4(v.x,a.x,M),j4(v.y,a.y,M)),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ym(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),yF(this.relativeTarget,this.relativeTargetOrigin,y,M),T&&Kj(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=yn()),bs(T,this.relativeTarget)),b&&(this.animationValues=p,Yj(p,h,this.latestValues,M,P,C)),R&&R.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=R.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,f;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(f=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||f.stop(),this.pendingAnimation&&(Zo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ct.update(()=>{xp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Nu(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jj(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(sF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:f,latestValues:h}=a;if(!(!u||!c||!f)){if(this!==a&&this.layout&&f&&w3(this.options.animationType,this.layout.layoutBox,f.layoutBox)){c=this.target||yn();const p=or(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const v=or(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+v}bs(u,c),yp(u,h),vd(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new rF),this.sharedNodes.get(a).add(u);const f=u.options.initialPromotionConfig;u.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(u):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var u;const{layoutId:a}=this.options;return a?((u=this.getStack())==null?void 0:u.lead)||this:this}getPrevLead(){var u;const{layoutId:a}=this.options;return a?(u=this.getStack())==null?void 0:u.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:u,preserveFollowOpacity:c}={}){const f=this.getStack();f&&f.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let u=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(u=!0),!u)return;const f={};c.z&&Wv("z",a,f,this.animationValues);for(let h=0;h<Bv.length;h++)Wv(`rotate${Bv[h]}`,a,f,this.animationValues),Wv(`skew${Bv[h]}`,a,f,this.animationValues);a.render();for(const h in f)a.setStaticValue(h,f[h]),this.animationValues&&(this.animationValues[h]=f[h]);a.scheduleRender()}applyProjectionStyles(a,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=_p(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=_p(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!ja(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=f.animationValues||f.latestValues;this.applyTransformsToTarget();let p=Zj(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:v,y}=this.projectionDelta;a.transformOrigin=`${v.origin*100}% ${y.origin*100}% 0`,f.animationValues?a.opacity=f===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const x in e_){if(h[x]===void 0)continue;const{correct:_,applyTo:b,isCSSVariable:E}=e_[x],C=p==="none"?h[x]:_(h[x],f);if(b){const P=b.length;for(let T=0;T<P;T++)a[b[T]]=C}else E?this.options.visualElement.renderState.vars[x]=C:a[x]=C}this.options.layoutId&&(a.pointerEvents=f===this?_p(u==null?void 0:u.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var u;return(u=a.currentAnimation)==null?void 0:u.stop()}),this.root.nodes.forEach(O4),this.root.sharedNodes.clear()}}}function oF(t){t.updateLayout()}function aF(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,a=e.source!==t.layout.source;if(i==="size")qs(p=>{const v=a?e.measuredBox[p]:e.layoutBox[p],y=or(v);v.min=r[p].min,v.max=v.min+y});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";t_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else w3(i,e.layoutBox,r)&&qs(p=>{const v=a?e.measuredBox[p]:e.layoutBox[p],y=or(r[p]);v.max=v.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+y)});const u=ru();vd(u,r,e.layoutBox);const c=ru();a?vd(c,t.applyTransform(s,!0),e.measuredBox):vd(c,r,e.layoutBox);const f=!g3(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:y}=p;if(v&&y){const x=t.options.layoutAnchor||void 0,_=yn();ym(_,e.layoutBox,v.layoutBox,x);const b=yn();ym(b,r,y.layoutBox,x),v3(_,b)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function lF(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 uF(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function cF(t){t.clearSnapshot()}function O4(t){t.clearMeasurements()}function dF(t){t.isLayoutDirty=!0,t.updateLayout()}function N4(t){t.isLayoutDirty=!1}function fF(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function hF(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function D4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function pF(t){t.resolveTargetDelta()}function mF(t){t.calcProjection()}function gF(t){t.resetSkewAndRotation()}function vF(t){t.removeLeadSnapshot()}function j4(t,e,n){t.translate=kt(e.translate,0,n),t.scale=kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function F4(t,e,n,r){t.min=kt(e.min,n.min,r),t.max=kt(e.max,n.max,r)}function yF(t,e,n,r){F4(t.x,e.x,n.x,r),F4(t.y,e.y,n.y,r)}function _F(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const xF={duration:.45,ease:[.4,0,.1,1]},V4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),$4=V4("applewebkit/")&&!V4("chrome/")?Math.round:fs;function H4(t){t.min=$4(t.min),t.max=$4(t.max)}function wF(t){H4(t.x),H4(t.y)}function w3(t,e,n){return t==="position"||t==="preserve-aspect"&&!zj(A4(e),A4(n),.2)}function bF(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const SF=x3({attachResizeListener:(t,e)=>Fd(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}),Gv={current:void 0},b3=x3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Gv.current){const t=new SF({});t.mount(window),t.setOptions({layoutScroll:!0}),Gv.current=t}return Gv.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),H2=g.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function z4(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function EF(...t){return e=>{let n=!1;const r=t.map(s=>{const i=z4(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():z4(t[s],null)}}}}function kF(...t){return g.useCallback(EF(...t),t)}class CF extends g.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(pp(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=pp(r)&&r.offsetWidth||0,i=pp(r)&&r.offsetHeight||0,a=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(a.height),u.width=parseFloat(a.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=i-u.height-u.top,u.direction=a.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function PF({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var v;const a=g.useId(),u=g.useRef(null),c=g.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:f}=g.useContext(H2),h=((v=t.props)==null?void 0:v.ref)??(t==null?void 0:t.ref),p=kF(u,h);return g.useInsertionEffect(()=>{const{width:y,height:x,top:_,left:b,right:E,bottom:C,direction:P}=c.current;if(e||i===!1||!u.current||!y||!x)return;const T=P==="rtl",A=n==="left"?T?`right: ${E}`:`left: ${b}`:T?`left: ${b}`:`right: ${E}`,O=r==="bottom"?`bottom: ${C}`:`top: ${_}`;u.current.dataset.motionPopId=a;const M=document.createElement("style");f&&(M.nonce=f);const R=s??document.head;return R.appendChild(M),M.sheet&&M.sheet.insertRule(`
63
- [data-motion-pop-id="${a}"] {
64
- position: absolute !important;
65
- width: ${y}px !important;
66
- height: ${x}px !important;
67
- ${A}px !important;
68
- ${O}px !important;
69
- }
70
- `),()=>{var L;(L=u.current)==null||L.removeAttribute("data-motion-pop-id"),R.contains(M)&&R.removeChild(M)}},[e]),S.jsx(CF,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:g.cloneElement(t,{ref:p})})}const TF=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:f})=>{const h=p2(AF),p=g.useId(),v=g.useRef(n),y=g.useRef(r);m2(()=>{v.current=n,y.current=r});let x=!0,_=g.useMemo(()=>(x=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:b=>{h.set(b,!0);for(const E of h.values())if(!E)return;r&&r()},register:b=>(h.set(b,!1),()=>{var E;h.delete(b),!v.current&&!h.size&&((E=y.current)==null||E.call(y))})}),[n,h,r]);return i&&x&&(_={..._}),g.useMemo(()=>{h.forEach((b,E)=>h.set(E,!1))},[n]),g.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=S.jsx(PF,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:f,children:t}),S.jsx(Bm.Provider,{value:_,children:t})};function AF(){return new Map}function S3(t=!0){const e=g.useContext(Bm);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=g.useId();g.useEffect(()=>{if(t)return s(i)},[t]);const a=g.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const Hh=t=>t.key||"";function U4(t){const e=[];return g.Children.forEach(t,n=>{g.isValidElement(n)&&e.push(n)}),e}const Gi=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:u="left",anchorY:c="top",root:f})=>{const[h,p]=S3(a),v=g.useMemo(()=>U4(t),[t]),y=a&&!h?[]:v.map(Hh),x=g.useRef(!0),_=g.useRef(v),b=p2(()=>new Map),E=g.useRef(new Set),[C,P]=g.useState(v),[T,A]=g.useState(v);m2(()=>{x.current=!1,_.current=v;for(let R=0;R<T.length;R++){const L=Hh(T[R]);y.includes(L)?(b.delete(L),E.current.delete(L)):b.get(L)!==!0&&b.set(L,!1)}},[T,y.length,y.join("-")]);const O=[];if(v!==C){let R=[...v];for(let L=0;L<T.length;L++){const N=T[L],j=Hh(N);y.includes(j)||(R.splice(L,0,N),O.push(N))}return i==="wait"&&O.length&&(R=O),A(U4(R)),P(v),null}const{forceRender:M}=g.useContext(h2);return S.jsx(S.Fragment,{children:T.map(R=>{const L=Hh(R),N=a&&!h?!1:v===T||y.includes(L),j=()=>{if(E.current.has(L))return;if(b.has(L))E.current.add(L),b.set(L,!0);else return;let V=!0;b.forEach(G=>{G||(V=!1)}),V&&(M==null||M(),A(_.current),a&&(p==null||p()),r&&r())};return S.jsx(TF,{isPresent:N,initial:!x.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:f,onExitComplete:N?void 0:j,anchorX:u,anchorY:c,children:R},L)})})},E3=g.createContext({strict:!1}),B4={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 W4=!1;function RF(){if(W4)return;const t={};for(const e in B4)t[e]={isEnabled:n=>B4[e].some(r=>!!n[r])};e3(t),W4=!0}function k3(){return RF(),pj()}function IF(t){const e=k3();for(const n in t)e[n]={...e[n],...t[n]};e3(e)}const MF=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 _m(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||MF.has(t)}let C3=t=>!_m(t);function LF(t){typeof t=="function"&&(C3=e=>e.startsWith("on")?!_m(e):t(e))}try{LF(require("@emotion/is-prop-valid").default)}catch{}function OF(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Vn(t[s])||(C3(s)||n===!0&&_m(s)||!e&&!_m(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Zm=g.createContext({});function NF(t,e){if(Km(t)){const{initial:n,animate:r}=t;return{initial:n===!1||jd(n)?n:void 0,animate:jd(r)?r:void 0}}return t.inherit!==!1?e:{}}function DF(t){const{initial:e,animate:n}=NF(t,g.useContext(Zm));return g.useMemo(()=>({initial:e,animate:n}),[G4(e),G4(n)])}function G4(t){return Array.isArray(t)?t.join(" "):t}const z2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function P3(t,e,n){for(const r in e)!Vn(e[r])&&!a3(r,n)&&(t[r]=e[r])}function jF({transformTemplate:t},e){return g.useMemo(()=>{const n=z2();return V2(n,e,t),Object.assign({},n.vars,n.style)},[e])}function FF(t,e){const n=t.style||{},r={};return P3(r,n,t),Object.assign(r,jF(t,e)),r}function VF(t,e){const n={},r=FF(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 T3=()=>({...z2(),attrs:{}});function $F(t,e,n,r){const s=g.useMemo(()=>{const i=T3();return l3(i,e,c3(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};P3(i,t.style,t),s.style={...i,...s.style}}return s}const HF=["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 U2(t){return typeof t!="string"||t.includes("-")?!1:!!(HF.indexOf(t)>-1||/[A-Z]/u.test(t))}function zF(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??U2(t)?$F:VF)(e,r,s,t),f=OF(e,typeof t=="string",i),h=t!==g.Fragment?{...f,...c,ref:n}:{},{children:p}=e,v=g.useMemo(()=>Vn(p)?p.get():p,[p]);return g.createElement(t,{...h,children:v})}function UF({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:BF(n,r,s,t),renderState:e()}}function BF(t,e,n,r){const s={},i=r(t,{});for(const v in i)s[v]=_p(i[v]);let{initial:a,animate:u}=t;const c=Km(t),f=QP(t);e&&f&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),u===void 0&&(u=e.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const p=h?u:a;if(p&&typeof p!="boolean"&&!Gm(p)){const v=Array.isArray(p)?p:[p];for(let y=0;y<v.length;y++){const x=R2(t,v[y]);if(x){const{transitionEnd:_,transition:b,...E}=x;for(const C in E){let P=E[C];if(Array.isArray(P)){const T=h?P.length-1:0;P=P[T]}P!==null&&(s[C]=P)}for(const C in _)s[C]=_[C]}}}return s}const A3=t=>(e,n)=>{const r=g.useContext(Zm),s=g.useContext(Bm),i=()=>UF(t,e,r,s);return n?i():p2(i)},WF=A3({scrapeMotionValuesFromProps:$2,createRenderState:z2}),GF=A3({scrapeMotionValuesFromProps:d3,createRenderState:T3}),KF=Symbol.for("motionComponentSymbol");function ZF(t,e,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var u;i&&((u=t.onMount)==null||u.call(t,i)),e&&(i?e.mount(i):e.unmount());const a=r.current;if(typeof a=="function")if(i){const c=a(i);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[e])}const R3=g.createContext({});function Ql(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qF(t,e,n,r,s,i){var P,T;const{visualElement:a}=g.useContext(Zm),u=g.useContext(E3),c=g.useContext(Bm),f=g.useContext(H2),h=f.reducedMotion,p=f.skipAnimations,v=g.useRef(null),y=g.useRef(!1);r=r||u.renderer,!v.current&&r&&(v.current=r(t,{visualState:e,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:p,isSVG:i}),y.current&&v.current&&(v.current.manuallyAnimateOnMount=!0));const x=v.current,_=g.useContext(R3);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&YF(v.current,n,s,_);const b=g.useRef(!1);g.useInsertionEffect(()=>{x&&b.current&&x.update(n,c)});const E=n[$P],C=g.useRef(!!E&&typeof window<"u"&&!((P=window.MotionHandoffIsComplete)!=null&&P.call(window,E))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,E)));return m2(()=>{y.current=!0,x&&(b.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),C.current&&x.animationState&&x.animationState.animateChanges())}),g.useEffect(()=>{x&&(!C.current&&x.animationState&&x.animationState.animateChanges(),C.current&&(queueMicrotask(()=>{var A;(A=window.MotionHandoffMarkAsComplete)==null||A.call(window,E)}),C.current=!1),x.enteringChildren=void 0)}),x}function YF(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:f,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:I3(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&Ql(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:f,layoutAnchor:h})}function I3(t){if(t)return t.options.allowProjection!==!1?t.projection:I3(t.parent)}function Kv(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&IF(r);const i=n?n==="svg":U2(t),a=i?GF:WF;function u(f,h){let p;const v={...g.useContext(H2),...f,layoutId:XF(f)},{isStatic:y}=v,x=DF(f),_=a(f,y);if(!y&&typeof window<"u"){QF();const b=JF(v);p=b.MeasureLayout,x.visualElement=qF(t,_,v,s,b.ProjectionNode,i)}return S.jsxs(Zm.Provider,{value:x,children:[p&&x.visualElement?S.jsx(p,{visualElement:x.visualElement,...v}):null,zF(t,f,ZF(_,x.visualElement,h),_,y,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=g.forwardRef(u);return c[KF]=t,c}function XF({layoutId:t}){const e=g.useContext(h2).id;return e&&t!==void 0?e+"-"+t:t}function QF(t,e){g.useContext(E3).strict}function JF(t){const e=k3(),{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 eV(t,e){if(typeof Proxy>"u")return Kv;const n=new Map,r=(i,a)=>Kv(i,a,t,e),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,Kv(a,void 0,t,e)),n.get(a))})}const tV=(t,e)=>e.isSVG??U2(t)?new Ij(e):new kj(e,{allowProjection:t!==g.Fragment});class nV extends ta{constructor(e){super(e),e.animationState||(e.animationState=Dj(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Gm(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 rV=0;class sV extends ta{constructor(){super(...arguments),this.id=rV++,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:a,custom:u}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const c=rl(this.node,a,u);if(c){const{transition:f,transitionEnd:h,...p}=c;for(const v in p)(i=this.node.getValue(v))==null||i.jump(p[v])}}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 iV={animation:{Feature:nV},exit:{Feature:sV}};function hf(t){return{point:{x:t.pageX,y:t.pageY}}}const oV=t=>e=>O2(e)&&t(e,hf(e));function yd(t,e,n,r){return Fd(t,e,oV(n),r)}const M3=({current:t})=>t?t.ownerDocument.defaultView:null,K4=(t,e)=>Math.abs(t-e);function aV(t,e){const n=K4(t.x,e.x),r=K4(t.y,e.y);return Math.sqrt(n**2+r**2)}const Z4=new Set(["auto","scroll"]);class L3{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:u}={}){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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zh(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Zv(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=aV(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:E}=x,{timestamp:C}=Dn;this.history.push({...E,timestamp:C});const{onStart:P,onMove:T}=this.handlers;_||(P&&P(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,x)},this.handlePointerMove=(x,_)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=zh(_,this.transformPagePoint),Ct.update(this.updatePoint,!0)},this.handlePointerUp=(x,_)=>{this.end();const{onEnd:b,onSessionEnd:E,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const P=Zv(x.type==="pointercancel"?this.lastMoveEventInfo:zh(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(x,P),E&&E(x,P)},!O2(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=hf(e),f=zh(c,this.transformPagePoint),{point:h}=f,{timestamp:p}=Dn;this.history=[{...h,timestamp:p}];const{onSessionStart:v}=n;v&&v(e,Zv(f,this.history));const y={passive:!0,capture:!0};this.removeListeners=cf(yd(this.contextWindow,"pointermove",this.handlePointerMove,y),yd(this.contextWindow,"pointerup",this.handlePointerUp,y),yd(this.contextWindow,"pointercancel",this.handlePointerUp,y)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Z4.has(r.overflowX)||Z4.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),Ct.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Zo(this.updatePoint)}}function zh(t,e){return e?{point:e(t.point)}:t}function q4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Zv({point:t},e){return{point:t,delta:q4(t,O3(e)),offset:q4(t,lV(e)),velocity:uV(e,.1)}}function lV(t){return t[0]}function O3(t){return t[t.length-1]}function uV(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=O3(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Ur(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>Ur(e)*2&&(r=t[1]);const i=ls(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function cV(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?kt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?kt(n,t,r.max):Math.min(t,n)),t}function Y4(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 dV(t,{top:e,left:n,bottom:r,right:s}){return{x:Y4(t.x,n,s),y:Y4(t.y,e,r)}}function X4(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 fV(t,e){return{x:X4(t.x,e.x),y:X4(t.y,e.y)}}function hV(t,e){let n=.5;const r=or(t),s=or(e);return s>r?n=Nd(e.min,e.max-r,t.min):r>s&&(n=Nd(t.min,t.max-s,e.min)),di(0,1,n)}function pV(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 n_=.35;function mV(t=n_){return t===!1?t=0:t===!0&&(t=n_),{x:Q4(t,"left","right"),y:Q4(t,"top","bottom")}}function Q4(t,e,n){return{min:J4(t,e),max:J4(t,n)}}function J4(t,e){return typeof t=="number"?t:t[e]||0}const gV=new WeakMap;class vV{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(hf(p).point),this.stopAnimation()},a=(p,v)=>{const{drag:y,dragPropagation:x,onDragStart:_}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=W7(y),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=v,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qs(E=>{let C=this.getAxisMotionValue(E).get()||0;if(li.test(C)){const{projection:P}=this.visualElement;if(P&&P.layout){const T=P.layout.layoutBox[E];T&&(C=or(T)*(parseFloat(C)/100))}}this.originPoint[E]=C}),_&&Ct.update(()=>_(p,v),!1,!0),Ky(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},u=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v;const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:_,onDrag:b}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:E}=v;if(x&&this.currentDirection===null){this.currentDirection=_V(E),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",v.point,E),this.updateAxis("y",v.point,E),this.visualElement.render(),b&&Ct.update(()=>b(p,v),!1,!0)},c=(p,v)=>{this.latestPointerEvent=p,this.latestPanInfo=v,this.stop(p,v),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new L3(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:M3(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:a}=s;this.startAnimation(a);const{onDragEnd:u}=this.getProps();u&&Ct.postRender(()=>u(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||!Uh(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=cV(a,this.constraints[e],this.elastic[e])),i.set(a)}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&&Ql(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=dV(r.layoutBox,e):this.constraints=!1,this.elastic=mV(n),s!==this.constraints&&!Ql(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&qs(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=pV(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ql(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=_j(r,s.root,this.visualElement.getTransformPagePoint());let a=fV(s.layout.layoutBox,i);if(n){const u=n(gj(a));this.hasMutatedConstraints=!!u,u&&(a=n3(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},f=qs(h=>{if(!Uh(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const v=s?200:1e6,y=s?40:1e7,x={type:"inertia",velocity:r?e[h]:0,bounceStiffness:v,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,x)});return Promise.all(f).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Ky(this.visualElement,e),r.start(A2(e,r,0,n,this.visualElement,!1))}stopAnimation(){qs(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){qs(n=>{const{drag:r}=this.getProps();if(!Uh(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:u}=s.layout.layoutBox[n],c=i.get()||0;i.set(e[n]-kt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ql(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};qs(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=hV({min:c,max:c},this.constraints[a])}});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(),qs(a=>{if(!Uh(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:f}=this.constraints[a];u.set(kt(c,f,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gV.set(this.visualElement,this);const e=this.visualElement.current,n=yd(e,"pointerdown",f=>{const{drag:h,dragListener:p=!0}=this.getProps(),v=f.target,y=v!==e&&X7(v);h&&p&&!y&&this.start(f)});let r;const s=()=>{const{dragConstraints:f}=this.getProps();Ql(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),r||(r=yV(e,f.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ct.read(s);const u=Fd(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:h})=>{this.isDragging&&h&&(qs(p=>{const v=this.getAxisMotionValue(p);v&&(this.originPoint[p]+=f[p].translate,v.set(v.get()+f[p].translate))}),this.visualElement.render())}));return()=>{u(),n(),a(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=n_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function ek(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function yV(t,e,n){const r=a4(t,ek(n)),s=a4(e,ek(n));return()=>{r(),s()}}function Uh(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function _V(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class xV extends ta{constructor(e){super(e),this.removeGroupControls=fs,this.removeListeners=fs,this.controls=new vV(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||fs}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 qv=t=>(e,n)=>{t&&Ct.update(()=>t(e,n),!1,!0)};class wV extends ta{constructor(){super(...arguments),this.removePointerDownListener=fs}onPointerDown(e){this.session=new L3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:M3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:qv(e),onStart:qv(n),onMove:qv(r),onEnd:(i,a)=>{delete this.session,s&&Ct.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=yd(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 Yv=!1;class bV extends g.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),Yv&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),xp.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,e.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Yv=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Ct.postRender(()=>{const u=a.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),L2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;Yv=!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 N3(t){const[e,n]=S3(),r=g.useContext(h2);return S.jsx(bV,{...t,layoutGroup:r,switchLayoutGroup:g.useContext(R3),isPresent:e,safeToRemove:n})}const SV={pan:{Feature:wV},drag:{Feature:xV,ProjectionNode:b3,MeasureLayout:N3}};function tk(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&&Ct.postRender(()=>i(e,hf(e)))}class EV extends ta{mount(){const{current:e}=this.node;e&&(this.unmount=K7(e,(n,r)=>(tk(this.node,r,"Start"),s=>tk(this.node,s,"End"))))}unmount(){}}class kV extends ta{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=cf(Fd(this.node.current,"focus",()=>this.onFocus()),Fd(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function nk(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&&Ct.postRender(()=>i(e,hf(e)))}class CV extends ta{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=J7(e,(s,i)=>(nk(this.node,i,"Start"),(a,{success:u})=>nk(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const r_=new WeakMap,Xv=new WeakMap,PV=t=>{const e=r_.get(t.target);e&&e(t)},TV=t=>{t.forEach(PV)};function AV({root:t,...e}){const n=t||document;Xv.has(n)||Xv.set(n,{});const r=Xv.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(TV,{root:t,...e})),r[s]}function RV(t,e,n){const r=AV(e);return r_.set(t,n),r.observe(t),()=>{r_.delete(t),r.unobserve(t)}}const IV={some:0,all:1};class MV extends ta{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:IV[s]},u=f=>{const{isIntersecting:h}=f;if(this.isInView===h||(this.isInView=h,i&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:p,onViewportLeave:v}=this.node.getProps(),y=h?p:v;y&&y(f)};this.stopObserver=RV(this.node.current,a,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(LV(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function LV({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const OV={inView:{Feature:MV},tap:{Feature:CV},focus:{Feature:kV},hover:{Feature:EV}},NV={layout:{ProjectionNode:b3,MeasureLayout:N3}},DV={...iV,...OV,...SV,...NV},Ki=eV(DV,tV);function jV(){!F2.current&&JP();const[t]=g.useState(mm.current);return t}const sl=Ki;var qm=G6();const FV=$m(qm);function VV(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 $V=t=>{switch(t){case"success":return UV;case"info":return WV;case"warning":return BV;case"error":return GV;default:return null}},HV=Array(12).fill(0),zV=({visible:t,className:e})=>ve.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ve.createElement("div",{className:"sonner-spinner"},HV.map((n,r)=>ve.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),UV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),BV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ve.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"})),WV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),GV=ve.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ve.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"})),KV=ve.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"},ve.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ve.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ZV=()=>{const[t,e]=ve.useState(document.hidden);return ve.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let s_=1;class qV{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{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.create=e=>{var n;const{message:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:s_++,a=this.toasts.find(c=>c.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),a?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:r}),{...c,...e,id:i,dismissible:u,title:r}):c):this.addToast({title:r,...s,dismissible:u,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),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,a;const u=s.then(async f=>{if(a=["resolve",f],ve.isValidElement(f))i=!1,this.create({id:r,type:"default",message:f});else if(XV(f)&&!f.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,v=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...x})}else if(f instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(f):n.error,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:v,...x})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(f):n.success,v=typeof n.description=="function"?await n.description(f):n.description,x=typeof p=="object"&&!ve.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:v,...x})}}).catch(async f=>{if(a=["reject",f],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,y=typeof h=="object"&&!ve.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((f,h)=>u.then(()=>a[0]==="reject"?h(a[1]):f(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||s_++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const yr=new qV,YV=(t,e)=>{const n=(e==null?void 0:e.id)||s_++;return yr.addToast({title:t,...e,id:n}),n},XV=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",QV=YV,JV=()=>yr.toasts,e$=()=>yr.getActiveToasts(),ht=Object.assign(QV,{success:yr.success,info:yr.info,warning:yr.warning,error:yr.error,custom:yr.custom,message:yr.message,promise:yr.promise,dismiss:yr.dismiss,loading:yr.loading},{getHistory:JV,getToasts:e$});VV("[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}[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(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);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]{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 Bh(t){return t.label!==void 0}const t$=3,n$="24px",r$="16px",rk=4e3,s$=356,i$=14,o$=45,a$=200;function Gs(...t){return t.filter(Boolean).join(" ")}function l$(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const u$=t=>{var e,n,r,s,i,a,u,c,f;const{invert:h,toast:p,unstyled:v,interacting:y,setHeights:x,visibleToasts:_,heights:b,index:E,toasts:C,expanded:P,removeToast:T,defaultRichColors:A,closeButton:O,style:M,cancelButtonStyle:R,actionButtonStyle:L,className:N="",descriptionClassName:j="",duration:V,position:G,gap:Y,expandByDefault:K,classNames:B,icons:X,closeButtonAriaLabel:$="Close toast"}=t,[ee,H]=ve.useState(null),[D,q]=ve.useState(null),[re,se]=ve.useState(!1),[oe,ue]=ve.useState(!1),[de,ie]=ve.useState(!1),[ae,me]=ve.useState(!1),[Se,Re]=ve.useState(!1),[Ke,it]=ve.useState(0),[Oe,at]=ve.useState(0),It=ve.useRef(p.duration||V||rk),mt=ve.useRef(null),je=ve.useRef(null),Qe=E===0,lt=E+1<=_,Je=p.type,vt=p.dismissible!==!1,xn=p.className||"",zt=p.descriptionClassName||"",An=ve.useMemo(()=>b.findIndex(Ze=>Ze.toastId===p.id)||0,[b,p.id]),Xn=ve.useMemo(()=>{var Ze;return(Ze=p.closeButton)!=null?Ze:O},[p.closeButton,O]),Pr=ve.useMemo(()=>p.duration||V||rk,[p.duration,V]),Qn=ve.useRef(0),wn=ve.useRef(0),Os=ve.useRef(0),Ns=ve.useRef(null),[Rn,pi]=G.split("-"),mi=ve.useMemo(()=>b.reduce((Ze,Pt,nn)=>nn>=An?Ze:Ze+Pt.height,0),[b,An]),ps=ZV(),Ds=p.invert||h,ur=Je==="loading";wn.current=ve.useMemo(()=>An*Y+mi,[An,mi]),ve.useEffect(()=>{It.current=Pr},[Pr]),ve.useEffect(()=>{se(!0)},[]),ve.useEffect(()=>{const Ze=je.current;if(Ze){const Pt=Ze.getBoundingClientRect().height;return at(Pt),x(nn=>[{toastId:p.id,height:Pt,position:p.position},...nn]),()=>x(nn=>nn.filter(bn=>bn.toastId!==p.id))}},[x,p.id]),ve.useLayoutEffect(()=>{if(!re)return;const Ze=je.current,Pt=Ze.style.height;Ze.style.height="auto";const nn=Ze.getBoundingClientRect().height;Ze.style.height=Pt,at(nn),x(bn=>bn.find(Ut=>Ut.toastId===p.id)?bn.map(Ut=>Ut.toastId===p.id?{...Ut,height:nn}:Ut):[{toastId:p.id,height:nn,position:p.position},...bn])},[re,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const In=ve.useCallback(()=>{ue(!0),it(wn.current),x(Ze=>Ze.filter(Pt=>Pt.toastId!==p.id)),setTimeout(()=>{T(p)},a$)},[p,T,x,wn]);ve.useEffect(()=>{if(p.promise&&Je==="loading"||p.duration===1/0||p.type==="loading")return;let Ze;return P||y||ps?(()=>{if(Os.current<Qn.current){const bn=new Date().getTime()-Qn.current;It.current=It.current-bn}Os.current=new Date().getTime()})():(()=>{It.current!==1/0&&(Qn.current=new Date().getTime(),Ze=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),In()},It.current))})(),()=>clearTimeout(Ze)},[P,y,p,Je,ps,In]),ve.useEffect(()=>{p.delete&&(In(),p.onDismiss==null||p.onDismiss.call(p,p))},[In,p.delete]);function oa(){var Ze;if(X!=null&&X.loading){var Pt;return ve.createElement("div",{className:Gs(B==null?void 0:B.loader,p==null||(Pt=p.classNames)==null?void 0:Pt.loader,"sonner-loader"),"data-visible":Je==="loading"},X.loading)}return ve.createElement(zV,{className:Gs(B==null?void 0:B.loader,p==null||(Ze=p.classNames)==null?void 0:Ze.loader),visible:Je==="loading"})}const Zr=p.icon||(X==null?void 0:X[Je])||$V(Je);var Tr,gi;return ve.createElement("li",{tabIndex:0,ref:je,className:Gs(N,xn,B==null?void 0:B.toast,p==null||(e=p.classNames)==null?void 0:e.toast,B==null?void 0:B.default,B==null?void 0:B[Je],p==null||(n=p.classNames)==null?void 0:n[Je]),"data-sonner-toast":"","data-rich-colors":(Tr=p.richColors)!=null?Tr:A,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":re,"data-promise":!!p.promise,"data-swiped":Se,"data-removed":oe,"data-visible":lt,"data-y-position":Rn,"data-x-position":pi,"data-index":E,"data-front":Qe,"data-swiping":de,"data-dismissible":vt,"data-type":Je,"data-invert":Ds,"data-swipe-out":ae,"data-swipe-direction":D,"data-expanded":!!(P||K&&re),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":C.length-E,"--offset":`${oe?Ke:wn.current}px`,"--initial-height":K?"auto":`${Oe}px`,...M,...p.style},onDragEnd:()=>{ie(!1),H(null),Ns.current=null},onPointerDown:Ze=>{Ze.button!==2&&(ur||!vt||(mt.current=new Date,it(wn.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(ie(!0),Ns.current={x:Ze.clientX,y:Ze.clientY})))},onPointerUp:()=>{var Ze,Pt,nn;if(ae||!vt)return;Ns.current=null;const bn=Number(((Ze=je.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),js=Number(((Pt=je.current)==null?void 0:Pt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((nn=mt.current)==null?void 0:nn.getTime()),rn=ee==="x"?bn:js,ms=Math.abs(rn)/Ut;if(Math.abs(rn)>=o$||ms>.11){it(wn.current),p.onDismiss==null||p.onDismiss.call(p,p),q(ee==="x"?bn>0?"right":"left":js>0?"down":"up"),In(),me(!0);return}else{var fn,Jn;(fn=je.current)==null||fn.style.setProperty("--swipe-amount-x","0px"),(Jn=je.current)==null||Jn.style.setProperty("--swipe-amount-y","0px")}Re(!1),ie(!1),H(null)},onPointerMove:Ze=>{var Pt,nn,bn;if(!Ns.current||!vt||((Pt=window.getSelection())==null?void 0:Pt.toString().length)>0)return;const Ut=Ze.clientY-Ns.current.y,rn=Ze.clientX-Ns.current.x;var ms;const fn=(ms=t.swipeDirections)!=null?ms:l$(G);!ee&&(Math.abs(rn)>1||Math.abs(Ut)>1)&&H(Math.abs(rn)>Math.abs(Ut)?"x":"y");let Jn={x:0,y:0};const Fs=er=>1/(1.5+Math.abs(er)/20);if(ee==="y"){if(fn.includes("top")||fn.includes("bottom"))if(fn.includes("top")&&Ut<0||fn.includes("bottom")&&Ut>0)Jn.y=Ut;else{const er=Ut*Fs(Ut);Jn.y=Math.abs(er)<Math.abs(Ut)?er:Ut}}else if(ee==="x"&&(fn.includes("left")||fn.includes("right")))if(fn.includes("left")&&rn<0||fn.includes("right")&&rn>0)Jn.x=rn;else{const er=rn*Fs(rn);Jn.x=Math.abs(er)<Math.abs(rn)?er:rn}(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&Re(!0),(nn=je.current)==null||nn.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(bn=je.current)==null||bn.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},Xn&&!p.jsx&&Je!=="loading"?ve.createElement("button",{"aria-label":$,"data-disabled":ur,"data-close-button":!0,onClick:ur||!vt?()=>{}:()=>{In(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Gs(B==null?void 0:B.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(gi=X==null?void 0:X.close)!=null?gi:KV):null,(Je||p.icon||p.promise)&&p.icon!==null&&((X==null?void 0:X[Je])!==null||p.icon)?ve.createElement("div",{"data-icon":"",className:Gs(B==null?void 0:B.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||oa():null,p.type!=="loading"?Zr:null):null,ve.createElement("div",{"data-content":"",className:Gs(B==null?void 0:B.content,p==null||(i=p.classNames)==null?void 0:i.content)},ve.createElement("div",{"data-title":"",className:Gs(B==null?void 0:B.title,p==null||(a=p.classNames)==null?void 0:a.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?ve.createElement("div",{"data-description":"",className:Gs(j,zt,B==null?void 0:B.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ve.isValidElement(p.cancel)?p.cancel:p.cancel&&Bh(p.cancel)?ve.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Ze=>{Bh(p.cancel)&&vt&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Ze),In())},className:Gs(B==null?void 0:B.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,ve.isValidElement(p.action)?p.action:p.action&&Bh(p.action)?ve.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Ze=>{Bh(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Ze),!Ze.defaultPrevented&&In())},className:Gs(B==null?void 0:B.actionButton,p==null||(f=p.classNames)==null?void 0:f.actionButton)},p.action.label):null)};function sk(){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 c$(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?r$:n$;function c(f){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${a}-${f}`]=u:n[`${a}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):c(u)}),n}const d$=ve.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:f,offset:h,mobileOffset:p,theme:v="light",richColors:y,duration:x,style:_,visibleToasts:b=t$,toastOptions:E,dir:C=sk(),gap:P=i$,icons:T,containerAriaLabel:A="Notifications"}=e,[O,M]=ve.useState([]),R=ve.useMemo(()=>r?O.filter(re=>re.toasterId===r):O.filter(re=>!re.toasterId),[O,r]),L=ve.useMemo(()=>Array.from(new Set([i].concat(R.filter(re=>re.position).map(re=>re.position)))),[R,i]),[N,j]=ve.useState([]),[V,G]=ve.useState(!1),[Y,K]=ve.useState(!1),[B,X]=ve.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ve.useRef(null),ee=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ve.useRef(null),D=ve.useRef(!1),q=ve.useCallback(re=>{M(se=>{var oe;return(oe=se.find(ue=>ue.id===re.id))!=null&&oe.delete||yr.dismiss(re.id),se.filter(({id:ue})=>ue!==re.id)})},[]);return ve.useEffect(()=>yr.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{M(se=>se.map(oe=>oe.id===re.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{FV.flushSync(()=>{M(se=>{const oe=se.findIndex(ue=>ue.id===re.id);return oe!==-1?[...se.slice(0,oe),{...se[oe],...re},...se.slice(oe+1)]:[re,...se]})})})}),[O]),ve.useEffect(()=>{if(v!=="system"){X(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:se})=>{X(se?"dark":"light")})}catch{re.addListener(({matches:oe})=>{try{X(oe?"dark":"light")}catch(ue){console.error(ue)}})}},[v]),ve.useEffect(()=>{O.length<=1&&G(!1)},[O]),ve.useEffect(()=>{const re=se=>{var oe;if(a.every(ie=>se[ie]||se.code===ie)){var de;G(!0),(de=$.current)==null||de.focus()}se.code==="Escape"&&(document.activeElement===$.current||(oe=$.current)!=null&&oe.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[a]),ve.useEffect(()=>{if($.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,D.current=!1)}},[$.current]),ve.createElement("section",{ref:n,"aria-label":`${A} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((re,se)=>{var oe;const[ue,de]=re.split("-");return R.length?ve.createElement("ol",{key:re,dir:C==="auto"?sk():C,tabIndex:-1,ref:$,className:f,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":ue,"data-x-position":de,style:{"--front-toast-height":`${((oe=N[0])==null?void 0:oe.height)||0}px`,"--width":`${s$}px`,"--gap":`${P}px`,..._,...c$(h,p)},onBlur:ie=>{D.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(D.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||D.current||(D.current=!0,H.current=ie.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{Y||G(!1)},onDragEnd:()=>G(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},R.filter(ie=>!ie.position&&se===0||ie.position===re).map((ie,ae)=>{var me,Se;return ve.createElement(u$,{key:ie.id,icons:T,index:ae,toast:ie,defaultRichColors:y,duration:(me=E==null?void 0:E.duration)!=null?me:x,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:s,visibleToasts:b,closeButton:(Se=E==null?void 0:E.closeButton)!=null?Se:c,interacting:Y,position:re,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:q,toasts:R.filter(Re=>Re.position==ie.position),heights:N.filter(Re=>Re.position==ie.position),setHeights:j,expandByDefault:u,gap:P,expanded:V,swipeDirections:e.swipeDirections})})):null}))});function Et(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)}}function ik(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function f$(...t){return e=>{let n=!1;const r=t.map(s=>{const i=ik(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():ik(t[s],null)}}}}function Yt(...t){return g.useCallback(f$(...t),t)}function na(t,e=[]){let n=[];function r(i,a){const u=g.createContext(a);u.displayName=i+"Context";const c=n.length;n=[...n,a];const f=p=>{var E;const{scope:v,children:y,...x}=p,_=((E=v==null?void 0:v[t])==null?void 0:E[c])||u,b=g.useMemo(()=>x,Object.values(x));return S.jsx(_.Provider,{value:b,children:y})};f.displayName=i+"Provider";function h(p,v,y={}){var E;const{optional:x=!1}=y,_=((E=v==null?void 0:v[t])==null?void 0:E[c])||u,b=g.useContext(_);if(b)return b;if(a!==void 0)return a;if(!x)throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const s=()=>{const i=n.map(a=>g.createContext(a));return function(u){const c=(u==null?void 0:u[t])||i;return g.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])}};return s.scopeName=t,[r,h$(s,...e)]}function h$(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((u,{useScope:c,scopeName:f})=>{const p=c(i)[`__scope${f}`];return{...u,...p}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var ui=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},p$=B_[" useId ".trim().toString()]||(()=>{}),m$=0;function il(t){const[e,n]=g.useState(p$());return ui(()=>{n(r=>r??String(m$++))},[t]),e?`radix-${e}`:""}var g$=B_[" useInsertionEffect ".trim().toString()]||ui;function fl({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[s,i,a]=v$({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s;{const h=g.useRef(t!==void 0);g.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,r])}const f=g.useCallback(h=>{var p;if(u){const v=y$(h)?h(t):h;v!==t&&((p=a.current)==null||p.call(a,v))}else i(h)},[u,t,i,a]);return[c,f]}function v$({defaultProp:t,onChange:e}){const[n,r]=g.useState(t),s=g.useRef(n),i=g.useRef(e);return g$(()=>{i.current=e},[e]),g.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function y$(t){return typeof t=="function"}function Vd(t){const e=g.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];ok(s)&&typeof Wh=="function"&&(s=Wh(s._payload)),g.Children.forEach(s,v=>{var y;if(S$(v)){u=!0;const x=v;let _="child"in x.props?x.props.child:x.props.children;ok(_)&&typeof Wh=="function"&&(_=Wh(_._payload)),a=x$(x,_),c.push((y=a==null?void 0:a.props)==null?void 0:y.children)}else c.push(v)}),a?a=g.cloneElement(a,void 0,c):!u&&g.Children.count(s)===1&&g.isValidElement(s)&&(a=s);const f=a?b$(a):void 0,h=Yt(r,f);if(!a){if(s||s===0)throw new Error(u?P$(t):C$(t));return s}const p=w$(i,a.props??{});return a.type!==g.Fragment&&(p.ref=r?h:f),g.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}var D3=Symbol.for("radix.slottable");function _$(t){const e=n=>"child"in n?n.children(n.child):n.children;return e.displayName=`${t}.Slottable`,e.__radixId=D3,e}var x$=(t,e)=>{if("child"in t.props){const n=t.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,t.props.children(n.props.children)):null}return g.isValidElement(e)?e:null};function w$(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]=(...u)=>{const c=i(...u);return s(...u),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function b$(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)}function S$(t){return g.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===D3}var E$=Symbol.for("react.lazy");function ok(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===E$&&"_payload"in t&&k$(t._payload)}function k$(t){return typeof t=="object"&&t!==null&&"then"in t}var C$=t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,P$=t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Wh=B_[" use ".trim().toString()],T$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rt=T$.reduce((t,e)=>{const n=Vd(`Primitive.${e}`),r=g.forwardRef((s,i)=>{const{asChild:a,...u}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function A$(t,e){t&&qm.flushSync(()=>t.dispatchEvent(e))}function Du(t){const e=g.useRef(t);return g.useEffect(()=>{e.current=t}),g.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}var R$="DismissableLayer",i_="dismissableLayer.update",I$="dismissableLayer.pointerDownOutside",M$="dismissableLayer.focusOutside",ak,B2=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ym=g.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:u,onDismiss:c,...f}=t,h=g.useContext(B2),[p,v]=g.useState(null),y=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=g.useState({}),_=Yt(e,v),b=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=E?b.indexOf(E):-1,P=p?b.indexOf(p):-1,T=h.layersWithOutsidePointerEventsDisabled.size>0,A=P>=C,O=g.useRef(!1),M=j$(j=>{i==null||i(j),u==null||u(j),j.defaultPrevented||c==null||c()},{ownerDocument:y,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:g.useCallback(j=>{if(!(j instanceof Node))return!1;const V=[...h.branches].some(G=>G.contains(j));return A&&!V},[h.branches,A])}),R=F$(j=>{if(r&&O.current)return;const V=j.target;[...h.branches].some(Y=>Y.contains(V))||(a==null||a(j),u==null||u(j),j.defaultPrevented||c==null||c())},y),L=p?P===b.length-1:!1,N=Du(j=>{j.key==="Escape"&&(s==null||s(j),!j.defaultPrevented&&c&&(j.preventDefault(),c()))});return g.useEffect(()=>{if(L)return y.addEventListener("keydown",N,{capture:!0}),()=>y.removeEventListener("keydown",N,{capture:!0})},[y,L,N]),g.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(ak=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),lk(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(p),h.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=ak))}},[p,y,n,h]),g.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),lk())},[p,h]),g.useEffect(()=>{const j=()=>x({});return document.addEventListener(i_,j),()=>document.removeEventListener(i_,j)},[]),S.jsx(Rt.div,{...f,ref:_,style:{pointerEvents:T?A?"auto":"none":void 0,...t.style},onFocusCapture:Et(t.onFocusCapture,R.onFocusCapture),onBlurCapture:Et(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Et(t.onPointerDownCapture,M.onPointerDownCapture)})});Ym.displayName=R$;var L$="DismissableLayerBranch",O$=g.forwardRef((t,e)=>{const n=g.useContext(B2),r=g.useRef(null),s=Yt(e,r);return g.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),S.jsx(Rt.div,{...t,ref:s})});O$.displayName=L$;function N$(){const t=g.useContext(B2),[e,n]=g.useState(null);return g.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}var D$=()=>!0;function j$(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=D$}=e,u=Du(t),c=g.useRef(!1),f=g.useRef(!1),h=g.useRef(new Map),p=g.useRef(()=>{});return g.useEffect(()=>{function v(){f.current=!1,s.current=!1,h.current.clear()}function y(){return Array.from(h.current.values()).some(Boolean)}function x(P){if(!f.current)return;const T=P.target;T instanceof Node&&[...i].some(O=>O.contains(T))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}function _(P){f.current&&h.current.set(P.type,!1)}const b=P=>{if(P.target&&!c.current){let T=function(){n.removeEventListener("click",p.current);const O=y();v(),O||j3(I$,u,A,{discrete:!0})};if(!a(P.target)){n.removeEventListener("click",p.current),v(),c.current=!1;return}const A={originalEvent:P};f.current=!0,s.current=r&&P.button===0,h.current.clear(),!r||P.button!==0?T():(n.removeEventListener("click",p.current),p.current=T,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),v();c.current=!1},E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of E)n.addEventListener(P,x,!0),n.addEventListener(P,_);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",b),n.removeEventListener("click",p.current);for(const P of E)n.removeEventListener(P,x,!0),n.removeEventListener(P,_)}},[n,u,r,s,i,a]),{onPointerDownCapture:()=>c.current=!0}}function F$(t,e=globalThis==null?void 0:globalThis.document){const n=Du(t),r=g.useRef(!1);return g.useEffect(()=>{const s=i=>{i.target&&!r.current&&j3(M$,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function lk(){const t=new CustomEvent(i_);document.dispatchEvent(t)}function j3(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?A$(s,i):s.dispatchEvent(i)}var Qv="focusScope.autoFocusOnMount",Jv="focusScope.autoFocusOnUnmount",uk={bubbles:!1,cancelable:!0},V$="FocusScope",W2=g.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[u,c]=g.useState(null),f=Du(s),h=Du(i),p=g.useRef(null),v=Yt(e,c),y=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let _=function(P){if(y.paused||!u)return;const T=P.target;u.contains(T)?p.current=T:Po(p.current,{select:!0})},b=function(P){if(y.paused||!u)return;const T=P.relatedTarget;T!==null&&(u.contains(T)||Po(p.current,{select:!0}))},E=function(P){if(document.activeElement===document.body)for(const A of P)A.removedNodes.length>0&&Po(u)};document.addEventListener("focusin",_),document.addEventListener("focusout",b);const C=new MutationObserver(E);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",b),C.disconnect()}}},[r,u,y.paused]),g.useEffect(()=>{if(u){dk.add(y);const _=document.activeElement;if(!u.contains(_)){const E=new CustomEvent(Qv,uk);u.addEventListener(Qv,f),u.dispatchEvent(E),E.defaultPrevented||($$(W$(F3(u)),{select:!0}),document.activeElement===_&&Po(u))}return()=>{u.removeEventListener(Qv,f),setTimeout(()=>{const E=new CustomEvent(Jv,uk);u.addEventListener(Jv,h),u.dispatchEvent(E),E.defaultPrevented||Po(_??document.body,{select:!0}),u.removeEventListener(Jv,h),dk.remove(y)},0)}}},[u,f,h,y]);const x=g.useCallback(_=>{if(!n&&!r||y.paused)return;const b=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,E=document.activeElement;if(b&&E){const C=_.currentTarget,[P,T]=H$(C);P&&T?!_.shiftKey&&E===T?(_.preventDefault(),n&&Po(P,{select:!0})):_.shiftKey&&E===P&&(_.preventDefault(),n&&Po(T,{select:!0})):E===C&&_.preventDefault()}},[n,r,y.paused]);return S.jsx(Rt.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});W2.displayName=V$;function $$(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Po(r,{select:e}),document.activeElement!==n)return}function H$(t){const e=F3(t),n=ck(e,t),r=ck(e.reverse(),t);return[n,r]}function F3(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)e.push(n.currentNode);return e}function ck(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):z$(r,{upTo:e})))return r}function z$(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}function U$(t){return t instanceof HTMLInputElement&&"select"in t}function Po(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&U$(t)&&e&&t.select()}}var dk=B$();function B$(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=fk(t,e),t.unshift(e)},remove(e){var n;t=fk(t,e),(n=t[0])==null||n.resume()}}}function fk(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function W$(t){return t.filter(e=>e.tagName!=="A")}var G$="Portal",Xm=g.forwardRef((t,e)=>{var u;const{container:n,...r}=t,[s,i]=g.useState(!1);ui(()=>i(!0),[]);const a=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?qm.createPortal(S.jsx(Rt.div,{...r,ref:e}),a):null});Xm.displayName=G$;function K$(t,e){return g.useReducer((n,r)=>e[n][r]??n,t)}var Qi=t=>{const{present:e,children:n}=t,r=Z$(e),s=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),i=q$(r.ref,Y$(s));return typeof n=="function"||r.isPresent?g.cloneElement(s,{ref:i}):null};Qi.displayName="Presence";function Z$(t){const[e,n]=g.useState(),r=g.useRef(null),s=g.useRef(t),i=g.useRef("none"),a=g.useRef(void 0),u=t?"mounted":"unmounted",[c,f]=K$(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(i.current=a.current??qc(r.current),a.current=void 0):i.current="none"},[c]),ui(()=>{const h=r.current,p=s.current;if(p!==t){const y=i.current,x=qc(h);t?(a.current=x,f("MOUNT")):x==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&y!==x?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,f]),ui(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,v=x=>{const b=qc(r.current).includes(CSS.escape(x.animationName));if(x.target===e&&b&&(f("ANIMATION_END"),!s.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},y=x=>{x.target===e&&(i.current=qc(r.current))};return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[e,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=qc(p)}else r.current=null;n(h)},[])}}function hk(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function q$(...t){const e=g.useRef(t);return e.current=t,g.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const u=hk(a,n);return!s&&typeof u=="function"&&(s=!0),u});if(s)return()=>{for(let a=0;a<i.length;a++){const u=i[a];typeof u=="function"?u():hk(r[a],null)}}},[])}function qc(t){return(t==null?void 0:t.animationName)||"none"}function Y$(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)}var Gh=0,Ks=null;function V3(){g.useEffect(()=>{Ks||(Ks={start:pk(),end:pk()});const{start:t,end:e}=Ks;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Gh++,()=>{Gh===1&&(Ks==null||Ks.start.remove(),Ks==null||Ks.end.remove(),Ks=null),Gh=Math.max(0,Gh-1)}},[])}function pk(){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}var ni=function(){return ni=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},ni.apply(this,arguments)};function $3(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 X$(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 wp="right-scroll-bar-position",bp="width-before-scroll-bar",Q$="with-scroll-bars-hidden",J$="--removed-body-scroll-bar-size";function e1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function eH(t,e){var n=g.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 tH=typeof window<"u"?g.useLayoutEffect:g.useEffect,mk=new WeakMap;function nH(t,e){var n=eH(null,function(r){return t.forEach(function(s){return e1(s,r)})});return tH(function(){var r=mk.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||e1(u,null)}),i.forEach(function(u){s.has(u)||e1(u,a)})}mk.set(n,t)},[t]),n}function rH(t){return t}function sH(t,e){e===void 0&&(e=rH);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 a=e(i,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(i),a=n}var c=function(){var h=a;a=[],h.forEach(i)},f=function(){return Promise.resolve().then(c)};f(),n={push:function(h){a.push(h),f()},filter:function(h){return a=a.filter(h),n}}}};return s}function iH(t){t===void 0&&(t={});var e=sH(null);return e.options=ni({async:!0,ssr:!1},t),e}var H3=function(t){var e=t.sideCar,n=$3(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 g.createElement(r,ni({},n))};H3.isSideCarExport=!0;function oH(t,e){return t.useMedium(e),H3}var z3=iH(),t1=function(){},Qm=g.forwardRef(function(t,e){var n=g.useRef(null),r=g.useState({onScrollCapture:t1,onWheelCapture:t1,onTouchMoveCapture:t1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,f=t.removeScrollBar,h=t.enabled,p=t.shards,v=t.sideCar,y=t.noRelative,x=t.noIsolation,_=t.inert,b=t.allowPinchZoom,E=t.as,C=E===void 0?"div":E,P=t.gapMode,T=$3(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,O=nH([n,e]),M=ni(ni({},T),s);return g.createElement(g.Fragment,null,h&&g.createElement(A,{sideCar:z3,removeScrollBar:f,shards:p,noRelative:y,noIsolation:x,inert:_,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:P}),a?g.cloneElement(g.Children.only(u),ni(ni({},M),{ref:O})):g.createElement(C,ni({},M,{className:c,ref:O}),u))});Qm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qm.classNames={fullWidth:bp,zeroRight:wp};var aH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lH(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=aH();return e&&t.setAttribute("nonce",e),t}function uH(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function cH(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var dH=function(){var t=0,e=null;return{add:function(n){t==0&&(e=lH())&&(uH(e,n),cH(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},fH=function(){var t=dH();return function(e,n){g.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},U3=function(){var t=fH(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},hH={left:0,top:0,right:0,gap:0},n1=function(t){return parseInt(t||"",10)||0},pH=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[n1(n),n1(r),n1(s)]},mH=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return hH;var e=pH(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])}},gH=U3(),lu="data-scroll-locked",vH=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
71
- .`.concat(Q$,` {
72
- overflow: hidden `).concat(r,`;
73
- padding-right: `).concat(u,"px ").concat(r,`;
74
- }
75
- body[`).concat(lu,`] {
76
- overflow: hidden `).concat(r,`;
77
- overscroll-behavior: contain;
78
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
79
- padding-left: `.concat(s,`px;
80
- padding-top: `).concat(i,`px;
81
- padding-right: `).concat(a,`px;
82
- margin-left:0;
83
- margin-top:0;
84
- margin-right: `).concat(u,"px ").concat(r,`;
85
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
86
- }
87
-
88
- .`).concat(wp,` {
89
- right: `).concat(u,"px ").concat(r,`;
90
- }
91
-
92
- .`).concat(bp,` {
93
- margin-right: `).concat(u,"px ").concat(r,`;
94
- }
95
-
96
- .`).concat(wp," .").concat(wp,` {
97
- right: 0 `).concat(r,`;
98
- }
99
-
100
- .`).concat(bp," .").concat(bp,` {
101
- margin-right: 0 `).concat(r,`;
102
- }
103
-
104
- body[`).concat(lu,`] {
105
- `).concat(J$,": ").concat(u,`px;
106
- }
107
- `)},gk=function(){var t=parseInt(document.body.getAttribute(lu)||"0",10);return isFinite(t)?t:0},yH=function(){g.useEffect(function(){return document.body.setAttribute(lu,(gk()+1).toString()),function(){var t=gk()-1;t<=0?document.body.removeAttribute(lu):document.body.setAttribute(lu,t.toString())}},[])},_H=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;yH();var i=g.useMemo(function(){return mH(s)},[s]);return g.createElement(gH,{styles:vH(i,!e,s,n?"":"!important")})},o_=!1;if(typeof window<"u")try{var Kh=Object.defineProperty({},"passive",{get:function(){return o_=!0,!0}});window.addEventListener("test",Kh,Kh),window.removeEventListener("test",Kh,Kh)}catch{o_=!1}var Bl=o_?{passive:!1}:!1,xH=function(t){return t.tagName==="TEXTAREA"},B3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!xH(t)&&n[e]==="visible")},wH=function(t){return B3(t,"overflowY")},bH=function(t){return B3(t,"overflowX")},vk=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=W3(t,r);if(s){var i=G3(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},SH=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},EH=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},W3=function(t,e){return t==="v"?wH(e):bH(e)},G3=function(t,e){return t==="v"?SH(e):EH(e)},kH=function(t,e){return t==="h"&&e==="rtl"?-1:1},CH=function(t,e,n,r,s){var i=kH(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),f=!1,h=a>0,p=0,v=0;do{if(!u)break;var y=G3(t,u),x=y[0],_=y[1],b=y[2],E=_-b-i*x;(x||E)&&W3(t,u)&&(p+=E,v+=x);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(h&&Math.abs(p)<1||!h&&Math.abs(v)<1)&&(f=!0),f},Zh=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},yk=function(t){return[t.deltaX,t.deltaY]},_k=function(t){return t&&"current"in t?t.current:t},PH=function(t,e){return t[0]===e[0]&&t[1]===e[1]},TH=function(t){return`
108
- .block-interactivity-`.concat(t,` {pointer-events: none;}
109
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
110
- `)},AH=0,Wl=[];function RH(t){var e=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),s=g.useState(AH++)[0],i=g.useState(U3)[0],a=g.useRef(t);g.useEffect(function(){a.current=t},[t]),g.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=X$([t.lockRef.current],(t.shards||[]).map(_k),!0).filter(Boolean);return _.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=g.useCallback(function(_,b){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var E=Zh(_),C=n.current,P="deltaX"in _?_.deltaX:C[0]-E[0],T="deltaY"in _?_.deltaY:C[1]-E[1],A,O=_.target,M=Math.abs(P)>Math.abs(T)?"h":"v";if("touches"in _&&M==="h"&&O.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,N=L?L===O||L.contains(O):!1;if(N)return!1;var j=vk(M,O);if(!j)return!0;if(j?A=M:(A=M==="v"?"h":"v",j=vk(M,O)),!j)return!1;if(!r.current&&"changedTouches"in _&&(P||T)&&(r.current=A),!A)return!0;var V=r.current||A;return CH(V,b,_,V==="h"?P:T)},[]),c=g.useCallback(function(_){var b=_;if(!(!Wl.length||Wl[Wl.length-1]!==i)){var E="deltaY"in b?yk(b):Zh(b),C=e.current.filter(function(A){return A.name===b.type&&(A.target===b.target||b.target===A.shadowParent)&&PH(A.delta,E)})[0];if(C&&C.should){b.cancelable&&b.preventDefault();return}if(!C){var P=(a.current.shards||[]).map(_k).filter(Boolean).filter(function(A){return A.contains(b.target)}),T=P.length>0?u(b,P[0]):!a.current.noIsolation;T&&b.cancelable&&b.preventDefault()}}},[]),f=g.useCallback(function(_,b,E,C){var P={name:_,delta:b,target:E,should:C,shadowParent:IH(E)};e.current.push(P),setTimeout(function(){e.current=e.current.filter(function(T){return T!==P})},1)},[]),h=g.useCallback(function(_){n.current=Zh(_),r.current=void 0},[]),p=g.useCallback(function(_){f(_.type,yk(_),_.target,u(_,t.lockRef.current))},[]),v=g.useCallback(function(_){f(_.type,Zh(_),_.target,u(_,t.lockRef.current))},[]);g.useEffect(function(){return Wl.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Bl),document.addEventListener("touchmove",c,Bl),document.addEventListener("touchstart",h,Bl),function(){Wl=Wl.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,Bl),document.removeEventListener("touchmove",c,Bl),document.removeEventListener("touchstart",h,Bl)}},[]);var y=t.removeScrollBar,x=t.inert;return g.createElement(g.Fragment,null,x?g.createElement(i,{styles:TH(s)}):null,y?g.createElement(_H,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function IH(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const MH=oH(z3,RH);var G2=g.forwardRef(function(t,e){return g.createElement(Qm,ni({},t,{ref:e,sideCar:MH}))});G2.classNames=Qm.classNames;var LH=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Gl=new WeakMap,qh=new WeakMap,Yh={},r1=0,K3=function(t){return t&&(t.host||K3(t.parentNode))},OH=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=K3(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})},NH=function(t,e,n,r){var s=OH(e,Array.isArray(t)?t:[t]);Yh[n]||(Yh[n]=new WeakMap);var i=Yh[n],a=[],u=new Set,c=new Set(s),f=function(p){!p||u.has(p)||(u.add(p),f(p.parentNode))};s.forEach(f);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))h(v);else try{var y=v.getAttribute(r),x=y!==null&&y!=="false",_=(Gl.get(v)||0)+1,b=(i.get(v)||0)+1;Gl.set(v,_),i.set(v,b),a.push(v),_===1&&x&&qh.set(v,!0),b===1&&v.setAttribute(n,"true"),x||v.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",v,E)}})};return h(e),u.clear(),r1++,function(){a.forEach(function(p){var v=Gl.get(p)-1,y=i.get(p)-1;Gl.set(p,v),i.set(p,y),v||(qh.has(p)||p.removeAttribute(r),qh.delete(p)),y||p.removeAttribute(n)}),r1--,r1||(Gl=new WeakMap,Gl=new WeakMap,qh=new WeakMap,Yh={})}},Z3=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=LH(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),NH(r,s,n,"aria-hidden")):function(){return null}},Jm="Dialog",[q3]=na(Jm),[DH,Ms]=q3(Jm),e0=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=g.useRef(null),c=g.useRef(null),[f,h]=fl({prop:r,defaultProp:s??!1,onChange:i,caller:Jm});return S.jsx(DH,{scope:e,triggerRef:u,contentRef:c,contentId:il(),titleId:il(),descriptionId:il(),open:f,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),modal:a,children:n})};e0.displayName=Jm;var Y3="DialogTrigger",jH=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ms(Y3,n),i=Yt(e,s.triggerRef);return S.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Z2(s.open),...r,ref:i,onClick:Et(t.onClick,s.onOpenToggle)})});jH.displayName=Y3;var K2="DialogPortal",[FH,X3]=q3(K2,{forceMount:void 0}),t0=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Ms(K2,e);return S.jsx(FH,{scope:e,forceMount:n,children:g.Children.map(r,a=>S.jsx(Qi,{present:n||i.open,children:S.jsx(Xm,{asChild:!0,container:s,children:a})}))})};t0.displayName=K2;var xm="DialogOverlay",n0=g.forwardRef((t,e)=>{const n=X3(xm,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ms(xm,t.__scopeDialog);return i.modal?S.jsx(Qi,{present:r||i.open,children:S.jsx($H,{...s,ref:e})}):null});n0.displayName=xm;var VH=Vd("DialogOverlay.RemoveScroll"),$H=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ms(xm,n),i=N$(),a=Yt(e,i);return S.jsx(G2,{as:VH,allowPinchZoom:!0,shards:[s.contentRef],children:S.jsx(Rt.div,{"data-state":Z2(s.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),ju="DialogContent",r0=g.forwardRef((t,e)=>{const n=X3(ju,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Ms(ju,t.__scopeDialog);return S.jsx(Qi,{present:r||i.open,children:i.modal?S.jsx(HH,{...s,ref:e}):S.jsx(zH,{...s,ref:e})})});r0.displayName=ju;var HH=g.forwardRef((t,e)=>{const n=Ms(ju,t.__scopeDialog),r=g.useRef(null),s=Yt(e,n.contentRef,r);return g.useEffect(()=>{const i=r.current;if(i)return Z3(i)},[]),S.jsx(Q3,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Et(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Et(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&i.preventDefault()}),onFocusOutside:Et(t.onFocusOutside,i=>i.preventDefault())})}),zH=g.forwardRef((t,e)=>{const n=Ms(ju,t.__scopeDialog),r=g.useRef(!1),s=g.useRef(!1);return S.jsx(Q3,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,f;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),Q3=g.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,u=Ms(ju,n);return V3(),S.jsx(S.Fragment,{children:S.jsx(W2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:S.jsx(Ym,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Z2(u.open),...a,ref:e,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})}),J3="DialogTitle",s0=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ms(J3,n);return S.jsx(Rt.h2,{id:s.titleId,...r,ref:e})});s0.displayName=J3;var eT="DialogDescription",i0=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ms(eT,n);return S.jsx(Rt.p,{id:s.descriptionId,...r,ref:e})});i0.displayName=eT;var tT="DialogClose",UH=g.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Ms(tT,n);return S.jsx(Rt.button,{type:"button",...r,ref:e,onClick:Et(t.onClick,()=>s.onOpenChange(!1))})});UH.displayName=tT;function Z2(t){return t?"open":"closed"}const BH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),WH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),GH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),KH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),ZH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),qH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),YH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),XH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),QH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),JH=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),ez=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),tz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),nz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),rz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),sz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),iz=new Map([["bold",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}),g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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",g.createElement(g.Fragment,null,g.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"}))]]),oz=g.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),zn=g.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...f}=t,{color:h="currentColor",size:p,weight:v="regular",mirrored:y=!1,...x}=g.useContext(oz);return g.createElement("svg",{ref:e,xmlns:"http://www.w3.org/2000/svg",width:s??p,height:s??p,fill:r??h,viewBox:"0 0 256 256",transform:a||y?"scale(-1, 1)":void 0,...x,...f},!!n&&g.createElement("title",null,n),u,c.get(i??v))});zn.displayName="IconBase";const nT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:BH}));nT.displayName="ArrowLeftIcon";const az=nT,rT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:WH}));rT.displayName="ArrowSquareOutIcon";const lz=rT,sT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:GH}));sT.displayName="ArrowUpIcon";const uz=sT,iT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:KH}));iT.displayName="CaretDownIcon";const cz=iT,oT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:ZH}));oT.displayName="ChatCircleIcon";const dz=oT,aT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:qH}));aT.displayName="CheckIcon";const lT=aT,uT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:YH}));uT.displayName="CircleNotchIcon";const o0=uT,cT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:XH}));cT.displayName="CopyIcon";const $d=cT,dT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:QH}));dT.displayName="MagnifyingGlassIcon";const fz=dT,fT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:JH}));fT.displayName="PencilSimpleIcon";const hz=fT,hT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:ez}));hT.displayName="SidebarSimpleIcon";const pz=hT,pT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:tz}));pT.displayName="SignOutIcon";const mz=pT,mT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:nz}));mT.displayName="SparkleIcon";const s1=mT,gT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:rz}));gT.displayName="SwatchesIcon";const vT=gT,yT=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:sz}));yT.displayName="TrashIcon";const gz=yT,_T=g.forwardRef((t,e)=>g.createElement(zn,{ref:e,...t,weights:iz}));_T.displayName="XIcon";const xT=_T;function wT(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=wT(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function vz(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=wT(t))&&(r&&(r+=" "),r+=e);return r}const yz=(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},_z=(t,e)=>({classGroupId:t,validator:e}),bT=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),wm="-",xk=[],xz="arbitrary..",wz=t=>{const e=Sz(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return bz(a);const u=a.split(wm),c=u[0]===""&&u.length>1?1:0;return ST(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],f=n[a];return c?f?yz(f,c):c:f||xk}return n[a]||xk}}},ST=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const f=ST(t,e+1,i);if(f)return f}const a=n.validators;if(a===null)return;const u=e===0?t.join(wm):t.slice(e).join(wm),c=a.length;for(let f=0;f<c;f++){const h=a[f];if(h.validator(u))return h.classGroupId}},bz=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?xz+r:void 0})(),Sz=t=>{const{theme:e,classGroups:n}=t;return Ez(n,e)},Ez=(t,e)=>{const n=bT();for(const r in t){const s=t[r];q2(s,n,r,e)}return n},q2=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];kz(a,e,n,r)}},kz=(t,e,n,r)=>{if(typeof t=="string"){Cz(t,e,n);return}if(typeof t=="function"){Pz(t,e,n,r);return}Tz(t,e,n,r)},Cz=(t,e,n)=>{const r=t===""?e:ET(e,t);r.classGroupId=n},Pz=(t,e,n,r)=>{if(Az(t)){q2(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(_z(n,t))},Tz=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];q2(c,ET(e,u),n,r)}},ET=(t,e)=>{let n=t;const r=e.split(wm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=bT(),n.nextPart.set(a,u)),n=u}return n},Az=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Rz=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const s=(i,a)=>{n[i]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(i){let a=n[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in n?n[i]=a:s(i,a)}}},a_="!",wk=":",Iz=[],bk=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),Mz=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,f;const h=s.length;for(let _=0;_<h;_++){const b=s[_];if(a===0&&u===0){if(b===wk){i.push(s.slice(c,_)),c=_+1;continue}if(b==="/"){f=_;continue}}b==="["?a++:b==="]"?a--:b==="("?u++:b===")"&&u--}const p=i.length===0?s:s.slice(c);let v=p,y=!1;p.endsWith(a_)?(v=p.slice(0,-1),y=!0):p.startsWith(a_)&&(v=p.slice(1),y=!0);const x=f&&f>c?f-c:void 0;return bk(i,y,v,x)};if(e){const s=e+wk,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):bk(Iz,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},Lz=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 a=n[i],u=a[0]==="[",c=e.has(a);u||c?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},Oz=t=>({cache:Rz(t.cacheSize),parseClassName:Mz(t),sortModifiers:Lz(t),postfixLookupClassGroupIds:Nz(t),...wz(t)}),Nz=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},Dz=/\s+/,jz=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split(Dz);let f="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:v,modifiers:y,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:b}=n(p);if(v){f=p+(f.length>0?" "+f:f);continue}let E=!!b,C;if(E){const M=_.substring(0,b);C=r(M);const R=C&&a[C]?r(_):void 0;R&&R!==C&&(C=R,E=!1)}else C=r(_);if(!C){if(!E){f=p+(f.length>0?" "+f:f);continue}if(C=r(_),!C){f=p+(f.length>0?" "+f:f);continue}E=!1}const P=y.length===0?"":y.length===1?y[0]:i(y).join(":"),T=x?P+a_:P,A=T+C;if(u.indexOf(A)>-1)continue;u.push(A);const O=s(C,E);for(let M=0;M<O.length;++M){const R=O[M];u.push(T+R)}f=p+(f.length>0?" "+f:f)}return f},Fz=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=kT(n))&&(s&&(s+=" "),s+=r);return s},kT=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=kT(t[r]))&&(n&&(n+=" "),n+=e);return n},Vz=(t,...e)=>{let n,r,s,i;const a=c=>{const f=e.reduce((h,p)=>p(h),t());return n=Oz(f),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const f=r(c);if(f)return f;const h=jz(c,n);return s(c,h),h};return i=a,(...c)=>i(Fz(...c))},$z=[],gn=t=>{const e=n=>n[t]||$z;return e.isThemeGetter=!0,e},CT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,PT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Hz=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zz=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Uz=/\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$/,Bz=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Wz=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Gz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,So=t=>Hz.test(t),nt=t=>!!t&&!Number.isNaN(Number(t)),Zs=t=>!!t&&Number.isInteger(Number(t)),i1=t=>t.endsWith("%")&&nt(t.slice(0,-1)),Ai=t=>zz.test(t),TT=()=>!0,Kz=t=>Uz.test(t)&&!Bz.test(t),Y2=()=>!1,Zz=t=>Wz.test(t),qz=t=>Gz.test(t),Yz=t=>!Ie(t)&&!Le(t),Xz=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)),Qz=t=>ra(t,IT,Y2),Ie=t=>CT.test(t),Ta=t=>ra(t,MT,Kz),Sk=t=>ra(t,oU,nt),Jz=t=>ra(t,OT,TT),eU=t=>ra(t,LT,Y2),Ek=t=>ra(t,AT,Y2),tU=t=>ra(t,RT,qz),Xh=t=>ra(t,NT,Zz),Le=t=>PT.test(t),Yc=t=>hl(t,MT),nU=t=>hl(t,LT),kk=t=>hl(t,AT),rU=t=>hl(t,IT),sU=t=>hl(t,RT),Qh=t=>hl(t,NT,!0),iU=t=>hl(t,OT,!0),ra=(t,e,n)=>{const r=CT.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},hl=(t,e,n=!1)=>{const r=PT.exec(t);return r?r[1]?e(r[1]):n:!1},AT=t=>t==="position"||t==="percentage",RT=t=>t==="image"||t==="url",IT=t=>t==="length"||t==="size"||t==="bg-size",MT=t=>t==="length",oU=t=>t==="number",LT=t=>t==="family-name",OT=t=>t==="number"||t==="weight",NT=t=>t==="shadow",aU=()=>{const t=gn("color"),e=gn("font"),n=gn("text"),r=gn("font-weight"),s=gn("tracking"),i=gn("leading"),a=gn("breakpoint"),u=gn("container"),c=gn("spacing"),f=gn("radius"),h=gn("shadow"),p=gn("inset-shadow"),v=gn("text-shadow"),y=gn("drop-shadow"),x=gn("blur"),_=gn("perspective"),b=gn("aspect"),E=gn("ease"),C=gn("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...T(),Le,Ie],O=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],R=()=>[Le,Ie,c],L=()=>[So,"full","auto",...R()],N=()=>[Zs,"none","subgrid",Le,Ie],j=()=>["auto",{span:["full",Zs,Le,Ie]},Zs,Le,Ie],V=()=>[Zs,"auto",Le,Ie],G=()=>["auto","min","max","fr",Le,Ie],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...R()],X=()=>[So,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],$=()=>[So,"screen","full","dvw","lvw","svw","min","max","fit",...R()],ee=()=>[So,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],H=()=>[t,Le,Ie],D=()=>[...T(),kk,Ek,{position:[Le,Ie]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",rU,Qz,{size:[Le,Ie]}],se=()=>[i1,Yc,Ta],oe=()=>["","none","full",f,Le,Ie],ue=()=>["",nt,Yc,Ta],de=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[nt,i1,kk,Ek],me=()=>["","none",x,Le,Ie],Se=()=>["none",nt,Le,Ie],Re=()=>["none",nt,Le,Ie],Ke=()=>[nt,Le,Ie],it=()=>[So,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ai],breakpoint:[Ai],color:[TT],container:[Ai],"drop-shadow":[Ai],ease:["in","out","in-out"],font:[Yz],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ai],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ai],shadow:[Ai],spacing:["px",nt],text:[Ai],"text-shadow":[Ai],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",So,Ie,Le,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Le,Ie]}],"container-named":[Xz],columns:[{columns:[nt,Ie,Le,u]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],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:[Zs,"auto",Le,Ie]}],basis:[{basis:[So,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nt,So,"auto","initial","none",Ie]}],grow:[{grow:["",nt,Le,Ie]}],shrink:[{shrink:["",nt,Le,Ie]}],order:[{order:[Zs,"first","last","none",Le,Ie]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[u,"screen",...X()]}],"min-w":[{"min-w":[u,"screen","none",...X()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,Yc,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,iU,Jz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",i1,Ie]}],"font-family":[{font:[nU,eU,e]}],"font-features":[{"font-features":[Ie]}],"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,Le,Ie]}],"line-clamp":[{"line-clamp":[nt,"none",Le,Sk]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",Le,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[nt,"from-font","auto",Le,Ta]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[nt,"auto",Le,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[Zs,Le,Ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Ie]}],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",Le,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zs,Le,Ie],radial:["",Le,Ie],conic:[Zs,Le,Ie]},sU,tU]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],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:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nt,Le,Ie]}],"outline-w":[{outline:["",nt,Yc,Ta]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,Qh,Xh]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,Qh,Xh]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[nt,Ta]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",v,Qh,Xh]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[nt,Le,Ie]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[nt]}],"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":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"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":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"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":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"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":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"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":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"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":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"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":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Le,Ie]}],"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":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[nt]}],"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":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Ie]}],filter:[{filter:["","none",Le,Ie]}],blur:[{blur:me()}],brightness:[{brightness:[nt,Le,Ie]}],contrast:[{contrast:[nt,Le,Ie]}],"drop-shadow":[{"drop-shadow":["","none",y,Qh,Xh]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",nt,Le,Ie]}],"hue-rotate":[{"hue-rotate":[nt,Le,Ie]}],invert:[{invert:["",nt,Le,Ie]}],saturate:[{saturate:[nt,Le,Ie]}],sepia:[{sepia:["",nt,Le,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Ie]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[nt,Le,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[nt,Le,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nt,Le,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nt,Le,Ie]}],"backdrop-invert":[{"backdrop-invert":["",nt,Le,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[nt,Le,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[nt,Le,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",nt,Le,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nt,"initial",Le,Ie]}],ease:[{ease:["linear","initial",E,Le,Ie]}],delay:[{delay:[nt,Le,Ie]}],animate:[{animate:["none",C,Le,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Le,Ie]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:Ke()}],"skew-x":[{"skew-x":Ke()}],"skew-y":[{"skew-y":Ke()}],transform:[{transform:[Le,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:it()}],"translate-x":[{"translate-x":it()}],"translate-y":[{"translate-y":it()}],"translate-z":[{"translate-z":it()}],"translate-none":["translate-none"],zoom:[{zoom:[Zs,Le,Ie]}],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",Le,Ie]}],"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":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Le,Ie]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[nt,Yc,Ta,Sk]}],stroke:[{stroke:["none",...H()]}],"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":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},lU=Vz(aU);function lr(...t){return lU(vz(t))}const Hd={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},Ck=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function DT(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=Ck[Math.abs(e)%Ck.length];return{color:n,backgroundColor:`${n}22`}}function jT(t,e={}){const{axis:n="y"}=e,r=g.useRef(new Map),[s,i]=g.useState(null),[a,u]=g.useState([]),c=g.useRef([]),f=g.useRef(0),h=g.useRef(null),p=g.useRef(null),v=g.useCallback(()=>{if(!t.current)return;const C=[];r.current.forEach((P,T)=>{C[T]={top:P.offsetTop,height:P.offsetHeight,left:P.offsetLeft,width:P.offsetWidth}}),c.current=C,u(C)},[t]),y=g.useCallback((E,C)=>{C?r.current.set(E,C):r.current.delete(E),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,v()})},[v]),x=g.useCallback(E=>{const C=E.clientX,P=E.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const T=t.current;if(!T)return;const A=T.getBoundingClientRect(),O=n==="x"?C:P;let M=null,R=1/0,L=null;const N=c.current,j=n==="x"?T.scrollLeft:T.scrollTop,V=n==="x"?T.clientLeft:T.clientTop,G=n==="x"?A.left:A.top,Y=n==="x"?T.offsetWidth:T.offsetHeight,K=n==="x"?A.width:A.height,B=Y>0?K/Y:1;for(let X=0;X<N.length;X++){const $=N[X];if(!$)continue;const ee=n==="x"?$.left:$.top,H=G+(V+ee-j)*B,D=(n==="x"?$.width:$.height)*B,q=H+D;O>=H&&O<=q&&(L=X);const re=H+D/2,se=Math.abs(O-re);se<R&&(R=se,M=X)}i(L??M)})},[n,t]),_=g.useCallback(()=>{f.current+=1,v()},[v]),b=g.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return g.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:f,handlers:{onMouseMove:x,onMouseEnter:_,onMouseLeave:b},registerItem:y,measureItems:v}}function uU(t,e,n){g.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const FT=(t,e)=>`style:${t}:${e}`,VT=t=>`text:${t}`,$T=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"]},HT=t=>$T(t)[0],Jh=(t,e)=>$T(t).includes(e),cU=t=>{const e=HT(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${FT(e,t.property)}${n}`:`${VT(e)}${n}`},Nn=[];for(let t=0;t<256;++t)Nn.push((t+256).toString(16).slice(1));function dU(t,e=0){return(Nn[t[e+0]]+Nn[t[e+1]]+Nn[t[e+2]]+Nn[t[e+3]]+"-"+Nn[t[e+4]]+Nn[t[e+5]]+"-"+Nn[t[e+6]]+Nn[t[e+7]]+"-"+Nn[t[e+8]]+Nn[t[e+9]]+"-"+Nn[t[e+10]]+Nn[t[e+11]]+Nn[t[e+12]]+Nn[t[e+13]]+Nn[t[e+14]]+Nn[t[e+15]]).toLowerCase()}const fU=new Uint8Array(16);function hU(){return crypto.getRandomValues(fU)}function Pk(t,e,n){return crypto.randomUUID?crypto.randomUUID():pU(t)}function pU(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??hU();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,dU(r)}const mU=300;class gU{constructor(){bo(this,"history",{current:new Map,past:[],future:[]});bo(this,"pendingChanges",new Map);bo(this,"currentBatchId",null);bo(this,"debounceTimer",null);bo(this,"onChangeCallbacks",[]);bo(this,"stateBeforePending",null);bo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=Pk(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=HT(e.elementId),r=e.type==="style"?FT(n,e.property):VT(n),s=Array.from(this.history.current.entries()).find(([a])=>a===r||a.startsWith(`${r}:`));if(s){const a=s[1];e.type==="style"&&a.type==="style"?e.oldValue=a.oldValue:e.type==="text"&&a.type==="text"&&(e.oldText=a.oldText)}const i=cU(e);this.history.current.set(i,e),this.pendingChanges.set(i,e),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.commitPending()},mU),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(){if(this.pendingChanges.size>0&&this.commitPending(),this.history.past.length===0)return null;const e=new Map(this.history.current);this.history.future.push(e),this.history.current=this.history.past.pop(),this.notifyChange();const n=[];for(const[r,s]of e)this.history.current.has(r)||n.push(s);return n}redo(){if(this.history.future.length===0)return null;const e=new Map(this.history.current);this.history.past.push(e),this.history.current=this.history.future.pop(),this.notifyChange();const n=[];for(const[r,s]of this.history.current)e.has(r)||n.push(s);return n}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"&&Jh(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"&&Jh(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>Jh(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>Jh(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=Pk(),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 bm={kind:"base"};function zd(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function vU(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const yU={resize:{default:!1},variants:{default:!1},designSystemEditor:{default:!1},branchDiff:{default:!1},gitUi:{default:!0},createProject:{default:!1},desktopForceUpgrade:{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}},zT=Object.fromEntries(Object.entries(yU).map(([t,e])=>[t,{isEnabled:e.default}]));et("view");const UT=et(!0),BT=et(null),_U=et("chat"),WT=et(0),GT=et({name:null,email:null}),Tk=et(bm);et(null);const Ud=new Map,xU=t=>{const e=zd(t);let n=Ud.get(e);return n||(n=new gU,Ud.set(e,n)),n};et(t=>xU(t(Tk)),(t,e,n)=>{Ud.set(zd(t(Tk)),n)});const wU=t=>{for(const e of[...Ud.keys()])e==="base"||t.has(e)||Ud.delete(e)},Bd=et(new Map),Ak=et(null);et(null);const l_=et(0),Sm=et(null),u_=et(!1),c_=et(null),KT=et(!1),ZT=et(!1),d_=et(null),f_=et(null),Wd=et(null),X2=et(null),qo=et(null),pf=et({active:!1}),qT=et([]),Rk=et(null),bU=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&vU(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},SU=et(null,(t,e,n)=>{const r=c=>{const f=c??bm;return f.kind==="variant"&&!n.has(zd(f))},s=t(Bd);let i=null;for(const[c,f]of s)r(f.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const f of i)c.delete(f);e(Bd,c)}const a=t(Ak);a&&r(a.target)&&(e(Ak,null),e(PU,!1));const u=t(Rk);u&&(i!=null&&i.has(u.commentId))&&e(Rk,null),wU(n)}),h_=et(zT),EU=et(!1),YT=et(null),mf=et(!0),XT=et(!1),QT=et(!1),JT=et(!1),e5=et(null),kU=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},a0=et(kU()),CU=et(null),PU=et(!1);et(0);et(0);var Sp={exports:{}},TU=Sp.exports,Ik;function AU(){return Ik||(Ik=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(TU,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={},a=null;function u(_,b){var E=_[b];if(typeof E.bind=="function")return E.bind(_);try{return Function.prototype.bind.call(E,_)}catch{return function(){return Function.prototype.apply.apply(E,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function f(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?u(console,_):console.log!==void 0?u(console,"log"):e}function h(){for(var _=this.getLevel(),b=0;b<s.length;b++){var E=s[b];this[E]=b<_?e:this.methodFactory(E,_,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&&(h.call(this),this[_].apply(this,arguments))}}function v(_,b,E){return f(_)||p.apply(this,arguments)}function y(_,b){var E=this,C,P,T,A="loglevel";typeof _=="string"?A+=":"+_:typeof _=="symbol"&&(A=void 0);function O(j){var V=(s[j]||"silent").toUpperCase();if(!(typeof window===n||!A)){try{window.localStorage[A]=V;return}catch{}try{window.document.cookie=encodeURIComponent(A)+"="+V+";"}catch{}}}function M(){var j;if(!(typeof window===n||!A)){try{j=window.localStorage[A]}catch{}if(typeof j===n)try{var V=window.document.cookie,G=encodeURIComponent(A),Y=V.indexOf(G+"=");Y!==-1&&(j=/^([^;]+)/.exec(V.slice(Y+G.length+1))[1])}catch{}return E.levels[j]===void 0&&(j=void 0),j}}function R(){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(j){var V=j;if(typeof V=="string"&&E.levels[V.toUpperCase()]!==void 0&&(V=E.levels[V.toUpperCase()]),typeof V=="number"&&V>=0&&V<=E.levels.SILENT)return V;throw new TypeError("log.setLevel() called with invalid level: "+j)}E.name=_,E.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},E.methodFactory=b||v,E.getLevel=function(){return T??P??C},E.setLevel=function(j,V){return T=L(j),V!==!1&&O(T),h.call(E)},E.setDefaultLevel=function(j){P=L(j),M()||E.setLevel(j,!1)},E.resetLevel=function(){T=null,R(),h.call(E)},E.enableAll=function(j){E.setLevel(E.levels.TRACE,j)},E.disableAll=function(j){E.setLevel(E.levels.SILENT,j)},E.rebuild=function(){if(a!==E&&(C=L(a.getLevel())),h.call(E),a===E)for(var j in i)i[j].rebuild()},C=L(a?a.getLevel():"WARN");var N=M();N!=null&&(T=L(N)),h.call(E)}a=new y,a.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var E=i[b];return E||(E=i[b]=new y(b,a.methodFactory)),E};var x=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=x),a},a.getLoggers=function(){return i},a.default=a,a})})(Sp)),Sp.exports}var RU=AU();const Cs=$m(RU),IU="INFO",MU=IU.toUpperCase();Cs.setLevel(Cs.levels[MU]||Cs.levels.INFO);const hs=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Cs.trace(`${e}${n}`,...r),debug:(n,...r)=>Cs.debug(`${e}${n}`,...r),info:(n,...r)=>Cs.info(`${e}${n}`,...r),warn:(n,...r)=>Cs.warn(`${e}${n}`,...r),error:(n,...r)=>{Cs.error(`${e}${n}`,...r);try{const i=r.map(u=>u instanceof Error?u.message:String(u)).join(" ").slice(0,512),a={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}:{}};Te.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Cs.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Cs.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Cs.debug(`${e}Mount: ${n}`,...r)}};let Ep=0;const LU=()=>{Ep+=1;let t=!1;return()=>{t||(t=!0,Ep=Math.max(0,Ep-1))}},OU=()=>Ep>0;function NU(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const DU=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Q2=({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:DU.map((n,r)=>S.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),jU=["top","right","bottom","left"],Yo=Math.min,jr=Math.max,Em=Math.round,ep=Math.floor,ci=t=>({x:t,y:t}),FU={left:"right",right:"left",bottom:"top",top:"bottom"};function p_(t,e,n){return jr(t,Yo(e,n))}function Zi(t,e){return typeof t=="function"?t(e):t}function qi(t){return t.split("-")[0]}function qu(t){return t.split("-")[1]}function J2(t){return t==="x"?"y":"x"}function ex(t){return t==="y"?"height":"width"}function ii(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function tx(t){return J2(ii(t))}function VU(t,e,n){n===void 0&&(n=!1);const r=qu(t),s=tx(t),i=ex(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=km(a)),[a,km(a)]}function $U(t){const e=km(t);return[m_(t),e,m_(e)]}function m_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Mk=["left","right"],Lk=["right","left"],HU=["top","bottom"],zU=["bottom","top"];function UU(t,e,n){switch(t){case"top":case"bottom":return n?e?Lk:Mk:e?Mk:Lk;case"left":case"right":return e?HU:zU;default:return[]}}function BU(t,e,n,r){const s=qu(t);let i=UU(qi(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(m_)))),i}function km(t){const e=qi(t);return FU[e]+t.slice(e.length)}function WU(t){return{top:0,right:0,bottom:0,left:0,...t}}function t5(t){return typeof t!="number"?WU(t):{top:t,right:t,bottom:t,left:t}}function Cm(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 Ok(t,e,n){let{reference:r,floating:s}=t;const i=ii(e),a=tx(e),u=ex(a),c=qi(e),f=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,v=r[u]/2-s[u]/2;let y;switch(c){case"top":y={x:h,y:r.y-s.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-s.width,y:p};break;default:y={x:r.x,y:r.y}}switch(qu(e)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}async function GU(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:v=!1,padding:y=0}=Zi(e,t),x=t5(y),b=u[v?p==="floating"?"reference":"floating":p],E=Cm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:f,rootBoundary:h,strategy:c})),C=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),T=await(i.isElement==null?void 0:i.isElement(P))?await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1}:{x:1,y:1},A=Cm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:C,offsetParent:P,strategy:c}):C);return{top:(E.top-A.top+x.top)/T.y,bottom:(A.bottom-E.bottom+x.bottom)/T.y,left:(E.left-A.left+x.left)/T.x,right:(A.right-E.right+x.right)/T.x}}const KU=50,ZU=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:GU},c=await(a.isRTL==null?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=Ok(f,r,c),v=r,y=0;const x={};for(let _=0;_<i.length;_++){const b=i[_];if(!b)continue;const{name:E,fn:C}=b,{x:P,y:T,data:A,reset:O}=await C({x:h,y:p,initialPlacement:r,placement:v,strategy:s,middlewareData:x,rects:f,platform:u,elements:{reference:t,floating:e}});h=P??h,p=T??p,x[E]={...x[E],...A},O&&y<KU&&(y++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(f=O.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):O.rects),{x:h,y:p}=Ok(f,v,c)),_=-1)}return{x:h,y:p,placement:v,strategy:s,middlewareData:x}},qU=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:u,middlewareData:c}=e,{element:f,padding:h=0}=Zi(t,e)||{};if(f==null)return{};const p=t5(h),v={x:n,y:r},y=tx(s),x=ex(y),_=await a.getDimensions(f),b=y==="y",E=b?"top":"left",C=b?"bottom":"right",P=b?"clientHeight":"clientWidth",T=i.reference[x]+i.reference[y]-v[y]-i.floating[x],A=v[y]-i.reference[y],O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let M=O?O[P]:0;(!M||!await(a.isElement==null?void 0:a.isElement(O)))&&(M=u.floating[P]||i.floating[x]);const R=T/2-A/2,L=M/2-_[x]/2-1,N=Yo(p[E],L),j=Yo(p[C],L),V=N,G=M-_[x]-j,Y=M/2-_[x]/2+R,K=p_(V,Y,G),B=!c.arrow&&qu(s)!=null&&Y!==K&&i.reference[x]/2-(Y<V?N:j)-_[x]/2<0,X=B?Y<V?Y-V:Y-G:0;return{[y]:v[y]+X,data:{[y]:K,centerOffset:Y-K-X,...B&&{alignmentOffset:X}},reset:B}}}),YU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:u,platform:c,elements:f}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...b}=Zi(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const E=qi(s),C=ii(u),P=qi(u)===u,T=await(c.isRTL==null?void 0:c.isRTL(f.floating)),A=v||(P||!_?[km(u)]:$U(u)),O=x!=="none";!v&&O&&A.push(...BU(u,_,x,T));const M=[u,...A],R=await c.detectOverflow(e,b),L=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&L.push(R[E]),p){const Y=VU(s,a,T);L.push(R[Y[0]],R[Y[1]])}if(N=[...N,{placement:s,overflows:L}],!L.every(Y=>Y<=0)){var j,V;const Y=(((j=i.flip)==null?void 0:j.index)||0)+1,K=M[Y];if(K&&(!(p==="alignment"?C!==ii(K):!1)||N.every($=>ii($.placement)===C?$.overflows[0]>0:!0)))return{data:{index:Y,overflows:N},reset:{placement:K}};let B=(V=N.filter(X=>X.overflows[0]<=0).sort((X,$)=>X.overflows[1]-$.overflows[1])[0])==null?void 0:V.placement;if(!B)switch(y){case"bestFit":{var G;const X=(G=N.filter($=>{if(O){const ee=ii($.placement);return ee===C||ee==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ee=>ee>0).reduce((ee,H)=>ee+H,0)]).sort(($,ee)=>$[1]-ee[1])[0])==null?void 0:G[0];X&&(B=X);break}case"initialPlacement":B=u;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function Nk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dk(t){return jU.some(e=>t[e]>=0)}const XU=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=Zi(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=Nk(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Dk(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=Nk(a,n.floating);return{data:{escapedOffsets:u,escaped:Dk(u)}}}default:return{}}}}},n5=new Set(["left","top"]);async function QU(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=qi(n),u=qu(n),c=ii(n)==="y",f=n5.has(a)?-1:1,h=i&&c?-1:1,p=Zi(e,t);let{mainAxis:v,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(y=u==="end"?x*-1:x),c?{x:y*h,y:v*f}:{x:v*f,y:y*h}}const JU=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:u}=e,c=await QU(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},eB=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:a=!0,crossAxis:u=!1,limiter:c={fn:E=>{let{x:C,y:P}=E;return{x:C,y:P}}},...f}=Zi(t,e),h={x:n,y:r},p=await i.detectOverflow(e,f),v=ii(qi(s)),y=J2(v);let x=h[y],_=h[v];if(a){const E=y==="y"?"top":"left",C=y==="y"?"bottom":"right",P=x+p[E],T=x-p[C];x=p_(P,x,T)}if(u){const E=v==="y"?"top":"left",C=v==="y"?"bottom":"right",P=_+p[E],T=_-p[C];_=p_(P,_,T)}const b=c.fn({...e,[y]:x,[v]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[y]:a,[v]:u}}}}}},tB=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=e,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=Zi(t,e),h={x:n,y:r},p=ii(s),v=J2(p);let y=h[v],x=h[p];const _=Zi(u,e),b=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(c){const P=v==="y"?"height":"width",T=i.reference[v]-i.floating[P]+b.mainAxis,A=i.reference[v]+i.reference[P]-b.mainAxis;y<T?y=T:y>A&&(y=A)}if(f){var E,C;const P=v==="y"?"width":"height",T=n5.has(qi(s)),A=i.reference[p]-i.floating[P]+(T&&((E=a.offset)==null?void 0:E[p])||0)+(T?0:b.crossAxis),O=i.reference[p]+i.reference[P]+(T?0:((C=a.offset)==null?void 0:C[p])||0)-(T?b.crossAxis:0);x<A?x=A:x>O&&(x=O)}return{[v]:y,[p]:x}}}},nB=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:a,elements:u}=e,{apply:c=()=>{},...f}=Zi(t,e),h=await a.detectOverflow(e,f),p=qi(s),v=qu(s),y=ii(s)==="y",{width:x,height:_}=i.floating;let b,E;p==="top"||p==="bottom"?(b=p,E=v===(await(a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(E=p,b=v==="end"?"top":"bottom");const C=_-h.top-h.bottom,P=x-h.left-h.right,T=Yo(_-h[b],C),A=Yo(x-h[E],P),O=!e.middlewareData.shift;let M=T,R=A;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=P),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(M=C),O&&!v){const N=jr(h.left,0),j=jr(h.right,0),V=jr(h.top,0),G=jr(h.bottom,0);y?R=x-2*(N!==0||j!==0?N+j:jr(h.left,h.right)):M=_-2*(V!==0||G!==0?V+G:jr(h.top,h.bottom))}await c({...e,availableWidth:R,availableHeight:M});const L=await a.getDimensions(u.floating);return x!==L.width||_!==L.height?{reset:{rects:!0}}:{}}}};function l0(){return typeof window<"u"}function Yu(t){return r5(t)?(t.nodeName||"").toLowerCase():"#document"}function Br(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hi(t){var e;return(e=(r5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function r5(t){return l0()?t instanceof Node||t instanceof Br(t).Node:!1}function Rs(t){return l0()?t instanceof Element||t instanceof Br(t).Element:!1}function Ji(t){return l0()?t instanceof HTMLElement||t instanceof Br(t).HTMLElement:!1}function jk(t){return!l0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Br(t).ShadowRoot}function gf(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Is(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function rB(t){return/^(table|td|th)$/.test(Yu(t))}function u0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const sB=/transform|translate|scale|rotate|perspective|filter/,iB=/paint|layout|strict|content/,Aa=t=>!!t&&t!=="none";let o1;function nx(t){const e=Rs(t)?Is(t):t;return Aa(e.transform)||Aa(e.translate)||Aa(e.scale)||Aa(e.rotate)||Aa(e.perspective)||!rx()&&(Aa(e.backdropFilter)||Aa(e.filter))||sB.test(e.willChange||"")||iB.test(e.contain||"")}function oB(t){let e=Xo(t);for(;Ji(e)&&!Fu(e);){if(nx(e))return e;if(u0(e))return null;e=Xo(e)}return null}function rx(){return o1==null&&(o1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),o1}function Fu(t){return/^(html|body|#document)$/.test(Yu(t))}function Is(t){return Br(t).getComputedStyle(t)}function c0(t){return Rs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xo(t){if(Yu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jk(t)&&t.host||hi(t);return jk(e)?e.host:e}function s5(t){const e=Xo(t);return Fu(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ji(e)&&gf(e)?e:s5(e)}function Gd(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=s5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Br(s);if(i){const u=g_(a);return e.concat(a,a.visualViewport||[],gf(s)?s:[],u&&n?Gd(u):[])}else return e.concat(s,Gd(s,[],n))}function g_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function i5(t){const e=Is(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Ji(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=Em(n)!==i||Em(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function sx(t){return Rs(t)?t:t.contextElement}function uu(t){const e=sx(t);if(!Ji(e))return ci(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=i5(e);let a=(i?Em(n.width):n.width)/r,u=(i?Em(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const aB=ci(0);function o5(t){const e=Br(t);return!rx()||!e.visualViewport?aB:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function lB(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Br(t)?!1:e}function dl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=sx(t);let a=ci(1);e&&(r?Rs(r)&&(a=uu(r)):a=uu(t));const u=lB(i,n,r)?o5(i):ci(0);let c=(s.left+u.x)/a.x,f=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i){const v=Br(i),y=r&&Rs(r)?Br(r):r;let x=v,_=g_(x);for(;_&&r&&y!==x;){const b=uu(_),E=_.getBoundingClientRect(),C=Is(_),P=E.left+(_.clientLeft+parseFloat(C.paddingLeft))*b.x,T=E.top+(_.clientTop+parseFloat(C.paddingTop))*b.y;c*=b.x,f*=b.y,h*=b.x,p*=b.y,c+=P,f+=T,x=Br(_),_=g_(x)}}return Cm({width:h,height:p,x:c,y:f})}function d0(t,e){const n=c0(t).scrollLeft;return e?e.left+n:dl(hi(t)).left+n}function a5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-d0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function uB(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=hi(r),u=e?u0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},f=ci(1);const h=ci(0),p=Ji(r);if((p||!p&&!i)&&((Yu(r)!=="body"||gf(a))&&(c=c0(r)),p)){const y=dl(r);f=uu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const v=a&&!p&&!i?a5(a,c):ci(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+h.x+v.x,y:n.y*f.y-c.scrollTop*f.y+h.y+v.y}}function cB(t){return Array.from(t.getClientRects())}function dB(t){const e=hi(t),n=c0(t),r=t.ownerDocument.body,s=jr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=jr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+d0(t);const u=-n.scrollTop;return Is(r).direction==="rtl"&&(a+=jr(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:u}}const Fk=25;function fB(t,e){const n=Br(t),r=hi(t),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,u=0,c=0;if(s){i=s.width,a=s.height;const h=rx();(!h||h&&e==="fixed")&&(u=s.offsetLeft,c=s.offsetTop)}const f=d0(r);if(f<=0){const h=r.ownerDocument,p=h.body,v=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-y);x<=Fk&&(i-=x)}else f<=Fk&&(i+=f);return{width:i,height:a,x:u,y:c}}function hB(t,e){const n=dl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Ji(t)?uu(t):ci(1),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,f=r*i.y;return{width:a,height:u,x:c,y:f}}function Vk(t,e,n){let r;if(e==="viewport")r=fB(t,n);else if(e==="document")r=dB(hi(t));else if(Rs(e))r=hB(e,n);else{const s=o5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Cm(r)}function l5(t,e){const n=Xo(t);return n===e||!Rs(n)||Fu(n)?!1:Is(n).position==="fixed"||l5(n,e)}function pB(t,e){const n=e.get(t);if(n)return n;let r=Gd(t,[],!1).filter(u=>Rs(u)&&Yu(u)!=="body"),s=null;const i=Is(t).position==="fixed";let a=i?Xo(t):t;for(;Rs(a)&&!Fu(a);){const u=Is(a),c=nx(a);!c&&u.position==="fixed"&&(s=null),(i?!c&&!s:!c&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||gf(a)&&!c&&l5(t,a))?r=r.filter(h=>h!==a):s=u,a=Xo(a)}return e.set(t,r),r}function mB(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?u0(e)?[]:pB(e,this._c):[].concat(n),r],u=Vk(e,a[0],s);let c=u.top,f=u.right,h=u.bottom,p=u.left;for(let v=1;v<a.length;v++){const y=Vk(e,a[v],s);c=jr(y.top,c),f=Yo(y.right,f),h=Yo(y.bottom,h),p=jr(y.left,p)}return{width:f-p,height:h-c,x:p,y:c}}function gB(t){const{width:e,height:n}=i5(t);return{width:e,height:n}}function vB(t,e,n){const r=Ji(e),s=hi(e),i=n==="fixed",a=dl(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=ci(0);function f(){c.x=d0(s)}if(r||!r&&!i)if((Yu(e)!=="body"||gf(s))&&(u=c0(e)),r){const y=dl(e,!0,i,e);c.x=y.x+e.clientLeft,c.y=y.y+e.clientTop}else s&&f();i&&!r&&s&&f();const h=s&&!r&&!i?a5(s,u):ci(0),p=a.left+u.scrollLeft-c.x-h.x,v=a.top+u.scrollTop-c.y-h.y;return{x:p,y:v,width:a.width,height:a.height}}function a1(t){return Is(t).position==="static"}function $k(t,e){if(!Ji(t)||Is(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return hi(t)===n&&(n=n.ownerDocument.body),n}function u5(t,e){const n=Br(t);if(u0(t))return n;if(!Ji(t)){let s=Xo(t);for(;s&&!Fu(s);){if(Rs(s)&&!a1(s))return s;s=Xo(s)}return n}let r=$k(t,e);for(;r&&rB(r)&&a1(r);)r=$k(r,e);return r&&Fu(r)&&a1(r)&&!nx(r)?n:r||oB(t)||n}const yB=async function(t){const e=this.getOffsetParent||u5,n=this.getDimensions,r=await n(t.floating);return{reference:vB(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _B(t){return Is(t).direction==="rtl"}const xB={convertOffsetParentRelativeRectToViewportRelativeRect:uB,getDocumentElement:hi,getClippingRect:mB,getOffsetParent:u5,getElementRects:yB,getClientRects:cB,getDimensions:gB,getScale:uu,isElement:Rs,isRTL:_B};function c5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function wB(t,e){let n=null,r;const s=hi(t);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function a(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),i();const f=t.getBoundingClientRect(),{left:h,top:p,width:v,height:y}=f;if(u||e(),!v||!y)return;const x=ep(p),_=ep(s.clientWidth-(h+v)),b=ep(s.clientHeight-(p+y)),E=ep(h),P={rootMargin:-x+"px "+-_+"px "+-b+"px "+-E+"px",threshold:jr(0,Yo(1,c))||1};let T=!0;function A(O){const M=O[0].intersectionRatio;if(M!==c){if(!T)return a();M?a(!1,M):r=setTimeout(()=>{a(!1,1e-7)},1e3)}M===1&&!c5(f,t.getBoundingClientRect())&&a(),T=!1}try{n=new IntersectionObserver(A,{...P,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,P)}n.observe(t)}return a(!0),i}function bB(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,f=sx(t),h=s||i?[...f?Gd(f):[],...e?Gd(e):[]]:[];h.forEach(E=>{s&&E.addEventListener("scroll",n,{passive:!0}),i&&E.addEventListener("resize",n)});const p=f&&u?wB(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[C]=E;C&&C.target===f&&y&&e&&(y.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var P;(P=y)==null||P.observe(e)})),n()}),f&&!c&&y.observe(f),e&&y.observe(e));let x,_=c?dl(t):null;c&&b();function b(){const E=dl(t);_&&!c5(_,E)&&n(),_=E,x=requestAnimationFrame(b)}return n(),()=>{var E;h.forEach(C=>{s&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p==null||p(),(E=y)==null||E.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const SB=JU,EB=eB,kB=YU,CB=nB,PB=XU,Hk=qU,TB=tB,AB=(t,e,n)=>{const r=new Map,s={platform:xB,...n},i={...s.platform,_c:r};return ZU(t,e,{...s,platform:i})};var RB=typeof document<"u",IB=function(){},kp=RB?g.useLayoutEffect:IB;function Pm(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(!Pm(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)&&!Pm(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function d5(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zk(t,e){const n=d5(t);return Math.round(e*n)/n}function l1(t){const e=g.useRef(t);return kp(()=>{e.current=t}),e}function MB(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:u=!0,whileElementsMounted:c,open:f}=t,[h,p]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,y]=g.useState(r);Pm(v,r)||y(r);const[x,_]=g.useState(null),[b,E]=g.useState(null),C=g.useCallback($=>{$!==O.current&&(O.current=$,_($))},[]),P=g.useCallback($=>{$!==M.current&&(M.current=$,E($))},[]),T=i||x,A=a||b,O=g.useRef(null),M=g.useRef(null),R=g.useRef(h),L=c!=null,N=l1(c),j=l1(s),V=l1(f),G=g.useCallback(()=>{if(!O.current||!M.current)return;const $={placement:e,strategy:n,middleware:v};j.current&&($.platform=j.current),AB(O.current,M.current,$).then(ee=>{const H={...ee,isPositioned:V.current!==!1};Y.current&&!Pm(R.current,H)&&(R.current=H,qm.flushSync(()=>{p(H)}))})},[v,e,n,j,V]);kp(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[f]);const Y=g.useRef(!1);kp(()=>(Y.current=!0,()=>{Y.current=!1}),[]),kp(()=>{if(T&&(O.current=T),A&&(M.current=A),T&&A){if(N.current)return N.current(T,A,G);G()}},[T,A,G,N,L]);const K=g.useMemo(()=>({reference:O,floating:M,setReference:C,setFloating:P}),[C,P]),B=g.useMemo(()=>({reference:T,floating:A}),[T,A]),X=g.useMemo(()=>{const $={position:n,left:0,top:0};if(!B.floating)return $;const ee=zk(B.floating,h.x),H=zk(B.floating,h.y);return u?{...$,transform:"translate("+ee+"px, "+H+"px)",...d5(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:H}},[n,u,B.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:G,refs:K,elements:B,floatingStyles:X}),[h,G,K,B,X])}const LB=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?Hk({element:r.current,padding:s}).fn(n):{}:r?Hk({element:r,padding:s}).fn(n):{}}}},OB=(t,e)=>{const n=SB(t);return{name:n.name,fn:n.fn,options:[t,e]}},NB=(t,e)=>{const n=EB(t);return{name:n.name,fn:n.fn,options:[t,e]}},DB=(t,e)=>({fn:TB(t).fn,options:[t,e]}),jB=(t,e)=>{const n=kB(t);return{name:n.name,fn:n.fn,options:[t,e]}},FB=(t,e)=>{const n=CB(t);return{name:n.name,fn:n.fn,options:[t,e]}},VB=(t,e)=>{const n=PB(t);return{name:n.name,fn:n.fn,options:[t,e]}},$B=(t,e)=>{const n=LB(t);return{name:n.name,fn:n.fn,options:[t,e]}};var HB="Arrow",f5=g.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return S.jsx(Rt.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});f5.displayName=HB;var zB=f5;function h5(t){const[e,n]=g.useState(void 0);return ui(()=>{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 a,u;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;a=f.inlineSize,u=f.blockSize}else a=t.offsetWidth,u=t.offsetHeight;n({width:a,height:u})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var ix="Popper",[p5,f0]=na(ix),[UB,m5]=p5(ix),g5=t=>{const{__scopePopper:e,children:n}=t,[r,s]=g.useState(null),[i,a]=g.useState(void 0);return S.jsx(UB,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})};g5.displayName=ix;var v5="PopperAnchor",y5=g.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=m5(v5,n),a=g.useRef(null),u=i.onAnchorChange,c=g.useCallback(x=>{a.current=x,x&&u(x)},[u]),f=Yt(e,c),h=g.useRef(null);g.useEffect(()=>{if(!r)return;const x=h.current;h.current=r.current,x!==h.current&&u(h.current)});const p=i.placementState&&ax(i.placementState),v=p==null?void 0:p[0],y=p==null?void 0:p[1];return r?null:S.jsx(Rt.div,{"data-radix-popper-side":v,"data-radix-popper-align":y,...s,ref:f})});y5.displayName=v5;var ox="PopperContent",[BB,WB]=p5(ox),_5=g.forwardRef((t,e)=>{var ie,ae,me,Se,Re,Ke;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:x,..._}=t,b=m5(ox,n),[E,C]=g.useState(null),P=Yt(e,C),[T,A]=g.useState(null),O=h5(T),M=(O==null?void 0:O.width)??0,R=(O==null?void 0:O.height)??0,L=r+(i!=="center"?"-"+i:""),N=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},j=Array.isArray(f)?f:[f],V=j.length>0,G={padding:N,boundary:j.filter(KB),altBoundary:V},{refs:Y,floatingStyles:K,placement:B,isPositioned:X,middlewareData:$}=MB({strategy:"fixed",placement:L,whileElementsMounted:(...it)=>bB(...it,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[OB({mainAxis:s+R,alignmentAxis:a}),c&&NB({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?DB():void 0,...G}),c&&jB({...G}),FB({...G,apply:({elements:it,rects:Oe,availableWidth:at,availableHeight:It})=>{const{width:mt,height:je}=Oe.reference,Qe=it.floating.style;Qe.setProperty("--radix-popper-available-width",`${at}px`),Qe.setProperty("--radix-popper-available-height",`${It}px`),Qe.setProperty("--radix-popper-anchor-width",`${mt}px`),Qe.setProperty("--radix-popper-anchor-height",`${je}px`)}}),T&&$B({element:T,padding:u}),ZB({arrowWidth:M,arrowHeight:R}),v&&VB({strategy:"referenceHidden",...G,boundary:V?G.boundary:void 0})]}),ee=b.setPlacementState;ui(()=>(ee(B),()=>{ee(void 0)}),[B,ee]);const[H,D]=ax(B),q=Du(x);ui(()=>{X&&(q==null||q())},[X,q]);const re=(ie=$.arrow)==null?void 0:ie.x,se=(ae=$.arrow)==null?void 0:ae.y,oe=((me=$.arrow)==null?void 0:me.centerOffset)!==0,[ue,de]=g.useState();return ui(()=>{E&&de(window.getComputedStyle(E).zIndex)},[E]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:X?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Se=$.transformOrigin)==null?void 0:Se.x,(Re=$.transformOrigin)==null?void 0:Re.y].join(" "),...((Ke=$.hide)==null?void 0:Ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:S.jsx(BB,{scope:n,placedSide:H,placedAlign:D,onArrowChange:A,arrowX:re,arrowY:se,shouldHideArrow:oe,children:S.jsx(Rt.div,{"data-side":H,"data-align":D,..._,ref:P,style:{..._.style,animation:X?void 0:"none"}})})})});_5.displayName=ox;var x5="PopperArrow",GB={top:"bottom",right:"left",bottom:"top",left:"right"},w5=g.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=WB(x5,r),a=GB[i.placedSide];return S.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:S.jsx(zB,{...s,ref:n,style:{...s.style,display:"block"}})})});w5.displayName=x5;function KB(t){return t!==null}var ZB=t=>({name:"transformOrigin",options:t,fn(e){var b,E,C;const{placement:n,rects:r,middlewareData:s}=e,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[f,h]=ax(n),p={start:"0%",center:"50%",end:"100%"}[h],v=(((E=s.arrow)==null?void 0:E.x)??0)+u/2,y=(((C=s.arrow)==null?void 0:C.y)??0)+c/2;let x="",_="";return f==="bottom"?(x=a?p:`${v}px`,_=`${-c}px`):f==="top"?(x=a?p:`${v}px`,_=`${r.floating.height+c}px`):f==="right"?(x=`${-c}px`,_=a?p:`${y}px`):f==="left"&&(x=`${r.floating.width+c}px`,_=a?p:`${y}px`),{data:{x,y:_}}}});function ax(t){const[e,n="center"]=t.split("-");return[e,n]}var b5=g5,lx=y5,S5=_5,E5=w5,h0="Popover",[k5]=na(h0,[f0]),vf=f0(),[qB,sa]=k5(h0),C5=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=vf(e),c=g.useRef(null),[f,h]=g.useState(!1),[p,v]=fl({prop:r,defaultProp:s??!1,onChange:i,caller:h0});return S.jsx(b5,{...u,children:S.jsx(qB,{scope:e,contentId:il(),triggerRef:c,open:p,onOpenChange:v,onOpenToggle:g.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:f,onCustomAnchorAdd:g.useCallback(()=>h(!0),[]),onCustomAnchorRemove:g.useCallback(()=>h(!1),[]),modal:a,children:n})})};C5.displayName=h0;var P5="PopoverAnchor",YB=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=sa(P5,n),i=vf(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:u}=s;return g.useEffect(()=>(a(),()=>u()),[a,u]),S.jsx(lx,{...i,...r,ref:e})});YB.displayName=P5;var T5="PopoverTrigger",A5=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=sa(T5,n),i=vf(n),a=Yt(e,s.triggerRef),u=S.jsx(Rt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":O5(s.open),...r,ref:a,onClick:Et(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:S.jsx(lx,{asChild:!0,...i,children:u})});A5.displayName=T5;var ux="PopoverPortal",[XB,QB]=k5(ux,{forceMount:void 0}),R5=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=sa(ux,e);return S.jsx(XB,{scope:e,forceMount:n,children:S.jsx(Qi,{present:n||i.open,children:S.jsx(Xm,{asChild:!0,container:s,children:r})})})};R5.displayName=ux;var Vu="PopoverContent",I5=g.forwardRef((t,e)=>{const n=QB(Vu,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=sa(Vu,t.__scopePopover);return S.jsx(Qi,{present:r||i.open,children:i.modal?S.jsx(eW,{...s,ref:e}):S.jsx(tW,{...s,ref:e})})});I5.displayName=Vu;var JB=Vd("PopoverContent.RemoveScroll"),eW=g.forwardRef((t,e)=>{const n=sa(Vu,t.__scopePopover),r=g.useRef(null),s=Yt(e,r),i=g.useRef(!1);return g.useEffect(()=>{const a=r.current;if(a)return Z3(a)},[]),S.jsx(G2,{as:JB,allowPinchZoom:!0,children:S.jsx(M5,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Et(t.onCloseAutoFocus,a=>{var u;a.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Et(t.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Et(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),tW=g.forwardRef((t,e)=>{const n=sa(Vu,t.__scopePopover),r=g.useRef(!1),s=g.useRef(!1);return S.jsx(M5,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,f;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),M5=g.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:h,...p}=t,v=sa(Vu,n),y=vf(n);return V3(),S.jsx(W2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:S.jsx(Ym,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onDismiss:()=>v.onOpenChange(!1),deferPointerDownOutside:!0,children:S.jsx(S5,{"data-state":O5(v.open),role:"dialog",id:v.contentId,...y,...p,ref:e,style:{...p.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)"}})})})}),L5="PopoverClose",nW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=sa(L5,n);return S.jsx(Rt.button,{type:"button",...r,ref:e,onClick:Et(t.onClick,()=>s.onOpenChange(!1))})});nW.displayName=L5;var rW="PopoverArrow",sW=g.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=vf(n);return S.jsx(E5,{...s,...r,ref:e})});sW.displayName=rW;function O5(t){return t?"open":"closed"}var N5=C5,D5=A5,j5=R5,F5=I5;const V5=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[f,h]=g.useState(!1),p=i?a??t:t,v=c.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 ${v?"rounded-l-md":"rounded-md"}`,children:[e?S.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),v?S.jsxs(N5,{open:f,onOpenChange:h,children:[S.jsx(D5,{asChild:!0,children:S.jsx("button",{"aria-label":u,disabled:s||i,title:u,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(cz,{className:"h-3.5 w-3.5",weight:"bold"})})}),S.jsx(j5,{children:S.jsx(F5,{className:"border-divider bg-main z-[60] min-w-[140px] rounded-lg border p-1 shadow-lg",sideOffset:5,align:"end",children:c.map(y=>{const x=y.icon;return S.jsxs("button",{onClick:()=>{y.isDisabled||(y.onClick(),h(!1))},disabled:y.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:[x?S.jsx(x,{className:"h-3.5 w-3.5",weight:"bold"}):null,y.label]},y.label)})})})]}):null]})};var iW=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"}),oW="VisuallyHidden",$5=g.forwardRef((t,e)=>S.jsx(Rt.span,{...t,ref:e,style:{...iW,...t.style}}));$5.displayName=oW;var aW=$5,[p0]=na("Tooltip",[f0]),m0=f0(),H5="TooltipProvider",lW=700,v_="tooltip.open",[uW,cx]=p0(H5),z5=t=>{const{__scopeTooltip:e,delayDuration:n=lW,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=g.useRef(!0),u=g.useRef(!1),c=g.useRef(0);return g.useEffect(()=>{const f=c.current;return()=>window.clearTimeout(f)},[]),S.jsx(uW,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:g.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:g.useCallback(f=>{u.current=f},[]),disableHoverableContent:s,children:i})};z5.displayName=H5;var Kd="Tooltip",[cW,yf]=p0(Kd),U5=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=cx(Kd,t.__scopeTooltip),f=m0(e),[h,p]=g.useState(null),v=il(),y=g.useRef(0),x=a??c.disableHoverableContent,_=u??c.delayDuration,b=g.useRef(!1),[E,C]=fl({prop:r,defaultProp:s??!1,onChange:M=>{M?(c.onOpen(),document.dispatchEvent(new CustomEvent(v_))):c.onClose(),i==null||i(M)},caller:Kd}),P=g.useMemo(()=>E?b.current?"delayed-open":"instant-open":"closed",[E]),T=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,b.current=!1,C(!0)},[C]),A=g.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C(!1)},[C]),O=g.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{b.current=!0,C(!0),y.current=0},_)},[_,C]);return g.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),S.jsx(b5,{...f,children:S.jsx(cW,{scope:e,contentId:v,open:E,stateAttribute:P,trigger:h,onTriggerChange:p,onTriggerEnter:g.useCallback(()=>{c.isOpenDelayedRef.current?O():T()},[c.isOpenDelayedRef,O,T]),onTriggerLeave:g.useCallback(()=>{x?A():(window.clearTimeout(y.current),y.current=0)},[A,x]),onOpen:T,onClose:A,disableHoverableContent:x,children:n})})};U5.displayName=Kd;var y_="TooltipTrigger",B5=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=yf(y_,n),i=cx(y_,n),a=m0(n),u=g.useRef(null),c=Yt(e,u,s.onTriggerChange),f=g.useRef(!1),h=g.useRef(!1),p=g.useCallback(()=>f.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),S.jsx(lx,{asChild:!0,...a,children:S.jsx(Rt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:Et(t.onPointerMove,v=>{v.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),h.current=!0)}),onPointerLeave:Et(t.onPointerLeave,()=>{s.onTriggerLeave(),h.current=!1}),onPointerDown:Et(t.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Et(t.onFocus,()=>{f.current||s.onOpen()}),onBlur:Et(t.onBlur,s.onClose),onClick:Et(t.onClick,s.onClose)})})});B5.displayName=y_;var dx="TooltipPortal",[dW,fW]=p0(dx,{forceMount:void 0}),W5=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=yf(dx,e);return S.jsx(dW,{scope:e,forceMount:n,children:S.jsx(Qi,{present:n||i.open,children:S.jsx(Xm,{asChild:!0,container:s,children:r})})})};W5.displayName=dx;var $u="TooltipContent",G5=g.forwardRef((t,e)=>{const n=fW($u,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=yf($u,t.__scopeTooltip);return S.jsx(Qi,{present:r||a.open,children:a.disableHoverableContent?S.jsx(K5,{side:s,...i,ref:e}):S.jsx(hW,{side:s,...i,ref:e})})}),hW=g.forwardRef((t,e)=>{const n=yf($u,t.__scopeTooltip),r=cx($u,t.__scopeTooltip),s=g.useRef(null),i=Yt(e,s),[a,u]=g.useState(null),{trigger:c,onClose:f}=n,h=s.current,{onPointerInTransitChange:p}=r,v=g.useCallback(()=>{u(null),p(!1)},[p]),y=g.useCallback((x,_)=>{const b=x.currentTarget,E={x:x.clientX,y:x.clientY},C=yW(E,b.getBoundingClientRect()),P=_W(E,C),T=xW(_.getBoundingClientRect()),A=bW([...P,...T]);u(A),p(!0)},[p]);return g.useEffect(()=>()=>v(),[v]),g.useEffect(()=>{if(c&&h){const x=b=>y(b,h),_=b=>y(b,c);return c.addEventListener("pointerleave",x),h.addEventListener("pointerleave",_),()=>{c.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",_)}}},[c,h,y,v]),g.useEffect(()=>{if(a){const x=_=>{const b=_.target,E={x:_.clientX,y:_.clientY},C=(c==null?void 0:c.contains(b))||(h==null?void 0:h.contains(b)),P=!wW(E,a);C?v():P&&(v(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,h,a,f,v]),S.jsx(K5,{...t,ref:i})}),[pW,mW]=p0(Kd,{isInside:!1}),gW=_$("TooltipContent"),K5=g.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...u}=t,c=yf($u,n),f=m0(n),{onClose:h}=c;return g.useEffect(()=>(document.addEventListener(v_,h),()=>document.removeEventListener(v_,h)),[h]),g.useEffect(()=>{if(c.trigger){const p=v=>{v.target instanceof Node&&v.target.contains(c.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[c.trigger,h]),S.jsx(Ym,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:S.jsxs(S5,{"data-state":c.stateAttribute,...f,...u,ref:e,style:{...u.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(gW,{children:r}),S.jsx(pW,{scope:n,isInside:!0,children:S.jsx(aW,{id:c.contentId,role:"tooltip",children:s||r})})]})})});G5.displayName=$u;var Z5="TooltipArrow",vW=g.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=m0(n);return mW(Z5,n).isInside?null:S.jsx(E5,{...s,...r,ref:e})});vW.displayName=Z5;function yW(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")}}function _W(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}function xW(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}]}function wW(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const u=e[i],c=e[a],f=u.x,h=u.y,p=c.x,v=c.y;h>r!=v>r&&n<(p-f)*(r-h)/(v-h)+f&&(s=!s)}return s}function bW(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),SW(e)}function SW(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],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.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)}var EW=z5,kW=U5,CW=B5,PW=W5,TW=G5;const _d={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},q5={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"}},Y5=g.createContext(null);function g0(){const t=g.useContext(Y5);return t?t.classes:q5.pill}function AW(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function RW({children:t,defaultShape:e="pill"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{AW(()=>r(i))},[]);return S.jsx(Y5.Provider,{value:{shape:n,setShape:s,classes:q5[n]},children:t})}const X5=g.createContext(null);function Q5({value:t,children:e}){return S.jsx(X5.Provider,{value:t,children:e})}function IW(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function fx({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,f]=g.useState(!1),h=a!==void 0?a:c,[p,v]=g.useState(!1),y=g0(),x=g.useContext(X5);g.useEffect(()=>{h&&v(!0)},[h]);const _=()=>{h||v(!1)},b=IW(n);return S.jsx(EW,{delayDuration:s,children:S.jsxs(kW,{open:h,onOpenChange:E=>{f(E),u==null||u(E)},children:[S.jsx(CW,{asChild:!0,children:e}),p&&S.jsx(PW,{forceMount:!0,container:x??void 0,children:S.jsx(TW,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:S.jsx(Ki.div,{className:lr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",y.bg,i),style:{fontVariationSettings:_d.medium},initial:{opacity:0,scale:.8,...b},animate:{opacity:h?1:0,scale:h?1:.9,x:0,y:0},transition:h?{type:"spring",duration:.34,bounce:.55}:{duration:.1},onAnimationComplete:_,children:t})})})]})})}const Fo=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?S.jsx(S.Fragment,{children:e}):S.jsx(fx,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),v0="/__rivet/preview",Uk=`${v0}/variant/`,Bk=`${v0}/history/`,J5=t=>t?t.startsWith("/")?t:`/${t}`:"/",MW=t=>`${v0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${J5(t.routePath)}`,LW=t=>`${v0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${J5(t.routePath)}`,OW=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(Uk)||e.pathname.startsWith(Bk)}catch{return t.startsWith(Uk)||t.startsWith(Bk)}},Wk=t=>{var s,i,a,u;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")?MW({sessionId:e,variantId:n.workItemId,routePath:t.routePath}):e&&(r==null?void 0:r.kind)==="fresh"&&((a=r.executionPlan)==null?void 0:a.mode)!=="vite_app"&&((u=n.preview)==null?void 0:u.kind)!=="dev_server"?`/api/variants/${e}/static/${n.workItemId}`:null},Gk="/rivet/",eA=t=>{if(!t.startsWith(Gk))return null;const e=t.slice(Gk.length);return!e||e==="/"?null:`/${e}`},Zd=(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(()=>{})},NW=(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),Zd(r,e))}},Kk=6,__="original",hx="Original",px="The original state of your app before any variants were generated.",Zk=200,vn=hs("AgentVariantsPanel"),u1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},DW=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,Xc=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},jW=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function cu(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function Eo(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 FW=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},$a=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")},tA=t=>t.status==="succeeded"&&!$a(t)&&!t.previewUnavailable,Cp=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"},qk=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},VW=t=>{var e;return FW(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},Yk=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),$W=(t,e)=>t.length===e.length&&t.every((n,r)=>{var i,a;const s=e[r];return n.sessionId===s.sessionId&&n.variantId===s.variantId&&n.label===s.label&&n.brief===s.brief&&n.createdAt===s.createdAt&&((i=n.serve)==null?void 0:i.kind)===((a=s.serve)==null?void 0:a.kind)&&n.hasTree===s.hasTree}),HW=()=>{var la,kf,sc,ua;const t=Xe(pf),e=Xe(qT),n=Xe(YT),r=Xe(mf),s=Xe(h_),i=((la=s.deployPrototype)==null?void 0:la.isEnabled)??!1,a=((kf=s.canvasShare)==null?void 0:kf.isEnabled)??!1,u=((sc=s.variantSend)==null?void 0:sc.isEnabled)??!1,c=((ua=s.designContextViewer)==null?void 0:ua.isEnabled)??!1,f=Xe(JT),h=Xe(e5),p=st(l_),v=st(Sm),y=st(u_),x=st(c_),_=st(KT),b=st(ZT),E=st(Wd),C=st(X2),P=st(BT);g.useEffect(()=>(P("Directions"),()=>P(null)),[P]);const T=Xe(qo),A=st(qo),O=g.useCallback(()=>{NW(T),A(null)},[A,T]),M=Xe(d_),R=st(d_),L=Xe(f_),N=st(f_),j=L?`${L.sessionId}:${L.variantId}`:null,[V,G]=g.useState(""),[Y,K]=g.useState(null),[B,X]=g.useState(null),[$,ee]=g.useState({}),[H,D]=g.useState(null),[q,re]=g.useState({}),[se,oe]=g.useState(null),[ue,de]=g.useState([]),ie=g.useRef([]);ie.current=ue;const[ae,me]=g.useState(!1),Se=g.useMemo(()=>t.active?t.variants:[],[t]),Re=g.useMemo(()=>Se.filter(VW),[Se]),Ke=g.useMemo(()=>Yk(Re,$),[Re,$]),it=(H==null?void 0:H.key)===Ke?H.shareUrl:null,Oe=t.active?t.sessionId:null,at=g.useMemo(()=>{const z=new Set;for(const le of ue){const xe=le.parentVariant;xe&&xe.sessionId!==le.sessionId&&z.add(xe.sessionId)}return z},[ue]),It=g.useMemo(()=>{var le;const z=new Set;for(const xe of Se)(le=xe.adoptedSource)!=null&&le.sessionId&&z.add(xe.adoptedSource.sessionId);return z},[Se]),mt=g.useMemo(()=>[...ue.filter(le=>le.sessionId!==Oe&&!at.has(le.sessionId)&&!It.has(le.sessionId))].sort((le,xe)=>{const ge=new Date(le.createdAt).getTime(),we=new Date(xe.createdAt).getTime();return(Number.isNaN(we)?0:we)-(Number.isNaN(ge)?0:ge)}),[ue,Oe,at,It]),je=g.useMemo(()=>L?Se.find(z=>{var le,xe;return((le=z.adoptedSource)==null?void 0:le.sessionId)===L.sessionId&&((xe=z.adoptedSource)==null?void 0:xe.variantId)===L.variantId})??null:null,[L,Se]),Qe=g.useMemo(()=>L?mt.find(z=>z.sessionId===L.sessionId&&z.variantId===L.variantId)??null:null,[L,mt]),lt=t.active?t.projectContext:null,Je=(lt==null?void 0:lt.kind)==="fresh"?lt.workspacePath:n,vt=!t.active&&mt.length>0&&mt.every(z=>z.projectKind==="fresh"),xn=t.active?jW(lt):!!n&&!vt,zt=g.useMemo(()=>Je?`?projectPath=${encodeURIComponent(Je)}`:"",[Je]),An=g.useRef(null),Xn=g.useRef(null),Pr=typeof window>"u"?"/":eA(window.location.pathname)??"/",Qn=g.useRef(null),wn=g.useRef(!1),Os=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),u1(),Qn.current={kind:"live",variantId:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]),Ns=g.useCallback((z,le)=>{le.button!==0&&le.pointerType==="mouse"||(le.preventDefault(),u1(),Qn.current={kind:"past",entry:z,startX:le.clientX,startY:le.clientY,committed:!1})},[]);g.useEffect(()=>{const z=ge=>{const we=Qn.current;if(!we)return;const Ce=ge.clientX-we.startX,We=ge.clientY-we.startY;if(!we.committed){if(Ce*Ce+We*We<Kk*Kk)return;if(u1(),we.kind==="live"){const ke=Se.find(Mn=>Mn.workItemId===we.variantId);if(!ke||ke.status!=="succeeded"){Qn.current=null;return}const hn=Wk({sessionId:Oe,variant:ke,projectContext:lt,routePath:Pr});E({sessionId:Oe??"",variantId:ke.workItemId,label:ke.label||"Direction",url:hn,source:"live",runLabel:ke.runLabel,description:ke.description})}else{const{entry:ke}=we,hn=Xc(ke),Mn=hn?LW({sessionId:ke.sessionId,variantId:ke.variantId,routePath:Pr}):`/api/variants/history/${encodeURIComponent(ke.sessionId)}/${encodeURIComponent(ke.variantId)}/preview${zt}`;if(E({sessionId:ke.sessionId,variantId:ke.variantId,label:ke.label||"Direction",url:Mn,source:hn?"history-dev-server":"history-static",runLabel:ke.runLabel,description:ke.brief}),hn){const Vs=qk(`/api/variants/history/${encodeURIComponent(ke.sessionId)}/${encodeURIComponent(ke.variantId)}/run${zt}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Vs,{method:"POST"})).ok)return;const qr=qk(Mn,"replay",String(Date.now()));E(Sn=>!Sn||Sn.sessionId!==ke.sessionId||Sn.variantId!==ke.variantId||Sn.source!=="history-dev-server"?Sn:{...Sn,url:qr}),A(Sn=>{if(!Sn)return Sn;const Yr=Ar=>!Ar||Ar.sessionId!==ke.sessionId||Ar.variantId!==ke.variantId?Ar:{...Ar,url:qr};return{...Sn,left:Yr(Sn.left),right:Yr(Sn.right)}})}catch($s){vn.warn("history replay drag boot failed",$s)}})()}}we.committed=!0}C({x:ge.clientX,y:ge.clientY})},le=()=>{const ge=Qn.current;ge!=null&&ge.committed&&(wn.current=!0),Qn.current=null,C(null)},xe=ge=>{if(ge.key!=="Escape")return;const we=Qn.current;we!=null&&we.committed&&(we.kind==="past"&&Xc(we.entry)&&Zd({sessionId:we.entry.sessionId,variantId:we.entry.variantId,source:"history-dev-server"}),Qn.current=null,E(null),C(null))};return window.addEventListener("pointermove",z),window.addEventListener("pointerup",le),window.addEventListener("pointercancel",le),window.addEventListener("keydown",xe),()=>{window.removeEventListener("pointermove",z),window.removeEventListener("pointerup",le),window.removeEventListener("pointercancel",le),window.removeEventListener("keydown",xe)}},[Se,Oe,lt,Pr,zt,E,C,A]);const Rn=g.useMemo(()=>{var le;if(ae||j)return null;const z=M?Se.find(xe=>xe.workItemId===M):null;return M&&!z?null:z?$a(z)?z.workItemId:null:t.active?((le=Se.find(xe=>{var ge,we;return $a(xe)&&(((ge=xe.preview)==null?void 0:ge.kind)==="static_artifact"||((we=xe.preview)==null?void 0:we.kind)==="dev_server")}))==null?void 0:le.workItemId)??null:null},[M,j,ae,t,Se]),pi=g.useCallback(async z=>{var xe,ge,we,Ce;if(!Oe)return;const le=(z==null?void 0:z.workItemId)??null;K({kind:"switch",variantId:le??void 0});try{if(((xe=z==null?void 0:z.preview)==null?void 0:xe.kind)==="static_artifact"){if(y(!1),x(null),((ge=z.refinement)==null?void 0:ge.status)==="succeeded"){const ke=z.preview.url.includes("?")?"&":"?";v(`${z.preview.url}${ke}refinement=${encodeURIComponent(z.refinement.workItemId)}`)}else v(z.preview.url);p(ke=>ke+1);return}if(le&&Oe&&t.active&&t.projectContext.kind==="fresh"&&((we=t.projectContext.executionPlan)==null?void 0:we.mode)!=="vite_app"&&((Ce=z==null?void 0:z.preview)==null?void 0:Ce.kind)!=="dev_server"){y(!1),x(null),v(`/api/variants/${Oe}/static/${le}`),p(ke=>ke+1);return}const We=z&&le?Wk({sessionId:Oe,variant:z,projectContext:t.active?t.projectContext:null,routePath:Pr}):null;if(We){y(!1),x(null),v(We),p(ke=>ke+1);return}Te.capture("variants_panel.preview_display_failed",{sessionId:Oe,variantId:le,previewKind:z?Cp(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),x(null)}catch(We){vn.warn("preview display failed",We),Te.capture("variants_panel.preview_display_failed",{sessionId:Oe,variantId:le,previewKind:z?Cp(z):"none",hasPreview:!!(z!=null&&z.preview),hasPort:typeof(z==null?void 0:z.port)=="number",errorMessage:We instanceof Error?We.message:String(We)}),y(!1),x(null)}finally{K(null)}},[Oe,t,Pr,p,v,y,x]),mi=g.useRef(!1),ps=g.useRef(null),Ds=g.useRef(0),ur=g.useCallback(()=>{if(Ds.current++,_(!1),b(!1),!mi.current)return;const z=ps.current;mi.current=!1,ps.current=null;const le=z?new URLSearchParams({sessionId:z.sessionId,variantId:z.variantId}):null,xe=le?`/api/variants/history/replay/stop?${le.toString()}`:"/api/variants/history/replay/stop";fetch(xe,{method:"POST"}).catch(ge=>vn.warn("history replay stop failed",ge))},[_,b]),In=g.useCallback(z=>{var Ce,We,ke,hn,Mn;if(wn.current){wn.current=!1;return}const le=$a(z),xe=z.status==="pending"||z.status==="running"||tA(z);if(!le&&!xe)return;ur();const ge=Cp(z),we=Se.find(Vs=>Vs.workItemId===M);Te.capture("variants_panel.preview_requested",{sessionId:Oe,fromVariantId:we==null?void 0:we.workItemId,toVariantId:z.workItemId,variantStatus:z.status,isPreviewReady:le,isArmed:xe,previewKind:ge,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((We=(Ce=z.actions)==null?void 0:Ce.view)==null?void 0:We.enabled)??null,previewUnavailableReason:((ke=z.previewUnavailable)==null?void 0:ke.reason)??null}),R(z.workItemId),N(null),le?(Xn.current=z.workItemId,me(!1),O(),pi(z)):(me(!1),v(null),y(!1),Te.capture("variants_panel.preview_armed",{sessionId:Oe,fromVariantId:we==null?void 0:we.workItemId,toVariantId:z.workItemId,variantStatus:z.status,previewKind:ge,hasPreview:!!z.preview,hasPort:typeof z.port=="number",viewEnabled:((Mn=(hn=z.actions)==null?void 0:hn.view)==null?void 0:Mn.enabled)??null})),Te.capture("variants_panel.preview_switched",{sessionId:Oe,fromVariantId:we==null?void 0:we.workItemId,toVariantId:z.workItemId,armed:xe})},[M,Oe,O,R,N,ur,pi,Se,v,y]),oa=t.active?`${t.sessionId}:${t.stage}`:"inactive";g.useEffect(()=>{if(r)return;let z=!1;return(async()=>{try{const le=await fetch(`/api/variants/history${zt}`,{credentials:"same-origin"});if(!le.ok)return;const xe=await le.json();if(z)return;const ge=(xe.variants??[]).filter(we=>{var Ce,We;return((Ce=we.preview)==null?void 0:Ce.kind)==="static"||((We=we.serve)==null?void 0:We.kind)==="static"||Xc(we)});if($W(ie.current,ge))return;ie.current=ge,de(ge)}catch(le){vn.warn("Failed to load past variants",le)}})(),()=>{z=!0}},[r,oa,zt]);const Zr=g.useCallback(()=>{mi.current=!1,ps.current=null,_(!1),b(!1),N(null),R(null),me(!0),y(!1),x(null),v(null),p(z=>z+1)},[R,_,b,p,v,x,N,y]),Tr=g.useCallback(z=>{if(wn.current){wn.current=!1;return}if(O(),N({sessionId:z.sessionId,variantId:z.variantId,previewKind:Xc(z)?"dev_server":"static"}),R(null),me(!1),Xc(z)){const le=++Ds.current;mi.current=!0,ps.current={sessionId:z.sessionId,variantId:z.variantId},_(!0),b(!0),(async()=>{K({kind:"switch"}),Te.capture("variants_panel.history_replay_started",{sessionId:z.sessionId,variantId:z.variantId});const xe=ge=>Te.capture("variants_panel.history_replay_failed",{sessionId:z.sessionId,variantId:z.variantId,...ge});try{const ge=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/run${zt}`,{method:"POST"});if(le!==Ds.current)return;if(!ge.ok){const{errorCode:we}=await Eo(ge);vn.warn(`history replay failed: HTTP ${ge.status} ${we??""}`),xe({httpStatus:ge.status,errorCode:we}),Zr();return}b(!1),y(!0),x(null),v(null),p(we=>we+1),Te.capture("variants_panel.history_replay_ready",{sessionId:z.sessionId,variantId:z.variantId})}catch(ge){if(le!==Ds.current)return;vn.warn("history replay failed",ge),xe({errorMessage:ge instanceof Error?ge.message:String(ge)}),Zr()}finally{K(null)}})();return}ur(),y(!1),x(null),v(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/preview${zt}`)},[Zr,K,_,b,p,N,R,v,x,O,y,ur,zt]),gi=g.useCallback(async()=>{ur();const z=()=>{O(),R(null),N(null),me(!0),Xn.current=null,y(!1),x(null),v(null),p(le=>le+1)};if(!Oe){z();return}K({kind:"switch"});try{const le=await fetch(`/api/variants/${Oe}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!le.ok){vn.warn(`switch to original failed: HTTP ${le.status}`);return}z(),y(!0),Te.capture("variants_panel.preview_switched",{sessionId:Oe,fromVariantId:M,toVariantId:null,target:"original",armed:!1})}catch(le){vn.warn("preview-port original switch failed",le)}finally{K(null)}},[M,Oe,R,N,p,v,x,O,y,ur]),Ze=g.useCallback(async z=>{var xe,ge;const le=((ge=(xe=z.actions)==null?void 0:xe.commit)==null?void 0:ge.enabled)??z.status==="succeeded";if(!(!Oe||!le)){Te.capture("variants_panel.commit_clicked",{sessionId:Oe,variantId:z.workItemId,variantLabel:z.label}),K({kind:"commit",variantId:z.workItemId});try{const we=await fetch(`/api/variants/${Oe}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:z.workItemId})});if(!we.ok){const{message:We,errorCode:ke}=await Eo(we);vn.warn(`commit failed: HTTP ${we.status} ${ke??""} ${We??""}`),Te.capture("variants_panel.commit_failed",{sessionId:Oe,variantId:z.workItemId,httpStatus:we.status,errorCode:ke??null,errorMessage:We??null}),ht.error("Couldn't send direction",{description:We??`The server rejected the request (HTTP ${we.status}). Try again, or pick a different direction.`});return}const Ce=await we.json().catch(()=>null);Te.capture("variants_panel.commit_succeeded",{sessionId:Oe,variantId:z.workItemId,payloadKind:(Ce==null?void 0:Ce.payloadKind)??null,duplicate:(Ce==null?void 0:Ce.duplicate)??!1}),ht.success(`Sent "${z.label}" to your project`,{description:(Ce==null?void 0:Ce.payloadKind)==="project-created"?`Project created at ${(Ce==null?void 0:Ce.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ce==null?void 0:Ce.payloadKind)!=="project-created"&&(v(null),y(!1),p(We=>We+1))}catch(we){vn.warn("commit failed",we),Te.capture("variants_panel.commit_failed",{sessionId:Oe,variantId:z.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:we instanceof Error?we.message:String(we)}),ht.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{K(null)}}},[Oe,p,v,y]),Pt=g.useCallback(async(z,le,xe)=>{Te.capture("variants_panel.deploy_clicked",{sessionId:z,variantId:le,variantLabel:xe});try{const ge=await fetch(`/api/variants/${z}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:le,...n?{projectPath:n}:{}})});if(!ge.ok){const{message:We,errorCode:ke}=await Eo(ge);return vn.warn(`deploy failed: HTTP ${ge.status} ${ke??""} ${We??""}`),Te.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:ge.status,errorCode:ke??null,errorMessage:We??null}),ht.error("Couldn't deploy this direction",{description:We??`The server rejected the request (HTTP ${ge.status}). Try again.`}),null}const we=await ge.json().catch(()=>null),Ce=we==null?void 0:we.shareUrl;return Ce?(await navigator.clipboard.writeText(Ce).catch(()=>{}),Te.capture("variants_panel.deploy_succeeded",{sessionId:z,variantId:le}),ht.success(`"${xe}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ce,"_blank","noopener")}}),Ce):(ht.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(ge){return vn.warn("deploy failed",ge),Te.capture("variants_panel.deploy_failed",{sessionId:z,variantId:le,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:ge instanceof Error?ge.message:String(ge)}),ht.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),nn=g.useCallback(async z=>{if(!Oe)return;const le=$[z.workItemId];if(le){await navigator.clipboard.writeText(le).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(le,"_blank","noopener")}});return}K({kind:"deploy",variantId:z.workItemId});try{const xe=await Pt(Oe,z.workItemId,z.label);xe&&ee(ge=>({...ge,[z.workItemId]:xe}))}finally{K(null)}},[Oe,$,Pt]),bn=g.useCallback(async()=>{if(!(!Oe||Re.length===0)){if(it){await navigator.clipboard.writeText(it).catch(()=>{}),ht.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(it,"_blank","noopener")}});return}Te.capture("variants_panel.deploy_clicked",{sessionId:Oe,variantId:"canvas",variantLabel:"Canvas",variantCount:Re.length}),K({kind:"deploy-canvas"});try{const z=await fetch(`/api/variants/${Oe}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Re.map(Ce=>Ce.workItemId),...n?{projectPath:n}:{}})});if(!z.ok){const{message:Ce,errorCode:We}=await Eo(z);vn.warn(`canvas deploy failed: HTTP ${z.status} ${We??""} ${Ce??""}`),Te.capture("variants_panel.deploy_failed",{sessionId:Oe,variantId:"canvas",httpStatus:z.status,errorCode:We??null,errorMessage:Ce??null,variantCount:Re.length}),ht.error("Couldn't share this canvas",{description:Ce??`The server rejected the request (HTTP ${z.status}). Try again.`});return}const le=await z.json().catch(()=>null),xe=le==null?void 0:le.shareUrl;if(!xe){ht.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const ge=Object.fromEntries(((le==null?void 0:le.variants)??[]).filter(Ce=>typeof Ce.variantId=="string"&&typeof Ce.shareUrl=="string").map(Ce=>[Ce.variantId,Ce.shareUrl])),we=Object.keys(ge).length>0?{...$,...ge}:$;we!==$&&ee(we),await navigator.clipboard.writeText(xe).catch(()=>{}),D({key:Yk(Re,we),shareUrl:xe}),Te.capture("variants_panel.deploy_succeeded",{sessionId:Oe,variantId:"canvas",variantCount:Re.length}),ht.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(xe,"_blank","noopener")}})}catch(z){vn.warn("canvas deploy failed",z),Te.capture("variants_panel.deploy_failed",{sessionId:Oe,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:z instanceof Error?z.message:String(z),variantCount:Re.length}),ht.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{K(null)}}},[it,Re,$,n,Oe]),js=g.useCallback(async z=>{const le=`${z.sessionId}:${z.variantId}`,xe=q[le];if(xe){await navigator.clipboard.writeText(xe).catch(()=>{}),ht.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(xe,"_blank","noopener")}});return}oe(le);try{const ge=await Pt(z.sessionId,z.variantId,z.label);ge&&re(we=>({...we,[le]:ge}))}finally{oe(null)}},[q,Pt]),Ut=g.useCallback(async z=>{if(Oe){Te.capture("variants_panel.remove_clicked",{sessionId:Oe,variantId:z.workItemId,variantLabelLength:z.label.length}),K({kind:"remove",variantId:z.workItemId});try{const le=await fetch(`/api/variants/${Oe}/${z.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!le.ok){const{message:xe}=await Eo(le);vn.warn(`remove failed: HTTP ${le.status} ${xe??""}`),ht.error("Couldn't remove direction",{description:xe??`The server rejected the request (HTTP ${le.status}). Try again.`});return}(z.workItemId===Rn||z.workItemId===M)&&(R(null),v(null),y(!1),p(xe=>xe+1))}catch(le){vn.warn("remove failed",le),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{K(null)}}},[Oe,M,Rn,R,v,y,p]),rn=g.useCallback(async z=>{if(!Je){ht.error("Couldn't remove direction",{description:"No project path available."});return}Te.capture("variants_panel.remove_past_clicked",{sessionId:z.sessionId,variantId:z.variantId});const le=`${z.sessionId}:${z.variantId}`,xe=ge=>ge.sessionId===z.sessionId&&ge.variantId===z.variantId;K({kind:"remove",variantId:le}),de(ge=>ge.filter(we=>!xe(we))),j===le&&(N(null),v(null),y(!1),p(ge=>ge+1));try{const ge=await fetch(`/api/variants/history/${encodeURIComponent(z.sessionId)}/${encodeURIComponent(z.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Je})});if(!ge.ok){const{message:we}=await Eo(ge);de(Ce=>Ce.some(xe)?Ce:[...Ce,z]),ht.error("Couldn't remove direction",{description:we??`The server rejected the request (HTTP ${ge.status}). Try again.`})}}catch(ge){vn.warn("remove past failed",ge),de(we=>we.some(xe)?we:[...we,z]),ht.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{K(null)}},[Je,j,N,v,y,p]),ms=g.useCallback(z=>{X(z)},[]),fn=g.useCallback(async()=>{if(B)try{B.kind==="active"?await Ut(B.variant):await rn(B.entry)}finally{X(null)}},[B,Ut,rn]),Jn=DW(B),Fs=(Y==null?void 0:Y.kind)==="remove"&&Y.variantId===Jn,[er,aa]=g.useState(null),[Qu,Ju]=g.useState(null),E0=g.useCallback(z=>{Ju(z)},[]),k0=g.useCallback(()=>{Ju(null)},[]),vi=g.useCallback(async z=>{const le=z.trim();if(le)try{await navigator.clipboard.writeText(le),ht.success("Copied")}catch{ht.error("Couldn't copy")}},[]),wf=g.useCallback(async(z,le)=>{Ju(null);const xe=le.trim();if(!xe||z.kind==="original")return;if(z.kind==="active"){if(!Oe||xe===z.variant.label)return;Te.capture("variants_panel.rename",{sessionId:Oe,variantId:z.variant.workItemId,labelLength:xe.length,past:!1});try{const Ce=await fetch(`/api/variants/${Oe}/${z.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:xe})});if(!Ce.ok){const{message:We}=await Eo(Ce);ht.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){vn.warn("rename failed",Ce),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:ge}=z;if(xe===ge.label.trim())return;if(!Je){ht.error("Couldn't rename direction",{description:"No project path available."});return}Te.capture("variants_panel.rename",{sessionId:ge.sessionId,variantId:ge.variantId,labelLength:xe.length,past:!0});const we=Ce=>Ce.sessionId===ge.sessionId&&Ce.variantId===ge.variantId;de(Ce=>Ce.map(We=>we(We)?{...We,label:xe}:We));try{const Ce=await fetch(`/api/variants/history/${encodeURIComponent(ge.sessionId)}/${encodeURIComponent(ge.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:xe,projectPath:Je})});if(!Ce.ok){const{message:We}=await Eo(Ce);de(ke=>ke.map(hn=>we(hn)?{...hn,label:ge.label}:hn)),ht.error("Couldn't rename direction",{description:We??`The server rejected the request (HTTP ${Ce.status}). Try again.`})}}catch(Ce){vn.warn("rename failed",Ce),de(We=>We.map(ke=>we(ke)?{...ke,label:ge.label}:ke)),ht.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[Oe,Je]);g.useEffect(()=>{if(An.current!==Oe){const le=An.current===null;if(An.current=Oe,Xn.current=null,D(null),v(null),y(!1),x(null),O(),R(null),N(null),me(!1),!le)return}if(j||ae||!Rn||t.active!==!0||Xn.current===Rn)return;const z=Se.find(le=>le.workItemId===Rn);z&&(Xn.current=Rn,O(),pi(z))},[Oe,j,ae,Rn,t,Se,pi,O,R,N,v,x,y]),g.useEffect(()=>{!L||!je||(Xn.current=null,N(null),R(je.workItemId),me(!1))},[je,L,Oe,R,N]),g.useEffect(()=>{!L||je||Qe||N(null)},[je,L,Qe,Oe,N,mt]),g.useEffect(()=>{const z=V.trim().toLowerCase(),le=Se.filter(ke=>$a(ke)&&cu(z,ke.label,ke.runLabel)),xe=mt.filter(ke=>cu(z,ke.label,ke.runLabel,ke.brief)),ge=xn&&cu(z,hx,px);if(le.length===0&&xe.length===0&&!ge)return;const we=[...le.map(ke=>({source:"live",variant:ke})),...xe.map(ke=>({source:"past",entry:ke})),...ge?[{source:"original"}]:[]],Ce=ke=>ke.source==="live"?`live:${ke.variant.workItemId}`:ke.source==="past"?`past:${ke.entry.sessionId}:${ke.entry.variantId}`:__,We=ke=>{if(OU())return;if(ke.key==="Enter"){const Yr=Se.find(Ar=>Ar.workItemId===er);Yr&&$a(Yr)&&(ke.preventDefault(),In(Yr));return}if(ke.key!=="ArrowUp"&&ke.key!=="ArrowDown")return;ke.preventDefault();let Mn=Rn?`live:${Rn}`:null;j?Mn=`past:${j}`:ae&&(Mn=__);const Vs=Mn?we.findIndex(Yr=>Ce(Yr)===Mn):-1;let $s;if(Vs===-1?$s=ke.key==="ArrowDown"?0:we.length-1:ke.key==="ArrowDown"?$s=Math.min(Vs+1,we.length-1):$s=Math.max(Vs-1,0),$s===Vs)return;const qr=we[$s];qr.source==="live"?In(qr.variant):qr.source==="past"?Tr(qr.entry):gi();const Sn=document.querySelector(`[data-variant-key="${Ce(qr)}"]`);Sn instanceof HTMLElement&&Sn.focus({preventScroll:!0})};return window.addEventListener("keydown",We),()=>window.removeEventListener("keydown",We)},[Se,mt,V,xn,j,ae,Rn,er,In,Tr,gi]);const ml=Se.find(z=>z.workItemId===Rn)??null,ec=j?mt.find(z=>`${z.sessionId}:${z.variantId}`===j)??null:null,tc=!!ec,bf=t.active?t.artifacts??[]:[],nc=t.active?Se.filter(z=>z.status!=="cancelled"):[],eo=[...nc.map(z=>({kind:"active",variant:z})),...mt.map(z=>({kind:"past",entry:z})),...xn?[{kind:"original"}]:[]],Sf=V.trim().toLowerCase(),rc=Sf?eo.filter(z=>WW(z,Sf)):eo,Bt=new Set(Se.map(z=>z.requestId).filter(Boolean)),Ef=e.filter(z=>!Bt.has(z.requestId)),to=Ef.length>0,gl=r&&!to&&eo.length===0;return S.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[eo.length>0?S.jsx("div",{className:"px-3 pt-2 pb-1",children:S.jsxs("div",{className:"relative",children:[S.jsx(fz,{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:V,onChange:z=>G(z.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 overflow-y-auto px-3 py-2",children:[to?S.jsx(rG,{groups:Ef}):null,gl?S.jsx(sG,{}):null,t.active&&nc.length===0&&!to&&!gl?S.jsx(iG,{}):null,!t.active&&!to&&!gl&&mt.length===0&&!xn?S.jsx(oG,{isMCPSession:f,mcpEditor:h}):null,eo.length>0&&rc.length===0?S.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",V.trim(),"”."]}):null,rc.length>0?S.jsx(KW,{rows:rc,activeVariantId:M??Rn,activePastKey:j,isOriginalSelected:ae,busy:Y,editingKey:Qu,onSelectActive:In,onSelectPast:Tr,onSelectOriginal:gi,onActivePointerDown:Os,onPastPointerDown:Ns,onHover:aa,onRemove:z=>ms({kind:"active",variant:z}),onRemovePast:z=>ms({kind:"past",entry:z}),onStartRename:E0,onCommitRename:wf,onCancelRename:k0,onCopyDescription:vi}):null,t.active&&c?S.jsx(JW,{artifacts:bf}):null]}),tc&&ec?S.jsx(YW,{entry:ec,deploying:se===j,deployedUrl:j?q[j]??null:null,onDeploy:js,isDeployDisabled:!i}):null,!tc&&t.active?S.jsx(nG,{selectedVariant:ml,busy:Y,onSend:Ze,onDeploy:nn,onDeployCanvas:bn,canDeploy:i&&(lt==null?void 0:lt.kind)==="fresh",canDeployCanvas:i&&a&&(lt==null?void 0:lt.kind)==="fresh",canSendToAgent:u,canvasVariantCount:Re.length,canvasDeployedUrl:it,deployedUrl:ml?$[ml.workItemId]??null:null}):null,S.jsx(UW,{target:B,isConfirming:Fs,onCancel:()=>X(null),onConfirm:fn})]})},zW=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",UW=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=zW(t);return S.jsx(e0,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:S.jsxs(t0,{children:[S.jsx(n0,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(r0,{className:"fixed left-1/2 top-1/2 z-max w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(s0,{className:"text-base font-medium text-content",children:"Remove direction?"}),S.jsxs(i0,{className:"text-sm leading-5 text-content-subtle",children:['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:"rounded-md px-3 py-1.5 text-sm font-medium text-content-subtle transition-colors hover:bg-main-hover hover:text-content 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...":"Remove direction"})]})]})})]})})},BW=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:__,WW=(t,e)=>t.kind==="active"?cu(e,t.variant.label,t.variant.runLabel):t.kind==="past"?cu(e,t.entry.label,t.entry.runLabel,t.entry.brief):cu(e,hx,px),GW=t=>t.length<=Zk?t:`${t.slice(0,Zk-1)}…`,KW=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:v,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:b,onCopyDescription:E})=>{const C=g.useRef(null),{activeIndex:P,itemRects:T,sessionRef:A,handlers:O,registerItem:M}=jT(C),R=(s==null?void 0:s.kind)==="switch",L=P!==null?T[P]:null;return S.jsxs("div",{ref:C,className:"relative",onMouseEnter:O.onMouseEnter,onMouseMove:O.onMouseMove,onMouseLeave:O.onMouseLeave,children:[S.jsx(Gi,{children:L&&S.jsx(sl.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:L.top,left:L.left,width:L.width,height:L.height},animate:{opacity:1,top:L.top,left:L.left,width:L.width,height:L.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Hd.fast,opacity:{duration:.08}}},A.current)}),S.jsx("ul",{className:"relative",children:t.map((N,j)=>{const V=BW(N);let G=!1;return N.kind==="active"?G=N.variant.workItemId===e:N.kind==="past"?G=`${N.entry.sessionId}:${N.entry.variantId}`===n:G=r,S.jsx(ZW,{rowKey:V,row:N,index:j,isSelected:G,isEditing:i===V,isSwitchInFlight:R,busy:s,registerItem:M,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:f,onPastPointerDown:h,onHover:p,onRemove:v,onRemovePast:y,onStartRename:x,onCommitRename:_,onCancelRename:b,onCopyDescription:E},V)})})]})},ZW=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,isSwitchInFlight:i,busy:a,registerItem:u,onSelectActive:c,onSelectPast:f,onSelectOriginal:h,onActivePointerDown:p,onPastPointerDown:v,onHover:y,onRemove:x,onRemovePast:_,onStartRename:b,onCommitRename:E,onCancelRename:C,onCopyDescription:P})=>{var oe,ue;const T=g.useRef(null);uU(u,n,T);const A=e.kind==="active",O=e.kind==="original",M=e.kind==="active"?e.variant:null,R=e.kind==="past"?e.entry:null,L=A?M.status==="succeeded":!0,N=A?$a(M):!0,j=A?tA(M):!1,V=A&&(M.status==="pending"||M.status==="running"),G=A?L&&(N||j)||V:!0,Y=A&&M.status==="failed",K=A&&M.status==="cancelled",B=A&&(!G||i),X=A&&(a==null?void 0:a.kind)==="remove"&&a.variantId===M.workItemId,$=A&&(((oe=M.refinement)==null?void 0:oe.status)==="pending"||((ue=M.refinement)==null?void 0:ue.status)==="running");let ee=hx;A?ee=M.label||`Direction ${n+1}`:R&&(ee=R.label.trim()||"Untitled direction");let H;A?H=M.runLabel:R&&(H=R.runLabel);let D=px;A?D=M.description:R&&(D=R.brief);const q=D?GW(D):null,re=A?M.changedFilesCount:void 0,se=A&&M.status==="succeeded"&&Cp(M)==="none"&&typeof re=="number"&&re>0?`${re} file${re===1?"":"s"} changed`:null;return s?S.jsx("li",{ref:T,"data-proximity-index":n,className:"group relative z-10",children:S.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx(qW,{initial:ee,onCommit:de=>E(e,de),onCancel:C}),q&&S.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:q})]})})}):S.jsxs("li",{ref:T,"data-proximity-index":n,className:"group relative z-10",children:[S.jsx("div",{role:"button",tabIndex:G?0:-1,"data-variant-id":A?M.workItemId:void 0,"data-variant-key":t,onClick:()=>{if(B)return;const de=window.getSelection();de&&!de.isCollapsed||(e.kind==="active"?c(e.variant):e.kind==="past"?f(e.entry):h())},onKeyDown:de=>{B||(de.key==="Enter"||de.key===" ")&&(de.preventDefault(),de.stopPropagation(),e.kind==="active"?c(e.variant):e.kind==="past"?f(e.entry):h())},onPointerDown:de=>{B||(e.kind==="active"?L&&p(e.variant.workItemId,de):e.kind==="past"&&v(e.entry,de))},"aria-pressed":G?r:void 0,"aria-disabled":A?!G:void 0,"aria-busy":V||$,onMouseEnter:A?()=>y(M.workItemId):void 0,onMouseLeave:A?()=>y(null):void 0,className:lr("focus-visible:ring-content-muted/40 flex w-full items-start gap-2 rounded-md px-3 py-2 text-left transition-colors focus:outline-none focus-visible:ring-1",r&&"bg-main-input ring-content-muted/40 ring-1 ring-inset",L&&N&&"cursor-grab active:cursor-grabbing",(V||j)&&"cursor-pointer",!L&&!V&&!j&&"cursor-not-allowed opacity-60",B&&"cursor-not-allowed opacity-50"),style:L?{touchAction:"none"}:void 0,children:S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsxs("span",{className:"flex items-center gap-2",children:[(V||$)&&S.jsx(Q2,{className:"text-content-muted shrink-0 text-sm","data-testid":$&&!V?"variant-refining":void 0}),S.jsx(Fo,{label:"Double-click to rename",disabled:O,children:S.jsx("span",{onDoubleClick:de=>{de.stopPropagation(),O||b(t)},className:lr("min-w-0 flex-1 truncate text-sm font-medium select-text",O?"cursor-default":"cursor-text",L||r?"text-content":"text-content-muted"),children:ee})}),Y&&S.jsx(Xk,{label:"Failed"}),K&&S.jsx(Xk,{label:"Cancelled"}),H&&S.jsx("span",{className:"ml-auto max-w-[8rem] shrink-0 truncate rounded px-1.5 py-0.5 text-[10px] font-medium opacity-100 transition-opacity duration-150 group-hover:opacity-0 group-has-[:focus-visible]:opacity-0",style:DT(H),children:H})]}),q&&S.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:q}),se&&S.jsx("span",{"data-testid":"variant-diff-summary",className:"text-content-muted mt-0.5 block text-[11px] leading-snug",children:se})]})}),S.jsxs("div",{className:lr("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"),children:[D&&S.jsx(Fo,{label:"Copy description",children:S.jsx("button",{type:"button","aria-label":"Copy description",onClick:de=>{de.stopPropagation();const ie=ee.trim();P(ie?`${ie}
111
- ${D}`:D)},onPointerDown:de=>de.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx($d,{size:13,weight:"bold"})})}),!O&&S.jsx(Fo,{label:"Rename",children:S.jsx("button",{type:"button","aria-label":"Rename direction",onClick:de=>{de.stopPropagation(),b(t)},onPointerDown:de=>de.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1",children:S.jsx(hz,{size:13,weight:"bold"})})}),!O&&S.jsx(Fo,{label:"Remove",children:S.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:X,onClick:de=>{de.stopPropagation(),e.kind==="active"?x(e.variant):_(e.entry)},onPointerDown:de=>de.stopPropagation(),className:"text-content-muted hover:bg-main-hover hover:text-content focus-visible:ring-content-muted/40 ml-1 flex h-6 w-6 items-center justify-center rounded focus:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(gz,{size:13,weight:"bold"})})})]})]})},qW=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=g.useState(t),i=g.useRef(!1),a=g.useCallback(c=>{c&&(c.focus(),c.select())},[]),u=c=>{i.current||(i.current=!0,c?e(r):n())};return S.jsx("input",{ref:a,type:"text",value:r,maxLength:120,"aria-label":"Rename direction",onChange:c=>s(c.target.value),onKeyDown:c=>{c.stopPropagation(),c.key==="Enter"?(c.preventDefault(),u(!0)):c.key==="Escape"&&(c.preventDefault(),u(!1))},onBlur:()=>u(!0),onClick:c=>c.stopPropagation(),onPointerDown:c=>c.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"})},Xk=({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}),YW=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=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 pt-2 pb-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($d,{size:12,weight:"bold"}):null,a]})]})},XW={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},QW={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},JW=({artifacts:t})=>{const[e,n]=g.useState(null),r=g.useMemo(()=>e&&t.some(i=>i.id===e)?e:null,[t,e]);if(t.length===0)return null;const s=i=>{n(a=>a===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(eG,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},eG=({artifact:t,isExpanded:e,onToggle:n})=>{const r=QW[t.kind],s=t.source?XW[t.source]:null,i=[t.kind==="design_context"?null:s,t.summary].filter(Boolean).join(" · "),a=t.kind==="design_context"&&!!t.viewUrl,u=`${e?"Hide":"View"} ${r} artifact${t.label?`: ${t.label}`:""}`;return a?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","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(lz,{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":u,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(tG,{artifact:t})}):null]})},tG=({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]}),nG=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:f,deployedUrl:h})=>{var M,R,L,N;const p=t?((R=(M=t.actions)==null?void 0:M.commit)==null?void 0:R.enabled)??t.status==="succeeded":!1,v=p&&e===null,y=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),x=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",b=!i||!p||e!==null,E=a&&c>0,P=x?"Deploying…":h?"Copy link":"Share",A=_?"Sharing…":f?"Copy canvas link":"Share canvas",O=y?"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 pt-2 pb-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"}),h?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(V5,{primaryLabel:P,primaryIcon:h&&!x?$d:void 0,primaryAction:()=>{t&&r(t)},isDisabled:b,isDropdownDisabled:e!==null,isLoading:x,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:E?[{label:A,icon:f&&!_?$d:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?S.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!v,title:(N=(L=t==null?void 0:t.actions)==null?void 0:L.commit)==null?void 0:N.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:O}):null]})]})},nA=()=>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(Q2,{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"})})]})}),rG=({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(nA,{},`${e.requestId}-${r}`)))}),sG=()=>S.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>S.jsx(nA,{},e))}),iG=()=>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."})]}),Qk="Try different ways to create a dropdown that feels fluid and dynamic",oG=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=g.useState(!1),s=NU(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(Qk).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:["“",Qk,"”"]}),S.jsx("button",{type:"button",onClick:a,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(lT,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):S.jsx($d,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},aG=({onClose:t})=>{const e=Xe(BT);return t?S.jsxs("div",{className:"z-10 flex flex-shrink-0 items-center justify-between gap-2 border-b border-main-border bg-main-light px-2.5 py-2.5",children:[e?S.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):S.jsx("span",{}),S.jsx(Fo,{label:"Close panel",side:"bottom",children:S.jsx("button",{onClick:t,className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded p-1 text-content-subtle transition-colors hover:bg-main-input hover:text-content",children:S.jsx(pz,{className:"h-4 w-4",weight:"bold"})})})]}):null},lG='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',uG=({itemSelector:t=lG,loop:e=!1}={})=>{const n=g.useRef(null),r=g.useRef(null),s=g.useCallback(a=>{var u;n.current=a,a?r.current=LU():((u=r.current)==null||u.call(r),r.current=null)},[]),i=g.useCallback(a=>{var x;const{key:u}=a;if(u!=="ArrowDown"&&u!=="ArrowUp"&&u!=="Home"&&u!=="End")return;const c=n.current;if(!c)return;const f=Array.from(c.querySelectorAll(t));if(f.length===0)return;a.preventDefault(),a.stopPropagation();const h=f.indexOf(document.activeElement),p=f.length-1,v=_=>{if(h===-1)return _===1?0:p;const b=h+_;return e?(b+f.length)%f.length:Math.min(Math.max(b,0),p)};let y;u==="Home"?y=0:u==="End"?y=p:u==="ArrowDown"?y=v(1):y=v(-1),(x=f[y])==null||x.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},Jk="/assets/arena-Db0j1set.png",cG=hs("useIntegrations"),eC=["integrations"],dG="rivet:connect-result",fG=t=>typeof t=="object"&&t!==null&&t.type===dG,hG=et(null),pG=()=>{const t=h8(),[e,n]=Q6(hG),r=H1({queryKey:eC,queryFn:async()=>{const u=await fetch("/api/integrations");if(!u.ok)throw new Error(`Failed to load integrations (${u.status})`);return(await u.json()).integrations??[]},staleTime:1e4}),s=g.useCallback(()=>t.invalidateQueries({queryKey:eC}),[t]),i=g.useCallback(async u=>{const c=window.open("","_blank","width=560,height=720");if(!c)throw new Error("Popup blocked. Allow popups to connect.");n(u);try{const f=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await f.json().catch(()=>({}));if(!f.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);c.location.href=h.authUrl,await new Promise(p=>{const v=()=>{window.removeEventListener("message",y),clearInterval(x),s(),p()},y=_=>{fG(_.data)&&_.data.provider===u&&(_.data.status==="error"&&cG.warn(`Connect failed for ${u}:`,_.data.message),v())};window.addEventListener("message",y);const x=setInterval(()=>{c.closed&&v()},500)})}finally{n(null)}},[s,n]),a=g.useCallback(async u=>{n(u);try{const c=await fetch(`/api/integrations/${u}`,{method:"DELETE"});if(!c.ok){const f=await c.json().catch(()=>({}));throw new Error(f.error||`Could not disconnect ${u}`)}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:a,refetch:s}},du=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=S.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?S.jsx(fx,{content:S.jsxs("div",{className:"flex flex-row items-center gap-2",children:[S.jsx("span",{children:e}),n?S.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},tC=hs("ConnectorsModal"),mG=()=>S.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","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"})}),gG=()=>S.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${Jk})`,maskImage:`url(${Jk})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),vG=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:S.jsx(mG,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:S.jsx(gG,{})}],yG=({meta:t,integration:e,isPending:n,isHighlighted:r,onConnect:s,onDisconnect:i})=>{const a=(e==null?void 0:e.status)==="connected",u=e!=null&&e.externalUsername?`@${e.externalUsername}`:null;return S.jsxs("article",{className:`flex flex-col rounded-xl bg-main-light p-[18px] ${r?"ring-2 ring-secondary":""}`,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,a?S.jsx(lT,{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}),a&&u?S.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?S.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-main-input px-3.5 text-[13px] font-semibold text-content-muted 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 mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg bg-secondary px-3.5 text-[13px] font-semibold text-secondary-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},x_=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:f}=pG(),[h,p]=g.useState(null),v=b=>s.find(E=>E.provider===b),y=g.useCallback(b=>{c(b).catch(E=>{const C=E instanceof Error?E.message:"Could not connect.";tC.warn(`Connect error for ${b}:`,C),ht.error(C)})},[c]),x=g.useCallback(b=>{f(b).catch(E=>{const C=E instanceof Error?E.message:"Could not disconnect.";tC.warn(`Disconnect error for ${b}:`,C),ht.error(C)})},[f]),_=n==="onboarding";return S.jsx(e0,{open:t,onOpenChange:b=>!b&&e(),children:S.jsxs(t0,{children:[S.jsx(n0,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(r0,{ref:p,className:"fixed left-1/2 top-1/2 z-max w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(Q5,{value:h,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(s0,{className:"text-base font-medium text-content",children:"Connect design references"}),S.jsx(du,{onClick:e,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content",children:S.jsx(xT,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[S.jsx(i0,{className:"text-sm text-content-subtle",children:"Connect your design references to use them with Rivet’s MCP."}),a?S.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,S.jsx("div",{className:"grid grid-cols-2 gap-4",children:vG.map(b=>S.jsx(yG,{meta:b,integration:v(b.provider),isPending:i||u===b.provider,isHighlighted:r===b.provider,onConnect:()=>y(b.provider),onDisconnect:()=>x(b.provider)},b.provider))}),_?S.jsxs("div",{className:"flex items-center justify-between gap-4",children:[S.jsx("p",{className:"text-xs text-content-subtle",children:"You can always do this later from the account menu."}),S.jsx("button",{type:"button",onClick:e,className:"active-push flex-none rounded-lg bg-secondary px-3.5 py-2 text-[13px] font-medium text-secondary-foreground transition-colors hover:bg-accent",children:"Skip for now"})]}):null]})]})})]})})},nC=({className:t=""})=>S.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),_G=hs("SupportTicketModal"),rC=5e3,c1="feedback",xG=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},wG=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=xG(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}`},bG=({isOpen:t,onClose:e,contactEmail:n})=>{const r=QN(),[s,i]=g.useState(""),[a,u]=g.useState(!1),[c,f]=g.useState(null),h=g.useCallback(()=>{i("")},[]),p=g.useCallback(()=>{a||(h(),e())},[a,e,h]),v=g.useCallback(async()=>{const b=s.trim();if(!(!b||a)){u(!0);try{const E=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,C=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,P=n==null?void 0:n.trim(),T=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:c1,message:b,contactEmail:P||void 0,metadata:{posthogSessionId:E??void 0,posthogDistinctId:C??void 0,appVersion:"0.13.2",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!T.ok){const A=await wG(T);throw new Error(A)}r==null||r.capture("support_ticket_submitted",{ticket_type:c1,has_posthog_session_id:!!E}),ht.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(E){const C=E instanceof Error?E.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:c1,error:C}),_G.error("Failed to submit support ticket:",C),ht.error("Could not send feedback",{description:C})}finally{u(!1)}}},[n,a,s,e,r,h]),y=g.useCallback(b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),v())},[v]),x=rC-s.length,_=a||s.trim().length===0;return S.jsx(e0,{open:t,onOpenChange:b=>!b&&p(),children:S.jsxs(t0,{children:[S.jsx(n0,{className:"fixed inset-0 z-max bg-black/40"}),S.jsx(r0,{ref:f,className:"fixed left-1/2 top-1/2 z-max w-[440px] -translate-x-1/2 -translate-y-1/2 rounded-lg border border-main-border bg-main font-main shadow-2xl outline-none",children:S.jsxs(Q5,{value:c,children:[S.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[S.jsx(s0,{className:"text-base font-medium text-content",children:"Send feedback"}),S.jsx(du,{onClick:p,disabled:a,title:"Close",className:"rounded p-1 text-content-subtle transition-colors hover:bg-main-hover hover:text-content disabled:cursor-not-allowed disabled:opacity-50",children:S.jsx(xT,{className:"h-4 w-4",weight:"bold"})})]}),S.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[S.jsx(i0,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),S.jsxs("div",{className:"rounded-lg bg-main-input 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:b=>i(b.target.value),onKeyDown:y,maxLength:rC,rows:6,disabled:a,placeholder:"What happened?",className:"max-h-64 w-full resize-none overflow-y-auto bg-transparent pb-1 pl-3 pr-3 pt-3 text-sm text-content placeholder-content-subtle focus:outline-none disabled:opacity-50"}),S.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[S.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),S.jsxs("div",{className:"flex items-center gap-2",children:[x<=500&&S.jsx("span",{className:"text-xs text-content-subtle",children:x}),S.jsx(du,{onClick:v,disabled:_,title:"Send feedback",shortcut:"⌘↵",className:"flex items-center justify-center rounded bg-primary p-1 text-content transition-colors hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-80",children:a?S.jsx(o0,{className:"h-5 w-5 animate-spin",weight:"bold"}):S.jsx(uz,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},SG=hs("ProfileAvatar"),rA=(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):""},EG=(t,e)=>rA(t,e).charAt(0).toUpperCase(),kG=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=Xe(GT),i=Xe(QT),a=Xe(XT),[u,c]=g.useState(!1),[f,h]=g.useState(!1),[p,v]=g.useState(!1),[y,x]=g.useState(!1),{containerRef:_,onKeyDown:b}=uG(),E=Xe(mf),C=EG(r,s);if(!C)return E?S.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[S.jsx(nC,{className:"h-7 w-7 rounded-full"}),S.jsx(nC,{className:"h-3 w-16"})]}):null;const P=rA(r,s),T=(r==null?void 0:r.trim())||null,A=(s==null?void 0:s.trim())||null,O=async()=>{x(!0);try{const M=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!M.ok)throw new Error(`Logout failed: ${M.status}`)}catch(M){SG.warn("Logout request failed",M),ht.error("Could not log out. Please try again."),x(!1);return}window.location.reload()};return S.jsxs(S.Fragment,{children:[S.jsxs(N5,{open:u,onOpenChange:c,children:[S.jsx(D5,{asChild:!0,children:S.jsxs("button",{type:"button","aria-label":"Account",className:`flex shrink-0 select-none items-center gap-2 text-content-muted transition-colors hover:text-content ${t}`,children:[S.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full border border-main-border bg-main-input text-[11px] font-semibold leading-none",children:C}),P?S.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:P}):null]})}),S.jsx(j5,{children:S.jsxs(F5,{ref:_,onKeyDown:b,role:"menu",className:"z-[60] min-w-[180px] rounded-lg bg-surface-2 p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[T||A?S.jsxs("div",{className:"border-b border-main-border px-3 py-2",children:[T?S.jsx("div",{className:"truncate text-xs font-medium text-content",children:T}):null,A?S.jsx("div",{className:"truncate text-[11px] text-content-muted",children:A}):null]}):null,S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),h(!0)},disabled:!i||a,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(vT,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{c(!1),v(!0)},className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none",children:[S.jsx(dz,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),S.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:O,disabled:y,className:"mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs text-content transition-colors hover:bg-hover focus:bg-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(mz,{className:"h-3.5 w-3.5",weight:"bold"}),y?"Logging out…":"Log out"]})]})})]}),S.jsx(x_,{isOpen:f,onClose:()=>h(!1)}),S.jsx(bG,{isOpen:p,onClose:()=>v(!1),contactEmail:s??void 0})]})},CG=({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(aG,{onClose:t}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:S.jsx(HW,{})}),S.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:S.jsx(kG,{side:"top",align:"start"})})]}),PG=hs("useServerConfig"),TG=()=>{const[t,e]=g.useState(null),[n,r]=g.useState(!0),[s,i]=g.useState(null),a=g.useCallback(async()=>{var u;try{r(!0),i(null);const c=await fetch("/api/health");if(!c.ok)throw new Error(`Failed to fetch config: ${c.status}`);const f=await c.json();if(!f.framework)throw new Error("Server did not return framework information");const h={userPort:((u=f.ports)==null?void 0:u.userDevServer)||3e3,framework:f.framework};return e(h),h}catch(c){const f=c instanceof Error?c.message:"Failed to fetch server config";throw i(f),PG.warn("Error fetching server config:",c),c}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},AG="#1C1C20",Ri=[118,118,124],sC=.85,RG=3,IG=.15,tp=36,MG=4.4,LG=.7,OG=3.5,NG=.8,iC=9,DG=11,jG=[1.35,1.12,.95,.85],FG=[0,1.1,2.3,3.1],VG=[0,.35,.16,.13],$G=[.9,.5,.4,.35],Ra=3,d1=[[{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}]],np=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},Pp=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},Ia=(t,e)=>(Math.round(t/e-.5)+.5)*e,HG=Math.sin(Math.PI/3),oC=(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*HG;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()},zG=(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)-iC}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)-iC}return Pp(.5-r/(2*DG))},sA=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=st(WT),r=g.useRef(null),s=g.useCallback(i=>{var N;if((N=r.current)==null||N.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(j=>j+1);const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],f=0,h=0,p=tp,v=tp,y=null,x=null,_=0,b=-1;const E=new Array(33),C=j=>{const V=Math.round(j*32);let G=E[V];if(!G){const Y=V/32,K=Math.round(Ri[0]+(255-Ri[0])*Y),B=Math.round(Ri[1]+(255-Ri[1])*Y),X=Math.round(Ri[2]+(255-Ri[2])*Y);G=`rgba(${K}, ${B}, ${X}, ${sC})`,E[V]=G}return G},P=j=>{const V=1-.35*j,G=Math.round(Ri[0]*V),Y=Math.round(Ri[1]*V),K=Math.round(Ri[2]*V);return`rgba(${G}, ${Y}, ${K}, ${sC})`},T=j=>{let V=Math.floor(Math.random()*d1.length);V===b&&(V=(V+1)%d1.length),b=V;const G=[0,0,0,0],Y=d1[V].map((D,q)=>{const re=D.level,se=G[re]++,oe=FG[re]+se*VG[re],ue=$G[re]+np(V*131+q*17+5)*.2;if(D.hline){const ae=Ia((D.y??0)*h,v);return{hline:!0,x1:Ia(D.x1*f,p),x2:Ia(D.x2*f,p),y1:ae,y2:ae,level:re,start:oe,dur:ue}}const de=Ia(D.x1*f,p),ie=Ia((D.y1??0)*h,v);return{hline:!1,x1:de,y1:ie,x2:Math.max(Ia(D.x2*f,p),de+p),y2:Math.max(Ia((D.y2??0)*h,v),ie+v),level:re,start:oe,dur:ue}}),K=Y.reduce((D,q)=>Math.max(D,q.start+q.dur),0),B=c.length,X=new Float32Array(B*Ra),$=new Int16Array(B*Ra).fill(-1),ee=new Uint8Array(B),H=Y[0];for(let D=0;D<B;D++){const q=c[D];q.x>H.x1&&q.x<H.x2&&q.y>H.y1&&q.y<H.y2&&(ee[D]=1);const re=D*Ra;for(let se=0;se<Y.length;se++){const oe=zG(q.x,q.y,Y[se]);if(oe<=.02)continue;let ue=re;for(let de=re;de<re+Ra;de++){if($[de]===-1){ue=de;break}X[de]<X[ue]&&(ue=de)}($[ue]===-1||oe>X[ue])&&(X[ue]=oe,$[ue]=se)}}return{startT:j,buildEnd:K,els:Y,frame:H,cellQ:X,cellEl:$,inFrame:ee}},A=()=>{const j=i.getBoundingClientRect();f=Math.max(1,j.width),h=Math.max(1,j.height);const V=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(f*V),i.height=Math.round(h*V),a.setTransform(V,0,0,V,0,0);const G=Math.max(8,Math.round(f/tp)),Y=Math.max(6,Math.round(h/tp));p=f/G,v=h/Y,c=[];for(let K=0;K<Y;K++){const B=Y>1?K/(Y-1):.5,X=MG*(1+LG*.4*(B*2-1));for(let $=0;$<G;$++){const ee=K*8191+$*131+1,H={x:($+.5)*p,y:(K+.5)*v,size:X,seed:ee,phase:np(ee),kind:0};H.kind=Math.floor(np(ee*97)*3),c.push(H)}}x=null,y=null},O=new Float32Array(32),M=j=>{a.fillStyle=AG,a.fillRect(0,0,f,h),y||(y=T(j+.2)),j>=y.startT+y.buildEnd+OG&&(x=y,_=j,y=T(j+.2));let V=0;x&&(V=1-Pp((j-_)/NG),V<=0&&(x=null));const G=y;for(let H=0;H<G.els.length;H++){const D=G.els[H];O[H]=Pp(Math.min(1,Math.max(0,(j-G.startT-D.start)/D.dur)))}const Y=O[0],K=P(0),B=P(Y),X=V>0?P(V):K,$=V>0?P(Math.max(Y,V)):B,ee=c.length;for(let H=0;H<ee;H++){const D=c[H];let q=0,re=0;const se=H*Ra;for(let Se=se;Se<se+Ra;Se++){const Re=G.cellEl[Se];if(Re<0)break;const Ke=G.cellQ[Se]*O[Re];Ke>q&&(q=Ke,re=G.els[Re].level)}if(x)for(let Se=se;Se<se+Ra;Se++){const Re=x.cellEl[Se];if(Re<0)break;const Ke=x.cellQ[Se]*V;Ke>q&&(q=Ke,re=x.els[Re].level)}const oe=j/RG+D.phase,ue=Math.floor(oe),de=oe-ue,ie=Pp(Math.min(de,1-de)/IG),ae=Math.floor(np(D.seed*97+ue*7919)*3);ae!==D.kind&&q<.02&&ie<.05&&(D.kind=ae);const me=Math.max(ie*(1-q),q);if(!(me<.01))if(q<.02){const Se=G.inFrame[H]===1,Re=x?x.inFrame[H]===1:!1;Se?a.fillStyle=Re?$:B:a.fillStyle=Re?X:K;const Ke=Math.max(Se?Y:0,Re?V:0);oC(a,D.kind,D.x,D.y,D.size*me*(1-.2*Ke))}else{a.fillStyle=C(q);const Se=1+(jG[re]-1)*q;oC(a,D.kind,D.x,D.y,D.size*me*Se)}}};A();let R=0;if(u)y=T(-100),M(0);else{const j=performance.now(),V=G=>{M((G-j)/1e3),R=requestAnimationFrame(V)};R=requestAnimationFrame(V)}const L=new ResizeObserver(()=>{A(),u&&(y=T(-100),M(0))});L.observe(i),r.current=()=>{cancelAnimationFrame(R),L.disconnect(),e&&n(j=>j-1)}},[e,n]);return S.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},UG=async(t=null)=>{if(t)return BG(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return rp();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable"};let r;try{r=await e.json()}catch{return rp()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable"}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable"}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable"}:rp()},BG=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},rp=async()=>{try{const t=await fetch("/");return{isOk:t.status!==502&&t.status!==503,unavailableReason:"upstream_unreachable"}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable"}}},aC=hs("usePreviewUpstreamHealth"),WG=500,GG=4e3,KG=15e3,ZG=(t,e={})=>{const n=g.useRef(null),r=g.useRef(null),s=e.probeMsWhileDown??WG,i=e.probeMsWhileUp??GG,a=e.firstUnreachableCaptureAfterMs??KG,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,f=e.skip??!1,[h,p]=g.useState(t==="static"),[v,y]=g.useState(0),[x,_]=g.useState(null),[b,E]=g.useState(0),[C,P]=g.useState(!1),[T,A]=g.useState(!1),[O,M]=g.useState(t==="static"?null:"upstream_unreachable");return g.useEffect(()=>{if(t==="static"){p(!0),_(null),E(0),P(!1),A(!0),M(null);return}if(f){p(!1),_(null),E(0),P(!1),A(!0),M("upstream_unreachable"),n.current=null;return}let R=!0;const L=Date.now();_(L),E(0),P(!1),p(!1),A(!1),M("upstream_unreachable");const N={current:!1},j={current:!1},V={current:!1},G={current:null},Y={current:!1};let K=null;const B=()=>{V.current||(V.current=!0,R&&A(!0))},X=()=>{K!==null&&(clearTimeout(K),K=null)},$=(H,D)=>{X(),K=setTimeout(D,H)},ee=async()=>{if(!R)return;E(se=>se+1);const{isOk:H,unavailableReason:D}=await UG(c);if(!R)return;if(B(),H){const se=!Y.current;Y.current=!0,p(!0),M(null),G.current=null,j.current=!1,P(!1),N.current?se&&(Te==null||Te.capture("preview_upstream_restored",{framework:t})):(N.current=!0,Te==null||Te.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-L})),$(i,ee);return}const q=Y.current;Y.current=!1,p(!1),M(D),G.current===null&&(G.current=Date.now(),j.current=!1,P(!1)),q&&(Te==null||Te.capture("preview_upstream_lost",{framework:t}),y(se=>se+1),aC.warn("Preview upstream became unavailable after it was ready"));const re=Date.now()-G.current;re>=a&&!j.current&&(j.current=!0,P(!0),Te==null||Te.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:re}),aC.warn("Dev server did not become ready within timeout window")),$(s,ee)};return n.current=()=>$(0,ee),$(0,ee),()=>{R=!1,n.current=null,X()}},[t,s,i,a,c,f]),g.useEffect(()=>{var L;if(t==="static"||u===void 0)return;const R=r.current;r.current=u,R!==null&&R!==u&&((L=n.current)==null||L.call(n))},[t,u]),{isUpstreamReady:h,iframeRemountKey:v,probeStartedAt:x,probeAttemptCount:b,isFirstUnreachableWindowExceeded:C,initialProbeComplete:T,unavailableReason:O}};function qG(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const iA=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}`},oA=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${iA(t)}${e}`:e,YG="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",XG=t=>YG,QG=hs("PreviewSurface"),lC=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",aA=({target:t,src:e,framework:n,remountKey:r})=>(Xe(a0),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:XG(),onLoad:()=>{Te==null||Te.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Te==null||Te.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:lC(e,t),framework:n}))},onError:()=>{Te==null||Te.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Te==null||Te.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:lC(e,t),framework:n})),QG.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),JG="modulepreload",eK=function(t){return"/"+t},uC={},tK=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=a(n.map(f=>{if(f=eK(f),f in uC)return;uC[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":JG,h||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),h)return new Promise((y,x)=>{v.addEventListener("load",y),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return s.then(a=>{for(const u of a||[])u.status==="rejected"&&i(u.reason);return e().catch(i)})},nK=g.lazy(()=>tK(()=>Promise.resolve().then(()=>OZ),void 0)),rK={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"},sK={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},iK={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"},xd=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:f,role:h="status",busy:p=!1,className:v=""})=>{const y=g.useCallback(_=>{_&&f&&(Te==null||Te.capture("status_surface_shown",{state:f,tone:i,fill:a}))},[f,i,a]),x=!!(e||n||r||c||s!=null&&s.length);return S.jsxs("div",{ref:y,className:`${rK[a]} ${v}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":f,children:[t?S.jsx("div",{className:"absolute inset-0",children:t}):null,x?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:sK[u],children:n}):null,r?S.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,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:iK[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},wd=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?S.jsx(xd,{...r,size:n,busy:!0,backdrop:S.jsx(sA,{trackGlobalLoaderCount:e})}):t==="logo"?S.jsx(xd,{...r,size:n,busy:!0,backdrop:S.jsx(g.Suspense,{fallback:null,children:S.jsx(nK,{className:"absolute inset-0"})})}):S.jsx(xd,{...r,size:n,busy:!0,media:S.jsx(o0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),lA=({icon:t,...e})=>S.jsx(xd,{...e,tone:"neutral",media:t?S.jsx("div",{className:"text-content-muted",children:t}):void 0}),Tm=t=>S.jsx(xd,{...t,tone:"error",role:"alert"}),cC="/static/",oK=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(cC)}catch{return t.endsWith(cC)}},aK=({isInteractionDisabled:t=!1,framework:e,userPort:n,activeDemoSessionId:r=null,holdPreviewNavigation:s=!1})=>{const i=Xe(l_),a=st(l_),u=Xe(Sm),c=st(Sm),f=Xe(pf),h=Xe(a0),p=Xe(u_),v=Xe(c_),y=Xe(KT),x=Xe(ZT),_=st(c_),b=Xe(qo),E=Xe(f_),C=st(u_),P=f.active&&f.projectContext.kind==="fresh",T=Xe(d_),A=f.active?f.variants.find(je=>je.workItemId===T&&(je.status==="pending"||je.status==="running"||je.status==="succeeded"&&!je.preview&&typeof je.port!="number"&&!je.previewUnavailable))??null:null,O=f.active&&f.variants.some(je=>je.status==="pending"||je.status==="running"),M=P||O,R=f.active?f.variants.find(je=>je.workItemId===T&&je.status==="succeeded"&&!!je.previewUnavailable)??null:null,L=e==="static"&&u!==null&&oK(u);g.useEffect(()=>{f.active||C(!1)},[f.active,C]);const N=g.useRef(!1);g.useEffect(()=>{const je=!!(b!=null&&b.left||b!=null&&b.right),Qe=je&&!N.current;N.current=je;const lt=f.active?f.sessionId:null;!lt||!qG({enteringSplit:Qe,isExistingSession:f.active&&f.projectContext.kind==="existing",hasActiveVariantProxy:p&&v!==null})||(C(!1),_(null),a(Je=>Je+1),fetch(`/api/variants/${encodeURIComponent(lt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[b,f,p,v,C,_,a]);const V=g.useMemo(()=>{var xn;if(p||u&&!L||!f.active)return null;const{stage:je,variants:Qe}=f,lt=je==="ready"||je==="degraded",Je=Qe.some(zt=>{var An,Xn;return((An=zt.refinement)==null?void 0:An.status)==="pending"||((Xn=zt.refinement)==null?void 0:Xn.status)==="running"});if(!lt&&!Je)return null;const vt=Qe.find(zt=>{var An;return zt.status==="succeeded"&&((An=zt.preview)==null?void 0:An.kind)==="static_artifact"});return((xn=vt==null?void 0:vt.preview)==null?void 0:xn.kind)==="static_artifact"?vt.preview.url:null},[L,u,p,f])??u,G=g.useMemo(()=>!f.active||!V?null:f.variants.find(je=>{var Qe;return((Qe=je.preview)==null?void 0:Qe.kind)==="static_artifact"&&V.startsWith(je.preview.url)})??null,[V,f]),Y=g.useMemo(()=>{if((E==null?void 0:E.previewKind)==="static")return{kind:"variant",sessionId:E.sessionId,variantId:E.variantId};if(!f.active)return bm;if(G)return{kind:"variant",sessionId:f.sessionId,variantId:G.workItemId};if(V){const Qe=V.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),lt=Qe!=null&&Qe[1]?decodeURIComponent(Qe[1]):null,Je=Qe!=null&&Qe[2]?decodeURIComponent(Qe[2]):null;if(lt===f.sessionId&&Je&&f.variants.some(zt=>zt.workItemId===Je))return{kind:"variant",sessionId:f.sessionId,variantId:Je};const vt=V.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),xn=vt!=null&&vt[1]?decodeURIComponent(vt[1]):null;if(xn&&f.variants.some(zt=>zt.workItemId===xn))return{kind:"variant",sessionId:f.sessionId,variantId:xn}}const je=!!(b!=null&&b.left||b!=null&&b.right);return(!je||P)&&!V&&p&&v&&f.variants.some(Qe=>Qe.workItemId===v)?{kind:"variant",sessionId:f.sessionId,variantId:v}:(!je||P)&&!V&&T&&f.variants.some(Qe=>Qe.workItemId===T)?{kind:"variant",sessionId:f.sessionId,variantId:T}:bm},[E,G,f,p,v,V,b,P,T]),K=g.useRef(null);g.useEffect(()=>{var Je,vt;if(!G||((Je=G.preview)==null?void 0:Je.kind)!=="static_artifact"||((vt=G.refinement)==null?void 0:vt.status)!=="succeeded")return;const je=`${G.workItemId}:${G.refinement.workItemId}`;if(K.current===je)return;K.current=je;const Qe=G.preview.url.includes("?")?"&":"?",lt=`${G.preview.url}${Qe}refinement=${encodeURIComponent(G.refinement.workItemId)}`;V!==lt&&(c(lt),a(xn=>xn+1))},[V,G,a,c,f]);const B=V!==null&&OW(V),X=V!==null&&!B||P&&!p&&!B,{isUpstreamReady:$,iframeRemountKey:ee,probeAttemptCount:H,initialProbeComplete:D}=ZG(e,{rerunProbeImmediatelyOnVersion:i,probePath:B?V:null,skip:X}),[q,re]=g.useState(()=>y&&$?i:null),se=g.useRef(null);g.useEffect(()=>{if(!y){se.current=null,re(null);return}if(q===i){se.current=null;return}const je=se.current;if(!je||je.remountKey!==i){se.current={remountKey:i,probeAttemptCount:H};return}$&&H>je.probeAttemptCount&&(se.current=null,re(i))},[q,i,y,H,$]);const ue=V!==null&&!B||$,ie=x||y&&q!==i||y&&!ue,ae=`${ee}:${i}`,me=r?`/try/${encodeURIComponent(r)}`:"",Se=eA(window.location.pathname),Re=e==="static"?`${me}/static${Se??"/"}`:`${me}${Se??"/"}`,Ke=iA(h);let it=null;V&&(it=oA({agentApplyMode:h,url:V}));const at=A||ie?"about:blank":(B&&!ue?"about:blank":it)??(s||!ue?"about:blank":`${Ke}${Re}`),It=!!A||!!R||!ue&&D;let mt=null;return ie?mt=S.jsx(wd,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):A?mt=A.status==="succeeded"?S.jsx(wd,{fill:"overlay",loader:"spinner",state:"variant_building",title:"Starting preview",description:"Its preview server is starting up."}):S.jsx(wd,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:S.jsx("span",{className:"sr-only",children:"Building your direction"})}):R?mt=S.jsx(Tm,{fill:"overlay",state:"preview_unavailable",title:"Preview couldn’t start",description:"Its preview server didn’t start.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]}):It&&(mt=M?S.jsx(lA,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):S.jsx(Tm,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),S.jsxs("div",{className:"relative h-full w-full",children:[mt,S.jsx(aA,{target:Y,src:at,framework:e,remountKey:ae})]})};function dC({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var E;const u=st(qo),c=Xe(pf),f=Xe(a0),h=g.useRef(!1),p=g.useCallback(()=>{h.current||(h.current=!0,Zd({source:i,sessionId:e,variantId:n}))},[i,e,n]),v=g.useCallback(()=>{if(a){u(null);return}p(),u(C=>{if(!C)return null;const P={...C};return delete P[t],P.left||P.right?P:null})},[u,t,a,p]),y=g.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=g.useMemo(()=>!c.active||c.sessionId!==e?null:c.variants.find(C=>C.workItemId===n)??null,[e,n,c]),_=g.useMemo(()=>{var P,T;let C=r;if(((P=x==null?void 0:x.preview)==null?void 0:P.kind)==="static_artifact"&&((T=x.refinement)==null?void 0:T.status)==="succeeded"){const A=x.preview.url.includes("?")?"&":"?";C=`${x.preview.url}${A}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return oA({agentApplyMode:f,url:C})},[f,x,r]),b=((E=x==null?void 0:x.refinement)==null?void 0:E.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(Fo,{label:"Collapse",children:S.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:v,"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(aA,{target:y,src:_,framework:"static",remountKey:b})})]})}const fC=240;function lK(){const t=Xe(Wd),e=Xe(X2),n=g.useRef(null);return g.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-fC/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:S.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:fC},children:S.jsxs("div",{className:"variant-drag-ghost-body",children:[S.jsxs("div",{className:"variant-drag-ghost-row",children:[S.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?S.jsx("div",{className:"variant-drag-ghost-tag",style:DT(t.runLabel),children:t.runLabel}):null]}),t.description?S.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function uK(){const t=Xe(Wd),e=Xe(X2),n=Xe(qo),r=st(Wd),s=st(qo),i=g.useRef(null),[a,u]=g.useState(null),[c,f]=g.useState("hidden");g.useEffect(()=>{if(!t){f("hidden"),u(null);return}const v=requestAnimationFrame(()=>f("visible"));return()=>cancelAnimationFrame(v)},[t]);const h=g.useCallback((v,y)=>{const x=i.current;if(!x)return null;const _=x.getBoundingClientRect();return v<_.left||v>_.right||y<_.top||y>_.bottom?null:v<(_.left+_.right)/2?"left":"right"},[]);if(g.useEffect(()=>{if(!t||!e)return;const v=h(e.x,e.y);u(y=>y===v?y:v)},[t,e,h]),g.useEffect(()=>{if(!t)return;const v=y=>{const x=h(y.clientX,y.clientY);if(x&&t.url){const _={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[x];b&&(b.sessionId!==_.sessionId||b.variantId!==_.variantId)&&Zd(b),s(E=>({...E??{},[x]:_})),f("exiting"),window.setTimeout(()=>r(null),220)}else Zd(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,h,r,s,n]),!t)return null;const p=["variant-drop-zones",c==="visible"&&"is-visible",c==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return S.jsxs("div",{ref:i,className:p,"aria-hidden":"true",children:[S.jsx(hC,{side:"left",hovered:a==="left",canDrop:!!t.url,label:t.label}),S.jsx(hC,{side:"right",hovered:a==="right",canDrop:!!t.url,label:t.label})]})}function hC({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 uA=(t,e,n)=>{var i,a;if(!t.active||t.sessionId!==e)return null;const r=t.variants.find(u=>u.workItemId===n);if(((i=r==null?void 0:r.preview)==null?void 0:i.kind)!=="static_artifact")return null;if(((a=r.refinement)==null?void 0:a.status)!=="succeeded")return r.preview.url;const s=r.preview.url.includes("?")?"&":"?";return`${r.preview.url}${s}refinement=${encodeURIComponent(r.refinement.workItemId)}`},pC=(t,e)=>{if(!t)return;const n=uA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},cK=()=>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(sA,{trackGlobalLoaderCount:!1})})}),dK=({isLoading:t=!1,isInteractionDisabled:e=!1,activeDemoSessionId:n=null,holdHostedTryoutPreviewNavigation:r=!1})=>{const{config:s,fetchConfig:i,isLoading:a,error:u}=TG();return g.useEffect(()=>{i().catch(c=>{Te==null||Te.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})},[i]),a?r?S.jsx("div",{className:"bg-main flex h-full min-h-0 w-full flex-1","aria-busy":"true"}):S.jsx(cK,{}):u||!s?S.jsx(Tm,{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:()=>{Te==null||Te.capture("preview_config_retry_clicked"),i().catch(c=>{Te==null||Te.capture("preview_config_load_failed",{message:c instanceof Error?c.message:"unknown_error"})})}}]}):S.jsx(fK,{isLoading:t,isInteractionDisabled:e,framework:s.framework,userPort:s.userPort,activeDemoSessionId:n,holdHostedTryoutPreviewNavigation:r})};function fK(t){const e=Xe(qo),n=Xe(Wd),r=Xe(pf),s=Xe(Sm),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=g.useMemo(()=>{var A,O;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const _=(A=i??a)==null?void 0:A.variantId,b=r.variants.filter(M=>{var R;return M.status==="succeeded"&&((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.workItemId!==_}),E=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),P=b.find(M=>{var R;return((R=M.preview)==null?void 0:R.kind)==="static_artifact"&&M.preview.url===E})??b[0];if(((O=P==null?void 0:P.preview)==null?void 0:O.kind)!=="static_artifact")return;const T=uA(r,r.sessionId,P.workItemId);if(T)return{sessionId:r.sessionId,variantId:P.workItemId,label:P.label,url:T,source:"live"}},[r,i,a,s]),c=pC(i,r)??(a?u:void 0),f=pC(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!f,v=!!(c||f),y=S.jsx(aK,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort,activeDemoSessionId:t.activeDemoSessionId,holdPreviewNavigation:t.holdHostedTryoutPreviewNavigation});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":""} ${v?"is-split":""}`,children:[S.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&S.jsx(dC,{side:"left",sessionId:c.sessionId,variantId:c.variantId,url:c.url,label:c.label,source:c.source,isFallback:h},`left-${c.sessionId}:${c.variantId}:${c.url}`),!(c&&f)&&S.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:y}),f&&S.jsx(dC,{side:"right",sessionId:f.sessionId,variantId:f.variantId,url:f.url,label:f.label,source:f.source,isFallback:p},`right-${f.sessionId}:${f.variantId}:${f.url}`)]}),S.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),S.jsx(uK,{}),S.jsx(lK,{})]})})}const cA=({message:t,isLoading:e=!0})=>S.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?S.jsx(o0,{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})]});function ji(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
112
- * GSAP 3.15.0
113
- * https://gsap.com
114
- *
115
- * @license Copyright 2008-2026, GreenSock. All rights reserved.
116
- * Subject to the terms at https://gsap.com/standard-license
117
- * @author: Jack Doyle, jack@greensock.com
118
- */var Wr={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},qd={duration:.5,overwrite:!1,delay:0},mx,Hn,Ht,us=1e8,St=1/us,w_=Math.PI*2,hK=w_/4,pK=0,fA=Math.sqrt,mK=Math.cos,gK=Math.sin,Tn=function(e){return typeof e=="string"},tn=function(e){return typeof e=="function"},Yi=function(e){return typeof e=="number"},gx=function(e){return typeof e>"u"},fi=function(e){return typeof e=="object"},br=function(e){return e!==!1},vx=function(){return typeof window<"u"},sp=function(e){return tn(e)||Tn(e)},hA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Yn=Array.isArray,vK=/random\([^)]+\)/g,yK=/,\s*/g,mC=/(?:-?\.?\d|\.)+/gi,pA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,su=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,f1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,mA=/[+-]=-?[.\d]+/,_K=/[^,'"\[\]\s]+/gi,xK=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Zt,Ys,b_,yx,Gr={},Am={},gA,vA=function(e){return(Am=Hu(e,Gr))&&Cr},_x=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},Yd=function(e,n){return!n&&console.warn(e)},yA=function(e,n){return e&&(Gr[e]=n)&&Am&&(Am[e]=n)||Gr},Xd=function(){return 0},wK={suppressEvents:!0,isStart:!0,kill:!1},Tp={suppressEvents:!0,kill:!1},bK={suppressEvents:!0},xx={},Uo=[],S_={},_A,Dr={},h1={},gC=30,Ap=[],wx="",bx=function(e){var n=e[0],r,s;if(fi(n)||tn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=Ap.length;s--&&!Ap[s].targetTest(n););r=Ap[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new HA(e[s],r)))||e.splice(s,1);return e},ol=function(e){return e._gsap||bx(cs(e))[0]._gsap},xA=function(e,n,r){return(r=e[n])&&tn(r)?e[n]():gx(r)&&e.getAttribute&&e.getAttribute(n)||r},Sr=function(e,n){return(e=e.split(",")).forEach(n)||e},an=function(e){return Math.round(e*1e5)/1e5||0},Kt=function(e){return Math.round(e*1e7)/1e7||0},fu=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},SK=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},Rm=function(){var e=Uo.length,n=Uo.slice(0),r,s;for(S_={},Uo.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},Sx=function(e){return!!(e._initted||e._startAt||e.add)},wA=function(e,n,r,s){Uo.length&&!Hn&&Rm(),e.render(n,r,!!(Hn&&n<0&&Sx(e))),Uo.length&&!Hn&&Rm()},bA=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(_K).length<2?n:Tn(e)?e.trim():e},SA=function(e){return e},Kr=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},EK=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},Hu=function(e,n){for(var r in n)e[r]=n[r];return e},vC=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=fi(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},Im=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},bd=function(e){var n=e.parent||Zt,r=e.keyframes?EK(Yn(e.keyframes)):Kr;if(br(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},kK=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},EA=function(e,n,r,s,i){var a=e[s],u;if(i)for(u=n[i];a&&a[i]>u;)a=a._prev;return a?(n._next=a._next,a._next=n):(n._next=e[r],e[r]=n),n._next?n._next._prev=n:e[s]=n,n._prev=a,n.parent=n._dp=e,n},y0=function(e,n,r,s){r===void 0&&(r="_first"),s===void 0&&(s="_last");var i=n._prev,a=n._next;i?i._next=a:e[r]===n&&(e[r]=a),a?a._prev=i:e[s]===n&&(e[s]=i),n._next=n._prev=n.parent=null},Qo=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},al=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},CK=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},E_=function(e,n,r,s){return e._startAt&&(Hn?e._startAt.revert(Tp):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},PK=function t(e){return!e||e._ts&&t(e.parent)},yC=function(e){return e._repeat?zu(e._tTime,e=e.duration()+e._rDelay)*e:0},zu=function(e,n){var r=Math.floor(e=Kt(e/n));return e&&r===e?r-1:r},Mm=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},_0=function(e){return e._end=Kt(e._start+(e._tDur/Math.abs(e._ts||e._rts||St)||0))},x0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Kt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),_0(e),r._dirty||al(r,e)),e},kA=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=Mm(e.rawTime(),n),(!n._dur||_f(0,n.totalDuration(),r)-n._tTime>St)&&n.render(r,!0)),al(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=-St}},ri=function(e,n,r,s){return n.parent&&Qo(n),n._start=Kt((Yi(r)?r:r||e!==Zt?ss(e,r,n):e._time)+n._delay),n._end=Kt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),EA(e,n,"_first","_last",e._sort?"_start":0),k_(n)||(e._recent=n),s||kA(e,n),e._ts<0&&x0(e,e._tTime),e},CA=function(e,n){return(Gr.ScrollTrigger||_x("scrollTrigger",n))&&Gr.ScrollTrigger.create(n,e)},PA=function(e,n,r,s,i){if(kx(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!Hn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&_A!==Fr.frame)return Uo.push(e),e._lazy=[i,s],1},TK=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},k_=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},AK=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&TK(e)&&!(!e._initted&&k_(e))||(e._ts<0||e._dp._ts<0)&&!k_(e))?0:1,u=e._rDelay,c=0,f,h,p;if(u&&e._repeat&&(c=_f(0,e._tDur,n),h=zu(c,u),e._yoyo&&h&1&&(a=1-a),h!==zu(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||Hn||s||e._zTime===St||!n&&e._zTime){if(!e._initted&&PA(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?St:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,f=e._pt;f;)f.r(a,f.d),f=f._next;n<0&&E_(e,n,r,!0),e._onUpdate&&!r&&$r(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&$r(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&Qo(e,1),!r&&!Hn&&($r(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},RK=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}},Uu=function(e,n,r,s){var i=e._repeat,a=Kt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Kt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&x0(e,e._tTime=e._tDur*u),e.parent&&_0(e),r||al(e.parent,e),e},_C=function(e){return e instanceof xr?al(e):Uu(e,e._dur)},IK={_start:0,endTime:Xd,totalDuration:Xd},ss=function t(e,n,r){var s=e.labels,i=e._recent||IK,a=e.duration()>=us?i.endTime(!1):e._dur,u,c,f;return Tn(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),f=n.substr(-1)==="%",u=n.indexOf("="),c==="<"||c===">"?(u>=0&&(n=n.replace(/=/,"")),(c==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(n.substr(1))||0)*(f?(u<0?i:r).totalDuration()/100:1)):u<0?(n in s||(s[n]=a),s[n]):(c=parseFloat(n.charAt(u-1)+n.substr(u+1)),f&&r&&(c=c/100*(Yn(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},Sd=function(e,n,r){var s=Yi(n[1]),i=(s?2:1)+(e<2?0:1),a=n[i],u,c;if(s&&(a.duration=n[1]),a.parent=r,e){for(u=a,c=r;c&&!("immediateRender"in u);)u=c.vars.defaults||{},c=br(c.vars.inherit)&&c.parent;a.immediateRender=br(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new dn(n[0],a,n[i+1])},ia=function(e,n){return e||e===0?n(e):n},_f=function(e,n,r){return r<e?e:r>n?n:r},qn=function(e,n){return!Tn(e)||!(n=xK.exec(e))?"":n[1]},MK=function(e,n,r){return ia(r,function(s){return _f(e,n,s)})},C_=[].slice,TA=function(e,n){return e&&fi(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&fi(e[0]))&&!e.nodeType&&e!==Ys},LK=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Tn(s)&&!n||TA(s,1)?(i=r).push.apply(i,cs(s)):r.push(s)})||r},cs=function(e,n,r){return Ht&&!n&&Ht.selector?Ht.selector(e):Tn(e)&&!r&&(b_||!Bu())?C_.call((n||yx).querySelectorAll(e),0):Yn(e)?LK(e,r):TA(e)?C_.call(e,0):e?[e]:[]},P_=function(e){return e=cs(e)[0]||Yd("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return cs(n,r.querySelectorAll?r:r===e?Yd("Invalid scope")||yx.createElement("div"):e)}},AA=function(e){return e.sort(function(){return .5-Math.random()})},RA=function(e){if(tn(e))return e;var n=fi(e)?e:{each:e},r=ll(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,f=n.axis,h=s,p=s;return Tn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(v,y,x){var _=(x||n).length,b=a[_],E,C,P,T,A,O,M,R,L;if(!b){if(L=n.grid==="auto"?0:(n.grid||[1,us])[1],!L){for(M=-us;M<(M=x[L++].getBoundingClientRect().left)&&L<_;);L<_&&L--}for(b=a[_]=[],E=c?Math.min(L,_)*h-.5:s%L,C=L===us?0:c?_*p/L-.5:s/L|0,M=0,R=us,O=0;O<_;O++)P=O%L-E,T=C-(O/L|0),b[O]=A=f?Math.abs(f==="y"?T:P):fA(P*P+T*T),A>M&&(M=A),A<R&&(R=A);s==="random"&&AA(b),b.max=M-R,b.min=R,b.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(L>_?_-1:f?f==="y"?_/L:L:Math.max(L,_/L))||0)*(s==="edges"?-1:1),b.b=_<0?i-_:i,b.u=qn(n.amount||n.each)||0,r=r&&_<0?GK(r):r}return _=(b[v]-b.min)/b.max||0,Kt(b.b+(r?r(_):_)*b.v)+b.u}},T_=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Kt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(Yi(r)?0:qn(r))}},IA=function(e,n){var r=Yn(e),s,i;return!r&&fi(e)&&(s=r=e.radius||us,e.values?(e=cs(e.values),(i=!Yi(e[0]))&&(s*=s)):e=T_(e.increment)),ia(n,r?tn(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var u=parseFloat(i?a.x:a),c=parseFloat(i?a.y:0),f=us,h=0,p=e.length,v,y;p--;)i?(v=e[p].x-u,y=e[p].y-c,v=v*v+y*y):v=Math.abs(e[p]-u),v<f&&(f=v,h=p);return h=!s||f<=s?e[h]:a,i||h===a||Yi(a)?h:h+qn(a)}:T_(e))},MA=function(e,n,r,s){return ia(Yn(e)?!n:r===!0?!!(r=0):!s,function(){return Yn(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})},OK=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,a){return a(i)},s)}},NK=function(e,n){return function(r){return e(parseFloat(r))+(n||qn(r))}},DK=function(e,n,r){return OA(e,n,0,1,r)},LA=function(e,n,r){return ia(r,function(s){return e[~~n(s)]})},jK=function t(e,n,r){var s=n-e;return Yn(e)?LA(e,t(0,e.length),n):ia(r,function(i){return(s+(i-e)%s)%s+e})},FK=function t(e,n,r){var s=n-e,i=s*2;return Yn(e)?LA(e,t(0,e.length-1),n):ia(r,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},Qd=function(e){return e.replace(vK,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(yK);return MA(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},OA=function(e,n,r,s,i){var a=n-e,u=s-r;return ia(i,function(c){return r+((c-e)/a*u||0)})},VK=function t(e,n,r,s){var i=isNaN(e+n)?0:function(y){return(1-y)*e+y*n};if(!i){var a=Tn(e),u={},c,f,h,p,v;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(Yn(e)&&!Yn(n)){for(h=[],p=e.length,v=p-2,f=1;f<p;f++)h.push(t(e[f-1],e[f]));p--,i=function(x){x*=p;var _=Math.min(v,~~x);return h[_](x-_)},r=n}else s||(e=Hu(Yn(e)?[]:{},e));if(!h){for(c in n)Ex.call(u,e,c,"get",n[c]);i=function(x){return Tx(x,u)||(a?e.p:e)}}}return ia(r,i)},xC=function(e,n,r){var s=e.labels,i=us,a,u,c;for(a in s)u=s[a]-n,u<0==!!r&&u&&i>(u=Math.abs(u))&&(c=a,i=u);return c},$r=function(e,n,r){var s=e.vars,i=s[n],a=Ht,u=e._ctx,c,f,h;if(i)return c=s[n+"Params"],f=s.callbackScope||e,r&&Uo.length&&Rm(),u&&(Ht=u),h=c?i.apply(f,c):i.call(f),Ht=a,h},ad=function(e){return Qo(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Hn),e.progress()<1&&$r(e,"onInterrupt"),e},iu,NA=[],DA=function(e){if(e)if(e=!e.name&&e.default||e,vx()||e.headless){var n=e.name,r=tn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:Xd,render:Tx,add:Ex,kill:nZ,modifier:tZ,rawVars:0},a={targetTest:0,get:0,getSetter:Px,aliases:{},register:0};if(Bu(),e!==s){if(Dr[n])return;Kr(s,Kr(Im(e,i),a)),Hu(s.prototype,Hu(i,Im(e,a))),Dr[s.prop=n]=s,e.targetTest&&(Ap.push(s),xx[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}yA(n,s),e.register&&e.register(Cr,s,Er)}else NA.push(e)},xt=255,ld={aqua:[0,xt,xt],lime:[0,xt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,xt],navy:[0,0,128],white:[xt,xt,xt],olive:[128,128,0],yellow:[xt,xt,0],orange:[xt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[xt,0,0],pink:[xt,192,203],cyan:[0,xt,xt],transparent:[xt,xt,xt,0]},p1=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)*xt+.5|0},jA=function(e,n,r){var s=e?Yi(e)?[e>>16,e>>8&xt,e&xt]:0:ld.black,i,a,u,c,f,h,p,v,y,x;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),ld[e])s=ld[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),u=e.charAt(3),e="#"+i+i+a+a+u+u+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&xt,s&xt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&xt,e&xt]}else if(e.substr(0,3)==="hsl"){if(s=x=e.match(mC),!n)c=+s[0]%360/360,f=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(f+1):h+f-h*f,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=p1(c+1/3,i,a),s[1]=p1(c,i,a),s[2]=p1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(pA),r&&s.length<4&&(s[3]=1),s}else s=e.match(mC)||ld.transparent;s=s.map(Number)}return n&&!x&&(i=s[0]/xt,a=s[1]/xt,u=s[2]/xt,p=Math.max(i,a,u),v=Math.min(i,a,u),h=(p+v)/2,p===v?c=f=0:(y=p-v,f=h>.5?y/(2-p-v):y/(p+v),c=p===i?(a-u)/y+(a<u?6:0):p===a?(u-i)/y+2:(i-a)/y+4,c*=60),s[0]=~~(c+.5),s[1]=~~(f*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},FA=function(e){var n=[],r=[],s=-1;return e.split(Bo).forEach(function(i){var a=i.match(su)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},wC=function(e,n,r){var s="",i=(e+s).match(Bo),a=n?"hsla(":"rgba(",u=0,c,f,h,p;if(!i)return e;if(i=i.map(function(v){return(v=jA(v,n,1))&&a+(n?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),r&&(h=FA(e),c=r.c,c.join(s)!==h.c.join(s)))for(f=e.replace(Bo,"1").split(su),p=f.length-1;u<p;u++)s+=f[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!f)for(f=e.split(Bo),p=f.length-1;u<p;u++)s+=f[u]+i[u];return s+f[p]},Bo=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ld)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),$K=/hsl[a]?\(/,VA=function(e){var n=e.join(" "),r;if(Bo.lastIndex=0,Bo.test(n))return r=$K.test(n),e[1]=wC(e[1],r),e[0]=wC(e[0],r,FA(e[1])),!0},Jd,Fr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,f,h,p,v,y,x=function _(b){var E=t()-s,C=b===!0,P,T,A,O;if((E>e||E<0)&&(r+=E-n),s+=E,A=s-r,P=A-a,(P>0||C)&&(O=++p.frame,v=A-p.time*1e3,p.time=A=A/1e3,a+=P+(P>=i?4:i-P),T=1),C||(c=f(_)),T)for(y=0;y<u.length;y++)u[y](A,v,O,b)};return p={time:0,frame:0,tick:function(){x(!0)},deltaRatio:function(b){return v/(1e3/(b||60))},wake:function(){gA&&(!b_&&vx()&&(Ys=b_=window,yx=Ys.document||{},Gr.gsap=Cr,(Ys.gsapVersions||(Ys.gsapVersions=[])).push(Cr.version),vA(Am||Ys.GreenSockGlobals||!Ys.gsap&&Ys||{}),NA.forEach(DA)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),f=h||function(b){return setTimeout(b,a-p.time*1e3+1|0)},Jd=1,x(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),Jd=0,f=Xd},lagSmoothing:function(b,E){e=b||1/0,n=Math.min(E||33,e)},fps:function(b){i=1e3/(b||240),a=p.time*1e3+i},add:function(b,E,C){var P=E?function(T,A,O,M){b(T,A,O,M),p.remove(P)}:b;return p.remove(b),u[C?"unshift":"push"](P),Bu(),P},remove:function(b,E){~(E=u.indexOf(b))&&u.splice(E,1)&&y>=E&&y--},_listeners:u},p})(),Bu=function(){return!Jd&&Fr.wake()},ct={},HK=/^[\d.\-M][\d.\-,\s]/,zK=/["']/g,UK=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,f;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,f=c.substr(0,u),n[s]=isNaN(f)?f.replace(zK,"").trim():+f,s=c.substr(u+1).trim();return n},BK=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)},WK=function(e){var n=(e+"").split("("),r=ct[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[UK(n[1])]:BK(e).split(",").map(bA)):ct._CE&&HK.test(e)?ct._CE("",e):r},GK=function(e){return function(n){return 1-e(1-n)}},ll=function(e,n){return e&&(tn(e)?e:ct[e]||WK(e))||n},pl=function(e,n,r,s){r===void 0&&(r=function(c){return 1-n(1-c)}),s===void 0&&(s=function(c){return c<.5?n(c*2)/2:1-n((1-c)*2)/2});var i={easeIn:n,easeOut:r,easeInOut:s},a;return Sr(e,function(u){ct[u]=Gr[u]=i,ct[a=u.toLowerCase()]=r;for(var c in i)ct[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ct[u+"."+c]=i[c]}),i},$A=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},m1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/w_*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*gK((h-a)*i)+1},c=e==="out"?u:e==="in"?function(f){return 1-u(1-f)}:$A(u);return i=w_/i,c.config=function(f,h){return t(e,f,h)},c},g1=function t(e,n){n===void 0&&(n=1.70158);var r=function(a){return a?--a*a*((n+1)*a+n)+1:0},s=e==="out"?r:e==="in"?function(i){return 1-r(1-i)}:$A(r);return s.config=function(i){return t(e,i)},s};Sr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;pl(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})});ct.Linear.easeNone=ct.none=ct.Linear.easeIn;pl("Elastic",m1("in"),m1("out"),m1());(function(t,e){var n=1/e,r=2*n,s=2.5*n,i=function(u){return u<n?t*u*u:u<r?t*Math.pow(u-1.5/e,2)+.75:u<s?t*(u-=2.25/e)*u+.9375:t*Math.pow(u-2.625/e,2)+.984375};pl("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);pl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});pl("Circ",function(t){return-(fA(1-t*t)-1)});pl("Sine",function(t){return t===1?1:-mK(t*hK)+1});pl("Back",g1("in"),g1("out"),g1());ct.SteppedEase=ct.steps=Gr.SteppedEase={config:function(e,n){e===void 0&&(e=1);var r=1/e,s=e+(n?0:1),i=n?1:0,a=1-St;return function(u){return((s*_f(0,a,u)|0)+i)*r}}};qd.ease=ct["quad.out"];Sr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return wx+=t+","+t+"Params,"});var HA=function(e,n){this.id=pK++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:xA,this.set=n?n.getSetter:Px},ef=(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,Uu(this,+n.duration,1,1),this.data=n.data,Ht&&(this._ctx=Ht,Ht.data.push(this)),Jd||Fr.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,Uu(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(Bu(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(x0(this,r),!i._dp||i.parent||kA(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)&&ri(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===St||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),wA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+yC(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)+yC(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?zu(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-St?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?Mm(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-St?0:this._rts,this.totalTime(_f(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),_0(this),CK(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):(Bu(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==St&&(this._tTime-=St)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Kt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&ri(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(br(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?Mm(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=bK);var s=Hn;return Hn=r,Sx(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Hn=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,_C(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,_C(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(ss(this,r),br(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,br(s)),this._dur||(this._zTime=-St),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?-St:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-St,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)-St)},e.eventCallback=function(r,s,i){var a=this.vars;return arguments.length>1?(s?(a[r]=s,i&&(a[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=s)):delete a[r],this):a[r]},e.then=function(r){var s=this,i=s._prom;return new Promise(function(a){var u=tn(r)?r:SA,c=function(){var h=s.then;s.then=null,i&&i(),tn(u)&&(u=u(s))&&(u.then||u===s)&&(s.then=h),a(u),s.then=h};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?c():s._prom=c})},e.kill=function(){ad(this)},t})();Kr(ef.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:-St,_prom:0,_ps:!1,_rts:1});var xr=(function(t){dA(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=br(r.sortChildren),Zt&&ri(r.parent||Zt,ji(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&CA(ji(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return Sd(0,arguments,this),this},n.from=function(s,i,a){return Sd(1,arguments,this),this},n.fromTo=function(s,i,a,u){return Sd(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,bd(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new dn(s,i,ss(this,a),1),this},n.call=function(s,i,a){return ri(this,dn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,f,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=f,a.onCompleteParams=h,a.parent=this,new dn(s,a,ss(this,c)),this},n.staggerFrom=function(s,i,a,u,c,f,h){return a.runBackwards=1,bd(a).immediateRender=br(a.immediateRender),this.staggerTo(s,i,a,u,c,f,h)},n.staggerFromTo=function(s,i,a,u,c,f,h,p){return u.startAt=a,bd(u).immediateRender=br(u.immediateRender),this.staggerTo(s,i,u,c,f,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,f=this._dur,h=s<=0?0:Kt(s),p=this._zTime<0!=s<0&&(this._initted||!f),v,y,x,_,b,E,C,P,T,A,O,M;if(this!==Zt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&f&&(h+=this._time-u,s+=this._time-u),v=h,T=this._start,P=this._ts,E=!P,p&&(f||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(O=this._yoyo,b=f+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(b*100+s,i,a);if(v=Kt(h%b),h===c?(_=this._repeat,v=f):(A=Kt(h/b),_=~~A,_&&_===A&&(v=f,_--),v>f&&(v=f)),A=zu(this._tTime,b),!u&&this._tTime&&A!==_&&this._tTime-A*b-this._dur<=0&&(A=_),O&&_&1&&(v=f-v,M=1),_!==A&&!this._lock){var R=O&&A&1,L=R===(O&&_&1);if(_<A&&(R=!R),u=R?0:h%f?f:h,this._lock=1,this.render(u||(M?0:Kt(_*b)),i,!f)._lock=0,this._tTime=h,!i&&this.parent&&$r(this,"onRepeat"),this.vars.repeatRefresh&&!M&&(this.invalidate()._lock=1,A=_),u&&u!==this._time||E!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(f=this._dur,c=this._tDur,L&&(this._lock=2,u=R?f:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!M&&this.invalidate()),this._lock=0,!this._ts&&!E)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(C=RK(this,Kt(u),Kt(v)),C&&(h-=v-(v=C._start))),this._tTime=h,this._time=v,this._act=!!P,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&f&&!i&&!A&&($r(this,"onStart"),this._tTime!==h))return this;if(v>=u&&s>=0)for(y=this._first;y;){if(x=y._next,(y._act||v>=y._start)&&y._ts&&C!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(v-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(v-y._start)*y._ts,i,a),v!==this._time||!this._ts&&!E){C=0,x&&(h+=this._zTime=-St);break}}y=x}else{y=this._last;for(var N=s<0?s:v;y;){if(x=y._prev,(y._act||N<=y._end)&&y._ts&&C!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(N-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(N-y._start)*y._ts,i,a||Hn&&Sx(y)),v!==this._time||!this._ts&&!E){C=0,x&&(h+=this._zTime=N?-St:St);break}}y=x}}if(C&&!i&&(this.pause(),C.render(v>=u?0:-St)._zTime=v>=u?1:-1,this._ts))return this._start=T,_0(this),this.render(s,i,a);this._onUpdate&&!i&&$r(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(T===this._start||Math.abs(P)!==Math.abs(this._ts))&&(this._lock||((s||!f)&&(h===c&&this._ts>0||!h&&this._ts<0)&&Qo(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&($r(this,h===c&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<c&&this.timeScale()>0)&&this._prom())))}return this},n.add=function(s,i){var a=this;if(Yi(i)||(i=ss(this,i,s)),!(s instanceof ef)){if(Yn(s))return s.forEach(function(u){return a.add(u,i)}),this;if(Tn(s))return this.addLabel(s,i);if(tn(s))s=dn.delayedCall(0,s);else return this}return this!==s?ri(this,s,i):this},n.getChildren=function(s,i,a,u){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),u===void 0&&(u=-us);for(var c=[],f=this._first;f;)f._start>=u&&(f instanceof dn?i&&c.push(f):(a&&c.push(f),s&&c.push.apply(c,f.getChildren(!0,i,a)))),f=f._next;return c},n.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},n.remove=function(s){return Tn(s)?this.removeLabel(s):tn(s)?this.killTweensOf(s):(s.parent===this&&y0(this,s),s===this._recent&&(this._recent=this._last),al(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Kt(Fr.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]=ss(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=dn.delayedCall(0,i||Xd,a);return u.data="isPause",this._hasPause=1,ri(this,u,ss(this,s))},n.removePause=function(s){var i=this._first;for(s=ss(this,s);i;)i._start===s&&i.data==="isPause"&&Qo(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)Vo!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=cs(s),c=this._first,f=Yi(i),h;c;)c instanceof dn?SK(c._targets,u)&&(f?(!Vo||c._initted&&c._ts)&&c.globalTime(0)<=i&&c.globalTime(c.totalDuration())>i:!i||c.isActive())&&a.push(c):(h=c.getTweensOf(u,i)).length&&a.push.apply(a,h),c=c._next;return a},n.tweenTo=function(s,i){i=i||{};var a=this,u=ss(a,s),c=i,f=c.startAt,h=c.onStart,p=c.onStartParams,v=c.immediateRender,y,x=dn.to(a,Kr({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(f&&"time"in f?f.time:a._time))/a.timeScale())||St,onStart:function(){if(a.pause(),!y){var b=i.duration||Math.abs((u-(f&&"time"in f?f.time:a._time))/a.timeScale());x._dur!==b&&Uu(x,b,0,1).render(x._time,!0,!0),y=1}h&&h.apply(x,p||[])}},i));return v?x.render(0):x},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,Kr({startAt:{time:ss(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),xC(this,ss(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),xC(this,ss(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+St)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,f;for(s=Kt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(f in c)c[f]>=a&&(c[f]+=s);return al(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,a;i;)a=i._next,this.remove(i),i=a;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),al(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=us,f,h,p;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(p=a.parent;u;)f=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,ri(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Kt(h/a._ts),a._time-=h,a._tTime-=h),a.shiftChildren(-h,!1,-1/0),c=0),u._end>i&&u._ts&&(i=u._end),u=f;Uu(a,a===Zt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Zt._ts&&(wA(Zt,Mm(s,Zt)),_A=Fr.frame),Fr.frame>=gC){gC+=Wr.autoSleep||120;var i=Zt._first;if((!i||!i._ts)&&Wr.autoSleep&&Fr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Fr.sleep()}}},e})(ef);Kr(xr.prototype,{_lock:0,_hasPause:0,_forcing:0});var KK=function(e,n,r,s,i,a,u){var c=new Er(this._pt,e,n,0,1,KA,null,i),f=0,h=0,p,v,y,x,_,b,E,C;for(c.b=r,c.e=s,r+="",s+="",(E=~s.indexOf("random("))&&(s=Qd(s)),a&&(C=[r,s],a(C,e,n),r=C[0],s=C[1]),v=r.match(f1)||[];p=f1.exec(s);)x=p[0],_=s.substring(f,p.index),y?y=(y+1)%5:_.substr(-5)==="rgba("&&(y=1),x!==v[h++]&&(b=parseFloat(v[h-1])||0,c._pt={_next:c._pt,p:_||h===1?_:",",s:b,c:x.charAt(1)==="="?fu(b,x)-b:parseFloat(x)-b,m:y&&y<4?Math.round:0},f=f1.lastIndex);return c.c=f<s.length?s.substring(f,s.length):"",c.fp=u,(mA.test(s)||E)&&(c.e=0),this._pt=c,c},Ex=function(e,n,r,s,i,a,u,c,f,h){tn(s)&&(s=s(i||0,e,a));var p=e[n],v=r!=="get"?r:tn(p)?f?e[n.indexOf("set")||!tn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](f):e[n]():p,y=tn(p)?f?QK:WA:Cx,x;if(Tn(s)&&(~s.indexOf("random(")&&(s=Qd(s)),s.charAt(1)==="="&&(x=fu(v,s)+(qn(v)||0),(x||x===0)&&(s=x))),!h||v!==s||A_)return!isNaN(v*s)&&s!==""?(x=new Er(this._pt,e,n,+v||0,s-(v||0),typeof p=="boolean"?eZ:GA,0,y),f&&(x.fp=f),u&&x.modifier(u,this,e),this._pt=x):(!p&&!(n in e)&&_x(n,s),KK.call(this,e,n,v,s,y,c||Wr.stringFilter,f))},ZK=function(e,n,r,s,i){if(tn(e)&&(e=Ed(e,i,n,r,s)),!fi(e)||e.style&&e.nodeType||Yn(e)||hA(e))return Tn(e)?Ed(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=Ed(e[u],i,n,r,s);return a},zA=function(e,n,r,s,i,a){var u,c,f,h;if(Dr[e]&&(u=new Dr[e]).init(i,u.rawVars?n[e]:ZK(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new Er(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==iu))for(f=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)f[u._props[h]]=c;return u},Vo,A_,kx=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,f=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,v=s.keyframes,y=s.autoRevert,x=e._dur,_=e._startAt,b=e._targets,E=e.parent,C=E&&E.data==="nested"?E.vars.targets:b,P=e._overwrite==="auto"&&!mx,T=e.timeline,A=s.easeReverse||p,O,M,R,L,N,j,V,G,Y,K,B,X,$;if(T&&(!v||!i)&&(i="none"),e._ease=ll(i,qd.ease),e._rEase=A&&(ll(A)||e._ease),e._from=!T&&!!s.runBackwards,e._from&&(e.ratio=1),!T||v&&!s.stagger){if(G=b[0]?ol(b[0]).harness:0,X=G&&s[G.prop],O=Im(s,xx),_&&(_._zTime<0&&_.progress(1),n<0&&h&&u&&!y?_.render(-1,!0):_.revert(h&&x?Tp:wK),_._lazy=0),a){if(Qo(e._startAt=dn.set(b,Kr({data:"isStart",overwrite:!1,parent:E,immediateRender:!0,lazy:!_&&br(c),startAt:null,delay:0,onUpdate:f&&function(){return $r(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Hn||!u&&!y)&&e._startAt.revert(Tp),u&&x&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&x&&!_){if(n&&(u=!1),R=Kr({overwrite:!1,data:"isFromStart",lazy:u&&!_&&br(c),immediateRender:u,stagger:0,parent:E},O),X&&(R[G.prop]=X),Qo(e._startAt=dn.set(b,R)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Hn?e._startAt.revert(Tp):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,St,St);else if(!n)return}for(e._pt=e._ptCache=0,c=x&&br(c)||c&&!x,M=0;M<b.length;M++){if(N=b[M],V=N._gsap||bx(b)[M]._gsap,e._ptLookup[M]=K={},S_[V.id]&&Uo.length&&Rm(),B=C===b?M:C.indexOf(N),G&&(Y=new G).init(N,X||O,e,B,C)!==!1&&(e._pt=L=new Er(e._pt,N,Y.name,0,1,Y.render,Y,0,Y.priority),Y._props.forEach(function(ee){K[ee]=L}),Y.priority&&(j=1)),!G||X)for(R in O)Dr[R]&&(Y=zA(R,O,e,B,N,C))?Y.priority&&(j=1):K[R]=L=Ex.call(e,N,R,"get",O[R],B,C,0,s.stringFilter);e._op&&e._op[M]&&e.kill(N,e._op[M]),P&&e._pt&&(Vo=e,Zt.killTweensOf(N,K,e.globalTime(n)),$=!e.parent,Vo=0),e._pt&&c&&(S_[V.id]=1)}j&&ZA(e),e._onInit&&e._onInit(e)}e._onUpdate=f,e._initted=(!e._op||e._pt)&&!$,v&&n<=0&&T.render(us,!0,!0)},qK=function(e,n,r,s,i,a,u,c){var f=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,v,y;if(!f)for(f=e._ptCache[n]=[],v=e._ptLookup,y=e._targets.length;y--;){if(h=v[y][n],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==n&&h.fp!==n;)h=h._next;if(!h)return A_=1,e.vars[n]="+=0",kx(e,u),A_=0,c?Yd(n+" not eligible for reset. Try splitting into individual properties"):1;f.push(h)}for(y=f.length;y--;)p=f[y],h=p._pt||p,h.s=(s||s===0)&&!i?s:h.s+(s||0)+a*h.c,h.c=r-h.s,p.e&&(p.e=an(r)+qn(p.e)),p.b&&(p.b=h.s+qn(p.b))},YK=function(e,n){var r=e[0]?ol(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=Hu({},n);for(a in s)if(a in i)for(c=s[a].split(","),u=c.length;u--;)i[c[u]]=i[a];return i},XK=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(Yn(n))u=r[e]||(r[e]=[]),n.forEach(function(c,f){return u.push({t:f/(n.length-1)*100,v:c,e:i})});else for(a in n)u=r[a]||(r[a]=[]),a==="ease"||u.push({t:parseFloat(e),v:n[a],e:i})},Ed=function(e,n,r,s,i){return tn(e)?e.call(n,r,s,i):Tn(e)&&~e.indexOf("random(")?Qd(e):e},UA=wx+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",BA={};Sr(UA+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return BA[t]=1});var dn=(function(t){dA(e,t);function e(r,s,i,a){var u;typeof s=="number"&&(i.duration=s,s=i,i=null),u=t.call(this,a?s:bd(s))||this;var c=u.vars,f=c.duration,h=c.delay,p=c.immediateRender,v=c.stagger,y=c.overwrite,x=c.keyframes,_=c.defaults,b=c.scrollTrigger,E=s.parent||Zt,C=(Yn(r)||hA(r)?Yi(r[0]):"length"in s)?[r]:cs(r),P,T,A,O,M,R,L,N;if(u._targets=C.length?bx(C):Yd("GSAP target "+r+" not found. https://gsap.com",!Wr.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=y,x||v||sp(f)||sp(h)){s=u.vars;var j=s.easeReverse||s.yoyoEase;if(P=u.timeline=new xr({data:"nested",defaults:_||{},targets:E&&E.data==="nested"?E.vars.targets:C}),P.kill(),P.parent=P._dp=ji(u),P._start=0,v||sp(f)||sp(h)){if(O=C.length,L=v&&RA(v),fi(v))for(M in v)~UA.indexOf(M)&&(N||(N={}),N[M]=v[M]);for(T=0;T<O;T++)A=Im(s,BA),A.stagger=0,j&&(A.easeReverse=j),N&&Hu(A,N),R=C[T],A.duration=+Ed(f,ji(u),T,R,C),A.delay=(+Ed(h,ji(u),T,R,C)||0)-u._delay,!v&&O===1&&A.delay&&(u._delay=h=A.delay,u._start+=h,A.delay=0),P.to(R,A,L?L(T,R,C):0),P._ease=ct.none;P.duration()?f=h=0:u.timeline=0}else if(x){bd(Kr(P.vars.defaults,{ease:"none"})),P._ease=ll(x.ease||s.ease||"none");var V=0,G,Y,K;if(Yn(x))x.forEach(function(B){return P.to(C,B,">")}),P.duration();else{A={};for(M in x)M==="ease"||M==="easeEach"||XK(M,x[M],A,x.easeEach);for(M in A)for(G=A[M].sort(function(B,X){return B.t-X.t}),V=0,T=0;T<G.length;T++)Y=G[T],K={ease:Y.e,duration:(Y.t-(T?G[T-1].t:0))/100*f},K[M]=Y.v,P.to(C,K,V),V+=K.duration;P.duration()<f&&P.to({},{duration:f-P.duration()})}}f||u.duration(f=P.duration())}else u.timeline=0;return y===!0&&!mx&&(Vo=ji(u),Zt.killTweensOf(C),Vo=0),ri(E,ji(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!f&&!x&&u._start===Kt(E._time)&&br(p)&&PK(ji(u))&&E.data!=="nested")&&(u._tTime=-St,u.render(Math.max(0,-h)||0)),b&&CA(ji(u),b),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,f=this._dur,h=s<0,p=s>c-St&&!h?c:s<St?0:s,v,y,x,_,b,E,C,P;if(!f)AK(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(v=p,P=this.timeline,this._repeat){if(_=f+this._rDelay,this._repeat<-1&&h)return this.totalTime(_*100+s,i,a);if(v=Kt(p%_),p===c?(x=this._repeat,v=f):(b=Kt(p/_),x=~~b,x&&x===b?(v=f,x--):v>f&&(v=f)),E=this._yoyo&&x&1,E&&(v=f-v),b=zu(this._tTime,_),v===u&&!a&&this._initted&&x===b)return this._tTime=p,this;x!==b&&this.vars.repeatRefresh&&!E&&!this._lock&&v!==_&&this._initted&&(this._lock=a=1,this.render(Kt(_*x),!0).invalidate()._lock=0)}if(!this._initted){if(PA(this,h?s:v,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&x!==b))return this;if(f!==this._dur)return this.render(s,i,a)}if(this._rEase){var T=v<u;if(T!==this._inv){var A=T?u:f-u;this._inv=T,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=A?(T?-1:1)/A:0,this._invScale=T?-this.ratio:1-this.ratio,this._invEase=T?this._rEase:this._ease}this.ratio=C=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=C=this._ease(v/f);if(this._from&&(this.ratio=C=1-C),this._tTime=p,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!b&&($r(this,"onStart"),this._tTime!==p))return this;for(y=this._pt;y;)y.r(C,y.d),y=y._next;P&&P.render(s<0?s:P._dur*P._ease(v/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&E_(this,s,i,a),$r(this,"onUpdate")),this._repeat&&x!==b&&this.vars.onRepeat&&!i&&this.parent&&$r(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&E_(this,s,!0,!0),(s||!f)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&Qo(this,1),!i&&!(h&&!u)&&(p||u||E)&&($r(this,p===c?"onComplete":"onReverseComplete",!0),this._prom&&!(p<c&&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,a,u,c){Jd||Fr.wake(),this._ts||this.play();var f=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||kx(this,f),h=this._ease(f/this._dur),qK(this,s,i,a,u,h,f,c)?this.resetTo(s,i,a,u,1):(x0(this,0),this.parent||EA(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?ad(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Hn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,Vo&&Vo.vars.overwrite!==!0)._first||ad(this),this.parent&&a!==this.timeline.totalDuration()&&Uu(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?cs(s):u,f=this._ptLookup,h=this._pt,p,v,y,x,_,b,E;if((!i||i==="all")&&kK(u,c))return i==="all"&&(this._pt=0),ad(this);for(p=this._op=this._op||[],i!=="all"&&(Tn(i)&&(_={},Sr(i,function(C){return _[C]=1}),i=_),i=YK(u,i)),E=u.length;E--;)if(~c.indexOf(u[E])){v=f[E],i==="all"?(p[E]=i,x=v,y={}):(y=p[E]=p[E]||{},x=i);for(_ in x)b=v&&v[_],b&&((!("kill"in b.d)||b.d.kill(_)===!0)&&y0(this,b,"_pt"),delete v[_]),y!=="all"&&(y[_]=1)}return this._initted&&!this._pt&&h&&ad(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Sd(1,arguments)},e.delayedCall=function(s,i,a,u){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:u})},e.fromTo=function(s,i,a){return Sd(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,a){return Zt.killTweensOf(s,i,a)},e})(ef);Kr(dn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Sr("staggerTo,staggerFrom,staggerFromTo",function(t){dn[t]=function(){var e=new xr,n=C_.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var Cx=function(e,n,r){return e[n]=r},WA=function(e,n,r){return e[n](r)},QK=function(e,n,r,s){return e[n](s.fp,r)},JK=function(e,n,r){return e.setAttribute(n,r)},Px=function(e,n){return tn(e[n])?WA:gx(e[n])&&e.setAttribute?JK:Cx},GA=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},eZ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},KA=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)},Tx=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},tZ=function(e,n,r,s){for(var i=this._pt,a;i;)a=i._next,i.p===s&&i.modifier(e,n,r),i=a},nZ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?y0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},rZ=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},ZA=function(e){for(var n=e._pt,r,s,i,a;n;){for(r=n._next,s=i;s&&s.pr>n.pr;)s=s._next;(n._prev=s?s._prev:a)?n._prev._next=n:i=n,(n._next=s)?s._prev=n:a=n,n=r}e._pt=i},Er=(function(){function t(n,r,s,i,a,u,c,f,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||GA,this.d=c||this,this.set=f||Cx,this.pr=h||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=rZ,this.m=r,this.mt=i,this.tween=s},t})();Sr(wx+"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 xx[t]=1});Gr.TweenMax=Gr.TweenLite=dn;Gr.TimelineLite=Gr.TimelineMax=xr;Zt=new xr({sortChildren:!1,defaults:qd,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Wr.stringFilter=VA;var ul=[],Rp={},sZ=[],bC=0,iZ=0,v1=function(e){return(Rp[e]||sZ).map(function(n){return n()})},R_=function(){var e=Date.now(),n=[];e-bC>2&&(v1("matchMediaInit"),ul.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,f;for(u in s)a=Ys.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,f=1);f&&(r.revert(),c&&n.push(r))}),v1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),bC=e,v1("matchMedia"))},qA=(function(){function t(n,r){this.selector=r&&P_(r),this.data=[],this._r=[],this.isReverted=!1,this.id=iZ++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){tn(r)&&(i=s,s=r,r=tn);var a=this,u=function(){var f=Ht,h=a.selector,p;return f&&f!==a&&f.data.push(a),i&&(a.selector=P_(i)),Ht=a,p=s.apply(a,arguments),tn(p)&&a._r.push(p),Ht=f,a.selector=h,a.isReverted=!1,p};return a.last=u,r===tn?u(a,function(c){return a.add(null,c)}):r?a[r]=u:u},e.ignore=function(r){var s=Ht;Ht=null,r(this),Ht=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof dn&&!(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 u=i.getTweens(),c=i.data.length,f;c--;)f=i.data[c],f.data==="isFlip"&&(f.revert(),f.getChildren(!0,!0,!1).forEach(function(h){return u.splice(u.indexOf(h),1)}));for(u.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,p){return p.g-h.g||-1/0}).forEach(function(h){return h.t.revert(r)}),c=i.data.length;c--;)f=i.data[c],f instanceof xr?f.data!=="nested"&&(f.scrollTrigger&&f.scrollTrigger.revert(),f.kill()):!(f instanceof dn)&&f.revert&&f.revert(r);i._r.forEach(function(h){return h(r,i)}),i.isReverted=!0})():this.data.forEach(function(u){return u.kill&&u.kill()}),this.clear(),s)for(var a=ul.length;a--;)ul[a].id===this.id&&ul.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),oZ=(function(){function t(n){this.contexts=[],this.scope=n,Ht&&Ht.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){fi(r)||(r={matches:r});var a=new qA(0,i||this.scope),u=a.conditions={},c,f,h;Ht&&!a.selector&&(a.selector=Ht.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(f in r)f==="all"?h=1:(c=Ys.matchMedia(r[f]),c&&(ul.indexOf(a)<0&&ul.push(a),(u[f]=c.matches)&&(h=1),c.addListener?c.addListener(R_):c.addEventListener("change",R_)));return h&&s(a,function(p){return a.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})(),Lm={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 DA(s)})},timeline:function(e){return new xr(e)},getTweensOf:function(e,n){return Zt.getTweensOf(e,n)},getProperty:function(e,n,r,s){Tn(e)&&(e=cs(e)[0]);var i=ol(e||{}).get,a=r?SA:bA;return r==="native"&&(r=""),e&&(n?a((Dr[n]&&Dr[n].get||i)(e,n,r,s)):function(u,c,f){return a((Dr[u]&&Dr[u].get||i)(e,u,c,f))})},quickSetter:function(e,n,r){if(e=cs(e),e.length>1){var s=e.map(function(h){return Cr.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Dr[n],u=ol(e),c=u.harness&&(u.harness.aliases||{})[n]||n,f=a?function(h){var p=new a;iu._pt=0,p.init(e,r?h+r:h,iu,0,[e]),p.render(1,p),iu._pt&&Tx(1,iu)}:u.set(e,c);return a?f:function(h){return f(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=Cr.to(e,Kr((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,f,h){return i.resetTo(n,c,f,h)};return a.tween=i,a},isTweening:function(e){return Zt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ll(e.ease,qd.ease)),vC(qd,e||{})},config:function(e){return vC(Wr,e||{})},registerEffect:function(e){var n=e.name,r=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(u){return u&&!Dr[u]&&!Gr[u]&&Yd(n+" effect requires "+u+" plugin.")}),h1[n]=function(u,c,f){return r(cs(u),Kr(c||{},i),f)},a&&(xr.prototype[n]=function(u,c,f){return this.add(h1[n](u,fi(c)?c:(f=c)&&{},this),f)})},registerEase:function(e,n){ct[e]=ll(n)},parseEase:function(e,n){return arguments.length?ll(e,n):ct},getById:function(e){return Zt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new xr(e),s,i;for(r.smoothChildTiming=br(e.smoothChildTiming),Zt.remove(r),r._dp=0,r._time=r._tTime=Zt._time,s=Zt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof dn&&s.vars.onComplete===s._targets[0]))&&ri(r,s,s._start-s._delay),s=i;return ri(Zt,r,0),r},context:function(e,n){return e?new qA(e,n):Ht},matchMedia:function(e){return new oZ(e)},matchMediaRefresh:function(){return ul.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||R_()},addEventListener:function(e,n){var r=Rp[e]||(Rp[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=Rp[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:jK,wrapYoyo:FK,distribute:RA,random:MA,snap:IA,normalize:DK,getUnit:qn,clamp:MK,splitColor:jA,toArray:cs,selector:P_,mapRange:OA,pipe:OK,unitize:NK,interpolate:VK,shuffle:AA},install:vA,effects:h1,ticker:Fr,updateRoot:xr.updateRoot,plugins:Dr,globalTimeline:Zt,core:{PropTween:Er,globals:yA,Tween:dn,Timeline:xr,Animation:ef,getCache:ol,_removeLinkedListItem:y0,reverting:function(){return Hn},context:function(e){return e&&Ht&&(Ht.data.push(e),e._ctx=Ht),Ht},suppressOverwrites:function(e){return mx=e}}};Sr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Lm[t]=dn[t]});Fr.add(xr.updateRoot);iu=Lm.to({},{duration:0});var aZ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},lZ=function(e,n){var r=e._targets,s,i,a;for(s in n)for(i=r.length;i--;)a=e._ptLookup[i][s],a&&(a=a.d)&&(a._pt&&(a=aZ(a,s)),a&&a.modifier&&a.modifier(n[s],e,r[i],s))},y1=function(e,n){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(u){var c,f;if(Tn(i)&&(c={},Sr(i,function(h){return c[h]=1}),i=c),n){c={};for(f in i)c[f]=n(i[f]);i=c}lZ(u,i)}}}},Cr=Lm.registerPlugin({name:"attr",init:function(e,n,r,s,i){var a,u,c;this.tween=r;for(a in n)c=e.getAttribute(a)||"",u=this.add(e,"setAttribute",(c||0)+"",n[a],s,i,0,0,a),u.op=a,u.b=c,this._props.push(a)},render:function(e,n){for(var r=n._pt;r;)Hn?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)}},y1("roundProps",T_),y1("modifiers"),y1("snap",IA))||Lm;dn.version=xr.version=Cr.version="3.15.0";gA=1;vx()&&Bu();ct.Power0;ct.Power1;ct.Power2;ct.Power3;ct.Power4;ct.Linear;ct.Quad;ct.Cubic;ct.Quart;ct.Quint;ct.Strong;ct.Elastic;ct.Back;ct.SteppedEase;ct.Bounce;ct.Sine;ct.Expo;ct.Circ;/*!
119
- * CSSPlugin 3.15.0
120
- * https://gsap.com
121
- *
122
- * Copyright 2008-2026, GreenSock. All rights reserved.
123
- * Subject to the terms at https://gsap.com/standard-license
124
- * @author: Jack Doyle, jack@greensock.com
125
- */var SC,$o,hu,Ax,Wa,EC,Rx,uZ=function(){return typeof window<"u"},Xi={},Fa=180/Math.PI,pu=Math.PI/180,Kl=Math.atan2,kC=1e8,Ix=/([A-Z])/g,cZ=/(left|right|width|margin|padding|x)/i,dZ=/[\s,\(]\S/,oi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},I_=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},fZ=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)},hZ=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)},pZ=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)},mZ=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},YA=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},XA=function(e,n){return n.set(n.t,n.p,e!==1?n.b:n.e,n)},gZ=function(e,n,r){return e.style[n]=r},vZ=function(e,n,r){return e.style.setProperty(n,r)},yZ=function(e,n,r){return e._gsap[n]=r},_Z=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},xZ=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},wZ=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},qt="transform",kr=qt+"Origin",bZ=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in Xi&&i){if(this.tfm=this.tfm||{},e!=="transform")e=oi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=Vi(s,u)}):this.tfm[e]=a.x?a[e]:Vi(s,e),e===kr&&(this.tfm.zOrigin=a.zOrigin);else return oi.transform.split(",").forEach(function(u){return t.call(r,u,n)});if(this.props.indexOf(qt)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(kr,n,"")),e=qt}(i||n)&&this.props.push(e,n,i[e])},QA=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},SZ=function(){var e=this.props,n=this.target,r=n.style,s=n._gsap,i,a;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(Ix,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)s[a]=this.tfm[a];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),i=Rx(),(!i||!i.isStart)&&!r[qt]&&(QA(r),s.zOrigin&&r[kr]&&(r[kr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},JA=function(e,n){var r={target:e,props:[],revert:SZ,save:bZ};return e._gsap||Cr.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},eR,M_=function(e,n){var r=$o.createElementNS?$o.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):$o.createElement(e);return r&&r.style?r:$o.createElement(e)},Hr=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Ix,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,Wu(n)||n,1)||""},CC="O,Moz,ms,Ms,Webkit".split(","),Wu=function(e,n,r){var s=n||Wa,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(CC[a]+e in i););return a<0?null:(a===3?"ms":a>=0?CC[a]:"")+e},L_=function(){uZ()&&window.document&&(SC=window,$o=SC.document,hu=$o.documentElement,Wa=M_("div")||{style:{}},M_("div"),qt=Wu(qt),kr=qt+"Origin",Wa.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",eR=!!Wu("perspective"),Rx=Cr.core.reverting,Ax=1)},PC=function(e){var n=e.ownerSVGElement,r=M_("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),hu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),hu.removeChild(r),i},TC=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},tR=function(e){var n,r;try{n=e.getBBox()}catch{n=PC(e),r=1}return n&&(n.width||n.height)||r||(n=PC(e)),n&&!n.width&&!n.x&&!n.y?{x:+TC(e,["x","cx","x1"])||0,y:+TC(e,["y","cy","y1"])||0,width:0,height:0}:n},nR=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&tR(e))},Jo=function(e,n){if(n){var r=e.style,s;n in Xi&&n!==kr&&(n=qt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Ix,"-$1").toLowerCase())):r.removeAttribute(n)}},Ho=function(e,n,r,s,i,a){var u=new Er(e._pt,n,r,0,1,a?XA:YA);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},AC={deg:1,rad:1,turn:1},EZ={grid:1,flex:1},ea=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=Wa.style,c=cZ.test(n),f=e.tagName.toLowerCase()==="svg",h=(f?"client":"offset")+(c?"Width":"Height"),p=100,v=s==="px",y=s==="%",x,_,b,E;if(s===a||!i||AC[s]||AC[a])return i;if(a!=="px"&&!v&&(i=t(e,n,r,"px")),E=e.getCTM&&nR(e),(y||a==="%")&&(Xi[n]||~n.indexOf("adius")))return x=E?e.getBBox()[c?"width":"height"]:e[h],an(y?i/x*p:i/100*x);if(u[c?"width":"height"]=p+(v?a:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!f?e:e.parentNode,E&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===$o||!_.appendChild)&&(_=$o.body),b=_._gsap,b&&y&&b.width&&c&&b.time===Fr.time&&!b.uncache)return an(i/b.width*p);if(y&&(n==="height"||n==="width")){var C=e.style[n];e.style[n]=p+s,x=e[h],C?e.style[n]=C:Jo(e,n)}else(y||a==="%")&&!EZ[Hr(_,"display")]&&(u.position=Hr(e,"position")),_===e&&(u.position="static"),_.appendChild(Wa),x=Wa[h],_.removeChild(Wa),u.position="absolute";return c&&y&&(b=ol(_),b.time=Fr.time,b.width=_[h]),an(v?x*i/p:x&&i?p/x*i:0)},Vi=function(e,n,r,s){var i;return Ax||L_(),n in oi&&n!=="transform"&&(n=oi[n],~n.indexOf(",")&&(n=n.split(",")[0])),Xi[n]&&n!=="transform"?(i=nf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:Nm(Hr(e,kr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=Om[n]&&Om[n](e,n,r)||Hr(e,n)||xA(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?ea(e,n,i,r)+r:i},kZ=function(e,n,r,s){if(!r||r==="none"){var i=Wu(n,e,1),a=i&&Hr(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=Hr(e,"borderTopColor"))}var u=new Er(this._pt,e.style,n,0,1,KA),c=0,f=0,h,p,v,y,x,_,b,E,C,P,T,A;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=Hr(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=Hr(e,n)||s,_?e.style[n]=_:Jo(e,n)),h=[r,s],VA(h),r=h[0],s=h[1],v=r.match(su)||[],A=s.match(su)||[],A.length){for(;p=su.exec(s);)b=p[0],C=s.substring(c,p.index),x?x=(x+1)%5:(C.substr(-5)==="rgba("||C.substr(-5)==="hsla(")&&(x=1),b!==(_=v[f++]||"")&&(y=parseFloat(_)||0,T=_.substr((y+"").length),b.charAt(1)==="="&&(b=fu(y,b)+T),E=parseFloat(b),P=b.substr((E+"").length),c=su.lastIndex-P.length,P||(P=P||Wr.units[n]||T,c===s.length&&(s+=P,u.e+=P)),T!==P&&(y=ea(e,n,_,P)||0),u._pt={_next:u._pt,p:C||f===1?C:",",s:y,c:E-y,m:x&&x<4||n==="zIndex"?Math.round:0});u.c=c<s.length?s.substring(c,s.length):""}else u.r=n==="display"&&s==="none"?XA:YA;return mA.test(s)&&(u.e=0),this._pt=u,u},RC={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},CZ=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]=RC[r]||r,n[1]=RC[s]||s,n.join(" ")},PZ=function(e,n){if(n.tween&&n.tween._time===n.tween._dur){var r=n.t,s=r.style,i=n.u,a=r._gsap,u,c,f;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),f=i.length;--f>-1;)u=i[f],Xi[u]&&(c=1,u=u==="transformOrigin"?kr:qt),Jo(r,u);c&&(Jo(r,qt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",nf(r,1),a.uncache=1,QA(s)))}},Om={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Er(e._pt,n,r,0,0,PZ);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},tf=[1,0,0,1,0,0],rR={},sR=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},IC=function(e){var n=Hr(e,qt);return sR(n)?tf:n.substr(7).match(pA).map(an)},Mx=function(e,n){var r=e._gsap||ol(e),s=e.style,i=IC(e),a,u,c,f;return r.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,i=[c.a,c.b,c.c,c.d,c.e,c.f],i.join(",")==="1,0,0,1,0,0"?tf:i):(i===tf&&!e.offsetParent&&e!==hu&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(f=1,u=e.nextElementSibling,hu.appendChild(e)),i=IC(e),c?s.display=c:Jo(e,"display"),f&&(u?a.insertBefore(e,u):a?a.appendChild(e):hu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},O_=function(e,n,r,s,i,a){var u=e._gsap,c=i||Mx(e,!0),f=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,v=u.yOffset||0,y=c[0],x=c[1],_=c[2],b=c[3],E=c[4],C=c[5],P=n.split(" "),T=parseFloat(P[0])||0,A=parseFloat(P[1])||0,O,M,R,L;r?c!==tf&&(M=y*b-x*_)&&(R=T*(b/M)+A*(-_/M)+(_*C-b*E)/M,L=T*(-x/M)+A*(y/M)-(y*C-x*E)/M,T=R,A=L):(O=tR(e),T=O.x+(~P[0].indexOf("%")?T/100*O.width:T),A=O.y+(~(P[1]||P[0]).indexOf("%")?A/100*O.height:A)),s||s!==!1&&u.smooth?(E=T-f,C=A-h,u.xOffset=p+(E*y+C*_)-E,u.yOffset=v+(E*x+C*b)-C):u.xOffset=u.yOffset=0,u.xOrigin=T,u.yOrigin=A,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[kr]="0px 0px",a&&(Ho(a,u,"xOrigin",f,T),Ho(a,u,"yOrigin",h,A),Ho(a,u,"xOffset",p,u.xOffset),Ho(a,u,"yOffset",v,u.yOffset)),e.setAttribute("data-svg-origin",T+" "+A)},nf=function(e,n){var r=e._gsap||new HA(e);if("x"in r&&!n&&!r.uncache)return r;var s=e.style,i=r.scaleX<0,a="px",u="deg",c=getComputedStyle(e),f=Hr(e,kr)||"0",h,p,v,y,x,_,b,E,C,P,T,A,O,M,R,L,N,j,V,G,Y,K,B,X,$,ee,H,D,q,re,se,oe;return h=p=v=_=b=E=C=P=T=0,y=x=1,r.svg=!!(e.getCTM&&nR(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(s[qt]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[qt]!=="none"?c[qt]:"")),s.scale=s.rotate=s.translate="none"),M=Mx(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),f=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",X=""):X=!n&&e.getAttribute("data-svg-origin"),O_(e,X||f,!!X||r.originIsAbsolute,r.smooth!==!1,M)),A=r.xOrigin||0,O=r.yOrigin||0,M!==tf&&(j=M[0],V=M[1],G=M[2],Y=M[3],h=K=M[4],p=B=M[5],M.length===6?(y=Math.sqrt(j*j+V*V),x=Math.sqrt(Y*Y+G*G),_=j||V?Kl(V,j)*Fa:0,C=G||Y?Kl(G,Y)*Fa+_:0,C&&(x*=Math.abs(Math.cos(C*pu))),r.svg&&(h-=A-(A*j+O*G),p-=O-(A*V+O*Y))):(oe=M[6],re=M[7],H=M[8],D=M[9],q=M[10],se=M[11],h=M[12],p=M[13],v=M[14],R=Kl(oe,q),b=R*Fa,R&&(L=Math.cos(-R),N=Math.sin(-R),X=K*L+H*N,$=B*L+D*N,ee=oe*L+q*N,H=K*-N+H*L,D=B*-N+D*L,q=oe*-N+q*L,se=re*-N+se*L,K=X,B=$,oe=ee),R=Kl(-G,q),E=R*Fa,R&&(L=Math.cos(-R),N=Math.sin(-R),X=j*L-H*N,$=V*L-D*N,ee=G*L-q*N,se=Y*N+se*L,j=X,V=$,G=ee),R=Kl(V,j),_=R*Fa,R&&(L=Math.cos(R),N=Math.sin(R),X=j*L+V*N,$=K*L+B*N,V=V*L-j*N,B=B*L-K*N,j=X,K=$),b&&Math.abs(b)+Math.abs(_)>359.9&&(b=_=0,E=180-E),y=an(Math.sqrt(j*j+V*V+G*G)),x=an(Math.sqrt(B*B+oe*oe)),R=Kl(K,B),C=Math.abs(R)>2e-4?R*Fa:0,T=se?1/(se<0?-se:se):0),r.svg&&(X=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!sR(Hr(e,qt)),X&&e.setAttribute("transform",X))),Math.abs(C)>90&&Math.abs(C)<270&&(i?(y*=-1,C+=_<=0?180:-180,_+=_<=0?180:-180):(x*=-1,C+=C<=0?180:-180)),n=n||r.uncache,r.x=h-((r.xPercent=h&&(!n&&r.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-h)?-50:0)))?e.offsetWidth*r.xPercent/100:0)+a,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)+a,r.z=v+a,r.scaleX=an(y),r.scaleY=an(x),r.rotation=an(_)+u,r.rotationX=an(b)+u,r.rotationY=an(E)+u,r.skewX=C+u,r.skewY=P+u,r.transformPerspective=T+a,(r.zOrigin=parseFloat(f.split(" ")[2])||!n&&r.zOrigin||0)&&(s[kr]=Nm(f)),r.xOffset=r.yOffset=0,r.force3D=Wr.force3D,r.renderTransform=r.svg?AZ:eR?iR:TZ,r.uncache=0,r},Nm=function(e){return(e=e.split(" "))[0]+" "+e[1]},_1=function(e,n,r){var s=qn(n);return an(parseFloat(n)+parseFloat(ea(e,"x",r+"px",s)))+s},TZ=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,iR(e,n)},Ma="0deg",Qc="0px",La=") ",iR=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,f=r.rotation,h=r.rotationY,p=r.rotationX,v=r.skewX,y=r.skewY,x=r.scaleX,_=r.scaleY,b=r.transformPerspective,E=r.force3D,C=r.target,P=r.zOrigin,T="",A=E==="auto"&&e&&e!==1||E===!0;if(P&&(p!==Ma||h!==Ma)){var O=parseFloat(h)*pu,M=Math.sin(O),R=Math.cos(O),L;O=parseFloat(p)*pu,L=Math.cos(O),a=_1(C,a,M*L*-P),u=_1(C,u,-Math.sin(O)*-P),c=_1(C,c,R*L*-P+P)}b!==Qc&&(T+="perspective("+b+La),(s||i)&&(T+="translate("+s+"%, "+i+"%) "),(A||a!==Qc||u!==Qc||c!==Qc)&&(T+=c!==Qc||A?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+La),f!==Ma&&(T+="rotate("+f+La),h!==Ma&&(T+="rotateY("+h+La),p!==Ma&&(T+="rotateX("+p+La),(v!==Ma||y!==Ma)&&(T+="skew("+v+", "+y+La),(x!==1||_!==1)&&(T+="scale("+x+", "+_+La),C.style[qt]=T||"translate(0, 0)"},AZ=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,f=r.skewX,h=r.skewY,p=r.scaleX,v=r.scaleY,y=r.target,x=r.xOrigin,_=r.yOrigin,b=r.xOffset,E=r.yOffset,C=r.forceCSS,P=parseFloat(a),T=parseFloat(u),A,O,M,R,L;c=parseFloat(c),f=parseFloat(f),h=parseFloat(h),h&&(h=parseFloat(h),f+=h,c+=h),c||f?(c*=pu,f*=pu,A=Math.cos(c)*p,O=Math.sin(c)*p,M=Math.sin(c-f)*-v,R=Math.cos(c-f)*v,f&&(h*=pu,L=Math.tan(f-h),L=Math.sqrt(1+L*L),M*=L,R*=L,h&&(L=Math.tan(h),L=Math.sqrt(1+L*L),A*=L,O*=L)),A=an(A),O=an(O),M=an(M),R=an(R)):(A=p,R=v,O=M=0),(P&&!~(a+"").indexOf("px")||T&&!~(u+"").indexOf("px"))&&(P=ea(y,"x",a,"px"),T=ea(y,"y",u,"px")),(x||_||b||E)&&(P=an(P+x-(x*A+_*M)+b),T=an(T+_-(x*O+_*R)+E)),(s||i)&&(L=y.getBBox(),P=an(P+s/100*L.width),T=an(T+i/100*L.height)),L="matrix("+A+","+O+","+M+","+R+","+P+","+T+")",y.setAttribute("transform",L),C&&(y.style[qt]=L)},RZ=function(e,n,r,s,i){var a=360,u=Tn(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?Fa:1),f=c-s,h=s+f+"deg",p,v;return u&&(p=i.split("_")[1],p==="short"&&(f%=a,f!==f%(a/2)&&(f+=f<0?a:-a)),p==="cw"&&f<0?f=(f+a*kC)%a-~~(f/a)*a:p==="ccw"&&f>0&&(f=(f-a*kC)%a-~~(f/a)*a)),e._pt=v=new Er(e._pt,n,r,s,f,fZ),v.e=h,v.u="deg",e._props.push(r),v},MC=function(e,n){for(var r in n)e[r]=n[r];return e},IZ=function(e,n,r){var s=MC({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,f,h,p,v,y,x;s.svg?(f=r.getAttribute("transform"),r.setAttribute("transform",""),a[qt]=n,u=nf(r,1),Jo(r,qt),r.setAttribute("transform",f)):(f=getComputedStyle(r)[qt],a[qt]=n,u=nf(r,1),a[qt]=f);for(c in Xi)f=s[c],h=u[c],f!==h&&i.indexOf(c)<0&&(y=qn(f),x=qn(h),p=y!==x?ea(r,c,f,x):parseFloat(f),v=parseFloat(h),e._pt=new Er(e._pt,u,c,p,v-p,I_),e._pt.u=x||0,e._props.push(c));MC(u,s)};Sr("padding,margin,Width,Radius",function(t,e){var n="Top",r="Right",s="Bottom",i="Left",a=(e<3?[n,r,s,i]:[n+i,n+r,s+r,s+i]).map(function(u){return e<2?t+u:"border"+u+t});Om[e>1?"border"+t:t]=function(u,c,f,h,p){var v,y;if(arguments.length<4)return v=a.map(function(x){return Vi(u,x,f)}),y=v.join(" "),y.split(v[0]).length===5?v[0]:y;v=(h+"").split(" "),y={},a.forEach(function(x,_){return y[x]=v[_]=v[_]||v[(_-1)/2|0]}),u.init(c,y,p)}});var oR={name:"css",register:L_,targetTest:function(e){return e.style&&e.nodeType},init:function(e,n,r,s,i){var a=this._props,u=e.style,c=r.vars.startAt,f,h,p,v,y,x,_,b,E,C,P,T,A,O,M,R,L;Ax||L_(),this.styles=this.styles||JA(e),R=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(h=n[_],!(Dr[_]&&zA(_,n,r,s,e,i)))){if(y=typeof h,x=Om[_],y==="function"&&(h=h.call(r,s,e,i),y=typeof h),y==="string"&&~h.indexOf("random(")&&(h=Qd(h)),x)x(this,e,_,h,r)&&(M=1);else if(_.substr(0,2)==="--")f=(getComputedStyle(e).getPropertyValue(_)+"").trim(),h+="",Bo.lastIndex=0,Bo.test(f)||(b=qn(f),E=qn(h),E?b!==E&&(f=ea(e,_,f,E)+E):b&&(h+=b)),this.add(u,"setProperty",f,h,s,i,0,0,_),a.push(_),R.push(_,0,u[_]);else if(y!=="undefined"){if(c&&_ in c?(f=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],Tn(f)&&~f.indexOf("random(")&&(f=Qd(f)),qn(f+"")||f==="auto"||(f+=Wr.units[_]||qn(Vi(e,_))||""),(f+"").charAt(1)==="="&&(f=Vi(e,_))):f=Vi(e,_),v=parseFloat(f),C=y==="string"&&h.charAt(1)==="="&&h.substr(0,2),C&&(h=h.substr(2)),p=parseFloat(h),_ in oi&&(_==="autoAlpha"&&(v===1&&Vi(e,"visibility")==="hidden"&&p&&(v=0),R.push("visibility",0,u.visibility),Ho(this,u,"visibility",v?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=oi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),P=_ in Xi,P){if(this.styles.save(_),L=h,y==="string"&&h.substring(0,6)==="var(--"){if(h=Hr(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var N=e.style.perspective;e.style.perspective=h,h=Hr(e,"perspective"),N?e.style.perspective=N:Jo(e,"perspective")}p=parseFloat(h)}if(T||(A=e._gsap,A.renderTransform&&!n.parseTransform||nf(e,n.parseTransform),O=n.smoothOrigin!==!1&&A.smooth,T=this._pt=new Er(this._pt,u,qt,0,1,A.renderTransform,A,0,-1),T.dep=1),_==="scale")this._pt=new Er(this._pt,A,"scaleY",A.scaleY,(C?fu(A.scaleY,C+p):p)-A.scaleY||0,I_),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){R.push(kr,0,u[kr]),h=CZ(h),A.svg?O_(e,h,0,O,0,this):(E=parseFloat(h.split(" ")[2])||0,E!==A.zOrigin&&Ho(this,A,"zOrigin",A.zOrigin,E),Ho(this,u,_,Nm(f),Nm(h)));continue}else if(_==="svgOrigin"){O_(e,h,1,O,0,this);continue}else if(_ in rR){RZ(this,A,_,v,C?fu(v,C+h):h);continue}else if(_==="smoothOrigin"){Ho(this,A,"smooth",A.smooth,h);continue}else if(_==="force3D"){A[_]=h;continue}else if(_==="transform"){IZ(this,h,e);continue}}else _ in u||(_=Wu(_)||_);if(P||(p||p===0)&&(v||v===0)&&!dZ.test(h)&&_ in u)b=(f+"").substr((v+"").length),p||(p=0),E=qn(h)||(_ in Wr.units?Wr.units[_]:b),b!==E&&(v=ea(e,_,f,E)),this._pt=new Er(this._pt,P?A:u,_,v,(C?fu(v,C+p):p)-v,!P&&(E==="px"||_==="zIndex")&&n.autoRound!==!1?mZ:I_),this._pt.u=E||0,P&&L!==h?(this._pt.b=f,this._pt.e=L,this._pt.r=pZ):b!==E&&E!=="%"&&(this._pt.b=f,this._pt.r=hZ);else if(_ in u)kZ.call(this,e,_,f,C?C+h:h);else if(_ in e)this.add(e,_,f||e[_],C?C+h:h,s,i);else if(_!=="parseTransform"){_x(_,h);continue}P||(_ in u?R.push(_,0,u[_]):typeof e[_]=="function"?R.push(_,2,e[_]()):R.push(_,1,f||e[_])),a.push(_)}}M&&ZA(this)},render:function(e,n){if(n.tween._time||!Rx())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:Vi,aliases:oi,getSetter:function(e,n,r){var s=oi[n];return s&&s.indexOf(",")<0&&(n=s),n in Xi&&n!==kr&&(e._gsap.x||Vi(e,"x"))?r&&EC===r?n==="scale"?_Z:yZ:(EC=r||{})&&(n==="scale"?xZ:wZ):e.style&&!gx(e.style[n])?gZ:~n.indexOf("-")?vZ:Px(e,n)},core:{_removeProperty:Jo,_getMatrix:Mx}};Cr.utils.checkPrefix=Wu;Cr.core.getStyleSaver=JA;(function(t,e,n,r){var s=Sr(t+","+e+","+n,function(i){Xi[i]=1});Sr(e,function(i){Wr.units[i]="deg",rR[i]=1}),oi[s[13]]=t+","+e,Sr(r,function(i){var a=i.split(":");oi[a[1]]=s[a[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");Sr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Wr.units[t]="px"});Cr.registerPlugin(oR);var Ss=Cr.registerPlugin(oR)||Cr;Ss.core.Tween;const Ip="/assets/logo-animation",x1=1280,MZ=[{id:"eraser",src:`${Ip}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${Ip}/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:`${Ip}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],LZ=[{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}],N_=({className:t})=>{const e=g.useRef(null),n=g.useRef(null),r=g.useRef(null);return g.useEffect(()=>{const s=e.current,i=n.current,a=r.current;if(!s||!i||!a)return;const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches,c=(E,C)=>E+Math.random()*(C-E);let f=null,h,p=1;const v=MZ.map(E=>({...E})),y=()=>{s.querySelectorAll(".la-obj").forEach(R=>R.remove());const E=s.getBoundingClientRect(),C=E.width||x1,P=E.height||x1*.64;p=C/x1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const A=250*p/337,O=[],M=(R,L,N)=>{const j=document.createElement("div");return j.className="la-obj",j.style.width=`${L}px`,j.innerHTML=`<img src="${R}" alt="" style="${N?"transform:scaleX(-1)":""}">`,s.appendChild(j),j};return LZ.forEach((R,L)=>{const N=R.w*p,j=M(`${Ip}/sea/${R.k}.png`,N,L%2===0);Ss.set(j,{x:R.x*C-N/2,y:R.y*P-N/2,rotation:R.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),O.push({el:j,hero:!1,rest:1})}),v.forEach(R=>{const L=R.cssW*p;R.el=M(R.src,L,!!R.flip),R.finalScale=R.fit*A/(R.cssW*p),Ss.set(R.el,{x:R.seaX*C-L/2,y:R.seaY*P-R.cssH*p/2,rotation:R.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),O.push({el:R.el,hero:!0,rest:150/R.cssW})}),O},x=(E,C)=>{const P=s.getBoundingClientRect(),T=a.getBoundingClientRect();return{x:T.left-P.left+E/326*T.width,y:T.top-P.top+C/337*T.height}},_=()=>{f&&f.revert();const E=y();if(u){f=Ss.context(()=>{E.filter(T=>!T.hero).forEach(T=>Ss.set(T.el,{scale:0})),v.forEach(T=>{if(!T.el)return;const A=x(T.localX,T.localY);Ss.set(T.el,{x:A.x-T.cssW*p/2,y:A.y-T.cssH*p/2,rotation:T.rot,scale:T.finalScale})})},s);return}const C=[],P=[];f=Ss.context(()=>{const T=Ss.timeline();T.to(E.map(A=>A.el),{scale:A=>E[A].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),T.add(()=>{E.forEach(({el:A,hero:O},M)=>{const R=O?C:P,L=M%2?1:-1;R.push(Ss.to(A,{rotation:"+="+c(2.5,6)*L,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),Ss.to(A,{y:"+="+c(5,11)*L,x:"+="+c(4,9)*-L,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),T.to({},{duration:1.1}),T.add("pick"),v.forEach((A,O)=>{A.el&&T.to(A.el,{scale:150/A.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+O*.08)}),T.add("clear","pick+=0.7"),T.add(()=>P.forEach(A=>A.kill()),"clear"),T.to(E.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"),T.add("assemble","clear+=0.25"),T.add(()=>C.forEach(A=>A.kill()),"assemble"),v.forEach((A,O)=>{if(!A.el||A.finalScale===void 0)return;const M=x(A.localX,A.localY);T.to(A.el,{x:M.x-A.cssW*p/2,y:M.y-A.cssH*p/2,rotation:A.rot,scale:A.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+O*.12)}),v.forEach(A=>{!A.el||A.finalScale===void 0||T.to(A.el,{scale:A.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};Ss.ticker.fps(12),_();const b=()=>{clearTimeout(h),h=setTimeout(_,250)};return window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b),clearTimeout(h),f==null||f.revert(),s.querySelectorAll(".la-obj").forEach(E=>E.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"})})})},OZ=Object.freeze(Object.defineProperty({__proto__:null,default:N_},Symbol.toStringTag,{value:"Module"})),LC=({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"})]}),aR=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="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(N_,{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(LC,{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:[r?S.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,S.jsx(N_,{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(LC,{isSigningIn:t})}),n?S.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),NZ="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",DZ=({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:NZ,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(o0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),S.jsx("span",{children:t})]})]})}),jZ="data:image/svg+xml,%3csvg%20width='548'%20height='565'%20viewBox='0%200%20548%20565'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M136.53%20-0.00177124C170.301%20-0.00177124%20197.687%2027.3551%20197.724%2061.1255L198.089%20394.976C198.189%20486.214%20124.253%20560.23%2033.0153%20560.23C14.7818%20560.23%200.000557184%20545.449%200.000557184%20527.216V61.1923C0.000557184%2027.3957%2027.3981%20-0.00177124%2061.1947%20-0.00177124H136.53Z'%20fill='white'/%3e%3cpath%20d='M271.092%20463.876C271.092%20530.762%20310.368%20564.205%20388.919%20564.205C468.248%20564.205%20507.913%20530.762%20507.913%20463.876C507.913%20426.545%20498.191%20400.88%20478.748%20386.88C460.082%20372.103%20430.139%20364.715%20388.919%20364.715C350.032%20364.715%20320.478%20372.103%20300.257%20386.88C280.814%20400.88%20271.092%20426.545%20271.092%20463.876Z'%20fill='white'/%3e%3cpath%20d='M405.25%200.917969C408.273%200.917973%20411.331%201.11183%20414.358%201.66895C437.891%205.99962%20471.151%2018.8698%20498.612%2044.5137C526.065%2070.1496%20547.676%20108.515%20547.992%20163.691C547.992%20163.693%20547.994%20163.695%20547.997%20163.695C547.999%20163.695%20548.001%20163.697%20548.001%20163.7L547.996%20164.612L548.001%20165.526C548.001%20165.528%20547.999%20165.53%20547.997%20165.53C547.994%20165.53%20547.992%20165.532%20547.992%20165.535C547.665%20222.498%20524.643%20261.54%20495.935%20287.156C467.223%20312.776%20432.863%20324.939%20409.917%20328.291C409.844%20328.302%20409.769%20328.308%20409.695%20328.308H283.146C254.52%20328.308%20231.314%20305.102%20231.314%20276.477C231.315%20244.265%20255.799%20218.161%20287.447%20213.026C309.663%20209.422%20329.612%20204.399%20344.084%20196.322C354.361%20190.586%20359.717%20184.074%20362.521%20178.421C365.332%20172.756%20365.636%20167.843%20365.636%20165.225V163.994C365.635%20161.374%20365.33%20156.465%20362.521%20150.805C359.717%20145.152%20354.361%20138.639%20344.084%20132.903C329.612%20124.826%20309.663%20119.803%20287.447%20116.199C255.799%20111.065%20231.315%2084.9602%20231.314%2052.749C231.314%2024.1235%20254.52%200.917969%20283.146%200.917969H405.25Z'%20fill='white'/%3e%3c/svg%3e",Dm=44,Jc=8,ip=16,FZ=4,OC=-18,VZ=.18,$Z=[.22,1,.36,1],NC=.92,HZ=1,zZ=.95,UZ=.4,BZ=[.19,1,.22,1],w1=0,WZ=1,GZ=0,KZ=0,ZZ=0,lR=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+Jc,s=Math.max(r,e.width-Dm-Jc),i=Math.max(Jc,e.height-Dm-Jc);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(Jc,t.y))}},Lx=()=>({width:window.innerWidth,height:window.innerHeight}),qZ=({position:t,boundsLeftPx:e=0})=>lR({position:t,viewport:Lx(),boundsLeft:e}),YZ=()=>{if(typeof window>"u")return{x:ip,y:ip};const t=Lx();return{x:t.width-Dm-ip,y:t.height-Dm-ip}},XZ=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=FZ,QZ=t=>t.button===void 0||t.button<=ZZ,DC=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},JZ=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=g.useRef(null),c=g.useRef(!1),[f,h]=g.useState(!1),[p,v]=g.useState(!1),y=n?!1:{opacity:w1,scale:NC,x:OC},x=n?{opacity:w1}:{opacity:w1,scale:NC,x:OC},_=n?{duration:KZ}:{duration:VZ,ease:$Z,scale:{duration:UZ,ease:BZ}},b=g.useCallback(()=>{const A=u.current;A&&(c.current=A.hasMoved),u.current=null,h(!1)},[]),E=g.useCallback(A=>{const O=u.current;if(!O)return;const M=DC(A),R=M.x-O.startPointer.x,L=M.y-O.startPointer.y,N=O.hasMoved||XZ({deltaX:R,deltaY:L});u.current={...O,hasMoved:N},N&&a(lR({position:{x:O.startPosition.x+R,y:O.startPosition.y+L},viewport:Lx(),boundsLeft:s}))},[a,s]),C=g.useCallback(A=>{if(u.current||!QZ(A))return;const O=DC(A);u.current={startPointer:O,startPosition:r,hasMoved:!1},h(!0)},[r]),P=g.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),T=e?"Close panel":"Open panel";return S.jsxs(S.Fragment,{children:[f?S.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:E,onPointerUp:b,onPointerCancel:b,onMouseMove:E,onMouseUp:b}):null,S.jsx(Gi,{children:t?S.jsx(Fo,{label:T,side:"top",forceOpen:p&&!f?void 0:!1,children:S.jsx(sl.button,{type:"button","aria-label":T,"data-cy":"reopen-panel",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),initial:y,animate:{opacity:WZ,scale:HZ,x:GZ},whileTap:{scale:zZ},exit:x,transition:_,onPointerDown:C,onMouseDown:C,onPointerMove:E,onPointerUp:b,onPointerCancel:b,onMouseMove:E,onMouseUp:b,onClick:P,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 ${f?"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:jZ,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},b1=hs("useConfig"),eq=300*1e3,tq=1800*1e3,nq=60*1e3,rq=300*1e3,sq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},iq=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},oq=t=>({...zT,...t??{}}),aq=()=>{const t=Xe(h_),e=st(h_),n=st(JT),r=st(e5),s=st(a0),i=st(CU),a=st(QT),u=st(EU),c=st(mf),f=st(GT),h=st(XT),p=g.useCallback(C=>{a(C.agentModeAvailable),f({name:C.name??null,email:C.email??null}),h(C.demoMode===!0),C.isMCPSession&&n(!0),C.mcpEditor&&r(C.mcpEditor),s(C.agentApplyMode??iq()??null),i(C.queueAccessToken??sq())},[s,a,h,n,r,i,f]),v=H1({queryKey:["rivet-config"],queryFn:async()=>{const C=await fetch("/api/config");if(!C.ok)throw new Error(`Failed to fetch config: ${C.statusText}`);return await C.json()},staleTime:eq,gcTime:tq}),y=H1({queryKey:["rivet-feature-flags"],queryFn:async()=>{const C=await fetch("/api/feature-flags");if(!C.ok)throw new Error(`Failed to fetch feature flags: ${C.statusText}`);return await C.json()},staleTime:nq,gcTime:rq}),{refetch:x}=v,{refetch:_}=y;g.useLayoutEffect(()=>{v.data&&(p(v.data),c(!1),b1.info("Config loaded:",v.data)),y.data&&(e(oq(y.data.featureFlags)),u(!0))},[v.data,y.data,p,c,e,u]),g.useLayoutEffect(()=>{v.error&&(u(!0),c(!1),b1.warn("Failed to load config:",v.error instanceof Error?v.error.message:"Failed to load config")),y.error&&(u(!0),b1.warn("Failed to load feature flags:",y.error instanceof Error?y.error.message:"Failed to load feature flags"))},[v.error,y.error,c,u]);const b=g.useCallback(async()=>{const[C]=await Promise.all([x(),_()]);return C.data?C.data:null},[x,_]);let E=null;return v.error instanceof Error?E=v.error.message:v.error&&(E="Failed to load config"),{config:v.data??null,featureFlags:t,loading:v.isPending||!v.error&&y.isPending,error:E,refetchConfig:b}},Mp="rivet_just_signed_in",Zl=hs("useOAuthCallback"),lq="https://rivet-proxy.onrender.com",uq=()=>{const[t,e]=g.useState({isProcessing:!1,isComplete:!1,error:null});return g.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var u,c,f;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{Zl.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),v=h.get("refresh_token"),x=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!x)throw new Error("No session ID found in URL");Zl.info(`Completing OAuth with session: ${x}`);const _=await fetch(`${lq}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:x,accessToken:p,refreshToken:v}),signal:n.signal}),b=await _.json();if(!_.ok||!b.success)throw new Error(b.error||b.message||"Failed to complete authentication");if(Zl.info("OAuth authentication completed successfully"),r)return;if((u=b.user)!=null&&u.id?(Te.identify(b.user.id,{...b.user.email?{email:b.user.email}:{}}),b.user.email&&Te.alias(b.user.email,b.user.id)):(c=b.user)!=null&&c.email&&Te.identify(b.user.email,{email:b.user.email}),(f=b.user)!=null&&f.email&&p)try{const C=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b.user.email,token:p,refreshToken:v,userId:b.user.id}),signal:n.signal});C.ok||Zl.warn(`Local auth store returned ${C.status}`)}catch(C){if(r)return;Zl.warn("Failed to store auth locally:",C)}if(r)return;window.sessionStorage.setItem(Mp,"1");const E=window.location.pathname;window.history.replaceState({},document.title,E),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";Zl.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},S1=hs("useAgentVariantsSession"),cq=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,jC=(t,e,n)=>{e.size===0&&!n||t.set(Bd,r=>{if(r.size===0)return r;const s=new Map(r);let i=!1;for(const[a,u]of r)u.status==="sending"&&u.variantRequestId&&(e.has(u.variantRequestId)||n&&u.variantRequest!==void 0)&&(s.delete(a),i=!0);return i?s:r})},dq=(t,e)=>{var s;if(t.size===0)return t;let n=!1;const r=new Map(t);for(const[i,a]of t){if(a.status!=="sending"||!a.awaitingSnapshotOutcome||a.variantRequest!==void 0)continue;const u=a.target;if(!u||u.kind!=="variant"||u.sessionId!==e.sessionId)continue;const c=(s=e.variants.find(f=>f.workItemId===u.variantId))==null?void 0:s.refinement;c&&(c.status==="succeeded"?(r.set(i,{...a,status:"complete",awaitingSnapshotOutcome:void 0}),n=!0):(c.status==="failed"||c.status==="cancelled")&&(r.set(i,{...a,status:"error",awaitingSnapshotOutcome:void 0}),n=!0))}return n?r:t},fq=({enabled:t=!0}={})=>{const e=st(pf),n=st(UT),r=st(_U),s=st(qT),i=st(SU),a=f2(),u=g.useRef(null);g.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=f=>{try{const h=JSON.parse(f.data),p=u.current;if(h.active){const x=new Set(h.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(E=>!x.has(E.requestId))),jC(a,x,!1),a.set(Bd,_=>{let b=_;for(const E of h.variants){const C=E.adoptedSource;C&&(b=bU(b,{kind:"variant",sessionId:C.sessionId,variantId:C.variantId},{kind:"variant",sessionId:h.sessionId,variantId:E.workItemId}))}return b}),a.set(Bd,_=>dq(_,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,jC(a,new Set,cq(h));e(h);const v=!h.active&&p!==null,y=h.active&&h.sessionId!==p;if(y&&fetch(`/api/variants/${h.sessionId}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(x=>S1.warn("failed to reset preview-port on session switch",x)),v||y){const x=new Set;if(h.active)for(const b of h.variants)x.add(zd({kind:"variant",sessionId:h.sessionId,variantId:b.workItemId}));const _=a.get(qo);for(const b of[_==null?void 0:_.left,_==null?void 0:_.right])b&&x.add(zd({kind:"variant",sessionId:b.sessionId,variantId:b.variantId}));i(x)}}catch(h){S1.warn("failed to parse SSE event payload",h)}},c.onerror=f=>{S1.warn("SSE error (auto-reconnects)",f)},()=>{c.close()}},[t,e,n,r,s,i,a])};function uR(t){const e=t+"CollectionProvider",[n,r]=na(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=_=>{const{scope:b,children:E}=_,C=g.useRef(null),P=g.useRef(new Map).current;return S.jsx(s,{scope:b,itemMap:P,collectionRef:C,children:E})};a.displayName=e;const u=t+"CollectionSlot",c=Vd(u),f=g.forwardRef((_,b)=>{const{scope:E,children:C}=_,P=i(u,E),T=Yt(b,P.collectionRef);return S.jsx(c,{ref:T,children:C})});f.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",v=Vd(h),y=g.forwardRef((_,b)=>{const{scope:E,children:C,...P}=_,T=g.useRef(null),A=Yt(b,T),O=i(h,E);return g.useEffect(()=>(O.itemMap.set(T,{ref:T,...P}),()=>void O.itemMap.delete(T))),S.jsx(v,{[p]:"",ref:A,children:C})});y.displayName=h;function x(_){const b=i(t+"CollectionConsumer",_);return g.useCallback(()=>{const C=b.collectionRef.current;if(!C)return[];const P=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(b.itemMap.values()).sort((O,M)=>P.indexOf(O.ref.current)-P.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},x,r]}var w0="Collapsible",[hq,cR]=na(w0),[pq,Ox]=hq(w0),dR=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[c,f]=fl({prop:r,defaultProp:s??!1,onChange:a,caller:w0});return S.jsx(pq,{scope:n,disabled:i,contentId:il(),open:c,onOpenToggle:g.useCallback(()=>f(h=>!h),[f]),children:S.jsx(Rt.div,{"data-state":Dx(c),"data-disabled":i?"":void 0,...u,ref:e})})});dR.displayName=w0;var fR="CollapsibleTrigger",hR=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Ox(fR,n);return S.jsx(Rt.button,{type:"button","aria-controls":s.open?s.contentId:void 0,"aria-expanded":s.open||!1,"data-state":Dx(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:Et(t.onClick,s.onOpenToggle)})});hR.displayName=fR;var Nx="CollapsibleContent",pR=g.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ox(Nx,t.__scopeCollapsible);return S.jsx(Qi,{present:n||s.open,children:({present:i})=>S.jsx(mq,{...r,ref:e,present:i})})});pR.displayName=Nx;var mq=g.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Ox(Nx,n),[u,c]=g.useState(r),f=g.useRef(null),h=Yt(e,f),p=g.useRef(0),v=p.current,y=g.useRef(0),x=y.current,_=a.open||u,b=g.useRef(_),E=g.useRef(void 0);return g.useEffect(()=>{const C=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(C)},[]),ui(()=>{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 P=C.getBoundingClientRect();p.current=P.height,y.current=P.width,b.current||(C.style.transitionDuration=E.current.transitionDuration,C.style.animationName=E.current.animationName),c(r)}},[a.open,r]),S.jsx(Rt.div,{"data-state":Dx(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...t.style},children:_&&s})});function Dx(t){return t?"open":"closed"}var gq=dR,vq=hR,yq=pR,_q=g.createContext(void 0);function mR(t){const e=g.useContext(_q);return t||e||"ltr"}var Ls="Accordion",xq=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[jx,wq,bq]=uR(Ls),[b0]=na(Ls,[bq,cR]),Fx=cR(),gR=g.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return S.jsx(jx.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?S.jsx(Cq,{...i,ref:e}):S.jsx(kq,{...s,ref:e})})});gR.displayName=Ls;var[vR,Sq]=b0(Ls),[yR,Eq]=b0(Ls,{collapsible:!1}),kq=g.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[u,c]=fl({prop:n,defaultProp:r??"",onChange:s,caller:Ls});return S.jsx(vR,{scope:t.__scopeAccordion,value:g.useMemo(()=>u?[u]:[],[u]),onItemOpen:c,onItemClose:g.useCallback(()=>i&&c(""),[i,c]),children:S.jsx(yR,{scope:t.__scopeAccordion,collapsible:i,children:S.jsx(_R,{...a,ref:e})})})}),Cq=g.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,u]=fl({prop:n,defaultProp:r??[],onChange:s,caller:Ls}),c=g.useCallback(h=>u((p=[])=>[...p,h]),[u]),f=g.useCallback(h=>u((p=[])=>p.filter(v=>v!==h)),[u]);return S.jsx(vR,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:f,children:S.jsx(yR,{scope:t.__scopeAccordion,collapsible:!0,children:S.jsx(_R,{...i,ref:e})})})}),[Pq,S0]=b0(Ls),_R=g.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...a}=t,u=g.useRef(null),c=Yt(u,e),f=wq(n),p=mR(s)==="ltr",v=Et(t.onKeyDown,y=>{var R;if(!xq.includes(y.key))return;const x=y.target,_=f().filter(L=>{var N;return!((N=L.ref.current)!=null&&N.disabled)}),b=_.findIndex(L=>L.ref.current===x),E=_.length;if(b===-1)return;y.preventDefault();let C=b;const P=0,T=E-1,A=()=>{C=b+1,C>T&&(C=P)},O=()=>{C=b-1,C<P&&(C=T)};switch(y.key){case"Home":C=P;break;case"End":C=T;break;case"ArrowRight":i==="horizontal"&&(p?A():O());break;case"ArrowDown":i==="vertical"&&A();break;case"ArrowLeft":i==="horizontal"&&(p?O():A());break;case"ArrowUp":i==="vertical"&&O();break}const M=C%E;(R=_[M].ref.current)==null||R.focus()});return S.jsx(Pq,{scope:n,disabled:r,direction:s,orientation:i,children:S.jsx(jx.Slot,{scope:n,children:S.jsx(Rt.div,{...a,"data-orientation":i,ref:c,onKeyDown:r?void 0:v})})})}),jm="AccordionItem",[Tq,Vx]=b0(jm),xR=g.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...s}=t,i=S0(jm,n),a=Sq(jm,n),u=Fx(n),c=il(),f=r&&a.value.includes(r)||!1,h=i.disabled||t.disabled;return S.jsx(Tq,{scope:n,open:f,disabled:h,triggerId:c,children:S.jsx(gq,{"data-orientation":i.orientation,"data-state":CR(f),...u,...s,ref:e,disabled:h,open:f,onOpenChange:p=>{p?a.onItemOpen(r):a.onItemClose(r)}})})});xR.displayName=jm;var wR="AccordionHeader",bR=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=S0(Ls,n),i=Vx(wR,n);return S.jsx(Rt.h3,{"data-orientation":s.orientation,"data-state":CR(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});bR.displayName=wR;var D_="AccordionTrigger",SR=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=S0(Ls,n),i=Vx(D_,n),a=Eq(D_,n),u=Fx(n);return S.jsx(jx.ItemSlot,{scope:n,children:S.jsx(vq,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:e})})});SR.displayName=D_;var ER="AccordionContent",kR=g.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=S0(Ls,n),i=Vx(ER,n),a=Fx(n);return S.jsx(yq,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});kR.displayName=ER;function CR(t){return t?"open":"closed"}var PR=gR,Aq=xR,Rq=bR,Iq=SR,Mq=kR;/**
126
- * @license lucide-react v1.24.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const TR=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
131
- * @license lucide-react v1.24.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const Lq=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
136
- * @license lucide-react v1.24.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const Oq=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
141
- * @license lucide-react v1.24.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const FC=t=>{const e=Oq(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
146
- * @license lucide-react v1.24.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */var E1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
151
- * @license lucide-react v1.24.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const Nq=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},Dq=g.createContext({}),jq=()=>g.useContext(Dq),Fq=g.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:f=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:v="currentColor",className:y=""}=jq()??{},x=r??p?Number(n??h)*24/Number(e??f):n??h;return g.createElement("svg",{ref:c,...E1,width:e??f??E1.width,height:e??f??E1.height,stroke:t??v,strokeWidth:x,className:TR("lucide",y,s),...!i&&!Nq(u)&&{"aria-hidden":"true"},...u},[...a.map(([_,b])=>g.createElement(_,b)),...Array.isArray(i)?i:[i]])});/**
156
- * @license lucide-react v1.24.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const qe=(t,e)=>{const n=g.forwardRef(({className:r,...s},i)=>g.createElement(Fq,{ref:i,iconNode:e,className:TR(`lucide-${Lq(FC(t))}`,`lucide-${t}`,r),...s}));return n.displayName=FC(t),n};/**
161
- * @license lucide-react v1.24.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const Vq=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],$q=qe("arrow-left",Vq);/**
166
- * @license lucide-react v1.24.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const Hq=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],zq=qe("arrow-right",Hq);/**
171
- * @license lucide-react v1.24.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const Uq=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Bq=qe("arrow-up",Uq);/**
176
- * @license lucide-react v1.24.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const Wq=[["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"}]],Gq=qe("bell",Wq);/**
181
- * @license lucide-react v1.24.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const Kq=[["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"}]],Zq=qe("brain",Kq);/**
186
- * @license lucide-react v1.24.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const qq=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Yq=qe("check",qq);/**
191
- * @license lucide-react v1.24.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const Xq=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qq=qe("chevron-down",Xq);/**
196
- * @license lucide-react v1.24.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const Jq=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],eY=qe("chevron-right",Jq);/**
201
- * @license lucide-react v1.24.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const tY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],nY=qe("circle",tY);/**
206
- * @license lucide-react v1.24.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const rY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],sY=qe("clock",rY);/**
211
- * @license lucide-react v1.24.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const iY=[["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"}]],oY=qe("copy",iY);/**
216
- * @license lucide-react v1.24.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const aY=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],lY=qe("dot",aY);/**
221
- * @license lucide-react v1.24.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const uY=[["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"}]],cY=qe("globe",uY);/**
226
- * @license lucide-react v1.24.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const dY=[["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"}]],fY=qe("heart",dY);/**
231
- * @license lucide-react v1.24.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const hY=[["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"}]],pY=qe("house",hY);/**
236
- * @license lucide-react v1.24.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const mY=[["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"}]],gY=qe("image",mY);/**
241
- * @license lucide-react v1.24.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const vY=[["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"}]],yY=qe("inbox",vY);/**
246
- * @license lucide-react v1.24.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const _Y=[["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"}]],xY=qe("lightbulb",_Y);/**
251
- * @license lucide-react v1.24.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const wY=[["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"}]],bY=qe("link",wY);/**
256
- * @license lucide-react v1.24.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const SY=[["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"}]],EY=qe("loader",SY);/**
261
- * @license lucide-react v1.24.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const kY=[["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"}]],CY=qe("lock",kY);/**
266
- * @license lucide-react v1.24.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const PY=[["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"}]],TY=qe("mail",PY);/**
271
- * @license lucide-react v1.24.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const AY=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],RY=qe("menu",AY);/**
276
- * @license lucide-react v1.24.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const IY=[["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"}]],MY=qe("message-circle",IY);/**
281
- * @license lucide-react v1.24.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const LY=[["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"}]],OY=qe("monitor",LY);/**
286
- * @license lucide-react v1.24.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const NY=[["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"}]],DY=qe("moon",NY);/**
291
- * @license lucide-react v1.24.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const jY=[["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"}]],FY=qe("paintbrush",jY);/**
296
- * @license lucide-react v1.24.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const VY=[["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"}]],$Y=qe("palette",VY);/**
301
- * @license lucide-react v1.24.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const HY=[["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"}]],zY=qe("pause",HY);/**
306
- * @license lucide-react v1.24.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const UY=[["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"}]],BY=qe("pencil",UY);/**
311
- * @license lucide-react v1.24.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const WY=[["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"}]],GY=qe("pipette",WY);/**
316
- * @license lucide-react v1.24.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const KY=[["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"}]],ZY=qe("play",KY);/**
321
- * @license lucide-react v1.24.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */const qY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],YY=qe("plus",qY);/**
326
- * @license lucide-react v1.24.0 - ISC
327
- *
328
- * This source code is licensed under the ISC license.
329
- * See the LICENSE file in the root directory of this source tree.
330
- */const XY=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],QY=qe("rectangle-horizontal",XY);/**
331
- * @license lucide-react v1.24.0 - ISC
332
- *
333
- * This source code is licensed under the ISC license.
334
- * See the LICENSE file in the root directory of this source tree.
335
- */const JY=[["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"}]],eX=qe("rocket",JY);/**
336
- * @license lucide-react v1.24.0 - ISC
337
- *
338
- * This source code is licensed under the ISC license.
339
- * See the LICENSE file in the root directory of this source tree.
340
- */const tX=[["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"}]],nX=qe("rotate-ccw",tX);/**
341
- * @license lucide-react v1.24.0 - ISC
342
- *
343
- * This source code is licensed under the ISC license.
344
- * See the LICENSE file in the root directory of this source tree.
345
- */const rX=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],sX=qe("search",rX);/**
346
- * @license lucide-react v1.24.0 - ISC
347
- *
348
- * This source code is licensed under the ISC license.
349
- * See the LICENSE file in the root directory of this source tree.
350
- */const iX=[["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"}]],oX=qe("settings",iX);/**
351
- * @license lucide-react v1.24.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */const aX=[["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"}]],lX=qe("shield",aX);/**
356
- * @license lucide-react v1.24.0 - ISC
357
- *
358
- * This source code is licensed under the ISC license.
359
- * See the LICENSE file in the root directory of this source tree.
360
- */const uX=[["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"}]],cX=qe("skip-forward",uX);/**
361
- * @license lucide-react v1.24.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */const dX=[["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"}]],fX=qe("square-library",dX);/**
366
- * @license lucide-react v1.24.0 - ISC
367
- *
368
- * This source code is licensed under the ISC license.
369
- * See the LICENSE file in the root directory of this source tree.
370
- */const hX=[["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"}]],pX=qe("star",hX);/**
371
- * @license lucide-react v1.24.0 - ISC
372
- *
373
- * This source code is licensed under the ISC license.
374
- * See the LICENSE file in the root directory of this source tree.
375
- */const mX=[["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"}]],gX=qe("sun",mX);/**
376
- * @license lucide-react v1.24.0 - ISC
377
- *
378
- * This source code is licensed under the ISC license.
379
- * See the LICENSE file in the root directory of this source tree.
380
- */const vX=[["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"}]],yX=qe("user",vX);/**
381
- * @license lucide-react v1.24.0 - ISC
382
- *
383
- * This source code is licensed under the ISC license.
384
- * See the LICENSE file in the root directory of this source tree.
385
- */const _X=[["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"}]],xX=qe("users",_X);/**
386
- * @license lucide-react v1.24.0 - ISC
387
- *
388
- * This source code is licensed under the ISC license.
389
- * See the LICENSE file in the root directory of this source tree.
390
- */const wX=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bX=qe("x",wX),SX={"chevron-right":eY,"chevron-down":Qq,pipette:GY,x:bX,copy:oY,menu:RY,dot:lY,monitor:OY,sun:gX,moon:DY,"rectangle-horizontal":QY,circle:nY,"square-library":fX,clock:sY,star:pX,settings:oX,plus:YY,"arrow-left":$q,"arrow-right":zq,"arrow-up":Bq,search:sX,loader:EY,users:xX,lock:CY,mail:TY,bell:Gq,shield:lX,palette:$Y,lightbulb:xY,rocket:eX,heart:fY,paintbrush:FY,brain:Zq,globe:cY,user:yX,image:gY,link:bY,check:Yq,"rotate-ccw":nX,play:ZY,pause:zY,home:pY,"message-circle":MY,inbox:yY,pencil:BY,"skip-forward":cX},VC={lucide:SX},AR=g.createContext(null);function EX(t){const e=g.useContext(AR);return e?VC[e.iconLibrary][t]:VC.lucide[t]}function kX({children:t,defaultLibrary:e="lucide"}){const[n,r]=g.useState(e),s=g.useCallback(i=>{r(i)},[]);return S.jsx(AR.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const RR=g.createContext(null);function $x(){return g.useContext(RR)}const IR=g.createContext(null);function MR(){const t=g.useContext(IR);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const CX=g.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=g.useRef(null),u=g.useRef(new Map),[c,f]=g.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:v,sessionRef:y,handlers:x,registerItem:_,measureItems:b}=jT(a),E=g.useCallback((ie,ae)=>{ae?u.current.set(ie,ae):u.current.delete(ie)},[]),C=g.useCallback(()=>{if(!a.current)return;const ie=new Map;u.current.forEach((ae,me)=>{ie.set(me,{top:ae.offsetTop,left:ae.offsetLeft,width:ae.offsetWidth,height:ae.offsetHeight})}),f(ie)},[]),[P,T]=g.useState(()=>r==="single"?t.defaultValue??"":""),[A,O]=g.useState(()=>r==="multiple"?t.defaultValue??[]:[]),M=t.onValueChange,R=t.onValueChange,L=t.value,N=new Set(r==="multiple"?t.value??A:(()=>{const ie=t.value??P;return ie?[ie]:[]})()),j=g.useCallback(ie=>{const ae=t;ae.onValueChange?ae.onValueChange(ie):T(ie)},[M]),V=g.useCallback(ie=>{const ae=t;ae.onValueChange?ae.onValueChange(ie):O(ie)},[R]),G=g.useCallback(ie=>{if(r==="multiple"){const ae=t.value??A;V(ae.filter(me=>me!==ie))}else j("")},[r,j,V,A,L]);g.useEffect(()=>{b(),C()},[b,C,n]);const Y=[...N].join(",");g.useEffect(()=>{b(),C()},[b,C,Y]);const[K,B]=g.useState(null),X=h!==null?v[h]:null,$=K!==null?v[K]:null,ee=h!==null&&!c.has(h),H=g0(),{value:D,defaultValue:q,onValueChange:re,collapsible:se,type:oe,...ue}=i,de=r==="multiple"?{type:"multiple",value:t.value??A,onValueChange:V}:{type:"single",collapsible:t.collapsible??!0,value:t.value??P,onValueChange:j};return S.jsx(RR.Provider,{value:{registerItem:_,registerFullItem:E,activeIndex:h,grouped:!0,remeasure:()=>{b(),C()},openValues:N,openItemRects:c,toggleValue:G},children:S.jsx(PR,{...de,asChild:!0,children:S.jsxs("div",{ref:ie=>{a.current=ie,typeof e=="function"?e(ie):e&&(e.current=ie)},onMouseEnter:x.onMouseEnter,onMouseMove:ie=>{const ae=a.current;if(ae){const me=ae.getBoundingClientRect(),Se=ae.offsetHeight,Re=me.height,Ke=Se>0?Re/Se:1,it=(ie.clientY-me.top)/Ke+ae.scrollTop;for(const[Oe,at]of c){const It=v[Oe];if(!It)continue;const mt=It.top+It.height,je=at.top+at.height;if(it>=mt&&it<=je){p(null);return}}}x.onMouseMove(ie)},onMouseLeave:x.onMouseLeave,onFocus:ie=>{var me;const ae=(me=ie.target.closest("[data-proximity-index]"))==null?void 0:me.getAttribute("data-proximity-index");if(ae!=null){const Se=Number(ae);p(Se),B(ie.target.matches(":focus-visible")?Se:null)}},onBlur:ie=>{var ae;(ae=a.current)!=null&&ae.contains(ie.relatedTarget)||(B(null),p(null))},className:lr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ue,children:[S.jsx(Gi,{children:[...c.entries()].map(([ie,ae])=>S.jsx(Ki.div,{className:`absolute ${H.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-${ie}`))}),S.jsx(Gi,{children:X&&S.jsx(Ki.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:X.top,left:X.left,width:X.width,height:X.height},animate:{opacity:1,top:X.top,left:X.left,width:X.width,height:X.height},exit:{opacity:0,transition:{duration:.06}},transition:{...Hd.fast,opacity:{duration:.08}}},y.current)}),S.jsx(Gi,{children:$&&S.jsx(Ki.div,{className:`absolute ${H.focusRing} pointer-events-none z-20 border border-[#6B97FF]`,initial:!1,animate:{left:$.left-2,top:$.top-2,width:$.width+4,height:$.height+4},exit:{opacity:0,transition:{duration:.06}},transition:{...Hd.fast,opacity:{duration:.08}}})}),n]})})})});CX.displayName="AccordionGroup";const LR=g.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[f,h]=g.useState(()=>e==="single"?r??"":""),[p,v]=g.useState(()=>e==="multiple"?r??[]:[]),y=new Set(e==="multiple"?s??p:(()=>{const C=s??f;return C?[C]:[]})()),x=g.useCallback(C=>{i?i(C):h(C)},[i]),_=g.useCallback(C=>{i?i(C):v(C)},[i]),b=g.useCallback(C=>{e==="multiple"?_((s??p).filter(T=>T!==C)):x("")},[e,s,p,x,_]),E=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??f,defaultValue:r,onValueChange:x};return S.jsx(PR,{...E,asChild:!0,children:S.jsx("div",{ref:c,className:lr("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:S.jsx(OR.Provider,{value:y,children:S.jsx(NR.Provider,{value:b,children:t})})})})});LR.displayName="Accordion";const OR=g.createContext(new Set),NR=g.createContext(()=>{}),DR=g.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=g.useRef(null),c=$x(),f=g.useContext(OR),h=g.useContext(NR),p=g0(),v=c!=null&&c.grouped?c.openValues.has(t):f.has(t),y=g.useRef(null),x=g.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):h(t)},[c,h,t]);return g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,y.current),()=>c.registerItem(e,null)},[e,c]),g.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return v?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,v]),S.jsx(IR.Provider,{value:{index:e,value:t,isOpen:v,onToggle:x,triggerRef:y},children:S.jsxs(Aq,{ref:_=>{u.current=_,typeof a=="function"?a(_):a&&(a.current=_)},value:t,disabled:n,"data-proximity-index":e,className:lr(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&S.jsx(Gi,{children:v&&S.jsx(Ki.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]})})});DR.displayName="AccordionItem";const jR=g.forwardRef(({children:t,className:e,...n},r)=>{const s=EX("chevron-right"),i=$x(),{index:a,isOpen:u,triggerRef:c}=MR(),f=g0(),[h,p]=g.useState(!1),v=i!=null&&i.grouped?i.activeIndex===a:h,y=S.jsx(Rq,{asChild:!0,children:S.jsx("div",{children:S.jsxs(Iq,{ref:r,className:lr(`relative z-10 flex items-center gap-2.5 ${f.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:_d.semibold},"aria-hidden":"true",children:t}),S.jsx("span",{className:lr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||v?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?_d.semibold:_d.normal},children:t})]}),S.jsx(Ki.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:Hd.fast,children:S.jsx(s,{size:16,strokeWidth:u||v?2:1.5,className:lr("transition-[color,stroke-width] duration-80",u||v?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?S.jsx("div",{ref:c,children:y}):S.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[S.jsx(Gi,{children:h&&S.jsx(Ki.div,{className:`absolute inset-0 ${f.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),y]})});jR.displayName="AccordionTrigger";const FR=g.forwardRef(({children:t,className:e,...n},r)=>{const s=$x(),{isOpen:i}=MR();return S.jsx(Gi,{initial:!1,children:i&&S.jsx(Mq,{forceMount:!0,asChild:!0,...n,children:S.jsx(Ki.div,{ref:r,className:lr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...Hd.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})})})})});FR.displayName="AccordionContent";const Lp=({children:t,defaultValue:e=[],className:n=""})=>S.jsx(LR,{type:"multiple",defaultValue:e,className:lr("w-full",n),children:t}),PX=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return S.jsxs(DR,{value:t,className:lr("w-full",!u&&"border-t border-main-border"),children:[S.jsxs(jR,{"data-cy":r,children:[s?S.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),S.jsxs(FR,{children:[n?S.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};Lp.Item=PX;const TX=()=>{const t=g.useRef(Date.now()),[e,n]=g.useState(0);return g.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},AX=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},$C="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",HC="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",RX="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",Op=["Applying","Thinking","Planning","Crafting"],IX=Op.reduce((t,e)=>t.length>=e.length?t:e),MX=20,LX="Still working — runs can take a few minutes.",OX=({hint:t,showElapsed:e=!0})=>{const[n,r]=g.useState(0),s=TX();g.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%Op.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=MX?LX:null);return S.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[S.jsx(sl.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(sl.path,{animate:{d:[$C,HC,RX,HC,$C]},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:_d.medium},children:[S.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:IX}),S.jsx(Gi,{mode:"popLayout",initial:!1,children:S.jsx(sl.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:Op[n]},Op[n])})]}),e?S.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:AX(s)}):null,i?S.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};function VR(t,[e,n]){return Math.min(n,Math.max(e,t))}function NX(t){const e=g.useRef({value:t,previous:t});return g.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var $R=["PageUp","PageDown"],HR=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],zR={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xu="Slider",[j_,DX,jX]=uR(Xu),[Hx]=na(Xu,[jX]),[FX,xf]=Hx(Xu),UR=g.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:u=!1,minStepsBetweenThumbs:c=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:v=()=>{},inverted:y=!1,form:x,..._}=t,b=g.useRef(new Set),E=g.useRef(0),C=g.useRef(!1),T=a==="horizontal"?VX:$X,[A,O]=g.useState(null),M=Yt(e,O),[R=[],L]=fl({prop:h,defaultProp:f,onChange:B=>{var $;($=[...b.current][E.current])==null||$.focus({preventScroll:!0,focusVisible:C.current}),C.current=!1,p(B)}}),N=g.useRef(R),j=g.useRef(R);g.useEffect(()=>{const B=x?A==null?void 0:A.ownerDocument.getElementById(x):A==null?void 0:A.closest("form");if(B instanceof HTMLFormElement){const X=()=>L(j.current);return B.addEventListener("reset",X),()=>B.removeEventListener("reset",X)}},[A,x,L]);function V(B){const X=BX(R,B);K(B,X)}function G(B){K(B,E.current)}function Y(){const B=N.current[E.current];R[E.current]!==B&&v(R)}function K(B,X,{commit:$}={commit:!1}){const ee=iI(i),H=Dp(Math.round((B-r)/i)*i+r,ee),D=VR(H,[r,s]);L((q=[])=>{const re=zX(q,D,X);if(KX(re,c*i)){E.current=re.indexOf(D);const se=String(re)!==String(q);return se&&$&&v(re),se?re:q}else return q})}return S.jsx(FX,{scope:t.__scopeSlider,name:n,disabled:u,min:r,max:s,valueIndexToChangeRef:E,thumbs:b.current,values:R,orientation:a,form:x,children:S.jsx(j_.Provider,{scope:t.__scopeSlider,children:S.jsx(j_.Slot,{scope:t.__scopeSlider,children:S.jsx(T,{"aria-disabled":u,"data-disabled":u?"":void 0,..._,ref:M,onPointerDown:Et(_.onPointerDown,()=>{u||(N.current=R,C.current=!1)}),min:r,max:s,inverted:y,onSlideStart:u?void 0:V,onSlideMove:u?void 0:G,onSlideEnd:u?void 0:Y,onHomeKeyDown:()=>{u||(C.current=!0,K(r,0,{commit:!0}))},onEndKeyDown:()=>{u||(C.current=!0,K(s,R.length-1,{commit:!0}))},onStepKeyDown:({event:B,direction:X})=>{if(!u){C.current=!0;const H=$R.includes(B.key)||B.shiftKey&&HR.includes(B.key)?10:1,D=E.current,q=R[D],re=ZX(q,{min:r,step:i,direction:X,multiplier:H});K(re,D,{commit:!0})}}})})})})});UR.displayName=Xu;var[BR,WR]=Hx(Xu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),VX=g.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:f,...h}=t,[p,v]=g.useState(null),y=Yt(e,v),x=g.useRef(void 0),_=mR(s),b=_==="ltr",E=b&&!i||!b&&i;function C(P){const T=x.current||p.getBoundingClientRect(),A=[0,T.width],M=zx(A,E?[n,r]:[r,n]);return x.current=T,M(P-T.left)}return S.jsx(BR,{scope:t.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:S.jsx(GR,{dir:_,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const T=C(P.clientX);a==null||a(T)},onSlideMove:P=>{const T=C(P.clientX);u==null||u(T)},onSlideEnd:()=>{x.current=void 0,c==null||c()},onStepKeyDown:P=>{const A=zR[E?"from-left":"from-right"].includes(P.key);f==null||f({event:P,direction:A?-1:1})}})})}),$X=g.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:u,onStepKeyDown:c,...f}=t,h=g.useRef(null),p=Yt(e,h),v=g.useRef(void 0),y=!s;function x(_){const b=v.current||h.current.getBoundingClientRect(),E=[0,b.height],P=zx(E,y?[r,n]:[n,r]);return v.current=b,P(_-b.top)}return S.jsx(BR,{scope:t.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:S.jsx(GR,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:_=>{const b=x(_.clientY);i==null||i(b)},onSlideMove:_=>{const b=x(_.clientY);a==null||a(b)},onSlideEnd:()=>{v.current=void 0,u==null||u()},onStepKeyDown:_=>{const E=zR[y?"from-bottom":"from-top"].includes(_.key);c==null||c({event:_,direction:E?-1:1})}})})}),GR=g.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:u,onStepKeyDown:c,...f}=t,h=xf(Xu,n);return S.jsx(Rt.span,{...f,ref:e,onKeyDown:Et(t.onKeyDown,p=>{p.key==="Home"?(a(p),p.preventDefault()):p.key==="End"?(u(p),p.preventDefault()):$R.concat(HR).includes(p.key)&&(c(p),p.preventDefault())}),onPointerDown:Et(t.onPointerDown,p=>{const v=p.target;v.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(v)?v.focus({preventScroll:!0,focusVisible:!1}):r(p)}),onPointerMove:Et(t.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&s(p)}),onPointerUp:Et(t.onPointerUp,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&(v.releasePointerCapture(p.pointerId),i(p))})})}),KR="SliderTrack",ZR=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=xf(KR,n);return S.jsx(Rt.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});ZR.displayName=KR;var F_="SliderRange",qR=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=xf(F_,n),i=WR(F_,n),a=g.useRef(null),u=Yt(e,a),c=s.values.length,f=s.values.map(v=>sI(v,s.min,s.max)),h=c>1?Math.min(...f):0,p=100-Math.max(...f);return S.jsx(Rt.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:u,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});qR.displayName=F_;var YR="SliderThumb",[HX,XR]=Hx(YR),QR="SliderThumbProvider";function JR(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=xf(QR,e),a=DX(e),[u,c]=g.useState(null),f=g.useMemo(()=>u?a().findIndex(b=>b.ref.current===u):-1,[a,u]),h=h5(u),p=u?!!i.form||!!u.closest("form"):!0,v=i.values[f],y=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),x=v===void 0?0:sI(v,i.min,i.max);g.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const _={value:v,name:y,form:i.form,isFormControl:p,index:f,thumb:u,onThumbChange:c,percent:x,size:h};return S.jsx(HX,{scope:e,..._,children:qX(s)?s(_):r})}JR.displayName=QR;var Np="SliderThumbTrigger",eI=g.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=xf(Np,n),i=WR(Np,n),{index:a,value:u,percent:c,size:f,onThumbChange:h}=XR(Np,n),p=Yt(e,h),v=UX(a,s.values.length),y=f==null?void 0:f[i.size],x=y?WX(y,c,i.direction):0;return S.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${c}% + ${x}px)`},children:S.jsx(j_.ItemSlot,{scope:n,children:S.jsx(Rt.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":s.min,"aria-valuenow":u,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...r,ref:p,style:u===void 0?{display:"none"}:t.style,onFocus:Et(t.onFocus,()=>{s.valueIndexToChangeRef.current=a})})})})});eI.displayName=Np;var tI=g.forwardRef((t,e)=>{const{__scopeSlider:n,name:r,...s}=t;return S.jsx(JR,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:i,isFormControl:a})=>S.jsxs(S.Fragment,{children:[S.jsx(eI,{...s,ref:e,__scopeSlider:n}),a?S.jsx(rI,{__scopeSlider:n},i):null]})})});tI.displayName=YR;var nI="SliderBubbleInput",rI=g.forwardRef(({__scopeSlider:t,...e},n)=>{const{value:r,name:s,form:i}=XR(nI,t),a=g.useRef(null),u=Yt(a,n),c=NX(r);return g.useEffect(()=>{const f=a.current;if(!f)return;const h=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==r&&v){const y=new Event("input",{bubbles:!0});v.call(f,r),f.dispatchEvent(y)}},[c,r]),S.jsx(Rt.input,{style:{display:"none"},name:s,form:i,...e,ref:u,defaultValue:r})});rI.displayName=nI;function zX(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function sI(t,e,n){const i=100/(n-e)*(t-e);return VR(i,[0,100])}function UX(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function BX(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)}function WX(t,e,n){const r=t/2,i=zx([0,50],[0,r]);return(r-i(e)*n)*n}function GX(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function KX(t,e){if(e>0){const n=GX(t);return Math.min(...n)>=e}return!0}function zx(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])}}function iI(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]||"",a=Number(s);return Math.max(0,i.length-a)}const n=e.split(".")[1];return n?n.length:0}function Dp(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function ZX(t,{min:e,step:n,direction:r,multiplier:s}){const i=iI(n),a=(t-e)/n,u=Math.round(a),c=Dp(u*n+e,i)===Dp(t,i);let f;return c?f=u+s*r:r>0?f=Math.ceil(a):f=Math.floor(a),Dp(f*n+e,i)}function qX(t){return typeof t=="function"}const V_=g.forwardRef(({className:t,...e},n)=>S.jsxs(UR,{ref:n,className:lr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[S.jsx(ZR,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:S.jsx(qR,{className:"absolute h-full bg-primary"})}),S.jsx(tI,{className:lr("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")})]}));V_.displayName="Slider";const YX=[{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"}],XX=[{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"}],QX=[{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"}],op=[{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:"CommentMarkerLayer",path:"components/CommentMarkerLayer.tsx",status:"feature-only",note:"Preview overlay layer tied to comment collections."},{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."}],JX=()=>{window.location.hash=""},Ii=({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]}),zC=({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))}),eQ=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",tQ=()=>{const t=op.filter(n=>n.status==="showcased").length,e=op.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:JX,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[S.jsx(az,{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(vT,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",S.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),S.jsx(Ii,{eyebrow:"Controls",title:"Button, split button, and tooltip",description:"The gallery uses Rivet's tooltip-wrapped button, compound split button, and the lower-level Radix tooltip wrapper so the reusable control APIs are visible.",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 wrapper"}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[S.jsx(du,{title:"Primary action",shortcut:"D",className:"bg-primary text-primary-foreground hover:bg-primary-hover rounded-lg px-4 py-2 text-sm font-medium transition-colors",children:"Design action"}),S.jsx(du,{title:"Secondary action",className:"border-border bg-surface-4 text-content hover:bg-surface-5 rounded-lg border px-4 py-2 text-sm font-medium transition-colors",children:"Secondary"}),S.jsx(du,{title:"Disabled action",disabled:!0,className:"border-border bg-muted text-muted-foreground rounded-lg border px-4 py-2 text-sm font-medium opacity-60",children:"Disabled"}),S.jsx(V5,{primaryLabel:"Ship",primaryIcon:s1,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(Fo,{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(fx,{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(Ii,{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(zC,{swatches:YX})}),S.jsx(Ii,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:S.jsx(zC,{swatches:XX})}),S.jsx(Ii,{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(Ii,{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:QX.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(Ii,{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(Lp,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[S.jsx(Lp.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:S.jsx(s1,{className:"text-primary h-4 w-4"}),children:S.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),S.jsx(Lp.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(V_,{defaultValue:[64],max:100,step:1}),S.jsx(V_,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),S.jsx(Ii,{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(cA,{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(Q2,{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(OX,{hint:"Reading selected elements"})})]})}),S.jsx(Ii,{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(wd,{fill:"surface",loader:"spinner",title:"Starting preview",description:"Its preview server is starting up."})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(wd,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),S.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:S.jsx(lA,{icon:S.jsx(s1,{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(Tm,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),S.jsxs(Ii,{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:op.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:op.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 ${eQ(n.status)}`,children:n.status})}),S.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},nQ=64,Fm=new Set;let jp=null;const rQ=()=>{jp=null;for(const t of Fm)t()},sQ=()=>{Fm.size!==0&&(jp!==null&&clearTimeout(jp),jp=setTimeout(rQ,nQ))},iQ=t=>(Fm.add(t),()=>{Fm.delete(t)}),oQ=(t,e)=>typeof URL<"u"&&t instanceof URL?t:typeof Request<"u"&&t instanceof Request?new URL(t.url):new URL(String(t),e),aQ=(t,e)=>{try{const n=oQ(t,e);return n.origin!==e?!1:n.pathname.startsWith("/api/")}catch{return!1}},lQ=({nativeFetch:t,pageOrigin:e,getShouldIntercept:n})=>{const r=(s,i)=>t(s,i).then(a=>(a.status===401&&n()&&aQ(s,e)&&sQ(),a));return window.fetch=r,()=>{window.fetch=t}},uQ=t=>!t.hasConfig||t.configLoading||t.demoMode!==!0||t.agentModeAvailable!==!0||t.pathnameDemoSessionId!==null?!1:(t.activeDemoSessionId??t.configuredDemoSessionId??null)===null,cQ=(t,e,n)=>t===!0&&e!==!0?null:n,dQ=t=>t?"Preparing your demo session…":null,fQ=t=>!(t==="/rivet"||t.startsWith("/rivet/")),hQ=t=>!fQ(t.pathname)||t.hasConfig?!1:!t.configLoading&&!t.isRetryingConfig,pQ=t=>{const e=t.match(/^\/try\/([^/]+)/);return e!=null&&e[1]?decodeURIComponent(e[1]):null},mQ=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",k1=hs("App"),gQ=2e3,vQ=60,UC="Connecting to Google...",BC="https://rivet-proxy.onrender.com",yQ=`<!doctype html>
391
- <html lang="en">
392
- <head>
393
- <meta charset="utf-8" />
394
- <meta name="viewport" content="width=device-width, initial-scale=1" />
395
- <title>${UC}</title>
396
- <style>
397
- :root { color-scheme: light dark; }
398
- body {
399
- margin: 0;
400
- min-height: 100vh;
401
- display: grid;
402
- place-items: center;
403
- font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
404
- background: #111215;
405
- color: #f3f4f6;
406
- }
407
- .panel {
408
- border: 1px solid rgba(255, 255, 255, 0.16);
409
- border-radius: 12px;
410
- padding: 18px 22px;
411
- background: rgba(255, 255, 255, 0.06);
412
- font-size: 14px;
413
- }
414
- </style>
415
- </head>
416
- <body>
417
- <div class="panel">${UC}</div>
418
- </body>
419
- </html>`,_Q="Too many people are trying Rivet right now. Please try again in a few minutes.",oI="Failed to start an isolated demo session.",xQ=async t=>{if(t.status===429)return _Q;try{const e=await t.json();if(e.error)return e.error;if(e.message)return e.message}catch{}return oI},$_=274,Vm=395,C1=Math.min(Vm,Math.round(($_+Vm)/2*1.1)),WC="rivet:panelWidth:v2",wQ=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},bQ=({projectPath:t,activeDemoSessionId:e=null,showLoginGate:n=!1,onStartLogin:r,isStartingLogin:s=!1,loginError:i=null,fullPageHostedLoginProgressMessage:a=null,holdHostedTryoutPreviewNavigation:u=!1,hostedTryoutPreviewHoldMessage:c=null,deferInspectorUntilPreviewReady:f=!1})=>{const h=Xe(WT)>0,[p,v]=Q6(UT),y=jV(),[x,_]=g.useState(()=>{if(typeof window>"u")return C1;const Y=Number(window.localStorage.getItem(WC));return Number.isFinite(Y)&&Y>=$_&&Y<=Vm?Y:C1}),[b,E]=g.useState(!1),[C,P]=g.useState(YZ),T=p?x:0,[A,O]=g.useState(p);g.useEffect(()=>{if(!p){O(!1);return}P(Y=>qZ({position:Y,boundsLeftPx:x}))},[p,x]),g.useEffect(()=>{window.localStorage.setItem(WC,String(x))},[x]),g.useEffect(()=>{if(!p)return;const Y=K=>{K.key==="Escape"&&(wQ(K.target)||(K.preventDefault(),v(!1)))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[p,v]);const M=g.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation();const K=Y.clientX,B=x;E(!0);const X=ee=>{const H=Math.min(Vm,Math.max($_,B+(ee.clientX-K)));_(H)},$=()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$),E(!1)};window.addEventListener("pointermove",X),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$)},[x]),R=g.useCallback(()=>_(C1),[]),L=uq(),N=Xe(mf);fq({enabled:!N});const j=L.isProcessing?"Completing authentication...":a,V=j!==null,G=st(YT);return g.useEffect(()=>{G(t??null)},[t,G]),g.useEffect(()=>{n&&(document.body.style.cursor="auto")},[n]),S.jsxs(sl.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[j!==null&&!n?S.jsx("div",{className:"absolute inset-0 z-50",children:S.jsx(DZ,{message:j})}):null,n?S.jsx("div",{className:"absolute inset-0 z-40 flex items-center justify-center bg-black/45 backdrop-blur-[2px]",children:S.jsx(aR,{isSigningIn:s||V,onStartSignIn:()=>{r==null||r()},errorMessage:i,displayMode:"modal"})}):null,S.jsxs("div",{className:`relative flex min-w-0 flex-1 flex-col ${n?"pointer-events-none select-none":""}`,children:[S.jsx(dK,{holdHostedTryoutPreviewNavigation:u,isInteractionDisabled:n,activeDemoSessionId:e}),u&&c?S.jsx("div",{className:"bg-main absolute inset-0 z-30 flex items-center justify-center",children:S.jsx("div",{className:"border-divider bg-main-light rounded-lg border p-6 shadow-lg",children:S.jsx(cA,{message:c})})}):null]}),n?null:S.jsx(S.Fragment,{children:!f&&!h?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:A?x:0},children:S.jsxs(sl.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:p?0:-x},transition:y?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{p&&O(!0)},style:{width:x,willChange:"transform"},children:[S.jsx(CG,{onClose:()=>v(!1)}),S.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:M,onDoubleClick:R,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 ${b?"w-0.5 bg-content-muted":"w-px bg-divider group-hover/resize:w-0.5 group-hover/resize:bg-content-muted"}`})})]})}),b&&S.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),S.jsx(JZ,{isVisible:!0,isPanelOpen:p,isReducedMotion:!!y,position:C,dragBoundsLeftPx:T,onPositionChange:P,onToggle:()=>v(Y=>!Y)})]}):null}),S.jsx(d$,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},H_="rivet_connect_deep_link",SQ=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(H_);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(H_,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},EQ=SQ(),kQ=()=>{const[t,e]=g.useState(window.location.hash),[n]=g.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(Mp)==="1"),[r,s]=g.useState(!1),[i,a]=g.useState(EQ);g.useEffect(()=>{n&&window.sessionStorage.removeItem(Mp)},[n]);const{config:u,refetchConfig:c,loading:f,error:h}=aq(),p=st(mf),[v,y]=g.useState(!1),[x,_]=g.useState(null),[b,E]=g.useState(!1),[C,P]=g.useState(!1),[T,A]=g.useState(null),[O,M]=g.useState(!1),R=g.useRef(!1),L=g.useRef(!1),N=pQ(window.location.pathname),j=(u==null?void 0:u.activeDemoSessionId)??null,V=N??T??j,G=g.useMemo(()=>cQ(u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,V),[u==null?void 0:u.demoMode,u==null?void 0:u.agentModeAvailable,V]),Y=g.useMemo(()=>uQ({configLoading:f,hasConfig:u!==null,demoMode:u==null?void 0:u.demoMode,agentModeAvailable:u==null?void 0:u.agentModeAvailable,pathnameDemoSessionId:N,activeDemoSessionId:T,configuredDemoSessionId:j}),[u,f,N,T,j]);g.useLayoutEffect(()=>{if(!Y){M(!1);return}M(!0)},[Y]);const K=O,B=g.useMemo(()=>dQ(K),[K]),X=(u==null?void 0:u.demoMode)===!0&&K,$=g.useRef(null);$.current=V;const ee=g.useCallback(async()=>{if(!R.current)return;A(null);const me=await c();if((me==null?void 0:me.demoMode)===!0&&me.agentModeAvailable!==!0){P(!1);return}(me==null?void 0:me.demoMode)===!0&&P(!0)},[c]);g.useEffect(()=>{if((u==null?void 0:u.demoMode)===!0)return iQ(()=>{ee()})},[u==null?void 0:u.demoMode,ee]),g.useEffect(()=>{if(R.current=(u==null?void 0:u.demoMode)===!0,(u==null?void 0:u.demoMode)!==!0)return;const me=window.fetch.bind(window);return lQ({nativeFetch:me,pageOrigin:window.location.origin,getShouldIntercept:()=>R.current})},[u==null?void 0:u.demoMode]),g.useEffect(()=>{(u==null?void 0:u.agentModeAvailable)===!0&&P(!1)},[u==null?void 0:u.agentModeAvailable]);const H=g.useCallback(async me=>{const Se=$.current;if(!(me!=null&&me.forceRefresh)&&Se)return Se;if(L.current)return"";L.current=!0;try{const Re=await fetch("/api/demo/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!Re.ok){const it=await xQ(Re);throw new Error(it)}const Ke=await Re.json();if(!Ke.sessionId)throw new Error("Demo session response missing session id.");return A(Ke.sessionId),Ke.sessionId}finally{L.current=!1}},[]);g.useEffect(()=>{j&&A(j)},[j]),g.useEffect(()=>{u!=null&&u.userId?(Te.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Te.alias(u.email,u.userId)):u!=null&&u.email&&Te.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),g.useEffect(()=>{if(!u)return;const me=!!u.demoMode,Se=me?V:null;Te.register({source:me?"tryout":"core",demo_mode:me,...Se?{demo_session_id:Se}:{}})},[u,V]);const D=g.useCallback(async()=>{var Se;y(!0),_(null);let me=null;try{if(me=window.open("","_blank"),!me)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{me.document.open(),me.document.write(yQ),me.document.close()}catch(it){k1.warn("Failed to render loading state in auth popup:",it)}const Re=await fetch(`${BC}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),Ke=await Re.json();if(!Re.ok||!Ke.success||!Ke.authUrl||!Ke.sessionId||!Ke.pollSecret)throw new Error(Ke.error||Ke.message||"Failed to start Google login");if(me.closed)throw new Error("Sign-in window was closed before Google login started.");me.location.href=Ke.authUrl;for(let it=0;it<vQ;it+=1){if(me.closed)throw new Error("Sign-in window was closed before authentication completed.");const at=await(await fetch(`${BC}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:Ke.sessionId,pollSecret:Ke.pollSecret})})).json();if(at.success&&at.token&&((Se=at.user)!=null&&Se.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:at.user.email,token:at.token,refreshToken:at.refreshToken,userId:at.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");if(me.close(),window.sessionStorage.setItem(Mp,"1"),(u==null?void 0:u.demoMode)===!0){await H({forceRefresh:!0}),window.location.reload();return}window.location.reload();return}if(at.error&&at.error!=="Pending")throw new Error(at.error||"Google login failed");await new Promise(It=>setTimeout(It,gQ))}throw new Error("Authentication timed out. Please try again.")}catch(Re){me&&!me.closed&&me.close();const Ke=Re instanceof Error?Re.message:"Failed to start login flow";k1.warn("Hosted login failed:",Ke),_(Ke),y(!1)}},[u==null?void 0:u.demoMode,H]),q=(u==null?void 0:u.demoMode)===!0&&((u==null?void 0:u.agentModeAvailable)!==!0||C||v),re=u!=null&&u.agentModeAvailable!==!0,se=mQ(t),oe=g.useCallback(async()=>{E(!0),p(!0);try{await c()}finally{p(!1),E(!1)}},[c,p]);if(g.useEffect(()=>{if(!Y)return;let me=!1;return H({forceRefresh:!0}).catch(Se=>{const Re=Se instanceof Error?Se.message:oI;k1.warn("Hosted session bootstrap failed:",Re),_(Re),ht.error(Re)}).finally(()=>{me||M(!1)}),()=>{me=!0}},[Y,H]),g.useEffect(()=>{const me=()=>{const Se=window.location.hash;e(Se)};return window.addEventListener("hashchange",me),()=>window.removeEventListener("hashchange",me)},[]),se==="design-system")return S.jsx(tQ,{});const ue={pathname:window.location.pathname,configLoading:f,hasConfig:u!==null,isRetryingConfig:b};if(hQ(ue)){const me=h||"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:me}),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:()=>{oe()},children:"Retry"})]})})}if(re)return S.jsx(aR,{isSigningIn:v,onStartSignIn:()=>{D()},errorMessage:x,displayMode:"full"});const ie=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&i!==null,ae=(u==null?void 0:u.agentModeAvailable)===!0&&(u==null?void 0:u.demoMode)!==!0&&n&&!r&&!ie;return S.jsxs(S.Fragment,{children:[S.jsx(bQ,{projectPath:u==null?void 0:u.projectPath,activeDemoSessionId:G,showLoginGate:q,onStartLogin:D,isStartingLogin:v,loginError:x,fullPageHostedLoginProgressMessage:(u==null?void 0:u.demoMode)===!0&&v?"Completing sign-in...":null,holdHostedTryoutPreviewNavigation:K,hostedTryoutPreviewHoldMessage:B,deferInspectorUntilPreviewReady:X}),S.jsx(x_,{context:"onboarding",isOpen:ae,onClose:()=>s(!0)}),S.jsx(x_,{context:"menu",isOpen:ie,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(H_),a(null)}})]})},CQ="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",PQ=new vL,TQ={session_recording:{maskAllInputs:!1,maskInputOptions:{password:!0},maskTextSelector:null}},AQ=()=>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."})});lD.createRoot(document.getElementById("root")).render(S.jsx(ve.StrictMode,{children:S.jsx(XN,{apiKey:CQ,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",...TQ,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"core",rivet_version:"0.13.2",env:"production"})}},children:S.jsx(nD,{fallback:S.jsx(AQ,{}),children:S.jsx(yL,{client:PQ,children:S.jsx(RW,{defaultShape:"rounded",children:S.jsx(kX,{defaultLibrary:"lucide",children:S.jsx(kQ,{})})})})})})}));