rivet-design 0.14.21 → 0.14.22

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.
@@ -0,0 +1,423 @@
1
+ var tL=Object.defineProperty;var cE=t=>{throw TypeError(t)};var nL=(t,e,n)=>e in t?tL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Uo=(t,e,n)=>nL(t,typeof e!="symbol"?e+"":e,n),Ev=(t,e,n)=>e.has(t)||cE("Cannot "+n);var z=(t,e,n)=>(Ev(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(t,e,n)=>e.has(t)?cE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ke=(t,e,n,r)=>(Ev(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ut=(t,e,n)=>(Ev(t,e,"access private method"),n);var Xh=(t,e,n,r)=>({set _(s){ke(t,e,s,n)},get _(){return z(t,e,r)}});function rL(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 d0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Cv={exports:{}},od={},kv={exports:{}},at={};/**
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 dE;function sL(){if(dE)return at;dE=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"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function x(j,X,oe){this.props=j,this.context=X,this.refs=_,this.updater=oe||y}x.prototype.isReactComponent={},x.prototype.setState=function(j,X){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,X,"setState")},x.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function b(){}b.prototype=x.prototype;function P(j,X,oe){this.props=j,this.context=X,this.refs=_,this.updater=oe||y}var T=P.prototype=new b;T.constructor=P,w(T,x.prototype),T.isPureReactComponent=!0;var k=Array.isArray,I=Object.prototype.hasOwnProperty,R={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function A(j,X,oe){var se,ee={},ce=null,we=null;if(X!=null)for(se in X.ref!==void 0&&(we=X.ref),X.key!==void 0&&(ce=""+X.key),X)I.call(X,se)&&!L.hasOwnProperty(se)&&(ee[se]=X[se]);var ue=arguments.length-2;if(ue===1)ee.children=oe;else if(1<ue){for(var ie=Array(ue),Ne=0;Ne<ue;Ne++)ie[Ne]=arguments[Ne+2];ee.children=ie}if(j&&j.defaultProps)for(se in ue=j.defaultProps,ue)ee[se]===void 0&&(ee[se]=ue[se]);return{$$typeof:t,type:j,key:ce,ref:we,props:ee,_owner:R.current}}function O(j,X){return{$$typeof:t,type:j.type,key:X,ref:j.ref,props:j.props,_owner:j._owner}}function D(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function N(j){var X={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(oe){return X[oe]})}var F=/\/+/g;function K(j,X){return typeof j=="object"&&j!==null&&j.key!=null?N(""+j.key):X.toString(36)}function Z(j,X,oe,se,ee){var ce=typeof j;(ce==="undefined"||ce==="boolean")&&(j=null);var we=!1;if(j===null)we=!0;else switch(ce){case"string":case"number":we=!0;break;case"object":switch(j.$$typeof){case t:case e:we=!0}}if(we)return we=j,ee=ee(we),j=se===""?"."+K(we,0):se,k(ee)?(oe="",j!=null&&(oe=j.replace(F,"$&/")+"/"),Z(ee,X,oe,"",function(Ne){return Ne})):ee!=null&&(D(ee)&&(ee=O(ee,oe+(!ee.key||we&&we.key===ee.key?"":(""+ee.key).replace(F,"$&/")+"/")+j)),X.push(ee)),1;if(we=0,se=se===""?".":se+":",k(j))for(var ue=0;ue<j.length;ue++){ce=j[ue];var ie=se+K(ce,ue);we+=Z(ce,X,oe,ie,ee)}else if(ie=m(j),typeof ie=="function")for(j=ie.call(j),ue=0;!(ce=j.next()).done;)ce=ce.value,ie=se+K(ce,ue++),we+=Z(ce,X,oe,ie,ee);else if(ce==="object")throw X=String(j),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.");return we}function W(j,X,oe){if(j==null)return j;var se=[],ee=0;return Z(j,se,"","",function(ce){return X.call(oe,ce,ee++)}),se}function G(j){if(j._status===-1){var X=j._result;X=X(),X.then(function(oe){(j._status===0||j._status===-1)&&(j._status=1,j._result=oe)},function(oe){(j._status===0||j._status===-1)&&(j._status=2,j._result=oe)}),j._status===-1&&(j._status=0,j._result=X)}if(j._status===1)return j._result.default;throw j._result}var Y={current:null},$={transition:null},J={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:$,ReactCurrentOwner:R};function H(){throw Error("act(...) is not supported in production builds of React.")}return at.Children={map:W,forEach:function(j,X,oe){W(j,function(){X.apply(this,arguments)},oe)},count:function(j){var X=0;return W(j,function(){X++}),X},toArray:function(j){return W(j,function(X){return X})||[]},only:function(j){if(!D(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},at.Component=x,at.Fragment=n,at.Profiler=s,at.PureComponent=P,at.StrictMode=r,at.Suspense=c,at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J,at.act=H,at.cloneElement=function(j,X,oe){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var se=w({},j.props),ee=j.key,ce=j.ref,we=j._owner;if(X!=null){if(X.ref!==void 0&&(ce=X.ref,we=R.current),X.key!==void 0&&(ee=""+X.key),j.type&&j.type.defaultProps)var ue=j.type.defaultProps;for(ie in X)I.call(X,ie)&&!L.hasOwnProperty(ie)&&(se[ie]=X[ie]===void 0&&ue!==void 0?ue[ie]:X[ie])}var ie=arguments.length-2;if(ie===1)se.children=oe;else if(1<ie){ue=Array(ie);for(var Ne=0;Ne<ie;Ne++)ue[Ne]=arguments[Ne+2];se.children=ue}return{$$typeof:t,type:j.type,key:ee,ref:ce,props:se,_owner:we}},at.createContext=function(j){return j={$$typeof:a,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:i,_context:j},j.Consumer=j},at.createElement=A,at.createFactory=function(j){var X=A.bind(null,j);return X.type=j,X},at.createRef=function(){return{current:null}},at.forwardRef=function(j){return{$$typeof:u,render:j}},at.isValidElement=D,at.lazy=function(j){return{$$typeof:h,_payload:{_status:-1,_result:j},_init:G}},at.memo=function(j,X){return{$$typeof:d,type:j,compare:X===void 0?null:X}},at.startTransition=function(j){var X=$.transition;$.transition={};try{j()}finally{$.transition=X}},at.unstable_act=H,at.useCallback=function(j,X){return Y.current.useCallback(j,X)},at.useContext=function(j){return Y.current.useContext(j)},at.useDebugValue=function(){},at.useDeferredValue=function(j){return Y.current.useDeferredValue(j)},at.useEffect=function(j,X){return Y.current.useEffect(j,X)},at.useId=function(){return Y.current.useId()},at.useImperativeHandle=function(j,X,oe){return Y.current.useImperativeHandle(j,X,oe)},at.useInsertionEffect=function(j,X){return Y.current.useInsertionEffect(j,X)},at.useLayoutEffect=function(j,X){return Y.current.useLayoutEffect(j,X)},at.useMemo=function(j,X){return Y.current.useMemo(j,X)},at.useReducer=function(j,X,oe){return Y.current.useReducer(j,X,oe)},at.useRef=function(j){return Y.current.useRef(j)},at.useState=function(j){return Y.current.useState(j)},at.useSyncExternalStore=function(j,X,oe){return Y.current.useSyncExternalStore(j,X,oe)},at.useTransition=function(){return Y.current.useTransition()},at.version="18.3.1",at}var fE;function k2(){return fE||(fE=1,kv.exports=sL()),kv.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 hE;function iL(){if(hE)return od;hE=1;var t=k2(),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,d){var h,p={},m=null,y=null;d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+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:m,ref:y,props:p,_owner:s.current}}return od.Fragment=n,od.jsx=a,od.jsxs=a,od}var pE;function oL(){return pE||(pE=1,Cv.exports=iL()),Cv.exports}var E=oL(),v=k2();const ye=d0(v),If=rL({__proto__:null,default:ye},[v]);var Af=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(){}},gl,Yo,Gu,n8,aL=(n8=class extends Af{constructor(){super();He(this,gl);He(this,Yo);He(this,Gu);ke(this,Gu,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,Yo)||this.setEventListener(z(this,Gu))}onUnsubscribe(){var e;this.hasListeners()||((e=z(this,Yo))==null||e.call(this),ke(this,Yo,void 0))}setEventListener(e){var n;ke(this,Gu,e),(n=z(this,Yo))==null||n.call(this),ke(this,Yo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){z(this,gl)!==e&&(ke(this,gl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof z(this,gl)=="boolean"?z(this,gl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},gl=new WeakMap,Yo=new WeakMap,Gu=new WeakMap,n8),P2=new aL,lL={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Xo,C2,r8,uL=(r8=class{constructor(){He(this,Xo,lL);He(this,C2,!1)}setTimeoutProvider(t){ke(this,Xo,t)}setTimeout(t,e){return z(this,Xo).setTimeout(t,e)}clearTimeout(t){z(this,Xo).clearTimeout(t)}setInterval(t,e){return z(this,Xo).setInterval(t,e)}clearInterval(t){z(this,Xo).clearInterval(t)}},Xo=new WeakMap,C2=new WeakMap,r8),ul=new uL;function cL(t){setTimeout(t,0)}var dL=typeof window>"u"||"Deno"in globalThis;function Rr(){}function fL(t,e){return typeof t=="function"?t(e):t}function ay(t){return typeof t=="number"&&t>=0&&t!==1/0}function f8(t,e){return Math.max(t+(e||0)-Date.now(),0)}function la(t,e){return typeof t=="function"?t(e):t}function Zr(t,e){return typeof t=="function"?t(e):t}function mE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==T2(a,e.options))return!1}else if(!ic(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 gE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Ud(e.options.mutationKey)!==Ud(i))return!1}else if(!ic(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function T2(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ud)(t)}function Ud(t){return JSON.stringify(t,(e,n)=>uy(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function ic(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){for(let r=0;r<e.length;r++)if(!ic(t[r],e[r]))return!1;return!0}const n=Object.keys(e);for(const r of n)if(!ic(t[r],e[r]))return!1;return!0}return!1}var hL=Object.prototype.hasOwnProperty;function h8(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=vE(t)&&vE(e);if(!r&&!(uy(t)&&uy(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 d=0;for(let h=0;h<u;h++){const p=r?h:a[h],m=t[p],y=e[p];if(m===y){c[p]=m,(r?h<i:hL.call(t,p))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){c[p]=y;continue}const w=h8(m,y,n+1);c[p]=w,w===m&&d++}return i===u&&d===i?t:c}function ly(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 vE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function uy(t){if(!yE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!yE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function yE(t){return Object.prototype.toString.call(t)==="[object Object]"}function pL(t){return new Promise(e=>{ul.setTimeout(e,t)})}function cy(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?h8(t,e):e}function mL(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function gL(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var I2=Symbol();function p8(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===I2?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function m8(t,e){return typeof t=="function"?t(...e):!!t}function vL(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 Wd=(()=>{let t=()=>dL;return{isServer(){return t()},setIsServer(e){t=e}}})();function dy(){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 yL=cL;function _L(){let t=[],e=0,n=u=>{u()},r=u=>{u()},s=yL;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 Wn=_L(),Ku,Qo,qu,s8,wL=(s8=class extends Af{constructor(){super();He(this,Ku,!0);He(this,Qo);He(this,qu);ke(this,qu,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(){z(this,Qo)||this.setEventListener(z(this,qu))}onUnsubscribe(){var e;this.hasListeners()||((e=z(this,Qo))==null||e.call(this),ke(this,Qo,void 0))}setEventListener(e){var n;ke(this,qu,e),(n=z(this,Qo))==null||n.call(this),ke(this,Qo,e(this.setOnline.bind(this)))}setOnline(e){z(this,Ku)!==e&&(ke(this,Ku,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return z(this,Ku)}},Ku=new WeakMap,Qo=new WeakMap,qu=new WeakMap,s8),um=new wL;function xL(t){return Math.min(1e3*2**t,3e4)}function g8(t){return(t??"online")==="online"?um.isOnline():!0}var fy=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function v8(t){let e=!1,n=0,r;const s=dy(),i=()=>s.status!=="pending",a=_=>{var x;if(!i()){const b=new fy(_);m(b),(x=t.onCancel)==null||x.call(t,b)}},u=()=>{e=!0},c=()=>{e=!1},d=()=>P2.isFocused()&&(t.networkMode==="always"||um.isOnline())&&t.canRun(),h=()=>g8(t.networkMode)&&t.canRun(),p=_=>{i()||(r==null||r(),s.resolve(_))},m=_=>{i()||(r==null||r(),s.reject(_))},y=()=>new Promise(_=>{var x;r=b=>{(i()||d())&&_(b)},(x=t.onPause)==null||x.call(t)}).then(()=>{var _;r=void 0,i()||(_=t.onContinue)==null||_.call(t)}),w=()=>{if(i())return;let _;const x=n===0?t.initialPromise:void 0;try{_=x??t.fn()}catch(b){_=Promise.reject(b)}Promise.resolve(_).then(p).catch(b=>{var R;if(i())return;const P=t.retry??(Wd.isServer()?0:3),T=t.retryDelay??xL,k=typeof T=="function"?T(n,b):T,I=P===!0||typeof P=="number"&&n<P||typeof P=="function"&&P(n,b);if(e||!I){m(b);return}n++,(R=t.onFail)==null||R.call(t,n,b),pL(k).then(()=>d()?void 0:y()).then(()=>{e?m(b):w()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(r==null||r(),s),cancelRetry:u,continueRetry:c,canStart:h,start:()=>(h()?w():y().then(w),s)}}var vl,i8,y8=(i8=class{constructor(){He(this,vl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ay(this.gcTime)&&ke(this,vl,ul.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Wd.isServer()?1/0:300*1e3))}clearGcTimeout(){z(this,vl)!==void 0&&(ul.clearTimeout(z(this,vl)),ke(this,vl,void 0))}},vl=new WeakMap,i8);function bL(t){return{onFetch:(e,n)=>{var h,p,m,y,w;const r=e.options,s=(m=(p=(h=e.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:m.direction,i=((y=e.state.data)==null?void 0:y.pages)||[],a=((w=e.state.data)==null?void 0:w.pageParams)||[];let u={pages:[],pageParams:[]},c=0;const d=async()=>{let _=!1;const x=T=>{vL(T,()=>e.signal,()=>_=!0)},b=p8(e.options,e.fetchOptions),P=async(T,k,I)=>{if(_)return Promise.reject(e.signal.reason);if(k==null&&T.pages.length)return Promise.resolve(T);const L=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:k,direction:I?"backward":"forward",meta:e.options.meta};return x(N),N})(),A=await b(L),{maxPages:O}=e.options,D=I?gL:mL;return{pages:D(T.pages,A,O),pageParams:D(T.pageParams,k,O)}};if(s&&i.length){const T=s==="backward",k=T?SL:_E,I={pages:i,pageParams:a},R=k(r,I);u=await P(I,R,T)}else{const T=t??i.length;do{const k=c===0?a[0]??r.initialPageParam:_E(r,u);if(c>0&&k==null)break;u=await P(u,k),c++}while(c<T)}return u};e.options.persister?e.fetchFn=()=>{var _,x;return(x=(_=e.options).persister)==null?void 0:x.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function _E(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 SL(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 Zu,yl,Yu,bs,_l,Rn,Ef,wl,Kr,_8,Gi,o8,EL=(o8=class extends y8{constructor(e){super();He(this,Kr);He(this,Zu);He(this,yl);He(this,Yu);He(this,bs);He(this,_l);He(this,Rn);He(this,Ef);He(this,wl);ke(this,wl,!1),ke(this,Ef,e.defaultOptions),this.setOptions(e.options),this.observers=[],ke(this,_l,e.client),ke(this,bs,z(this,_l).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ke(this,yl,xE(this.options)),this.state=e.state??z(this,yl),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return z(this,Zu)}get promise(){var e;return(e=z(this,Rn))==null?void 0:e.promise}setOptions(e){if(this.options={...z(this,Ef),...e},e!=null&&e._type&&ke(this,Zu,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=xE(this.options);n.data!==void 0&&(this.setState(wE(n.data,n.dataUpdatedAt)),ke(this,yl,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,bs).remove(this)}setData(e,n){const r=cy(this.state.data,e,this.options);return ut(this,Kr,Gi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e){ut(this,Kr,Gi).call(this,{type:"setState",state:e})}cancel(e){var r,s;const n=(r=z(this,Rn))==null?void 0:r.promise;return(s=z(this,Rn))==null||s.cancel(e),n?n.then(Rr).catch(Rr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return z(this,yl)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Zr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===I2||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>la(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:!f8(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=z(this,Rn))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=z(this,Rn))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),z(this,bs).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(z(this,Rn)&&(z(this,wl)||ut(this,Kr,_8).call(this)?z(this,Rn).cancel({revert:!0}):z(this,Rn).cancelRetry()),this.scheduleGc()),z(this,bs).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,Kr,Gi).call(this,{type:"invalidate"})}async fetch(e,n){var d,h,p,m,y,w,_,x,b,P,T;if(this.state.fetchStatus!=="idle"&&((d=z(this,Rn))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,Rn))return z(this,Rn).continueRetry(),z(this,Rn).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(I=>I.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(ke(this,wl,!0),r.signal)})},i=()=>{const k=p8(this.options,n),R=(()=>{const L={client:z(this,_l),queryKey:this.queryKey,meta:this.meta};return s(L),L})();return ke(this,wl,!1),this.options.persister?this.options.persister(k,R,this):k(R)},u=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:z(this,_l),state:this.state,fetchFn:i};return s(k),k})(),c=z(this,Zu)==="infinite"?bL(this.options.pages):this.options.behavior;c==null||c.onFetch(u,this),ke(this,Yu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=u.fetchOptions)==null?void 0:h.meta))&&ut(this,Kr,Gi).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),ke(this,Rn,v8({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:k=>{k instanceof fy&&k.revert&&this.setState({...z(this,Yu),fetchStatus:"idle"}),r.abort()},onFail:(k,I)=>{ut(this,Kr,Gi).call(this,{type:"failed",failureCount:k,error:I})},onPause:()=>{ut(this,Kr,Gi).call(this,{type:"pause"})},onContinue:()=>{ut(this,Kr,Gi).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const k=await z(this,Rn).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(y=(m=z(this,bs).config).onSuccess)==null||y.call(m,k,this),(_=(w=z(this,bs).config).onSettled)==null||_.call(w,k,this.state.error,this),k}catch(k){if(k instanceof fy){if(k.silent)return z(this,Rn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw ut(this,Kr,Gi).call(this,{type:"error",error:k}),(b=(x=z(this,bs).config).onError)==null||b.call(x,k,this),(T=(P=z(this,bs).config).onSettled)==null||T.call(P,this.state.data,k,this),k}finally{this.scheduleGc()}}},Zu=new WeakMap,yl=new WeakMap,Yu=new WeakMap,bs=new WeakMap,_l=new WeakMap,Rn=new WeakMap,Ef=new WeakMap,wl=new WeakMap,Kr=new WeakSet,_8=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Gi=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,...w8(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...wE(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ke(this,Yu,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),Wn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),z(this,bs).notify({query:this,type:"updated",action:e})})},o8);function w8(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:g8(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function wE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function xE(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 Tr,ct,Cf,cr,xl,Xu,to,Jo,kf,Qu,Ju,bl,Sl,ea,ec,xt,xd,hy,py,my,gy,vy,yy,_y,x8,a8,CL=(a8=class extends Af{constructor(e,n){super();He(this,xt);He(this,Tr);He(this,ct);He(this,Cf);He(this,cr);He(this,xl);He(this,Xu);He(this,to);He(this,Jo);He(this,kf);He(this,Qu);He(this,Ju);He(this,bl);He(this,Sl);He(this,ea);He(this,ec,new Set);this.options=n,ke(this,Tr,e),ke(this,Jo,null),ke(this,to,dy()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,ct).addObserver(this),bE(z(this,ct),this.options)?ut(this,xt,xd).call(this):this.updateResult(),ut(this,xt,gy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wy(z(this,ct),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wy(z(this,ct),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,xt,vy).call(this),ut(this,xt,yy).call(this),z(this,ct).removeObserver(this)}setOptions(e){const n=this.options,r=z(this,ct);if(this.options=z(this,Tr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Zr(this.options.enabled,z(this,ct))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,xt,_y).call(this),z(this,ct).setOptions(this.options),n._defaulted&&!ly(this.options,n)&&z(this,Tr).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,ct),observer:this});const s=this.hasListeners();s&&SE(z(this,ct),r,this.options,n)&&ut(this,xt,xd).call(this),this.updateResult(),s&&(z(this,ct)!==r||Zr(this.options.enabled,z(this,ct))!==Zr(n.enabled,z(this,ct))||la(this.options.staleTime,z(this,ct))!==la(n.staleTime,z(this,ct)))&&ut(this,xt,hy).call(this);const i=ut(this,xt,py).call(this);s&&(z(this,ct)!==r||Zr(this.options.enabled,z(this,ct))!==Zr(n.enabled,z(this,ct))||i!==z(this,ea))&&ut(this,xt,my).call(this,i)}getOptimisticResult(e){const n=z(this,Tr).getQueryCache().build(z(this,Tr),e),r=this.createResult(n,e);return PL(this,r)&&(ke(this,cr,r),ke(this,Xu,this.options),ke(this,xl,z(this,ct).state)),r}getCurrentResult(){return z(this,cr)}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&&z(this,to).status==="pending"&&z(this,to).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){z(this,ec).add(e)}getCurrentQuery(){return z(this,ct)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=z(this,Tr).defaultQueryOptions(e),r=z(this,Tr).getQueryCache().build(z(this,Tr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return ut(this,xt,xd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,cr)))}createResult(e,n){var O;const r=z(this,ct),s=this.options,i=z(this,cr),a=z(this,xl),u=z(this,Xu),d=e!==r?e.state:z(this,Cf),{state:h}=e;let p={...h},m=!1,y;if(n._optimisticResults){const D=this.hasListeners(),N=!D&&bE(e,n),F=D&&SE(e,r,n,s);(N||F)&&(p={...p,...w8(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:x}=p;y=p.data;let b=!1;if(n.placeholderData!==void 0&&y===void 0&&x==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(D=i.data,b=!0):D=typeof n.placeholderData=="function"?n.placeholderData((O=z(this,Ju))==null?void 0:O.state.data,z(this,Ju)):n.placeholderData,D!==void 0&&(x="success",y=cy(i==null?void 0:i.data,D,n),m=!0)}if(n.select&&y!==void 0&&!b)if(i&&y===(a==null?void 0:a.data)&&n.select===z(this,kf))y=z(this,Qu);else try{ke(this,kf,n.select),y=n.select(y),y=cy(i==null?void 0:i.data,y,n),ke(this,Qu,y),ke(this,Jo,null)}catch(D){ke(this,Jo,D)}z(this,Jo)&&(w=z(this,Jo),y=z(this,Qu),_=Date.now(),x="error");const P=p.fetchStatus==="fetching",T=x==="pending",k=x==="error",I=T&&P,R=y!==void 0,A={status:x,fetchStatus:p.fetchStatus,isPending:T,isSuccess:x==="success",isError:k,isInitialLoading:I,isLoading:I,data:y,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:P,isRefetching:P&&!T,isLoadingError:k&&!R,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&R,isStale:A2(e,n),refetch:this.refetch,promise:z(this,to),isEnabled:Zr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const D=A.data!==void 0,N=A.status==="error"&&!D,F=W=>{N?W.reject(A.error):D&&W.resolve(A.data)},K=()=>{const W=ke(this,to,A.promise=dy());F(W)},Z=z(this,to);switch(Z.status){case"pending":e.queryHash===r.queryHash&&F(Z);break;case"fulfilled":(N||A.data!==Z.value)&&K();break;case"rejected":(!N||A.error!==Z.reason)&&K();break}}return A}updateResult(){const e=z(this,cr),n=this.createResult(z(this,ct),this.options);if(ke(this,xl,z(this,ct).state),ke(this,Xu,this.options),z(this,xl).data!==void 0&&ke(this,Ju,z(this,ct)),ly(n,e))return;ke(this,cr,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!z(this,ec).size)return!0;const a=new Set(i??z(this,ec));return this.options.throwOnError&&a.add("error"),Object.keys(z(this,cr)).some(u=>{const c=u;return z(this,cr)[c]!==e[c]&&a.has(c)})};ut(this,xt,x8).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,xt,gy).call(this)}},Tr=new WeakMap,ct=new WeakMap,Cf=new WeakMap,cr=new WeakMap,xl=new WeakMap,Xu=new WeakMap,to=new WeakMap,Jo=new WeakMap,kf=new WeakMap,Qu=new WeakMap,Ju=new WeakMap,bl=new WeakMap,Sl=new WeakMap,ea=new WeakMap,ec=new WeakMap,xt=new WeakSet,xd=function(e){ut(this,xt,_y).call(this);let n=z(this,ct).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Rr)),n},hy=function(){ut(this,xt,vy).call(this);const e=la(this.options.staleTime,z(this,ct));if(Wd.isServer()||z(this,cr).isStale||!ay(e))return;const r=f8(z(this,cr).dataUpdatedAt,e)+1;ke(this,bl,ul.setTimeout(()=>{z(this,cr).isStale||this.updateResult()},r))},py=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,ct)):this.options.refetchInterval)??!1},my=function(e){ut(this,xt,yy).call(this),ke(this,ea,e),!(Wd.isServer()||Zr(this.options.enabled,z(this,ct))===!1||!ay(z(this,ea))||z(this,ea)===0)&&ke(this,Sl,ul.setInterval(()=>{(this.options.refetchIntervalInBackground||P2.isFocused())&&ut(this,xt,xd).call(this)},z(this,ea)))},gy=function(){ut(this,xt,hy).call(this),ut(this,xt,my).call(this,ut(this,xt,py).call(this))},vy=function(){z(this,bl)!==void 0&&(ul.clearTimeout(z(this,bl)),ke(this,bl,void 0))},yy=function(){z(this,Sl)!==void 0&&(ul.clearInterval(z(this,Sl)),ke(this,Sl,void 0))},_y=function(){const e=z(this,Tr).getQueryCache().build(z(this,Tr),this.options);if(e===z(this,ct))return;const n=z(this,ct);ke(this,ct,e),ke(this,Cf,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},x8=function(e){Wn.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(z(this,cr))}),z(this,Tr).getQueryCache().notify({query:z(this,ct),type:"observerResultsUpdated"})})},a8);function kL(t,e){return Zr(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Zr(e.retryOnMount,t)===!1)}function bE(t,e){return kL(t,e)||t.state.data!==void 0&&wy(t,e,e.refetchOnMount)}function wy(t,e,n){if(Zr(e.enabled,t)!==!1&&la(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&A2(t,e)}return!1}function SE(t,e,n,r){return(t!==e||Zr(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&A2(t,n)}function A2(t,e){return Zr(e.enabled,t)!==!1&&t.isStaleByTime(la(e.staleTime,t))}function PL(t,e){return!ly(t.getCurrentResult(),e)}var Pf,fi,tr,El,hi,qo,l8,TL=(l8=class extends y8{constructor(e){super();He(this,hi);He(this,Pf);He(this,fi);He(this,tr);He(this,El);ke(this,Pf,e.client),this.mutationId=e.mutationId,ke(this,tr,e.mutationCache),ke(this,fi,[]),this.state=e.state||IL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){z(this,fi).includes(e)||(z(this,fi).push(e),this.clearGcTimeout(),z(this,tr).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ke(this,fi,z(this,fi).filter(n=>n!==e)),this.scheduleGc(),z(this,tr).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){z(this,fi).length||(this.state.status==="pending"?this.scheduleGc():z(this,tr).remove(this))}continue(){var e;return((e=z(this,El))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,c,d,h,p,m,y,w,_,x,b,P,T,k,I,R,L;const n=()=>{ut(this,hi,qo).call(this,{type:"continue"})},r={client:z(this,Pf),meta:this.options.meta,mutationKey:this.options.mutationKey};ke(this,El,v8({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,O)=>{ut(this,hi,qo).call(this,{type:"failed",failureCount:A,error:O})},onPause:()=>{ut(this,hi,qo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,tr).canRun(this)}));const s=this.state.status==="pending",i=!z(this,El).canStart();try{if(s)n();else{ut(this,hi,qo).call(this,{type:"pending",variables:e,isPaused:i}),z(this,tr).config.onMutate&&await z(this,tr).config.onMutate(e,this,r);const O=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,r));O!==this.state.context&&ut(this,hi,qo).call(this,{type:"pending",context:O,variables:e,isPaused:i})}const A=await z(this,El).start();return await((d=(c=z(this,tr).config).onSuccess)==null?void 0:d.call(c,A,e,this.state.context,this,r)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,A,e,this.state.context,r)),await((y=(m=z(this,tr).config).onSettled)==null?void 0:y.call(m,A,null,this.state.variables,this.state.context,this,r)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,A,null,e,this.state.context,r)),ut(this,hi,qo).call(this,{type:"success",data:A}),A}catch(A){try{await((b=(x=z(this,tr).config).onError)==null?void 0:b.call(x,A,e,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((T=(P=this.options).onError)==null?void 0:T.call(P,A,e,this.state.context,r))}catch(O){Promise.reject(O)}try{await((I=(k=z(this,tr).config).onSettled)==null?void 0:I.call(k,void 0,A,this.state.variables,this.state.context,this,r))}catch(O){Promise.reject(O)}try{await((L=(R=this.options).onSettled)==null?void 0:L.call(R,void 0,A,e,this.state.context,r))}catch(O){Promise.reject(O)}throw ut(this,hi,qo).call(this,{type:"error",error:A}),A}finally{z(this,tr).runNext(this)}}},Pf=new WeakMap,fi=new WeakMap,tr=new WeakMap,El=new WeakMap,hi=new WeakSet,qo=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),Wn.batch(()=>{z(this,fi).forEach(r=>{r.onMutationUpdate(e)}),z(this,tr).notify({mutation:this,type:"updated",action:e})})},l8);function IL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var no,Gs,Tf,u8,AL=(u8=class extends Af{constructor(e={}){super();He(this,no);He(this,Gs);He(this,Tf);this.config=e,ke(this,no,new Set),ke(this,Gs,new Map),ke(this,Tf,0)}build(e,n,r){const s=new TL({client:e,mutationCache:this,mutationId:++Xh(this,Tf)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){z(this,no).add(e);const n=Qh(e);if(typeof n=="string"){const r=z(this,Gs).get(n);r?r.push(e):z(this,Gs).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(z(this,no).delete(e)){const n=Qh(e);if(typeof n=="string"){const r=z(this,Gs).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&z(this,Gs).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Qh(e);if(typeof n=="string"){const r=z(this,Gs).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=Qh(e);if(typeof n=="string"){const s=(r=z(this,Gs).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(){Wn.batch(()=>{z(this,no).forEach(e=>{this.notify({type:"removed",mutation:e})}),z(this,no).clear(),z(this,Gs).clear()})}getAll(){return Array.from(z(this,no))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>gE(n,r))}findAll(e={}){return this.getAll().filter(n=>gE(e,n))}notify(e){Wn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Wn.batch(()=>Promise.all(e.map(n=>n.continue().catch(Rr))))}},no=new WeakMap,Gs=new WeakMap,Tf=new WeakMap,u8);function Qh(t){var e;return(e=t.options.scope)==null?void 0:e.id}var pi,c8,RL=(c8=class extends Af{constructor(e={}){super();He(this,pi);this.config=e,ke(this,pi,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??T2(s,n);let a=this.get(i);return a||(a=new EL({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){z(this,pi).has(e.queryHash)||(z(this,pi).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=z(this,pi).get(e.queryHash);n&&(e.destroy(),n===e&&z(this,pi).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return z(this,pi).get(e)}getAll(){return[...z(this,pi).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>mE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>mE(e,r)):n}notify(e){Wn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pi=new WeakMap,c8),nn,ta,na,tc,nc,ra,rc,sc,d8,ML=(d8=class{constructor(t={}){He(this,nn);He(this,ta);He(this,na);He(this,tc);He(this,nc);He(this,ra);He(this,rc);He(this,sc);ke(this,nn,t.queryCache||new RL),ke(this,ta,t.mutationCache||new AL),ke(this,na,t.defaultOptions||{}),ke(this,tc,new Map),ke(this,nc,new Map),ke(this,ra,0)}mount(){Xh(this,ra)._++,z(this,ra)===1&&(ke(this,rc,P2.subscribe(async t=>{t&&(await this.resumePausedMutations(),z(this,nn).onFocus())})),ke(this,sc,um.subscribe(async t=>{t&&(await this.resumePausedMutations(),z(this,nn).onOnline())})))}unmount(){var t,e;Xh(this,ra)._--,z(this,ra)===0&&((t=z(this,rc))==null||t.call(this),ke(this,rc,void 0),(e=z(this,sc))==null||e.call(this),ke(this,sc,void 0))}isFetching(t){return z(this,nn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return z(this,ta).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=z(this,nn).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=z(this,nn).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(la(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return z(this,nn).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=z(this,nn).get(r.queryHash),i=s==null?void 0:s.state.data,a=fL(e,i);if(a!==void 0)return z(this,nn).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Wn.batch(()=>z(this,nn).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=z(this,nn).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=z(this,nn);Wn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=z(this,nn);return Wn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Wn.batch(()=>z(this,nn).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Rr).catch(Rr)}invalidateQueries(t,e={}){return Wn.batch(()=>(z(this,nn).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=Wn.batch(()=>z(this,nn).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Rr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Rr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=z(this,nn).build(this,e);return n.isStaleByTime(la(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Rr).catch(Rr)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Rr).catch(Rr)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return um.isOnline()?z(this,ta).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,nn)}getMutationCache(){return z(this,ta)}getDefaultOptions(){return z(this,na)}setDefaultOptions(t){ke(this,na,t)}setQueryDefaults(t,e){z(this,tc).set(Ud(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...z(this,tc).values()],n={};return e.forEach(r=>{ic(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){z(this,nc).set(Ud(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...z(this,nc).values()],n={};return e.forEach(r=>{ic(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...z(this,na).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=T2(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===I2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...z(this,na).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){z(this,nn).clear(),z(this,ta).clear()}},nn=new WeakMap,ta=new WeakMap,na=new WeakMap,tc=new WeakMap,nc=new WeakMap,ra=new WeakMap,rc=new WeakMap,sc=new WeakMap,d8),b8=v.createContext(void 0),S8=t=>{const e=v.useContext(b8);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},OL=({client:t,children:e})=>(v.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),E.jsx(b8.Provider,{value:t,children:e})),E8=v.createContext(!1),LL=()=>v.useContext(E8);E8.Provider;function DL(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var NL=v.createContext(DL()),FL=()=>v.useContext(NL),jL=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?m8(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},VL=t=>{v.useEffect(()=>{t.clearReset()},[t])},$L=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||m8(n,[t.error,r])),HL=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))}},zL=(t,e)=>t.isLoading&&t.isFetching&&!e,BL=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,EE=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function UL(t,e,n){var y,w,_,x;const r=LL(),s=FL(),i=S8(),a=i.defaultQueryOptions(t);(w=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||w.call(y,a);const u=i.getQueryCache().get(a.queryHash),c=t.subscribed!==!1;a._optimisticResults=r?"isRestoring":c?"optimistic":void 0,HL(a),jL(a,s,u),VL(s);const d=!i.getQueryCache().get(a.queryHash),[h]=v.useState(()=>new e(i,a)),p=h.getOptimisticResult(a),m=!r&&c;if(v.useSyncExternalStore(v.useCallback(b=>{const P=m?h.subscribe(Wn.batchCalls(b)):Rr;return h.updateResult(),P},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),v.useEffect(()=>{h.setOptions(a)},[a,h]),BL(a,p))throw EE(a,h,s);if($L({result:p,errorResetBoundary:s,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((x=(_=i.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||x.call(_,a,p),a.experimental_prefetchInRender&&!Wd.isServer()&&zL(p,r)){const b=d?EE(a,h,s):u==null?void 0:u.promise;b==null||b.catch(Rr).finally(()=>{h.updateResult()})}return a.notifyOnChangeProps?p:h.trackResult(p)}function xy(t,e){return UL(t,CL)}var ne=typeof window<"u"?window:void 0,rr=typeof globalThis<"u"?globalThis:ne,hr=rr==null?void 0:rr.navigator,_e=rr==null?void 0:rr.document,jt=rr==null?void 0:rr.location,R2=rr==null?void 0:rr.fetch,by=rr!=null&&rr.XMLHttpRequest&&"withCredentials"in new rr.XMLHttpRequest?rr.XMLHttpRequest:void 0,CE=rr==null?void 0:rr.AbortController,WL=rr==null?void 0:rr.CompressionStream,Ir=hr==null?void 0:hr.userAgent;function C8(){return!(!ne||ne.navigator.onLine===!1)}var ad=typeof globalThis<"u"?globalThis:ne;ad&&typeof self>"u"&&(ad.self=ad),ad&&typeof File>"u"&&(ad.File=function(){});var je=ne??{},kt={DEBUG:!1,LIB_VERSION:"0.5.0",LIB_NAME:"browser-common"};function kE(t,e,n,r,s,i,a){try{var u=t[i](a),c=u.value}catch(d){return void n(d)}u.done?e(c):Promise.resolve(c).then(r,s)}function Pt(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var i=t.apply(e,n);function a(c){kE(i,r,s,a,u,"next",c)}function u(c){kE(i,r,s,a,u,"throw",c)}a(void 0)}))}}function le(){return le=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},le.apply(null,arguments)}function k8(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 PE=t=>{if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}};function TE(t){return typeof t=="string"||t}function IE(t){return typeof t=="string"?t:void 0}var ld,GL=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Zi=(function(t){return t.AnonymousId="anonymous_id",t.DistinctId="distinct_id",t.Props="props",t.EnablePersonProcessing="enable_person_processing",t.PersonMode="person_mode",t.FeatureFlagDetails="feature_flag_details",t.FeatureFlags="feature_flags",t.FeatureFlagPayloads="feature_flag_payloads",t.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",t.BootstrapFeatureFlags="bootstrap_feature_flags",t.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",t.OverrideFeatureFlags="override_feature_flags",t.Queue="queue",t.AiQueue="ai_queue",t.AiCaptureQueue="ai_capture_queue",t.LogsQueue="logs_queue",t.OptedOut="opted_out",t.SessionId="session_id",t.SessionStartTimestamp="session_start_timestamp",t.SessionLastTimestamp="session_timestamp",t.PersonProperties="person_properties",t.GroupProperties="group_properties",t.InstalledAppBuild="installed_app_build",t.InstalledAppVersion="installed_app_version",t.SessionReplay="session_replay",t.PushRegistered="push_registered",t.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",t.SurveyLastSeenDate="survey_last_seen_date",t.SurveysSeen="surveys_seen",t.Surveys="surveys",t.RemoteConfig="remote_config",t.FlagsEndpointWasHit="flags_endpoint_was_hit",t.DeviceId="device_id",t})({}),AE=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),KL=["$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"],qL=["token"],P8="NativeGzipValidationError",Sy=t=>t.length>=2&&t[0]===31&&t[1]===139,RE=(t,e)=>t===AE.GZipJS||e===AE.GZipJS||e==="gzip",ME=t=>!(!t||typeof t!="object")&&("name"in t?String(t.name):"")==="NotReadableError",Jh=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=P8,e},ZL=(function(){var t=Pt((function*(e,n){18>e.size&&Jh("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());Sy(r)&&r[2]===8||Jh("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var u=(()=>{if(ld)return ld;ld=[];for(var h=0;256>h;h++){for(var p=h,m=0;8>m;m++)p=1&p?3988292384^p>>>1:p>>>1;ld[h]=p>>>0}return ld})(),c=4294967295,d=0;a.length>d;d++)c=u[255&(c^a[d])]^c>>>8;return(4294967295^c)>>>0})(n)&&Jh("invalid-crc");var i=n.length>>>0;s.getUint32(4,!0)!==i&&Jh("invalid-size")}));return function(e,n){return t.apply(this,arguments)}})();function Ey(){return Ey=Pt((function*(t,e,n){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(t),s=new globalThis.CompressionStream("gzip"),i=s.writable.getWriter(),a=i.write(r).then((()=>i.close())).catch((function(){var d=Pt((function*(h){try{yield i.abort(h)}catch{}throw h}));return function(h){return d.apply(this,arguments)}})()),u=new Response(s.readable).blob(),c=(yield Promise.all([u,a]))[0];return yield ZL(c,r),c}catch(d){if(n!=null&&n.rethrow)throw d;return e&&console.error("Failed to gzip compress data",d),null}})),Ey.apply(this,arguments)}var YL=["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"],OE=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return YL.concat(e).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function Ze(t,e){return t.indexOf(e)!==-1}var f0=function(t){return t.trim()},Cy=function(t){return t.replace(/^\$/,"")};function T8(t){var e,n=[];return(e=JSON.stringify(t,(function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(s))return"[Circular]";n.push(s)}return s}})))!==null&&e!==void 0?e:"null"}var I8=Object.prototype,A8=I8.hasOwnProperty,h0=I8.toString,Ke=Array.isArray||function(t){return h0.call(t)==="[object Array]"},dr=t=>typeof t=="function",It=t=>t===Object(t)&&!Ke(t),Ks=t=>{if(It(t)){for(var e in t)if(A8.call(t,e))return!1;return!0}return!1},de=t=>t===void 0,ft=t=>h0.call(t)=="[object String]",cm=t=>ft(t)&&t.trim().length===0,Ln=t=>t===null,Qe=t=>de(t)||Ln(t),on=t=>h0.call(t)=="[object Number]"&&t==t,Ki=t=>on(t)&&t>0,Qr=t=>h0.call(t)==="[object Boolean]",XL=t=>t instanceof FormData,QL=t=>Ze(KL,t),JL=t=>Ze(qL,t);function R8(t){return t===null||typeof t!="object"}function dm(t,e){return{}.toString.call(t)==="[object "+e+"]"}function M8(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return O8(t,Error)}}function M2(t){return typeof Event<"u"&&O8(t,Event)}function O8(t,e){try{return t instanceof e}catch{return!1}}var eD=[!0,"true",1,"1","yes"],Pv=t=>Ze(eD,t),tD=[!1,"false",0,"0","no"];function _i(t,e,n,r,s){return e>n&&(r.warn("min cannot be greater than max."),e=n),on(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),_i(s||n,e,n,r))}class nD{constructor(e){this.k={},this.S=e.S,this.C=_i(e.bucketSize,0,100,e.I),this.R=_i(e.refillRate,0,this.C,e.I),this.A=_i(e.refillInterval,0,864e5,e.I)}O(e,n){var r=Math.floor((n-e.lastAccess)/this.A);r>0&&(e.tokens=Math.min(e.tokens+r*this.R,this.C),e.lastAccess=e.lastAccess+r*this.A)}consumeRateLimit(e){var n,r=Date.now(),s=String(e),i=this.k[s];return i?this.O(i,r):this.k[s]=i={tokens:this.C,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.S)==null||n.call(this,e)),i.tokens===0)}stop(){this.k={}}}var rs="Mobile",fm="iOS",lo="Android",oc="Tablet",L8=lo+" "+oc,D8="iPad",N8="Apple",F8=N8+" Watch",Id="Safari",ac="BlackBerry",j8="Samsung",V8=j8+"Browser",$8=j8+" Internet",Cl="Chrome",rD=Cl+" OS",H8=Cl+" "+fm,O2="Internet Explorer",z8=O2+" "+rs,L2="Opera",sD=L2+" Mini",D2="Edge",B8="Microsoft "+D2,Lu="Firefox",U8=Lu+" "+fm,Gd="Nintendo",Kd="PlayStation",Du="Xbox",W8=lo+" "+rs,G8=rs+" "+Id,bd="Windows",ky=bd+" Phone",LE="Nokia",Py="Ouya",K8="Generic",iD=K8+" "+rs.toLowerCase(),q8=K8+" "+oc.toLowerCase(),Ty="Konqueror",Z8="Oculus Browser",hm="Vivaldi",Y8="Yandex",pm="Whale",Iy="DuckDuckGo",X8="Pale Moon",mm="Waterfox",Ad="Brave",Q8="Google Search App",Ut="(\\d+(\\.\\d+)?)",Tv=new RegExp("Version/"+Ut),oD=new RegExp(Du,"i"),aD=new RegExp(Kd+" \\w+","i"),lD=new RegExp(Gd+" \\w+","i"),N2=new RegExp(ac+"|PlayBook|BB10","i"),uD={"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"},J8=function(t,e,n,r){e=e||"";var s=(function(i){return i!=null&&i.brave?Ad:null})(n);return s||(r!=null&&r.detectGoogleSearchApp&&Ze(t,"GSA/")?Q8:Ze(t," OPR/")&&Ze(t,"Mini")?sD:Ze(t," OPR/")?L2:N2.test(t)?ac:Ze(t,"IE"+rs)||Ze(t,"WPDesktop")?z8:Ze(t,"OculusBrowser")?Z8:Ze(t,V8)?$8:Ze(t,D2)||Ze(t,"Edg/")?B8:Ze(t,hm+"/")?hm:Ze(t,"YaBrowser/")?Y8:Ze(t,pm+"/")?pm:Ze(t,Iy+"/")||Ze(t,"Ddg/")?Iy:Ze(t,"FBIOS")?"Facebook "+rs:Ze(t,"UCWEB")||Ze(t,"UCBrowser")?"UC Browser":Ze(t,"CriOS")?H8:Ze(t,"CrMo")||Ze(t,Cl)?Cl:Ze(t,lo)&&Ze(t,Id)?W8:Ze(t,"FxiOS")?U8:Ze(t.toLowerCase(),Ty.toLowerCase())?Ty:Ze(t,Ad+"/")?Ad:((i,a)=>a&&Ze(a,N8)||(function(u){return Ze(u,Id)&&!Ze(u,Cl)&&!Ze(u,lo)})(i))(t,e)?Ze(t,rs)?G8:Id:Ze(t,"PaleMoon/")?X8:Ze(t,mm+"/")?mm:Ze(t,Lu)?Lu:Ze(t,"MSIE")||Ze(t,"Trident/")?O2:Ze(t,"Gecko")?Lu:"")},cD={[z8]:[new RegExp("rv:"+Ut)],[B8]:[new RegExp(D2+"?\\/"+Ut)],[Cl]:[new RegExp("("+Cl+"|CrMo)\\/"+Ut)],[H8]:[new RegExp("CriOS\\/"+Ut)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ut)],[Id]:[Tv],[G8]:[Tv],[L2]:[new RegExp("(Opera|OPR)\\/"+Ut)],[Lu]:[new RegExp(Lu+"\\/"+Ut)],[U8]:[new RegExp("FxiOS\\/"+Ut)],[Ty]:[new RegExp("Konqueror[:/]?"+Ut,"i")],[ac]:[new RegExp(ac+" "+Ut),Tv],[W8]:[new RegExp("android\\s"+Ut,"i")],[$8]:[new RegExp(V8+"\\/"+Ut)],[Z8]:[new RegExp("OculusBrowser\\/"+Ut)],[hm]:[new RegExp(hm+"\\/"+Ut)],[Y8]:[new RegExp("YaBrowser\\/"+Ut)],[pm]:[new RegExp(pm+"\\/"+Ut)],[Ad]:[new RegExp(Ad+"\\/"+Ut)],[Iy]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ut)],[X8]:[new RegExp("PaleMoon\\/"+Ut)],[mm]:[new RegExp(mm+"\\/"+Ut)],[Q8]:[new RegExp("GSA\\/"+Ut)],[O2]:[new RegExp("(rv:|MSIE )"+Ut)],Mozilla:[new RegExp("rv:"+Ut)]},dD=function(t,e,n,r){var s=J8(t,e,n,r),i=cD[s];if(de(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},DE=[[new RegExp(Du+"; "+Du+" (.*?)[);]","i"),t=>[Du,t&&t[1]||""]],[new RegExp(Gd,"i"),[Gd,""]],[new RegExp(Kd,"i"),[Kd,""]],[N2,[ac,""]],[new RegExp(bd,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[ky,""];if(new RegExp(rs).test(e)&&!/IEMobile\b/.test(e))return[bd+" "+rs,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=uD[n[1]]||"";return/arm/i.test(e)&&(r="RT"),[bd,r]}return[bd,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[fm,[t[3],t[4],t[5]||"0"].join(".")]:[fm,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=de(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+lo+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+lo+")","i"),t=>t&&t[2]?[lo,[t[2],t[3],t[4]||"0"].join(".")]:[lo,""]],[/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/,[rD,""]],[/Linux|debian/i,["Linux",""]]],NE=function(t){return lD.test(t)?Gd:aD.test(t)?Kd:oD.test(t)?Du:new RegExp(Py,"i").test(t)?Py:new RegExp("("+ky+"|WPDesktop)","i").test(t)?ky:/iPad/.test(t)?D8:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?F8:N2.test(t)?ac:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(LE,"i").test(t)?LE:/(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(rs).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)?lo:L8:new RegExp("(pda|"+rs+")","i").test(t)?iD:new RegExp(oc,"i").test(t)&&!new RegExp(oc+" pc","i").test(t)?q8:""},fD=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function FE(t,e){return typeof(n=t)=="string"&&fD.test(n)?t:e();var n}function ha(t){return t&&t.split("#")[0]}function F2(t,e){var n=setTimeout(t,e);return n!=null&&n.unref&&(n==null||n.unref()),n}function jE(t,e,n){return eP.apply(this,arguments)}function eP(){return(eP=Pt((function*(t,e,n){var r;try{return yield Promise.race([t,new Promise(((s,i)=>{r=F2((()=>{try{n==null||n(),s()}catch(a){i(a)}}),e)}))])}finally{clearTimeout(r)}}))).apply(this,arguments)}var tP={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}},hD=tP.info;function nP(t){if(Qr(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(Ke(t))return{arrayValue:{values:t.map((e=>nP(e)))}};try{return{stringValue:JSON.stringify(t)}}catch{return{stringValue:String(t)}}}function gm(t){var e=[];for(var n in t){var r=t[n];Ln(r)||de(r)||e.push({key:n,value:nP(r)})}return e}function pD(t,e){var n=tP[t.level||"info"]||hD,r=n.text,s=n.number,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),Qe(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),Qe(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=le({},a,t.attributes||{}),c={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:s,severityText:r,body:{stringValue:t.body},attributes:gm(u)};return t.trace_id&&(c.traceId=t.trace_id),t.span_id&&(c.spanId=t.span_id),de(t.trace_flags)||(c.flags=t.trace_flags),c}function rP(t,e,n){return le({},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 sP(t,e,n,r){return{resourceLogs:[{resource:{attributes:gm(e)},scopeLogs:[{scope:{name:n,version:r},logRecords:t}]}]}}let mD=class{constructor(t,e,n,r,s,i,a){var u;i===void 0&&(i=()=>Promise.resolve()),this._instance=t,this.Oi=e,this.I=n,this.Ji=r,this.Ki=s,this.Xi=i,this.tn=a,this.en=null,this.rn=0,this.nn=0,this.sn=0,this.an=0,this.ln=!1,this.un=e.maxBufferSize,this.hn=Math.max((u=e.maxQueueSize)!==null&&u!==void 0?u:e.maxBufferSize,e.maxBufferSize),this.dn=e.flushIntervalMs,this.vn=e.maxBatchRecordsPerPost,this.cn=e.rateCapWindowMs,this.fn=e.maxLogsPerInterval}reset(){this.pn(),this.en=null,this.sn=0,this.an=0,this.ln=!1,this.rn=0,this.nn=0,this.vn=this.Oi.maxBatchRecordsPerPost}onReconnect(){this.nn=0,this.gn()}captureLog(t){if(!this._instance.isDisabled&&!this._instance.optedOut&&t!=null&&t.body){var e=this.mn(t);if(e!==null)if(e.body){if(this.yn()){var n={record:pD(e,this.Ji())};this.Ki((()=>this.bn(n)))}}else this.I.info("Log was rejected in beforeSend function")}}mn(t){var e=this.Oi.beforeSend;if(!e)return t;var n=Ke(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.I.info("Log was rejected in beforeSend function"),null;r=i}catch(a){return this.I.error("Error in beforeSend function for log:",a),null}return r}yn(){if(this.fn===void 0)return!0;var t=Date.now(),e=t-this.sn;return this.cn>e&&e>=0||(this.sn=t,this.an=0,this.ln=!1),this.fn>this.an?(this.an++,!0):(this.ln||(this.I.warn("captureLog dropping logs: exceeded "+this.fn+" logs per "+this.cn+"ms"),this.ln=!0),!1)}flush(){var t=this;return Pt((function*(){if(!t._instance.isDisabled)return t.en||(t.en=t._n().finally((()=>{t.en=null}))),t.en}))()}_n(){var t=this;return Pt((function*(){var e;t.pn();var n=(e=t._instance.getPersistedProperty(Zi.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.rn=0;var u=Math.min(n.length,t.vn),c=n.slice(0,u),d=sP(c.map((p=>p.record)),t.wn(),(i=t.tn)!==null&&i!==void 0?i:t._instance.getLibraryId(),t._instance.getLibraryVersion()),h=yield t._instance.kn(d);if(h.kind==="too-large"&&c.length>1)t.vn=Math.max(1,Math.floor(c.length/2)),t.I.warn("Received 413 when sending logs batch of size "+c.length+", reducing batch size to "+t.vn);else if(h.kind==="retry-later"||(h.kind==="too-large"?t.I.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.Oi.maxBatchRecordsPerPost>t.vn&&(t.vn=Math.min(t.Oi.maxBatchRecordsPerPost,t.vn+1)),yield t.xn(c.length),n=(a=t._instance.getPersistedProperty(Zi.LogsQueue))!==null&&a!==void 0?a:[],s+=c.length,h.kind==="fatal"))throw h.error}}))()}xn(t){var e=this;return Pt((function*(){var n,r=Math.max(0,t-e.rn),s=(n=e._instance.getPersistedProperty(Zi.LogsQueue))!==null&&n!==void 0?n:[];e._instance.setPersistedProperty(Zi.LogsQueue,s.slice(r)),yield e.Xi()}))()}wn(){return rP(this.Oi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}bn(t){var e;if(!this._instance.optedOut){var n=(e=this._instance.getPersistedProperty(Zi.LogsQueue))!==null&&e!==void 0?e:[];this.hn>n.length||(n.shift(),this.rn++,this.I.info("Logs queue is full, dropping oldest record.")),n.push(t),this._instance.setPersistedProperty(Zi.LogsQueue,n),this.un>n.length?this.Sn():this.gn()}}Sn(t){t===void 0&&(t=this.dn),this.Cn||(this.Cn=F2((()=>{this.Cn=void 0,this.gn()}),t))}Tn(){var t=Math.min(Math.max(0,this.nn-1),6);return this.dn*Math.pow(2,t)}Mn(){var t=this._instance.getPersistedProperty(Zi.LogsQueue);return!!t&&t.length>0}shutdown(t){var e=this;return Pt((function*(){e.pn();var n=e.flush().catch((()=>{}));t!==void 0?yield jE(n,t):yield n}))()}flushWithTimeout(t){var e=this;return Pt((function*(){var n=e.flush();yield jE(n,t,(()=>{n.catch((()=>{}))}))}))()}gn(){this.flush().then((()=>{this.nn=0}),(t=>{this.nn++,this.I.error("PostHog logs flush failed:",t)})).finally((()=>{!this._instance.isDisabled&&this.Mn()&&this.Sn(this.Tn())}))}pn(){this.Cn&&(clearTimeout(this.Cn),this.Cn=void 0)}};var Iv=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function VE(t){return String(t)+"000000"}function $E(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 gD=class{constructor(t,e,n){this._instance=t,this.Oi=e,this.I=n,this.En=new Map,this.en=null,this.In=!1,this.Rn=new Map,this.Pn=new Set,this.An=0}count(t,e,n){e===void 0&&(e=1),this.Fn({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.Fn({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.Fn({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.en,n=(function(){var s=Pt((function*(){e&&(yield e.catch((()=>{}))),yield t.On()}));return function(){return s.apply(this,arguments)}})(),r=n().finally((()=>{this.en===r&&(this.en=null)}));return this.en=r,r}drainWindow(){if(this.En.size===0)return null;var t=this.En;return this.En=new Map,this.In=!1,this.Rn=new Map,this.Pn=new Set,this.Ln(t)}reset(){this.An++,this.pn(),this.En=new Map,this.en=null,this.In=!1,this.Rn=new Map,this.Pn=new Set}Fn(t){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.mn(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.I.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var n,r;try{n=e.attributes?le({},e.attributes):void 0,r=$E(e.type,e.name,e.unit,n)}catch(a){return void this.I.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.En.get(r);if(!s){if(!this.$n())return;s={name:e.name,type:e.type,unit:e.unit,attributes:n,windowStartMs:Date.now()},this.En.set(r,s)}var i=this.Rn.get(e.name);i===void 0?this.Rn.set(e.name,e.type):i===e.type||this.Pn.has(e.name)||(this.Pn.add(e.name),this.I.warn("Metric name '"+e.name+"' is already used as a "+i+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Dn(s,e.value),this.Sn()}else this.I.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}$n(){return this.Oi.maxSeriesPerFlush>this.En.size||(this.In||(this.In=!0,this.I.warn("Metric series cap reached ("+this.Oi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Dn(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(Iv.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,Iv)]+=1}}mn(t){var e=this.Oi.beforeSend;if(!e)return t;var n=Ke(e)?e:[e],r=t;for(var s of n)try{var i=s(r);if(!i)return this.I.info("Metric was rejected in beforeSend function"),null;r=i}catch(a){return this.I.error("Error in beforeSend function for metric:",a),null}return r}Sn(){this.Cn||(this.Cn=F2((()=>{this.Cn=void 0,this.flush().catch((t=>{this.I.error("Metrics flush failed:",t)}))}),this.Oi.flushIntervalMs))}pn(){this.Cn&&(clearTimeout(this.Cn),this.Cn=void 0)}On(){var t=this;return Pt((function*(){if(t.En.size!==0){var e=t.En;t.En=new Map,t.In=!1,t.Rn=new Map,t.Pn=new Set;var n=t.An,r=yield t._instance.Nn(t.Ln(e));if(n===t.An)switch(r.kind){case"ok":return;case"retry-later":return t.qn(e),void t.Sn();case"too-large":return void t.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void t.I.error("Failed to send metrics batch:",r.error)}}}))()}Ln(t){return e=this.jn(t),n=(function(i,a,u){return le({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":u})})(this.Oi,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:gm(n)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,n,r,s}jn(t){var e=VE(Date.now()),n=new Map;for(var r of t.values()){var s,i=$E(r.type,r.name,r.unit,void 0),a=n.get(i);a||(a=le({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=gm((s=r.attributes)!==null&&s!==void 0?s:{}),c=VE(r.windowStartMs);if(r.type==="count"){var d,h={attributes:u,startTimeUnixNano:c,timeUnixNano:e,asDouble:(d=r.total)!==null&&d!==void 0?d:0};a.sum.dataPoints.push(h)}else if(r.type==="gauge"){var p,m={attributes:u,timeUnixNano:e,asDouble:(p=r.last)!==null&&p!==void 0?p:0};a.gauge.dataPoints.push(m)}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:Iv})}return Array.from(n.values())}qn(t){var e,n;for(var r of t){var s=r[0],i=r[1],a=this.En.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,i.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((n=i.total)!==null&&n!==void 0?n:0);break;case"gauge":break;case"histogram":if(i.hist)if(a.hist){a.hist.count+=i.hist.count,a.hist.sum+=i.hist.sum,a.hist.min=Math.min(a.hist.min,i.hist.min),a.hist.max=Math.max(a.hist.max,i.hist.max);for(var u=0;a.hist.bucketCounts.length>u;u++)a.hist.bucketCounts[u]+=i.hist.bucketCounts[u]}else a.hist=i.hist}else this.$n()&&this.En.set(s,i)}}};var ep,HE,Av;function vD(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Av&&n.length===HE||(HE=n.length,Av=n.reduce(((r,s)=>{ep||(ep={});var i=ep[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],d=c==null?void 0:c.filename,h=e[s];if(d&&h){r[d]=h,ep[s]=[d,h];break}}return r}),{})),Av}}class yD{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 Pt((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&Ke(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)),le({},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 Pt((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,le({},n,{handled:!0}))),u}buildParsingContext(e){var n;return{chunkIdMap:vD(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 le({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var lc="?";function Ay(t,e,n,r,s){var i={platform:t,filename:e,function:n==="<anonymous>"?lc:n,in_app:!(e!=null&&e.startsWith("webkit-masked-url://"))&&e!=="<anonymous>"};return de(r)||(i.lineno=r),de(s)||(i.colno=s),i}var iP=(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]:lc,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},_D=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wD=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,xD=/\((\S*)(?::(\d+))(?::(\d+))\)/,bD=(t,e)=>{var n=_D.exec(t);if(n)return Ay(e,n[1],lc,+n[2],+n[3]);var r=wD.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=xD.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var i=iP(r[1]||lc,r[2]);return Ay(e,i[1],i[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},SD=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ED=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,CD=(t,e)=>{var n=SD.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=ED.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]||lc,a=iP(i,s);return Ay(e,s=a[1],i=a[0],n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},zE=/\(error: (.*)\)/;class kD{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=ft(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 dm(e,"DOMException")}isDOMError(e){return dm(e,"DOMError")}}class PD{match(e){return M8(e)}coerce(e,n){var r,s=this.getStack(e),i=s===void 0;return{type:this.getType(e),value:this.getMessage(e,n),stack:s??((r=n.syntheticException)==null?void 0:r.stack),cause:e.cause?n.next(e.cause):void 0,synthetic:i}}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 TD{constructor(){}match(e){return!!dm(e,"ErrorEvent")&&(e.error!=null||this.li(e))}coerce(e,n){var r;if(e.error!=null)return n.apply(e.error);var s=n.apply(e.message);return le({},s,{stack:(r=this.hi(e))!==null&&r!==void 0?r:s.stack,synthetic:!0})}li(e){return ft(e.message)&&e.message.length>0}hi(e){var n,r,s=e,i=(n=s.lineno)!==null&&n!==void 0?n:0,a=(r=s.colno)!==null&&r!==void 0?r:0;if(ft(s.filename)&&s.filename.length!==0&&i!==0)return`Error
18
+ at `+s.filename+":"+i+":"+a}}var ID=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class AD{match(e){return typeof e=="string"}coerce(e,n){var r,s=this.getInfos(e),i=s[0],a=s[1];return{type:i??"Error",value:a??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,s=e.match(ID);return s&&(n=s[1],r=s[2]),[n,r]}}var RD=["fatal","error","warning","log","info","debug"];function oP(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 MD{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,s,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=this.getStack(e))!==null&&r!==void 0?r:(s=n.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(M2(e))return e.constructor.name;var n="name"in e?e.name:void 0;return ft(n)&&!cm(n)?n:"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: "+oP(e)}isSeverityLevel(e){return ft(e)&&!cm(e)&&RD.indexOf(e)>=0}getStack(e){try{return ft(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:ft(e.stack)&&e.stack.length>0?e.stack:void 0}catch{return}}getErrorPropertyFromObject(e){for(var n in e)if({}.hasOwnProperty.call(e,n)){var r=e[n];if(M8(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class OD{match(e){return M2(e)}coerce(e,n){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+oP(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class LD{match(e){return R8(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 DD{match(e){return dm(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!M2(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 R8(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 vm="$message",ym="$timestamp",ND=new Set([vm,ym]),Rv={enabled:!0,max_bytes:32768};function _m(t){var e;return t?{enabled:(e=t.enabled)!==null&&e!==void 0?e:Rv.enabled,max_bytes:jD(t.max_bytes,Rv.max_bytes)}:le({},Rv)}class FD{constructor(e){this.Bn=[],this.Hn=0,this.Oi=_m(e)}setConfig(e){this.Oi=_m(e),this.zn()}add(e){var n=(function(s){var i;try{i=T8(s)}catch{return}try{var a=JSON.parse(i);if(!It(a))return;var u=a,c=u[vm],d=u[ym];return!ft(c)||c.trim().length===0||!ft(d)&&!on(d)?void 0:{step:u,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.Oi.max_bytes||(this.Bn.push({step:n.step,bytes:r}),this.Hn+=r,this.zn())}}getAttachable(){return this.Bn.map((e=>e.step))}clear(){this.Bn=[],this.Hn=0}size(){return this.Bn.length}zn(){for(;this.Hn>this.Oi.max_bytes&&this.Bn.length>0;){var e=this.Bn.shift();e&&(this.Hn-=e.bytes)}}}function jD(t,e){if(!on(t)||t===1/0||t===-1/0)return e;var n=Math.floor(t);return 0>n?e:n}var aP=function(t,e){var n=(e===void 0?{}:e).debugEnabled,r={F(s){if(ne&&(kt.DEBUG||ne.POSTHOG_DEBUG||n)&&!de(ne.console)&&ne.console){for(var i=("__rrweb_original__"in ne.console[s])?ne.console[s].__rrweb_original__:ne.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.F("debug",...i)},info(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.F("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.F("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),a=0;s>a;a++)i[a]=arguments[a];r.F("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)=>aP(t+" "+s,i)};return r},ve=aP("[PostHog.js]"),Lt=ve.createLogger,VD=Lt("[ExternalScriptsLoader]"),wm=t=>{var e=_e==null?void 0:_e.querySelectorAll("script");if(e){for(var n=0;e.length>n;n++)if(e[n].src===t)return e[n]}},rl=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return VD.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=wm(e);if(r){if(r.__posthog_loading_callback_fired)return n();var s=r.__posthog_loading_error;return s?n(s):(r.addEventListener("load",(a=>{r.__posthog_loading_callback_fired=!0,n(void 0,a)})),void r.addEventListener("error",(a=>{r.__posthog_loading_error=a,n(a)})))}var i=()=>{if(!_e)return n("document not found");if(wm(e))return rl(t,e,n);var a=_e.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=e,a.onload=d=>{a.__posthog_loading_callback_fired=!0,n(void 0,d)},a.onerror=d=>{a.__posthog_loading_error=d,n(d)},t.config.prepare_external_dependency_script&&(a=t.config.prepare_external_dependency_script(a)),!a)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")_e.head.appendChild(a);else{var u,c=_e.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(a,c[0]):_e.body.appendChild(a)}};_e!=null&&_e.body?i():_e==null||_e.addEventListener("DOMContentLoaded",i)},Mv={},BE=(t,e)=>{var n="/static/"+e+".js?v="+t.version;if(e==="toolbar"){var r=3e5;n=n+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",n)};je.__PosthogExtensions__=je.__PosthogExtensions__||{},je.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{if(e!=="remote-config"){var r=t.config.strict_script_versioning;if(r){var s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),i=Mv[s];if(r==="fallback"&&i){if(wm(i))return void rl(t,i,n);delete Mv[s]}rl(t,s,r==="fallback"?(u,c)=>{if(u)if(typeof u=="string")n(u);else{var d,h=BE(t,e);Mv[s]=h;var p=wm(s);p==null||(d=p.parentNode)==null||d.removeChild(p),rl(t,h,n)}else n(void 0,c)}:n)}else rl(t,BE(t,e),n)}else{var a=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");rl(t,a,n)}},je.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);rl(t,r,n)};kt.DEBUG=!1,kt.LIB_VERSION="1.418.6",kt.LIB_NAME="web";var lP="$people_distinct_id",ur="distinct_id",qd="$device_id",Ov="$device_model",ku="__alias",Sd="__timers",Ry="$autocapture_disabled_server_side",My="$heatmaps_enabled_server_side",Oy="$exception_capture_enabled_server_side",Ly="$error_tracking_suppression_rules",Dy="$error_tracking_capture_extension_exceptions",Ny="$web_vitals_enabled_server_side",j2="$dead_clicks_enabled_server_side",V2="$product_tours_enabled_server_side",Fy="$web_vitals_allowed_metrics",cl="$session_recording_remote_config",uP="$replay_sample_rate",cP="$replay_override_sampling",dP="$replay_override_linked_flag",fP="$replay_override_url_trigger",hP="$replay_override_event_trigger",Pu="$sesid",$2="$session_is_sampled",Qi="$enabled_feature_flags",dl="$active_feature_flags",Dp="$early_access_features",Zd="$feature_flag_details",fl="$feature_flag_payloads",Nu="$feature_flag_request_id",xm="$minimal_flag_called_events",li="$override_feature_flags",sl="$override_feature_flag_payloads",Us="$stored_person_properties",mi="$stored_group_properties",pP="$groups",jy="$surveys",bm="$surveys_loaded_at",Vy="$surveys_activated",Np="$surveys_activated_session",Fp="$surveys_activated_timestamps",Ed="ph_product_tours",ro="$flag_call_reported",Cd="$flag_call_reported_session_id",Fu="$feature_flag_errors",kl="$feature_flag_evaluated_at",st="$user_state",$y="$client_session_props",Hy="$capture_rate_limit",zy="$initial_campaign_params",By="$initial_referrer_info",Sm="$initial_person_info",Em="$epp",tp="$posthog_cookieless",mP="$cookieless_mode",gP="$sdk_debug_extensions_init_method",vP="$sdk_debug_extensions_init_time_ms",Uy="$sdk_debug_recording_script_not_loaded",H2="PostHog loadExternalDependency extension not found.",il="on_reject",so="always",fn="anonymous",Un="identified",Wy="identified_only",Cm="visibilitychange",km="beforeunload",bu="$pageview",Lv="$pageleave",Dv="$identify",UE="$groupidentify";function np(t,e){Ke(t)&&t.forEach(e)}function yt(t,e){if(!Qe(t))if(Ke(t))t.forEach(e);else if(XL(t))t.forEach(((r,s)=>e(r,s)));else for(var n in t)A8.call(t,n)&&e(t[n],n)}var St=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 jp(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 WE=function(t){try{return t()}catch{return}},$D=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){ve.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ve.critical(s)}}},z2=function(t){var e={};return yt(t,(function(n,r){(ft(n)&&n.length>0||on(n))&&(e[r]=n)})),e},HD=["herokuapp.com","vercel.app","netlify.app"];function zD(t){var e=t==null?void 0:t.hostname;if(!ft(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of HD)if(n===r)return!1;return!0}function Vt(t,e,n,r){var s=r??{},i=s.capture,a=s.passive;t==null||t.addEventListener(e,n,{capture:i!==void 0&&i,passive:a===void 0||a})}function Gy(t){return t.name==="ph_toolbar_internal"}var yP=t=>{if(_e){try{for(var e=t+"=",n=_e.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}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return on(t)&&isFinite(t)&&Math.floor(t)===t});class Pm{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/256,i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new Pm(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 Pm(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 BD{generate(){var e=this.generateOrAbort();if(!de(e))return e;this.Tr=0;var n=this.generateOrAbort();if(de(n))throw new Error("Could not generate UUID after timestamp reset");return n}generateOrAbort(){var e=Date.now();if(e>this.Tr)this.Tr=e,this.Ir();else{if(this.Tr>=e+1e4)return;this.Er++,this.Er>4398046511103&&(this.Tr++,this.Ir())}return Pm.fromFieldsV7(this.Tr,Math.trunc(this.Er/Math.pow(2,30)),this.Er&Math.pow(2,30)-1,this.Rr.nextUint32())}Ir(){this.Er=1024*this.Rr.nextUint32()+(1023&this.Rr.nextUint32())}constructor(){this.Tr=0,this.Er=0,this.Rr=new UD}}var GE,_P=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};ne&&!de(ne.crypto)&&crypto.getRandomValues&&(_P=t=>crypto.getRandomValues(t));class UD{nextUint32(){return this.ft.length>this.Ar||(_P(this.ft),this.Ar=0),this.ft[this.Ar++]}constructor(){this.ft=new Uint32Array(8),this.Ar=1/0}}var Ji=()=>WD().toString(),WD=()=>(GE||(GE=new BD)).generate(),ud="",GD=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,dn={Lr:()=>!!_e,Nr(t){ve.error("cookieStore error: "+t)},Fr:yP,Pr(t){var e;try{e=JSON.parse(dn.Fr(t))||{}}catch{}return e},Or(t,e,n,r,s){if(!_e)return!1;try{var i="",a="",u=(function(h,p){if(p){var m=(function(w,_){if(_===void 0&&(_=_e),ud)return ud;if(!_||["localhost","127.0.0.1"].includes(w))return"";for(var x=w.split("."),b=Math.min(x.length,8),P="dmn_chk_"+Ji();!ud&&b--;){var T=x.slice(b).join("."),k=P+"=1;domain=."+T+";path=/";_.cookie=k+";max-age=3",_.cookie.includes(P)&&(_.cookie=k+";max-age=0",ud=T)}return ud})(h);if(!m){var y=(w=>{var _=w.match(GD);return _?_[0]:""})(h);y!==m&&ve.info("Warning: cookie subdomain discovery mismatch",y,m),m=y}return m?"; domain=."+m:""}return""})(_e.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+u+a;return d.length>3686.4&&ve.warn("cookieStore warning: large cookie, len="+d.length),_e.cookie=d,!0}catch{return!1}},Dr(t,e){if(_e!=null&&_e.cookie)try{dn.Or(t,"",-1,e)}catch{return}}},Nv=null,wt={Lr(){if(!Ln(Nv))return Nv;var t=!0;if(de(ne))t=!1;else try{var e="__mplssupport__";wt.Or(e,"xyz"),wt.Fr(e)!=='"xyz"'&&(t=!1),wt.Dr(e)}catch{t=!1}return t||ve.error("localStorage unsupported; falling back to cookie store"),Nv=t,t},Nr(t){ve.error("localStorage error: "+t)},Fr(t){try{return ne==null?void 0:ne.localStorage.getItem(t)}catch(e){wt.Nr(e)}return null},Pr(t){try{return JSON.parse(wt.Fr(t))||{}}catch{}return null},Or(t,e){try{return ne==null||ne.localStorage.setItem(t,JSON.stringify(e)),!0}catch(n){wt.Nr(n)}return!1},Dr(t){try{ne==null||ne.localStorage.removeItem(t)}catch(e){wt.Nr(e)}}},Fv=[Us,dl,Qi,Zd,fl,Nu,kl,Fu,ro],ol=[qd,ur,Pu,$2,Em,Sm,st],Tm=t=>t+"_cpm",KD=["__proto__","constructor","prototype"],jv=t=>{if(!It(t))return{};var e={};return Object.keys(t).forEach((n=>{KD.indexOf(n)===-1&&(e[n]=t[n])})),e},Vv=function(t,e){e===void 0&&(e=[]);var n={};return[...ol,...e].forEach((r=>{var s=t[r];de(s)||Ln(s)||s===""||(n[r]=s)})),n},wP=t=>{for(var e=5381,n=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,n=Math.imul(n^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(n>>>0).toString(36)},KE=(t,e)=>({p:e,f:wP(JSON.stringify(t))}),qE=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var n=dn.Pr(Tm(t)),r=(n==null?void 0:n.f)===wP(e)&&Ke(n.p);return{properties:r?n.p:[],isValid:r}}catch{return{properties:[],isValid:!1}}},$v=(t,e)=>e+"|"+(dn.Fr(Tm(t))||""),rp={},qD={Lr:()=>!0,Nr(t){ve.error("memoryStorage error: "+t)},Fr:t=>rp[t]||null,Pr:t=>rp[t]||null,Or:(t,e)=>(rp[t]=e,!0),Dr(t){delete rp[t]}},Wa=null,Et={Lr(){if(!Ln(Wa))return Wa;if(Wa=!0,de(ne))Wa=!1;else try{var t="__support__";Et.Or(t,"xyz"),Et.Fr(t)!=='"xyz"'&&(Wa=!1),Et.Dr(t)}catch{Wa=!1}return Wa},Nr(t){ve.error("sessionStorage error: ",t)},Fr(t){try{return ne==null?void 0:ne.sessionStorage.getItem(t)}catch(e){Et.Nr(e)}return null},Pr(t){try{return JSON.parse(Et.Fr(t))||null}catch{}return null},Or(t,e){try{return ne==null||ne.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(n){Et.Nr(n)}return!1},Dr(t){try{ne==null||ne.sessionStorage.removeItem(t)}catch(e){Et.Nr(e)}}};class ZD{constructor(e){this._instance=e}get Oi(){return this._instance.config}get consent(){return this.Un()?0:this.Wn}isOptedOut(){return this.Oi.cookieless_mode===so||this.isRejected()||this.consent===-1&&this.Oi.cookieless_mode===il}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Oi.opt_out_capturing_by_default}optInOut(e){this.Vn.Or(this.Gn,e?1:0,this.Oi.cookie_expiration,this.Oi.cross_subdomain_cookie,this.Oi.secure_cookie)}reset(){this.Vn.Dr(this.Gn,this.Oi.cross_subdomain_cookie)}get Gn(){var e=this._instance.config,n=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+n:"__ph_opt_in_out_"+n)}get Wn(){var e=this.Vn.Fr(this.Gn);return Pv(e)?1:Ze(tD,e)?0:-1}get Vn(){var e=this.Oi.opt_out_capturing_persistence_type,n=e==="localStorage"?wt:dn;if(!this.Zn||this.Zn!==n){this.Zn=n;var r=e==="localStorage"?dn:wt;r.Fr(this.Gn)&&(this.Zn.Fr(this.Gn)||this.optInOut(Pv(r.Fr(this.Gn))),r.Dr(this.Gn,this.Oi.cross_subdomain_cookie))}return this.Zn}Un(){return!!this.Oi.respect_dnt&&[hr==null?void 0:hr.doNotTrack,hr==null?void 0:hr.msDoNotTrack,je.doNotTrack].some((e=>Pv(e)))}}function xP(t,e){var n,r=t==null||(n=t.config)==null?void 0:n.get_current_url;if(!dr(r))return e;try{var s=r(e);return ft(s)&&s?s:e}catch(i){return ve.error("Error in get_current_url, falling back to window.location.href",i),e}}var bP="__POSTHOG_TOOLBAR__",YD=1,XD=3,QD=11;function ZE(t){return t instanceof Element&&(t.id===bP||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function pa(t){return!!t&&t.nodeType===YD}function es(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function SP(t){return!!t&&t.nodeType===XD}function EP(t){return!!t&&t.nodeType===QD&&pa(t.host)}var CP=1e3;function B2(t){return t?f0(t).split(/\s+/):[]}function YE(t,e){var n=(function(r){var s,i=ne==null||(s=ne.location)==null?void 0:s.href;return de(i)?void 0:xP(r,i)})(e);return!!(n&&t&&t.some((r=>n.match(r))))}function Im(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 B2(e)}function kP(t){return Qe(t)?null:f0(t).split(/(\s+)/).filter((e=>Rd(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Yd(t){var e="";return qy(t)&&!AP(t)&&t.childNodes&&t.childNodes.length&&yt(t.childNodes,(function(n){var r;SP(n)&&n.textContent&&(e+=(r=kP(n.textContent))!==null&&r!==void 0?r:"")})),f0(e)}function Hv(t){var e;return de(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}var U2=["a","button","form","input","select","textarea","label"];function Ky(t,e){if(de(e))return!0;var n,r=function(i){if(e.some((a=>(function(u,c){var d=u.matches||u.matchesSelector||u.msMatchesSelector||u.mozMatchesSelector||u.webkitMatchesSelector||u.oMatchesSelector;try{return!!d&&d.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 PP(t){var e=t.parentNode;return!(!e||!pa(e))&&e}var JD=[".ph-no-autocapture","[data-ph-no-autocapture]"],TP=["next","previous","prev",">","<"],eN=[...TP,"+","-","−","–"],XE=(t,e)=>/[a-z0-9]/i.test(e)?t.includes(e):t===e,QE=[".ph-no-rageclick",".ph-no-capture"],tN=["","text","search","email","password","url","tel","number"];function JE(t,e){if(!ne||W2(t))return!1;var n,r,s,i,a;if(Qr(e)?(n=!!e&&QE,r=void 0,s=!1):(n=(i=e==null?void 0:e.css_selector_ignorelist)!==null&&i!==void 0?i:QE,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||!pa(c))&&(!!es(c,"textarea")||(es(c,"input")?Ze(tN,(c.getAttribute("type")||"").toLowerCase()):(function(d){if(d.isContentEditable)return!0;var h=d.getAttribute==null?void 0:d.getAttribute("contenteditable");return h==="true"||h===""})(c)))})(t))return!1;var u=IP(t,!1).targetElementList;return!(function(c,d){if(c===!1||de(c))return!1;var h;if(c===!0)h=TP;else{if(!Ke(c))return!1;if(c.length>10)return ve.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 d.some((p=>{var m=p.safeText,y=p.ariaLabel;return h.some((w=>XE(m,w)||XE(y,w)))}))})(r,u.map((c=>{var d;return{safeText:Yd(c).toLowerCase(),ariaLabel:((d=c.getAttribute("aria-label"))==null?void 0:d.toLowerCase().trim())||""}})))&&!Ky(u,n)}var W2=t=>!t||es(t,"html")||!pa(t),IP=(t,e)=>{if(!ne||W2(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],s=t;s.parentNode&&!es(s,"body");)if(EP(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=PP(s);if(!i)break;if(e||U2.indexOf(i.tagName.toLowerCase())>-1)n=!0;else try{var a=ne.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}catch{}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function qy(t){for(var e=new Set,n=0,r=t;r.parentNode&&!es(r,"body");r=r.parentNode){if(n++>=CP||e.has(r))return!1;e.add(r);var s=Im(r);if(Ze(s,"ph-sensitive")||Ze(s,"ph-no-capture"))return!1}if(Ze(Im(t),"ph-include"))return!0;var i=t.type||"";if(ft(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!ft(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function AP(t){return!!(es(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||es(t,"select")||es(t,"textarea")||t.getAttribute("contenteditable")==="true")}var eC=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),tC=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,nN=[16,15,14,13],rN=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),nC=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rC=/[0-9A-Za-z_]/;function sN(t){for(var e=0,n=!1,r=t.length-1;r>=0;r--){var s=t.charCodeAt(r)-48;n&&(s*=2)>9&&(s-=9),e+=s,n=!n}return e%10==0}function Rd(t,e){if(e===void 0&&(e=!0),Qe(t))return!1;if(ft(t)){t=f0(t);var n=e?eC.test((t||"").replace(/[- ]/g,"")):(function(s){var i;for(tC.lastIndex=0;i=tC.exec(s);){var a=i[2];if(a)for(var u=a.replace(/[- ]/g,""),c=0;u.length>c;c++)for(var d of nN){var h=c+d;if(u.length>=h){var p=u.slice(c,h);if(eC.test(p)&&sN(p))return!0}}}return!1})(t);if(n)return!1;var r=e?rN.test(t):(function(s){var i;for(nC.lastIndex=0;i=nC.exec(s);){var a=i[1],u=i[3];if(!(a&&u&&rC.test(a)&&rC.test(u)))return!0}return!1})(t);if(r)return!1}return!0}function sC(t){var e=Yd(t);return Rd(e=(e+" "+RP(t)).trim())?e:""}function RP(t){var e="";return t&&t.childNodes&&t.childNodes.length&&yt(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=Yd(n);e=(e+" "+s).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+RP(n)).trim())}catch(i){ve.error("[AutoCapture]",i)}})),e}function iC(t){return t.replace(/"|\\"/g,'\\"')}function iN(t){var e=t.attr__class;if(e)return Ke(e)?e:B2(e)}var sp=Lt("[Dead Clicks]"),oN=()=>!0,aN=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(j2)),r=t.instance.config.capture_dead_clicks;return Qr(r)?r:!!It(r)||n};class oC{get lazyLoadedDeadClicksAutocapture(){return this.Qn}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var n=e.config;"captureDeadClicks"in n&&(this.instance.persistence&&this.instance.persistence.register({[j2]:n.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Jn((()=>{this.Kn()})):this.stop()}Jn(e){var n,r;(n=je.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture?e():(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?sp.error("failed to load script",s):e()}))}Kn(){var e;if(_e){if(!this.Qn&&(e=je.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=It(this.instance.config.capture_dead_clicks)?le({},this.instance.config.capture_dead_clicks):{};n.__onCapture=this.onCapture,this.onCapture&&(n.capture_dead_swipes=!1),this.Qn=je.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.Qn.start(_e),sp.info("starting...")}}else sp.error("`document` not found. Cannot start.")}stop(){this.Qn&&(this.Qn.stop(),this.Qn=void 0,sp.info("stopping..."))}}var zv=Lt("[SegmentIntegration]"),MP="posthog-js";function OP(t,e){var n=e===void 0?{}:e,r=n.organization,s=n.projectId,i=n.prefix,a=n.severityAllowList,u=a===void 0?["error"]:a,c=n.sendExceptionsToPostHog,d=c===void 0||c;return h=>{var p,m,y,w,_;if(u!=="*"&&!u.includes(h.level)||!t.__loaded)return h;h.tags||(h.tags={});var x=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());h.tags["PostHog Person URL"]=x,t.sessionRecordingStarted()&&(h.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var b,P=((p=h.exception)==null?void 0:p.values)||[],T=P.map((I=>le({},I,{stacktrace:I.stacktrace?le({},I.stacktrace,{type:"raw",frames:(I.stacktrace.frames||[]).map((R=>le({},R,{platform:"web:javascript"})))}):void 0}))),k={$exception_message:((m=P[0])==null?void 0:m.value)||h.message,$exception_type:(y=P[0])==null?void 0:y.type,$exception_level:h.level,$exception_list:T,$sentry_event_id:h.event_id,$sentry_exception:h.exception,$sentry_exception_message:((w=P[0])==null?void 0:w.value)||h.message,$sentry_exception_type:(_=P[0])==null?void 0:_.type,$sentry_tags:h.tags};return r&&s&&(k.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+h.event_id),d&&((b=t.exceptions)==null||b.sendExceptionEvent(k)),h}}class lN{constructor(e,n,r,s,i,a){this.name=MP,this.setupOnce=function(u){u(OP(e,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}class aC{constructor(e){this.Yn=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(ve.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.Xn=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.ts()}ts(){var e;this.es=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.Yn)}destroy(){var e;(e=this.es)==null||e.call(this),this.es=void 0}doPageView(e,n){var r,s=this.rs(e,n);return this.Xn={pathname:(r=ne==null?void 0:ne.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var n;return this.rs(e,(n=this.Xn)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Xn)==null?void 0:e.pageViewId}}rs(e,n){var r=this.Xn;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 a=i.maxScrollHeight,u=i.lastScrollY,c=i.maxScrollY,d=i.maxContentHeight,h=i.lastContentY,p=i.maxContentY;if(!(de(a)||de(u)||de(c)||de(d)||de(h)||de(p))){a=Math.ceil(a),u=Math.ceil(u),c=Math.ceil(c),d=Math.ceil(d),h=Math.ceil(h),p=Math.ceil(p);var m=a>1?_i(u/a,0,1,ve):1,y=a>1?_i(c/a,0,1,ve):1,w=d>1?_i(h/d,0,1,ve):1,_=d>1?_i(p/d,0,1,ve):1;s=St(s,{$prev_pageview_last_scroll:u,$prev_pageview_last_scroll_percentage:m,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:y,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:w,$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 Bv=["flags","surveys"],uN={[lP]:{exposure:"hidden"},[ku]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Sd]:{exposure:"hidden"},[Ry]:{exposure:"event"},[My]:{exposure:"hidden"},[Oy]:{exposure:"event"},[Ly]:{exposure:"hidden"},[Dy]:{exposure:"event"},[Ny]:{exposure:"event"},[j2]:{exposure:"event"},[V2]:{exposure:"hidden"},[Fy]:{exposure:"event"},[cl]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Pu]:{exposure:"hidden"},[$2]:{exposure:"event"},[uP]:{exposure:"event",shouldSkipFromEventProperties:t=>Ln(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"},[Qi]:{exposure:"hidden",storageGroup:"flags"},[dl]:{exposure:"hidden",storageGroup:"flags"},[Dp]:{exposure:"hidden"},[Zd]:{exposure:"hidden",storageGroup:"flags"},[fl]:{exposure:"hidden",storageGroup:"flags"},[Nu]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xm]:{exposure:"hidden",storageGroup:"flags"},[li]:{exposure:"hidden"},[sl]:{exposure:"hidden"},[Us]:{exposure:"hidden"},[mi]:{exposure:"hidden"},[jy]:{exposure:"hidden",storageGroup:"surveys"},[bm]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Vy]:{exposure:"event"},[Np]:{exposure:"hidden"},[Fp]:{exposure:"hidden"},[Ed]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ro]:{exposure:"hidden"},[Cd]:{exposure:"hidden"},[pP]:{exposure:"event"},[Fu]:{exposure:"hidden"},[kl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[st]:{exposure:"hidden"},[$y]:{exposure:"hidden"},[Hy]:{exposure:"hidden"},[zy]:{exposure:"hidden"},[By]:{exposure:"hidden"},[Sm]:{exposure:"hidden"},[Em]:{exposure:"hidden"},[cP]:{exposure:"event"},[dP]:{exposure:"event"},[fP]:{exposure:"event"},[hP]:{exposure:"event"},[gP]:{exposure:"event"},[vP]:{exposure:"event"},[Uy]:{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"}},cN=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ui=t=>{var e=uN[t];if(e)return e;for(var n of cN){var r=n[1];if(t.indexOf(n[0])===0)return r}},Tu=(t,e)=>{try{return JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e)}catch{return T8(t)}},uc=t=>{var e=_e==null?void 0:_e.createElement("a");return de(e)?null:(e.href=t,e)},cc=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(!Ke(n)||2>n.length)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{ve.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Xd=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("&"),d=[],h=0;c.length>h;h++){var p=c[h].split("=");Ke(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(c[h]))}var m=u;return a!=null&&(m+="?"+d.join("&")),s!=null&&(m+="#"+s),m},Am=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},LP=(t,e)=>t>=e&&C8(),DP=(t,e,n,r)=>{if(t===0){if(C8()){var s=e+1;return s===n&&r(),s}return e}return 0},ip="https?://(.*)",dc=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],dN=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...dc],Qd="<masked>",fN=["li_fat_id"];function NP(t,e,n){if(!_e)return{};var r,s=e?[...dc,...n||[]]:[],i=FP(Xd(_e.URL,s,Qd),t),a=(r={},yt(fN,(function(u){var c=yP(u);r[u]=c||null})),r);return St(a,i)}function FP(t,e){var n=dN.concat(e||[]),r={};return yt(n,(function(s){var i=cc(t,s);r[s]=i||null})),r}function jP(t){var e=(function(i){return i?i.search(ip+"google.([^/?]*)")===0?"google":i.search(ip+"bing.com")===0?"bing":i.search(ip+"yahoo.com")===0?"yahoo":i.search(ip+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Ln(e)){r.$search_engine=e;var s=_e?cc(_e.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function lC(){return navigator.language||navigator.userLanguage}var Rm="$direct";function VP(){return(_e==null?void 0:_e.referrer)||Rm}function $P(t,e,n){n===void 0&&(n=!1);var r=t?[...dc,...e||[]]:[],s=n?ha(jt==null?void 0:jt.href):jt==null?void 0:jt.href,i=s==null?void 0:s.substring(0,1e3);return{r:VP().substring(0,1e3),u:i?Xd(i,r,Qd):void 0}}function HP(t,e){var n;e===void 0&&(e=!1);var r=t.r,s=t.u,i=e?ha(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==Rm?Rm:(n=uc(r))==null?void 0:n.host};if(i){a.$current_url=i;var u=uc(i);a.$host=u==null?void 0:u.host,a.$pathname=u==null?void 0:u.pathname;var c=FP(i);St(a,c)}if(r){var d=jP(r);St(a,d)}return a}function zP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function hN(){try{return new Date().getTimezoneOffset()}catch{return}}var pN={flags:kl,surveys:bm},mN=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],op=t=>t+"_cookie_identity_change_pending",Wo="main",uC=(t,e)=>{yt(t,((n,r)=>{var s=ui(r);s&&s.exposure!=="event"||{}.hasOwnProperty.call(e,r)||delete t[r]}))};class Uv{constructor(e,n,r){if(r===void 0&&(r=!0),this.ns={},this.ss=!1,this.os=!1,this.ls=!1,this.us=!1,this.Oi=e,this.hs=r,this.props={},this.ds=void 0,this.vs=(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.Vn=this.cs(e),this.os=this.fs(e),this.load(),e.debug&&ve.info("Persistence loaded",e.persistence,le({},this.props)),this.update_config(e,e,n),this.save(),ne){var s=()=>this.flush();Vt(ne,"beforeunload",s,{capture:!1}),Vt(ne,"pagehide",s,{capture:!1})}}ps(){var e,n=(e=this.Oi)==null?void 0:e.persistence_save_debounce_ms;return on(n)&&n>0?n:0}gs(e){if(this.Oi.cookieWinsOnConflict&&this.Oi.persistence.toLowerCase()==="localstorage+cookie")if(e)try{var n=Vv(e,this.Oi.cookie_persisted_properties||[]),r=KE(n,this.Oi.cookie_persisted_properties||[]),s=JSON.stringify(n)+"|"+JSON.stringify(r),i=dn.Fr(this.vs)||void 0;i&&$v(this.vs,i)===s&&(this.ys=s,this.bs=i)}catch{}else try{var a=dn.Fr(this.vs)||void 0;this.ys=a?$v(this.vs,a):void 0,this.bs=a}catch{}}syncCookieProperties(){return this._s(this.Oi)}_s(e,n){if(n===void 0&&(n=!1),this.ws&&!n||this.us||!e.cookieWinsOnConflict||e.persistence.toLowerCase()!=="localstorage+cookie")return!1;var r;try{r=dn.Fr(this.vs)||void 0}catch{}if(!r||r===this.bs)return!1;var s,i=$v(this.vs,r);try{s=jv(JSON.parse(r))}catch{return!1}if((dn.Fr(this.vs)||void 0)!==r)return!1;this.ys=i,this.bs=r;var a=qE(this.vs,r),u=[...ol,...a.properties],c={};if(Object.keys(s).forEach((_=>{var x=s[_];(de(x)||Ln(x)||x===""||_===st&&x!==fn&&x!==Un)&&(c[_]=!0,delete s[_])})),Ks(s))return!1;var d=ur in s||s[st]===fn||s[st]===Un,h=this.props[ur],p=this.props[st],m=St({},this.props);[...ol,...e.cookie_persisted_properties||[]].forEach((_=>{if(u.indexOf(_)!==-1&&!(_ in s)&&!c[_]&&(d||_!==ur&&_!==st)){var x=m[_];!a.isValid&&ol.indexOf(_)!==-1&&(x===!1||x===0)||delete m[_]}})),this.props=St(m,s),!d||st in s||st in this.props||this.ks(st,fn);var y=this.props[ur],w=this.props[st];return!d||y===h&&w===p||(this.ls=!0,Et.Or(op(this.vs),!0),this.xs(Us),this.xs(dl),this.xs(Qi),this.xs(Zd),this.xs(fl),this.xs(Nu),this.xs(kl),this.xs(Fu),this.xs(ro),w===fn&&(p===Un||s[st]===fn||!de(h)&&y!==h)&&(uC(this.props,s),this.xs(mi)),w===Un?this.props.$user_id=y:delete this.props.$user_id,this.xs(ku)),!0}consumeCookieIdentityChange(){var e=op(this.vs),n=this.ls||!!Et.Fr(e);return this.ls=!1,n&&Et.Dr(e),n}Ss(e){return e===void 0&&(e=!1),!(this.us||this.ws&&!e||!this.Oi.cookieWinsOnConflict||this.Oi.persistence.toLowerCase()!=="localstorage+cookie"||(this.us=!0,0))}Cs(){this.us&&(de(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0),delete this.ns[Wo],this.Ms(!0))}Es(e){if(e===void 0&&(e=!0),this.us)try{e?this.Cs():de(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0)}finally{this.us=!1}}isDisabled(){return!!this.ws}cs(e){mN.indexOf(e.persistence.toLowerCase())===-1&&(ve.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=[...ol,...a];return le({},wt,{Pr(d){try{var h,p={};try{h=dn.Fr(d)||void 0,p=h?jv(JSON.parse(h)):{}}catch{}var m,y=JSON.parse(wt.Fr(d)||"{}");if(u){var w=qE(d,h),_=[...ol,...w.properties],x={};Object.keys(p).forEach((I=>{var R=p[I];Ln(R)||R===""||I===st&&R!==fn&&R!==Un||(x[I]=R)}));var b=ur in x||x[st]===fn||x[st]===Un;if(Object.keys(x).length>0){var P,T=y[ur],k=(P=y[st])!==null&&P!==void 0?P:fn;c.forEach((I=>{if(_.indexOf(I)!==-1&&!(I in p)&&(b||I!==ur&&I!==st)){var R=y[I];!w.isValid&&ol.indexOf(I)!==-1&&(R===!1||R===0)||delete y[I]}})),!b||st in p||st in y||(y[st]=fn),!b||(ur in x?x[ur]:y[ur])===T&&(st in x?x[st]:y[st])===k||(Fv.forEach((I=>delete y[I])),x[st]===Un&&ur in x?y.$user_id=x[ur]:delete y.$user_id,x[st]!==Un&&(delete y[pP],delete y[mi]),delete y.__alias)}m=St(y,x)}else m=St(p,y);return wt.Or(d,m),m}catch{}return null},Or(d,h,p,m,y,w){var _=wt.Or(d,h,void 0,void 0,w);try{var x=Vv(h,a);if(Object.keys(x).length){if(u){var b=Tm(d),P=KE(x,a);if(dn.Or(b,P,p,m,y,w),dn.Fr(b)!==JSON.stringify(P)){dn.Dr(b,m);var T=Vv(h);return dn.Or(d,T,p,m,y,w),_}}dn.Or(d,x,p,m,y,w)}}catch(k){wt.Nr(k)}return _},Dr(d,h){try{ne==null||ne.localStorage.removeItem(d),dn.Dr(d,h),dn.Dr(Tm(d),h)}catch(p){wt.Nr(p)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),s=!1,i=e.persistence.toLowerCase();return i==="localstorage"&&wt.Lr()?(n=wt,s=!0):i==="localstorage+cookie"&&r.Lr()?(n=r,s=!0):i==="sessionstorage"&&Et.Lr()?n=Et:i==="memory"?n=qD:i==="cookie"?n=dn:r.Lr()?(n=r,s=!0):n=dn,this.ss=s,n}Is(e){return this.vs+"__"+e}fs(e){return this.ss&&!!e.split_storage}properties(){var e={};return yt(this.props,((n,r)=>{var s=ui(r);if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(n))return;e[r]=n}})),e}load(){if(!this.ws){var e=this.Oi.cookieWinsOnConflict&&this.Oi.persistence.toLowerCase()==="localstorage+cookie",n=e?wt.Pr(this.vs):null,r={};if(e)try{yt(r=jv(dn.Pr(this.vs)),((y,w)=>{(de(y)||Ln(y)||y==="")&&delete r[w]}))}catch{}var s=this.Vn.Pr(this.vs);if(s&&(this.props=St({},s)),this.os&&this.Rs(),e&&s){var i,a,u=n==null?void 0:n[ur],c=(i=n==null?void 0:n[st])!==null&&i!==void 0?i:fn,d=s[ur],h=(a=s[st])!==null&&a!==void 0?a:fn;if(d!==u||h!==c){this.ls=!0,Et.Or(op(this.vs),!0);var p=St({},this.props);Fv.forEach((y=>delete p[y])),h===fn&&(c===Un||r[st]===fn||!de(u)&&d!==u)&&(uC(p,r),delete p[mi]),this.props=p;var m=new Set;Fv.forEach((y=>{var w,_=(w=ui(y))==null?void 0:w.storageGroup;_&&m.add(_)})),m.forEach((y=>{var w={};yt(this.props,((_,x)=>{var b;((b=ui(x))==null?void 0:b.storageGroup)===y&&(w[x]=_)})),Ks(w)?(wt.Dr(this.Is(y)),this.ns[y]={}):wt.Or(this.Is(y),w)&&(this.ns[y]={persisted:!0,fingerprint:this.Ps(w,y)})}))}}Et.Fr(op(this.vs))&&(this.ls=!0)}}Rs(){for(var e of Bv){var n=wt.Pr(this.Is(e));if(n&&!Ks(n)){var r=this.As(e);r.persisted=!0,this.Fs(e)||(r.fingerprint=this.Ps(n,e)),this.Os(e,n)||St(this.props,n)}}}Fs(e){return Object.keys(this.props).some((n=>{var r;return((r=ui(n))==null?void 0:r.storageGroup)===e}))}Os(e,n){var r=pN[e];if(!r)return!1;var s=n[r],i=this.props[r];return on(s)&&on(i)&&i>s}refreshKey(e){var n;if(!this.ws){var r=this.os?(n=ui(e))==null?void 0:n.storageGroup:void 0,s=r?wt.Pr(this.Is(r)):this.Vn.Pr(this.vs);if(s&&e in s)this.ks(e,s[e]);else{if(r){var i=this.Vn.Pr(this.vs);if(i&&e in i)return void this.ks(e,i[e])}this.xs(e)}}}save(){if(!this.ws){var e=this.ps();e>0?de(this.Ts)&&(this.Ts=setTimeout((()=>{this.Ts=void 0,this.Ms()}),e)):this.Ms()}}flush(){de(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0,this.Ms())}Ms(e){e===void 0&&(e=!1),this.ws||this.us&&!e||(e||this.syncCookieProperties(),this.os?this.Ls():this.$s(this.Vn,this.vs,this.props,Wo)&&this.gs(this.props))}Ls(){var e=this.Ds(),n=e.main,r=e.groups;for(var s of(this.$s(this.Vn,this.vs,n,Wo)&&this.gs(n),Bv)){var i,a=r[s];(!Ks(a)||(i=this.ns[s])!=null&&i.persisted)&&this.$s(wt,this.Is(s),a,s)}}Ds(){var e={},n={flags:{},surveys:{}};return yt(this.props,((r,s)=>{var i,a=(i=ui(s))==null?void 0:i.storageGroup;a?n[a][s]=r:e[s]=r})),{main:e,groups:n}}Ps(e,n){if(n===Wo)return JSON.stringify(e)+"|"+this.Ns+"|"+this.qs+"|"+this.js;var r={};return yt(e,((s,i)=>{var a;r[i]=(a=ui(i))!=null&&a.volatile?"__volatile__":s})),JSON.stringify(r)}$s(e,n,r,s){var i,a=this.As(s);if(s!==Wo&&!a.dirty&&!de(a.fingerprint))return!1;try{if((i=this.Ps(r,s))===a.fingerprint)return a.dirty=!1,!1}catch{i=void 0}return e.Or(n,r,this.Ns,this.qs,this.js,this.Oi.debug)?(a.dirty=!1,s!==Wo&&(a.persisted=!0),de(i)||(a.fingerprint=i),!0):(this.Oi.debug&&ve.warn('failed to persist storage entry "'+n+'"; will retry on next save'),!1)}remove(e){var n=(e===void 0?{}:e).keepGroupEntries,r=n!==void 0&&n;if(de(this.Ts)||(clearTimeout(this.Ts),this.Ts=void 0),this.Vn.Dr(this.vs,!1),this.Vn.Dr(this.vs,!0),!r&&this.hs)for(var s of Bv)wt.Dr(this.Is(s));r?delete this.ns[Wo]:this.ns={},this.ys=void 0,this.bs=void 0}clear(){this.remove(),this.props={}}register_once(e,n,r){if(It(e)){this.syncCookieProperties(),de(n)&&(n="None"),this.Ns=de(r)?this.Bs:r;var s=!1;if(yt(e,((i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.ks(a,i),s=!0)})),s)return this.save(),!0}return!1}register(e,n){if(It(e)){this.syncCookieProperties(),this.Ns=de(n)?this.Bs:n;var r=!1;if(yt(e,((s,i)=>{e.hasOwnProperty(i)&&(this.props[i]!==s||It(s)||Ke(s))&&(this.ks(i,s),r=!0)})),r)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var n=typeof e=="string"?[e]:e,r=!1;for(var s of n)s in this.props&&(this.xs(s),r=!0);r&&this.save()}update_campaign_params(){var e=_e==null?void 0:_e.URL;if(e!==this.ds){var n=NP(this.Oi.custom_campaign_params,this.Oi.mask_personal_data_properties,this.Oi.custom_personal_data_properties);Ks(z2(n))||this.register(n),this.ds=e}}update_search_keyword(){var e;this.register((e=_e==null?void 0:_e.referrer)?jP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:VP(),$referring_domain:_e!=null&&_e.referrer&&((e=uc(_e.referrer))==null?void 0:e.host)||Rm},void 0)}set_initial_person_info(){this.props[zy]||this.props[By]||this.register_once({[Sm]:$P(this.Oi.mask_personal_data_properties,this.Oi.custom_personal_data_properties,this.Oi.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};yt([By,zy],(s=>{var i=this.props[s];i&&yt(i,(function(a,u){e["$initial_"+Cy(u)]=a}))}));var n=this.props[Sm];if(n){var r=(function(s,i){i===void 0&&(i=!1);var a=HP(s,i),u={};return yt(a,(function(c,d){u["$initial_"+Cy(d)]=c})),u})(n,this.Oi.disable_capture_url_hashes);St(e,r)}return e}safe_merge(e){return yt(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){var s=e.persistence!==n.persistence,i=!((_,x)=>{if(_.length!==x.length)return!1;var b=[..._].sort(),P=[...x].sort();return b.every(((T,k)=>T===P[k]))})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[]),a=s||i,u=e.cookieWinsOnConflict!==n.cookieWinsOnConflict,c=e.disable_persistence||!!r,d=!!this.ws&&!c;c||this._s(n,d),this.Oi=e,!c&&(s||i||u)&&(this.ys=void 0,this.bs=void 0,this._s(le({},e,{cookie_persisted_properties:n.cookie_persisted_properties}),d));var h=a||u?this.cs(e):this.Vn,p=this.fs(e),m=a||p!==this.os,y=!c&&(m||e.cross_subdomain_cookie!==this.qs||e.secure_cookie!==this.js)&&this.Ss(d);try{if(this.Bs=this.Ns=e.cookie_expiration,this.set_disabled(c),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),m){var w=this.props;this.clear(),this.Vn=h,this.os=p,this.props=w,this.save()}else u&&(this.Vn=h,c||(delete this.ns[Wo],this.Ms()))}finally{y&&this.Es()}}set_disabled(e){this.ws=e,this.ws?this.remove():this.save()}set_cross_subdomain(e){e!==this.qs&&(this.qs=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.js&&(this.js=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,n){var r=this.props[Sd]||{};r[e]=n,this.ks(Sd,r),this.save()}remove_event_timer(e){var n=this.props[Sd]||{},r=n[e];return de(r)||(delete n[e],this.ks(Sd,n),this.save()),r}get_property(e){return this.props[e]}set_property(e,n){this.ks(e,n),this.save()}ks(e,n){var r;this.props[e]=n,(r=ui(e))!=null&&r.volatile||this.Hs(e)}xs(e){delete this.props[e],this.Hs(e)}Hs(e){var n,r=(n=ui(e))==null?void 0:n.storageGroup;r&&(this.As(r).dirty=!0)}As(e){return this.ns[e]||(this.ns[e]={})}}function ap(t){var e=!0;return{dispose(){if(e){e=!1;var n=t();n&&dr(n.then)&&n.then(void 0,(()=>{}))}}}}var fr={GZipJS:"gzip-js",Base64:"base64"},cd={Activation:"events",Cancellation:"cancelEvents"},Wv={Popover:"popover",API:"api",Widget:"widget"},io={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Gv={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Zy={Popover:"popover",Inline:"inline"},gN={SHOWN:"product tour shown"},cC={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},dC=Lt("[RateLimiter]");class vN{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=>{dC.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void dC.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 i=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,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 d=1>c.tokens;if(d||e||(c.tokens=Math.max(0,c.tokens-1)),d&&!e){var h=(on(c.dropped)?c.dropped:0)+1;c.dropped=h,!this.lastEventRateLimited&&this.zs(h)&&(c.dropped=0)}return this.lastEventRateLimited=d,(s=this.instance.persistence)==null||s.set_property(Hy,c),{isRateLimited:d,remainingTokens:c.tokens}}Us(e){var n=this.instance.config.property_denylist;return!Ke(n)||!n.includes(e)}Ws(){var e;if(this.Us("$current_url")&&this.Us("$pathname")&&jt!=null&&jt.pathname)return""+((e=jt.origin)!==null&&e!==void 0?e:"")+jt.pathname}zs(e){var n,r,s=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,a=this.Ws(),u=this.Us("$session_id")?(n=(r=this.instance).get_session_id)==null?void 0:n.call(r):void 0,c=[e+" event(s) dropped since the last warning",a?"triggered on "+a:void 0,u?"session "+u:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+c+". Config is set to "+i+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Go=Lt("[RemoteConfig]");class BP{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=je._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Vs(e){var n,r;(n=je.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Gs(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return Go.info("Using preloaded remote config",this.remoteConfig),this.Zs(this.remoteConfig),void this.Qs();if(this._instance.Js())return void Go.warn("Remote config is disabled. Falling back to local config.");this.Vs((e=>{if(!e)return Go.info("No config found after loading remote JS config. Falling back to JSON."),void this.Gs((n=>{this.Zs(n.json,n),this.Qs()}));this.Zs(e),this.Qs()}))}catch(e){Go.error("Error loading remote config",e),this.Zs()}}stop(){this.Ks&&(clearInterval(this.Ks),this.Ks=void 0)}refresh(){!this._instance.Js()&&_e&&_e.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Qs(){var e;if(!this.Ks){var n=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;n!==0&&(this.Ks=setInterval((()=>{this.refresh()}),n))}}Zs(e,n){!e&&n&&(n.statusCode===0?n.error||Go.warn("Failed to fetch remote config from PostHog."):Go.error("Failed to fetch remote config from PostHog."));try{this._instance.Zs(e?{ok:!0,config:e}:{ok:!1})}catch(s){Go.error("Error applying remote config",s)}if((e==null?void 0:e.hasFeatureFlags)!==!1&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var r;(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded()}catch(s){Go.error("Error loading feature flags",s)}}}var Ps=Uint8Array,Or=Uint16Array,fc=Uint32Array,G2=new Ps([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]),K2=new Ps([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]),fC=new Ps([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),UP=function(t,e){for(var n=new Or(31),r=0;31>r;++r)n[r]=e+=1<<t[r-1];var s=new fc(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]},WP=UP(G2,2),Yy=WP[1];WP[0][28]=258,Yy[258]=28;for(var hC=UP(K2,0)[1],GP=new Or(32768),Ht=0;32768>Ht;++Ht){var hu=(43690&Ht)>>>1|(21845&Ht)<<1;GP[Ht]=((65280&(hu=(61680&(hu=(52428&hu)>>>2|(13107&hu)<<2))>>>4|(3855&hu)<<4))>>>8|(255&hu)<<8)>>>1}var Md=function(t,e,n){for(var r=t.length,s=0,i=new Or(e);r>s;++s)++i[t[s]-1];var a,u=new Or(e);for(s=0;e>s;++s)u[s]=u[s-1]+i[s-1]<<1;for(a=new Or(r),s=0;r>s;++s)a[s]=GP[u[t[s]-1]++]>>>15-t[s];return a},Ll=new Ps(288);for(Ht=0;144>Ht;++Ht)Ll[Ht]=8;for(Ht=144;256>Ht;++Ht)Ll[Ht]=9;for(Ht=256;280>Ht;++Ht)Ll[Ht]=7;for(Ht=280;288>Ht;++Ht)Ll[Ht]=8;var Mm=new Ps(32);for(Ht=0;32>Ht;++Ht)Mm[Ht]=5;var yN=Md(Ll,9),_N=Md(Mm,5),KP=function(t){return(t/8>>0)+(7&t&&1)},qP=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof Or?Or:t instanceof fc?fc:Ps)(n-e);return r.set(t.subarray(e,n)),r},$i=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8},dd=function(t,e,n){var r=e/8>>0;t[r]|=n<<=7&e,t[r+1]|=n>>>8,t[r+2]|=n>>>16},Kv=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 Ps(0),0];if(s==1){var a=new Ps(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(I,R){return I.f-R.f})),n.push({s:-1,f:25001});var u=n[0],c=n[1],d=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[d].f?d++:p++],c=n[d!=h&&n[p].f>n[d].f?d++:p++],n[h++]={s:-1,f:u.f+c.f,l:u,r:c};var m=i[0].s;for(r=1;s>r;++r)i[r].s>m&&(m=i[r].s);var y=new Or(m+1),w=Xy(n[h-1],y,0);if(w>e){r=0;var _=0,x=w-e,b=1<<x;for(i.sort((function(I,R){return y[R.s]-y[I.s]||I.f-R.f}));s>r;++r){var P=i[r].s;if(e>=y[P])break;_+=b-(1<<w-y[P]),y[P]=e}for(_>>>=x;_>0;){var T=i[r].s;e>y[T]?_-=1<<e-y[T]++-1:++r}for(;r>=0&&_;--r){var k=i[r].s;y[k]==e&&(--y[k],++_)}w=e}return[new Ps(y),w]},Xy=function(t,e,n){return t.s==-1?Math.max(Xy(t.l,e,n+1),Xy(t.r,e,n+1)):e[t.s]=n},pC=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Or(++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]},fd=function(t,e){for(var n=0,r=0;e.length>r;++r)n+=t[r]*e[r];return n},Qy=function(t,e,n){var r=n.length,s=KP(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)},mC=function(t,e,n,r,s,i,a,u,c,d,h){$i(e,h++,n),++s[256];for(var p=Kv(s,15),m=p[0],y=p[1],w=Kv(i,15),_=w[0],x=w[1],b=pC(m),P=b[0],T=b[1],k=pC(_),I=k[0],R=k[1],L=new Or(19),A=0;P.length>A;++A)L[31&P[A]]++;for(A=0;I.length>A;++A)L[31&I[A]]++;for(var O=Kv(L,7),D=O[0],N=O[1],F=19;F>4&&!D[fC[F-1]];--F);var K,Z,W,G,Y=d+5<<3,$=fd(s,Ll)+fd(i,Mm)+a,J=fd(s,m)+fd(i,_)+a+14+3*F+fd(L,D)+(2*L[16]+3*L[17]+7*L[18]);if($>=Y&&J>=Y)return Qy(e,h,t.subarray(c,c+d));if($i(e,h,1+($>J)),h+=2,$>J){K=Md(m,y),Z=m,W=Md(_,x),G=_;var H=Md(D,N);for($i(e,h,T-257),$i(e,h+5,R-1),$i(e,h+10,F-4),h+=14,A=0;F>A;++A)$i(e,h+3*A,D[fC[A]]);h+=3*F;for(var j=[P,I],X=0;2>X;++X){var oe=j[X];for(A=0;oe.length>A;++A)$i(e,h,H[se=31&oe[A]]),h+=D[se],se>15&&($i(e,h,oe[A]>>>5&127),h+=oe[A]>>>12)}}else K=yN,Z=Ll,W=_N,G=Mm;for(A=0;u>A;++A)if(r[A]>255){var se;dd(e,h,K[257+(se=r[A]>>>18&31)]),h+=Z[se+257],se>7&&($i(e,h,r[A]>>>23&31),h+=G2[se]);var ee=31&r[A];dd(e,h,W[ee]),h+=G[ee],ee>3&&(dd(e,h,r[A]>>>5&8191),h+=K2[ee])}else dd(e,h,K[r[A]]),h+=Z[r[A]];return dd(e,h,K[256]),h+Z[256]},wN=new fc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),xN=(function(){for(var t=new fc(256),e=0;256>e;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),qv=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function bN(t,e){e===void 0&&(e={});var n=(function(){var p=4294967295;return{p(m){for(var y=p,w=0;m.length>w;++w)y=xN[255&y^m[w]]^y>>>8;p=y},d(){return 4294967295^p}}})(),r=t.length;n.p(t);var s,i,a,u,c,d=(u=10+((s=e).filename&&s.filename.length+1||0),c=8,(function(p,m,y,w,_,x){var b=p.length,P=new Ps(w+b+5*(1+Math.floor(b/7e3))+_),T=P.subarray(w,P.length-_),k=0;if(!m||8>b)for(var I=0;b>=I;I+=65535){var R=I+65535;b>R?k=Qy(T,k,p.subarray(I,R)):(T[I]=!0,k=Qy(T,k,p.subarray(I,b)))}else{for(var L=wN[m-1],A=L>>>13,O=8191&L,D=(1<<y)-1,N=new Or(32768),F=new Or(D+1),K=Math.ceil(y/3),Z=2*K,W=function(an){return(p[an]^p[an+1]<<K^p[an+2]<<Z)&D},G=new fc(25e3),Y=new Or(288),$=new Or(32),J=0,H=0,j=(I=0,0),X=0,oe=0;b>I;++I){var se=W(I),ee=32767&I,ce=F[se];if(N[ee]=ce,F[se]=ee,I>=X){var we=b-I;if((J>7e3||j>24576)&&we>423){k=mC(p,T,0,G,Y,$,H,j,oe,I-oe,k),j=J=H=0,oe=I;for(var ue=0;286>ue;++ue)Y[ue]=0;for(ue=0;30>ue;++ue)$[ue]=0}var ie=2,Ne=0,Ue=O,Pe=ee-ce&32767;if(we>2&&se==W(I-Pe))for(var Ve=Math.min(A,we)-1,ht=Math.min(32767,I),Jt=Math.min(258,we);ht>=Pe&&--Ue&&ee!=ce;){if(p[I+ie]==p[I+ie-Pe]){for(var be=0;Jt>be&&p[I+be]==p[I+be-Pe];++be);if(be>ie){if(ie=be,Ne=Pe,be>Ve)break;var $e=Math.min(Pe,be-2),Ge=0;for(ue=0;$e>ue;++ue){var tt=I-Pe+ue+32768&32767,bt=tt-N[tt]+32768&32767;bt>Ge&&(Ge=bt,ce=tt)}}}Pe+=(ee=ce)-(ce=N[ee])+32768&32767}if(Ne){G[j++]=268435456|Yy[ie]<<18|hC[Ne];var nt=31&Yy[ie],Ye=31&hC[Ne];H+=G2[nt]+K2[Ye],++Y[257+nt],++$[Ye],X=I+ie,++J}else G[j++]=p[I],++Y[p[I]]}}k=mC(p,T,!0,G,Y,$,H,j,oe,I-oe,k)}return qP(P,0,w+KP(k)+_)})(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=d.length;return(function(p,m){var y=m.filename;if(p[0]=31,p[1]=139,p[2]=8,p[8]=2>m.level?4:m.level==9?2:0,p[9]=3,m.mtime!=0&&qv(p,4,Math.floor(new Date(m.mtime||Date.now())/1e3)),y){p[3]=8;for(var w=0;y.length>=w;++w)p[w+10]=y.charCodeAt(w)}})(d,e),qv(d,h-8,n.d()),qv(d,h-4,r),d}var SN=!!by||!!R2,ZP="text/plain",Vp=!1,YP=(t,e)=>{var n=t.split("#"),r=n[1],s=n[0].split("?"),i=s[0],a=s[1];if(!a)return t;var u=a.split("&").filter((c=>c.split("=")[0]!==e)).join("&");return i+(u?"?"+u:"")+(r?"#"+r:"")},p0=function(t,e,n){var r;n===void 0&&(n=!0);var s=t.split("?"),i=s[0],a=s[1],u=le({},e),c=(r=a==null?void 0:a.split("&").map((h=>{var p,m=h.split("="),y=m[0],w=n&&(p=u[y])!==null&&p!==void 0?p:m[1];return delete u[y],y+"="+w})))!==null&&r!==void 0?r:[],d=(function(h,p){var m,y;p===void 0&&(p="&");var w=[];return yt(h,(function(_,x){de(_)||de(x)||x==="undefined"||(m=encodeURIComponent((b=>b instanceof File)(_)?_.name:_.toString()),y=encodeURIComponent(x),w[w.length]=y+"="+m)})),w.join(p)})(u);return d&&c.push(d),c.length>0?i+"?"+c.join("&"):i},Zv=t=>{if(t.Ys)return t.Ys;var e=t.data,n=t.compression;if(e){if(n===fr.GZipJS){var r=bN((function(u,c){var d=u.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(u);for(var h=new Ps(u.length+(u.length>>>1)),p=0,m=function(x){h[p++]=x},y=0;d>y;++y){if(p+5>h.length){var w=new Ps(p+8+(d-y<<1));w.set(h),h=w}var _=u.charCodeAt(y);128>_?m(_):2048>_?(m(192|_>>>6),m(128|63&_)):_>55295&&57344>_?(m(240|(_=65536+(1047552&_)|1023&u.charCodeAt(++y))>>>18),m(128|_>>>12&63),m(128|_>>>6&63),m(128|63&_)):(m(224|_>>>12),m(128|_>>>6&63),m(128|63&_))}return qP(h,0,p)})(Tu(e)),{mtime:0});return{contentType:ZP,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===fr.Base64){var s=(function(u){return u&&btoa(encodeURIComponent(u).replace(/%([0-9A-F]{2})/g,((c,d)=>String.fromCharCode(parseInt(d,16)))))})(Tu(e)),i=(u=>"data="+encodeURIComponent(typeof u=="string"?u:Tu(u)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=Tu(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},XP=t=>{var e,n,r=()=>t.transport==="sendBeacon"?{url:p0(t.url,{compression:fr.Base64}),encodedBody:Zv(le({},t,{compression:fr.Base64,Ys:void 0}))}:{url:YP(t.url,"compression"),encodedBody:Zv(le({},t,{compression:void 0,Ys:void 0}))};try{e=Zv(t)}catch(s){if(RE(t.compression,cc(t.url,"compression")))return ve.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&RE(t.compression,cc(t.url,"compression"))&&!((n=e.body)instanceof ArrayBuffer?Sy(new Uint8Array(n)):ArrayBuffer.isView(n)&&Sy(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)))?(Vp=!0,r()):{url:t.url,encodedBody:e}},QP=t=>{try{return XP(t)}catch(e){return ve.error(e),void(t.callback==null||t.callback({statusCode:0,error:e}))}},EN=(function(){var t=Pt((function*(e){var n=Tu(e.data),r=yield(function(i,a,u){return Ey.apply(this,arguments)})(n,kt.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return le({},e,{Ys:{contentType:ZP,body:s,estimatedSize:s.byteLength}})}));return function(e){return t.apply(this,arguments)}})(),CN=/Failed to fetch|NetworkError|Load failed/i,JP=t=>(t==null?void 0:t.name)==="TypeError"&&CN.test((t==null?void 0:t.message)||""),e3=t=>{var e=QP(t);if(e){var n=e.url,r=e.encodedBody,s=r??{},i=s.contentType,a=s.body,u=s.estimatedSize,c=new Headers;yt(t.headers,(function(w,_){c.append(_,w)})),i&&c.append("Content-Type",i);var d=null,h=!1;if(CE){var p=new CE;d={signal:p.signal,timeout:setTimeout((()=>{var w,_;h=!0,p.abort((w=t.timeout,(_=new Error("PostHog request timed out"+(w?" after "+w+"ms":""))).name="AbortError",_))}),t.timeout)}}var m=w=>{h&&(w==null?void 0:w.name)==="AbortError"||JP(w)?ve.warn(w):ve.error(w),t.callback==null||t.callback({statusCode:0,error:w})};try{var y;R2(n,le({method:(t==null?void 0:t.method)||"GET",headers:c,keepalive:t.method==="POST"&&!t.Xs&&52428.8>(u||0),body:a,signal:(y=d)==null?void 0:y.signal},t.fetchOptions)).then((w=>w.text().then((_=>{var x={statusCode:w.status,text:_};if(w.status===200)try{x.json=JSON.parse(_)}catch(b){ve.error(b)}t.callback==null||t.callback(x)})))).catch(m).finally((()=>d?clearTimeout(d.timeout):null))}catch(w){d&&clearTimeout(d.timeout),m(w)}}},Jy=t=>{try{var e,n=XP(t),r=n.url,s=n.encodedBody,i=s??{},a=i.body,u=i.estimatedSize;if(!a)return;var c=a instanceof Blob?a:new Blob([a],{type:i.contentType});if(hr.sendBeacon(r,c))return;var d=Ke(t.data)?t.data:(e=t.data)==null?void 0:e.batch;if(Ke(d)&&d.length>1&&(u??0)>16384){var h=Math.ceil(d.length/2),p=m=>Ke(t.data)?m:le({},t.data,{batch:m});return Jy(le({},t,{data:p(d.slice(0,h))})),void Jy(le({},t,{data:p(d.slice(h))}))}ve.warn("Beacon of ~"+(u??0)+" bytes was rejected by the browser, falling back to fetch"),e3(le({},t,{Xs:!0}))}catch(m){ve.warn("Beacon send failed",m)}},gC=(t,e,n,r)=>{var s=r==="query"?e==="POST"?"sent_at":"_":void 0;return p0(n===fr.GZipJS?YP(t,"compression"):t,le({},s?{[s]:Date.now().toString()}:{},n===fr.GZipJS?{}:{compression:n}))},$p=[];R2&&$p.push({transport:"fetch",method:e3}),by&&$p.push({transport:"XHR",method(t){var e=QP(t);if(e){var n=new by,r=e.encodedBody;n.open(t.method||"GET",e.url,!0);var s=r??{},i=s.contentType,a=s.body;yt(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)}}}),hr!=null&&hr.sendBeacon&&$p.push({transport:"sendBeacon",method:Jy});var e_=3e3;class kN{constructor(e,n){this.eo=!0,this.io=[],this.ro=_i((n==null?void 0:n.flush_interval_ms)||e_,250,5e3,ve.createLogger("flush interval"),e_),this.no=e}enqueue(e){this.io.push(e),this.so||this.oo()}unload(){this.ao();var e=this.io.length>0?this.lo():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.uo(le({},r,{transport:"sendBeacon"}))}))}enable(){this.eo=!1,this.oo()}oo(){var e=this;this.eo||(this.so=setTimeout((()=>{if(this.ao(),this.io.length>0){var n=this.lo(),r=function(){var i=n[s],a=new Date().getTime();i.data&&Ke(i.data)&&yt(i.data,(u=>{u.offset=Math.abs(u.timestamp-a),delete u.timestamp})),e.uo(i)};for(var s in n)r()}}),this.ro))}uo(e){try{this.no(e)}catch(n){ve.error(n)}}ao(){clearTimeout(this.so),this.so=void 0}lo(){var e={};return yt(this.io,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;de(e[i])&&(e[i]=le({},s,{data:[]})),(r=e[i].data)==null||r.push(s.data)})),this.io=[],e}}var PN=["retriesPerformedSoFar"];class TN{constructor(e){this.ho=!1,this.do=3e3,this.io=[],this._instance=e,this.io=[],this.vo=!0,!de(ne)&&"onLine"in ne.navigator&&(this.vo=ne.navigator.onLine,this.co=()=>{this.vo=!0,this.fo()},this.po=()=>{this.vo=!1},Vt(ne,"online",this.co),Vt(ne,"offline",this.po))}get length(){return this.io.length}retriableRequest(e){var n=e.retriesPerformedSoFar,r=k8(e,PN);Ki(n)&&(r.url=p0(r.url,{retry_count:n})),this._instance._send_request(le({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(n??0))return void this.bn(le({retriesPerformedSoFar:n},r));s.statusCode===0&&ve.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(n??0)+" retries.")}r.callback==null||r.callback(s)}}))}bn(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(a){var u=3e3*Math.pow(2,a),c=u/2,d=Math.min(18e5,u),h=Math.random()-.5;return Math.ceil(d+h*(d-c))})(n),s=Date.now()+r;this.io.push({retryAt:s,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),ve.warn(i),this.ho||(this.ho=!0,this.mo())}mo(){if(this.yo&&clearTimeout(this.yo),this.io.length===0)return this.ho=!1,void(this.yo=void 0);this.yo=setTimeout((()=>{this.vo&&this.io.length>0&&this.fo(),this.mo()}),this.do)}fo(){var e=Date.now(),n=[],r=this.io.filter((i=>e>i.retryAt||(n.push(i),!1)));if(this.io=n,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.yo&&(clearTimeout(this.yo),this.yo=void 0),this.ho=!1,de(ne)||(this.co&&(ne.removeEventListener("online",this.co),this.co=void 0),this.po&&(ne.removeEventListener("offline",this.po),this.po=void 0)),this.io)){var n=e.requestOptions;try{this._instance._send_request(le({},n,{transport:"sendBeacon"}))}catch(r){ve.error(r)}}this.io=[]}}class IN{constructor(e){this.bo=()=>{var n,r,s,i;this._o||(this._o={});var a=this.scrollElement(),u=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=u+((a==null?void 0:a.clientHeight)||0),h=(a==null?void 0:a.scrollHeight)||0;this._o.lastScrollY=Math.ceil(u),this._o.maxScrollY=Math.max(u,(n=this._o.maxScrollY)!==null&&n!==void 0?n:0),this._o.maxScrollHeight=Math.max(c,(r=this._o.maxScrollHeight)!==null&&r!==void 0?r:0),this._o.lastContentY=d,this._o.maxContentY=Math.max(d,(s=this._o.maxContentY)!==null&&s!==void 0?s:0),this._o.maxContentHeight=Math.max(h,(i=this._o.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get wo(){return this._instance.config.scroll_root_selector}getContext(){return this._o}resetContext(){var e=this._o;return setTimeout(this.bo,0),e}startMeasuringScrollPosition(){Vt(ne,"scroll",this.bo,{capture:!0}),Vt(ne,"scrollend",this.bo,{capture:!0}),Vt(ne,"resize",this.bo)}scrollElement(){if(!this.wo)return ne==null?void 0:ne.document.documentElement;var e=Ke(this.wo)?this.wo:[this.wo];for(var n of e){var r=ne==null?void 0:ne.document.querySelector(n);if(r)return r}}ko(e){var n=e==="y"?"scrollTop":"scrollLeft";if(this.wo){var r=this.scrollElement();return r&&r[n]||0}return ne?e==="y"?ne.scrollY||ne.pageYOffset||ne.document.documentElement.scrollTop||0:ne.scrollX||ne.pageXOffset||ne.document.documentElement.scrollLeft||0:0}scrollY(){return this.ko("y")}scrollX(){return this.ko("x")}}var AN=t=>$P(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 vC{constructor(e,n,r,s){this.ot=i=>{var a=this.xo();if(!a||a.sessionId!==i){var u={sessionId:i,props:this.So(this._instance)};this.Co.register({[$y]:u})}},this._instance=e,this.To=n,this.Co=r,this.So=s||AN,this.To.onSessionId(this.ot)}xo(){return this.Co.props[$y]}getSetOnceProps(){var e,n=(e=this.xo())==null?void 0:e.props;return n?"r"in n?HP(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 yt(z2(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Cy(r)]=n})),e}}class q2{on(e,n){return this.Mo[e]||(this.Mo[e]=[]),this.Mo[e].push(n),()=>{this.Mo[e]=this.Mo[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.Mo[e]||[])r(n);for(var s of this.Mo["*"]||[])s(e,n)}constructor(){this.Mo={}}}var pu=Lt("[SessionId]"),yC=864e5;class _C{on(e,n){return this.Eo.on(e,n)}constructor(e,n,r){var s;if(this.Io=null,this.Ro=null,this.Po=[],this.Ao=void 0,this.Fo=!1,this.Eo=new q2,this.Oo=(c,d)=>!(!Ki(c)||!Ki(d))&&Math.abs(c-d)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===so)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Oi=e.config,this.Co=e.persistence,this.st=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.Lo=void 0,this._sessionActivityTimestamp=null,this.$o=n||Ji,this.Do=r||Ji;var i=this.Oi.persistence_name||this.Oi.token;if(this._sessionTimeoutMs=1e3*_i(this.Oi.session_idle_timeout_seconds||1800,60,36e3,pu.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.No(),this.qo="ph_"+i+"_window_id",this.jo="ph_"+i+"_primary_window_exists",this.Bo()){var a=Et.Pr(this.qo),u=Et.Pr(this.jo);a&&!u?this.st=a:Et.Dr(this.qo),Et.Or(this.jo,!0)}(s=this.Oi.bootstrap)!=null&&s.sessionID&&this.setBootstrapSessionId(this.Oi.bootstrap.sessionID),this.Ho()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return de(this.Po)&&(this.Po=[]),this.Po.push(e),this._e&&e(this._e,this.st),()=>{this.Po=this.Po.filter((n=>n!==e))}}Bo(){return this.Oi.persistence!=="memory"&&!this.Co.ws&&Et.Lr()}zo(e){e!==this.st&&(this.st=e,this.Bo()&&Et.Or(this.qo,e))}Uo(){return this.st?this.st:this.Bo()?Et.Pr(this.qo):null}Wo(e){var n=this.Io;return!Ln(n)&&!Ln(e)&&5e3>Math.abs(e-n)}Vo(e,n,r){var s=n!==this._sessionActivityTimestamp,i=!(e!==this._e||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._e=e,i&&!s||i&&this.Wo(n)||(this.Io=n,this.Co.register({[Pu]:[n,e,r]}))}Go(){var e,n=(e=this.Oi)==null?void 0:e.persistence_save_debounce_ms;return Ki(n)&&n>0}Zo(){this.Go()?this.Co.refreshKey(Pu):(this.Co.flush(),this.Co.load())}Qo(){var e;if(!Ln(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Io){this.Zo();var n=this.Jo();n[1]===this._e&&n[2]===this._sessionStartTimestamp&&(this.Io=this._sessionActivityTimestamp,this.Co.register({[Pu]:[this._sessionActivityTimestamp,(e=this._e)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.Co.flush())}}Ko(){var e=this.Jo()[0],n=Ki(e)?e:0,r=Ki(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(n,r)}Yo(e){return this.Zo(),this.Oo(e,this.Ko())}Jo(){var e=this.Co.props[Pu];return Ke(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Io=null,this.Lo=void 0,clearTimeout(this.Xo),this.Xo=void 0,this.Vo(null,null,null)}setBootstrapSessionId(e,n){n===void 0&&(n=!1);var r=(function(s,i){i===void 0&&(i=new Date().getTime());try{var a=(u=>{var c=u.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})(s);return a>i+6e4?void pu.error("Bootstrap sessionID cannot be in the future"):a}catch(u){return void pu.error("Invalid sessionID in bootstrap",u)}})(e);return!de(r)&&(n?this.Lo={sessionId:e,sessionStartTimestamp:r}:this.Vo(e,new Date().getTime(),r),!0)}destroy(){this.Fo=!0,this.Qo(),clearTimeout(this.Xo),this.Xo=void 0,this.Ao&&ne&&(ne.removeEventListener(km,this.Ao,{capture:!1}),this.Ao=void 0),this.Po=[]}Ho(){this.Ao=()=>{this.Qo(),this.Bo()&&Et.Dr(this.jo)},Vt(ne,km,this.Ao,{capture:!1})}checkAndGetSessionAndWindowId(e,n,r){if(e===void 0&&(e=!1),n===void 0&&(n=null),r===void 0&&(r=!1),this.Oi.cookieless_mode===so)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=n||new Date().getTime(),i=this._e;if(r)this.Ro=s;else if(Ln(this.Ro)||this.Ro>s||s-this.Ro>=1e3){var a,u;(a=(u=this.Co).syncCookieProperties)==null||a.call(u),this.Ro=s}var c=this.Jo(),d=c[1],h=c[2],p=!de(i)&&d!==i,m=this.Ko(),y=this.Uo(),w=this.Lo,_=!!w&&(w.sessionStartTimestamp>s+6e4||s-w.sessionStartTimestamp>yC),x=w?_:Ki(h)&&Math.abs(s-h)>yC,b=!1,P=p,T=!d||!!w,k=d,I=!T&&!e&&this.Oo(s,m);if(I){(I=this.Yo(s))||pu.info("cross-tab refresh kept the session alive",{sessionId:d});var R=this.Jo();d=R[1],h=R[2]}if(T||I||x){P=!1;var L=w&&!_;d=L?w.sessionId:this.$o(),y=this.Do(),pu.info("new session ID assigned",{sessionId:d,windowId:y,bootstrapped:!!L,changeReason:{noSessionId:T,activityTimeout:I,sessionPastMaximumLength:x}}),h=L?w.sessionStartTimestamp:s,this.Lo=void 0,b=!0}else y||(y=this.Do(),b=!0),(P=P||d!==k)&&(pu.info("adopted cross-tab session id",{sessionId:d,windowId:y}),b=!0);var A=Ki(m)&&e&&!x?m:s,O=Ki(h)?h:new Date().getTime();this.zo(y),this.Vo(d,A,O),e||this.No();var D={noSessionId:T,activityTimeout:I,sessionPastMaximumLength:x,crossTabAdoption:P};return b&&this.Po.forEach((N=>N(d,y,D))),{sessionId:d,windowId:y,sessionStartTimestamp:O,changeReason:b?D:void 0,lastActivityTimestamp:m}}No(){this.Fo||(clearTimeout(this.Xo),this.Xo=setTimeout((()=>{if(!this.Fo)if(this.Yo(new Date().getTime())){var e=this._e;this.resetSessionId(),this.Eo.emit("forcedIdleReset",{idleSessionId:e})}else this.No()}),1.1*this.sessionTimeoutMs))}}var t3=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&OE(n,e))return!0;try{var r=t==null?void 0:t.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>OE(s==null?void 0:s.brand,e))))return!0}catch{}return!!t.webdriver};function n3(){return(n3=Pt((function*(){var t=hr==null?void 0:hr.userAgentData;if(t!=null&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),n=e==null?void 0:e.model;return ft(n)&&n.length>0?n:void 0}catch(r){return void ve.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}}))).apply(this,arguments)}var Om=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 Yv(t,e,n){return Tu({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var r3={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=>Om(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!Om(n,r))))),icontains:(t,e)=>e.map(lp).some((n=>t.map(lp).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(lp).every((n=>t.map(lp).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)))}))},lp=t=>t.toLowerCase();function s3(t,e){return!t||Object.entries(t).every((n=>{var r=n[1],s=e==null?void 0:e[n[0]];if(de(s)||Ln(s))return!1;var i=[String(s)],a=r3[r.operator];return!!a&&a(r.values,i)}))}var t_="custom",wC="i.posthog.com",RN=/^\/static\//,MN=["/s/","/e/","/i/"];class ON{constructor(e){this.ta={},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("."+wC,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.ta[this.apiHost]||(this.ta[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":t_),this.ta[this.apiHost]}ea(e){if(RN.test(e)){var n=this.instance.config.asset_host;if(typeof n=="string")return n.trim().replace(/\/$/,"")||void 0}}ia(e){var n=uc(e);return n?n.protocol+"//"+n.host+n.pathname:void 0}ra(e,n,r){if(e==="ui")return r;var s=r,i=this.instance.config.rewriteRequestPath;if(i){var a,u=((a=uc(r))==null?void 0:a.href)||r;s=i(new URL(u)).toString()}if(i&&e==="api"&&MN.some((m=>n.indexOf(m)===0))){var c=this.ia(s);if(c){var d,h=this.apiHost,p=this.na;((d=p)==null?void 0:d.apiHost)===h&&p.rewriteRequestPath===i||(p={apiHost:h,rewriteRequestPath:i,urls:new Set},this.na=p),p.urls.add(c)}}return s}isIngestionEndpoint(e){var n=this.na,r=this.ia(e);return(n==null?void 0:n.apiHost)===this.apiHost&&n.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!r&&n.urls.has(r)}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.ra(e,n,this.uiHost+n);if(e==="flags")return this.ra(e,n,this.flagsApiHost+n);if(e==="assets"){var r=this.ea(n);if(r)return this.ra(e,n,""+r+n)}if(this.region===t_)return this.ra(e,n,this.apiHost+n);var s=wC+n;switch(e){case"assets":return this.ra(e,n,"https://"+this.region+"-assets."+s);case"api":return this.ra(e,n,"https://"+this.region+"."+s)}}}function i3(t){var e;return!((e=t.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var _t=Lt("[Surveys]"),o3="seenSurvey_",a3=t=>{try{var e=(n=>((r,s)=>""+o3+(function(i){return i.current_iteration&&i.current_iteration>0?i.id+"_"+i.current_iteration:i.id})(s))(0,n))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(n){_t.error("Failed to persist survey seen state",n)}},LN=[Wv.Popover,Wv.Widget,Wv.API],DN={ignoreConditions:!1,ignoreDelay:!1,displayType:Zy.Popover},NN=Lt("[PostHog ExternalIntegrations]"),FN={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class jN{constructor(e){this._instance=e}Jn(e,n){var r;(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(s=>{if(s)return NN.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var e=this,n=function(){var i,a,u,c=r[0],d=r[1];!d||(i=je.__PosthogExtensions__)!=null&&(i=i.integrations)!=null&&i[c]||e.Jn(FN[c],(()=>{var h;(h=je.__PosthogExtensions__)==null||(h=h.integrations)==null||(h=h[c])==null||h.start(e._instance)})),!d&&(a=je.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[c]&&((u=je.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[c])==null||u.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n()}}}class VN{constructor(e,n){this.I=e,this.sa=n,this.oa=new Map,this.aa=!1}add(e){var n=this;return Pt((function*(){if(n.aa)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(n.oa.has(e.name))throw new Error('Browser extension "'+e.name+'" is already registered');n.oa.set(e.name,e);try{var r=e.setup(n.sa);r&&(yield r)}catch(i){var s=n.oa.get(e.name)===e;s&&n.oa.delete(e.name),n.I.error('Failed to set up browser extension "'+e.name+'"',i),s&&n.la(e)}}))()}dispose(){if(!this.aa){this.aa=!0;var e=Array.from(this.oa.values()).reverse();for(var n of(this.oa.clear(),e))this.la(n)}}la(e){try{var n=e.dispose==null?void 0:e.dispose();n&&dr(n.then)&&n.then(void 0,(r=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',r)}))}catch(r){this.I.error('Failed to dispose browser extension "'+e.name+'"',r)}}}class $N{constructor(e){this._instance=e}initialize(){}get(e){var n=this._instance.persistence;if(typeof e=="string")return n==null?void 0:n.get_property(e);var r={};for(var s of e){var i=n==null?void 0:n.get_property(s);de(i)||(r[s]=i)}return r}set(e,n){var r;(r=this._instance.persistence)==null||r.register(typeof e=="string"?{[e]:n}:e)}remove(e){var n;(n=this._instance.persistence)==null||n.unregister(e)}}var xC="extensionsRemoteConfig";class HN{constructor(e){this.aa=!1,this.instance=e,this.I=ve,this.ua=e.ha,this.kv=new $N(e),this.onEvent=n=>ap(this.instance.on("eventCaptured",(r=>{try{n({event:r.event,properties:r.properties})}catch(s){this.I.error("Browser extension event listener failed",s)}}))),this.onRemoteConfig=n=>{if(this.aa)return ap((()=>{}));var r=i=>{try{n(i)}catch(a){this.I.error("Browser extension remote config listener failed",a)}},s=this.instance.da.on(xC,r);return this.ua&&r(this.ua),ap(s)},this.va=new VN(ve.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return(e=this.instance.get_property(qd))!==null&&e!==void 0?e:this.distinctId}get deviceId(){var e=this.instance.get_property(qd);return typeof e=="string"?e:void 0}get library(){return{name:kt.LIB_NAME,version:kt.LIB_VERSION}}get initialPersonProperties(){var e,n;return(e=(n=this.instance.persistence)==null?void 0:n.get_initial_props())!==null&&e!==void 0?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,n,r,s,i=(e=this.instance.sessionManager)==null?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:(n=i==null?void 0:i.sessionId)!==null&&n!==void 0?n:"",windowId:(r=i==null?void 0:i.windowId)!==null&&r!==void 0?r:"",sessionStartTimestamp:(s=i==null?void 0:i.sessionStartTimestamp)!==null&&s!==void 0?s:0}}catch{return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.va.add(e)}capture(e,n,r){var s=this;return Pt((function*(){r?s.instance.capture(e,n,{timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce}):s.instance.capture(e,n)}))()}registerDynamicEventProperties(e){return ap(this.instance.ca(e))}handleRemoteConfig(e){this.aa||(this.ua=e,this.instance.da.emit(xC,e))}sendRequest(e,n){var r=this;return Pt((function*(){var s;n===void 0&&(n={});var i=r.instance.requestRouter.endpointFor((s=n.target)!==null&&s!==void 0?s:"api",e),a={method:n.method,url:n.query?p0(i,n.query):i,data:n.body,headers:n.headers,timeout:n.timeoutMs,fireCallbackOnDrop:!0,transport:n.transport,compression:n.compression,timestampMode:n.sentAt};return n.transport==="sendBeacon"?(r.instance._send_request(a),{statusCode:202}):new Promise((u=>{a.callback=u,r.instance._send_request(a)}))}))()}dispose(){this.aa||(this.aa=!0,this.va.dispose())}}var Od={},Xv=0,Lm=()=>{},bC='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',hd="Surveys module not available",SC="sanitize_properties is deprecated. Use before_send instead",l3="Invalid value for property_denylist config: ",zN=["token","distinct_id",mP],Su="posthog",u3=!SN&&(Ir==null?void 0:Ir.indexOf("MSIE"))===-1&&(Ir==null?void 0:Ir.indexOf("Mozilla"))===-1,Qv=t=>{var e;return le({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:zD(_e==null?void 0:_e.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Lm,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:jt&&ft(jt==null?void 0:jt.search)&&jt.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:"fallback",enable_recording_console_log:void 0,secure_cookie:(ne==null||(e=ne.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){ve.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Wy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:e_},error_tracking:{},_onCapture:Lm},(n=>({rageclick:n&&n>="2026-05-30"?{content_ignorelist:eN,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),cookieWinsOnConflict:!(!n||n==="unset"||"2026-08-29">n)}))(t))},BN=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],EC=t=>{var e={};for(var n of BN){var r=n[0],s=n[1];de(t[r])||(e[s]=t[r])}var i=St({},e,t),a=t.__preview_external_dependency_versioned_paths;return de(a)||(de(t.strict_script_versioning)&&(i.strict_script_versioning=!!a),ft(a)&&de(t.asset_host)&&(i.asset_host=a)),Ke(t.property_blacklist)&&(de(t.property_denylist)?i.property_denylist=t.property_blacklist:Ke(t.property_denylist)?i.property_denylist=[...t.property_blacklist,...t.property_denylist]:ve.error(l3+t.property_denylist)),i};class UN{constructor(){this.__forceAllowLocalhost=!1}get fa(){return this.__forceAllowLocalhost}set fa(e){ve.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Yr{pa(e,n){if(e){var r=this.oa.indexOf(e);r!==-1&&this.oa.splice(r,1)}return this.oa.push(n),n.initialize==null||n.initialize(),n}ga(){return this.config.cookieless_mode===so||this.config.cookieless_mode===il&&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 UN,this.ma=!1,this.version=kt.LIB_VERSION,this.ya=new Set,this.ba="",this.da=new q2,this.oa=[],this._a=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Qv(),this.SentryIntegration=lN,this.sentryIntegration=r=>(function(s,i){var a=OP(s,i);return{name:MP,processEvent:u=>a(u)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.wa=!1,this.ka=null,this.xa=null,this.Sa=null,this.scrollManager=new IN(this),this.pageViewManager=new aC(this),this.rateLimiter=new vN(this),this.requestRouter=new ON(this),this.consent=new ZD(this),this.externalIntegrations=new jN(this);var n=(e=Yr.__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=ft(r)?{[r]:s}:r;this.setPersonProperties(a),i==null||i({})},set_once:(r,s,i)=>{var a=ft(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),i==null||i({})}},this.on("eventCaptured",(r=>ve.info('send "'+(r==null?void 0:r.event)+'"',r)))}init(e,n,r){if(r&&r!==Su){var s,i=(s=Od[r])!==null&&s!==void 0?s:new Yr;return i._init(e,n,r),Od[r]=i,Od[Su][r]=i,i}return this._init(e,n,r)}_init(e,n,r){var s,i;n===void 0&&(n={});var a,u=ft(e)?e.trim():"";if(!u)return ve.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 u!==((a=this.config)==null?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+u+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=Qv(n.defaults),n.debug=this.Ca(n.debug),this.Ta=n,this.Ma=[],n.person_profiles?this.xa=n.person_profiles:n.process_person&&(this.xa=n.process_person);var c=Qv(n.defaults),d=EC(n),h=St({},c,d,{name:r,token:u});It(c.rageclick)&&It(d.rageclick)&&(h.rageclick=St({},c.rageclick,d.rageclick)),It(c.session_recording)&&It(d.session_recording)&&(h.session_recording=St({},c.session_recording,d.session_recording)),this.set_config(h),this.config.on_xhr_error&&ve.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:fr.GZipJS;var p=this.Ea();if(this.persistence=new Uv(this.config,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Uv(le({},this.config,{persistence:"sessionStorage"}),p,!1),this.ba="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties",this.config.persistence!=="memory"&&!p&&Et.Lr()){var m=Et.Pr(this.ba);Ke(m)&&m.forEach((R=>{ft(R)&&this.ya.add(R)}))}else Et.Dr(this.ba);var y=le({},this.persistence.props),w=le({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ia=new kN((R=>this.Ra(R)),this.config.request_queue_config),this.Pa=new TN(this),this.__request_queue=[];var _=this.ga();if(_||(this.sessionManager=new _C(this),this.sessionPropsManager=new vC(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId(((R,L,A)=>{(A!=null&&A.activityTimeout||A!=null&&A.sessionPastMaximumLength||A!=null&&A.crossTabAdoption)&&this.Aa()}))),this.Fa(),this.config.__preview_deferred_init_extensions?(ve.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Oa(_)}),0)):(ve.info("Initializing extensions synchronously"),this.Oa(_)),kt.DEBUG=kt.DEBUG||this.config.debug,kt.DEBUG&&ve.info("Starting in debug mode",{this:this,config:n,thisC:le({},this.config),p:y,s:w}),!this.config.identity_distinct_id||(s=n.bootstrap)!=null&&s.distinctID||(n.bootstrap=le({},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,b=this.get_distinct_id(),P=this.persistence.get_property(st);if(n.bootstrap.isIdentifiedID&&b!=null&&b!==x&&P===fn)this.identify(x);else if(n.bootstrap.isIdentifiedID&&b!=null&&b!==x&&P===Un)ve.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var T=this.config.get_device_id(Ji()),k=n.bootstrap.isIdentifiedID?T:x;this.persistence.set_property(st,n.bootstrap.isIdentifiedID?Un:fn),this.register({distinct_id:x,$device_id:k})}}if(_)this.register_once({distinct_id:tp,$device_id:null},"");else if(!this.get_distinct_id()){var I=this.config.get_device_id(Ji());this.register_once({distinct_id:I,$device_id:I},""),this.persistence.set_property(st,fn)}return Vt(ne,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(R,L){var A=R.config.segment;if(!A)return L();(function(O,D){var N=O.config.segment;if(!N)return D();var F=Z=>{var W=()=>Z.anonymousId()||Ji();O.config.get_device_id=W,Z.id()&&(O.register({distinct_id:Z.id(),$device_id:W()}),O.persistence.set_property(st,Un)),D()},K=N.user();"then"in K&&dr(K.then)?K.then(F):F(K)})(R,(()=>{A.register((O=>{typeof Promise<"u"&&Promise.resolve||zv.warn("This browser does not have Promise support, and can not use the segment integration");var D=(N,F)=>{if(!F)return N;N.event.userId||N.event.anonymousId===O.get_distinct_id()||(zv.info("No userId set, resetting PostHog"),O.reset()),N.event.userId&&N.event.userId!==O.get_distinct_id()&&(zv.info("UserId set, identifying with PostHog"),O.identify(N.event.userId));var K=O.calculateEventProperties(F,N.event.properties);return N.event.properties=Object.assign({},K,N.event.properties),N};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:N=>D(N,N.event.event),page:N=>D(N,bu),identify:N=>D(N,Dv),screen:N=>D(N,"$screen")}})(R)).then((()=>{L()}))}))})(this,(()=>this.La())):this.La(),dr(this.config._onCapture)&&this.config._onCapture!==Lm&&(ve.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(R=>this.config._onCapture(R.event,R)))),this.config.ip&&ve.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return n3.apply(this,arguments)})().then((R=>{R&&this.register({[Ov]:R})})).catch(Lm),this}Fa(){var e,n,r,s,i,a,u=(e=(n=this.config.__extensionClasses)==null?void 0:n.featureFlags)!==null&&e!==void 0?e:(r=Yr.__defaultExtensionClasses)==null?void 0:r.featureFlags;u&&(this.featureFlags&&this.featureFlags instanceof u||((s=this.$a)==null||s.call(this),this.$a=void 0,this.featureFlags=new u(this)),dr(this.featureFlags.onReloading)&&dr(this.featureFlags.setup)?this.$a||(this.$a=this.featureFlags.onReloading((()=>{this.da.emit("featureFlagsReloading",!0)})),this.Da().add(this.featureFlags)):(i=(a=this.featureFlags).initialize)==null||i.call(a))}Oa(e){var n,r,s,i,a,u,c,d=performance.now(),h=le({},Yr.__defaultExtensionClasses,this.config.__extensionClasses),p=[];h.exceptions&&this.oa.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new h.exceptions(this)),h.historyAutocapture&&this.oa.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.oa.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.oa.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.oa.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||p.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),h.autocapture&&this.oa.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.oa.push(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new h.surveys(this)),h.logs&&this.oa.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new h.logs(this)),h.metrics&&this.oa.push(this.metrics=(i=this.metrics)!==null&&i!==void 0?i:new h.metrics(this)),h.conversations&&this.oa.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new h.conversations(this)),h.productTours&&this.oa.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.oa.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.oa.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.oa.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.oa.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,aN)),h.toolbar&&this.oa.push(this.toolbar=(u=this.toolbar)!==null&&u!==void 0?u:new h.toolbar(this)),h.experiments&&this.oa.push(this.experiments=(c=this.experiments)!==null&&c!==void 0?c:new h.experiments(this)),this.oa.forEach((m=>{m.initialize&&p.push((()=>{m.initialize==null||m.initialize()}))})),p.push((()=>{if(this.Na){var m=this.Na;this.Na=void 0,this.oa.forEach((y=>y.onRemoteConfig==null?void 0:y.onRemoteConfig(m)))}})),this.qa(p,d)}qa(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.qa(e,n)}),0);var r=e.shift();if(r)try{r()}catch(i){ve.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({[gP]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[vP]:s}),this.config.__preview_deferred_init_extensions&&ve.info("PostHog extensions initialized ("+s+"ms)")}Zs(e){var n;if(!_e||!_e.body)return ve.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Zs(e)}),500);if(this.config.__preview_deferred_init_extensions&&(this.Na=e),this.ha=e,this.compression=void 0,e.ok){var r,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=Ze(s.supportedCompression,fr.GZipJS)?fr.GZipJS:Ze(s.supportedCompression,fr.Base64)?fr.Base64:void 0),(r=s.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.xa?this.xa:Wy}),(n=this.ja)==null||n.handleRemoteConfig(e),this.oa.forEach((i=>i.onRemoteConfig==null?void 0:i.onRemoteConfig(e)))}La(){try{this.config.loaded(this)}catch(r){ve.critical("`loaded` function failed",r)}if(this.Ba(),this.config.internal_or_test_user_hostname&&jt!=null&&jt.hostname){var e=jt.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.ga())&&this.Ha()}),1),this.za=new BP(this),this.za.load()}Ba(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Ia)==null||e.enable())}_dom_loaded(){this.is_capturing()&&np(this.__request_queue,(e=>this.Ra(e))),this.__request_queue=[],this.Ba()}_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.Ua()&&this.capture(Lv),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.Ia)==null||s.unload(),(i=this.Pa)==null||i.unload()):this.Ua()&&this.capture(Lv,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?u3?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=le({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(de(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=le({},n);a.timeout=a.timeout||6e4;var u,c,d,h,p,m=(r=a.transport)!==null&&r!==void 0?r:"fetch";m==="sendBeacon"&&de(a.compression)&&a.data&&(a.compression=fr.Base64),a.method==="POST"&&a.data&&(a.timestampMode==="capture-body"?a.data={api_key:(c=(p=(h=(Ke(u=a.data)?u:[u]).map((x=>le({},x,x.timestamp instanceof Date&&!isNaN(x.timestamp.getTime())?{timestamp:x.timestamp.toISOString()}:{}))))[0])==null||(d=p.properties)==null?void 0:d.token)!==null&&c!==void 0?c:p==null?void 0:p.token,batch:h,sent_at:new Date().toISOString()}:a.timestampMode==="body"&&(a.data=(function(x,b){return b===void 0&&(b=new Date().toISOString()),Ke(x)?x.map((P=>le({},P,{sent_at:b}))):le({},x,{sent_at:b})})(a.data))),a.url=gC(a.url,a.method,a.compression,a.timestampMode);var y=$p.filter((x=>!a.disableTransport||!x.transport||!a.disableTransport.includes(x.transport))),w=(s=(i=(function(x,b){for(var P=0;x.length>P;P++)if(x[P].transport===m)return x[P]})(y))==null?void 0:i.method)!==null&&s!==void 0?s:y[0].method;if(!w)throw new Error("No available transport method");var _=x=>{try{w(x)}catch(b){JP(b)?ve.warn(b):ve.error(b),a.callback==null||a.callback({statusCode:0,error:b})}};m!=="sendBeacon"&&a.data&&a.compression===fr.GZipJS&&WL&&typeof Promise<"u"&&!Vp?EN(a).then((x=>{_(x)})).catch((x=>{if(ME(x))return Vp=!0,void _(le({},a,{compression:void 0,url:gC(n.url,n.method,void 0,n.timestampMode)}));(b=>{if(!b||typeof b!="object")return!1;var P="name"in b?String(b.name):"";return ME(b)||P===P8})(x)&&(Vp=!0),_(a)})):w(a)})(le({},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}))}Ra(e){this.Pa?this.Pa.retriableRequest(e):this._send_request(e)}_execute_array(e){Xv++;try{var n,r=[],s=[],i=[];np(e,(u=>{if(u)if(Ke(n=u[0]))i.push(u);else if(dr(u))try{u.call(this)}catch(c){ve.error("Error executing queued PostHog call",u,c)}else Ke(u)&&n==="alias"?r.push(u):Ke(u)&&n.indexOf("capture")!==-1&&dr(this[n])?i.push(u):s.push(u)}));var a=function(u,c){np(u,(function(d){try{if(Ke(d[0])){var h=c;yt(d,(function(p){h=h[p[0]].apply(h,p.slice(1))}))}else c[d[0]].apply(c,d.slice(1))}catch(p){ve.error("Error executing queued PostHog call",d,p)}}))};a(r,this),a(s,this),a(i,this)}finally{Xv--}}push(e){if(Xv>0&&Ke(e)&&ft(e[0])){var n=Yr.prototype[e[0]];dr(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.Ia){if(this.is_capturing())if(!de(e)&&ft(e)){var d=!this.config.opt_out_useragent_filter&&this._is_bot();if(!d||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&&!ft(n==null?void 0:n.$current_url)&&(ve.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||r!=null&&r.Wa||ve.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&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,m=(r==null?void 0:r.timestamp)||p,y=FE(r==null?void 0:r.uuid,Ji),w={uuid:y,event:e,properties:this.calculateEventProperties(e,n||{},m,y)};e===bu&&this.config.__preview_capture_bot_pageviews&&d&&(w.event="$bot_pageview",w.properties.$browser_type="bot"),h&&(w.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var _=e==="$feature_flag_called"&&w.properties.$feature_flag_has_experiment===!1&&this.get_property(xm)===!0;r!=null&&r.$set&&!_&&(w.$set=r==null?void 0:r.$set);var x=r==null?void 0:r.$unset;x&&(w.$unset=x);var b,P,T,k=_?void 0:this.Va(r==null?void 0:r.$set_once,e!==UE,e===Dv);if(k&&(w.$set_once=k),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,a=w,u=F=>ft(F)?F.slice(0,i):F,c=new Set,w=(function F(K,Z){if(K!==Object(K))return u?u(K):K;if(!c.has(K)){var W;if(c.add(K),Ke(K))W=[],np(K,(Y=>{W.push(F(Y))}));else{var G={};yt(K,((Y,$)=>{c.has(Y)||(G[$]=F(Y))})),W=G}return W}})(a)),w.timestamp=m,de(r==null?void 0:r.timestamp)||(w.properties.$event_time_override_provided=!0,w.properties.$event_time_override_system_time=p),_&&(w.properties=(function(F,K){K===void 0&&(K=[]);var Z={},W=G=>{F[G]!==void 0&&(Z[G]=F[G])};return GL.forEach(W),K.forEach(W),Z})(w.properties,zN)),e===io.DISMISSED||e===io.SENT){var I=n==null?void 0:n[Gv.SURVEY_ID],R=n==null?void 0:n[Gv.SURVEY_ITERATION];a3({id:I,current_iteration:R}),w.$set=le({},w.$set,{[(b={id:I,current_iteration:R},P=e===io.SENT?"responded":"dismissed",T="$survey_"+P+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(T="$survey_"+P+"/"+b.id+"/"+b.current_iteration),T)]:!0})}else e===io.SHOWN&&(w.$set=le({},w.$set,{[Gv.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===gN.SHOWN){var L=n==null?void 0:n[cC.TOUR_TYPE];L&&(w.$set=le({},w.$set,{[cC.TOUR_LAST_SEEN_DATE+"/"+L]:new Date().toISOString()}))}var A=le({},w.properties.$set,w.$set);if(Ks(A)||this.setPersonPropertiesForFlags(A),!Qe(this.config.before_send)){var O=this.mn(w);if(!O)return;(w=O).uuid=FE(w.uuid,Ji)}this.da.emit("eventCaptured",w);var D=(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),N={method:"POST",url:D,data:w,compression:"best-available",timestampMode:(r==null?void 0:r._batchKey)==="recordings"||/\/s\/(?:\?|$)/.test(D)?"body":"capture-body",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.Ra(N):this.Ia.enqueue(N),w}ve.critical("This capture call is ignored due to client rate limiting.")}}else ve.error("No event name provided to posthog.capture")}else ve.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(n=>e(n.event,n)))}Da(){var e;return(e=this.ja)!==null&&e!==void 0?e:this.ja=new HN(this)}ca(e){this._a.push(e);var n=!0;return()=>{if(n){n=!1;var r=this._a.indexOf(e);r!==-1&&this._a.splice(r,1)}}}Ga(e){var n,r,s;return e===void 0&&(e=!0),!((n=this.persistence)==null||!n.consumeCookieIdentityChange())&&(this.Sa=null,this.persistence.get_property(st)===fn&&((s=this.sessionPersistence)==null||s.clear(),this.ya.clear(),this.Za()),(r=this.featureFlags)==null||r.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;this.persistence.syncCookieProperties(),this.Ga();var a=i?void 0:this.persistence.remove_event_timer(e),u=le({},n);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.ga()&&(u[mP]=!0),e==="$snapshot"){var c=le({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!ft(u.distinct_id)&&!on(u.distinct_id)||cm(u.distinct_id))&&ve.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,h=(function(I,R,L,A){var O,D,N,F;if(A===void 0&&(A=!1),!Ir)return{};var K,Z=I?[...dc,...R||[]]:[],W=(function(Jt){for(var be=0;DE.length>be;be++){var $e=DE[be],Ge=$e[1],tt=$e[0].exec(Jt),bt=tt&&(dr(Ge)?Ge(tt,Jt):Ge);if(bt)return bt}return["",""]})(Ir),G=W[0],Y=W[1],$=(K=typeof navigator<"u"?navigator:void 0)!=null&&K.brave?{brave:!0}:{},J={};de(L)||(J.detectGoogleSearchApp=L);var H={},j=(O=navigator)==null||(O=O.userAgentData)==null?void 0:O.platform,X=(D=navigator)==null?void 0:D.maxTouchPoints,oe=ne==null||(N=ne.screen)==null?void 0:N.width,se=ne==null||(F=ne.screen)==null?void 0:F.height,ee=ne==null?void 0:ne.devicePixelRatio;de(j)||(H.userAgentDataPlatform=j),de(X)||(H.maxTouchPoints=X),de(oe)||(H.screenWidth=oe),de(se)||(H.screenHeight=se),de(ee)||(H.devicePixelRatio=ee);var ce,we,ue,ie,Ne,Ue,Pe,Ve,ht=St(z2({$os:G,$os_version:Y,$browser:J8(Ir,navigator.vendor,$,J),$device:NE(Ir),$device_type:(we=Ir,ue=H,Ve=NE(we),Ve===D8||Ve===L8||Ve==="Kobo"||Ve==="Kindle Fire"||Ve===q8?oc:Ve===Gd||Ve===Du||Ve===Kd||Ve===Py?"Console":Ve===F8?"Wearable":Ve?rs:(ue==null?void 0:ue.userAgentDataPlatform)==="Android"&&((ie=ue==null?void 0:ue.maxTouchPoints)!==null&&ie!==void 0?ie:0)>0?600>Math.min((Ne=ue==null?void 0:ue.screenWidth)!==null&&Ne!==void 0?Ne:0,(Ue=ue==null?void 0:ue.screenHeight)!==null&&Ue!==void 0?Ue:0)/((Pe=ue==null?void 0:ue.devicePixelRatio)!==null&&Pe!==void 0?Pe:1)?rs:oc:"Desktop"),$timezone:zP(),$timezone_offset:hN()}),{$current_url:Xd(A?ha(jt==null?void 0:jt.href):jt==null?void 0:jt.href,Z,Qd),$host:jt==null?void 0:jt.host,$pathname:jt==null?void 0:jt.pathname,$raw_user_agent:Ir.length>1e3?Ir.substring(0,997)+"...":Ir,$browser_version:dD(Ir,navigator.vendor,$,J),$browser_language:lC(),$browser_language_prefix:(ce=lC(),typeof ce=="string"?ce.split("-")[0]:void 0),$screen_height:ne==null?void 0:ne.screen.height,$screen_width:ne==null?void 0:ne.screen.width,$viewport_height:ne==null?void 0:ne.innerHeight,$viewport_width:ne==null?void 0:ne.innerWidth,$lib:kt.LIB_NAME,$lib_version:kt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return kt.SDK_DIST_CHANNEL&&(ht.$sdk_dist_channel=kt.SDK_DIST_CHANNEL),ht})(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 p=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime(),!0),m=p.windowId;u.$session_id=p.sessionId,u.$window_id=m}this.sessionPropsManager&&St(u,this.sessionPropsManager.getSessionProps());try{var y;this.sessionRecording&&St(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=(y=this.Pa)==null?void 0:y.length}catch(I){u.$sdk_debug_error_capturing_properties=String(I)}if(this.requestRouter.region===t_&&(u.$lib_custom_api_host=this.config.api_host),d=e!==bu||i?e!==Lv||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),u=St(u,d),e===bu&&_e&&(u.title=_e.title),!de(a)){var w=r.getTime()-a;u.$duration=parseFloat((w/1e3).toFixed(3))}Ir&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var _=this.persistence.properties(),x=this.sessionPersistence.properties();yt(["$referrer","$referring_domain"],(I=>{I in _&&delete x[I]}));var b={};if(this._a.length>0)for(var P of this._a.slice())try{St(b,P())}catch(I){ve.error("Failed to produce browser extension event properties",I)}(u=St({},h,_,x,le({},b,u))).$is_identified=this._isIdentified(),Ke(this.config.property_denylist)?yt(this.config.property_denylist,(function(I){delete u[I]})):ve.error(l3+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var T=this.config.sanitize_properties;T&&(ve.error(SC),u=T(u,e));var k=this.Qa();return u.$process_person_profile=k,k&&!i&&this.Ja("_calculate_event_properties"),u}Va(e,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Qa()||this.ma&&!r)return e;var i=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),u=St({},i,a||{},e||{}),c=this.config.sanitize_properties;return c&&(ve.error(SC),u=c(u,"$set_once")),n&&(this.ma=!0),Ks(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,r;(n=this.persistence)==null||n.syncCookieProperties(),this.Ga(),(r=this.sessionPersistence)==null||r.register(e),Object.keys(e).forEach((s=>this.ya.add(s))),this.Za()}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e),this.ya.delete(e),this.Za()}Ka(e,n){this.register({[e]:n})}Aa(){this.ya.forEach((e=>{var n;(n=this.sessionPersistence)==null||n.unregister(e)})),this.ya.clear(),this.Za()}Za(){var e;if(this.ba)if(this.config.persistence==="memory"||(e=this.sessionPersistence)!=null&&e.ws||!Et.Lr())Et.Dr(this.ba);else{var n=[];this.ya.forEach((r=>n.push(r))),n.length>0?Et.Or(this.ba,n):Et.Dr(this.ba)}}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,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,n))!==null&&r!==void 0?r:n==null?void 0:n.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.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.da.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:hd}),()=>{})}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:hd})}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,n):e([],{isLoaded:!1,error:hd})}renderSurvey(e,n){var r;(r=this.surveys)==null||r.renderSurvey(e,n)}displaySurvey(e,n){var r;n===void 0&&(n=DN),(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:hd}}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:hd})}Ya(e){return!e||cm(e)?(ve.critical("Unique user id has not been set in posthog.identify"),!1):e===tp?(ve.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(ve.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,n,r){if(!this.__loaded||!this.persistence)return ve.uninitializedWarning("posthog.identify");if(on(e)&&(e=e.toString(),ve.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Ya(e)&&this.Ja("posthog.identify")){var s=this.get_distinct_id(),i=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,a=this.Ga(!1),u=this.persistence.Ss(),c=!1;try{var d=this.get_distinct_id();this.register({$user_id:e}),this.get_property(qd)||this.register_once({$had_persisted_distinct_id:!0,$device_id:d},""),e!==d&&e!==this.get_property(ku)&&(this.unregister(ku),this.register({distinct_id:e}));var h,p=(this.persistence.get_property(st)||fn)===fn,m=e!==d,y=!m&&p;if(m&&p)this.persistence.set_property(st,Un),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Cs(),this.capture(Dv,{distinct_id:e,$anon_distinct_id:d},{$set:n||{},$set_once:r||{}}),this.Sa=Yv(e,n,r),(h=this.featureFlags)==null||h.setAnonymousDistinctId(d);else if(y){this.persistence.set_property(st,Un);var w=n||{},_=r||{};this.setPersonPropertiesForFlags({$set:w,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.Cs(),this.capture("$set",{$set:w,$set_once:_}),this.Sa=Yv(e,n,r)}else(n||r)&&this.setPersonProperties(n,r);m||i||a?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(ro)):y&&(n||r)&&this.reloadFeatureFlags(),c=!0}finally{u&&this.persistence.Es(c)}}}setPersonProperties(e,n){if((e||n)&&this.Ja("posthog.setPersonProperties")){var r=Yv(this.get_distinct_id(),e,n);this.Sa!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:n||{}},!0),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Sa=r):ve.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var n,r=(Ke(e)?e:[e]).filter((s=>ft(s)&&s.length>0));r.length!==0&&this.Ja("posthog.unsetPersonProperties")&&((n=this.featureFlags)==null||n.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.Sa=null)}group(e,n,r){var s;if(e&&n){(s=this.persistence)==null||s.syncCookieProperties(),this.Ga();var i=this.getGroups(),a=i[e]!==n;if(a&&this.resetGroupPropertiesForFlags(e),this.register({$groups:le({},i,{[e]:n})}),a||r){var u={$group_type:e,$group_key:n};r&&(u.$group_set=r),this.capture(UE,u)}r&&this.setGroupPropertiesForFlags({[e]:r}),a&&!r&&this.reloadFeatureFlags()}else ve.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.Ja("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=Qr(e)?e:e==null?void 0:e.resetDeviceID,r=Qr(e)||e==null?void 0:e.bootstrap;this.Xa(n,!1,r)}Xa(e,n,r){var s,i,a;if(n===void 0&&(n=!1),ve.info("reset"),!this.__loaded)return ve.uninitializedWarning("posthog.reset");var u=r==null?void 0:r.sessionID;this.config.bootstrap=r||((s=this.Ta)==null?void 0:s.bootstrap)||{},(i=this.featureFlags)==null||i.updateConfig==null||i.updateConfig(this.config,this.Js());var c=this.get_property(qd),d=this.get_property(Ov),h=this.get_property(cl),p=this.is_capturing();this.consent.reset(),n||!p||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var m=(a=this.persistence)==null||a.Ss==null?void 0:a.Ss(),y=!1;try{var w,_,x,b,P,T,k,I,R,L,A,O,D,N;if((w=this.persistence)==null||w.clear(),(_=this.sessionPersistence)==null||_.clear(),this.ya.clear(),this.Za(),de(h)||(A=this.persistence)==null||A.register({[cl]:h}),(x=this.surveys)==null||x.reset(),(b=this.za)==null||b.stop(),(P=this.featureFlags)==null||P.reset(),(T=this.conversations)==null||T.reset(),(k=this.logs)==null||k.reset(),(I=this.metrics)==null||I.reset(),(R=this.persistence)==null||R.set_property(st,fn),(L=this.sessionManager)==null||L.resetSessionId(),this.Sa=null,this.config.cookieless_mode===so)this.register_once({distinct_id:tp,$device_id:null},"");else{var F=this.config.get_device_id(Ji());this.register_once({distinct_id:F,$device_id:e?F:c},""),e||de(d)||this.register({[Ov]:d})}if(this.register({$last_posthog_reset:new Date().toISOString()},1),r&&(r.distinctID===void 0||this.ga()||((N=this.persistence)==null||N.set_property(st,r.isIdentifiedID?Un:fn),this.register({distinct_id:r.distinctID})),(O=this.featureFlags)==null||O.initialize(),!(de(u)||(D=this.sessionManager)!=null&&D.setBootstrapSessionId(u,!0)))){var K=le({},r);delete K.sessionID,this.config.bootstrap=K}delete this.config.identity_distinct_id,delete this.config.identity_hash,y=!0}finally{var Z;m&&((Z=this.persistence)==null||Z.Es==null||Z.Es(y))}this.reloadFeatureFlags()}shutdown(e){var n=this;return Pt((function*(){var r,s,i,a,u,c,d;if(n.__loaded){(r=n.za)==null||r.stop(),(s=n.ja)==null||s.dispose(),(i=n.sessionRecording)==null||i.dispose(),(a=n.logs)==null||a.flushLogs("sendBeacon"),(u=n.metrics)==null||u.flush("sendBeacon"),(c=n.Ia)==null||c.unload(),(d=n.Pa)==null||d.unload();try{var h;(h=n.featureFlags)==null||h.destroy()}catch(p){ve.error("Error while destroying feature flags",p)}}else ve.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.tl()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.el()}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 n=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n.sessionId);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(lP)?(ve.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ja("posthog.alias")?(de(n)&&(n=this.get_distinct_id()),e!==n?(this.Ka(ku,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(ve.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=le({},this.config);if(It(e)){var r,s,i,a,u,c,d,h,p,m,y,w;St(this.config,EC(e));var _=this.Ea();(r=this.persistence)==null||r.update_config(this.config,n,_),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Uv(le({},this.config,{persistence:"sessionStorage"}),_,!1);var x=this.Ca(this.config.debug);Qr(x)&&(this.config.debug=x),Qr(this.config.debug)&&(this.config.debug?(kt.DEBUG=!0,wt.Lr()&&wt.Or("ph_debug",!0),ve.info("set_config",{config:e,oldConfig:n,newConfig:le({},this.config)})):(kt.DEBUG=!1,wt.Lr()&&wt.Dr("ph_debug"))),(s=this.featureFlags)==null||s.updateConfig==null||s.updateConfig(this.config,this.Js()),(i=this.exceptionObserver)==null||i.onConfigChange(),(a=this.exceptions)==null||a.onConfigChange(),(u=this.sessionRecording)==null||u.startIfEnabledOrStop(),(c=this.tracingHeaders)==null||c.startIfEnabledOrStop(),(d=this.autocapture)==null||d.startIfEnabled(),(h=this.heatmaps)==null||h.startIfEnabled(),(p=this.exceptionObserver)==null||p.startIfEnabledOrStop(),(m=this.deadClicksAutocapture)==null||m.startIfEnabledOrStop(),(y=this.surveys)==null||y.loadIfEnabled(),this.il(),(w=this.externalIntegrations)==null||w.startIfEnabledOrStop()}}_overrideSDKInfo(e,n){kt.LIB_NAME=e,kt.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(le({},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:Yr.rl}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:Su;return n!==Su&&(n=Su+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(st))===Un||((n=this.sessionPersistence)==null?void 0:n.get_property(st))===Un}Qa(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===Wy&&!this._isIdentified()&&Ks(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ku])&&((n=this.persistence)==null||(n=n.props)==null||!n[Em]))}Ua(){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.Qa()||this.Ja("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ja("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ja(e){return this.config.person_profiles==="never"?(ve.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ka(Em,!0),!0)}Ea(){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!==il)}il(){var e,n,r,s,i=this.Ea();return((e=this.persistence)==null?void 0:e.ws)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.ws)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i&&(this.ya.clear(),this.Za()),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!==so){if(this.ga()){var r,s,i,a,u;this.Xa(!0,!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new _C(this),this.pageViewManager=new aC(this),this.persistence&&(this.sessionPropsManager=new vC(this,this.sessionManager,this.persistence));var c,d=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(u=Yr.__defaultExtensionClasses)==null?void 0:u.sessionRecording;d&&(this.sessionRecording=this.pa(this.sessionRecording,new d(this)),this.ha&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.ha)))}var h,p;this.consent.optInOut(!0),this.il(),this.Ba(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==il&&((h=this.surveys)==null||h.loadIfEnabled()),(de(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.Ha()}else ve.warn(bC)}opt_out_capturing(){var e,n,r;this.config.cookieless_mode!==so?(this.config.cookieless_mode===il&&this.consent.isOptedIn()&&this.Xa(!0,!0),this.consent.optInOut(!1),this.il(),this.config.cookieless_mode===il&&(this.register({distinct_id:tp,$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.Ha(),this.Ba())):ve.warn(bC)}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===so||(this.config.cookieless_mode===il?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.il()}_is_bot(){return hr?t3(hr,this.config.custom_blocked_useragents):void 0}Ha(){_e&&(_e.visibilityState==="visible"?this.wa||(this.wa=!0,this.capture(bu,{title:_e.title},{send_instantly:!0}),this.ka&&(_e.removeEventListener(Cm,this.ka),this.ka=null)):this.ka||(this.ka=this.Ha.bind(this),Vt(_e,Cm,this.ka)))}debug(e){e===!1?(ne==null||ne.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ne==null||ne.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}))}Js(){var e=this.Ta||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ve.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(function(n,r,s,i,a){var u=r in n&&!Qe(n[r]),c=s in n&&!Qe(n[s]);return u?n[r]:!!c&&(a&&a.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),n[s])})(e,"advanced_disable_flags","advanced_disable_decide",0,ve)}mn(e){var n;if(Qe(this.config.before_send))return e;var r=Object.keys((n=e.properties)!==null&&n!==void 0?n:{}).filter(JL),s=Ke(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var a of s)try{if(i=a(i),Qe(i)){var u="Event '"+e.event+"' was rejected in beforeSend function";return QL(e.event)?ve.warn(u+". This can cause unexpected behavior."):ve.info(u),null}i.properties&&!Ks(i.properties)||ve.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(d){return ve.error("Error in beforeSend function for event '"+e.event+"':",d),null}for(var c of r)if(i.properties&&Qe(i.properties[c]))return ve.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.Xn)==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)})}Ca(e){var n=Qr(e)&&!e,r=wt.Lr()&&wt.Fr("ph_debug")==="true";return!n&&(!!r||e)}}Yr.__defaultExtensionClasses={},Yr.rl=(()=>{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]]=$D(t.prototype[e[n]])})(Yr,["identify"]);class CC{constructor(e){this.disabled=e===!1;var n=It(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 Jv="$copy_autocapture",e1=Lt("[AutoCapture]");function t1(t,e){return e.length>t?e.slice(0,t)+"...":e}function WN(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!pa(e));return e}function GN(t,e){var n,r,s=e.e,i=e.maskAllElementAttributes,a=e.maskAllText,u=e.elementAttributeIgnoreList,c=e.elementsChainAsString,d=e.disableCaptureUrlHashes;if(!pa(t))return{props:{}};for(var h=[t],p=new Set([t]),m=t;m.parentNode&&!es(m,"body")&&CP>h.length;)if(EP(m.parentNode)){var y=m.parentNode.host;if(p.has(y))break;p.add(y),h.push(y),m=y}else{if(!pa(m.parentNode)||p.has(m.parentNode))break;p.add(m.parentNode),h.push(m.parentNode),m=m.parentNode}var w,_,x=[],b={},P=!1,T=!1;if(yt(h,(A=>{var O=qy(A);if(es(A,"a")){var D=A.getAttribute("href");P=!!(O&&D&&Rd(D))&&(d?ha(D):D)}Ze(Im(A),"ph-no-capture")&&(T=!0),x.push((function(F,K,Z,W,G){G===void 0&&(G=!1);var Y=F.tagName.toLowerCase(),$={tag_name:Y};U2.indexOf(Y)>-1&&!Z&&($.$el_text=Y.toLowerCase()==="a"||Y.toLowerCase()==="button"?t1(1024,sC(F)):t1(1024,Yd(F)));var J=Im(F);J.length>0&&($.classes=J.filter((function(oe){return oe!==""}))),yt(F.attributes,(function(oe){var se;if((!AP(F)||["name","id","class","aria-label"].indexOf(oe.name)!==-1)&&(W==null||!W.includes(oe.name))&&!K&&Rd(oe.value)&&(!ft(se=oe.name)||se.substring(0,10)!=="_ngcontent"&&se.substring(0,7)!=="_nghost")){var ee=oe.value;oe.name==="class"&&(ee=B2(ee).join(" ")),$["attr__"+oe.name]=t1(1024,oe.name==="href"&&G?ha(ee):ee)}}));for(var H=1,j=1,X=F;X=WN(X);)H++,X.tagName===F.tagName&&j++;return $.nth_child=H,$.nth_of_type=j,$})(A,i,a,u,d));var N=(function(F){if(!qy(F))return{};var K={};return yt(F.attributes,(function(Z){if(Z.name&&Z.name.indexOf("data-ph-capture-attribute")===0){var W=Z.name.replace("data-ph-capture-attribute-",""),G=Z.value;W&&G&&Rd(G)&&(K[W]=G)}})),K})(A);St(b,N)})),T)return{props:{},explicitNoCapture:T};if(a||(x[0].$el_text=es(t,"a")||es(t,"button")?sC(t):Yd(t)),P){var k,I;x[0].attr__href=P;var R=(k=uc(P))==null?void 0:k.host,L=ne==null||(I=ne.location)==null?void 0:I.host;R&&L&&R!==L&&(w=P)}return{props:St({$event_type:s.type,$ce_version:1},c?{}:{$elements:x},{$elements_chain:(_=x,(function(A){return A.map((O=>{var D,N,F="";if(O.tag_name&&(F+=O.tag_name),O.attr_class)for(var K of(O.attr_class.sort(),O.attr_class))F+="."+K.replace(/"/g,"");var Z=le({},O.text?{text:O.text}:{},{"nth-child":(D=O.nth_child)!==null&&D!==void 0?D:0,"nth-of-type":(N=O.nth_of_type)!==null&&N!==void 0?N:0},O.href?{href:O.href}:{},O.attr_id?{attr_id:O.attr_id}:{},O.attributes),W={};return jp(Z).sort(((G,Y)=>G[0].localeCompare(Y[0]))).forEach((G=>{var Y=G[1];return W[iC(G[0].toString())]=iC(Y.toString())})),(F+=":")+jp(W).map((G=>G[0]+'="'+G[1]+'"')).join("")})).join(";")})((function(A){return A.map((O=>{var D,N,F={text:(D=O.$el_text)==null?void 0:D.slice(0,400),tag_name:O.tag_name,href:(N=O.attr__href)==null?void 0:N.slice(0,2048),attr_class:iN(O),attr_id:O.attr__id,nth_child:O.nth_child,nth_of_type:O.nth_of_type,attributes:{}};return jp(O).filter((K=>K[0].indexOf("attr__")===0)).forEach((K=>F.attributes[K[0]]=K[1])),F}))})(_)))},(n=x[0])!=null&&n.$el_text?{$el_text:(r=x[0])==null?void 0:r.$el_text}:{},w&&s.type==="click"?{$external_click_url:w}:{},b)}}var pd=Lt("[ExceptionAutocapture]"),kC=()=>{},KN=Lt("[TracingHeaders]"),Ga=Lt("[Web Vitals]"),PC=9e5,TC="disabled",IC="lazy_loading",md="awaiting_config",up="missing_config";Lt("[SessionRecording]"),Lt("[SessionRecording]");var n_="[SessionRecording]",Hi=Lt(n_),qN=Lt("[Heatmaps]");function n1(t){return It(t)&&"clientX"in t&&"clientY"in t&&on(t.clientX)&&on(t.clientY)}var cp=Lt("[Product Tours]"),r1=t=>{var e;return!t.config.disable_product_tours&&!((e=t.persistence)==null||!e.get_property(V2))},ZN=["$set_once","$set"],ri=Lt("[SiteApps]"),AC="Error while initializing PostHog app with config id ";function mu(t,e,n){if(Qe(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 YN{constructor(e){this.nl=new q2,this.sl=(n,r)=>this.ol(n,r)&&this.al(n,r)&&this.ll(n,r)&&this.ul(n,r),this.ol=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=e,this.hl=new Set,this.dl=new Set}init(){var e,n;de((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(!de((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach((a=>{var u,c;(u=this.dl)==null||u.add(a),(c=a.steps)==null||c.forEach((d=>{var h;(h=this.hl)==null||h.add((d==null?void 0:d.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.hl.has(e)||this.hl.has(n.event))&&this.dl&&((r=this.dl)==null?void 0:r.size)>0&&this.dl.forEach((s=>{this.vl(n,s)&&this.nl.emit("actionCaptured",s.name)}))}cl(e){this.onAction("actionCaptured",(n=>e(n)))}vl(e,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.sl(e,r))return!0;return!1}onAction(e,n){return this.nl.on(e,n)}al(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"||!mu(s,n.url,n.url_matching||"contains"))return!1}return!0}ll(e,n){return!!this.fl(e,n)&&!!this.pl(e,n)&&!!this.gl(e,n)}fl(e,n){var r;if(n==null||!n.href)return!0;var s=this.ml(e);if(s.length>0)return s.some((u=>mu(u.href,n.href,n.href_matching||"exact")));var i,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&mu((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}pl(e,n){var r;if(n==null||!n.text)return!0;var s=this.ml(e);if(s.length>0)return s.some((d=>mu(d.text,n.text,n.text_matching||"exact")||mu(d.$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(d){for(var h,p=[],m=/(?::|")text="(.*?)"/g;!Qe(h=m.exec(d));)p.includes(h[1])||p.push(h[1]);return p})(c),a=n.text,u=n.text_matching||"exact",i.some((d=>mu(d,a,u))))}gl(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}ml(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e==null?void 0:e.properties.$elements}ul(e,n){return n==null||!n.properties||n.properties.length===0||s3(n.properties.reduce(((r,s)=>{var i=Ke(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 XN{constructor(e){var n;this.yl=[],this._instance=e,this.bl=new Map,this._l=new Map,this.wl=new Map,(n=this._instance)==null||n.onSessionId==null||n.onSessionId((r=>this.kl(r)))}xl(e){return!1}Sl(){return null}Cl(e){}Tl(){}Ml(e,n){return!!e&&s3(e.propertyFilters,n==null?void 0:n.properties)}El(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}Il(e,n,r){var s=(r===cd.Activation?this.bl:this._l).get(e),i=[];return this.Rl((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((d=>d.name===e));return this.Ml(c,n)}))}register(e){var n;de((n=this._instance)==null?void 0:n._addCaptureHook)||(this.Pl(e),this.Al(e))}Al(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.Fl==null&&(this.Fl=new YN(this._instance),this.Fl.init(),this.Fl.cl((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.Fl)==null||u.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((d=>{if(d&&d.name){var h=this.wl.get(d.name);h&&h.push(r.id),this.wl.set(d.name,h||[r.id])}})))})))}Pl(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.bl=this.El(e,cd.Activation),this._l=this.El(e,cd.Cancellation))}onEvent(e,n){var r,s,i=this.Ol(),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.Ll(e,a);if(u==="consume")return i.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.$l([a]);if(u==="persist")return i.info("shown item promoted to persisted activation",{event:e,itemId:a}),this.Dl(a),void this.Nl([a])}if(this._l.has(e)){var c=this.Il(e,n,cd.Cancellation);c.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:c.map((h=>h.id))}),this.$l(c.map((h=>h.id))),c.forEach((h=>this.ql(h.id))))}if(this.bl.has(e)){i.info("event name matched",{event:e,eventPayload:n,items:this.bl.get(e)});var d=this.Il(e,n,cd.Activation);this.jl(d.map((h=>h.id)))}}onAction(e){this.wl.has(e)&&this.jl(this.wl.get(e)||[])}jl(e){var n;if(e.length!==0){var r=!((n=this._instance)==null||n.get_session_id==null||!n.get_session_id()),s=[];for(var i of e)r&&this.xl(i)?this.Dl(i)&&this.Bl(i):s.push(i);s.length>0&&(this.yl=[...new Set([...this.yl,...s])]),this.Ol().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Dl(e){this.yl=this.yl.filter((r=>r!==e));var n=this.Hl();return!n.includes(e)&&(this.zl([...n,e]),this.Ul(),!0)}$l(e){var n=new Set(e);this.yl=this.yl.filter((i=>!n.has(i)));var r=this.Wl(),s=r.filter((i=>!n.has(i)));s.length!==r.length&&(this.zl(s),s.length===0&&this.Vl()),this.Nl(e)}Gl(){var e,n=this.Sl();if(!n)return{};var r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return r&&typeof r=="object"?r:{}}Bl(e){if(this.Sl()){var n=this.Gl();this.Cl(le({},n,{[e]:Date.now()}))}}Nl(e){if(this.Sl()){var n=this.Gl(),r={},s=!1;for(var i of Object.entries(n)){var a=i[0],u=i[1];e.includes(a)?s=!0:r[a]=u}s&&(Ks(r)?this.Tl():this.Cl(r))}}Zl(){this.Sl()&&this.Tl()}getActivationTimestamp(e){if(this.Hl().includes(e)){var n=this.Gl()[e];return on(n)?n:void 0}}Wl(){var e,n=this.Ql();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n])||[]}Hl(){var e,n,r=this.Wl();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this.Jl()],i=(n=this._instance)==null||n.get_session_id==null?void 0:n.get_session_id();return i&&s===i?r:[]}Ul(){var e,n=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();n&&this.Kl(n)}Vl(){this.Yl()}kl(e){var n,r=(n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[this.Jl()];if(r&&r!==e){var s=this.Wl(),i=this.Gl();s.length>0&&(this.zl([]),s.filter((a=>on(i[a]))).forEach((a=>this.ql(a)))),this.Vl(),this.Zl()}}getActivatedIds(){return[...new Set([...this.Hl(),...this.yl])].filter((e=>!this.Xl(e)))}reset(){this.yl=[],this.Wl().length>0&&this.zl([]),this.Vl(),this.Zl()}getEventToItemsMap(){return this.bl}tu(){return this.Fl}}class QN extends XN{constructor(e){super(e)}Ql(){return Vy}Jl(){return Np}Sl(){return Fp}Cl(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Fp]:e})}Tl(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Fp)}xl(e){var n,r;this.Rl((i=>{r=i.find((a=>a.id===e))}));var s=(n=r)==null||(n=n.appearance)==null?void 0:n.surveyPopupDelaySeconds;return on(s)&&s>0}eu(){return io.SHOWN}Rl(e){var n;(n=this._instance)==null||n.getSurveys(e)}ql(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}Ol(){return _t}zl(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Vy]:e})}Kl(e){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Np]:e})}Yl(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Np)}Xl(){return!1}Ll(e,n){var r;this.Rl((i=>{r=i.find((a=>a.id===n))}));var s=!r||(function(i){var a;return i3(i)&&!((a=i.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||i.schedule==="always"})(r);return s?e===io.SHOWN?"consume":"ignore":e===io.SHOWN?"persist":e===io.DISMISSED||e===io.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var dp="SDK is not enabled or survey functionality is not yet loaded",RC="Disabled. Not loading surveys.",JN=ne!=null&&ne.location?Am(ne.location.hash,"__posthog")||Am(location.hash,"state"):null,MC="_postHogToolbarParams",OC=Lt("[Toolbar]"),LC=Lt("[FeatureFlags]");class e9{constructor(e,n){n===void 0&&(n=!1),this.iu=!1,this.update(e,n)}update(e,n){this.ru=((r,s)=>{var i,a,u,c;return{bootstrap:{featureFlags:(i=r.bootstrap)==null?void 0:i.featureFlags,featureFlagPayloads:(a=r.bootstrap)==null?void 0:a.featureFlagPayloads},remoteRequestsDisabled:s,featureFlagsDisabled:!!r.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!r.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!r.advanced_feature_flags_dedup_per_session,cacheTtlMs:r.feature_flag_cache_ttl_ms,requestTimeoutMs:r.feature_flag_request_timeout_ms,compression:r.disable_compression?"none":"base64",evaluationContexts:(u=(c=r.evaluation_contexts)!==null&&c!==void 0?c:r.evaluation_environments)!==null&&u!==void 0?u:[],flagKeys:Ke(r.flag_keys)?r.flag_keys:void 0}})(e,n),!e.evaluation_environments||e.evaluation_contexts||this.iu||(LC.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.iu=!0),de(e.flag_keys)||Ke(e.flag_keys)||LC.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.ru}}var DC=Lt("[FeatureFlags]"),Ka=Lt("[FeatureFlags]",{debugEnabled:!0}),s1=`" failed. Feature flags didn't load in time.`,NC="connection_error",FC=t=>{for(var e={},n=0;t.length>n;n++)e[t[n]]=!0;return e},jC=t=>{var e={};for(var n of jp(t||{})){var r=n[1];r&&(e[n[0]]=r)}return e},si=Lt("[Error tracking]"),t9=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],VC="Refusing to render web experiment since the viewer is a likely bot",n9={icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>Om(e,t),not_regex:(t,e)=>!Om(e,t),exact:(t,e)=>e===t,is_not:(t,e)=>e!==t};class er{get Oi(){return this._instance.config}constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{er.nu("retrieved web experiments from the server"),n.su=new Map,s.forEach((i=>{if(i.feature_flag_key){var a;n.su&&(er.nu("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.su)==null||a.set(i.feature_flag_key,i));var u=n._instance.getFeatureFlag(i.feature_flag_key);ft(u)&&i.variants[u]&&n.ou(i.name,u,i.variants[u].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];er.au(d,n._instance)&&n.ou(i.name,c,d.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())er.nu(VC);else if(!this.Oi.disable_web_experiments){if(Qe(this.su))return this.su=new Map,this.loadIfEnabled(),void this.previewWebExperiment();er.nu("applying feature flags",e),e.forEach((n=>{var r;if(this.su&&(r=this.su)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),a=(s=this.su)==null?void 0:s.get(n);i&&a!=null&&a.variants[i]&&this.ou(a.name,i,a.variants[i].transforms)}}))}}previewWebExperiment(){var e=er.getWindowLocation();if(e!=null&&e.search){var n=cc(e==null?void 0:e.search,"__experiment_id"),r=cc(e==null?void 0:e.search,"__experiment_variant");n&&r&&(er.nu("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.lu(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Oi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this.Oi.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.Oi.token),method:"GET",timestampMode:"query",callback:i=>e(i.statusCode===200&&i.json&&i.json.experiments||[])})}lu(e,n,r){var s=r.filter((i=>i.id===e));s&&s.length>0&&(er.nu("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.ou(s[0].name,n,s[0].variants[n].transforms))}static au(e,n){return!Qe(e.conditions)&&er.uu(e,n)&&er.hu(e)}static uu(e,n){var r;if(Qe(e.conditions)||Qe((r=e.conditions)==null?void 0:r.url))return!0;var s=er.getWindowLocation();if(s){var i,a,u,c=xP(n,s.href);return(i=e.conditions)==null||!i.url||n9[(a=(u=e.conditions)==null?void 0:u.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,c)}return!1}static getWindowLocation(){return ne==null?void 0:ne.location}static hu(e){var n;if(Qe(e.conditions)||Qe((n=e.conditions)==null?void 0:n.utm))return!0;var r=NP();if(r.utm_source){var s,i,a,u,c,d,h,p,m=(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,w=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.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 m&&w&&_&&y}return!1}static nu(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];ve.info("[WebExperiments] "+e,r)}ou(e,n,r){this._is_bot()?er.nu(VC):n!=="control"?r.forEach((s=>{if(s.selector){var i;er.nu("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)}))}})):er.nu("Control variants leave the page unmodified.")}_is_bot(){return hr&&this._instance?t3(hr,this.Oi.custom_blocked_useragents):void 0}}var ws=Lt("[Conversations]"),qa="Conversations not available yet.",$C="console",c3="__posthogHandledLogsRequestError",i1=(t,e)=>{var n=t instanceof Error?t:new Error(e);return n[c3]=!0,n},HC=t=>!!t&&typeof t=="object"&&t[c3]===!0,m0={featureFlags:class{constructor(t){this.name="featureFlags",this.du=!1,this.featureFlagEventHandlers=[],this.I=DC,this.vu={},this.cu={},this.fu=[],this.pu=!1,this.gu=!1,this.mu=0,this.yu=!1,this.bu=!1,this._u=!1,this.wu=!1,this.ku=0,this.Tt=()=>{var e=this.xu();this.ku=0,e&&this.reloadFeatureFlags()},"get"in t?this.Su=t:(this.Cu=new e9(t.config,t.Js()),this.Su=this.Cu)}updateConfig(t,e){var n;(n=this.Cu)==null||n.update(t,e)}setup(t){return this.Tu=t,this.I=t.logger.createLogger("[FeatureFlags]"),n=()=>{this.Tu===t&&(this.Tu=void 0,this.sa=t,this.Mu(t))},(e=t.kv.initialize())!=null&&e.then?e.then(n):n();var e,n}Mu(t){if(this.sa===t)return ne&&Vt(ne,"online",this.Tt),this.Eu=t.registerDynamicEventProperties((()=>this.Iu()?this.vu:this.cu)),this.Ru(),this.initialize()}destroy(){ne==null||ne.removeEventListener("online",this.Tt)}dispose(){var t;this.mu++,this.bu=!1,this.Tu=void 0,this.sa&&(this.Pu(),(t=this.Eu)==null||t.dispose(),this.Eu=void 0,this.fu=[],ne==null||ne.removeEventListener("online",this.Tt),this.sa=void 0)}get Oi(){return this.Su.get()}Au(t){var e;return(e=this.sa)==null?void 0:e.kv.get(t)}Or(t){this.Fu((()=>{var e;return(e=this.sa)==null?void 0:e.kv.set(t)}))}Dr(t){this.Fu((()=>{var e;return(e=this.sa)==null?void 0:e.kv.remove(t)}))}Fu(t){try{t()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}Ru(){var t={};for(var e of[dl,fl,Nu,li]){var n=this.Au(e);de(n)||(t[e]=n)}this.vu=t;var r=le({},t),s=this.Au(Qi);if(s)for(var i of Object.entries(s))r["$feature/"+i[0]]=i[1];this.cu=r}Iu(){var t=this.Oi.cacheTtlMs;if(!t||0>=t)return!1;var e=this.Au(kl);return typeof e!="number"||Date.now()-e>t}Ou(){return!!this.Iu()&&(this.wu||this.gu||(this.wu=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Lu(){var t=this.Oi.evaluationContexts;return t!=null&&t.length?t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),n})):[]}$u(){var t=this.Oi.flagKeys;if(!de(t))return t.filter((e=>{var n=e&&typeof e=="string"&&e.trim().length>0;return n||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),n}))}initialize(){var t,e,n=this.Oi,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((d=>!!r[d])).reduce(((d,h)=>(d[h]=r[h]||!1,d)),{}),c=Object.keys(a).filter((d=>u[d])).reduce(((d,h)=>(d[h]=a[h],d)),{});return this.Du({featureFlags:u,featureFlagPayloads:c})}}updateFlags(t,e,n){var r,s,i=n!=null&&n.merge&&(r=this.Au(Qi))!==null&&r!==void 0?r:{},a=n!=null&&n.merge&&(s=this.Au(fl))!==null&&s!==void 0?s:{},u=le({},i,t),c=le({},a,e),d={};for(var h of Object.entries(u)){var p=h[0],m=h[1];d[p]={key:p,enabled:TE(m),variant:IE(m),reason:void 0,metadata:de(c==null?void 0:c[p])?void 0:{id:0,version:void 0,description:void 0,payload:c[p]}}}this.Du({flags:d})}get hasLoadedFlags(){return this.pu}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.Au(Zd),e=this.Au(li),n=this.Au(sl);if(!n&&!e)return t||{};var r=St({},t||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(e||{})])];for(var i of s){var a,u,c=r[i],d=e==null?void 0:e[i],h=de(d)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!d,p=de(d)?c==null?void 0:c.variant:typeof d=="string"?d:void 0,m=n==null?void 0:n[i],y=le({},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),m&&(y.metadata=le({},c==null?void 0:c.metadata,{payload:m,original_payload:c==null||(u=c.metadata)==null?void 0:u.payload})),r[i]=y}return this.du||(this.I.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:n,finalDetails:r}),this.du=!0),r}getAllFeatureFlags(){var t=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(t).map((n=>{var r=t[n];return{key:n,enabled:TE(r),variant:IE(r),payload:PE(e[n])}}))}getFlagVariants(){var t=this.Au(Qi),e=this.Au(li);if(!e)return t||{};for(var n=St({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.du||(this.I.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:n}),this.du=!0),n}getFlagPayloads(){var t=this.Au(fl),e=this.Au(sl);if(!e)return t||{};for(var n=St({},t||{}),r=Object.keys(e),s=0;r.length>s;s++)n[r[s]]=e[r[s]];return this.du||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:n}),this.du=!0),n}reloadFeatureFlags(){this.yu||this.Oi.featureFlagsDisabled||this.xu()||this.Nu||(this.fu.slice().forEach((t=>{try{t()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}})),this.Nu=setTimeout((()=>{this.qu()}),5))}Pu(){clearTimeout(this.Nu),this.Nu=void 0}onReloading(t){return this.fu.push(t),()=>{this.fu=this.fu.filter((e=>e!==t))}}ensureFlagsLoaded(){this.pu||this.gu||this.Nu||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.yu=t}resetFlagCallReported(){this.Dr(ro)}qu(t){this.Pu();var e=this.sa;if(e&&!this.Oi.remoteRequestsDisabled&&!this.xu())if(this.gu)this.bu=!0;else{var n={token:e.projectToken,distinct_id:e.distinctId,groups:e.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:le({},e.initialPersonProperties,this.Au(Us)||{},{$lib:e.library.name,$lib_version:e.library.version}),group_properties:this.Au(mi),timezone:zP()};de(e.deviceId)||(n.$device_id=e.deviceId),(t!=null&&t.disableFlags||this.Oi.featureFlagsDisabled)&&(n.disable_flags=!0);var r=this.Lu();r.length&&(n.evaluation_contexts=r);var s=this.$u();de(s)||(n.flag_keys=s);var i=this.Oi.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(i?"&only_evaluate_survey_feature_flags=true":""),u=this.mu;this.gu=!0;var c=()=>{this.bu&&(this.bu=!1,this.qu())},d=h=>{this.gu=!1,u===this.mu&&(this.Or({[Fu]:[NC]}),this.I.error("Feature flag request failed",h)),c()};try{e.sendRequest(a,{target:"flags",method:"POST",body:n,compression:this.Oi.compression==="base64"?fr.Base64:void 0,sentAt:"body",timeoutMs:this.Oi.requestTimeoutMs}).then((h=>{var p,m,y=(p=h.json)!==null&&p!==void 0?p:{},w=h.statusCode!==200;if(this.gu=!1,u===this.mu){if(this.ju(h.statusCode),w||this.bu||(this.$anon_distinct_id=void 0),!n.disable_flags||this.bu){this._u=!w;var _=[];h.error?_.push(h.error instanceof Error&&h.error.name==="AbortError"?"timeout":h.error instanceof Error?NC:"unknown_error"):h.statusCode!==200&&_.push("api_error_"+h.statusCode),y.errorsWhileComputingFlags&&_.push("errors_while_computing_flags");var x=!((m=y.quotaLimited)==null||!m.includes("feature_flags"));x&&_.push("quota_limited"),this.Or({[Fu]:_}),x?this.I.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):n.disable_flags||this.Du(y,w,{partialResponse:i}),c()}}else c()})).catch(d)}catch(h){d(h)}}}xu(){return LP(this.ku,3)}ju(t){this.ku=DP(t,this.ku,3,(()=>this.I.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._u)if(this.pu||this.getFlags()&&this.getFlags().length>0){if(!this.Ou()){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 this.I.warn('getFeatureFlag for key "'+t+s1)}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._u)if(this.pu||this.getFlags()&&this.getFlags().length>0){if(!this.Ou()){var n,r=this.getFlagVariants(),s=t in r,i=r[t],a=this.getFlagPayloads()[t],u=String(i),c=this.Au(Nu)||void 0,d=this.Au(kl)||void 0,h=this.Au(ro)||{};if(this.Oi.deduplicateCallsPerSession){var p,m=(p=this.sa)==null?void 0:p.session.sessionId,y=this.Au(Cd);m&&m!==y&&(h={},n=m)}if(e.send_event||!("send_event"in e))if(t in h&&h[t].includes(u))n&&this.Or({[ro]:h,[Cd]:n});else{var w,_,x,b,P,T,k,I,R,L,A,O;Ke(h[t])?h[t].push(u):h[t]=[u],this.Or(le({[ro]:h},n?{[Cd]:n}:{}));var D=this.getFeatureFlagDetails(t),N=[...(w=this.Au(Fu))!==null&&w!==void 0?w:[]];de(i)&&N.push("flag_missing");var F={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:a??null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:(_=(x=this.Oi.bootstrap)==null||(x=x.featureFlags)==null?void 0:x[t])!==null&&_!==void 0?_:null,$feature_flag_bootstrapped_payload:(b=(P=this.Oi.bootstrap)==null||(P=P.featureFlagPayloads)==null?void 0:P[t])!==null&&b!==void 0?b:null,$used_bootstrap_value:!this._u};de(D==null||(T=D.metadata)==null?void 0:T.has_experiment)||(F.$feature_flag_has_experiment=D.metadata.has_experiment),de(D==null||(k=D.metadata)==null?void 0:k.version)||(F.$feature_flag_version=D.metadata.version);var K,Z=(I=D==null||(R=D.reason)==null?void 0:R.description)!==null&&I!==void 0?I:D==null||(L=D.reason)==null?void 0:L.code;Z&&(F.$feature_flag_reason=Z),D!=null&&(A=D.metadata)!=null&&A.id&&(F.$feature_flag_id=D.metadata.id),de(D==null?void 0:D.original_variant)&&de(D==null?void 0:D.original_enabled)||(F.$feature_flag_original_response=de(D.original_variant)?D.original_enabled:D.original_variant),D!=null&&(O=D.metadata)!=null&&O.original_payload&&(F.$feature_flag_original_payload=D==null||(K=D.metadata)==null?void 0:K.original_payload),N.length&&(F.$feature_flag_error=N.join(",")),this.Bu(F)}else n&&this.Or({[ro]:h,[Cd]:n});if(s)return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:PE(a)}}}else this.I.warn('getFeatureFlagResult for key "'+t+s1)}Bu(t){try{var e;(e=this.sa)==null||e.capture("$feature_flag_called",t).catch((n=>{this.I.error("Failed to capture feature flag call",n)}))}catch(n){this.I.error("Failed to capture feature flag call",n)}}getRemoteConfigPayload(t,e){this.Hu(t,e)}Hu(t,e){var n=this;return Pt((function*(){var r=n.sa;if(r){var s={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},i=n.Lu();i.length&&(s.evaluation_contexts=i);var a,u=n.$u();de(u)||(s.flag_keys=u);try{var c,d=(c=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:s,compression:n.Oi.compression==="base64"?fr.Base64:void 0,sentAt:"body",timeoutMs:n.Oi.requestTimeoutMs})).json)==null?void 0:c.featureFlagPayloads;a=(d==null?void 0:d[t])||void 0}catch(h){return void n.I.error("Remote config feature flag request failed",h)}try{e(a)}catch(h){n.I.error("Remote config feature flag callback failed",h)}}}))()}isFeatureEnabled(t,e){if(e===void 0&&(e={}),e.fresh&&!this._u)return e.defaultValue;if(!(this.pu||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+t+s1),e.defaultValue;var n=this.getFeatureFlag(t,e);return de(n)?e.defaultValue:!!n}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==t))}receivedFeatureFlags(t,e,n){this.Du(t,e,n)}Du(t,e,n){if(this.sa){this.pu=!0;var r=(function(s,i,a,u,c,d){i===void 0&&(i={}),a===void 0&&(a={}),u===void 0&&(u={}),d===void 0&&(d=DC);var h=((R,L)=>{var A=R.flags;return A?le({},R,{featureFlags:Object.fromEntries(Object.keys(A).map((O=>{var D;return[O,(D=A[O].variant)!==null&&D!==void 0?D:A[O].enabled]}))),featureFlagPayloads:Object.fromEntries(Object.keys(A).filter((O=>A[O].enabled)).filter((O=>{var D;return(D=A[O].metadata)==null?void 0:D.payload})).map((O=>{var D;return[O,(D=A[O].metadata)==null?void 0:D.payload]})))}):(R.featureFlags&&L.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),R)})(s,d),p=h.flags,m=h.featureFlags,y=h.featureFlagPayloads;if(m){var w=s.requestId,_=s.evaluatedAt;if(Ke(m)){d.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var x={};if(m)for(var b=0;m.length>b;b++)x[m[b]]=!0;return{[dl]:m,[Qi]:x,[xm]:!1}}var P=m,T=y,k=p;if(c!=null&&c.partialResponse)P=le({},i,P),T=le({},a,T),k=le({},u,k);else if(s.errorsWhileComputingFlags)if(p){var I=new Set(Object.keys(p).filter((R=>{var L;return!((L=p[R])!=null&&L.failed)})));P=le({},i,Object.fromEntries(Object.entries(P).filter((R=>I.has(R[0]))))),T=le({},a,Object.fromEntries(Object.entries(T||{}).filter((R=>I.has(R[0]))))),k=le({},u,Object.fromEntries(Object.entries(k||{}).filter((R=>I.has(R[0])))))}else P=le({},i,P),T=le({},a,T),k=le({},u,k);return le({[dl]:Object.keys(jC(P)),[Qi]:P||{},[fl]:T||{},[Zd]:k||{},[xm]:s.minimalFlagCalledEvents===!0},w?{[Nu]:w}:{},_?{[kl]:_}:{})}})(t,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),n,this.I);r&&this.Or(r),e||(this.wu=!1),this.zu(e)}}override(t,e){e===void 0&&(e=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){this.Uu(t)}Uu(t){if(this.sa){if(t===!1)return this.Dr([li,sl]),this.zu(),void Ka.info("All overrides cleared");if(Ke(t))return this.Or({[li]:FC(t)}),this.zu(),void Ka.info("Flag overrides set",{flags:t});if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var e,n=t;this.du=!!((e=n.suppressWarning)!==null&&e!==void 0&&e);var r={},s=n.flags,i=n.payloads;return s&&(r[li]=Ke(s)?FC(s):s),i&&(r[sl]=i),Object.keys(r).length&&this.Or(r),s===!1&&i===!1?this.Dr([li,sl]):s===!1?this.Dr(li):i===!1&&this.Dr(sl),this.zu(),s===!1?Ka.info("Flag overrides cleared"):s&&Ka.info("Flag overrides set",{flags:s}),void(i===!1?Ka.info("Payload overrides cleared"):i&&Ka.info("Payload overrides set",{payloads:i}))}if(t&&typeof t=="object")return this.Or({[li]:t}),this.zu(),void Ka.info("Flag overrides set",{flags:t});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.pu){var e=this.Wu(),n=e.flags,r=e.flagVariants;try{t(n,r)}catch(s){this.I.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,n){var r=(this.Au(Dp)||[]).find((c=>c.flagKey===t)),s={["$feature_enrollment/"+t]:e},i={$feature_flag:t,$feature_enrollment:e,$set:s};r&&(i.$early_access_feature_name=r.name),n&&(i.$feature_enrollment_stage=n);var a=le({},this.getFlagVariants(),{[t]:e});this.Or({[dl]:Object.keys(jC(a)),[Qi]:a,[Us]:le({},this.Au(Us)||{},s)}),this.zu();try{var u;(u=this.sa)==null||u.capture("$feature_enrollment_update",i).catch((c=>{this.I.error("Failed to capture early access feature enrollment",c)}))}catch(c){this.I.error("Failed to capture early access feature enrollment",c)}}getEarlyAccessFeatures(t,e,n){e===void 0&&(e=!1);var r=this.Au(Dp);!r||e?this.Vu(t,n):t(r)}Vu(t,e){var n=this;return Pt((function*(){var r=n.sa;if(r){var s,i=e?"&"+e.map((u=>"stage="+u)).join("&"):"";try{var a=yield r.sendRequest("/api/early_access_features/?token="+r.projectToken+i,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;n.Or({[Dp]:s=a.json.earlyAccessFeatures})}catch(u){return void n.I.error("Early access feature request failed",u)}try{t(s)}catch(u){n.I.error("Early access feature callback failed",u)}}}))()}Wu(){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)),{})}}zu(t){this.Ru();var e=this.Wu(),n=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach((s=>{try{s(n,r,{errorsLoading:t})}catch(i){this.I.error("Error while running feature flags callback",i)}}))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0),this.Gu(t,e)}Gu(t,e){e===void 0&&(e=!0);var n=this.Au(Us)||{},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.Or({[Us]:le({},n,i,r)}),e&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=le({},this.Au(Us)||{});t.forEach((r=>{delete n[r]})),this.Or({[Us]:n}),e&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(t){t===void 0&&(t=!0),this.Dr(Us),t&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var n=this.Au(mi)||{},r=le({},n);for(var s of Object.keys(t))r[s]=le({},n[s],t[s]);this.Or({[mi]:r}),e&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this.Au(mi)||{};this.Or({[mi]:le({},e,{[t]:{}})})}else this.Dr(mi)}reset(){this.mu++,this.bu=!1,this.vu={},this.cu={},this.pu=!1,this.yu=!1,this._u=!1,this.$anon_distinct_id=void 0,this.Pu(),this.du=!1,this.ku=0}}},r9={sessionRecording:class{get Oi(){return this._instance.config}get Co(){return this._instance.persistence}get started(){var t;return!((t=this.Zu)==null||!t.isStarted)}get status(){var t,e;return this.Qu===md||this.Qu===up?this.Qu:(t=(e=this.Zu)==null?void 0:e.status)!==null&&t!==void 0?t:this.Qu}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Qu=TC,this.Ju=void 0,this.Ku=!1,this.kt=(()=>{var e;if(_e==null||!_e.visibilityState||_e.visibilityState==="visible")return!0;var n=ne==null||(e=ne.performance)==null||e.getEntriesByType==null?void 0:e.getEntriesByType("visibility-state");return!(n!=null&&n.length)||n.some((r=>r.name==="visible"))})(),this.It=()=>{var e;(_e==null?void 0:_e.visibilityState)==="visible"&&(this.kt=!0,(e=this.Zu)==null||e.setDocumentWasEverVisible==null||e.setDocumentWasEverVisible(!0))},this._instance=t,!this._instance.sessionManager)throw Hi.error("started without valid sessionManager"),new Error(n_+" started without valid sessionManager. This is a bug.");if(this.Oi.cookieless_mode===so)throw new Error(n_+' cannot be used with cookieless_mode="always"');_e!=null&&_e.addEventListener&&Vt(_e,"visibilitychange",this.It)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Ku=!0,_e==null||_e.removeEventListener==null||_e.removeEventListener("visibilitychange",this.It),this.stopRecording()}get Yu(){var t,e=!((t=this._instance.get_property(cl))==null||!t.enabled),n=!this.Oi.disable_session_recording,r=this.Oi.disable_session_recording||this._instance.consent.isOptedOut();return ne&&e&&n&&!r}startIfEnabledOrStop(t){var e;if(!(this.Ku||this.Yu&&(e=this.Zu)!=null&&e.isStarted)){var n=!de(Object.assign)&&!de(Array.from);this.Yu&&n?(this.Xu(t),Hi.info("starting")):(this.Qu=TC,this.stopRecording())}}Xu(t){var e,n,r;this.Yu&&(this.Qu!==md&&this.Qu!==up&&(this.Qu=IC),je!=null&&(e=je.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=je.__PosthogExtensions__)!=null&&n.initSessionRecording?this.th(t):(r=je.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.eh,(s=>{if(s)return this._instance.register_for_session({[Uy]:!0}),Hi.error("could not load recorder",s);this.th(t)})))}stopRecording(){var t,e;(t=this.Ju)==null||t.call(this),this.Ju=void 0,(e=this.Zu)==null||e.stop()}ih(){var t,e;(t=this.Ju)==null||t.call(this),this.Ju=void 0,(e=this.Zu)==null||e.discard()}rh(){var t,e;(t=this.Co)==null||t.unregister($2),(e=this.Co)==null||e.unregister(uP)}nh(t,e){if(Qe(t))return null;var n,r=on(t)?t:parseFloat(t);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Hi.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null):r}sh(t){if(this.Co){var e,n,r=this.Co,s=()=>{var i,a=t.sessionRecording===!1?void 0:t.sessionRecording,u=this.nh((i=this.Oi.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.nh(a==null?void 0:a.sampleRate,"remote config sampleRate"),d=u??c;Qe(d)&&this.rh();var h=a==null?void 0:a.minimumDurationMilliseconds;r.register({[cl]:le({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:le({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:d,minimumDurationMilliseconds:de(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.Ju)==null||e.call(this),this.Ju=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(t){var e=t.ok?t.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.sh(e),void this.ih()):(this.sh(e),void this.startIfEnabledOrStop()):(this.Qu===md&&(this.Qu=up,Hi.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.Zu)!=null&&n.log?this.Zu.log(t,e):Hi.warn("log called before recorder was ready")}get eh(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(cl);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}oh(){var t,e=this._instance.get_property(cl);if(!e)return!1;try{t=typeof e=="object"?e:JSON.parse(e)}catch(n){return Hi.warn("persisted remote config for session recording is invalid and will be ignored",n),!1}return!Qe(t.cache_timestamp)&&36e5>=Date.now()-t.cache_timestamp}th(t){var e,n,r;if(!this.Ku){if((e=je.__PosthogExtensions__)==null||!e.initSessionRecording)return Hi.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Uy]:!0});var s;if(this.Zu||(this.Zu=(s=je.__PosthogExtensions__)==null?void 0:s.initSessionRecording(this._instance,this.kt),this.Zu._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.oh())return this.Qu===up||this.Qu===md?void 0:(this.Qu=md,Hi.info("persisted remote config is stale, requesting fresh config before starting"),void new BP(this._instance).load());this.Qu=IC,(n=(r=this.Zu).setDocumentWasEverVisible)==null||n.call(r,this.kt),this.Zu.start(t)}}onRRwebEmit(t){var e;(e=this.Zu)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.Zu||(e=this.Co)==null||e.register({[dP]:!0}),(t=this.Zu)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.Zu||(e=this.Co)==null||e.register({[cP]:!0}),(t=this.Zu)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.Zu||(n=this.Co)==null||n.register({[t==="url"?fP:hP]:!0}),(e=this.Zu)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.Zu)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.Zu)==null||!n.tryAddCustomEvent(t,e))}}},s9={autocapture:class{constructor(t){this.ah=!1,this.lh=null,this.uh=!1,this.hh=!1,this.instance=t,this.rageclicks=new CC(t.config.rageclick),this.dh=null}initialize(){this.startIfEnabled()}get Oi(){var t,e,n=It(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}fh(){if(this.isBrowserSupported()){if(ne&&_e){var t=n=>{n=n||(ne==null?void 0:ne.event);try{this.ph(n)}catch(r){e1.error("Failed to capture event",r)}};if(Vt(_e,"submit",t,{capture:!0}),Vt(_e,"change",t,{capture:!0}),Vt(_e,"click",t,{capture:!0}),this.Oi.capture_copied_text){var e=n=>{n=n||(ne==null?void 0:ne.event);try{this.ph(n,Jv)}catch(r){e1.error("Failed to capture copy/cut event",r)}};Vt(_e,"copy",e,{capture:!0}),Vt(_e,"cut",e,{capture:!0})}}}else e1.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ah&&(this.fh(),this.ah=!0)}onRemoteConfig(t){if(this.uh=!0,t.ok){var e=t.config;e.elementsChainAsString&&(this.hh=e.elementsChainAsString);var n=e.autocapture_opt_out;Qr(n)&&(this.instance.persistence&&this.instance.persistence.register({[Ry]:n}),this.lh=n),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(t){this.dh=t}getElementSelectors(t){var e,n=[];return(e=this.dh)==null||e.forEach((r=>{var s=_e==null?void 0:_e.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[Ry],r=this.lh,s=this.instance.Js()&&!this.uh;if(Ln(r)&&!Qr(n)&&!s)return!1;var i=(e=this.lh)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!i}ph(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,r=Hv(t);SP(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())&&JE(r,this.instance.config.rageclick)&&this.ph(t,"$rageclick");var s=e===Jv;if(r&&(function(p,m,y,w,_,x){var b;if(!ne||W2(p)||y!=null&&y.url_allowlist&&!YE(y.url_allowlist,x)||y!=null&&y.url_ignorelist&&YE(y.url_ignorelist,x))return!1;if(y!=null&&y.dom_event_allowlist){var P=y.dom_event_allowlist;if(P&&!P.some((A=>m.type===A)))return!1}var T=IP(p,w),k=T.parentIsUsefulElement,I=T.targetElementList;if(!(function(A,O){var D=O==null?void 0:O.element_allowlist;if(de(D))return!0;var N,F=function(Z){if(D.some((W=>Z.tagName.toLowerCase()===W)))return{v:!0}};for(var K of A)if(N=F(K))return N.v;return!1})(I,y)||!Ky(I,y==null?void 0:y.css_selector_allowlist)||Ky(I,(b=y==null?void 0:y.css_selector_ignorelist)!==null&&b!==void 0?b:JD))return!1;try{var R=ne.getComputedStyle(p);if(R&&R.getPropertyValue("cursor")==="pointer"&&m.type==="click")return!0}catch{}var L=p.tagName.toLowerCase();switch(L){case"html":return!1;case"form":return(_||["submit"]).indexOf(m.type)>=0;case"input":case"select":case"textarea":return(_||["change","click"]).indexOf(m.type)>=0;default:return k?(_||["click"]).indexOf(m.type)>=0:(_||["click"]).indexOf(m.type)>=0&&(U2.indexOf(L)>-1||p.getAttribute("contenteditable")==="true")}})(r,t,this.Oi,s,s?["copy","cut"]:void 0,this.instance)){var i=GN(r,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Oi.element_attribute_ignorelist,elementsChainAsString:this.hh,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var u=this.getElementSelectors(r);if(u&&u.length>0&&(a.$element_selectors=u),e===Jv){var c,d=kP(ne==null||(c=ne.getSelection())==null?void 0:c.toString()),h=t.type||"clipboard";if(!d)return!1;a.$selected_content=d,a.$copy_type=h}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return dr(_e==null?void 0:_e.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.gh=(ne==null||(e=ne.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(ve.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.mh&&this.mh(),this.mh=void 0,ve.info("History API monitoring stopped")}monitorHistoryChanges(){ne&&ne.history&&(this.yh("pushState"),this.yh("replaceState"),this.bh())}yh(t){var e;if(ne&&((e=ne.history[t])==null||!e.__posthog_wrapped__)){var n=this;(function(r,s,i){try{if(!(s in r))return kC;var a={next:r[s]},u=i((function(){for(var c=arguments.length,d=new Array(c),h=0;c>h;h++)d[h]=arguments[h];return a.next.apply(this,d)}));return dr(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];dr(c)&&c.__posthog_layer__;){var d=c.__posthog_layer__;if(d.next===u)return void(d.next=a.next);c=d.next}else r[s]=a.next}}catch{return kC}})(ne.history,t,(r=>function(s,i,a){r.call(this,s,i,a),n._h(t)}))}}_h(t){try{var e,n=ne==null||(e=ne.location)==null?void 0:e.pathname;if(!n)return;n!==this.gh&&this.isEnabled&&this._instance.capture(bu,{navigation_type:t}),this.gh=n}catch(r){ve.error("Error capturing "+t+" pageview",r)}}bh(){if(!this.mh){var t=()=>{this._h("popstate")};Vt(ne,"popstate",t),this.mh=()=>{ne&&ne.removeEventListener("popstate",t)}}}},heatmaps:class{get Oi(){return this.instance.config}constructor(t){var e;this.wh=!1,this.ah=!1,this.kh=null,this.instance=t,this.wh=!((e=this.instance.persistence)==null||!e.props[My]),this.rageclicks=new CC(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return It(this.Oi.capture_heatmaps)&&this.Oi.capture_heatmaps.flush_interval_milliseconds&&(t=this.Oi.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Qe(this.Oi.capture_heatmaps)?Qe(this.Oi.enable_heatmaps)?this.wh:this.Oi.enable_heatmaps:this.Oi.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ah)return;qN.info("starting..."),this.xh(),this.It()}else{var t;clearInterval((t=this.kh)!==null&&t!==void 0?t:void 0),this.Sh(),this.getAndClearBuffer()}}onRemoteConfig(t){if(t.ok){var e=t.config;if("heatmaps"in e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[My]:n}),this.wh=n,this.startIfEnabled()}}}getAndClearBuffer(){var t=this.ft;return this.ft=void 0,t}Ch(t){n1(t.originalEvent)&&this.mi(t.originalEvent,"deadclick")}It(){this.kh&&clearInterval(this.kh),this.kh=(_e==null?void 0:_e.visibilityState)==="visible"?setInterval(this.fo.bind(this),this.flushIntervalMilliseconds):null}xh(){ne&&_e&&(this.Th=this.fo.bind(this),Vt(ne,km,this.Th),this.Mh=t=>this.mi(t||(ne==null?void 0:ne.event)),Vt(_e,"click",this.Mh,{capture:!0}),this.Eh=t=>this.Ih(t||(ne==null?void 0:ne.event)),Vt(_e,"mousemove",this.Eh,{capture:!0}),this.Rh=new oC(this.instance,oN,this.Ch.bind(this)),this.Rh.startIfEnabledOrStop(),this.Ph=this.It.bind(this),Vt(_e,Cm,this.Ph),this.ah=!0)}Sh(){var t;ne&&_e&&(this.Th&&ne.removeEventListener(km,this.Th),this.Mh&&_e.removeEventListener("click",this.Mh,{capture:!0}),this.Eh&&_e.removeEventListener("mousemove",this.Eh,{capture:!0}),this.Ph&&_e.removeEventListener(Cm,this.Ph),clearTimeout(this.Ah),(t=this.Rh)==null||t.stop(),this.ah=!1)}Fh(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 d=a;d&&pa(d)&&!es(d,"body");){if(d===c)return!1;var h=void 0;try{var p,m,y;h=(p=(m=(y=d.ownerDocument)==null?void 0:y.defaultView)!==null&&m!==void 0?m:ne)==null?void 0:p.getComputedStyle(d).position}catch{return!1}if(Ze(u,h))return!0;d=PP(d)}return!1})(Hv(t),["fixed","sticky"],s);return{x:t.clientX+(i?0:r),y:t.clientY+(i?0:n),target_fixed:i,type:e}}mi(t,e){var n;if(e===void 0&&(e="click"),!ZE(t.target)&&n1(t)){var r=this.Fh(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&JE(Hv(t),this.instance.config.rageclick)&&this.Fn(le({},r,{type:"rageclick"})),this.Fn(r)}}Ih(t){!ZE(t.target)&&n1(t)&&(clearTimeout(this.Ah),this.Ah=setTimeout((()=>{this.Fn(this.Fh(t,"mousemove"))}),500))}Fn(t){if(ne){var e=this.Oi.disable_capture_url_hashes?ha(ne.location.href):ne.location.href,n=this.Oi.custom_personal_data_properties,r=this.Oi.mask_personal_data_properties?[...dc,...n||[]]:[],s=Xd(e,r,Qd);this.ft=this.ft||{},this.ft[s]||(this.ft[s]=[]),this.ft[s].push(t)}}fo(){this.ft&&!Ks(this.ft)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:oC,webVitalsAutocapture:class{constructor(t){var e;this.wh=!1,this.ah=!1,this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Oh=()=>{clearTimeout(this.Lh),this.Lh=void 0,this.ft.metrics.length!==0&&(this._instance.capture("$web_vitals",le({$current_url:this.ft.url},this.ft.metrics.reduce(((n,r)=>le({},n,{["$web_vitals_"+r.name+"_event"]:le({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{}))),this.ft={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.$h=n=>{var r;if(this.ft=this.ft||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},Qe(n==null?void 0:n.name)||Qe(n==null?void 0:n.value))Ga.error("Invalid metric received",n);else{var s=typeof n.navigationURL=="string"?n.navigationURL:void 0,i=this.Dh(s);if(!de(i)){var a=on(n.navigationId)||typeof n.navigationId=="string"?"navigation:"+n.navigationId:"url:"+i;if(!this.Nh||this.Nh>n.value){this.ft.navigationKey!==a&&(this.Oh(),this.Lh=setTimeout(this.Oh,this.flushToCaptureTimeoutMs)),de(this.ft.navigationKey)&&(this.ft.navigationKey=a,this.ft.url=i),this.ft.firstMetricTimestamp=de(this.ft.firstMetricTimestamp)?Date.now():this.ft.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0);var u=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),c=le({},n,s?{navigationURL:i}:{},{$current_url:i,timestamp:Date.now()});de(u)||(c.$session_id=u.sessionId,c.$window_id=u.windowId),this.ft.metrics.push(c),this.ft.metrics.length===this.allowedMetrics.length&&this.Oh()}else Ga.error("Ignoring metric with value >= "+this.Nh,n)}}},this.qh=()=>{if(!this.ah){var n,r,s,i,a=je.__PosthogExtensions__,u=a==null?void 0:a.postHogWebVitalsCallbacksByFlavor,c=(u==null?void 0:u[this.jh])||(this.jh==="web-vitals"&&de(u)?a==null?void 0:a.postHogWebVitalsCallbacks:void 0);if(de(c)||(n=c.onLCP,r=c.onCLS,s=c.onFCP,i=c.onINP),n&&r&&s&&i){var d={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&n(this.$h.bind(this),d),this.allowedMetrics.indexOf("CLS")>-1&&r(this.$h.bind(this),d),this.allowedMetrics.indexOf("FCP")>-1&&s(this.$h.bind(this),d),this.allowedMetrics.indexOf("INP")>-1&&i(this.$h.bind(this),d),this.ah=!0}else Ga.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.wh=!((e=this._instance.persistence)==null||!e.props[Ny]),this.startIfEnabled()}get Bh(){return this._instance.config.capture_performance}get allowedMetrics(){var t,e,n=It(this.Bh)?(t=this.Bh)==null?void 0:t.web_vitals_allowed_metrics:void 0;return Qe(n)?((e=this._instance.persistence)==null?void 0:e.props[Fy])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(It(this.Bh)?this.Bh.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=It(this.Bh)?this.Bh.web_vitals_attribution:void 0;return t!=null&&t}get useSoftNavs(){var t=It(this.Bh)?this.Bh.__preview_web_vitals_soft_navs:void 0;return t!=null&&t}get Nh(){var t=It(this.Bh)&&on(this.Bh.__web_vitals_max_value)?this.Bh.__web_vitals_max_value:PC;return t>0&&6e4>=t?PC:t}get isEnabled(){var t=jt==null?void 0:jt.protocol;if(t!=="http:"&&t!=="https:")return Ga.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=It(this.Bh)?this.Bh.web_vitals:Qr(this.Bh)?this.Bh:void 0;return Qr(e)?e:this.wh}startIfEnabled(){this.isEnabled&&!this.ah&&(Ga.info("enabled, starting..."),this.Jn(this.qh))}onRemoteConfig(t){if(t.ok){var e=t.config;if("capturePerformance"in e){var n=It(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=It(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ny]:n}),this._instance.persistence.register({[Fy]:r})),this.wh=n,this.startIfEnabled()}}}get jh(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Jn(t){var e=je.__PosthogExtensions__,n=this.jh,r=e==null?void 0:e.postHogWebVitalsCallbacksByFlavor;r!=null&&r[n]||n==="web-vitals"&&de(r)&&e!=null&&e.postHogWebVitalsCallbacks?t():e==null||e.loadExternalDependency==null||e.loadExternalDependency(this._instance,n,(s=>{s?Ga.error("failed to load script",s):t()}))}Dh(t){var e=t||(ne==null?void 0:ne.location.href);if(e){var n=this._instance.config.disable_capture_url_hashes?ha(e):e,r=this._instance.config.custom_personal_data_properties,s=this._instance.config.mask_personal_data_properties?[...dc,...r||[]]:[];return Xd(n,s,Qd)}Ga.error("Could not determine current URL")}}},i9={exceptionObserver:class{constructor(t){var e;this.qh=()=>{var n;if(ne&&this.isEnabled&&(n=je.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var r=je.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=je.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,i=je.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Hh&&this.Oi.capture_unhandled_errors&&(this.Hh=r(this.captureException.bind(this))),!this.zh&&this.Oi.capture_unhandled_rejections&&(this.zh=s(this.captureException.bind(this))),!this.Uh&&this.Oi.capture_console_errors&&(this.Uh=i(this.captureException.bind(this)))}catch(a){pd.error("failed to start",a),this.Wh()}}},this._instance=t,this.Vh=!((e=this._instance.persistence)==null||!e.props[Oy]),this.oe=new nD(le({},(function(n){var r,s,i,a;return n===void 0&&(n={}),{refillRate:(r=(s=n.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:n.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=(a=n.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:n.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10}})(this._instance.config.error_tracking),{refillInterval:1e4,I:pd})),this.Oi=this.Gh(),this.startIfEnabledOrStop()}Gh(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return It(t)?e=le({},e,t):(de(t)?this.Vh:t)&&(e=le({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Oi.capture_console_errors||this.Oi.capture_unhandled_errors||this.Oi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(pd.info("enabled"),this.Wh(),this.Jn(this.qh)):this.Wh()}Jn(t){var e,n;(e=je.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?t():(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return pd.error("failed to load script",r);t()}))}Wh(){var t,e,n;(t=this.Hh)==null||t.call(this),this.Hh=void 0,(e=this.zh)==null||e.call(this),this.zh=void 0,(n=this.Uh)==null||n.call(this),this.Uh=void 0}onRemoteConfig(t){if(t.ok){var e=t.config;"autocaptureExceptions"in e&&(this.Vh=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Oy]:this.Vh}),this.Oi=this.Gh(),this.startIfEnabledOrStop())}}onConfigChange(){this.Oi=this.Gh()}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.oe.consumeRateLimit(s)?pd.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.Zh=[],this.Qh=new yD([new kD,new DD,new TD,new PD,new OD,new MD,new AD,new LD],(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 d=[],h=u.split(`
19
+ `),p=c;h.length>p;p++){var m=h[p];if(1024>=m.length){var y=zE.test(m)?m.replace(zE,"$1"):m;if(!y.match(/\S*Error: /)){for(var w of i){var _=w(y,r);if(_){d.push(_);break}}if(d.length>=50)break}}}return(function(x){if(!x.length)return[];var b=Array.from(x);return b.reverse(),b.slice(0,50).map((P=>{return le({},P,{filename:P.filename||(T=b,T[T.length-1]||{}).filename,function:P.function||lc});var T}))})(d)}})("web:javascript",bD,CD)),this._instance=t,this.Zh=(e=(n=this._instance.persistence)==null?void 0:n.get_property(Ly))!==null&&e!==void 0?e:[],this.Jh=_m(this.Kh()),this.Yh=new FD(this.Jh)}onConfigChange(){this.Jh=_m(this.Kh()),this.Yh.setConfig(this.Jh)}onRemoteConfig(t){var e,n,r;if(t.ok){var s=t.config;if("errorTracking"in s){var i=(e=(n=s.errorTracking)==null?void 0:n.suppressionRules)!==null&&e!==void 0?e:[],a=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Zh=i,this._instance.persistence&&this._instance.persistence.register({[Ly]:this.Zh,[Dy]:a})}}}get Xh(){var t,e=!!this._instance.get_property(Dy),n=this._instance.config.error_tracking.captureExtensionExceptions;return(t=n??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Qh.buildFromUnknown(t,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(t,e){if(this.Jh.enabled)try{if(!ft(t)||t.trim().length===0)return void si.warn("Ignoring exception step because message must be a non-empty string");var n=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(i).reduce(((u,c)=>ND.has(c)?(a.push(c),u):(u[c]=i[c],u)),{}),droppedKeys:a}})(this.td(e)),r=n.sanitizedProperties,s=n.droppedKeys;s.length>0&&si.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Yh.add(le({[vm]:t,[ym]:new Date().toISOString()},r))}catch(i){si.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(t){try{var e=t.$exception_list;if(this.ed(e)){if(this.rd(e))return this.nd("Exception dropped: matched a suppression rule"),void si.info("Skipping exception capture because a suppression rule matched");if(!this.Xh&&this.sd(e))return this.nd("Exception dropped: thrown by a browser extension"),void si.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.od(e))return this.nd("Exception dropped: thrown by the PostHog SDK"),void si.info("Skipping exception capture because it was thrown by the PostHog SDK")}var n=this.Jh.enabled&&Qe(t.$exception_steps)?this.ad(t):t,r=typeof(i=globalThis._posthogReleaseId)=="string"&&i.length>0?i:void 0;r&&(n.$release_id=r);try{var s=this._instance.capture("$exception",n,{_noTruncate:!0,_batchKey:"exceptionEvent",Wa:!0});return s&&this.Yh.clear(),s}catch(a){return si.error("Failed to capture exception event. Dropping this exception.",a),void this.Yh.clear()}}catch(a){return void si.error("Failed to process exception event. Ignoring this exception.",a)}var i}ad(t){try{var e=this.Yh.getAttachable();return e.length===0?t:le({},t,{$exception_steps:e})}catch(n){return si.error("Failed to read buffered exception steps. Capturing exception without steps.",n),t}}nd(t){this.Jh.enabled&&this.Yh.add({[vm]:t,[ym]:new Date().toISOString()})}td(t){return It(t)?le({},t):{}}Kh(){var t,e;return(t=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&t!==void 0?t:{}}rd(t){if(t.length===0)return!1;try{var e=t.reduce(((n,r)=>{var s=r.type,i=r.value;return ft(s)&&s.length>0&&n.$exception_types.push(s),ft(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.Zh.some((n=>{var r=n.values.map((s=>{var i=r3[s.operator],a=e[s.key];if(!i||!a)return!1;var u=Ke(s.value)?s.value:[s.value];return u.length>0&&i(u,a)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}catch(n){return si.warn("Failed to evaluate suppression rules. Capturing the exception.",n),!1}}sd(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=>{var n=e.filename;return!!n&&t9.some((r=>n.startsWith(r)))}))}od(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}ed(t){return!Qe(t)&&Ke(t)}}},o9=le({productTours:class{get Co(){return this._instance.persistence}constructor(t){this.ld=null,this.ud=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(t.ok){var e=t.config;if("productTours"in e){var n,r;if(this.Co&&this.Co.register({[V2]:!!e.productTours}),!r1(this._instance))return!this.ld&&Qe((n=this.Co)==null?void 0:n.props[Ed])||cp.info("product tours disabled; stopping and clearing cached tours"),(r=this.ld)==null||r.stop(),this.ld=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.ld&&r1(this._instance)&&this.Jn((()=>this.hd()))}Jn(t){var e,n;(e=je.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?cp.error("Could not load product tours script",r):t()}))}hd(){var t;!this.ld&&(t=je.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.ld=je.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!Ke(this.ud)||e){var n=this.Co;if(n){var r=n.props[Ed];if(Ke(r)&&!e)return this.ud=r,void t(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if(r1(this._instance)){var i=s.statusCode;if(i!==200||!s.json){var a="Product Tours API could not be loaded, status: "+i;return i===0?s.error||cp.warn(a):cp.error(a),void t([],{isLoaded:!1,error:a})}var u=Ke(s.json.product_tours)?s.json.product_tours:[];this.ud=u,n&&n.register({[Ed]:u}),t(u,{isLoaded:!0})}else t([],{isLoaded:!0})}})}else t(this.ud,{isLoaded:!0})}getActiveProductTours(t){Qe(this.ld)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.ld.getActiveProductTours(t)}showProductTour(t){var e;(e=this.ld)==null||e.showTourById(t)}previewTour(t){this.ld?this.ld.previewTour(t):this.Jn((()=>{var e;this.hd(),(e=this.ld)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.ld)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.ld)==null||t.nextStep()}previousStep(){var t;(t=this.ld)==null||t.previousStep()}clearCache(){var t;this.ud=null,(t=this.Co)==null||t.unregister(Ed)}resetTour(t){var e;(e=this.ld)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.ld)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.ld)==null||e.cancelPendingTour(t)}}},m0),a9={siteApps:class{constructor(t){this.dd=0,this._instance=t,this.vd=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}fd(t,e){if(e){var n=this.globalsForEvent(e);this.vd.push(n),this.vd.length>1e3&&(this.vd=this.vd.slice(10))}}get siteAppLoaders(){var t;return(t=je._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.fd.bind(this));this.pd=()=>{t(),this.vd=[],this.pd=void 0}}}globalsForEvent(t){var e,n,r,s,i,a,u;if(!t)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var p of Object.entries(h)){var m=p[0];c[m]={id:d[m],type:m,properties:p[1]}}var y=t.$set_once,w=t.$set;return{event:le({},k8(t,ZN),{properties:le({},t.properties,w?{$set:le({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},w)}:{},y?{$set_once:le({},(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}}gd(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)||(ri.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)||(ri.error("prepare_external_dependency_script returned null"),null):t}md(){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=_e==null?void 0:_e.defaultView,d=c==null||(t=c.Node)==null?void 0:t.prototype;if(!c||!d)return()=>{};if(this.dd++,this.yd)return this.bd();var h=[],p=this,m=new WeakSet,y=(x,b,P)=>{if(x!=null&&x[b]){var T=x[b];x[b]=P(T),h.push((()=>{x[b]=T}))}},w=x=>{if(m.has(x))return x;var b=p.gd(x);return b&&m.add(b),b},_=x=>x.map((b=>typeof b=="string"?b:w(b))).filter((b=>!Ln(b)));return y(d,"appendChild",(x=>function(b){var P=w(b);return P?x.call(this,P):b})),y(d,"insertBefore",(x=>function(b,P){var T=w(b);return T?x.call(this,T,P):b})),y(d,"replaceChild",(x=>function(b,P){var T=w(b);return T?x.call(this,T,P):P})),[(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((x=>{y(x,"append",(b=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return b.apply(this,_(T))})),y(x,"prepend",(b=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return b.apply(this,_(T))}))})),[(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((x=>{y(x,"before",(b=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return b.apply(this,_(T))})),y(x,"after",(b=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];return b.apply(this,_(T))})),y(x,"replaceWith",(b=>function(){for(var P=arguments.length,T=new Array(P),k=0;P>k;k++)T[k]=arguments[k];var I=_(T);return T.length&&!I.length?void 0:b.apply(this,I)}))})),y((u=c.Element)==null?void 0:u.prototype,"insertAdjacentElement",(x=>function(b,P){var T=w(P);return T?x.call(this,b,T):null})),this.yd=()=>{h.forEach((x=>x())),this.yd=void 0},this.bd()}bd(){var t=!1;return()=>{var e;t||(t=!0,this.dd--,this.dd===0&&((e=this.yd)==null||e.call(this)))}}_d(t,e){e===void 0&&(e=!0);var n=this.md();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.vd.length&&(ri.info("Processing "+this.vd.length+" events for site app with id "+t.id),this.vd.forEach((u=>this._d((()=>e.processEvent==null?void 0:e.processEvent(u))))),e.processedBuffer=!0),Object.values(this.apps).every((u=>u.processedBuffer||u.errored))&&((a=this.pd)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,ri.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),r&&n()};try{var i=this._d((a=>t.init({posthog:this._instance,callback(u){a(),s(u)}})),!1).processEvent;i&&(e.processEvent=i),r=!0}catch(a){ri.error(AC+t.id,a),s(!1)}if(r&&e.loaded)try{n()}catch(a){ri.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}wd(){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)}kd(t){var e=this;if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t),r=function(i){try{e._d((()=>i.processEvent==null?void 0:i.processEvent(n)))}catch(a){ri.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.wd(),void this._instance.on("eventCaptured",(c=>this.kd(c)))):void ri.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.pd)==null||n.call(this),t.ok){var i=t.config;if((r=i.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var c,d=u.id,h=u.url;je["__$$ph_site_app_"+d]=s._instance,(c=je.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(s._instance,h,(p=>{if(p)return ri.error(AC+d,p)}))};for(var u of i.siteApps)a()}else ri.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},l9={tracingHeaders:class{constructor(t){this.xd=void 0,this.Sd=void 0,this.Cd=void 0,this.qh=()=>{var e,n,r=this.Td();r?(de(this.xd)&&(this.xd=(e=je.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager)),de(this.Sd)&&(this.Sd=(n=je.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null?void 0:n._patchFetch(r,(()=>this._instance.get_distinct_id()),this._instance.sessionManager))):this.Wh()},this._instance=t}initialize(){this.startIfEnabledOrStop()}Jn(t){var e,n;(e=je.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?t():(n=je.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return KN.error("failed to load script",r);t()}))}Md(){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}Td(){var t=this.Md();return Ke(t)?(Ke(this.Cd)?this.Cd.splice(0,this.Cd.length,...t):this.Cd=[...t],t.length>0?this.Cd:void 0):(Ke(this.Cd)&&this.Cd.splice(0),this.Cd=t||void 0,this.Cd)}Wh(){var t,e;(t=this.xd)==null||t.call(this),(e=this.Sd)==null||e.call(this),this.xd=void 0,this.Sd=void 0}startIfEnabledOrStop(){this.Td()?this.Jn(this.qh):this.Wh()}}},u9=le({surveys:class{get Oi(){return this._instance.config}constructor(t){this.Ed=void 0,this._surveyManager=null,this.Id=!1,this.Rd=[],this.Pd=null,this.Ad=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this.Oi.disable_surveys){if(!t.ok)return _t.warn("Remote config unavailable. Not loading surveys.");var e=t.config.surveys;if(Qe(e))return _t.warn("Flags not loaded yet. Not loading surveys.");var n=Ke(e);this.Ed=n?e.length>0:e,_t.info("flags response received, isSurveysEnabled: "+this.Ed),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(o3)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((s=>localStorage.removeItem(s)))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Id)_t.info("Already initializing surveys, skipping...");else if(this.Oi.disable_surveys)_t.info(RC);else if(this.Oi.cookieless_mode&&this._instance.consent.isOptedOut())_t.info("Not loading surveys in cookieless mode without consent.");else{var t=je==null?void 0:je.__PosthogExtensions__;if(t){if(!de(this.Ed)||this.Oi.advanced_enable_surveys){var e=this.Ed||this.Oi.advanced_enable_surveys;this.Id=!0;try{var n=t.generateSurveys;if(n)return void this.Fd(n,e);var r=t.loadExternalDependency;if(!r)return void this.Od(H2);r(this._instance,"surveys",(s=>{s||!t.generateSurveys?this.Od("Could not load surveys script",s):this.Fd(t.generateSurveys,e)}))}catch(s){throw this.Od("Error initializing surveys",s),s}finally{this.Id=!1}}}else _t.error("PostHog Extensions not found.")}}Fd(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new QN(this._instance),_t.info("Surveys loaded successfully"),this.Ld({isLoaded:!0})}Od(t,e){_t.error(t,e),this.Ld({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Rd.push(t),this._surveyManager&&this.Ld({isLoaded:!0}),()=>{this.Rd=this.Rd.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this.Oi.disable_surveys)return _t.info(RC),t([]);var n,r=this._instance.get_property(jy);if(r&&!e)return t(r,{isLoaded:!0}),void(this.$d()&&this.getSurveys((()=>{}),!0));typeof Promise<"u"&&this.Pd?this.Pd.then((s=>t(s.surveys,s.context))):(typeof Promise<"u"&&(this.Pd=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Oi.token),method:"GET",timestampMode:"query",timeout:this.Oi.surveys_request_timeout_ms,callback:s=>{var i;this.Pd=null;var a=s.statusCode;if(a!==200||!s.json){var u="Surveys API could not be loaded, status: "+a;a!==0?_t.error(u):s.error||_t.warn(u),this.Ad=Date.now();var c={isLoaded:!1,error:u};return t([],c),void(n==null||n({surveys:[],context:c}))}this.Ad=null;var d,h=s.json.surveys||[],p=h.filter((y=>(function(w){return!(!w.start_date||w.end_date)})(y)&&(i3(y)||(function(w){var _;return!((_=w.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)})(y))));p.length>0&&((d=this._surveyEventReceiver)==null||d.register(p)),(i=this._instance.persistence)==null||i.register({[jy]:h,[bm]:Date.now()});var m={isLoaded:!0};t(h,m),n==null||n({surveys:h,context:m})}}))}$d(){return this.Dd()&&!this.Pd&&!this.Nd()}Dd(){var t=this._instance.get_property(bm);return on(t)&&Date.now()-t>3e5}Nd(){return on(this.Ad)&&3e5>Date.now()-this.Ad}markSurveyAsSeen(t,e){var n,r={id:t,current_iteration:(n=e==null?void 0:e.iteration)!==null&&n!==void 0?n:null};a3(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Ld(t){for(var e of this.Rd)try{if(!t.isLoaded)return e([],t);this.getSurveys(e)}catch(n){_t.error("Error in survey callback",n)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!Qe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);_t.warn("init was not called")}qd(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}jd(t){if(Qe(this._surveyManager))return{eligible:!1,reason:dp};var e=typeof t=="string"?this.qd(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}Bd(t){if(Qe(this._surveyManager))return{eligible:!1,reason:dp};var e=typeof t=="string"?this.qd(t):t;return e?this._surveyManager.checkSurveyRenderability(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(Qe(this._surveyManager))return _t.warn("init was not called"),{visible:!1,disabledReason:dp};var e=this.Bd(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return Qe(this._surveyManager)?(_t.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:dp})):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.Bd(i);n({visible:a.eligible,disabledReason:a.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,n){var r;if(Qe(this._surveyManager))_t.warn("init was not called");else{var s=typeof t=="string"?this.qd(t):t;if(s!=null&&s.id)if(LN.includes(s.type)){var i=_e==null?void 0:_e.querySelector(e);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(_t.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,u;_t.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),_t.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);_t.warn("Survey element not found")}else _t.warn("Surveys of type "+s.type+" cannot be rendered in the app");else _t.warn("Survey not found")}}displaySurvey(t,e){var n;if(Qe(this._surveyManager))_t.warn("init was not called");else{var r=this.qd(t);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=le({},r,{appearance:le({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Zy.Popover&&e.initialResponses&&_t.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var i=this.jd(r);if(!i.eligible)return void _t.warn("Survey is not eligible to be displayed: ",i.reason)}e.displayType!==Zy.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else _t.warn("Survey not found")}}cancelPendingSurvey(t){Qe(this._surveyManager)?_t.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload==null||t.handlePageUnload()}}},m0),c9={toolbar:class{constructor(t){this.instance=t}Hd(t){je.ph_toolbar_state=t}zd(){var t;return(t=je.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),Gy(this.instance.config)||!ne||!_e)return!1;t=t??ne.location,n=n??ne.history;try{if(!e){try{ne.localStorage.setItem("test","test"),ne.localStorage.removeItem("test")}catch{return!1}e=ne==null?void 0:ne.localStorage}var r,s=JN||Am(t.hash,"__posthog")||Am(t.hash,"state"),i=s?WE((()=>JSON.parse(atob(decodeURIComponent(s)))))||WE((()=>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(MC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Ud(t){var e=je.ph_load_toolbar||je.ph_load_editor;!Qe(e)&&dr(e)?e(t,this.instance):OC.warn("No toolbar load function found")}loadToolbar(t){var e=!(_e==null||!_e.getElementById(bP));if(!ne||e)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=le({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(ne.localStorage.setItem(MC,JSON.stringify(le({},r,{source:void 0}))),this.zd()===2)this.Ud(r);else if(this.zd()===0){var s;this.Hd(1),(s=je.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return OC.error("[Toolbar] Failed to load",i),void this.Hd(0);this.Hd(2),this.Ud(r)})),Vt(ne,"turbolinks:load",(()=>{this.Hd(0),this.loadToolbar(r)}))}return!0}Wd(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)}}},d9=le({experiments:er},m0),f9={conversations:class{constructor(t){this.Vd=void 0,this._conversationsManager=null,this.Gd=!1,this.Me=null,this.Zd=!1,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations&&(this.Qd=t.ok,t.ok)){var e=t.config.conversations;Qe(e)||(Qr(e)?this.Vd=e:(this.Vd=e.enabled,this.Me=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Vd=void 0,this.Me=null,this.Qd=void 0,this.Zd=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Gd||this._instance.config.disable_conversations||Gy(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=je==null?void 0:je.__PosthogExtensions__;if(t&&!de(this.Vd)&&this.Vd)if(this.Me&&this.Me.token){this.Gd=!0;try{var e=t.initConversations;if(e)return this.Jd(e),void(this.Gd=!1);var n=t.loadExternalDependency;if(!n)return void this.Kd(H2);n(this._instance,"conversations",(r=>{r||!t.initConversations?this.Kd("Could not load conversations script",r):this.Jd(t.initConversations),this.Gd=!1}))}catch(r){this.Kd("Error initializing conversations",r),this.Gd=!1}}else ws.error("Conversations enabled but missing token in remote config.")}}Jd(t){if(this.Me)try{this._conversationsManager=t(this.Me,this._instance),this.Zd=!1,ws.info("Conversations loaded successfully")}catch(e){this.Kd("Error completing conversations initialization",e)}else ws.error("Cannot complete initialization: remote config is null")}Kd(t,e){ws.error(t,e),this._conversationsManager=null,this.Gd=!1,this.Zd=!0}show(){this._conversationsManager?this._conversationsManager.show():ws.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Vd===!0&&!Ln(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":Gy(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":this.Qd===!1?"remote_config_failed":de(this.Vd)?this.Qd?"disabled_in_project":"remote_config_pending":this.Vd?Qe(this.Me)||!this.Me.token?"missing_token":je!=null&&je.__PosthogExtensions__?this.Gd?"initializing":this.Zd?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}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 Pt((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(t,e,n):(ws.warn(qa),null)}))()}getMessages(t,e){var n=this;return Pt((function*(){return n._conversationsManager?n._conversationsManager.getMessages(t,e):(ws.warn(qa),null)}))()}markAsRead(t){var e=this;return Pt((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(ws.warn(qa),null)}))()}getTickets(t){var e=this;return Pt((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(ws.warn(qa),null)}))()}requestRestoreLink(t){var e=this;return Pt((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(ws.warn(qa),null)}))()}restoreFromToken(t){var e=this;return Pt((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(ws.warn(qa),null)}))()}restoreFromUrlToken(){var t=this;return Pt((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ws.warn(qa),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}tl(){var t;(t=this._conversationsManager)==null||t.setIdentity()}el(){var t;(t=this._conversationsManager)==null||t.clearIdentity()}}},h9={logs:class{constructor(t){var e,n=this;this.Yd=!1,this.Xd=!1,this.I=Lt("[logs]"),this.tv=le({},this.I,{error(){for(var r=arguments.length,s=new Array(r),i=0;r>i;i++)s[i]=arguments[i];s.some(HC)||n.I.error(...s)}}),this.io=[],this.ev=[],this.ku=0,this.iv=()=>{var r,s;this.ku=0,(r=this.rv)==null||r.onReconnect(),(s=this.nv)==null||s.onReconnect()},this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Yd=!0),ne&&Vt(ne,"online",this.iv)}sv(t,e,n,r){var s,i=(function(a,u){var c,d,h,p,m,y,w,_=(c=a==null?void 0:a.flushIntervalMs)!==null&&c!==void 0?c:3e3,x=(d=a==null?void 0:a.maxBufferSize)!==null&&d!==void 0?d:100,b=u!=null&&u.consoleCapture?void 0:(h=a==null?void 0:a.maxLogsPerInterval)!==null&&h!==void 0?h:1e3,P=de(b)?Math.max(x,2048):Math.max(x,b),T=a==null?void 0:a.resourceAttributes;return{serviceName:(p=(m=T==null?void 0:T["service.name"])!==null&&m!==void 0?m:a==null?void 0:a.serviceName)!==null&&p!==void 0?p:u==null?void 0:u.serviceNameDefault,serviceVersion:(y=T==null?void 0:T["service.version"])!==null&&y!==void 0?y:a==null?void 0:a.serviceVersion,environment:(w=T==null?void 0:T["deployment.environment"])!==null&&w!==void 0?w:a==null?void 0:a.environment,resourceAttributes:T,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:_,maxBufferSize:x,maxQueueSize:P,maxBatchRecordsPerPost:100,rateCapWindowMs:_,maxLogsPerInterval:b,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}})((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,n);return[new mD(this.ov(t,e),i,this.tv,(()=>this.av()),(a=>a()),void 0,r),i]}lv(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.rv||this.uv!==e){var n;(n=this.rv)==null||n.reset(),this.uv=e;var r=this.sv((()=>this.io),(s=>{this.io=s}));this.rv=r[0],this.hv=r[1]}return this.rv}dv(){var t,e=(t=this._instance)==null||(t=t.config)==null?void 0:t.logs;if(!this.nv||this.vv!==e){var n;(n=this.nv)==null||n.reset(),this.vv=e;var r=this.sv((()=>this.ev),(s=>{this.ev=s}),{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},$C);this.nv=r[0],this.fv=r[1]}return this.nv}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e;if(t.ok){var n=(e=t.config.logs)==null?void 0:e.captureConsoleLogs;!Qe(n)&&n&&(this.Yd=!0,this.loadIfEnabled())}}reset(){var t,e;this.io=[],(t=this.rv)==null||t.reset(),this.ev=[],(e=this.nv)==null||e.reset(),this.ku=0}captureLog(t){this.lv().captureLog(t)}ui(t){this.dv().captureLog(t)}get logger(){return this.pv||(this.pv={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.pv}flushLogs(t){t?this.gv(t):(this.rv&&this.rv.flush().catch((e=>this.mv(e))),this.nv&&this.nv.flush().catch((e=>this.mv(e))))}mv(t){HC(t)||this.I.error("PostHog logs flush failed:",t)}loadIfEnabled(){if(this.Yd&&!this.Xd){var t=je==null?void 0:je.__PosthogExtensions__;if(t){var e=t.loadExternalDependency;e?e(this._instance,"logs",(n=>{var r;n||(r=t.logs)==null||!r.initializeLogs?this.I.error("Could not load logs script",n):(t.logs.initializeLogs(this._instance),this.Xd=!0)})):this.I.error(H2)}else this.I.error("PostHog Extensions not found.")}}ov(t,e){var n=this._instance;return{get isDisabled(){return!1},get optedOut(){return!n.is_capturing()},getPersistedProperty:r=>r===Zi.LogsQueue?t():void 0,setPersistedProperty(r,s){var i;r===Zi.LogsQueue&&e((i=s)!==null&&i!==void 0?i:[])},kn:r=>this.kn(r),getLibraryId:()=>kt.LIB_NAME,getLibraryVersion:()=>kt.LIB_VERSION}}kn(t){return new Promise((e=>{if(LP(this.ku,3))e({kind:"fatal",error:i1(void 0,"logs endpoint is unreachable, dropping batch")});else{var n=!1,r=i=>{n||(n=!0,clearTimeout(s),e(i))},s=setTimeout((()=>{this.I.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:i1(void 0,"logs request timed out")})}),9e4);this._instance._send_request({method:"POST",url:this.yv(),data:t,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:i=>{var a=i.statusCode;if(this.bv(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;a===0?(i.error||this.I.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:i1(i.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:(u=i.error)!==null&&u!==void 0?u:new Error("logs request failed with status "+a)})}}})}}))}bv(t){(t!==0||this._instance.__loaded)&&(this.ku=DP(t,this.ku,3,(()=>this.I.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."))))}gv(t){this.io.length>0&&this._v(t,this.io,this.hv,kt.LIB_NAME,(e=>{this.io=e})),this.ev.length>0&&this._v(t,this.ev,this.fv,$C,(e=>{this.ev=e}))}_v(t,e,n,r,s){if(e.length!==0){var i=e.map((u=>u.record));s([]);var a=sP(i,rP(n,kt.LIB_NAME,kt.LIB_VERSION),r,kt.LIB_VERSION);this._instance._send_request({method:"POST",url:this.yv(),data:a,compression:"best-available",batchKey:"logs",transport:t})}}yv(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}av(){var t,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var n=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=n.windowId,s=n.sessionStartTimestamp,i=n.lastActivityTimestamp;e.sessionId=n.sessionId,e.windowId=r,Qe(s)||(e.sessionStartTimestamp=s),Qe(i)||(e.lastActivityTimestamp=i)}if(je!=null&&(t=je.location)!=null&&t.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?ha(je.location.href):je.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},p9={metrics:class{constructor(t){this.I=Lt("[metrics]"),this._instance=t}initialize(){}lv(){var t,e,n=(t=this._instance)==null||(t=t.config)==null?void 0:t.metrics;return this.rv&&this.uv===n||((e=this.rv)==null||e.reset(),this.uv=n,this.rv=new gD(this.ov(),(function(r){var s,i,a,u,c,d=r==null?void 0:r.resourceAttributes;return{serviceName:(s=d==null?void 0:d["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(i=d==null?void 0:d["service.version"])!==null&&i!==void 0?i:r==null?void 0:r.serviceVersion,environment:(a=d==null?void 0:d["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:d,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(u=r==null?void 0:r.flushIntervalMs)!==null&&u!==void 0?u:1e4,maxSeriesPerFlush:(c=r==null?void 0:r.maxSeriesPerFlush)!==null&&c!==void 0?c:1e3}})(n),this.I)),this.rv}count(t,e,n){e===void 0&&(e=1),this.lv().count(t,e,n)}gauge(t,e,n){this.lv().gauge(t,e,n)}histogram(t,e,n){this.lv().histogram(t,e,n)}flush(t){if(!this.rv)return Promise.resolve();if(t){var e=this.rv.drainWindow();return e&&this.Nn(e,t),Promise.resolve()}return this.rv.flush().catch((n=>this.I.error("PostHog metrics flush failed:",n)))}reset(){var t;(t=this.rv)==null||t.reset()}ov(){var t=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},Nn:n=>e.Nn(n),getLibraryId:()=>kt.LIB_NAME,getLibraryVersion:()=>kt.LIB_VERSION}}Nn(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(le({method:"POST",url:this.wv(),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)})}}}))}))}wv(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},m9=le({},m0,r9,s9,i9,o9,a9,u9,l9,c9,d9,f9,h9,p9);Yr.__defaultExtensionClasses=le({},m9);var Se=(function(){kt.SDK_DIST_CHANNEL="npm";var t=Od[Su]=new Yr;return(function(){function e(){e.done||(e.done=!0,u3=!1,yt(Od,(function(n){n._dom_loaded()})))}_e!=null&&_e.addEventListener?_e.readyState==="complete"?e():Vt(_e,"DOMContentLoaded",e,{capture:!1}):ne&&ve.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),t})(),d3;function g9(t){d3=t}function r_(){return d3}var Z2=v.createContext({get client(){return r_()},bootstrap:void 0});function f3(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)||!f3(t[u],e[u],n))return!1}return!0}function v9(t){var e,n,r=t.children,s=t.client,i=t.apiKey,a=t.options,u=v.useRef(null),c=v.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 d=r_();return i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),d},[s,i,JSON.stringify(a)]);return v.useEffect(function(){if(!(s||!i)){var d=r_(),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&&!f3(a,h.options)&&d.set_config(a),u.current={apiKey:i,options:a??{}}):(d.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),d.init(i,a),u.current={apiKey:i,options:a??{}})}},[s,i,JSON.stringify(a)]),ye.createElement(Z2.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 o1=function(t){return typeof t=="function"},g0=function(){var t=v.useContext(Z2).client;return t},s_=function(t,e){return s_=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])},s_(t,e)};function y9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s_(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var _9={componentStack:null,exceptionEvent:null,error:null},w9={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."},x9=(function(t){y9(e,t);function e(n){var r=t.call(this,n)||this;return r.state=_9,r}return e.prototype.componentDidCatch=function(n,r){var s=this.props.additionalProperties,i;o1(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 o1(r)?r():r;var a=o1(s)?ye.createElement(s,{error:i.error,componentStack:i.componentStack,exceptionEvent:i.exceptionEvent}):s;return ye.isValidElement(a)?a:(console.warn(w9.INVALID_FALLBACK),ye.createElement(ye.Fragment,null))},e.contextType=Z2,e})(ye.Component);g9(Se);var fp={},a1={exports:{}},Pr={},l1={exports:{}},u1={};/**
20
+ * @license React
21
+ * scheduler.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var zC;function b9(){return zC||(zC=1,(function(t){function e($,J){var H=$.length;$.push(J);e:for(;0<H;){var j=H-1>>>1,X=$[j];if(0<s(X,J))$[j]=J,$[H]=X,H=j;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var J=$[0],H=$.pop();if(H!==J){$[0]=H;e:for(var j=0,X=$.length,oe=X>>>1;j<oe;){var se=2*(j+1)-1,ee=$[se],ce=se+1,we=$[ce];if(0>s(ee,H))ce<X&&0>s(we,ee)?($[j]=we,$[ce]=H,j=ce):($[j]=ee,$[se]=H,j=se);else if(ce<X&&0>s(we,H))$[j]=we,$[ce]=H,j=ce;else break e}}return J}function s($,J){var H=$.sortIndex-J.sortIndex;return H!==0?H:$.id-J.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=[],d=[],h=1,p=null,m=3,y=!1,w=!1,_=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T($){for(var J=n(d);J!==null;){if(J.callback===null)r(d);else if(J.startTime<=$)r(d),J.sortIndex=J.expirationTime,e(c,J);else break;J=n(d)}}function k($){if(_=!1,T($),!w)if(n(c)!==null)w=!0,G(I);else{var J=n(d);J!==null&&Y(k,J.startTime-$)}}function I($,J){w=!1,_&&(_=!1,b(A),A=-1),y=!0;var H=m;try{for(T(J),p=n(c);p!==null&&(!(p.expirationTime>J)||$&&!N());){var j=p.callback;if(typeof j=="function"){p.callback=null,m=p.priorityLevel;var X=j(p.expirationTime<=J);J=t.unstable_now(),typeof X=="function"?p.callback=X:p===n(c)&&r(c),T(J)}else r(c);p=n(c)}if(p!==null)var oe=!0;else{var se=n(d);se!==null&&Y(k,se.startTime-J),oe=!1}return oe}finally{p=null,m=H,y=!1}}var R=!1,L=null,A=-1,O=5,D=-1;function N(){return!(t.unstable_now()-D<O)}function F(){if(L!==null){var $=t.unstable_now();D=$;var J=!0;try{J=L(!0,$)}finally{J?K():(R=!1,L=null)}}else R=!1}var K;if(typeof P=="function")K=function(){P(F)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,W=Z.port2;Z.port1.onmessage=F,K=function(){W.postMessage(null)}}else K=function(){x(F,0)};function G($){L=$,R||(R=!0,K())}function Y($,J){A=x(function(){$(t.unstable_now())},J)}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(){w||y||(w=!0,G(I))},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"):O=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function($){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var H=m;m=J;try{return $()}finally{m=H}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,J){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=m;m=$;try{return J()}finally{m=H}},t.unstable_scheduleCallback=function($,J,H){var j=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?j+H:j):H=j,$){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=H+X,$={id:h++,callback:J,priorityLevel:$,startTime:H,expirationTime:X,sortIndex:-1},H>j?($.sortIndex=H,e(d,$),n(c)===null&&$===n(d)&&(_?(b(A),A=-1):_=!0,Y(k,H-j))):($.sortIndex=X,e(c,$),w||y||(w=!0,G(I))),$},t.unstable_shouldYield=N,t.unstable_wrapCallback=function($){var J=m;return function(){var H=m;m=J;try{return $.apply(this,arguments)}finally{m=H}}}})(u1)),u1}var BC;function S9(){return BC||(BC=1,l1.exports=b9()),l1.exports}/**
28
+ * @license React
29
+ * react-dom.production.min.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var UC;function E9(){if(UC)return Pr;UC=1;var t=k2(),e=S9();function n(o){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+o,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);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,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function m(o){return c.call(p,o)?!0:c.call(h,o)?!1:d.test(o)?p[o]=!0:(h[o]=!0,!1)}function y(o,l,f,g){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return g?!1:f!==null?!f.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function w(o,l,f,g){if(l===null||typeof l>"u"||y(o,l,f,g))return!0;if(g)return!1;if(f!==null)switch(f.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,f,g,S,C,M){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=g,this.attributeNamespace=S,this.mustUseProperty=f,this.propertyName=o,this.type=l,this.sanitizeURL=C,this.removeEmptyString=M}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){x[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];x[l]=new _(l,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){x[o]=new _(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){x[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){x[o]=new _(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){x[o]=new _(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){x[o]=new _(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){x[o]=new _(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){x[o]=new _(o,5,!1,o.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function P(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(b,P);x[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(b,P);x[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(b,P);x[l]=new _(l,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){x[o]=new _(o,1,!1,o.toLowerCase(),null,!1,!1)}),x.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){x[o]=new _(o,1,!1,o.toLowerCase(),null,!0,!0)});function T(o,l,f,g){var S=x.hasOwnProperty(l)?x[l]:null;(S!==null?S.type!==0:g||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(w(l,f,S,g)&&(f=null),g||S===null?m(l)&&(f===null?o.removeAttribute(l):o.setAttribute(l,""+f)):S.mustUseProperty?o[S.propertyName]=f===null?S.type===3?!1:"":f:(l=S.attributeName,g=S.attributeNamespace,f===null?o.removeAttribute(l):(S=S.type,f=S===3||S===4&&f===!0?"":""+f,g?o.setAttributeNS(g,l,f):o.setAttribute(l,f))))}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),R=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),N=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),$=Symbol.iterator;function J(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var H=Object.assign,j;function X(o){if(j===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);j=l&&l[1]||""}return`
36
+ `+j+o}var oe=!1;function se(o,l){if(!o||oe)return"";oe=!0;var f=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(re){var g=re}Reflect.construct(o,[],l)}else{try{l.call()}catch(re){g=re}o.call(l.prototype)}else{try{throw Error()}catch(re){g=re}o()}}catch(re){if(re&&g&&typeof re.stack=="string"){for(var S=re.stack.split(`
37
+ `),C=g.stack.split(`
38
+ `),M=S.length-1,V=C.length-1;1<=M&&0<=V&&S[M]!==C[V];)V--;for(;1<=M&&0<=V;M--,V--)if(S[M]!==C[V]){if(M!==1||V!==1)do if(M--,V--,0>V||S[M]!==C[V]){var U=`
39
+ `+S[M].replace(" at new "," at ");return o.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",o.displayName)),U}while(1<=M&&0<=V);break}}}finally{oe=!1,Error.prepareStackTrace=f}return(o=o?o.displayName||o.name:"")?X(o):""}function ee(o){switch(o.tag){case 5:return X(o.type);case 16:return X("Lazy");case 13:return X("Suspense");case 19:return X("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 ce(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 L:return"Fragment";case R:return"Portal";case O:return"Profiler";case A:return"StrictMode";case K:return"Suspense";case Z:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case N:return(o.displayName||"Context")+".Consumer";case D:return(o._context.displayName||"Context")+".Provider";case F:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case W:return l=o.displayName||null,l!==null?l:ce(o.type)||"Memo";case G:l=o._payload,o=o._init;try{return ce(o(l))}catch{}}return null}function we(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 ce(l);case 8:return l===A?"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 ue(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function ie(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ne(o){var l=ie(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),g=""+o[l];if(!o.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var S=f.get,C=f.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return S.call(this)},set:function(M){g=""+M,C.call(this,M)}}),Object.defineProperty(o,l,{enumerable:f.enumerable}),{getValue:function(){return g},setValue:function(M){g=""+M},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Ue(o){o._valueTracker||(o._valueTracker=Ne(o))}function Pe(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var f=l.getValue(),g="";return o&&(g=ie(o)?o.checked?"true":"false":o.value),o=g,o!==f?(l.setValue(o),!0):!1}function Ve(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 ht(o,l){var f=l.checked;return H({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??o._wrapperState.initialChecked})}function Jt(o,l){var f=l.defaultValue==null?"":l.defaultValue,g=l.checked!=null?l.checked:l.defaultChecked;f=ue(l.value!=null?l.value:f),o._wrapperState={initialChecked:g,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function be(o,l){l=l.checked,l!=null&&T(o,"checked",l,!1)}function $e(o,l){be(o,l);var f=ue(l.value),g=l.type;if(f!=null)g==="number"?(f===0&&o.value===""||o.value!=f)&&(o.value=""+f):o.value!==""+f&&(o.value=""+f);else if(g==="submit"||g==="reset"){o.removeAttribute("value");return}l.hasOwnProperty("value")?tt(o,l.type,f):l.hasOwnProperty("defaultValue")&&tt(o,l.type,ue(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(o.defaultChecked=!!l.defaultChecked)}function Ge(o,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var g=l.type;if(!(g!=="submit"&&g!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+o._wrapperState.initialValue,f||l===o.value||(o.value=l),o.defaultValue=l}f=o.name,f!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,f!==""&&(o.name=f)}function tt(o,l,f){(l!=="number"||Ve(o.ownerDocument)!==o)&&(f==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+f&&(o.defaultValue=""+f))}var bt=Array.isArray;function nt(o,l,f,g){if(o=o.options,l){l={};for(var S=0;S<f.length;S++)l["$"+f[S]]=!0;for(f=0;f<o.length;f++)S=l.hasOwnProperty("$"+o[f].value),o[f].selected!==S&&(o[f].selected=S),S&&g&&(o[f].defaultSelected=!0)}else{for(f=""+ue(f),l=null,S=0;S<o.length;S++){if(o[S].value===f){o[S].selected=!0,g&&(o[S].defaultSelected=!0);return}l!==null||o[S].disabled||(l=o[S])}l!==null&&(l.selected=!0)}}function Ye(o,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return H({},l,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function an(o,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(n(92));if(bt(f)){if(1<f.length)throw Error(n(93));f=f[0]}l=f}l==null&&(l=""),f=l}o._wrapperState={initialValue:ue(f)}}function ln(o,l){var f=ue(l.value),g=ue(l.defaultValue);f!=null&&(f=""+f,f!==o.value&&(o.value=f),l.defaultValue==null&&o.defaultValue!==f&&(o.defaultValue=f)),g!=null&&(o.defaultValue=""+g)}function Fn(o){var l=o.textContent;l===o._wrapperState.initialValue&&l!==""&&l!==null&&(o.value=l)}function xo(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 Zn(o,l){return o==null||o==="http://www.w3.org/1999/xhtml"?xo(l):o==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var us,yr=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,g,S){MSApp.execUnsafeLocalFunction(function(){return o(l,f,g,S)})}:o})(function(o,l){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=l;else{for(us=us||document.createElement("div"),us.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=us.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;l.firstChild;)o.appendChild(l.firstChild)}});function ir(o,l){if(l){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=l;return}}o.textContent=l}var _r={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},$l=["Webkit","ms","Moz","O"];Object.keys(_r).forEach(function(o){$l.forEach(function(l){l=l+o.charAt(0).toUpperCase()+o.substring(1),_r[l]=_r[o]})});function en(o,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||_r.hasOwnProperty(o)&&_r[o]?(""+l).trim():l+"px"}function bo(o,l){o=o.style;for(var f in l)if(l.hasOwnProperty(f)){var g=f.indexOf("--")===0,S=en(f,l[f],g);f==="float"&&(f="cssFloat"),g?o.setProperty(f,S):o[f]=S}}var So=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 As(o,l){if(l){if(So[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 Rs(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 bn=null;function cs(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Xs=null,mn=null,ds=null;function Eo(o){if(o=Wc(o)){if(typeof Xs!="function")throw Error(n(280));var l=o.stateNode;l&&(l=fh(l),Xs(o.stateNode,o.type,l))}}function Ii(o){mn?ds?ds.push(o):ds=[o]:mn=o}function Ai(){if(mn){var o=mn,l=ds;if(ds=mn=null,Eo(o),l)for(o=0;o<l.length;o++)Eo(l[o])}}function We(o,l){return o(l)}function Gt(){}var Dt=!1;function Sn(o,l,f){if(Dt)return o(l,f);Dt=!0;try{return We(o,l,f)}finally{Dt=!1,(mn!==null||ds!==null)&&(Gt(),Ai())}}function Hr(o,l){var f=o.stateNode;if(f===null)return null;var g=fh(f);if(g===null)return null;f=g[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":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(n(231,l,typeof f));return f}var Kt=!1;if(u)try{var un={};Object.defineProperty(un,"passive",{get:function(){Kt=!0}}),window.addEventListener("test",un,un),window.removeEventListener("test",un,un)}catch{Kt=!1}function or(o,l,f,g,S,C,M,V,U){var re=Array.prototype.slice.call(arguments,3);try{l.apply(f,re)}catch(he){this.onError(he)}}var fs=!1,jn=null,Qs=!1,Pc=null,Bf={onError:function(o){fs=!0,jn=o}};function U0(o,l,f,g,S,C,M,V,U){fs=!1,jn=null,or.apply(Bf,arguments)}function W0(o,l,f,g,S,C,M,V,U){if(U0.apply(this,arguments),fs){if(fs){var re=jn;fs=!1,jn=null}else throw Error(n(198));Qs||(Qs=!0,Pc=re)}}function Ms(o){var l=o,f=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(f=l.return),o=l.return;while(o)}return l.tag===3?f:null}function Uf(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 Wf(o){if(Ms(o)!==o)throw Error(n(188))}function G0(o){var l=o.alternate;if(!l){if(l=Ms(o),l===null)throw Error(n(188));return l!==o?null:o}for(var f=o,g=l;;){var S=f.return;if(S===null)break;var C=S.alternate;if(C===null){if(g=S.return,g!==null){f=g;continue}break}if(S.child===C.child){for(C=S.child;C;){if(C===f)return Wf(S),o;if(C===g)return Wf(S),l;C=C.sibling}throw Error(n(188))}if(f.return!==g.return)f=S,g=C;else{for(var M=!1,V=S.child;V;){if(V===f){M=!0,f=S,g=C;break}if(V===g){M=!0,g=S,f=C;break}V=V.sibling}if(!M){for(V=C.child;V;){if(V===f){M=!0,f=C,g=S;break}if(V===g){M=!0,g=C,f=S;break}V=V.sibling}if(!M)throw Error(n(189))}}if(f.alternate!==g)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?o:l}function Gf(o){return o=G0(o),o!==null?Hl(o):null}function Hl(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var l=Hl(o);if(l!==null)return l;o=o.sibling}return null}var zl=e.unstable_scheduleCallback,Tc=e.unstable_cancelCallback,K0=e.unstable_shouldYield,zx=e.unstable_requestPaint,Ct=e.unstable_now,Kf=e.unstable_getCurrentPriorityLevel,Aa=e.unstable_ImmediatePriority,qf=e.unstable_UserBlockingPriority,Ra=e.unstable_NormalPriority,Bl=e.unstable_LowPriority,Ul=e.unstable_IdlePriority,Ma=null,zr=null;function Zf(o){if(zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(Ma,o,void 0,(o.current.flags&128)===128)}catch{}}var wr=Math.clz32?Math.clz32:Te,B=Math.log,ae=Math.LN2;function Te(o){return o>>>=0,o===0?32:31-(B(o)/ae|0)|0}var pe=64,me=4194304;function Ee(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 qe(o,l){var f=o.pendingLanes;if(f===0)return 0;var g=0,S=o.suspendedLanes,C=o.pingedLanes,M=f&268435455;if(M!==0){var V=M&~S;V!==0?g=Ee(V):(C&=M,C!==0&&(g=Ee(C)))}else M=f&~S,M!==0?g=Ee(M):C!==0&&(g=Ee(C));if(g===0)return 0;if(l!==0&&l!==g&&(l&S)===0&&(S=g&-g,C=l&-l,S>=C||S===16&&(C&4194240)!==0))return l;if((g&4)!==0&&(g|=f&16),l=o.entangledLanes,l!==0)for(o=o.entanglements,l&=g;0<l;)f=31-wr(l),S=1<<f,g|=o[f],l&=~S;return g}function Ce(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 Vn(o,l){for(var f=o.suspendedLanes,g=o.pingedLanes,S=o.expirationTimes,C=o.pendingLanes;0<C;){var M=31-wr(C),V=1<<M,U=S[M];U===-1?((V&f)===0||(V&g)!==0)&&(S[M]=Ce(V,l)):U<=l&&(o.expiredLanes|=V),C&=~V}}function hs(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function Os(){var o=pe;return pe<<=1,(pe&4194240)===0&&(pe=64),o}function Ls(o){for(var l=[],f=0;31>f;f++)l.push(o);return l}function xr(o,l,f){o.pendingLanes|=l,l!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,l=31-wr(l),o[l]=f}function gn(o,l){var f=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 g=o.eventTimes;for(o=o.expirationTimes;0<f;){var S=31-wr(f),C=1<<S;l[S]=0,g[S]=-1,o[S]=-1,f&=~C}}function Ri(o,l){var f=o.entangledLanes|=l;for(o=o.entanglements;f;){var g=31-wr(f),S=1<<g;S&l|o[g]&l&&(o[g]|=l),f&=~S}}var rt=0;function Yf(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var Bx,q0,Ux,Wx,Gx,Z0=!1,Xf=[],Co=null,ko=null,Po=null,Ic=new Map,Ac=new Map,To=[],SM="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 Kx(o,l){switch(o){case"focusin":case"focusout":Co=null;break;case"dragenter":case"dragleave":ko=null;break;case"mouseover":case"mouseout":Po=null;break;case"pointerover":case"pointerout":Ic.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ac.delete(l.pointerId)}}function Rc(o,l,f,g,S,C){return o===null||o.nativeEvent!==C?(o={blockedOn:l,domEventName:f,eventSystemFlags:g,nativeEvent:C,targetContainers:[S]},l!==null&&(l=Wc(l),l!==null&&q0(l)),o):(o.eventSystemFlags|=g,l=o.targetContainers,S!==null&&l.indexOf(S)===-1&&l.push(S),o)}function EM(o,l,f,g,S){switch(l){case"focusin":return Co=Rc(Co,o,l,f,g,S),!0;case"dragenter":return ko=Rc(ko,o,l,f,g,S),!0;case"mouseover":return Po=Rc(Po,o,l,f,g,S),!0;case"pointerover":var C=S.pointerId;return Ic.set(C,Rc(Ic.get(C)||null,o,l,f,g,S)),!0;case"gotpointercapture":return C=S.pointerId,Ac.set(C,Rc(Ac.get(C)||null,o,l,f,g,S)),!0}return!1}function qx(o){var l=Oa(o.target);if(l!==null){var f=Ms(l);if(f!==null){if(l=f.tag,l===13){if(l=Uf(f),l!==null){o.blockedOn=l,Gx(o.priority,function(){Ux(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var f=X0(o.domEventName,o.eventSystemFlags,l[0],o.nativeEvent);if(f===null){f=o.nativeEvent;var g=new f.constructor(f.type,f);bn=g,f.target.dispatchEvent(g),bn=null}else return l=Wc(f),l!==null&&q0(l),o.blockedOn=f,!1;l.shift()}return!0}function Zx(o,l,f){Qf(o)&&f.delete(l)}function CM(){Z0=!1,Co!==null&&Qf(Co)&&(Co=null),ko!==null&&Qf(ko)&&(ko=null),Po!==null&&Qf(Po)&&(Po=null),Ic.forEach(Zx),Ac.forEach(Zx)}function Mc(o,l){o.blockedOn===l&&(o.blockedOn=null,Z0||(Z0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,CM)))}function Oc(o){function l(S){return Mc(S,o)}if(0<Xf.length){Mc(Xf[0],o);for(var f=1;f<Xf.length;f++){var g=Xf[f];g.blockedOn===o&&(g.blockedOn=null)}}for(Co!==null&&Mc(Co,o),ko!==null&&Mc(ko,o),Po!==null&&Mc(Po,o),Ic.forEach(l),Ac.forEach(l),f=0;f<To.length;f++)g=To[f],g.blockedOn===o&&(g.blockedOn=null);for(;0<To.length&&(f=To[0],f.blockedOn===null);)qx(f),f.blockedOn===null&&To.shift()}var Wl=k.ReactCurrentBatchConfig,Jf=!0;function kM(o,l,f,g){var S=rt,C=Wl.transition;Wl.transition=null;try{rt=1,Y0(o,l,f,g)}finally{rt=S,Wl.transition=C}}function PM(o,l,f,g){var S=rt,C=Wl.transition;Wl.transition=null;try{rt=4,Y0(o,l,f,g)}finally{rt=S,Wl.transition=C}}function Y0(o,l,f,g){if(Jf){var S=X0(o,l,f,g);if(S===null)pg(o,l,g,eh,f),Kx(o,g);else if(EM(S,o,l,f,g))g.stopPropagation();else if(Kx(o,g),l&4&&-1<SM.indexOf(o)){for(;S!==null;){var C=Wc(S);if(C!==null&&Bx(C),C=X0(o,l,f,g),C===null&&pg(o,l,g,eh,f),C===S)break;S=C}S!==null&&g.stopPropagation()}else pg(o,l,g,null,f)}}var eh=null;function X0(o,l,f,g){if(eh=null,o=cs(g),o=Oa(o),o!==null)if(l=Ms(o),l===null)o=null;else if(f=l.tag,f===13){if(o=Uf(l),o!==null)return o;o=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null);return eh=o,null}function Yx(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(Kf()){case Aa:return 1;case qf:return 4;case Ra:case Bl:return 16;case Ul:return 536870912;default:return 16}default:return 16}}var Io=null,Q0=null,th=null;function Xx(){if(th)return th;var o,l=Q0,f=l.length,g,S="value"in Io?Io.value:Io.textContent,C=S.length;for(o=0;o<f&&l[o]===S[o];o++);var M=f-o;for(g=1;g<=M&&l[f-g]===S[C-g];g++);return th=S.slice(o,1<g?1-g:void 0)}function nh(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 rh(){return!0}function Qx(){return!1}function Br(o){function l(f,g,S,C,M){this._reactName=f,this._targetInst=S,this.type=g,this.nativeEvent=C,this.target=M,this.currentTarget=null;for(var V in o)o.hasOwnProperty(V)&&(f=o[V],this[V]=f?f(C):C[V]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?rh:Qx,this.isPropagationStopped=Qx,this}return H(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=rh)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=rh)},persist:function(){},isPersistent:rh}),l}var Gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},J0=Br(Gl),Lc=H({},Gl,{view:0,detail:0}),TM=Br(Lc),eg,tg,Dc,sh=H({},Lc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rg,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"?(eg=o.screenX-Dc.screenX,tg=o.screenY-Dc.screenY):tg=eg=0,Dc=o),eg)},movementY:function(o){return"movementY"in o?o.movementY:tg}}),Jx=Br(sh),IM=H({},sh,{dataTransfer:0}),AM=Br(IM),RM=H({},Lc,{relatedTarget:0}),ng=Br(RM),MM=H({},Gl,{animationName:0,elapsedTime:0,pseudoElement:0}),OM=Br(MM),LM=H({},Gl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),DM=Br(LM),NM=H({},Gl,{data:0}),eb=Br(NM),FM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jM={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"},VM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $M(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=VM[o])?!!l[o]:!1}function rg(){return $M}var HM=H({},Lc,{key:function(o){if(o.key){var l=FM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=nh(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?jM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rg,charCode:function(o){return o.type==="keypress"?nh(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?nh(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),zM=Br(HM),BM=H({},sh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tb=Br(BM),UM=H({},Lc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rg}),WM=Br(UM),GM=H({},Gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),KM=Br(GM),qM=H({},sh,{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}),ZM=Br(qM),YM=[9,13,27,32],sg=u&&"CompositionEvent"in window,Nc=null;u&&"documentMode"in document&&(Nc=document.documentMode);var XM=u&&"TextEvent"in window&&!Nc,nb=u&&(!sg||Nc&&8<Nc&&11>=Nc),rb=" ",sb=!1;function ib(o,l){switch(o){case"keyup":return YM.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ob(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Kl=!1;function QM(o,l){switch(o){case"compositionend":return ob(l);case"keypress":return l.which!==32?null:(sb=!0,rb);case"textInput":return o=l.data,o===rb&&sb?null:o;default:return null}}function JM(o,l){if(Kl)return o==="compositionend"||!sg&&ib(o,l)?(o=Xx(),th=Q0=Io=null,Kl=!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 nb&&l.locale!=="ko"?null:l.data;default:return null}}var eO={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 ab(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!eO[o.type]:l==="textarea"}function lb(o,l,f,g){Ii(g),l=uh(l,"onChange"),0<l.length&&(f=new J0("onChange","change",null,f,g),o.push({event:f,listeners:l}))}var Fc=null,jc=null;function tO(o){kb(o,0)}function ih(o){var l=Ql(o);if(Pe(l))return o}function nO(o,l){if(o==="change")return l}var ub=!1;if(u){var ig;if(u){var og="oninput"in document;if(!og){var cb=document.createElement("div");cb.setAttribute("oninput","return;"),og=typeof cb.oninput=="function"}ig=og}else ig=!1;ub=ig&&(!document.documentMode||9<document.documentMode)}function db(){Fc&&(Fc.detachEvent("onpropertychange",fb),jc=Fc=null)}function fb(o){if(o.propertyName==="value"&&ih(jc)){var l=[];lb(l,jc,o,cs(o)),Sn(tO,l)}}function rO(o,l,f){o==="focusin"?(db(),Fc=l,jc=f,Fc.attachEvent("onpropertychange",fb)):o==="focusout"&&db()}function sO(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return ih(jc)}function iO(o,l){if(o==="click")return ih(l)}function oO(o,l){if(o==="input"||o==="change")return ih(l)}function aO(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ds=typeof Object.is=="function"?Object.is:aO;function Vc(o,l){if(Ds(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var f=Object.keys(o),g=Object.keys(l);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var S=f[g];if(!c.call(l,S)||!Ds(o[S],l[S]))return!1}return!0}function hb(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function pb(o,l){var f=hb(o);o=0;for(var g;f;){if(f.nodeType===3){if(g=o+f.textContent.length,o<=l&&g>=l)return{node:f,offset:l-o};o=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=hb(f)}}function mb(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?mb(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function gb(){for(var o=window,l=Ve();l instanceof o.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)o=l.contentWindow;else break;l=Ve(o.document)}return l}function ag(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 lO(o){var l=gb(),f=o.focusedElem,g=o.selectionRange;if(l!==f&&f&&f.ownerDocument&&mb(f.ownerDocument.documentElement,f)){if(g!==null&&ag(f)){if(l=g.start,o=g.end,o===void 0&&(o=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(o,f.value.length);else if(o=(l=f.ownerDocument||document)&&l.defaultView||window,o.getSelection){o=o.getSelection();var S=f.textContent.length,C=Math.min(g.start,S);g=g.end===void 0?C:Math.min(g.end,S),!o.extend&&C>g&&(S=g,g=C,C=S),S=pb(f,C);var M=pb(f,g);S&&M&&(o.rangeCount!==1||o.anchorNode!==S.node||o.anchorOffset!==S.offset||o.focusNode!==M.node||o.focusOffset!==M.offset)&&(l=l.createRange(),l.setStart(S.node,S.offset),o.removeAllRanges(),C>g?(o.addRange(l),o.extend(M.node,M.offset)):(l.setEnd(M.node,M.offset),o.addRange(l)))}}for(l=[],o=f;o=o.parentNode;)o.nodeType===1&&l.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)o=l[f],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var uO=u&&"documentMode"in document&&11>=document.documentMode,ql=null,lg=null,$c=null,ug=!1;function vb(o,l,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;ug||ql==null||ql!==Ve(g)||(g=ql,"selectionStart"in g&&ag(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),$c&&Vc($c,g)||($c=g,g=uh(lg,"onSelect"),0<g.length&&(l=new J0("onSelect","select",null,l,f),o.push({event:l,listeners:g}),l.target=ql)))}function oh(o,l){var f={};return f[o.toLowerCase()]=l.toLowerCase(),f["Webkit"+o]="webkit"+l,f["Moz"+o]="moz"+l,f}var Zl={animationend:oh("Animation","AnimationEnd"),animationiteration:oh("Animation","AnimationIteration"),animationstart:oh("Animation","AnimationStart"),transitionend:oh("Transition","TransitionEnd")},cg={},yb={};u&&(yb=document.createElement("div").style,"AnimationEvent"in window||(delete Zl.animationend.animation,delete Zl.animationiteration.animation,delete Zl.animationstart.animation),"TransitionEvent"in window||delete Zl.transitionend.transition);function ah(o){if(cg[o])return cg[o];if(!Zl[o])return o;var l=Zl[o],f;for(f in l)if(l.hasOwnProperty(f)&&f in yb)return cg[o]=l[f];return o}var _b=ah("animationend"),wb=ah("animationiteration"),xb=ah("animationstart"),bb=ah("transitionend"),Sb=new Map,Eb="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){Sb.set(o,l),i(l,[o])}for(var dg=0;dg<Eb.length;dg++){var fg=Eb[dg],cO=fg.toLowerCase(),dO=fg[0].toUpperCase()+fg.slice(1);Ao(cO,"on"+dO)}Ao(_b,"onAnimationEnd"),Ao(wb,"onAnimationIteration"),Ao(xb,"onAnimationStart"),Ao("dblclick","onDoubleClick"),Ao("focusin","onFocus"),Ao("focusout","onBlur"),Ao(bb,"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 Hc="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(" "),fO=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hc));function Cb(o,l,f){var g=o.type||"unknown-event";o.currentTarget=f,W0(g,l,void 0,o),o.currentTarget=null}function kb(o,l){l=(l&4)!==0;for(var f=0;f<o.length;f++){var g=o[f],S=g.event;g=g.listeners;e:{var C=void 0;if(l)for(var M=g.length-1;0<=M;M--){var V=g[M],U=V.instance,re=V.currentTarget;if(V=V.listener,U!==C&&S.isPropagationStopped())break e;Cb(S,V,re),C=U}else for(M=0;M<g.length;M++){if(V=g[M],U=V.instance,re=V.currentTarget,V=V.listener,U!==C&&S.isPropagationStopped())break e;Cb(S,V,re),C=U}}}if(Qs)throw o=Pc,Qs=!1,Pc=null,o}function Nt(o,l){var f=l[wg];f===void 0&&(f=l[wg]=new Set);var g=o+"__bubble";f.has(g)||(Pb(l,o,2,!1),f.add(g))}function hg(o,l,f){var g=0;l&&(g|=4),Pb(f,o,g,l)}var lh="_reactListening"+Math.random().toString(36).slice(2);function zc(o){if(!o[lh]){o[lh]=!0,r.forEach(function(f){f!=="selectionchange"&&(fO.has(f)||hg(f,!1,o),hg(f,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[lh]||(l[lh]=!0,hg("selectionchange",!1,l))}}function Pb(o,l,f,g){switch(Yx(l)){case 1:var S=kM;break;case 4:S=PM;break;default:S=Y0}f=S.bind(null,l,f,o),S=void 0,!Kt||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(S=!0),g?S!==void 0?o.addEventListener(l,f,{capture:!0,passive:S}):o.addEventListener(l,f,!0):S!==void 0?o.addEventListener(l,f,{passive:S}):o.addEventListener(l,f,!1)}function pg(o,l,f,g,S){var C=g;if((l&1)===0&&(l&2)===0&&g!==null)e:for(;;){if(g===null)return;var M=g.tag;if(M===3||M===4){var V=g.stateNode.containerInfo;if(V===S||V.nodeType===8&&V.parentNode===S)break;if(M===4)for(M=g.return;M!==null;){var U=M.tag;if((U===3||U===4)&&(U=M.stateNode.containerInfo,U===S||U.nodeType===8&&U.parentNode===S))return;M=M.return}for(;V!==null;){if(M=Oa(V),M===null)return;if(U=M.tag,U===5||U===6){g=C=M;continue e}V=V.parentNode}}g=g.return}Sn(function(){var re=C,he=cs(f),ge=[];e:{var fe=Sb.get(o);if(fe!==void 0){var Ie=J0,Oe=o;switch(o){case"keypress":if(nh(f)===0)break e;case"keydown":case"keyup":Ie=zM;break;case"focusin":Oe="focus",Ie=ng;break;case"focusout":Oe="blur",Ie=ng;break;case"beforeblur":case"afterblur":Ie=ng;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ie=Jx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ie=AM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ie=WM;break;case _b:case wb:case xb:Ie=OM;break;case bb:Ie=KM;break;case"scroll":Ie=TM;break;case"wheel":Ie=ZM;break;case"copy":case"cut":case"paste":Ie=DM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ie=tb}var De=(l&4)!==0,cn=!De&&o==="scroll",Q=De?fe!==null?fe+"Capture":null:fe;De=[];for(var q=re,te;q!==null;){te=q;var xe=te.stateNode;if(te.tag===5&&xe!==null&&(te=xe,Q!==null&&(xe=Hr(q,Q),xe!=null&&De.push(Bc(q,xe,te)))),cn)break;q=q.return}0<De.length&&(fe=new Ie(fe,Oe,null,f,he),ge.push({event:fe,listeners:De}))}}if((l&7)===0){e:{if(fe=o==="mouseover"||o==="pointerover",Ie=o==="mouseout"||o==="pointerout",fe&&f!==bn&&(Oe=f.relatedTarget||f.fromElement)&&(Oa(Oe)||Oe[Mi]))break e;if((Ie||fe)&&(fe=he.window===he?he:(fe=he.ownerDocument)?fe.defaultView||fe.parentWindow:window,Ie?(Oe=f.relatedTarget||f.toElement,Ie=re,Oe=Oe?Oa(Oe):null,Oe!==null&&(cn=Ms(Oe),Oe!==cn||Oe.tag!==5&&Oe.tag!==6)&&(Oe=null)):(Ie=null,Oe=re),Ie!==Oe)){if(De=Jx,xe="onMouseLeave",Q="onMouseEnter",q="mouse",(o==="pointerout"||o==="pointerover")&&(De=tb,xe="onPointerLeave",Q="onPointerEnter",q="pointer"),cn=Ie==null?fe:Ql(Ie),te=Oe==null?fe:Ql(Oe),fe=new De(xe,q+"leave",Ie,f,he),fe.target=cn,fe.relatedTarget=te,xe=null,Oa(he)===re&&(De=new De(Q,q+"enter",Oe,f,he),De.target=te,De.relatedTarget=cn,xe=De),cn=xe,Ie&&Oe)t:{for(De=Ie,Q=Oe,q=0,te=De;te;te=Yl(te))q++;for(te=0,xe=Q;xe;xe=Yl(xe))te++;for(;0<q-te;)De=Yl(De),q--;for(;0<te-q;)Q=Yl(Q),te--;for(;q--;){if(De===Q||Q!==null&&De===Q.alternate)break t;De=Yl(De),Q=Yl(Q)}De=null}else De=null;Ie!==null&&Tb(ge,fe,Ie,De,!1),Oe!==null&&cn!==null&&Tb(ge,cn,Oe,De,!0)}}e:{if(fe=re?Ql(re):window,Ie=fe.nodeName&&fe.nodeName.toLowerCase(),Ie==="select"||Ie==="input"&&fe.type==="file")var Fe=nO;else if(ab(fe))if(ub)Fe=oO;else{Fe=sO;var ze=rO}else(Ie=fe.nodeName)&&Ie.toLowerCase()==="input"&&(fe.type==="checkbox"||fe.type==="radio")&&(Fe=iO);if(Fe&&(Fe=Fe(o,re))){lb(ge,Fe,f,he);break e}ze&&ze(o,fe,re),o==="focusout"&&(ze=fe._wrapperState)&&ze.controlled&&fe.type==="number"&&tt(fe,"number",fe.value)}switch(ze=re?Ql(re):window,o){case"focusin":(ab(ze)||ze.contentEditable==="true")&&(ql=ze,lg=re,$c=null);break;case"focusout":$c=lg=ql=null;break;case"mousedown":ug=!0;break;case"contextmenu":case"mouseup":case"dragend":ug=!1,vb(ge,f,he);break;case"selectionchange":if(uO)break;case"keydown":case"keyup":vb(ge,f,he)}var Be;if(sg)e:{switch(o){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Kl?ib(o,f)&&(Xe="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Xe="onCompositionStart");Xe&&(nb&&f.locale!=="ko"&&(Kl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Kl&&(Be=Xx()):(Io=he,Q0="value"in Io?Io.value:Io.textContent,Kl=!0)),ze=uh(re,Xe),0<ze.length&&(Xe=new eb(Xe,o,null,f,he),ge.push({event:Xe,listeners:ze}),Be?Xe.data=Be:(Be=ob(f),Be!==null&&(Xe.data=Be)))),(Be=XM?QM(o,f):JM(o,f))&&(re=uh(re,"onBeforeInput"),0<re.length&&(he=new eb("onBeforeInput","beforeinput",null,f,he),ge.push({event:he,listeners:re}),he.data=Be))}kb(ge,l)})}function Bc(o,l,f){return{instance:o,listener:l,currentTarget:f}}function uh(o,l){for(var f=l+"Capture",g=[];o!==null;){var S=o,C=S.stateNode;S.tag===5&&C!==null&&(S=C,C=Hr(o,f),C!=null&&g.unshift(Bc(o,C,S)),C=Hr(o,l),C!=null&&g.push(Bc(o,C,S))),o=o.return}return g}function Yl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Tb(o,l,f,g,S){for(var C=l._reactName,M=[];f!==null&&f!==g;){var V=f,U=V.alternate,re=V.stateNode;if(U!==null&&U===g)break;V.tag===5&&re!==null&&(V=re,S?(U=Hr(f,C),U!=null&&M.unshift(Bc(f,U,V))):S||(U=Hr(f,C),U!=null&&M.push(Bc(f,U,V)))),f=f.return}M.length!==0&&o.push({event:l,listeners:M})}var hO=/\r\n?/g,pO=/\u0000|\uFFFD/g;function Ib(o){return(typeof o=="string"?o:""+o).replace(hO,`
40
+ `).replace(pO,"")}function ch(o,l,f){if(l=Ib(l),Ib(o)!==l&&f)throw Error(n(425))}function dh(){}var mg=null,gg=null;function vg(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 yg=typeof setTimeout=="function"?setTimeout:void 0,mO=typeof clearTimeout=="function"?clearTimeout:void 0,Ab=typeof Promise=="function"?Promise:void 0,gO=typeof queueMicrotask=="function"?queueMicrotask:typeof Ab<"u"?function(o){return Ab.resolve(null).then(o).catch(vO)}:yg;function vO(o){setTimeout(function(){throw o})}function _g(o,l){var f=l,g=0;do{var S=f.nextSibling;if(o.removeChild(f),S&&S.nodeType===8)if(f=S.data,f==="/$"){if(g===0){o.removeChild(S),Oc(l);return}g--}else f!=="$"&&f!=="$?"&&f!=="$!"||g++;f=S}while(f);Oc(l)}function Ro(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 Rb(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return o;l--}else f==="/$"&&l++}o=o.previousSibling}return null}var Xl=Math.random().toString(36).slice(2),Js="__reactFiber$"+Xl,Uc="__reactProps$"+Xl,Mi="__reactContainer$"+Xl,wg="__reactEvents$"+Xl,yO="__reactListeners$"+Xl,_O="__reactHandles$"+Xl;function Oa(o){var l=o[Js];if(l)return l;for(var f=o.parentNode;f;){if(l=f[Mi]||f[Js]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(o=Rb(o);o!==null;){if(f=o[Js])return f;o=Rb(o)}return l}o=f,f=o.parentNode}return null}function Wc(o){return o=o[Js]||o[Mi],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Ql(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(n(33))}function fh(o){return o[Uc]||null}var xg=[],Jl=-1;function Mo(o){return{current:o}}function Ft(o){0>Jl||(o.current=xg[Jl],xg[Jl]=null,Jl--)}function Ot(o,l){Jl++,xg[Jl]=o.current,o.current=l}var Oo={},Yn=Mo(Oo),br=Mo(!1),La=Oo;function eu(o,l){var f=o.type.contextTypes;if(!f)return Oo;var g=o.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===l)return g.__reactInternalMemoizedMaskedChildContext;var S={},C;for(C in f)S[C]=l[C];return g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=l,o.__reactInternalMemoizedMaskedChildContext=S),S}function Sr(o){return o=o.childContextTypes,o!=null}function hh(){Ft(br),Ft(Yn)}function Mb(o,l,f){if(Yn.current!==Oo)throw Error(n(168));Ot(Yn,l),Ot(br,f)}function Ob(o,l,f){var g=o.stateNode;if(l=l.childContextTypes,typeof g.getChildContext!="function")return f;g=g.getChildContext();for(var S in g)if(!(S in l))throw Error(n(108,we(o)||"Unknown",S));return H({},f,g)}function ph(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Oo,La=Yn.current,Ot(Yn,o),Ot(br,br.current),!0}function Lb(o,l,f){var g=o.stateNode;if(!g)throw Error(n(169));f?(o=Ob(o,l,La),g.__reactInternalMemoizedMergedChildContext=o,Ft(br),Ft(Yn),Ot(Yn,o)):Ft(br),Ot(br,f)}var Oi=null,mh=!1,bg=!1;function Db(o){Oi===null?Oi=[o]:Oi.push(o)}function wO(o){mh=!0,Db(o)}function Lo(){if(!bg&&Oi!==null){bg=!0;var o=0,l=rt;try{var f=Oi;for(rt=1;o<f.length;o++){var g=f[o];do g=g(!0);while(g!==null)}Oi=null,mh=!1}catch(S){throw Oi!==null&&(Oi=Oi.slice(o+1)),zl(Aa,Lo),S}finally{rt=l,bg=!1}}return null}var tu=[],nu=0,gh=null,vh=0,ps=[],ms=0,Da=null,Li=1,Di="";function Na(o,l){tu[nu++]=vh,tu[nu++]=gh,gh=o,vh=l}function Nb(o,l,f){ps[ms++]=Li,ps[ms++]=Di,ps[ms++]=Da,Da=o;var g=Li;o=Di;var S=32-wr(g)-1;g&=~(1<<S),f+=1;var C=32-wr(l)+S;if(30<C){var M=S-S%5;C=(g&(1<<M)-1).toString(32),g>>=M,S-=M,Li=1<<32-wr(l)+S|f<<S|g,Di=C+o}else Li=1<<C|f<<S|g,Di=o}function Sg(o){o.return!==null&&(Na(o,1),Nb(o,1,0))}function Eg(o){for(;o===gh;)gh=tu[--nu],tu[nu]=null,vh=tu[--nu],tu[nu]=null;for(;o===Da;)Da=ps[--ms],ps[ms]=null,Di=ps[--ms],ps[ms]=null,Li=ps[--ms],ps[ms]=null}var Ur=null,Wr=null,Bt=!1,Ns=null;function Fb(o,l){var f=_s(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=o,l=o.deletions,l===null?(o.deletions=[f],o.flags|=16):l.push(f)}function jb(o,l){switch(o.tag){case 5:var f=o.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(o.stateNode=l,Ur=o,Wr=Ro(l.firstChild),!0):!1;case 6:return l=o.pendingProps===""||l.nodeType!==3?null:l,l!==null?(o.stateNode=l,Ur=o,Wr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Da!==null?{id:Li,overflow:Di}:null,o.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=_s(18,null,null,0),f.stateNode=l,f.return=o,o.child=f,Ur=o,Wr=null,!0):!1;default:return!1}}function Cg(o){return(o.mode&1)!==0&&(o.flags&128)===0}function kg(o){if(Bt){var l=Wr;if(l){var f=l;if(!jb(o,l)){if(Cg(o))throw Error(n(418));l=Ro(f.nextSibling);var g=Ur;l&&jb(o,l)?Fb(g,f):(o.flags=o.flags&-4097|2,Bt=!1,Ur=o)}}else{if(Cg(o))throw Error(n(418));o.flags=o.flags&-4097|2,Bt=!1,Ur=o}}}function Vb(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Ur=o}function yh(o){if(o!==Ur)return!1;if(!Bt)return Vb(o),Bt=!0,!1;var l;if((l=o.tag!==3)&&!(l=o.tag!==5)&&(l=o.type,l=l!=="head"&&l!=="body"&&!vg(o.type,o.memoizedProps)),l&&(l=Wr)){if(Cg(o))throw $b(),Error(n(418));for(;l;)Fb(o,l),l=Ro(l.nextSibling)}if(Vb(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 f=o.data;if(f==="/$"){if(l===0){Wr=Ro(o.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}o=o.nextSibling}Wr=null}}else Wr=Ur?Ro(o.stateNode.nextSibling):null;return!0}function $b(){for(var o=Wr;o;)o=Ro(o.nextSibling)}function ru(){Wr=Ur=null,Bt=!1}function Pg(o){Ns===null?Ns=[o]:Ns.push(o)}var xO=k.ReactCurrentBatchConfig;function Gc(o,l,f){if(o=f.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var g=f.stateNode}if(!g)throw Error(n(147,o));var S=g,C=""+o;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===C?l.ref:(l=function(M){var V=S.refs;M===null?delete V[C]:V[C]=M},l._stringRef=C,l)}if(typeof o!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,o))}return o}function _h(o,l){throw o=Object.prototype.toString.call(l),Error(n(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o))}function Hb(o){var l=o._init;return l(o._payload)}function zb(o){function l(Q,q){if(o){var te=Q.deletions;te===null?(Q.deletions=[q],Q.flags|=16):te.push(q)}}function f(Q,q){if(!o)return null;for(;q!==null;)l(Q,q),q=q.sibling;return null}function g(Q,q){for(Q=new Map;q!==null;)q.key!==null?Q.set(q.key,q):Q.set(q.index,q),q=q.sibling;return Q}function S(Q,q){return Q=zo(Q,q),Q.index=0,Q.sibling=null,Q}function C(Q,q,te){return Q.index=te,o?(te=Q.alternate,te!==null?(te=te.index,te<q?(Q.flags|=2,q):te):(Q.flags|=2,q)):(Q.flags|=1048576,q)}function M(Q){return o&&Q.alternate===null&&(Q.flags|=2),Q}function V(Q,q,te,xe){return q===null||q.tag!==6?(q=yv(te,Q.mode,xe),q.return=Q,q):(q=S(q,te),q.return=Q,q)}function U(Q,q,te,xe){var Fe=te.type;return Fe===L?he(Q,q,te.props.children,xe,te.key):q!==null&&(q.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===G&&Hb(Fe)===q.type)?(xe=S(q,te.props),xe.ref=Gc(Q,q,te),xe.return=Q,xe):(xe=Bh(te.type,te.key,te.props,null,Q.mode,xe),xe.ref=Gc(Q,q,te),xe.return=Q,xe)}function re(Q,q,te,xe){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=_v(te,Q.mode,xe),q.return=Q,q):(q=S(q,te.children||[]),q.return=Q,q)}function he(Q,q,te,xe,Fe){return q===null||q.tag!==7?(q=Ua(te,Q.mode,xe,Fe),q.return=Q,q):(q=S(q,te),q.return=Q,q)}function ge(Q,q,te){if(typeof q=="string"&&q!==""||typeof q=="number")return q=yv(""+q,Q.mode,te),q.return=Q,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case I:return te=Bh(q.type,q.key,q.props,null,Q.mode,te),te.ref=Gc(Q,null,q),te.return=Q,te;case R:return q=_v(q,Q.mode,te),q.return=Q,q;case G:var xe=q._init;return ge(Q,xe(q._payload),te)}if(bt(q)||J(q))return q=Ua(q,Q.mode,te,null),q.return=Q,q;_h(Q,q)}return null}function fe(Q,q,te,xe){var Fe=q!==null?q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Fe!==null?null:V(Q,q,""+te,xe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case I:return te.key===Fe?U(Q,q,te,xe):null;case R:return te.key===Fe?re(Q,q,te,xe):null;case G:return Fe=te._init,fe(Q,q,Fe(te._payload),xe)}if(bt(te)||J(te))return Fe!==null?null:he(Q,q,te,xe,null);_h(Q,te)}return null}function Ie(Q,q,te,xe,Fe){if(typeof xe=="string"&&xe!==""||typeof xe=="number")return Q=Q.get(te)||null,V(q,Q,""+xe,Fe);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case I:return Q=Q.get(xe.key===null?te:xe.key)||null,U(q,Q,xe,Fe);case R:return Q=Q.get(xe.key===null?te:xe.key)||null,re(q,Q,xe,Fe);case G:var ze=xe._init;return Ie(Q,q,te,ze(xe._payload),Fe)}if(bt(xe)||J(xe))return Q=Q.get(te)||null,he(q,Q,xe,Fe,null);_h(q,xe)}return null}function Oe(Q,q,te,xe){for(var Fe=null,ze=null,Be=q,Xe=q=0,An=null;Be!==null&&Xe<te.length;Xe++){Be.index>Xe?(An=Be,Be=null):An=Be.sibling;var mt=fe(Q,Be,te[Xe],xe);if(mt===null){Be===null&&(Be=An);break}o&&Be&&mt.alternate===null&&l(Q,Be),q=C(mt,q,Xe),ze===null?Fe=mt:ze.sibling=mt,ze=mt,Be=An}if(Xe===te.length)return f(Q,Be),Bt&&Na(Q,Xe),Fe;if(Be===null){for(;Xe<te.length;Xe++)Be=ge(Q,te[Xe],xe),Be!==null&&(q=C(Be,q,Xe),ze===null?Fe=Be:ze.sibling=Be,ze=Be);return Bt&&Na(Q,Xe),Fe}for(Be=g(Q,Be);Xe<te.length;Xe++)An=Ie(Be,Q,Xe,te[Xe],xe),An!==null&&(o&&An.alternate!==null&&Be.delete(An.key===null?Xe:An.key),q=C(An,q,Xe),ze===null?Fe=An:ze.sibling=An,ze=An);return o&&Be.forEach(function(Bo){return l(Q,Bo)}),Bt&&Na(Q,Xe),Fe}function De(Q,q,te,xe){var Fe=J(te);if(typeof Fe!="function")throw Error(n(150));if(te=Fe.call(te),te==null)throw Error(n(151));for(var ze=Fe=null,Be=q,Xe=q=0,An=null,mt=te.next();Be!==null&&!mt.done;Xe++,mt=te.next()){Be.index>Xe?(An=Be,Be=null):An=Be.sibling;var Bo=fe(Q,Be,mt.value,xe);if(Bo===null){Be===null&&(Be=An);break}o&&Be&&Bo.alternate===null&&l(Q,Be),q=C(Bo,q,Xe),ze===null?Fe=Bo:ze.sibling=Bo,ze=Bo,Be=An}if(mt.done)return f(Q,Be),Bt&&Na(Q,Xe),Fe;if(Be===null){for(;!mt.done;Xe++,mt=te.next())mt=ge(Q,mt.value,xe),mt!==null&&(q=C(mt,q,Xe),ze===null?Fe=mt:ze.sibling=mt,ze=mt);return Bt&&Na(Q,Xe),Fe}for(Be=g(Q,Be);!mt.done;Xe++,mt=te.next())mt=Ie(Be,Q,Xe,mt.value,xe),mt!==null&&(o&&mt.alternate!==null&&Be.delete(mt.key===null?Xe:mt.key),q=C(mt,q,Xe),ze===null?Fe=mt:ze.sibling=mt,ze=mt);return o&&Be.forEach(function(eL){return l(Q,eL)}),Bt&&Na(Q,Xe),Fe}function cn(Q,q,te,xe){if(typeof te=="object"&&te!==null&&te.type===L&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case I:e:{for(var Fe=te.key,ze=q;ze!==null;){if(ze.key===Fe){if(Fe=te.type,Fe===L){if(ze.tag===7){f(Q,ze.sibling),q=S(ze,te.props.children),q.return=Q,Q=q;break e}}else if(ze.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===G&&Hb(Fe)===ze.type){f(Q,ze.sibling),q=S(ze,te.props),q.ref=Gc(Q,ze,te),q.return=Q,Q=q;break e}f(Q,ze);break}else l(Q,ze);ze=ze.sibling}te.type===L?(q=Ua(te.props.children,Q.mode,xe,te.key),q.return=Q,Q=q):(xe=Bh(te.type,te.key,te.props,null,Q.mode,xe),xe.ref=Gc(Q,q,te),xe.return=Q,Q=xe)}return M(Q);case R:e:{for(ze=te.key;q!==null;){if(q.key===ze)if(q.tag===4&&q.stateNode.containerInfo===te.containerInfo&&q.stateNode.implementation===te.implementation){f(Q,q.sibling),q=S(q,te.children||[]),q.return=Q,Q=q;break e}else{f(Q,q);break}else l(Q,q);q=q.sibling}q=_v(te,Q.mode,xe),q.return=Q,Q=q}return M(Q);case G:return ze=te._init,cn(Q,q,ze(te._payload),xe)}if(bt(te))return Oe(Q,q,te,xe);if(J(te))return De(Q,q,te,xe);_h(Q,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,q!==null&&q.tag===6?(f(Q,q.sibling),q=S(q,te),q.return=Q,Q=q):(f(Q,q),q=yv(te,Q.mode,xe),q.return=Q,Q=q),M(Q)):f(Q,q)}return cn}var su=zb(!0),Bb=zb(!1),wh=Mo(null),xh=null,iu=null,Tg=null;function Ig(){Tg=iu=xh=null}function Ag(o){var l=wh.current;Ft(wh),o._currentValue=l}function Rg(o,l,f){for(;o!==null;){var g=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,g!==null&&(g.childLanes|=l)):g!==null&&(g.childLanes&l)!==l&&(g.childLanes|=l),o===f)break;o=o.return}}function ou(o,l){xh=o,Tg=iu=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&l)!==0&&(Er=!0),o.firstContext=null)}function gs(o){var l=o._currentValue;if(Tg!==o)if(o={context:o,memoizedValue:l,next:null},iu===null){if(xh===null)throw Error(n(308));iu=o,xh.dependencies={lanes:0,firstContext:o}}else iu=iu.next=o;return l}var Fa=null;function Mg(o){Fa===null?Fa=[o]:Fa.push(o)}function Ub(o,l,f,g){var S=l.interleaved;return S===null?(f.next=f,Mg(l)):(f.next=S.next,S.next=f),l.interleaved=f,Ni(o,g)}function Ni(o,l){o.lanes|=l;var f=o.alternate;for(f!==null&&(f.lanes|=l),f=o,o=o.return;o!==null;)o.childLanes|=l,f=o.alternate,f!==null&&(f.childLanes|=l),f=o,o=o.return;return f.tag===3?f.stateNode:null}var Do=!1;function Og(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wb(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 Fi(o,l){return{eventTime:o,lane:l,tag:0,payload:null,callback:null,next:null}}function No(o,l,f){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(pt&2)!==0){var S=g.pending;return S===null?l.next=l:(l.next=S.next,S.next=l),g.pending=l,Ni(o,f)}return S=g.interleaved,S===null?(l.next=l,Mg(g)):(l.next=S.next,S.next=l),g.interleaved=l,Ni(o,f)}function bh(o,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var g=l.lanes;g&=o.pendingLanes,f|=g,l.lanes=f,Ri(o,f)}}function Gb(o,l){var f=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var S=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var M={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};C===null?S=C=M:C=C.next=M,f=f.next}while(f!==null);C===null?S=C=l:C=C.next=l}else S=C=l;f={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:C,shared:g.shared,effects:g.effects},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=l:o.next=l,f.lastBaseUpdate=l}function Sh(o,l,f,g){var S=o.updateQueue;Do=!1;var C=S.firstBaseUpdate,M=S.lastBaseUpdate,V=S.shared.pending;if(V!==null){S.shared.pending=null;var U=V,re=U.next;U.next=null,M===null?C=re:M.next=re,M=U;var he=o.alternate;he!==null&&(he=he.updateQueue,V=he.lastBaseUpdate,V!==M&&(V===null?he.firstBaseUpdate=re:V.next=re,he.lastBaseUpdate=U))}if(C!==null){var ge=S.baseState;M=0,he=re=U=null,V=C;do{var fe=V.lane,Ie=V.eventTime;if((g&fe)===fe){he!==null&&(he=he.next={eventTime:Ie,lane:0,tag:V.tag,payload:V.payload,callback:V.callback,next:null});e:{var Oe=o,De=V;switch(fe=l,Ie=f,De.tag){case 1:if(Oe=De.payload,typeof Oe=="function"){ge=Oe.call(Ie,ge,fe);break e}ge=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=De.payload,fe=typeof Oe=="function"?Oe.call(Ie,ge,fe):Oe,fe==null)break e;ge=H({},ge,fe);break e;case 2:Do=!0}}V.callback!==null&&V.lane!==0&&(o.flags|=64,fe=S.effects,fe===null?S.effects=[V]:fe.push(V))}else Ie={eventTime:Ie,lane:fe,tag:V.tag,payload:V.payload,callback:V.callback,next:null},he===null?(re=he=Ie,U=ge):he=he.next=Ie,M|=fe;if(V=V.next,V===null){if(V=S.shared.pending,V===null)break;fe=V,V=fe.next,fe.next=null,S.lastBaseUpdate=fe,S.shared.pending=null}}while(!0);if(he===null&&(U=ge),S.baseState=U,S.firstBaseUpdate=re,S.lastBaseUpdate=he,l=S.shared.interleaved,l!==null){S=l;do M|=S.lane,S=S.next;while(S!==l)}else C===null&&(S.shared.lanes=0);$a|=M,o.lanes=M,o.memoizedState=ge}}function Kb(o,l,f){if(o=l.effects,l.effects=null,o!==null)for(l=0;l<o.length;l++){var g=o[l],S=g.callback;if(S!==null){if(g.callback=null,g=f,typeof S!="function")throw Error(n(191,S));S.call(g)}}}var Kc={},ei=Mo(Kc),qc=Mo(Kc),Zc=Mo(Kc);function ja(o){if(o===Kc)throw Error(n(174));return o}function Lg(o,l){switch(Ot(Zc,l),Ot(qc,o),Ot(ei,Kc),o=l.nodeType,o){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:Zn(null,"");break;default:o=o===8?l.parentNode:l,l=o.namespaceURI||null,o=o.tagName,l=Zn(l,o)}Ft(ei),Ot(ei,l)}function au(){Ft(ei),Ft(qc),Ft(Zc)}function qb(o){ja(Zc.current);var l=ja(ei.current),f=Zn(l,o.type);l!==f&&(Ot(qc,o),Ot(ei,f))}function Dg(o){qc.current===o&&(Ft(ei),Ft(qc))}var qt=Mo(0);function Eh(o){for(var l=o;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.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 Ng=[];function Fg(){for(var o=0;o<Ng.length;o++)Ng[o]._workInProgressVersionPrimary=null;Ng.length=0}var Ch=k.ReactCurrentDispatcher,jg=k.ReactCurrentBatchConfig,Va=0,Zt=null,En=null,Tn=null,kh=!1,Yc=!1,Xc=0,bO=0;function Xn(){throw Error(n(321))}function Vg(o,l){if(l===null)return!1;for(var f=0;f<l.length&&f<o.length;f++)if(!Ds(o[f],l[f]))return!1;return!0}function $g(o,l,f,g,S,C){if(Va=C,Zt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,Ch.current=o===null||o.memoizedState===null?kO:PO,o=f(g,S),Yc){C=0;do{if(Yc=!1,Xc=0,25<=C)throw Error(n(301));C+=1,Tn=En=null,l.updateQueue=null,Ch.current=TO,o=f(g,S)}while(Yc)}if(Ch.current=Ih,l=En!==null&&En.next!==null,Va=0,Tn=En=Zt=null,kh=!1,l)throw Error(n(300));return o}function Hg(){var o=Xc!==0;return Xc=0,o}function ti(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?Zt.memoizedState=Tn=o:Tn=Tn.next=o,Tn}function vs(){if(En===null){var o=Zt.alternate;o=o!==null?o.memoizedState:null}else o=En.next;var l=Tn===null?Zt.memoizedState:Tn.next;if(l!==null)Tn=l,En=o;else{if(o===null)throw Error(n(310));En=o,o={memoizedState:En.memoizedState,baseState:En.baseState,baseQueue:En.baseQueue,queue:En.queue,next:null},Tn===null?Zt.memoizedState=Tn=o:Tn=Tn.next=o}return Tn}function Qc(o,l){return typeof l=="function"?l(o):l}function zg(o){var l=vs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var g=En,S=g.baseQueue,C=f.pending;if(C!==null){if(S!==null){var M=S.next;S.next=C.next,C.next=M}g.baseQueue=S=C,f.pending=null}if(S!==null){C=S.next,g=g.baseState;var V=M=null,U=null,re=C;do{var he=re.lane;if((Va&he)===he)U!==null&&(U=U.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),g=re.hasEagerState?re.eagerState:o(g,re.action);else{var ge={lane:he,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};U===null?(V=U=ge,M=g):U=U.next=ge,Zt.lanes|=he,$a|=he}re=re.next}while(re!==null&&re!==C);U===null?M=g:U.next=V,Ds(g,l.memoizedState)||(Er=!0),l.memoizedState=g,l.baseState=M,l.baseQueue=U,f.lastRenderedState=g}if(o=f.interleaved,o!==null){S=o;do C=S.lane,Zt.lanes|=C,$a|=C,S=S.next;while(S!==o)}else S===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function Bg(o){var l=vs(),f=l.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=o;var g=f.dispatch,S=f.pending,C=l.memoizedState;if(S!==null){f.pending=null;var M=S=S.next;do C=o(C,M.action),M=M.next;while(M!==S);Ds(C,l.memoizedState)||(Er=!0),l.memoizedState=C,l.baseQueue===null&&(l.baseState=C),f.lastRenderedState=C}return[C,g]}function Zb(){}function Yb(o,l){var f=Zt,g=vs(),S=l(),C=!Ds(g.memoizedState,S);if(C&&(g.memoizedState=S,Er=!0),g=g.queue,Ug(Jb.bind(null,f,g,o),[o]),g.getSnapshot!==l||C||Tn!==null&&Tn.memoizedState.tag&1){if(f.flags|=2048,Jc(9,Qb.bind(null,f,g,S,l),void 0,null),In===null)throw Error(n(349));(Va&30)!==0||Xb(f,l,S)}return S}function Xb(o,l,f){o.flags|=16384,o={getSnapshot:l,value:f},l=Zt.updateQueue,l===null?(l={lastEffect:null,stores:null},Zt.updateQueue=l,l.stores=[o]):(f=l.stores,f===null?l.stores=[o]:f.push(o))}function Qb(o,l,f,g){l.value=f,l.getSnapshot=g,eS(l)&&tS(o)}function Jb(o,l,f){return f(function(){eS(l)&&tS(o)})}function eS(o){var l=o.getSnapshot;o=o.value;try{var f=l();return!Ds(o,f)}catch{return!0}}function tS(o){var l=Ni(o,1);l!==null&&$s(l,o,1,-1)}function nS(o){var l=ti();return typeof o=="function"&&(o=o()),l.memoizedState=l.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qc,lastRenderedState:o},l.queue=o,o=o.dispatch=CO.bind(null,Zt,o),[l.memoizedState,o]}function Jc(o,l,f,g){return o={tag:o,create:l,destroy:f,deps:g,next:null},l=Zt.updateQueue,l===null?(l={lastEffect:null,stores:null},Zt.updateQueue=l,l.lastEffect=o.next=o):(f=l.lastEffect,f===null?l.lastEffect=o.next=o:(g=f.next,f.next=o,o.next=g,l.lastEffect=o)),o}function rS(){return vs().memoizedState}function Ph(o,l,f,g){var S=ti();Zt.flags|=o,S.memoizedState=Jc(1|l,f,void 0,g===void 0?null:g)}function Th(o,l,f,g){var S=vs();g=g===void 0?null:g;var C=void 0;if(En!==null){var M=En.memoizedState;if(C=M.destroy,g!==null&&Vg(g,M.deps)){S.memoizedState=Jc(l,f,C,g);return}}Zt.flags|=o,S.memoizedState=Jc(1|l,f,C,g)}function sS(o,l){return Ph(8390656,8,o,l)}function Ug(o,l){return Th(2048,8,o,l)}function iS(o,l){return Th(4,2,o,l)}function oS(o,l){return Th(4,4,o,l)}function aS(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 lS(o,l,f){return f=f!=null?f.concat([o]):null,Th(4,4,aS.bind(null,l,o),f)}function Wg(){}function uS(o,l){var f=vs();l=l===void 0?null:l;var g=f.memoizedState;return g!==null&&l!==null&&Vg(l,g[1])?g[0]:(f.memoizedState=[o,l],o)}function cS(o,l){var f=vs();l=l===void 0?null:l;var g=f.memoizedState;return g!==null&&l!==null&&Vg(l,g[1])?g[0]:(o=o(),f.memoizedState=[o,l],o)}function dS(o,l,f){return(Va&21)===0?(o.baseState&&(o.baseState=!1,Er=!0),o.memoizedState=f):(Ds(f,l)||(f=Os(),Zt.lanes|=f,$a|=f,o.baseState=!0),l)}function SO(o,l){var f=rt;rt=f!==0&&4>f?f:4,o(!0);var g=jg.transition;jg.transition={};try{o(!1),l()}finally{rt=f,jg.transition=g}}function fS(){return vs().memoizedState}function EO(o,l,f){var g=$o(o);if(f={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null},hS(o))pS(l,f);else if(f=Ub(o,l,f,g),f!==null){var S=lr();$s(f,o,g,S),mS(f,l,g)}}function CO(o,l,f){var g=$o(o),S={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null};if(hS(o))pS(l,S);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=l.lastRenderedReducer,C!==null))try{var M=l.lastRenderedState,V=C(M,f);if(S.hasEagerState=!0,S.eagerState=V,Ds(V,M)){var U=l.interleaved;U===null?(S.next=S,Mg(l)):(S.next=U.next,U.next=S),l.interleaved=S;return}}catch{}finally{}f=Ub(o,l,S,g),f!==null&&(S=lr(),$s(f,o,g,S),mS(f,l,g))}}function hS(o){var l=o.alternate;return o===Zt||l!==null&&l===Zt}function pS(o,l){Yc=kh=!0;var f=o.pending;f===null?l.next=l:(l.next=f.next,f.next=l),o.pending=l}function mS(o,l,f){if((f&4194240)!==0){var g=l.lanes;g&=o.pendingLanes,f|=g,l.lanes=f,Ri(o,f)}}var Ih={readContext:gs,useCallback:Xn,useContext:Xn,useEffect:Xn,useImperativeHandle:Xn,useInsertionEffect:Xn,useLayoutEffect:Xn,useMemo:Xn,useReducer:Xn,useRef:Xn,useState:Xn,useDebugValue:Xn,useDeferredValue:Xn,useTransition:Xn,useMutableSource:Xn,useSyncExternalStore:Xn,useId:Xn,unstable_isNewReconciler:!1},kO={readContext:gs,useCallback:function(o,l){return ti().memoizedState=[o,l===void 0?null:l],o},useContext:gs,useEffect:sS,useImperativeHandle:function(o,l,f){return f=f!=null?f.concat([o]):null,Ph(4194308,4,aS.bind(null,l,o),f)},useLayoutEffect:function(o,l){return Ph(4194308,4,o,l)},useInsertionEffect:function(o,l){return Ph(4,2,o,l)},useMemo:function(o,l){var f=ti();return l=l===void 0?null:l,o=o(),f.memoizedState=[o,l],o},useReducer:function(o,l,f){var g=ti();return l=f!==void 0?f(l):l,g.memoizedState=g.baseState=l,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:l},g.queue=o,o=o.dispatch=EO.bind(null,Zt,o),[g.memoizedState,o]},useRef:function(o){var l=ti();return o={current:o},l.memoizedState=o},useState:nS,useDebugValue:Wg,useDeferredValue:function(o){return ti().memoizedState=o},useTransition:function(){var o=nS(!1),l=o[0];return o=SO.bind(null,o[1]),ti().memoizedState=o,[l,o]},useMutableSource:function(){},useSyncExternalStore:function(o,l,f){var g=Zt,S=ti();if(Bt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=l(),In===null)throw Error(n(349));(Va&30)!==0||Xb(g,l,f)}S.memoizedState=f;var C={value:f,getSnapshot:l};return S.queue=C,sS(Jb.bind(null,g,C,o),[o]),g.flags|=2048,Jc(9,Qb.bind(null,g,C,f,l),void 0,null),f},useId:function(){var o=ti(),l=In.identifierPrefix;if(Bt){var f=Di,g=Li;f=(g&~(1<<32-wr(g)-1)).toString(32)+f,l=":"+l+"R"+f,f=Xc++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=bO++,l=":"+l+"r"+f.toString(32)+":";return o.memoizedState=l},unstable_isNewReconciler:!1},PO={readContext:gs,useCallback:uS,useContext:gs,useEffect:Ug,useImperativeHandle:lS,useInsertionEffect:iS,useLayoutEffect:oS,useMemo:cS,useReducer:zg,useRef:rS,useState:function(){return zg(Qc)},useDebugValue:Wg,useDeferredValue:function(o){var l=vs();return dS(l,En.memoizedState,o)},useTransition:function(){var o=zg(Qc)[0],l=vs().memoizedState;return[o,l]},useMutableSource:Zb,useSyncExternalStore:Yb,useId:fS,unstable_isNewReconciler:!1},TO={readContext:gs,useCallback:uS,useContext:gs,useEffect:Ug,useImperativeHandle:lS,useInsertionEffect:iS,useLayoutEffect:oS,useMemo:cS,useReducer:Bg,useRef:rS,useState:function(){return Bg(Qc)},useDebugValue:Wg,useDeferredValue:function(o){var l=vs();return En===null?l.memoizedState=o:dS(l,En.memoizedState,o)},useTransition:function(){var o=Bg(Qc)[0],l=vs().memoizedState;return[o,l]},useMutableSource:Zb,useSyncExternalStore:Yb,useId:fS,unstable_isNewReconciler:!1};function Fs(o,l){if(o&&o.defaultProps){l=H({},l),o=o.defaultProps;for(var f in o)l[f]===void 0&&(l[f]=o[f]);return l}return l}function Gg(o,l,f,g){l=o.memoizedState,f=f(g,l),f=f==null?l:H({},l,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var Ah={isMounted:function(o){return(o=o._reactInternals)?Ms(o)===o:!1},enqueueSetState:function(o,l,f){o=o._reactInternals;var g=lr(),S=$o(o),C=Fi(g,S);C.payload=l,f!=null&&(C.callback=f),l=No(o,C,S),l!==null&&($s(l,o,S,g),bh(l,o,S))},enqueueReplaceState:function(o,l,f){o=o._reactInternals;var g=lr(),S=$o(o),C=Fi(g,S);C.tag=1,C.payload=l,f!=null&&(C.callback=f),l=No(o,C,S),l!==null&&($s(l,o,S,g),bh(l,o,S))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var f=lr(),g=$o(o),S=Fi(f,g);S.tag=2,l!=null&&(S.callback=l),l=No(o,S,g),l!==null&&($s(l,o,g,f),bh(l,o,g))}};function gS(o,l,f,g,S,C,M){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,C,M):l.prototype&&l.prototype.isPureReactComponent?!Vc(f,g)||!Vc(S,C):!0}function vS(o,l,f){var g=!1,S=Oo,C=l.contextType;return typeof C=="object"&&C!==null?C=gs(C):(S=Sr(l)?La:Yn.current,g=l.contextTypes,C=(g=g!=null)?eu(o,S):Oo),l=new l(f,C),o.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Ah,o.stateNode=l,l._reactInternals=o,g&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=S,o.__reactInternalMemoizedMaskedChildContext=C),l}function yS(o,l,f,g){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,g),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,g),l.state!==o&&Ah.enqueueReplaceState(l,l.state,null)}function Kg(o,l,f,g){var S=o.stateNode;S.props=f,S.state=o.memoizedState,S.refs={},Og(o);var C=l.contextType;typeof C=="object"&&C!==null?S.context=gs(C):(C=Sr(l)?La:Yn.current,S.context=eu(o,C)),S.state=o.memoizedState,C=l.getDerivedStateFromProps,typeof C=="function"&&(Gg(o,l,C,f),S.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(l=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),l!==S.state&&Ah.enqueueReplaceState(S,S.state,null),Sh(o,f,S,g),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4194308)}function lu(o,l){try{var f="",g=l;do f+=ee(g),g=g.return;while(g);var S=f}catch(C){S=`
41
+ Error generating stack: `+C.message+`
42
+ `+C.stack}return{value:o,source:l,stack:S,digest:null}}function qg(o,l,f){return{value:o,source:null,stack:f??null,digest:l??null}}function Zg(o,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var IO=typeof WeakMap=="function"?WeakMap:Map;function _S(o,l,f){f=Fi(-1,f),f.tag=3,f.payload={element:null};var g=l.value;return f.callback=function(){Fh||(Fh=!0,cv=g),Zg(o,l)},f}function wS(o,l,f){f=Fi(-1,f),f.tag=3;var g=o.type.getDerivedStateFromError;if(typeof g=="function"){var S=l.value;f.payload=function(){return g(S)},f.callback=function(){Zg(o,l)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(f.callback=function(){Zg(o,l),typeof g!="function"&&(jo===null?jo=new Set([this]):jo.add(this));var M=l.stack;this.componentDidCatch(l.value,{componentStack:M!==null?M:""})}),f}function xS(o,l,f){var g=o.pingCache;if(g===null){g=o.pingCache=new IO;var S=new Set;g.set(l,S)}else S=g.get(l),S===void 0&&(S=new Set,g.set(l,S));S.has(f)||(S.add(f),o=BO.bind(null,o,l,f),l.then(o,o))}function bS(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 SS(o,l,f,g,S){return(o.mode&1)===0?(o===l?o.flags|=65536:(o.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Fi(-1,1),l.tag=2,No(f,l,1))),f.lanes|=1),o):(o.flags|=65536,o.lanes=S,o)}var AO=k.ReactCurrentOwner,Er=!1;function ar(o,l,f,g){l.child=o===null?Bb(l,null,f,g):su(l,o.child,f,g)}function ES(o,l,f,g,S){f=f.render;var C=l.ref;return ou(l,S),g=$g(o,l,f,g,C,S),f=Hg(),o!==null&&!Er?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~S,ji(o,l,S)):(Bt&&f&&Sg(l),l.flags|=1,ar(o,l,g,S),l.child)}function CS(o,l,f,g,S){if(o===null){var C=f.type;return typeof C=="function"&&!vv(C)&&C.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=C,kS(o,l,C,g,S)):(o=Bh(f.type,null,g,l,l.mode,S),o.ref=l.ref,o.return=l,l.child=o)}if(C=o.child,(o.lanes&S)===0){var M=C.memoizedProps;if(f=f.compare,f=f!==null?f:Vc,f(M,g)&&o.ref===l.ref)return ji(o,l,S)}return l.flags|=1,o=zo(C,g),o.ref=l.ref,o.return=l,l.child=o}function kS(o,l,f,g,S){if(o!==null){var C=o.memoizedProps;if(Vc(C,g)&&o.ref===l.ref)if(Er=!1,l.pendingProps=g=C,(o.lanes&S)!==0)(o.flags&131072)!==0&&(Er=!0);else return l.lanes=o.lanes,ji(o,l,S)}return Yg(o,l,f,g,S)}function PS(o,l,f){var g=l.pendingProps,S=g.children,C=o!==null?o.memoizedState:null;if(g.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(cu,Gr),Gr|=f;else{if((f&1073741824)===0)return o=C!==null?C.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:o,cachePool:null,transitions:null},l.updateQueue=null,Ot(cu,Gr),Gr|=o,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=C!==null?C.baseLanes:f,Ot(cu,Gr),Gr|=g}else C!==null?(g=C.baseLanes|f,l.memoizedState=null):g=f,Ot(cu,Gr),Gr|=g;return ar(o,l,S,f),l.child}function TS(o,l){var f=l.ref;(o===null&&f!==null||o!==null&&o.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function Yg(o,l,f,g,S){var C=Sr(f)?La:Yn.current;return C=eu(l,C),ou(l,S),f=$g(o,l,f,g,C,S),g=Hg(),o!==null&&!Er?(l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~S,ji(o,l,S)):(Bt&&g&&Sg(l),l.flags|=1,ar(o,l,f,S),l.child)}function IS(o,l,f,g,S){if(Sr(f)){var C=!0;ph(l)}else C=!1;if(ou(l,S),l.stateNode===null)Mh(o,l),vS(l,f,g),Kg(l,f,g,S),g=!0;else if(o===null){var M=l.stateNode,V=l.memoizedProps;M.props=V;var U=M.context,re=f.contextType;typeof re=="object"&&re!==null?re=gs(re):(re=Sr(f)?La:Yn.current,re=eu(l,re));var he=f.getDerivedStateFromProps,ge=typeof he=="function"||typeof M.getSnapshotBeforeUpdate=="function";ge||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(V!==g||U!==re)&&yS(l,M,g,re),Do=!1;var fe=l.memoizedState;M.state=fe,Sh(l,g,M,S),U=l.memoizedState,V!==g||fe!==U||br.current||Do?(typeof he=="function"&&(Gg(l,f,he,g),U=l.memoizedState),(V=Do||gS(l,f,V,g,fe,U,re))?(ge||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(l.flags|=4194308)):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=g,l.memoizedState=U),M.props=g,M.state=U,M.context=re,g=V):(typeof M.componentDidMount=="function"&&(l.flags|=4194308),g=!1)}else{M=l.stateNode,Wb(o,l),V=l.memoizedProps,re=l.type===l.elementType?V:Fs(l.type,V),M.props=re,ge=l.pendingProps,fe=M.context,U=f.contextType,typeof U=="object"&&U!==null?U=gs(U):(U=Sr(f)?La:Yn.current,U=eu(l,U));var Ie=f.getDerivedStateFromProps;(he=typeof Ie=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(V!==ge||fe!==U)&&yS(l,M,g,U),Do=!1,fe=l.memoizedState,M.state=fe,Sh(l,g,M,S);var Oe=l.memoizedState;V!==ge||fe!==Oe||br.current||Do?(typeof Ie=="function"&&(Gg(l,f,Ie,g),Oe=l.memoizedState),(re=Do||gS(l,f,re,g,fe,Oe,U)||!1)?(he||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(g,Oe,U),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(g,Oe,U)),typeof M.componentDidUpdate=="function"&&(l.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof M.componentDidUpdate!="function"||V===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),l.memoizedProps=g,l.memoizedState=Oe),M.props=g,M.state=Oe,M.context=U,g=re):(typeof M.componentDidUpdate!="function"||V===o.memoizedProps&&fe===o.memoizedState||(l.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||V===o.memoizedProps&&fe===o.memoizedState||(l.flags|=1024),g=!1)}return Xg(o,l,f,g,C,S)}function Xg(o,l,f,g,S,C){TS(o,l);var M=(l.flags&128)!==0;if(!g&&!M)return S&&Lb(l,f,!1),ji(o,l,C);g=l.stateNode,AO.current=l;var V=M&&typeof f.getDerivedStateFromError!="function"?null:g.render();return l.flags|=1,o!==null&&M?(l.child=su(l,o.child,null,C),l.child=su(l,null,V,C)):ar(o,l,V,C),l.memoizedState=g.state,S&&Lb(l,f,!0),l.child}function AS(o){var l=o.stateNode;l.pendingContext?Mb(o,l.pendingContext,l.pendingContext!==l.context):l.context&&Mb(o,l.context,!1),Lg(o,l.containerInfo)}function RS(o,l,f,g,S){return ru(),Pg(S),l.flags|=256,ar(o,l,f,g),l.child}var Qg={dehydrated:null,treeContext:null,retryLane:0};function Jg(o){return{baseLanes:o,cachePool:null,transitions:null}}function MS(o,l,f){var g=l.pendingProps,S=qt.current,C=!1,M=(l.flags&128)!==0,V;if((V=M)||(V=o!==null&&o.memoizedState===null?!1:(S&2)!==0),V?(C=!0,l.flags&=-129):(o===null||o.memoizedState!==null)&&(S|=1),Ot(qt,S&1),o===null)return kg(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):(M=g.children,o=g.fallback,C?(g=l.mode,C=l.child,M={mode:"hidden",children:M},(g&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=M):C=Uh(M,g,0,null),o=Ua(o,g,f,null),C.return=l,o.return=l,C.sibling=o,l.child=C,l.child.memoizedState=Jg(f),l.memoizedState=Qg,o):ev(l,M));if(S=o.memoizedState,S!==null&&(V=S.dehydrated,V!==null))return RO(o,l,M,g,V,S,f);if(C){C=g.fallback,M=l.mode,S=o.child,V=S.sibling;var U={mode:"hidden",children:g.children};return(M&1)===0&&l.child!==S?(g=l.child,g.childLanes=0,g.pendingProps=U,l.deletions=null):(g=zo(S,U),g.subtreeFlags=S.subtreeFlags&14680064),V!==null?C=zo(V,C):(C=Ua(C,M,f,null),C.flags|=2),C.return=l,g.return=l,g.sibling=C,l.child=g,g=C,C=l.child,M=o.child.memoizedState,M=M===null?Jg(f):{baseLanes:M.baseLanes|f,cachePool:null,transitions:M.transitions},C.memoizedState=M,C.childLanes=o.childLanes&~f,l.memoizedState=Qg,g}return C=o.child,o=C.sibling,g=zo(C,{mode:"visible",children:g.children}),(l.mode&1)===0&&(g.lanes=f),g.return=l,g.sibling=null,o!==null&&(f=l.deletions,f===null?(l.deletions=[o],l.flags|=16):f.push(o)),l.child=g,l.memoizedState=null,g}function ev(o,l){return l=Uh({mode:"visible",children:l},o.mode,0,null),l.return=o,o.child=l}function Rh(o,l,f,g){return g!==null&&Pg(g),su(l,o.child,null,f),o=ev(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function RO(o,l,f,g,S,C,M){if(f)return l.flags&256?(l.flags&=-257,g=qg(Error(n(422))),Rh(o,l,M,g)):l.memoizedState!==null?(l.child=o.child,l.flags|=128,null):(C=g.fallback,S=l.mode,g=Uh({mode:"visible",children:g.children},S,0,null),C=Ua(C,S,M,null),C.flags|=2,g.return=l,C.return=l,g.sibling=C,l.child=g,(l.mode&1)!==0&&su(l,o.child,null,M),l.child.memoizedState=Jg(M),l.memoizedState=Qg,C);if((l.mode&1)===0)return Rh(o,l,M,null);if(S.data==="$!"){if(g=S.nextSibling&&S.nextSibling.dataset,g)var V=g.dgst;return g=V,C=Error(n(419)),g=qg(C,g,void 0),Rh(o,l,M,g)}if(V=(M&o.childLanes)!==0,Er||V){if(g=In,g!==null){switch(M&-M){case 4:S=2;break;case 16:S=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:S=32;break;case 536870912:S=268435456;break;default:S=0}S=(S&(g.suspendedLanes|M))!==0?0:S,S!==0&&S!==C.retryLane&&(C.retryLane=S,Ni(o,S),$s(g,o,S,-1))}return gv(),g=qg(Error(n(421))),Rh(o,l,M,g)}return S.data==="$?"?(l.flags|=128,l.child=o.child,l=UO.bind(null,o),S._reactRetry=l,null):(o=C.treeContext,Wr=Ro(S.nextSibling),Ur=l,Bt=!0,Ns=null,o!==null&&(ps[ms++]=Li,ps[ms++]=Di,ps[ms++]=Da,Li=o.id,Di=o.overflow,Da=l),l=ev(l,g.children),l.flags|=4096,l)}function OS(o,l,f){o.lanes|=l;var g=o.alternate;g!==null&&(g.lanes|=l),Rg(o.return,l,f)}function tv(o,l,f,g,S){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:S}:(C.isBackwards=l,C.rendering=null,C.renderingStartTime=0,C.last=g,C.tail=f,C.tailMode=S)}function LS(o,l,f){var g=l.pendingProps,S=g.revealOrder,C=g.tail;if(ar(o,l,g.children,f),g=qt.current,(g&2)!==0)g=g&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&&OS(o,f,l);else if(o.tag===19)OS(o,f,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}g&=1}if(Ot(qt,g),(l.mode&1)===0)l.memoizedState=null;else switch(S){case"forwards":for(f=l.child,S=null;f!==null;)o=f.alternate,o!==null&&Eh(o)===null&&(S=f),f=f.sibling;f=S,f===null?(S=l.child,l.child=null):(S=f.sibling,f.sibling=null),tv(l,!1,S,f,C);break;case"backwards":for(f=null,S=l.child,l.child=null;S!==null;){if(o=S.alternate,o!==null&&Eh(o)===null){l.child=S;break}o=S.sibling,S.sibling=f,f=S,S=o}tv(l,!0,f,null,C);break;case"together":tv(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Mh(o,l){(l.mode&1)===0&&o!==null&&(o.alternate=null,l.alternate=null,l.flags|=2)}function ji(o,l,f){if(o!==null&&(l.dependencies=o.dependencies),$a|=l.lanes,(f&l.childLanes)===0)return null;if(o!==null&&l.child!==o.child)throw Error(n(153));if(l.child!==null){for(o=l.child,f=zo(o,o.pendingProps),l.child=f,f.return=l;o.sibling!==null;)o=o.sibling,f=f.sibling=zo(o,o.pendingProps),f.return=l;f.sibling=null}return l.child}function MO(o,l,f){switch(l.tag){case 3:AS(l),ru();break;case 5:qb(l);break;case 1:Sr(l.type)&&ph(l);break;case 4:Lg(l,l.stateNode.containerInfo);break;case 10:var g=l.type._context,S=l.memoizedProps.value;Ot(wh,g._currentValue),g._currentValue=S;break;case 13:if(g=l.memoizedState,g!==null)return g.dehydrated!==null?(Ot(qt,qt.current&1),l.flags|=128,null):(f&l.child.childLanes)!==0?MS(o,l,f):(Ot(qt,qt.current&1),o=ji(o,l,f),o!==null?o.sibling:null);Ot(qt,qt.current&1);break;case 19:if(g=(f&l.childLanes)!==0,(o.flags&128)!==0){if(g)return LS(o,l,f);l.flags|=128}if(S=l.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),Ot(qt,qt.current),g)break;return null;case 22:case 23:return l.lanes=0,PS(o,l,f)}return ji(o,l,f)}var DS,nv,NS,FS;DS=function(o,l){for(var f=l.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},nv=function(){},NS=function(o,l,f,g){var S=o.memoizedProps;if(S!==g){o=l.stateNode,ja(ei.current);var C=null;switch(f){case"input":S=ht(o,S),g=ht(o,g),C=[];break;case"select":S=H({},S,{value:void 0}),g=H({},g,{value:void 0}),C=[];break;case"textarea":S=Ye(o,S),g=Ye(o,g),C=[];break;default:typeof S.onClick!="function"&&typeof g.onClick=="function"&&(o.onclick=dh)}As(f,g);var M;f=null;for(re in S)if(!g.hasOwnProperty(re)&&S.hasOwnProperty(re)&&S[re]!=null)if(re==="style"){var V=S[re];for(M in V)V.hasOwnProperty(M)&&(f||(f={}),f[M]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(s.hasOwnProperty(re)?C||(C=[]):(C=C||[]).push(re,null));for(re in g){var U=g[re];if(V=S!=null?S[re]:void 0,g.hasOwnProperty(re)&&U!==V&&(U!=null||V!=null))if(re==="style")if(V){for(M in V)!V.hasOwnProperty(M)||U&&U.hasOwnProperty(M)||(f||(f={}),f[M]="");for(M in U)U.hasOwnProperty(M)&&V[M]!==U[M]&&(f||(f={}),f[M]=U[M])}else f||(C||(C=[]),C.push(re,f)),f=U;else re==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,V=V?V.__html:void 0,U!=null&&V!==U&&(C=C||[]).push(re,U)):re==="children"?typeof U!="string"&&typeof U!="number"||(C=C||[]).push(re,""+U):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(s.hasOwnProperty(re)?(U!=null&&re==="onScroll"&&Nt("scroll",o),C||V===U||(C=[])):(C=C||[]).push(re,U))}f&&(C=C||[]).push("style",f);var re=C;(l.updateQueue=re)&&(l.flags|=4)}},FS=function(o,l,f,g){f!==g&&(l.flags|=4)};function ed(o,l){if(!Bt)switch(o.tailMode){case"hidden":l=o.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function Qn(o){var l=o.alternate!==null&&o.alternate.child===o.child,f=0,g=0;if(l)for(var S=o.child;S!==null;)f|=S.lanes|S.childLanes,g|=S.subtreeFlags&14680064,g|=S.flags&14680064,S.return=o,S=S.sibling;else for(S=o.child;S!==null;)f|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=o,S=S.sibling;return o.subtreeFlags|=g,o.childLanes=f,l}function OO(o,l,f){var g=l.pendingProps;switch(Eg(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qn(l),null;case 1:return Sr(l.type)&&hh(),Qn(l),null;case 3:return g=l.stateNode,au(),Ft(br),Ft(Yn),Fg(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(o===null||o.child===null)&&(yh(l)?l.flags|=4:o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ns!==null&&(hv(Ns),Ns=null))),nv(o,l),Qn(l),null;case 5:Dg(l);var S=ja(Zc.current);if(f=l.type,o!==null&&l.stateNode!=null)NS(o,l,f,g,S),o.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!g){if(l.stateNode===null)throw Error(n(166));return Qn(l),null}if(o=ja(ei.current),yh(l)){g=l.stateNode,f=l.type;var C=l.memoizedProps;switch(g[Js]=l,g[Uc]=C,o=(l.mode&1)!==0,f){case"dialog":Nt("cancel",g),Nt("close",g);break;case"iframe":case"object":case"embed":Nt("load",g);break;case"video":case"audio":for(S=0;S<Hc.length;S++)Nt(Hc[S],g);break;case"source":Nt("error",g);break;case"img":case"image":case"link":Nt("error",g),Nt("load",g);break;case"details":Nt("toggle",g);break;case"input":Jt(g,C),Nt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!C.multiple},Nt("invalid",g);break;case"textarea":an(g,C),Nt("invalid",g)}As(f,C),S=null;for(var M in C)if(C.hasOwnProperty(M)){var V=C[M];M==="children"?typeof V=="string"?g.textContent!==V&&(C.suppressHydrationWarning!==!0&&ch(g.textContent,V,o),S=["children",V]):typeof V=="number"&&g.textContent!==""+V&&(C.suppressHydrationWarning!==!0&&ch(g.textContent,V,o),S=["children",""+V]):s.hasOwnProperty(M)&&V!=null&&M==="onScroll"&&Nt("scroll",g)}switch(f){case"input":Ue(g),Ge(g,C,!0);break;case"textarea":Ue(g),Fn(g);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(g.onclick=dh)}g=S,l.updateQueue=g,g!==null&&(l.flags|=4)}else{M=S.nodeType===9?S:S.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=xo(f)),o==="http://www.w3.org/1999/xhtml"?f==="script"?(o=M.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof g.is=="string"?o=M.createElement(f,{is:g.is}):(o=M.createElement(f),f==="select"&&(M=o,g.multiple?M.multiple=!0:g.size&&(M.size=g.size))):o=M.createElementNS(o,f),o[Js]=l,o[Uc]=g,DS(o,l,!1,!1),l.stateNode=o;e:{switch(M=Rs(f,g),f){case"dialog":Nt("cancel",o),Nt("close",o),S=g;break;case"iframe":case"object":case"embed":Nt("load",o),S=g;break;case"video":case"audio":for(S=0;S<Hc.length;S++)Nt(Hc[S],o);S=g;break;case"source":Nt("error",o),S=g;break;case"img":case"image":case"link":Nt("error",o),Nt("load",o),S=g;break;case"details":Nt("toggle",o),S=g;break;case"input":Jt(o,g),S=ht(o,g),Nt("invalid",o);break;case"option":S=g;break;case"select":o._wrapperState={wasMultiple:!!g.multiple},S=H({},g,{value:void 0}),Nt("invalid",o);break;case"textarea":an(o,g),S=Ye(o,g),Nt("invalid",o);break;default:S=g}As(f,S),V=S;for(C in V)if(V.hasOwnProperty(C)){var U=V[C];C==="style"?bo(o,U):C==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&yr(o,U)):C==="children"?typeof U=="string"?(f!=="textarea"||U!=="")&&ir(o,U):typeof U=="number"&&ir(o,""+U):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(s.hasOwnProperty(C)?U!=null&&C==="onScroll"&&Nt("scroll",o):U!=null&&T(o,C,U,M))}switch(f){case"input":Ue(o),Ge(o,g,!1);break;case"textarea":Ue(o),Fn(o);break;case"option":g.value!=null&&o.setAttribute("value",""+ue(g.value));break;case"select":o.multiple=!!g.multiple,C=g.value,C!=null?nt(o,!!g.multiple,C,!1):g.defaultValue!=null&&nt(o,!!g.multiple,g.defaultValue,!0);break;default:typeof S.onClick=="function"&&(o.onclick=dh)}switch(f){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Qn(l),null;case 6:if(o&&l.stateNode!=null)FS(o,l,o.memoizedProps,g);else{if(typeof g!="string"&&l.stateNode===null)throw Error(n(166));if(f=ja(Zc.current),ja(ei.current),yh(l)){if(g=l.stateNode,f=l.memoizedProps,g[Js]=l,(C=g.nodeValue!==f)&&(o=Ur,o!==null))switch(o.tag){case 3:ch(g.nodeValue,f,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&ch(g.nodeValue,f,(o.mode&1)!==0)}C&&(l.flags|=4)}else g=(f.nodeType===9?f:f.ownerDocument).createTextNode(g),g[Js]=l,l.stateNode=g}return Qn(l),null;case 13:if(Ft(qt),g=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(Bt&&Wr!==null&&(l.mode&1)!==0&&(l.flags&128)===0)$b(),ru(),l.flags|=98560,C=!1;else if(C=yh(l),g!==null&&g.dehydrated!==null){if(o===null){if(!C)throw Error(n(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(n(317));C[Js]=l}else ru(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Qn(l),C=!1}else Ns!==null&&(hv(Ns),Ns=null),C=!0;if(!C)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=f,l):(g=g!==null,g!==(o!==null&&o.memoizedState!==null)&&g&&(l.child.flags|=8192,(l.mode&1)!==0&&(o===null||(qt.current&1)!==0?Cn===0&&(Cn=3):gv())),l.updateQueue!==null&&(l.flags|=4),Qn(l),null);case 4:return au(),nv(o,l),o===null&&zc(l.stateNode.containerInfo),Qn(l),null;case 10:return Ag(l.type._context),Qn(l),null;case 17:return Sr(l.type)&&hh(),Qn(l),null;case 19:if(Ft(qt),C=l.memoizedState,C===null)return Qn(l),null;if(g=(l.flags&128)!==0,M=C.rendering,M===null)if(g)ed(C,!1);else{if(Cn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(M=Eh(o),M!==null){for(l.flags|=128,ed(C,!1),g=M.updateQueue,g!==null&&(l.updateQueue=g,l.flags|=4),l.subtreeFlags=0,g=f,f=l.child;f!==null;)C=f,o=g,C.flags&=14680066,M=C.alternate,M===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=M.childLanes,C.lanes=M.lanes,C.child=M.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=M.memoizedProps,C.memoizedState=M.memoizedState,C.updateQueue=M.updateQueue,C.type=M.type,o=M.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),f=f.sibling;return Ot(qt,qt.current&1|2),l.child}o=o.sibling}C.tail!==null&&Ct()>du&&(l.flags|=128,g=!0,ed(C,!1),l.lanes=4194304)}else{if(!g)if(o=Eh(M),o!==null){if(l.flags|=128,g=!0,f=o.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),ed(C,!0),C.tail===null&&C.tailMode==="hidden"&&!M.alternate&&!Bt)return Qn(l),null}else 2*Ct()-C.renderingStartTime>du&&f!==1073741824&&(l.flags|=128,g=!0,ed(C,!1),l.lanes=4194304);C.isBackwards?(M.sibling=l.child,l.child=M):(f=C.last,f!==null?f.sibling=M:l.child=M,C.last=M)}return C.tail!==null?(l=C.tail,C.rendering=l,C.tail=l.sibling,C.renderingStartTime=Ct(),l.sibling=null,f=qt.current,Ot(qt,g?f&1|2:f&1),l):(Qn(l),null);case 22:case 23:return mv(),g=l.memoizedState!==null,o!==null&&o.memoizedState!==null!==g&&(l.flags|=8192),g&&(l.mode&1)!==0?(Gr&1073741824)!==0&&(Qn(l),l.subtreeFlags&6&&(l.flags|=8192)):Qn(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function LO(o,l){switch(Eg(l),l.tag){case 1:return Sr(l.type)&&hh(),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return au(),Ft(br),Ft(Yn),Fg(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 5:return Dg(l),null;case 13:if(Ft(qt),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(n(340));ru()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return Ft(qt),null;case 4:return au(),null;case 10:return Ag(l.type._context),null;case 22:case 23:return mv(),null;case 24:return null;default:return null}}var Oh=!1,Jn=!1,DO=typeof WeakSet=="function"?WeakSet:Set,Re=null;function uu(o,l){var f=o.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(g){tn(o,l,g)}else f.current=null}function rv(o,l,f){try{f()}catch(g){tn(o,l,g)}}var jS=!1;function NO(o,l){if(mg=Jf,o=gb(),ag(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var S=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{f.nodeType,C.nodeType}catch{f=null;break e}var M=0,V=-1,U=-1,re=0,he=0,ge=o,fe=null;t:for(;;){for(var Ie;ge!==f||S!==0&&ge.nodeType!==3||(V=M+S),ge!==C||g!==0&&ge.nodeType!==3||(U=M+g),ge.nodeType===3&&(M+=ge.nodeValue.length),(Ie=ge.firstChild)!==null;)fe=ge,ge=Ie;for(;;){if(ge===o)break t;if(fe===f&&++re===S&&(V=M),fe===C&&++he===g&&(U=M),(Ie=ge.nextSibling)!==null)break;ge=fe,fe=ge.parentNode}ge=Ie}f=V===-1||U===-1?null:{start:V,end:U}}else f=null}f=f||{start:0,end:0}}else f=null;for(gg={focusedElem:o,selectionRange:f},Jf=!1,Re=l;Re!==null;)if(l=Re,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Re=o;else for(;Re!==null;){l=Re;try{var Oe=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var De=Oe.memoizedProps,cn=Oe.memoizedState,Q=l.stateNode,q=Q.getSnapshotBeforeUpdate(l.elementType===l.type?De:Fs(l.type,De),cn);Q.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var te=l.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(xe){tn(l,l.return,xe)}if(o=l.sibling,o!==null){o.return=l.return,Re=o;break}Re=l.return}return Oe=jS,jS=!1,Oe}function td(o,l,f){var g=l.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var S=g=g.next;do{if((S.tag&o)===o){var C=S.destroy;S.destroy=void 0,C!==void 0&&rv(l,f,C)}S=S.next}while(S!==g)}}function Lh(o,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&o)===o){var g=f.create;f.destroy=g()}f=f.next}while(f!==l)}}function sv(o){var l=o.ref;if(l!==null){var f=o.stateNode;switch(o.tag){case 5:o=f;break;default:o=f}typeof l=="function"?l(o):l.current=o}}function VS(o){var l=o.alternate;l!==null&&(o.alternate=null,VS(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&(delete l[Js],delete l[Uc],delete l[wg],delete l[yO],delete l[_O])),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 $S(o){return o.tag===5||o.tag===3||o.tag===4}function HS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||$S(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 iv(o,l,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(o,l):f.insertBefore(o,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(o,f)):(l=f,l.appendChild(o)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=dh));else if(g!==4&&(o=o.child,o!==null))for(iv(o,l,f),o=o.sibling;o!==null;)iv(o,l,f),o=o.sibling}function ov(o,l,f){var g=o.tag;if(g===5||g===6)o=o.stateNode,l?f.insertBefore(o,l):f.appendChild(o);else if(g!==4&&(o=o.child,o!==null))for(ov(o,l,f),o=o.sibling;o!==null;)ov(o,l,f),o=o.sibling}var $n=null,js=!1;function Fo(o,l,f){for(f=f.child;f!==null;)zS(o,l,f),f=f.sibling}function zS(o,l,f){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(Ma,f)}catch{}switch(f.tag){case 5:Jn||uu(f,l);case 6:var g=$n,S=js;$n=null,Fo(o,l,f),$n=g,js=S,$n!==null&&(js?(o=$n,f=f.stateNode,o.nodeType===8?o.parentNode.removeChild(f):o.removeChild(f)):$n.removeChild(f.stateNode));break;case 18:$n!==null&&(js?(o=$n,f=f.stateNode,o.nodeType===8?_g(o.parentNode,f):o.nodeType===1&&_g(o,f),Oc(o)):_g($n,f.stateNode));break;case 4:g=$n,S=js,$n=f.stateNode.containerInfo,js=!0,Fo(o,l,f),$n=g,js=S;break;case 0:case 11:case 14:case 15:if(!Jn&&(g=f.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){S=g=g.next;do{var C=S,M=C.destroy;C=C.tag,M!==void 0&&((C&2)!==0||(C&4)!==0)&&rv(f,l,M),S=S.next}while(S!==g)}Fo(o,l,f);break;case 1:if(!Jn&&(uu(f,l),g=f.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=f.memoizedProps,g.state=f.memoizedState,g.componentWillUnmount()}catch(V){tn(f,l,V)}Fo(o,l,f);break;case 21:Fo(o,l,f);break;case 22:f.mode&1?(Jn=(g=Jn)||f.memoizedState!==null,Fo(o,l,f),Jn=g):Fo(o,l,f);break;default:Fo(o,l,f)}}function BS(o){var l=o.updateQueue;if(l!==null){o.updateQueue=null;var f=o.stateNode;f===null&&(f=o.stateNode=new DO),l.forEach(function(g){var S=WO.bind(null,o,g);f.has(g)||(f.add(g),g.then(S,S))})}}function Vs(o,l){var f=l.deletions;if(f!==null)for(var g=0;g<f.length;g++){var S=f[g];try{var C=o,M=l,V=M;e:for(;V!==null;){switch(V.tag){case 5:$n=V.stateNode,js=!1;break e;case 3:$n=V.stateNode.containerInfo,js=!0;break e;case 4:$n=V.stateNode.containerInfo,js=!0;break e}V=V.return}if($n===null)throw Error(n(160));zS(C,M,S),$n=null,js=!1;var U=S.alternate;U!==null&&(U.return=null),S.return=null}catch(re){tn(S,l,re)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)US(l,o),l=l.sibling}function US(o,l){var f=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Vs(l,o),ni(o),g&4){try{td(3,o,o.return),Lh(3,o)}catch(De){tn(o,o.return,De)}try{td(5,o,o.return)}catch(De){tn(o,o.return,De)}}break;case 1:Vs(l,o),ni(o),g&512&&f!==null&&uu(f,f.return);break;case 5:if(Vs(l,o),ni(o),g&512&&f!==null&&uu(f,f.return),o.flags&32){var S=o.stateNode;try{ir(S,"")}catch(De){tn(o,o.return,De)}}if(g&4&&(S=o.stateNode,S!=null)){var C=o.memoizedProps,M=f!==null?f.memoizedProps:C,V=o.type,U=o.updateQueue;if(o.updateQueue=null,U!==null)try{V==="input"&&C.type==="radio"&&C.name!=null&&be(S,C),Rs(V,M);var re=Rs(V,C);for(M=0;M<U.length;M+=2){var he=U[M],ge=U[M+1];he==="style"?bo(S,ge):he==="dangerouslySetInnerHTML"?yr(S,ge):he==="children"?ir(S,ge):T(S,he,ge,re)}switch(V){case"input":$e(S,C);break;case"textarea":ln(S,C);break;case"select":var fe=S._wrapperState.wasMultiple;S._wrapperState.wasMultiple=!!C.multiple;var Ie=C.value;Ie!=null?nt(S,!!C.multiple,Ie,!1):fe!==!!C.multiple&&(C.defaultValue!=null?nt(S,!!C.multiple,C.defaultValue,!0):nt(S,!!C.multiple,C.multiple?[]:"",!1))}S[Uc]=C}catch(De){tn(o,o.return,De)}}break;case 6:if(Vs(l,o),ni(o),g&4){if(o.stateNode===null)throw Error(n(162));S=o.stateNode,C=o.memoizedProps;try{S.nodeValue=C}catch(De){tn(o,o.return,De)}}break;case 3:if(Vs(l,o),ni(o),g&4&&f!==null&&f.memoizedState.isDehydrated)try{Oc(l.containerInfo)}catch(De){tn(o,o.return,De)}break;case 4:Vs(l,o),ni(o);break;case 13:Vs(l,o),ni(o),S=o.child,S.flags&8192&&(C=S.memoizedState!==null,S.stateNode.isHidden=C,!C||S.alternate!==null&&S.alternate.memoizedState!==null||(uv=Ct())),g&4&&BS(o);break;case 22:if(he=f!==null&&f.memoizedState!==null,o.mode&1?(Jn=(re=Jn)||he,Vs(l,o),Jn=re):Vs(l,o),ni(o),g&8192){if(re=o.memoizedState!==null,(o.stateNode.isHidden=re)&&!he&&(o.mode&1)!==0)for(Re=o,he=o.child;he!==null;){for(ge=Re=he;Re!==null;){switch(fe=Re,Ie=fe.child,fe.tag){case 0:case 11:case 14:case 15:td(4,fe,fe.return);break;case 1:uu(fe,fe.return);var Oe=fe.stateNode;if(typeof Oe.componentWillUnmount=="function"){g=fe,f=fe.return;try{l=g,Oe.props=l.memoizedProps,Oe.state=l.memoizedState,Oe.componentWillUnmount()}catch(De){tn(g,f,De)}}break;case 5:uu(fe,fe.return);break;case 22:if(fe.memoizedState!==null){KS(ge);continue}}Ie!==null?(Ie.return=fe,Re=Ie):KS(ge)}he=he.sibling}e:for(he=null,ge=o;;){if(ge.tag===5){if(he===null){he=ge;try{S=ge.stateNode,re?(C=S.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(V=ge.stateNode,U=ge.memoizedProps.style,M=U!=null&&U.hasOwnProperty("display")?U.display:null,V.style.display=en("display",M))}catch(De){tn(o,o.return,De)}}}else if(ge.tag===6){if(he===null)try{ge.stateNode.nodeValue=re?"":ge.memoizedProps}catch(De){tn(o,o.return,De)}}else if((ge.tag!==22&&ge.tag!==23||ge.memoizedState===null||ge===o)&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===o)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===o)break e;he===ge&&(he=null),ge=ge.return}he===ge&&(he=null),ge.sibling.return=ge.return,ge=ge.sibling}}break;case 19:Vs(l,o),ni(o),g&4&&BS(o);break;case 21:break;default:Vs(l,o),ni(o)}}function ni(o){var l=o.flags;if(l&2){try{e:{for(var f=o.return;f!==null;){if($S(f)){var g=f;break e}f=f.return}throw Error(n(160))}switch(g.tag){case 5:var S=g.stateNode;g.flags&32&&(ir(S,""),g.flags&=-33);var C=HS(o);ov(o,C,S);break;case 3:case 4:var M=g.stateNode.containerInfo,V=HS(o);iv(o,V,M);break;default:throw Error(n(161))}}catch(U){tn(o,o.return,U)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function FO(o,l,f){Re=o,WS(o)}function WS(o,l,f){for(var g=(o.mode&1)!==0;Re!==null;){var S=Re,C=S.child;if(S.tag===22&&g){var M=S.memoizedState!==null||Oh;if(!M){var V=S.alternate,U=V!==null&&V.memoizedState!==null||Jn;V=Oh;var re=Jn;if(Oh=M,(Jn=U)&&!re)for(Re=S;Re!==null;)M=Re,U=M.child,M.tag===22&&M.memoizedState!==null?qS(S):U!==null?(U.return=M,Re=U):qS(S);for(;C!==null;)Re=C,WS(C),C=C.sibling;Re=S,Oh=V,Jn=re}GS(o)}else(S.subtreeFlags&8772)!==0&&C!==null?(C.return=S,Re=C):GS(o)}}function GS(o){for(;Re!==null;){var l=Re;if((l.flags&8772)!==0){var f=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Jn||Lh(5,l);break;case 1:var g=l.stateNode;if(l.flags&4&&!Jn)if(f===null)g.componentDidMount();else{var S=l.elementType===l.type?f.memoizedProps:Fs(l.type,f.memoizedProps);g.componentDidUpdate(S,f.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var C=l.updateQueue;C!==null&&Kb(l,C,g);break;case 3:var M=l.updateQueue;if(M!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}Kb(l,M,f)}break;case 5:var V=l.stateNode;if(f===null&&l.flags&4){f=V;var U=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&f.focus();break;case"img":U.src&&(f.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var re=l.alternate;if(re!==null){var he=re.memoizedState;if(he!==null){var ge=he.dehydrated;ge!==null&&Oc(ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Jn||l.flags&512&&sv(l)}catch(fe){tn(l,l.return,fe)}}if(l===o){Re=null;break}if(f=l.sibling,f!==null){f.return=l.return,Re=f;break}Re=l.return}}function KS(o){for(;Re!==null;){var l=Re;if(l===o){Re=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Re=f;break}Re=l.return}}function qS(o){for(;Re!==null;){var l=Re;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{Lh(4,l)}catch(U){tn(l,f,U)}break;case 1:var g=l.stateNode;if(typeof g.componentDidMount=="function"){var S=l.return;try{g.componentDidMount()}catch(U){tn(l,S,U)}}var C=l.return;try{sv(l)}catch(U){tn(l,C,U)}break;case 5:var M=l.return;try{sv(l)}catch(U){tn(l,M,U)}}}catch(U){tn(l,l.return,U)}if(l===o){Re=null;break}var V=l.sibling;if(V!==null){V.return=l.return,Re=V;break}Re=l.return}}var jO=Math.ceil,Dh=k.ReactCurrentDispatcher,av=k.ReactCurrentOwner,ys=k.ReactCurrentBatchConfig,pt=0,In=null,vn=null,Hn=0,Gr=0,cu=Mo(0),Cn=0,nd=null,$a=0,Nh=0,lv=0,rd=null,Cr=null,uv=0,du=1/0,Vi=null,Fh=!1,cv=null,jo=null,jh=!1,Vo=null,Vh=0,sd=0,dv=null,$h=-1,Hh=0;function lr(){return(pt&6)!==0?Ct():$h!==-1?$h:$h=Ct()}function $o(o){return(o.mode&1)===0?1:(pt&2)!==0&&Hn!==0?Hn&-Hn:xO.transition!==null?(Hh===0&&(Hh=Os()),Hh):(o=rt,o!==0||(o=window.event,o=o===void 0?16:Yx(o.type)),o)}function $s(o,l,f,g){if(50<sd)throw sd=0,dv=null,Error(n(185));xr(o,f,g),((pt&2)===0||o!==In)&&(o===In&&((pt&2)===0&&(Nh|=f),Cn===4&&Ho(o,Hn)),kr(o,g),f===1&&pt===0&&(l.mode&1)===0&&(du=Ct()+500,mh&&Lo()))}function kr(o,l){var f=o.callbackNode;Vn(o,l);var g=qe(o,o===In?Hn:0);if(g===0)f!==null&&Tc(f),o.callbackNode=null,o.callbackPriority=0;else if(l=g&-g,o.callbackPriority!==l){if(f!=null&&Tc(f),l===1)o.tag===0?wO(YS.bind(null,o)):Db(YS.bind(null,o)),gO(function(){(pt&6)===0&&Lo()}),f=null;else{switch(Yf(g)){case 1:f=Aa;break;case 4:f=qf;break;case 16:f=Ra;break;case 536870912:f=Ul;break;default:f=Ra}f=sE(f,ZS.bind(null,o))}o.callbackPriority=l,o.callbackNode=f}}function ZS(o,l){if($h=-1,Hh=0,(pt&6)!==0)throw Error(n(327));var f=o.callbackNode;if(fu()&&o.callbackNode!==f)return null;var g=qe(o,o===In?Hn:0);if(g===0)return null;if((g&30)!==0||(g&o.expiredLanes)!==0||l)l=zh(o,g);else{l=g;var S=pt;pt|=2;var C=QS();(In!==o||Hn!==l)&&(Vi=null,du=Ct()+500,za(o,l));do try{HO();break}catch(V){XS(o,V)}while(!0);Ig(),Dh.current=C,pt=S,vn!==null?l=0:(In=null,Hn=0,l=Cn)}if(l!==0){if(l===2&&(S=hs(o),S!==0&&(g=S,l=fv(o,S))),l===1)throw f=nd,za(o,0),Ho(o,g),kr(o,Ct()),f;if(l===6)Ho(o,g);else{if(S=o.current.alternate,(g&30)===0&&!VO(S)&&(l=zh(o,g),l===2&&(C=hs(o),C!==0&&(g=C,l=fv(o,C))),l===1))throw f=nd,za(o,0),Ho(o,g),kr(o,Ct()),f;switch(o.finishedWork=S,o.finishedLanes=g,l){case 0:case 1:throw Error(n(345));case 2:Ba(o,Cr,Vi);break;case 3:if(Ho(o,g),(g&130023424)===g&&(l=uv+500-Ct(),10<l)){if(qe(o,0)!==0)break;if(S=o.suspendedLanes,(S&g)!==g){lr(),o.pingedLanes|=o.suspendedLanes&S;break}o.timeoutHandle=yg(Ba.bind(null,o,Cr,Vi),l);break}Ba(o,Cr,Vi);break;case 4:if(Ho(o,g),(g&4194240)===g)break;for(l=o.eventTimes,S=-1;0<g;){var M=31-wr(g);C=1<<M,M=l[M],M>S&&(S=M),g&=~C}if(g=S,g=Ct()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*jO(g/1960))-g,10<g){o.timeoutHandle=yg(Ba.bind(null,o,Cr,Vi),g);break}Ba(o,Cr,Vi);break;case 5:Ba(o,Cr,Vi);break;default:throw Error(n(329))}}}return kr(o,Ct()),o.callbackNode===f?ZS.bind(null,o):null}function fv(o,l){var f=rd;return o.current.memoizedState.isDehydrated&&(za(o,l).flags|=256),o=zh(o,l),o!==2&&(l=Cr,Cr=f,l!==null&&hv(l)),o}function hv(o){Cr===null?Cr=o:Cr.push.apply(Cr,o)}function VO(o){for(var l=o;;){if(l.flags&16384){var f=l.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var g=0;g<f.length;g++){var S=f[g],C=S.getSnapshot;S=S.value;try{if(!Ds(C(),S))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;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 Ho(o,l){for(l&=~lv,l&=~Nh,o.suspendedLanes|=l,o.pingedLanes&=~l,o=o.expirationTimes;0<l;){var f=31-wr(l),g=1<<f;o[f]=-1,l&=~g}}function YS(o){if((pt&6)!==0)throw Error(n(327));fu();var l=qe(o,0);if((l&1)===0)return kr(o,Ct()),null;var f=zh(o,l);if(o.tag!==0&&f===2){var g=hs(o);g!==0&&(l=g,f=fv(o,g))}if(f===1)throw f=nd,za(o,0),Ho(o,l),kr(o,Ct()),f;if(f===6)throw Error(n(345));return o.finishedWork=o.current.alternate,o.finishedLanes=l,Ba(o,Cr,Vi),kr(o,Ct()),null}function pv(o,l){var f=pt;pt|=1;try{return o(l)}finally{pt=f,pt===0&&(du=Ct()+500,mh&&Lo())}}function Ha(o){Vo!==null&&Vo.tag===0&&(pt&6)===0&&fu();var l=pt;pt|=1;var f=ys.transition,g=rt;try{if(ys.transition=null,rt=1,o)return o()}finally{rt=g,ys.transition=f,pt=l,(pt&6)===0&&Lo()}}function mv(){Gr=cu.current,Ft(cu)}function za(o,l){o.finishedWork=null,o.finishedLanes=0;var f=o.timeoutHandle;if(f!==-1&&(o.timeoutHandle=-1,mO(f)),vn!==null)for(f=vn.return;f!==null;){var g=f;switch(Eg(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&hh();break;case 3:au(),Ft(br),Ft(Yn),Fg();break;case 5:Dg(g);break;case 4:au();break;case 13:Ft(qt);break;case 19:Ft(qt);break;case 10:Ag(g.type._context);break;case 22:case 23:mv()}f=f.return}if(In=o,vn=o=zo(o.current,null),Hn=Gr=l,Cn=0,nd=null,lv=Nh=$a=0,Cr=rd=null,Fa!==null){for(l=0;l<Fa.length;l++)if(f=Fa[l],g=f.interleaved,g!==null){f.interleaved=null;var S=g.next,C=f.pending;if(C!==null){var M=C.next;C.next=S,g.next=M}f.pending=g}Fa=null}return o}function XS(o,l){do{var f=vn;try{if(Ig(),Ch.current=Ih,kh){for(var g=Zt.memoizedState;g!==null;){var S=g.queue;S!==null&&(S.pending=null),g=g.next}kh=!1}if(Va=0,Tn=En=Zt=null,Yc=!1,Xc=0,av.current=null,f===null||f.return===null){Cn=1,nd=l,vn=null;break}e:{var C=o,M=f.return,V=f,U=l;if(l=Hn,V.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=U,he=V,ge=he.tag;if((he.mode&1)===0&&(ge===0||ge===11||ge===15)){var fe=he.alternate;fe?(he.updateQueue=fe.updateQueue,he.memoizedState=fe.memoizedState,he.lanes=fe.lanes):(he.updateQueue=null,he.memoizedState=null)}var Ie=bS(M);if(Ie!==null){Ie.flags&=-257,SS(Ie,M,V,C,l),Ie.mode&1&&xS(C,re,l),l=Ie,U=re;var Oe=l.updateQueue;if(Oe===null){var De=new Set;De.add(U),l.updateQueue=De}else Oe.add(U);break e}else{if((l&1)===0){xS(C,re,l),gv();break e}U=Error(n(426))}}else if(Bt&&V.mode&1){var cn=bS(M);if(cn!==null){(cn.flags&65536)===0&&(cn.flags|=256),SS(cn,M,V,C,l),Pg(lu(U,V));break e}}C=U=lu(U,V),Cn!==4&&(Cn=2),rd===null?rd=[C]:rd.push(C),C=M;do{switch(C.tag){case 3:C.flags|=65536,l&=-l,C.lanes|=l;var Q=_S(C,U,l);Gb(C,Q);break e;case 1:V=U;var q=C.type,te=C.stateNode;if((C.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(jo===null||!jo.has(te)))){C.flags|=65536,l&=-l,C.lanes|=l;var xe=wS(C,V,l);Gb(C,xe);break e}}C=C.return}while(C!==null)}eE(f)}catch(Fe){l=Fe,vn===f&&f!==null&&(vn=f=f.return);continue}break}while(!0)}function QS(){var o=Dh.current;return Dh.current=Ih,o===null?Ih:o}function gv(){(Cn===0||Cn===3||Cn===2)&&(Cn=4),In===null||($a&268435455)===0&&(Nh&268435455)===0||Ho(In,Hn)}function zh(o,l){var f=pt;pt|=2;var g=QS();(In!==o||Hn!==l)&&(Vi=null,za(o,l));do try{$O();break}catch(S){XS(o,S)}while(!0);if(Ig(),pt=f,Dh.current=g,vn!==null)throw Error(n(261));return In=null,Hn=0,Cn}function $O(){for(;vn!==null;)JS(vn)}function HO(){for(;vn!==null&&!K0();)JS(vn)}function JS(o){var l=rE(o.alternate,o,Gr);o.memoizedProps=o.pendingProps,l===null?eE(o):vn=l,av.current=null}function eE(o){var l=o;do{var f=l.alternate;if(o=l.return,(l.flags&32768)===0){if(f=OO(f,l,Gr),f!==null){vn=f;return}}else{if(f=LO(f,l),f!==null){f.flags&=32767,vn=f;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Cn=6,vn=null;return}}if(l=l.sibling,l!==null){vn=l;return}vn=l=o}while(l!==null);Cn===0&&(Cn=5)}function Ba(o,l,f){var g=rt,S=ys.transition;try{ys.transition=null,rt=1,zO(o,l,f,g)}finally{ys.transition=S,rt=g}return null}function zO(o,l,f,g){do fu();while(Vo!==null);if((pt&6)!==0)throw Error(n(327));f=o.finishedWork;var S=o.finishedLanes;if(f===null)return null;if(o.finishedWork=null,o.finishedLanes=0,f===o.current)throw Error(n(177));o.callbackNode=null,o.callbackPriority=0;var C=f.lanes|f.childLanes;if(gn(o,C),o===In&&(vn=In=null,Hn=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||jh||(jh=!0,sE(Ra,function(){return fu(),null})),C=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||C){C=ys.transition,ys.transition=null;var M=rt;rt=1;var V=pt;pt|=4,av.current=null,NO(o,f),US(f,o),lO(gg),Jf=!!mg,gg=mg=null,o.current=f,FO(f),zx(),pt=V,rt=M,ys.transition=C}else o.current=f;if(jh&&(jh=!1,Vo=o,Vh=S),C=o.pendingLanes,C===0&&(jo=null),Zf(f.stateNode),kr(o,Ct()),l!==null)for(g=o.onRecoverableError,f=0;f<l.length;f++)S=l[f],g(S.value,{componentStack:S.stack,digest:S.digest});if(Fh)throw Fh=!1,o=cv,cv=null,o;return(Vh&1)!==0&&o.tag!==0&&fu(),C=o.pendingLanes,(C&1)!==0?o===dv?sd++:(sd=0,dv=o):sd=0,Lo(),null}function fu(){if(Vo!==null){var o=Yf(Vh),l=ys.transition,f=rt;try{if(ys.transition=null,rt=16>o?16:o,Vo===null)var g=!1;else{if(o=Vo,Vo=null,Vh=0,(pt&6)!==0)throw Error(n(331));var S=pt;for(pt|=4,Re=o.current;Re!==null;){var C=Re,M=C.child;if((Re.flags&16)!==0){var V=C.deletions;if(V!==null){for(var U=0;U<V.length;U++){var re=V[U];for(Re=re;Re!==null;){var he=Re;switch(he.tag){case 0:case 11:case 15:td(8,he,C)}var ge=he.child;if(ge!==null)ge.return=he,Re=ge;else for(;Re!==null;){he=Re;var fe=he.sibling,Ie=he.return;if(VS(he),he===re){Re=null;break}if(fe!==null){fe.return=Ie,Re=fe;break}Re=Ie}}}var Oe=C.alternate;if(Oe!==null){var De=Oe.child;if(De!==null){Oe.child=null;do{var cn=De.sibling;De.sibling=null,De=cn}while(De!==null)}}Re=C}}if((C.subtreeFlags&2064)!==0&&M!==null)M.return=C,Re=M;else e:for(;Re!==null;){if(C=Re,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:td(9,C,C.return)}var Q=C.sibling;if(Q!==null){Q.return=C.return,Re=Q;break e}Re=C.return}}var q=o.current;for(Re=q;Re!==null;){M=Re;var te=M.child;if((M.subtreeFlags&2064)!==0&&te!==null)te.return=M,Re=te;else e:for(M=q;Re!==null;){if(V=Re,(V.flags&2048)!==0)try{switch(V.tag){case 0:case 11:case 15:Lh(9,V)}}catch(Fe){tn(V,V.return,Fe)}if(V===M){Re=null;break e}var xe=V.sibling;if(xe!==null){xe.return=V.return,Re=xe;break e}Re=V.return}}if(pt=S,Lo(),zr&&typeof zr.onPostCommitFiberRoot=="function")try{zr.onPostCommitFiberRoot(Ma,o)}catch{}g=!0}return g}finally{rt=f,ys.transition=l}}return!1}function tE(o,l,f){l=lu(f,l),l=_S(o,l,1),o=No(o,l,1),l=lr(),o!==null&&(xr(o,1,l),kr(o,l))}function tn(o,l,f){if(o.tag===3)tE(o,o,f);else for(;l!==null;){if(l.tag===3){tE(l,o,f);break}else if(l.tag===1){var g=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(jo===null||!jo.has(g))){o=lu(f,o),o=wS(l,o,1),l=No(l,o,1),o=lr(),l!==null&&(xr(l,1,o),kr(l,o));break}}l=l.return}}function BO(o,l,f){var g=o.pingCache;g!==null&&g.delete(l),l=lr(),o.pingedLanes|=o.suspendedLanes&f,In===o&&(Hn&f)===f&&(Cn===4||Cn===3&&(Hn&130023424)===Hn&&500>Ct()-uv?za(o,0):lv|=f),kr(o,l)}function nE(o,l){l===0&&((o.mode&1)===0?l=1:(l=me,me<<=1,(me&130023424)===0&&(me=4194304)));var f=lr();o=Ni(o,l),o!==null&&(xr(o,l,f),kr(o,f))}function UO(o){var l=o.memoizedState,f=0;l!==null&&(f=l.retryLane),nE(o,f)}function WO(o,l){var f=0;switch(o.tag){case 13:var g=o.stateNode,S=o.memoizedState;S!==null&&(f=S.retryLane);break;case 19:g=o.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(l),nE(o,f)}var rE;rE=function(o,l,f){if(o!==null)if(o.memoizedProps!==l.pendingProps||br.current)Er=!0;else{if((o.lanes&f)===0&&(l.flags&128)===0)return Er=!1,MO(o,l,f);Er=(o.flags&131072)!==0}else Er=!1,Bt&&(l.flags&1048576)!==0&&Nb(l,vh,l.index);switch(l.lanes=0,l.tag){case 2:var g=l.type;Mh(o,l),o=l.pendingProps;var S=eu(l,Yn.current);ou(l,f),S=$g(null,l,g,o,S,f);var C=Hg();return l.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Sr(g)?(C=!0,ph(l)):C=!1,l.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Og(l),S.updater=Ah,l.stateNode=S,S._reactInternals=l,Kg(l,g,o,f),l=Xg(null,l,g,!0,C,f)):(l.tag=0,Bt&&C&&Sg(l),ar(null,l,S,f),l=l.child),l;case 16:g=l.elementType;e:{switch(Mh(o,l),o=l.pendingProps,S=g._init,g=S(g._payload),l.type=g,S=l.tag=KO(g),o=Fs(g,o),S){case 0:l=Yg(null,l,g,o,f);break e;case 1:l=IS(null,l,g,o,f);break e;case 11:l=ES(null,l,g,o,f);break e;case 14:l=CS(null,l,g,Fs(g.type,o),f);break e}throw Error(n(306,g,""))}return l;case 0:return g=l.type,S=l.pendingProps,S=l.elementType===g?S:Fs(g,S),Yg(o,l,g,S,f);case 1:return g=l.type,S=l.pendingProps,S=l.elementType===g?S:Fs(g,S),IS(o,l,g,S,f);case 3:e:{if(AS(l),o===null)throw Error(n(387));g=l.pendingProps,C=l.memoizedState,S=C.element,Wb(o,l),Sh(l,g,null,f);var M=l.memoizedState;if(g=M.element,C.isDehydrated)if(C={element:g,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},l.updateQueue.baseState=C,l.memoizedState=C,l.flags&256){S=lu(Error(n(423)),l),l=RS(o,l,g,f,S);break e}else if(g!==S){S=lu(Error(n(424)),l),l=RS(o,l,g,f,S);break e}else for(Wr=Ro(l.stateNode.containerInfo.firstChild),Ur=l,Bt=!0,Ns=null,f=Bb(l,null,g,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(ru(),g===S){l=ji(o,l,f);break e}ar(o,l,g,f)}l=l.child}return l;case 5:return qb(l),o===null&&kg(l),g=l.type,S=l.pendingProps,C=o!==null?o.memoizedProps:null,M=S.children,vg(g,S)?M=null:C!==null&&vg(g,C)&&(l.flags|=32),TS(o,l),ar(o,l,M,f),l.child;case 6:return o===null&&kg(l),null;case 13:return MS(o,l,f);case 4:return Lg(l,l.stateNode.containerInfo),g=l.pendingProps,o===null?l.child=su(l,null,g,f):ar(o,l,g,f),l.child;case 11:return g=l.type,S=l.pendingProps,S=l.elementType===g?S:Fs(g,S),ES(o,l,g,S,f);case 7:return ar(o,l,l.pendingProps,f),l.child;case 8:return ar(o,l,l.pendingProps.children,f),l.child;case 12:return ar(o,l,l.pendingProps.children,f),l.child;case 10:e:{if(g=l.type._context,S=l.pendingProps,C=l.memoizedProps,M=S.value,Ot(wh,g._currentValue),g._currentValue=M,C!==null)if(Ds(C.value,M)){if(C.children===S.children&&!br.current){l=ji(o,l,f);break e}}else for(C=l.child,C!==null&&(C.return=l);C!==null;){var V=C.dependencies;if(V!==null){M=C.child;for(var U=V.firstContext;U!==null;){if(U.context===g){if(C.tag===1){U=Fi(-1,f&-f),U.tag=2;var re=C.updateQueue;if(re!==null){re=re.shared;var he=re.pending;he===null?U.next=U:(U.next=he.next,he.next=U),re.pending=U}}C.lanes|=f,U=C.alternate,U!==null&&(U.lanes|=f),Rg(C.return,f,l),V.lanes|=f;break}U=U.next}}else if(C.tag===10)M=C.type===l.type?null:C.child;else if(C.tag===18){if(M=C.return,M===null)throw Error(n(341));M.lanes|=f,V=M.alternate,V!==null&&(V.lanes|=f),Rg(M,f,l),M=C.sibling}else M=C.child;if(M!==null)M.return=C;else for(M=C;M!==null;){if(M===l){M=null;break}if(C=M.sibling,C!==null){C.return=M.return,M=C;break}M=M.return}C=M}ar(o,l,S.children,f),l=l.child}return l;case 9:return S=l.type,g=l.pendingProps.children,ou(l,f),S=gs(S),g=g(S),l.flags|=1,ar(o,l,g,f),l.child;case 14:return g=l.type,S=Fs(g,l.pendingProps),S=Fs(g.type,S),CS(o,l,g,S,f);case 15:return kS(o,l,l.type,l.pendingProps,f);case 17:return g=l.type,S=l.pendingProps,S=l.elementType===g?S:Fs(g,S),Mh(o,l),l.tag=1,Sr(g)?(o=!0,ph(l)):o=!1,ou(l,f),vS(l,g,S),Kg(l,g,S,f),Xg(null,l,g,!0,o,f);case 19:return LS(o,l,f);case 22:return PS(o,l,f)}throw Error(n(156,l.tag))};function sE(o,l){return zl(o,l)}function GO(o,l,f,g){this.tag=o,this.key=f,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=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _s(o,l,f,g){return new GO(o,l,f,g)}function vv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function KO(o){if(typeof o=="function")return vv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===F)return 11;if(o===W)return 14}return 2}function zo(o,l){var f=o.alternate;return f===null?(f=_s(o.tag,l,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=l,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&14680064,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,l=o.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f}function Bh(o,l,f,g,S,C){var M=2;if(g=o,typeof o=="function")vv(o)&&(M=1);else if(typeof o=="string")M=5;else e:switch(o){case L:return Ua(f.children,S,C,l);case A:M=8,S|=8;break;case O:return o=_s(12,f,l,S|2),o.elementType=O,o.lanes=C,o;case K:return o=_s(13,f,l,S),o.elementType=K,o.lanes=C,o;case Z:return o=_s(19,f,l,S),o.elementType=Z,o.lanes=C,o;case Y:return Uh(f,S,C,l);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case D:M=10;break e;case N:M=9;break e;case F:M=11;break e;case W:M=14;break e;case G:M=16,g=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return l=_s(M,f,l,S),l.elementType=o,l.type=g,l.lanes=C,l}function Ua(o,l,f,g){return o=_s(7,o,g,l),o.lanes=f,o}function Uh(o,l,f,g){return o=_s(22,o,g,l),o.elementType=Y,o.lanes=f,o.stateNode={isHidden:!1},o}function yv(o,l,f){return o=_s(6,o,null,l),o.lanes=f,o}function _v(o,l,f){return l=_s(4,o.children!==null?o.children:[],o.key,l),l.lanes=f,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}function qO(o,l,f,g,S){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=Ls(0),this.expirationTimes=Ls(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ls(0),this.identifierPrefix=g,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function wv(o,l,f,g,S,C,M,V,U){return o=new qO(o,l,f,V,U),l===1?(l=1,C===!0&&(l|=8)):l=0,C=_s(3,null,null,l),o.current=C,C.stateNode=o,C.memoizedState={element:g,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Og(C),o}function ZO(o,l,f){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:g==null?null:""+g,children:o,containerInfo:l,implementation:f}}function iE(o){if(!o)return Oo;o=o._reactInternals;e:{if(Ms(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(Sr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(o.tag===1){var f=o.type;if(Sr(f))return Ob(o,f,l)}return l}function oE(o,l,f,g,S,C,M,V,U){return o=wv(f,g,!0,o,S,C,M,V,U),o.context=iE(null),f=o.current,g=lr(),S=$o(f),C=Fi(g,S),C.callback=l??null,No(f,C,S),o.current.lanes=S,xr(o,S,g),kr(o,g),o}function Wh(o,l,f,g){var S=l.current,C=lr(),M=$o(S);return f=iE(f),l.context===null?l.context=f:l.pendingContext=f,l=Fi(C,M),l.payload={element:o},g=g===void 0?null:g,g!==null&&(l.callback=g),o=No(S,l,M),o!==null&&($s(o,S,M,C),bh(o,S,M)),M}function Gh(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 aE(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<l?f:l}}function xv(o,l){aE(o,l),(o=o.alternate)&&aE(o,l)}function YO(){return null}var lE=typeof reportError=="function"?reportError:function(o){console.error(o)};function bv(o){this._internalRoot=o}Kh.prototype.render=bv.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(n(409));Wh(o,l,null,null)},Kh.prototype.unmount=bv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Ha(function(){Wh(null,o,null,null)}),l[Mi]=null}};function Kh(o){this._internalRoot=o}Kh.prototype.unstable_scheduleHydration=function(o){if(o){var l=Wx();o={blockedOn:null,target:o,priority:l};for(var f=0;f<To.length&&l!==0&&l<To[f].priority;f++);To.splice(f,0,o),f===0&&qx(o)}};function Sv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function qh(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function uE(){}function XO(o,l,f,g,S){if(S){if(typeof g=="function"){var C=g;g=function(){var re=Gh(M);C.call(re)}}var M=oE(l,g,o,0,null,!1,!1,"",uE);return o._reactRootContainer=M,o[Mi]=M.current,zc(o.nodeType===8?o.parentNode:o),Ha(),M}for(;S=o.lastChild;)o.removeChild(S);if(typeof g=="function"){var V=g;g=function(){var re=Gh(U);V.call(re)}}var U=wv(o,0,!1,null,null,!1,!1,"",uE);return o._reactRootContainer=U,o[Mi]=U.current,zc(o.nodeType===8?o.parentNode:o),Ha(function(){Wh(l,U,f,g)}),U}function Zh(o,l,f,g,S){var C=f._reactRootContainer;if(C){var M=C;if(typeof S=="function"){var V=S;S=function(){var U=Gh(M);V.call(U)}}Wh(l,M,o,S)}else M=XO(f,l,o,S,g);return Gh(M)}Bx=function(o){switch(o.tag){case 3:var l=o.stateNode;if(l.current.memoizedState.isDehydrated){var f=Ee(l.pendingLanes);f!==0&&(Ri(l,f|1),kr(l,Ct()),(pt&6)===0&&(du=Ct()+500,Lo()))}break;case 13:Ha(function(){var g=Ni(o,1);if(g!==null){var S=lr();$s(g,o,1,S)}}),xv(o,1)}},q0=function(o){if(o.tag===13){var l=Ni(o,134217728);if(l!==null){var f=lr();$s(l,o,134217728,f)}xv(o,134217728)}},Ux=function(o){if(o.tag===13){var l=$o(o),f=Ni(o,l);if(f!==null){var g=lr();$s(f,o,l,g)}xv(o,l)}},Wx=function(){return rt},Gx=function(o,l){var f=rt;try{return rt=o,l()}finally{rt=f}},Xs=function(o,l,f){switch(l){case"input":if($e(o,f),l=f.name,f.type==="radio"&&l!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var g=f[l];if(g!==o&&g.form===o.form){var S=fh(g);if(!S)throw Error(n(90));Pe(g),$e(g,S)}}}break;case"textarea":ln(o,f);break;case"select":l=f.value,l!=null&&nt(o,!!f.multiple,l,!1)}},We=pv,Gt=Ha;var QO={usingClientEntryPoint:!1,Events:[Wc,Ql,fh,Ii,Ai,pv]},id={findFiberByHostInstance:Oa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},JO={bundleType:id.bundleType,version:id.version,rendererPackageName:id.rendererPackageName,rendererConfig:id.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=Gf(o),o===null?null:o.stateNode},findFiberByHostInstance:id.findFiberByHostInstance||YO,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 Yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yh.isDisabled&&Yh.supportsFiber)try{Ma=Yh.inject(JO),zr=Yh}catch{}}return Pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=QO,Pr.createPortal=function(o,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Sv(l))throw Error(n(200));return ZO(o,l,null,f)},Pr.createRoot=function(o,l){if(!Sv(o))throw Error(n(299));var f=!1,g="",S=lE;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onRecoverableError!==void 0&&(S=l.onRecoverableError)),l=wv(o,1,!1,null,null,f,!1,g,S),o[Mi]=l.current,zc(o.nodeType===8?o.parentNode:o),new bv(l)},Pr.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=Gf(l),o=o===null?null:o.stateNode,o},Pr.flushSync=function(o){return Ha(o)},Pr.hydrate=function(o,l,f){if(!qh(l))throw Error(n(200));return Zh(null,o,l,!0,f)},Pr.hydrateRoot=function(o,l,f){if(!Sv(o))throw Error(n(405));var g=f!=null&&f.hydratedSources||null,S=!1,C="",M=lE;if(f!=null&&(f.unstable_strictMode===!0&&(S=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(M=f.onRecoverableError)),l=oE(l,null,o,1,f??null,S,!1,C,M),o[Mi]=l.current,zc(o),g)for(o=0;o<g.length;o++)f=g[o],S=f._getVersion,S=S(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,S]:l.mutableSourceEagerHydrationData.push(f,S);return new Kh(l)},Pr.render=function(o,l,f){if(!qh(l))throw Error(n(200));return Zh(null,o,l,!1,f)},Pr.unmountComponentAtNode=function(o){if(!qh(o))throw Error(n(40));return o._reactRootContainer?(Ha(function(){Zh(null,null,o,!1,function(){o._reactRootContainer=null,o[Mi]=null})}),!0):!1},Pr.unstable_batchedUpdates=pv,Pr.unstable_renderSubtreeIntoContainer=function(o,l,f,g){if(!qh(f))throw Error(n(200));if(o==null||o._reactInternals===void 0)throw Error(n(38));return Zh(o,l,f,!1,g)},Pr.version="18.3.1-next-f1338f8080-20240426",Pr}var WC;function h3(){if(WC)return a1.exports;WC=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(),a1.exports=E9(),a1.exports}var GC;function C9(){if(GC)return fp;GC=1;var t=h3();return fp.createRoot=t.createRoot,fp.hydrateRoot=t.hydrateRoot,fp}var k9=C9();const P9=d0(k9),oo={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};function p3(t){return"init"in t}function i_(t){return typeof t.write=="function"}function T9(t){return!!t.onMount}function KC(t){return"v"in t||"e"in t}function Dm(t){if("e"in t)throw t.e;if((oo?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}function Nm(t){return typeof(t==null?void 0:t.then)=="function"}function I9(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 m3(t,e,n){if(!n.p.has(t)){n.p.add(t);const r=()=>n.p.delete(t);e.then(r,r)}}function g3(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 A9(t){return!!t.INTERNAL_onInit}const R9=(t,e,n,...r)=>n.read(...r),M9=(t,e,n,...r)=>n.write(...r),O9=(t,e,n)=>n.INTERNAL_onInit(e),L9=(t,e,n,r)=>{var s;return(s=n.onMount)==null?void 0:s.call(n,r)},D9=(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),A9(n)&&u(t,e,n)}return i},N9=(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 d=[],h=p=>{try{p()}catch(m){d.push(m)}};do{u.f&&h(u.f);const p=new Set;for(const m of s){const y=(n=r.get(m))==null?void 0:n.l;if(y)for(const w of y)p.add(w)}s.clear();for(const m of a)p.add(m);a.clear();for(const m of i)p.add(m);i.clear();for(const m of p)h(m);s.size&&c(t,e)}while(s.size||a.size||i.size);if(d.length)throw new AggregateError(d)},F9=(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=[],d=[],h=new WeakSet,p=new WeakSet,m=[],y=[];for(const w of s)m.push(w),y.push(i(t,e,w));for(;m.length;){const w=m.length-1,_=m[w],x=y[w];if(p.has(_)){m.pop(),y.pop();continue}if(h.has(_)){if(r.get(_)===x.n)c.push(_),d.push(x);else if((oo?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");p.add(_),m.pop(),y.pop();continue}h.add(_);for(const b of g3(_,x,n))h.has(b)||(m.push(b),y.push(i(t,e,b)))}for(let w=c.length-1;w>=0;--w){const _=c[w],x=d[w];let b=!1;for(const P of x.d.keys())if(P!==_&&s.has(P)){b=!0;break}b&&(r.set(_,x.n),a(t,e,_),u(t,e,_)),r.delete(_)}},o_=new WeakSet,j9=(t,e,n)=>{var r,s;const i=t[1],a=t[2],u=t[3],c=t[6],d=t[7],h=t[11],p=t[12],m=t[13],y=t[14],w=t[16],_=t[17],x=t[20],b=t[26],P=t[28],T=h(t,e,n),k=P[0];if(KC(T)){if(i.has(n)&&a.get(n)!==T.n||T.m===k)return T.m=k,T;let W=!1;for(const[G,Y]of T.d)if(y(t,e,G).n!==Y){W=!0;break}if(!W)return T.m=k,T}let I=!0;const R=new Set(T.d.keys()),L=()=>{for(const W of R)T.d.delete(W)},A=()=>{if(i.has(n)){const W=!u.size;_(t,e,n),W&&(m(t,e),p(t,e))}},O=W=>{var G;if(W===n){const $=h(t,e,W);if(!KC($))if(p3(W))x(t,e,W,W.init);else throw new Error("no atom init");return Dm($)}const Y=y(t,e,W);try{return Dm(Y)}finally{R.delete(W),T.d.set(W,Y.n),Nm(T.v)&&m3(n,T.v,Y),i.has(n)&&((G=i.get(W))==null||G.t.add(n)),I||A()}};let D,N;const F={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(oo?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(oo?"production":void 0)!=="production"&&!i_(n)&&console.warn("setSelf function cannot be used with read-only atom"),!N&&i_(n)&&(N=(...W)=>{if((oo?"production":void 0)!=="production"&&I&&console.warn("setSelf function cannot be called in sync"),!I)try{return w(t,e,n,W)}finally{m(t,e),p(t,e)}}),N}},K=T.n,Z=a.get(n)===K;try{(oo?"production":void 0)!=="production"&&o_.delete(e);const W=d(t,e,n,O,F);if((oo?"production":void 0)!=="production"&&o_.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),x(t,e,n,W),Nm(W)){b(t,e,W,()=>D==null?void 0:D.abort());const G=()=>{L(),A()};W.then(G,G)}else L();return(r=c.r)==null||r.call(c,n),T.m=k,T}catch(W){if(I9(W))throw W;return delete T.v,T.e=W,++T.n,T.m=k,T}finally{I=!1,T.n!==K&&Z&&(a.set(n,T.n),u.add(n),(s=c.c)==null||s.call(c,n))}},V9=(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 d of g3(u,c,r)){const h=i(t,e,d);s.get(d)!==h.n&&(s.set(d,h.n),a.push(d))}}},$9=(t,e,n,r)=>{const s=t[3],i=t[6],a=t[8],u=t[11],c=t[12],d=t[13],h=t[14],p=t[15],m=t[16],y=t[17],w=t[20],_=t[28];let x=!0;const b=T=>Dm(h(t,e,T)),P=(T,...k)=>{var I;const R=u(t,e,T);try{if(T===n){if(!p3(T))throw new Error("atom not writable");(oo?"production":void 0)!=="production"&&o_.add(e);const L=R.n,A=k[0];w(t,e,T,A),y(t,e,T),L!==R.n&&(++_[0],s.add(T),p(t,e,T),(I=i.c)==null||I.call(i,T));return}else return m(t,e,T,k)}finally{x||(d(t,e),c(t,e))}};try{return a(t,e,n,b,P,...r)}finally{x=!1}},H9=(t,e,n)=>{var r;const s=t[1],i=t[3],a=t[6],u=t[11],c=t[15],d=t[18],h=t[19],p=u(t,e,n),m=s.get(n);if(m&&p.d.size>0){for(const[y,w]of p.d)if(!m.d.has(y)){const _=u(t,e,y);d(t,e,y).t.add(n),m.d.add(y),w!==_.n&&(i.add(y),c(t,e,y),(r=a.c)==null||r.call(a,y))}for(const y of m.d)if(!p.d.has(y)){m.d.delete(y);const w=h(t,e,y);w==null||w.t.delete(n)}}},z9=(t,e,n)=>{var r;const s=t[1],i=t[4],a=t[6],u=t[10],c=t[11],d=t[12],h=t[13],p=t[14],m=t[16],y=t[18],w=c(t,e,n);let _=s.get(n);if(!_){p(t,e,n);for(const x of w.d.keys())y(t,e,x).t.add(n);if(_={l:new Set,d:new Set(w.d.keys()),t:new Set},s.set(n,_),i_(n)&&T9(n)){const x=()=>{let b=!0;const P=(...T)=>{try{return m(t,e,n,T)}finally{b||(h(t,e),d(t,e))}};try{const T=u(t,e,n,P);T&&(_.u=()=>{b=!0;try{T()}finally{b=!1}})}finally{b=!1}};i.add(x)}(r=a.m)==null||r.call(a,n)}return _},B9=(t,e,n)=>{var r,s;const i=t[1],a=t[5],u=t[6],c=t[11],d=t[19],h=c(t,e,n);let p=i.get(n);if(!p||p.l.size)return p;let m=!1;for(const y of p.t)if((r=i.get(y))!=null&&r.d.has(n)){m=!0;break}if(!m){p.u&&a.add(p.u),p=void 0,i.delete(n);for(const y of h.d.keys()){const w=d(t,e,y);w==null||w.t.delete(n)}(s=u.u)==null||s.call(u,n);return}return p},U9=(t,e,n,r)=>{const s=t[11],i=t[27],a=s(t,e,n),u="v"in a,c=a.v;if(Nm(r))for(const d of a.d.keys())m3(n,r,s(t,e,d));a.v=r,delete a.e,(!u||!Object.is(c,a.v))&&(++a.n,Nm(c)&&i(t,e,c))},W9=(t,e,n)=>{const r=t[14];return Dm(r(t,e,n))},G9=(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))}},K9=(t,e,n,r)=>{const s=t[12],i=t[13],a=t[18],u=t[19],d=a(t,e,n).l;return d.add(r),i(t,e),s(t,e),()=>{d.delete(r),u(t,e,n),i(t,e),s(t,e)}},q9=(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)},Z9=(t,e,n)=>{const s=t[25].get(n);s==null||s.forEach(i=>i())},v3=new WeakMap;function Y9(t){const e=v3.get(t);if((oo?"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 X9(...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,{},R9,M9,O9,L9,D9,N9,F9,j9,V9,$9,H9,z9,B9,U9,W9,G9,K9,void 0,new WeakMap,q9,Z9,[0]].map((a,u)=>t[u]||a);v3.set(e,Object.freeze(n));const r=n[21],s=n[22],i=n[23];return e}const y3={};let Q9=0;function it(t,e){const n=`atom${++Q9}`,r={toString(){return(y3?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=J9,r.write=eF),e&&(r.write=e),r}function J9(t){return t(this)}function eF(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function tF(){return X9()}let gd;function nF(){return gd||(gd=tF(),(y3?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=gd),globalThis.__JOTAI_DEFAULT_STORE__!==gd&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),gd}const rF={},sF=v.createContext(void 0);function Y2(t){return v.useContext(sF)||nF()}const a_=t=>typeof(t==null?void 0:t.then)=="function",l_=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},iF=ye.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(l_(t),t)}),c1=new WeakMap,qC=(t,e,n)=>{const r=Y9(t),s=r[26];let i=c1.get(e);return i||(i=new Promise((a,u)=>{let c=e;const d=m=>y=>{c===m&&a(y)},h=m=>y=>{c===m&&u(y)},p=()=>{try{const m=n();a_(m)?(c1.set(m,i),c=m,m.then(d(m),h(m)),s(r,t,m,p)):a(m)}catch(m){u(m)}};e.then(d(e),h(e)),s(r,t,e,p)}),c1.set(e,i)),i};function et(t,e){const{delay:n,unstable_promiseStatus:r=!ye.use}={},s=Y2(),[[i,a,u],c]=v.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 d=i;if((a!==s||u!==t)&&(c(),d=s.get(t)),v.useEffect(()=>{const h=s.sub(t,()=>{if(r)try{const p=s.get(t);a_(p)&&l_(qC(s,p,()=>s.get(t)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
43
+
44
+ Migration guide:
45
+
46
+ Create a custom hook like the following.
47
+
48
+ function useAtomValueWithDelay<Value>(
49
+ atom: Atom<Value>,
50
+ options: { delay: number },
51
+ ): Value {
52
+ const { delay } = options
53
+ const store = useStore(options)
54
+ const [value, setValue] = useState(() => store.get(atom))
55
+ useEffect(() => {
56
+ const unsub = store.sub(atom, () => {
57
+ setTimeout(() => setValue(store.get(atom)), delay)
58
+ })
59
+ return unsub
60
+ }, [store, atom, delay])
61
+ return value
62
+ }
63
+ `),setTimeout(c,n);return}c()});return c(),h},[s,t,n,r]),v.useDebugValue(d),a_(d)){const h=qC(s,d,()=>s.get(t));return r&&l_(h),iF(h)}return d}function lt(t,e){const n=Y2();return v.useCallback((...s)=>{if((rF?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...s)},[n,t])}function _3(t,e){return[et(t),lt(t)]}const X2=v.createContext({});function Q2(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const oF=typeof window<"u",J2=oF?v.useLayoutEffect:v.useEffect,v0=v.createContext(null);function ew(t,e){t.indexOf(e)===-1&&t.push(e)}function Fm(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Si=(t,e,n)=>n>e?e:n<t?t:n;let y0=()=>{};const ma={},w3=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),x3=t=>typeof t=="object"&&t!==null,b3=t=>/^0[^.\s]+$/u.test(t);function S3(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ts=t=>t,Rf=(...t)=>t.reduce((e,n)=>r=>n(e(r))),Jd=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class tw{constructor(){this.subscriptions=[]}add(e){return ew(this.subscriptions,e),()=>Fm(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;i<s;i++){const a=this.subscriptions[i];a&&a(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ss=t=>t*1e3,Es=t=>t/1e3,E3=(t,e)=>e?t*(1e3/e):0,C3=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,aF=1e-7,lF=12;function uF(t,e,n,r,s){let i,a,u=0;do a=e+(n-e)/2,i=C3(a,r,s)-t,i>0?n=a:e=a;while(Math.abs(i)>aF&&++u<lF);return a}function Mf(t,e,n,r){if(t===e&&n===r)return Ts;const s=i=>uF(i,0,1,t,n);return i=>i===0||i===1?i:C3(s(i),e,r)}const k3=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,P3=t=>e=>1-t(1-e),T3=Mf(.33,1.53,.69,.99),nw=P3(T3),I3=k3(nw),A3=t=>t>=1?1:(t*=2)<1?.5*nw(t):.5*(2-Math.pow(2,-10*(t-1))),rw=t=>1-Math.sin(Math.acos(t)),R3=P3(rw),M3=k3(rw),cF=Mf(.42,0,1,1),dF=Mf(0,0,.58,1),O3=Mf(.42,0,.58,1),fF=t=>Array.isArray(t)&&typeof t[0]!="number",L3=t=>Array.isArray(t)&&typeof t[0]=="number",hF={linear:Ts,easeIn:cF,easeInOut:O3,easeOut:dF,circIn:rw,circInOut:M3,circOut:R3,backIn:nw,backInOut:I3,backOut:T3,anticipate:A3},pF=t=>typeof t=="string",ZC=t=>{if(L3(t)){y0(t.length===4);const[e,n,r,s]=t;return Mf(e,n,r,s)}else if(pF(t))return hF[t];return t},hp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function mF(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(d){i.has(d)&&(c.schedule(d),t()),d(a)}const c={schedule:(d,h=!1,p=!1)=>{const y=p&&r?e:n;return h&&i.add(d),y.add(d),d},cancel:d=>{n.delete(d),i.delete(d)},process:d=>{if(a=d,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(d))}};return c}const gF=40;function D3(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=hp.reduce((T,k)=>(T[k]=mF(i),T),{}),{setup:u,read:c,resolveKeyframes:d,preUpdate:h,update:p,preRender:m,render:y,postRender:w}=a,_=()=>{const T=ma.useManualTiming,k=T?s.timestamp:performance.now();n=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,gF),1)),s.timestamp=k,s.isProcessing=!0,u.process(s),c.process(s),d.process(s),h.process(s),p.process(s),m.process(s),y.process(s),w.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(_))},x=()=>{n=!0,r=!0,s.isProcessing||t(_)};return{schedule:hp.reduce((T,k)=>{const I=a[k];return T[k]=(R,L=!1,A=!1)=>(n||x(),I.schedule(R,L,A)),T},{}),cancel:T=>{for(let k=0;k<hp.length;k++)a[hp[k]].cancel(T)},state:s,steps:a}}const{schedule:Mt,cancel:ga,state:Bn,steps:d1}=D3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ts,!0);let Hp;function vF(){Hp=void 0}const pr={now:()=>(Hp===void 0&&pr.set(Bn.isProcessing||ma.useManualTiming?Bn.timestamp:performance.now()),Hp),set:t=>{Hp=t,queueMicrotask(vF)}},N3=t=>e=>typeof e=="string"&&e.startsWith(t),F3=N3("--"),yF=N3("var(--"),sw=t=>yF(t)?_F.test(t.split("/*")[0].trim()):!1,_F=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function YC(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const wc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ef={...wc,transform:t=>Si(0,1,t)},pp={...wc,default:1},Ld=t=>Math.round(t*1e5)/1e5,iw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wF(t){return t==null}const xF=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ow=(t,e)=>n=>!!(typeof n=="string"&&xF.test(n)&&n.startsWith(t)||e&&!wF(n)&&Object.prototype.hasOwnProperty.call(n,e)),j3=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,u]=r.match(iw);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}},bF=t=>Si(0,255,t),f1={...wc,transform:t=>Math.round(bF(t))},hl={test:ow("rgb","red"),parse:j3("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+f1.transform(t)+", "+f1.transform(e)+", "+f1.transform(n)+", "+Ld(ef.transform(r))+")"};function SF(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 u_={test:ow("#"),parse:SF,transform:hl.transform},Of=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),qi=Of("deg"),bi=Of("%"),Le=Of("px"),EF=Of("vh"),CF=Of("vw"),XC={...bi,parse:t=>bi.parse(t)/100,transform:t=>bi.transform(t*100)},Iu={test:ow("hsl","hue"),parse:j3("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+bi.transform(Ld(e))+", "+bi.transform(Ld(n))+", "+Ld(ef.transform(r))+")"},wn={test:t=>hl.test(t)||u_.test(t)||Iu.test(t),parse:t=>hl.test(t)?hl.parse(t):Iu.test(t)?Iu.parse(t):u_.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?hl.transform(t):Iu.transform(t),getAnimatableNone:t=>{const e=wn.parse(t);return e.alpha=0,wn.transform(e)}},kF=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function PF(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(iw))==null?void 0:e.length)||0)+(((n=t.match(kF))==null?void 0:n.length)||0)>0}const V3="number",$3="color",TF="var",IF="var(",QC="${}",AF=/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 hc(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const u=e.replace(AF,c=>(wn.test(c)?(r.color.push(i),s.push($3),n.push(wn.parse(c))):c.startsWith(IF)?(r.var.push(i),s.push(TF),n.push(c)):(r.number.push(i),s.push(V3),n.push(parseFloat(c))),++i,QC)).split(QC);return{values:n,split:u,indexes:r,types:s}}function RF(t){return hc(t).values}function H3({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===V3?s+=Ld(r[i]):a===$3?s+=wn.transform(r[i]):s+=r[i]}return s}}function MF(t){return H3(hc(t))}const OF=t=>typeof t=="number"?0:wn.test(t)?wn.getAnimatableNone(t):t,LF=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:OF(t);function DF(t){const e=hc(t);return H3(e)(e.values.map((r,s)=>LF(r,e.split[s])))}const qs={test:PF,parse:RF,createTransformer:MF,getAnimatableNone:DF};function h1(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 NF({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=h1(c,u,t+1/3),i=h1(c,u,t),a=h1(c,u,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function jm(t,e){return n=>n>0?e:t}const Rt=(t,e,n)=>t+(e-t)*n,p1=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},FF=[u_,hl,Iu],jF=t=>FF.find(e=>e.test(t));function JC(t){const e=jF(t);if(!e)return!1;let n=e.parse(t);return e===Iu&&(n=NF(n)),n}const ek=(t,e)=>{const n=JC(t),r=JC(e);if(!n||!r)return jm(t,e);const s={...n};return i=>(s.red=p1(n.red,r.red,i),s.green=p1(n.green,r.green,i),s.blue=p1(n.blue,r.blue,i),s.alpha=Rt(n.alpha,r.alpha,i),hl.transform(s))},c_=new Set(["none","hidden"]);function VF(t,e){return c_.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function $F(t,e){return n=>Rt(t,e,n)}function aw(t){return typeof t=="number"?$F:typeof t=="string"?sw(t)?jm:wn.test(t)?ek:BF:Array.isArray(t)?z3:typeof t=="object"?wn.test(t)?ek:HF:jm}function z3(t,e){const n=[...t],r=n.length,s=t.map((i,a)=>aw(i)(i,e[a]));return i=>{for(let a=0;a<r;a++)n[a]=s[a](i);return n}}function HF(t,e){const n={...t,...e},r={};for(const s in n)t[s]!==void 0&&e[s]!==void 0&&(r[s]=aw(t[s])(t[s],e[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function zF(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 BF=(t,e)=>{const n=qs.createTransformer(e),r=hc(t),s=hc(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?c_.has(t)&&!s.values.length||c_.has(e)&&!r.values.length?VF(t,e):Rf(z3(zF(r,s),s.values),n):jm(t,e)};function B3(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Rt(t,e,n):aw(t)(t,e)}const UF=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Mt.update(e,n),stop:()=>ga(e),now:()=>Bn.isProcessing?Bn.timestamp:pr.now()}},U3=(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)})`},Vm=2e4;function lw(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Vm;)e+=n,r=t.next(e);return e>=Vm?1/0:e}function WF(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(lw(r),Vm);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Es(s)}}const rn={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 d_(t,e){return t*Math.sqrt(1-e*e)}const GF=12;function KF(t,e,n){let r=n;for(let s=1;s<GF;s++)r=r-t(r)/e(r);return r}const m1=.001;function qF({duration:t=rn.duration,bounce:e=rn.bounce,velocity:n=rn.velocity,mass:r=rn.mass}){let s,i,a=1-e;a=Si(rn.minDamping,rn.maxDamping,a),t=Si(rn.minDuration,rn.maxDuration,Es(t)),a<1?(s=d=>{const h=d*a,p=h*t,m=h-n,y=d_(d,a),w=Math.exp(-p);return m1-m/y*w},i=d=>{const p=d*a*t,m=p*n+n,y=Math.pow(a,2)*Math.pow(d,2)*t,w=Math.exp(-p),_=d_(Math.pow(d,2),a);return(-s(d)+m1>0?-1:1)*((m-y)*w)/_}):(s=d=>{const h=Math.exp(-d*t),p=(d-n)*t+1;return-m1+h*p},i=d=>{const h=Math.exp(-d*t),p=(n-d)*(t*t);return h*p});const u=5/t,c=KF(s,i,u);if(t=ss(t),isNaN(c))return{stiffness:rn.stiffness,damping:rn.damping,duration:t};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:a*2*Math.sqrt(r*d),duration:t}}}const ZF=["duration","bounce"],YF=["stiffness","damping","mass"];function tk(t,e){return e.some(n=>t[n]!==void 0)}function XF(t){let e={velocity:rn.velocity,stiffness:rn.stiffness,damping:rn.damping,mass:rn.mass,isResolvedFromDuration:!1,...t};if(!tk(t,YF)&&tk(t,ZF))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Si(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:rn.mass,stiffness:s,damping:i}}else{const n=qF({...t,velocity:0});e={...e,...n,mass:rn.mass},e.isResolvedFromDuration=!0}return e}function $m(t=rn.visualDuration,e=rn.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:d,mass:h,duration:p,velocity:m,isResolvedFromDuration:y}=XF({...n,velocity:-Es(n.velocity||0)}),w=m||0,_=d/(2*Math.sqrt(c*h)),x=a-i,b=Es(Math.sqrt(c/h)),P=Math.abs(x)<5;r||(r=P?rn.restSpeed.granular:rn.restSpeed.default),s||(s=P?rn.restDelta.granular:rn.restDelta.default);let T,k,I,R,L,A;if(_<1)I=d_(b,_),R=(w+_*b*x)/I,T=D=>{const N=Math.exp(-_*b*D);return a-N*(R*Math.sin(I*D)+x*Math.cos(I*D))},L=_*b*R+x*I,A=_*b*x-R*I,k=D=>Math.exp(-_*b*D)*(L*Math.sin(I*D)+A*Math.cos(I*D));else if(_===1){T=N=>a-Math.exp(-b*N)*(x+(w+b*x)*N);const D=w+b*x;k=N=>Math.exp(-b*N)*(b*D*N-w)}else{const D=b*Math.sqrt(_*_-1);T=Z=>{const W=Math.exp(-_*b*Z),G=Math.min(D*Z,300);return a-W*((w+_*b*x)*Math.sinh(G)+D*x*Math.cosh(G))/D};const N=(w+_*b*x)/D,F=_*b*N-x*D,K=_*b*x-N*D;k=Z=>{const W=Math.exp(-_*b*Z),G=Math.min(D*Z,300);return W*(F*Math.sinh(G)+K*Math.cosh(G))}}const O={calculatedDuration:y&&p||null,velocity:D=>ss(k(D)),next:D=>{if(!y&&_<1){const F=Math.exp(-_*b*D),K=Math.sin(I*D),Z=Math.cos(I*D),W=a-F*(R*K+x*Z),G=ss(F*(L*K+A*Z));return u.done=Math.abs(G)<=r&&Math.abs(a-W)<=s,u.value=u.done?a:W,u}const N=T(D);if(y)u.done=D>=p;else{const F=ss(k(D));u.done=Math.abs(F)<=r&&Math.abs(a-N)<=s}return u.value=u.done?a:N,u},toString:()=>{const D=Math.min(lw(O),Vm),N=U3(F=>O.next(D*F).value,D,30);return D+"ms "+N},toTransition:()=>{}};return O}$m.applyToOptions=t=>{const e=WF(t,100,$m);return t.ease=e.ease,t.duration=ss(e.duration),t.type="keyframes",t};const QF=5;function W3(t,e,n){const r=Math.max(e-QF,0);return E3(n-t(r),e-r)}function f_({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:u,max:c,restDelta:d=.5,restSpeed:h}){const p=t[0],m={done:!1,value:p},y=A=>u!==void 0&&A<u||c!==void 0&&A>c,w=A=>u===void 0?c:c===void 0||Math.abs(u-A)<Math.abs(c-A)?u:c;let _=n*e;const x=p+_,b=a===void 0?x:a(x);b!==x&&(_=b-p);const P=A=>-_*Math.exp(-A/r),T=A=>b+P(A),k=A=>{const O=P(A),D=T(A);m.done=Math.abs(O)<=d,m.value=m.done?b:D};let I,R;const L=A=>{y(m.value)&&(I=A,R=$m({keyframes:[m.value,w(m.value)],velocity:W3(T,A,m.value),damping:s,stiffness:i,restDelta:d,restSpeed:h}))};return L(0),{calculatedDuration:null,next:A=>{let O=!1;return!R&&I===void 0&&(O=!0,k(A),L(A)),I!==void 0&&A>=I?R.next(A-I):(!O&&k(A),m)}}}function JF(t,e,n){const r=[],s=n||ma.mix||B3,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]||Ts:e;u=Rf(c,u)}r.push(u)}return r}function ej(t,e,{clamp:n=!0,ease:r,mixer:s}={}){const i=t.length;if(y0(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=JF(e,r,s),c=u.length,d=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 m=Jd(t[p],t[p+1],h);return u[p](m)};return n?h=>d(Si(t[0],t[i-1],h)):d}function tj(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Jd(0,e,r);t.push(Rt(n,1,s))}}function nj(t){const e=[0];return tj(e,t.length-1),e}function rj(t,e){return t.map(n=>n*e)}function sj(t,e){return t.map(()=>e||O3).splice(0,t.length-1)}function Dd({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=fF(r)?r.map(ZC):ZC(r),i={done:!1,value:e[0]},a=rj(n&&n.length===e.length?n:nj(e),t),u=ej(a,e,{ease:Array.isArray(s)?s:sj(e,s)});return{calculatedDuration:t,next:c=>(i.value=u(c),i.done=c>=t,i)}}const ij=t=>t!==null;function _0(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(ij),u=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!u||r===void 0?i[u]:r}const oj={decay:f_,inertia:f_,tween:Dd,keyframes:Dd,spring:$m};function G3(t){typeof t.type=="string"&&(t.type=oj[t.type])}class uw{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 aj=t=>t/100;class Hm extends uw{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!==pr.now()&&this.tick(pr.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;G3(e);const{type:n=Dd,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=e;let{keyframes:u}=e;const c=n||Dd;c!==Dd&&typeof u[0]!="number"&&(this.mixKeyframes=Rf(aj,B3(u[0],u[1])),u=[0,100]);const d=c({...e,keyframes:u});i==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...u].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=lw(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:u,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:h,repeat:p,repeatType:m,repeatDelay:y,type:w,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-d*(this.playbackSpeed>=0?1:-1),P=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,k=r;if(p){const A=Math.min(this.currentTime,s)/u;let O=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&O--,O=Math.min(O,p+1),!!(O%2)&&(m==="reverse"?(D=1-D,y&&(D-=y/u)):m==="mirror"&&(k=a)),T=Si(0,1,D)*u}let I;P?(this.delayState.value=h[0],I=this.delayState):I=k.next(T),i&&!P&&(I.value=i(I.value));let{done:R}=I;!P&&c!==null&&(R=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return L&&w!==f_&&(I.value=_0(h,this.options,x,this.speed)),_&&_(I.value),L&&this.finish(),I}then(e,n){return this.finished.then(e,n)}get duration(){return Es(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Es(e)}get time(){return Es(this.currentTime)}set time(e){e=ss(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 W3(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(pr.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=Es(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=UF,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(pr.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 lj(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const pl=t=>t*180/Math.PI,h_=t=>{const e=pl(Math.atan2(t[1],t[0]));return p_(e)},uj={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:h_,rotateZ:h_,skewX:t=>pl(Math.atan(t[1])),skewY:t=>pl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},p_=t=>(t=t%360,t<0&&(t+=360),t),nk=h_,rk=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),sk=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),cj={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:rk,scaleY:sk,scale:t=>(rk(t)+sk(t))/2,rotateX:t=>p_(pl(Math.atan2(t[6],t[5]))),rotateY:t=>p_(pl(Math.atan2(-t[2],t[0]))),rotateZ:nk,rotate:nk,skewX:t=>pl(Math.atan(t[4])),skewY:t=>pl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function m_(t){return t.includes("scale")?1:0}function g_(t,e){if(!t||t==="none")return m_(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=cj,s=n;else{const u=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=uj,s=u}if(!s)return m_(e);const i=r[e],a=s[1].split(",").map(fj);return typeof i=="function"?i(a):a[i]}const dj=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return g_(n,e)};function fj(t){return parseFloat(t.trim())}const xc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bc=new Set([...xc,"pathRotation"]),ik=t=>t===wc||t===Le,hj=new Set(["x","y","z"]),pj=xc.filter(t=>!hj.has(t));function mj(t){const e=[];return pj.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const sa={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})=>g_(e,"x"),y:(t,{transform:e})=>g_(e,"y")};sa.translateX=sa.x;sa.translateY=sa.y;const Pl=new Set;let v_=!1,y_=!1,__=!1;function K3(){if(y_){const t=Array.from(Pl).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=mj(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)})}y_=!1,v_=!1,Pl.forEach(t=>t.complete(__)),Pl.clear()}function q3(){Pl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(y_=!0)})}function gj(){__=!0,q3(),K3(),__=!1}class cw{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?(Pl.add(this),v_||(v_=!0,Mt.read(q3),Mt.resolveKeyframes(K3))):(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])}lj(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Pl.delete(this)}cancel(){this.state==="scheduled"&&(Pl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const vj=t=>t.startsWith("--");function Z3(t,e,n){vj(e)?t.style.setProperty(e,n):t.style[e]=n}const yj={};function Y3(t,e){const n=S3(t);return()=>yj[e]??n()}const _j=Y3(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),X3=Y3(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),kd=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,ok={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kd([0,.65,.55,1]),circOut:kd([.55,0,1,.45]),backIn:kd([.31,.01,.66,-.59]),backOut:kd([.33,1.53,.69,.99])};function Q3(t,e){if(t)return typeof t=="function"?X3()?U3(t,e):"ease-out":L3(t)?kd(t):Array.isArray(t)?t.map(n=>Q3(n,e)||ok.easeOut):ok[t]}function wj(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:u="easeOut",times:c}={},d=void 0){const h={[e]:n};c&&(h.offset=c);const p=Q3(u,s);Array.isArray(p)&&(h.easing=p);const m={delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return d&&(m.pseudoElement=d),t.animate(h,m)}function J3(t){return typeof t=="function"&&"applyToOptions"in t}function xj({type:t,...e}){return J3(t)&&X3()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class eT extends uw{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,y0(typeof e.type!="string");const d=xj(e);this.animation=wj(n,r,s,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=_0(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(h),Z3(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 Es(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Es(e)}get time(){return Es(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ss(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&&_j()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ts):s(this)}}const tT={anticipate:A3,backInOut:I3,circInOut:M3};function bj(t){return t in tT}function Sj(t){typeof t.ease=="string"&&bj(t.ease)&&(t.ease=tT[t.ease])}const g1=10;class Ej extends eT{constructor(e){Sj(e),G3(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(g1,pr.now()-this.startTime),d=Si(0,g1,c-g1),h=u.sample(c).value,{name:p}=this.options;i&&p&&Z3(i,p,h),n.setWithVelocity(u.sample(Math.max(0,c-d)).value,h,d),u.stop()}}const ak=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(qs.test(t)||t==="0")&&!t.startsWith("url("));function Cj(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 kj(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=ak(s,e),u=ak(i,e);return!a||!u?!1:Cj(t)||(n==="spring"||J3(n))&&r}function w_(t){t.duration=0,t.type="keyframes"}const nT=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Pj=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Tj(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&Pj.test(t[e]))return!0;return!1}const Ij=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Aj=S3(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Rj(t){var p;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:u}=t,c=(p=e==null?void 0:e.owner)==null?void 0:p.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;const{onUpdate:d,transformTemplate:h}=e.owner.getProps();return Aj()&&n&&(nT.has(n)||Ij.has(n)&&Tj(u))&&(n!=="transform"||!h)&&!d&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const Mj=40;class Oj extends uw{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:u,name:c,motionValue:d,element:h,...p}){var w;super(),this.stop=()=>{var _,x;this._animation&&(this._animation.stop(),(_=this.stopTimeline)==null||_.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=pr.now();const m={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:c,motionValue:d,element:h,...p},y=(h==null?void 0:h.KeyframeResolver)||cw;this.keyframeResolver=new y(u,(_,x,b)=>this.onKeyframesResolved(_,x,m,!b),c,d,h),(w=this.keyframeResolver)==null||w.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,P;this.keyframeResolver=void 0;const{name:i,type:a,velocity:u,delay:c,isHandoff:d,onUpdate:h}=r;this.resolvedAt=pr.now();let p=!0;kj(e,i,a,u)||(p=!1,(ma.instantAnimations||!c)&&(h==null||h(_0(e,r,n))),e[0]=e[e.length-1],w_(r),r.repeat=0);const y={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Mj?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},w=p&&!d&&Rj(y),_=(P=(b=y.motionValue)==null?void 0:b.owner)==null?void 0:P.current;let x;if(w)try{x=new Ej({...y,element:_})}catch{x=new Hm(y)}else x=new Hm(y);x.finished.then(()=>{this.notifyFinished()}).catch(Ts),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),gj()),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 rT(t,e,n,r=0,s=1){const i=Array.from(t).sort((d,h)=>d.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 lk=30,Lj=t=>!isNaN(parseFloat(t));class Dj{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=pr.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=pr.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Lj(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 tw);const r=this.events[e].add(n);return e==="change"?()=>{r(),Mt.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=pr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>lk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,lk);return E3(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 pc(t,e){return new Dj(t,e)}function sT(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function dw(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?sT(n,t):n}const Nj={type:"spring",stiffness:500,damping:25,restSpeed:10},Fj=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),jj={type:"keyframes",duration:.8},Vj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$j=(t,{keyframes:e})=>e.length>2?jj:bc.has(t)?t.startsWith("scale")?Fj(e[1]):Nj:Vj,Hj=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function zj(t){for(const e in t)if(!Hj.has(e))return!0;return!1}const fw=(t,e,n,r={},s,i)=>a=>{const u=dw(r,t)||{},c=u.delay||r.delay||0;let{elapsed:d=0}=r;d=d-ss(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-d,onUpdate:m=>{e.set(m),u.onUpdate&&u.onUpdate(m)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:e,element:i?void 0:s};zj(u)||Object.assign(h,$j(t,h)),h.duration&&(h.duration=ss(h.duration)),h.repeatDelay&&(h.repeatDelay=ss(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let p=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(w_(h),h.delay===0&&(p=!0)),(ma.instantAnimations||ma.skipAnimations||s!=null&&s.shouldSkipAnimations||u.skipAnimations)&&(p=!0,w_(h),h.delay=0),h.allowFlatten=!u.type&&!u.ease,p&&!i&&e.get()!==void 0){const m=_0(h.keyframes,u);if(m!==void 0){Mt.update(()=>{h.onUpdate(m),h.onComplete()});return}}return u.isSync?new Hm(h):new Oj(h)},Bj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Uj(t){const e=Bj.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function iT(t,e,n=1){const[r,s]=Uj(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const a=i.trim();return w3(a)?parseFloat(a):a}return sw(s)?iT(s,e,n+1):s}function uk(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function hw(t,e,n,r){if(typeof e=="function"){const[s,i]=uk(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]=uk(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function Tl(t,e,n){const r=t.getProps();return hw(r,e,n!==void 0?n:r.custom,t)}const oT=new Set(["width","height","top","left","right","bottom",...xc]),x_=t=>Array.isArray(t);function Wj(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,pc(n))}function Gj(t){return x_(t)?t[t.length-1]||0:t}function Kj(t,e){const n=Tl(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const u=Gj(i[a]);Wj(t,a,u)}}const Gn=t=>!!(t&&t.getVelocity);function qj(t){return!!(Gn(t)&&t.add)}function b_(t,e){const n=t.getValue("willChange");if(qj(n))return n.add(e);if(!n&&ma.WillChange){const r=new ma.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function pw(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Zj="framerAppearId",aT="data-"+pw(Zj);function lT(t){return t.props[aT]}function Yj({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function uT(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...u}=e;const c=t.getDefaultTransition();i=i?sT(i,c):c;const d=i==null?void 0:i.reduceMotion,h=i==null?void 0:i.skipAnimations;r&&(i=r);const p=[],m=s&&t.animationState&&t.animationState.getState()[s],y=i==null?void 0:i.path;y&&y.animateVisualElement(t,u,i,n,p);for(const w in u){const _=t.getValue(w,t.latestValues[w]??null),x=u[w];if(x===void 0||m&&Yj(m,w))continue;const b={delay:n,...dw(i||{},w)};h&&(b.skipAnimations=!0);const P=_.get();if(P!==void 0&&!_.isAnimating()&&!Array.isArray(x)&&x===P&&!b.velocity){Mt.update(()=>_.set(x));continue}let T=!1;if(window.MotionHandoffAnimation){const R=lT(t);if(R){const L=window.MotionHandoffAnimation(R,w,Mt);L!==null&&(b.startTime=L,T=!0)}}b_(t,w);const k=d??t.shouldReduceMotion;_.start(fw(w,_,x,k&&oT.has(w)?{type:!1}:b,t,T));const I=_.animation;I&&p.push(I)}if(a){const w=()=>Mt.update(()=>{a&&Kj(t,a)});p.length?Promise.all(p).then(w):w()}return p}function S_(t,e,n={}){var c;const r=Tl(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(uT(t,r,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:p,staggerDirection:m}=s;return Xj(t,e,d,h,p,m,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[d,h]=u==="beforeChildren"?[i,a]:[a,i];return d().then(()=>h())}else return Promise.all([i(),a(n.delay)])}function Xj(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(S_(c,e,{...a,delay:n+(typeof r=="function"?0:r)+rT(t.variantChildren,c,r,s,i)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(u)}function Qj(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>S_(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=S_(t,e,n);else{const s=typeof e=="function"?Tl(t,e,n.custom):e;r=Promise.all(uT(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const Jj={test:t=>t==="auto",parse:t=>t},cT=t=>e=>e.test(t),dT=[wc,Le,bi,qi,CF,EF,Jj],ck=t=>dT.find(cT(t));function e7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||b3(t):!0}const t7=new Set(["brightness","contrast","saturate","opacity"]);function n7(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(iw)||[];if(!r)return t;const s=n.replace(r,"");let i=t7.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const r7=/\b([a-z-]*)\(.*?\)/gu,E_={...qs,getAnimatableNone:t=>{const e=t.match(r7);return e?e.map(n7).join(" "):t}},C_={...qs,getAnimatableNone:t=>{const e=qs.parse(t);return qs.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},dk={...wc,transform:Math.round},s7={rotate:qi,pathRotation:qi,rotateX:qi,rotateY:qi,rotateZ:qi,scale:pp,scaleX:pp,scaleY:pp,scaleZ:pp,skew:qi,skewX:qi,skewY:qi,distance:Le,translateX:Le,translateY:Le,translateZ:Le,x:Le,y:Le,z:Le,perspective:Le,transformPerspective:Le,opacity:ef,originX:XC,originY:XC,originZ:Le},zm={borderWidth:Le,borderTopWidth:Le,borderRightWidth:Le,borderBottomWidth:Le,borderLeftWidth:Le,borderRadius:Le,borderTopLeftRadius:Le,borderTopRightRadius:Le,borderBottomRightRadius:Le,borderBottomLeftRadius:Le,width:Le,maxWidth:Le,height:Le,maxHeight:Le,top:Le,right:Le,bottom:Le,left:Le,inset:Le,insetBlock:Le,insetBlockStart:Le,insetBlockEnd:Le,insetInline:Le,insetInlineStart:Le,insetInlineEnd:Le,padding:Le,paddingTop:Le,paddingRight:Le,paddingBottom:Le,paddingLeft:Le,paddingBlock:Le,paddingBlockStart:Le,paddingBlockEnd:Le,paddingInline:Le,paddingInlineStart:Le,paddingInlineEnd:Le,margin:Le,marginTop:Le,marginRight:Le,marginBottom:Le,marginLeft:Le,marginBlock:Le,marginBlockStart:Le,marginBlockEnd:Le,marginInline:Le,marginInlineStart:Le,marginInlineEnd:Le,fontSize:Le,backgroundPositionX:Le,backgroundPositionY:Le,...s7,zIndex:dk,fillOpacity:ef,strokeOpacity:ef,numOctaves:dk},i7={...zm,color:wn,backgroundColor:wn,outlineColor:wn,fill:wn,stroke:wn,borderColor:wn,borderTopColor:wn,borderRightColor:wn,borderBottomColor:wn,borderLeftColor:wn,filter:E_,WebkitFilter:E_,mask:C_,WebkitMask:C_},fT=t=>i7[t],o7=new Set([E_,C_]);function hT(t,e){let n=fT(t);return o7.has(n)||(n=qs),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const a7=new Set(["auto","none","0"]);function l7(t,e,n){let r=0,s;for(;r<t.length&&!s;){const i=t[r];typeof i=="string"&&!a7.has(i)&&hc(i).values.length&&(s=t[r]),r++}if(s&&n)for(const i of e)t[i]=hT(n,s)}class u7 extends cw{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(),sw(p))){const m=iT(p,n.current);m!==void 0&&(e[h]=m),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!oT.has(r)||e.length!==2)return;const[s,i]=e,a=ck(s),u=ck(i),c=YC(s),d=YC(i);if(c!==d&&sa[r]){this.needsMeasurement=!0;return}if(a!==u)if(ik(a)&&ik(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else sa[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||e7(e[s]))&&r.push(s);r.length&&l7(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=sa[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]=sa[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,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const mw=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function pT(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 k_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function zp(t){return x3(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:gw}=D3(queueMicrotask,!1),Bs={x:!1,y:!1};function mT(){return Bs.x||Bs.y}function c7(t){return t==="x"||t==="y"?Bs[t]?null:(Bs[t]=!0,()=>{Bs[t]=!1}):Bs.x||Bs.y?null:(Bs.x=Bs.y=!0,()=>{Bs.x=Bs.y=!1})}function gT(t,e){const n=pT(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function d7(t){return!(t.pointerType==="touch"||mT())}function f7(t,e,n={}){const[r,s,i]=gT(t,n);return r.forEach(a=>{let u=!1,c=!1,d;const h=()=>{a.removeEventListener("pointerleave",w)},p=x=>{d&&(d(x),d=void 0),h()},m=x=>{u=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,p(x))},y=()=>{u=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},w=x=>{if(x.pointerType!=="touch"){if(u){c=!0;return}p(x)}},_=x=>{if(!d7(x))return;c=!1;const b=e(a,x);typeof b=="function"&&(d=b,a.addEventListener("pointerleave",w,s))};a.addEventListener("pointerenter",_,s),a.addEventListener("pointerdown",y,s)}),i}const vT=(t,e)=>e?t===e?!0:vT(t,e.parentElement):!1,vw=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,h7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function p7(t){return h7.has(t.tagName)||t.isContentEditable===!0}const m7=new Set(["INPUT","SELECT","TEXTAREA"]);function g7(t){return m7.has(t.tagName)||t.isContentEditable===!0}const Bp=new WeakSet;function fk(t){return e=>{e.key==="Enter"&&t(e)}}function v1(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const v7=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=fk(()=>{if(Bp.has(n))return;v1(n,"down");const s=fk(()=>{v1(n,"up")}),i=()=>v1(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 hk(t){return vw(t)&&!mT()}const pk=new WeakSet;function y7(t,e,n={}){const[r,s,i]=gT(t,n),a=u=>{const c=u.currentTarget;if(!hk(u)||pk.has(u))return;Bp.add(c),n.stopPropagation&&pk.add(u);const d=e(c,u),h={...s,capture:!0},p=(w,_)=>{window.removeEventListener("pointerup",m,h),window.removeEventListener("pointercancel",y,h),Bp.has(c)&&Bp.delete(c),hk(w)&&typeof d=="function"&&d(w,{success:_})},m=w=>{p(w,c===window||c===document||n.useGlobalTarget||vT(c,w.target))},y=w=>{p(w,!1)};window.addEventListener("pointerup",m,h),window.addEventListener("pointercancel",y,h)};return r.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",a,s),zp(u)&&(u.addEventListener("focus",d=>v7(d,s)),!p7(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),i}function yw(t){return x3(t)&&"ownerSVGElement"in t}const Up=new WeakMap;let Zo;const yT=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:yw(r)&&"getBBox"in r?r.getBBox()[e]:r[n],_7=yT("inline","width","offsetWidth"),w7=yT("block","height","offsetHeight");function x7({target:t,borderBoxSize:e}){var n;(n=Up.get(t))==null||n.forEach(r=>{r(t,{get width(){return _7(t,e)},get height(){return w7(t,e)}})})}function b7(t){t.forEach(x7)}function S7(){typeof ResizeObserver>"u"||(Zo=new ResizeObserver(b7))}function E7(t,e){Zo||S7();const n=pT(t);return n.forEach(r=>{let s=Up.get(r);s||(s=new Set,Up.set(r,s)),s.add(e),Zo==null||Zo.observe(r)}),()=>{n.forEach(r=>{const s=Up.get(r);s==null||s.delete(e),s!=null&&s.size||Zo==null||Zo.unobserve(r)})}}const Wp=new Set;let Au;function C7(){Au=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Wp.forEach(e=>e(t))},window.addEventListener("resize",Au)}function k7(t){return Wp.add(t),Au||C7(),()=>{Wp.delete(t),!Wp.size&&typeof Au=="function"&&(window.removeEventListener("resize",Au),Au=void 0)}}function mk(t,e){return typeof t=="function"?k7(t):E7(t,e)}function P7(t){return yw(t)&&t.tagName==="svg"}const T7=[...dT,wn,qs],I7=t=>T7.find(cT(t)),gk=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ru=()=>({x:gk(),y:gk()}),vk=()=>({min:0,max:0}),Pn=()=>({x:vk(),y:vk()}),A7=new WeakMap;function w0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function tf(t){return typeof t=="string"||Array.isArray(t)}const _w=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ww=["initial",..._w];function x0(t){return w0(t.animate)||ww.some(e=>tf(t[e]))}function _T(t){return!!(x0(t)||t.variants)}function R7(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Gn(s))t.addValue(r,s);else if(Gn(i))t.addValue(r,pc(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,pc(a!==void 0?a:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const Bm={current:null},xw={current:!1},M7=typeof window<"u";function wT(){if(xw.current=!0,!!M7)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Bm.current=t.matches;t.addEventListener("change",e),e()}else Bm.current=!1}const yk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Um={};function xT(t){Um=t}function O7(){return Um}class L7{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=cw,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=pr.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,Mt.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},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=x0(n),this.isVariantNode=_T(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in m){const w=m[y];d[y]!==void 0&&Gn(w)&&w.set(d[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,A7.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:(xw.current||wT(),this.shouldReduceMotion=Bm.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(),ga(this.notifyUpdate),ga(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&&nT.has(e)&&this.current instanceof HTMLElement){const{factory:a,keyframes:u,times:c,ease:d,duration:h}=n.accelerate,p=new eT({element:this.current,name:e,keyframes:u,times:c,ease:d,duration:ss(h)}),m=a(p);this.valueSubscriptions.set(e,()=>{m(),p.cancel()});return}const r=bc.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&Mt.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 Um){const n=Um[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):Pn()}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<yk.length;r++){const s=yk[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=R7(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=pc(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"&&(w3(r)||b3(r))?r=parseFloat(r):!I7(r)&&qs.test(n)&&(r=hT(e,n)),this.setBaseTarget(e,Gn(r)?r.get():r)),Gn(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=hw(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&&!Gn(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 tw),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){gw.render(this.render)}}class bT extends L7{constructor(){super(...arguments),this.KeyframeResolver=u7}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;Gn(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Sa{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ST({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function D7({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function N7(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 y1(t){return t===void 0||t===1}function P_({scale:t,scaleX:e,scaleY:n}){return!y1(t)||!y1(e)||!y1(n)}function al(t){return P_(t)||ET(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ET(t){return _k(t.x)||_k(t.y)}function _k(t){return t&&t!=="0%"}function Wm(t,e,n){const r=t-n,s=e*r;return n+s}function wk(t,e,n,r,s){return s!==void 0&&(t=Wm(t,s,r)),Wm(t,n,r)+e}function T_(t,e=0,n=1,r,s){t.min=wk(t.min,e,n,r,s),t.max=wk(t.max,e,n,r,s)}function CT(t,{x:e,y:n}){T_(t.x,e.translate,e.scale,e.originPoint),T_(t.y,n.translate,n.scale,n.originPoint)}const xk=.999999999999,bk=1.0000000000001;function F7(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:d}=i.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(gi(t.x,-i.scroll.offset.x),gi(t.y,-i.scroll.offset.y)),a&&(e.x*=a.x.scale,e.y*=a.y.scale,CT(t,a)),r&&al(i.latestValues)&&Gp(t,i.latestValues,(u=i.layout)==null?void 0:u.layoutBox))}e.x<bk&&e.x>xk&&(e.x=1),e.y<bk&&e.y>xk&&(e.y=1)}function gi(t,e){t.min+=e,t.max+=e}function Sk(t,e,n,r,s=.5){const i=Rt(t.min,t.max,s);T_(t,e,n,i,r)}function Ek(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Gp(t,e,n){const r=n??t;Sk(t.x,Ek(e.x,r.x),e.scaleX,e.scale,e.originX),Sk(t.y,Ek(e.y,r.y),e.scaleY,e.scale,e.originY)}function kT(t,e){return ST(N7(t.getBoundingClientRect(),e))}function j7(t,e,n){const r=kT(t,n),{scroll:s}=e;return s&&(gi(r.x,s.offset.x),gi(r.y,s.offset.y)),r}const V7={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$7=xc.length;function H7(t,e,n){let r="",s=!0;for(let a=0;a<$7;a++){const u=xc[a],c=t[u];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(u.startsWith("scale")?1:0);else{const h=parseFloat(c);d=u.startsWith("scale")?h===1:h===0}if(!d||n){const h=k_(c,zm[u]);if(!d){s=!1;const p=V7[u]||u;r+=`${p}(${h}) `}n&&(e[u]=h)}}const i=t.pathRotation;return i&&(s=!1,r+=`rotate(${k_(i,zm.pathRotation)}) `),r=r.trim(),n?r=n(e,s?"":r):s&&(r="none"),r}function bw(t,e,n){const{style:r,vars:s,transformOrigin:i}=t;let a=!1,u=!1;for(const c in e){const d=e[c];if(bc.has(c)){a=!0;continue}else if(F3(c)){s[c]=d;continue}else{const h=k_(d,zm[c]);c.startsWith("origin")?(u=!0,i[c]=h):r[c]=h}}if(e.transform||(a||n?r.transform=H7(e,t.transform,n):r.transform&&(r.transform="none")),u){const{originX:c="50%",originY:d="50%",originZ:h=0}=i;r.transformOrigin=`${c} ${d} ${h}`}}function PT(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 Ck(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const vd={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Le.test(t))t=parseFloat(t);else return t;const n=Ck(t,e.target.x),r=Ck(t,e.target.y);return`${n}% ${r}%`}},z7={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=qs.parse(t);if(s.length>5)return r;const i=qs.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 d=Rt(u,c,.5);return typeof s[2+a]=="number"&&(s[2+a]/=d),typeof s[3+a]=="number"&&(s[3+a]/=d),i(s)}},I_={borderRadius:{...vd,applyTo:[...mw]},borderTopLeftRadius:vd,borderTopRightRadius:vd,borderBottomLeftRadius:vd,borderBottomRightRadius:vd,boxShadow:z7};function TT(t,{layout:e,layoutId:n}){return bc.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!I_[t]||t==="opacity")}function Sw(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)(Gn(r[u])||s&&Gn(s[u])||TT(u,t)||((a=n==null?void 0:n.getValue(u))==null?void 0:a.liveStyle)!==void 0)&&(i[u]=r[u]);return i}function B7(t){return window.getComputedStyle(t)}class U7 extends bT{constructor(){super(...arguments),this.type="html",this.renderInstance=PT}mount(e){y0(!!e.style),super.mount(e)}readValueFromInstance(e,n){var r;if(bc.has(n))return(r=this.projection)!=null&&r.isProjecting?m_(n):dj(e,n);{const s=B7(e),i=(F3(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return kT(e,n)}build(e,n,r){bw(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Sw(e,n,r)}}const W7={offset:"stroke-dashoffset",array:"stroke-dasharray"},G7={offset:"strokeDashoffset",array:"strokeDasharray"};function K7(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?W7:G7;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const q7=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function IT(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...u},c,d,h){if(bw(t,u,d),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m}=t;p.transform&&(m.transform=p.transform,delete p.transform),(m.transform||p.transformOrigin)&&(m.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),m.transform&&(m.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete p.transformBox);for(const y of q7)p[y]!==void 0&&(m[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&&K7(p,s,i,a,!1)}const AT=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"]),RT=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Z7(t,e,n,r){PT(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(AT.has(s)?s:pw(s),e.attrs[s])}function MT(t,e,n){const r=Sw(t,e,n);for(const s in t)if(Gn(t[s])||Gn(e[s])){const i=xc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class Y7 extends bT{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pn}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(bc.has(n)){const r=fT(n);return r&&r.default||0}return n=AT.has(n)?n:pw(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return MT(e,n,r)}build(e,n,r){IT(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){Z7(e,n,r,s)}mount(e){this.isSVGTag=RT(e.tagName),super.mount(e)}}const X7=ww.length;function OT(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?OT(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<X7;n++){const r=ww[n],s=t.props[r];(tf(s)||s===!1)&&(e[r]=s)}return e}function LT(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 Q7=[..._w].reverse(),J7=_w.length;function eV(t){return e=>Promise.all(e.map(({animation:n,options:r})=>Qj(t,n,r)))}function tV(t){let e=eV(t),n=kk(),r=!0,s=!1;const i=d=>(h,p)=>{var y;const m=Tl(t,p,d==="exit"?(y=t.presenceContext)==null?void 0:y.custom:void 0);if(m){const{transition:w,transitionEnd:_,...x}=m;h={...h,...x,..._}}return h};function a(d){e=d(t)}function u(d){const{props:h}=t,p=OT(t.parent)||{},m=[],y=new Set;let w={},_=1/0;for(let b=0;b<J7;b++){const P=Q7[b],T=n[P],k=h[P]!==void 0?h[P]:p[P],I=tf(k),R=P===d?T.isActive:null;R===!1&&(_=b);let L=k===p[P]&&k!==h[P]&&I;if(L&&(r||s)&&t.manuallyAnimateOnMount&&(L=!1),T.protectedKeys={...w},!T.isActive&&R===null||!k&&!T.prevProp||w0(k)||typeof k=="boolean")continue;if(P==="exit"&&T.isActive&&R!==!0){T.prevResolvedValues&&(w={...w,...T.prevResolvedValues});continue}const A=nV(T.prevProp,k);let O=A||P===d&&T.isActive&&!L&&I||b>_&&I,D=!1;const N=Array.isArray(k)?k:[k];let F=N.reduce(i(P),{});R===!1&&(F={});const{prevResolvedValues:K={}}=T,Z={...K,...F},W=$=>{O=!0,y.has($)&&(D=!0,y.delete($)),T.needsAnimating[$]=!0;const J=t.getValue($);J&&(J.liveStyle=!1)};for(const $ in Z){const J=F[$],H=K[$];if(w.hasOwnProperty($))continue;let j=!1;x_(J)&&x_(H)?j=!LT(J,H)||A:j=J!==H,j?J!=null?W($):y.add($):J!==void 0&&y.has($)?W($):T.protectedKeys[$]=!0}T.prevProp=k,T.prevResolvedValues=F,T.isActive&&(w={...w,...F}),(r||s)&&t.blockInitialAnimation&&(O=!1);const G=L&&A;O&&(!G||D)&&m.push(...N.map($=>{const J={type:P};if(typeof $=="string"&&(r||s)&&!G&&t.manuallyAnimateOnMount&&t.parent){const{parent:H}=t,j=Tl(H,$);if(H.enteringChildren&&j){const{delayChildren:X}=j.transition||{};J.delay=rT(H.enteringChildren,t,X)}}return{animation:$,options:J}}))}if(y.size){const b={};if(typeof h.initial!="boolean"){const P=Tl(t,Array.isArray(h.initial)?h.initial[0]:h.initial);P&&P.transition&&(b.transition=P.transition)}y.forEach(P=>{const T=t.getBaseTarget(P),k=t.getValue(P);k&&(k.liveStyle=!0),b[P]=T??null}),m.push({animation:b})}let x=!!m.length;return r&&(h.initial===!1||h.initial===h.animate)&&!t.manuallyAnimateOnMount&&(x=!1),r=!1,s=!1,x?e(m):Promise.resolve()}function c(d,h){var m;if(n[d].isActive===h)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(y=>{var w;return(w=y.animationState)==null?void 0:w.setActive(d,h)}),n[d].isActive=h;const p=u(d);for(const y in n)n[y].protectedKeys={};return p}return{animateChanges:u,setActive:c,setAnimateFunction:a,getState:()=>n,reset:()=>{n=kk(),s=!0}}}function nV(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!LT(e,t):!1}function Za(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kk(){return{animate:Za(!0),whileInView:Za(),whileHover:Za(),whileTap:Za(),whileDrag:Za(),whileFocus:Za(),exit:Za()}}function A_(t,e){t.min=e.min,t.max=e.max}function Hs(t,e){A_(t.x,e.x),A_(t.y,e.y)}function Pk(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const DT=1e-4,rV=1-DT,sV=1+DT,NT=.01,iV=0-NT,oV=0+NT;function mr(t){return t.max-t.min}function aV(t,e,n){return Math.abs(t-e)<=n}function Tk(t,e,n,r=.5){t.origin=r,t.originPoint=Rt(e.min,e.max,t.origin),t.scale=mr(n)/mr(e),t.translate=Rt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=rV&&t.scale<=sV||isNaN(t.scale))&&(t.scale=1),(t.translate>=iV&&t.translate<=oV||isNaN(t.translate))&&(t.translate=0)}function Nd(t,e,n,r){Tk(t.x,e.x,n.x,r?r.originX:void 0),Tk(t.y,e.y,n.y,r?r.originY:void 0)}function Ik(t,e,n,r=0){const s=r?Rt(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+mr(e)}function lV(t,e,n,r){Ik(t.x,e.x,n.x,r==null?void 0:r.x),Ik(t.y,e.y,n.y,r==null?void 0:r.y)}function Ak(t,e,n,r=0){const s=r?Rt(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+mr(e)}function Gm(t,e,n,r){Ak(t.x,e.x,n.x,r==null?void 0:r.x),Ak(t.y,e.y,n.y,r==null?void 0:r.y)}function Rk(t,e,n,r,s){return t-=e,t=Wm(t,1/n,r),s!==void 0&&(t=Wm(t,1/s,r)),t}function uV(t,e=0,n=1,r=.5,s,i=t,a=t){if(bi.test(e)&&(e=parseFloat(e),e=Rt(a.min,a.max,e/100)-a.min),typeof e!="number")return;let u=Rt(i.min,i.max,r);t===i&&(u-=e),t.min=Rk(t.min,e,n,u,s),t.max=Rk(t.max,e,n,u,s)}function Mk(t,e,[n,r,s],i,a){uV(t,e[n],e[r],e[s],e.scale,i,a)}const cV=["x","scaleX","originX"],dV=["y","scaleY","originY"];function Ok(t,e,n,r){Mk(t.x,e,cV,n?n.x:void 0,r?r.x:void 0),Mk(t.y,e,dV,n?n.y:void 0,r?r.y:void 0)}function Lk(t){return t.translate===0&&t.scale===1}function FT(t){return Lk(t.x)&&Lk(t.y)}function Dk(t,e){return t.min===e.min&&t.max===e.max}function fV(t,e){return Dk(t.x,e.x)&&Dk(t.y,e.y)}function Nk(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function jT(t,e){return Nk(t.x,e.x)&&Nk(t.y,e.y)}function Fk(t){return mr(t.x)/mr(t.y)}function jk(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function ci(t){return[t("x"),t("y")]}function hV(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:d,rotate:h,pathRotation:p,rotateX:m,rotateY:y,skewX:w,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),h&&(r+=`rotate(${h}deg) `),p&&(r+=`rotate(${p}deg) `),m&&(r+=`rotateX(${m}deg) `),y&&(r+=`rotateY(${y}deg) `),w&&(r+=`skewX(${w}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 pV=mw.length,Vk=t=>typeof t=="string"?parseFloat(t):t,$k=t=>typeof t=="number"||Le.test(t);function mV(t,e,n,r,s,i){s?(t.opacity=Rt(0,n.opacity??1,gV(r)),t.opacityExit=Rt(e.opacity??1,0,vV(r))):i&&(t.opacity=Rt(e.opacity??1,n.opacity??1,r));for(let a=0;a<pV;a++){const u=mw[a];let c=Hk(e,u),d=Hk(n,u);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||$k(c)===$k(d)?(t[u]=Math.max(Rt(Vk(c),Vk(d),r),0),(bi.test(d)||bi.test(c))&&(t[u]+="%")):t[u]=d}(e.rotate||n.rotate)&&(t.rotate=Rt(e.rotate||0,n.rotate||0,r))}function Hk(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const gV=VT(0,.5,R3),vV=VT(.5,.95,Ts);function VT(t,e,n){return r=>r<t?0:r>e?1:n(Jd(t,e,r))}function yV(t,e,n){const r=Gn(t)?t:pc(t);return r.start(fw("",r,e,n)),r.animation}function nf(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const _V=(t,e)=>t.depth-e.depth;class wV{constructor(){this.children=[],this.isDirty=!1}add(e){ew(this.children,e),this.isDirty=!0}remove(e){Fm(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(_V),this.isDirty=!1,this.children.forEach(e)}}function xV(t,e){const n=pr.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(ga(r),t(i-e))};return Mt.setup(r,!0),()=>ga(r)}function Kp(t){return Gn(t)?t.get():t}class bV{constructor(){this.members=[]}add(e){ew(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Fm(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Fm(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency: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 qp={hasAnimatedSinceResize:!0,hasEverUpdated:!1},_1=["","X","Y","Z"],SV=1e3;let EV=0;function w1(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function $T(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=lT(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Mt,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&$T(r)}function HT({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},u=e==null?void 0:e()){this.id=EV++,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(PV),this.nodes.forEach(OV),this.nodes.forEach(LV),this.nodes.forEach(TV)},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 wV)}addEventListener(a,u){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new tw),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=yw(a)&&!P7(a),this.instance=a;const{layoutId:u,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.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 m=()=>this.root.updateBlockedByResize=!1;Mt.read(()=>{p=window.innerWidth}),t(a,()=>{const y=window.innerWidth;y!==p&&(p=y,this.root.updateBlockedByResize=!0,h&&h(),h=xV(m,250),qp.hasAnimatedSinceResize&&(qp.hasAnimatedSinceResize=!1,this.nodes.forEach(Uk)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||VV,{onLayoutAnimationStart:_,onLayoutAnimationComplete:x}=d.getProps(),b=!this.targetLayout||!jT(this.targetLayout,y),P=!p&&m;if(this.options.layoutRoot||this.resumeFrom||P||p&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...dw(w,"layout"),onPlay:_,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,P,T.path)}else p||Uk(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(),ga(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(DV),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&&$T(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 d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(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(AV),this.nodes.forEach(zk);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Bk);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(RV),this.nodes.forEach(MV),this.nodes.forEach(CV),this.nodes.forEach(kV)):this.nodes.forEach(Bk),this.clearAllSnapshots();const u=pr.now();Bn.delta=Si(0,1e3/60,u-Bn.timestamp),Bn.timestamp=u,Bn.isProcessing=!0,d1.update.process(Bn),d1.preRender.process(Bn),d1.render.process(Bn),Bn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,gw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(IV),this.sharedNodes.forEach(NV)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Mt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Mt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!mr(this.snapshot.measuredBox.x)&&!mr(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=Pn()),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&&!FT(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;a&&this.instance&&(u||al(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const u=this.measurePageBox();let c=this.removeElementScroll(u);return a&&(c=this.removeTransform(c)),$V(c),{animationId:this.root.animationId,measuredBox:u,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:a}=this.options;if(!a)return Pn();const u=a.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(HV))){const{scroll:h}=this.root;h&&(gi(u.x,h.offset.x),gi(u.y,h.offset.y))}return u}removeElementScroll(a){var c;const u=Pn();if(Hs(u,a),(c=this.scroll)!=null&&c.wasRoot)return u;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:p,options:m}=h;h!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&Hs(u,a),gi(u.x,p.offset.x),gi(u.y,p.offset.y))}return u}applyTransform(a,u=!1,c){var h,p;const d=c||Pn();Hs(d,a);for(let m=0;m<this.path.length;m++){const y=this.path[m];!u&&y.options.layoutScroll&&y.scroll&&y!==y.root&&(gi(d.x,-y.scroll.offset.x),gi(d.y,-y.scroll.offset.y)),al(y.latestValues)&&Gp(d,y.latestValues,(h=y.layout)==null?void 0:h.layoutBox)}return al(this.latestValues)&&Gp(d,this.latestValues,(p=this.layout)==null?void 0:p.layoutBox),d}removeTransform(a){var c;const u=Pn();Hs(u,a);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!al(h.latestValues))continue;let p;h.instance&&(P_(h.latestValues)&&h.updateSnapshot(),p=Pn(),Hs(p,h.measurePageBox())),Ok(u,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,p)}return al(this.latestValues)&&Ok(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!==Bn.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=Bn.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Pn(),this.targetWithTransforms=Pn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lV(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Hs(this.target,this.layout.layoutBox),CT(this.target,this.targetDelta)):Hs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||P_(this.parent.latestValues)||ET(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=Pn(),this.relativeTargetOrigin=Pn(),Gm(this.relativeTargetOrigin,u,c,this.options.layoutAnchor||void 0),Hs(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var w;const a=this.getLead(),u=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(w=this.parent)!=null&&w.isProjectionDirty)&&(c=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Bn.timestamp&&(c=!1),c)return;const{layout:d,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||!(d||h))return;Hs(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;F7(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=Pn());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Pk(this.prevProjectionDelta.x,this.projectionDelta.x),Pk(this.prevProjectionDelta.y,this.projectionDelta.y)),Nd(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!jk(this.projectionDelta.x,this.prevProjectionDelta.x)||!jk(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 d=this.snapshot,h=d?d.latestValues:{},p={...this.latestValues},m=Ru();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const y=Pn(),w=d?d.source:void 0,_=this.layout?this.layout.source:void 0,x=w!==_,b=this.getStack(),P=!b||b.members.length<=1,T=!!(x&&!P&&this.options.crossfade===!0&&!this.path.some(jV));this.animationProgress=0;let k;const I=c==null?void 0:c.interpolateProjection(a);this.mixTargetDelta=R=>{const L=R/1e3,A=I==null?void 0:I(L);A?(m.x.translate=A.x,m.x.scale=Rt(a.x.scale,1,L),m.x.origin=a.x.origin,m.x.originPoint=a.x.originPoint,m.y.translate=A.y,m.y.scale=Rt(a.y.scale,1,L),m.y.origin=a.y.origin,m.y.originPoint=a.y.originPoint):(Wk(m.x,a.x,L),Wk(m.y,a.y,L)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gm(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),FV(this.relativeTarget,this.relativeTargetOrigin,y,L),k&&fV(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Pn()),Hs(k,this.relativeTarget)),x&&(this.animationValues=p,mV(p,h,this.latestValues,L,T,P)),A&&A.rotate!==void 0&&(this.animationValues||(this.animationValues=p),this.animationValues.pathRotation=A.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var u,c,d;this.notifyListeners("animationStart"),(u=this.currentAnimation)==null||u.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(ga(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Mt.update(()=>{qp.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=pc(0)),this.motionValue.jump(0,!1),this.currentAnimation=yV(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(SV),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:u,target:c,layout:d,latestValues:h}=a;if(!(!u||!c||!d)){if(this!==a&&this.layout&&d&&zT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Pn();const p=mr(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+p;const m=mr(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+m}Hs(u,c),Gp(u,h),Nd(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(a,u){this.sharedNodes.has(a)||this.sharedNodes.set(a,new bV),this.sharedNodes.get(a).add(u);const d=u.options.initialPromotionConfig;u.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.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 d=this.getStack();d&&d.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 d={};c.z&&w1("z",a,d,this.animationValues);for(let h=0;h<_1.length;h++)w1(`rotate${_1[h]}`,a,d,this.animationValues),w1(`skew${_1[h]}`,a,d,this.animationValues);a.render();for(const h in d)a.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[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=Kp(u==null?void 0:u.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=Kp(u==null?void 0:u.pointerEvents)||""),this.hasProjected&&!al(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let p=hV(this.projectionDeltaWithTransform,this.treeScale,h);c&&(p=c(h,p)),a.transform=p;const{x:m,y}=this.projectionDelta;a.transformOrigin=`${m.origin*100}% ${y.origin*100}% 0`,d.animationValues?a.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:a.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const w in I_){if(h[w]===void 0)continue;const{correct:_,applyTo:x,isCSSVariable:b}=I_[w],P=p==="none"?h[w]:_(h[w],d);if(x){const T=x.length;for(let k=0;k<T;k++)a[x[k]]=P}else b?this.options.visualElement.renderState.vars[w]=P:a[w]=P}this.options.layoutId&&(a.pointerEvents=d===this?Kp(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(zk),this.root.sharedNodes.clear()}}}function CV(t){t.updateLayout()}function kV(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")ci(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],y=mr(m);m.min=r[p].min,m.max=m.min+y});else if(i==="x"||i==="y"){const p=i==="x"?"y":"x";A_(a?e.measuredBox[p]:e.layoutBox[p],r[p])}else zT(i,e.layoutBox,r)&&ci(p=>{const m=a?e.measuredBox[p]:e.layoutBox[p],y=mr(r[p]);m.max=m.min+y,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+y)});const u=Ru();Nd(u,r,e.layoutBox);const c=Ru();a?Nd(c,t.applyTransform(s,!0),e.measuredBox):Nd(c,r,e.layoutBox);const d=!FT(u);let h=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:y}=p;if(m&&y){const w=t.options.layoutAnchor||void 0,_=Pn();Gm(_,e.layoutBox,m.layoutBox,w);const x=Pn();Gm(x,r,y.layoutBox,w),jT(_,x)||(h=!0),p.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:u,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function PV(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 TV(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function IV(t){t.clearSnapshot()}function zk(t){t.clearMeasurements()}function AV(t){t.isLayoutDirty=!0,t.updateLayout()}function Bk(t){t.isLayoutDirty=!1}function RV(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function MV(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Uk(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function OV(t){t.resolveTargetDelta()}function LV(t){t.calcProjection()}function DV(t){t.resetSkewAndRotation()}function NV(t){t.removeLeadSnapshot()}function Wk(t,e,n){t.translate=Rt(e.translate,0,n),t.scale=Rt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Gk(t,e,n,r){t.min=Rt(e.min,n.min,r),t.max=Rt(e.max,n.max,r)}function FV(t,e,n,r){Gk(t.x,e.x,n.x,r),Gk(t.y,e.y,n.y,r)}function jV(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const VV={duration:.45,ease:[.4,0,.1,1]},Kk=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),qk=Kk("applewebkit/")&&!Kk("chrome/")?Math.round:Ts;function Zk(t){t.min=qk(t.min),t.max=qk(t.max)}function $V(t){Zk(t.x),Zk(t.y)}function zT(t,e,n){return t==="position"||t==="preserve-aspect"&&!aV(Fk(e),Fk(n),.2)}function HV(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const zV=HT({attachResizeListener:(t,e)=>nf(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}),x1={current:void 0},BT=HT({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!x1.current){const t=new zV({});t.mount(window),t.setOptions({layoutScroll:!0}),x1.current=t}return x1.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ew=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Yk(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function BV(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Yk(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():Yk(t[s],null)}}}}function UV(...t){return v.useCallback(BV(...t),t)}class WV extends v.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(zp(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=zp(r)&&r.offsetWidth||0,i=zp(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 GV({children:t,isPresent:e,anchorX:n,anchorY:r,root:s,pop:i}){var m;const a=v.useId(),u=v.useRef(null),c=v.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=v.useContext(Ew),h=i!==!1?((m=t.props)==null?void 0:m.ref)??(t==null?void 0:t.ref):void 0,p=UV(u,h);return v.useInsertionEffect(()=>{const{width:y,height:w,top:_,left:x,right:b,bottom:P,direction:T}=c.current;if(e||i===!1||!u.current||!y||!w)return;const k=T==="rtl",I=n==="left"?k?`right: ${b}`:`left: ${x}`:k?`left: ${x}`:`right: ${b}`,R=r==="bottom"?`bottom: ${P}`:`top: ${_}`;u.current.dataset.motionPopId=a;const L=document.createElement("style");d&&(L.nonce=d);const A=s??document.head;return A.appendChild(L),L.sheet&&L.sheet.insertRule(`
64
+ [data-motion-pop-id="${a}"] {
65
+ position: absolute !important;
66
+ width: ${y}px !important;
67
+ height: ${w}px !important;
68
+ ${I}px !important;
69
+ ${R}px !important;
70
+ }
71
+ `),()=>{var O;(O=u.current)==null||O.removeAttribute("data-motion-pop-id"),A.contains(L)&&A.removeChild(L)}},[e]),E.jsx(WV,{isPresent:e,childRef:u,sizeRef:c,pop:i,children:i===!1?t:v.cloneElement(t,{ref:p})})}const KV=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:u,anchorY:c,root:d})=>{const h=Q2(qV),p=v.useId(),m=v.useRef(n),y=v.useRef(r);J2(()=>{m.current=n,y.current=r});let w=!0,_=v.useMemo(()=>(w=!1,{id:p,initial:e,isPresent:n,custom:s,onExitComplete:x=>{h.set(x,!0);for(const b of h.values())if(!b)return;r&&r()},register:x=>(h.set(x,!1),()=>{var b;h.delete(x),!m.current&&!h.size&&((b=y.current)==null||b.call(y))})}),[n,h,r]);return i&&w&&(_={..._}),v.useMemo(()=>{h.forEach((x,b)=>h.set(b,!1))},[n]),v.useEffect(()=>{!n&&!h.size&&r&&r()},[n]),t=E.jsx(GV,{pop:a==="popLayout",isPresent:n,anchorX:u,anchorY:c,root:d,children:t}),E.jsx(v0.Provider,{value:_,children:t})};function qV(){return new Map}function UT(t=!0){const e=v.useContext(v0);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const a=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,a]:[!0]}const mp=t=>t.key||"";function Xk(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const uo=({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:d})=>{const[h,p]=UT(a),m=v.useMemo(()=>Xk(t),[t]),y=a&&!h?[]:m.map(mp),w=v.useRef(!0),_=v.useRef(m),x=Q2(()=>new Map),b=v.useRef(new Set),[P,T]=v.useState(m),[k,I]=v.useState(m);J2(()=>{w.current=!1,_.current=m;for(let A=0;A<k.length;A++){const O=mp(k[A]);y.includes(O)?(x.delete(O),b.current.delete(O)):x.get(O)!==!0&&x.set(O,!1)}},[k,y.length,y.join("-")]);const R=[];if(m!==P){let A=[...m];for(let O=0;O<k.length;O++){const D=k[O],N=mp(D);y.includes(N)||(A.splice(O,0,D),R.push(D))}return i==="wait"&&R.length&&(A=R),I(Xk(A)),T(m),null}const{forceRender:L}=v.useContext(X2);return E.jsx(E.Fragment,{children:k.map(A=>{const O=mp(A),D=a&&!h?!1:m===k||y.includes(O),N=()=>{if(b.current.has(O))return;if(x.has(O))b.current.add(O),x.set(O,!0);else return;let F=!0;x.forEach(K=>{K||(F=!1)}),F&&(L==null||L(),I(_.current),a&&(p==null||p()),r&&r())};return E.jsx(KV,{isPresent:D,initial:!w.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:d,onExitComplete:D?void 0:N,anchorX:u,anchorY:c,children:A},O)})})},WT=v.createContext({strict:!1}),Qk={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 Jk=!1;function ZV(){if(Jk)return;const t={};for(const e in Qk)t[e]={isEnabled:n=>Qk[e].some(r=>!!n[r])};xT(t),Jk=!0}function GT(){return ZV(),O7()}function YV(t){const e=GT();for(const n in t)e[n]={...e[n],...t[n]};xT(e)}const XV=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Km(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||XV.has(t)}let KT=t=>!Km(t);function QV(t){typeof t=="function"&&(KT=e=>e.startsWith("on")?!Km(e):t(e))}try{QV(require("@emotion/is-prop-valid").default)}catch{}function JV(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||Gn(t[s])||(KT(s)||n===!0&&Km(s)||!e&&!Km(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const b0=v.createContext({});function e$(t,e){if(x0(t)){const{initial:n,animate:r}=t;return{initial:n===!1||tf(n)?n:void 0,animate:tf(r)?r:void 0}}return t.inherit!==!1?e:{}}function t$(t){const{initial:e,animate:n}=e$(t,v.useContext(b0));return v.useMemo(()=>({initial:e,animate:n}),[e4(e),e4(n)])}function e4(t){return Array.isArray(t)?t.join(" "):t}const Cw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qT(t,e,n){for(const r in e)!Gn(e[r])&&!TT(r,n)&&(t[r]=e[r])}function n$({transformTemplate:t},e){return v.useMemo(()=>{const n=Cw();return bw(n,e,t),Object.assign({},n.vars,n.style)},[e])}function r$(t,e){const n=t.style||{},r={};return qT(r,n,t),Object.assign(r,n$(t,e)),r}function s$(t,e){const n={},r=r$(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 ZT=()=>({...Cw(),attrs:{}});function i$(t,e,n,r){const s=v.useMemo(()=>{const i=ZT();return IT(i,e,RT(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};qT(i,t.style,t),s.style={...i,...s.style}}return s}const o$=["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 kw(t){return typeof t!="string"||t.includes("-")?!1:!!(o$.indexOf(t)>-1||/[A-Z]/u.test(t))}function a$(t,e,n,{latestValues:r},s,i=!1,a){const c=(a??kw(t)?i$:s$)(e,r,s,t),d=JV(e,typeof t=="string",i),h=t!==v.Fragment?{...d,...c,ref:n}:{},{children:p}=e,m=v.useMemo(()=>Gn(p)?p.get():p,[p]);return v.createElement(t,{...h,children:m})}function l$({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:u$(n,r,s,t),renderState:e()}}function u$(t,e,n,r){const s={},i=r(t,{});for(const m in i)s[m]=Kp(i[m]);let{initial:a,animate:u}=t;const c=x0(t),d=_T(t);e&&d&&!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"&&!w0(p)){const m=Array.isArray(p)?p:[p];for(let y=0;y<m.length;y++){const w=hw(t,m[y]);if(w){const{transitionEnd:_,transition:x,...b}=w;for(const P in b){let T=b[P];if(Array.isArray(T)){const k=h?T.length-1:0;T=T[k]}T!==null&&(s[P]=T)}for(const P in _)s[P]=_[P]}}}return s}const YT=t=>(e,n)=>{const r=v.useContext(b0),s=v.useContext(v0),i=()=>l$(t,e,r,s);return n?i():Q2(i)},c$=YT({scrapeMotionValuesFromProps:Sw,createRenderState:Cw}),d$=YT({scrapeMotionValuesFromProps:MT,createRenderState:ZT}),f$=Symbol.for("motionComponentSymbol");function h$(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.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 XT=v.createContext({});function Eu(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function p$(t,e,n,r,s,i){var T,k;const{visualElement:a}=v.useContext(b0),u=v.useContext(WT),c=v.useContext(v0),d=v.useContext(Ew),h=d.reducedMotion,p=d.skipAnimations,m=v.useRef(null),y=v.useRef(!1);r=r||u.renderer,!m.current&&r&&(m.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&&m.current&&(m.current.manuallyAnimateOnMount=!0));const w=m.current,_=v.useContext(XT);w&&!w.projection&&s&&(w.type==="html"||w.type==="svg")&&m$(m.current,n,s,_);const x=v.useRef(!1);v.useInsertionEffect(()=>{w&&x.current&&w.update(n,c)});const b=n[aT],P=v.useRef(!!b&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,b))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,b)));return J2(()=>{y.current=!0,w&&(x.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),P.current&&w.animationState&&w.animationState.animateChanges())}),v.useEffect(()=>{w&&(!P.current&&w.animationState&&w.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var I;(I=window.MotionHandoffMarkAsComplete)==null||I.call(window,b)}),P.current=!1),w.enteringChildren=void 0)}),w}function m$(t,e,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:u,layoutScroll:c,layoutRoot:d,layoutAnchor:h,layoutCrossfade:p}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:QT(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||u&&Eu(u),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:c,layoutRoot:d,layoutAnchor:h})}function QT(t){if(t)return t.options.allowProjection!==!1?t.projection:QT(t.parent)}function b1(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&YV(r);const i=n?n==="svg":kw(t),a=i?d$:c$;function u(d,h){let p;const m={...v.useContext(Ew),...d,layoutId:g$(d)},{isStatic:y}=m,w=t$(d),_=a(d,y);if(!y&&typeof window<"u"){v$();const x=y$(m);p=x.MeasureLayout,w.visualElement=p$(t,_,m,s,x.ProjectionNode,i)}return E.jsxs(b0.Provider,{value:w,children:[p&&w.visualElement?E.jsx(p,{visualElement:w.visualElement,...m}):null,a$(t,d,h$(_,w.visualElement,h),_,y,e,i)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=v.forwardRef(u);return c[f$]=t,c}function g$({layoutId:t}){const e=v.useContext(X2).id;return e&&t!==void 0?e+"-"+t:t}function v$(t,e){v.useContext(WT).strict}function y$(t){const e=GT(),{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 _$(t,e){if(typeof Proxy>"u")return b1;const n=new Map,r=(i,a)=>b1(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,b1(a,void 0,t,e)),n.get(a))})}const w$=(t,e)=>e.isSVG??kw(t)?new Y7(e):new U7(e,{allowProjection:t!==v.Fragment});class x$ extends Sa{constructor(e){super(e),e.animationState||(e.animationState=tV(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();w0(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 b$=0;class S$ extends Sa{constructor(){super(...arguments),this.id=b$++,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=Tl(this.node,a,u);if(c){const{transition:d,transitionEnd:h,...p}=c;for(const m in p)(i=this.node.getValue(m))==null||i.jump(p[m])}}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 E$={animation:{Feature:x$},exit:{Feature:S$}};function Lf(t){return{point:{x:t.pageX,y:t.pageY}}}const C$=t=>e=>vw(e)&&t(e,Lf(e));function Fd(t,e,n,r){return nf(t,e,C$(n),r)}const JT=({current:t})=>t?t.ownerDocument.defaultView:null,t4=(t,e)=>Math.abs(t-e);function k$(t,e){const n=t4(t.x,e.x),r=t4(t.y,e.y);return Math.sqrt(n**2+r**2)}const n4=new Set(["auto","scroll"]);class eI{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=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=gp(this.lastRawMoveEventInfo,this.transformPagePoint));const w=S1(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,x=k$(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!x)return;const{point:b}=w,{timestamp:P}=Bn;this.history.push({...b,timestamp:P});const{onStart:T,onMove:k}=this.handlers;_||(T&&T(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,w)},this.handlePointerMove=(w,_)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=_,this.lastMoveEventInfo=gp(_,this.transformPagePoint),Mt.update(this.updatePoint,!0)},this.handlePointerUp=(w,_)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:P}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&P&&P(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=S1(w.type==="pointercancel"?this.lastMoveEventInfo:gp(_,this.transformPagePoint),this.history);this.startEvent&&x&&x(w,T),b&&b(w,T)},!vw(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const c=Lf(e),d=gp(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=Bn;this.history=[{...h,timestamp:p}];const{onSessionStart:m}=n;m&&m(e,S1(d,this.history));const y={passive:!0,capture:!0};this.removeListeners=Rf(Fd(this.contextWindow,"pointermove",this.handlePointerMove,y),Fd(this.contextWindow,"pointerup",this.handlePointerUp,y),Fd(this.contextWindow,"pointercancel",this.handlePointerUp,y)),u&&this.startScrollTracking(u)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(n4.has(r.overflowX)||n4.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),Mt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ga(this.updatePoint)}}function gp(t,e){return e?{point:e(t.point)}:t}function r4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function S1({point:t},e){return{point:t,delta:r4(t,tI(e)),offset:r4(t,P$(e)),velocity:T$(e,.1)}}function P$(t){return t[0]}function tI(t){return t[t.length-1]}function T$(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=tI(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>ss(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>ss(e)*2&&(r=t[1]);const i=Es(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 I$(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?Rt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?Rt(n,t,r.max):Math.min(t,n)),t}function s4(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 A$(t,{top:e,left:n,bottom:r,right:s}){return{x:s4(t.x,n,s),y:s4(t.y,e,r)}}function i4(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 R$(t,e){return{x:i4(t.x,e.x),y:i4(t.y,e.y)}}function M$(t,e){let n=.5;const r=mr(t),s=mr(e);return s>r?n=Jd(e.min,e.max-r,t.min):r>s&&(n=Jd(t.min,t.max-s,e.min)),Si(0,1,n)}function O$(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 R_=.35;function L$(t=R_){return t===!1?t=0:t===!0&&(t=R_),{x:o4(t,"left","right"),y:o4(t,"top","bottom")}}function o4(t,e,n){return{min:a4(t,e),max:a4(t,n)}}function a4(t,e){return typeof t=="number"?t:t[e]||0}const D$=new WeakMap;class N${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=Pn(),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(Lf(p).point),this.stopAnimation()},a=(p,m)=>{const{drag:y,dragPropagation:w,onDragStart:_}=this.getProps();if(y&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=c7(y),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ci(b=>{let P=this.getAxisMotionValue(b).get()||0;if(bi.test(P)){const{projection:T}=this.visualElement;if(T&&T.layout){const k=T.layout.layoutBox[b];k&&(P=mr(k)*(parseFloat(P)/100))}}this.originPoint[b]=P}),_&&Mt.update(()=>_(p,m),!1,!0),b_(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},u=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m;const{dragPropagation:y,dragDirectionLock:w,onDirectionLock:_,onDrag:x}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:b}=m;if(w&&this.currentDirection===null){this.currentDirection=j$(b),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),x&&Mt.update(()=>x(p,m),!1,!0)},c=(p,m)=>{this.latestPointerEvent=p,this.latestPanInfo=m,this.stop(p,m),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new eI(e,{onSessionStart:i,onStart:a,onMove:u,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:JT(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&&Mt.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||!vp(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=I$(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&&Eu(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=A$(r.layoutBox,e):this.constraints=!1,this.elastic=L$(n),s!==this.constraints&&!Eu(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&ci(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=O$(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Eu(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=j7(r,s.root,this.visualElement.getTransformPagePoint());let a=R$(s.layout.layoutBox,i);if(n){const u=n(D7(a));this.hasMutatedConstraints=!!u,u&&(a=ST(u))}return a}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:u}=this.getProps(),c=this.constraints||{},d=ci(h=>{if(!vp(h,n,this.currentDirection))return;let p=c&&c[h]||{};(a===!0||a===h)&&(p={min:0,max:0});const m=s?200:1e6,y=s?40:1e7,w={type:"inertia",velocity:r?e[h]:0,bounceStiffness:m,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(h,w)});return Promise.all(d).then(u)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return b_(this.visualElement,e),r.start(fw(e,r,0,n,this.visualElement,!1))}stopAnimation(){ci(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){ci(n=>{const{drag:r}=this.getProps();if(!vp(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]-Rt(a,u,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Eu(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};ci(a=>{const u=this.getAxisMotionValue(a);if(u&&this.constraints!==!1){const c=u.get();s[a]=M$({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(),ci(a=>{if(!vp(a,e,null))return;const u=this.getAxisMotionValue(a),{min:c,max:d}=this.constraints[a];u.set(Rt(c,d,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;D$.set(this.visualElement,this);const e=this.visualElement.current,n=Fd(e,"pointerdown",d=>{const{drag:h,dragListener:p=!0}=this.getProps(),m=d.target,y=m!==e&&g7(m);h&&p&&!y&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();Eu(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=F$(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Mt.read(s);const u=nf(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(ci(p=>{const m=this.getAxisMotionValue(p);m&&(this.originPoint[p]+=d[p].translate,m.set(m.get()+d[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=R_,dragMomentum:u=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:u}}}function l4(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function F$(t,e,n){const r=mk(t,l4(n)),s=mk(e,l4(n));return()=>{r(),s()}}function vp(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function j$(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class V$ extends Sa{constructor(e){super(e),this.removeGroupControls=Ts,this.removeListeners=Ts,this.controls=new N$(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ts}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 E1=t=>(e,n)=>{t&&Mt.update(()=>t(e,n),!1,!0)};class $$ extends Sa{constructor(){super(...arguments),this.removePointerDownListener=Ts}onPointerDown(e){this.session=new eI(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:JT(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:E1(e),onStart:E1(n),onMove:E1(r),onEnd:(i,a)=>{delete this.session,s&&Mt.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Fd(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 C1=!1;class H$ extends v.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),C1&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),qp.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}),C1=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Mt.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(),gw.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;C1=!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 nI(t){const[e,n]=UT(),r=v.useContext(X2);return E.jsx(H$,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(XT),isPresent:e,safeToRemove:n})}const z$={pan:{Feature:$$},drag:{Feature:V$,ProjectionNode:BT,MeasureLayout:nI}};function u4(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&&Mt.postRender(()=>i(e,Lf(e)))}class B$ extends Sa{mount(){const{current:e}=this.node;e&&(this.unmount=f7(e,(n,r)=>(u4(this.node,r,"Start"),s=>u4(this.node,s,"End"))))}unmount(){}}class U$ extends Sa{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=Rf(nf(this.node.current,"focus",()=>this.onFocus()),nf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function c4(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&&Mt.postRender(()=>i(e,Lf(e)))}class W$ extends Sa{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=y7(e,(s,i)=>(c4(this.node,i,"Start"),(a,{success:u})=>c4(this.node,a,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const M_=new WeakMap,k1=new WeakMap,G$=t=>{const e=M_.get(t.target);e&&e(t)},K$=t=>{t.forEach(G$)};function q$({root:t,...e}){const n=t||document;k1.has(n)||k1.set(n,{});const r=k1.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(K$,{root:t,...e})),r[s]}function Z$(t,e,n){const r=q$(e);return M_.set(t,n),r.observe(t),()=>{M_.delete(t),r.unobserve(t)}}const Y$={some:0,all:1};class X$ extends Sa{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:Y$[s]},u=d=>{const{isIntersecting:h}=d;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:m}=this.node.getProps(),y=h?p:m;y&&y(d)};this.stopObserver=Z$(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(Q$(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function Q$({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const J$={inView:{Feature:X$},tap:{Feature:W$},focus:{Feature:U$},hover:{Feature:B$}},eH={layout:{ProjectionNode:BT,MeasureLayout:nI}},tH={...E$,...J$,...z$,...eH},co=_$(tH,w$);function nH(){!xw.current&&wT();const[t]=v.useState(Bm.current);return t}const Il=co;var S0=h3();const rH=d0(S0);function sH(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 iH=t=>{switch(t){case"success":return lH;case"info":return cH;case"warning":return uH;case"error":return dH;default:return null}},oH=Array(12).fill(0),aH=({visible:t,className:e})=>ye.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ye.createElement("div",{className:"sonner-spinner"},oH.map((n,r)=>ye.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),lH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),uH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),cH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),dH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},ye.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"})),fH=ye.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},ye.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ye.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),hH=()=>{const[t,e]=ye.useState(document.hidden);return ye.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),t};let pH=1;const mH=100,d4=t=>{var e;return typeof(t==null?void 0:t.id)=="number"||(t==null||(e=t.id)==null?void 0:e.length)>0?t.id:pH++};class gH{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(n=>e(n)),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-mH;e<=0||(this.toasts=this.toasts.filter(n=>e>0&&this.dismissedToasts.has(n.id)?(this.dismissedToasts.delete(n.id),e--,!1):!0))},this.create=e=>{const{message:n,...r}=e,s=d4(e),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),u=e.dismissible===void 0?!0:e.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(a?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...e,id:s,title:n}),{...d,...e,id:s,dismissible:u,title:n}):d):this.addToast({title:n,...r,dismissible:u,id:s}),s},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);const n=this.pendingDismissals.get(e);return n!==void 0&&cancelAnimationFrame(n),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(r=>r({id:e,dismiss:!0}))})),e},this.message=(e,n)=>this.create({...n,message:e,type:void 0}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(e instanceof Function?e():e);let i=r!==void 0,a;const u=s.then(async d=>{if(a=["resolve",d],ye.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(yH(d)&&!d.ok){i=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof p=="object"&&!ye.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(d instanceof Error){i=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!ye.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...w})}else if(n.success!==void 0){i=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,w=typeof p=="object"&&!ye.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...w})}}).catch(async d=>{if(a=["reject",d],n.error!==void 0){i=!1;const h=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof h=="object"&&!ye.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((d,h)=>u.then(()=>a[0]==="reject"?h(a[1]):d(a[1])).catch(h));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(e,n)=>{const r=d4(n);return this.create({...n,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Ar=new gH,vH=(t,e)=>Ar.message(t,e),yH=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",_H=vH,wH=()=>Ar.toasts,xH=()=>Ar.getActiveToasts(),vt=Object.assign(_H,{success:Ar.success,info:Ar.info,warning:Ar.warning,error:Ar.error,custom:Ar.custom,message:Ar.message,promise:Ar.promise,dismiss:Ar.dismiss,loading:Ar.loading},{getHistory:wH,getToasts:xH});sH("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function yp(t){return t.label!==void 0}const bH=3,SH="24px",EH="16px",f4=4e3,CH=356,kH=14,PH=45,TH=200;function ii(...t){return t.filter(Boolean).join(" ")}function IH(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const AH=t=>{var e,n,r,s,i,a,u,c,d;const{invert:h,toast:p,unstyled:m,interacting:y,setHeights:w,visibleToasts:_,heights:x,index:b,toasts:P,expanded:T,removeToast:k,defaultRichColors:I,closeButton:R,style:L,cancelButtonStyle:A,actionButtonStyle:O,className:D="",descriptionClassName:N="",duration:F,position:K,gap:Z,expandByDefault:W,classNames:G,icons:Y,closeButtonAriaLabel:$="Close toast"}=t,[J,H]=ye.useState(null),[j,X]=ye.useState(null),[oe,se]=ye.useState(!1),[ee,ce]=ye.useState(!1),[we,ue]=ye.useState(!1),[ie,Ne]=ye.useState(!1),[Ue,Pe]=ye.useState(!1),[Ve,ht]=ye.useState(0),[Jt,be]=ye.useState(0),$e=ye.useRef(p.duration||F||f4),Ge=ye.useRef(null),tt=ye.useRef(null),bt=b===0,nt=b+1<=_,Ye=p.type,an=Ye??"default",ln=p.dismissible!==!1,Fn=p.className||"",xo=p.descriptionClassName||"",Zn=ye.useMemo(()=>x.findIndex(We=>We.toastId===p.id)||0,[x,p.id]),us=ye.useMemo(()=>{var We;return(We=p.closeButton)!=null?We:R},[p.closeButton,R]),yr=ye.useMemo(()=>p.duration||F||f4,[p.duration,F]),ir=ye.useRef(0),_r=ye.useRef(0),$l=ye.useRef(0),en=ye.useRef(null),[bo,So]=K.split("-"),As=ye.useMemo(()=>x.reduce((We,Gt,Dt)=>Dt>=Zn?We:We+Gt.height,0),[x,Zn]),Rs=hH(),bn=ye.useMemo(()=>{var We;return(We=t.swipeDirections)!=null?We:IH(K)},[t.swipeDirections,K]),cs=p.invert||h,Xs=Ye==="loading";_r.current=ye.useMemo(()=>Zn*Z+As,[Zn,As]),ye.useEffect(()=>{$e.current=yr},[yr]),ye.useEffect(()=>{se(!0)},[]),ye.useEffect(()=>{const We=tt.current;if(We){const Gt=We.getBoundingClientRect().height;return be(Gt),w(Dt=>[{toastId:p.id,height:Gt,position:p.position},...Dt]),()=>w(Dt=>Dt.filter(Sn=>Sn.toastId!==p.id))}},[w,p.id]),ye.useLayoutEffect(()=>{if(!oe)return;const We=tt.current,Gt=We.style.height;We.style.height="auto";const Dt=We.getBoundingClientRect().height;We.style.height=Gt,be(Dt),w(Sn=>Sn.find(Kt=>Kt.toastId===p.id)?Sn.map(Kt=>Kt.toastId===p.id?{...Kt,height:Dt}:Kt):[{toastId:p.id,height:Dt,position:p.position},...Sn])},[oe,p.title,p.description,w,p.id,p.jsx,p.action,p.cancel]);const mn=ye.useCallback(()=>{ce(!0),ht(_r.current),w(We=>We.filter(Gt=>Gt.toastId!==p.id)),setTimeout(()=>{k(p)},TH)},[p,k,w,_r]);ye.useEffect(()=>{if(p.promise&&Ye==="loading"||p.duration===1/0||p.type==="loading")return;let We;return T||y||Rs?(()=>{if($l.current<ir.current){const Sn=new Date().getTime()-ir.current;$e.current=$e.current-Sn}$l.current=new Date().getTime()})():(()=>{$e.current!==1/0&&(ir.current=new Date().getTime(),We=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),mn()},$e.current))})(),()=>clearTimeout(We)},[T,y,p,Ye,Rs,mn]),ye.useEffect(()=>{p.delete&&(mn(),p.onDismiss==null||p.onDismiss.call(p,p))},[mn,p.delete]);function ds(){var We;if(Y!=null&&Y.loading){var Gt;return ye.createElement("div",{className:ii(G==null?void 0:G.loader,p==null||(Gt=p.classNames)==null?void 0:Gt.loader,"sonner-loader"),"data-visible":Ye==="loading"},Y.loading)}return ye.createElement(aH,{className:ii(G==null?void 0:G.loader,p==null||(We=p.classNames)==null?void 0:We.loader),visible:Ye==="loading"})}const Eo=p.icon||(Y==null?void 0:Y[Ye])||iH(Ye);var Ii,Ai;return ye.createElement("li",{tabIndex:0,ref:tt,className:ii(D,Fn,G==null?void 0:G.toast,p==null||(e=p.classNames)==null?void 0:e.toast,G==null?void 0:G[an],p==null||(n=p.classNames)==null?void 0:n[an]),"data-sonner-toast":"","data-rich-colors":(Ii=p.richColors)!=null?Ii:I,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":oe,"data-promise":!!p.promise,"data-swiped":Ue,"data-removed":ee,"data-visible":nt,"data-y-position":bo,"data-x-position":So,"data-index":b,"data-front":bt,"data-swiping":we,"data-dismissible":ln,"data-type":Ye,"data-invert":cs,"data-swipe-out":ie,"data-swipe-direction":j,"data-expanded":!!(T||W&&oe),"data-testid":p.testId,style:{"--index":b,"--toasts-before":b,"--z-index":P.length-b,"--offset":`${ee?Ve:_r.current}px`,"--initial-height":W?"auto":`${Jt}px`,...L,...p.style},onDragEnd:()=>{ue(!1),H(null),en.current=null},onPointerDown:We=>{We.button!==2&&(Xs||!ln||(Ge.current=new Date,ht(_r.current),We.target.setPointerCapture(We.pointerId),We.target.tagName!=="BUTTON"&&(ue(!0),en.current={x:We.clientX,y:We.clientY})))},onPointerUp:()=>{var We,Gt,Dt;if(ie||!ln)return;en.current=null;const Sn=Number(((We=tt.current)==null?void 0:We.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Hr=Number(((Gt=tt.current)==null?void 0:Gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Kt=new Date().getTime()-((Dt=Ge.current)==null?void 0:Dt.getTime()),un=J==="x"?Sn:Hr,or=Math.abs(un)/Kt;if((J==="x"?bn.includes(Sn>0?"right":"left"):bn.includes(Hr>0?"bottom":"top"))&&(Math.abs(un)>=PH||or>.11)){ht(_r.current),p.onDismiss==null||p.onDismiss.call(p,p),X(J==="x"?Sn>0?"right":"left":Hr>0?"down":"up"),mn(),Ne(!0);return}else{var jn,Qs;(jn=tt.current)==null||jn.style.setProperty("--swipe-amount-x","0px"),(Qs=tt.current)==null||Qs.style.setProperty("--swipe-amount-y","0px")}Pe(!1),ue(!1),H(null)},onPointerMove:We=>{var Gt,Dt,Sn;if(!en.current||!ln||((Gt=window.getSelection())==null?void 0:Gt.toString().length)>0)return;const Kt=We.clientY-en.current.y,un=We.clientX-en.current.x;!J&&(Math.abs(un)>1||Math.abs(Kt)>1)&&H(Math.abs(un)>Math.abs(Kt)?"x":"y");let or={x:0,y:0};const fs=jn=>1/(1.5+Math.abs(jn)/20);if(J==="y"){if(bn.includes("top")||bn.includes("bottom"))if(bn.includes("top")&&Kt<0||bn.includes("bottom")&&Kt>0)or.y=Kt;else{const jn=Kt*fs(Kt);or.y=Math.abs(jn)<Math.abs(Kt)?jn:Kt}}else if(J==="x"&&(bn.includes("left")||bn.includes("right")))if(bn.includes("left")&&un<0||bn.includes("right")&&un>0)or.x=un;else{const jn=un*fs(un);or.x=Math.abs(jn)<Math.abs(un)?jn:un}(Math.abs(or.x)>0||Math.abs(or.y)>0)&&Pe(!0),(Dt=tt.current)==null||Dt.style.setProperty("--swipe-amount-x",`${or.x}px`),(Sn=tt.current)==null||Sn.style.setProperty("--swipe-amount-y",`${or.y}px`)}},us&&!p.jsx&&Ye!=="loading"?ye.createElement("button",{"aria-label":$,"data-disabled":Xs,"data-close-button":!0,onClick:Xs||!ln?()=>{}:()=>{mn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ii(G==null?void 0:G.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Ai=Y==null?void 0:Y.close)!=null?Ai:fH):null,(Ye||p.icon||p.promise)&&p.icon!==null&&((Y==null?void 0:Y[Ye])!==null||p.icon)?ye.createElement("div",{"data-icon":"",className:ii(G==null?void 0:G.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},Ye==="loading"?p.icon||ds():p.promise?ds():null,Ye!=="loading"?Eo:null):null,ye.createElement("div",{"data-content":"",className:ii(G==null?void 0:G.content,p==null||(i=p.classNames)==null?void 0:i.content)},ye.createElement("div",{"data-title":"",className:ii(G==null?void 0:G.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?ye.createElement("div",{"data-description":"",className:ii(N,xo,G==null?void 0:G.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),ye.isValidElement(p.cancel)?p.cancel:p.cancel&&yp(p.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||A,onClick:We=>{yp(p.cancel)&&ln&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,We),mn())},className:ii(G==null?void 0:G.cancelButton,p==null||(c=p.classNames)==null?void 0:c.cancelButton)},p.cancel.label):null,ye.isValidElement(p.action)?p.action:p.action&&yp(p.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||O,onClick:We=>{yp(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,We),!We.defaultPrevented&&mn())},className:ii(G==null?void 0:G.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function h4(){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 RH(t,e){const n={};return[t,e].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",u=i?EH:SH;function c(d){["top","right","bottom","left"].forEach(h=>{n[`${a}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=u:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(u)}),n}const MH=ye.forwardRef(function(e,n){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:u,closeButton:c,className:d,offset:h,mobileOffset:p,theme:m="light",richColors:y,duration:w,style:_,visibleToasts:x=bH,toastOptions:b,dir:P=h4(),gap:T=kH,icons:k,customAriaLabel:I,containerAriaLabel:R="Notifications"}=e,[L,A]=ye.useState([]),O=ye.useMemo(()=>r?L.filter(se=>se.toasterId===r):L.filter(se=>!se.toasterId),[L,r]),D=ye.useMemo(()=>Array.from(new Set([i].concat(O.filter(se=>se.position).map(se=>se.position)))),[O,i]),[N,F]=ye.useState([]),[K,Z]=ye.useState(!1),[W,G]=ye.useState(!1),[Y,$]=ye.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=ye.useRef(null),H=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=ye.useRef(null),X=ye.useRef(!1),oe=ye.useCallback(se=>{A(ee=>{var ce;return(ce=ee.find(we=>we.id===se.id))!=null&&ce.delete||Ar.dismiss(se.id),ee.filter(({id:we})=>we!==se.id)})},[]);return ye.useEffect(()=>Ar.subscribe(se=>{if(se.dismiss){requestAnimationFrame(()=>{A(ee=>ee.map(ce=>ce.id===se.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{rH.flushSync(()=>{A(ee=>{const ce=ee.findIndex(we=>we.id===se.id);return ce!==-1?[...ee.slice(0,ce),{...ee[ce],...se},...ee.slice(ce+1)]:[se,...ee]})})})}),[]),ye.useEffect(()=>{if(m!=="system"){$(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const se=window.matchMedia("(prefers-color-scheme: dark)");try{se.addEventListener("change",({matches:ee})=>{$(ee?"dark":"light")})}catch{se.addListener(({matches:ce})=>{try{$(ce?"dark":"light")}catch(we){console.error(we)}})}},[m]),ye.useEffect(()=>{L.length<=1&&Z(!1)},[L]),ye.useEffect(()=>{const se=ee=>{var ce;if(a.length>0&&a.every(ie=>ee[ie]||ee.code===ie)){var ue;Z(!0),(ue=J.current)==null||ue.focus()}ee.code==="Escape"&&(document.activeElement===J.current||(ce=J.current)!=null&&ce.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[a]),ye.useEffect(()=>{if(J.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,X.current=!1)}},[J.current]),ye.createElement("section",{ref:n,"aria-label":I??`${R} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},D.map((se,ee)=>{var ce;const[we,ue]=se.split("-");return O.length?ye.createElement("ol",{key:se,dir:P==="auto"?h4():P,tabIndex:-1,ref:J,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":we,"data-x-position":ue,style:{"--front-toast-height":`${((ce=N[0])==null?void 0:ce.height)||0}px`,"--width":`${CH}px`,"--gap":`${T}px`,..._,...RH(h,p)},onBlur:ie=>{X.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(X.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||X.current||(X.current=!0,j.current=ie.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{W||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},O.filter(ie=>!ie.position&&ee===0||ie.position===se).map((ie,Ne)=>{var Ue,Pe;return ye.createElement(AH,{key:ie.id,icons:k,index:Ne,toast:ie,defaultRichColors:y,duration:(Ue=b==null?void 0:b.duration)!=null?Ue:w,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:x,closeButton:(Pe=b==null?void 0:b.closeButton)!=null?Pe:c,interacting:W,position:se,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:oe,toasts:O.filter(Ve=>Ve.position==ie.position),heights:N.filter(Ve=>Ve.position==ie.position),setHeights:F,expandByDefault:u,gap:T,expanded:K,swipeDirections:e.swipeDirections})})):null}))});var OH=Object.defineProperty,Sc=(t,e)=>OH(t,"name",{value:e,configurable:!0}),rI=!!(typeof window<"u"&&window.document&&window.document.createElement);function $t(t,e,{checkForDefaultPrevented:n=!0}={}){return Sc(function(s){if(t==null||t(s),n===!1||!s||!s.defaultPrevented)return e==null?void 0:e(s)},"handleEvent")}Sc($t,"composeEventHandlers");function LH(t){var e;if(!rI)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}Sc(LH,"getOwnerWindow");function O_(t){if(!rI)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}Sc(O_,"getOwnerDocument");function sI(t,e=!1){const{activeElement:n}=O_(t);if(!(n!=null&&n.nodeName))return null;if(iI(n)&&n.contentDocument)return sI(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const s=O_(n).getElementById(r);if(s)return s}}return n}Sc(sI,"getActiveElement");function iI(t){return t.tagName==="IFRAME"}Sc(iI,"isFrame");var DH=Object.defineProperty,Pw=(t,e)=>DH(t,"name",{value:e,configurable:!0});function L_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}Pw(L_,"setRef");function oI(...t){return e=>{let n=!1;const r=t.map(s=>{const i=L_(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():L_(t[s],null)}}}}Pw(oI,"composeRefs");function zt(...t){return v.useCallback(oI(...t),t)}Pw(zt,"useComposedRefs");var NH=Object.defineProperty,Ss=(t,e)=>NH(t,"name",{value:e,configurable:!0});function FH(t,e){const n=v.createContext(e);n.displayName=t+"Context";const r=Ss(i=>{const{children:a,...u}=i,c=v.useMemo(()=>u,Object.values(u));return E.jsx(n.Provider,{value:c,children:a})},"Provider");r.displayName=t+"Provider";function s(i,a={}){const{optional:u=!1}=a,c=v.useContext(n);if(c)return c;if(e!==void 0)return e;if(!u)throw new Error(`\`${i}\` must be used within \`${t}\``)}return Ss(s,"useContext"),[r,s]}Ss(FH,"createContext");function Pi(t,e=[]){let n=[];function r(i,a){const u=v.createContext(a);u.displayName=i+"Context";const c=n.length;n=[...n,a];const d=Ss(p=>{var b;const{scope:m,children:y,...w}=p,_=((b=m==null?void 0:m[t])==null?void 0:b[c])||u,x=v.useMemo(()=>w,Object.values(w));return E.jsx(_.Provider,{value:x,children:y})},"Provider");d.displayName=i+"Provider";function h(p,m,y={}){var b;const{optional:w=!1}=y,_=((b=m==null?void 0:m[t])==null?void 0:b[c])||u,x=v.useContext(_);if(x)return x;if(a!==void 0)return a;if(!w)throw new Error(`\`${p}\` must be used within \`${i}\``)}return Ss(h,"useContext"),[d,h]}Ss(r,"createContext");const s=Ss(()=>{const i=n.map(a=>v.createContext(a));return Ss(function(u){const c=(u==null?void 0:u[t])||i;return v.useMemo(()=>({[`__scope${t}`]:{...u,[t]:c}}),[u,c])},"useScope")},"createScope");return s.scopeName=t,[r,aI(s,...e)]}Ss(Pi,"createContextScope");function aI(...t){const e=t[0];if(t.length===1)return e;const n=Ss(()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return Ss(function(i){const a=r.reduce((u,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...u,...p}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Ss(aI,"composeContextScopes");var Lr=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},jH=Object.defineProperty,VH=(t,e)=>jH(t,"name",{value:e,configurable:!0}),$H=If[" useId ".trim().toString()]||(()=>{}),HH=0;function ua(t){const[e,n]=v.useState($H());return Lr(()=>{t||n(r=>r??String(HH++))},[t]),t||(e?`radix-${e}`:"")}VH(ua,"useId");var zH=Object.defineProperty,BH=(t,e)=>zH(t,"name",{value:e,configurable:!0}),p4=If[" useEffectEvent ".trim().toString()],m4=If[" useInsertionEffect ".trim().toString()];function lI(t){if(typeof p4=="function")return p4(t);const e=v.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof m4=="function"?m4(()=>{e.current=t}):Lr(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}BH(lI,"useEffectEvent");var UH=Object.defineProperty,Df=(t,e)=>UH(t,"name",{value:e,configurable:!0}),WH=If[" useInsertionEffect ".trim().toString()]||Lr;function Ea({prop:t,defaultProp:e,onChange:n=Df(()=>{},"onChange"),caller:r}){const[s,i,a]=uI({defaultProp:e,onChange:n}),u=t!==void 0,c=u?t:s,d=v.useCallback(h=>{var p;if(u){const m=cI(h)?h(t):h;m!==t&&((p=a.current)==null||p.call(a,m))}else i(h)},[u,t,i,a]);return[c,d]}Df(Ea,"useControllableState");function uI({defaultProp:t,onChange:e}){const[n,r]=v.useState(t),s=v.useRef(n),i=v.useRef(e);return WH(()=>{i.current=e},[e]),v.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}Df(uI,"useUncontrolledState");function cI(t){return typeof t=="function"}Df(cI,"isFunction");var g4=Symbol("RADIX:SYNC_STATE");function GH(t,e,n,r){const{prop:s,defaultProp:i,onChange:a,caller:u}=e,c=s!==void 0,d=lI(a),h=[{...n,state:i}];r&&h.push(r);const[p,m]=v.useReducer((x,b)=>{if(b.type===g4)return{...x,state:b.state};const P=t(x,b);return c&&!Object.is(P.state,x.state)&&d(P.state),P},...h),y=p.state,w=v.useRef(y);v.useEffect(()=>{w.current!==y&&(w.current=y,c||d(y))},[y,w,c]);const _=v.useMemo(()=>s!==void 0?{...p,state:s}:p,[p,s]);return v.useEffect(()=>{c&&!Object.is(s,p.state)&&m({type:g4,state:s})},[s,p.state,c]),[_,m]}Df(GH,"useControllableStateReducer");var KH=Object.defineProperty,Zs=(t,e)=>KH(t,"name",{value:e,configurable:!0});function va(t){const e=v.forwardRef((n,r)=>{let{children:s,...i}=n,a=null,u=!1;const c=[];D_(s)&&typeof _p=="function"&&(s=_p(s._payload)),v.Children.forEach(s,m=>{var y;if(mI(m)){u=!0;const w=m;let _="child"in w.props?w.props.child:w.props.children;D_(_)&&typeof _p=="function"&&(_=_p(_._payload)),a=qH(w,_),c.push((y=a==null?void 0:a.props)==null?void 0:y.children)}else c.push(m)}),a?a=v.cloneElement(a,void 0,c):!u&&v.Children.count(s)===1&&v.isValidElement(s)&&(a=s);const d=a?pI(a):void 0,h=zt(r,d);if(!a){if(s||s===0)throw new Error(u?XH(t):YH(t));return s}const p=hI(i,a.props??{});return a.type!==v.Fragment&&(p.ref=r?h:d),v.cloneElement(a,p)});return e.displayName=`${t}.Slot`,e}Zs(va,"createSlot");var dI=Symbol.for("radix.slottable");function fI(t){const e=Zs(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=dI,e}Zs(fI,"createSlottable");var qH=Zs((t,e)=>{if("child"in t.props){const n=t.props.child;return v.isValidElement(n)?v.cloneElement(n,void 0,t.props.children(n.props.children)):null}return v.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function hI(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}}Zs(hI,"mergeProps");function pI(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)}Zs(pI,"getElementRef");function mI(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dI}Zs(mI,"isSlottable");var ZH=Symbol.for("react.lazy");function D_(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===ZH&&"_payload"in t&&gI(t._payload)}Zs(D_,"isLazyComponent");function gI(t){return typeof t=="object"&&t!==null&&"then"in t}Zs(gI,"isPromiseLike");var YH=Zs(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),XH=Zs(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),_p=If[" use ".trim().toString()],QH=Object.defineProperty,JH=(t,e)=>QH(t,"name",{value:e,configurable:!0}),ez=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pn=ez.reduce((t,e)=>{const n=va(`Primitive.${e}`),r=v.forwardRef((s,i)=>{const{asChild:a,...u}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(c,{...u,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function vI(t,e){t&&S0.flushSync(()=>t.dispatchEvent(e))}JH(vI,"dispatchDiscreteCustomEvent");var tz=Object.defineProperty,nz=(t,e)=>tz(t,"name",{value:e,configurable:!0});function Dl(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}nz(Dl,"useCallbackRef");var rz=Object.defineProperty,Mn=(t,e)=>rz(t,"name",{value:e,configurable:!0}),N_="dismissableLayer.update",sz="dismissableLayer.pointerDownOutside",iz="dismissableLayer.focusOutside",v4,yI=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tw=v.forwardRef(Mn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:s=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:u,onInteractOutside:c,onDismiss:d,...h}=e,p=v.useContext(yI),[m,y]=v.useState(null),w=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=v.useState({}),x=zt(n,y),b=Array.from(p.layers),[P]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=P?b.indexOf(P):-1,k=m?b.indexOf(m):-1,I=p.layersWithOutsidePointerEventsDisabled.size>0,R=k>=T,L=v.useRef(!1),A=wI(F=>{a==null||a(F),c==null||c(F),F.defaultPrevented||d==null||d()},{ownerDocument:w,deferPointerDownOutside:s,isDeferredPointerDownOutsideRef:L,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(F=>{if(!(F instanceof Node))return!1;const K=[...p.branches].some(Z=>Z.contains(F));return R&&!K},[p.branches,R])}),O=xI(F=>{if(s&&L.current)return;const K=F.target;[...p.branches].some(W=>W.contains(K))||(u==null||u(F),c==null||c(F),F.defaultPrevented||d==null||d())},w),D=m?k===b.length-1:!1,N=Dl(F=>{F.key==="Escape"&&(i==null||i(F),!F.defaultPrevented&&d&&(F.preventDefault(),d()))});return v.useEffect(()=>{if(D)return w.addEventListener("keydown",N,{capture:!0}),()=>w.removeEventListener("keydown",N,{capture:!0})},[w,D,N]),v.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(v4=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),F_(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=v4))}},[m,w,r,p]),v.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),F_())},[m,p]),v.useEffect(()=>{const F=Mn(()=>_({}),"handleUpdate");return document.addEventListener(N_,F),()=>document.removeEventListener(N_,F)},[]),E.jsx(pn.div,{...h,ref:x,style:{pointerEvents:I?R?"auto":"none":void 0,...e.style},onFocusCapture:$t(e.onFocusCapture,O.onFocusCapture),onBlurCapture:$t(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:$t(e.onPointerDownCapture,A.onPointerDownCapture)})},"DismissableLayer"));function _I(){const t=v.useContext(yI),[e,n]=v.useState(null);return v.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}Mn(_I,"useDismissableLayerSurface");var oz=Mn(()=>!0,"IS_TRUE");function wI(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=oz}=e,u=Dl(t),c=v.useRef(!1),d=v.useRef(!1),h=v.useRef(new Map),p=v.useRef(()=>{});return v.useEffect(()=>{function m(){d.current=!1,s.current=!1,h.current.clear()}Mn(m,"resetOutsideInteraction");function y(){return Array.from(h.current.values()).some(Boolean)}Mn(y,"isOutsideInteractionIntercepted");function w(T){if(!d.current)return;const k=T.target;k instanceof Node&&[...i].some(R=>R.contains(k))||h.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}Mn(w,"handleInteractionCapture");function _(T){d.current&&h.current.set(T.type,!1)}Mn(_,"handleInteractionBubble");const x=Mn(T=>{if(T.target&&!c.current){let k=function(){n.removeEventListener("click",p.current);const R=y();m(),R||Iw(sz,u,I,{discrete:!0})};if(Mn(k,"handleAndDispatchPointerDownOutsideEvent"),!a(T.target)){n.removeEventListener("click",p.current),m(),c.current=!1;return}const I={originalEvent:T};d.current=!0,s.current=r&&T.button===0,h.current.clear(),!r||T.button!==0?k():(n.removeEventListener("click",p.current),p.current=k,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();c.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of b)n.addEventListener(T,w,!0),n.addEventListener(T,_);const P=window.setTimeout(()=>{n.addEventListener("pointerdown",x)},0);return()=>{window.clearTimeout(P),n.removeEventListener("pointerdown",x),n.removeEventListener("click",p.current);for(const T of b)n.removeEventListener(T,w,!0),n.removeEventListener(T,_)}},[n,u,r,s,i,a]),{onPointerDownCapture:Mn(()=>c.current=!0,"onPointerDownCapture")}}Mn(wI,"usePointerDownOutside");function xI(t,e=globalThis==null?void 0:globalThis.document){const n=Dl(t),r=v.useRef(!1);return v.useEffect(()=>{const s=Mn(i=>{i.target&&!r.current&&Iw(iz,n,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:Mn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Mn(()=>r.current=!1,"onBlurCapture")}}Mn(xI,"useFocusOutside");function F_(){const t=new CustomEvent(N_);document.dispatchEvent(t)}Mn(F_,"dispatchUpdate");function Iw(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?vI(s,i):s.dispatchEvent(i)}Mn(Iw,"handleAndDispatchCustomEvent");var az=Object.defineProperty,gr=(t,e)=>az(t,"name",{value:e,configurable:!0}),P1="focusScope.autoFocusOnMount",T1="focusScope.autoFocusOnUnmount",y4={bubbles:!1,cancelable:!0},bI=v.forwardRef(gr(function(e,n){const{loop:r=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...u}=e,[c,d]=v.useState(null),h=Dl(i),p=Dl(a),m=v.useRef(null),y=zt(n,d),w=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(s){let x=function(k){if(w.paused||!c)return;const I=k.target;c.contains(I)?m.current=I:Yi(m.current,{select:!0})},b=function(k){if(w.paused||!c)return;const I=k.relatedTarget;I!==null&&(c.contains(I)||Yi(m.current,{select:!0}))},P=function(k){if(document.activeElement===document.body)for(const R of k)R.removedNodes.length>0&&Yi(c)};gr(x,"handleFocusIn"),gr(b,"handleFocusOut"),gr(P,"handleMutations"),document.addEventListener("focusin",x),document.addEventListener("focusout",b);const T=new MutationObserver(P);return c&&T.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",b),T.disconnect()}}},[s,c,w.paused]),v.useEffect(()=>{if(c){_4.add(w);const x=document.activeElement;if(!c.contains(x)){const P=new CustomEvent(P1,y4);c.addEventListener(P1,h),c.dispatchEvent(P),P.defaultPrevented||(SI(TI(Aw(c)),{select:!0}),document.activeElement===x&&Yi(c))}return()=>{c.removeEventListener(P1,h),setTimeout(()=>{const P=new CustomEvent(T1,y4);c.addEventListener(T1,p),c.dispatchEvent(P),P.defaultPrevented||Yi(x??document.body,{select:!0}),c.removeEventListener(T1,p),_4.remove(w)},0)}}},[c,h,p,w]);const _=v.useCallback(x=>{if(!r&&!s||w.paused)return;const b=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,P=document.activeElement;if(b&&P){const T=x.currentTarget,[k,I]=EI(T);k&&I?!x.shiftKey&&P===I?(x.preventDefault(),r&&Yi(k,{select:!0})):x.shiftKey&&P===k&&(x.preventDefault(),r&&Yi(I,{select:!0})):P===T&&x.preventDefault()}},[r,s,w.paused]);return E.jsx(pn.div,{tabIndex:-1,...u,ref:y,onKeyDown:_})},"FocusScope"));function SI(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Yi(r,{select:e}),document.activeElement!==n)return}gr(SI,"focusFirst");function EI(t){const e=Aw(t),n=j_(e,t),r=j_(e.reverse(),t);return[n,r]}gr(EI,"getTabbableEdges");function Aw(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:gr(r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}gr(Aw,"getTabbableCandidates");function j_(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):CI(r,{upTo:e})))return r}gr(j_,"findVisible");function CI(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}gr(CI,"isHidden");function kI(t){return t instanceof HTMLInputElement&&"select"in t}gr(kI,"isSelectableInput");function Yi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&kI(t)&&e&&t.select()}}gr(Yi,"focus");var _4=PI();function PI(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=V_(t,e),t.unshift(e)},remove(e){var n;t=V_(t,e),(n=t[0])==null||n.resume()}}}gr(PI,"createFocusScopesStack");function V_(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}gr(V_,"arrayRemove");function TI(t){return t.filter(e=>e.tagName!=="A")}gr(TI,"removeLinks");var lz=Object.defineProperty,uz=(t,e)=>lz(t,"name",{value:e,configurable:!0}),Rw=v.forwardRef(uz(function(e,n){var c;const{container:r,...s}=e,[i,a]=v.useState(!1);Lr(()=>a(!0),[]);const u=r||i&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return u?S0.createPortal(E.jsx(pn.div,{...s,ref:n}),u):null},"Portal")),cz=Object.defineProperty,po=(t,e)=>cz(t,"name",{value:e,configurable:!0});function II(t,e){return v.useReducer((n,r)=>e[n][r]??n,t)}po(II,"useStateMachine");var Ca=po(t=>{const{present:e,children:n}=t,r=AI(e),s=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=RI(r.ref,MI(s));return typeof n=="function"||r.isPresent?v.cloneElement(s,{ref:i}):null},"Presence");function AI(t){const[e,n]=v.useState(),r=v.useRef(null),s=v.useRef(t),i=v.useRef("none"),a=v.useRef(void 0),u=t?"mounted":"unmounted",[c,d]=II(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{c==="mounted"?(i.current=a.current??Cu(r.current),a.current=void 0):i.current="none"},[c]),Lr(()=>{const h=r.current,p=s.current;if(p!==t){const y=i.current,w=Cu(h);t?(a.current=w,d("MOUNT")):w==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(p&&y!==w?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Lr(()=>{if(e){let h;const p=e.ownerDocument.defaultView??window,m=po(w=>{const x=Cu(r.current).includes(CSS.escape(w.animationName));if(w.target===e&&x&&(d("ANIMATION_END"),!s.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",h=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},"handleAnimationEnd"),y=po(w=>{w.target===e&&(i.current=Cu(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(h),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(h=>{if(h){const p=getComputedStyle(h);r.current=p,a.current=Cu(p)}else r.current=null;n(h)},[])}}po(AI,"usePresence");function $_(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}po($_,"setRef");function RI(...t){const e=v.useRef(t);return e.current=t,v.useCallback(n=>{const r=e.current;let s=!1;const i=r.map(a=>{const u=$_(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():$_(r[a],null)}}},[])}po(RI,"useStableComposedRefs");function Cu(t){return(t==null?void 0:t.animationName)||"none"}po(Cu,"getAnimationName");function MI(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)}po(MI,"getElementRef");var dz=Object.defineProperty,Mw=(t,e)=>dz(t,"name",{value:e,configurable:!0}),wp=0,oi=null;function fz(t){return E0(),t.children}Mw(fz,"FocusGuards");function E0(){v.useEffect(()=>{oi||(oi={start:H_(),end:H_()});const{start:t,end:e}=oi;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),wp++,()=>{wp===1&&(oi==null||oi.start.remove(),oi==null||oi.end.remove(),oi=null),wp=Math.max(0,wp-1)}},[])}Mw(E0,"useFocusGuards");function H_(){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}Mw(H_,"createFocusGuard");var vi=function(){return vi=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},vi.apply(this,arguments)};function OI(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 hz(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 Zp="right-scroll-bar-position",Yp="width-before-scroll-bar",pz="with-scroll-bars-hidden",mz="--removed-body-scroll-bar-size";function I1(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function gz(t,e){var n=v.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 vz=typeof window<"u"?v.useLayoutEffect:v.useEffect,w4=new WeakMap;function yz(t,e){var n=gz(null,function(r){return t.forEach(function(s){return I1(s,r)})});return vz(function(){var r=w4.get(n);if(r){var s=new Set(r),i=new Set(t),a=n.current;s.forEach(function(u){i.has(u)||I1(u,null)}),i.forEach(function(u){s.has(u)||I1(u,a)})}w4.set(n,t)},[t]),n}function _z(t){return t}function wz(t,e){e===void 0&&(e=_z);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)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return s}function xz(t){t===void 0&&(t={});var e=wz(null);return e.options=vi({async:!0,ssr:!1},t),e}var LI=function(t){var e=t.sideCar,n=OI(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 v.createElement(r,vi({},n))};LI.isSideCarExport=!0;function bz(t,e){return t.useMedium(e),LI}var DI=xz(),A1=function(){},C0=v.forwardRef(function(t,e){var n=v.useRef(null),r=v.useState({onScrollCapture:A1,onWheelCapture:A1,onTouchMoveCapture:A1}),s=r[0],i=r[1],a=t.forwardProps,u=t.children,c=t.className,d=t.removeScrollBar,h=t.enabled,p=t.shards,m=t.sideCar,y=t.noRelative,w=t.noIsolation,_=t.inert,x=t.allowPinchZoom,b=t.as,P=b===void 0?"div":b,T=t.gapMode,k=OI(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=m,R=yz([n,e]),L=vi(vi({},k),s);return v.createElement(v.Fragment,null,h&&v.createElement(I,{sideCar:DI,removeScrollBar:d,shards:p,noRelative:y,noIsolation:w,inert:_,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:T}),a?v.cloneElement(v.Children.only(u),vi(vi({},L),{ref:R})):v.createElement(P,vi({},L,{className:c,ref:R}),u))});C0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};C0.classNames={fullWidth:Yp,zeroRight:Zp};var Sz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ez(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Sz();return e&&t.setAttribute("nonce",e),t}function Cz(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function kz(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Pz=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Ez())&&(Cz(e,n),kz(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Tz=function(){var t=Pz();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},NI=function(){var t=Tz(),e=function(n){var r=n.styles,s=n.dynamic;return t(r,s),null};return e},Iz={left:0,top:0,right:0,gap:0},R1=function(t){return parseInt(t||"",10)||0},Az=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[R1(n),R1(r),R1(s)]},Rz=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Iz;var e=Az(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])}},Mz=NI(),ju="data-scroll-locked",Oz=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,u=t.gap;return n===void 0&&(n="margin"),`
72
+ .`.concat(pz,` {
73
+ overflow: hidden `).concat(r,`;
74
+ padding-right: `).concat(u,"px ").concat(r,`;
75
+ }
76
+ body[`).concat(ju,`] {
77
+ overflow: hidden `).concat(r,`;
78
+ overscroll-behavior: contain;
79
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
80
+ padding-left: `.concat(s,`px;
81
+ padding-top: `).concat(i,`px;
82
+ padding-right: `).concat(a,`px;
83
+ margin-left:0;
84
+ margin-top:0;
85
+ margin-right: `).concat(u,"px ").concat(r,`;
86
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
87
+ }
88
+
89
+ .`).concat(Zp,` {
90
+ right: `).concat(u,"px ").concat(r,`;
91
+ }
92
+
93
+ .`).concat(Yp,` {
94
+ margin-right: `).concat(u,"px ").concat(r,`;
95
+ }
96
+
97
+ .`).concat(Zp," .").concat(Zp,` {
98
+ right: 0 `).concat(r,`;
99
+ }
100
+
101
+ .`).concat(Yp," .").concat(Yp,` {
102
+ margin-right: 0 `).concat(r,`;
103
+ }
104
+
105
+ body[`).concat(ju,`] {
106
+ `).concat(mz,": ").concat(u,`px;
107
+ }
108
+ `)},x4=function(){var t=parseInt(document.body.getAttribute(ju)||"0",10);return isFinite(t)?t:0},Lz=function(){v.useEffect(function(){return document.body.setAttribute(ju,(x4()+1).toString()),function(){var t=x4()-1;t<=0?document.body.removeAttribute(ju):document.body.setAttribute(ju,t.toString())}},[])},Dz=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;Lz();var i=v.useMemo(function(){return Rz(s)},[s]);return v.createElement(Mz,{styles:Oz(i,!e,s,n?"":"!important")})},z_=!1;if(typeof window<"u")try{var xp=Object.defineProperty({},"passive",{get:function(){return z_=!0,!0}});window.addEventListener("test",xp,xp),window.removeEventListener("test",xp,xp)}catch{z_=!1}var gu=z_?{passive:!1}:!1,Nz=function(t){return t.tagName==="TEXTAREA"},FI=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Nz(t)&&n[e]==="visible")},Fz=function(t){return FI(t,"overflowY")},jz=function(t){return FI(t,"overflowX")},b4=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=jI(t,r);if(s){var i=VI(t,r),a=i[1],u=i[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Vz=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},$z=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},jI=function(t,e){return t==="v"?Fz(e):jz(e)},VI=function(t,e){return t==="v"?Vz(e):$z(e)},Hz=function(t,e){return t==="h"&&e==="rtl"?-1:1},zz=function(t,e,n,r,s){var i=Hz(t,window.getComputedStyle(e).direction),a=i*r,u=n.target,c=e.contains(u),d=!1,h=a>0,p=0,m=0;do{if(!u)break;var y=VI(t,u),w=y[0],_=y[1],x=y[2],b=_-x-i*w;(w||b)&&jI(t,u)&&(p+=b,m+=w);var P=u.parentNode;u=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!c&&u!==document.body||c&&(e.contains(u)||e===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(d=!0),d},bp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},S4=function(t){return[t.deltaX,t.deltaY]},E4=function(t){return t&&"current"in t?t.current:t},Bz=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Uz=function(t){return`
109
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
110
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
111
+ `)},Wz=0,vu=[];function Gz(t){var e=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),s=v.useState(Wz++)[0],i=v.useState(NI)[0],a=v.useRef(t);v.useEffect(function(){a.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var _=hz([t.lockRef.current],(t.shards||[]).map(E4),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var u=v.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var b=bp(_),P=n.current,T="deltaX"in _?_.deltaX:P[0]-b[0],k="deltaY"in _?_.deltaY:P[1]-b[1],I,R=_.target,L=Math.abs(T)>Math.abs(k)?"h":"v";if("touches"in _&&L==="h"&&R.type==="range")return!1;var A=window.getSelection(),O=A&&A.anchorNode,D=O?O===R||O.contains(R):!1;if(D)return!1;var N=b4(L,R);if(!N)return!0;if(N?I=L:(I=L==="v"?"h":"v",N=b4(L,R)),!N)return!1;if(!r.current&&"changedTouches"in _&&(T||k)&&(r.current=I),!I)return!0;var F=r.current||I;return zz(F,x,_,F==="h"?T:k)},[]),c=v.useCallback(function(_){var x=_;if(!(!vu.length||vu[vu.length-1]!==i)){var b="deltaY"in x?S4(x):bp(x),P=e.current.filter(function(I){return I.name===x.type&&(I.target===x.target||x.target===I.shadowParent)&&Bz(I.delta,b)})[0];if(P&&P.should){x.cancelable&&x.preventDefault();return}if(!P){var T=(a.current.shards||[]).map(E4).filter(Boolean).filter(function(I){return I.contains(x.target)}),k=T.length>0?u(x,T[0]):!a.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),d=v.useCallback(function(_,x,b,P){var T={name:_,delta:x,target:b,should:P,shadowParent:Kz(b)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(k){return k!==T})},1)},[]),h=v.useCallback(function(_){n.current=bp(_),r.current=void 0},[]),p=v.useCallback(function(_){d(_.type,S4(_),_.target,u(_,t.lockRef.current))},[]),m=v.useCallback(function(_){d(_.type,bp(_),_.target,u(_,t.lockRef.current))},[]);v.useEffect(function(){return vu.push(i),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",c,gu),document.addEventListener("touchmove",c,gu),document.addEventListener("touchstart",h,gu),function(){vu=vu.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,gu),document.removeEventListener("touchmove",c,gu),document.removeEventListener("touchstart",h,gu)}},[]);var y=t.removeScrollBar,w=t.inert;return v.createElement(v.Fragment,null,w?v.createElement(i,{styles:Uz(s)}):null,y?v.createElement(Dz,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Kz(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const qz=bz(DI,Gz);var Ow=v.forwardRef(function(t,e){return v.createElement(C0,vi({},t,{ref:e,sideCar:qz}))});Ow.classNames=C0.classNames;var Zz=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},yu=new WeakMap,Sp=new WeakMap,Ep={},M1=0,$I=function(t){return t&&(t.host||$I(t.parentNode))},Yz=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=$I(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})},Xz=function(t,e,n,r){var s=Yz(e,Array.isArray(t)?t:[t]);Ep[n]||(Ep[n]=new WeakMap);var i=Ep[n],a=[],u=new Set,c=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var y=m.getAttribute(r),w=y!==null&&y!=="false",_=(yu.get(m)||0)+1,x=(i.get(m)||0)+1;yu.set(m,_),i.set(m,x),a.push(m),_===1&&w&&Sp.set(m,!0),x===1&&m.setAttribute(n,"true"),w||m.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return h(e),u.clear(),M1++,function(){a.forEach(function(p){var m=yu.get(p)-1,y=i.get(p)-1;yu.set(p,m),i.set(p,y),m||(Sp.has(p)||p.removeAttribute(r),Sp.delete(p)),y||p.removeAttribute(n)}),M1--,M1||(yu=new WeakMap,yu=new WeakMap,Sp=new WeakMap,Ep={})}},HI=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=Zz(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Xz(r,s,n,"aria-hidden")):function(){return null}},Qz=Object.defineProperty,Ys=(t,e)=>Qz(t,"name",{value:e,configurable:!0}),Lw="Dialog",[zI,_ee]=Pi(Lw),[Jz,_o]=zI(Lw),Dw=Ys(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=v.useRef(null),c=v.useRef(null),[d,h]=Ea({prop:r,defaultProp:s??!1,onChange:i,caller:Lw}),[p,m]=v.useState(0),[y,w]=v.useState(0);return E.jsx(Jz,{scope:e,triggerRef:u,contentRef:c,contentId:ua(),titleId:ua(),descriptionId:ua(),titlePresent:p>0,descriptionPresent:y>0,setTitleCount:m,setDescriptionCount:w,open:d,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(_=>!_),[h]),modal:a,children:n})},"Dialog"),BI="DialogPortal",[eB,UI]=zI(BI,{forceMount:void 0}),Nw=Ys(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=_o(BI,e);return E.jsx(eB,{scope:e,forceMount:n,children:v.Children.map(r,a=>E.jsx(Ca,{present:n||i.open,children:E.jsx(Rw,{asChild:!0,container:s,children:a})}))})},"DialogPortal"),B_="DialogOverlay",Fw=v.forwardRef(Ys(function(e,n){const r=UI(B_,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=_o(B_,e.__scopeDialog);return a.modal?E.jsx(Ca,{present:s||a.open,children:E.jsx(nB,{...i,ref:n})}):null},"DialogOverlay")),tB=va("DialogOverlay.RemoveScroll"),nB=v.forwardRef(Ys(function(e,n){const{__scopeDialog:r,...s}=e,i=_o(B_,r),a=_I(),u=zt(n,a);return E.jsx(Ow,{as:tB,allowPinchZoom:!0,shards:[i.contentRef],children:E.jsx(pn.div,{"data-state":Hw(i.open),...s,ref:u,style:{pointerEvents:"auto",...s.style}})})},"DialogOverlayImpl")),rf="DialogContent",jw=v.forwardRef(Ys(function(e,n){const r=UI(rf,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,a=_o(rf,e.__scopeDialog);return E.jsx(Ca,{present:s||a.open,children:a.modal?E.jsx(rB,{...i,ref:n}):E.jsx(sB,{...i,ref:n})})},"DialogContent")),rB=v.forwardRef(Ys(function(e,n){const r=_o(rf,e.__scopeDialog),s=v.useRef(null),i=zt(n,r.contentRef,s);return v.useEffect(()=>{const a=s.current;if(a)return HI(a)},[]),E.jsx(WI,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:$t(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:$t(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&a.preventDefault()}),onFocusOutside:$t(e.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),sB=v.forwardRef(Ys(function(e,n){const r=_o(rf,e.__scopeDialog),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(WI,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"DialogContentNonModal")),WI=v.forwardRef(Ys(function(e,n){const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,...u}=e,c=_o(rf,r);return E0(),E.jsx(E.Fragment,{children:E.jsx(bI,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(Tw,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Hw(c.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),iB="DialogTitle",Vw=v.forwardRef(Ys(function(e,n){const{__scopeDialog:r,...s}=e,i=_o(iB,r),{setTitleCount:a}=i;return Lr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),E.jsx(pn.h2,{id:i.titleId,...s,ref:n})},"DialogTitle")),oB="DialogDescription",$w=v.forwardRef(Ys(function(e,n){const{__scopeDialog:r,...s}=e,i=_o(oB,r),{setDescriptionCount:a}=i;return Lr(()=>(a(u=>u+1),()=>a(u=>u-1)),[a]),E.jsx(pn.p,{id:i.descriptionId,...s,ref:n})},"DialogDescription"));function Hw(t){return t?"open":"closed"}Ys(Hw,"getState");const aB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M112,56V200L40,128Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),lB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),uB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),cB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M208,96l-80,80L48,96Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),dB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),fB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),hB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),pB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),mB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),gB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),vB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M88,48V208H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),yB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),_B=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),wB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),xB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),bB=new Map([["bold",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}),v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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",v.createElement(v.Fragment,null,v.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"}))]]),SB=v.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),qn=v.forwardRef((t,e)=>{const{alt:n,color:r,size:s,weight:i,mirrored:a,children:u,weights:c,...d}=t,{color:h="currentColor",size:p,weight:m="regular",mirrored:y=!1,...w}=v.useContext(SB);return v.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,...w,...d},!!n&&v.createElement("title",null,n),u,c.get(i??m))});qn.displayName="IconBase";const GI=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:aB}));GI.displayName="ArrowLeftIcon";const EB=GI,KI=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:lB}));KI.displayName="ArrowSquareOutIcon";const CB=KI,qI=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:uB}));qI.displayName="ArrowUpIcon";const kB=qI,ZI=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:cB}));ZI.displayName="CaretDownIcon";const PB=ZI,YI=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:dB}));YI.displayName="ChatCircleIcon";const TB=YI,XI=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:fB}));XI.displayName="CheckIcon";const QI=XI,JI=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:hB}));JI.displayName="CircleNotchIcon";const k0=JI,e5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:pB}));e5.displayName="CopyIcon";const sf=e5,t5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:mB}));t5.displayName="MagnifyingGlassIcon";const IB=t5,n5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:gB}));n5.displayName="PencilSimpleIcon";const AB=n5,r5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:vB}));r5.displayName="SidebarSimpleIcon";const RB=r5,s5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:yB}));s5.displayName="SignOutIcon";const MB=s5,i5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:_B}));i5.displayName="SparkleIcon";const O1=i5,o5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:wB}));o5.displayName="SwatchesIcon";const a5=o5,l5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:xB}));l5.displayName="TrashIcon";const OB=l5,u5=v.forwardRef((t,e)=>v.createElement(qn,{ref:e,...t,weights:bB}));u5.displayName="XIcon";const c5=u5;function d5(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=d5(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function LB(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=d5(t))&&(r&&(r+=" "),r+=e);return r}const DB=(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},NB=(t,e)=>({classGroupId:t,validator:e}),f5=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),qm="-",C4=[],FB="arbitrary..",jB=t=>{const e=$B(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return VB(a);const u=a.split(qm),c=u[0]===""&&u.length>1?1:0;return h5(u,c,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const c=r[a],d=n[a];return c?d?DB(d,c):c:d||C4}return n[a]||C4}}},h5=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const d=h5(t,e+1,i);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(qm):t.slice(e).join(qm),c=a.length;for(let d=0;d<c;d++){const h=a[d];if(h.validator(u))return h.classGroupId}},VB=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?FB+r:void 0})(),$B=t=>{const{theme:e,classGroups:n}=t;return HB(n,e)},HB=(t,e)=>{const n=f5();for(const r in t){const s=t[r];zw(s,n,r,e)}return n},zw=(t,e,n,r)=>{const s=t.length;for(let i=0;i<s;i++){const a=t[i];zB(a,e,n,r)}},zB=(t,e,n,r)=>{if(typeof t=="string"){BB(t,e,n);return}if(typeof t=="function"){UB(t,e,n,r);return}WB(t,e,n,r)},BB=(t,e,n)=>{const r=t===""?e:p5(e,t);r.classGroupId=n},UB=(t,e,n,r)=>{if(GB(t)){zw(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(NB(n,t))},WB=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a<i;a++){const[u,c]=s[a];zw(c,p5(e,u),n,r)}},p5=(t,e)=>{let n=t;const r=e.split(qm),s=r.length;for(let i=0;i<s;i++){const a=r[i];let u=n.nextPart.get(a);u||(u=f5(),n.nextPart.set(a,u)),n=u}return n},GB=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,KB=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)}}},U_="!",k4=":",qB=[],P4=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),ZB=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,u=0,c=0,d;const h=s.length;for(let _=0;_<h;_++){const x=s[_];if(a===0&&u===0){if(x===k4){i.push(s.slice(c,_)),c=_+1;continue}if(x==="/"){d=_;continue}}x==="["?a++:x==="]"?a--:x==="("?u++:x===")"&&u--}const p=i.length===0?s:s.slice(c);let m=p,y=!1;p.endsWith(U_)?(m=p.slice(0,-1),y=!0):p.startsWith(U_)&&(m=p.slice(1),y=!0);const w=d&&d>c?d-c:void 0;return P4(i,y,m,w)};if(e){const s=e+k4,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):P4(qB,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},YB=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}},XB=t=>({cache:KB(t.cacheSize),parseClassName:ZB(t),sortModifiers:YB(t),postfixLookupClassGroupIds:QB(t),...jB(t)}),QB=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},JB=/\s+/,eU=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=e,u=[],c=t.trim().split(JB);let d="";for(let h=c.length-1;h>=0;h-=1){const p=c[h],{isExternal:m,modifiers:y,hasImportantModifier:w,baseClassName:_,maybePostfixModifierPosition:x}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let b=!!x,P;if(b){const L=_.substring(0,x);P=r(L);const A=P&&a[P]?r(_):void 0;A&&A!==P&&(P=A,b=!1)}else P=r(_);if(!P){if(!b){d=p+(d.length>0?" "+d:d);continue}if(P=r(_),!P){d=p+(d.length>0?" "+d:d);continue}b=!1}const T=y.length===0?"":y.length===1?y[0]:i(y).join(":"),k=w?T+U_:T,I=k+P;if(u.indexOf(I)>-1)continue;u.push(I);const R=s(P,b);for(let L=0;L<R.length;++L){const A=R[L];u.push(k+A)}d=p+(d.length>0?" "+d:d)}return d},tU=(...t)=>{let e=0,n,r,s="";for(;e<t.length;)(n=t[e++])&&(r=m5(n))&&(s&&(s+=" "),s+=r);return s},m5=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=m5(t[r]))&&(n&&(n+=" "),n+=e);return n},nU=(t,...e)=>{let n,r,s,i;const a=c=>{const d=e.reduce((h,p)=>p(h),t());return n=XB(d),r=n.cache.get,s=n.cache.set,i=u,u(c)},u=c=>{const d=r(c);if(d)return d;const h=eU(c,n);return s(c,h),h};return i=a,(...c)=>i(tU(...c))},rU=[],kn=t=>{const e=n=>n[t]||rU;return e.isThemeGetter=!0,e},g5=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,v5=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sU=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,iU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oU=/\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$/,aU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ko=t=>sU.test(t),ot=t=>!!t&&!Number.isNaN(Number(t)),ai=t=>!!t&&Number.isInteger(Number(t)),L1=t=>t.endsWith("%")&&ot(t.slice(0,-1)),zi=t=>iU.test(t),y5=()=>!0,cU=t=>oU.test(t)&&!aU.test(t),Bw=()=>!1,dU=t=>lU.test(t),fU=t=>uU.test(t),hU=t=>!Ae(t)&&!Me(t),pU=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)),mU=t=>ka(t,x5,Bw),Ae=t=>g5.test(t),Ya=t=>ka(t,b5,cU),T4=t=>ka(t,SU,ot),gU=t=>ka(t,E5,y5),vU=t=>ka(t,S5,Bw),I4=t=>ka(t,_5,Bw),yU=t=>ka(t,w5,fU),Cp=t=>ka(t,C5,dU),Me=t=>v5.test(t),yd=t=>jl(t,b5),_U=t=>jl(t,S5),A4=t=>jl(t,_5),wU=t=>jl(t,x5),xU=t=>jl(t,w5),kp=t=>jl(t,C5,!0),bU=t=>jl(t,E5,!0),ka=(t,e,n)=>{const r=g5.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},jl=(t,e,n=!1)=>{const r=v5.exec(t);return r?r[1]?e(r[1]):n:!1},_5=t=>t==="position"||t==="percentage",w5=t=>t==="image"||t==="url",x5=t=>t==="length"||t==="size"||t==="bg-size",b5=t=>t==="length",SU=t=>t==="number",S5=t=>t==="family-name",E5=t=>t==="number"||t==="weight",C5=t=>t==="shadow",EU=()=>{const t=kn("color"),e=kn("font"),n=kn("text"),r=kn("font-weight"),s=kn("tracking"),i=kn("leading"),a=kn("breakpoint"),u=kn("container"),c=kn("spacing"),d=kn("radius"),h=kn("shadow"),p=kn("inset-shadow"),m=kn("text-shadow"),y=kn("drop-shadow"),w=kn("blur"),_=kn("perspective"),x=kn("aspect"),b=kn("ease"),P=kn("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...k(),Me,Ae],R=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],A=()=>[Me,Ae,c],O=()=>[Ko,"full","auto",...A()],D=()=>[ai,"none","subgrid",Me,Ae],N=()=>["auto",{span:["full",ai,Me,Ae]},ai,Me,Ae],F=()=>[ai,"auto",Me,Ae],K=()=>["auto","min","max","fr",Me,Ae],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...A()],Y=()=>[Ko,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[Ko,"screen","full","dvw","lvw","svw","min","max","fit",...A()],J=()=>[Ko,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],H=()=>[t,Me,Ae],j=()=>[...k(),A4,I4,{position:[Me,Ae]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],oe=()=>["auto","cover","contain",wU,mU,{size:[Me,Ae]}],se=()=>[L1,yd,Ya],ee=()=>["","none","full",d,Me,Ae],ce=()=>["",ot,yd,Ya],we=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[ot,L1,A4,I4],Ne=()=>["","none",w,Me,Ae],Ue=()=>["none",ot,Me,Ae],Pe=()=>["none",ot,Me,Ae],Ve=()=>[ot,Me,Ae],ht=()=>[Ko,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zi],breakpoint:[zi],color:[y5],container:[zi],"drop-shadow":[zi],ease:["in","out","in-out"],font:[hU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zi],shadow:[zi],spacing:["px",ot],text:[zi],"text-shadow":[zi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ko,Ae,Me,x]}],container:["container"],"container-type":[{"@container":["","normal","size",Me,Ae]}],"container-named":[pU],columns:[{columns:[ot,Ae,Me,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:I()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[ai,"auto",Me,Ae]}],basis:[{basis:[Ko,"full","auto",u,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ot,Ko,"auto","initial","none",Ae]}],grow:[{grow:["",ot,Me,Ae]}],shrink:[{shrink:["",ot,Me,Ae]}],order:[{order:[ai,"first","last","none",Me,Ae]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[u,"screen",...Y()]}],"min-w":[{"min-w":[u,"screen","none",...Y()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,yd,Ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,bU,gU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",L1,Ae]}],"font-family":[{font:[_U,vU,e]}],"font-features":[{"font-features":[Ae]}],"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,Me,Ae]}],"line-clamp":[{"line-clamp":[ot,"none",Me,T4]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",Me,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,Ae]}],"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:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[ot,"from-font","auto",Me,Ya]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[ot,"auto",Me,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[ai,Me,Ae]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,Ae]}],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",Me,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:oe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ai,Me,Ae],radial:["",Me,Ae],conic:[ai,Me,Ae]},xU,yU]}],"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:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"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:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ot,Me,Ae]}],"outline-w":[{outline:["",ot,yd,Ya]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",h,kp,Cp]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,kp,Cp]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[ot,Ya]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",m,kp,Cp]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[ot,Me,Ae]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[ot]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"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":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"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":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"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":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"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":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"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":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"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":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Me,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[ot]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"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:j()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:oe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,Ae]}],filter:[{filter:["","none",Me,Ae]}],blur:[{blur:Ne()}],brightness:[{brightness:[ot,Me,Ae]}],contrast:[{contrast:[ot,Me,Ae]}],"drop-shadow":[{"drop-shadow":["","none",y,kp,Cp]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",ot,Me,Ae]}],"hue-rotate":[{"hue-rotate":[ot,Me,Ae]}],invert:[{invert:["",ot,Me,Ae]}],saturate:[{saturate:[ot,Me,Ae]}],sepia:[{sepia:["",ot,Me,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,Ae]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[ot,Me,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[ot,Me,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ot,Me,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ot,Me,Ae]}],"backdrop-invert":[{"backdrop-invert":["",ot,Me,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[ot,Me,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[ot,Me,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",ot,Me,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ot,"initial",Me,Ae]}],ease:[{ease:["linear","initial",b,Me,Ae]}],delay:[{delay:[ot,Me,Ae]}],animate:[{animate:["none",P,Me,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Me,Ae]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:Ue()}],"rotate-x":[{"rotate-x":Ue()}],"rotate-y":[{"rotate-y":Ue()}],"rotate-z":[{"rotate-z":Ue()}],scale:[{scale:Pe()}],"scale-x":[{"scale-x":Pe()}],"scale-y":[{"scale-y":Pe()}],"scale-z":[{"scale-z":Pe()}],"scale-3d":["scale-3d"],skew:[{skew:Ve()}],"skew-x":[{"skew-x":Ve()}],"skew-y":[{"skew-y":Ve()}],transform:[{transform:[Me,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ht()}],"translate-x":[{"translate-x":ht()}],"translate-y":[{"translate-y":ht()}],"translate-z":[{"translate-z":ht()}],"translate-none":["translate-none"],zoom:[{zoom:[ai,Me,Ae]}],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",Me,Ae]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Me,Ae]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[ot,yd,Ya,T4]}],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"]}},CU=nU(EU);function vr(...t){return CU(LB(t))}const of={fast:{type:"spring",duration:.08,bounce:0},moderate:{type:"spring",duration:.16,bounce:.15}},R4=["#f59e0b","#38bdf8","#34d399","#a78bfa","#fb7185","#22d3ee","#fb923c","#a3e635","#e879f9","#2dd4bf"];function k5(t){let e=0;for(let r=0;r<t.length;r++)e=e*31+t.charCodeAt(r)|0;const n=R4[Math.abs(e)%R4.length];return{color:n,backgroundColor:`${n}22`}}function P5(t,e={}){const{axis:n="y"}=e,r=v.useRef(new Map),[s,i]=v.useState(null),[a,u]=v.useState([]),c=v.useRef([]),d=v.useRef(0),h=v.useRef(null),p=v.useRef(null),m=v.useCallback(()=>{if(!t.current)return;const P=[];r.current.forEach((T,k)=>{P[k]={top:T.offsetTop,height:T.offsetHeight,left:T.offsetLeft,width:T.offsetWidth}}),c.current=P,u(P)},[t]),y=v.useCallback((b,P)=>{P?r.current.set(b,P):r.current.delete(b),p.current!==null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{p.current=null,m()})},[m]),w=v.useCallback(b=>{const P=b.clientX,T=b.clientY;h.current!==null&&cancelAnimationFrame(h.current),h.current=requestAnimationFrame(()=>{h.current=null;const k=t.current;if(!k)return;const I=k.getBoundingClientRect(),R=n==="x"?P:T;let L=null,A=1/0,O=null;const D=c.current,N=n==="x"?k.scrollLeft:k.scrollTop,F=n==="x"?k.clientLeft:k.clientTop,K=n==="x"?I.left:I.top,Z=n==="x"?k.offsetWidth:k.offsetHeight,W=n==="x"?I.width:I.height,G=Z>0?W/Z:1;for(let Y=0;Y<D.length;Y++){const $=D[Y];if(!$)continue;const J=n==="x"?$.left:$.top,H=K+(F+J-N)*G,j=(n==="x"?$.width:$.height)*G,X=H+j;R>=H&&R<=X&&(O=Y);const oe=H+j/2,se=Math.abs(R-oe);se<A&&(A=se,L=Y)}i(O??L)})},[n,t]),_=v.useCallback(()=>{d.current+=1,m()},[m]),x=v.useCallback(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),i(null)},[]);return v.useEffect(()=>()=>{h.current!==null&&cancelAnimationFrame(h.current),p.current!==null&&cancelAnimationFrame(p.current)},[]),{activeIndex:s,setActiveIndex:i,itemRects:a,sessionRef:d,handlers:{onMouseMove:w,onMouseEnter:_,onMouseLeave:x},registerItem:y,measureItems:m}}function kU(t,e,n){v.useEffect(()=>(t(e,n.current),()=>t(e,null)),[e,t,n])}const T5=(t,e)=>`style:${t}:${e}`,I5=t=>`text:${t}`,A5=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"]},R5=t=>A5(t)[0],Pp=(t,e)=>A5(t).includes(e),PU=t=>{const e=R5(t.elementId),n=t.batchId?`:${t.batchId}`:"";return t.type==="style"?`${T5(e,t.property)}${n}`:`${I5(e)}${n}`},zn=[];for(let t=0;t<256;++t)zn.push((t+256).toString(16).slice(1));function TU(t,e=0){return(zn[t[e+0]]+zn[t[e+1]]+zn[t[e+2]]+zn[t[e+3]]+"-"+zn[t[e+4]]+zn[t[e+5]]+"-"+zn[t[e+6]]+zn[t[e+7]]+"-"+zn[t[e+8]]+zn[t[e+9]]+"-"+zn[t[e+10]]+zn[t[e+11]]+zn[t[e+12]]+zn[t[e+13]]+zn[t[e+14]]+zn[t[e+15]]).toLowerCase()}const IU=new Uint8Array(16);function AU(){return crypto.getRandomValues(IU)}function M4(t,e,n){return crypto.randomUUID?crypto.randomUUID():RU(t)}function RU(t,e,n){var s;t=t||{};const r=t.random??((s=t.rng)==null?void 0:s.call(t))??AU();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,TU(r)}const MU=300;class OU{constructor(){Uo(this,"history",{current:new Map,past:[],future:[]});Uo(this,"pendingChanges",new Map);Uo(this,"currentBatchId",null);Uo(this,"debounceTimer",null);Uo(this,"onChangeCallbacks",[]);Uo(this,"stateBeforePending",null);Uo(this,"transactionDepth",0)}recordChange(e){this.pendingChanges.size===0&&(this.currentBatchId=M4(),this.stateBeforePending=new Map(this.history.current)),this.currentBatchId&&(e.batchId=this.currentBatchId);const n=R5(e.elementId),r=e.type==="style"?T5(n,e.property):I5(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=PU(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"&&Pp(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"&&Pp(r.elementId,e)).sort((r,s)=>s.timestamp-r.timestamp)[0]}hasChanges(e){return Array.from(this.history.current.values()).some(n=>Pp(n.elementId,e))}getChangesForElement(e){return Array.from(this.history.current.values()).filter(n=>Pp(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=M4(),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 Zm={kind:"base"};function af(t){return t.kind==="base"?"base":`variant:${t.sessionId}:${t.variantId}`}function LU(t,e){return t.kind==="base"&&e.kind,t.kind==="variant"&&e.kind==="variant"?t.sessionId===e.sessionId&&t.variantId===e.variantId:!1}const DU={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}},M5=Object.fromEntries(Object.entries(DU).map(([t,e])=>[t,{isEnabled:e.default}]));it("view");const O5=it(!0),L5=it(null),NU=it("chat"),D5=it(0),N5=it({name:null,email:null}),O4=it(Zm);it(null);const lf=new Map,FU=t=>{const e=af(t);let n=lf.get(e);return n||(n=new OU,lf.set(e,n)),n};it(t=>FU(t(O4)),(t,e,n)=>{lf.set(af(t(O4)),n)});const jU=t=>{for(const e of[...lf.keys()])e==="base"||t.has(e)||lf.delete(e)},uf=it(new Map),L4=it(null);it(null);const W_=it(0),Ym=it(null),G_=it(!1),K_=it(null),F5=it(!1),j5=it(!1),q_=it(null),Z_=it(null),cf=it(null),Uw=it(null),mo=it(null),Nf=it({active:!1}),V5=it([]),D4=it(null),VU=(t,e,n)=>{let r=!1;const s=new Map(t);for(const[i,a]of t)a.target&&LU(a.target,e)&&(s.set(i,{...a,target:n}),r=!0);return r?s:t},$U=it(null,(t,e,n)=>{const r=c=>{const d=c??Zm;return d.kind==="variant"&&!n.has(af(d))},s=t(uf);let i=null;for(const[c,d]of s)r(d.target)&&(i??(i=new Set)).add(c);if(i){const c=new Map(s);for(const d of i)c.delete(d);e(uf,c)}const a=t(L4);a&&r(a.target)&&(e(L4,null),e(UU,!1));const u=t(D4);u&&(i!=null&&i.has(u.commentId))&&e(D4,null),jU(n)}),Y_=it(M5),HU=it(!1),$5=it(null),Ff=it(!0),H5=it(!1),z5=it(!1),B5=it(null),zU=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},P0=it(zU()),BU=it(null),UU=it(!1);it(0);it(0);var Xp={exports:{}},WU=Xp.exports,N4;function GU(){return N4||(N4=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(WU,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(_,x){var b=_[x];if(typeof b.bind=="function")return b.bind(_);try{return Function.prototype.bind.call(b,_)}catch{return function(){return Function.prototype.apply.apply(b,[_,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(_){return _==="debug"&&(_="log"),typeof console===n?!1:_==="trace"&&r?c:console[_]!==void 0?u(console,_):console.log!==void 0?u(console,"log"):e}function h(){for(var _=this.getLevel(),x=0;x<s.length;x++){var b=s[x];this[b]=x<_?e:this.methodFactory(b,_,this.name)}if(this.log=this.debug,typeof console===n&&_<this.levels.SILENT)return"No console available for logging"}function p(_){return function(){typeof console!==n&&(h.call(this),this[_].apply(this,arguments))}}function m(_,x,b){return d(_)||p.apply(this,arguments)}function y(_,x){var b=this,P,T,k,I="loglevel";typeof _=="string"?I+=":"+_:typeof _=="symbol"&&(I=void 0);function R(N){var F=(s[N]||"silent").toUpperCase();if(!(typeof window===n||!I)){try{window.localStorage[I]=F;return}catch{}try{window.document.cookie=encodeURIComponent(I)+"="+F+";"}catch{}}}function L(){var N;if(!(typeof window===n||!I)){try{N=window.localStorage[I]}catch{}if(typeof N===n)try{var F=window.document.cookie,K=encodeURIComponent(I),Z=F.indexOf(K+"=");Z!==-1&&(N=/^([^;]+)/.exec(F.slice(Z+K.length+1))[1])}catch{}return b.levels[N]===void 0&&(N=void 0),N}}function A(){if(!(typeof window===n||!I)){try{window.localStorage.removeItem(I)}catch{}try{window.document.cookie=encodeURIComponent(I)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function O(N){var F=N;if(typeof F=="string"&&b.levels[F.toUpperCase()]!==void 0&&(F=b.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=b.levels.SILENT)return F;throw new TypeError("log.setLevel() called with invalid level: "+N)}b.name=_,b.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},b.methodFactory=x||m,b.getLevel=function(){return k??T??P},b.setLevel=function(N,F){return k=O(N),F!==!1&&R(k),h.call(b)},b.setDefaultLevel=function(N){T=O(N),L()||b.setLevel(N,!1)},b.resetLevel=function(){k=null,A(),h.call(b)},b.enableAll=function(N){b.setLevel(b.levels.TRACE,N)},b.disableAll=function(N){b.setLevel(b.levels.SILENT,N)},b.rebuild=function(){if(a!==b&&(P=O(a.getLevel())),h.call(b),a===b)for(var N in i)i[N].rebuild()},P=O(a?a.getLevel():"WARN");var D=L();D!=null&&(k=O(D)),h.call(b)}a=new y,a.getLogger=function(x){if(typeof x!="symbol"&&typeof x!="string"||x==="")throw new TypeError("You must supply a name when creating a logger.");var b=i[x];return b||(b=i[x]=new y(x,a.methodFactory)),b};var w=typeof window!==n?window.log:void 0;return a.noConflict=function(){return typeof window!==n&&window.log===a&&(window.log=w),a},a.getLoggers=function(){return i},a.default=a,a})})(Xp)),Xp.exports}var KU=GU();const Ws=d0(KU),qU="INFO",ZU=qU.toUpperCase();Ws.setLevel(Ws.levels[ZU]||Ws.levels.INFO);const Is=t=>{const e=t?`[${t}] `:"";return{trace:(n,...r)=>Ws.trace(`${e}${n}`,...r),debug:(n,...r)=>Ws.debug(`${e}${n}`,...r),info:(n,...r)=>Ws.info(`${e}${n}`,...r),warn:(n,...r)=>Ws.warn(`${e}${n}`,...r),error:(n,...r)=>{Ws.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}:{}};Se.capture("logger_error",a)}catch(s){console.error("[logger] Failed to send logger_error to PostHog:",s)}},api:(n,...r)=>Ws.info(`${e}API: ${n}`,...r),hook:(n,...r)=>Ws.debug(`${e}Hook: ${n}`,...r),mount:(n,...r)=>Ws.debug(`${e}Mount: ${n}`,...r)}};let Qp=0;const YU=()=>{Qp+=1;let t=!1;return()=>{t||(t=!0,Qp=Math.max(0,Qp-1))}},XU=()=>Qp>0;function QU(t){return t==="cursor"?"Cursor":t==="codex"?"Codex":t==="claude-desktop"?"Claude":"Claude Code"}const JU=["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],Ww=({className:t,"data-testid":e}={})=>E.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:E.jsx("div",{className:"rivet-sparkle-strip",children:JU.map((n,r)=>E.jsx("span",{className:"block",style:{height:"1em",lineHeight:"1em"},children:n},r))})}),eW=["top","right","bottom","left"],ya=Math.min,fo=Math.max,Xm=Math.round,Tp=Math.floor,ho=t=>({x:t,y:t}),tW={left:"right",right:"left",bottom:"top",top:"bottom"};function U5(t,e,n){return fo(t,ya(e,n))}function go(t,e){return typeof t=="function"?t(e):t}function _a(t){return t.split("-")[0]}function Ec(t){return t.split("-")[1]}function Gw(t){return t==="x"?"y":"x"}function Kw(t){return t==="y"?"height":"width"}function wi(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function qw(t){return Gw(wi(t))}function nW(t,e,n){n===void 0&&(n=!1);const r=Ec(t),s=qw(t),i=Kw(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=Qm(a)),[a,Qm(a)]}function rW(t){const e=Qm(t);return[X_(t),e,X_(e)]}function X_(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const F4=["left","right"],j4=["right","left"],sW=["top","bottom"],iW=["bottom","top"];function oW(t,e,n){switch(t){case"top":case"bottom":return n?e?j4:F4:e?F4:j4;case"left":case"right":return e?sW:iW;default:return[]}}function aW(t,e,n,r){const s=Ec(t);let i=oW(_a(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(X_)))),i}function Qm(t){const e=_a(t);return tW[e]+t.slice(e.length)}function lW(t){var e,n,r,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(s=t.left)!=null?s:0}}function W5(t){return typeof t!="number"?lW(t):{top:t,right:t,bottom:t,left:t}}function Jm(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 V4(t,e,n){let{reference:r,floating:s}=t;const i=wi(e),a=qw(e),u=Kw(a),c=_a(e),d=i==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=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}}const w=Ec(e);return w&&(y[a]+=m*(w==="end"?1:-1)*(n&&d?-1:1)),y}async function uW(t,e){var n;e===void 0&&(e={});const{x:r,y:s,platform:i,rects:a,elements:u,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=go(e,t),w=W5(y),x=u[m?p==="floating"?"reference":"floating":p],b=Jm(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:d,rootBoundary:h,strategy:c})),P=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),k=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},I=Jm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:P,offsetParent:T,strategy:c}):P);return{top:(b.top-I.top+w.top)/k.y,bottom:(I.bottom-b.bottom+w.bottom)/k.y,left:(b.left-I.left+w.left)/k.x,right:(I.right-b.right+w.right)/k.x}}const cW=50,dW=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:uW},c=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=V4(d,r,c),m=r,y=0;const w={};for(let _=0;_<i.length;_++){const x=i[_];if(!x)continue;const{name:b,fn:P}=x,{x:T,y:k,data:I,reset:R}=await P({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:w,rects:d,platform:u,elements:{reference:t,floating:e}});h=T??h,p=k??p,w[b]={...w[b],...I},R&&y<cW&&(y++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(d=R.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:s}):R.rects),{x:h,y:p}=V4(d,m,c)),_=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:w}},fW=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:d,padding:h=0}=go(t,e)||{};if(d==null)return{};const p=W5(h),m={x:n,y:r},y=qw(s),w=Kw(y),_=await a.getDimensions(d),x=y==="y",b=x?"top":"left",P=x?"bottom":"right",T=x?"clientHeight":"clientWidth",k=i.reference[w]+i.reference[y]-m[y]-i.floating[w],I=m[y]-i.reference[y],R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let L=R?R[T]:0;(!L||!await(a.isElement==null?void 0:a.isElement(R)))&&(L=u.floating[T]||i.floating[w]);const A=k/2-I/2,O=L/2-_[w]/2-1,D=ya(p[b],O),N=ya(p[P],O),F=L-_[w]-N,K=L/2-_[w]/2+A,Z=U5(D,K,F),W=!c.arrow&&Ec(s)!=null&&K!==Z&&i.reference[w]/2-(K<D?D:N)-_[w]/2<0,G=W?K<D?K-D:K-F:0;return{[y]:m[y]+G,data:{[y]:Z,centerOffset:K-Z-G,...W&&{alignmentOffset:G}},reset:W}}}),hW=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:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:_=!0,...x}=go(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=_a(s),P=wi(u),T=_a(u)===u,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),I=m||(T||!_?[Qm(u)]:rW(u)),R=w!=="none";!m&&R&&I.push(...aW(u,_,w,k));const L=[u,...I],A=await c.detectOverflow(e,x),O=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&O.push(A[b]),p){const Z=nW(s,a,k);O.push(A[Z[0]],A[Z[1]])}if(D=[...D,{placement:s,overflows:O}],!O.every(Z=>Z<=0)){var N,F;const Z=(((N=i.flip)==null?void 0:N.index)||0)+1,W=L[Z];if(W&&(!(p==="alignment"?P!==wi(W):!1)||D.every($=>wi($.placement)===P?$.overflows[0]>0:!0)))return{data:{index:Z,overflows:D},reset:{placement:W}};let G=(F=D.filter(Y=>Y.overflows[0]<=0).sort((Y,$)=>Y.overflows[1]-$.overflows[1])[0])==null?void 0:F.placement;if(!G)switch(y){case"bestFit":{var K;const Y=(K=D.filter($=>{if(R){const J=wi($.placement);return J===P||J==="y"}return!0}).map($=>[$.placement,$.overflows.filter(J=>J>0).reduce((J,H)=>J+H,0)]).sort(($,J)=>$[1]-J[1])[0])==null?void 0:K[0];Y&&(G=Y);break}case"initialPlacement":G=u;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function $4(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function H4(t){return eW.some(e=>t[e]>=0)}const pW=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:s="referenceHidden",...i}=go(t,e);switch(s){case"referenceHidden":{const a=await r.detectOverflow(e,{...i,elementContext:"reference"}),u=$4(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:H4(u)}}}case"escaped":{const a=await r.detectOverflow(e,{...i,altBoundary:!0}),u=$4(a,n.floating);return{data:{escapedOffsets:u,escaped:H4(u)}}}default:return{}}}}},G5=new Set(["left","top"]);async function mW(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=_a(n),u=Ec(n),c=wi(n)==="y",d=G5.has(a)?-1:1,h=i&&c?-1:1,p=go(e,t);let{mainAxis:m,crossAxis:y,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof w=="number"&&(y=u==="end"?w*-1:w),c?{x:y*h,y:m*d}:{x:m*d,y:y*h}}const gW=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 mW(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}}}}},vW=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:P=>{let{x:T,y:k}=P;return{x:T,y:k}}},...d}=go(t,e),h={x:n,y:r},p=await i.detectOverflow(e,d),m=wi(s),y=Gw(m);let w=h[y],_=h[m];const x=(P,T)=>U5(T+p[P==="y"?"top":"left"],T,T-p[P==="y"?"bottom":"right"]);a&&(w=x(y,w)),u&&(_=x(m,_));const b=c.fn({...e,[y]:w,[m]:_});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[y]:a,[m]:u}}}}}},yW=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:s,y:i,placement:a,rects:u,middlewareData:c}=e,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=go(t,e),m={x:s,y:i},y=wi(a),w=Gw(y);let _=m[w],x=m[y];const b=go(d,e),P=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:(n=b.mainAxis)!=null?n:0,crossAxis:(r=b.crossAxis)!=null?r:0};if(h){const I=w==="y"?"height":"width",R=u.reference[w]-u.floating[I]+P.mainAxis,L=u.reference[w]+u.reference[I]-P.mainAxis;_<R?_=R:_>L&&(_=L)}if(p){var T,k;const I=w==="y"?"width":"height",R=G5.has(_a(a)),L=u.reference[y]-u.floating[I]+(R&&((T=c.offset)==null?void 0:T[y])||0)+(R?0:P.crossAxis),A=u.reference[y]+u.reference[I]+(R?0:((k=c.offset)==null?void 0:k[y])||0)-(R?P.crossAxis:0);x<L?x=L:x>A&&(x=A)}return{[w]:_,[y]:x}}}},_W=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:a=()=>{},...u}=go(t,e),c=await s.detectOverflow(e,u),d=_a(n),h=Ec(n),p=wi(n)==="y",{width:m,height:y}=r.floating;let w,_;d==="top"||d==="bottom"?(w=d,_=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,w=h==="end"?"top":"bottom");const x=y-c.top-c.bottom,b=m-c.left-c.right,P=ya(y-c[w],x),T=ya(m-c[_],b),k=e.middlewareData.shift,I=!k;let R=P,L=T;k!=null&&k.enabled.x&&(L=b),k!=null&&k.enabled.y&&(R=x),I&&!h&&(p?L=m-2*fo(c.left,c.right):R=y-2*fo(c.top,c.bottom)),await a({...e,availableWidth:L,availableHeight:R});const A=await s.getDimensions(i.floating);return m!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function T0(){return typeof window<"u"}function Cc(t){return K5(t)?(t.nodeName||"").toLowerCase():"#document"}function Dr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function wo(t){var e;return(e=(K5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function K5(t){return T0()?t instanceof Node||t instanceof Dr(t).Node:!1}function Ei(t){return T0()?t instanceof Element||t instanceof Dr(t).Element:!1}function Pa(t){return T0()?t instanceof HTMLElement||t instanceof Dr(t).HTMLElement:!1}function z4(t){return!T0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dr(t).ShadowRoot}function I0(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Ci(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&s!=="inline"&&s!=="contents"}function wW(t){return/^(table|td|th)$/.test(Cc(t))}function A0(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const xW=/transform|translate|scale|rotate|perspective|filter/,bW=/paint|layout|strict|content/,Xa=t=>!!t&&t!=="none";let D1;function Zw(t){const e=Ei(t)?Ci(t):t;return Xa(e.transform)||Xa(e.translate)||Xa(e.scale)||Xa(e.rotate)||Xa(e.perspective)||!Yw()&&(Xa(e.backdropFilter)||Xa(e.filter))||xW.test(e.willChange||"")||bW.test(e.contain||"")}function SW(t){let e=Nl(t);for(;Pa(e)&&!df(e);){if(Zw(e))return e;if(A0(e))return null;e=Nl(e)}return null}function Yw(){return D1==null&&(D1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),D1}function df(t){return/^(html|body|#document)$/.test(Cc(t))}function Ci(t){return Dr(t).getComputedStyle(t)}function R0(t){return Ei(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Nl(t){if(Cc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||z4(t)&&t.host||wo(t);return z4(e)?e.host:e}function q5(t){const e=Nl(t);return df(e)?(t.ownerDocument||t).body:Pa(e)&&I0(e)?e:q5(e)}function ff(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=q5(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=Dr(s);if(i){const u=Q_(a);return e.concat(a,a.visualViewport||[],I0(s)?s:[],u&&n?ff(u):[])}else return e.concat(s,ff(s,[],n))}function Q_(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Z5(t){const e=Ci(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=Pa(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,u=Xm(n)!==i||Xm(r)!==a;return u&&(n=i,r=a),{width:n,height:r,$:u}}function Xw(t){return Ei(t)?t:t.contextElement}function Vu(t){const e=Xw(t);if(!Pa(e))return ho(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=Z5(e);let a=(i?Xm(n.width):n.width)/r,u=(i?Xm(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const EW=ho(0);function Y5(t){const e=Dr(t);return!Yw()||!e.visualViewport?EW:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function CW(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Dr(t)}function Fl(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Xw(t);let a=ho(1);e&&(r?Ei(r)&&(a=Vu(r)):a=Vu(t));const u=CW(i,n,r)?Y5(i):ho(0);let c=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(i&&r){const m=Dr(i),y=Ei(r)?Dr(r):r;let w=m,_=Q_(w);for(;_&&y!==w;){const x=Vu(_),b=_.getBoundingClientRect(),P=Ci(_),T=b.left+(_.clientLeft+parseFloat(P.paddingLeft))*x.x,k=b.top+(_.clientTop+parseFloat(P.paddingTop))*x.y;c*=x.x,d*=x.y,h*=x.x,p*=x.y,c+=T,d+=k,w=Dr(_),_=Q_(w)}}return Jm({width:h,height:p,x:c,y:d})}function M0(t,e){const n=R0(t).scrollLeft;return e?e.left+n:Fl(wo(t)).left+n}function X5(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-M0(t,n),s=n.top+e.scrollTop;return{x:r,y:s}}function kW(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=wo(r),u=e?A0(e.floating):!1;if(r===a||u&&i)return n;let c={scrollLeft:0,scrollTop:0},d=ho(1);const h=ho(0),p=Pa(r);if((p||!i)&&((Cc(r)!=="body"||I0(a))&&(c=R0(r)),p)){const y=Fl(r);d=Vu(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const m=a&&!p&&!i?X5(a,c):ho(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-c.scrollTop*d.y+h.y+m.y}}function PW(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function TW(t){const e=R0(t),n=t.ownerDocument.body,r=fo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+M0(t);const a=-e.scrollTop;return Ci(n).direction==="rtl"&&(i+=fo(t.clientWidth,n.clientWidth)-r),{width:r,height:s,x:i,y:a}}const IW=25;function AW(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=Dr(t),i=wo(t),a=s.visualViewport;let u=i.clientWidth,c=i.clientHeight,d=0,h=0;if(a){const m=!Yw()||e==="fixed";r?m||(d=-a.offsetLeft,h=-a.offsetTop):(u=a.width,c=a.height,m&&(d=a.offsetLeft,h=a.offsetTop))}if(M0(i)<=0){const m=i.ownerDocument,y=m.body,w=getComputedStyle(y),_=m.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,x=Math.abs(i.clientWidth-y.clientWidth-_),b=getComputedStyle(i).scrollbarGutter==="stable both-edges"?x/2:x;b<=IW&&(u-=b)}return{width:u,height:c,x:d,y:h}}function RW(t,e){const n=Fl(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=Vu(t),a=t.clientWidth*i.x,u=t.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:a,height:u,x:c,y:d}}function B4(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=AW(t,n,e);else if(e==="document")r=TW(wo(t));else if(Ei(e))r=RW(e,n);else{const s=Y5(t);r={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Jm(r)}function MW(t,e){const n=e.get(t);if(n)return n;let r=ff(t,[],!1).filter(u=>Ei(u)&&Cc(u)!=="body"),s=null;const i=Ci(t).position==="fixed";let a=i?Nl(t):t;for(;Ei(a)&&!df(a);){const u=Ci(a),c=Zw(a),d=s?s.position:i?"fixed":"";!c&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):s=u,a=Nl(a)}return e.set(t,r),r}function OW(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?A0(e)?[]:MW(e,this._c):[].concat(n),r],u=B4(e,a[0],s);let c=u.top,d=u.right,h=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const y=B4(e,a[m],s);c=fo(y.top,c),d=ya(y.right,d),h=ya(y.bottom,h),p=fo(y.left,p)}return{width:d-p,height:h-c,x:p,y:c}}function LW(t){const{width:e,height:n}=Z5(t);return{width:e,height:n}}function DW(t,e,n){const r=Pa(e),s=wo(e),i=n==="fixed",a=Fl(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const c=ho(0);if((r||!i)&&((Cc(e)!=="body"||I0(s))&&(u=R0(e)),r)){const m=Fl(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}!r&&s&&(c.x=M0(s));const d=s&&!r&&!i?X5(s,u):ho(0),h=a.left+u.scrollLeft-c.x-d.x,p=a.top+u.scrollTop-c.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function N1(t){return Ci(t).position==="static"}function U4(t,e){if(!Pa(t)||Ci(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return wo(t)===n&&(n=n.ownerDocument.body),n}function Q5(t,e){const n=Dr(t);if(A0(t))return n;if(!Pa(t)){let s=Nl(t);for(;s&&!df(s);){if(Ei(s)&&!N1(s))return s;s=Nl(s)}return n}let r=U4(t,e);for(;r&&wW(r)&&N1(r);)r=U4(r,e);return r&&df(r)&&N1(r)&&!Zw(r)?n:r||SW(t)||n}const NW=async function(t){const e=this.getOffsetParent||Q5,n=this.getDimensions,r=await n(t.floating);return{reference:DW(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FW(t){return Ci(t).direction==="rtl"}const jW={convertOffsetParentRelativeRectToViewportRelativeRect:kW,getDocumentElement:wo,getClippingRect:OW,getOffsetParent:Q5,getElementRects:NW,getClientRects:PW,getDimensions:LW,getScale:Vu,isElement:Ei,isRTL:FW};function J5(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function VW(t,e,n){let r=null,s;const i=wo(t);function a(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function u(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:y,top:w,width:_,height:x}=m;if(h||e(),!_||!x)return;const b=Tp(w),P=Tp(i.clientWidth-(y+_)),T=Tp(i.clientHeight-(w+x)),k=Tp(y),R={rootMargin:-b+"px "+-P+"px "+-T+"px "+-k+"px",threshold:fo(0,ya(1,p))||1};let L=!0;function A(O){const D=O[0].intersectionRatio;if(!J5(m,t.getBoundingClientRect()))return u();if(D!==p){if(!L)return u();D?u(!1,D):s=setTimeout(()=>{u(!1,1e-7)},1e3)}L=!1}try{r=new IntersectionObserver(A,{...R,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,R)}r.observe(t)}const c=Dr(t),d=()=>u(n);return c.addEventListener("resize",d),u(!0),()=>{c.removeEventListener("resize",d),a()}}function $W(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,d=Xw(t),h=s||i?[...d?ff(d):[],...e?ff(e):[]]:[];h.forEach(b=>{s&&b.addEventListener("scroll",n),i&&b.addEventListener("resize",n)});const p=d&&u?VW(d,n,i):null;let m=-1,y=null;a&&(y=new ResizeObserver(b=>{let[P]=b;P&&P.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(e)})),n()}),d&&!c&&y.observe(d),e&&y.observe(e));let w,_=c?Fl(t):null;c&&x();function x(){const b=Fl(t);_&&!J5(_,b)&&n(),_=b,w=requestAnimationFrame(x)}return n(),()=>{var b;h.forEach(P=>{s&&P.removeEventListener("scroll",n),i&&P.removeEventListener("resize",n)}),p==null||p(),(b=y)==null||b.disconnect(),y=null,c&&cancelAnimationFrame(w)}}const HW=gW,zW=vW,BW=hW,UW=_W,WW=pW,W4=fW,GW=yW,KW=(t,e,n)=>{const r=new Map,s=n??{},i={...jW,...s.platform,_c:r};return dW(t,e,{...s,platform:i})};var qW=typeof document<"u",ZW=function(){},Jp=qW?v.useLayoutEffect:ZW;function e0(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(!e0(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)&&!e0(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function eA(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function G4(t,e){const n=eA(t);return Math.round(e*n)/n}function F1(t){const e=v.useRef(t);return Jp(()=>{e.current=t}),e}function YW(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:d}=t,[h,p]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,y]=v.useState(r);e0(m,r)||y(r);const[w,_]=v.useState(null),[x,b]=v.useState(null),P=v.useCallback($=>{$!==R.current&&(R.current=$,_($))},[]),T=v.useCallback($=>{$!==L.current&&(L.current=$,b($))},[]),k=i||w,I=a||x,R=v.useRef(null),L=v.useRef(null),A=v.useRef(h),O=c!=null,D=F1(c),N=F1(s),F=F1(d),K=v.useCallback(()=>{if(!R.current||!L.current)return;const $={placement:e,strategy:n,middleware:m};N.current&&($.platform=N.current),KW(R.current,L.current,$).then(J=>{const H={...J,isPositioned:F.current!==!1};Z.current&&!e0(A.current,H)&&(A.current=H,S0.flushSync(()=>{p(H)}))})},[m,e,n,N,F]);Jp(()=>{d===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[d]);const Z=v.useRef(!1);Jp(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Jp(()=>{if(k&&(R.current=k),I&&(L.current=I),k&&I){if(D.current)return D.current(k,I,K);K()}},[k,I,K,D,O]);const W=v.useMemo(()=>({reference:R,floating:L,setReference:P,setFloating:T}),[P,T]),G=v.useMemo(()=>({reference:k,floating:I}),[k,I]),Y=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!G.floating)return $;const J=G4(G.floating,h.x),H=G4(G.floating,h.y);return u?{...$,transform:"translate("+J+"px, "+H+"px)",...eA(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:H}},[n,u,G.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:K,refs:W,elements:G,floatingStyles:Y}),[h,K,W,G,Y])}const XW=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?W4({element:r.current,padding:s}).fn(n):{}:r?W4({element:r,padding:s}).fn(n):{}}}},QW=(t,e)=>{const n=HW(t);return{name:n.name,fn:n.fn,options:[t,e]}},JW=(t,e)=>{const n=zW(t);return{name:n.name,fn:n.fn,options:[t,e]}},eG=(t,e)=>({fn:GW(t).fn,options:[t,e]}),tG=(t,e)=>{const n=BW(t);return{name:n.name,fn:n.fn,options:[t,e]}},nG=(t,e)=>{const n=UW(t);return{name:n.name,fn:n.fn,options:[t,e]}},rG=(t,e)=>{const n=WW(t);return{name:n.name,fn:n.fn,options:[t,e]}},sG=(t,e)=>{const n=XW(t);return{name:n.name,fn:n.fn,options:[t,e]}};var iG=Object.defineProperty,oG=(t,e)=>iG(t,"name",{value:e,configurable:!0});function Qw(t){const[e,n]=v.useState(void 0);return Lr(()=>{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,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,u=d.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}oG(Qw,"useSize");var aG=Object.defineProperty,ca=(t,e)=>aG(t,"name",{value:e,configurable:!0}),tA="Popper",[nA,O0]=Pi(tA),[lG,rA]=nA(tA),uG=ca(t=>{const{__scopePopper:e,children:n}=t,[r,s]=v.useState(null),[i,a]=v.useState(void 0);return E.jsx(lG,{scope:e,anchor:r,onAnchorChange:s,placementState:i,setPlacementState:a,children:n})},"Popper"),cG="PopperAnchor",dG=v.forwardRef(ca(function(e,n){const{__scopePopper:r,virtualRef:s,...i}=e,a=rA(cG,r),u=v.useRef(null),c=a.onAnchorChange,d=v.useCallback(_=>{u.current=_,_&&c(_)},[c]),h=zt(n,d),p=v.useRef(null);v.useEffect(()=>{if(!s)return;const _=p.current;p.current=s.current,_!==p.current&&c(p.current)});const m=a.placementState&&L0(a.placementState),y=m==null?void 0:m[0],w=m==null?void 0:m[1];return s?null:E.jsx(pn.div,{"data-radix-popper-side":y,"data-radix-popper-align":w,...i,ref:h})},"PopperAnchor")),sA="PopperContent",[fG,wee]=nA(sA),hG=v.forwardRef(ca(function(e,n){var ie,Ne,Ue,Pe,Ve,ht,Jt;const{__scopePopper:r,side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:u=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:w="optimized",onPlaced:_,...x}=e,b=rA(sA,r),[P,T]=v.useState(null),k=zt(n,T),[I,R]=v.useState(null),L=Qw(I),A=(L==null?void 0:L.width)??0,O=(L==null?void 0:L.height)??0,D=s+(a!=="center"?"-"+a:""),N=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(h)?h:[h],K=F.length>0,Z={padding:N,boundary:F.filter(iA),altBoundary:K},{refs:W,floatingStyles:G,placement:Y,isPositioned:$,middlewareData:J}=YW({strategy:"fixed",placement:D,whileElementsMounted:ca((...be)=>$W(...be,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[QW({mainAxis:i+O,alignmentAxis:u}),d&&JW({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?eG():void 0,...Z}),d&&tG({...Z}),nG({...Z,apply:ca(({elements:be,rects:$e,availableWidth:Ge,availableHeight:tt})=>{const{width:bt,height:nt}=$e.reference,Ye=be.floating.style;Ye.setProperty("--radix-popper-available-width",`${Ge}px`),Ye.setProperty("--radix-popper-available-height",`${tt}px`),Ye.setProperty("--radix-popper-anchor-width",`${bt}px`),Ye.setProperty("--radix-popper-anchor-height",`${nt}px`)},"apply")}),I&&sG({element:I,padding:c}),pG({arrowWidth:A,arrowHeight:O}),y&&rG({strategy:"referenceHidden",...Z,boundary:K?Z.boundary:void 0})]}),H=b.setPlacementState;Lr(()=>(H(Y),()=>{H(void 0)}),[Y,H]);const[j,X]=L0(Y),oe=Dl(_);Lr(()=>{$&&(oe==null||oe())},[$,oe]);const se=(ie=J.arrow)==null?void 0:ie.x,ee=(Ne=J.arrow)==null?void 0:Ne.y,ce=((Ue=J.arrow)==null?void 0:Ue.centerOffset)!==0,[we,ue]=v.useState();return Lr(()=>{P&&ue(window.getComputedStyle(P).zIndex)},[P]),E.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:$?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(Pe=J.transformOrigin)==null?void 0:Pe.x,(Ve=J.transformOrigin)==null?void 0:Ve.y].join(" "),...((ht=J.hide)==null?void 0:ht.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:E.jsx(fG,{scope:r,placedSide:j,placedAlign:X,onArrowChange:R,arrowX:se,arrowY:ee,shouldHideArrow:ce,children:E.jsx(pn.div,{"data-side":j,"data-align":X,...x,ref:k,style:{...x.style,animation:$?(Jt=x.style)==null?void 0:Jt.animation:"none"}})})})},"PopperContent"));function iA(t){return t!==null}ca(iA,"isNotNull");var pG=ca(t=>({name:"transformOrigin",options:t,fn(e){var x,b,P;const{placement:n,rects:r,middlewareData:s}=e,a=((x=s.arrow)==null?void 0:x.centerOffset)!==0,u=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[d,h]=L0(n),p={start:"0%",center:"50%",end:"100%"}[h],m=(((b=s.arrow)==null?void 0:b.x)??0)+u/2,y=(((P=s.arrow)==null?void 0:P.y)??0)+c/2;let w="",_="";return d==="bottom"?(w=a?p:`${m}px`,_=`${-c}px`):d==="top"?(w=a?p:`${m}px`,_=`${r.floating.height+c}px`):d==="right"?(w=`${-c}px`,_=a?p:`${y}px`):d==="left"&&(w=`${r.floating.width+c}px`,_=a?p:`${y}px`),{data:{x:w,y:_}}}}),"transformOrigin");function L0(t){const[e,n="center"]=t.split("-");return[e,n]}ca(L0,"getSideAndAlignFromPlacement");var oA=uG,aA=dG,lA=hG,mG=Object.defineProperty,Ta=(t,e)=>mG(t,"name",{value:e,configurable:!0}),Jw="Popover",[uA,xee]=Pi(Jw,[O0]),ex=O0(),[gG,kc]=uA(Jw),vG=Ta(t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,u=ex(e),c=v.useRef(null),[d,h]=v.useState(!1),[p,m]=Ea({prop:r,defaultProp:s??!1,onChange:i,caller:Jw});return E.jsx(oA,{...u,children:E.jsx(gG,{scope:e,contentId:ua(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(y=>!y),[m]),hasCustomAnchor:d,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:a,children:n})})},"Popover"),yG="PopoverTrigger",_G=v.forwardRef(Ta(function(e,n){const{__scopePopover:r,...s}=e,i=kc(yG,r),a=ex(r),u=zt(n,i.triggerRef),c=E.jsx(pn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":tx(i.open),...s,ref:u,onClick:$t(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?c:E.jsx(aA,{asChild:!0,...a,children:c})},"PopoverTrigger")),cA="PopoverPortal",[wG,xG]=uA(cA,{forceMount:void 0}),bG=Ta(t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=kc(cA,e);return E.jsx(wG,{scope:e,forceMount:n,children:E.jsx(Ca,{present:n||i.open,children:E.jsx(Rw,{asChild:!0,container:s,children:r})})})},"PopoverPortal"),hf="PopoverContent",SG=v.forwardRef(Ta(function(e,n){const r=xG(hf,e.__scopePopover),{forceMount:s=r.forceMount,...i}=e,a=kc(hf,e.__scopePopover);return E.jsx(Ca,{present:s||a.open,children:a.modal?E.jsx(CG,{...i,ref:n}):E.jsx(kG,{...i,ref:n})})},"PopoverContent")),EG=va("PopoverContent.RemoveScroll"),CG=v.forwardRef(Ta(function(e,n){const r=kc(hf,e.__scopePopover),s=v.useRef(null),i=zt(n,s),a=v.useRef(!1);return v.useEffect(()=>{const u=s.current;if(u)return HI(u)},[]),E.jsx(Ow,{as:EG,allowPinchZoom:!0,children:E.jsx(dA,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$t(e.onCloseAutoFocus,u=>{var c;u.preventDefault(),a.current||(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:$t(e.onPointerDownOutside,u=>{const c=u.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,h=c.button===2||d;a.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:$t(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),kG=v.forwardRef(Ta(function(e,n){const r=kc(hf,e.__scopePopover),s=v.useRef(!1),i=v.useRef(!1);return E.jsx(dA,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var u,c;(u=e.onCloseAutoFocus)==null||u.call(e,a),a.defaultPrevented||(s.current||(c=r.triggerRef.current)==null||c.focus(),a.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:a=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const u=a.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})},"PopoverContentNonModal")),dA=v.forwardRef(Ta(function(e,n){const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...m}=e,y=kc(hf,r),w=ex(r);return E0(),E.jsx(bI,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:a,children:E.jsx(Tw,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:p,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>y.onOpenChange(!1),deferPointerDownOutside:!0,children:E.jsx(lA,{"data-state":tx(y.open),role:"dialog",id:y.contentId,...w,...m,ref:n,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function tx(t){return t?"open":"closed"}Ta(tx,"getState");var fA=vG,hA=_G,pA=bG,mA=SG;const gA=({primaryLabel:t,primaryIcon:e,primaryAction:n,isDisabled:r=!1,isDropdownDisabled:s=!1,isLoading:i=!1,loadingLabel:a,dropdownAriaLabel:u="More actions",dropdownItems:c})=>{const[d,h]=v.useState(!1),p=i?a??t:t,m=c.length>0;return E.jsxs("div",{className:"flex items-stretch",children:[E.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 ${m?"rounded-l-md":"rounded-md"}`,children:[e?E.jsx(e,{className:"h-3.5 w-3.5",weight:"bold"}):null,p]}),m?E.jsxs(fA,{open:d,onOpenChange:h,children:[E.jsx(hA,{asChild:!0,children:E.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:E.jsx(PB,{className:"h-3.5 w-3.5",weight:"bold"})})}),E.jsx(pA,{children:E.jsx(mA,{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 w=y.icon;return E.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:[w?E.jsx(w,{className:"h-3.5 w-3.5",weight:"bold"}):null,y.label]},y.label)})})})]}):null]})};var PG=Object.defineProperty,TG=(t,e)=>PG(t,"name",{value:e,configurable:!0}),IG=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"}),AG=v.forwardRef(TG(function(e,n){return E.jsx(pn.span,{...e,ref:n,style:{...IG,...e.style}})},"VisuallyHidden")),RG=AG,MG=Object.defineProperty,Dn=(t,e)=>MG(t,"name",{value:e,configurable:!0}),[nx,bee]=Pi("Tooltip",[O0]),rx=O0(),OG="TooltipProvider",LG=700,J_="tooltip.open",[DG,sx]=nx(OG),NG=Dn(t=>{const{__scopeTooltip:e,delayDuration:n=LG,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=v.useRef(!0),u=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),E.jsx(DG,{scope:e,isOpenDelayedRef:a,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:i})},"TooltipProvider"),e2="Tooltip",[FG,jf]=nx(e2),jG=Dn(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:u}=t,c=sx(e2,t.__scopeTooltip),d=rx(e),[h,p]=v.useState(null),[m,y]=v.useState(void 0),w=ua(),_=v.useRef(0),x=a??c.disableHoverableContent,b=u??c.delayDuration,P=v.useRef(!1),[T,k]=Ea({prop:r,defaultProp:s??!1,onChange:Dn(D=>{D?(c.onOpen(),document.dispatchEvent(new CustomEvent(J_))):c.onClose(),i==null||i(D)},"onChange"),caller:e2}),I=v.useMemo(()=>T?P.current?"delayed-open":"instant-open":"closed",[T]),R=v.useCallback(()=>{window.clearTimeout(_.current),_.current=0,P.current=!1,k(!0)},[k]),L=v.useCallback(()=>{window.clearTimeout(_.current),_.current=0,k(!1)},[k]),A=v.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{P.current=!0,k(!0),_.current=0},b)},[b,k]);v.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const O=m??w;return E.jsx(oA,{...d,children:E.jsx(FG,{scope:e,contentId:O,setContentId:y,open:T,stateAttribute:I,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?A():R()},[c.isOpenDelayedRef,A,R]),onTriggerLeave:v.useCallback(()=>{x?L():(window.clearTimeout(_.current),_.current=0)},[L,x]),onOpen:R,onClose:L,disableHoverableContent:x,children:n})})},"Tooltip"),K4="TooltipTrigger",VG=v.forwardRef(Dn(function(e,n){const{__scopeTooltip:r,...s}=e,i=jf(K4,r),a=sx(K4,r),u=rx(r),c=v.useRef(null),d=zt(n,c,i.onTriggerChange),h=v.useRef(!1),p=v.useRef(!1),m=v.useCallback(()=>h.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),E.jsx(aA,{asChild:!0,...u,children:E.jsx(pn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:$t(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:$t(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:$t(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:$t(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:$t(e.onBlur,i.onClose),onClick:$t(e.onClick,i.onClose)})})},"TooltipTrigger")),vA="TooltipPortal",[$G,HG]=nx(vA,{forceMount:void 0}),zG=Dn(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=jf(vA,e);return E.jsx($G,{scope:e,forceMount:n,children:E.jsx(Ca,{present:n||i.open,children:E.jsx(Rw,{asChild:!0,container:s,children:r})})})},"TooltipPortal"),pf="TooltipContent",BG=v.forwardRef(Dn(function(e,n){const r=HG(pf,e.__scopeTooltip),{forceMount:s=r.forceMount,side:i="top",...a}=e,u=jf(pf,e.__scopeTooltip);return E.jsx(Ca,{present:s||u.open,children:u.disableHoverableContent?E.jsx(yA,{side:i,...a,ref:n}):E.jsx(UG,{side:i,...a,ref:n})})},"TooltipContent")),UG=v.forwardRef(Dn(function(e,n){const r=jf(pf,e.__scopeTooltip),s=sx(pf,e.__scopeTooltip),i=v.useRef(null),a=zt(n,i),[u,c]=v.useState(null),{trigger:d,onClose:h}=r,p=i.current,{onPointerInTransitChange:m}=s,y=v.useCallback(()=>{c(null),m(!1)},[m]),w=v.useCallback((_,x)=>{const b=_.currentTarget,P={x:_.clientX,y:_.clientY},T=_A(P,b.getBoundingClientRect()),k=wA(P,T),I=xA(x.getBoundingClientRect()),R=SA([...k,...I]);c(R),m(!0)},[m]);return v.useEffect(()=>()=>y(),[y]),v.useEffect(()=>{if(d&&p){const _=Dn(b=>w(b,p),"handleTriggerLeave"),x=Dn(b=>w(b,d),"handleContentLeave");return d.addEventListener("pointerleave",_),p.addEventListener("pointerleave",x),()=>{d.removeEventListener("pointerleave",_),p.removeEventListener("pointerleave",x)}}},[d,p,w,y]),v.useEffect(()=>{if(u){const _=Dn(x=>{const b=x.target,P={x:x.clientX,y:x.clientY},T=(d==null?void 0:d.contains(b))||(p==null?void 0:p.contains(b)),k=!bA(P,u);T?y():k&&(y(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[d,p,u,h,y]),E.jsx(yA,{...e,ref:a})},"TooltipContentHoverable")),WG=fI("TooltipContent"),yA=v.forwardRef(Dn(function(e,n){const{__scopeTooltip:r,children:s,"aria-label":i,id:a,onEscapeKeyDown:u,onPointerDownOutside:c,...d}=e,h=jf(pf,r),p=rx(r),{onClose:m}=h;v.useEffect(()=>(document.addEventListener(J_,m),()=>document.removeEventListener(J_,m)),[m]),v.useEffect(()=>{if(h.trigger){const w=Dn(_=>{_.target instanceof Node&&_.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[h.trigger,m]);const{setContentId:y}=h;return Lr(()=>(y(a),()=>{y(void 0)}),[a,y]),E.jsx(Tw,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:w=>w.preventDefault(),onDismiss:m,children:E.jsxs(lA,{"data-state":h.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:h.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[E.jsx(WG,{children:s}),i?E.jsx(RG,{id:h.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl"));function _A(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")}}Dn(_A,"getExitSideFromRect");function wA(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}Dn(wA,"getPaddedExitPoints");function xA(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}]}Dn(xA,"getPointsFromRect");function bA(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],d=u.x,h=u.y,p=c.x,m=c.y;h>r!=m>r&&n<(p-d)*(r-h)/(m-h)+d&&(s=!s)}return s}Dn(bA,"isPointInPolygon");function SA(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),EA(e)}Dn(SA,"getHull");function EA(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)}Dn(EA,"getHullPresorted");var GG=NG,KG=jG,qG=VG,ZG=zG,YG=BG;const jd={normal:"'wght' 400",medium:"'wght' 450",semibold:"'wght' 550"},CA={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"}},kA=v.createContext(null);function D0(){const t=v.useContext(kA);return t?t.classes:CA.pill}function XG(t){const e=document.documentElement;e.classList.add("transitioning"),e.offsetHeight,t(),setTimeout(()=>e.classList.remove("transitioning"),200)}function QG({children:t,defaultShape:e="pill"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{XG(()=>r(i))},[]);return E.jsx(kA.Provider,{value:{shape:n,setShape:s,classes:CA[n]},children:t})}const PA=v.createContext(null);function TA({value:t,children:e}){return E.jsx(PA.Provider,{value:t,children:e})}function JG(t){switch(t){case"top":return{y:4};case"bottom":return{y:-4};case"left":return{x:4};case"right":return{x:-4}}}function ix({content:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=200,className:i,forceOpen:a,onOpenChange:u}){const[c,d]=v.useState(!1),h=a!==void 0?a:c,[p,m]=v.useState(!1),y=D0(),w=v.useContext(PA);v.useEffect(()=>{h&&m(!0)},[h]);const _=()=>{h||m(!1)},x=JG(n);return E.jsx(GG,{delayDuration:s,children:E.jsxs(KG,{open:h,onOpenChange:b=>{d(b),u==null||u(b)},children:[E.jsx(qG,{asChild:!0,children:e}),p&&E.jsx(ZG,{forceMount:!0,container:w??void 0,children:E.jsx(YG,{side:n,sideOffset:r,forceMount:!0,className:"z-tooltip",children:E.jsx(co.div,{className:vr("bg-neutral-900 text-white text-[12px] px-2 py-1 border border-white/10 shadow-lg",y.bg,i),style:{fontVariationSettings:jd.medium},initial:{opacity:0,scale:.8,...x},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 ao=({label:t,children:e,side:n="top",sideOffset:r=8,delayDuration:s=300,disabled:i=!1,forceOpen:a})=>i?E.jsx(E.Fragment,{children:e}):E.jsx(ix,{content:t,side:n,sideOffset:r,delayDuration:s,forceOpen:a,children:e}),N0="/__rivet/preview",q4=`${N0}/variant/`,Z4=`${N0}/history/`,IA=t=>t?t.startsWith("/")?t:`/${t}`:"/",eK=t=>`${N0}/variant/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${IA(t.routePath)}`,tK=t=>`${N0}/history/${encodeURIComponent(t.sessionId)}/${encodeURIComponent(t.variantId)}${IA(t.routePath)}`,nK=t=>{try{const e=new URL(t,"http://localhost");return e.pathname.startsWith(q4)||e.pathname.startsWith(Z4)}catch{return t.startsWith(q4)||t.startsWith(Z4)}},Y4=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")?eK({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},X4="/rivet/",AA=t=>{if(!t.startsWith(X4))return null;const e=t.slice(X4.length);return!e||e==="/"?null:`/${e}`},mf=(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(()=>{})},rK=(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),mf(r,e))}},t0=(t,e)=>{const n=e==null?void 0:e.left,r=e==null?void 0:e.right;return{event:`visual_editor_variant_compare_${t}`,properties:{bound_side_count:+!!n+ +!!r,is_cross_session:!!(n&&r&&n.sessionId!==r.sessionId),left_session_id:n==null?void 0:n.sessionId,left_source:n==null?void 0:n.source,left_variant_id:n==null?void 0:n.variantId,right_session_id:r==null?void 0:r.sessionId,right_source:r==null?void 0:r.source,right_variant_id:r==null?void 0:r.variantId}}},Q4=6,t2="original",ox="Original",ax="The original state of your app before any variants were generated.",J4=200,yn=Is("AgentVariantsPanel"),j1=()=>{var t;(t=window.getSelection())==null||t.removeAllRanges()},sK=t=>t?t.kind==="active"?t.variant.workItemId:`${t.entry.sessionId}:${t.entry.variantId}`:null,_u=t=>{var e;return!!t.hasTree&&((e=t.serve)==null?void 0:e.kind)==="dev-server"},iK=t=>{var e;return t?t.kind==="existing"?!0:((e=t.executionPlan)==null?void 0:e.mode)==="vite_app":!1};function $u(t,...e){return t?e.some(n=>(n??"").toLowerCase().includes(t)):!0}async function Bi(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 oK=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},Vd=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")},RA=t=>{var e;return((e=t.previewUnavailable)==null?void 0:e.reason)==="idle_timeout"},aK=t=>t.status==="succeeded"&&!Vd(t)&&(!t.previewUnavailable||RA(t)),V1=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"},e6=(t,e,n)=>{const r=t.includes("?")?"&":"?";return`${t}${r}${encodeURIComponent(e)}=${encodeURIComponent(n)}`},lK=t=>{var e;return oK(t)&&((e=t.preview)==null?void 0:e.kind)==="static_artifact"},t6=(t,e)=>t.map(n=>`${n.workItemId}:${e[n.workItemId]??""}`).join("|"),uK=(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}),cK=()=>{var Ma,zr,Zf,wr;const t=et(Nf),e=et(V5),n=et($5),r=et(Ff),s=et(Y_),i=((Ma=s.deployPrototype)==null?void 0:Ma.isEnabled)??!1,a=((zr=s.canvasShare)==null?void 0:zr.isEnabled)??!1,u=((Zf=s.variantSend)==null?void 0:Zf.isEnabled)??!1,c=((wr=s.designContextViewer)==null?void 0:wr.isEnabled)??!1,d=et(z5),h=et(B5),p=lt(W_),m=lt(Ym),y=lt(G_),w=lt(K_),_=lt(F5),x=lt(j5),b=lt(cf),P=lt(Uw),T=lt(L5);v.useEffect(()=>(T("Directions"),()=>T(null)),[T]);const k=et(mo),I=lt(mo),R=v.useCallback((B=!1)=>{if(rK(k),I(null),B&&k){const ae=t0("ended",k);Se.capture(ae.event,ae.properties)}},[I,k]),L=et(q_),A=lt(q_),O=et(Z_),D=lt(Z_),N=O?`${O.sessionId}:${O.variantId}`:null,[F,K]=v.useState(""),[Z,W]=v.useState(null),[G,Y]=v.useState(null),[$,J]=v.useState({}),[H,j]=v.useState(null),[X,oe]=v.useState({}),[se,ee]=v.useState(null),[ce,we]=v.useState([]),ue=v.useRef([]);ue.current=ce;const[ie,Ne]=v.useState(!1),Ue=v.useRef(!1);Ue.current=O!==null||L!==null||ie;const Pe=v.useMemo(()=>t.active?t.variants:[],[t]),Ve=v.useMemo(()=>Pe.filter(lK),[Pe]),ht=v.useMemo(()=>t6(Ve,$),[Ve,$]),Jt=(H==null?void 0:H.key)===ht?H.shareUrl:null,be=t.active?t.sessionId:null,$e=v.useMemo(()=>{const B=new Set;for(const ae of Pe)ae.adoptedSource&&B.add(`${ae.adoptedSource.sessionId}:${ae.adoptedSource.variantId}`);return B},[Pe]),Ge=v.useMemo(()=>[...ce.filter(ae=>ae.sessionId!==be&&!$e.has(`${ae.sessionId}:${ae.variantId}`))].sort((ae,Te)=>{const pe=new Date(ae.createdAt).getTime(),me=new Date(Te.createdAt).getTime();return(Number.isNaN(me)?0:me)-(Number.isNaN(pe)?0:pe)}),[$e,ce,be]),tt=v.useMemo(()=>O?Pe.find(B=>{var ae,Te;return((ae=B.adoptedSource)==null?void 0:ae.sessionId)===O.sessionId&&((Te=B.adoptedSource)==null?void 0:Te.variantId)===O.variantId})??null:null,[O,Pe]),bt=v.useMemo(()=>O?Ge.find(B=>B.sessionId===O.sessionId&&B.variantId===O.variantId)??null:null,[O,Ge]),nt=t.active?t.projectContext:null,Ye=(nt==null?void 0:nt.kind)==="fresh"?nt.workspacePath:n,an=!t.active&&Ge.length>0&&Ge.every(B=>B.projectKind==="fresh"),ln=t.active?iK(nt):!!n&&!an,Fn=v.useMemo(()=>Ye?`?projectPath=${encodeURIComponent(Ye)}`:"",[Ye]),xo=v.useRef(null),Zn=v.useRef(null),us=typeof window>"u"?"/":AA(window.location.pathname)??"/",yr=v.useRef(null),ir=v.useRef(!1),_r=v.useCallback((B,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),j1(),yr.current={kind:"live",variantId:B,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]),$l=v.useCallback((B,ae)=>{ae.button!==0&&ae.pointerType==="mouse"||(ae.preventDefault(),j1(),yr.current={kind:"past",entry:B,startX:ae.clientX,startY:ae.clientY,committed:!1})},[]);v.useEffect(()=>{const B=pe=>{const me=yr.current;if(!me)return;const Ee=pe.clientX-me.startX,qe=pe.clientY-me.startY;if(!me.committed){if(Ee*Ee+qe*qe<Q4*Q4)return;if(j1(),me.kind==="live"){const Ce=Pe.find(hs=>hs.workItemId===me.variantId);if(!Ce||Ce.status!=="succeeded"){yr.current=null;return}const Vn=Y4({sessionId:be,variant:Ce,projectContext:nt,routePath:us});b({sessionId:be??"",variantId:Ce.workItemId,label:Ce.label||"Direction",url:Vn,source:"live",runLabel:Ce.runLabel,description:Ce.description})}else{const{entry:Ce}=me,Vn=_u(Ce),hs=Vn?tK({sessionId:Ce.sessionId,variantId:Ce.variantId,routePath:us}):`/api/variants/history/${encodeURIComponent(Ce.sessionId)}/${encodeURIComponent(Ce.variantId)}/preview${Fn}`;if(b({sessionId:Ce.sessionId,variantId:Ce.variantId,label:Ce.label||"Direction",url:hs,source:Vn?"history-dev-server":"history-static",runLabel:Ce.runLabel,description:Ce.brief}),Vn){const Os=e6(`/api/variants/history/${encodeURIComponent(Ce.sessionId)}/${encodeURIComponent(Ce.variantId)}/run${Fn}`,"targetAddressed","1");(async()=>{try{if(!(await fetch(Os,{method:"POST"})).ok)return;const xr=e6(hs,"replay",String(Date.now()));b(gn=>!gn||gn.sessionId!==Ce.sessionId||gn.variantId!==Ce.variantId||gn.source!=="history-dev-server"?gn:{...gn,url:xr}),I(gn=>{if(!gn)return gn;const Ri=rt=>!rt||rt.sessionId!==Ce.sessionId||rt.variantId!==Ce.variantId?rt:{...rt,url:xr};return{...gn,left:Ri(gn.left),right:Ri(gn.right)}})}catch(Ls){yn.warn("history replay drag boot failed",Ls)}})()}}me.committed=!0}P({x:pe.clientX,y:pe.clientY})},ae=()=>{const pe=yr.current;pe!=null&&pe.committed&&(ir.current=!0),yr.current=null,P(null)},Te=pe=>{if(pe.key!=="Escape")return;const me=yr.current;me!=null&&me.committed&&(me.kind==="past"&&_u(me.entry)&&mf({sessionId:me.entry.sessionId,variantId:me.entry.variantId,source:"history-dev-server"}),yr.current=null,b(null),P(null))};return window.addEventListener("pointermove",B),window.addEventListener("pointerup",ae),window.addEventListener("pointercancel",ae),window.addEventListener("keydown",Te),()=>{window.removeEventListener("pointermove",B),window.removeEventListener("pointerup",ae),window.removeEventListener("pointercancel",ae),window.removeEventListener("keydown",Te)}},[Pe,be,nt,us,Fn,b,P,I]);const en=v.useMemo(()=>{var ae;if(ie||N)return null;const B=L?Pe.find(Te=>Te.workItemId===L):null;return L&&!B?null:B?Vd(B)?B.workItemId:null:t.active?((ae=Pe.find(Te=>{var pe,me;return Vd(Te)&&(((pe=Te.preview)==null?void 0:pe.kind)==="static_artifact"||((me=Te.preview)==null?void 0:me.kind)==="dev_server")}))==null?void 0:ae.workItemId)??null:null},[L,N,ie,t,Pe]),bo=ie||ln&&L===null&&N===null&&en===null,So=v.useCallback(async B=>{var Te,pe,me,Ee;if(!be)return;const ae=(B==null?void 0:B.workItemId)??null;W({kind:"switch",variantId:ae??void 0});try{if(((Te=B==null?void 0:B.preview)==null?void 0:Te.kind)==="static_artifact"){if(y(!1),w(null),((pe=B.refinement)==null?void 0:pe.status)==="succeeded"){const Ce=B.preview.url.includes("?")?"&":"?";m(`${B.preview.url}${Ce}refinement=${encodeURIComponent(B.refinement.workItemId)}`)}else m(B.preview.url);p(Ce=>Ce+1);return}if(ae&&be&&t.active&&t.projectContext.kind==="fresh"&&((me=t.projectContext.executionPlan)==null?void 0:me.mode)!=="vite_app"&&((Ee=B==null?void 0:B.preview)==null?void 0:Ee.kind)!=="dev_server"){y(!1),w(null),m(`/api/variants/${be}/static/${ae}`),p(Ce=>Ce+1);return}const qe=B&&ae?Y4({sessionId:be,variant:B,projectContext:t.active?t.projectContext:null,routePath:us}):null;if(qe){y(!1),w(null),m(qe),p(Ce=>Ce+1);return}Se.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:ae,previewKind:B?V1(B):"none",hasPreview:!!(B!=null&&B.preview),hasPort:typeof(B==null?void 0:B.port)=="number",errorMessage:"No addressable dev-server preview URL"}),y(!1),w(null)}catch(qe){yn.warn("preview display failed",qe),Se.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:ae,previewKind:B?V1(B):"none",hasPreview:!!(B!=null&&B.preview),hasPort:typeof(B==null?void 0:B.port)=="number",errorMessage:qe instanceof Error?qe.message:String(qe)}),y(!1),w(null)}finally{W(null)}},[be,t,us,p,m,y,w]),As=v.useRef(!1),Rs=v.useRef(null),bn=v.useRef(0),cs=v.useCallback(()=>{if(bn.current++,_(!1),x(!1),!As.current)return;const B=Rs.current;As.current=!1,Rs.current=null;const ae=B?new URLSearchParams({sessionId:B.sessionId,variantId:B.variantId}):null,Te=ae?`/api/variants/history/replay/stop?${ae.toString()}`:"/api/variants/history/replay/stop";fetch(Te,{method:"POST"}).catch(pe=>yn.warn("history replay stop failed",pe))},[_,x]),Xs=v.useCallback(async B=>{if(be){W({kind:"switch",variantId:B.workItemId});try{const ae=await fetch(`/api/variants/${be}/preview-port`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variantId:B.workItemId})});if(!ae.ok){const Te=await Bi(ae);throw new Error(Te.message??`Preview restoration failed (${ae.status})`)}}catch(ae){yn.warn("preview restoration failed",ae),Se.capture("variants_panel.preview_display_failed",{sessionId:be,variantId:B.workItemId,previewKind:"dev_server",hasPreview:!1,hasPort:!1,errorMessage:ae instanceof Error?ae.message:String(ae)})}finally{W(null)}}},[be]),mn=v.useCallback(B=>{var Ee,qe,Ce,Vn,hs;if(ir.current){ir.current=!1;return}const ae=Vd(B),Te=B.status==="pending"||B.status==="running"||aK(B);cs();const pe=V1(B),me=Pe.find(Os=>Os.workItemId===L);Se.capture("variants_panel.preview_requested",{sessionId:be,fromVariantId:me==null?void 0:me.workItemId,toVariantId:B.workItemId,variantStatus:B.status,isPreviewReady:ae,isArmed:Te,previewKind:pe,hasPreview:!!B.preview,hasPort:typeof B.port=="number",viewEnabled:((qe=(Ee=B.actions)==null?void 0:Ee.view)==null?void 0:qe.enabled)??null,previewUnavailableReason:((Ce=B.previewUnavailable)==null?void 0:Ce.reason)??null}),A(B.workItemId),D(null),ae?(Zn.current=B.workItemId,Ne(!1),R(!0),So(B)):(Zn.current=null,Ne(!1),m(null),y(!1),Te&&Se.capture("variants_panel.preview_armed",{sessionId:be,fromVariantId:me==null?void 0:me.workItemId,toVariantId:B.workItemId,variantStatus:B.status,previewKind:pe,hasPreview:!!B.preview,hasPort:typeof B.port=="number",viewEnabled:((hs=(Vn=B.actions)==null?void 0:Vn.view)==null?void 0:hs.enabled)??null}),RA(B)&&Xs(B)),Se.capture("variants_panel.preview_switched",{sessionId:be,fromVariantId:me==null?void 0:me.workItemId,toVariantId:B.workItemId,armed:Te})},[L,be,R,A,D,cs,Xs,So,Pe,m,y]),ds=t.active?`${t.sessionId}:${t.stage}`:"inactive",Eo=v.useRef(!1);v.useEffect(()=>{if(r)return;let B=!1;return(async()=>{try{const ae=await fetch(`/api/variants/history${Fn}`,{credentials:"same-origin"});if(!ae.ok)return;const Te=await ae.json();if(B)return;const pe=(Te.variants??[]).filter(me=>{var Ee,qe;return((Ee=me.preview)==null?void 0:Ee.kind)==="static"||((qe=me.serve)==null?void 0:qe.kind)==="static"||_u(me)});if(!Eo.current&&!Ue.current&&ds==="inactive"&&pe.length>0&&pe.every(me=>me.projectKind==="fresh")){const me=[...pe].sort((Ee,qe)=>new Date(qe.createdAt).getTime()-new Date(Ee.createdAt).getTime()).find(Ee=>!_u(Ee));me&&(Eo.current=!0,D({sessionId:me.sessionId,variantId:me.variantId,previewKind:"static"}),Ne(!1),m(`/api/variants/history/${encodeURIComponent(me.sessionId)}/${encodeURIComponent(me.variantId)}/preview${Fn}`))}if(uK(ue.current,pe))return;ue.current=pe,we(pe)}catch(ae){yn.warn("Failed to load past variants",ae)}})(),()=>{B=!0}},[r,ds,Fn]);const Ii=v.useCallback(()=>{As.current=!1,Rs.current=null,_(!1),x(!1),D(null),A(null),Ne(!0),y(!1),w(null),m(null),p(B=>B+1)},[A,_,x,p,m,w,D,y]),Ai=v.useCallback(B=>{if(ir.current){ir.current=!1;return}if(R(!0),D({sessionId:B.sessionId,variantId:B.variantId,previewKind:_u(B)?"dev_server":"static"}),A(null),Ne(!1),_u(B)){const ae=++bn.current;As.current=!0,Rs.current={sessionId:B.sessionId,variantId:B.variantId},_(!0),x(!0),(async()=>{W({kind:"switch"}),Se.capture("variants_panel.history_replay_started",{sessionId:B.sessionId,variantId:B.variantId});const Te=pe=>Se.capture("variants_panel.history_replay_failed",{sessionId:B.sessionId,variantId:B.variantId,...pe});try{const pe=await fetch(`/api/variants/history/${encodeURIComponent(B.sessionId)}/${encodeURIComponent(B.variantId)}/run${Fn}`,{method:"POST"});if(ae!==bn.current)return;if(!pe.ok){const{errorCode:me}=await Bi(pe);yn.warn(`history replay failed: HTTP ${pe.status} ${me??""}`),Te({httpStatus:pe.status,errorCode:me}),Ii();return}x(!1),y(!0),w(null),m(null),p(me=>me+1),Se.capture("variants_panel.history_replay_ready",{sessionId:B.sessionId,variantId:B.variantId})}catch(pe){if(ae!==bn.current)return;yn.warn("history replay failed",pe),Te({errorMessage:pe instanceof Error?pe.message:String(pe)}),Ii()}finally{W(null)}})();return}cs(),y(!1),w(null),m(`/api/variants/history/${encodeURIComponent(B.sessionId)}/${encodeURIComponent(B.variantId)}/preview${Fn}`)},[Ii,W,_,x,p,D,A,m,w,R,y,cs,Fn]),We=v.useCallback(async()=>{cs();const B=()=>{R(!0),A(null),D(null),Ne(!0),Zn.current=null,y(!1),w(null),m(null),p(ae=>ae+1)};if(!be){B();return}W({kind:"switch"});try{const ae=await fetch(`/api/variants/${be}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})});if(!ae.ok){yn.warn(`switch to original failed: HTTP ${ae.status}`);return}B(),y(!0),Se.capture("variants_panel.preview_switched",{sessionId:be,fromVariantId:L,toVariantId:null,target:"original",armed:!1})}catch(ae){yn.warn("preview-port original switch failed",ae)}finally{W(null)}},[L,be,A,D,p,m,w,R,y,cs]),Gt=v.useCallback(async B=>{var Te,pe;const ae=((pe=(Te=B.actions)==null?void 0:Te.commit)==null?void 0:pe.enabled)??B.status==="succeeded";if(!(!be||!ae)){Se.capture("variants_panel.commit_clicked",{sessionId:be,variantId:B.workItemId,variantLabel:B.label}),W({kind:"commit",variantId:B.workItemId});try{const me=await fetch(`/api/variants/${be}/commit`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:B.workItemId})});if(!me.ok){const{message:qe,errorCode:Ce}=await Bi(me);yn.warn(`commit failed: HTTP ${me.status} ${Ce??""} ${qe??""}`),Se.capture("variants_panel.commit_failed",{sessionId:be,variantId:B.workItemId,httpStatus:me.status,errorCode:Ce??null,errorMessage:qe??null}),vt.error("Couldn't send direction",{description:qe??`The server rejected the request (HTTP ${me.status}). Try again, or pick a different direction.`});return}const Ee=await me.json().catch(()=>null);Se.capture("variants_panel.commit_succeeded",{sessionId:be,variantId:B.workItemId,payloadKind:(Ee==null?void 0:Ee.payloadKind)??null,duplicate:(Ee==null?void 0:Ee.duplicate)??!1}),vt.success(`Sent "${B.label}" to your project`,{description:(Ee==null?void 0:Ee.payloadKind)==="project-created"?`Project created at ${(Ee==null?void 0:Ee.destinationPath)??"destination"}.`:"Direction diff applied to your working tree (uncommitted)."}),(Ee==null?void 0:Ee.payloadKind)!=="project-created"&&(m(null),y(!1),p(qe=>qe+1))}catch(me){yn.warn("commit failed",me),Se.capture("variants_panel.commit_failed",{sessionId:be,variantId:B.workItemId,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:me instanceof Error?me.message:String(me)}),vt.error("Couldn't send direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[be,p,m,y]),Dt=v.useCallback(async(B,ae,Te)=>{Se.capture("variants_panel.deploy_clicked",{sessionId:B,variantId:ae,variantLabel:Te});try{const pe=await fetch(`/api/variants/${B}/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:ae,...n?{projectPath:n}:{}})});if(!pe.ok){const{message:qe,errorCode:Ce}=await Bi(pe);return yn.warn(`deploy failed: HTTP ${pe.status} ${Ce??""} ${qe??""}`),Se.capture("variants_panel.deploy_failed",{sessionId:B,variantId:ae,httpStatus:pe.status,errorCode:Ce??null,errorMessage:qe??null}),vt.error("Couldn't deploy this direction",{description:qe??`The server rejected the request (HTTP ${pe.status}). Try again.`}),null}const me=await pe.json().catch(()=>null),Ee=me==null?void 0:me.shareUrl;return Ee?(await navigator.clipboard.writeText(Ee).catch(()=>{}),Se.capture("variants_panel.deploy_succeeded",{sessionId:B,variantId:ae}),vt.success(`"${Te}" is live — link copied`,{action:{label:"Open",onClick:()=>window.open(Ee,"_blank","noopener")}}),Ee):(vt.error("Couldn't deploy this direction",{description:"The deploy host returned an unexpected response."}),null)}catch(pe){return yn.warn("deploy failed",pe),Se.capture("variants_panel.deploy_failed",{sessionId:B,variantId:ae,httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:pe instanceof Error?pe.message:String(pe)}),vt.error("Couldn't deploy this direction",{description:"Network or server error. Check that the Rivet backend is reachable and try again."}),null}},[n]),Sn=v.useCallback(async B=>{if(!be)return;const ae=$[B.workItemId];if(ae){await navigator.clipboard.writeText(ae).catch(()=>{}),vt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(ae,"_blank","noopener")}});return}W({kind:"deploy",variantId:B.workItemId});try{const Te=await Dt(be,B.workItemId,B.label);Te&&J(pe=>({...pe,[B.workItemId]:Te}))}finally{W(null)}},[be,$,Dt]),Hr=v.useCallback(async()=>{if(!(!be||Ve.length===0)){if(Jt){await navigator.clipboard.writeText(Jt).catch(()=>{}),vt.success("Canvas link copied",{action:{label:"Open",onClick:()=>window.open(Jt,"_blank","noopener")}});return}Se.capture("variants_panel.deploy_clicked",{sessionId:be,variantId:"canvas",variantLabel:"Canvas",variantCount:Ve.length}),W({kind:"deploy-canvas"});try{const B=await fetch(`/api/variants/${be}/canvas/deploy`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantIds:Ve.map(Ee=>Ee.workItemId),...n?{projectPath:n}:{}})});if(!B.ok){const{message:Ee,errorCode:qe}=await Bi(B);yn.warn(`canvas deploy failed: HTTP ${B.status} ${qe??""} ${Ee??""}`),Se.capture("variants_panel.deploy_failed",{sessionId:be,variantId:"canvas",httpStatus:B.status,errorCode:qe??null,errorMessage:Ee??null,variantCount:Ve.length}),vt.error("Couldn't share this canvas",{description:Ee??`The server rejected the request (HTTP ${B.status}). Try again.`});return}const ae=await B.json().catch(()=>null),Te=ae==null?void 0:ae.shareUrl;if(!Te){vt.error("Couldn't share this canvas",{description:"The deploy host returned an unexpected response."});return}const pe=Object.fromEntries(((ae==null?void 0:ae.variants)??[]).filter(Ee=>typeof Ee.variantId=="string"&&typeof Ee.shareUrl=="string").map(Ee=>[Ee.variantId,Ee.shareUrl])),me=Object.keys(pe).length>0?{...$,...pe}:$;me!==$&&J(me),await navigator.clipboard.writeText(Te).catch(()=>{}),j({key:t6(Ve,me),shareUrl:Te}),Se.capture("variants_panel.deploy_succeeded",{sessionId:be,variantId:"canvas",variantCount:Ve.length}),vt.success("Canvas is live — link copied",{action:{label:"Open",onClick:()=>window.open(Te,"_blank","noopener")}})}catch(B){yn.warn("canvas deploy failed",B),Se.capture("variants_panel.deploy_failed",{sessionId:be,variantId:"canvas",httpStatus:null,errorCode:"NETWORK_ERROR",errorMessage:B instanceof Error?B.message:String(B),variantCount:Ve.length}),vt.error("Couldn't share this canvas",{description:"Network or server error. Check that the Rivet backend is reachable and try again."})}finally{W(null)}}},[Jt,Ve,$,n,be]),Kt=v.useCallback(async B=>{const ae=`${B.sessionId}:${B.variantId}`,Te=X[ae];if(Te){await navigator.clipboard.writeText(Te).catch(()=>{}),vt.success("Share link copied",{action:{label:"Open",onClick:()=>window.open(Te,"_blank","noopener")}});return}ee(ae);try{const pe=await Dt(B.sessionId,B.variantId,B.label);pe&&oe(me=>({...me,[ae]:pe}))}finally{ee(null)}},[X,Dt]),un=v.useCallback(async B=>{if(be){Se.capture("variants_panel.remove_clicked",{sessionId:be,variantId:B.workItemId,variantLabelLength:B.label.length}),W({kind:"remove",variantId:B.workItemId});try{const ae=await fetch(`/api/variants/${be}/${B.workItemId}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:"{}"});if(!ae.ok){const{message:Te}=await Bi(ae);yn.warn(`remove failed: HTTP ${ae.status} ${Te??""}`),vt.error("Couldn't remove direction",{description:Te??`The server rejected the request (HTTP ${ae.status}). Try again.`});return}(B.workItemId===en||B.workItemId===L)&&(A(null),m(null),y(!1),p(Te=>Te+1))}catch(ae){yn.warn("remove failed",ae),vt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}}},[be,L,en,A,m,y,p]),or=v.useCallback(async B=>{if(!Ye){vt.error("Couldn't remove direction",{description:"No project path available."});return}Se.capture("variants_panel.remove_past_clicked",{sessionId:B.sessionId,variantId:B.variantId});const ae=`${B.sessionId}:${B.variantId}`,Te=pe=>pe.sessionId===B.sessionId&&pe.variantId===B.variantId;W({kind:"remove",variantId:ae}),we(pe=>pe.filter(me=>!Te(me))),N===ae&&(D(null),m(null),y(!1),p(pe=>pe+1));try{const pe=await fetch(`/api/variants/history/${encodeURIComponent(B.sessionId)}/${encodeURIComponent(B.variantId)}/remove`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({projectPath:Ye})});if(!pe.ok){const{message:me}=await Bi(pe);we(Ee=>Ee.some(Te)?Ee:[...Ee,B]),vt.error("Couldn't remove direction",{description:me??`The server rejected the request (HTTP ${pe.status}). Try again.`})}}catch(pe){yn.warn("remove past failed",pe),we(me=>me.some(Te)?me:[...me,B]),vt.error("Couldn't remove direction",{description:"Network or server error. Try again."})}finally{W(null)}},[Ye,N,D,m,y,p]),fs=v.useCallback(B=>{Y(B)},[]),jn=v.useCallback(async()=>{if(G)try{G.kind==="active"?await un(G.variant):await or(G.entry)}finally{Y(null)}},[G,un,or]),Qs=sK(G),Pc=(Z==null?void 0:Z.kind)==="remove"&&Z.variantId===Qs,[Bf,U0]=v.useState(null),[W0,Ms]=v.useState(null),Uf=v.useCallback(B=>{Ms(B)},[]),Wf=v.useCallback(()=>{Ms(null)},[]),G0=v.useCallback(async B=>{const ae=B.trim();if(ae)try{await navigator.clipboard.writeText(ae),vt.success("Copied")}catch{vt.error("Couldn't copy")}},[]),Gf=v.useCallback(async(B,ae)=>{Ms(null);const Te=ae.trim();if(!Te||B.kind==="original")return;if(B.kind==="active"){if(!be||Te===B.variant.label)return;Se.capture("variants_panel.rename",{sessionId:be,variantId:B.variant.workItemId,labelLength:Te.length,past:!1});try{const Ee=await fetch(`/api/variants/${be}/${B.variant.workItemId}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Te})});if(!Ee.ok){const{message:qe}=await Bi(Ee);vt.error("Couldn't rename direction",{description:qe??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){yn.warn("rename failed",Ee),vt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}return}const{entry:pe}=B;if(Te===pe.label.trim())return;if(!Ye){vt.error("Couldn't rename direction",{description:"No project path available."});return}Se.capture("variants_panel.rename",{sessionId:pe.sessionId,variantId:pe.variantId,labelLength:Te.length,past:!0});const me=Ee=>Ee.sessionId===pe.sessionId&&Ee.variantId===pe.variantId;we(Ee=>Ee.map(qe=>me(qe)?{...qe,label:Te}:qe));try{const Ee=await fetch(`/api/variants/history/${encodeURIComponent(pe.sessionId)}/${encodeURIComponent(pe.variantId)}/rename`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({label:Te,projectPath:Ye})});if(!Ee.ok){const{message:qe}=await Bi(Ee);we(Ce=>Ce.map(Vn=>me(Vn)?{...Vn,label:pe.label}:Vn)),vt.error("Couldn't rename direction",{description:qe??`The server rejected the request (HTTP ${Ee.status}). Try again.`})}}catch(Ee){yn.warn("rename failed",Ee),we(qe=>qe.map(Ce=>me(Ce)?{...Ce,label:pe.label}:Ce)),vt.error("Couldn't rename direction",{description:"Network or server error. Try again."})}},[be,Ye]);v.useEffect(()=>{if(xo.current!==be){const ae=xo.current===null;if(xo.current=be,Zn.current=null,j(null),m(null),y(!1),w(null),R(),A(null),D(null),Ne(!1),Eo.current=!1,!ae)return}if(N||ie||!en||t.active!==!0||Zn.current===en)return;const B=Pe.find(ae=>ae.workItemId===en);B&&(Zn.current=en,R(),So(B))},[be,N,ie,en,t,Pe,So,R,A,D,m,w,y]),v.useEffect(()=>{!O||!tt||(Zn.current=null,D(null),A(tt.workItemId),Ne(!1))},[tt,O,be,A,D]),v.useEffect(()=>{!O||tt||bt||D(null)},[tt,O,bt,be,D,Ge]),v.useEffect(()=>{const B=F.trim().toLowerCase(),ae=Pe.filter(Ce=>$u(B,Ce.label,Ce.runLabel)),Te=Ge.filter(Ce=>$u(B,Ce.label,Ce.runLabel,Ce.brief)),pe=ln&&$u(B,ox,ax);if(ae.length===0&&Te.length===0&&!pe)return;const me=[...ae.map(Ce=>({source:"live",variant:Ce})),...Te.map(Ce=>({source:"past",entry:Ce})),...pe?[{source:"original"}]:[]],Ee=Ce=>Ce.source==="live"?`live:${Ce.variant.workItemId}`:Ce.source==="past"?`past:${Ce.entry.sessionId}:${Ce.entry.variantId}`:t2,qe=Ce=>{if(XU())return;if(Ce.key==="Enter"){const rt=Pe.find(Yf=>Yf.workItemId===Bf);rt&&(Ce.preventDefault(),mn(rt));return}if(Ce.key!=="ArrowUp"&&Ce.key!=="ArrowDown")return;Ce.preventDefault();const Vn=L??en;let Os=Vn?`live:${Vn}`:null;N?Os=`past:${N}`:bo&&(Os=t2);const Ls=Os?me.findIndex(rt=>Ee(rt)===Os):-1;let xr;if(Ls===-1?xr=Ce.key==="ArrowDown"?0:me.length-1:Ce.key==="ArrowDown"?xr=Math.min(Ls+1,me.length-1):xr=Math.max(Ls-1,0),xr===Ls)return;const gn=me[xr];gn.source==="live"?mn(gn.variant):gn.source==="past"?Ai(gn.entry):We();const Ri=document.querySelector(`[data-variant-key="${Ee(gn)}"]`);Ri instanceof HTMLElement&&Ri.focus({preventScroll:!0})};return window.addEventListener("keydown",qe),()=>window.removeEventListener("keydown",qe)},[Pe,Ge,F,ln,L,N,bo,en,Bf,mn,Ai,We]);const Hl=Pe.find(B=>B.workItemId===en)??null,zl=N?Ge.find(B=>`${B.sessionId}:${B.variantId}`===N)??null:null,Tc=!!zl,K0=t.active?t.artifacts??[]:[],Ct=[...(t.active?Pe:[]).map(B=>({kind:"active",variant:B})),...Ge.map(B=>({kind:"past",entry:B})),...ln?[{kind:"original"}]:[]],Kf=F.trim().toLowerCase(),Aa=Kf?Ct.filter(B=>pK(B,Kf)):Ct,qf=new Set(Pe.map(B=>B.requestId).filter(Boolean)),Ra=e.filter(B=>!qf.has(B.requestId)),Bl=Ra.length>0,Ul=r&&!Bl&&Ct.length===0;return E.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[Ct.length>0?E.jsx("div",{className:"px-3 pt-2 pb-1",children:E.jsxs("div",{className:"relative",children:[E.jsx(IB,{size:13,className:"text-content-muted pointer-events-none absolute top-1/2 left-2 -translate-y-1/2"}),E.jsx("input",{type:"text",value:F,onChange:B=>K(B.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,E.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2",children:[Bl?E.jsx(TK,{groups:Ra}):null,Ul?E.jsx(IK,{}):null,t.active&&Ct.length===0&&!Bl&&!Ul?E.jsx(AK,{}):null,!t.active&&!Bl&&!Ul&&Ge.length===0&&!ln?E.jsx(RK,{isMCPSession:d,mcpEditor:h}):null,Ct.length>0&&Aa.length===0?E.jsxs("p",{className:"text-content-muted px-1 py-6 text-center text-xs",children:["No directions match “",F.trim(),"”."]}):null,Aa.length>0?E.jsx(yK,{rows:Aa,activeVariantId:L??en,activePastKey:N,isOriginalSelected:bo,busy:Z,editingKey:W0,onSelectActive:mn,onSelectPast:Ai,onSelectOriginal:We,onActivePointerDown:_r,onPastPointerDown:$l,onHover:U0,onRemove:B=>fs({kind:"active",variant:B}),onRemovePast:B=>fs({kind:"past",entry:B}),onStartRename:Uf,onCommitRename:Gf,onCancelRename:Wf,onCopyVariantContext:G0,activeSessionId:t.active?t.sessionId:null,projectPath:Ye}):null,t.active&&c?E.jsx(EK,{artifacts:K0}):null]}),Tc&&zl?E.jsx(xK,{entry:zl,deploying:se===N,deployedUrl:N?X[N]??null:null,onDeploy:Kt,isDeployDisabled:!i}):null,!Tc&&t.active?E.jsx(PK,{selectedVariant:Hl,busy:Z,onSend:Gt,onDeploy:Sn,onDeployCanvas:Hr,canDeploy:i&&(nt==null?void 0:nt.kind)==="fresh",canDeployCanvas:i&&a&&(nt==null?void 0:nt.kind)==="fresh",canSendToAgent:u,canvasVariantCount:Ve.length,canvasDeployedUrl:Jt,deployedUrl:Hl?$[Hl.workItemId]??null:null}):null,E.jsx(fK,{target:G,isConfirming:Pc,onCancel:()=>Y(null),onConfirm:jn})]})},dK=t=>t.kind==="active"?t.variant.label.trim()||"this direction":t.entry.label.trim()||"this direction",fK=({target:t,isConfirming:e,onCancel:n,onConfirm:r})=>{if(!t)return null;const s=dK(t);return E.jsx(Dw,{open:!0,onOpenChange:i=>{!i&&!e&&n()},children:E.jsxs(Nw,{children:[E.jsx(Fw,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(jw,{className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx(Vw,{className:"text-content text-base font-medium",children:"Remove direction?"}),E.jsxs($w,{className:"text-content-subtle text-sm leading-5",children:['This removes "',s,'" from the directions list.']}),E.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[E.jsx("button",{type:"button",onClick:n,disabled:e,className:"text-content-subtle hover:bg-main-hover hover:text-content rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),E.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"})]})]})})]})})},hK=t=>t.kind==="active"?`live:${t.variant.workItemId}`:t.kind==="past"?`past:${t.entry.sessionId}:${t.entry.variantId}`:t2,pK=(t,e)=>t.kind==="active"?$u(e,t.variant.label,t.variant.runLabel):t.kind==="past"?$u(e,t.entry.label,t.entry.runLabel,t.entry.brief):$u(e,ox,ax),mK=t=>t.length<=J4?t:`${t.slice(0,J4-1)}…`,gK=(t,e)=>t.kind==="active"?e?`${e}:${t.variant.workItemId}`:null:t.kind==="past"?`${t.entry.sessionId}:${t.entry.variantId}`:null,vK=t=>{var i,a;const e=[t.label.trim(),(i=t.description)==null?void 0:i.trim()].filter(u=>!!u).join(`
112
+ `);if(!t.reference)return e;const n=((a=t.projectPath)==null?void 0:a.trim())??"",r=n?` --project '${n.replace(/'/g,"'\\''")}'`:"",s=[`Rivet variant: ${t.reference}`,"To inspect the full variant context, run:",`rivet variants get ${t.reference}${r}`].join(`
113
+ `);return e?`${e}
114
+
115
+ ${s}`:s},yK=({rows:t,activeVariantId:e,activePastKey:n,isOriginalSelected:r,busy:s,editingKey:i,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:y,onStartRename:w,onCommitRename:_,onCancelRename:x,onCopyVariantContext:b,activeSessionId:P,projectPath:T})=>{const k=v.useRef(null),{activeIndex:I,itemRects:R,sessionRef:L,handlers:A,registerItem:O}=P5(k),D=I!==null?R[I]:null;return E.jsxs("div",{ref:k,className:"relative",onMouseEnter:A.onMouseEnter,onMouseMove:A.onMouseMove,onMouseLeave:A.onMouseLeave,children:[E.jsx(uo,{children:D&&E.jsx(Il.div,{className:"bg-hover pointer-events-none absolute z-0 rounded-md",initial:{opacity:0,top:D.top,left:D.left,width:D.width,height:D.height},animate:{opacity:1,top:D.top,left:D.left,width:D.width,height:D.height},exit:{opacity:0,transition:{duration:.06}},transition:{...of.fast,opacity:{duration:.08}}},L.current)}),E.jsx("ul",{className:"relative",children:t.map((N,F)=>{const K=hK(N);let Z=!1;return N.kind==="active"?Z=N.variant.workItemId===e:N.kind==="past"?Z=`${N.entry.sessionId}:${N.entry.variantId}`===n:Z=r,E.jsx(_K,{rowKey:K,row:N,index:F,isSelected:Z,isEditing:i===K,busy:s,registerItem:O,onSelectActive:a,onSelectPast:u,onSelectOriginal:c,onActivePointerDown:d,onPastPointerDown:h,onHover:p,onRemove:m,onRemovePast:y,onStartRename:w,onCommitRename:_,onCancelRename:x,onCopyVariantContext:b,activeSessionId:P,projectPath:T},K)})})]})},_K=({rowKey:t,row:e,index:n,isSelected:r,isEditing:s,busy:i,registerItem:a,onSelectActive:u,onSelectPast:c,onSelectOriginal:d,onActivePointerDown:h,onPastPointerDown:p,onHover:m,onRemove:y,onRemovePast:w,onStartRename:_,onCommitRename:x,onCancelRename:b,onCopyVariantContext:P,activeSessionId:T,projectPath:k})=>{var oe,se;const I=v.useRef(null);kU(a,n,I);const R=e.kind==="active",L=e.kind==="original",A=e.kind==="active"?e.variant:null,O=e.kind==="past"?e.entry:null,D=R?A.status==="succeeded":!0,N=R?Vd(A):!0,F=R&&(A.status==="pending"||A.status==="running"),K=R&&A.status==="failed",Z=R&&A.status==="cancelled",W=R&&(i==null?void 0:i.kind)==="remove"&&i.variantId===A.workItemId,G=R&&(((oe=A.refinement)==null?void 0:oe.status)==="pending"||((se=A.refinement)==null?void 0:se.status)==="running");let Y=ox;R?Y=A.label||`Direction ${n+1}`:O&&(Y=O.label.trim()||"Untitled direction");let $;R?$=A.runLabel:O&&($=O.runLabel);let J=ax;R?J=A.description:O&&(J=O.brief);const H=J?mK(J):null,j=gK(e,T),X=j?"Copy variant reference":"Copy description";return s?E.jsx("li",{ref:I,"data-proximity-index":n,className:"group relative z-10",children:E.jsx("div",{className:"bg-main-input flex w-full items-start gap-2 rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsx(wK,{initial:Y,onCommit:ee=>x(e,ee),onCancel:b}),H&&E.jsx("span",{className:"text-content-muted mt-1 line-clamp-2 block text-xs leading-snug",children:H})]})})}):E.jsxs("li",{ref:I,"data-proximity-index":n,className:"group relative z-10",children:[E.jsx("div",{role:"button",tabIndex:0,"data-variant-id":R?A.workItemId:void 0,"data-variant-key":t,onClick:()=>{const ee=window.getSelection();ee&&!ee.isCollapsed||(e.kind==="active"?u(e.variant):e.kind==="past"?c(e.entry):d())},onKeyDown:ee=>{(ee.key==="Enter"||ee.key===" ")&&(ee.preventDefault(),ee.stopPropagation(),e.kind==="active"?u(e.variant):e.kind==="past"?c(e.entry):d())},onPointerDown:ee=>{e.kind==="active"?N&&h(e.variant.workItemId,ee):e.kind==="past"&&p(e.entry,ee)},"aria-pressed":r,"aria-disabled":R?!1:void 0,"aria-busy":F||G,onMouseEnter:R?()=>m(A.workItemId):void 0,onMouseLeave:R?()=>m(null):void 0,className:vr("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",N&&"cursor-grab active:cursor-grabbing",!N&&"cursor-pointer"),style:N?{touchAction:"none"}:void 0,children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[(F||G)&&E.jsx(Ww,{className:"text-content-muted shrink-0 text-sm","data-testid":G&&!F?"variant-refining":void 0}),E.jsx(ao,{label:"Double-click to rename",disabled:L,children:E.jsx("span",{onDoubleClick:ee=>{ee.stopPropagation(),L||_(t)},className:vr("min-w-0 flex-1 truncate text-sm font-medium select-text",L?"cursor-default":"cursor-text",D||r?"text-content":"text-content-muted"),children:Y})}),K&&E.jsx(ao,{label:A.errorMessage??A.errorCode??"Failed",disabled:!A.errorMessage&&!A.errorCode,children:E.jsx("span",{className:"shrink-0",children:E.jsx(n6,{label:"Failed"})})}),Z&&E.jsx(n6,{label:"Cancelled"}),$&&E.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:k5($),children:$})]}),H&&E.jsx("span",{className:"text-content-muted mt-0.5 line-clamp-2 block cursor-text text-xs leading-snug select-text",children:H})]})}),E.jsxs("div",{className:vr("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:[J||j?E.jsx(ao,{label:X,children:E.jsx("button",{type:"button","aria-label":X,onClick:ee=>{ee.stopPropagation(),P(vK({label:Y,description:J,reference:j,projectPath:k}))},onPointerDown:ee=>ee.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:E.jsx(sf,{size:13,weight:"bold"})})}):null,!L&&E.jsx(ao,{label:"Rename",children:E.jsx("button",{type:"button","aria-label":"Rename direction",onClick:ee=>{ee.stopPropagation(),_(t)},onPointerDown:ee=>ee.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:E.jsx(AB,{size:13,weight:"bold"})})}),!L&&E.jsx(ao,{label:"Remove",children:E.jsx("button",{type:"button","data-variant-remove-id":e.kind==="active"?e.variant.workItemId:void 0,"aria-label":"Remove direction",disabled:W,onClick:ee=>{ee.stopPropagation(),e.kind==="active"?y(e.variant):w(e.entry)},onPointerDown:ee=>ee.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:E.jsx(OB,{size:13,weight:"bold"})})})]})]})},wK=({initial:t,onCommit:e,onCancel:n})=>{const[r,s]=v.useState(t),i=v.useRef(!1),a=v.useCallback(c=>{c&&(c.focus(),c.select())},[]),u=c=>{i.current||(i.current=!0,c?e(r):n())};return E.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"})},n6=({label:t})=>E.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}),xK=({entry:t,deploying:e,deployedUrl:n,onDeploy:r,isDeployDisabled:s=!1})=>{const a=e?"Deploying…":n?"Copy link":"Share";return E.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:[E.jsxs("div",{className:"min-w-0",children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),n?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}),E.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?E.jsx(sf,{size:12,weight:"bold"}):null,a]})]})},bK={agent_browser:"Browser extracted",cache:"Cached",static:"Bundled catalog",manual:"Manual"},SK={design_context:"DESIGN.md",source_context:"Source",qa_report:"QA",asset:"Asset"},EK=({artifacts:t})=>{const[e,n]=v.useState(null),r=v.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 E.jsxs("section",{"aria-label":"Directions session artifacts",className:"mt-4",children:[E.jsx("div",{className:"flex shrink-0 items-center px-3 py-2",children:E.jsx("span",{className:"text-content truncate text-sm font-medium",children:"Artifacts"})}),E.jsx("ul",{className:"mt-2 space-y-1 px-1",children:t.map(i=>E.jsx(CK,{artifact:i,isExpanded:i.id===r,onToggle:()=>s(i.id)},i.id))})]})},CK=({artifact:t,isExpanded:e,onToggle:n})=>{const r=SK[t.kind],s=t.source?bK[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?E.jsx("li",{className:"border-main-border rounded-md border",children:E.jsxs("div",{className:"flex w-full items-center justify-between gap-2 px-3 py-2 text-left text-xs",children:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.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}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("a",{href:t.viewUrl,target:"_blank",rel:"noreferrer",onClick:()=>{Se.capture("visual_editor_design_context_opened",{context_kind:"design_system",artifact_source:t.source})},"aria-label":`Open ${r} artifact${t.label?`: ${t.label}`:""}`,className:"text-content-muted hover:bg-main-input hover:text-content focus-visible:ring-content-muted/40 shrink-0 rounded p-1 transition-colors focus:outline-none focus-visible:ring-1",children:E.jsx(CB,{className:"h-3.5 w-3.5",weight:"bold"})})]})}):E.jsxs("li",{className:"border-main-border rounded-md border",children:[E.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:[E.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-content-muted text-[10px] font-semibold tracking-wide uppercase",children:r}),E.jsx("span",{className:"text-content truncate text-xs font-medium",children:t.label})]}),i?E.jsx("span",{className:"text-content-muted mt-0.5 truncate text-[11px]",children:i}):null]}),E.jsx("span",{className:"text-content-muted shrink-0 text-[11px]",children:e?"Hide":"View"})]}),e?E.jsx("div",{className:"border-main-border bg-main-light border-t px-3 py-2",children:E.jsx(kK,{artifact:t})}):null]})},kK=({artifact:t})=>E.jsxs("div",{className:"text-content-muted space-y-1 text-[11px]",children:[t.summary?E.jsx("p",{children:t.summary}):null,t.path?E.jsxs("p",{children:["Stored at ",t.path]}):null,!t.summary&&!t.path?E.jsx("p",{children:"No inline content available for this artifact."}):null]}),PK=({selectedVariant:t,busy:e,onSend:n,onDeploy:r,onDeployCanvas:s,canDeploy:i,canDeployCanvas:a,canSendToAgent:u,canvasVariantCount:c,canvasDeployedUrl:d,deployedUrl:h})=>{var L,A,O,D;const p=t?((A=(L=t.actions)==null?void 0:L.commit)==null?void 0:A.enabled)??t.status==="succeeded":!1,m=p&&e===null,y=(e==null?void 0:e.kind)==="commit"&&e.variantId===(t==null?void 0:t.workItemId),w=(e==null?void 0:e.kind)==="deploy"&&e.variantId===(t==null?void 0:t.workItemId),_=(e==null?void 0:e.kind)==="deploy-canvas",x=!i||!p||e!==null,b=a&&c>0,T=w?"Deploying…":h?"Copy link":"Share",I=_?"Sharing…":d?"Copy canvas link":"Share canvas",R=y?"Applying…":"Apply to project";return E.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:[E.jsx("div",{className:"min-w-0",children:t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"text-content truncate text-sm font-medium",children:t.label.trim()||"Untitled direction"}),h?E.jsx("div",{className:"text-content-muted text-[11px]",children:"Deployed — share link ready"}):null]}):null}),E.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[E.jsx(gA,{primaryLabel:T,primaryIcon:h&&!w?sf:void 0,primaryAction:()=>{t&&r(t)},isDisabled:x,isDropdownDisabled:e!==null,isLoading:w,loadingLabel:"Deploying…",dropdownAriaLabel:"More share actions",dropdownItems:b?[{label:I,icon:d&&!_?sf:void 0,onClick:s,isDisabled:e!==null}]:[]}),u?E.jsx("button",{type:"button",onClick:()=>{t&&n(t)},disabled:!m,title:(D=(O=t==null?void 0:t.actions)==null?void 0:O.commit)==null?void 0:D.reason,className:"bg-secondary text-secondary-foreground hover:bg-accent rounded-md px-2 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:R}):null]})]})},MA=()=>E.jsx("div",{"data-testid":"direction-skeleton-row","aria-hidden":"true",className:"flex w-full items-start rounded-md px-3 py-2",children:E.jsxs("span",{className:"min-w-0 flex-1",children:[E.jsxs("span",{className:"flex items-center gap-2",children:[E.jsx(Ww,{className:"text-content-muted shrink-0 text-sm"}),E.jsx("span",{className:"bg-muted-foreground/15 h-3.5 w-28 animate-pulse rounded"})]}),E.jsx("span",{className:"mt-1.5 flex",children:E.jsx("span",{className:"bg-muted-foreground/10 h-2.5 w-full max-w-[14rem] animate-pulse rounded"})})]})}),TK=({groups:t})=>E.jsx("div",{className:"space-y-0.5",children:t.flatMap(e=>Array.from({length:Math.max(1,e.count)}).map((n,r)=>E.jsx(MA,{},`${e.requestId}-${r}`)))}),IK=()=>E.jsx("div",{"data-testid":"direction-boot-skeletons",className:"space-y-0.5",children:Array.from({length:3}).map((t,e)=>E.jsx(MA,{},e))}),AK=()=>E.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[E.jsx("div",{className:"text-content text-sm",children:"No directions yet"}),E.jsx("div",{className:"text-content-muted text-xs",children:"They’ll appear here as they generate."})]}),r6="Try different ways to create a dropdown that feels fluid and dynamic",RK=({isMCPSession:t=!1,mcpEditor:e=null})=>{const[n,r]=v.useState(!1),s=QU(e),i=t?s:"your coding agent",a=()=>{navigator.clipboard.writeText(r6).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})};return E.jsxs("div",{className:"flex flex-col items-start gap-3 px-2 py-2",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"Create your first direction"}),E.jsxs("p",{className:"text-content-muted text-xs",children:["Use ",i," to generate directions."]}),E.jsxs("div",{className:"w-full",children:[E.jsx("p",{className:"text-content-muted mb-2 text-xs",children:"Here's a sample prompt to use:"}),E.jsxs("div",{className:"border-main-border bg-main-input relative rounded-md border px-3 py-2.5 pr-8",children:[E.jsxs("p",{className:"text-content-muted text-xs leading-snug",children:["“",r6,"”"]}),E.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?E.jsx(QI,{className:"h-3.5 w-3.5 text-emerald-500",weight:"bold"}):E.jsx(sf,{className:"h-3.5 w-3.5",weight:"bold"})})]})]})]})},MK=({onClose:t})=>{const e=et(L5);return t?E.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?E.jsx("span",{className:"text-content min-w-0 truncate text-sm font-medium",title:e,children:e}):E.jsx("span",{}),E.jsx(ao,{label:"Close panel",side:"bottom",children:E.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:E.jsx(RB,{className:"h-4 w-4",weight:"bold"})})})]}):null},OK='[data-menu-item]:not([disabled]):not([aria-disabled="true"])',LK=({itemSelector:t=OK,loop:e=!1}={})=>{const n=v.useRef(null),r=v.useRef(null),s=v.useCallback(a=>{var u;n.current=a,a?r.current=YU():((u=r.current)==null||u.call(r),r.current=null)},[]),i=v.useCallback(a=>{var w;const{key:u}=a;if(u!=="ArrowDown"&&u!=="ArrowUp"&&u!=="Home"&&u!=="End")return;const c=n.current;if(!c)return;const d=Array.from(c.querySelectorAll(t));if(d.length===0)return;a.preventDefault(),a.stopPropagation();const h=d.indexOf(document.activeElement),p=d.length-1,m=_=>{if(h===-1)return _===1?0:p;const x=h+_;return e?(x+d.length)%d.length:Math.min(Math.max(x,0),p)};let y;u==="Home"?y=0:u==="End"?y=p:u==="ArrowDown"?y=m(1):y=m(-1),(w=d[y])==null||w.focus()},[t,e]);return{containerRef:s,onKeyDown:i}},s6="/assets/arena-Db0j1set.png",DK=Is("useIntegrations"),$1=["integrations"],NK="rivet:connect-result",FK=t=>typeof t=="object"&&t!==null&&t.type===NK,jK=it(null),i6=async()=>{const t=await fetch("/api/integrations");if(!t.ok)throw new Error(`Failed to load integrations (${t.status})`);return(await t.json()).integrations??[]},VK=()=>{const t=S8(),[e,n]=_3(jK),r=xy({queryKey:$1,queryFn:i6,staleTime:1e4}),s=v.useCallback(async()=>(await t.invalidateQueries({queryKey:$1,refetchType:"none"}),t.fetchQuery({queryKey:$1,queryFn:i6})),[t]),i=v.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 d=await fetch(`/api/integrations/${u}/connect`,{method:"POST"}),h=await d.json().catch(()=>({}));if(!d.ok||!h.authUrl)throw c.close(),new Error(h.error||`Could not connect ${u}`);return c.location.href=h.authUrl,await new Promise(p=>{let m=!1,y=null;const w=async(x,b=!1)=>{if(!m){m=!0,window.removeEventListener("message",_),y&&clearInterval(y);try{const T=(await s()).some(k=>k.provider===u&&k.status==="connected");p(b&&T?"connected":x)}catch{p(x)}}},_=x=>{if(FK(x.data)&&x.data.provider===u){if(x.data.status==="error"){DK.warn(`Connect failed for ${u}:`,x.data.message),w("failed");return}w("connected")}};window.addEventListener("message",_),y=setInterval(()=>{c.closed&&w("closed",!0)},500)})}finally{n(null)}},[s,n]),a=v.useCallback(async u=>{n(u);try{const c=await fetch(`/api/integrations/${u}`,{method:"DELETE"});if(!c.ok){const d=await c.json().catch(()=>({}));throw new Error(d.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}},Hu=({onClick:t,title:e,shortcut:n,children:r,disabled:s=!1,className:i="",type:a="button","data-cy":u})=>{const c=E.jsx("button",{onClick:t,disabled:s,className:i,type:a,"data-cy":u,children:r});return e?E.jsx(ix,{content:E.jsxs("div",{className:"flex flex-row items-center gap-2",children:[E.jsx("span",{children:e}),n?E.jsx("span",{className:"rounded bg-white/15 px-1.5 py-0.5 text-[11px]",children:n}):null]}),children:c}):c},Qa=({action:t,outcome:e,provider:n,entryPoint:r,durationMs:s,failureReason:i})=>({event:`visual_editor_reference_${t==="connect"?"connection":"disconnection"}_${e}`,properties:{provider:n,entry_point:r,...s!==void 0?{duration_ms:s}:{},...i?{failure_reason:i}:{}}}),o6=Is("ConnectorsModal"),$K=()=>E.jsx("svg",{viewBox:"0 0 24 24",className:"h-6 w-6","aria-hidden":"true",children:E.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"})}),HK=()=>E.jsx("span",{"aria-hidden":"true",className:"h-6 w-6 bg-[#b1b1b1]",style:{WebkitMaskImage:`url(${s6})`,maskImage:`url(${s6})`,WebkitMaskSize:"contain",maskSize:"contain",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center"}}),zK=[{provider:"pinterest",name:"Pinterest",description:"Pull boards and pins in as visual references.",tileClassName:"bg-[#e60023] text-white",icon:E.jsx($K,{})},{provider:"arena",name:"Are.na",description:"Connect channels of collected blocks and links.",tileClassName:"bg-[#18181b] text-content",icon:E.jsx(HK,{})}],BK=({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 E.jsxs("article",{className:`bg-main-light flex flex-col rounded-xl p-[18px] ${r?"ring-secondary ring-2":""}`,children:[E.jsx("span",{className:`grid h-[52px] w-[52px] flex-none place-items-center rounded-xl ${t.tileClassName}`,"aria-hidden":"true",children:t.icon}),E.jsxs("div",{className:"mt-4 flex-1",children:[E.jsxs("h2",{className:"text-content flex items-center gap-1.5 text-[15px] font-semibold",children:[t.name,a?E.jsx(QI,{className:"h-3.5 w-3.5",weight:"bold","aria-hidden":"true"}):null]}),E.jsx("p",{className:"text-content-subtle mt-1 text-[13px] leading-relaxed",children:t.description}),a&&u?E.jsx("p",{className:"text-content-muted mt-2.5 text-xs font-medium",children:u}):null]}),a?E.jsx("button",{type:"button",onClick:i,disabled:n,className:"active-push bg-main-input text-content-muted mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors hover:bg-red-500/10 hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-50",children:n?"Disconnecting…":"Disconnect"}):E.jsx("button",{type:"button",onClick:s,disabled:n,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent mt-[18px] inline-flex min-h-[38px] w-full items-center justify-center rounded-lg px-3.5 text-[13px] font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",children:n?"Connecting…":"Connect"})]})},n2=({isOpen:t,onClose:e,context:n="menu",highlightProvider:r=null})=>{const{integrations:s,isLoading:i,error:a,pendingProvider:u,connect:c,disconnect:d}=VK(),h=g0(),[p,m]=v.useState(null),y=b=>s.find(P=>P.provider===b),w=v.useCallback(b=>{const P=Date.now(),T=Qa({action:"connect",outcome:"started",provider:b,entryPoint:n});h==null||h.capture(T.event,T.properties),c(b).then(k=>{const I=Date.now()-P;if(k==="connected"){const L=Qa({action:"connect",outcome:"completed",provider:b,entryPoint:n,durationMs:I});h==null||h.capture(L.event,L.properties);return}const R=Qa({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:I,failureReason:k==="closed"?"popup_closed":"provider_failed"});h==null||h.capture(R.event,R.properties)}).catch(k=>{const I=k instanceof Error?k.message:"Could not connect.",R=Qa({action:"connect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-P,failureReason:I.includes("Popup blocked")?"popup_blocked":"request_failed"});h==null||h.capture(R.event,R.properties),o6.warn(`Connect error for ${b}:`,I),vt.error(I)})},[c,n,h]),_=v.useCallback(b=>{const P=Date.now(),T=Qa({action:"disconnect",outcome:"started",provider:b,entryPoint:n});h==null||h.capture(T.event,T.properties),d(b).then(()=>{const k=Qa({action:"disconnect",outcome:"completed",provider:b,entryPoint:n,durationMs:Date.now()-P});h==null||h.capture(k.event,k.properties)}).catch(k=>{const I=k instanceof Error?k.message:"Could not disconnect.",R=Qa({action:"disconnect",outcome:"failed",provider:b,entryPoint:n,durationMs:Date.now()-P,failureReason:"request_failed"});h==null||h.capture(R.event,R.properties),o6.warn(`Disconnect error for ${b}:`,I),vt.error(I)})},[n,d,h]),x=n==="onboarding";return E.jsx(Dw,{open:t,onOpenChange:b=>!b&&e(),children:E.jsxs(Nw,{children:[E.jsx(Fw,{className:"z-max fixed inset-0 bg-black/40"}),E.jsx(jw,{ref:m,className:"z-max border-main-border bg-main font-main fixed top-1/2 left-1/2 w-[560px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-2xl outline-none",children:E.jsxs(TA,{value:p,children:[E.jsxs("div",{className:"border-main-border bg-main-light flex items-center justify-between rounded-t-lg border-b px-4 py-2",children:[E.jsx(Vw,{className:"text-content text-base font-medium",children:"Connect design references"}),E.jsx(Hu,{onClick:e,title:"Close",className:"text-content-subtle hover:bg-main-hover hover:text-content rounded p-1 transition-colors",children:E.jsx(c5,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[E.jsx($w,{className:"text-content-subtle text-sm",children:"Connect your design references to use them with Rivet’s MCP."}),a?E.jsx("p",{className:"rounded-lg bg-red-500/10 px-4 py-3 text-[13px] font-medium text-red-300",children:a}):null,E.jsx("div",{className:"grid grid-cols-2 gap-4",children:zK.map(b=>E.jsx(BK,{meta:b,integration:y(b.provider),isPending:i||u===b.provider,isHighlighted:r===b.provider,onConnect:()=>w(b.provider),onDisconnect:()=>_(b.provider)},b.provider))}),x?E.jsxs("div",{className:"flex items-center justify-between gap-4",children:[E.jsx("p",{className:"text-content-subtle text-xs",children:"You can always do this later from the account menu."}),E.jsx("button",{type:"button",onClick:e,className:"active-push bg-secondary text-secondary-foreground hover:bg-accent flex-none rounded-lg px-3.5 py-2 text-[13px] font-medium transition-colors",children:"Skip for now"})]}):null]})]})})]})})},a6=({className:t=""})=>E.jsx("span",{"aria-hidden":"true",className:`rivet-skeleton block rounded ${t}`.trim()}),UK=Is("SupportTicketModal"),l6=5e3,H1="feedback",WK=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},GK=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=WK(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}`},KK=({isOpen:t,onClose:e,contactEmail:n})=>{const r=g0(),[s,i]=v.useState(""),[a,u]=v.useState(!1),[c,d]=v.useState(null),h=v.useCallback(()=>{i("")},[]),p=v.useCallback(()=>{a||(h(),e())},[a,e,h]),m=v.useCallback(async()=>{const x=s.trim();if(!(!x||a)){u(!0);try{const b=typeof(r==null?void 0:r.get_session_id)=="function"?r.get_session_id():void 0,P=typeof(r==null?void 0:r.get_distinct_id)=="function"?r.get_distinct_id():void 0,T=n==null?void 0:n.trim(),k=await fetch("/api/support/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:H1,message:x,contactEmail:T||void 0,metadata:{posthogSessionId:b??void 0,posthogDistinctId:P??void 0,appVersion:"0.14.22",appEnvironment:"production",pageUrl:window.location.href,userAgent:navigator.userAgent,submittedAt:new Date().toISOString()}})});if(!k.ok){const I=await GK(k);throw new Error(I)}r==null||r.capture("support_ticket_submitted",{ticket_type:H1,has_posthog_session_id:!!b}),vt.success("Feedback sent",{description:"Thanks for sharing this."}),h(),e()}catch(b){const P=b instanceof Error?b.message:"Failed to send message";r==null||r.capture("support_ticket_submit_failed",{ticket_type:H1,error:P}),UK.error("Failed to submit support ticket:",P),vt.error("Could not send feedback",{description:P})}finally{u(!1)}}},[n,a,s,e,r,h]),y=v.useCallback(x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),m())},[m]),w=l6-s.length,_=a||s.trim().length===0;return E.jsx(Dw,{open:t,onOpenChange:x=>!x&&p(),children:E.jsxs(Nw,{children:[E.jsx(Fw,{className:"fixed inset-0 z-max bg-black/40"}),E.jsx(jw,{ref:d,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:E.jsxs(TA,{value:c,children:[E.jsxs("div",{className:"flex items-center justify-between rounded-t-lg border-b border-main-border bg-main-light px-4 py-2",children:[E.jsx(Vw,{className:"text-base font-medium text-content",children:"Send feedback"}),E.jsx(Hu,{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:E.jsx(c5,{className:"h-4 w-4",weight:"bold"})})]}),E.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[E.jsx($w,{className:"text-sm text-content-subtle",children:"Tell us what happened or what we can improve."}),E.jsxs("div",{className:"rounded-lg bg-main-input outline outline-1 outline-transparent transition-[outline-color] focus-within:outline-white/20",children:[E.jsx("textarea",{id:"support-ticket-message","aria-label":"Your feedback",value:s,onChange:x=>i(x.target.value),onKeyDown:y,maxLength:l6,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"}),E.jsxs("div",{className:"flex items-center justify-between px-3 pb-3 pt-1",children:[E.jsx("span",{className:"text-xs text-content-subtle",children:"Context details are included automatically."}),E.jsxs("div",{className:"flex items-center gap-2",children:[w<=500&&E.jsx("span",{className:"text-xs text-content-subtle",children:w}),E.jsx(Hu,{onClick:m,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?E.jsx(k0,{className:"h-5 w-5 animate-spin",weight:"bold"}):E.jsx(kB,{className:"h-5 w-5",weight:"bold"})})]})]})]})]})]})})]})})},qK=Is("ProfileAvatar"),OA=(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):""},ZK=(t,e)=>OA(t,e).charAt(0).toUpperCase(),YK=({className:t="",side:e="bottom",align:n="end"})=>{const{name:r,email:s}=et(N5),i=et(H5),[a,u]=v.useState(!1),[c,d]=v.useState(!1),[h,p]=v.useState(!1),[m,y]=v.useState(!1),{containerRef:w,onKeyDown:_}=LK(),x=et(Ff),b=ZK(r,s);if(!b)return x?E.jsxs("span",{"data-testid":"profile-avatar-skeleton","aria-hidden":"true",className:`flex shrink-0 items-center gap-2 ${t}`.trim(),children:[E.jsx(a6,{className:"h-7 w-7 rounded-full"}),E.jsx(a6,{className:"h-3 w-16"})]}):null;const P=OA(r,s),T=(r==null?void 0:r.trim())||null,k=(s==null?void 0:s.trim())||null,I=async()=>{y(!0);try{const R=await fetch("/api/auth/logout",{method:"POST",credentials:"same-origin"});if(!R.ok)throw new Error(`Logout failed: ${R.status}`)}catch(R){qK.warn("Logout request failed",R),vt.error("Could not log out. Please try again."),y(!1);return}window.location.reload()};return E.jsxs(E.Fragment,{children:[E.jsxs(fA,{open:a,onOpenChange:u,children:[E.jsx(hA,{asChild:!0,children:E.jsxs("button",{type:"button","aria-label":"Account",className:`text-content-muted hover:text-content flex shrink-0 items-center gap-2 transition-colors select-none ${t}`,children:[E.jsx("span",{className:"border-main-border bg-main-input flex h-7 w-7 items-center justify-center rounded-full border text-[11px] leading-none font-semibold",children:b}),P?E.jsx("span",{className:"max-w-[8rem] truncate text-xs font-medium",children:P}):null]})}),E.jsx(pA,{children:E.jsxs(mA,{ref:w,onKeyDown:_,role:"menu",className:"bg-surface-2 z-[60] min-w-[180px] rounded-lg p-1 shadow-lg",side:e,sideOffset:6,align:n,children:[T||k?E.jsxs("div",{className:"border-main-border border-b px-3 py-2",children:[T?E.jsx("div",{className:"text-content truncate text-xs font-medium",children:T}):null,k?E.jsx("div",{className:"text-content-muted truncate text-[11px]",children:k}):null]}):null,E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u(!1),d(!0)},disabled:!i,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[E.jsx(a5,{className:"h-3.5 w-3.5",weight:"bold"}),"Connect design references"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:()=>{u(!1),p(!0)},className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none",children:[E.jsx(TB,{className:"h-3.5 w-3.5",weight:"bold"}),"Share feedback"]}),E.jsxs("button",{type:"button",role:"menuitem","data-menu-item":!0,onClick:I,disabled:m,className:"text-content hover:bg-hover focus:bg-hover mt-1 flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-xs transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:[E.jsx(MB,{className:"h-3.5 w-3.5",weight:"bold"}),m?"Logging out…":"Log out"]})]})})]}),E.jsx(n2,{isOpen:c,onClose:()=>d(!1)}),E.jsx(KK,{isOpen:h,onClose:()=>p(!1),contactEmail:s??void 0})]})},XK=({onClose:t})=>E.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:[E.jsx(MK,{onClose:t}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:E.jsx(cK,{})}),E.jsx("div",{className:"border-main-border bg-main-light flex flex-shrink-0 items-center border-t px-2.5 py-1.5",children:E.jsx(YK,{side:"top",align:"start"})})]});async function QK(t,e){const{delaysMs:n,shouldRetry:r,onRetry:s}=e;for(let i=1;;i++)try{return await t(i)}catch(a){const u=n[i-1];if(u===void 0||r&&!r(a))throw a;s==null||s(a,i,u),await new Promise(c=>setTimeout(c,u))}}const u6=Is("useServerConfig"),LA=[250,500,1e3,2e3,4e3],c6=LA.length+1,JK=async()=>{var n;const t=await fetch("/api/health");if(!t.ok)throw new Error(`Failed to fetch config: ${t.status}`);const e=await t.json();if(!e.framework)throw new Error("Server did not return framework information");return{userPort:((n=e.ports)==null?void 0:n.userDevServer)||3e3,framework:e.framework}},eq=()=>{const[t,e]=v.useState(null),[n,r]=v.useState(!0),[s,i]=v.useState(null),a=v.useCallback(async()=>{try{r(!0),i(null);const u=await QK(JK,{delaysMs:LA,onRetry:(c,d,h)=>{u6.warn(`Server config fetch failed (attempt ${d}); retrying in ${h}ms`,c)}});return e(u),u}catch(u){const c=u instanceof Error?u.message:"Failed to fetch server config";throw i(c),u6.warn("Error fetching server config:",u),u}finally{r(!1)}},[]);return{config:t,fetchConfig:a,isLoading:n,error:s}},tq="#1C1C20",Ui=[118,118,124],d6=.85,nq=3,rq=.15,Ip=36,sq=4.4,iq=.7,oq=3.5,aq=.8,f6=9,lq=11,uq=[1.35,1.12,.95,.85],cq=[0,1.1,2.3,3.1],dq=[0,.35,.16,.13],fq=[.9,.5,.4,.35],Ja=3,z1=[[{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}]],Ap=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},em=t=>{const e=Math.min(1,Math.max(0,t));return e*e*(3-2*e)},el=(t,e)=>(Math.round(t/e-.5)+.5)*e,hq=Math.sin(Math.PI/3),h6=(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*hq;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()},pq=(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)-f6}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)-f6}return em(.5-r/(2*lq))},DA=({className:t="",trackGlobalLoaderCount:e=!0})=>{const n=lt(D5),r=v.useRef(null),s=v.useCallback(i=>{var D;if((D=r.current)==null||D.call(r),r.current=null,!i)return;const a=i.getContext("2d");if(!a)return;e&&n(N=>N+1);const u=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let c=[],d=0,h=0,p=Ip,m=Ip,y=null,w=null,_=0,x=-1;const b=new Array(33),P=N=>{const F=Math.round(N*32);let K=b[F];if(!K){const Z=F/32,W=Math.round(Ui[0]+(255-Ui[0])*Z),G=Math.round(Ui[1]+(255-Ui[1])*Z),Y=Math.round(Ui[2]+(255-Ui[2])*Z);K=`rgba(${W}, ${G}, ${Y}, ${d6})`,b[F]=K}return K},T=N=>{const F=1-.35*N,K=Math.round(Ui[0]*F),Z=Math.round(Ui[1]*F),W=Math.round(Ui[2]*F);return`rgba(${K}, ${Z}, ${W}, ${d6})`},k=N=>{let F=Math.floor(Math.random()*z1.length);F===x&&(F=(F+1)%z1.length),x=F;const K=[0,0,0,0],Z=z1[F].map((j,X)=>{const oe=j.level,se=K[oe]++,ee=cq[oe]+se*dq[oe],ce=fq[oe]+Ap(F*131+X*17+5)*.2;if(j.hline){const ie=el((j.y??0)*h,m);return{hline:!0,x1:el(j.x1*d,p),x2:el(j.x2*d,p),y1:ie,y2:ie,level:oe,start:ee,dur:ce}}const we=el(j.x1*d,p),ue=el((j.y1??0)*h,m);return{hline:!1,x1:we,y1:ue,x2:Math.max(el(j.x2*d,p),we+p),y2:Math.max(el((j.y2??0)*h,m),ue+m),level:oe,start:ee,dur:ce}}),W=Z.reduce((j,X)=>Math.max(j,X.start+X.dur),0),G=c.length,Y=new Float32Array(G*Ja),$=new Int16Array(G*Ja).fill(-1),J=new Uint8Array(G),H=Z[0];for(let j=0;j<G;j++){const X=c[j];X.x>H.x1&&X.x<H.x2&&X.y>H.y1&&X.y<H.y2&&(J[j]=1);const oe=j*Ja;for(let se=0;se<Z.length;se++){const ee=pq(X.x,X.y,Z[se]);if(ee<=.02)continue;let ce=oe;for(let we=oe;we<oe+Ja;we++){if($[we]===-1){ce=we;break}Y[we]<Y[ce]&&(ce=we)}($[ce]===-1||ee>Y[ce])&&(Y[ce]=ee,$[ce]=se)}}return{startT:N,buildEnd:W,els:Z,frame:H,cellQ:Y,cellEl:$,inFrame:J}},I=()=>{const N=i.getBoundingClientRect();d=Math.max(1,N.width),h=Math.max(1,N.height);const F=Math.min(2,window.devicePixelRatio||1);i.width=Math.round(d*F),i.height=Math.round(h*F),a.setTransform(F,0,0,F,0,0);const K=Math.max(8,Math.round(d/Ip)),Z=Math.max(6,Math.round(h/Ip));p=d/K,m=h/Z,c=[];for(let W=0;W<Z;W++){const G=Z>1?W/(Z-1):.5,Y=sq*(1+iq*.4*(G*2-1));for(let $=0;$<K;$++){const J=W*8191+$*131+1,H={x:($+.5)*p,y:(W+.5)*m,size:Y,seed:J,phase:Ap(J),kind:0};H.kind=Math.floor(Ap(J*97)*3),c.push(H)}}w=null,y=null},R=new Float32Array(32),L=N=>{a.fillStyle=tq,a.fillRect(0,0,d,h),y||(y=k(N+.2)),N>=y.startT+y.buildEnd+oq&&(w=y,_=N,y=k(N+.2));let F=0;w&&(F=1-em((N-_)/aq),F<=0&&(w=null));const K=y;for(let H=0;H<K.els.length;H++){const j=K.els[H];R[H]=em(Math.min(1,Math.max(0,(N-K.startT-j.start)/j.dur)))}const Z=R[0],W=T(0),G=T(Z),Y=F>0?T(F):W,$=F>0?T(Math.max(Z,F)):G,J=c.length;for(let H=0;H<J;H++){const j=c[H];let X=0,oe=0;const se=H*Ja;for(let Ue=se;Ue<se+Ja;Ue++){const Pe=K.cellEl[Ue];if(Pe<0)break;const Ve=K.cellQ[Ue]*R[Pe];Ve>X&&(X=Ve,oe=K.els[Pe].level)}if(w)for(let Ue=se;Ue<se+Ja;Ue++){const Pe=w.cellEl[Ue];if(Pe<0)break;const Ve=w.cellQ[Ue]*F;Ve>X&&(X=Ve,oe=w.els[Pe].level)}const ee=N/nq+j.phase,ce=Math.floor(ee),we=ee-ce,ue=em(Math.min(we,1-we)/rq),ie=Math.floor(Ap(j.seed*97+ce*7919)*3);ie!==j.kind&&X<.02&&ue<.05&&(j.kind=ie);const Ne=Math.max(ue*(1-X),X);if(!(Ne<.01))if(X<.02){const Ue=K.inFrame[H]===1,Pe=w?w.inFrame[H]===1:!1;Ue?a.fillStyle=Pe?$:G:a.fillStyle=Pe?Y:W;const Ve=Math.max(Ue?Z:0,Pe?F:0);h6(a,j.kind,j.x,j.y,j.size*Ne*(1-.2*Ve))}else{a.fillStyle=P(X);const Ue=1+(uq[oe]-1)*X;h6(a,j.kind,j.x,j.y,j.size*Ne*Ue)}}};I();let A=0;if(u)y=k(-100),L(0);else{const N=performance.now(),F=K=>{L((K-N)/1e3),A=requestAnimationFrame(F)};A=requestAnimationFrame(F)}const O=new ResizeObserver(()=>{I(),u&&(y=k(-100),L(0))});O.observe(i),r.current=()=>{cancelAnimationFrame(A),O.disconnect(),e&&n(N=>N-1)}},[e,n]);return E.jsx("canvas",{ref:s,"aria-hidden":"true",className:`h-full w-full ${t}`.trim()})},mq=async(t=null)=>{if(t)return gq(t);let e;try{e=await fetch("/api/mcp/status")}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}if(e.status===404||!(e.headers.get("content-type")??"").toLowerCase().includes("application/json"))return Rp();if(!e.ok)return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null};let r;try{r=await e.json()}catch{return Rp()}const s=r.devServerHealth;return s?s.ownership==="none"?{isOk:!1,unavailableReason:"upstream_unreachable",upstreamStatus:null}:s.isReachable===!0?{isOk:!0,unavailableReason:"upstream_unreachable",upstreamStatus:null}:{isOk:!1,unavailableReason:s.reason==="rivet_unreachable"?"rivet_unreachable":"upstream_unreachable",upstreamStatus:null}:Rp()},NA=async t=>{try{const e=await fetch(t);return{isOk:e.status!==502&&e.status!==503,unavailableReason:"upstream_unreachable",upstreamStatus:e.status}}catch{return{isOk:!1,unavailableReason:"rivet_unreachable",upstreamStatus:null}}},gq=t=>NA(t),Rp=()=>NA("/"),B1=Is("usePreviewUpstreamHealth"),vq=500,yq=4e3,_q=15e3,wq=3,xq=(t,e={})=>{const n=v.useRef(null),r=v.useRef(null),s=e.probeMsWhileDown??vq,i=e.probeMsWhileUp??yq,a=e.firstUnreachableCaptureAfterMs??_q,u=e.rerunProbeImmediatelyOnVersion,c=e.probePath??null,d=e.skip??!1,h=v.useRef(e.onPersistentUpstreamServerErrors);h.current=e.onPersistentUpstreamServerErrors;const[p,m]=v.useState(t==="static"),[y,w]=v.useState(0),[_,x]=v.useState(null),[b,P]=v.useState(0),[T,k]=v.useState(!1),[I,R]=v.useState(!1),[L,A]=v.useState(t==="static"?null:"upstream_unreachable");return v.useEffect(()=>{if(t==="static"){m(!0),x(null),P(0),k(!1),R(!0),A(null);return}if(d){m(!1),x(null),P(0),k(!1),R(!0),A("upstream_unreachable"),n.current=null;return}let O=!0;const D=Date.now();x(D),P(0),k(!1),m(!1),R(!1),A("upstream_unreachable");const N={current:!1},F={current:!1},K={current:!1},Z={current:null},W={current:!1},G={current:!1},Y={current:0},$={current:!1},J={current:null};let H=null;const j=()=>{K.current||(K.current=!0,O&&R(!0))},X=()=>{H!==null&&(clearTimeout(H),H=null)},oe=(ee,ce)=>{X(),H=setTimeout(ce,ee)},se=async()=>{var Ve;if(!O)return;P(ht=>ht+1);const{isOk:ee,unavailableReason:ce,upstreamStatus:we}=await mq(c);if(!O)return;j(),J.current=we;const ue=ee&&we!==null&&we>=500;ue&&G.current?Y.current+=1:ee&&!ue&&(Y.current=0);const ie=Y.current>=wq;if(ie&&!$.current&&we!==null&&($.current=!0,Se==null||Se.capture("preview_upstream_error_responses",{framework:t,upstream_status:we,consecutive_count:Y.current}),B1.warn(`Preview upstream is listening but has served ${Y.current} consecutive ${we} responses`),(Ve=h.current)==null||Ve.call(h,{upstreamStatus:we,consecutiveCount:Y.current})),ee&&!ie){ue||(G.current=!0,$.current=!1);const ht=!W.current;W.current=!0,m(!0),A(null),Z.current=null,F.current=!1,k(!1),N.current?ht&&(Se==null||Se.capture("preview_upstream_restored",{framework:t})):(N.current=!0,Se==null||Se.capture("preview_dev_server_ready",{framework:t,ready_after_ms:Date.now()-D})),oe(i,se);return}const Ue=W.current;W.current=!1,m(!1),A(ce),Z.current===null&&(Z.current=Date.now(),F.current=!1,k(!1)),Ue&&(Se==null||Se.capture("preview_upstream_lost",{framework:t,upstream_status:we}),w(ht=>ht+1),B1.warn("Preview upstream became unavailable after it was ready"));const Pe=Date.now()-Z.current;Pe>=a&&!F.current&&(F.current=!0,k(!0),Se==null||Se.capture("preview_dev_server_unreachable",{framework:t,elapsed_ms:Pe,upstream_status:J.current}),B1.warn("Dev server did not become ready within timeout window")),oe(s,se)};return n.current=()=>oe(0,se),oe(0,se),()=>{O=!1,n.current=null,X()}},[t,s,i,a,c,d]),v.useEffect(()=>{var D;if(t==="static"||u===void 0)return;const O=r.current;r.current=u,O!==null&&O!==u&&((D=n.current)==null||D.call(n))},[t,u]),{isUpstreamReady:p,iframeRemountKey:y,probeStartedAt:_,probeAttemptCount:b,isFirstUnreachableWindowExceeded:T,initialProbeComplete:I,unavailableReason:L}};function bq(t){return t.enteringSplit&&t.isExistingSession&&t.hasActiveVariantProxy}const FA=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}`},jA=({agentApplyMode:t,url:e})=>e.startsWith("/")?`${FA(t)}${e}`:e,Sq="allow-scripts allow-same-origin allow-forms allow-popups allow-modals",Eq=t=>Sq,Cq=Is("PreviewSurface"),p6=(t,e)=>t==="about:blank"?"blank":t.includes("/api/variants/")?"static_artifact":e.kind==="variant"?"dev_server":"original",VA=({target:t,src:e,framework:n,remountKey:r})=>(et(P0),E.jsx("div",{className:"relative h-full w-full",children:E.jsx("iframe",{src:e,className:"h-full w-full border-none",title:"Project Preview",sandbox:Eq(),onLoad:()=>{Se==null||Se.capture("preview_iframe_loaded",{framework:n,src:e}),t.kind==="variant"&&(Se==null||Se.capture("variants_panel.preview_displayed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:p6(e,t),framework:n}))},onError:()=>{Se==null||Se.capture("preview_iframe_load_failed",{framework:n,src:e}),t.kind==="variant"&&(Se==null||Se.capture("variants_panel.preview_display_failed",{sessionId:t.sessionId,variantId:t.variantId,renderedTarget:"variant",iframeSrcKind:p6(e,t),framework:n})),Cq.warn("Preview iframe failed to load",{framework:n,src:e})}},r)})),kq="modulepreload",Pq=function(t){return"/"+t},m6={},Tq=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let a=function(d){return Promise.all(d.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(d=>{if(d=Pq(d),d in m6)return;m6[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":kq,h||(m.as="script"),m.crossOrigin="",m.href=d,c&&m.setAttribute("nonce",c),document.head.appendChild(m),h)return new Promise((y,w)=>{m.addEventListener("load",y),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}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)})},Iq=v.lazy(()=>Tq(()=>Promise.resolve().then(()=>cY),void 0)),Aq={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"},Rq={sm:"text-lg font-semibold text-content",md:"text-2xl font-semibold text-content",lg:"text-3xl font-semibold text-content"},Mq={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"},zu=({backdrop:t,media:e,title:n,description:r,actions:s,tone:i="neutral",fill:a="surface",size:u="md",children:c,state:d,role:h="status",busy:p=!1,className:m=""})=>{const y=v.useCallback(_=>{_&&d&&(Se==null||Se.capture("status_surface_shown",{state:d,tone:i,fill:a}))},[d,i,a]),w=!!(e||n||r||c||s!=null&&s.length);return E.jsxs("div",{ref:y,className:`${Aq[a]} ${m}`.trim(),role:h,"aria-live":"polite","aria-busy":p||void 0,"data-state":d,children:[t?E.jsx("div",{className:"absolute inset-0",children:t}):null,w?E.jsxs("div",{className:"relative z-10 flex max-w-sm flex-col items-center gap-5 text-center",children:[e,n?E.jsx("h2",{className:Rq[u],children:n}):null,r?E.jsx("p",{className:"text-content-muted text-base leading-relaxed",children:r}):null,c,s!=null&&s.length?E.jsx("div",{className:"flex flex-row items-center gap-3",children:s.map(_=>E.jsx("button",{type:"button",onClick:_.onClick,className:Mq[_.variant??"neutral"],children:_.label},_.label))}):null]}):null]})},r2=({loader:t="coalesce",trackGlobalLoaderCount:e,size:n="lg",...r})=>t==="coalesce"?E.jsx(zu,{...r,size:n,busy:!0,backdrop:E.jsx(DA,{trackGlobalLoaderCount:e})}):t==="logo"?E.jsx(zu,{...r,size:n,busy:!0,backdrop:E.jsx(v.Suspense,{fallback:null,children:E.jsx(Iq,{className:"absolute inset-0"})})}):E.jsx(zu,{...r,size:n,busy:!0,media:E.jsx(k0,{"aria-hidden":!0,className:"text-content h-8 w-8 shrink-0 animate-spin",weight:"bold"})}),$A=({icon:t,...e})=>E.jsx(zu,{...e,tone:"neutral",media:t?E.jsx("div",{className:"text-content-muted",children:t}):void 0}),lx=t=>E.jsx(zu,{...t,tone:"error",role:"alert"}),g6="/static/",Oq=t=>{try{return new URL(t,"http://localhost").pathname.endsWith(g6)}catch{return t.endsWith(g6)}},Lq=t=>t==="spawn_error"?"The direction is saved, but its preview process didn’t start.":t==="exited"?"The direction is saved, but its preview stopped before it was ready.":t==="timeout"?"The direction is saved, but its preview took too long to become ready.":t==="missing_dev_script"?"The direction is saved, but Rivet couldn’t find a dev script to preview it.":t==="missing_static_entry"?"The direction is saved, but Rivet couldn’t find an HTML entry to preview it.":"The direction is saved, but Rivet couldn’t prepare its preview.",Dq=t=>t.status==="failed"&&t.errorCode==="VARIANT_VERIFICATION_UNAVAILABLE"?{state:"variant_verification_unavailable",title:"Rivet couldn’t verify this direction",description:"The worker completed, but Rivet couldn’t inspect its generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"&&t.errorCode==="VARIANT_QA_FAILED"?{state:"variant_output_integrity_failed",title:"This direction couldn’t be verified",description:"The worker completed, but Rivet found a structural problem in the generated files.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="failed"?{state:"variant_worker_failed",title:"This direction didn’t complete",description:"The worker stopped before producing a usable result.",detail:t.errorMessage??t.errorCode,isError:!0}:t.status==="cancelled"?{state:"variant_cancelled",title:"Direction was cancelled",description:"Rivet stopped before a preview was ready. Your other directions are unchanged.",isError:!1}:t.status==="succeeded"&&t.previewUnavailable&&t.previewUnavailable.reason!=="idle_timeout"?{state:"preview_unavailable",title:"Rivet couldn’t preview this direction",description:Lq(t.previewUnavailable.reason),detail:t.previewUnavailable.portInUse?"The preview port was already in use.":void 0,isError:!0}:null,Nq=({issue:t})=>E.jsx(zu,{fill:"overlay",size:"sm",state:t.state,role:t.isError?"alert":"status",tone:t.isError?"error":"neutral",title:t.title,description:t.description,children:t.detail?E.jsx("p",{className:"text-content-subtle text-xs leading-relaxed break-words",children:t.detail}):null}),Fq=({isInteractionDisabled:t=!1,framework:e,userPort:n})=>{const r=et(W_),s=lt(W_),i=et(Ym),a=lt(Ym),u=et(Nf),c=et(P0),d=et(G_),h=et(K_),p=et(F5),m=et(j5),y=lt(K_),w=et(mo),_=et(Z_),x=lt(G_),b=u.active&&u.projectContext.kind==="fresh",P=et(q_),T=u.active?u.variants.find($e=>$e.workItemId===P&&($e.status==="pending"||$e.status==="running"||$e.status==="succeeded"&&!$e.preview&&typeof $e.port!="number"&&(!$e.previewUnavailable||$e.previewUnavailable.reason==="idle_timeout")))??null:null,k=u.active&&u.variants.some($e=>$e.status==="pending"||$e.status==="running"),I=b||k,R=u.active?u.variants.find($e=>$e.workItemId===P)??null:null,L=R?Dq(R):null,A=e==="static"&&i!==null&&Oq(i);v.useEffect(()=>{u.active||x(!1)},[u.active,x]);const O=v.useRef(!1);v.useEffect(()=>{const $e=!!(w!=null&&w.left||w!=null&&w.right),Ge=$e&&!O.current;O.current=$e;const tt=u.active?u.sessionId:null;!tt||!bq({enteringSplit:Ge,isExistingSession:u.active&&u.projectContext.kind==="existing",hasActiveVariantProxy:d&&h!==null})||(x(!1),y(null),s(bt=>bt+1),fetch(`/api/variants/${encodeURIComponent(tt)}/preview-port`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({variantId:null})}).catch(()=>{}))},[w,u,d,h,x,y,s]);const N=v.useMemo(()=>{var Ye;if(d||i&&!A||!u.active)return null;const{stage:$e,variants:Ge}=u,tt=$e==="ready"||$e==="degraded",bt=Ge.some(an=>{var ln,Fn;return((ln=an.refinement)==null?void 0:ln.status)==="pending"||((Fn=an.refinement)==null?void 0:Fn.status)==="running"});if(!tt&&!bt)return null;const nt=Ge.find(an=>{var ln;return an.status==="succeeded"&&((ln=an.preview)==null?void 0:ln.kind)==="static_artifact"});return((Ye=nt==null?void 0:nt.preview)==null?void 0:Ye.kind)==="static_artifact"?nt.preview.url:null},[A,i,d,u])??i,F=v.useMemo(()=>!u.active||!N?null:u.variants.find($e=>{var Ge;return((Ge=$e.preview)==null?void 0:Ge.kind)==="static_artifact"&&N.startsWith($e.preview.url)})??null,[N,u]),K=v.useMemo(()=>{if((_==null?void 0:_.previewKind)==="static")return{kind:"variant",sessionId:_.sessionId,variantId:_.variantId};if(!u.active)return Zm;if(F)return{kind:"variant",sessionId:u.sessionId,variantId:F.workItemId};if(N){const Ge=N.match(/\/__rivet\/preview\/variant\/([^/]+)\/([^/?#]+)/),tt=Ge!=null&&Ge[1]?decodeURIComponent(Ge[1]):null,bt=Ge!=null&&Ge[2]?decodeURIComponent(Ge[2]):null;if(tt===u.sessionId&&bt&&u.variants.some(an=>an.workItemId===bt))return{kind:"variant",sessionId:u.sessionId,variantId:bt};const nt=N.match(/\/api\/variants\/[^/]+\/static\/([^/?#]+)/),Ye=nt!=null&&nt[1]?decodeURIComponent(nt[1]):null;if(Ye&&u.variants.some(an=>an.workItemId===Ye))return{kind:"variant",sessionId:u.sessionId,variantId:Ye}}const $e=!!(w!=null&&w.left||w!=null&&w.right);return(!$e||b)&&!N&&d&&h&&u.variants.some(Ge=>Ge.workItemId===h)?{kind:"variant",sessionId:u.sessionId,variantId:h}:(!$e||b)&&!N&&P&&u.variants.some(Ge=>Ge.workItemId===P)?{kind:"variant",sessionId:u.sessionId,variantId:P}:Zm},[_,F,u,d,h,N,w,b,P]),Z=v.useRef(null);v.useEffect(()=>{var bt,nt;if(!F||((bt=F.preview)==null?void 0:bt.kind)!=="static_artifact"||((nt=F.refinement)==null?void 0:nt.status)!=="succeeded")return;const $e=`${F.workItemId}:${F.refinement.workItemId}`;if(Z.current===$e)return;Z.current=$e;const Ge=F.preview.url.includes("?")?"&":"?",tt=`${F.preview.url}${Ge}refinement=${encodeURIComponent(F.refinement.workItemId)}`;N!==tt&&(a(tt),s(Ye=>Ye+1))},[N,F,s,a,u]);const W=N!==null&&nK(N),G=N!==null&&!W||b&&!d&&!W,{isUpstreamReady:Y,iframeRemountKey:$,probeAttemptCount:J,initialProbeComplete:H}=xq(e,{rerunProbeImmediatelyOnVersion:r,probePath:W?N:null,skip:G}),[j,X]=v.useState(()=>p&&Y?r:null),oe=v.useRef(null);v.useEffect(()=>{if(!p){oe.current=null,X(null);return}if(j===r){oe.current=null;return}const $e=oe.current;if(!$e||$e.remountKey!==r){oe.current={remountKey:r,probeAttemptCount:J};return}Y&&J>$e.probeAttemptCount&&(oe.current=null,X(r))},[j,r,p,J,Y]);const ee=N!==null&&!W||Y,we=m||p&&j!==r||p&&!ee,ue=`${$}:${r}`,ie=AA(window.location.pathname),Ne=e==="static"?`/static${ie??"/"}`:ie??"/",Ue=FA(c);let Pe=null;N&&(Pe=jA({agentApplyMode:c,url:N}));const ht=T||L||we?"about:blank":(W&&!ee?"about:blank":Pe)??(ee?`${Ue}${Ne}`:"about:blank"),Jt=!!T||!!L||!ee&&H;let be=null;return we?be=E.jsx(r2,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"preview_replay_boot"}):T?be=E.jsx(r2,{fill:"overlay",loader:"coalesce",trackGlobalLoaderCount:!1,state:"variant_building",children:E.jsx("span",{className:"sr-only",children:"Building your direction"})}):L?be=E.jsx(Nq,{issue:L}):Jt&&(be=I?E.jsx($A,{fill:"overlay",state:"preview_no_selection",title:"Nothing to preview yet",description:"Pick a direction from the panel."}):E.jsx(lx,{fill:"overlay",state:"preview_offline",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>window.location.reload()}]})),E.jsxs("div",{className:"relative h-full w-full",children:[be,E.jsx(VA,{target:K,src:ht,framework:e,remountKey:ue})]})};function v6({side:t,sessionId:e,variantId:n,url:r,label:s,source:i,isFallback:a=!1}){var T;const u=et(mo),c=lt(mo),d=g0(),h=et(Nf),p=et(P0),m=v.useRef(!1),y=v.useCallback(()=>{m.current||(m.current=!0,mf({source:i,sessionId:e,variantId:n}))},[i,e,n]),w=v.useCallback(()=>{if(a){c(null);const L=t0("ended",u);d==null||d.capture(L.event,L.properties);return}y();const k={...u};delete k[t];const I=k.left||k.right?k:null;c(I);const R=t0(I?"updated":"ended",I??u);d==null||d.capture(R.event,R.properties)},[a,d,c,t,u,y]),_=v.useMemo(()=>({kind:"variant",sessionId:e,variantId:n}),[e,n]),x=v.useMemo(()=>!h.active||h.sessionId!==e?null:h.variants.find(k=>k.workItemId===n)??null,[e,n,h]),b=v.useMemo(()=>{var I,R;let k=r;if(((I=x==null?void 0:x.preview)==null?void 0:I.kind)==="static_artifact"&&((R=x.refinement)==null?void 0:R.status)==="succeeded"){const L=x.preview.url.includes("?")?"&":"?";k=`${x.preview.url}${L}refinement=${encodeURIComponent(x.refinement.workItemId)}`}return jA({agentApplyMode:p,url:k})},[p,x,r]),P=((T=x==null?void 0:x.refinement)==null?void 0:T.status)==="succeeded"?`${n}:${x.refinement.workItemId}`:n;return E.jsxs("div",{className:"variant-split-secondary","data-cy":"variant-split-pane","data-variant-id":n,children:[E.jsxs("div",{className:"variant-split-secondary-toolbar",children:[E.jsx("span",{className:"variant-split-secondary-label",title:s,children:s}),E.jsx(ao,{label:"Collapse",children:E.jsx("button",{type:"button",className:"variant-split-secondary-close",onClick:w,"aria-label":"Collapse split view",children:E.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",children:E.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"})})})})]}),E.jsx("div",{className:"variant-split-secondary-body relative min-h-0 flex-1",children:E.jsx(VA,{target:_,src:b,framework:"static",remountKey:P})})]})}const y6=240;function jq(){const t=et(cf),e=et(Uw),n=v.useRef(null);return v.useEffect(()=>{if(!t||!e||!n.current)return;const r=e.x-y6/2,s=e.y-22;n.current.style.transform=`translate3d(${r}px, ${s}px, 0)`},[t,e]),!t||!e?null:E.jsx("div",{ref:n,"aria-hidden":"true",className:"variant-drag-ghost",style:{width:y6},children:E.jsxs("div",{className:"variant-drag-ghost-body",children:[E.jsxs("div",{className:"variant-drag-ghost-row",children:[E.jsx("div",{className:"variant-drag-ghost-title",children:t.label}),t.runLabel?E.jsx("div",{className:"variant-drag-ghost-tag",style:k5(t.runLabel),children:t.runLabel}):null]}),t.description?E.jsx("div",{className:"variant-drag-ghost-desc",children:t.description}):null]})})}function Vq(){const t=et(cf),e=et(Uw),n=et(mo),r=lt(cf),s=lt(mo),i=g0(),a=v.useRef(null),[u,c]=v.useState(null),[d,h]=v.useState("hidden");v.useEffect(()=>{if(!t){h("hidden"),c(null);return}const y=requestAnimationFrame(()=>h("visible"));return()=>cancelAnimationFrame(y)},[t]);const p=v.useCallback((y,w)=>{const _=a.current;if(!_)return null;const x=_.getBoundingClientRect();return y<x.left||y>x.right||w<x.top||w>x.bottom?null:y<(x.left+x.right)/2?"left":"right"},[]);if(v.useEffect(()=>{if(!t||!e)return;const y=p(e.x,e.y);c(w=>w===y?w:y)},[t,e,p]),v.useEffect(()=>{if(!t)return;const y=w=>{const _=p(w.clientX,w.clientY);if(_&&t.url){const x={sessionId:t.sessionId,variantId:t.variantId,label:t.label,url:t.url,source:t.source},b=n==null?void 0:n[_];b&&(b.sessionId!==x.sessionId||b.variantId!==x.variantId)&&mf(b);const P={...n??{},[_]:x};s(P);const T=t0(n?"updated":"started",P);i==null||i.capture(T.event,T.properties),h("exiting"),window.setTimeout(()=>r(null),220)}else mf(t),h("exiting"),window.setTimeout(()=>r(null),220)};return window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y),()=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y)}},[t,p,i,r,s,n]),!t)return null;const m=["variant-drop-zones",d==="visible"&&"is-visible",d==="exiting"&&"is-exiting"].filter(Boolean).join(" ");return E.jsxs("div",{ref:a,className:m,"aria-hidden":"true",children:[E.jsx(_6,{side:"left",hovered:u==="left",canDrop:!!t.url,label:t.label}),E.jsx(_6,{side:"right",hovered:u==="right",canDrop:!!t.url,label:t.label})]})}function _6({side:t,hovered:e,canDrop:n,label:r}){return E.jsxs("div",{className:["variant-drop-zone",`is-${t}`,e&&"is-hover",!n&&"is-disabled"].filter(Boolean).join(" "),children:[E.jsxs("div",{className:"variant-drop-zone-inner",children:[E.jsx("div",{className:`variant-drop-zone-icon is-${t}`}),E.jsx("div",{className:"variant-drop-zone-caption",children:n?`Add ${t} split`:"Split unavailable for this direction"})]}),E.jsx("div",{className:"variant-drop-zone-preview","aria-hidden":"true",children:E.jsx("div",{className:"variant-drop-zone-preview-label",children:r})}),E.jsx("div",{className:"variant-drop-zone-border"})]})}const HA=(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)}`},w6=(t,e)=>{if(!t)return;const n=HA(e,t.sessionId,t.variantId);return!n||n===t.url?t:{...t,url:n}},$q=()=>E.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:E.jsx("div",{className:"border-main-border relative min-h-0 flex-1 overflow-hidden rounded-lg border",children:E.jsx(DA,{trackGlobalLoaderCount:!1})})}),Hq=({isLoading:t=!1,isInteractionDisabled:e=!1})=>{const{config:n,fetchConfig:r,isLoading:s,error:i}=eq();return v.useEffect(()=>{r().catch(a=>{Se==null||Se.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:c6})})},[r]),s?E.jsx($q,{}):i||!n?E.jsx(lx,{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:()=>{Se==null||Se.capture("preview_config_retry_clicked"),r().catch(a=>{Se==null||Se.capture("preview_config_load_failed",{message:a instanceof Error?a.message:"unknown_error",attempts:c6})})}}]}):E.jsx(zq,{isLoading:t,isInteractionDisabled:e,framework:n.framework,userPort:n.userPort})};function zq(t){const e=et(mo),n=et(cf),r=et(Nf),s=et(Ym),i=e==null?void 0:e.left,a=e==null?void 0:e.right,u=v.useMemo(()=>{var I,R;if(!r.active||r.projectContext.kind!=="fresh"||!(!!i!=!!a))return;const _=(I=i??a)==null?void 0:I.variantId,x=r.variants.filter(L=>{var A;return L.status==="succeeded"&&((A=L.preview)==null?void 0:A.kind)==="static_artifact"&&L.workItemId!==_}),b=s==null?void 0:s.replace(/[?&]refinement=[^&]*$/,""),T=x.find(L=>{var A;return((A=L.preview)==null?void 0:A.kind)==="static_artifact"&&L.preview.url===b})??x[0];if(((R=T==null?void 0:T.preview)==null?void 0:R.kind)!=="static_artifact")return;const k=HA(r,r.sessionId,T.workItemId);if(k)return{sessionId:r.sessionId,variantId:T.workItemId,label:T.label,url:k,source:"live"}},[r,i,a,s]),c=w6(i,r)??(a?u:void 0),d=w6(a,r)??(i?u:void 0),h=!i&&!!c,p=!a&&!!d,m=!!(c||d),y=E.jsx(Fq,{isInteractionDisabled:t.isInteractionDisabled,framework:t.framework,userPort:t.userPort});return E.jsx("div",{className:"relative flex h-full min-h-0 w-full flex-1 flex-col",children:E.jsxs("div",{className:`variant-preview-region relative flex h-full min-h-0 w-full flex-1 flex-col ${n?"is-dragging":""} ${m?"is-split":""}`,children:[E.jsxs("div",{className:"variant-preview-row flex h-full min-h-0 w-full flex-1",children:[c&&E.jsx(v6,{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&&d)&&E.jsx("div",{className:"variant-preview-primary flex h-full min-h-0 flex-1 flex-col",children:y}),d&&E.jsx(v6,{side:"right",sessionId:d.sessionId,variantId:d.variantId,url:d.url,label:d.label,source:d.source,isFallback:p},`right-${d.sessionId}:${d.variantId}:${d.url}`)]}),E.jsx("div",{className:"variant-preview-atmosphere","aria-hidden":"true"}),E.jsx(Vq,{}),E.jsx(jq,{})]})})}function Xi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
116
+ * GSAP 3.15.0
117
+ * https://gsap.com
118
+ *
119
+ * @license Copyright 2008-2026, GreenSock. All rights reserved.
120
+ * Subject to the terms at https://gsap.com/standard-license
121
+ * @author: Jack Doyle, jack@greensock.com
122
+ */var is={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},gf={duration:.5,overwrite:!1,delay:0},ux,Kn,Wt,Cs=1e8,At=1/Cs,s2=Math.PI*2,Bq=s2/4,Uq=0,BA=Math.sqrt,Wq=Math.cos,Gq=Math.sin,Nn=function(e){return typeof e=="string"},sn=function(e){return typeof e=="function"},vo=function(e){return typeof e=="number"},cx=function(e){return typeof e>"u"},ki=function(e){return typeof e=="object"},Nr=function(e){return e!==!1},dx=function(){return typeof window<"u"},Mp=function(e){return sn(e)||Nn(e)},UA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},sr=Array.isArray,Kq=/random\([^)]+\)/g,qq=/,\s*/g,x6=/(?:-?\.?\d|\.)+/gi,WA=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Mu=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,U1=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,GA=/[+-]=-?[.\d]+/,Zq=/[^,'"\[\]\s]+/gi,Yq=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Xt,di,i2,fx,as={},n0={},KA,qA=function(e){return(n0=mc(e,as))&&$r},hx=function(e,n){return console.warn("Invalid property",e,"set to",n,"Missing plugin? gsap.registerPlugin()")},vf=function(e,n){return!n&&console.warn(e)},ZA=function(e,n){return e&&(as[e]=n)&&n0&&(n0[e]=n)||as},yf=function(){return 0},Xq={suppressEvents:!0,isStart:!0,kill:!1},tm={suppressEvents:!0,kill:!1},Qq={suppressEvents:!0},px={},da=[],o2={},YA,Xr={},W1={},b6=30,nm=[],mx="",gx=function(e){var n=e[0],r,s;if(ki(n)||sn(n)||(e=[e]),!(r=(n._gsap||{}).harness)){for(s=nm.length;s--&&!nm[s].targetTest(n););r=nm[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new yR(e[s],r)))||e.splice(s,1);return e},Al=function(e){return e._gsap||gx(ks(e))[0]._gsap},XA=function(e,n,r){return(r=e[n])&&sn(r)?e[n]():cx(r)&&e.getAttribute&&e.getAttribute(n)||r},Fr=function(e,n){return(e=e.split(",")).forEach(n)||e},hn=function(e){return Math.round(e*1e5)/1e5||0},Yt=function(e){return Math.round(e*1e7)/1e7||0},Bu=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},Jq=function(e,n){for(var r=n.length,s=0;e.indexOf(n[s])<0&&++s<r;);return s<r},r0=function(){var e=da.length,n=da.slice(0),r,s;for(o2={},da.length=0,r=0;r<e;r++)s=n[r],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},vx=function(e){return!!(e._initted||e._startAt||e.add)},QA=function(e,n,r,s){da.length&&!Kn&&r0(),e.render(n,r,!!(Kn&&n<0&&vx(e))),da.length&&!Kn&&r0()},JA=function(e){var n=parseFloat(e);return(n||n===0)&&(e+"").match(Zq).length<2?n:Nn(e)?e.trim():e},eR=function(e){return e},ls=function(e,n){for(var r in n)r in e||(e[r]=n[r]);return e},eZ=function(e){return function(n,r){for(var s in r)s in n||s==="duration"&&e||s==="ease"||(n[s]=r[s])}},mc=function(e,n){for(var r in n)e[r]=n[r];return e},S6=function t(e,n){for(var r in n)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(e[r]=ki(n[r])?t(e[r]||(e[r]={}),n[r]):n[r]);return e},s0=function(e,n){var r={},s;for(s in e)s in n||(r[s]=e[s]);return r},$d=function(e){var n=e.parent||Xt,r=e.keyframes?eZ(sr(e.keyframes)):ls;if(Nr(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},tZ=function(e,n){for(var r=e.length,s=r===n.length;s&&r--&&e[r]===n[r];);return r<0},tR=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},F0=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},wa=function(e,n){e.parent&&(!n||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},Rl=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},nZ=function(e){for(var n=e.parent;n&&n.parent;)n._dirty=1,n.totalDuration(),n=n.parent;return e},a2=function(e,n,r,s){return e._startAt&&(Kn?e._startAt.revert(tm):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(n,!0,s))},rZ=function t(e){return!e||e._ts&&t(e.parent)},E6=function(e){return e._repeat?gc(e._tTime,e=e.duration()+e._rDelay)*e:0},gc=function(e,n){var r=Math.floor(e=Yt(e/n));return e&&r===e?r-1:r},i0=function(e,n){return(e-n._start)*n._ts+(n._ts>=0?0:n._dirty?n.totalDuration():n._tDur)},j0=function(e){return e._end=Yt(e._start+(e._tDur/Math.abs(e._ts||e._rts||At)||0))},V0=function(e,n){var r=e._dp;return r&&r.smoothChildTiming&&e._ts&&(e._start=Yt(r._time-(e._ts>0?n/e._ts:((e._dirty?e.totalDuration():e._tDur)-n)/-e._ts)),j0(e),r._dirty||Rl(r,e)),e},nR=function(e,n){var r;if((n._time||!n._dur&&n._initted||n._start<e._time&&(n._dur||!n.add))&&(r=i0(e.rawTime(),n),(!n._dur||Vf(0,n.totalDuration(),r)-n._tTime>At)&&n.render(r,!0)),Rl(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=-At}},yi=function(e,n,r,s){return n.parent&&wa(n),n._start=Yt((vo(r)?r:r||e!==Xt?xs(e,r,n):e._time)+n._delay),n._end=Yt(n._start+(n.totalDuration()/Math.abs(n.timeScale())||0)),tR(e,n,"_first","_last",e._sort?"_start":0),l2(n)||(e._recent=n),s||nR(e,n),e._ts<0&&V0(e,e._tTime),e},rR=function(e,n){return(as.ScrollTrigger||hx("scrollTrigger",n))&&as.ScrollTrigger.create(n,e)},sR=function(e,n,r,s,i){if(_x(e,n,i),!e._initted)return 1;if(!r&&e._pt&&!Kn&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&YA!==Jr.frame)return da.push(e),e._lazy=[i,s],1},sZ=function t(e){var n=e.parent;return n&&n._ts&&n._initted&&!n._lock&&(n.rawTime()<0||t(n))},l2=function(e){var n=e.data;return n==="isFromStart"||n==="isStart"},iZ=function(e,n,r,s){var i=e.ratio,a=n<0||!n&&(!e._start&&sZ(e)&&!(!e._initted&&l2(e))||(e._ts<0||e._dp._ts<0)&&!l2(e))?0:1,u=e._rDelay,c=0,d,h,p;if(u&&e._repeat&&(c=Vf(0,e._tDur,n),h=gc(c,u),e._yoyo&&h&1&&(a=1-a),h!==gc(e._tTime,u)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==i||Kn||s||e._zTime===At||!n&&e._zTime){if(!e._initted&&sR(e,n,s,r,c))return;for(p=e._zTime,e._zTime=n||(r?At:0),r||(r=n&&!p),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=c,d=e._pt;d;)d.r(a,d.d),d=d._next;n<0&&a2(e,n,r,!0),e._onUpdate&&!r&&ts(e,"onUpdate"),c&&e._repeat&&!r&&e.parent&&ts(e,"onRepeat"),(n>=e._tDur||n<0)&&e.ratio===a&&(a&&wa(e,1),!r&&!Kn&&(ts(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=n)},oZ=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}},vc=function(e,n,r,s){var i=e._repeat,a=Yt(n)||0,u=e._tTime/e._tDur;return u&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Yt(a*(i+1)+e._rDelay*i):a,u>0&&!s&&V0(e,e._tTime=e._tDur*u),e.parent&&j0(e),r||Rl(e.parent,e),e},C6=function(e){return e instanceof Mr?Rl(e):vc(e,e._dur)},aZ={_start:0,endTime:yf,totalDuration:yf},xs=function t(e,n,r){var s=e.labels,i=e._recent||aZ,a=e.duration()>=Cs?i.endTime(!1):e._dur,u,c,d;return Nn(n)&&(isNaN(n)||n in s)?(c=n.charAt(0),d=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)*(d?(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)),d&&r&&(c=c/100*(sr(r)?r[0]:r).totalDuration()),u>1?t(e,n.substr(0,u-1),r)+c:a+c)):n==null?a:+n},Hd=function(e,n,r){var s=vo(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=Nr(c.vars.inherit)&&c.parent;a.immediateRender=Nr(u.immediateRender),e<2?a.runBackwards=1:a.startAt=n[i-1]}return new xn(n[0],a,n[i+1])},Ia=function(e,n){return e||e===0?n(e):n},Vf=function(e,n,r){return r<e?e:r>n?n:r},nr=function(e,n){return!Nn(e)||!(n=Yq.exec(e))?"":n[1]},lZ=function(e,n,r){return Ia(r,function(s){return Vf(e,n,s)})},u2=[].slice,iR=function(e,n){return e&&ki(e)&&"length"in e&&(!n&&!e.length||e.length-1 in e&&ki(e[0]))&&!e.nodeType&&e!==di},uZ=function(e,n,r){return r===void 0&&(r=[]),e.forEach(function(s){var i;return Nn(s)&&!n||iR(s,1)?(i=r).push.apply(i,ks(s)):r.push(s)})||r},ks=function(e,n,r){return Wt&&!n&&Wt.selector?Wt.selector(e):Nn(e)&&!r&&(i2||!yc())?u2.call((n||fx).querySelectorAll(e),0):sr(e)?uZ(e,r):iR(e)?u2.call(e,0):e?[e]:[]},c2=function(e){return e=ks(e)[0]||vf("Invalid scope")||{},function(n){var r=e.current||e.nativeElement||e;return ks(n,r.querySelectorAll?r:r===e?vf("Invalid scope")||fx.createElement("div"):e)}},oR=function(e){return e.sort(function(){return .5-Math.random()})},aR=function(e){if(sn(e))return e;var n=ki(e)?e:{each:e},r=Ml(n.ease),s=n.from||0,i=parseFloat(n.base)||0,a={},u=s>0&&s<1,c=isNaN(s)||u,d=n.axis,h=s,p=s;return Nn(s)?h=p={center:.5,edges:.5,end:1}[s]||0:!u&&c&&(h=s[0],p=s[1]),function(m,y,w){var _=(w||n).length,x=a[_],b,P,T,k,I,R,L,A,O;if(!x){if(O=n.grid==="auto"?0:(n.grid||[1,Cs])[1],!O){for(L=-Cs;L<(L=w[O++].getBoundingClientRect().left)&&O<_;);O<_&&O--}for(x=a[_]=[],b=c?Math.min(O,_)*h-.5:s%O,P=O===Cs?0:c?_*p/O-.5:s/O|0,L=0,A=Cs,R=0;R<_;R++)T=R%O-b,k=P-(R/O|0),x[R]=I=d?Math.abs(d==="y"?k:T):BA(T*T+k*k),I>L&&(L=I),I<A&&(A=I);s==="random"&&oR(x),x.max=L-A,x.min=A,x.v=_=(parseFloat(n.amount)||parseFloat(n.each)*(O>_?_-1:d?d==="y"?_/O:O:Math.max(O,_/O))||0)*(s==="edges"?-1:1),x.b=_<0?i-_:i,x.u=nr(n.amount||n.each)||0,r=r&&_<0?bZ(r):r}return _=(x[m]-x.min)/x.max||0,Yt(x.b+(r?r(_):_)*x.v)+x.u}},d2=function(e){var n=Math.pow(10,((e+"").split(".")[1]||"").length);return function(r){var s=Yt(Math.round(parseFloat(r)/e)*e*n);return(s-s%1)/n+(vo(r)?0:nr(r))}},lR=function(e,n){var r=sr(e),s,i;return!r&&ki(e)&&(s=r=e.radius||Cs,e.values?(e=ks(e.values),(i=!vo(e[0]))&&(s*=s)):e=d2(e.increment)),Ia(n,r?sn(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),d=Cs,h=0,p=e.length,m,y;p--;)i?(m=e[p].x-u,y=e[p].y-c,m=m*m+y*y):m=Math.abs(e[p]-u),m<d&&(d=m,h=p);return h=!s||d<=s?e[h]:a,i||h===a||vo(a)?h:h+nr(a)}:d2(e))},uR=function(e,n,r,s){return Ia(sr(e)?!n:r===!0?!!(r=0):!s,function(){return sr(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})},cZ=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)}},dZ=function(e,n){return function(r){return e(parseFloat(r))+(n||nr(r))}},fZ=function(e,n,r){return dR(e,n,0,1,r)},cR=function(e,n,r){return Ia(r,function(s){return e[~~n(s)]})},hZ=function t(e,n,r){var s=n-e;return sr(e)?cR(e,t(0,e.length),n):Ia(r,function(i){return(s+(i-e)%s)%s+e})},pZ=function t(e,n,r){var s=n-e,i=s*2;return sr(e)?cR(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)})},_f=function(e){return e.replace(Kq,function(n){var r=n.indexOf("[")+1,s=n.substring(r||7,r?n.indexOf("]"):n.length-1).split(qq);return uR(r?s:+s[0],r?0:+s[1],+s[2]||1e-5)})},dR=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)})},mZ=function t(e,n,r,s){var i=isNaN(e+n)?0:function(y){return(1-y)*e+y*n};if(!i){var a=Nn(e),u={},c,d,h,p,m;if(r===!0&&(s=1)&&(r=null),a)e={p:e},n={p:n};else if(sr(e)&&!sr(n)){for(h=[],p=e.length,m=p-2,d=1;d<p;d++)h.push(t(e[d-1],e[d]));p--,i=function(w){w*=p;var _=Math.min(m,~~w);return h[_](w-_)},r=n}else s||(e=mc(sr(e)?[]:{},e));if(!h){for(c in n)yx.call(u,e,c,"get",n[c]);i=function(w){return bx(w,u)||(a?e.p:e)}}}return Ia(r,i)},k6=function(e,n,r){var s=e.labels,i=Cs,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},ts=function(e,n,r){var s=e.vars,i=s[n],a=Wt,u=e._ctx,c,d,h;if(i)return c=s[n+"Params"],d=s.callbackScope||e,r&&da.length&&r0(),u&&(Wt=u),h=c?i.apply(d,c):i.call(d),Wt=a,h},Pd=function(e){return wa(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Kn),e.progress()<1&&ts(e,"onInterrupt"),e},Ou,fR=[],hR=function(e){if(e)if(e=!e.name&&e.default||e,dx()||e.headless){var n=e.name,r=sn(e),s=n&&!r&&e.init?function(){this._props=[]}:e,i={init:yf,render:bx,add:yx,kill:MZ,modifier:RZ,rawVars:0},a={targetTest:0,get:0,getSetter:xx,aliases:{},register:0};if(yc(),e!==s){if(Xr[n])return;ls(s,ls(s0(e,i),a)),mc(s.prototype,mc(i,s0(e,a))),Xr[s.prop=n]=s,e.targetTest&&(nm.push(s),px[n]=1),n=(n==="css"?"CSS":n.charAt(0).toUpperCase()+n.substr(1))+"Plugin"}ZA(n,s),e.register&&e.register($r,s,jr)}else fR.push(e)},Tt=255,Td={aqua:[0,Tt,Tt],lime:[0,Tt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Tt],navy:[0,0,128],white:[Tt,Tt,Tt],olive:[128,128,0],yellow:[Tt,Tt,0],orange:[Tt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Tt,0,0],pink:[Tt,192,203],cyan:[0,Tt,Tt],transparent:[Tt,Tt,Tt,0]},G1=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)*Tt+.5|0},pR=function(e,n,r){var s=e?vo(e)?[e>>16,e>>8&Tt,e&Tt]:0:Td.black,i,a,u,c,d,h,p,m,y,w;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Td[e])s=Td[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&Tt,s&Tt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&Tt,e&Tt]}else if(e.substr(0,3)==="hsl"){if(s=w=e.match(x6),!n)c=+s[0]%360/360,d=+s[1]/100,h=+s[2]/100,a=h<=.5?h*(d+1):h+d-h*d,i=h*2-a,s.length>3&&(s[3]*=1),s[0]=G1(c+1/3,i,a),s[1]=G1(c,i,a),s[2]=G1(c-1/3,i,a);else if(~e.indexOf("="))return s=e.match(WA),r&&s.length<4&&(s[3]=1),s}else s=e.match(x6)||Td.transparent;s=s.map(Number)}return n&&!w&&(i=s[0]/Tt,a=s[1]/Tt,u=s[2]/Tt,p=Math.max(i,a,u),m=Math.min(i,a,u),h=(p+m)/2,p===m?c=d=0:(y=p-m,d=h>.5?y/(2-p-m):y/(p+m),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]=~~(d*100+.5),s[2]=~~(h*100+.5)),r&&s.length<4&&(s[3]=1),s},mR=function(e){var n=[],r=[],s=-1;return e.split(fa).forEach(function(i){var a=i.match(Mu)||[];n.push.apply(n,a),r.push(s+=a.length+1)}),n.c=r,n},P6=function(e,n,r){var s="",i=(e+s).match(fa),a=n?"hsla(":"rgba(",u=0,c,d,h,p;if(!i)return e;if(i=i.map(function(m){return(m=pR(m,n,1))&&a+(n?m[0]+","+m[1]+"%,"+m[2]+"%,"+m[3]:m.join(","))+")"}),r&&(h=mR(e),c=r.c,c.join(s)!==h.c.join(s)))for(d=e.replace(fa,"1").split(Mu),p=d.length-1;u<p;u++)s+=d[u]+(~c.indexOf(u)?i.shift()||a+"0,0,0,0)":(h.length?h:i.length?i:r).shift());if(!d)for(d=e.split(fa),p=d.length-1;u<p;u++)s+=d[u]+i[u];return s+d[p]},fa=(function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Td)t+="|"+e+"\\b";return new RegExp(t+")","gi")})(),gZ=/hsl[a]?\(/,gR=function(e){var n=e.join(" "),r;if(fa.lastIndex=0,fa.test(n))return r=gZ.test(n),e[1]=P6(e[1],r),e[0]=P6(e[0],r,mR(e[1])),!0},wf,Jr=(function(){var t=Date.now,e=500,n=33,r=t(),s=r,i=1e3/240,a=i,u=[],c,d,h,p,m,y,w=function _(x){var b=t()-s,P=x===!0,T,k,I,R;if((b>e||b<0)&&(r+=b-n),s+=b,I=s-r,T=I-a,(T>0||P)&&(R=++p.frame,m=I-p.time*1e3,p.time=I=I/1e3,a+=T+(T>=i?4:i-T),k=1),P||(c=d(_)),k)for(y=0;y<u.length;y++)u[y](I,m,R,x)};return p={time:0,frame:0,tick:function(){w(!0)},deltaRatio:function(x){return m/(1e3/(x||60))},wake:function(){KA&&(!i2&&dx()&&(di=i2=window,fx=di.document||{},as.gsap=$r,(di.gsapVersions||(di.gsapVersions=[])).push($r.version),qA(n0||di.GreenSockGlobals||!di.gsap&&di||{}),fR.forEach(hR)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,c&&p.sleep(),d=h||function(x){return setTimeout(x,a-p.time*1e3+1|0)},wf=1,w(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(c),wf=0,d=yf},lagSmoothing:function(x,b){e=x||1/0,n=Math.min(b||33,e)},fps:function(x){i=1e3/(x||240),a=p.time*1e3+i},add:function(x,b,P){var T=b?function(k,I,R,L){x(k,I,R,L),p.remove(T)}:x;return p.remove(x),u[P?"unshift":"push"](T),yc(),T},remove:function(x,b){~(b=u.indexOf(x))&&u.splice(b,1)&&y>=b&&y--},_listeners:u},p})(),yc=function(){return!wf&&Jr.wake()},dt={},vZ=/^[\d.\-M][\d.\-,\s]/,yZ=/["']/g,_Z=function(e){for(var n={},r=e.substr(1,e.length-3).split(":"),s=r[0],i=1,a=r.length,u,c,d;i<a;i++)c=r[i],u=i!==a-1?c.lastIndexOf(","):c.length,d=c.substr(0,u),n[s]=isNaN(d)?d.replace(yZ,"").trim():+d,s=c.substr(u+1).trim();return n},wZ=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)},xZ=function(e){var n=(e+"").split("("),r=dt[n[0]];return r&&n.length>1&&r.config?r.config.apply(null,~e.indexOf("{")?[_Z(n[1])]:wZ(e).split(",").map(JA)):dt._CE&&vZ.test(e)?dt._CE("",e):r},bZ=function(e){return function(n){return 1-e(1-n)}},Ml=function(e,n){return e&&(sn(e)?e:dt[e]||xZ(e))||n},Vl=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 Fr(e,function(u){dt[u]=as[u]=i,dt[a=u.toLowerCase()]=r;for(var c in i)dt[a+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=dt[u+"."+c]=i[c]}),i},vR=function(e){return function(n){return n<.5?(1-e(1-n*2))/2:.5+e((n-.5)*2)/2}},K1=function t(e,n,r){var s=n>=1?n:1,i=(r||(e?.3:.45))/(n<1?n:1),a=i/s2*(Math.asin(1/s)||0),u=function(h){return h===1?1:s*Math.pow(2,-10*h)*Gq((h-a)*i)+1},c=e==="out"?u:e==="in"?function(d){return 1-u(1-d)}:vR(u);return i=s2/i,c.config=function(d,h){return t(e,d,h)},c},q1=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)}:vR(r);return s.config=function(i){return t(e,i)},s};Fr("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var n=e<5?e+1:e;Vl(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})});dt.Linear.easeNone=dt.none=dt.Linear.easeIn;Vl("Elastic",K1("in"),K1("out"),K1());(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};Vl("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);Vl("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});Vl("Circ",function(t){return-(BA(1-t*t)-1)});Vl("Sine",function(t){return t===1?1:-Wq(t*Bq)+1});Vl("Back",q1("in"),q1("out"),q1());dt.SteppedEase=dt.steps=as.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-At;return function(u){return((s*Vf(0,a,u)|0)+i)*r}}};gf.ease=dt["quad.out"];Fr("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return mx+=t+","+t+"Params,"});var yR=function(e,n){this.id=Uq++,e._gsap=this,this.target=e,this.harness=n,this.get=n?n.get:XA,this.set=n?n.getSetter:xx},xf=(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,vc(this,+n.duration,1,1),this.data=n.data,Wt&&(this._ctx=Wt,Wt.data.push(this)),wf||Jr.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,vc(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(r,s){if(yc(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(V0(this,r),!i._dp||i.parent||nR(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)&&yi(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===At||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),QA(this,r,s)),this},e.time=function(r,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+E6(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)+E6(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?gc(this._tTime,i)+1:1},e.timeScale=function(r,s){if(!arguments.length)return this._rts===-At?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?i0(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-At?0:this._rts,this.totalTime(Vf(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),j0(this),nZ(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):(yc(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==At&&(this._tTime-=At)))),this):this._ps},e.startTime=function(r){if(arguments.length){this._start=Yt(r);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&yi(s,this,this._start-this._delay),this}return this._start},e.endTime=function(r){return this._start+(Nr(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?i0(s.rawTime(r),this):this._tTime:this._tTime},e.revert=function(r){r===void 0&&(r=Qq);var s=Kn;return Kn=r,vx(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Kn=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,C6(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(r){if(arguments.length){var s=this._time;return this._rDelay=r,C6(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(xs(this,r),Nr(s))},e.restart=function(r,s){return this.play().totalTime(r?-this._delay:0,Nr(s)),this._dur||(this._zTime=-At),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?-At:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-At,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)-At)},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=sn(r)?r:eR,c=function(){var h=s.then;s.then=null,i&&i(),sn(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(){Pd(this)},t})();ls(xf.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:-At,_prom:0,_ps:!1,_rts:1});var Mr=(function(t){zA(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=Nr(r.sortChildren),Xt&&yi(r.parent||Xt,Xi(i),s),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&rR(Xi(i),r.scrollTrigger),i}var n=e.prototype;return n.to=function(s,i,a){return Hd(0,arguments,this),this},n.from=function(s,i,a){return Hd(1,arguments,this),this},n.fromTo=function(s,i,a,u){return Hd(2,arguments,this),this},n.set=function(s,i,a){return i.duration=0,i.parent=this,$d(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new xn(s,i,xs(this,a),1),this},n.call=function(s,i,a){return yi(this,xn.delayedCall(0,s,i),a)},n.staggerTo=function(s,i,a,u,c,d,h){return a.duration=i,a.stagger=a.stagger||u,a.onComplete=d,a.onCompleteParams=h,a.parent=this,new xn(s,a,xs(this,c)),this},n.staggerFrom=function(s,i,a,u,c,d,h){return a.runBackwards=1,$d(a).immediateRender=Nr(a.immediateRender),this.staggerTo(s,i,a,u,c,d,h)},n.staggerFromTo=function(s,i,a,u,c,d,h,p){return u.startAt=a,$d(u).immediateRender=Nr(u.immediateRender),this.staggerTo(s,i,u,c,d,h,p)},n.render=function(s,i,a){var u=this._time,c=this._dirty?this.totalDuration():this._tDur,d=this._dur,h=s<=0?0:Yt(s),p=this._zTime<0!=s<0&&(this._initted||!d),m,y,w,_,x,b,P,T,k,I,R,L;if(this!==Xt&&h>c&&s>=0&&(h=c),h!==this._tTime||a||p){if(u!==this._time&&d&&(h+=this._time-u,s+=this._time-u),m=h,k=this._start,T=this._ts,b=!T,p&&(d||(u=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(R=this._yoyo,x=d+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(x*100+s,i,a);if(m=Yt(h%x),h===c?(_=this._repeat,m=d):(I=Yt(h/x),_=~~I,_&&_===I&&(m=d,_--),m>d&&(m=d)),I=gc(this._tTime,x),!u&&this._tTime&&I!==_&&this._tTime-I*x-this._dur<=0&&(I=_),R&&_&1&&(m=d-m,L=1),_!==I&&!this._lock){var A=R&&I&1,O=A===(R&&_&1);if(_<I&&(A=!A),u=A?0:h%d?d:h,this._lock=1,this.render(u||(L?0:Yt(_*x)),i,!d)._lock=0,this._tTime=h,!i&&this.parent&&ts(this,"onRepeat"),this.vars.repeatRefresh&&!L&&(this.invalidate()._lock=1,I=_),u&&u!==this._time||b!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(d=this._dur,c=this._tDur,O&&(this._lock=2,u=A?d:-1e-4,this.render(u,!0),this.vars.repeatRefresh&&!L&&this.invalidate()),this._lock=0,!this._ts&&!b)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(P=oZ(this,Yt(u),Yt(m)),P&&(h-=m-(m=P._start))),this._tTime=h,this._time=m,this._act=!!T,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,u=0),!u&&h&&d&&!i&&!I&&(ts(this,"onStart"),this._tTime!==h))return this;if(m>=u&&s>=0)for(y=this._first;y;){if(w=y._next,(y._act||m>=y._start)&&y._ts&&P!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(m-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(m-y._start)*y._ts,i,a),m!==this._time||!this._ts&&!b){P=0,w&&(h+=this._zTime=-At);break}}y=w}else{y=this._last;for(var D=s<0?s:m;y;){if(w=y._prev,(y._act||D<=y._end)&&y._ts&&P!==y){if(y.parent!==this)return this.render(s,i,a);if(y.render(y._ts>0?(D-y._start)*y._ts:(y._dirty?y.totalDuration():y._tDur)+(D-y._start)*y._ts,i,a||Kn&&vx(y)),m!==this._time||!this._ts&&!b){P=0,w&&(h+=this._zTime=D?-At:At);break}}y=w}}if(P&&!i&&(this.pause(),P.render(m>=u?0:-At)._zTime=m>=u?1:-1,this._ts))return this._start=k,j0(this),this.render(s,i,a);this._onUpdate&&!i&&ts(this,"onUpdate",!0),(h===c&&this._tTime>=this.totalDuration()||!h&&u)&&(k===this._start||Math.abs(T)!==Math.abs(this._ts))&&(this._lock||((s||!d)&&(h===c&&this._ts>0||!h&&this._ts<0)&&wa(this,1),!i&&!(s<0&&!u)&&(h||u||!c)&&(ts(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(vo(i)||(i=xs(this,i,s)),!(s instanceof xf)){if(sr(s))return s.forEach(function(u){return a.add(u,i)}),this;if(Nn(s))return this.addLabel(s,i);if(sn(s))s=xn.delayedCall(0,s);else return this}return this!==s?yi(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=-Cs);for(var c=[],d=this._first;d;)d._start>=u&&(d instanceof xn?i&&c.push(d):(a&&c.push(d),s&&c.push.apply(c,d.getChildren(!0,i,a)))),d=d._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 Nn(s)?this.removeLabel(s):sn(s)?this.killTweensOf(s):(s.parent===this&&F0(this,s),s===this._recent&&(this._recent=this._last),Rl(this))},n.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Yt(Jr.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]=xs(this,i),this},n.removeLabel=function(s){return delete this.labels[s],this},n.addPause=function(s,i,a){var u=xn.delayedCall(0,i||yf,a);return u.data="isPause",this._hasPause=1,yi(this,u,xs(this,s))},n.removePause=function(s){var i=this._first;for(s=xs(this,s);i;)i._start===s&&i.data==="isPause"&&wa(i),i=i._next},n.killTweensOf=function(s,i,a){for(var u=this.getTweensOf(s,a),c=u.length;c--;)ia!==u[c]&&u[c].kill(s,i);return this},n.getTweensOf=function(s,i){for(var a=[],u=ks(s),c=this._first,d=vo(i),h;c;)c instanceof xn?Jq(c._targets,u)&&(d?(!ia||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=xs(a,s),c=i,d=c.startAt,h=c.onStart,p=c.onStartParams,m=c.immediateRender,y,w=xn.to(a,ls({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:u,overwrite:"auto",duration:i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale())||At,onStart:function(){if(a.pause(),!y){var x=i.duration||Math.abs((u-(d&&"time"in d?d.time:a._time))/a.timeScale());w._dur!==x&&vc(w,x,0,1).render(w._time,!0,!0),y=1}h&&h.apply(w,p||[])}},i));return m?w.render(0):w},n.tweenFromTo=function(s,i,a){return this.tweenTo(i,ls({startAt:{time:xs(this,s)}},a))},n.recent=function(){return this._recent},n.nextLabel=function(s){return s===void 0&&(s=this._time),k6(this,xs(this,s))},n.previousLabel=function(s){return s===void 0&&(s=this._time),k6(this,xs(this,s),1)},n.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+At)},n.shiftChildren=function(s,i,a){a===void 0&&(a=0);var u=this._first,c=this.labels,d;for(s=Yt(s);u;)u._start>=a&&(u._start+=s,u._end+=s),u=u._next;if(i)for(d in c)c[d]>=a&&(c[d]+=s);return Rl(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={}),Rl(this)},n.totalDuration=function(s){var i=0,a=this,u=a._last,c=Cs,d,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;)d=u._prev,u._dirty&&u.totalDuration(),h=u._start,h>c&&a._sort&&u._ts&&!a._lock?(a._lock=1,yi(a,u,h-u._delay,1)._lock=0):c=h,h<0&&u._ts&&(i-=h,(!p&&!a._dp||p&&p.smoothChildTiming)&&(a._start+=Yt(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=d;vc(a,a===Xt&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Xt._ts&&(QA(Xt,i0(s,Xt)),YA=Jr.frame),Jr.frame>=b6){b6+=is.autoSleep||120;var i=Xt._first;if((!i||!i._ts)&&is.autoSleep&&Jr._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Jr.sleep()}}},e})(xf);ls(Mr.prototype,{_lock:0,_hasPause:0,_forcing:0});var SZ=function(e,n,r,s,i,a,u){var c=new jr(this._pt,e,n,0,1,ER,null,i),d=0,h=0,p,m,y,w,_,x,b,P;for(c.b=r,c.e=s,r+="",s+="",(b=~s.indexOf("random("))&&(s=_f(s)),a&&(P=[r,s],a(P,e,n),r=P[0],s=P[1]),m=r.match(U1)||[];p=U1.exec(s);)w=p[0],_=s.substring(d,p.index),y?y=(y+1)%5:_.substr(-5)==="rgba("&&(y=1),w!==m[h++]&&(x=parseFloat(m[h-1])||0,c._pt={_next:c._pt,p:_||h===1?_:",",s:x,c:w.charAt(1)==="="?Bu(x,w)-x:parseFloat(w)-x,m:y&&y<4?Math.round:0},d=U1.lastIndex);return c.c=d<s.length?s.substring(d,s.length):"",c.fp=u,(GA.test(s)||b)&&(c.e=0),this._pt=c,c},yx=function(e,n,r,s,i,a,u,c,d,h){sn(s)&&(s=s(i||0,e,a));var p=e[n],m=r!=="get"?r:sn(p)?d?e[n.indexOf("set")||!sn(e["get"+n.substr(3)])?n:"get"+n.substr(3)](d):e[n]():p,y=sn(p)?d?TZ:bR:wx,w;if(Nn(s)&&(~s.indexOf("random(")&&(s=_f(s)),s.charAt(1)==="="&&(w=Bu(m,s)+(nr(m)||0),(w||w===0)&&(s=w))),!h||m!==s||f2)return!isNaN(m*s)&&s!==""?(w=new jr(this._pt,e,n,+m||0,s-(m||0),typeof p=="boolean"?AZ:SR,0,y),d&&(w.fp=d),u&&w.modifier(u,this,e),this._pt=w):(!p&&!(n in e)&&hx(n,s),SZ.call(this,e,n,m,s,y,c||is.stringFilter,d))},EZ=function(e,n,r,s,i){if(sn(e)&&(e=zd(e,i,n,r,s)),!ki(e)||e.style&&e.nodeType||sr(e)||UA(e))return Nn(e)?zd(e,i,n,r,s):e;var a={},u;for(u in e)a[u]=zd(e[u],i,n,r,s);return a},_R=function(e,n,r,s,i,a){var u,c,d,h;if(Xr[e]&&(u=new Xr[e]).init(i,u.rawVars?n[e]:EZ(n[e],s,i,a,r),r,s,a)!==!1&&(r._pt=c=new jr(r._pt,i,e,0,1,u.render,u,0,u.priority),r!==Ou))for(d=r._ptLookup[r._targets.indexOf(i)],h=u._props.length;h--;)d[u._props[h]]=c;return u},ia,f2,_x=function t(e,n,r){var s=e.vars,i=s.ease,a=s.startAt,u=s.immediateRender,c=s.lazy,d=s.onUpdate,h=s.runBackwards,p=s.yoyoEase,m=s.keyframes,y=s.autoRevert,w=e._dur,_=e._startAt,x=e._targets,b=e.parent,P=b&&b.data==="nested"?b.vars.targets:x,T=e._overwrite==="auto"&&!ux,k=e.timeline,I=s.easeReverse||p,R,L,A,O,D,N,F,K,Z,W,G,Y,$;if(k&&(!m||!i)&&(i="none"),e._ease=Ml(i,gf.ease),e._rEase=I&&(Ml(I)||e._ease),e._from=!k&&!!s.runBackwards,e._from&&(e.ratio=1),!k||m&&!s.stagger){if(K=x[0]?Al(x[0]).harness:0,Y=K&&s[K.prop],R=s0(s,px),_&&(_._zTime<0&&_.progress(1),n<0&&h&&u&&!y?_.render(-1,!0):_.revert(h&&w?tm:Xq),_._lazy=0),a){if(wa(e._startAt=xn.set(x,ls({data:"isStart",overwrite:!1,parent:b,immediateRender:!0,lazy:!_&&Nr(c),startAt:null,delay:0,onUpdate:d&&function(){return ts(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Kn||!u&&!y)&&e._startAt.revert(tm),u&&w&&n<=0&&r<=0){n&&(e._zTime=n);return}}else if(h&&w&&!_){if(n&&(u=!1),A=ls({overwrite:!1,data:"isFromStart",lazy:u&&!_&&Nr(c),immediateRender:u,stagger:0,parent:b},R),Y&&(A[K.prop]=Y),wa(e._startAt=xn.set(x,A)),e._startAt._dp=0,e._startAt._sat=e,n<0&&(Kn?e._startAt.revert(tm):e._startAt.render(-1,!0)),e._zTime=n,!u)t(e._startAt,At,At);else if(!n)return}for(e._pt=e._ptCache=0,c=w&&Nr(c)||c&&!w,L=0;L<x.length;L++){if(D=x[L],F=D._gsap||gx(x)[L]._gsap,e._ptLookup[L]=W={},o2[F.id]&&da.length&&r0(),G=P===x?L:P.indexOf(D),K&&(Z=new K).init(D,Y||R,e,G,P)!==!1&&(e._pt=O=new jr(e._pt,D,Z.name,0,1,Z.render,Z,0,Z.priority),Z._props.forEach(function(J){W[J]=O}),Z.priority&&(N=1)),!K||Y)for(A in R)Xr[A]&&(Z=_R(A,R,e,G,D,P))?Z.priority&&(N=1):W[A]=O=yx.call(e,D,A,"get",R[A],G,P,0,s.stringFilter);e._op&&e._op[L]&&e.kill(D,e._op[L]),T&&e._pt&&(ia=e,Xt.killTweensOf(D,W,e.globalTime(n)),$=!e.parent,ia=0),e._pt&&c&&(o2[F.id]=1)}N&&CR(e),e._onInit&&e._onInit(e)}e._onUpdate=d,e._initted=(!e._op||e._pt)&&!$,m&&n<=0&&k.render(Cs,!0,!0)},CZ=function(e,n,r,s,i,a,u,c){var d=(e._pt&&e._ptCache||(e._ptCache={}))[n],h,p,m,y;if(!d)for(d=e._ptCache[n]=[],m=e._ptLookup,y=e._targets.length;y--;){if(h=m[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 f2=1,e.vars[n]="+=0",_x(e,u),f2=0,c?vf(n+" not eligible for reset. Try splitting into individual properties"):1;d.push(h)}for(y=d.length;y--;)p=d[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=hn(r)+nr(p.e)),p.b&&(p.b=h.s+nr(p.b))},kZ=function(e,n){var r=e[0]?Al(e[0]).harness:0,s=r&&r.aliases,i,a,u,c;if(!s)return n;i=mc({},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},PZ=function(e,n,r,s){var i=n.ease||s||"power1.inOut",a,u;if(sr(n))u=r[e]||(r[e]=[]),n.forEach(function(c,d){return u.push({t:d/(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})},zd=function(e,n,r,s,i){return sn(e)?e.call(n,r,s,i):Nn(e)&&~e.indexOf("random(")?_f(e):e},wR=mx+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",xR={};Fr(wR+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return xR[t]=1});var xn=(function(t){zA(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:$d(s))||this;var c=u.vars,d=c.duration,h=c.delay,p=c.immediateRender,m=c.stagger,y=c.overwrite,w=c.keyframes,_=c.defaults,x=c.scrollTrigger,b=s.parent||Xt,P=(sr(r)||UA(r)?vo(r[0]):"length"in s)?[r]:ks(r),T,k,I,R,L,A,O,D;if(u._targets=P.length?gx(P):vf("GSAP target "+r+" not found. https://gsap.com",!is.nullTargetWarn)||[],u._ptLookup=[],u._overwrite=y,w||m||Mp(d)||Mp(h)){s=u.vars;var N=s.easeReverse||s.yoyoEase;if(T=u.timeline=new Mr({data:"nested",defaults:_||{},targets:b&&b.data==="nested"?b.vars.targets:P}),T.kill(),T.parent=T._dp=Xi(u),T._start=0,m||Mp(d)||Mp(h)){if(R=P.length,O=m&&aR(m),ki(m))for(L in m)~wR.indexOf(L)&&(D||(D={}),D[L]=m[L]);for(k=0;k<R;k++)I=s0(s,xR),I.stagger=0,N&&(I.easeReverse=N),D&&mc(I,D),A=P[k],I.duration=+zd(d,Xi(u),k,A,P),I.delay=(+zd(h,Xi(u),k,A,P)||0)-u._delay,!m&&R===1&&I.delay&&(u._delay=h=I.delay,u._start+=h,I.delay=0),T.to(A,I,O?O(k,A,P):0),T._ease=dt.none;T.duration()?d=h=0:u.timeline=0}else if(w){$d(ls(T.vars.defaults,{ease:"none"})),T._ease=Ml(w.ease||s.ease||"none");var F=0,K,Z,W;if(sr(w))w.forEach(function(G){return T.to(P,G,">")}),T.duration();else{I={};for(L in w)L==="ease"||L==="easeEach"||PZ(L,w[L],I,w.easeEach);for(L in I)for(K=I[L].sort(function(G,Y){return G.t-Y.t}),F=0,k=0;k<K.length;k++)Z=K[k],W={ease:Z.e,duration:(Z.t-(k?K[k-1].t:0))/100*d},W[L]=Z.v,T.to(P,W,F),F+=W.duration;T.duration()<d&&T.to({},{duration:d-T.duration()})}}d||u.duration(d=T.duration())}else u.timeline=0;return y===!0&&!ux&&(ia=Xi(u),Xt.killTweensOf(P),ia=0),yi(b,Xi(u),i),s.reversed&&u.reverse(),s.paused&&u.paused(!0),(p||!d&&!w&&u._start===Yt(b._time)&&Nr(p)&&rZ(Xi(u))&&b.data!=="nested")&&(u._tTime=-At,u.render(Math.max(0,-h)||0)),x&&rR(Xi(u),x),u}var n=e.prototype;return n.render=function(s,i,a){var u=this._time,c=this._tDur,d=this._dur,h=s<0,p=s>c-At&&!h?c:s<At?0:s,m,y,w,_,x,b,P,T;if(!d)iZ(this,s,i,a);else if(p!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h||this._lazy){if(m=p,T=this.timeline,this._repeat){if(_=d+this._rDelay,this._repeat<-1&&h)return this.totalTime(_*100+s,i,a);if(m=Yt(p%_),p===c?(w=this._repeat,m=d):(x=Yt(p/_),w=~~x,w&&w===x?(m=d,w--):m>d&&(m=d)),b=this._yoyo&&w&1,b&&(m=d-m),x=gc(this._tTime,_),m===u&&!a&&this._initted&&w===x)return this._tTime=p,this;w!==x&&this.vars.repeatRefresh&&!b&&!this._lock&&m!==_&&this._initted&&(this._lock=a=1,this.render(Yt(_*w),!0).invalidate()._lock=0)}if(!this._initted){if(sR(this,h?s:m,a,i,p))return this._tTime=0,this;if(u!==this._time&&!(a&&this.vars.repeatRefresh&&w!==x))return this;if(d!==this._dur)return this.render(s,i,a)}if(this._rEase){var k=m<u;if(k!==this._inv){var I=k?u:d-u;this._inv=k,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=u,this._invRecip=I?(k?-1:1)/I:0,this._invScale=k?-this.ratio:1-this.ratio,this._invEase=k?this._rEase:this._ease}this.ratio=P=this._invRatio+this._invScale*this._invEase((m-this._invTime)*this._invRecip)}else this.ratio=P=this._ease(m/d);if(this._from&&(this.ratio=P=1-P),this._tTime=p,this._time=m,!this._act&&this._ts&&(this._act=1,this._lazy=0),!u&&p&&!i&&!x&&(ts(this,"onStart"),this._tTime!==p))return this;for(y=this._pt;y;)y.r(P,y.d),y=y._next;T&&T.render(s<0?s:T._dur*T._ease(m/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(h&&a2(this,s,i,a),ts(this,"onUpdate")),this._repeat&&w!==x&&this.vars.onRepeat&&!i&&this.parent&&ts(this,"onRepeat"),(p===this._tDur||!p)&&this._tTime===p&&(h&&!this._onUpdate&&a2(this,s,!0,!0),(s||!d)&&(p===this._tDur&&this._ts>0||!p&&this._ts<0)&&wa(this,1),!i&&!(h&&!u)&&(p||u||b)&&(ts(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){wf||Jr.wake(),this._ts||this.play();var d=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||_x(this,d),h=this._ease(d/this._dur),CZ(this,s,i,a,u,h,d,c)?this.resetTo(s,i,a,u,1):(V0(this,0),this.parent||tR(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?Pd(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Kn),this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(s,i,ia&&ia.vars.overwrite!==!0)._first||Pd(this),this.parent&&a!==this.timeline.totalDuration()&&vc(this,this._dur*this.timeline._tDur/a,0,1),this}var u=this._targets,c=s?ks(s):u,d=this._ptLookup,h=this._pt,p,m,y,w,_,x,b;if((!i||i==="all")&&tZ(u,c))return i==="all"&&(this._pt=0),Pd(this);for(p=this._op=this._op||[],i!=="all"&&(Nn(i)&&(_={},Fr(i,function(P){return _[P]=1}),i=_),i=kZ(u,i)),b=u.length;b--;)if(~c.indexOf(u[b])){m=d[b],i==="all"?(p[b]=i,w=m,y={}):(y=p[b]=p[b]||{},w=i);for(_ in w)x=m&&m[_],x&&((!("kill"in x.d)||x.d.kill(_)===!0)&&F0(this,x,"_pt"),delete m[_]),y!=="all"&&(y[_]=1)}return this._initted&&!this._pt&&h&&Pd(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Hd(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 Hd(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 Xt.killTweensOf(s,i,a)},e})(xf);ls(xn.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Fr("staggerTo,staggerFrom,staggerFromTo",function(t){xn[t]=function(){var e=new Mr,n=u2.call(arguments,0);return n.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,n)}});var wx=function(e,n,r){return e[n]=r},bR=function(e,n,r){return e[n](r)},TZ=function(e,n,r,s){return e[n](s.fp,r)},IZ=function(e,n,r){return e.setAttribute(n,r)},xx=function(e,n){return sn(e[n])?bR:cx(e[n])&&e.setAttribute?IZ:wx},SR=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e6)/1e6,n)},AZ=function(e,n){return n.set(n.t,n.p,!!(n.s+n.c*e),n)},ER=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)},bx=function(e,n){for(var r=n._pt;r;)r.r(e,r.d),r=r._next},RZ=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},MZ=function(e){for(var n=this._pt,r,s;n;)s=n._next,n.p===e&&!n.op||n.op===e?F0(this,n,"_pt"):n.dep||(r=1),n=s;return!r},OZ=function(e,n,r,s){s.mSet(e,n,s.m.call(s.tween,r,s.mt),s)},CR=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},jr=(function(){function t(n,r,s,i,a,u,c,d,h){this.t=r,this.s=i,this.c=a,this.p=s,this.r=u||SR,this.d=c||this,this.set=d||wx,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=OZ,this.m=r,this.mt=i,this.tween=s},t})();Fr(mx+"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 px[t]=1});as.TweenMax=as.TweenLite=xn;as.TimelineLite=as.TimelineMax=Mr;Xt=new Mr({sortChildren:!1,defaults:gf,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});is.stringFilter=gR;var Ol=[],rm={},LZ=[],T6=0,DZ=0,Z1=function(e){return(rm[e]||LZ).map(function(n){return n()})},h2=function(){var e=Date.now(),n=[];e-T6>2&&(Z1("matchMediaInit"),Ol.forEach(function(r){var s=r.queries,i=r.conditions,a,u,c,d;for(u in s)a=di.matchMedia(s[u]).matches,a&&(c=1),a!==i[u]&&(i[u]=a,d=1);d&&(r.revert(),c&&n.push(r))}),Z1("matchMediaRevert"),n.forEach(function(r){return r.onMatch(r,function(s){return r.add(null,s)})}),T6=e,Z1("matchMedia"))},kR=(function(){function t(n,r){this.selector=r&&c2(r),this.data=[],this._r=[],this.isReverted=!1,this.id=DZ++,n&&this.add(n)}var e=t.prototype;return e.add=function(r,s,i){sn(r)&&(i=s,s=r,r=sn);var a=this,u=function(){var d=Wt,h=a.selector,p;return d&&d!==a&&d.data.push(a),i&&(a.selector=c2(i)),Wt=a,p=s.apply(a,arguments),sn(p)&&a._r.push(p),Wt=d,a.selector=h,a.isReverted=!1,p};return a.last=u,r===sn?u(a,function(c){return a.add(null,c)}):r?a[r]=u:u},e.ignore=function(r){var s=Wt;Wt=null,r(this),Wt=s},e.getTweens=function(){var r=[];return this.data.forEach(function(s){return s instanceof t?r.push.apply(r,s.getTweens()):s instanceof xn&&!(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,d;c--;)d=i.data[c],d.data==="isFlip"&&(d.revert(),d.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--;)d=i.data[c],d instanceof Mr?d.data!=="nested"&&(d.scrollTrigger&&d.scrollTrigger.revert(),d.kill()):!(d instanceof xn)&&d.revert&&d.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=Ol.length;a--;)Ol[a].id===this.id&&Ol.splice(a,1)},e.revert=function(r){this.kill(r||{})},t})(),NZ=(function(){function t(n){this.contexts=[],this.scope=n,Wt&&Wt.data.push(this)}var e=t.prototype;return e.add=function(r,s,i){ki(r)||(r={matches:r});var a=new kR(0,i||this.scope),u=a.conditions={},c,d,h;Wt&&!a.selector&&(a.selector=Wt.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=r;for(d in r)d==="all"?h=1:(c=di.matchMedia(r[d]),c&&(Ol.indexOf(a)<0&&Ol.push(a),(u[d]=c.matches)&&(h=1),c.addListener?c.addListener(h2):c.addEventListener("change",h2)));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})(),o0={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 hR(s)})},timeline:function(e){return new Mr(e)},getTweensOf:function(e,n){return Xt.getTweensOf(e,n)},getProperty:function(e,n,r,s){Nn(e)&&(e=ks(e)[0]);var i=Al(e||{}).get,a=r?eR:JA;return r==="native"&&(r=""),e&&(n?a((Xr[n]&&Xr[n].get||i)(e,n,r,s)):function(u,c,d){return a((Xr[u]&&Xr[u].get||i)(e,u,c,d))})},quickSetter:function(e,n,r){if(e=ks(e),e.length>1){var s=e.map(function(h){return $r.quickSetter(h,n,r)}),i=s.length;return function(h){for(var p=i;p--;)s[p](h)}}e=e[0]||{};var a=Xr[n],u=Al(e),c=u.harness&&(u.harness.aliases||{})[n]||n,d=a?function(h){var p=new a;Ou._pt=0,p.init(e,r?h+r:h,Ou,0,[e]),p.render(1,p),Ou._pt&&bx(1,Ou)}:u.set(e,c);return a?d:function(h){return d(e,c,r?h+r:h,u,1)}},quickTo:function(e,n,r){var s,i=$r.to(e,ls((s={},s[n]="+=0.1",s.paused=!0,s.stagger=0,s),r||{})),a=function(c,d,h){return i.resetTo(n,c,d,h)};return a.tween=i,a},isTweening:function(e){return Xt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Ml(e.ease,gf.ease)),S6(gf,e||{})},config:function(e){return S6(is,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&&!Xr[u]&&!as[u]&&vf(n+" effect requires "+u+" plugin.")}),W1[n]=function(u,c,d){return r(ks(u),ls(c||{},i),d)},a&&(Mr.prototype[n]=function(u,c,d){return this.add(W1[n](u,ki(c)?c:(d=c)&&{},this),d)})},registerEase:function(e,n){dt[e]=Ml(n)},parseEase:function(e,n){return arguments.length?Ml(e,n):dt},getById:function(e){return Xt.getById(e)},exportRoot:function(e,n){e===void 0&&(e={});var r=new Mr(e),s,i;for(r.smoothChildTiming=Nr(e.smoothChildTiming),Xt.remove(r),r._dp=0,r._time=r._tTime=Xt._time,s=Xt._first;s;)i=s._next,(n||!(!s._dur&&s instanceof xn&&s.vars.onComplete===s._targets[0]))&&yi(r,s,s._start-s._delay),s=i;return yi(Xt,r,0),r},context:function(e,n){return e?new kR(e,n):Wt},matchMedia:function(e){return new NZ(e)},matchMediaRefresh:function(){return Ol.forEach(function(e){var n=e.conditions,r,s;for(s in n)n[s]&&(n[s]=!1,r=1);r&&e.revert()})||h2()},addEventListener:function(e,n){var r=rm[e]||(rm[e]=[]);~r.indexOf(n)||r.push(n)},removeEventListener:function(e,n){var r=rm[e],s=r&&r.indexOf(n);s>=0&&r.splice(s,1)},utils:{wrap:hZ,wrapYoyo:pZ,distribute:aR,random:uR,snap:lR,normalize:fZ,getUnit:nr,clamp:lZ,splitColor:pR,toArray:ks,selector:c2,mapRange:dR,pipe:cZ,unitize:dZ,interpolate:mZ,shuffle:oR},install:qA,effects:W1,ticker:Jr,updateRoot:Mr.updateRoot,plugins:Xr,globalTimeline:Xt,core:{PropTween:jr,globals:ZA,Tween:xn,Timeline:Mr,Animation:xf,getCache:Al,_removeLinkedListItem:F0,reverting:function(){return Kn},context:function(e){return e&&Wt&&(Wt.data.push(e),e._ctx=Wt),Wt},suppressOverwrites:function(e){return ux=e}}};Fr("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return o0[t]=xn[t]});Jr.add(Mr.updateRoot);Ou=o0.to({},{duration:0});var FZ=function(e,n){for(var r=e._pt;r&&r.p!==n&&r.op!==n&&r.fp!==n;)r=r._next;return r},jZ=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=FZ(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,d;if(Nn(i)&&(c={},Fr(i,function(h){return c[h]=1}),i=c),n){c={};for(d in i)c[d]=n(i[d]);i=c}jZ(u,i)}}}},$r=o0.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;)Kn?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",d2),Y1("modifiers"),Y1("snap",lR))||o0;xn.version=Mr.version=$r.version="3.15.0";KA=1;dx()&&yc();dt.Power0;dt.Power1;dt.Power2;dt.Power3;dt.Power4;dt.Linear;dt.Quad;dt.Cubic;dt.Quart;dt.Quint;dt.Strong;dt.Elastic;dt.Back;dt.SteppedEase;dt.Bounce;dt.Sine;dt.Expo;dt.Circ;/*!
123
+ * CSSPlugin 3.15.0
124
+ * https://gsap.com
125
+ *
126
+ * Copyright 2008-2026, GreenSock. All rights reserved.
127
+ * Subject to the terms at https://gsap.com/standard-license
128
+ * @author: Jack Doyle, jack@greensock.com
129
+ */var I6,oa,Uu,Sx,ml,A6,Ex,VZ=function(){return typeof window<"u"},yo={},ll=180/Math.PI,Wu=Math.PI/180,wu=Math.atan2,R6=1e8,Cx=/([A-Z])/g,$Z=/(left|right|width|margin|padding|x)/i,HZ=/[\s,\(]\S/,xi={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},p2=function(e,n){return n.set(n.t,n.p,Math.round((n.s+n.c*e)*1e4)/1e4+n.u,n)},zZ=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)},BZ=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)},UZ=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)},WZ=function(e,n){var r=n.s+n.c*e;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},PR=function(e,n){return n.set(n.t,n.p,e?n.e:n.b,n)},TR=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},KZ=function(e,n,r){return e.style.setProperty(n,r)},qZ=function(e,n,r){return e._gsap[n]=r},ZZ=function(e,n,r){return e._gsap.scaleX=e._gsap.scaleY=r},YZ=function(e,n,r,s,i){var a=e._gsap;a.scaleX=a.scaleY=r,a.renderTransform(i,a)},XZ=function(e,n,r,s,i){var a=e._gsap;a[n]=r,a.renderTransform(i,a)},Qt="transform",Vr=Qt+"Origin",QZ=function t(e,n){var r=this,s=this.target,i=s.style,a=s._gsap;if(e in yo&&i){if(this.tfm=this.tfm||{},e!=="transform")e=xi[e]||e,~e.indexOf(",")?e.split(",").forEach(function(u){return r.tfm[u]=eo(s,u)}):this.tfm[e]=a.x?a[e]:eo(s,e),e===Vr&&(this.tfm.zOrigin=a.zOrigin);else return xi.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(Vr,n,"")),e=Qt}(i||n)&&this.props.push(e,n,i[e])},IR=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},JZ=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(Cx,"-$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=Ex(),(!i||!i.isStart)&&!r[Qt]&&(IR(r),s.zOrigin&&r[Vr]&&(r[Vr]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},AR=function(e,n){var r={target:e,props:[],revert:JZ,save:QZ};return e._gsap||$r.core.getCache(e),n&&e.style&&e.nodeType&&n.split(",").forEach(function(s){return r.save(s)}),r},RR,m2=function(e,n){var r=oa.createElementNS?oa.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):oa.createElement(e);return r&&r.style?r:oa.createElement(e)},ns=function t(e,n,r){var s=getComputedStyle(e);return s[n]||s.getPropertyValue(n.replace(Cx,"-$1").toLowerCase())||s.getPropertyValue(n)||!r&&t(e,_c(n)||n,1)||""},M6="O,Moz,ms,Ms,Webkit".split(","),_c=function(e,n,r){var s=n||ml,i=s.style,a=5;if(e in i&&!r)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(M6[a]+e in i););return a<0?null:(a===3?"ms":a>=0?M6[a]:"")+e},g2=function(){VZ()&&window.document&&(I6=window,oa=I6.document,Uu=oa.documentElement,ml=m2("div")||{style:{}},m2("div"),Qt=_c(Qt),Vr=Qt+"Origin",ml.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",RR=!!_c("perspective"),Ex=$r.core.reverting,Sx=1)},O6=function(e){var n=e.ownerSVGElement,r=m2("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",r.appendChild(s),Uu.appendChild(r);try{i=s.getBBox()}catch{}return r.removeChild(s),Uu.removeChild(r),i},L6=function(e,n){for(var r=n.length;r--;)if(e.hasAttribute(n[r]))return e.getAttribute(n[r])},MR=function(e){var n,r;try{n=e.getBBox()}catch{n=O6(e),r=1}return n&&(n.width||n.height)||r||(n=O6(e)),n&&!n.width&&!n.x&&!n.y?{x:+L6(e,["x","cx","x1"])||0,y:+L6(e,["y","cy","y1"])||0,width:0,height:0}:n},OR=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&MR(e))},xa=function(e,n){if(n){var r=e.style,s;n in yo&&n!==Vr&&(n=Qt),r.removeProperty?(s=n.substr(0,2),(s==="ms"||n.substr(0,6)==="webkit")&&(n="-"+n),r.removeProperty(s==="--"?n:n.replace(Cx,"-$1").toLowerCase())):r.removeAttribute(n)}},aa=function(e,n,r,s,i,a){var u=new jr(e._pt,n,r,0,1,a?TR:PR);return e._pt=u,u.b=s,u.e=i,e._props.push(r),u},D6={deg:1,rad:1,turn:1},eY={grid:1,flex:1},ba=function t(e,n,r,s){var i=parseFloat(r)||0,a=(r+"").trim().substr((i+"").length)||"px",u=ml.style,c=$Z.test(n),d=e.tagName.toLowerCase()==="svg",h=(d?"client":"offset")+(c?"Width":"Height"),p=100,m=s==="px",y=s==="%",w,_,x,b;if(s===a||!i||D6[s]||D6[a])return i;if(a!=="px"&&!m&&(i=t(e,n,r,"px")),b=e.getCTM&&OR(e),(y||a==="%")&&(yo[n]||~n.indexOf("adius")))return w=b?e.getBBox()[c?"width":"height"]:e[h],hn(y?i/w*p:i/100*w);if(u[c?"width":"height"]=p+(m?a:s),_=s!=="rem"&&~n.indexOf("adius")||s==="em"&&e.appendChild&&!d?e:e.parentNode,b&&(_=(e.ownerSVGElement||{}).parentNode),(!_||_===oa||!_.appendChild)&&(_=oa.body),x=_._gsap,x&&y&&x.width&&c&&x.time===Jr.time&&!x.uncache)return hn(i/x.width*p);if(y&&(n==="height"||n==="width")){var P=e.style[n];e.style[n]=p+s,w=e[h],P?e.style[n]=P:xa(e,n)}else(y||a==="%")&&!eY[ns(_,"display")]&&(u.position=ns(e,"position")),_===e&&(u.position="static"),_.appendChild(ml),w=ml[h],_.removeChild(ml),u.position="absolute";return c&&y&&(x=Al(_),x.time=Jr.time,x.width=_[h]),hn(m?w*i/p:w&&i?p/w*i:0)},eo=function(e,n,r,s){var i;return Sx||g2(),n in xi&&n!=="transform"&&(n=xi[n],~n.indexOf(",")&&(n=n.split(",")[0])),yo[n]&&n!=="transform"?(i=Sf(e,s),i=n!=="transformOrigin"?i[n]:i.svg?i.origin:l0(ns(e,Vr))+" "+i.zOrigin+"px"):(i=e.style[n],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=a0[n]&&a0[n](e,n,r)||ns(e,n)||XA(e,n)||(n==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?ba(e,n,i,r)+r:i},tY=function(e,n,r,s){if(!r||r==="none"){var i=_c(n,e,1),a=i&&ns(e,i,1);a&&a!==r?(n=i,r=a):n==="borderColor"&&(r=ns(e,"borderTopColor"))}var u=new jr(this._pt,e.style,n,0,1,ER),c=0,d=0,h,p,m,y,w,_,x,b,P,T,k,I;if(u.b=r,u.e=s,r+="",s+="",s.substring(0,6)==="var(--"&&(s=ns(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(_=e.style[n],e.style[n]=s,s=ns(e,n)||s,_?e.style[n]=_:xa(e,n)),h=[r,s],gR(h),r=h[0],s=h[1],m=r.match(Mu)||[],I=s.match(Mu)||[],I.length){for(;p=Mu.exec(s);)x=p[0],P=s.substring(c,p.index),w?w=(w+1)%5:(P.substr(-5)==="rgba("||P.substr(-5)==="hsla(")&&(w=1),x!==(_=m[d++]||"")&&(y=parseFloat(_)||0,k=_.substr((y+"").length),x.charAt(1)==="="&&(x=Bu(y,x)+k),b=parseFloat(x),T=x.substr((b+"").length),c=Mu.lastIndex-T.length,T||(T=T||is.units[n]||k,c===s.length&&(s+=T,u.e+=T)),k!==T&&(y=ba(e,n,_,T)||0),u._pt={_next:u._pt,p:P||d===1?P:",",s:y,c:b-y,m:w&&w<4||n==="zIndex"?Math.round:0});u.c=c<s.length?s.substring(c,s.length):""}else u.r=n==="display"&&s==="none"?TR:PR;return GA.test(s)&&(u.e=0),this._pt=u,u},N6={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},nY=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]=N6[r]||r,n[1]=N6[s]||s,n.join(" ")},rY=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,d;if(i==="all"||i===!0)s.cssText="",c=1;else for(i=i.split(","),d=i.length;--d>-1;)u=i[d],yo[u]&&(c=1,u=u==="transformOrigin"?Vr:Qt),xa(r,u);c&&(xa(r,Qt),a&&(a.svg&&r.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Sf(r,1),a.uncache=1,IR(s)))}},a0={clearProps:function(e,n,r,s,i){if(i.data!=="isFromStart"){var a=e._pt=new jr(e._pt,n,r,0,0,rY);return a.u=s,a.pr=-10,a.tween=i,e._props.push(r),1}}},bf=[1,0,0,1,0,0],LR={},DR=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},F6=function(e){var n=ns(e,Qt);return DR(n)?bf:n.substr(7).match(WA).map(hn)},kx=function(e,n){var r=e._gsap||Al(e),s=e.style,i=F6(e),a,u,c,d;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"?bf:i):(i===bf&&!e.offsetParent&&e!==Uu&&!r.svg&&(c=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(d=1,u=e.nextElementSibling,Uu.appendChild(e)),i=F6(e),c?s.display=c:xa(e,"display"),d&&(u?a.insertBefore(e,u):a?a.appendChild(e):Uu.removeChild(e))),n&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},v2=function(e,n,r,s,i,a){var u=e._gsap,c=i||kx(e,!0),d=u.xOrigin||0,h=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,y=c[0],w=c[1],_=c[2],x=c[3],b=c[4],P=c[5],T=n.split(" "),k=parseFloat(T[0])||0,I=parseFloat(T[1])||0,R,L,A,O;r?c!==bf&&(L=y*x-w*_)&&(A=k*(x/L)+I*(-_/L)+(_*P-x*b)/L,O=k*(-w/L)+I*(y/L)-(y*P-w*b)/L,k=A,I=O):(R=MR(e),k=R.x+(~T[0].indexOf("%")?k/100*R.width:k),I=R.y+(~(T[1]||T[0]).indexOf("%")?I/100*R.height:I)),s||s!==!1&&u.smooth?(b=k-d,P=I-h,u.xOffset=p+(b*y+P*_)-b,u.yOffset=m+(b*w+P*x)-P):u.xOffset=u.yOffset=0,u.xOrigin=k,u.yOrigin=I,u.smooth=!!s,u.origin=n,u.originIsAbsolute=!!r,e.style[Vr]="0px 0px",a&&(aa(a,u,"xOrigin",d,k),aa(a,u,"yOrigin",h,I),aa(a,u,"xOffset",p,u.xOffset),aa(a,u,"yOffset",m,u.yOffset)),e.setAttribute("data-svg-origin",k+" "+I)},Sf=function(e,n){var r=e._gsap||new yR(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),d=ns(e,Vr)||"0",h,p,m,y,w,_,x,b,P,T,k,I,R,L,A,O,D,N,F,K,Z,W,G,Y,$,J,H,j,X,oe,se,ee;return h=p=m=_=x=b=P=T=k=0,y=w=1,r.svg=!!(e.getCTM&&OR(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"),L=kx(e,r.svg),r.svg&&(r.uncache?($=e.getBBox(),d=r.xOrigin-$.x+"px "+(r.yOrigin-$.y)+"px",Y=""):Y=!n&&e.getAttribute("data-svg-origin"),v2(e,Y||d,!!Y||r.originIsAbsolute,r.smooth!==!1,L)),I=r.xOrigin||0,R=r.yOrigin||0,L!==bf&&(N=L[0],F=L[1],K=L[2],Z=L[3],h=W=L[4],p=G=L[5],L.length===6?(y=Math.sqrt(N*N+F*F),w=Math.sqrt(Z*Z+K*K),_=N||F?wu(F,N)*ll:0,P=K||Z?wu(K,Z)*ll+_:0,P&&(w*=Math.abs(Math.cos(P*Wu))),r.svg&&(h-=I-(I*N+R*K),p-=R-(I*F+R*Z))):(ee=L[6],oe=L[7],H=L[8],j=L[9],X=L[10],se=L[11],h=L[12],p=L[13],m=L[14],A=wu(ee,X),x=A*ll,A&&(O=Math.cos(-A),D=Math.sin(-A),Y=W*O+H*D,$=G*O+j*D,J=ee*O+X*D,H=W*-D+H*O,j=G*-D+j*O,X=ee*-D+X*O,se=oe*-D+se*O,W=Y,G=$,ee=J),A=wu(-K,X),b=A*ll,A&&(O=Math.cos(-A),D=Math.sin(-A),Y=N*O-H*D,$=F*O-j*D,J=K*O-X*D,se=Z*D+se*O,N=Y,F=$,K=J),A=wu(F,N),_=A*ll,A&&(O=Math.cos(A),D=Math.sin(A),Y=N*O+F*D,$=W*O+G*D,F=F*O-N*D,G=G*O-W*D,N=Y,W=$),x&&Math.abs(x)+Math.abs(_)>359.9&&(x=_=0,b=180-b),y=hn(Math.sqrt(N*N+F*F+K*K)),w=hn(Math.sqrt(G*G+ee*ee)),A=wu(W,G),P=Math.abs(A)>2e-4?A*ll:0,k=se?1/(se<0?-se:se):0),r.svg&&(Y=e.getAttribute("transform"),r.forceCSS=e.setAttribute("transform","")||!DR(ns(e,Qt)),Y&&e.setAttribute("transform",Y))),Math.abs(P)>90&&Math.abs(P)<270&&(i?(y*=-1,P+=_<=0?180:-180,_+=_<=0?180:-180):(w*=-1,P+=P<=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=m+a,r.scaleX=hn(y),r.scaleY=hn(w),r.rotation=hn(_)+u,r.rotationX=hn(x)+u,r.rotationY=hn(b)+u,r.skewX=P+u,r.skewY=T+u,r.transformPerspective=k+a,(r.zOrigin=parseFloat(d.split(" ")[2])||!n&&r.zOrigin||0)&&(s[Vr]=l0(d)),r.xOffset=r.yOffset=0,r.force3D=is.force3D,r.renderTransform=r.svg?iY:RR?NR:sY,r.uncache=0,r},l0=function(e){return(e=e.split(" "))[0]+" "+e[1]},X1=function(e,n,r){var s=nr(n);return hn(parseFloat(n)+parseFloat(ba(e,"x",r+"px",s)))+s},sY=function(e,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,NR(e,n)},tl="0deg",_d="0px",nl=") ",NR=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.z,d=r.rotation,h=r.rotationY,p=r.rotationX,m=r.skewX,y=r.skewY,w=r.scaleX,_=r.scaleY,x=r.transformPerspective,b=r.force3D,P=r.target,T=r.zOrigin,k="",I=b==="auto"&&e&&e!==1||b===!0;if(T&&(p!==tl||h!==tl)){var R=parseFloat(h)*Wu,L=Math.sin(R),A=Math.cos(R),O;R=parseFloat(p)*Wu,O=Math.cos(R),a=X1(P,a,L*O*-T),u=X1(P,u,-Math.sin(R)*-T),c=X1(P,c,A*O*-T+T)}x!==_d&&(k+="perspective("+x+nl),(s||i)&&(k+="translate("+s+"%, "+i+"%) "),(I||a!==_d||u!==_d||c!==_d)&&(k+=c!==_d||I?"translate3d("+a+", "+u+", "+c+") ":"translate("+a+", "+u+nl),d!==tl&&(k+="rotate("+d+nl),h!==tl&&(k+="rotateY("+h+nl),p!==tl&&(k+="rotateX("+p+nl),(m!==tl||y!==tl)&&(k+="skew("+m+", "+y+nl),(w!==1||_!==1)&&(k+="scale("+w+", "+_+nl),P.style[Qt]=k||"translate(0, 0)"},iY=function(e,n){var r=n||this,s=r.xPercent,i=r.yPercent,a=r.x,u=r.y,c=r.rotation,d=r.skewX,h=r.skewY,p=r.scaleX,m=r.scaleY,y=r.target,w=r.xOrigin,_=r.yOrigin,x=r.xOffset,b=r.yOffset,P=r.forceCSS,T=parseFloat(a),k=parseFloat(u),I,R,L,A,O;c=parseFloat(c),d=parseFloat(d),h=parseFloat(h),h&&(h=parseFloat(h),d+=h,c+=h),c||d?(c*=Wu,d*=Wu,I=Math.cos(c)*p,R=Math.sin(c)*p,L=Math.sin(c-d)*-m,A=Math.cos(c-d)*m,d&&(h*=Wu,O=Math.tan(d-h),O=Math.sqrt(1+O*O),L*=O,A*=O,h&&(O=Math.tan(h),O=Math.sqrt(1+O*O),I*=O,R*=O)),I=hn(I),R=hn(R),L=hn(L),A=hn(A)):(I=p,A=m,R=L=0),(T&&!~(a+"").indexOf("px")||k&&!~(u+"").indexOf("px"))&&(T=ba(y,"x",a,"px"),k=ba(y,"y",u,"px")),(w||_||x||b)&&(T=hn(T+w-(w*I+_*L)+x),k=hn(k+_-(w*R+_*A)+b)),(s||i)&&(O=y.getBBox(),T=hn(T+s/100*O.width),k=hn(k+i/100*O.height)),O="matrix("+I+","+R+","+L+","+A+","+T+","+k+")",y.setAttribute("transform",O),P&&(y.style[Qt]=O)},oY=function(e,n,r,s,i){var a=360,u=Nn(i),c=parseFloat(i)*(u&&~i.indexOf("rad")?ll:1),d=c-s,h=s+d+"deg",p,m;return u&&(p=i.split("_")[1],p==="short"&&(d%=a,d!==d%(a/2)&&(d+=d<0?a:-a)),p==="cw"&&d<0?d=(d+a*R6)%a-~~(d/a)*a:p==="ccw"&&d>0&&(d=(d-a*R6)%a-~~(d/a)*a)),e._pt=m=new jr(e._pt,n,r,s,d,zZ),m.e=h,m.u="deg",e._props.push(r),m},j6=function(e,n){for(var r in n)e[r]=n[r];return e},aY=function(e,n,r){var s=j6({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=r.style,u,c,d,h,p,m,y,w;s.svg?(d=r.getAttribute("transform"),r.setAttribute("transform",""),a[Qt]=n,u=Sf(r,1),xa(r,Qt),r.setAttribute("transform",d)):(d=getComputedStyle(r)[Qt],a[Qt]=n,u=Sf(r,1),a[Qt]=d);for(c in yo)d=s[c],h=u[c],d!==h&&i.indexOf(c)<0&&(y=nr(d),w=nr(h),p=y!==w?ba(r,c,d,w):parseFloat(d),m=parseFloat(h),e._pt=new jr(e._pt,u,c,p,m-p,p2),e._pt.u=w||0,e._props.push(c));j6(u,s)};Fr("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});a0[e>1?"border"+t:t]=function(u,c,d,h,p){var m,y;if(arguments.length<4)return m=a.map(function(w){return eo(u,w,d)}),y=m.join(" "),y.split(m[0]).length===5?m[0]:y;m=(h+"").split(" "),y={},a.forEach(function(w,_){return y[w]=m[_]=m[_]||m[(_-1)/2|0]}),u.init(c,y,p)}});var FR={name:"css",register:g2,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,d,h,p,m,y,w,_,x,b,P,T,k,I,R,L,A,O;Sx||g2(),this.styles=this.styles||AR(e),A=this.styles.props,this.tween=r;for(_ in n)if(_!=="autoRound"&&(h=n[_],!(Xr[_]&&_R(_,n,r,s,e,i)))){if(y=typeof h,w=a0[_],y==="function"&&(h=h.call(r,s,e,i),y=typeof h),y==="string"&&~h.indexOf("random(")&&(h=_f(h)),w)w(this,e,_,h,r)&&(L=1);else if(_.substr(0,2)==="--")d=(getComputedStyle(e).getPropertyValue(_)+"").trim(),h+="",fa.lastIndex=0,fa.test(d)||(x=nr(d),b=nr(h),b?x!==b&&(d=ba(e,_,d,b)+b):x&&(h+=x)),this.add(u,"setProperty",d,h,s,i,0,0,_),a.push(_),A.push(_,0,u[_]);else if(y!=="undefined"){if(c&&_ in c?(d=typeof c[_]=="function"?c[_].call(r,s,e,i):c[_],Nn(d)&&~d.indexOf("random(")&&(d=_f(d)),nr(d+"")||d==="auto"||(d+=is.units[_]||nr(eo(e,_))||""),(d+"").charAt(1)==="="&&(d=eo(e,_))):d=eo(e,_),m=parseFloat(d),P=y==="string"&&h.charAt(1)==="="&&h.substr(0,2),P&&(h=h.substr(2)),p=parseFloat(h),_ in xi&&(_==="autoAlpha"&&(m===1&&eo(e,"visibility")==="hidden"&&p&&(m=0),A.push("visibility",0,u.visibility),aa(this,u,"visibility",m?"inherit":"hidden",p?"inherit":"hidden",!p)),_!=="scale"&&_!=="transform"&&(_=xi[_],~_.indexOf(",")&&(_=_.split(",")[0]))),T=_ in yo,T){if(this.styles.save(_),O=h,y==="string"&&h.substring(0,6)==="var(--"){if(h=ns(e,h.substring(4,h.indexOf(")"))),h.substring(0,5)==="calc("){var D=e.style.perspective;e.style.perspective=h,h=ns(e,"perspective"),D?e.style.perspective=D:xa(e,"perspective")}p=parseFloat(h)}if(k||(I=e._gsap,I.renderTransform&&!n.parseTransform||Sf(e,n.parseTransform),R=n.smoothOrigin!==!1&&I.smooth,k=this._pt=new jr(this._pt,u,Qt,0,1,I.renderTransform,I,0,-1),k.dep=1),_==="scale")this._pt=new jr(this._pt,I,"scaleY",I.scaleY,(P?Bu(I.scaleY,P+p):p)-I.scaleY||0,p2),this._pt.u=0,a.push("scaleY",_),_+="X";else if(_==="transformOrigin"){A.push(Vr,0,u[Vr]),h=nY(h),I.svg?v2(e,h,0,R,0,this):(b=parseFloat(h.split(" ")[2])||0,b!==I.zOrigin&&aa(this,I,"zOrigin",I.zOrigin,b),aa(this,u,_,l0(d),l0(h)));continue}else if(_==="svgOrigin"){v2(e,h,1,R,0,this);continue}else if(_ in LR){oY(this,I,_,m,P?Bu(m,P+h):h);continue}else if(_==="smoothOrigin"){aa(this,I,"smooth",I.smooth,h);continue}else if(_==="force3D"){I[_]=h;continue}else if(_==="transform"){aY(this,h,e);continue}}else _ in u||(_=_c(_)||_);if(T||(p||p===0)&&(m||m===0)&&!HZ.test(h)&&_ in u)x=(d+"").substr((m+"").length),p||(p=0),b=nr(h)||(_ in is.units?is.units[_]:x),x!==b&&(m=ba(e,_,d,b)),this._pt=new jr(this._pt,T?I:u,_,m,(P?Bu(m,P+p):p)-m,!T&&(b==="px"||_==="zIndex")&&n.autoRound!==!1?WZ:p2),this._pt.u=b||0,T&&O!==h?(this._pt.b=d,this._pt.e=O,this._pt.r=UZ):x!==b&&b!=="%"&&(this._pt.b=d,this._pt.r=BZ);else if(_ in u)tY.call(this,e,_,d,P?P+h:h);else if(_ in e)this.add(e,_,d||e[_],P?P+h:h,s,i);else if(_!=="parseTransform"){hx(_,h);continue}T||(_ in u?A.push(_,0,u[_]):typeof e[_]=="function"?A.push(_,2,e[_]()):A.push(_,1,d||e[_])),a.push(_)}}L&&CR(this)},render:function(e,n){if(n.tween._time||!Ex())for(var r=n._pt;r;)r.r(e,r.d),r=r._next;else n.styles.revert()},get:eo,aliases:xi,getSetter:function(e,n,r){var s=xi[n];return s&&s.indexOf(",")<0&&(n=s),n in yo&&n!==Vr&&(e._gsap.x||eo(e,"x"))?r&&A6===r?n==="scale"?ZZ:qZ:(A6=r||{})&&(n==="scale"?YZ:XZ):e.style&&!cx(e.style[n])?GZ:~n.indexOf("-")?KZ:xx(e,n)},core:{_removeProperty:xa,_getMatrix:kx}};$r.utils.checkPrefix=_c;$r.core.getStyleSaver=AR;(function(t,e,n,r){var s=Fr(t+","+e+","+n,function(i){yo[i]=1});Fr(e,function(i){is.units[i]="deg",LR[i]=1}),xi[s[13]]=t+","+e,Fr(r,function(i){var a=i.split(":");xi[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");Fr("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){is.units[t]="px"});$r.registerPlugin(FR);var zs=$r.registerPlugin(FR)||$r;zs.core.Tween;const sm="/assets/logo-animation",Q1=1280,lY=[{id:"eraser",src:`${sm}/eraser.png`,cssW:189,cssH:74,rot:-90,fit:337,localX:60,localY:168,seaX:.2,seaY:.27,seaRot:-8},{id:"clasp",src:`${sm}/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:`${sm}/playdough.png`,cssW:236,cssH:206,rot:5,fit:150,localX:182,localY:277,seaX:.52,seaY:.79,seaRot:6}],uY=[{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}],y2=({className:t})=>{const e=v.useRef(null),n=v.useRef(null),r=v.useRef(null);return v.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=(b,P)=>b+Math.random()*(P-b);let d=null,h,p=1;const m=lY.map(b=>({...b})),y=()=>{s.querySelectorAll(".la-obj").forEach(A=>A.remove());const b=s.getBoundingClientRect(),P=b.width||Q1,T=b.height||Q1*.64;p=P/Q1,i.style.width=`${242*p}px`,i.style.height=`${250*p}px`;const I=250*p/337,R=[],L=(A,O,D)=>{const N=document.createElement("div");return N.className="la-obj",N.style.width=`${O}px`,N.innerHTML=`<img src="${A}" alt="" style="${D?"transform:scaleX(-1)":""}">`,s.appendChild(N),N};return uY.forEach((A,O)=>{const D=A.w*p,N=L(`${sm}/sea/${A.k}.png`,D,O%2===0);zs.set(N,{x:A.x*P-D/2,y:A.y*T-D/2,rotation:A.r,opacity:1,scale:0,transformOrigin:"50% 50%"}),R.push({el:N,hero:!1,rest:1})}),m.forEach(A=>{const O=A.cssW*p;A.el=L(A.src,O,!!A.flip),A.finalScale=A.fit*I/(A.cssW*p),zs.set(A.el,{x:A.seaX*P-O/2,y:A.seaY*T-A.cssH*p/2,rotation:A.seaRot,opacity:1,scale:0,transformOrigin:"50% 50%",zIndex:30}),R.push({el:A.el,hero:!0,rest:150/A.cssW})}),R},w=(b,P)=>{const T=s.getBoundingClientRect(),k=a.getBoundingClientRect();return{x:k.left-T.left+b/326*k.width,y:k.top-T.top+P/337*k.height}},_=()=>{d&&d.revert();const b=y();if(u){d=zs.context(()=>{b.filter(k=>!k.hero).forEach(k=>zs.set(k.el,{scale:0})),m.forEach(k=>{if(!k.el)return;const I=w(k.localX,k.localY);zs.set(k.el,{x:I.x-k.cssW*p/2,y:I.y-k.cssH*p/2,rotation:k.rot,scale:k.finalScale})})},s);return}const P=[],T=[];d=zs.context(()=>{const k=zs.timeline();k.to(b.map(I=>I.el),{scale:I=>b[I].rest,duration:.5,ease:"steps(4)",stagger:{each:.045,from:"random"}}),k.add(()=>{b.forEach(({el:I,hero:R},L)=>{const A=R?P:T,O=L%2?1:-1;A.push(zs.to(I,{rotation:"+="+c(2.5,6)*O,duration:c(.5,.9),repeat:-1,yoyo:!0,ease:"steps(2)",delay:c(0,.4)}),zs.to(I,{y:"+="+c(5,11)*O,x:"+="+c(4,9)*-O,duration:c(.7,1.2),repeat:-1,yoyo:!0,ease:"steps(3)",delay:c(0,.4)}))})},"<0.1"),k.to({},{duration:1.1}),k.add("pick"),m.forEach((I,R)=>{I.el&&k.to(I.el,{scale:150/I.cssW*1.2,duration:.28,ease:"steps(3)",yoyo:!0,repeat:1},"pick+="+R*.08)}),k.add("clear","pick+=0.7"),k.add(()=>T.forEach(I=>I.kill()),"clear"),k.to(b.filter(I=>!I.hero).map(I=>I.el),{scale:0,rotation:"+=40",duration:.5,ease:"steps(5)",overwrite:"auto",stagger:{each:.025,from:"random"}},"clear"),k.add("assemble","clear+=0.25"),k.add(()=>P.forEach(I=>I.kill()),"assemble"),m.forEach((I,R)=>{if(!I.el||I.finalScale===void 0)return;const L=w(I.localX,I.localY);k.to(I.el,{x:L.x-I.cssW*p/2,y:L.y-I.cssH*p/2,rotation:I.rot,scale:I.finalScale,duration:1.05,ease:"steps(9)",overwrite:"auto"},"assemble+="+R*.12)}),m.forEach(I=>{!I.el||I.finalScale===void 0||k.to(I.el,{scale:I.finalScale*1.03,duration:.16,ease:"steps(2)",yoyo:!0,repeat:1},"assemble+=1.45")})},s)};zs.ticker.fps(12),_();const x=()=>{clearTimeout(h),h=setTimeout(_,250)};return window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x),clearTimeout(h),d==null||d.revert(),s.querySelectorAll(".la-obj").forEach(b=>b.remove())}},[]),E.jsx("div",{ref:e,className:`la-scene ${t??""}`,children:E.jsx("div",{ref:n,className:"la-logo-stage",children:E.jsx("svg",{ref:r,className:"la-mark",viewBox:"0 0 326 337","aria-hidden":"true"})})})},cY=Object.freeze(Object.defineProperty({__proto__:null,default:y2},Symbol.toStringTag,{value:"Module"})),V6=({isSigningIn:t})=>t?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),E.jsx("span",{children:"Signing in..."})]}):E.jsxs(E.Fragment,{children:[E.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"Google",className:"h-5 w-5"}),E.jsx("span",{children:"Sign in with Google"})]}),dY=({isSigningIn:t,onStartSignIn:e,errorMessage:n=null,isDesktopShell:r=!1,displayMode:s="full"})=>s==="modal"?E.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:[E.jsx(y2,{className:"relative z-0 h-44 w-full"}),E.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6 px-8 pb-12 pt-8",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[E.jsx("h1",{className:"text-xl font-medium text-content",children:"Welcome to Rivet"}),E.jsx("p",{className:"text-sm leading-relaxed text-content-muted",children:"Rivet understands your references, and then explores dozens of design directions with you."})]}),E.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:E.jsx(V6,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-200",children:n}):null]})]}):E.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-white font-main text-[#18181b]",children:[r?E.jsx("div",{className:"fixed left-0 right-0 top-0 z-10 h-8",style:{WebkitAppRegion:"drag"}}):null,E.jsx(y2,{className:"absolute inset-0 z-0"}),E.jsxs("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col items-center gap-5 pb-[14vh]",children:[E.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 text-center",children:[E.jsx("h1",{className:"text-xl font-medium tracking-tight text-[#18181b]",children:"Welcome to Rivet"}),E.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."})]}),E.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:E.jsx(V6,{isSigningIn:t})}),n?E.jsx("p",{className:"text-center text-xs text-red-500",children:n}):null]})]}),fY="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",hY=({message:t})=>E.jsx("div",{className:"relative flex min-h-screen flex-col items-center justify-center overflow-hidden bg-[#1c1c20] font-main text-white",children:E.jsxs("div",{className:"flex flex-col items-center gap-10",children:[E.jsx("img",{src:fY,alt:"Rivet",className:"h-8 w-auto object-contain"}),E.jsxs("div",{className:"glass-panel flex items-center gap-3 rounded-xl px-8 py-3.5 text-sm font-medium",children:[E.jsx(k0,{className:"h-5 w-5 shrink-0 animate-spin text-primary",weight:"bold"}),E.jsx("span",{children:t})]})]})}),pY="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",u0=44,wd=8,Op=16,mY=4,$6=-18,gY=.18,vY=[.22,1,.36,1],H6=.92,yY=1,_Y=.95,wY=.4,xY=[.19,1,.22,1],J1=0,bY=1,SY=0,EY=0,CY=0,jR=({position:t,viewport:e,boundsLeft:n=0})=>{const r=n+wd,s=Math.max(r,e.width-u0-wd),i=Math.max(wd,e.height-u0-wd);return{x:Math.min(s,Math.max(r,t.x)),y:Math.min(i,Math.max(wd,t.y))}},Px=()=>({width:window.innerWidth,height:window.innerHeight}),kY=({position:t,boundsLeftPx:e=0})=>jR({position:t,viewport:Px(),boundsLeft:e}),PY=()=>{if(typeof window>"u")return{x:Op,y:Op};const t=Px();return{x:t.width-u0-Op,y:t.height-u0-Op}},TY=({deltaX:t,deltaY:e})=>Math.hypot(t,e)>=mY,IY=t=>t.button===void 0||t.button<=CY,z6=t=>{const e=t.nativeEvent;return{x:Number.isFinite(t.clientX)?t.clientX:e.clientX,y:Number.isFinite(t.clientY)?t.clientY:e.clientY}},AY=({isVisible:t,isPanelOpen:e,isReducedMotion:n,position:r,dragBoundsLeftPx:s=0,onToggle:i,onPositionChange:a})=>{const u=v.useRef(null),c=v.useRef(!1),[d,h]=v.useState(!1),[p,m]=v.useState(!1),y=n?!1:{opacity:J1,scale:H6,x:$6},w=n?{opacity:J1}:{opacity:J1,scale:H6,x:$6},_=n?{duration:EY}:{duration:gY,ease:vY,scale:{duration:wY,ease:xY}},x=v.useCallback(()=>{const I=u.current;I&&(c.current=I.hasMoved),u.current=null,h(!1)},[]),b=v.useCallback(I=>{const R=u.current;if(!R)return;const L=z6(I),A=L.x-R.startPointer.x,O=L.y-R.startPointer.y,D=R.hasMoved||TY({deltaX:A,deltaY:O});u.current={...R,hasMoved:D},D&&a(jR({position:{x:R.startPosition.x+A,y:R.startPosition.y+O},viewport:Px(),boundsLeft:s}))},[a,s]),P=v.useCallback(I=>{if(u.current||!IY(I))return;const R=z6(I);u.current={startPointer:R,startPosition:r,hasMoved:!1},h(!0)},[r]),T=v.useCallback(()=>{if(c.current){c.current=!1;return}i()},[i]),k=e?"Close panel":"Open panel";return E.jsxs(E.Fragment,{children:[d?E.jsx("div",{className:"fixed inset-0 z-40 cursor-grabbing","data-cy":"rivet-panel-launcher-drag-surface",onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x}):null,E.jsx(uo,{children:t?E.jsx(ao,{label:k,side:"top",forceOpen:p&&!d?void 0:!1,children:E.jsx(Il.button,{type:"button","aria-label":k,"data-cy":"reopen-panel",onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),initial:y,animate:{opacity:bY,scale:yY,x:SY},whileTap:{scale:_Y},exit:w,transition:_,onPointerDown:P,onMouseDown:P,onPointerMove:b,onPointerUp:x,onPointerCancel:x,onMouseMove:b,onMouseUp:x,onClick:T,className:`bg-main absolute z-50 flex h-11 w-11 touch-none select-none items-center justify-center overflow-hidden rounded-full border border-white/10 shadow-[0_2px_8px_rgba(0,0,0,0.2),0_4px_16px_rgba(0,0,0,0.1)] transition-[background-color,box-shadow] duration-150 hover:bg-[#2a2a2a] focus:outline-none focus-visible:ring-2 focus-visible:ring-white/75 ${d?"cursor-grabbing shadow-[0_4px_12px_rgba(0,0,0,0.28),0_10px_24px_rgba(0,0,0,0.16)]":"cursor-grab"}`,style:{left:r.x,top:r.y,willChange:"left, top, transform"},children:E.jsx("img",{src:pY,alt:"","aria-hidden":"true",draggable:!1,className:"h-4 w-4"})})}):null})]})},ey=Is("useConfig"),RY=300*1e3,MY=1800*1e3,OY=60*1e3,LY=300*1e3,DY=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.queueAccessToken)??null},NY=()=>{var t;return typeof window>"u"?null:((t=window.__RIVET_BOOTSTRAP__)==null?void 0:t.agentApplyMode)??null},FY=t=>({...M5,...t??{}}),jY=()=>{const t=et(Y_),e=lt(Y_),n=lt(z5),r=lt(B5),s=lt(P0),i=lt(BU),a=lt(H5),u=lt(HU),c=lt(Ff),d=lt(N5),h=v.useCallback(b=>{a(b.agentModeAvailable),d({name:b.name??null,email:b.email??null}),b.isMCPSession&&n(!0),b.mcpEditor&&r(b.mcpEditor),s(b.agentApplyMode??NY()??null),i(b.queueAccessToken??DY())},[s,a,n,r,i,d]),p=xy({queryKey:["rivet-config"],queryFn:async()=>{const b=await fetch("/api/config");if(!b.ok)throw new Error(`Failed to fetch config: ${b.statusText}`);return await b.json()},staleTime:RY,gcTime:MY}),m=xy({queryKey:["rivet-feature-flags"],queryFn:async()=>{const b=await fetch("/api/feature-flags");if(!b.ok)throw new Error(`Failed to fetch feature flags: ${b.statusText}`);return await b.json()},staleTime:OY,gcTime:LY}),{refetch:y}=p,{refetch:w}=m;v.useLayoutEffect(()=>{p.data&&(h(p.data),c(!1),ey.info("Config loaded:",p.data)),m.data&&(e(FY(m.data.featureFlags)),u(!0))},[p.data,m.data,h,c,e,u]),v.useLayoutEffect(()=>{p.error&&(u(!0),c(!1),ey.warn("Failed to load config:",p.error instanceof Error?p.error.message:"Failed to load config")),m.error&&(u(!0),ey.warn("Failed to load feature flags:",m.error instanceof Error?m.error.message:"Failed to load feature flags"))},[p.error,m.error,c,u]);const _=v.useCallback(async()=>{const[b]=await Promise.all([y(),w()]);return b.data?b.data:null},[y,w]);let x=null;return p.error instanceof Error?x=p.error.message:p.error&&(x="Failed to load config"),{config:p.data??null,featureFlags:t,loading:p.isPending||!p.error&&m.isPending,error:x,refetchConfig:_}},im="rivet_just_signed_in",xu=Is("useOAuthCallback"),VY="https://rivet-proxy.onrender.com",$Y=()=>{const[t,e]=v.useState({isProcessing:!1,isComplete:!1,error:null});return v.useEffect(()=>{const n=new AbortController;let r=!1;return(async()=>{var u,c,d;const i=window.location.hash,a=window.location.search;if(!(!i||!i.includes("access_token"))&&!r){e({isProcessing:!0,isComplete:!1,error:null});try{xu.info("Processing OAuth callback...");const h=new URLSearchParams(i.substring(1)),p=h.get("access_token"),m=h.get("refresh_token"),w=new URLSearchParams(a).get("session");if(!p)throw new Error("No access token found in URL");if(!w)throw new Error("No session ID found in URL");xu.info(`Completing OAuth with session: ${w}`);const _=await fetch(`${VY}/api/auth/google/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:w,accessToken:p,refreshToken:m}),signal:n.signal}),x=await _.json();if(!_.ok||!x.success)throw new Error(x.error||x.message||"Failed to complete authentication");if(xu.info("OAuth authentication completed successfully"),r)return;if((u=x.user)!=null&&u.id?(Se.identify(x.user.id,{...x.user.email?{email:x.user.email}:{}}),x.user.email&&Se.alias(x.user.email,x.user.id)):(c=x.user)!=null&&c.email&&Se.identify(x.user.email,{email:x.user.email}),(d=x.user)!=null&&d.email&&p)try{const P=await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:x.user.email,token:p,refreshToken:m,userId:x.user.id}),signal:n.signal});P.ok||xu.warn(`Local auth store returned ${P.status}`)}catch(P){if(r)return;xu.warn("Failed to store auth locally:",P)}if(r)return;window.sessionStorage.setItem(im,"1");const b=window.location.pathname;window.history.replaceState({},document.title,b),e({isProcessing:!1,isComplete:!0,error:null})}catch(h){if(r)return;const p=h instanceof Error?h.message:"Unknown error occurred";xu.warn("OAuth callback error:",h),e({isProcessing:!1,isComplete:!1,error:p})}}})(),()=>{r=!0,n.abort()}},[]),t},ty=Is("useAgentVariantsSession"),HY=t=>typeof t.pendingCount=="number"&&t.pendingCount===0&&(t.pendingVariantRequests??0)===0&&(t.leasedVariantRequests??0)===0&&(t.activeLeases??[]).length===0,B6=(t,e,n)=>{e.size===0&&!n||t.set(uf,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})},zY=(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(d=>d.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},BY=({enabled:t=!0}={})=>{const e=lt(Nf),n=lt(O5),r=lt(NU),s=lt(V5),i=lt($U),a=Y2(),u=v.useRef(null);v.useEffect(()=>{if(!t)return;const c=new EventSource("/api/variants/events");return c.onmessage=d=>{try{const h=JSON.parse(d.data),p=u.current;if(h.active){const w=new Set(h.variants.map(_=>_.requestId).filter(_=>!!_));s(_=>_.filter(b=>!w.has(b.requestId))),B6(a,w,!1),a.set(uf,_=>{let x=_;for(const b of h.variants){const P=b.adoptedSource;P&&(x=VU(x,{kind:"variant",sessionId:P.sessionId,variantId:P.variantId},{kind:"variant",sessionId:h.sessionId,variantId:b.workItemId}))}return x}),a.set(uf,_=>zY(_,h)),h.sessionId!==u.current&&(u.current=h.sessionId,n(!0),r("directions"))}else u.current=null,B6(a,new Set,HY(h));e(h);const m=!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(w=>ty.warn("failed to reset preview-port on session switch",w)),m||y){const w=new Set;if(h.active)for(const x of h.variants)w.add(af({kind:"variant",sessionId:h.sessionId,variantId:x.workItemId}));const _=a.get(mo);for(const x of[_==null?void 0:_.left,_==null?void 0:_.right])x&&w.add(af({kind:"variant",sessionId:x.sessionId,variantId:x.variantId}));i(w)}}catch(h){ty.warn("failed to parse SSE event payload",h)}},c.onerror=d=>{ty.warn("SSE error (auto-reconnects)",d)},()=>{c.close()}},[t,e,n,r,s,i,a])};var UY=Object.defineProperty,On=(t,e)=>UY(t,"name",{value:e,configurable:!0});function Tx(t){const e=t+"CollectionProvider",[n,r]=Pi(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=On(_=>{const{scope:x,children:b}=_,P=v.useRef(null),T=v.useRef(new Map).current;return E.jsx(s,{scope:x,itemMap:T,collectionRef:P,children:b})},"CollectionProvider");a.displayName=e;const u=t+"CollectionSlot",c=va(u),d=v.forwardRef((_,x)=>{const{scope:b,children:P}=_,T=i(u,b),k=zt(x,T.collectionRef);return E.jsx(c,{ref:k,children:P})});d.displayName=u;const h=t+"CollectionItemSlot",p="data-radix-collection-item",m=va(h),y=v.forwardRef((_,x)=>{const{scope:b,children:P,...T}=_,k=v.useRef(null),I=zt(x,k),R=i(h,b);return v.useEffect(()=>(R.itemMap.set(k,{ref:k,...T}),()=>void R.itemMap.delete(k))),E.jsx(m,{[p]:"",ref:I,children:P})});y.displayName=h;function w(_){const x=i(t+"CollectionConsumer",_);return v.useCallback(()=>{const P=x.collectionRef.current;if(!P)return[];const T=Array.from(P.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((R,L)=>T.indexOf(R.ref.current)-T.indexOf(L.ref.current))},[x.collectionRef,x.itemMap])}return On(w,"useCollection"),[{Provider:a,Slot:d,ItemSlot:y},w,r]}On(Tx,"createCollection");var U6=new WeakMap,_n,qr,ny=(qr=class extends Map{constructor(n){super(n);He(this,_n);ke(this,_n,[...super.keys()]),U6.set(this,!0)}set(n,r){return U6.get(this)&&(this.has(n)?z(this,_n)[z(this,_n).indexOf(n)]=n:z(this,_n).push(n)),super.set(n,r),this}insert(n,r,s){const i=this.has(r),a=z(this,_n).length,u=Ix(n);let c=u>=0?u:a+u;const d=c<0||c>=a?-1:c;if(d===this.size||i&&d===this.size-1||d===-1)return this.set(r,s),this;const h=this.size+(i?0:1);u<0&&c++;const p=[...z(this,_n)];let m,y=!1;for(let w=c;w<h;w++)if(c===w){let _=p[w];p[w]===r&&(_=p[w+1]),i&&this.delete(r),m=this.get(_),this.set(r,s)}else{!y&&p[w-1]===r&&(y=!0);const _=p[y?w:w-1],x=m;m=this.get(_),this.delete(_),this.set(_,x)}return this}with(n,r,s){const i=new qr(this);return i.insert(n,r,s),i}before(n){const r=z(this,_n).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,s){const i=z(this,_n).indexOf(n);return i===-1?this:this.insert(i,r,s)}after(n){let r=z(this,_n).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,s){const i=z(this,_n).indexOf(n);return i===-1?this:this.insert(i+1,r,s)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return ke(this,_n,[]),super.clear()}delete(n){const r=super.delete(n);return r&&z(this,_n).splice(z(this,_n).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=om(z(this,_n),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=om(z(this,_n),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return z(this,_n).indexOf(n)}keyAt(n){return om(z(this,_n),n)}from(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(n,r){const s=this.indexOf(n);if(s===-1)return;let i=s+r;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return i;s++}}findIndex(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return s;s++}return-1}filter(n,r){const s=[];let i=0;for(const a of this)Reflect.apply(n,r,[a,i,this])&&s.push(a),i++;return new qr(s)}map(n,r){const s=[];let i=0;for(const a of this)s.push([a[0],Reflect.apply(n,r,[a,i,this])]),i++;return new qr(s)}reduce(...n){const[r,s]=n;let i=0,a=s??this.at(0);for(const u of this)i===0&&n.length===1?a=u:a=Reflect.apply(r,this,[a,u,i,this]),i++;return a}reduceRight(...n){const[r,s]=n;let i=s??this.at(-1);for(let a=this.size-1;a>=0;a--){const u=this.at(a);a===this.size-1&&n.length===1?i=u:i=Reflect.apply(r,this,[i,u,a,this])}return i}toSorted(n){const r=[...this.entries()].sort(n);return new qr(r)}toReversed(){const n=new qr;for(let r=this.size-1;r>=0;r--){const s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new qr(r)}slice(n,r){const s=new qr;let i=this.size-1;if(n===void 0)return s;n<0&&(n=n+this.size),r!==void 0&&r>0&&(i=r-1);for(let a=n;a<=i;a++){const u=this.keyAt(a),c=this.get(u);s.set(u,c)}return s}every(n,r){let s=0;for(const i of this){if(!Reflect.apply(n,r,[i,s,this]))return!1;s++}return!0}some(n,r){let s=0;for(const i of this){if(Reflect.apply(n,r,[i,s,this]))return!0;s++}return!1}},_n=new WeakMap,On(qr,"OrderedDict"),qr);function om(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=VR(t,e);return n===-1?void 0:t[n]}On(om,"at");function VR(t,e){const n=t.length,r=Ix(e),s=r>=0?r:n+r;return s<0||s>=n?-1:s}On(VR,"toSafeIndex");function Ix(t){return t!==t||t===0?0:Math.trunc(t)}On(Ix,"toSafeInteger");function WY(t){const e=t+"CollectionProvider",[n,r]=Pi(e),[s,i]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ny,setItemMap:On(()=>{},"setItemMap")}),a=On(({state:T,...k})=>T?E.jsx(c,{...k,state:T}):E.jsx(u,{...k}),"CollectionProvider");a.displayName=e;const u=On(T=>{const k=x();return E.jsx(c,{...T,state:k})},"CollectionInit");u.displayName=e+"Init";const c=On(T=>{const{scope:k,children:I,state:R}=T,L=v.useRef(null),[A,O]=v.useState(null),D=zt(L,O),[N,F]=R;return v.useEffect(()=>{if(!A)return;const K=zR(()=>{});return K.observe(A,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[A]),E.jsx(s,{scope:k,itemMap:N,setItemMap:F,collectionRef:D,collectionRefObject:L,collectionElement:A,children:I})},"CollectionProviderImpl");c.displayName=e+"Impl";const d=t+"CollectionSlot",h=va(d),p=v.forwardRef((T,k)=>{const{scope:I,children:R}=T,L=i(d,I),A=zt(k,L.collectionRef);return E.jsx(h,{ref:A,children:R})});p.displayName=d;const m=t+"CollectionItemSlot",y="data-radix-collection-item",w=va(m),_=v.forwardRef((T,k)=>{const{scope:I,children:R,...L}=T,A=v.useRef(null),[O,D]=v.useState(null),N=zt(k,A,D),F=i(m,I),{setItemMap:K}=F,Z=v.useRef(L);$R(Z.current,L)||(Z.current=L);const W=Z.current;return v.useEffect(()=>{const G=W;return K(Y=>O?Y.has(O)?Y.set(O,{...G,element:O}).toSorted(_2):(Y.set(O,{...G,element:O}),Y.toSorted(_2)):Y),()=>{K(Y=>!O||!Y.has(O)?Y:(Y.delete(O),new ny(Y)))}},[O,W,K]),E.jsx(w,{[y]:"",ref:N,children:R})});_.displayName=m;function x(){return v.useState(new ny)}On(x,"useInitCollection");function b(T){const{itemMap:k}=i(t+"CollectionConsumer",T);return k}return On(b,"useCollection"),[{Provider:a,Slot:p,ItemSlot:_},{createCollectionScope:r,useCollection:b,useInitCollection:x}]}On(WY,"createCollection");function $R(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(e,s)||t[s]!==e[s])return!1;return!0}On($R,"shallowEqual");function HR(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}On(HR,"isElementPreceding");function _2(t,e){return!t[1].element||!e[1].element?0:HR(t[1].element,e[1].element)?-1:1}On(_2,"sortByDocumentPosition");function zR(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}On(zR,"getChildListObserver");var GY=Object.defineProperty,$f=(t,e)=>GY(t,"name",{value:e,configurable:!0}),Ax="Collapsible",[KY,BR]=Pi(Ax),[qY,Rx]=KY(Ax),ZY=v.forwardRef($f(function(e,n){const{__scopeCollapsible:r,open:s,defaultOpen:i,disabled:a,onOpenChange:u,...c}=e,[d,h]=Ea({prop:s,defaultProp:i??!1,onChange:u,caller:Ax});return E.jsx(qY,{scope:r,disabled:a,contentId:ua(),open:d,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),children:E.jsx(pn.div,{"data-state":$0(d),"data-disabled":a?"":void 0,...c,ref:n})})},"Collapsible")),YY="CollapsibleTrigger",XY=v.forwardRef($f(function(e,n){const{__scopeCollapsible:r,...s}=e,i=Rx(YY,r);return E.jsx(pn.button,{type:"button","aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":$0(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:n,onClick:$t(e.onClick,i.onOpenToggle)})},"CollapsibleTrigger")),UR="CollapsibleContent",QY=v.forwardRef($f(function(e,n){const{forceMount:r,...s}=e,i=Rx(UR,e.__scopeCollapsible);return E.jsx(Ca,{present:r||i.open,children:({present:a})=>E.jsx(JY,{...s,ref:n,present:a})})},"CollapsibleContent")),JY=v.forwardRef($f(function(e,n){const{__scopeCollapsible:r,present:s,children:i,...a}=e,u=Rx(UR,r),[c,d]=v.useState(s),h=v.useRef(null),p=zt(n,h),m=v.useRef(0),y=m.current,w=v.useRef(0),_=w.current,x=u.open||c,b=v.useRef(x),P=v.useRef(void 0);return v.useEffect(()=>{const T=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(T)},[]),Lr(()=>{const T=h.current;if(T){P.current=P.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const k=T.getBoundingClientRect();m.current=k.height,w.current=k.width,b.current||(T.style.transitionDuration=P.current.transitionDuration,T.style.animationName=P.current.animationName),d(s)}},[u.open,s]),E.jsx(pn.div,{"data-state":$0(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!x,...a,ref:p,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":_?`${_}px`:void 0,...e.style},children:x&&i})},"CollapsibleContentImpl"));function $0(t){return t?"open":"closed"}$f($0,"getState");var eX=ZY,tX=XY,nX=QY,rX=Object.defineProperty,sX=(t,e)=>rX(t,"name",{value:e,configurable:!0}),iX=v.createContext(void 0);function Mx(t){const e=v.useContext(iX);return t||e||"ltr"}sX(Mx,"useDirection");var oX=Object.defineProperty,os=(t,e)=>oX(t,"name",{value:e,configurable:!0}),Ti="Accordion",aX=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Ox,lX,uX]=Tx(Ti),[H0,See]=Pi(Ti,[uX,BR]),Lx=BR(),cX=v.forwardRef(os(function(e,n){const{type:r,...s}=e,i=s,a=s;return E.jsx(Ox.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?E.jsx(pX,{...a,ref:n}):E.jsx(hX,{...i,ref:n})})},"Accordion")),[WR,dX]=H0(Ti),[GR,fX]=H0(Ti,{collapsible:!1}),hX=v.forwardRef(os(function(e,n){const{value:r,defaultValue:s,onValueChange:i=os(()=>{},"onValueChange"),collapsible:a=!1,...u}=e,[c,d]=Ea({prop:r,defaultProp:s??"",onChange:i,caller:Ti});return E.jsx(WR,{scope:e.__scopeAccordion,value:v.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:v.useCallback(()=>a&&d(""),[a,d]),children:E.jsx(GR,{scope:e.__scopeAccordion,collapsible:a,children:E.jsx(KR,{...u,ref:n})})})},"AccordionImplSingle")),pX=v.forwardRef(os(function(e,n){const{value:r,defaultValue:s,onValueChange:i=os(()=>{},"onValueChange"),...a}=e,[u,c]=Ea({prop:r,defaultProp:s??[],onChange:i,caller:Ti}),d=v.useCallback(p=>c((m=[])=>[...m,p]),[c]),h=v.useCallback(p=>c((m=[])=>m.filter(y=>y!==p)),[c]);return E.jsx(WR,{scope:e.__scopeAccordion,value:u,onItemOpen:d,onItemClose:h,children:E.jsx(GR,{scope:e.__scopeAccordion,collapsible:!0,children:E.jsx(KR,{...a,ref:n})})})},"AccordionImplMultiple")),[mX,z0]=H0(Ti),KR=v.forwardRef(os(function(e,n){const{__scopeAccordion:r,disabled:s,dir:i,orientation:a="vertical",...u}=e,c=v.useRef(null),d=zt(c,n),h=lX(r),m=Mx(i)==="ltr",y=$t(e.onKeyDown,w=>{var O;if(!aX.includes(w.key))return;const _=w.target,x=h().filter(D=>{var N;return!((N=D.ref.current)!=null&&N.disabled)}),b=x.findIndex(D=>D.ref.current===_),P=x.length;if(b===-1)return;w.preventDefault();let T=b;const k=0,I=P-1,R=os(()=>{T=b+1,T>I&&(T=k)},"moveNext"),L=os(()=>{T=b-1,T<k&&(T=I)},"movePrev");switch(w.key){case"Home":T=k;break;case"End":T=I;break;case"ArrowRight":a==="horizontal"&&(m?R():L());break;case"ArrowDown":a==="vertical"&&R();break;case"ArrowLeft":a==="horizontal"&&(m?L():R());break;case"ArrowUp":a==="vertical"&&L();break}const A=T%P;(O=x[A].ref.current)==null||O.focus()});return E.jsx(mX,{scope:r,disabled:s,direction:i,orientation:a,children:E.jsx(Ox.Slot,{scope:r,children:E.jsx(pn.div,{...u,"data-orientation":a,ref:d,onKeyDown:s?void 0:y})})})},"AccordionImpl")),w2="AccordionItem",[gX,Dx]=H0(w2),vX=v.forwardRef(os(function(e,n){const{__scopeAccordion:r,value:s,...i}=e,a=z0(w2,r),u=dX(w2,r),c=Lx(r),d=ua(),h=s&&u.value.includes(s)||!1,p=a.disabled||e.disabled;return E.jsx(gX,{scope:r,open:h,disabled:p,triggerId:d,children:E.jsx(eX,{"data-orientation":a.orientation,"data-state":Nx(h),...c,...i,ref:n,disabled:p,open:h,onOpenChange:m=>{m?u.onItemOpen(s):u.onItemClose(s)}})})},"AccordionItem")),yX="AccordionHeader",_X=v.forwardRef(os(function(e,n){const{__scopeAccordion:r,...s}=e,i=z0(Ti,r),a=Dx(yX,r);return E.jsx(pn.h3,{"data-orientation":i.orientation,"data-state":Nx(a.open),"data-disabled":a.disabled?"":void 0,...s,ref:n})},"AccordionHeader")),W6="AccordionTrigger",wX=v.forwardRef(os(function(e,n){const{__scopeAccordion:r,...s}=e,i=z0(Ti,r),a=Dx(W6,r),u=fX(W6,r),c=Lx(r);return E.jsx(Ox.ItemSlot,{scope:r,children:E.jsx(tX,{"aria-disabled":a.open&&!u.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...c,...s,ref:n})})},"AccordionTrigger")),xX="AccordionContent",bX=v.forwardRef(os(function(e,n){const{__scopeAccordion:r,...s}=e,i=z0(Ti,r),a=Dx(xX,r),u=Lx(r);return E.jsx(nX,{role:"region","aria-labelledby":a.triggerId,"data-orientation":i.orientation,...u,...s,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})},"AccordionContent"));function Nx(t){return t?"open":"closed"}os(Nx,"getState");var qR=cX,SX=vX,EX=_X,CX=wX,kX=bX;/**
130
+ * @license lucide-react v1.33.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const ZR=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
135
+ * @license lucide-react v1.33.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const PX=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
140
+ * @license lucide-react v1.33.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const TX=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
145
+ * @license lucide-react v1.33.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const G6=t=>{const e=TX(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
150
+ * @license lucide-react v1.33.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */var ry={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"};/**
155
+ * @license lucide-react v1.33.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const IX=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},AX=v.createContext({}),RX=()=>v.useContext(AX),MX=v.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...u},c)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:y=""}=RX()??{},w=r??p?Number(n??h)*24/Number(e??d):n??h;return v.createElement("svg",{ref:c,...ry,width:e??d??ry.width,height:e??d??ry.height,stroke:t??m,strokeWidth:w,className:ZR("lucide",y,s),...!i&&!IX(u)&&{"aria-hidden":"true"},...u},[...a.map(([_,x])=>v.createElement(_,x)),...Array.isArray(i)?i:[i]])});/**
160
+ * @license lucide-react v1.33.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const Je=(t,e)=>{const n=v.forwardRef(({className:r,...s},i)=>v.createElement(MX,{ref:i,iconNode:e,className:ZR(`lucide-${PX(G6(t))}`,`lucide-${t}`,r),...s}));return n.displayName=G6(t),n};/**
165
+ * @license lucide-react v1.33.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const OX=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],LX=Je("arrow-left",OX);/**
170
+ * @license lucide-react v1.33.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const DX=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],NX=Je("arrow-right",DX);/**
175
+ * @license lucide-react v1.33.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const FX=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],jX=Je("arrow-up",FX);/**
180
+ * @license lucide-react v1.33.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const VX=[["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"}]],$X=Je("bell",VX);/**
185
+ * @license lucide-react v1.33.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const HX=[["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"}]],zX=Je("brain",HX);/**
190
+ * @license lucide-react v1.33.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const BX=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],UX=Je("check",BX);/**
195
+ * @license lucide-react v1.33.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const WX=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],GX=Je("chevron-down",WX);/**
200
+ * @license lucide-react v1.33.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const KX=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qX=Je("chevron-right",KX);/**
205
+ * @license lucide-react v1.33.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const ZX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],YX=Je("circle",ZX);/**
210
+ * @license lucide-react v1.33.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const XX=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],QX=Je("clock",XX);/**
215
+ * @license lucide-react v1.33.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const JX=[["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"}]],eQ=Je("copy",JX);/**
220
+ * @license lucide-react v1.33.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const tQ=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],nQ=Je("dot",tQ);/**
225
+ * @license lucide-react v1.33.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const rQ=[["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"}]],sQ=Je("globe",rQ);/**
230
+ * @license lucide-react v1.33.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const iQ=[["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"}]],oQ=Je("heart",iQ);/**
235
+ * @license lucide-react v1.33.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */const aQ=[["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"}]],lQ=Je("house",aQ);/**
240
+ * @license lucide-react v1.33.0 - ISC
241
+ *
242
+ * This source code is licensed under the ISC license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */const uQ=[["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"}]],cQ=Je("image",uQ);/**
245
+ * @license lucide-react v1.33.0 - ISC
246
+ *
247
+ * This source code is licensed under the ISC license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */const dQ=[["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"}]],fQ=Je("inbox",dQ);/**
250
+ * @license lucide-react v1.33.0 - ISC
251
+ *
252
+ * This source code is licensed under the ISC license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */const hQ=[["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"}]],pQ=Je("lightbulb",hQ);/**
255
+ * @license lucide-react v1.33.0 - ISC
256
+ *
257
+ * This source code is licensed under the ISC license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */const mQ=[["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"}]],gQ=Je("link",mQ);/**
260
+ * @license lucide-react v1.33.0 - ISC
261
+ *
262
+ * This source code is licensed under the ISC license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */const vQ=[["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"}]],yQ=Je("loader",vQ);/**
265
+ * @license lucide-react v1.33.0 - ISC
266
+ *
267
+ * This source code is licensed under the ISC license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */const _Q=[["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"}]],wQ=Je("lock",_Q);/**
270
+ * @license lucide-react v1.33.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */const xQ=[["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"}]],bQ=Je("mail",xQ);/**
275
+ * @license lucide-react v1.33.0 - ISC
276
+ *
277
+ * This source code is licensed under the ISC license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */const SQ=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],EQ=Je("menu",SQ);/**
280
+ * @license lucide-react v1.33.0 - ISC
281
+ *
282
+ * This source code is licensed under the ISC license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */const CQ=[["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"}]],kQ=Je("message-circle",CQ);/**
285
+ * @license lucide-react v1.33.0 - ISC
286
+ *
287
+ * This source code is licensed under the ISC license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */const PQ=[["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"}]],TQ=Je("monitor",PQ);/**
290
+ * @license lucide-react v1.33.0 - ISC
291
+ *
292
+ * This source code is licensed under the ISC license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */const IQ=[["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"}]],AQ=Je("moon",IQ);/**
295
+ * @license lucide-react v1.33.0 - ISC
296
+ *
297
+ * This source code is licensed under the ISC license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */const RQ=[["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"}]],MQ=Je("paintbrush",RQ);/**
300
+ * @license lucide-react v1.33.0 - ISC
301
+ *
302
+ * This source code is licensed under the ISC license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */const OQ=[["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"}]],LQ=Je("palette",OQ);/**
305
+ * @license lucide-react v1.33.0 - ISC
306
+ *
307
+ * This source code is licensed under the ISC license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */const DQ=[["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"}]],NQ=Je("pause",DQ);/**
310
+ * @license lucide-react v1.33.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */const FQ=[["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"}]],jQ=Je("pencil",FQ);/**
315
+ * @license lucide-react v1.33.0 - ISC
316
+ *
317
+ * This source code is licensed under the ISC license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */const VQ=[["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"}]],$Q=Je("pipette",VQ);/**
320
+ * @license lucide-react v1.33.0 - ISC
321
+ *
322
+ * This source code is licensed under the ISC license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */const HQ=[["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"}]],zQ=Je("play",HQ);/**
325
+ * @license lucide-react v1.33.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */const BQ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],UQ=Je("plus",BQ);/**
330
+ * @license lucide-react v1.33.0 - ISC
331
+ *
332
+ * This source code is licensed under the ISC license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */const WQ=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]],GQ=Je("rectangle-horizontal",WQ);/**
335
+ * @license lucide-react v1.33.0 - ISC
336
+ *
337
+ * This source code is licensed under the ISC license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */const KQ=[["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"}]],qQ=Je("rocket",KQ);/**
340
+ * @license lucide-react v1.33.0 - ISC
341
+ *
342
+ * This source code is licensed under the ISC license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */const ZQ=[["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"}]],YQ=Je("rotate-ccw",ZQ);/**
345
+ * @license lucide-react v1.33.0 - ISC
346
+ *
347
+ * This source code is licensed under the ISC license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */const XQ=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],QQ=Je("search",XQ);/**
350
+ * @license lucide-react v1.33.0 - ISC
351
+ *
352
+ * This source code is licensed under the ISC license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */const JQ=[["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"}]],eJ=Je("settings",JQ);/**
355
+ * @license lucide-react v1.33.0 - ISC
356
+ *
357
+ * This source code is licensed under the ISC license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */const tJ=[["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"}]],nJ=Je("shield",tJ);/**
360
+ * @license lucide-react v1.33.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */const rJ=[["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"}]],sJ=Je("skip-forward",rJ);/**
365
+ * @license lucide-react v1.33.0 - ISC
366
+ *
367
+ * This source code is licensed under the ISC license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */const iJ=[["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"}]],oJ=Je("square-library",iJ);/**
370
+ * @license lucide-react v1.33.0 - ISC
371
+ *
372
+ * This source code is licensed under the ISC license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */const aJ=[["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"}]],lJ=Je("star",aJ);/**
375
+ * @license lucide-react v1.33.0 - ISC
376
+ *
377
+ * This source code is licensed under the ISC license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */const uJ=[["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"}]],cJ=Je("sun",uJ);/**
380
+ * @license lucide-react v1.33.0 - ISC
381
+ *
382
+ * This source code is licensed under the ISC license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */const dJ=[["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"}]],fJ=Je("user",dJ);/**
385
+ * @license lucide-react v1.33.0 - ISC
386
+ *
387
+ * This source code is licensed under the ISC license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */const hJ=[["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"}]],pJ=Je("users",hJ);/**
390
+ * @license lucide-react v1.33.0 - ISC
391
+ *
392
+ * This source code is licensed under the ISC license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */const mJ=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gJ=Je("x",mJ),vJ={"chevron-right":qX,"chevron-down":GX,pipette:$Q,x:gJ,copy:eQ,menu:EQ,dot:nQ,monitor:TQ,sun:cJ,moon:AQ,"rectangle-horizontal":GQ,circle:YX,"square-library":oJ,clock:QX,star:lJ,settings:eJ,plus:UQ,"arrow-left":LX,"arrow-right":NX,"arrow-up":jX,search:QQ,loader:yQ,users:pJ,lock:wQ,mail:bQ,bell:$X,shield:nJ,palette:LQ,lightbulb:pQ,rocket:qQ,heart:oQ,paintbrush:MQ,brain:zX,globe:sQ,user:fJ,image:cQ,link:gQ,check:UX,"rotate-ccw":YQ,play:zQ,pause:NQ,home:lQ,"message-circle":kQ,inbox:fQ,pencil:jQ,"skip-forward":sJ},K6={lucide:vJ},YR=v.createContext(null);function yJ(t){const e=v.useContext(YR);return e?K6[e.iconLibrary][t]:K6.lucide[t]}function _J({children:t,defaultLibrary:e="lucide"}){const[n,r]=v.useState(e),s=v.useCallback(i=>{r(i)},[]);return E.jsx(YR.Provider,{value:{iconLibrary:n,setIconLibrary:s},children:t})}const XR=v.createContext(null);function Fx(){return v.useContext(XR)}const QR=v.createContext(null);function JR(){const t=v.useContext(QR);if(!t)throw new Error("AccordionTrigger/AccordionContent must be used within an AccordionItem");return t}const wJ=v.forwardRef((t,e)=>{const{children:n,type:r="single",className:s,...i}=t,a=v.useRef(null),u=v.useRef(new Map),[c,d]=v.useState(new Map),{activeIndex:h,setActiveIndex:p,itemRects:m,sessionRef:y,handlers:w,registerItem:_,measureItems:x}=P5(a),b=v.useCallback((ue,ie)=>{ie?u.current.set(ue,ie):u.current.delete(ue)},[]),P=v.useCallback(()=>{if(!a.current)return;const ue=new Map;u.current.forEach((ie,Ne)=>{ue.set(Ne,{top:ie.offsetTop,left:ie.offsetLeft,width:ie.offsetWidth,height:ie.offsetHeight})}),d(ue)},[]),[T,k]=v.useState(()=>r==="single"?t.defaultValue??"":""),[I,R]=v.useState(()=>r==="multiple"?t.defaultValue??[]:[]),L=t.onValueChange,A=t.onValueChange,O=t.value,D=new Set(r==="multiple"?t.value??I:(()=>{const ue=t.value??T;return ue?[ue]:[]})()),N=v.useCallback(ue=>{const ie=t;ie.onValueChange?ie.onValueChange(ue):k(ue)},[L]),F=v.useCallback(ue=>{const ie=t;ie.onValueChange?ie.onValueChange(ue):R(ue)},[A]),K=v.useCallback(ue=>{if(r==="multiple"){const ie=t.value??I;F(ie.filter(Ne=>Ne!==ue))}else N("")},[r,N,F,I,O]);v.useEffect(()=>{x(),P()},[x,P,n]);const Z=[...D].join(",");v.useEffect(()=>{x(),P()},[x,P,Z]);const[W,G]=v.useState(null),Y=h!==null?m[h]:null,$=W!==null?m[W]:null,J=h!==null&&!c.has(h),H=D0(),{value:j,defaultValue:X,onValueChange:oe,collapsible:se,type:ee,...ce}=i,we=r==="multiple"?{type:"multiple",value:t.value??I,onValueChange:F}:{type:"single",collapsible:t.collapsible??!0,value:t.value??T,onValueChange:N};return E.jsx(XR.Provider,{value:{registerItem:_,registerFullItem:b,activeIndex:h,grouped:!0,remeasure:()=>{x(),P()},openValues:D,openItemRects:c,toggleValue:K},children:E.jsx(qR,{...we,asChild:!0,children:E.jsxs("div",{ref:ue=>{a.current=ue,typeof e=="function"?e(ue):e&&(e.current=ue)},onMouseEnter:w.onMouseEnter,onMouseMove:ue=>{const ie=a.current;if(ie){const Ne=ie.getBoundingClientRect(),Ue=ie.offsetHeight,Pe=Ne.height,Ve=Ue>0?Pe/Ue:1,ht=(ue.clientY-Ne.top)/Ve+ie.scrollTop;for(const[Jt,be]of c){const $e=m[Jt];if(!$e)continue;const Ge=$e.top+$e.height,tt=be.top+be.height;if(ht>=Ge&&ht<=tt){p(null);return}}}w.onMouseMove(ue)},onMouseLeave:w.onMouseLeave,onFocus:ue=>{var Ne;const ie=(Ne=ue.target.closest("[data-proximity-index]"))==null?void 0:Ne.getAttribute("data-proximity-index");if(ie!=null){const Ue=Number(ie);p(Ue),G(ue.target.matches(":focus-visible")?Ue:null)}},onBlur:ue=>{var ie;(ie=a.current)!=null&&ie.contains(ue.relatedTarget)||(G(null),p(null))},className:vr("relative flex flex-col gap-0.5 w-72 max-w-full",s),...ce,children:[E.jsx(uo,{children:[...c.entries()].map(([ue,ie])=>E.jsx(co.div,{className:`absolute ${H.bg} bg-accent/20 dark:bg-accent/12 pointer-events-none`,initial:!1,animate:{top:ie.top,left:ie.left,width:ie.width,height:ie.height,opacity:J?.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-${ue}`))}),E.jsx(uo,{children:Y&&E.jsx(co.div,{className:`absolute ${H.bg} bg-hover pointer-events-none`,initial:{opacity:0,top:Y.top,left:Y.left,width:Y.width,height:Y.height},animate:{opacity:1,top:Y.top,left:Y.left,width:Y.width,height:Y.height},exit:{opacity:0,transition:{duration:.06}},transition:{...of.fast,opacity:{duration:.08}}},y.current)}),E.jsx(uo,{children:$&&E.jsx(co.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:{...of.fast,opacity:{duration:.08}}})}),n]})})})});wJ.displayName="AccordionGroup";const eM=v.forwardRef(({children:t,type:e="single",collapsible:n=!0,defaultValue:r,value:s,onValueChange:i,className:a,...u},c)=>{const[d,h]=v.useState(()=>e==="single"?r??"":""),[p,m]=v.useState(()=>e==="multiple"?r??[]:[]),y=new Set(e==="multiple"?s??p:(()=>{const P=s??d;return P?[P]:[]})()),w=v.useCallback(P=>{i?i(P):h(P)},[i]),_=v.useCallback(P=>{i?i(P):m(P)},[i]),x=v.useCallback(P=>{e==="multiple"?_((s??p).filter(k=>k!==P)):w("")},[e,s,p,w,_]),b=e==="multiple"?{type:"multiple",value:s??p,defaultValue:r,onValueChange:_}:{type:"single",collapsible:n,value:s??d,defaultValue:r,onValueChange:w};return E.jsx(qR,{...b,asChild:!0,children:E.jsx("div",{ref:c,className:vr("w-72 max-w-full flex flex-col gap-0.5",a),...u,children:E.jsx(tM.Provider,{value:y,children:E.jsx(nM.Provider,{value:x,children:t})})})})});eM.displayName="Accordion";const tM=v.createContext(new Set),nM=v.createContext(()=>{}),rM=v.forwardRef(({value:t,index:e,disabled:n,children:r,className:s,...i},a)=>{const u=v.useRef(null),c=Fx(),d=v.useContext(tM),h=v.useContext(nM),p=D0(),m=c!=null&&c.grouped?c.openValues.has(t):d.has(t),y=v.useRef(null),w=v.useCallback(()=>{c!=null&&c.grouped?c.toggleValue(t):h(t)},[c,h,t]);return v.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return c.registerItem(e,y.current),()=>c.registerItem(e,null)},[e,c]),v.useEffect(()=>{if(c!=null&&c.grouped&&e!==void 0)return m?c.registerFullItem(e,u.current):c.registerFullItem(e,null),()=>c.registerFullItem(e,null)},[e,c,m]),E.jsx(QR.Provider,{value:{index:e,value:t,isOpen:m,onToggle:w,triggerRef:y},children:E.jsxs(SX,{ref:_=>{u.current=_,typeof a=="function"?a(_):a&&(a.current=_)},value:t,disabled:n,"data-proximity-index":e,className:vr(!(c!=null&&c.grouped)&&"relative",s),...i,children:[!(c!=null&&c.grouped)&&E.jsx(uo,{children:m&&E.jsx(co.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]})})});rM.displayName="AccordionItem";const sM=v.forwardRef(({children:t,className:e,...n},r)=>{const s=yJ("chevron-right"),i=Fx(),{index:a,isOpen:u,triggerRef:c}=JR(),d=D0(),[h,p]=v.useState(!1),m=i!=null&&i.grouped?i.activeIndex===a:h,y=E.jsx(EX,{asChild:!0,children:E.jsx("div",{children:E.jsxs(CX,{ref:r,className:vr(`relative z-10 flex items-center gap-2.5 ${d.item} px-3 py-2 w-full cursor-pointer outline-none select-none`,!(i!=null&&i.grouped)&&"focus-visible:ring-1 focus-visible:ring-[#6B97FF] focus-visible:ring-offset-0",e),...n,children:[E.jsxs("span",{className:"inline-grid text-[13px] flex-1 text-left",children:[E.jsx("span",{className:"col-start-1 row-start-1 invisible",style:{fontVariationSettings:jd.semibold},"aria-hidden":"true",children:t}),E.jsx("span",{className:vr("col-start-1 row-start-1 transition-[color,font-variation-settings] duration-80",u||m?"text-foreground":"text-muted-foreground"),style:{fontVariationSettings:u?jd.semibold:jd.normal},children:t})]}),E.jsx(co.span,{className:"shrink-0 inline-flex items-center justify-center",animate:{rotate:u?90:0},transition:of.fast,children:E.jsx(s,{size:16,strokeWidth:u||m?2:1.5,className:vr("transition-[color,stroke-width] duration-80",u||m?"text-foreground":"text-muted-foreground")})})]})})});return i!=null&&i.grouped?E.jsx("div",{ref:c,children:y}):E.jsxs("div",{className:"relative",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[E.jsx(uo,{children:h&&E.jsx(co.div,{className:`absolute inset-0 ${d.bg} bg-hover pointer-events-none`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:.06}},transition:{duration:.08}})}),y]})});sM.displayName="AccordionTrigger";const iM=v.forwardRef(({children:t,className:e,...n},r)=>{const s=Fx(),{isOpen:i}=JR();return E.jsx(uo,{initial:!1,children:i&&E.jsx(kX,{forceMount:!0,asChild:!0,...n,children:E.jsx(co.div,{ref:r,className:vr("overflow-hidden",e),initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{...of.moderate,bounce:0},onUpdate:()=>{s==null||s.remeasure()},onAnimationComplete:()=>{s==null||s.remeasure()},children:E.jsx("div",{className:"px-3 pb-3 pt-1 text-[13px] text-muted-foreground",children:t})})})})});iM.displayName="AccordionContent";const am=({children:t,defaultValue:e=[],className:n=""})=>E.jsx(eM,{type:"multiple",defaultValue:e,className:vr("w-full",n),children:t}),xJ=({value:t,title:e,description:n,dataCy:r,icon:s,children:i,className:a=""})=>{const u=a.includes("first-item");return E.jsxs(rM,{value:t,className:vr("w-full",!u&&"border-t border-main-border"),children:[E.jsxs(sM,{"data-cy":r,children:[s?E.jsx("span",{className:"mr-1 inline-flex items-center",children:s}):null,e]}),E.jsxs(iM,{children:[n?E.jsx("p",{className:"pb-2 text-sm text-content-subtle",children:n}):null,i]})]})};am.Item=xJ;const bJ=({message:t,isLoading:e=!0})=>E.jsxs("div",{className:"flex items-center gap-2 text-sm text-content",children:[e?E.jsx(k0,{className:"h-4 w-4 shrink-0 animate-spin text-primary",weight:"bold"}):null,E.jsx("span",{className:"whitespace-pre-wrap font-sans",children:t})]}),SJ=()=>{const t=v.useRef(Date.now()),[e,n]=v.useState(0);return v.useEffect(()=>{const r=()=>n(Math.max(0,Math.floor((Date.now()-t.current)/1e3)));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[]),e},EJ=t=>{const e=Math.floor(t/60),n=t%60;return`${e}:${n.toString().padStart(2,"0")}`},q6="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",Z6="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",CJ="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",lm=["Applying","Thinking","Planning","Crafting"],kJ=lm.reduce((t,e)=>t.length>=e.length?t:e),PJ=20,TJ="Still working — runs can take a few minutes.",IJ=({hint:t,showElapsed:e=!0})=>{const[n,r]=v.useState(0),s=SJ();v.useEffect(()=>{const a=setInterval(()=>{r(u=>(u+1)%lm.length)},4e3);return()=>clearInterval(a)},[]);const i=t??(e&&s>=PJ?TJ:null);return E.jsxs("div",{role:"status",className:"flex items-center gap-2 px-3 py-1","data-cy":"thinking-indicator",children:[E.jsx(Il.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:E.jsx(Il.path,{animate:{d:[q6,Z6,CJ,Z6,q6]},transition:{d:{duration:6,ease:"easeInOut",repeat:1/0,times:[0,.25,.5,.75,1]}}})}),E.jsxs("span",{className:"inline-grid overflow-hidden text-sm font-medium",style:{fontVariationSettings:jd.medium},children:[E.jsx("span",{className:"shimmer-text invisible col-start-1 row-start-1","aria-hidden":"true",children:kJ}),E.jsx(uo,{mode:"popLayout",initial:!1,children:E.jsx(Il.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:lm[n]},lm[n])})]}),e?E.jsx("span",{className:"text-xs tabular-nums text-content-subtle","data-cy":"thinking-elapsed",children:EJ(s)}):null,i?E.jsx("span",{className:"text-xs text-content-subtle",children:i}):null]})};var AJ=Object.defineProperty,RJ=(t,e)=>AJ(t,"name",{value:e,configurable:!0});function jx(t,[e,n]){return Math.min(n,Math.max(e,t))}RJ(jx,"clamp");var MJ=Object.defineProperty,OJ=(t,e)=>MJ(t,"name",{value:e,configurable:!0});function oM(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}OJ(oM,"usePrevious");var LJ=Object.defineProperty,gt=(t,e)=>LJ(t,"name",{value:e,configurable:!0}),aM=["PageUp","PageDown"],lM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],uM={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Hf="Slider",[x2,DJ,NJ]=Tx(Hf),[Vx,Eee]=Pi(Hf,[NJ]),[FJ,zf]=Vx(Hf),jJ=v.forwardRef(gt(function(e,n){const{name:r,min:s=0,max:i=100,step:a=1,orientation:u="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[s],value:p,onValueChange:m=gt(()=>{},"onValueChange"),onValueCommit:y=gt(()=>{},"onValueCommit"),inverted:w=!1,form:_,...x}=e,b=v.useRef(new Set),P=v.useRef(0),T=v.useRef(!1),I=u==="horizontal"?VJ:$J,[R,L]=v.useState(null),A=zt(n,L),[O=[],D]=Ea({prop:p,defaultProp:h,onChange:gt(Y=>{var J;(J=[...b.current][P.current])==null||J.focus({preventScroll:!0,focusVisible:T.current}),T.current=!1,m(Y)},"onChange")}),N=v.useRef(O),F=v.useRef(O);v.useEffect(()=>{const Y=_?R==null?void 0:R.ownerDocument.getElementById(_):R==null?void 0:R.closest("form");if(Y instanceof HTMLFormElement){const $=gt(()=>D(F.current),"reset");return Y.addEventListener("reset",$),()=>Y.removeEventListener("reset",$)}},[R,_,D]);function K(Y){const $=vM(O,Y);G(Y,$)}gt(K,"handleSlideStart");function Z(Y){G(Y,P.current)}gt(Z,"handleSlideMove");function W(){String(O)!==String(N.current)&&y(O)}gt(W,"handleSlideEnd");function G(Y,$,{commit:J}={commit:!1}){const H=Hx(a),j=Bd(Math.round((Y-s)/a)*a+s,H),X=jx(j,[s,i]);D((oe=[])=>{const se=mM(oe,X,$);if(wM(se,d*a)){P.current=se.indexOf(X);const ee=String(se)!==String(oe);return ee&&J&&y(se),ee?se:oe}else return oe})}return gt(G,"updateValues"),E.jsx(FJ,{scope:e.__scopeSlider,name:r,disabled:c,min:s,max:i,valueIndexToChangeRef:P,thumbs:b.current,values:O,orientation:u,form:_,children:E.jsx(x2.Provider,{scope:e.__scopeSlider,children:E.jsx(x2.Slot,{scope:e.__scopeSlider,children:E.jsx(I,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:A,onPointerDown:$t(x.onPointerDown,()=>{c||(N.current=O,T.current=!1)}),min:s,max:i,inverted:w,onSlideStart:c?void 0:K,onSlideMove:c?void 0:Z,onSlideEnd:c?void 0:W,onHomeKeyDown:()=>{c||(T.current=!0,G(s,0,{commit:!0}))},onEndKeyDown:()=>{c||(T.current=!0,G(i,O.length-1,{commit:!0}))},onStepKeyDown:({event:Y,direction:$})=>{if(!c){T.current=!0;const j=aM.includes(Y.key)||Y.shiftKey&&lM.includes(Y.key)?10:1,X=P.current,oe=O[X],se=xM(oe,{min:s,step:a,direction:$,multiplier:j});G(se,X,{commit:!0})}}})})})})},"Slider")),[cM,dM]=Vx(Hf,{startEdge:"left",endEdge:"right",size:"width",direction:1}),VJ=v.forwardRef(gt(function(e,n){const{min:r,max:s,dir:i,inverted:a,onSlideStart:u,onSlideMove:c,onSlideEnd:d,onStepKeyDown:h,...p}=e,[m,y]=v.useState(null),w=zt(n,y),_=v.useRef(void 0),x=Mx(i),b=x==="ltr",P=b&&!a||!b&&a;function T(k){const I=_.current||m.getBoundingClientRect(),R=[0,I.width],A=B0(R,P?[r,s]:[s,r]);return _.current=I,A(k-I.left)}return gt(T,"getValueFromPointer"),E.jsx(cM,{scope:e.__scopeSlider,startEdge:P?"left":"right",endEdge:P?"right":"left",direction:P?1:-1,size:"width",children:E.jsx(fM,{dir:x,"data-orientation":"horizontal",...p,ref:w,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const I=T(k.clientX);u==null||u(I)},onSlideMove:k=>{const I=T(k.clientX);c==null||c(I)},onSlideEnd:()=>{_.current=void 0,d==null||d()},onStepKeyDown:k=>{const R=uM[P?"from-left":"from-right"].includes(k.key);h==null||h({event:k,direction:R?-1:1})}})})},"SliderHorizontal")),$J=v.forwardRef(gt(function(e,n){const{min:r,max:s,inverted:i,onSlideStart:a,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...h}=e,p=v.useRef(null),m=zt(n,p),y=v.useRef(void 0),w=!i;function _(x){const b=y.current||p.current.getBoundingClientRect(),P=[0,b.height],k=B0(P,w?[s,r]:[r,s]);return y.current=b,k(x-b.top)}return gt(_,"getValueFromPointer"),E.jsx(cM,{scope:e.__scopeSlider,startEdge:w?"bottom":"top",endEdge:w?"top":"bottom",size:"height",direction:w?1:-1,children:E.jsx(fM,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:x=>{const b=_(x.clientY);a==null||a(b)},onSlideMove:x=>{const b=_(x.clientY);u==null||u(b)},onSlideEnd:()=>{y.current=void 0,c==null||c()},onStepKeyDown:x=>{const P=uM[w?"from-bottom":"from-top"].includes(x.key);d==null||d({event:x,direction:P?-1:1})}})})},"SliderVertical")),fM=v.forwardRef(gt(function(e,n){const{__scopeSlider:r,onSlideStart:s,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:u,onEndKeyDown:c,onStepKeyDown:d,...h}=e,p=zf(Hf,r);return E.jsx(pn.span,{...h,ref:n,onKeyDown:$t(e.onKeyDown,m=>{m.key==="Home"?(u(m),m.preventDefault()):m.key==="End"?(c(m),m.preventDefault()):aM.concat(lM).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:$t(e.onPointerDown,m=>{const y=m.target;y.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(y)?y.focus({preventScroll:!0,focusVisible:!1}):s(m)}),onPointerMove:$t(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:$t(e.onPointerUp,m=>{const y=m.target;y.hasPointerCapture(m.pointerId)&&(y.releasePointerCapture(m.pointerId),a(m))})})},"SliderImpl")),HJ="SliderTrack",zJ=v.forwardRef(gt(function(e,n){const{__scopeSlider:r,...s}=e,i=zf(HJ,r);return E.jsx(pn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...s,ref:n})},"SliderTrack")),Y6="SliderRange",BJ=v.forwardRef(gt(function(e,n){const{__scopeSlider:r,...s}=e,i=zf(Y6,r),a=dM(Y6,r),u=v.useRef(null),c=zt(n,u),d=i.values.length,h=i.values.map(y=>$x(y,i.min,i.max)),p=d>1?Math.min(...h):0,m=100-Math.max(...h);return E.jsx(pn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...s,ref:c,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})},"SliderRange")),UJ="SliderThumb",[WJ,hM]=Vx(UJ),GJ="SliderThumbProvider";function pM(t){const{__scopeSlider:e,name:n,children:r,internal_do_not_use_render:s}=t,i=zf(GJ,e),a=DJ(e),[u,c]=v.useState(null),d=v.useMemo(()=>u?a().findIndex(x=>x.ref.current===u):-1,[a,u]),h=Qw(u),p=u?!!i.form||!!u.closest("form"):!0,m=i.values[d],y=n??(i.name?i.name+(i.values.length>1?"[]":""):void 0),w=m===void 0?0:$x(m,i.min,i.max);v.useEffect(()=>{if(u)return i.thumbs.add(u),()=>{i.thumbs.delete(u)}},[u,i.thumbs]);const _={value:m,name:y,form:i.form,isFormControl:p,index:d,thumb:u,onThumbChange:c,percent:w,size:h};return E.jsx(WJ,{scope:e,..._,children:bM(s)?s(_):r})}gt(pM,"SliderThumbProvider");var sy="SliderThumbTrigger",KJ=v.forwardRef(gt(function(e,n){const{__scopeSlider:r,...s}=e,i=zf(sy,r),a=dM(sy,r),{index:u,value:c,percent:d,size:h,onThumbChange:p}=hM(sy,r),m=zt(n,p),y=gM(u,i.values.length),w=h==null?void 0:h[a.size],_=w?yM(w,d,a.direction):0;return E.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${d}% + ${_}px)`},children:E.jsx(x2.ItemSlot,{scope:r,children:E.jsx(pn.span,{role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":i.min,"aria-valuenow":c,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:m,style:c===void 0?{display:"none"}:e.style,onFocus:$t(e.onFocus,()=>{i.valueIndexToChangeRef.current=u})})})})},"SliderThumbTrigger")),qJ=v.forwardRef(gt(function(e,n){const{__scopeSlider:r,name:s,...i}=e;return E.jsx(pM,{__scopeSlider:r,name:s,internal_do_not_use_render:({index:a,isFormControl:u})=>E.jsxs(E.Fragment,{children:[E.jsx(KJ,{...i,ref:n,__scopeSlider:r}),u?E.jsx(YJ,{__scopeSlider:r},a):null]})})},"SliderThumb")),ZJ="SliderBubbleInput",YJ=v.forwardRef(gt(function({__scopeSlider:e,...n},r){const{value:s,name:i,form:a}=hM(ZJ,e),u=v.useRef(null),c=zt(u,r),d=oM(s);return v.useEffect(()=>{const h=u.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"value").set;if(d!==s&&y){const w=new Event("input",{bubbles:!0});y.call(h,s),h.dispatchEvent(w)}},[d,s]),E.jsx(pn.input,{style:{display:"none"},name:i,form:a,...n,ref:c,defaultValue:s})},"SliderBubbleInput"));function mM(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}gt(mM,"getNextSortedValues");function $x(t,e,n){const i=100/(n-e)*(t-e);return jx(i,[0,100])}gt($x,"convertValueToPercentage");function gM(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}gt(gM,"getLabel");function vM(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)}gt(vM,"getClosestValueIndex");function yM(t,e,n){const r=t/2,i=B0([0,50],[0,r]);return(r-i(e)*n)*n}gt(yM,"getThumbInBoundsOffset");function _M(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}gt(_M,"getStepsBetweenValues");function wM(t,e){if(e>0){const n=_M(t);return Math.min(...n)>=e}return!0}gt(wM,"hasMinStepsBetweenValues");function B0(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])}}gt(B0,"linearScale");function Hx(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}gt(Hx,"getDecimalCount");function Bd(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}gt(Bd,"roundValue");function xM(t,{min:e,step:n,direction:r,multiplier:s}){const i=Hx(n),a=(t-e)/n,u=Math.round(a),c=Bd(u*n+e,i)===Bd(t,i);let d;return c?d=u+s*r:r>0?d=Math.ceil(a):d=Math.floor(a),Bd(d*n+e,i)}gt(xM,"getNextStepValue");function bM(t){return typeof t=="function"}gt(bM,"isFunction");const b2=v.forwardRef(({className:t,...e},n)=>E.jsxs(jJ,{ref:n,className:vr("relative flex w-full touch-none select-none items-center","data-[disabled]:opacity-50",t),...e,children:[E.jsx(zJ,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-input",children:E.jsx(BJ,{className:"absolute h-full bg-primary"})}),E.jsx(qJ,{className:vr("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")})]}));b2.displayName="Slider";const XJ=[{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"}],QJ=[{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"}],JJ=[{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"}],Lp=[{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."}],eee=()=>{window.location.hash=""},Wi=({title:t,eyebrow:e,description:n,children:r})=>E.jsxs("section",{className:"border-border bg-card shadow-surface-3 rounded-2xl border p-5",children:[E.jsxs("div",{className:"mb-5 max-w-2xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.18em] uppercase",children:e}),E.jsx("h2",{className:"text-foreground mt-2 text-xl font-semibold",children:t}),E.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-6",children:n})]}),r]}),X6=({swatches:t})=>E.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-3",children:[E.jsx("div",{className:`h-16 rounded-lg ${e.className}`}),E.jsxs("div",{className:"mt-3 flex items-center justify-between gap-3",children:[E.jsx("span",{className:"text-foreground text-sm font-medium",children:e.name}),E.jsx("code",{className:"bg-muted text-muted-foreground rounded px-2 py-1 text-xs",children:e.utility})]})]},e.name))}),tee=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",nee=()=>{const t=Lp.filter(n=>n.status==="showcased").length,e=Lp.filter(n=>n.status==="cataloged").length;return E.jsx("main",{className:"bg-main font-main text-content h-screen overflow-y-auto",children:E.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-6 lg:px-8",children:[E.jsxs("header",{className:"border-border bg-surface-2 shadow-surface-4 rounded-3xl border p-6",children:[E.jsxs("button",{type:"button",onClick:eee,className:"text-content-subtle hover:text-content mb-6 inline-flex items-center gap-2 text-sm transition-colors",children:[E.jsx(EB,{className:"h-4 w-4",weight:"bold"}),"Back to editor"]}),E.jsxs("div",{className:"flex flex-col gap-5 lg:flex-row lg:items-end lg:justify-between",children:[E.jsxs("div",{className:"max-w-3xl",children:[E.jsx("p",{className:"text-primary text-xs font-semibold tracking-[0.22em] uppercase",children:"Local component gallery"}),E.jsx("h1",{className:"text-foreground mt-3 text-4xl font-semibold tracking-tight",children:"Rivet design system"}),E.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."})]}),E.jsx("div",{className:"border-border bg-surface-3 rounded-2xl border p-4",children:E.jsxs("div",{className:"text-content-muted flex items-center gap-3 text-sm",children:[E.jsx(a5,{className:"text-primary h-5 w-5",weight:"bold"}),"Open with ",E.jsx("code",{className:"text-content",children:"#/design-system"})]})})]})]}),E.jsx(Wi,{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:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-[1fr_1fr]",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Rivet Button wrapper"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[E.jsx(Hu,{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"}),E.jsx(Hu,{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"}),E.jsx(Hu,{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"}),E.jsx(gA,{primaryLabel:"Ship",primaryIcon:O1,primaryAction:()=>{},dropdownItems:[{label:"Create PR",onClick:()=>{}},{label:"Copy branch",onClick:()=>{}}]})]})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-3 text-sm font-medium",children:"Tooltip states"}),E.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[E.jsx(ao,{label:"Rivet tooltip API",side:"bottom",children:E.jsx("button",{className:"border-border bg-surface-4 text-content rounded-lg border px-4 py-2 text-sm",children:"Hover target"})}),E.jsx(ix,{content:"Forced open preview",forceOpen:!0,side:"right",children:E.jsx("button",{className:"bg-selected text-content rounded-lg px-4 py-2 text-sm",children:"UI tooltip"})})]})]})]})}),E.jsx(Wi,{eyebrow:"Tokens",title:"Surface ladder",description:"Surface tokens move from the base app background toward raised panels without leaving the dark Rivet palette.",children:E.jsx(X6,{swatches:XJ})}),E.jsx(Wi,{eyebrow:"Tokens",title:"Color roles",description:"Named roles should communicate purpose: brand, selection, neutral accent, and outcome colors.",children:E.jsx(X6,{swatches:QJ})}),E.jsx(Wi,{eyebrow:"Type",title:"Typography",description:"Satoshi remains the default UI voice with clear hierarchy and muted support text.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-primary text-xs tracking-[0.18em] uppercase",children:"Display"}),E.jsx("p",{className:"text-foreground mt-2 text-3xl font-semibold tracking-tight",children:"Visual edits, quickly"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground text-sm font-semibold",children:"Panel heading"}),E.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."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs font-medium tracking-[0.16em] uppercase",children:"Micro label"}),E.jsx("code",{className:"bg-muted text-muted-foreground mt-3 block rounded-lg px-3 py-2 text-xs",children:"font-main text-content"})]})]})}),E.jsx(Wi,{eyebrow:"Layout",title:"Spacing rhythm",description:"A compact spacing scale keeps editor chrome dense while preserving scannable groupings.",children:E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:E.jsx("div",{className:"flex flex-col gap-3",children:JJ.map(n=>E.jsxs("div",{className:"flex items-center gap-4",children:[E.jsx("code",{className:"text-muted-foreground w-16 text-xs",children:n.name}),E.jsx("div",{className:`${n.className} bg-primary h-4 rounded`}),E.jsx("div",{className:"bg-border h-px flex-1"})]},n.name))})})}),E.jsx(Wi,{eyebrow:"Primitives",title:"Accordion and slider",description:"Representative Radix primitives styled through the local component layer.",children:E.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[E.jsxs(am,{defaultValue:["foundations"],className:"border-border bg-surface-2 rounded-xl border p-2",children:[E.jsx(am.Item,{value:"foundations",title:"Foundations",description:"Tokens, surfaces, type, and spacing.",className:"first-item",icon:E.jsx(O1,{className:"text-primary h-4 w-4"}),children:E.jsx("p",{children:"Use these pieces before adding one-off visual rules."})}),E.jsx(am.Item,{value:"components",title:"Components",description:"Buttons, tooltips, accordions, sliders.",children:E.jsx("p",{children:"Keep states visible in this route as the system evolves."})})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-5",children:[E.jsx("p",{className:"text-foreground mb-5 text-sm font-medium",children:"Slider states"}),E.jsxs("div",{className:"space-y-6",children:[E.jsx(b2,{defaultValue:[64],max:100,step:1}),E.jsx(b2,{defaultValue:[36],max:100,step:1,disabled:!0})]})]})]})}),E.jsx(Wi,{eyebrow:"Feedback",title:"Motion and loading",description:"Loading states use existing CSS animation utilities and avoid per-frame React work where possible.",children:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Progress"}),E.jsx(bJ,{message:"Applying visual change..."})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Sparkle strip"}),E.jsx(Ww,{className:"text-primary text-xl"})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-foreground mb-4 text-sm font-medium",children:"Shimmer text"}),E.jsx("span",{className:"shimmer-text text-sm font-medium",children:"Generating variants"})]}),E.jsx("div",{className:"border-border bg-surface-2 rounded-xl border p-4 sm:col-span-3",children:E.jsx(IJ,{hint:"Reading selected elements"})})]})}),E.jsx(Wi,{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:E.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(r2,{fill:"surface",loader:"coalesce",trackGlobalLoaderCount:!1})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx($A,{icon:E.jsx(O1,{size:32}),title:"Nothing to preview yet",description:"Pick a direction from the panel."})}),E.jsx("div",{className:"border-border relative h-56 overflow-hidden rounded-xl border",children:E.jsx(lx,{fill:"surface",size:"sm",title:"Preview isn't connected",description:"Rivet lost connection to your project.",actions:[{label:"Reload",onClick:()=>{}}]})})]})}),E.jsxs(Wi,{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:[E.jsxs("div",{className:"mb-4 grid gap-3 sm:grid-cols-3",children:[E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Total components"}),E.jsx("p",{className:"text-foreground mt-2 text-2xl font-semibold",children:Lp.length})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Showcased"}),E.jsx("p",{className:"text-accent-success mt-2 text-2xl font-semibold",children:t})]}),E.jsxs("div",{className:"border-border bg-surface-2 rounded-xl border p-4",children:[E.jsx("p",{className:"text-content-subtle text-xs tracking-[0.16em] uppercase",children:"Cataloged"}),E.jsx("p",{className:"text-primary mt-2 text-2xl font-semibold",children:e})]})]}),E.jsxs("div",{className:"border-border overflow-hidden rounded-xl border",children:[E.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:[E.jsx("span",{children:"Component"}),E.jsx("span",{children:"Status"}),E.jsx("span",{children:"Coverage note"})]}),E.jsx("div",{className:"divide-border bg-surface-2 divide-y",children:Lp.map(n=>E.jsxs("div",{className:"grid grid-cols-[minmax(140px,1fr)_minmax(110px,auto)_minmax(220px,2fr)] gap-3 px-4 py-3 text-sm",children:[E.jsxs("div",{children:[E.jsx("p",{className:"text-foreground font-medium",children:n.name}),E.jsx("code",{className:"text-muted-foreground text-xs",children:n.path})]}),E.jsx("div",{children:E.jsx("span",{className:`inline-flex rounded-full border px-2 py-1 text-xs font-medium ${tee(n.status)}`,children:n.status})}),E.jsx("p",{className:"text-muted-foreground",children:n.note})]},n.path))})]})]})]})})},ree=t=>(t.startsWith("#/")?t.slice(2):t.slice(1)).split("?")[0]==="design-system"?"design-system":"editor",see=t=>{const e=t.toLowerCase();return e.includes("timed out")?"timeout":e.includes("pop-up blocked")?"popup_blocked":e.includes("window was closed")?"popup_closed":e.includes("store session")?"credential_store_failed":"provider_failed"},iy=({outcome:t,authAttemptId:e,startedAt:n,now:r,failureReason:s})=>({event:`visual_editor_auth_${t}`,properties:{auth_attempt_id:e,duration_ms:r-n,entry_point:"editor_gate",method:"google_oauth",...s?{failure_reason:s}:{}}}),Q6=Is("App"),iee=2e3,oee=60,J6="Connecting to Google...",e8="https://rivet-proxy.onrender.com",aee=`<!doctype html>
395
+ <html lang="en">
396
+ <head>
397
+ <meta charset="utf-8" />
398
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
399
+ <title>${J6}</title>
400
+ <style>
401
+ :root { color-scheme: light dark; }
402
+ body {
403
+ margin: 0;
404
+ min-height: 100vh;
405
+ display: grid;
406
+ place-items: center;
407
+ font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
408
+ background: #111215;
409
+ color: #f3f4f6;
410
+ }
411
+ .panel {
412
+ border: 1px solid rgba(255, 255, 255, 0.16);
413
+ border-radius: 12px;
414
+ padding: 18px 22px;
415
+ background: rgba(255, 255, 255, 0.06);
416
+ font-size: 14px;
417
+ }
418
+ </style>
419
+ </head>
420
+ <body>
421
+ <div class="panel">${J6}</div>
422
+ </body>
423
+ </html>`,S2=274,c0=395,oy=Math.min(c0,Math.round((S2+c0)/2*1.1)),t8="rivet:panelWidth:v2",lee=t=>{if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return t.isContentEditable||e==="input"||e==="textarea"||e==="select"},uee=({projectPath:t})=>{const e=et(D5)>0,[n,r]=_3(O5),s=nH(),[i,a]=v.useState(()=>{if(typeof window>"u")return oy;const k=Number(window.localStorage.getItem(t8));return Number.isFinite(k)&&k>=S2&&k<=c0?k:oy}),[u,c]=v.useState(!1),[d,h]=v.useState(PY),p=n?i:0,[m,y]=v.useState(n);v.useEffect(()=>{if(!n){y(!1);return}h(k=>kY({position:k,boundsLeftPx:i}))},[n,i]),v.useEffect(()=>{window.localStorage.setItem(t8,String(i))},[i]),v.useEffect(()=>{if(!n)return;const k=I=>{I.key==="Escape"&&(lee(I.target)||(I.preventDefault(),r(!1)))};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[n,r]);const w=v.useCallback(k=>{k.preventDefault(),k.stopPropagation();const I=k.clientX,R=i;c(!0);const L=O=>{const D=Math.min(c0,Math.max(S2,R+(O.clientX-I)));a(D)},A=()=>{window.removeEventListener("pointermove",L),window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",A),c(!1)};window.addEventListener("pointermove",L),window.addEventListener("pointerup",A),window.addEventListener("pointercancel",A)},[i]),_=v.useCallback(()=>a(oy),[]),x=$Y(),b=et(Ff);BY({enabled:!b});const P=x.isProcessing?"Completing authentication...":null,T=lt($5);return v.useEffect(()=>{T(t??null)},[t,T]),E.jsxs(Il.div,{className:"relative flex h-screen overflow-hidden",initial:!1,animate:{opacity:1},transition:{duration:.5,ease:"easeOut"},"data-cy":"rivet-app",children:[P!==null?E.jsx("div",{className:"absolute inset-0 z-50",children:E.jsx(hY,{message:P})}):null,E.jsx("div",{className:"relative flex min-w-0 flex-1 flex-col",children:E.jsx(Hq,{})}),E.jsx(E.Fragment,{children:e?null:E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"relative order-first h-full flex-shrink-0",style:{width:m?i:0},children:E.jsxs(Il.div,{className:"absolute inset-y-0 left-0 z-30",initial:!1,animate:{x:n?0:-i},transition:s?{duration:0}:{duration:.2,ease:[.22,1,.36,1]},onAnimationComplete:()=>{n&&y(!0)},style:{width:i,willChange:"transform"},children:[E.jsx(XK,{onClose:()=>r(!1)}),E.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize panel",onPointerDown:w,onDoubleClick:_,className:"group/resize absolute inset-y-0 right-0 z-20 flex w-3 cursor-col-resize touch-none justify-end",children:E.jsx("span",{className:`h-full transition-all duration-150 ${u?"bg-content-muted w-0.5":"bg-divider group-hover/resize:bg-content-muted w-px group-hover/resize:w-0.5"}`})})]})}),u&&E.jsx("div",{className:"fixed inset-0 z-[100] cursor-col-resize"}),E.jsx(AY,{isVisible:!0,isPanelOpen:n,isReducedMotion:!!s,position:d,dragBoundsLeftPx:p,onPositionChange:h,onToggle:()=>r(k=>!k)})]})}),E.jsx(MH,{duration:5e3,richColors:!0,toastOptions:{style:{maxHeight:"150px",overflow:"hidden"}}})]})},E2="rivet_connect_deep_link",cee=()=>{if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search),e=t.get("connect"),n=e??window.sessionStorage.getItem(E2);if(n!=="pinterest"&&n!=="arena")return null;if(window.sessionStorage.setItem(E2,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},dee=cee(),fee=()=>{const[t,e]=v.useState(window.location.hash),[n]=v.useState(()=>typeof window<"u"&&window.sessionStorage.getItem(im)==="1"),[r,s]=v.useState(!1),[i,a]=v.useState(dee);v.useEffect(()=>{n&&window.sessionStorage.removeItem(im)},[n]);const{config:u,refetchConfig:c,loading:d,error:h}=jY(),p=lt(Ff),[m,y]=v.useState(!1),[w,_]=v.useState(null),[x,b]=v.useState(!1);v.useEffect(()=>{u!=null&&u.userId?(Se.identify(u.userId,{...u.email?{email:u.email}:{}}),u.email&&Se.alias(u.email,u.userId)):u!=null&&u.email&&Se.identify(u.email,{email:u.email})},[u==null?void 0:u.userId,u==null?void 0:u.email]),v.useEffect(()=>{u&&Se.register({source:"visual_editor",surface:"visual_editor"})},[u]);const P=v.useCallback(async()=>{var K;const O=globalThis.crypto.randomUUID(),D=Date.now();y(!0),_(null);const N=iy({outcome:"started",authAttemptId:O,startedAt:D,now:D});Se.capture(N.event,N.properties);let F=null;try{if(F=window.open("","_blank"),!F)throw new Error("Pop-up blocked. Please allow pop-ups and try again.");try{F.document.open(),F.document.write(aee),F.document.close()}catch(G){Q6.warn("Failed to render loading state in auth popup:",G)}const Z=await fetch(`${e8}/api/auth/google/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:"desktop"})}),W=await Z.json();if(!Z.ok||!W.success||!W.authUrl||!W.sessionId||!W.pollSecret)throw new Error(W.error||W.message||"Failed to start Google login");if(F.closed)throw new Error("Sign-in window was closed before Google login started.");F.location.href=W.authUrl;for(let G=0;G<oee;G+=1){if(F.closed)throw new Error("Sign-in window was closed before authentication completed.");const $=await(await fetch(`${e8}/api/auth/google/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:W.sessionId,pollSecret:W.pollSecret})})).json();if($.success&&$.token&&((K=$.user)!=null&&K.email)){if(!(await fetch("/api/auth/store",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:$.user.email,token:$.token,refreshToken:$.refreshToken,userId:$.user.id})})).ok)throw new Error("Signed in, but failed to store session locally.");F.close(),window.sessionStorage.setItem(im,"1");const H=iy({outcome:"completed",authAttemptId:O,startedAt:D,now:Date.now()});Se.capture(H.event,H.properties),window.location.reload();return}if($.error&&$.error!=="Pending")throw new Error($.error||"Google login failed");await new Promise(J=>setTimeout(J,iee))}throw new Error("Authentication timed out. Please try again.")}catch(Z){F&&!F.closed&&F.close();const W=Z instanceof Error?Z.message:"Failed to start login flow";Q6.warn("Login failed:",W);const G=iy({outcome:"failed",authAttemptId:O,startedAt:D,now:Date.now(),failureReason:see(W)});Se.capture(G.event,G.properties),_(W),y(!1)}},[]),T=u!=null&&u.agentModeAvailable!==!0,k=ree(t),I=v.useCallback(async()=>{b(!0),p(!0);try{await c()}finally{p(!1),b(!1)}},[c,p]);if(v.useEffect(()=>{const O=()=>{const D=window.location.hash;e(D)};return window.addEventListener("hashchange",O),()=>window.removeEventListener("hashchange",O)},[]),k==="design-system")return E.jsx(nee,{});if(!d&&u===null&&!x){const O=h||"Could not load Rivet configuration.";return E.jsx("div",{className:"bg-main flex h-screen items-center justify-center px-6",children:E.jsxs("div",{className:"border-divider bg-main w-full max-w-md rounded-lg border p-6 text-center shadow-lg",children:[E.jsx("p",{className:"text-content text-sm font-medium",children:"We could not start Rivet yet."}),E.jsx("p",{className:"text-content-dim mt-2 text-xs",children:O}),E.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:()=>{I()},children:"Retry"})]})})}if(T)return E.jsx(dY,{isSigningIn:m,onStartSignIn:()=>{P()},errorMessage:w,displayMode:"full"});const L=(u==null?void 0:u.agentModeAvailable)===!0&&i!==null,A=(u==null?void 0:u.agentModeAvailable)===!0&&n&&!r&&!L;return E.jsxs(E.Fragment,{children:[E.jsx(uee,{projectPath:u==null?void 0:u.projectPath}),E.jsx(n2,{context:"onboarding",isOpen:A,onClose:()=>s(!0)}),E.jsx(n2,{context:"menu",isOpen:L,highlightProvider:i,onClose:()=>{window.sessionStorage.removeItem(E2),a(null)}})]})},hee="phc_Ntj9tXHbS64XgYxlTfhglRmFivFsfm0AERph4ZlnNH",pee=new ML,mee={session_recording:{maskAllInputs:!0,maskTextSelector:"[data-rivet-private]"}},gee=()=>E.jsx("div",{style:{display:"flex",height:"100vh",alignItems:"center",justifyContent:"center"},children:E.jsx("p",{style:{fontSize:"14px",color:"#6b7280"},children:"Something went wrong. Please reload the page."})});P9.createRoot(document.getElementById("root")).render(E.jsx(ye.StrictMode,{children:E.jsx(v9,{apiKey:hee,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",...mee,mask_all_text:!1,mask_all_element_attributes:!1,loaded:t=>{t.register({source:"visual_editor",surface:"visual_editor",telemetry_version:2,rivet_version:"0.14.22",env:"production"})}},children:E.jsx(x9,{fallback:E.jsx(gee,{}),children:E.jsx(OL,{client:pee,children:E.jsx(QG,{defaultShape:"rounded",children:E.jsx(_J,{defaultLibrary:"lucide",children:E.jsx(fee,{})})})})})})}));