@kite-copilot/chat-panel 0.2.49 → 0.2.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/auto.cjs +118 -158
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-YZXB3LLU.js → chunk-VBCGW333.js} +118 -158
- package/dist/{createKiteChat-e6BnJS6T.d.cts → createKiteChat-DeQKgFyx.d.cts} +8 -2
- package/dist/{createKiteChat-e6BnJS6T.d.ts → createKiteChat-DeQKgFyx.d.ts} +8 -2
- package/dist/embed.global.js +24 -59
- package/dist/index.cjs +118 -158
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/embed.global.js
CHANGED
|
@@ -1,84 +1,49 @@
|
|
|
1
|
-
"use strict";var KiteChatEmbed=(()=>{var Nk=Object.create;var Fu=Object.defineProperty;var Mk=Object.getOwnPropertyDescriptor;var Ok=Object.getOwnPropertyNames;var Bk=Object.getPrototypeOf,Fk=Object.prototype.hasOwnProperty;var Uk=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var oa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vk=(e,t)=>{for(var r in t)Fu(e,r,{get:t[r],enumerable:!0})},rv=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ok(t))!Fk.call(e,o)&&o!==r&&Fu(e,o,{get:()=>t[o],enumerable:!(a=Mk(t,o))||a.enumerable});return e};var M=(e,t,r)=>(r=e!=null?Nk(Bk(e)):{},rv(t||!e||!e.__esModule?Fu(r,"default",{value:e,enumerable:!0}):r,e)),jk=e=>rv(Fu({},"__esModule",{value:!0}),e);var mv=oa(oe=>{"use strict";var Fi=Symbol.for("react.element"),qk=Symbol.for("react.portal"),$k=Symbol.for("react.fragment"),Hk=Symbol.for("react.strict_mode"),zk=Symbol.for("react.profiler"),Wk=Symbol.for("react.provider"),Gk=Symbol.for("react.context"),Kk=Symbol.for("react.forward_ref"),Xk=Symbol.for("react.suspense"),Jk=Symbol.for("react.memo"),Qk=Symbol.for("react.lazy"),av=Symbol.iterator;function Yk(e){return e===null||typeof e!="object"?null:(e=av&&e[av]||e["@@iterator"],typeof e=="function"?e:null)}var sv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},iv=Object.assign,lv={};function $n(e,t,r){this.props=e,this.context=t,this.refs=lv,this.updater=r||sv}$n.prototype.isReactComponent={};$n.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};$n.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uv(){}uv.prototype=$n.prototype;function Ap(e,t,r){this.props=e,this.context=t,this.refs=lv,this.updater=r||sv}var Rp=Ap.prototype=new uv;Rp.constructor=Ap;iv(Rp,$n.prototype);Rp.isPureReactComponent=!0;var ov=Array.isArray,cv=Object.prototype.hasOwnProperty,Ep={current:null},dv={key:!0,ref:!0,__self:!0,__source:!0};function fv(e,t,r){var a,o={},n=null,s=null;if(t!=null)for(a in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(n=""+t.key),t)cv.call(t,a)&&!dv.hasOwnProperty(a)&&(o[a]=t[a]);var i=arguments.length-2;if(i===1)o.children=r;else if(1<i){for(var l=Array(i),u=0;u<i;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)o[a]===void 0&&(o[a]=i[a]);return{$$typeof:Fi,type:e,key:n,ref:s,props:o,_owner:Ep.current}}function Zk(e,t){return{$$typeof:Fi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Dp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Fi}function eP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var nv=/\/+/g;function _p(e,t){return typeof e=="object"&&e!==null&&e.key!=null?eP(""+e.key):t.toString(36)}function Vu(e,t,r,a,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(n){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Fi:case qk:s=!0}}if(s)return s=e,o=o(s),e=a===""?"."+_p(s,0):a,ov(o)?(r="",e!=null&&(r=e.replace(nv,"$&/")+"/"),Vu(o,t,r,"",function(u){return u})):o!=null&&(Dp(o)&&(o=Zk(o,r+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(nv,"$&/")+"/")+e)),t.push(o)),1;if(s=0,a=a===""?".":a+":",ov(e))for(var i=0;i<e.length;i++){n=e[i];var l=a+_p(n,i);s+=Vu(n,t,r,l,o)}else if(l=Yk(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=a+_p(n,i++),s+=Vu(n,t,r,l,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Uu(e,t,r){if(e==null)return e;var a=[],o=0;return Vu(e,a,"","",function(n){return t.call(r,n,o++)}),a}function tP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Pt={current:null},ju={transition:null},rP={ReactCurrentDispatcher:Pt,ReactCurrentBatchConfig:ju,ReactCurrentOwner:Ep};function pv(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:Uu,forEach:function(e,t,r){Uu(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Uu(e,function(){t++}),t},toArray:function(e){return Uu(e,function(t){return t})||[]},only:function(e){if(!Dp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=$n;oe.Fragment=$k;oe.Profiler=zk;oe.PureComponent=Ap;oe.StrictMode=Hk;oe.Suspense=Xk;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rP;oe.act=pv;oe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=iv({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=Ep.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)cv.call(t,l)&&!dv.hasOwnProperty(l)&&(a[l]=t[l]===void 0&&i!==void 0?i[l]:t[l])}var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){i=Array(l);for(var u=0;u<l;u++)i[u]=arguments[u+2];a.children=i}return{$$typeof:Fi,type:e.type,key:o,ref:n,props:a,_owner:s}};oe.createContext=function(e){return e={$$typeof:Gk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Wk,_context:e},e.Consumer=e};oe.createElement=fv;oe.createFactory=function(e){var t=fv.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:Kk,render:e}};oe.isValidElement=Dp;oe.lazy=function(e){return{$$typeof:Qk,_payload:{_status:-1,_result:e},_init:tP}};oe.memo=function(e,t){return{$$typeof:Jk,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=ju.transition;ju.transition={};try{e()}finally{ju.transition=t}};oe.unstable_act=pv;oe.useCallback=function(e,t){return Pt.current.useCallback(e,t)};oe.useContext=function(e){return Pt.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Pt.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Pt.current.useEffect(e,t)};oe.useId=function(){return Pt.current.useId()};oe.useImperativeHandle=function(e,t,r){return Pt.current.useImperativeHandle(e,t,r)};oe.useInsertionEffect=function(e,t){return Pt.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Pt.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Pt.current.useMemo(e,t)};oe.useReducer=function(e,t,r){return Pt.current.useReducer(e,t,r)};oe.useRef=function(e){return Pt.current.useRef(e)};oe.useState=function(e){return Pt.current.useState(e)};oe.useSyncExternalStore=function(e,t,r){return Pt.current.useSyncExternalStore(e,t,r)};oe.useTransition=function(){return Pt.current.useTransition()};oe.version="18.3.1"});var K=oa((bN,hv)=>{"use strict";hv.exports=mv()});var Iv=oa(Se=>{"use strict";function Bp(e,t){var r=e.length;e.push(t);e:for(;0<r;){var a=r-1>>>1,o=e[a];if(0<qu(o,t))e[a]=t,e[r]=o,r=a;else break e}}function br(e){return e.length===0?null:e[0]}function Hu(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var a=0,o=e.length,n=o>>>1;a<n;){var s=2*(a+1)-1,i=e[s],l=s+1,u=e[l];if(0>qu(i,r))l<o&&0>qu(u,i)?(e[a]=u,e[l]=r,a=l):(e[a]=i,e[s]=r,a=s);else if(l<o&&0>qu(u,r))e[a]=u,e[l]=r,a=l;else break e}}return t}function qu(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(gv=performance,Se.unstable_now=function(){return gv.now()}):(Np=Date,yv=Np.now(),Se.unstable_now=function(){return Np.now()-yv});var gv,Np,yv,Or=[],ja=[],aP=1,cr=null,xt=3,zu=!1,Vo=!1,Vi=!1,wv=typeof setTimeout=="function"?setTimeout:null,Sv=typeof clearTimeout=="function"?clearTimeout:null,vv=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Fp(e){for(var t=br(ja);t!==null;){if(t.callback===null)Hu(ja);else if(t.startTime<=e)Hu(ja),t.sortIndex=t.expirationTime,Bp(Or,t);else break;t=br(ja)}}function Up(e){if(Vi=!1,Fp(e),!Vo)if(br(Or)!==null)Vo=!0,jp(Vp);else{var t=br(ja);t!==null&&qp(Up,t.startTime-e)}}function Vp(e,t){Vo=!1,Vi&&(Vi=!1,Sv(ji),ji=-1),zu=!0;var r=xt;try{for(Fp(t),cr=br(Or);cr!==null&&(!(cr.expirationTime>t)||e&&!Lv());){var a=cr.callback;if(typeof a=="function"){cr.callback=null,xt=cr.priorityLevel;var o=a(cr.expirationTime<=t);t=Se.unstable_now(),typeof o=="function"?cr.callback=o:cr===br(Or)&&Hu(Or),Fp(t)}else Hu(Or);cr=br(Or)}if(cr!==null)var n=!0;else{var s=br(ja);s!==null&&qp(Up,s.startTime-t),n=!1}return n}finally{cr=null,xt=r,zu=!1}}var Wu=!1,$u=null,ji=-1,Cv=5,bv=-1;function Lv(){return!(Se.unstable_now()-bv<Cv)}function Mp(){if($u!==null){var e=Se.unstable_now();bv=e;var t=!0;try{t=$u(!0,e)}finally{t?Ui():(Wu=!1,$u=null)}}else Wu=!1}var Ui;typeof vv=="function"?Ui=function(){vv(Mp)}:typeof MessageChannel<"u"?(Op=new MessageChannel,xv=Op.port2,Op.port1.onmessage=Mp,Ui=function(){xv.postMessage(null)}):Ui=function(){wv(Mp,0)};var Op,xv;function jp(e){$u=e,Wu||(Wu=!0,Ui())}function qp(e,t){ji=wv(function(){e(Se.unstable_now())},t)}Se.unstable_IdlePriority=5;Se.unstable_ImmediatePriority=1;Se.unstable_LowPriority=4;Se.unstable_NormalPriority=3;Se.unstable_Profiling=null;Se.unstable_UserBlockingPriority=2;Se.unstable_cancelCallback=function(e){e.callback=null};Se.unstable_continueExecution=function(){Vo||zu||(Vo=!0,jp(Vp))};Se.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Cv=0<e?Math.floor(1e3/e):5};Se.unstable_getCurrentPriorityLevel=function(){return xt};Se.unstable_getFirstCallbackNode=function(){return br(Or)};Se.unstable_next=function(e){switch(xt){case 1:case 2:case 3:var t=3;break;default:t=xt}var r=xt;xt=t;try{return e()}finally{xt=r}};Se.unstable_pauseExecution=function(){};Se.unstable_requestPaint=function(){};Se.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=xt;xt=e;try{return t()}finally{xt=r}};Se.unstable_scheduleCallback=function(e,t,r){var a=Se.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0<r?a+r:a):r=a,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=r+o,e={id:aP++,callback:t,priorityLevel:e,startTime:r,expirationTime:o,sortIndex:-1},r>a?(e.sortIndex=r,Bp(ja,e),br(Or)===null&&e===br(ja)&&(Vi?(Sv(ji),ji=-1):Vi=!0,qp(Up,r-a))):(e.sortIndex=o,Bp(Or,e),Vo||zu||(Vo=!0,jp(Vp))),e};Se.unstable_shouldYield=Lv;Se.unstable_wrapCallback=function(e){var t=xt;return function(){var r=xt;xt=t;try{return e.apply(this,arguments)}finally{xt=r}}}});var Pv=oa((IN,kv)=>{"use strict";kv.exports=Iv()});var Rw=oa(Yt=>{"use strict";var oP=K(),Jt=Pv();function R(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Nx=new Set,ul={};function Zo(e,t){cs(e,t),cs(e+"Capture",t)}function cs(e,t){for(ul[e]=t,e=0;e<t.length;e++)Nx.add(t[e])}var ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dm=Object.prototype.hasOwnProperty,nP=/^[: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]*$/,Tv={},_v={};function sP(e){return dm.call(_v,e)?!0:dm.call(Tv,e)?!1:nP.test(e)?_v[e]=!0:(Tv[e]=!0,!1)}function iP(e,t,r,a){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return a?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lP(e,t,r,a){if(t===null||typeof t>"u"||iP(e,t,r,a))return!0;if(a)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function At(e,t,r,a,o,n,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=a,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=s}var ft={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ft[e]=new At(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ft[t]=new At(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ft[e]=new At(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ft[e]=new At(e,2,!1,e,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(e){ft[e]=new At(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ft[e]=new At(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ft[e]=new At(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ft[e]=new At(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ft[e]=new At(e,5,!1,e.toLowerCase(),null,!1,!1)});var ah=/[\-:]([a-z])/g;function oh(e){return e[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(e){var t=e.replace(ah,oh);ft[t]=new At(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ah,oh);ft[t]=new At(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ah,oh);ft[t]=new At(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ft[e]=new At(e,1,!1,e.toLowerCase(),null,!1,!1)});ft.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ft[e]=new At(e,1,!1,e.toLowerCase(),null,!0,!0)});function nh(e,t,r,a){var o=ft.hasOwnProperty(t)?ft[t]:null;(o!==null?o.type!==0:a||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(lP(t,r,o,a)&&(r=null),a||o===null?sP(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,a=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,a?e.setAttributeNS(a,t,r):e.setAttribute(t,r))))}var ma=oP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Gu=Symbol.for("react.element"),Wn=Symbol.for("react.portal"),Gn=Symbol.for("react.fragment"),sh=Symbol.for("react.strict_mode"),fm=Symbol.for("react.profiler"),Mx=Symbol.for("react.provider"),Ox=Symbol.for("react.context"),ih=Symbol.for("react.forward_ref"),pm=Symbol.for("react.suspense"),mm=Symbol.for("react.suspense_list"),lh=Symbol.for("react.memo"),$a=Symbol.for("react.lazy"),Bx=Symbol.for("react.offscreen"),Av=Symbol.iterator;function qi(e){return e===null||typeof e!="object"?null:(e=Av&&e[Av]||e["@@iterator"],typeof e=="function"?e:null)}var Oe=Object.assign,$p;function Ji(e){if($p===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);$p=t&&t[1]||""}return`
|
|
2
|
-
|
|
3
|
-
`),n=
|
|
1
|
+
"use strict";var KiteChatEmbed=(()=>{var Kk=Object.create;var qu=Object.defineProperty;var Xk=Object.getOwnPropertyDescriptor;var Qk=Object.getOwnPropertyNames;var Jk=Object.getPrototypeOf,Yk=Object.prototype.hasOwnProperty;var Zk=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,a)=>(typeof require<"u"?require:t)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var eP=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nx=(e,t)=>{for(var a in t)qu(e,a,{get:t[a],enumerable:!0})},sx=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qk(t))!Yk.call(e,o)&&o!==a&&qu(e,o,{get:()=>t[o],enumerable:!(r=Xk(t,o))||r.enumerable});return e};var M=(e,t,a)=>(a=e!=null?Kk(Jk(e)):{},sx(t||!e||!e.__esModule?qu(a,"default",{value:e,enumerable:!0}):a,e)),ix=e=>sx(qu({},"__esModule",{value:!0}),e);var vx=Ze(re=>{"use strict";var Mi=Symbol.for("react.element"),tP=Symbol.for("react.portal"),aP=Symbol.for("react.fragment"),rP=Symbol.for("react.strict_mode"),oP=Symbol.for("react.profiler"),nP=Symbol.for("react.provider"),sP=Symbol.for("react.context"),iP=Symbol.for("react.forward_ref"),lP=Symbol.for("react.suspense"),uP=Symbol.for("react.memo"),dP=Symbol.for("react.lazy"),lx=Symbol.iterator;function cP(e){return e===null||typeof e!="object"?null:(e=lx&&e[lx]||e["@@iterator"],typeof e=="function"?e:null)}var cx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fx=Object.assign,px={};function Fn(e,t,a){this.props=e,this.context=t,this.refs=px,this.updater=a||cx}Fn.prototype.isReactComponent={};Fn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Fn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mx(){}mx.prototype=Fn.prototype;function Fp(e,t,a){this.props=e,this.context=t,this.refs=px,this.updater=a||cx}var Bp=Fp.prototype=new mx;Bp.constructor=Fp;fx(Bp,Fn.prototype);Bp.isPureReactComponent=!0;var ux=Array.isArray,hx=Object.prototype.hasOwnProperty,Up={current:null},gx={key:!0,ref:!0,__self:!0,__source:!0};function yx(e,t,a){var r,o={},n=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(n=""+t.key),t)hx.call(t,r)&&!gx.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(i===1)o.children=a;else if(1<i){for(var l=Array(i),u=0;u<i;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in i=e.defaultProps,i)o[r]===void 0&&(o[r]=i[r]);return{$$typeof:Mi,type:e,key:n,ref:s,props:o,_owner:Up.current}}function fP(e,t){return{$$typeof:Mi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Vp(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mi}function pP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var dx=/\/+/g;function Op(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pP(""+e.key):t.toString(36)}function zu(e,t,a,r,o){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(n){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Mi:case tP:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Op(s,0):r,ux(o)?(a="",e!=null&&(a=e.replace(dx,"$&/")+"/"),zu(o,t,a,"",function(u){return u})):o!=null&&(Vp(o)&&(o=fP(o,a+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(dx,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",ux(e))for(var i=0;i<e.length;i++){n=e[i];var l=r+Op(n,i);s+=zu(n,t,a,l,o)}else if(l=cP(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=r+Op(n,i++),s+=zu(n,t,a,l,o);else if(n==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Hu(e,t,a){if(e==null)return e;var r=[],o=0;return zu(e,r,"","",function(n){return t.call(a,n,o++)}),r}function mP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(a){(e._status===0||e._status===-1)&&(e._status=1,e._result=a)},function(a){(e._status===0||e._status===-1)&&(e._status=2,e._result=a)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var kt={current:null},$u={transition:null},hP={ReactCurrentDispatcher:kt,ReactCurrentBatchConfig:$u,ReactCurrentOwner:Up};function xx(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:Hu,forEach:function(e,t,a){Hu(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return Hu(e,function(){t++}),t},toArray:function(e){return Hu(e,function(t){return t})||[]},only:function(e){if(!Vp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Fn;re.Fragment=aP;re.Profiler=oP;re.PureComponent=Fp;re.StrictMode=rP;re.Suspense=lP;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hP;re.act=xx;re.cloneElement=function(e,t,a){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=fx({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=Up.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)hx.call(t,l)&&!gx.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&i!==void 0?i[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=a;else if(1<l){i=Array(l);for(var u=0;u<l;u++)i[u]=arguments[u+2];r.children=i}return{$$typeof:Mi,type:e.type,key:o,ref:n,props:r,_owner:s}};re.createContext=function(e){return e={$$typeof:sP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:nP,_context:e},e.Consumer=e};re.createElement=yx;re.createFactory=function(e){var t=yx.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:iP,render:e}};re.isValidElement=Vp;re.lazy=function(e){return{$$typeof:dP,_payload:{_status:-1,_result:e},_init:mP}};re.memo=function(e,t){return{$$typeof:uP,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=$u.transition;$u.transition={};try{e()}finally{$u.transition=t}};re.unstable_act=xx;re.useCallback=function(e,t){return kt.current.useCallback(e,t)};re.useContext=function(e){return kt.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return kt.current.useDeferredValue(e)};re.useEffect=function(e,t){return kt.current.useEffect(e,t)};re.useId=function(){return kt.current.useId()};re.useImperativeHandle=function(e,t,a){return kt.current.useImperativeHandle(e,t,a)};re.useInsertionEffect=function(e,t){return kt.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return kt.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return kt.current.useMemo(e,t)};re.useReducer=function(e,t,a){return kt.current.useReducer(e,t,a)};re.useRef=function(e){return kt.current.useRef(e)};re.useState=function(e){return kt.current.useState(e)};re.useSyncExternalStore=function(e,t,a){return kt.current.useSyncExternalStore(e,t,a)};re.useTransition=function(){return kt.current.useTransition()};re.version="18.3.1"});var W=Ze((nM,wx)=>{"use strict";wx.exports=vx()});var Rx=Ze(ve=>{"use strict";function zp(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<Wu(o,t))e[r]=t,e[a]=o,a=r;else break e}}function wa(e){return e.length===0?null:e[0]}function Ku(e){if(e.length===0)return null;var t=e[0],a=e.pop();if(a!==t){e[0]=a;e:for(var r=0,o=e.length,n=o>>>1;r<n;){var s=2*(r+1)-1,i=e[s],l=s+1,u=e[l];if(0>Wu(i,a))l<o&&0>Wu(u,i)?(e[r]=u,e[l]=a,r=l):(e[r]=i,e[s]=a,r=s);else if(l<o&&0>Wu(u,a))e[r]=u,e[l]=a,r=l;else break e}}return t}function Wu(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(Sx=performance,ve.unstable_now=function(){return Sx.now()}):(jp=Date,Cx=jp.now(),ve.unstable_now=function(){return jp.now()-Cx});var Sx,jp,Cx,Da=[],Er=[],gP=1,ia=null,gt=3,Xu=!1,Ro=!1,Oi=!1,Ix=typeof setTimeout=="function"?setTimeout:null,kx=typeof clearTimeout=="function"?clearTimeout:null,Lx=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $p(e){for(var t=wa(Er);t!==null;){if(t.callback===null)Ku(Er);else if(t.startTime<=e)Ku(Er),t.sortIndex=t.expirationTime,zp(Da,t);else break;t=wa(Er)}}function Wp(e){if(Oi=!1,$p(e),!Ro)if(wa(Da)!==null)Ro=!0,Kp(Gp);else{var t=wa(Er);t!==null&&Xp(Wp,t.startTime-e)}}function Gp(e,t){Ro=!1,Oi&&(Oi=!1,kx(Fi),Fi=-1),Xu=!0;var a=gt;try{for($p(t),ia=wa(Da);ia!==null&&(!(ia.expirationTime>t)||e&&!Ax());){var r=ia.callback;if(typeof r=="function"){ia.callback=null,gt=ia.priorityLevel;var o=r(ia.expirationTime<=t);t=ve.unstable_now(),typeof o=="function"?ia.callback=o:ia===wa(Da)&&Ku(Da),$p(t)}else Ku(Da);ia=wa(Da)}if(ia!==null)var n=!0;else{var s=wa(Er);s!==null&&Xp(Wp,s.startTime-t),n=!1}return n}finally{ia=null,gt=a,Xu=!1}}var Qu=!1,Gu=null,Fi=-1,Px=5,Tx=-1;function Ax(){return!(ve.unstable_now()-Tx<Px)}function qp(){if(Gu!==null){var e=ve.unstable_now();Tx=e;var t=!0;try{t=Gu(!0,e)}finally{t?Ni():(Qu=!1,Gu=null)}}else Qu=!1}var Ni;typeof Lx=="function"?Ni=function(){Lx(qp)}:typeof MessageChannel<"u"?(Hp=new MessageChannel,bx=Hp.port2,Hp.port1.onmessage=qp,Ni=function(){bx.postMessage(null)}):Ni=function(){Ix(qp,0)};var Hp,bx;function Kp(e){Gu=e,Qu||(Qu=!0,Ni())}function Xp(e,t){Fi=Ix(function(){e(ve.unstable_now())},t)}ve.unstable_IdlePriority=5;ve.unstable_ImmediatePriority=1;ve.unstable_LowPriority=4;ve.unstable_NormalPriority=3;ve.unstable_Profiling=null;ve.unstable_UserBlockingPriority=2;ve.unstable_cancelCallback=function(e){e.callback=null};ve.unstable_continueExecution=function(){Ro||Xu||(Ro=!0,Kp(Gp))};ve.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Px=0<e?Math.floor(1e3/e):5};ve.unstable_getCurrentPriorityLevel=function(){return gt};ve.unstable_getFirstCallbackNode=function(){return wa(Da)};ve.unstable_next=function(e){switch(gt){case 1:case 2:case 3:var t=3;break;default:t=gt}var a=gt;gt=t;try{return e()}finally{gt=a}};ve.unstable_pauseExecution=function(){};ve.unstable_requestPaint=function(){};ve.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var a=gt;gt=e;try{return t()}finally{gt=a}};ve.unstable_scheduleCallback=function(e,t,a){var r=ve.unstable_now();switch(typeof a=="object"&&a!==null?(a=a.delay,a=typeof a=="number"&&0<a?r+a:r):a=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=a+o,e={id:gP++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,zp(Er,e),wa(Da)===null&&e===wa(Er)&&(Oi?(kx(Fi),Fi=-1):Oi=!0,Xp(Wp,a-r))):(e.sortIndex=o,zp(Da,e),Ro||Xu||(Ro=!0,Kp(Gp))),e};ve.unstable_shouldYield=Ax;ve.unstable_wrapCallback=function(e){var t=gt;return function(){var a=gt;gt=t;try{return e.apply(this,arguments)}finally{gt=a}}}});var Ex=Ze((iM,_x)=>{"use strict";_x.exports=Rx()});var Ow=Ze(Jt=>{"use strict";var yP=W(),Xt=Ex();function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Uv=new Set,nl={};function Ho(e,t){os(e,t),os(e+"Capture",t)}function os(e,t){for(nl[e]=t,e=0;e<t.length;e++)Uv.add(t[e])}var ir=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xm=Object.prototype.hasOwnProperty,xP=/^[: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]*$/,Dx={},Mx={};function vP(e){return xm.call(Mx,e)?!0:xm.call(Dx,e)?!1:xP.test(e)?Mx[e]=!0:(Dx[e]=!0,!1)}function wP(e,t,a,r){if(a!==null&&a.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:a!==null?!a.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function SP(e,t,a,r){if(t===null||typeof t>"u"||wP(e,t,a,r))return!0;if(r)return!1;if(a!==null)switch(a.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function At(e,t,a,r,o,n,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=n,this.removeEmptyString=s}var lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){lt[e]=new At(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];lt[t]=new At(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){lt[e]=new At(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){lt[e]=new At(e,2,!1,e,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(e){lt[e]=new At(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){lt[e]=new At(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){lt[e]=new At(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){lt[e]=new At(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){lt[e]=new At(e,5,!1,e.toLowerCase(),null,!1,!1)});var dh=/[\-:]([a-z])/g;function ch(e){return e[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(e){var t=e.replace(dh,ch);lt[t]=new At(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(dh,ch);lt[t]=new At(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(dh,ch);lt[t]=new At(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){lt[e]=new At(e,1,!1,e.toLowerCase(),null,!1,!1)});lt.xlinkHref=new At("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){lt[e]=new At(e,1,!1,e.toLowerCase(),null,!0,!0)});function fh(e,t,a,r){var o=lt.hasOwnProperty(t)?lt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(SP(t,a,o,r)&&(a=null),r||o===null?vP(t)&&(a===null?e.removeAttribute(t):e.setAttribute(t,""+a)):o.mustUseProperty?e[o.propertyName]=a===null?o.type===3?!1:"":a:(t=o.attributeName,r=o.attributeNamespace,a===null?e.removeAttribute(t):(o=o.type,a=o===3||o===4&&a===!0?"":""+a,r?e.setAttributeNS(r,t,a):e.setAttribute(t,a))))}var cr=yP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ju=Symbol.for("react.element"),Vn=Symbol.for("react.portal"),jn=Symbol.for("react.fragment"),ph=Symbol.for("react.strict_mode"),vm=Symbol.for("react.profiler"),Vv=Symbol.for("react.provider"),jv=Symbol.for("react.context"),mh=Symbol.for("react.forward_ref"),wm=Symbol.for("react.suspense"),Sm=Symbol.for("react.suspense_list"),hh=Symbol.for("react.memo"),Mr=Symbol.for("react.lazy"),qv=Symbol.for("react.offscreen"),Nx=Symbol.iterator;function Bi(e){return e===null||typeof e!="object"?null:(e=Nx&&e[Nx]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Qp;function Wi(e){if(Qp===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Qp=t&&t[1]||""}return`
|
|
2
|
+
`+Qp+e}var Jp=!1;function Yp(e,t){if(!e||Jp)return"";Jp=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
3
|
+
`),n=r.stack.split(`
|
|
4
4
|
`),s=o.length-1,i=n.length-1;1<=s&&0<=i&&o[s]!==n[i];)i--;for(;1<=s&&0<=i;s--,i--)if(o[s]!==n[i]){if(s!==1||i!==1)do if(s--,i--,0>i||o[s]!==n[i]){var l=`
|
|
5
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=i);break}}}finally{Hp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ji(e):""}function uP(e){switch(e.tag){case 5:return Ji(e.type);case 16:return Ji("Lazy");case 13:return Ji("Suspense");case 19:return Ji("SuspenseList");case 0:case 2:case 15:return e=zp(e.type,!1),e;case 11:return e=zp(e.type.render,!1),e;case 1:return e=zp(e.type,!0),e;default:return""}}function hm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Gn:return"Fragment";case Wn:return"Portal";case fm:return"Profiler";case sh:return"StrictMode";case pm:return"Suspense";case mm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ox:return(e.displayName||"Context")+".Consumer";case Mx:return(e._context.displayName||"Context")+".Provider";case ih:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case lh:return t=e.displayName||null,t!==null?t:hm(e.type)||"Memo";case $a:t=e._payload,e=e._init;try{return hm(e(t))}catch{}}return null}function cP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hm(t);case 8:return t===sh?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ao(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dP(e){var t=Fx(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,n=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){a=""+s,n.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return a},setValue:function(s){a=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ku(e){e._valueTracker||(e._valueTracker=dP(e))}function Ux(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),a="";return e&&(a=Fx(e)?e.checked?"true":"false":e.value),e=a,e!==r?(t.setValue(e),!0):!1}function Cc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function gm(e,t){var r=t.checked;return Oe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Rv(e,t){var r=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;r=ao(t.value!=null?t.value:r),e._wrapperState={initialChecked:a,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vx(e,t){t=t.checked,t!=null&&nh(e,"checked",t,!1)}function ym(e,t){Vx(e,t);var r=ao(t.value),a=t.type;if(r!=null)a==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vm(e,t.type,r):t.hasOwnProperty("defaultValue")&&vm(e,t.type,ao(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ev(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function vm(e,t,r){(t!=="number"||Cc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Qi=Array.isArray;function os(e,t,r,a){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&a&&(e[r].defaultSelected=!0)}else{for(r=""+ao(r),t=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,a&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function xm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(R(91));return Oe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Dv(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(R(92));if(Qi(r)){if(1<r.length)throw Error(R(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:ao(r)}}function jx(e,t){var r=ao(t.value),a=ao(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),a!=null&&(e.defaultValue=""+a)}function Nv(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function qx(e){switch(e){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 wm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?qx(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xu,$x=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,a,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,a,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Xu=Xu||document.createElement("div"),Xu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var el={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},fP=["Webkit","ms","Moz","O"];Object.keys(el).forEach(function(e){fP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),el[t]=el[e]})});function Hx(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||el.hasOwnProperty(e)&&el[e]?(""+t).trim():t+"px"}function zx(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var a=r.indexOf("--")===0,o=Hx(r,t[r],a);r==="float"&&(r="cssFloat"),a?e.setProperty(r,o):e[r]=o}}var pP=Oe({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 Sm(e,t){if(t){if(pP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(R(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(R(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(R(61))}if(t.style!=null&&typeof t.style!="object")throw Error(R(62))}}function Cm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 bm=null;function uh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lm=null,ns=null,ss=null;function Mv(e){if(e=Tl(e)){if(typeof Lm!="function")throw Error(R(280));var t=e.stateNode;t&&(t=Jc(t),Lm(e.stateNode,e.type,t))}}function Wx(e){ns?ss?ss.push(e):ss=[e]:ns=e}function Gx(){if(ns){var e=ns,t=ss;if(ss=ns=null,Mv(e),t)for(e=0;e<t.length;e++)Mv(t[e])}}function Kx(e,t){return e(t)}function Xx(){}var Wp=!1;function Jx(e,t,r){if(Wp)return e(t,r);Wp=!0;try{return Kx(e,t,r)}finally{Wp=!1,(ns!==null||ss!==null)&&(Xx(),Gx())}}function dl(e,t){var r=e.stateNode;if(r===null)return null;var a=Jc(r);if(a===null)return null;r=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(R(231,t,typeof r));return r}var Im=!1;if(ca)try{Hn={},Object.defineProperty(Hn,"passive",{get:function(){Im=!0}}),window.addEventListener("test",Hn,Hn),window.removeEventListener("test",Hn,Hn)}catch{Im=!1}var Hn;function mP(e,t,r,a,o,n,s,i,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(c){this.onError(c)}}var tl=!1,bc=null,Lc=!1,km=null,hP={onError:function(e){tl=!0,bc=e}};function gP(e,t,r,a,o,n,s,i,l){tl=!1,bc=null,mP.apply(hP,arguments)}function yP(e,t,r,a,o,n,s,i,l){if(gP.apply(this,arguments),tl){if(tl){var u=bc;tl=!1,bc=null}else throw Error(R(198));Lc||(Lc=!0,km=u)}}function en(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Qx(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ov(e){if(en(e)!==e)throw Error(R(188))}function vP(e){var t=e.alternate;if(!t){if(t=en(e),t===null)throw Error(R(188));return t!==e?null:e}for(var r=e,a=t;;){var o=r.return;if(o===null)break;var n=o.alternate;if(n===null){if(a=o.return,a!==null){r=a;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===r)return Ov(o),e;if(n===a)return Ov(o),t;n=n.sibling}throw Error(R(188))}if(r.return!==a.return)r=o,a=n;else{for(var s=!1,i=o.child;i;){if(i===r){s=!0,r=o,a=n;break}if(i===a){s=!0,a=o,r=n;break}i=i.sibling}if(!s){for(i=n.child;i;){if(i===r){s=!0,r=n,a=o;break}if(i===a){s=!0,a=n,r=o;break}i=i.sibling}if(!s)throw Error(R(189))}}if(r.alternate!==a)throw Error(R(190))}if(r.tag!==3)throw Error(R(188));return r.stateNode.current===r?e:t}function Yx(e){return e=vP(e),e!==null?Zx(e):null}function Zx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Zx(e);if(t!==null)return t;e=e.sibling}return null}var e0=Jt.unstable_scheduleCallback,Bv=Jt.unstable_cancelCallback,xP=Jt.unstable_shouldYield,wP=Jt.unstable_requestPaint,He=Jt.unstable_now,SP=Jt.unstable_getCurrentPriorityLevel,ch=Jt.unstable_ImmediatePriority,t0=Jt.unstable_UserBlockingPriority,Ic=Jt.unstable_NormalPriority,CP=Jt.unstable_LowPriority,r0=Jt.unstable_IdlePriority,Wc=null,Vr=null;function bP(e){if(Vr&&typeof Vr.onCommitFiberRoot=="function")try{Vr.onCommitFiberRoot(Wc,e,void 0,(e.current.flags&128)===128)}catch{}}var Tr=Math.clz32?Math.clz32:kP,LP=Math.log,IP=Math.LN2;function kP(e){return e>>>=0,e===0?32:31-(LP(e)/IP|0)|0}var Ju=64,Qu=4194304;function Yi(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kc(e,t){var r=e.pendingLanes;if(r===0)return 0;var a=0,o=e.suspendedLanes,n=e.pingedLanes,s=r&268435455;if(s!==0){var i=s&~o;i!==0?a=Yi(i):(n&=s,n!==0&&(a=Yi(n)))}else s=r&~o,s!==0?a=Yi(s):n!==0&&(a=Yi(n));if(a===0)return 0;if(t!==0&&t!==a&&(t&o)===0&&(o=a&-a,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((a&4)!==0&&(a|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0<t;)r=31-Tr(t),o=1<<r,a|=e[r],t&=~o;return a}function PP(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 TP(e,t){for(var r=e.suspendedLanes,a=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Tr(n),i=1<<s,l=o[s];l===-1?((i&r)===0||(i&a)!==0)&&(o[s]=PP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function Pm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function a0(){var e=Ju;return Ju<<=1,(Ju&4194240)===0&&(Ju=64),e}function Gp(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function kl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tr(t),e[t]=r}function _P(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-Tr(r),n=1<<o;t[o]=0,a[o]=-1,e[o]=-1,r&=~n}}function dh(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var a=31-Tr(r),o=1<<a;o&t|e[a]&t&&(e[a]|=t),r&=~o}}var ge=0;function o0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var n0,fh,s0,i0,l0,Tm=!1,Yu=[],Xa=null,Ja=null,Qa=null,fl=new Map,pl=new Map,za=[],AP="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 Fv(e,t){switch(e){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":Qa=null;break;case"pointerover":case"pointerout":fl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(t.pointerId)}}function $i(e,t,r,a,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:r,eventSystemFlags:a,nativeEvent:n,targetContainers:[o]},t!==null&&(t=Tl(t),t!==null&&fh(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function RP(e,t,r,a,o){switch(t){case"focusin":return Xa=$i(Xa,e,t,r,a,o),!0;case"dragenter":return Ja=$i(Ja,e,t,r,a,o),!0;case"mouseover":return Qa=$i(Qa,e,t,r,a,o),!0;case"pointerover":var n=o.pointerId;return fl.set(n,$i(fl.get(n)||null,e,t,r,a,o)),!0;case"gotpointercapture":return n=o.pointerId,pl.set(n,$i(pl.get(n)||null,e,t,r,a,o)),!0}return!1}function u0(e){var t=$o(e.target);if(t!==null){var r=en(t);if(r!==null){if(t=r.tag,t===13){if(t=Qx(r),t!==null){e.blockedOn=t,l0(e.priority,function(){s0(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=_m(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var a=new r.constructor(r.type,r);bm=a,r.target.dispatchEvent(a),bm=null}else return t=Tl(r),t!==null&&fh(t),e.blockedOn=r,!1;t.shift()}return!0}function Uv(e,t,r){fc(e)&&r.delete(t)}function EP(){Tm=!1,Xa!==null&&fc(Xa)&&(Xa=null),Ja!==null&&fc(Ja)&&(Ja=null),Qa!==null&&fc(Qa)&&(Qa=null),fl.forEach(Uv),pl.forEach(Uv)}function Hi(e,t){e.blockedOn===t&&(e.blockedOn=null,Tm||(Tm=!0,Jt.unstable_scheduleCallback(Jt.unstable_NormalPriority,EP)))}function ml(e){function t(o){return Hi(o,e)}if(0<Yu.length){Hi(Yu[0],e);for(var r=1;r<Yu.length;r++){var a=Yu[r];a.blockedOn===e&&(a.blockedOn=null)}}for(Xa!==null&&Hi(Xa,e),Ja!==null&&Hi(Ja,e),Qa!==null&&Hi(Qa,e),fl.forEach(t),pl.forEach(t),r=0;r<za.length;r++)a=za[r],a.blockedOn===e&&(a.blockedOn=null);for(;0<za.length&&(r=za[0],r.blockedOn===null);)u0(r),r.blockedOn===null&&za.shift()}var is=ma.ReactCurrentBatchConfig,Pc=!0;function DP(e,t,r,a){var o=ge,n=is.transition;is.transition=null;try{ge=1,ph(e,t,r,a)}finally{ge=o,is.transition=n}}function NP(e,t,r,a){var o=ge,n=is.transition;is.transition=null;try{ge=4,ph(e,t,r,a)}finally{ge=o,is.transition=n}}function ph(e,t,r,a){if(Pc){var o=_m(e,t,r,a);if(o===null)em(e,t,a,Tc,r),Fv(e,a);else if(RP(o,e,t,r,a))a.stopPropagation();else if(Fv(e,a),t&4&&-1<AP.indexOf(e)){for(;o!==null;){var n=Tl(o);if(n!==null&&n0(n),n=_m(e,t,r,a),n===null&&em(e,t,a,Tc,r),n===o)break;o=n}o!==null&&a.stopPropagation()}else em(e,t,a,null,r)}}var Tc=null;function _m(e,t,r,a){if(Tc=null,e=uh(a),e=$o(e),e!==null)if(t=en(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Qx(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Tc=e,null}function c0(e){switch(e){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(SP()){case ch:return 1;case t0:return 4;case Ic:case CP:return 16;case r0:return 536870912;default:return 16}default:return 16}}var Ga=null,mh=null,pc=null;function d0(){if(pc)return pc;var e,t=mh,r=t.length,a,o="value"in Ga?Ga.value:Ga.textContent,n=o.length;for(e=0;e<r&&t[e]===o[e];e++);var s=r-e;for(a=1;a<=s&&t[r-a]===o[n-a];a++);return pc=o.slice(e,1<a?1-a:void 0)}function mc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Zu(){return!0}function Vv(){return!1}function Qt(e){function t(r,a,o,n,s){this._reactName=r,this._targetInst=o,this.type=a,this.nativeEvent=n,this.target=s,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(r=e[i],this[i]=r?r(n):n[i]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Zu:Vv,this.isPropagationStopped=Vv,this}return Oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Zu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Zu)},persist:function(){},isPersistent:Zu}),t}var ys={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hh=Qt(ys),Pl=Oe({},ys,{view:0,detail:0}),MP=Qt(Pl),Kp,Xp,zi,Gc=Oe({},Pl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==zi&&(zi&&e.type==="mousemove"?(Kp=e.screenX-zi.screenX,Xp=e.screenY-zi.screenY):Xp=Kp=0,zi=e),Kp)},movementY:function(e){return"movementY"in e?e.movementY:Xp}}),jv=Qt(Gc),OP=Oe({},Gc,{dataTransfer:0}),BP=Qt(OP),FP=Oe({},Pl,{relatedTarget:0}),Jp=Qt(FP),UP=Oe({},ys,{animationName:0,elapsedTime:0,pseudoElement:0}),VP=Qt(UP),jP=Oe({},ys,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qP=Qt(jP),$P=Oe({},ys,{data:0}),qv=Qt($P),HP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zP={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"},WP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=WP[e])?!!t[e]:!1}function gh(){return GP}var KP=Oe({},Pl,{key:function(e){if(e.key){var t=HP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=mc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gh,charCode:function(e){return e.type==="keypress"?mc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?mc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),XP=Qt(KP),JP=Oe({},Gc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$v=Qt(JP),QP=Oe({},Pl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gh}),YP=Qt(QP),ZP=Oe({},ys,{propertyName:0,elapsedTime:0,pseudoElement:0}),eT=Qt(ZP),tT=Oe({},Gc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),rT=Qt(tT),aT=[9,13,27,32],yh=ca&&"CompositionEvent"in window,rl=null;ca&&"documentMode"in document&&(rl=document.documentMode);var oT=ca&&"TextEvent"in window&&!rl,f0=ca&&(!yh||rl&&8<rl&&11>=rl),Hv=" ",zv=!1;function p0(e,t){switch(e){case"keyup":return aT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kn=!1;function nT(e,t){switch(e){case"compositionend":return m0(t);case"keypress":return t.which!==32?null:(zv=!0,Hv);case"textInput":return e=t.data,e===Hv&&zv?null:e;default:return null}}function sT(e,t){if(Kn)return e==="compositionend"||!yh&&p0(e,t)?(e=d0(),pc=mh=Ga=null,Kn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return f0&&t.locale!=="ko"?null:t.data;default:return null}}var iT={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 Wv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iT[e.type]:t==="textarea"}function h0(e,t,r,a){Wx(a),t=_c(t,"onChange"),0<t.length&&(r=new hh("onChange","change",null,r,a),e.push({event:r,listeners:t}))}var al=null,hl=null;function lT(e){k0(e,0)}function Kc(e){var t=Qn(e);if(Ux(t))return e}function uT(e,t){if(e==="change")return t}var g0=!1;ca&&(ca?(tc="oninput"in document,tc||(Qp=document.createElement("div"),Qp.setAttribute("oninput","return;"),tc=typeof Qp.oninput=="function"),ec=tc):ec=!1,g0=ec&&(!document.documentMode||9<document.documentMode));var ec,tc,Qp;function Gv(){al&&(al.detachEvent("onpropertychange",y0),hl=al=null)}function y0(e){if(e.propertyName==="value"&&Kc(hl)){var t=[];h0(t,hl,e,uh(e)),Jx(lT,t)}}function cT(e,t,r){e==="focusin"?(Gv(),al=t,hl=r,al.attachEvent("onpropertychange",y0)):e==="focusout"&&Gv()}function dT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Kc(hl)}function fT(e,t){if(e==="click")return Kc(t)}function pT(e,t){if(e==="input"||e==="change")return Kc(t)}function mT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ar=typeof Object.is=="function"?Object.is:mT;function gl(e,t){if(Ar(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(a=0;a<r.length;a++){var o=r[a];if(!dm.call(t,o)||!Ar(e[o],t[o]))return!1}return!0}function Kv(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xv(e,t){var r=Kv(e);e=0;for(var a;r;){if(r.nodeType===3){if(a=e+r.textContent.length,e<=t&&a>=t)return{node:r,offset:t-e};e=a}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Kv(r)}}function v0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?v0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function x0(){for(var e=window,t=Cc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Cc(e.document)}return t}function vh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function hT(e){var t=x0(),r=e.focusedElem,a=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&v0(r.ownerDocument.documentElement,r)){if(a!==null&&vh(r)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,n=Math.min(a.start,o);a=a.end===void 0?n:Math.min(a.end,o),!e.extend&&n>a&&(o=a,a=n,n=o),o=Xv(r,n);var s=Xv(r,a);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>a?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var gT=ca&&"documentMode"in document&&11>=document.documentMode,Xn=null,Am=null,ol=null,Rm=!1;function Jv(e,t,r){var a=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Rm||Xn==null||Xn!==Cc(a)||(a=Xn,"selectionStart"in a&&vh(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ol&&gl(ol,a)||(ol=a,a=_c(Am,"onSelect"),0<a.length&&(t=new hh("onSelect","select",null,t,r),e.push({event:t,listeners:a}),t.target=Xn)))}function rc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Jn={animationend:rc("Animation","AnimationEnd"),animationiteration:rc("Animation","AnimationIteration"),animationstart:rc("Animation","AnimationStart"),transitionend:rc("Transition","TransitionEnd")},Yp={},w0={};ca&&(w0=document.createElement("div").style,"AnimationEvent"in window||(delete Jn.animationend.animation,delete Jn.animationiteration.animation,delete Jn.animationstart.animation),"TransitionEvent"in window||delete Jn.transitionend.transition);function Xc(e){if(Yp[e])return Yp[e];if(!Jn[e])return e;var t=Jn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in w0)return Yp[e]=t[r];return e}var S0=Xc("animationend"),C0=Xc("animationiteration"),b0=Xc("animationstart"),L0=Xc("transitionend"),I0=new Map,Qv="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 no(e,t){I0.set(e,t),Zo(t,[e])}for(ac=0;ac<Qv.length;ac++)oc=Qv[ac],Yv=oc.toLowerCase(),Zv=oc[0].toUpperCase()+oc.slice(1),no(Yv,"on"+Zv);var oc,Yv,Zv,ac;no(S0,"onAnimationEnd");no(C0,"onAnimationIteration");no(b0,"onAnimationStart");no("dblclick","onDoubleClick");no("focusin","onFocus");no("focusout","onBlur");no(L0,"onTransitionEnd");cs("onMouseEnter",["mouseout","mouseover"]);cs("onMouseLeave",["mouseout","mouseover"]);cs("onPointerEnter",["pointerout","pointerover"]);cs("onPointerLeave",["pointerout","pointerover"]);Zo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Zo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Zo("onBeforeInput",["compositionend","keypress","textInput","paste"]);Zo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Zo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Zo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zi="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(" "),yT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Zi));function ex(e,t,r){var a=e.type||"unknown-event";e.currentTarget=r,yP(a,t,void 0,e),e.currentTarget=null}function k0(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var a=e[r],o=a.event;a=a.listeners;e:{var n=void 0;if(t)for(var s=a.length-1;0<=s;s--){var i=a[s],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==n&&o.isPropagationStopped())break e;ex(o,i,u),n=l}else for(s=0;s<a.length;s++){if(i=a[s],l=i.instance,u=i.currentTarget,i=i.listener,l!==n&&o.isPropagationStopped())break e;ex(o,i,u),n=l}}}if(Lc)throw e=km,Lc=!1,km=null,e}function ke(e,t){var r=t[Om];r===void 0&&(r=t[Om]=new Set);var a=e+"__bubble";r.has(a)||(P0(t,e,2,!1),r.add(a))}function Zp(e,t,r){var a=0;t&&(a|=4),P0(r,e,a,t)}var nc="_reactListening"+Math.random().toString(36).slice(2);function yl(e){if(!e[nc]){e[nc]=!0,Nx.forEach(function(r){r!=="selectionchange"&&(yT.has(r)||Zp(r,!1,e),Zp(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nc]||(t[nc]=!0,Zp("selectionchange",!1,t))}}function P0(e,t,r,a){switch(c0(t)){case 1:var o=DP;break;case 4:o=NP;break;default:o=ph}r=o.bind(null,t,r,e),o=void 0,!Im||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),a?o!==void 0?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):o!==void 0?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function em(e,t,r,a,o){var n=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var s=a.tag;if(s===3||s===4){var i=a.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=a.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;i!==null;){if(s=$o(i),s===null)return;if(l=s.tag,l===5||l===6){a=n=s;continue e}i=i.parentNode}}a=a.return}Jx(function(){var u=n,c=uh(r),d=[];e:{var f=I0.get(e);if(f!==void 0){var m=hh,v=e;switch(e){case"keypress":if(mc(r)===0)break e;case"keydown":case"keyup":m=XP;break;case"focusin":v="focus",m=Jp;break;case"focusout":v="blur",m=Jp;break;case"beforeblur":case"afterblur":m=Jp;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=jv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=BP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=YP;break;case S0:case C0:case b0:m=VP;break;case L0:m=eT;break;case"scroll":m=MP;break;case"wheel":m=rT;break;case"copy":case"cut":case"paste":m=qP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=$v}var x=(t&4)!==0,b=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var h=u,y;h!==null;){y=h;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,g!==null&&(w=dl(h,g),w!=null&&x.push(vl(h,w,y)))),b)break;h=h.return}0<x.length&&(f=new m(f,v,null,r,c),d.push({event:f,listeners:x}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&r!==bm&&(v=r.relatedTarget||r.fromElement)&&($o(v)||v[da]))break e;if((m||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,m?(v=r.relatedTarget||r.toElement,m=u,v=v?$o(v):null,v!==null&&(b=en(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(x=jv,w="onMouseLeave",g="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(x=$v,w="onPointerLeave",g="onPointerEnter",h="pointer"),b=m==null?f:Qn(m),y=v==null?f:Qn(v),f=new x(w,h+"leave",m,r,c),f.target=b,f.relatedTarget=y,w=null,$o(c)===u&&(x=new x(g,h+"enter",v,r,c),x.target=y,x.relatedTarget=b,w=x),b=w,m&&v)t:{for(x=m,g=v,h=0,y=x;y;y=zn(y))h++;for(y=0,w=g;w;w=zn(w))y++;for(;0<h-y;)x=zn(x),h--;for(;0<y-h;)g=zn(g),y--;for(;h--;){if(x===g||g!==null&&x===g.alternate)break t;x=zn(x),g=zn(g)}x=null}else x=null;m!==null&&tx(d,f,m,x,!1),v!==null&&b!==null&&tx(d,b,v,x,!0)}}e:{if(f=u?Qn(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var L=uT;else if(Wv(f))if(g0)L=pT;else{L=dT;var P=cT}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(L=fT);if(L&&(L=L(e,u))){h0(d,L,r,c);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&vm(f,"number",f.value)}switch(P=u?Qn(u):window,e){case"focusin":(Wv(P)||P.contentEditable==="true")&&(Xn=P,Am=u,ol=null);break;case"focusout":ol=Am=Xn=null;break;case"mousedown":Rm=!0;break;case"contextmenu":case"mouseup":case"dragend":Rm=!1,Jv(d,r,c);break;case"selectionchange":if(gT)break;case"keydown":case"keyup":Jv(d,r,c)}var _;if(yh)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Kn?p0(e,r)&&(A="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(A="onCompositionStart");A&&(f0&&r.locale!=="ko"&&(Kn||A!=="onCompositionStart"?A==="onCompositionEnd"&&Kn&&(_=d0()):(Ga=c,mh="value"in Ga?Ga.value:Ga.textContent,Kn=!0)),P=_c(u,A),0<P.length&&(A=new qv(A,e,null,r,c),d.push({event:A,listeners:P}),_?A.data=_:(_=m0(r),_!==null&&(A.data=_)))),(_=oT?nT(e,r):sT(e,r))&&(u=_c(u,"onBeforeInput"),0<u.length&&(c=new qv("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=_))}k0(d,t)})}function vl(e,t,r){return{instance:e,listener:t,currentTarget:r}}function _c(e,t){for(var r=t+"Capture",a=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=dl(e,r),n!=null&&a.unshift(vl(e,n,o)),n=dl(e,t),n!=null&&a.push(vl(e,n,o))),e=e.return}return a}function zn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function tx(e,t,r,a,o){for(var n=t._reactName,s=[];r!==null&&r!==a;){var i=r,l=i.alternate,u=i.stateNode;if(l!==null&&l===a)break;i.tag===5&&u!==null&&(i=u,o?(l=dl(r,n),l!=null&&s.unshift(vl(r,l,i))):o||(l=dl(r,n),l!=null&&s.push(vl(r,l,i)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var vT=/\r\n?/g,xT=/\u0000|\uFFFD/g;function rx(e){return(typeof e=="string"?e:""+e).replace(vT,`
|
|
6
|
-
`).replace(xT,"")}function sc(e,t,r){if(t=rx(t),rx(e)!==t&&r)throw Error(R(425))}function Ac(){}var Em=null,Dm=null;function Nm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mm=typeof setTimeout=="function"?setTimeout:void 0,wT=typeof clearTimeout=="function"?clearTimeout:void 0,ax=typeof Promise=="function"?Promise:void 0,ST=typeof queueMicrotask=="function"?queueMicrotask:typeof ax<"u"?function(e){return ax.resolve(null).then(e).catch(CT)}:Mm;function CT(e){setTimeout(function(){throw e})}function tm(e,t){var r=t,a=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(a===0){e.removeChild(o),ml(t);return}a--}else r!=="$"&&r!=="$?"&&r!=="$!"||a++;r=o}while(r);ml(t)}function Ya(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ox(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var vs=Math.random().toString(36).slice(2),Ur="__reactFiber$"+vs,xl="__reactProps$"+vs,da="__reactContainer$"+vs,Om="__reactEvents$"+vs,bT="__reactListeners$"+vs,LT="__reactHandles$"+vs;function $o(e){var t=e[Ur];if(t)return t;for(var r=e.parentNode;r;){if(t=r[da]||r[Ur]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=ox(e);e!==null;){if(r=e[Ur])return r;e=ox(e)}return t}e=r,r=e.parentNode}return null}function Tl(e){return e=e[Ur]||e[da],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(R(33))}function Jc(e){return e[xl]||null}var Bm=[],Yn=-1;function so(e){return{current:e}}function Pe(e){0>Yn||(e.current=Bm[Yn],Bm[Yn]=null,Yn--)}function Ce(e,t){Yn++,Bm[Yn]=e.current,e.current=t}var oo={},bt=so(oo),Bt=so(!1),Ko=oo;function ds(e,t){var r=e.type.contextTypes;if(!r)return oo;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in r)o[n]=t[n];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ft(e){return e=e.childContextTypes,e!=null}function Rc(){Pe(Bt),Pe(bt)}function nx(e,t,r){if(bt.current!==oo)throw Error(R(168));Ce(bt,t),Ce(Bt,r)}function T0(e,t,r){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return r;a=a.getChildContext();for(var o in a)if(!(o in t))throw Error(R(108,cP(e)||"Unknown",o));return Oe({},r,a)}function Ec(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||oo,Ko=bt.current,Ce(bt,e),Ce(Bt,Bt.current),!0}function sx(e,t,r){var a=e.stateNode;if(!a)throw Error(R(169));r?(e=T0(e,t,Ko),a.__reactInternalMemoizedMergedChildContext=e,Pe(Bt),Pe(bt),Ce(bt,e)):Pe(Bt),Ce(Bt,r)}var sa=null,Qc=!1,rm=!1;function _0(e){sa===null?sa=[e]:sa.push(e)}function IT(e){Qc=!0,_0(e)}function io(){if(!rm&&sa!==null){rm=!0;var e=0,t=ge;try{var r=sa;for(ge=1;e<r.length;e++){var a=r[e];do a=a(!0);while(a!==null)}sa=null,Qc=!1}catch(o){throw sa!==null&&(sa=sa.slice(e+1)),e0(ch,io),o}finally{ge=t,rm=!1}}return null}var Zn=[],es=0,Dc=null,Nc=0,dr=[],fr=0,Xo=null,ia=1,la="";function jo(e,t){Zn[es++]=Nc,Zn[es++]=Dc,Dc=e,Nc=t}function A0(e,t,r){dr[fr++]=ia,dr[fr++]=la,dr[fr++]=Xo,Xo=e;var a=ia;e=la;var o=32-Tr(a)-1;a&=~(1<<o),r+=1;var n=32-Tr(t)+o;if(30<n){var s=o-o%5;n=(a&(1<<s)-1).toString(32),a>>=s,o-=s,ia=1<<32-Tr(t)+o|r<<o|a,la=n+e}else ia=1<<n|r<<o|a,la=e}function xh(e){e.return!==null&&(jo(e,1),A0(e,1,0))}function wh(e){for(;e===Dc;)Dc=Zn[--es],Zn[es]=null,Nc=Zn[--es],Zn[es]=null;for(;e===Xo;)Xo=dr[--fr],dr[fr]=null,la=dr[--fr],dr[fr]=null,ia=dr[--fr],dr[fr]=null}var Xt=null,Kt=null,Ee=!1,Pr=null;function R0(e,t){var r=pr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function ix(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Xt=e,Kt=Ya(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Xt=e,Kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Xo!==null?{id:ia,overflow:la}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=pr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Xt=e,Kt=null,!0):!1;default:return!1}}function Fm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Um(e){if(Ee){var t=Kt;if(t){var r=t;if(!ix(e,t)){if(Fm(e))throw Error(R(418));t=Ya(r.nextSibling);var a=Xt;t&&ix(e,t)?R0(a,r):(e.flags=e.flags&-4097|2,Ee=!1,Xt=e)}}else{if(Fm(e))throw Error(R(418));e.flags=e.flags&-4097|2,Ee=!1,Xt=e}}}function lx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Xt=e}function ic(e){if(e!==Xt)return!1;if(!Ee)return lx(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Nm(e.type,e.memoizedProps)),t&&(t=Kt)){if(Fm(e))throw E0(),Error(R(418));for(;t;)R0(e,t),t=Ya(t.nextSibling)}if(lx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Kt=Ya(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Kt=null}}else Kt=Xt?Ya(e.stateNode.nextSibling):null;return!0}function E0(){for(var e=Kt;e;)e=Ya(e.nextSibling)}function fs(){Kt=Xt=null,Ee=!1}function Sh(e){Pr===null?Pr=[e]:Pr.push(e)}var kT=ma.ReactCurrentBatchConfig;function Wi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(R(309));var a=r.stateNode}if(!a)throw Error(R(147,e));var o=a,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(R(284));if(!r._owner)throw Error(R(290,e))}return e}function lc(e,t){throw e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ux(e){var t=e._init;return t(e._payload)}function D0(e){function t(g,h){if(e){var y=g.deletions;y===null?(g.deletions=[h],g.flags|=16):y.push(h)}}function r(g,h){if(!e)return null;for(;h!==null;)t(g,h),h=h.sibling;return null}function a(g,h){for(g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function o(g,h){return g=ro(g,h),g.index=0,g.sibling=null,g}function n(g,h,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<h?(g.flags|=2,h):y):(g.flags|=2,h)):(g.flags|=1048576,h)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function i(g,h,y,w){return h===null||h.tag!==6?(h=um(y,g.mode,w),h.return=g,h):(h=o(h,y),h.return=g,h)}function l(g,h,y,w){var L=y.type;return L===Gn?c(g,h,y.props.children,w,y.key):h!==null&&(h.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===$a&&ux(L)===h.type)?(w=o(h,y.props),w.ref=Wi(g,h,y),w.return=g,w):(w=Sc(y.type,y.key,y.props,null,g.mode,w),w.ref=Wi(g,h,y),w.return=g,w)}function u(g,h,y,w){return h===null||h.tag!==4||h.stateNode.containerInfo!==y.containerInfo||h.stateNode.implementation!==y.implementation?(h=cm(y,g.mode,w),h.return=g,h):(h=o(h,y.children||[]),h.return=g,h)}function c(g,h,y,w,L){return h===null||h.tag!==7?(h=Go(y,g.mode,w,L),h.return=g,h):(h=o(h,y),h.return=g,h)}function d(g,h,y){if(typeof h=="string"&&h!==""||typeof h=="number")return h=um(""+h,g.mode,y),h.return=g,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Gu:return y=Sc(h.type,h.key,h.props,null,g.mode,y),y.ref=Wi(g,null,h),y.return=g,y;case Wn:return h=cm(h,g.mode,y),h.return=g,h;case $a:var w=h._init;return d(g,w(h._payload),y)}if(Qi(h)||qi(h))return h=Go(h,g.mode,y,null),h.return=g,h;lc(g,h)}return null}function f(g,h,y,w){var L=h!==null?h.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return L!==null?null:i(g,h,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Gu:return y.key===L?l(g,h,y,w):null;case Wn:return y.key===L?u(g,h,y,w):null;case $a:return L=y._init,f(g,h,L(y._payload),w)}if(Qi(y)||qi(y))return L!==null?null:c(g,h,y,w,null);lc(g,y)}return null}function m(g,h,y,w,L){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(y)||null,i(h,g,""+w,L);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Gu:return g=g.get(w.key===null?y:w.key)||null,l(h,g,w,L);case Wn:return g=g.get(w.key===null?y:w.key)||null,u(h,g,w,L);case $a:var P=w._init;return m(g,h,y,P(w._payload),L)}if(Qi(w)||qi(w))return g=g.get(y)||null,c(h,g,w,L,null);lc(h,w)}return null}function v(g,h,y,w){for(var L=null,P=null,_=h,A=h=0,F=null;_!==null&&A<y.length;A++){_.index>A?(F=_,_=null):F=_.sibling;var V=f(g,_,y[A],w);if(V===null){_===null&&(_=F);break}e&&_&&V.alternate===null&&t(g,_),h=n(V,h,A),P===null?L=V:P.sibling=V,P=V,_=F}if(A===y.length)return r(g,_),Ee&&jo(g,A),L;if(_===null){for(;A<y.length;A++)_=d(g,y[A],w),_!==null&&(h=n(_,h,A),P===null?L=_:P.sibling=_,P=_);return Ee&&jo(g,A),L}for(_=a(g,_);A<y.length;A++)F=m(_,g,A,y[A],w),F!==null&&(e&&F.alternate!==null&&_.delete(F.key===null?A:F.key),h=n(F,h,A),P===null?L=F:P.sibling=F,P=F);return e&&_.forEach(function(me){return t(g,me)}),Ee&&jo(g,A),L}function x(g,h,y,w){var L=qi(y);if(typeof L!="function")throw Error(R(150));if(y=L.call(y),y==null)throw Error(R(151));for(var P=L=null,_=h,A=h=0,F=null,V=y.next();_!==null&&!V.done;A++,V=y.next()){_.index>A?(F=_,_=null):F=_.sibling;var me=f(g,_,V.value,w);if(me===null){_===null&&(_=F);break}e&&_&&me.alternate===null&&t(g,_),h=n(me,h,A),P===null?L=me:P.sibling=me,P=me,_=F}if(V.done)return r(g,_),Ee&&jo(g,A),L;if(_===null){for(;!V.done;A++,V=y.next())V=d(g,V.value,w),V!==null&&(h=n(V,h,A),P===null?L=V:P.sibling=V,P=V);return Ee&&jo(g,A),L}for(_=a(g,_);!V.done;A++,V=y.next())V=m(_,g,A,V.value,w),V!==null&&(e&&V.alternate!==null&&_.delete(V.key===null?A:V.key),h=n(V,h,A),P===null?L=V:P.sibling=V,P=V);return e&&_.forEach(function(ce){return t(g,ce)}),Ee&&jo(g,A),L}function b(g,h,y,w){if(typeof y=="object"&&y!==null&&y.type===Gn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Gu:e:{for(var L=y.key,P=h;P!==null;){if(P.key===L){if(L=y.type,L===Gn){if(P.tag===7){r(g,P.sibling),h=o(P,y.props.children),h.return=g,g=h;break e}}else if(P.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===$a&&ux(L)===P.type){r(g,P.sibling),h=o(P,y.props),h.ref=Wi(g,P,y),h.return=g,g=h;break e}r(g,P);break}else t(g,P);P=P.sibling}y.type===Gn?(h=Go(y.props.children,g.mode,w,y.key),h.return=g,g=h):(w=Sc(y.type,y.key,y.props,null,g.mode,w),w.ref=Wi(g,h,y),w.return=g,g=w)}return s(g);case Wn:e:{for(P=y.key;h!==null;){if(h.key===P)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){r(g,h.sibling),h=o(h,y.children||[]),h.return=g,g=h;break e}else{r(g,h);break}else t(g,h);h=h.sibling}h=cm(y,g.mode,w),h.return=g,g=h}return s(g);case $a:return P=y._init,b(g,h,P(y._payload),w)}if(Qi(y))return v(g,h,y,w);if(qi(y))return x(g,h,y,w);lc(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,h!==null&&h.tag===6?(r(g,h.sibling),h=o(h,y),h.return=g,g=h):(r(g,h),h=um(y,g.mode,w),h.return=g,g=h),s(g)):r(g,h)}return b}var ps=D0(!0),N0=D0(!1),Mc=so(null),Oc=null,ts=null,Ch=null;function bh(){Ch=ts=Oc=null}function Lh(e){var t=Mc.current;Pe(Mc),e._currentValue=t}function Vm(e,t,r){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===r)break;e=e.return}}function ls(e,t){Oc=e,Ch=ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ot=!0),e.firstContext=null)}function hr(e){var t=e._currentValue;if(Ch!==e)if(e={context:e,memoizedValue:t,next:null},ts===null){if(Oc===null)throw Error(R(308));ts=e,Oc.dependencies={lanes:0,firstContext:e}}else ts=ts.next=e;return t}var Ho=null;function Ih(e){Ho===null?Ho=[e]:Ho.push(e)}function M0(e,t,r,a){var o=t.interleaved;return o===null?(r.next=r,Ih(t)):(r.next=o.next,o.next=r),t.interleaved=r,fa(e,a)}function fa(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ha=!1;function kh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function O0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Za(e,t,r){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ue&2)!==0){var o=a.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),a.pending=t,fa(e,r)}return o=a.interleaved,o===null?(t.next=t,Ih(a)):(t.next=o.next,o.next=t),a.interleaved=t,fa(e,r)}function hc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,dh(e,r)}}function cx(e,t){var r=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,r===a)){var o=null,n=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};n===null?o=n=s:n=n.next=s,r=r.next}while(r!==null);n===null?o=n=t:n=n.next=t}else o=n=t;r={baseState:a.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:a.shared,effects:a.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Bc(e,t,r,a){var o=e.updateQueue;Ha=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,i=c.lastBaseUpdate,i!==s&&(i===null?c.firstBaseUpdate=u:i.next=u,c.lastBaseUpdate=l))}if(n!==null){var d=o.baseState;s=0,c=u=l=null,i=n;do{var f=i.lane,m=i.eventTime;if((a&f)===f){c!==null&&(c=c.next={eventTime:m,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var v=e,x=i;switch(f=t,m=r,x.tag){case 1:if(v=x.payload,typeof v=="function"){d=v.call(m,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,f=typeof v=="function"?v.call(m,d,f):v,f==null)break e;d=Oe({},d,f);break e;case 2:Ha=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else m={eventTime:m,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);Qo|=s,e.lanes=s,e.memoizedState=d}}function dx(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var a=e[t],o=a.callback;if(o!==null){if(a.callback=null,a=r,typeof o!="function")throw Error(R(191,o));o.call(a)}}}var _l={},jr=so(_l),wl=so(_l),Sl=so(_l);function zo(e){if(e===_l)throw Error(R(174));return e}function Ph(e,t){switch(Ce(Sl,t),Ce(wl,e),Ce(jr,_l),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:wm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=wm(t,e)}Pe(jr),Ce(jr,t)}function ms(){Pe(jr),Pe(wl),Pe(Sl)}function B0(e){zo(Sl.current);var t=zo(jr.current),r=wm(t,e.type);t!==r&&(Ce(wl,e),Ce(jr,r))}function Th(e){wl.current===e&&(Pe(jr),Pe(wl))}var Ne=so(0);function Fc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var am=[];function _h(){for(var e=0;e<am.length;e++)am[e]._workInProgressVersionPrimary=null;am.length=0}var gc=ma.ReactCurrentDispatcher,om=ma.ReactCurrentBatchConfig,Jo=0,Me=null,Ye=null,ot=null,Uc=!1,nl=!1,Cl=0,PT=0;function wt(){throw Error(R(321))}function Ah(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ar(e[r],t[r]))return!1;return!0}function Rh(e,t,r,a,o,n){if(Jo=n,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gc.current=e===null||e.memoizedState===null?RT:ET,e=r(a,o),nl){n=0;do{if(nl=!1,Cl=0,25<=n)throw Error(R(301));n+=1,ot=Ye=null,t.updateQueue=null,gc.current=DT,e=r(a,o)}while(nl)}if(gc.current=Vc,t=Ye!==null&&Ye.next!==null,Jo=0,ot=Ye=Me=null,Uc=!1,t)throw Error(R(300));return e}function Eh(){var e=Cl!==0;return Cl=0,e}function Fr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ot===null?Me.memoizedState=ot=e:ot=ot.next=e,ot}function gr(){if(Ye===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=ot===null?Me.memoizedState:ot.next;if(t!==null)ot=t,Ye=e;else{if(e===null)throw Error(R(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},ot===null?Me.memoizedState=ot=e:ot=ot.next=e}return ot}function bl(e,t){return typeof t=="function"?t(e):t}function nm(e){var t=gr(),r=t.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=e;var a=Ye,o=a.baseQueue,n=r.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}a.baseQueue=o=n,r.pending=null}if(o!==null){n=o.next,a=a.baseState;var i=s=null,l=null,u=n;do{var c=u.lane;if((Jo&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),a=u.hasEagerState?u.eagerState:e(a,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=d,s=a):l=l.next=d,Me.lanes|=c,Qo|=c}u=u.next}while(u!==null&&u!==n);l===null?s=a:l.next=i,Ar(a,t.memoizedState)||(Ot=!0),t.memoizedState=a,t.baseState=s,t.baseQueue=l,r.lastRenderedState=a}if(e=r.interleaved,e!==null){o=e;do n=o.lane,Me.lanes|=n,Qo|=n,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function sm(e){var t=gr(),r=t.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=e;var a=r.dispatch,o=r.pending,n=t.memoizedState;if(o!==null){r.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);Ar(n,t.memoizedState)||(Ot=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),r.lastRenderedState=n}return[n,a]}function F0(){}function U0(e,t){var r=Me,a=gr(),o=t(),n=!Ar(a.memoizedState,o);if(n&&(a.memoizedState=o,Ot=!0),a=a.queue,Dh(q0.bind(null,r,a,e),[e]),a.getSnapshot!==t||n||ot!==null&&ot.memoizedState.tag&1){if(r.flags|=2048,Ll(9,j0.bind(null,r,a,o,t),void 0,null),nt===null)throw Error(R(349));(Jo&30)!==0||V0(r,t,o)}return o}function V0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function j0(e,t,r,a){t.value=r,t.getSnapshot=a,$0(t)&&H0(e)}function q0(e,t,r){return r(function(){$0(t)&&H0(e)})}function $0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ar(e,r)}catch{return!0}}function H0(e){var t=fa(e,1);t!==null&&_r(t,e,1,-1)}function fx(e){var t=Fr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bl,lastRenderedState:e},t.queue=e,e=e.dispatch=AT.bind(null,Me,e),[t.memoizedState,e]}function Ll(e,t,r,a){return e={tag:e,create:t,destroy:r,deps:a,next:null},t=Me.updateQueue,t===null?(t={lastEffect:null,stores:null},Me.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(a=r.next,r.next=e,e.next=a,t.lastEffect=e)),e}function z0(){return gr().memoizedState}function yc(e,t,r,a){var o=Fr();Me.flags|=e,o.memoizedState=Ll(1|t,r,void 0,a===void 0?null:a)}function Yc(e,t,r,a){var o=gr();a=a===void 0?null:a;var n=void 0;if(Ye!==null){var s=Ye.memoizedState;if(n=s.destroy,a!==null&&Ah(a,s.deps)){o.memoizedState=Ll(t,r,n,a);return}}Me.flags|=e,o.memoizedState=Ll(1|t,r,n,a)}function px(e,t){return yc(8390656,8,e,t)}function Dh(e,t){return Yc(2048,8,e,t)}function W0(e,t){return Yc(4,2,e,t)}function G0(e,t){return Yc(4,4,e,t)}function K0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function X0(e,t,r){return r=r!=null?r.concat([e]):null,Yc(4,4,K0.bind(null,t,e),r)}function Nh(){}function J0(e,t){var r=gr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&Ah(t,a[1])?a[0]:(r.memoizedState=[e,t],e)}function Q0(e,t){var r=gr();t=t===void 0?null:t;var a=r.memoizedState;return a!==null&&t!==null&&Ah(t,a[1])?a[0]:(e=e(),r.memoizedState=[e,t],e)}function Y0(e,t,r){return(Jo&21)===0?(e.baseState&&(e.baseState=!1,Ot=!0),e.memoizedState=r):(Ar(r,t)||(r=a0(),Me.lanes|=r,Qo|=r,e.baseState=!0),t)}function TT(e,t){var r=ge;ge=r!==0&&4>r?r:4,e(!0);var a=om.transition;om.transition={};try{e(!1),t()}finally{ge=r,om.transition=a}}function Z0(){return gr().memoizedState}function _T(e,t,r){var a=to(e);if(r={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null},ew(e))tw(t,r);else if(r=M0(e,t,r,a),r!==null){var o=_t();_r(r,e,a,o),rw(r,t,a)}}function AT(e,t,r){var a=to(e),o={lane:a,action:r,hasEagerState:!1,eagerState:null,next:null};if(ew(e))tw(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,r);if(o.hasEagerState=!0,o.eagerState=i,Ar(i,s)){var l=t.interleaved;l===null?(o.next=o,Ih(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}r=M0(e,t,o,a),r!==null&&(o=_t(),_r(r,e,a,o),rw(r,t,a))}}function ew(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function tw(e,t){nl=Uc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function rw(e,t,r){if((r&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,r|=a,t.lanes=r,dh(e,r)}}var Vc={readContext:hr,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useInsertionEffect:wt,useLayoutEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useMutableSource:wt,useSyncExternalStore:wt,useId:wt,unstable_isNewReconciler:!1},RT={readContext:hr,useCallback:function(e,t){return Fr().memoizedState=[e,t===void 0?null:t],e},useContext:hr,useEffect:px,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yc(4194308,4,K0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yc(4194308,4,e,t)},useInsertionEffect:function(e,t){return yc(4,2,e,t)},useMemo:function(e,t){var r=Fr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var a=Fr();return t=r!==void 0?r(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=_T.bind(null,Me,e),[a.memoizedState,e]},useRef:function(e){var t=Fr();return e={current:e},t.memoizedState=e},useState:fx,useDebugValue:Nh,useDeferredValue:function(e){return Fr().memoizedState=e},useTransition:function(){var e=fx(!1),t=e[0];return e=TT.bind(null,e[1]),Fr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var a=Me,o=Fr();if(Ee){if(r===void 0)throw Error(R(407));r=r()}else{if(r=t(),nt===null)throw Error(R(349));(Jo&30)!==0||V0(a,t,r)}o.memoizedState=r;var n={value:r,getSnapshot:t};return o.queue=n,px(q0.bind(null,a,n,e),[e]),a.flags|=2048,Ll(9,j0.bind(null,a,n,r,t),void 0,null),r},useId:function(){var e=Fr(),t=nt.identifierPrefix;if(Ee){var r=la,a=ia;r=(a&~(1<<32-Tr(a)-1)).toString(32)+r,t=":"+t+"R"+r,r=Cl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=PT++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ET={readContext:hr,useCallback:J0,useContext:hr,useEffect:Dh,useImperativeHandle:X0,useInsertionEffect:W0,useLayoutEffect:G0,useMemo:Q0,useReducer:nm,useRef:z0,useState:function(){return nm(bl)},useDebugValue:Nh,useDeferredValue:function(e){var t=gr();return Y0(t,Ye.memoizedState,e)},useTransition:function(){var e=nm(bl)[0],t=gr().memoizedState;return[e,t]},useMutableSource:F0,useSyncExternalStore:U0,useId:Z0,unstable_isNewReconciler:!1},DT={readContext:hr,useCallback:J0,useContext:hr,useEffect:Dh,useImperativeHandle:X0,useInsertionEffect:W0,useLayoutEffect:G0,useMemo:Q0,useReducer:sm,useRef:z0,useState:function(){return sm(bl)},useDebugValue:Nh,useDeferredValue:function(e){var t=gr();return Ye===null?t.memoizedState=e:Y0(t,Ye.memoizedState,e)},useTransition:function(){var e=sm(bl)[0],t=gr().memoizedState;return[e,t]},useMutableSource:F0,useSyncExternalStore:U0,useId:Z0,unstable_isNewReconciler:!1};function Ir(e,t){if(e&&e.defaultProps){t=Oe({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function jm(e,t,r,a){t=e.memoizedState,r=r(a,t),r=r==null?t:Oe({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Zc={isMounted:function(e){return(e=e._reactInternals)?en(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var a=_t(),o=to(e),n=ua(a,o);n.payload=t,r!=null&&(n.callback=r),t=Za(e,n,o),t!==null&&(_r(t,e,o,a),hc(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var a=_t(),o=to(e),n=ua(a,o);n.tag=1,n.payload=t,r!=null&&(n.callback=r),t=Za(e,n,o),t!==null&&(_r(t,e,o,a),hc(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=_t(),a=to(e),o=ua(r,a);o.tag=2,t!=null&&(o.callback=t),t=Za(e,o,a),t!==null&&(_r(t,e,a,r),hc(t,e,a))}};function mx(e,t,r,a,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,n,s):t.prototype&&t.prototype.isPureReactComponent?!gl(r,a)||!gl(o,n):!0}function aw(e,t,r){var a=!1,o=oo,n=t.contextType;return typeof n=="object"&&n!==null?n=hr(n):(o=Ft(t)?Ko:bt.current,a=t.contextTypes,n=(a=a!=null)?ds(e,o):oo),t=new t(r,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zc,e.stateNode=t,t._reactInternals=e,a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function hx(e,t,r,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,a),t.state!==e&&Zc.enqueueReplaceState(t,t.state,null)}function qm(e,t,r,a){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs={},kh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=hr(n):(n=Ft(t)?Ko:bt.current,o.context=ds(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(jm(e,t,n,r),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Zc.enqueueReplaceState(o,o.state,null),Bc(e,r,o,a),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function hs(e,t){try{var r="",a=t;do r+=uP(a),a=a.return;while(a);var o=r}catch(n){o=`
|
|
5
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=i);break}}}finally{Jp=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Wi(e):""}function CP(e){switch(e.tag){case 5:return Wi(e.type);case 16:return Wi("Lazy");case 13:return Wi("Suspense");case 19:return Wi("SuspenseList");case 0:case 2:case 15:return e=Yp(e.type,!1),e;case 11:return e=Yp(e.type.render,!1),e;case 1:return e=Yp(e.type,!0),e;default:return""}}function Cm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case jn:return"Fragment";case Vn:return"Portal";case vm:return"Profiler";case ph:return"StrictMode";case wm:return"Suspense";case Sm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jv:return(e.displayName||"Context")+".Consumer";case Vv:return(e._context.displayName||"Context")+".Provider";case mh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hh:return t=e.displayName||null,t!==null?t:Cm(e.type)||"Memo";case Mr:t=e._payload,e=e._init;try{return Cm(e(t))}catch{}}return null}function LP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Cm(t);case 8:return t===ph?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Hv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bP(e){var t=Hv(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var o=a.get,n=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,n.call(this,s)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yu(e){e._valueTracker||(e._valueTracker=bP(e))}function zv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=Hv(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function kd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Lm(e,t){var a=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Ox(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Kr(t.value!=null?t.value:a),e._wrapperState={initialChecked:r,initialValue:a,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function $v(e,t){t=t.checked,t!=null&&fh(e,"checked",t,!1)}function bm(e,t){$v(e,t);var a=Kr(t.value),r=t.type;if(a!=null)r==="number"?(a===0&&e.value===""||e.value!=a)&&(e.value=""+a):e.value!==""+a&&(e.value=""+a);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Im(e,t.type,a):t.hasOwnProperty("defaultValue")&&Im(e,t.type,Kr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Fx(e,t,a){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,a||t===e.value||(e.value=t),e.defaultValue=t}a=e.name,a!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,a!==""&&(e.name=a)}function Im(e,t,a){(t!=="number"||kd(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Gi=Array.isArray;function Yn(e,t,a,r){if(e=e.options,t){t={};for(var o=0;o<a.length;o++)t["$"+a[o]]=!0;for(a=0;a<e.length;a++)o=t.hasOwnProperty("$"+e[a].value),e[a].selected!==o&&(e[a].selected=o),o&&r&&(e[a].defaultSelected=!0)}else{for(a=""+Kr(a),t=null,o=0;o<e.length;o++){if(e[o].value===a){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function km(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Bx(e,t){var a=t.value;if(a==null){if(a=t.children,t=t.defaultValue,a!=null){if(t!=null)throw Error(_(92));if(Gi(a)){if(1<a.length)throw Error(_(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Kr(a)}}function Wv(e,t){var a=Kr(t.value),r=Kr(t.defaultValue);a!=null&&(a=""+a,a!==e.value&&(e.value=a),t.defaultValue==null&&e.defaultValue!==a&&(e.defaultValue=a)),r!=null&&(e.defaultValue=""+r)}function Ux(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Gv(e){switch(e){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 Pm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Gv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zu,Kv=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,a,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,a,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Zu=Zu||document.createElement("div"),Zu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Qi={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},IP=["Webkit","ms","Moz","O"];Object.keys(Qi).forEach(function(e){IP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qi[t]=Qi[e]})});function Xv(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||Qi.hasOwnProperty(e)&&Qi[e]?(""+t).trim():t+"px"}function Qv(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Xv(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var kP=Ee({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 Tm(e,t){if(t){if(kP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function Am(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Rm=null;function gh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _m=null,Zn=null,es=null;function Vx(e){if(e=bl(e)){if(typeof _m!="function")throw Error(_(280));var t=e.stateNode;t&&(t=ec(t),_m(e.stateNode,e.type,t))}}function Jv(e){Zn?es?es.push(e):es=[e]:Zn=e}function Yv(){if(Zn){var e=Zn,t=es;if(es=Zn=null,Vx(e),t)for(e=0;e<t.length;e++)Vx(t[e])}}function Zv(e,t){return e(t)}function e0(){}var Zp=!1;function t0(e,t,a){if(Zp)return e(t,a);Zp=!0;try{return Zv(e,t,a)}finally{Zp=!1,(Zn!==null||es!==null)&&(e0(),Yv())}}function il(e,t){var a=e.stateNode;if(a===null)return null;var r=ec(a);if(r===null)return null;a=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(_(231,t,typeof a));return a}var Em=!1;if(ir)try{Bn={},Object.defineProperty(Bn,"passive",{get:function(){Em=!0}}),window.addEventListener("test",Bn,Bn),window.removeEventListener("test",Bn,Bn)}catch{Em=!1}var Bn;function PP(e,t,a,r,o,n,s,i,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(a,u)}catch(d){this.onError(d)}}var Ji=!1,Pd=null,Td=!1,Dm=null,TP={onError:function(e){Ji=!0,Pd=e}};function AP(e,t,a,r,o,n,s,i,l){Ji=!1,Pd=null,PP.apply(TP,arguments)}function RP(e,t,a,r,o,n,s,i,l){if(AP.apply(this,arguments),Ji){if(Ji){var u=Pd;Ji=!1,Pd=null}else throw Error(_(198));Td||(Td=!0,Dm=u)}}function zo(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function a0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function jx(e){if(zo(e)!==e)throw Error(_(188))}function _P(e){var t=e.alternate;if(!t){if(t=zo(e),t===null)throw Error(_(188));return t!==e?null:e}for(var a=e,r=t;;){var o=a.return;if(o===null)break;var n=o.alternate;if(n===null){if(r=o.return,r!==null){a=r;continue}break}if(o.child===n.child){for(n=o.child;n;){if(n===a)return jx(o),e;if(n===r)return jx(o),t;n=n.sibling}throw Error(_(188))}if(a.return!==r.return)a=o,r=n;else{for(var s=!1,i=o.child;i;){if(i===a){s=!0,a=o,r=n;break}if(i===r){s=!0,r=o,a=n;break}i=i.sibling}if(!s){for(i=n.child;i;){if(i===a){s=!0,a=n,r=o;break}if(i===r){s=!0,r=n,a=o;break}i=i.sibling}if(!s)throw Error(_(189))}}if(a.alternate!==r)throw Error(_(190))}if(a.tag!==3)throw Error(_(188));return a.stateNode.current===a?e:t}function r0(e){return e=_P(e),e!==null?o0(e):null}function o0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=o0(e);if(t!==null)return t;e=e.sibling}return null}var n0=Xt.unstable_scheduleCallback,qx=Xt.unstable_cancelCallback,EP=Xt.unstable_shouldYield,DP=Xt.unstable_requestPaint,Be=Xt.unstable_now,MP=Xt.unstable_getCurrentPriorityLevel,yh=Xt.unstable_ImmediatePriority,s0=Xt.unstable_UserBlockingPriority,Ad=Xt.unstable_NormalPriority,NP=Xt.unstable_LowPriority,i0=Xt.unstable_IdlePriority,Qd=null,Fa=null;function OP(e){if(Fa&&typeof Fa.onCommitFiberRoot=="function")try{Fa.onCommitFiberRoot(Qd,e,void 0,(e.current.flags&128)===128)}catch{}}var Ia=Math.clz32?Math.clz32:UP,FP=Math.log,BP=Math.LN2;function UP(e){return e>>>=0,e===0?32:31-(FP(e)/BP|0)|0}var ed=64,td=4194304;function Ki(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rd(e,t){var a=e.pendingLanes;if(a===0)return 0;var r=0,o=e.suspendedLanes,n=e.pingedLanes,s=a&268435455;if(s!==0){var i=s&~o;i!==0?r=Ki(i):(n&=s,n!==0&&(r=Ki(n)))}else s=a&~o,s!==0?r=Ki(s):n!==0&&(r=Ki(n));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,n=t&-t,o>=n||o===16&&(n&4194240)!==0))return t;if((r&4)!==0&&(r|=a&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)a=31-Ia(t),o=1<<a,r|=e[a],t&=~o;return r}function VP(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 jP(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-Ia(n),i=1<<s,l=o[s];l===-1?((i&a)===0||(i&r)!==0)&&(o[s]=VP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function Mm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function l0(){var e=ed;return ed<<=1,(ed&4194240)===0&&(ed=64),e}function em(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Cl(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ia(t),e[t]=a}function qP(e,t){var a=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<a;){var o=31-Ia(a),n=1<<o;t[o]=0,r[o]=-1,e[o]=-1,a&=~n}}function xh(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var r=31-Ia(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var he=0;function u0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var d0,vh,c0,f0,p0,Nm=!1,ad=[],Vr=null,jr=null,qr=null,ll=new Map,ul=new Map,Or=[],HP="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 Hx(e,t){switch(e){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":qr=null;break;case"pointerover":case"pointerout":ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ul.delete(t.pointerId)}}function Ui(e,t,a,r,o,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:a,eventSystemFlags:r,nativeEvent:n,targetContainers:[o]},t!==null&&(t=bl(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function zP(e,t,a,r,o){switch(t){case"focusin":return Vr=Ui(Vr,e,t,a,r,o),!0;case"dragenter":return jr=Ui(jr,e,t,a,r,o),!0;case"mouseover":return qr=Ui(qr,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return ll.set(n,Ui(ll.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,ul.set(n,Ui(ul.get(n)||null,e,t,a,r,o)),!0}return!1}function m0(e){var t=Do(e.target);if(t!==null){var a=zo(t);if(a!==null){if(t=a.tag,t===13){if(t=a0(a),t!==null){e.blockedOn=t,p0(e.priority,function(){c0(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Om(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Rm=r,a.target.dispatchEvent(r),Rm=null}else return t=bl(a),t!==null&&vh(t),e.blockedOn=a,!1;t.shift()}return!0}function zx(e,t,a){gd(e)&&a.delete(t)}function $P(){Nm=!1,Vr!==null&&gd(Vr)&&(Vr=null),jr!==null&&gd(jr)&&(jr=null),qr!==null&&gd(qr)&&(qr=null),ll.forEach(zx),ul.forEach(zx)}function Vi(e,t){e.blockedOn===t&&(e.blockedOn=null,Nm||(Nm=!0,Xt.unstable_scheduleCallback(Xt.unstable_NormalPriority,$P)))}function dl(e){function t(o){return Vi(o,e)}if(0<ad.length){Vi(ad[0],e);for(var a=1;a<ad.length;a++){var r=ad[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Vr!==null&&Vi(Vr,e),jr!==null&&Vi(jr,e),qr!==null&&Vi(qr,e),ll.forEach(t),ul.forEach(t),a=0;a<Or.length;a++)r=Or[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<Or.length&&(a=Or[0],a.blockedOn===null);)m0(a),a.blockedOn===null&&Or.shift()}var ts=cr.ReactCurrentBatchConfig,_d=!0;function WP(e,t,a,r){var o=he,n=ts.transition;ts.transition=null;try{he=1,wh(e,t,a,r)}finally{he=o,ts.transition=n}}function GP(e,t,a,r){var o=he,n=ts.transition;ts.transition=null;try{he=4,wh(e,t,a,r)}finally{he=o,ts.transition=n}}function wh(e,t,a,r){if(_d){var o=Om(e,t,a,r);if(o===null)im(e,t,r,Ed,a),Hx(e,r);else if(zP(o,e,t,a,r))r.stopPropagation();else if(Hx(e,r),t&4&&-1<HP.indexOf(e)){for(;o!==null;){var n=bl(o);if(n!==null&&d0(n),n=Om(e,t,a,r),n===null&&im(e,t,r,Ed,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else im(e,t,r,null,a)}}var Ed=null;function Om(e,t,a,r){if(Ed=null,e=gh(r),e=Do(e),e!==null)if(t=zo(e),t===null)e=null;else if(a=t.tag,a===13){if(e=a0(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ed=e,null}function h0(e){switch(e){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(MP()){case yh:return 1;case s0:return 4;case Ad:case NP:return 16;case i0:return 536870912;default:return 16}default:return 16}}var Br=null,Sh=null,yd=null;function g0(){if(yd)return yd;var e,t=Sh,a=t.length,r,o="value"in Br?Br.value:Br.textContent,n=o.length;for(e=0;e<a&&t[e]===o[e];e++);var s=a-e;for(r=1;r<=s&&t[a-r]===o[n-r];r++);return yd=o.slice(e,1<r?1-r:void 0)}function xd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function rd(){return!0}function $x(){return!1}function Qt(e){function t(a,r,o,n,s){this._reactName=a,this._targetInst=o,this.type=r,this.nativeEvent=n,this.target=s,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(a=e[i],this[i]=a?a(n):n[i]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?rd:$x,this.isPropagationStopped=$x,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=rd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=rd)},persist:function(){},isPersistent:rd}),t}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ch=Qt(cs),Ll=Ee({},cs,{view:0,detail:0}),KP=Qt(Ll),tm,am,ji,Jd=Ee({},Ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Lh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ji&&(ji&&e.type==="mousemove"?(tm=e.screenX-ji.screenX,am=e.screenY-ji.screenY):am=tm=0,ji=e),tm)},movementY:function(e){return"movementY"in e?e.movementY:am}}),Wx=Qt(Jd),XP=Ee({},Jd,{dataTransfer:0}),QP=Qt(XP),JP=Ee({},Ll,{relatedTarget:0}),rm=Qt(JP),YP=Ee({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),ZP=Qt(YP),eT=Ee({},cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tT=Qt(eT),aT=Ee({},cs,{data:0}),Gx=Qt(aT),rT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oT={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"},nT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nT[e])?!!t[e]:!1}function Lh(){return sT}var iT=Ee({},Ll,{key:function(e){if(e.key){var t=rT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Lh,charCode:function(e){return e.type==="keypress"?xd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lT=Qt(iT),uT=Ee({},Jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kx=Qt(uT),dT=Ee({},Ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lh}),cT=Qt(dT),fT=Ee({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),pT=Qt(fT),mT=Ee({},Jd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hT=Qt(mT),gT=[9,13,27,32],bh=ir&&"CompositionEvent"in window,Yi=null;ir&&"documentMode"in document&&(Yi=document.documentMode);var yT=ir&&"TextEvent"in window&&!Yi,y0=ir&&(!bh||Yi&&8<Yi&&11>=Yi),Xx=" ",Qx=!1;function x0(e,t){switch(e){case"keyup":return gT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function v0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qn=!1;function xT(e,t){switch(e){case"compositionend":return v0(t);case"keypress":return t.which!==32?null:(Qx=!0,Xx);case"textInput":return e=t.data,e===Xx&&Qx?null:e;default:return null}}function vT(e,t){if(qn)return e==="compositionend"||!bh&&x0(e,t)?(e=g0(),yd=Sh=Br=null,qn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return y0&&t.locale!=="ko"?null:t.data;default:return null}}var wT={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 Jx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wT[e.type]:t==="textarea"}function w0(e,t,a,r){Jv(r),t=Dd(t,"onChange"),0<t.length&&(a=new Ch("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Zi=null,cl=null;function ST(e){_0(e,0)}function Yd(e){var t=$n(e);if(zv(t))return e}function CT(e,t){if(e==="change")return t}var S0=!1;ir&&(ir?(nd="oninput"in document,nd||(om=document.createElement("div"),om.setAttribute("oninput","return;"),nd=typeof om.oninput=="function"),od=nd):od=!1,S0=od&&(!document.documentMode||9<document.documentMode));var od,nd,om;function Yx(){Zi&&(Zi.detachEvent("onpropertychange",C0),cl=Zi=null)}function C0(e){if(e.propertyName==="value"&&Yd(cl)){var t=[];w0(t,cl,e,gh(e)),t0(ST,t)}}function LT(e,t,a){e==="focusin"?(Yx(),Zi=t,cl=a,Zi.attachEvent("onpropertychange",C0)):e==="focusout"&&Yx()}function bT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yd(cl)}function IT(e,t){if(e==="click")return Yd(t)}function kT(e,t){if(e==="input"||e==="change")return Yd(t)}function PT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pa=typeof Object.is=="function"?Object.is:PT;function fl(e,t){if(Pa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),r=Object.keys(t);if(a.length!==r.length)return!1;for(r=0;r<a.length;r++){var o=a[r];if(!xm.call(t,o)||!Pa(e[o],t[o]))return!1}return!0}function Zx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ev(e,t){var a=Zx(e);e=0;for(var r;a;){if(a.nodeType===3){if(r=e+a.textContent.length,e<=t&&r>=t)return{node:a,offset:t-e};e=r}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Zx(a)}}function L0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?L0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function b0(){for(var e=window,t=kd();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=kd(e.document)}return t}function Ih(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function TT(e){var t=b0(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&L0(a.ownerDocument.documentElement,a)){if(r!==null&&Ih(a)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in a)a.selectionStart=t,a.selectionEnd=Math.min(e,a.value.length);else if(e=(t=a.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=a.textContent.length,n=Math.min(r.start,o);r=r.end===void 0?n:Math.min(r.end,o),!e.extend&&n>r&&(o=r,r=n,n=o),o=ev(a,n);var s=ev(a,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),n>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=a;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<t.length;a++)e=t[a],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var AT=ir&&"documentMode"in document&&11>=document.documentMode,Hn=null,Fm=null,el=null,Bm=!1;function tv(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Bm||Hn==null||Hn!==kd(r)||(r=Hn,"selectionStart"in r&&Ih(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),el&&fl(el,r)||(el=r,r=Dd(Fm,"onSelect"),0<r.length&&(t=new Ch("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=Hn)))}function sd(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zn={animationend:sd("Animation","AnimationEnd"),animationiteration:sd("Animation","AnimationIteration"),animationstart:sd("Animation","AnimationStart"),transitionend:sd("Transition","TransitionEnd")},nm={},I0={};ir&&(I0=document.createElement("div").style,"AnimationEvent"in window||(delete zn.animationend.animation,delete zn.animationiteration.animation,delete zn.animationstart.animation),"TransitionEvent"in window||delete zn.transitionend.transition);function Zd(e){if(nm[e])return nm[e];if(!zn[e])return e;var t=zn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in I0)return nm[e]=t[a];return e}var k0=Zd("animationend"),P0=Zd("animationiteration"),T0=Zd("animationstart"),A0=Zd("transitionend"),R0=new Map,av="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 Qr(e,t){R0.set(e,t),Ho(t,[e])}for(id=0;id<av.length;id++)ld=av[id],rv=ld.toLowerCase(),ov=ld[0].toUpperCase()+ld.slice(1),Qr(rv,"on"+ov);var ld,rv,ov,id;Qr(k0,"onAnimationEnd");Qr(P0,"onAnimationIteration");Qr(T0,"onAnimationStart");Qr("dblclick","onDoubleClick");Qr("focusin","onFocus");Qr("focusout","onBlur");Qr(A0,"onTransitionEnd");os("onMouseEnter",["mouseout","mouseover"]);os("onMouseLeave",["mouseout","mouseover"]);os("onPointerEnter",["pointerout","pointerover"]);os("onPointerLeave",["pointerout","pointerover"]);Ho("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ho("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ho("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ho("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ho("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ho("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xi="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(" "),RT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xi));function nv(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,RP(r,t,void 0,e),e.currentTarget=null}function _0(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var r=e[a],o=r.event;r=r.listeners;e:{var n=void 0;if(t)for(var s=r.length-1;0<=s;s--){var i=r[s],l=i.instance,u=i.currentTarget;if(i=i.listener,l!==n&&o.isPropagationStopped())break e;nv(o,i,u),n=l}else for(s=0;s<r.length;s++){if(i=r[s],l=i.instance,u=i.currentTarget,i=i.listener,l!==n&&o.isPropagationStopped())break e;nv(o,i,u),n=l}}}if(Td)throw e=Dm,Td=!1,Dm=null,e}function be(e,t){var a=t[Hm];a===void 0&&(a=t[Hm]=new Set);var r=e+"__bubble";a.has(r)||(E0(t,e,2,!1),a.add(r))}function sm(e,t,a){var r=0;t&&(r|=4),E0(a,e,r,t)}var ud="_reactListening"+Math.random().toString(36).slice(2);function pl(e){if(!e[ud]){e[ud]=!0,Uv.forEach(function(a){a!=="selectionchange"&&(RT.has(a)||sm(a,!1,e),sm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ud]||(t[ud]=!0,sm("selectionchange",!1,t))}}function E0(e,t,a,r){switch(h0(t)){case 1:var o=WP;break;case 4:o=GP;break;default:o=wh}a=o.bind(null,t,a,e),o=void 0,!Em||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,a,{capture:!0,passive:o}):e.addEventListener(t,a,!0):o!==void 0?e.addEventListener(t,a,{passive:o}):e.addEventListener(t,a,!1)}function im(e,t,a,r,o){var n=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var i=r.stateNode.containerInfo;if(i===o||i.nodeType===8&&i.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;i!==null;){if(s=Do(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}t0(function(){var u=n,d=gh(a),c=[];e:{var f=R0.get(e);if(f!==void 0){var m=Ch,x=e;switch(e){case"keypress":if(xd(a)===0)break e;case"keydown":case"keyup":m=lT;break;case"focusin":x="focus",m=rm;break;case"focusout":x="blur",m=rm;break;case"beforeblur":case"afterblur":m=rm;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Wx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=QP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=cT;break;case k0:case P0:case T0:m=ZP;break;case A0:m=pT;break;case"scroll":m=KP;break;case"wheel":m=hT;break;case"copy":case"cut":case"paste":m=tT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Kx}var w=(t&4)!==0,b=!w&&e==="scroll",h=w?f!==null?f+"Capture":null:f;w=[];for(var g=u,y;g!==null;){y=g;var C=y.stateNode;if(y.tag===5&&C!==null&&(y=C,h!==null&&(C=il(g,h),C!=null&&w.push(ml(g,C,y)))),b)break;g=g.return}0<w.length&&(f=new m(f,x,null,a,d),c.push({event:f,listeners:w}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&a!==Rm&&(x=a.relatedTarget||a.fromElement)&&(Do(x)||x[lr]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(x=a.relatedTarget||a.toElement,m=u,x=x?Do(x):null,x!==null&&(b=zo(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=u),m!==x)){if(w=Wx,C="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=Kx,C="onPointerLeave",h="onPointerEnter",g="pointer"),b=m==null?f:$n(m),y=x==null?f:$n(x),f=new w(C,g+"leave",m,a,d),f.target=b,f.relatedTarget=y,C=null,Do(d)===u&&(w=new w(h,g+"enter",x,a,d),w.target=y,w.relatedTarget=b,C=w),b=C,m&&x)t:{for(w=m,h=x,g=0,y=w;y;y=Un(y))g++;for(y=0,C=h;C;C=Un(C))y++;for(;0<g-y;)w=Un(w),g--;for(;0<y-g;)h=Un(h),y--;for(;g--;){if(w===h||h!==null&&w===h.alternate)break t;w=Un(w),h=Un(h)}w=null}else w=null;m!==null&&sv(c,f,m,w,!1),x!==null&&b!==null&&sv(c,b,x,w,!0)}}e:{if(f=u?$n(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var L=CT;else if(Jx(f))if(S0)L=kT;else{L=bT;var P=LT}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(L=IT);if(L&&(L=L(e,u))){w0(c,L,a,d);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&Im(f,"number",f.value)}switch(P=u?$n(u):window,e){case"focusin":(Jx(P)||P.contentEditable==="true")&&(Hn=P,Fm=u,el=null);break;case"focusout":el=Fm=Hn=null;break;case"mousedown":Bm=!0;break;case"contextmenu":case"mouseup":case"dragend":Bm=!1,tv(c,a,d);break;case"selectionchange":if(AT)break;case"keydown":case"keyup":tv(c,a,d)}var A;if(bh)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else qn?x0(e,a)&&(R="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(R="onCompositionStart");R&&(y0&&a.locale!=="ko"&&(qn||R!=="onCompositionStart"?R==="onCompositionEnd"&&qn&&(A=g0()):(Br=d,Sh="value"in Br?Br.value:Br.textContent,qn=!0)),P=Dd(u,R),0<P.length&&(R=new Gx(R,e,null,a,d),c.push({event:R,listeners:P}),A?R.data=A:(A=v0(a),A!==null&&(R.data=A)))),(A=yT?xT(e,a):vT(e,a))&&(u=Dd(u,"onBeforeInput"),0<u.length&&(d=new Gx("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=A))}_0(c,t)})}function ml(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Dd(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=il(e,a),n!=null&&r.unshift(ml(e,n,o)),n=il(e,t),n!=null&&r.push(ml(e,n,o))),e=e.return}return r}function Un(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sv(e,t,a,r,o){for(var n=t._reactName,s=[];a!==null&&a!==r;){var i=a,l=i.alternate,u=i.stateNode;if(l!==null&&l===r)break;i.tag===5&&u!==null&&(i=u,o?(l=il(a,n),l!=null&&s.unshift(ml(a,l,i))):o||(l=il(a,n),l!=null&&s.push(ml(a,l,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var _T=/\r\n?/g,ET=/\u0000|\uFFFD/g;function iv(e){return(typeof e=="string"?e:""+e).replace(_T,`
|
|
6
|
+
`).replace(ET,"")}function dd(e,t,a){if(t=iv(t),iv(e)!==t&&a)throw Error(_(425))}function Md(){}var Um=null,Vm=null;function jm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qm=typeof setTimeout=="function"?setTimeout:void 0,DT=typeof clearTimeout=="function"?clearTimeout:void 0,lv=typeof Promise=="function"?Promise:void 0,MT=typeof queueMicrotask=="function"?queueMicrotask:typeof lv<"u"?function(e){return lv.resolve(null).then(e).catch(NT)}:qm;function NT(e){setTimeout(function(){throw e})}function lm(e,t){var a=t,r=0;do{var o=a.nextSibling;if(e.removeChild(a),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(r===0){e.removeChild(o),dl(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);dl(t)}function Hr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function uv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}var fs=Math.random().toString(36).slice(2),Oa="__reactFiber$"+fs,hl="__reactProps$"+fs,lr="__reactContainer$"+fs,Hm="__reactEvents$"+fs,OT="__reactListeners$"+fs,FT="__reactHandles$"+fs;function Do(e){var t=e[Oa];if(t)return t;for(var a=e.parentNode;a;){if(t=a[lr]||a[Oa]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=uv(e);e!==null;){if(a=e[Oa])return a;e=uv(e)}return t}e=a,a=e.parentNode}return null}function bl(e){return e=e[Oa]||e[lr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function $n(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function ec(e){return e[hl]||null}var zm=[],Wn=-1;function Jr(e){return{current:e}}function Ie(e){0>Wn||(e.current=zm[Wn],zm[Wn]=null,Wn--)}function we(e,t){Wn++,zm[Wn]=e.current,e.current=t}var Xr={},wt=Jr(Xr),Ot=Jr(!1),Bo=Xr;function ns(e,t){var a=e.type.contextTypes;if(!a)return Xr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},n;for(n in a)o[n]=t[n];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ft(e){return e=e.childContextTypes,e!=null}function Nd(){Ie(Ot),Ie(wt)}function dv(e,t,a){if(wt.current!==Xr)throw Error(_(168));we(wt,t),we(Ot,a)}function D0(e,t,a){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return a;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(_(108,LP(e)||"Unknown",o));return Ee({},a,r)}function Od(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xr,Bo=wt.current,we(wt,e),we(Ot,Ot.current),!0}function cv(e,t,a){var r=e.stateNode;if(!r)throw Error(_(169));a?(e=D0(e,t,Bo),r.__reactInternalMemoizedMergedChildContext=e,Ie(Ot),Ie(wt),we(wt,e)):Ie(Ot),we(Ot,a)}var rr=null,tc=!1,um=!1;function M0(e){rr===null?rr=[e]:rr.push(e)}function BT(e){tc=!0,M0(e)}function Yr(){if(!um&&rr!==null){um=!0;var e=0,t=he;try{var a=rr;for(he=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}rr=null,tc=!1}catch(o){throw rr!==null&&(rr=rr.slice(e+1)),n0(yh,Yr),o}finally{he=t,um=!1}}return null}var Gn=[],Kn=0,Fd=null,Bd=0,la=[],ua=0,Uo=null,or=1,nr="";function _o(e,t){Gn[Kn++]=Bd,Gn[Kn++]=Fd,Fd=e,Bd=t}function N0(e,t,a){la[ua++]=or,la[ua++]=nr,la[ua++]=Uo,Uo=e;var r=or;e=nr;var o=32-Ia(r)-1;r&=~(1<<o),a+=1;var n=32-Ia(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,or=1<<32-Ia(t)+o|a<<o|r,nr=n+e}else or=1<<n|a<<o|r,nr=e}function kh(e){e.return!==null&&(_o(e,1),N0(e,1,0))}function Ph(e){for(;e===Fd;)Fd=Gn[--Kn],Gn[Kn]=null,Bd=Gn[--Kn],Gn[Kn]=null;for(;e===Uo;)Uo=la[--ua],la[ua]=null,nr=la[--ua],la[ua]=null,or=la[--ua],la[ua]=null}var Kt=null,Gt=null,Ae=!1,ba=null;function O0(e,t){var a=da(5,null,null,0);a.elementType="DELETED",a.stateNode=t,a.return=e,t=e.deletions,t===null?(e.deletions=[a],e.flags|=16):t.push(a)}function fv(e,t){switch(e.tag){case 5:var a=e.type;return t=t.nodeType!==1||a.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Kt=e,Gt=Hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Kt=e,Gt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Uo!==null?{id:or,overflow:nr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=da(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Kt=e,Gt=null,!0):!1;default:return!1}}function $m(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wm(e){if(Ae){var t=Gt;if(t){var a=t;if(!fv(e,t)){if($m(e))throw Error(_(418));t=Hr(a.nextSibling);var r=Kt;t&&fv(e,t)?O0(r,a):(e.flags=e.flags&-4097|2,Ae=!1,Kt=e)}}else{if($m(e))throw Error(_(418));e.flags=e.flags&-4097|2,Ae=!1,Kt=e}}}function pv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Kt=e}function cd(e){if(e!==Kt)return!1;if(!Ae)return pv(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!jm(e.type,e.memoizedProps)),t&&(t=Gt)){if($m(e))throw F0(),Error(_(418));for(;t;)O0(e,t),t=Hr(t.nextSibling)}if(pv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"){if(t===0){Gt=Hr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}Gt=null}}else Gt=Kt?Hr(e.stateNode.nextSibling):null;return!0}function F0(){for(var e=Gt;e;)e=Hr(e.nextSibling)}function ss(){Gt=Kt=null,Ae=!1}function Th(e){ba===null?ba=[e]:ba.push(e)}var UT=cr.ReactCurrentBatchConfig;function qi(e,t,a){if(e=a.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(_(309));var r=a.stateNode}if(!r)throw Error(_(147,e));var o=r,n=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===n?t.ref:(t=function(s){var i=o.refs;s===null?delete i[n]:i[n]=s},t._stringRef=n,t)}if(typeof e!="string")throw Error(_(284));if(!a._owner)throw Error(_(290,e))}return e}function fd(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mv(e){var t=e._init;return t(e._payload)}function B0(e){function t(h,g){if(e){var y=h.deletions;y===null?(h.deletions=[g],h.flags|=16):y.push(g)}}function a(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function r(h,g){for(h=new Map;g!==null;)g.key!==null?h.set(g.key,g):h.set(g.index,g),g=g.sibling;return h}function o(h,g){return h=Gr(h,g),h.index=0,h.sibling=null,h}function n(h,g,y){return h.index=y,e?(y=h.alternate,y!==null?(y=y.index,y<g?(h.flags|=2,g):y):(h.flags|=2,g)):(h.flags|=1048576,g)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function i(h,g,y,C){return g===null||g.tag!==6?(g=gm(y,h.mode,C),g.return=h,g):(g=o(g,y),g.return=h,g)}function l(h,g,y,C){var L=y.type;return L===jn?d(h,g,y.props.children,C,y.key):g!==null&&(g.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Mr&&mv(L)===g.type)?(C=o(g,y.props),C.ref=qi(h,g,y),C.return=h,C):(C=Id(y.type,y.key,y.props,null,h.mode,C),C.ref=qi(h,g,y),C.return=h,C)}function u(h,g,y,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=ym(y,h.mode,C),g.return=h,g):(g=o(g,y.children||[]),g.return=h,g)}function d(h,g,y,C,L){return g===null||g.tag!==7?(g=Fo(y,h.mode,C,L),g.return=h,g):(g=o(g,y),g.return=h,g)}function c(h,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=gm(""+g,h.mode,y),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ju:return y=Id(g.type,g.key,g.props,null,h.mode,y),y.ref=qi(h,null,g),y.return=h,y;case Vn:return g=ym(g,h.mode,y),g.return=h,g;case Mr:var C=g._init;return c(h,C(g._payload),y)}if(Gi(g)||Bi(g))return g=Fo(g,h.mode,y,null),g.return=h,g;fd(h,g)}return null}function f(h,g,y,C){var L=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return L!==null?null:i(h,g,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ju:return y.key===L?l(h,g,y,C):null;case Vn:return y.key===L?u(h,g,y,C):null;case Mr:return L=y._init,f(h,g,L(y._payload),C)}if(Gi(y)||Bi(y))return L!==null?null:d(h,g,y,C,null);fd(h,y)}return null}function m(h,g,y,C,L){if(typeof C=="string"&&C!==""||typeof C=="number")return h=h.get(y)||null,i(g,h,""+C,L);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Ju:return h=h.get(C.key===null?y:C.key)||null,l(g,h,C,L);case Vn:return h=h.get(C.key===null?y:C.key)||null,u(g,h,C,L);case Mr:var P=C._init;return m(h,g,y,P(C._payload),L)}if(Gi(C)||Bi(C))return h=h.get(y)||null,d(g,h,C,L,null);fd(g,C)}return null}function x(h,g,y,C){for(var L=null,P=null,A=g,R=g=0,q=null;A!==null&&R<y.length;R++){A.index>R?(q=A,A=null):q=A.sibling;var V=f(h,A,y[R],C);if(V===null){A===null&&(A=q);break}e&&A&&V.alternate===null&&t(h,A),g=n(V,g,R),P===null?L=V:P.sibling=V,P=V,A=q}if(R===y.length)return a(h,A),Ae&&_o(h,R),L;if(A===null){for(;R<y.length;R++)A=c(h,y[R],C),A!==null&&(g=n(A,g,R),P===null?L=A:P.sibling=A,P=A);return Ae&&_o(h,R),L}for(A=r(h,A);R<y.length;R++)q=m(A,h,R,y[R],C),q!==null&&(e&&q.alternate!==null&&A.delete(q.key===null?R:q.key),g=n(q,g,R),P===null?L=q:P.sibling=q,P=q);return e&&A.forEach(function(pe){return t(h,pe)}),Ae&&_o(h,R),L}function w(h,g,y,C){var L=Bi(y);if(typeof L!="function")throw Error(_(150));if(y=L.call(y),y==null)throw Error(_(151));for(var P=L=null,A=g,R=g=0,q=null,V=y.next();A!==null&&!V.done;R++,V=y.next()){A.index>R?(q=A,A=null):q=A.sibling;var pe=f(h,A,V.value,C);if(pe===null){A===null&&(A=q);break}e&&A&&pe.alternate===null&&t(h,A),g=n(pe,g,R),P===null?L=pe:P.sibling=pe,P=pe,A=q}if(V.done)return a(h,A),Ae&&_o(h,R),L;if(A===null){for(;!V.done;R++,V=y.next())V=c(h,V.value,C),V!==null&&(g=n(V,g,R),P===null?L=V:P.sibling=V,P=V);return Ae&&_o(h,R),L}for(A=r(h,A);!V.done;R++,V=y.next())V=m(A,h,R,V.value,C),V!==null&&(e&&V.alternate!==null&&A.delete(V.key===null?R:V.key),g=n(V,g,R),P===null?L=V:P.sibling=V,P=V);return e&&A.forEach(function(le){return t(h,le)}),Ae&&_o(h,R),L}function b(h,g,y,C){if(typeof y=="object"&&y!==null&&y.type===jn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Ju:e:{for(var L=y.key,P=g;P!==null;){if(P.key===L){if(L=y.type,L===jn){if(P.tag===7){a(h,P.sibling),g=o(P,y.props.children),g.return=h,h=g;break e}}else if(P.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Mr&&mv(L)===P.type){a(h,P.sibling),g=o(P,y.props),g.ref=qi(h,P,y),g.return=h,h=g;break e}a(h,P);break}else t(h,P);P=P.sibling}y.type===jn?(g=Fo(y.props.children,h.mode,C,y.key),g.return=h,h=g):(C=Id(y.type,y.key,y.props,null,h.mode,C),C.ref=qi(h,g,y),C.return=h,h=C)}return s(h);case Vn:e:{for(P=y.key;g!==null;){if(g.key===P)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){a(h,g.sibling),g=o(g,y.children||[]),g.return=h,h=g;break e}else{a(h,g);break}else t(h,g);g=g.sibling}g=ym(y,h.mode,C),g.return=h,h=g}return s(h);case Mr:return P=y._init,b(h,g,P(y._payload),C)}if(Gi(y))return x(h,g,y,C);if(Bi(y))return w(h,g,y,C);fd(h,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(a(h,g.sibling),g=o(g,y),g.return=h,h=g):(a(h,g),g=gm(y,h.mode,C),g.return=h,h=g),s(h)):a(h,g)}return b}var is=B0(!0),U0=B0(!1),Ud=Jr(null),Vd=null,Xn=null,Ah=null;function Rh(){Ah=Xn=Vd=null}function _h(e){var t=Ud.current;Ie(Ud),e._currentValue=t}function Gm(e,t,a){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===a)break;e=e.return}}function as(e,t){Vd=e,Ah=Xn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Nt=!0),e.firstContext=null)}function fa(e){var t=e._currentValue;if(Ah!==e)if(e={context:e,memoizedValue:t,next:null},Xn===null){if(Vd===null)throw Error(_(308));Xn=e,Vd.dependencies={lanes:0,firstContext:e}}else Xn=Xn.next=e;return t}var Mo=null;function Eh(e){Mo===null?Mo=[e]:Mo.push(e)}function V0(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,Eh(t)):(a.next=o.next,o.next=a),t.interleaved=a,ur(e,r)}function ur(e,t){e.lanes|=t;var a=e.alternate;for(a!==null&&(a.lanes|=t),a=e,e=e.return;e!==null;)e.childLanes|=t,a=e.alternate,a!==null&&(a.childLanes|=t),a=e,e=e.return;return a.tag===3?a.stateNode:null}var Nr=!1;function Dh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function j0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(de&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ur(e,a)}return o=r.interleaved,o===null?(t.next=t,Eh(r)):(t.next=o.next,o.next=t),r.interleaved=t,ur(e,a)}function vd(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,xh(e,a)}}function hv(e,t){var a=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,a===r)){var o=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var s={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};n===null?o=n=s:n=n.next=s,a=a.next}while(a!==null);n===null?o=n=t:n=n.next=t}else o=n=t;a={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:n,shared:r.shared,effects:r.effects},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}function jd(e,t,a,r){var o=e.updateQueue;Nr=!1;var n=o.firstBaseUpdate,s=o.lastBaseUpdate,i=o.shared.pending;if(i!==null){o.shared.pending=null;var l=i,u=l.next;l.next=null,s===null?n=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,i=d.lastBaseUpdate,i!==s&&(i===null?d.firstBaseUpdate=u:i.next=u,d.lastBaseUpdate=l))}if(n!==null){var c=o.baseState;s=0,d=u=l=null,i=n;do{var f=i.lane,m=i.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var x=e,w=i;switch(f=t,m=a,w.tag){case 1:if(x=w.payload,typeof x=="function"){c=x.call(m,c,f);break e}c=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,f=typeof x=="function"?x.call(m,c,f):x,f==null)break e;c=Ee({},c,f);break e;case 2:Nr=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[i]:f.push(i))}else m={eventTime:m,lane:f,tag:i.tag,payload:i.payload,callback:i.callback,next:null},d===null?(u=d=m,l=c):d=d.next=m,s|=f;if(i=i.next,i===null){if(i=o.shared.pending,i===null)break;f=i,i=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else n===null&&(o.shared.lanes=0);jo|=s,e.lanes=s,e.memoizedState=c}}function gv(e,t,a){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=a,typeof o!="function")throw Error(_(191,o));o.call(r)}}}var Il={},Ba=Jr(Il),gl=Jr(Il),yl=Jr(Il);function No(e){if(e===Il)throw Error(_(174));return e}function Mh(e,t){switch(we(yl,t),we(gl,e),we(Ba,Il),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Pm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Pm(t,e)}Ie(Ba),we(Ba,t)}function ls(){Ie(Ba),Ie(gl),Ie(yl)}function q0(e){No(yl.current);var t=No(Ba.current),a=Pm(t,e.type);t!==a&&(we(gl,e),we(Ba,a))}function Nh(e){gl.current===e&&(Ie(Ba),Ie(gl))}var Re=Jr(0);function qd(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var dm=[];function Oh(){for(var e=0;e<dm.length;e++)dm[e]._workInProgressVersionPrimary=null;dm.length=0}var wd=cr.ReactCurrentDispatcher,cm=cr.ReactCurrentBatchConfig,Vo=0,_e=null,Ke=null,et=null,Hd=!1,tl=!1,xl=0,VT=0;function yt(){throw Error(_(321))}function Fh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Pa(e[a],t[a]))return!1;return!0}function Bh(e,t,a,r,o,n){if(Vo=n,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,wd.current=e===null||e.memoizedState===null?zT:$T,e=a(r,o),tl){n=0;do{if(tl=!1,xl=0,25<=n)throw Error(_(301));n+=1,et=Ke=null,t.updateQueue=null,wd.current=WT,e=a(r,o)}while(tl)}if(wd.current=zd,t=Ke!==null&&Ke.next!==null,Vo=0,et=Ke=_e=null,Hd=!1,t)throw Error(_(300));return e}function Uh(){var e=xl!==0;return xl=0,e}function Na(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?_e.memoizedState=et=e:et=et.next=e,et}function pa(){if(Ke===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=et===null?_e.memoizedState:et.next;if(t!==null)et=t,Ke=e;else{if(e===null)throw Error(_(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},et===null?_e.memoizedState=et=e:et=et.next=e}return et}function vl(e,t){return typeof t=="function"?t(e):t}function fm(e){var t=pa(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=Ke,o=r.baseQueue,n=a.pending;if(n!==null){if(o!==null){var s=o.next;o.next=n.next,n.next=s}r.baseQueue=o=n,a.pending=null}if(o!==null){n=o.next,r=r.baseState;var i=s=null,l=null,u=n;do{var d=u.lane;if((Vo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var c={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(i=l=c,s=r):l=l.next=c,_e.lanes|=d,jo|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,Pa(r,t.memoizedState)||(Nt=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,a.lastRenderedState=r}if(e=a.interleaved,e!==null){o=e;do n=o.lane,_e.lanes|=n,jo|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function pm(e){var t=pa(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=a.dispatch,o=a.pending,n=t.memoizedState;if(o!==null){a.pending=null;var s=o=o.next;do n=e(n,s.action),s=s.next;while(s!==o);Pa(n,t.memoizedState)||(Nt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function H0(){}function z0(e,t){var a=_e,r=pa(),o=t(),n=!Pa(r.memoizedState,o);if(n&&(r.memoizedState=o,Nt=!0),r=r.queue,Vh(G0.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||et!==null&&et.memoizedState.tag&1){if(a.flags|=2048,wl(9,W0.bind(null,a,r,o,t),void 0,null),tt===null)throw Error(_(349));(Vo&30)!==0||$0(a,t,o)}return o}function $0(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function W0(e,t,a,r){t.value=a,t.getSnapshot=r,K0(t)&&X0(e)}function G0(e,t,a){return a(function(){K0(t)&&X0(e)})}function K0(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Pa(e,a)}catch{return!0}}function X0(e){var t=ur(e,1);t!==null&&ka(t,e,1,-1)}function yv(e){var t=Na();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:e},t.queue=e,e=e.dispatch=HT.bind(null,_e,e),[t.memoizedState,e]}function wl(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=_e.updateQueue,t===null?(t={lastEffect:null,stores:null},_e.updateQueue=t,t.lastEffect=e.next=e):(a=t.lastEffect,a===null?t.lastEffect=e.next=e:(r=a.next,a.next=e,e.next=r,t.lastEffect=e)),e}function Q0(){return pa().memoizedState}function Sd(e,t,a,r){var o=Na();_e.flags|=e,o.memoizedState=wl(1|t,a,void 0,r===void 0?null:r)}function ac(e,t,a,r){var o=pa();r=r===void 0?null:r;var n=void 0;if(Ke!==null){var s=Ke.memoizedState;if(n=s.destroy,r!==null&&Fh(r,s.deps)){o.memoizedState=wl(t,a,n,r);return}}_e.flags|=e,o.memoizedState=wl(1|t,a,n,r)}function xv(e,t){return Sd(8390656,8,e,t)}function Vh(e,t){return ac(2048,8,e,t)}function J0(e,t){return ac(4,2,e,t)}function Y0(e,t){return ac(4,4,e,t)}function Z0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ew(e,t,a){return a=a!=null?a.concat([e]):null,ac(4,4,Z0.bind(null,t,e),a)}function jh(){}function tw(e,t){var a=pa();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Fh(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function aw(e,t){var a=pa();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Fh(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function rw(e,t,a){return(Vo&21)===0?(e.baseState&&(e.baseState=!1,Nt=!0),e.memoizedState=a):(Pa(a,t)||(a=l0(),_e.lanes|=a,jo|=a,e.baseState=!0),t)}function jT(e,t){var a=he;he=a!==0&&4>a?a:4,e(!0);var r=cm.transition;cm.transition={};try{e(!1),t()}finally{he=a,cm.transition=r}}function ow(){return pa().memoizedState}function qT(e,t,a){var r=Wr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},nw(e))sw(t,a);else if(a=V0(e,t,a,r),a!==null){var o=Tt();ka(a,e,r,o),iw(a,t,r)}}function HT(e,t,a){var r=Wr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(nw(e))sw(t,o);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var s=t.lastRenderedState,i=n(s,a);if(o.hasEagerState=!0,o.eagerState=i,Pa(i,s)){var l=t.interleaved;l===null?(o.next=o,Eh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=V0(e,t,o,r),a!==null&&(o=Tt(),ka(a,e,r,o),iw(a,t,r))}}function nw(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function sw(e,t){tl=Hd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function iw(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,xh(e,a)}}var zd={readContext:fa,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useInsertionEffect:yt,useLayoutEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useMutableSource:yt,useSyncExternalStore:yt,useId:yt,unstable_isNewReconciler:!1},zT={readContext:fa,useCallback:function(e,t){return Na().memoizedState=[e,t===void 0?null:t],e},useContext:fa,useEffect:xv,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,Sd(4194308,4,Z0.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Sd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Sd(4,2,e,t)},useMemo:function(e,t){var a=Na();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=Na();return t=a!==void 0?a(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qT.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Na();return e={current:e},t.memoizedState=e},useState:yv,useDebugValue:jh,useDeferredValue:function(e){return Na().memoizedState=e},useTransition:function(){var e=yv(!1),t=e[0];return e=jT.bind(null,e[1]),Na().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=_e,o=Na();if(Ae){if(a===void 0)throw Error(_(407));a=a()}else{if(a=t(),tt===null)throw Error(_(349));(Vo&30)!==0||$0(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,xv(G0.bind(null,r,n,e),[e]),r.flags|=2048,wl(9,W0.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=Na(),t=tt.identifierPrefix;if(Ae){var a=nr,r=or;a=(r&~(1<<32-Ia(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=xl++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=VT++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$T={readContext:fa,useCallback:tw,useContext:fa,useEffect:Vh,useImperativeHandle:ew,useInsertionEffect:J0,useLayoutEffect:Y0,useMemo:aw,useReducer:fm,useRef:Q0,useState:function(){return fm(vl)},useDebugValue:jh,useDeferredValue:function(e){var t=pa();return rw(t,Ke.memoizedState,e)},useTransition:function(){var e=fm(vl)[0],t=pa().memoizedState;return[e,t]},useMutableSource:H0,useSyncExternalStore:z0,useId:ow,unstable_isNewReconciler:!1},WT={readContext:fa,useCallback:tw,useContext:fa,useEffect:Vh,useImperativeHandle:ew,useInsertionEffect:J0,useLayoutEffect:Y0,useMemo:aw,useReducer:pm,useRef:Q0,useState:function(){return pm(vl)},useDebugValue:jh,useDeferredValue:function(e){var t=pa();return Ke===null?t.memoizedState=e:rw(t,Ke.memoizedState,e)},useTransition:function(){var e=pm(vl)[0],t=pa().memoizedState;return[e,t]},useMutableSource:H0,useSyncExternalStore:z0,useId:ow,unstable_isNewReconciler:!1};function Ca(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Km(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:Ee({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var rc={isMounted:function(e){return(e=e._reactInternals)?zo(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Tt(),o=Wr(e),n=sr(r,o);n.payload=t,a!=null&&(n.callback=a),t=zr(e,n,o),t!==null&&(ka(t,e,o,r),vd(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Tt(),o=Wr(e),n=sr(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=zr(e,n,o),t!==null&&(ka(t,e,o,r),vd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Tt(),r=Wr(e),o=sr(a,r);o.tag=2,t!=null&&(o.callback=t),t=zr(e,o,r),t!==null&&(ka(t,e,r,a),vd(t,e,r))}};function vv(e,t,a,r,o,n,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,n,s):t.prototype&&t.prototype.isPureReactComponent?!fl(a,r)||!fl(o,n):!0}function lw(e,t,a){var r=!1,o=Xr,n=t.contextType;return typeof n=="object"&&n!==null?n=fa(n):(o=Ft(t)?Bo:wt.current,r=t.contextTypes,n=(r=r!=null)?ns(e,o):Xr),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rc,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function wv(e,t,a,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,r),t.state!==e&&rc.enqueueReplaceState(t,t.state,null)}function Xm(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},Dh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=fa(n):(n=Ft(t)?Bo:wt.current,o.context=ns(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Km(e,t,n,a),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&rc.enqueueReplaceState(o,o.state,null),jd(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function us(e,t){try{var a="",r=t;do a+=CP(r),r=r.return;while(r);var o=a}catch(n){o=`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}return{value:e,source:t,stack:o,digest:null}}function im(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function $m(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var NT=typeof WeakMap=="function"?WeakMap:Map;function ow(e,t,r){r=ua(-1,r),r.tag=3,r.payload={element:null};var a=t.value;return r.callback=function(){qc||(qc=!0,Zm=a),$m(e,t)},r}function nw(e,t,r){r=ua(-1,r),r.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var o=t.value;r.payload=function(){return a(o)},r.callback=function(){$m(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(r.callback=function(){$m(e,t),typeof a!="function"&&(eo===null?eo=new Set([this]):eo.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function gx(e,t,r){var a=e.pingCache;if(a===null){a=e.pingCache=new NT;var o=new Set;a.set(t,o)}else o=a.get(t),o===void 0&&(o=new Set,a.set(t,o));o.has(r)||(o.add(r),e=KT.bind(null,e,t,r),t.then(e,e))}function yx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function vx(e,t,r,a,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=ua(-1,1),t.tag=2,Za(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var MT=ma.ReactCurrentOwner,Ot=!1;function Tt(e,t,r,a){t.child=e===null?N0(t,null,r,a):ps(t,e.child,r,a)}function xx(e,t,r,a,o){r=r.render;var n=t.ref;return ls(t,o),a=Rh(e,t,r,a,n,o),r=Eh(),e!==null&&!Ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,pa(e,t,o)):(Ee&&r&&xh(t),t.flags|=1,Tt(e,t,a,o),t.child)}function wx(e,t,r,a,o){if(e===null){var n=r.type;return typeof n=="function"&&!qh(n)&&n.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=n,sw(e,t,n,a,o)):(e=Sc(r.type,null,a,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(r=r.compare,r=r!==null?r:gl,r(s,a)&&e.ref===t.ref)return pa(e,t,o)}return t.flags|=1,e=ro(n,a),e.ref=t.ref,e.return=t,t.child=e}function sw(e,t,r,a,o){if(e!==null){var n=e.memoizedProps;if(gl(n,a)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=a=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,pa(e,t,o)}return Hm(e,t,r,a,o)}function iw(e,t,r){var a=t.pendingProps,o=a.children,n=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ce(as,Gt),Gt|=r;else{if((r&1073741824)===0)return e=n!==null?n.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ce(as,Gt),Gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=n!==null?n.baseLanes:r,Ce(as,Gt),Gt|=a}else n!==null?(a=n.baseLanes|r,t.memoizedState=null):a=r,Ce(as,Gt),Gt|=a;return Tt(e,t,o,r),t.child}function lw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Hm(e,t,r,a,o){var n=Ft(r)?Ko:bt.current;return n=ds(t,n),ls(t,o),r=Rh(e,t,r,a,n,o),a=Eh(),e!==null&&!Ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,pa(e,t,o)):(Ee&&a&&xh(t),t.flags|=1,Tt(e,t,r,o),t.child)}function Sx(e,t,r,a,o){if(Ft(r)){var n=!0;Ec(t)}else n=!1;if(ls(t,o),t.stateNode===null)vc(e,t),aw(t,r,a),qm(t,r,a,o),a=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=hr(u):(u=Ft(r)?Ko:bt.current,u=ds(t,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==a||l!==u)&&hx(t,s,a,u),Ha=!1;var f=t.memoizedState;s.state=f,Bc(t,a,s,o),l=t.memoizedState,i!==a||f!==l||Bt.current||Ha?(typeof c=="function"&&(jm(t,r,c,a),l=t.memoizedState),(i=Ha||mx(t,r,i,a,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=l),s.props=a,s.state=l,s.context=u,a=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{s=t.stateNode,O0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:Ir(t.type,i),s.props=u,d=t.pendingProps,f=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=hr(l):(l=Ft(r)?Ko:bt.current,l=ds(t,l));var m=r.getDerivedStateFromProps;(c=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==d||f!==l)&&hx(t,s,a,l),Ha=!1,f=t.memoizedState,s.state=f,Bc(t,a,s,o);var v=t.memoizedState;i!==d||f!==v||Bt.current||Ha?(typeof m=="function"&&(jm(t,r,m,a),v=t.memoizedState),(u=Ha||mx(t,r,u,a,f,v,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(a,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(a,v,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=v),s.props=a,s.state=v,s.context=l,a=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),a=!1)}return zm(e,t,r,a,n,o)}function zm(e,t,r,a,o,n){lw(e,t);var s=(t.flags&128)!==0;if(!a&&!s)return o&&sx(t,r,!1),pa(e,t,n);a=t.stateNode,MT.current=t;var i=s&&typeof r.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&s?(t.child=ps(t,e.child,null,n),t.child=ps(t,null,i,n)):Tt(e,t,i,n),t.memoizedState=a.state,o&&sx(t,r,!0),t.child}function uw(e){var t=e.stateNode;t.pendingContext?nx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nx(e,t.context,!1),Ph(e,t.containerInfo)}function Cx(e,t,r,a,o){return fs(),Sh(o),t.flags|=256,Tt(e,t,r,a),t.child}var Wm={dehydrated:null,treeContext:null,retryLane:0};function Gm(e){return{baseLanes:e,cachePool:null,transitions:null}}function cw(e,t,r){var a=t.pendingProps,o=Ne.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Ce(Ne,o&1),e===null)return Um(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=a.children,e=a.fallback,n?(a=t.mode,n=t.child,s={mode:"hidden",children:s},(a&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=rd(s,a,0,null),e=Go(e,a,r,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Gm(r),t.memoizedState=Wm,e):Mh(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return OT(e,t,s,a,i,o,r);if(n){n=a.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:a.children};return(s&1)===0&&t.child!==o?(a=t.child,a.childLanes=0,a.pendingProps=l,t.deletions=null):(a=ro(o,l),a.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=ro(i,n):(n=Go(n,s,r,null),n.flags|=2),n.return=t,a.return=t,a.sibling=n,t.child=a,a=n,n=t.child,s=e.child.memoizedState,s=s===null?Gm(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~r,t.memoizedState=Wm,a}return n=e.child,e=n.sibling,a=ro(n,{mode:"visible",children:a.children}),(t.mode&1)===0&&(a.lanes=r),a.return=t,a.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=a,t.memoizedState=null,a}function Mh(e,t){return t=rd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function uc(e,t,r,a){return a!==null&&Sh(a),ps(t,e.child,null,r),e=Mh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function OT(e,t,r,a,o,n,s){if(r)return t.flags&256?(t.flags&=-257,a=im(Error(R(422))),uc(e,t,s,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=a.fallback,o=t.mode,a=rd({mode:"visible",children:a.children},o,0,null),n=Go(n,o,s,null),n.flags|=2,a.return=t,n.return=t,a.sibling=n,t.child=a,(t.mode&1)!==0&&ps(t,e.child,null,s),t.child.memoizedState=Gm(s),t.memoizedState=Wm,n);if((t.mode&1)===0)return uc(e,t,s,null);if(o.data==="$!"){if(a=o.nextSibling&&o.nextSibling.dataset,a)var i=a.dgst;return a=i,n=Error(R(419)),a=im(n,a,void 0),uc(e,t,s,a)}if(i=(s&e.childLanes)!==0,Ot||i){if(a=nt,a!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(a.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,fa(e,o),_r(a,e,o,-1))}return jh(),a=im(Error(R(421))),uc(e,t,s,a)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=XT.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Kt=Ya(o.nextSibling),Xt=t,Ee=!0,Pr=null,e!==null&&(dr[fr++]=ia,dr[fr++]=la,dr[fr++]=Xo,ia=e.id,la=e.overflow,Xo=t),t=Mh(t,a.children),t.flags|=4096,t)}function bx(e,t,r){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Vm(e.return,t,r)}function lm(e,t,r,a,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:r,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=a,n.tail=r,n.tailMode=o)}function dw(e,t,r){var a=t.pendingProps,o=a.revealOrder,n=a.tail;if(Tt(e,t,a.children,r),a=Ne.current,(a&2)!==0)a=a&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bx(e,r,t);else if(e.tag===19)bx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(Ce(Ne,a),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;r!==null;)e=r.alternate,e!==null&&Fc(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),lm(t,!1,o,r,n);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Fc(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}lm(t,!0,r,null,n);break;case"together":lm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vc(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pa(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Qo|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(R(153));if(t.child!==null){for(e=t.child,r=ro(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=ro(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function BT(e,t,r){switch(t.tag){case 3:uw(t),fs();break;case 5:B0(t);break;case 1:Ft(t.type)&&Ec(t);break;case 4:Ph(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,o=t.memoizedProps.value;Ce(Mc,a._currentValue),a._currentValue=o;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(Ce(Ne,Ne.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?cw(e,t,r):(Ce(Ne,Ne.current&1),e=pa(e,t,r),e!==null?e.sibling:null);Ce(Ne,Ne.current&1);break;case 19:if(a=(r&t.childLanes)!==0,(e.flags&128)!==0){if(a)return dw(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ce(Ne,Ne.current),a)break;return null;case 22:case 23:return t.lanes=0,iw(e,t,r)}return pa(e,t,r)}var fw,Km,pw,mw;fw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Km=function(){};pw=function(e,t,r,a){var o=e.memoizedProps;if(o!==a){e=t.stateNode,zo(jr.current);var n=null;switch(r){case"input":o=gm(e,o),a=gm(e,a),n=[];break;case"select":o=Oe({},o,{value:void 0}),a=Oe({},a,{value:void 0}),n=[];break;case"textarea":o=xm(e,o),a=xm(e,a),n=[];break;default:typeof o.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=Ac)}Sm(r,a);var s;r=null;for(u in o)if(!a.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ul.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in a){var l=a[u];if(i=o?.[u],a.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(n||(n=[]),n.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ul.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ke("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}r&&(n=n||[]).push("style",r);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};mw=function(e,t,r,a){r!==a&&(t.flags|=4)};function Gi(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,a=0;if(t)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags&14680064,a|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,a|=o.subtreeFlags,a|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=a,e.childLanes=r,t}function FT(e,t,r){var a=t.pendingProps;switch(wh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return Ft(t.type)&&Rc(),St(t),null;case 3:return a=t.stateNode,ms(),Pe(Bt),Pe(bt),_h(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(ic(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Pr!==null&&(rh(Pr),Pr=null))),Km(e,t),St(t),null;case 5:Th(t);var o=zo(Sl.current);if(r=t.type,e!==null&&t.stateNode!=null)pw(e,t,r,a,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(R(166));return St(t),null}if(e=zo(jr.current),ic(t)){a=t.stateNode,r=t.type;var n=t.memoizedProps;switch(a[Ur]=t,a[xl]=n,e=(t.mode&1)!==0,r){case"dialog":ke("cancel",a),ke("close",a);break;case"iframe":case"object":case"embed":ke("load",a);break;case"video":case"audio":for(o=0;o<Zi.length;o++)ke(Zi[o],a);break;case"source":ke("error",a);break;case"img":case"image":case"link":ke("error",a),ke("load",a);break;case"details":ke("toggle",a);break;case"input":Rv(a,n),ke("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!n.multiple},ke("invalid",a);break;case"textarea":Dv(a,n),ke("invalid",a)}Sm(r,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?a.textContent!==i&&(n.suppressHydrationWarning!==!0&&sc(a.textContent,i,e),o=["children",i]):typeof i=="number"&&a.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&sc(a.textContent,i,e),o=["children",""+i]):ul.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&ke("scroll",a)}switch(r){case"input":Ku(a),Ev(a,n,!0);break;case"textarea":Ku(a),Nv(a);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(a.onclick=Ac)}a=o,t.updateQueue=a,a!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=qx(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=s.createElement(r,{is:a.is}):(e=s.createElement(r),r==="select"&&(s=e,a.multiple?s.multiple=!0:a.size&&(s.size=a.size))):e=s.createElementNS(e,r),e[Ur]=t,e[xl]=a,fw(e,t,!1,!1),t.stateNode=e;e:{switch(s=Cm(r,a),r){case"dialog":ke("cancel",e),ke("close",e),o=a;break;case"iframe":case"object":case"embed":ke("load",e),o=a;break;case"video":case"audio":for(o=0;o<Zi.length;o++)ke(Zi[o],e);o=a;break;case"source":ke("error",e),o=a;break;case"img":case"image":case"link":ke("error",e),ke("load",e),o=a;break;case"details":ke("toggle",e),o=a;break;case"input":Rv(e,a),o=gm(e,a),ke("invalid",e);break;case"option":o=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},o=Oe({},a,{value:void 0}),ke("invalid",e);break;case"textarea":Dv(e,a),o=xm(e,a),ke("invalid",e);break;default:o=a}Sm(r,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?zx(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&$x(e,l)):n==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&cl(e,l):typeof l=="number"&&cl(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(ul.hasOwnProperty(n)?l!=null&&n==="onScroll"&&ke("scroll",e):l!=null&&nh(e,n,l,s))}switch(r){case"input":Ku(e),Ev(e,a,!1);break;case"textarea":Ku(e),Nv(e);break;case"option":a.value!=null&&e.setAttribute("value",""+ao(a.value));break;case"select":e.multiple=!!a.multiple,n=a.value,n!=null?os(e,!!a.multiple,n,!1):a.defaultValue!=null&&os(e,!!a.multiple,a.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ac)}switch(r){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return St(t),null;case 6:if(e&&t.stateNode!=null)mw(e,t,e.memoizedProps,a);else{if(typeof a!="string"&&t.stateNode===null)throw Error(R(166));if(r=zo(Sl.current),zo(jr.current),ic(t)){if(a=t.stateNode,r=t.memoizedProps,a[Ur]=t,(n=a.nodeValue!==r)&&(e=Xt,e!==null))switch(e.tag){case 3:sc(a.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&sc(a.nodeValue,r,(e.mode&1)!==0)}n&&(t.flags|=4)}else a=(r.nodeType===9?r:r.ownerDocument).createTextNode(a),a[Ur]=t,t.stateNode=a}return St(t),null;case 13:if(Pe(Ne),a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&Kt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)E0(),fs(),t.flags|=98560,n=!1;else if(n=ic(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(R(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(R(317));n[Ur]=t}else fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),n=!1}else Pr!==null&&(rh(Pr),Pr=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(a=a!==null,a!==(e!==null&&e.memoizedState!==null)&&a&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ne.current&1)!==0?Ze===0&&(Ze=3):jh())),t.updateQueue!==null&&(t.flags|=4),St(t),null);case 4:return ms(),Km(e,t),e===null&&yl(t.stateNode.containerInfo),St(t),null;case 10:return Lh(t.type._context),St(t),null;case 17:return Ft(t.type)&&Rc(),St(t),null;case 19:if(Pe(Ne),n=t.memoizedState,n===null)return St(t),null;if(a=(t.flags&128)!==0,s=n.rendering,s===null)if(a)Gi(n,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Fc(e),s!==null){for(t.flags|=128,Gi(n,!1),a=s.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=r,r=t.child;r!==null;)n=r,e=a,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ce(Ne,Ne.current&1|2),t.child}e=e.sibling}n.tail!==null&&He()>gs&&(t.flags|=128,a=!0,Gi(n,!1),t.lanes=4194304)}else{if(!a)if(e=Fc(s),e!==null){if(t.flags|=128,a=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Gi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ee)return St(t),null}else 2*He()-n.renderingStartTime>gs&&r!==1073741824&&(t.flags|=128,a=!0,Gi(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(r=n.last,r!==null?r.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=He(),t.sibling=null,r=Ne.current,Ce(Ne,a?r&1|2:r&1),t):(St(t),null);case 22:case 23:return Vh(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?(Gt&1073741824)!==0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(R(156,t.tag))}function UT(e,t){switch(wh(t),t.tag){case 1:return Ft(t.type)&&Rc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),Pe(Bt),Pe(bt),_h(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Th(t),null;case 13:if(Pe(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(Ne),null;case 4:return ms(),null;case 10:return Lh(t.type._context),null;case 22:case 23:return Vh(),null;case 24:return null;default:return null}}var cc=!1,Ct=!1,VT=typeof WeakSet=="function"?WeakSet:Set,U=null;function rs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(a){je(e,t,a)}else r.current=null}function Xm(e,t,r){try{r()}catch(a){je(e,t,a)}}var Lx=!1;function jT(e,t){if(Em=Pc,e=x0(),vh(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var a=r.getSelection&&r.getSelection();if(a&&a.rangeCount!==0){r=a.anchorNode;var o=a.anchorOffset,n=a.focusNode;a=a.focusOffset;try{r.nodeType,n.nodeType}catch{r=null;break e}var s=0,i=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var m;d!==r||o!==0&&d.nodeType!==3||(i=s+o),d!==n||a!==0&&d.nodeType!==3||(l=s+a),d.nodeType===3&&(s+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===r&&++u===o&&(i=s),f===n&&++c===a&&(l=s),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}r=i===-1||l===-1?null:{start:i,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Dm={focusedElem:e,selectionRange:r},Pc=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var v=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var x=v.memoizedProps,b=v.memoizedState,g=t.stateNode,h=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ir(t.type,x),b);g.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(w){je(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return v=Lx,Lx=!1,v}function sl(e,t,r){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var o=a=a.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&Xm(t,r,n)}o=o.next}while(o!==a)}}function ed(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var a=r.create;r.destroy=a()}r=r.next}while(r!==t)}}function Jm(e){var t=e.ref;if(t!==null){var r=e.stateNode;e.tag,e=r,typeof t=="function"?t(e):t.current=e}}function hw(e){var t=e.alternate;t!==null&&(e.alternate=null,hw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ur],delete t[xl],delete t[Om],delete t[bT],delete t[LT])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gw(e){return e.tag===5||e.tag===3||e.tag===4}function Ix(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qm(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ac));else if(a!==4&&(e=e.child,e!==null))for(Qm(e,t,r),e=e.sibling;e!==null;)Qm(e,t,r),e=e.sibling}function Ym(e,t,r){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Ym(e,t,r),e=e.sibling;e!==null;)Ym(e,t,r),e=e.sibling}var ct=null,kr=!1;function qa(e,t,r){for(r=r.child;r!==null;)yw(e,t,r),r=r.sibling}function yw(e,t,r){if(Vr&&typeof Vr.onCommitFiberUnmount=="function")try{Vr.onCommitFiberUnmount(Wc,r)}catch{}switch(r.tag){case 5:Ct||rs(r,t);case 6:var a=ct,o=kr;ct=null,qa(e,t,r),ct=a,kr=o,ct!==null&&(kr?(e=ct,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ct.removeChild(r.stateNode));break;case 18:ct!==null&&(kr?(e=ct,r=r.stateNode,e.nodeType===8?tm(e.parentNode,r):e.nodeType===1&&tm(e,r),ml(e)):tm(ct,r.stateNode));break;case 4:a=ct,o=kr,ct=r.stateNode.containerInfo,kr=!0,qa(e,t,r),ct=a,kr=o;break;case 0:case 11:case 14:case 15:if(!Ct&&(a=r.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){o=a=a.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&Xm(r,t,s),o=o.next}while(o!==a)}qa(e,t,r);break;case 1:if(!Ct&&(rs(r,t),a=r.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=r.memoizedProps,a.state=r.memoizedState,a.componentWillUnmount()}catch(i){je(r,t,i)}qa(e,t,r);break;case 21:qa(e,t,r);break;case 22:r.mode&1?(Ct=(a=Ct)||r.memoizedState!==null,qa(e,t,r),Ct=a):qa(e,t,r);break;default:qa(e,t,r)}}function kx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new VT),t.forEach(function(a){var o=JT.bind(null,e,a);r.has(a)||(r.add(a),a.then(o,o))})}}function Lr(e,t){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:ct=i.stateNode,kr=!1;break e;case 3:ct=i.stateNode.containerInfo,kr=!0;break e;case 4:ct=i.stateNode.containerInfo,kr=!0;break e}i=i.return}if(ct===null)throw Error(R(160));yw(n,s,o),ct=null,kr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){je(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)vw(t,e),t=t.sibling}function vw(e,t){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Lr(t,e),Br(e),a&4){try{sl(3,e,e.return),ed(3,e)}catch(x){je(e,e.return,x)}try{sl(5,e,e.return)}catch(x){je(e,e.return,x)}}break;case 1:Lr(t,e),Br(e),a&512&&r!==null&&rs(r,r.return);break;case 5:if(Lr(t,e),Br(e),a&512&&r!==null&&rs(r,r.return),e.flags&32){var o=e.stateNode;try{cl(o,"")}catch(x){je(e,e.return,x)}}if(a&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=r!==null?r.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&Vx(o,n),Cm(i,s);var u=Cm(i,n);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?zx(o,d):c==="dangerouslySetInnerHTML"?$x(o,d):c==="children"?cl(o,d):nh(o,c,d,u)}switch(i){case"input":ym(o,n);break;case"textarea":jx(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var m=n.value;m!=null?os(o,!!n.multiple,m,!1):f!==!!n.multiple&&(n.defaultValue!=null?os(o,!!n.multiple,n.defaultValue,!0):os(o,!!n.multiple,n.multiple?[]:"",!1))}o[xl]=n}catch(x){je(e,e.return,x)}}break;case 6:if(Lr(t,e),Br(e),a&4){if(e.stateNode===null)throw Error(R(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(x){je(e,e.return,x)}}break;case 3:if(Lr(t,e),Br(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ml(t.containerInfo)}catch(x){je(e,e.return,x)}break;case 4:Lr(t,e),Br(e);break;case 13:Lr(t,e),Br(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(Fh=He())),a&4&&kx(e);break;case 22:if(c=r!==null&&r.memoizedState!==null,e.mode&1?(Ct=(u=Ct)||c,Lr(t,e),Ct=u):Lr(t,e),Br(e),a&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&(e.mode&1)!==0)for(U=e,c=e.child;c!==null;){for(d=U=c;U!==null;){switch(f=U,m=f.child,f.tag){case 0:case 11:case 14:case 15:sl(4,f,f.return);break;case 1:rs(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){a=f,r=f.return;try{t=a,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(x){je(a,r,x)}}break;case 5:rs(f,f.return);break;case 22:if(f.memoizedState!==null){Tx(d);continue}}m!==null?(m.return=f,U=m):Tx(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=Hx("display",s))}catch(x){je(e,e.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){je(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Lr(t,e),Br(e),a&4&&kx(e);break;case 21:break;default:Lr(t,e),Br(e)}}function Br(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(gw(r)){var a=r;break e}r=r.return}throw Error(R(160))}switch(a.tag){case 5:var o=a.stateNode;a.flags&32&&(cl(o,""),a.flags&=-33);var n=Ix(e);Ym(e,n,o);break;case 3:case 4:var s=a.stateNode.containerInfo,i=Ix(e);Qm(e,i,s);break;default:throw Error(R(161))}}catch(l){je(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qT(e,t,r){U=e,xw(e,t,r)}function xw(e,t,r){for(var a=(e.mode&1)!==0;U!==null;){var o=U,n=o.child;if(o.tag===22&&a){var s=o.memoizedState!==null||cc;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||Ct;i=cc;var u=Ct;if(cc=s,(Ct=l)&&!u)for(U=o;U!==null;)s=U,l=s.child,s.tag===22&&s.memoizedState!==null?_x(o):l!==null?(l.return=s,U=l):_x(o);for(;n!==null;)U=n,xw(n,t,r),n=n.sibling;U=o,cc=i,Ct=u}Px(e,t,r)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,U=n):Px(e,t,r)}}function Px(e){for(;U!==null;){var t=U;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Ct||ed(5,t);break;case 1:var a=t.stateNode;if(t.flags&4&&!Ct)if(r===null)a.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:Ir(t.type,r.memoizedProps);a.componentDidUpdate(o,r.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&dx(t,n,a);break;case 3:var s=t.updateQueue;if(s!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}dx(t,s,r)}break;case 5:var i=t.stateNode;if(r===null&&t.flags&4){r=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&ml(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}Ct||t.flags&512&&Jm(t)}catch(f){je(t,t.return,f)}}if(t===e){U=null;break}if(r=t.sibling,r!==null){r.return=t.return,U=r;break}U=t.return}}function Tx(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var r=t.sibling;if(r!==null){r.return=t.return,U=r;break}U=t.return}}function _x(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ed(4,t)}catch(l){je(t,r,l)}break;case 1:var a=t.stateNode;if(typeof a.componentDidMount=="function"){var o=t.return;try{a.componentDidMount()}catch(l){je(t,o,l)}}var n=t.return;try{Jm(t)}catch(l){je(t,n,l)}break;case 5:var s=t.return;try{Jm(t)}catch(l){je(t,s,l)}}}catch(l){je(t,t.return,l)}if(t===e){U=null;break}var i=t.sibling;if(i!==null){i.return=t.return,U=i;break}U=t.return}}var $T=Math.ceil,jc=ma.ReactCurrentDispatcher,Oh=ma.ReactCurrentOwner,mr=ma.ReactCurrentBatchConfig,ue=0,nt=null,Ge=null,dt=0,Gt=0,as=so(0),Ze=0,Il=null,Qo=0,td=0,Bh=0,il=null,Mt=null,Fh=0,gs=1/0,na=null,qc=!1,Zm=null,eo=null,dc=!1,Ka=null,$c=0,ll=0,eh=null,xc=-1,wc=0;function _t(){return(ue&6)!==0?He():xc!==-1?xc:xc=He()}function to(e){return(e.mode&1)===0?1:(ue&2)!==0&&dt!==0?dt&-dt:kT.transition!==null?(wc===0&&(wc=a0()),wc):(e=ge,e!==0||(e=window.event,e=e===void 0?16:c0(e.type)),e)}function _r(e,t,r,a){if(50<ll)throw ll=0,eh=null,Error(R(185));kl(e,r,a),((ue&2)===0||e!==nt)&&(e===nt&&((ue&2)===0&&(td|=r),Ze===4&&Wa(e,dt)),Ut(e,a),r===1&&ue===0&&(t.mode&1)===0&&(gs=He()+500,Qc&&io()))}function Ut(e,t){var r=e.callbackNode;TP(e,t);var a=kc(e,e===nt?dt:0);if(a===0)r!==null&&Bv(r),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(r!=null&&Bv(r),t===1)e.tag===0?IT(Ax.bind(null,e)):_0(Ax.bind(null,e)),ST(function(){(ue&6)===0&&io()}),r=null;else{switch(o0(a)){case 1:r=ch;break;case 4:r=t0;break;case 16:r=Ic;break;case 536870912:r=r0;break;default:r=Ic}r=Pw(r,ww.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function ww(e,t){if(xc=-1,wc=0,(ue&6)!==0)throw Error(R(327));var r=e.callbackNode;if(us()&&e.callbackNode!==r)return null;var a=kc(e,e===nt?dt:0);if(a===0)return null;if((a&30)!==0||(a&e.expiredLanes)!==0||t)t=Hc(e,a);else{t=a;var o=ue;ue|=2;var n=Cw();(nt!==e||dt!==t)&&(na=null,gs=He()+500,Wo(e,t));do try{WT();break}catch(i){Sw(e,i)}while(!0);bh(),jc.current=n,ue=o,Ge!==null?t=0:(nt=null,dt=0,t=Ze)}if(t!==0){if(t===2&&(o=Pm(e),o!==0&&(a=o,t=th(e,o))),t===1)throw r=Il,Wo(e,0),Wa(e,a),Ut(e,He()),r;if(t===6)Wa(e,a);else{if(o=e.current.alternate,(a&30)===0&&!HT(o)&&(t=Hc(e,a),t===2&&(n=Pm(e),n!==0&&(a=n,t=th(e,n))),t===1))throw r=Il,Wo(e,0),Wa(e,a),Ut(e,He()),r;switch(e.finishedWork=o,e.finishedLanes=a,t){case 0:case 1:throw Error(R(345));case 2:qo(e,Mt,na);break;case 3:if(Wa(e,a),(a&130023424)===a&&(t=Fh+500-He(),10<t)){if(kc(e,0)!==0)break;if(o=e.suspendedLanes,(o&a)!==a){_t(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Mm(qo.bind(null,e,Mt,na),t);break}qo(e,Mt,na);break;case 4:if(Wa(e,a),(a&4194240)===a)break;for(t=e.eventTimes,o=-1;0<a;){var s=31-Tr(a);n=1<<s,s=t[s],s>o&&(o=s),a&=~n}if(a=o,a=He()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*$T(a/1960))-a,10<a){e.timeoutHandle=Mm(qo.bind(null,e,Mt,na),a);break}qo(e,Mt,na);break;case 5:qo(e,Mt,na);break;default:throw Error(R(329))}}}return Ut(e,He()),e.callbackNode===r?ww.bind(null,e):null}function th(e,t){var r=il;return e.current.memoizedState.isDehydrated&&(Wo(e,t).flags|=256),e=Hc(e,t),e!==2&&(t=Mt,Mt=r,t!==null&&rh(t)),e}function rh(e){Mt===null?Mt=e:Mt.push.apply(Mt,e)}function HT(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var a=0;a<r.length;a++){var o=r[a],n=o.getSnapshot;o=o.value;try{if(!Ar(n(),o))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wa(e,t){for(t&=~Bh,t&=~td,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Tr(t),a=1<<r;e[r]=-1,t&=~a}}function Ax(e){if((ue&6)!==0)throw Error(R(327));us();var t=kc(e,0);if((t&1)===0)return Ut(e,He()),null;var r=Hc(e,t);if(e.tag!==0&&r===2){var a=Pm(e);a!==0&&(t=a,r=th(e,a))}if(r===1)throw r=Il,Wo(e,0),Wa(e,t),Ut(e,He()),r;if(r===6)throw Error(R(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,qo(e,Mt,na),Ut(e,He()),null}function Uh(e,t){var r=ue;ue|=1;try{return e(t)}finally{ue=r,ue===0&&(gs=He()+500,Qc&&io())}}function Yo(e){Ka!==null&&Ka.tag===0&&(ue&6)===0&&us();var t=ue;ue|=1;var r=mr.transition,a=ge;try{if(mr.transition=null,ge=1,e)return e()}finally{ge=a,mr.transition=r,ue=t,(ue&6)===0&&io()}}function Vh(){Gt=as.current,Pe(as)}function Wo(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,wT(r)),Ge!==null)for(r=Ge.return;r!==null;){var a=r;switch(wh(a),a.tag){case 1:a=a.type.childContextTypes,a!=null&&Rc();break;case 3:ms(),Pe(Bt),Pe(bt),_h();break;case 5:Th(a);break;case 4:ms();break;case 13:Pe(Ne);break;case 19:Pe(Ne);break;case 10:Lh(a.type._context);break;case 22:case 23:Vh()}r=r.return}if(nt=e,Ge=e=ro(e.current,null),dt=Gt=t,Ze=0,Il=null,Bh=td=Qo=0,Mt=il=null,Ho!==null){for(t=0;t<Ho.length;t++)if(r=Ho[t],a=r.interleaved,a!==null){r.interleaved=null;var o=a.next,n=r.pending;if(n!==null){var s=n.next;n.next=o,a.next=s}r.pending=a}Ho=null}return e}function Sw(e,t){do{var r=Ge;try{if(bh(),gc.current=Vc,Uc){for(var a=Me.memoizedState;a!==null;){var o=a.queue;o!==null&&(o.pending=null),a=a.next}Uc=!1}if(Jo=0,ot=Ye=Me=null,nl=!1,Cl=0,Oh.current=null,r===null||r.return===null){Ze=1,Il=t,Ge=null;break}e:{var n=e,s=r.return,i=r,l=t;if(t=dt,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=i,d=c.tag;if((c.mode&1)===0&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var m=yx(s);if(m!==null){m.flags&=-257,vx(m,s,i,n,t),m.mode&1&&gx(n,u,t),t=m,l=u;var v=t.updateQueue;if(v===null){var x=new Set;x.add(l),t.updateQueue=x}else v.add(l);break e}else{if((t&1)===0){gx(n,u,t),jh();break e}l=Error(R(426))}}else if(Ee&&i.mode&1){var b=yx(s);if(b!==null){(b.flags&65536)===0&&(b.flags|=256),vx(b,s,i,n,t),Sh(hs(l,i));break e}}n=l=hs(l,i),Ze!==4&&(Ze=2),il===null?il=[n]:il.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var g=ow(n,l,t);cx(n,g);break e;case 1:i=l;var h=n.type,y=n.stateNode;if((n.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(eo===null||!eo.has(y)))){n.flags|=65536,t&=-t,n.lanes|=t;var w=nw(n,i,t);cx(n,w);break e}}n=n.return}while(n!==null)}Lw(r)}catch(L){t=L,Ge===r&&r!==null&&(Ge=r=r.return);continue}break}while(!0)}function Cw(){var e=jc.current;return jc.current=Vc,e===null?Vc:e}function jh(){(Ze===0||Ze===3||Ze===2)&&(Ze=4),nt===null||(Qo&268435455)===0&&(td&268435455)===0||Wa(nt,dt)}function Hc(e,t){var r=ue;ue|=2;var a=Cw();(nt!==e||dt!==t)&&(na=null,Wo(e,t));do try{zT();break}catch(o){Sw(e,o)}while(!0);if(bh(),ue=r,jc.current=a,Ge!==null)throw Error(R(261));return nt=null,dt=0,Ze}function zT(){for(;Ge!==null;)bw(Ge)}function WT(){for(;Ge!==null&&!xP();)bw(Ge)}function bw(e){var t=kw(e.alternate,e,Gt);e.memoizedProps=e.pendingProps,t===null?Lw(e):Ge=t,Oh.current=null}function Lw(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=FT(r,t,Gt),r!==null){Ge=r;return}}else{if(r=UT(r,t),r!==null){r.flags&=32767,Ge=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ze=6,Ge=null;return}}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Ze===0&&(Ze=5)}function qo(e,t,r){var a=ge,o=mr.transition;try{mr.transition=null,ge=1,GT(e,t,r,a)}finally{mr.transition=o,ge=a}return null}function GT(e,t,r,a){do us();while(Ka!==null);if((ue&6)!==0)throw Error(R(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(R(177));e.callbackNode=null,e.callbackPriority=0;var n=r.lanes|r.childLanes;if(_P(e,n),e===nt&&(Ge=nt=null,dt=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||dc||(dc=!0,Pw(Ic,function(){return us(),null})),n=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||n){n=mr.transition,mr.transition=null;var s=ge;ge=1;var i=ue;ue|=4,Oh.current=null,jT(e,r),vw(r,e),hT(Dm),Pc=!!Em,Dm=Em=null,e.current=r,qT(r,e,o),wP(),ue=i,ge=s,mr.transition=n}else e.current=r;if(dc&&(dc=!1,Ka=e,$c=o),n=e.pendingLanes,n===0&&(eo=null),bP(r.stateNode,a),Ut(e,He()),t!==null)for(a=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],a(o.value,{componentStack:o.stack,digest:o.digest});if(qc)throw qc=!1,e=Zm,Zm=null,e;return($c&1)!==0&&e.tag!==0&&us(),n=e.pendingLanes,(n&1)!==0?e===eh?ll++:(ll=0,eh=e):ll=0,io(),null}function us(){if(Ka!==null){var e=o0($c),t=mr.transition,r=ge;try{if(mr.transition=null,ge=16>e?16:e,Ka===null)var a=!1;else{if(e=Ka,Ka=null,$c=0,(ue&6)!==0)throw Error(R(331));var o=ue;for(ue|=4,U=e.current;U!==null;){var n=U,s=n.child;if((U.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(U=u;U!==null;){var c=U;switch(c.tag){case 0:case 11:case 15:sl(8,c,n)}var d=c.child;if(d!==null)d.return=c,U=d;else for(;U!==null;){c=U;var f=c.sibling,m=c.return;if(hw(c),c===u){U=null;break}if(f!==null){f.return=m,U=f;break}U=m}}}var v=n.alternate;if(v!==null){var x=v.child;if(x!==null){v.child=null;do{var b=x.sibling;x.sibling=null,x=b}while(x!==null)}}U=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,U=s;else e:for(;U!==null;){if(n=U,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:sl(9,n,n.return)}var g=n.sibling;if(g!==null){g.return=n.return,U=g;break e}U=n.return}}var h=e.current;for(U=h;U!==null;){s=U;var y=s.child;if((s.subtreeFlags&2064)!==0&&y!==null)y.return=s,U=y;else e:for(s=h;U!==null;){if(i=U,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:ed(9,i)}}catch(L){je(i,i.return,L)}if(i===s){U=null;break e}var w=i.sibling;if(w!==null){w.return=i.return,U=w;break e}U=i.return}}if(ue=o,io(),Vr&&typeof Vr.onPostCommitFiberRoot=="function")try{Vr.onPostCommitFiberRoot(Wc,e)}catch{}a=!0}return a}finally{ge=r,mr.transition=t}}return!1}function Rx(e,t,r){t=hs(r,t),t=ow(e,t,1),e=Za(e,t,1),t=_t(),e!==null&&(kl(e,1,t),Ut(e,t))}function je(e,t,r){if(e.tag===3)Rx(e,e,r);else for(;t!==null;){if(t.tag===3){Rx(t,e,r);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(eo===null||!eo.has(a))){e=hs(r,e),e=nw(t,e,1),t=Za(t,e,1),e=_t(),t!==null&&(kl(t,1,e),Ut(t,e));break}}t=t.return}}function KT(e,t,r){var a=e.pingCache;a!==null&&a.delete(t),t=_t(),e.pingedLanes|=e.suspendedLanes&r,nt===e&&(dt&r)===r&&(Ze===4||Ze===3&&(dt&130023424)===dt&&500>He()-Fh?Wo(e,0):Bh|=r),Ut(e,t)}function Iw(e,t){t===0&&((e.mode&1)===0?t=1:(t=Qu,Qu<<=1,(Qu&130023424)===0&&(Qu=4194304)));var r=_t();e=fa(e,t),e!==null&&(kl(e,t,r),Ut(e,r))}function XT(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Iw(e,r)}function JT(e,t){var r=0;switch(e.tag){case 13:var a=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(R(314))}a!==null&&a.delete(t),Iw(e,r)}var kw;kw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bt.current)Ot=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return Ot=!1,BT(e,t,r);Ot=(e.flags&131072)!==0}else Ot=!1,Ee&&(t.flags&1048576)!==0&&A0(t,Nc,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;vc(e,t),e=t.pendingProps;var o=ds(t,bt.current);ls(t,r),o=Rh(null,t,a,e,o,r);var n=Eh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(a)?(n=!0,Ec(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,kh(t),o.updater=Zc,t.stateNode=o,o._reactInternals=t,qm(t,a,e,r),t=zm(null,t,a,!0,n,r)):(t.tag=0,Ee&&n&&xh(t),Tt(null,t,o,r),t=t.child),t;case 16:a=t.elementType;e:{switch(vc(e,t),e=t.pendingProps,o=a._init,a=o(a._payload),t.type=a,o=t.tag=YT(a),e=Ir(a,e),o){case 0:t=Hm(null,t,a,e,r);break e;case 1:t=Sx(null,t,a,e,r);break e;case 11:t=xx(null,t,a,e,r);break e;case 14:t=wx(null,t,a,Ir(a.type,e),r);break e}throw Error(R(306,a,""))}return t;case 0:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Ir(a,o),Hm(e,t,a,o,r);case 1:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Ir(a,o),Sx(e,t,a,o,r);case 3:e:{if(uw(t),e===null)throw Error(R(387));a=t.pendingProps,n=t.memoizedState,o=n.element,O0(e,t),Bc(t,a,null,r);var s=t.memoizedState;if(a=s.element,n.isDehydrated)if(n={element:a,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=hs(Error(R(423)),t),t=Cx(e,t,a,r,o);break e}else if(a!==o){o=hs(Error(R(424)),t),t=Cx(e,t,a,r,o);break e}else for(Kt=Ya(t.stateNode.containerInfo.firstChild),Xt=t,Ee=!0,Pr=null,r=N0(t,null,a,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(fs(),a===o){t=pa(e,t,r);break e}Tt(e,t,a,r)}t=t.child}return t;case 5:return B0(t),e===null&&Um(t),a=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Nm(a,o)?s=null:n!==null&&Nm(a,n)&&(t.flags|=32),lw(e,t),Tt(e,t,s,r),t.child;case 6:return e===null&&Um(t),null;case 13:return cw(e,t,r);case 4:return Ph(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ps(t,null,a,r):Tt(e,t,a,r),t.child;case 11:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Ir(a,o),xx(e,t,a,o,r);case 7:return Tt(e,t,t.pendingProps,r),t.child;case 8:return Tt(e,t,t.pendingProps.children,r),t.child;case 12:return Tt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(a=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,Ce(Mc,a._currentValue),a._currentValue=s,n!==null)if(Ar(n.value,s)){if(n.children===o.children&&!Bt.current){t=pa(e,t,r);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===a){if(n.tag===1){l=ua(-1,r&-r),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}n.lanes|=r,l=n.alternate,l!==null&&(l.lanes|=r),Vm(n.return,r,t),i.lanes|=r;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(R(341));s.lanes|=r,i=s.alternate,i!==null&&(i.lanes|=r),Vm(s,r,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}Tt(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,a=t.pendingProps.children,ls(t,r),o=hr(o),a=a(o),t.flags|=1,Tt(e,t,a,r),t.child;case 14:return a=t.type,o=Ir(a,t.pendingProps),o=Ir(a.type,o),wx(e,t,a,o,r);case 15:return sw(e,t,t.type,t.pendingProps,r);case 17:return a=t.type,o=t.pendingProps,o=t.elementType===a?o:Ir(a,o),vc(e,t),t.tag=1,Ft(a)?(e=!0,Ec(t)):e=!1,ls(t,r),aw(t,a,o),qm(t,a,o,r),zm(null,t,a,!0,e,r);case 19:return dw(e,t,r);case 22:return iw(e,t,r)}throw Error(R(156,t.tag))};function Pw(e,t){return e0(e,t)}function QT(e,t,r,a){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pr(e,t,r,a){return new QT(e,t,r,a)}function qh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YT(e){if(typeof e=="function")return qh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ih)return 11;if(e===lh)return 14}return 2}function ro(e,t){var r=e.alternate;return r===null?(r=pr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Sc(e,t,r,a,o,n){var s=2;if(a=e,typeof e=="function")qh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Gn:return Go(r.children,o,n,t);case sh:s=8,o|=8;break;case fm:return e=pr(12,r,t,o|2),e.elementType=fm,e.lanes=n,e;case pm:return e=pr(13,r,t,o),e.elementType=pm,e.lanes=n,e;case mm:return e=pr(19,r,t,o),e.elementType=mm,e.lanes=n,e;case Bx:return rd(r,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mx:s=10;break e;case Ox:s=9;break e;case ih:s=11;break e;case lh:s=14;break e;case $a:s=16,a=null;break e}throw Error(R(130,e==null?e:typeof e,""))}return t=pr(s,r,t,o),t.elementType=e,t.type=a,t.lanes=n,t}function Go(e,t,r,a){return e=pr(7,e,a,t),e.lanes=r,e}function rd(e,t,r,a){return e=pr(22,e,a,t),e.elementType=Bx,e.lanes=r,e.stateNode={isHidden:!1},e}function um(e,t,r){return e=pr(6,e,null,t),e.lanes=r,e}function cm(e,t,r){return t=pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ZT(e,t,r,a,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gp(0),this.expirationTimes=Gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gp(0),this.identifierPrefix=a,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function $h(e,t,r,a,o,n,s,i,l){return e=new ZT(e,t,r,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=pr(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:a,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(n),e}function e_(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Wn,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}function Tw(e){if(!e)return oo;e=e._reactInternals;e:{if(en(e)!==e||e.tag!==1)throw Error(R(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(R(171))}if(e.tag===1){var r=e.type;if(Ft(r))return T0(e,r,t)}return t}function _w(e,t,r,a,o,n,s,i,l){return e=$h(r,a,!0,e,o,n,s,i,l),e.context=Tw(null),r=e.current,a=_t(),o=to(r),n=ua(a,o),n.callback=t??null,Za(r,n,o),e.current.lanes=o,kl(e,o,a),Ut(e,a),e}function ad(e,t,r,a){var o=t.current,n=_t(),s=to(o);return r=Tw(r),t.context===null?t.context=r:t.pendingContext=r,t=ua(n,s),t.payload={element:e},a=a===void 0?null:a,a!==null&&(t.callback=a),e=Za(o,t,s),e!==null&&(_r(e,o,s,n),hc(e,o,s)),s}function zc(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Ex(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Hh(e,t){Ex(e,t),(e=e.alternate)&&Ex(e,t)}function t_(){return null}var Aw=typeof reportError=="function"?reportError:function(e){console.error(e)};function zh(e){this._internalRoot=e}od.prototype.render=zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));ad(e,t,null,null)};od.prototype.unmount=zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Yo(function(){ad(null,e,null,null)}),t[da]=null}};function od(e){this._internalRoot=e}od.prototype.unstable_scheduleHydration=function(e){if(e){var t=i0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<za.length&&t!==0&&t<za[r].priority;r++);za.splice(r,0,e),r===0&&u0(e)}};function Wh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dx(){}function r_(e,t,r,a,o){if(o){if(typeof a=="function"){var n=a;a=function(){var u=zc(s);n.call(u)}}var s=_w(t,a,e,0,null,!1,!1,"",Dx);return e._reactRootContainer=s,e[da]=s.current,yl(e.nodeType===8?e.parentNode:e),Yo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof a=="function"){var i=a;a=function(){var u=zc(l);i.call(u)}}var l=$h(e,0,!1,null,null,!1,!1,"",Dx);return e._reactRootContainer=l,e[da]=l.current,yl(e.nodeType===8?e.parentNode:e),Yo(function(){ad(t,l,r,a)}),l}function sd(e,t,r,a,o){var n=r._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=zc(s);i.call(l)}}ad(t,s,e,o)}else s=r_(r,t,e,o,a);return zc(s)}n0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Yi(t.pendingLanes);r!==0&&(dh(t,r|1),Ut(t,He()),(ue&6)===0&&(gs=He()+500,io()))}break;case 13:Yo(function(){var a=fa(e,1);if(a!==null){var o=_t();_r(a,e,1,o)}}),Hh(e,1)}};fh=function(e){if(e.tag===13){var t=fa(e,134217728);if(t!==null){var r=_t();_r(t,e,134217728,r)}Hh(e,134217728)}};s0=function(e){if(e.tag===13){var t=to(e),r=fa(e,t);if(r!==null){var a=_t();_r(r,e,t,a)}Hh(e,t)}};i0=function(){return ge};l0=function(e,t){var r=ge;try{return ge=e,t()}finally{ge=r}};Lm=function(e,t,r){switch(t){case"input":if(ym(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var a=r[t];if(a!==e&&a.form===e.form){var o=Jc(a);if(!o)throw Error(R(90));Ux(a),ym(a,o)}}}break;case"textarea":jx(e,r);break;case"select":t=r.value,t!=null&&os(e,!!r.multiple,t,!1)}};Kx=Uh;Xx=Yo;var a_={usingClientEntryPoint:!1,Events:[Tl,Qn,Jc,Wx,Gx,Uh]},Ki={findFiberByHostInstance:$o,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},o_={bundleType:Ki.bundleType,version:Ki.version,rendererPackageName:Ki.rendererPackageName,rendererConfig:Ki.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ma.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yx(e),e===null?null:e.stateNode},findFiberByHostInstance:Ki.findFiberByHostInstance||t_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Xi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Xi.isDisabled&&Xi.supportsFiber))try{Wc=Xi.inject(o_),Vr=Xi}catch{}var Xi;Yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a_;Yt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Wh(t))throw Error(R(200));return e_(e,t,null,r)};Yt.createRoot=function(e,t){if(!Wh(e))throw Error(R(299));var r=!1,a="",o=Aw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=$h(e,1,!1,null,null,r,!1,a,o),e[da]=t.current,yl(e.nodeType===8?e.parentNode:e),new zh(t)};Yt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(R(188)):(e=Object.keys(e).join(","),Error(R(268,e)));return e=Yx(t),e=e===null?null:e.stateNode,e};Yt.flushSync=function(e){return Yo(e)};Yt.hydrate=function(e,t,r){if(!nd(t))throw Error(R(200));return sd(null,e,t,!0,r)};Yt.hydrateRoot=function(e,t,r){if(!Wh(e))throw Error(R(405));var a=r!=null&&r.hydratedSources||null,o=!1,n="",s=Aw;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(n=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=_w(t,null,e,1,r??null,o,!1,n,s),e[da]=t.current,yl(e),a)for(e=0;e<a.length;e++)r=a[e],o=r._getVersion,o=o(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new od(t)};Yt.render=function(e,t,r){if(!nd(t))throw Error(R(200));return sd(null,e,t,!1,r)};Yt.unmountComponentAtNode=function(e){if(!nd(e))throw Error(R(40));return e._reactRootContainer?(Yo(function(){sd(null,null,e,!1,function(){e._reactRootContainer=null,e[da]=null})}),!0):!1};Yt.unstable_batchedUpdates=Uh;Yt.unstable_renderSubtreeIntoContainer=function(e,t,r,a){if(!nd(r))throw Error(R(200));if(e==null||e._reactInternals===void 0)throw Error(R(38));return sd(e,t,r,!1,a)};Yt.version="18.3.1-next-f1338f8080-20240426"});var Gh=oa((PN,Dw)=>{"use strict";function Ew(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ew)}catch(e){console.error(e)}}Ew(),Dw.exports=Rw()});var Mw=oa(Kh=>{"use strict";var Nw=Gh();Kh.createRoot=Nw.createRoot,Kh.hydrateRoot=Nw.hydrateRoot;var TN});var QS=oa(_d=>{"use strict";var mR=K(),hR=Symbol.for("react.element"),gR=Symbol.for("react.fragment"),yR=Object.prototype.hasOwnProperty,vR=mR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xR={key:!0,ref:!0,__self:!0,__source:!0};function JS(e,t,r){var a,o={},n=null,s=null;r!==void 0&&(n=""+r),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(a in t)yR.call(t,a)&&!xR.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps,t)o[a]===void 0&&(o[a]=t[a]);return{$$typeof:hR,type:e,key:n,ref:s,props:o,_owner:vR.current}}_d.Fragment=gR;_d.jsx=JS;_d.jsxs=JS});var le=oa((m2,YS)=>{"use strict";YS.exports=QS()});var vN={};Vk(vN,{initKiteChat:()=>gp});var Zr=M(K(),1),yk=M(Mw(),1);var B=M(K(),1);function tn(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(r[a[o]]=e[a[o]]);return r}function Ow(e,t,r,a){function o(n){return n instanceof r?n:new r(function(s){s(n)})}return new(r||(r=Promise))(function(n,s){function i(c){try{u(a.next(c))}catch(d){s(d)}}function l(c){try{u(a.throw(c))}catch(d){s(d)}}function u(c){c.done?n(c.value):o(c.value).then(i,l)}u((a=a.apply(e,t||[])).next())})}var Bw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var xs=class extends Error{constructor(t,r="FunctionsError",a){super(t),this.name=r,this.context=a}},Al=class extends xs{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},ws=class extends xs{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Ss=class extends xs{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},Rl;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Rl||(Rl={}));var El=class{constructor(t,{headers:r={},customFetch:a,region:o=Rl.Any}={}){this.url=t,this.headers=r,this.region=o,this.fetch=Bw(a)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return Ow(this,arguments,void 0,function*(r,a={}){var o;let n,s;try{let{headers:i,method:l,body:u,signal:c,timeout:d}=a,f={},{region:m}=a;m||(m=this.region);let v=new URL(`${this.url}/${r}`);m&&m!=="any"&&(f["x-region"]=m,v.searchParams.set("forceFunctionRegion",m));let x;u&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",x=u):typeof u=="string"?(f["Content-Type"]="text/plain",x=u):typeof FormData<"u"&&u instanceof FormData?x=u:(f["Content-Type"]="application/json",x=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?x=JSON.stringify(u):x=u;let b=c;d&&(s=new AbortController,n=setTimeout(()=>s.abort(),d),c?(b=s.signal,c.addEventListener("abort",()=>s.abort())):b=s.signal);let g=yield this.fetch(v.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),i),body:x,signal:b}).catch(L=>{throw new Al(L)}),h=g.headers.get("x-relay-error");if(h&&h==="true")throw new ws(g);if(!g.ok)throw new Ss(g);let y=((o=g.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),w;return y==="application/json"?w=yield g.json():y==="application/octet-stream"||y==="application/pdf"?w=yield g.blob():y==="text/event-stream"?w=g:y==="multipart/form-data"?w=yield g.formData():w=yield g.text(),{data:w,error:null,response:g}}catch(i){return{data:null,error:i,response:i instanceof Ss||i instanceof ws?i.context:void 0}}finally{n&&clearTimeout(n)}})}};var Uw=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},n_=class{constructor(e){var t,r;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let a=this.fetch,o=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{let s=null,i=null,l=null,u=n.status,c=n.statusText;if(n.ok){var d,f;if(r.method!=="HEAD"){var m;let g=await n.text();g===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((m=r.headers.get("Accept"))===null||m===void 0)&&m.includes("application/vnd.pgrst.plan+text"))?i=g:i=JSON.parse(g))}let x=(d=r.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),b=(f=n.headers.get("content-range"))===null||f===void 0?void 0:f.split("/");x&&b&&b.length>1&&(l=parseInt(b[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(i)&&(i.length>1?(s={code:"PGRST116",details:`Results contain ${i.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},i=null,l=null,u=406,c="Not Acceptable"):i.length===1?i=i[0]:i=null)}else{var v;let x=await n.text();try{s=JSON.parse(x),Array.isArray(s)&&n.status===404&&(i=[],s=null,u=200,c="OK")}catch{n.status===404&&x===""?(u=204,c="No Content"):s={message:x}}if(s&&r.isMaybeSingle&&(!(s==null||(v=s.details)===null||v===void 0)&&v.includes("0 rows"))&&(s=null,u=200,c="OK"),s&&r.shouldThrowOnError)throw new Uw(s)}return{error:s,data:i,count:l,status:u,statusText:c}});return this.shouldThrowOnError||(o=o.catch(n=>{var s;let i="",l=n?.cause;if(l){var u,c,d,f;let v=(u=l?.message)!==null&&u!==void 0?u:"",x=(c=l?.code)!==null&&c!==void 0?c:"";i=`${(d=n?.name)!==null&&d!==void 0?d:"FetchError"}: ${n?.message}`,i+=`
|
|
9
|
-
|
|
10
|
-
Caused by: ${(f=l?.name)!==null&&f!==void 0?f:"Error"}: ${v}`,x&&(i+=` (${x})`),l?.stack&&(i+=`
|
|
11
|
-
${l.stack}`)}else{var m;i=(m=n?.stack)!==null&&m!==void 0?m:""}return{error:{message:`${(s=n?.name)!==null&&s!==void 0?s:"FetchError"}: ${n?.message}`,details:i,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),o.then(e,t)}returns(){return this}overrideTypes(){return this}},s_=class extends n_{select(e){let t=!1,r=(e??"*").split("").map(a=>/\s/.test(a)&&!t?"":(a==='"'&&(t=!t),a)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:a,referencedTable:o=a}={}){let n=o?`${o}.order`:"order",s=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${s?`${s},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){let a=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:a=r}={}){let o=typeof a>"u"?"offset":`${a}.offset`,n=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(n,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:a=!1,wal:o=!1,format:n="text"}={}){var s;let i=[e?"analyze":null,t?"verbose":null,r?"settings":null,a?"buffers":null,o?"wal":null].filter(Boolean).join("|"),l=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${n}; for="${l}"; options=${i};`),n==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}},Fw=new RegExp("[,()]"),Cs=class extends s_{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let r=Array.from(new Set(t)).map(a=>typeof a=="string"&&Fw.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){let r=Array.from(new Set(t)).map(a=>typeof a=="string"&&Fw.test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:a}={}){let o="";a==="plain"?o="pl":a==="phrase"?o="ph":a==="websearch"&&(o="w");let n=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${o}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){let a=r?`${r}.or`:"or";return this.url.searchParams.append(a,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},i_=class{constructor(e,{headers:t={},schema:r,fetch:a}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:r=!1,count:a}=t??{},o=r?"HEAD":"GET",n=!1,s=(e??"*").split("").map(u=>/\s/.test(u)&&!n?"":(u==='"'&&(n=!n),u)).join(""),{url:i,headers:l}=this.cloneRequestState();return i.searchParams.set("select",s),a&&l.append("Prefer",`count=${a}`),new Cs({method:o,url:i,headers:l,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:r=!0}={}){var a;let o="POST",{url:n,headers:s}=this.cloneRequestState();if(t&&s.append("Prefer",`count=${t}`),r||s.append("Prefer","missing=default"),Array.isArray(e)){let i=e.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(i.length>0){let l=[...new Set(i)].map(u=>`"${u}"`);n.searchParams.set("columns",l.join(","))}}return new Cs({method:o,url:n,headers:s,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:a,defaultToNull:o=!0}={}){var n;let s="POST",{url:i,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&i.searchParams.set("on_conflict",t),a&&l.append("Prefer",`count=${a}`),o||l.append("Prefer","missing=default"),Array.isArray(e)){let u=e.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){let c=[...new Set(u)].map(d=>`"${d}"`);i.searchParams.set("columns",c.join(","))}}return new Cs({method:s,url:i,headers:l,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}update(e,{count:t}={}){var r;let a="PATCH",{url:o,headers:n}=this.cloneRequestState();return t&&n.append("Prefer",`count=${t}`),new Cs({method:a,url:o,headers:n,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:e}={}){var t;let r="DELETE",{url:a,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new Cs({method:r,url:a,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},Vw=class jw{constructor(t,{headers:r={},schema:a,fetch:o}={}){this.url=t,this.headers=new Headers(r),this.schemaName=a,this.fetch=o}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new i_(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new jw(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,r={},{head:a=!1,get:o=!1,count:n}={}){var s;let i,l=new URL(`${this.url}/rpc/${t}`),u,c=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(c)),d=a&&Object.values(r).some(c);d?(i="POST",u=r):a||o?(i=a?"HEAD":"GET",Object.entries(r).filter(([m,v])=>v!==void 0).map(([m,v])=>[m,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([m,v])=>{l.searchParams.append(m,v)})):(i="POST",u=r);let f=new Headers(this.headers);return d?f.set("Prefer",n?`count=${n},return=minimal`:"return=minimal"):n&&f.set("Prefer",`count=${n}`),new Cs({method:i,url:l,headers:f,schema:this.schemaName,body:u,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}};var Xh=class{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};let r=globalThis.process;if(r){let a=r.versions;if(a&&a.node){let o=a.node,n=parseInt(o.replace(/^v/,"").split(".")[0]);return n>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${n} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
12
|
-
import ws from "ws"
|
|
13
|
-
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){let t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
|
|
14
|
-
|
|
15
|
-
Suggested solution: ${t.workaround}`),new Error(r)}static createWebSocket(t,r){let a=this.getWebSocketConstructor();return new a(t,r)}static isWebSocketSupported(){try{let t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}},Jh=Xh;var qw="2.90.1";var $w=`realtime-js/${qw}`,Qh="1.0.0",Hw="2.0.0",Yh=Qh;var Dl=1e4,zw=1e3,Ww=100,ha;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ha||(ha={}));var Ke;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Ke||(Ke={}));var Zt;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Zt||(Zt={}));var id;(function(e){e.websocket="websocket"})(id||(id={}));var lo;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(lo||(lo={}));var Nl=class{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let a=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(a))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,a;let o=(a=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var r,a;let o=(a=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&a!==void 0?a:{},s=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,s)}_encodeUserBroadcastPush(t,r,a){var o,n;let s=t.topic,i=(o=t.ref)!==null&&o!==void 0?o:"",l=(n=t.join_ref)!==null&&n!==void 0?n:"",u=t.payload.event,c=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},d=Object.keys(c).length===0?"":JSON.stringify(c);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`ref length ${i.length} exceeds maximum of 255`);if(s.length>255)throw new Error(`topic length ${s.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);let f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+i.length+s.length+u.length+d.length,m=new ArrayBuffer(this.HEADER_LENGTH+f),v=new DataView(m),x=0;v.setUint8(x++,this.KINDS.userBroadcastPush),v.setUint8(x++,l.length),v.setUint8(x++,i.length),v.setUint8(x++,s.length),v.setUint8(x++,u.length),v.setUint8(x++,d.length),v.setUint8(x++,r),Array.from(l,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(i,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(s,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(u,g=>v.setUint8(x++,g.charCodeAt(0))),Array.from(d,g=>v.setUint8(x++,g.charCodeAt(0)));var b=new Uint8Array(m.byteLength+a.byteLength);return b.set(new Uint8Array(m),0),b.set(new Uint8Array(a),m.byteLength),b.buffer}decode(t,r){if(this._isArrayBuffer(t)){let a=this._binaryDecode(t);return r(a)}if(typeof t=="string"){let a=JSON.parse(t),[o,n,s,i,l]=a;return r({join_ref:o,ref:n,topic:s,event:i,payload:l})}return r({})}_binaryDecode(t){let r=new DataView(t),a=r.getUint8(0),o=new TextDecoder;if(a===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,r,o)}_decodeUserBroadcast(t,r,a){let o=r.getUint8(1),n=r.getUint8(2),s=r.getUint8(3),i=r.getUint8(4),l=this.HEADER_LENGTH+4,u=a.decode(t.slice(l,l+o));l=l+o;let c=a.decode(t.slice(l,l+n));l=l+n;let d=a.decode(t.slice(l,l+s));l=l+s;let f=t.slice(l,t.byteLength),m=i===this.JSON_ENCODING?JSON.parse(a.decode(f)):f,v={type:this.BROADCAST_EVENT,event:c,payload:m};return s>0&&(v.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:v}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t?.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([a])=>r.includes(a)))}};var rn=class{constructor(t,r){this.callback=t,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var be;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(be||(be={}));var eg=(e,t,r={})=>{var a;let o=(a=r.skipTypes)!==null&&a!==void 0?a:[];return t?Object.keys(t).reduce((n,s)=>(n[s]=l_(s,e,t,o),n),{}):{}},l_=(e,t,r,a)=>{let o=t.find(i=>i.name===e),n=o?.type,s=r[e];return n&&!a.includes(n)?Gw(n,s):Zh(s)},Gw=(e,t)=>{if(e.charAt(0)==="_"){let r=e.slice(1,e.length);return f_(t,r)}switch(e){case be.bool:return u_(t);case be.float4:case be.float8:case be.int2:case be.int4:case be.int8:case be.numeric:case be.oid:return c_(t);case be.json:case be.jsonb:return d_(t);case be.timestamp:return p_(t);case be.abstime:case be.date:case be.daterange:case be.int4range:case be.int8range:case be.money:case be.reltime:case be.text:case be.time:case be.timestamptz:case be.timetz:case be.tsrange:case be.tstzrange:return Zh(t);default:return Zh(t)}},Zh=e=>e,u_=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},c_=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},d_=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},f_=(e,t)=>{if(typeof e!="string")return e;let r=e.length-1,a=e[r];if(e[0]==="{"&&a==="}"){let n,s=e.slice(1,r);try{n=JSON.parse("["+s+"]")}catch{n=s?s.split(","):[]}return n.map(i=>Gw(t,i))}return e},p_=e=>typeof e=="string"?e.replace(" ","T"):e,ld=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var an=class{constructor(t,r,a={},o=Dl){this.channel=t,this.event=r,this.payload=a,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,r){var a;return this._hasReceived(t)&&r((a=this.receivedResp)===null||a===void 0?void 0:a.response),this.recHooks.push({status:t,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let t=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:r}){this.recHooks.filter(a=>a.status===t).forEach(a=>a.callback(r))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}};var tg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(tg||(tg={}));var bs=class e{constructor(t,r){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let a=r?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(a.state,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,o,n,s),this.pendingDiffs.forEach(l=>{this.state=e.syncDiff(this.state,l,n,s)}),this.pendingDiffs=[],i()}),this.channel._on(a.diff,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=e.syncDiff(this.state,o,n,s),i())}),this.onJoin((o,n,s)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:n,newPresences:s})}),this.onLeave((o,n,s)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:n,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,r,a,o){let n=this.cloneDeep(t),s=this.transformState(r),i={},l={};return this.map(n,(u,c)=>{s[u]||(l[u]=c)}),this.map(s,(u,c)=>{let d=n[u];if(d){let f=c.map(b=>b.presence_ref),m=d.map(b=>b.presence_ref),v=c.filter(b=>m.indexOf(b.presence_ref)<0),x=d.filter(b=>f.indexOf(b.presence_ref)<0);v.length>0&&(i[u]=v),x.length>0&&(l[u]=x)}else i[u]=c}),this.syncDiff(n,{joins:i,leaves:l},a,o)}static syncDiff(t,r,a,o){let{joins:n,leaves:s}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return a||(a=()=>{}),o||(o=()=>{}),this.map(n,(i,l)=>{var u;let c=(u=t[i])!==null&&u!==void 0?u:[];if(t[i]=this.cloneDeep(l),c.length>0){let d=t[i].map(m=>m.presence_ref),f=c.filter(m=>d.indexOf(m.presence_ref)<0);t[i].unshift(...f)}a(i,c,l)}),this.map(s,(i,l)=>{let u=t[i];if(!u)return;let c=l.map(d=>d.presence_ref);u=u.filter(d=>c.indexOf(d.presence_ref)<0),t[i]=u,o(i,u,l),u.length===0&&delete t[i]}),t}static map(t,r){return Object.getOwnPropertyNames(t).map(a=>r(a,t[a]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((r,a)=>{let o=t[a];return"metas"in o?r[a]=o.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):r[a]=o,r},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var rg;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(rg||(rg={}));var Ls;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ls||(Ls={}));var qr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(qr||(qr={}));var Is=class e{constructor(t,r={config:{}},a){var o,n;if(this.topic=t,this.params=r,this.socket=a,this.bindings={},this.state=Ke.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new an(this,Zt.join,this.params,this.timeout),this.rejoinTimer=new rn(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Ke.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Ke.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Ke.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Ke.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Ke.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Zt.reply,{},(s,i)=>{this._trigger(this._replyEventName(i),s)}),this.presence=new bs(this),this.broadcastEndpointURL=ld(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((n=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||n===void 0)&&n.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var a,o,n;if(this.socket.isConnected()||this.socket.connect(),this.state==Ke.closed){let{config:{broadcast:s,presence:i,private:l}}=this.params,u=(o=(a=this.bindings.postgres_changes)===null||a===void 0?void 0:a.map(m=>m.filter))!==null&&o!==void 0?o:[],c=!!this.bindings[Ls.PRESENCE]&&this.bindings[Ls.PRESENCE].length>0||((n=this.params.config.presence)===null||n===void 0?void 0:n.enabled)===!0,d={},f={broadcast:s,presence:Object.assign(Object.assign({},i),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(m=>t?.(qr.CHANNEL_ERROR,m)),this._onClose(()=>t?.(qr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:m})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){t?.(qr.SUBSCRIBED);return}else{let x=this.bindings.postgres_changes,b=(v=x?.length)!==null&&v!==void 0?v:0,g=[];for(let h=0;h<b;h++){let y=x[h],{filter:{event:w,schema:L,table:P,filter:_}}=y,A=m&&m[h];if(A&&A.event===w&&e.isFilterValueEqual(A.schema,L)&&e.isFilterValueEqual(A.table,P)&&e.isFilterValueEqual(A.filter,_))g.push(Object.assign(Object.assign({},y),{id:A.id}));else{this.unsubscribe(),this.state=Ke.errored,t?.(qr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,t&&t(qr.SUBSCRIBED);return}}).receive("error",m=>{this.state=Ke.errored,t?.(qr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(m).join(", ")||"error")))}).receive("timeout",()=>{t?.(qr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,a){return this.state===Ke.joined&&t===Ls.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,r,a)}async httpSend(t,r,a={}){var o;if(r==null)return Promise.reject("Payload is required for httpSend()");let n={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(n.Authorization=`Bearer ${this.socket.accessTokenValue}`);let s={method:"POST",headers:n,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},i=await this._fetchWithTimeout(this.broadcastEndpointURL,s,(o=a.timeout)!==null&&o!==void 0?o:this.timeout);if(i.status===202)return{success:!0};let l=i.statusText;try{let u=await i.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(t,r={}){var a,o;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");let{event:n,payload:s}=t,i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);let l={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:s,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(a=r.timeout)!==null&&a!==void 0?a:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var s,i,l;let u=this._push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(i=(s=this.params)===null||s===void 0?void 0:s.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),u.receive("ok",()=>n("ok")),u.receive("error",()=>n("error")),u.receive("timeout",()=>n("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Ke.leaving;let r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Zt.close,"leave",this._joinRef())};this.joinPush.destroy();let a=null;return new Promise(o=>{a=new an(this,Zt.leave,{},t),a.receive("ok",()=>{r(),o("ok")}).receive("timeout",()=>{r(),o("timed out")}).receive("error",()=>{o("error")}),a.send(),this._canPush()||a.trigger("ok",{})}).finally(()=>{a?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ke.closed,this.bindings={}}async _fetchWithTimeout(t,r,a){let o=new AbortController,n=setTimeout(()=>o.abort(),a),s=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:o.signal}));return clearTimeout(n),s}_push(t,r,a=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new an(this,t,r,a);return this._canPush()?o.send():this._addToPushBuffer(o),o}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>Ww){let r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(t,r,a){return r}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,r,a){var o,n;let s=t.toLocaleLowerCase(),{close:i,error:l,leave:u,join:c}=Zt;if(a&&[i,l,u,c].indexOf(s)>=0&&a!==this._joinRef())return;let f=this._onMessage(s,r,a);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(m=>{var v,x,b;return((v=m.filter)===null||v===void 0?void 0:v.event)==="*"||((b=(x=m.filter)===null||x===void 0?void 0:x.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===s}).map(m=>m.callback(f,a)):(n=this.bindings[s])===null||n===void 0||n.filter(m=>{var v,x,b,g,h,y,w,L;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in m){let P=m.id,_=(v=m.filter)===null||v===void 0?void 0:v.event;return P&&((x=r.ids)===null||x===void 0?void 0:x.includes(P))&&(_==="*"||_?.toLocaleLowerCase()===((b=r.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))&&(!(!((g=m.filter)===null||g===void 0)&&g.table)||m.filter.table===((h=r.data)===null||h===void 0?void 0:h.table))}else{let P=(w=(y=m?.filter)===null||y===void 0?void 0:y.event)===null||w===void 0?void 0:w.toLocaleLowerCase();return P==="*"||P===((L=r?.event)===null||L===void 0?void 0:L.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===s}).map(m=>{if(typeof f=="object"&&"ids"in f){let v=f.data,{schema:x,table:b,commit_timestamp:g,type:h,errors:y}=v;f=Object.assign(Object.assign({},{schema:x,table:b,commit_timestamp:g,eventType:h,new:{},old:{},errors:y}),this._getPayloadRecords(v))}m.callback(f,a)})}_isClosed(){return this.state===Ke.closed}_isJoined(){return this.state===Ke.joined}_isJoining(){return this.state===Ke.joining}_isLeaving(){return this.state===Ke.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,r,a){let o=t.toLocaleLowerCase(),n={type:o,filter:r,callback:a};return this.bindings[o]?this.bindings[o].push(n):this.bindings[o]=[n],this}_off(t,r){let a=t.toLocaleLowerCase();return this.bindings[a]&&(this.bindings[a]=this.bindings[a].filter(o=>{var n;return!(((n=o.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===a&&e.isEqual(o.filter,r))})),this}static isEqual(t,r){if(Object.keys(t).length!==Object.keys(r).length)return!1;for(let a in t)if(t[a]!==r[a])return!1;return!0}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Zt.close,{},t)}_onError(t){this._on(Zt.error,{},r=>t(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Ke.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=eg(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=eg(t.columns,t.old_record)),r}};var ag=()=>{},ud={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},h_=[1e3,2e3,5e3,1e4],g_=1e4,y_=`
|
|
8
|
+
`+n.stack}return{value:e,source:t,stack:o,digest:null}}function mm(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Qm(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var GT=typeof WeakMap=="function"?WeakMap:Map;function uw(e,t,a){a=sr(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){Wd||(Wd=!0,sh=r),Qm(e,t)},a}function dw(e,t,a){a=sr(-1,a),a.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;a.payload=function(){return r(o)},a.callback=function(){Qm(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Qm(e,t),typeof r!="function"&&($r===null?$r=new Set([this]):$r.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function Sv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new GT;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(a)||(o.add(a),e=i1.bind(null,e,t,a),t.then(e,e))}function Cv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Lv(e,t,a,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(t=sr(-1,1),t.tag=2,zr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var KT=cr.ReactCurrentOwner,Nt=!1;function Pt(e,t,a,r){t.child=e===null?U0(t,null,a,r):is(t,e.child,a,r)}function bv(e,t,a,r,o){a=a.render;var n=t.ref;return as(t,o),r=Bh(e,t,a,r,n,o),a=Uh(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,dr(e,t,o)):(Ae&&a&&kh(t),t.flags|=1,Pt(e,t,r,o),t.child)}function Iv(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Xh(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,cw(e,t,n,r,o)):(e=Id(a.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,(e.lanes&o)===0){var s=n.memoizedProps;if(a=a.compare,a=a!==null?a:fl,a(s,r)&&e.ref===t.ref)return dr(e,t,o)}return t.flags|=1,e=Gr(n,r),e.ref=t.ref,e.return=t,t.child=e}function cw(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(fl(n,r)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,dr(e,t,o)}return Jm(e,t,a,r,o)}function fw(e,t,a){var r=t.pendingProps,o=r.children,n=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},we(Jn,Wt),Wt|=a;else{if((a&1073741824)===0)return e=n!==null?n.baseLanes|a:a,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,we(Jn,Wt),Wt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,we(Jn,Wt),Wt|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,we(Jn,Wt),Wt|=r;return Pt(e,t,o,a),t.child}function pw(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Jm(e,t,a,r,o){var n=Ft(a)?Bo:wt.current;return n=ns(t,n),as(t,o),a=Bh(e,t,a,r,n,o),r=Uh(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,dr(e,t,o)):(Ae&&r&&kh(t),t.flags|=1,Pt(e,t,a,o),t.child)}function kv(e,t,a,r,o){if(Ft(a)){var n=!0;Od(t)}else n=!1;if(as(t,o),t.stateNode===null)Cd(e,t),lw(t,a,r),Xm(t,a,r,o),r=!0;else if(e===null){var s=t.stateNode,i=t.memoizedProps;s.props=i;var l=s.context,u=a.contextType;typeof u=="object"&&u!==null?u=fa(u):(u=Ft(a)?Bo:wt.current,u=ns(t,u));var d=a.getDerivedStateFromProps,c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==r||l!==u)&&wv(t,s,r,u),Nr=!1;var f=t.memoizedState;s.state=f,jd(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Ot.current||Nr?(typeof d=="function"&&(Km(t,a,d,r),l=t.memoizedState),(i=Nr||vv(t,a,i,r,f,l,u))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=i):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,j0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:Ca(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=fa(l):(l=Ft(a)?Bo:wt.current,l=ns(t,l));var m=a.getDerivedStateFromProps;(d=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(i!==c||f!==l)&&wv(t,s,r,l),Nr=!1,f=t.memoizedState,s.state=f,jd(t,r,s,o);var x=t.memoizedState;i!==c||f!==x||Ot.current||Nr?(typeof m=="function"&&(Km(t,a,m,r),x=t.memoizedState),(u=Nr||vv(t,a,u,r,f,x,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ym(e,t,a,r,n,o)}function Ym(e,t,a,r,o,n){pw(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&cv(t,a,!1),dr(e,t,n);r=t.stateNode,KT.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=is(t,e.child,null,n),t.child=is(t,null,i,n)):Pt(e,t,i,n),t.memoizedState=r.state,o&&cv(t,a,!0),t.child}function mw(e){var t=e.stateNode;t.pendingContext?dv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dv(e,t.context,!1),Mh(e,t.containerInfo)}function Pv(e,t,a,r,o){return ss(),Th(o),t.flags|=256,Pt(e,t,a,r),t.child}var Zm={dehydrated:null,treeContext:null,retryLane:0};function eh(e){return{baseLanes:e,cachePool:null,transitions:null}}function hw(e,t,a){var r=t.pendingProps,o=Re.current,n=!1,s=(t.flags&128)!==0,i;if((i=s)||(i=e!==null&&e.memoizedState===null?!1:(o&2)!==0),i?(n=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),we(Re,o&1),e===null)return Wm(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,n?(r=t.mode,n=t.child,s={mode:"hidden",children:s},(r&1)===0&&n!==null?(n.childLanes=0,n.pendingProps=s):n=sc(s,r,0,null),e=Fo(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=eh(a),t.memoizedState=Zm,e):qh(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return XT(e,t,s,r,i,o,a);if(n){n=r.fallback,s=t.mode,o=e.child,i=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Gr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Gr(i,n):(n=Fo(n,s,a,null),n.flags|=2),n.return=t,r.return=t,r.sibling=n,t.child=r,r=n,n=t.child,s=e.child.memoizedState,s=s===null?eh(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=Zm,r}return n=e.child,e=n.sibling,r=Gr(n,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=a),r.return=t,r.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=r,t.memoizedState=null,r}function qh(e,t){return t=sc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function pd(e,t,a,r){return r!==null&&Th(r),is(t,e.child,null,a),e=qh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function XT(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=mm(Error(_(422))),pd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=sc({mode:"visible",children:r.children},o,0,null),n=Fo(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&is(t,e.child,null,s),t.child.memoizedState=eh(s),t.memoizedState=Zm,n);if((t.mode&1)===0)return pd(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var i=r.dgst;return r=i,n=Error(_(419)),r=mm(n,r,void 0),pd(e,t,s,r)}if(i=(s&e.childLanes)!==0,Nt||i){if(r=tt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==n.retryLane&&(n.retryLane=o,ur(e,o),ka(r,e,o,-1))}return Kh(),r=mm(Error(_(421))),pd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=l1.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Gt=Hr(o.nextSibling),Kt=t,Ae=!0,ba=null,e!==null&&(la[ua++]=or,la[ua++]=nr,la[ua++]=Uo,or=e.id,nr=e.overflow,Uo=t),t=qh(t,r.children),t.flags|=4096,t)}function Tv(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gm(e.return,t,a)}function hm(e,t,a,r,o){var n=e.memoizedState;n===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:a,tailMode:o}:(n.isBackwards=t,n.rendering=null,n.renderingStartTime=0,n.last=r,n.tail=a,n.tailMode=o)}function gw(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(Pt(e,t,r.children,a),r=Re.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tv(e,a,t);else if(e.tag===19)Tv(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(we(Re,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(a=t.child,o=null;a!==null;)e=a.alternate,e!==null&&qd(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),hm(t,!1,o,a,n);break;case"backwards":for(a=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&qd(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}hm(t,!0,a,null,n);break;case"together":hm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Cd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function dr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),jo|=t.lanes,(a&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,a=Gr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Gr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function QT(e,t,a){switch(t.tag){case 3:mw(t),ss();break;case 5:q0(t);break;case 1:Ft(t.type)&&Od(t);break;case 4:Mh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;we(Ud,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(we(Re,Re.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?hw(e,t,a):(we(Re,Re.current&1),e=dr(e,t,a),e!==null?e.sibling:null);we(Re,Re.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return gw(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(Re,Re.current),r)break;return null;case 22:case 23:return t.lanes=0,fw(e,t,a)}return dr(e,t,a)}var yw,th,xw,vw;yw=function(e,t){for(var a=t.child;a!==null;){if(a.tag===5||a.tag===6)e.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};th=function(){};xw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,No(Ba.current);var n=null;switch(a){case"input":o=Lm(e,o),r=Lm(e,r),n=[];break;case"select":o=Ee({},o,{value:void 0}),r=Ee({},r,{value:void 0}),n=[];break;case"textarea":o=km(e,o),r=km(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Md)}Tm(a,r);var s;a=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var i=o[u];for(s in i)i.hasOwnProperty(s)&&(a||(a={}),a[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(nl.hasOwnProperty(u)?n||(n=[]):(n=n||[]).push(u,null));for(u in r){var l=r[u];if(i=o?.[u],r.hasOwnProperty(u)&&l!==i&&(l!=null||i!=null))if(u==="style")if(i){for(s in i)!i.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(a||(a={}),a[s]="");for(s in l)l.hasOwnProperty(s)&&i[s]!==l[s]&&(a||(a={}),a[s]=l[s])}else a||(n||(n=[]),n.push(u,a)),a=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,i=i?i.__html:void 0,l!=null&&i!==l&&(n=n||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(n=n||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(nl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&be("scroll",e),n||i===l||(n=[])):(n=n||[]).push(u,l))}a&&(n=n||[]).push("style",a);var u=n;(t.updateQueue=u)&&(t.flags|=4)}};vw=function(e,t,a,r){a!==r&&(t.flags|=4)};function Hi(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var r=null;a!==null;)a.alternate!==null&&(r=a),a=a.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,r=0;if(t)for(var o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)a|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=a,t}function JT(e,t,a){var r=t.pendingProps;switch(Ph(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return Ft(t.type)&&Nd(),xt(t),null;case 3:return r=t.stateNode,ls(),Ie(Ot),Ie(wt),Oh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(cd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ba!==null&&(uh(ba),ba=null))),th(e,t),xt(t),null;case 5:Nh(t);var o=No(yl.current);if(a=t.type,e!==null&&t.stateNode!=null)xw(e,t,a,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return xt(t),null}if(e=No(Ba.current),cd(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Oa]=t,r[hl]=n,e=(t.mode&1)!==0,a){case"dialog":be("cancel",r),be("close",r);break;case"iframe":case"object":case"embed":be("load",r);break;case"video":case"audio":for(o=0;o<Xi.length;o++)be(Xi[o],r);break;case"source":be("error",r);break;case"img":case"image":case"link":be("error",r),be("load",r);break;case"details":be("toggle",r);break;case"input":Ox(r,n),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},be("invalid",r);break;case"textarea":Bx(r,n),be("invalid",r)}Tm(a,n),o=null;for(var s in n)if(n.hasOwnProperty(s)){var i=n[s];s==="children"?typeof i=="string"?r.textContent!==i&&(n.suppressHydrationWarning!==!0&&dd(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&dd(r.textContent,i,e),o=["children",""+i]):nl.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&be("scroll",r)}switch(a){case"input":Yu(r),Fx(r,n,!0);break;case"textarea":Yu(r),Ux(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Md)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Gv(a)),e==="http://www.w3.org/1999/xhtml"?a==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(a,{is:r.is}):(e=s.createElement(a),a==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,a),e[Oa]=t,e[hl]=r,yw(e,t,!1,!1),t.stateNode=e;e:{switch(s=Am(a,r),a){case"dialog":be("cancel",e),be("close",e),o=r;break;case"iframe":case"object":case"embed":be("load",e),o=r;break;case"video":case"audio":for(o=0;o<Xi.length;o++)be(Xi[o],e);o=r;break;case"source":be("error",e),o=r;break;case"img":case"image":case"link":be("error",e),be("load",e),o=r;break;case"details":be("toggle",e),o=r;break;case"input":Ox(e,r),o=Lm(e,r),be("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ee({},r,{value:void 0}),be("invalid",e);break;case"textarea":Bx(e,r),o=km(e,r),be("invalid",e);break;default:o=r}Tm(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?Qv(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Kv(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&sl(e,l):typeof l=="number"&&sl(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(nl.hasOwnProperty(n)?l!=null&&n==="onScroll"&&be("scroll",e):l!=null&&fh(e,n,l,s))}switch(a){case"input":Yu(e),Fx(e,r,!1);break;case"textarea":Yu(e),Ux(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Yn(e,!!r.multiple,n,!1):r.defaultValue!=null&&Yn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Md)}switch(a){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xt(t),null;case 6:if(e&&t.stateNode!=null)vw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(a=No(yl.current),No(Ba.current),cd(t)){if(r=t.stateNode,a=t.memoizedProps,r[Oa]=t,(n=r.nodeValue!==a)&&(e=Kt,e!==null))switch(e.tag){case 3:dd(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&dd(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Oa]=t,t.stateNode=r}return xt(t),null;case 13:if(Ie(Re),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&Gt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)F0(),ss(),t.flags|=98560,n=!1;else if(n=cd(t),r!==null&&r.dehydrated!==null){if(e===null){if(!n)throw Error(_(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(_(317));n[Oa]=t}else ss(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),n=!1}else ba!==null&&(uh(ba),ba=null),n=!0;if(!n)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=a,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Re.current&1)!==0?Xe===0&&(Xe=3):Kh())),t.updateQueue!==null&&(t.flags|=4),xt(t),null);case 4:return ls(),th(e,t),e===null&&pl(t.stateNode.containerInfo),xt(t),null;case 10:return _h(t.type._context),xt(t),null;case 17:return Ft(t.type)&&Nd(),xt(t),null;case 19:if(Ie(Re),n=t.memoizedState,n===null)return xt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Hi(n,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=qd(e),s!==null){for(t.flags|=128,Hi(n,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=a,a=t.child;a!==null;)n=a,e=r,n.flags&=14680066,s=n.alternate,s===null?(n.childLanes=0,n.lanes=e,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=s.childLanes,n.lanes=s.lanes,n.child=s.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=s.memoizedProps,n.memoizedState=s.memoizedState,n.updateQueue=s.updateQueue,n.type=s.type,e=s.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),a=a.sibling;return we(Re,Re.current&1|2),t.child}e=e.sibling}n.tail!==null&&Be()>ds&&(t.flags|=128,r=!0,Hi(n,!1),t.lanes=4194304)}else{if(!r)if(e=qd(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),Hi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Ae)return xt(t),null}else 2*Be()-n.renderingStartTime>ds&&a!==1073741824&&(t.flags|=128,r=!0,Hi(n,!1),t.lanes=4194304);n.isBackwards?(s.sibling=t.child,t.child=s):(a=n.last,a!==null?a.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(t=n.tail,n.rendering=t,n.tail=t.sibling,n.renderingStartTime=Be(),t.sibling=null,a=Re.current,we(Re,r?a&1|2:a&1),t):(xt(t),null);case 22:case 23:return Gh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Wt&1073741824)!==0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function YT(e,t){switch(Ph(t),t.tag){case 1:return Ft(t.type)&&Nd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ls(),Ie(Ot),Ie(wt),Oh(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Nh(t),null;case 13:if(Ie(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Re),null;case 4:return ls(),null;case 10:return _h(t.type._context),null;case 22:case 23:return Gh(),null;case 24:return null;default:return null}}var md=!1,vt=!1,ZT=typeof WeakSet=="function"?WeakSet:Set,B=null;function Qn(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Ne(e,t,r)}else a.current=null}function ah(e,t,a){try{a()}catch(r){Ne(e,t,r)}}var Av=!1;function e1(e,t){if(Um=_d,e=b0(),Ih(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var r=a.getSelection&&a.getSelection();if(r&&r.rangeCount!==0){a=r.anchorNode;var o=r.anchorOffset,n=r.focusNode;r=r.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break e}var s=0,i=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==a||o!==0&&c.nodeType!==3||(i=s+o),c!==n||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===a&&++u===o&&(i=s),f===n&&++d===r&&(l=s),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}a=i===-1||l===-1?null:{start:i,end:l}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vm={focusedElem:e,selectionRange:a},_d=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var x=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,b=x.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ca(t.type,w),b);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(C){Ne(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return x=Av,Av=!1,x}function al(e,t,a){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var n=o.destroy;o.destroy=void 0,n!==void 0&&ah(t,a,n)}o=o.next}while(o!==r)}}function oc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var a=t=t.next;do{if((a.tag&e)===e){var r=a.create;a.destroy=r()}a=a.next}while(a!==t)}}function rh(e){var t=e.ref;if(t!==null){var a=e.stateNode;e.tag,e=a,typeof t=="function"?t(e):t.current=e}}function ww(e){var t=e.alternate;t!==null&&(e.alternate=null,ww(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Oa],delete t[hl],delete t[Hm],delete t[OT],delete t[FT])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Sw(e){return e.tag===5||e.tag===3||e.tag===4}function Rv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function oh(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Md));else if(r!==4&&(e=e.child,e!==null))for(oh(e,t,a),e=e.sibling;e!==null;)oh(e,t,a),e=e.sibling}function nh(e,t,a){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(nh(e,t,a),e=e.sibling;e!==null;)nh(e,t,a),e=e.sibling}var st=null,La=!1;function Dr(e,t,a){for(a=a.child;a!==null;)Cw(e,t,a),a=a.sibling}function Cw(e,t,a){if(Fa&&typeof Fa.onCommitFiberUnmount=="function")try{Fa.onCommitFiberUnmount(Qd,a)}catch{}switch(a.tag){case 5:vt||Qn(a,t);case 6:var r=st,o=La;st=null,Dr(e,t,a),st=r,La=o,st!==null&&(La?(e=st,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):st.removeChild(a.stateNode));break;case 18:st!==null&&(La?(e=st,a=a.stateNode,e.nodeType===8?lm(e.parentNode,a):e.nodeType===1&&lm(e,a),dl(e)):lm(st,a.stateNode));break;case 4:r=st,o=La,st=a.stateNode.containerInfo,La=!0,Dr(e,t,a),st=r,La=o;break;case 0:case 11:case 14:case 15:if(!vt&&(r=a.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var n=o,s=n.destroy;n=n.tag,s!==void 0&&((n&2)!==0||(n&4)!==0)&&ah(a,t,s),o=o.next}while(o!==r)}Dr(e,t,a);break;case 1:if(!vt&&(Qn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Ne(a,t,i)}Dr(e,t,a);break;case 21:Dr(e,t,a);break;case 22:a.mode&1?(vt=(r=vt)||a.memoizedState!==null,Dr(e,t,a),vt=r):Dr(e,t,a);break;default:Dr(e,t,a)}}function _v(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new ZT),t.forEach(function(r){var o=u1.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function Sa(e,t){var a=t.deletions;if(a!==null)for(var r=0;r<a.length;r++){var o=a[r];try{var n=e,s=t,i=s;e:for(;i!==null;){switch(i.tag){case 5:st=i.stateNode,La=!1;break e;case 3:st=i.stateNode.containerInfo,La=!0;break e;case 4:st=i.stateNode.containerInfo,La=!0;break e}i=i.return}if(st===null)throw Error(_(160));Cw(n,s,o),st=null,La=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ne(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Lw(t,e),t=t.sibling}function Lw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Sa(t,e),Ma(e),r&4){try{al(3,e,e.return),oc(3,e)}catch(w){Ne(e,e.return,w)}try{al(5,e,e.return)}catch(w){Ne(e,e.return,w)}}break;case 1:Sa(t,e),Ma(e),r&512&&a!==null&&Qn(a,a.return);break;case 5:if(Sa(t,e),Ma(e),r&512&&a!==null&&Qn(a,a.return),e.flags&32){var o=e.stateNode;try{sl(o,"")}catch(w){Ne(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var n=e.memoizedProps,s=a!==null?a.memoizedProps:n,i=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{i==="input"&&n.type==="radio"&&n.name!=null&&$v(o,n),Am(i,s);var u=Am(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Qv(o,c):d==="dangerouslySetInnerHTML"?Kv(o,c):d==="children"?sl(o,c):fh(o,d,c,u)}switch(i){case"input":bm(o,n);break;case"textarea":Wv(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var m=n.value;m!=null?Yn(o,!!n.multiple,m,!1):f!==!!n.multiple&&(n.defaultValue!=null?Yn(o,!!n.multiple,n.defaultValue,!0):Yn(o,!!n.multiple,n.multiple?[]:"",!1))}o[hl]=n}catch(w){Ne(e,e.return,w)}}break;case 6:if(Sa(t,e),Ma(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){Ne(e,e.return,w)}}break;case 3:if(Sa(t,e),Ma(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{dl(t.containerInfo)}catch(w){Ne(e,e.return,w)}break;case 4:Sa(t,e),Ma(e);break;case 13:Sa(t,e),Ma(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||($h=Be())),r&4&&_v(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(vt=(u=vt)||d,Sa(t,e),vt=u):Sa(t,e),Ma(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&(e.mode&1)!==0)for(B=e,d=e.child;d!==null;){for(c=B=d;B!==null;){switch(f=B,m=f.child,f.tag){case 0:case 11:case 14:case 15:al(4,f,f.return);break;case 1:Qn(f,f.return);var x=f.stateNode;if(typeof x.componentWillUnmount=="function"){r=f,a=f.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(w){Ne(r,a,w)}}break;case 5:Qn(f,f.return);break;case 22:if(f.memoizedState!==null){Dv(c);continue}}m!==null?(m.return=f,B=m):Dv(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{o=c.stateNode,u?(n=o.style,typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"):(i=c.stateNode,l=c.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,i.style.display=Xv("display",s))}catch(w){Ne(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Ne(e,e.return,w)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;d===c&&(d=null),c=c.return}d===c&&(d=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:Sa(t,e),Ma(e),r&4&&_v(e);break;case 21:break;default:Sa(t,e),Ma(e)}}function Ma(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(Sw(a)){var r=a;break e}a=a.return}throw Error(_(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(sl(o,""),r.flags&=-33);var n=Rv(e);nh(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=Rv(e);oh(e,i,s);break;default:throw Error(_(161))}}catch(l){Ne(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function t1(e,t,a){B=e,bw(e,t,a)}function bw(e,t,a){for(var r=(e.mode&1)!==0;B!==null;){var o=B,n=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||md;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||vt;i=md;var u=vt;if(md=s,(vt=l)&&!u)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?Mv(o):l!==null?(l.return=s,B=l):Mv(o);for(;n!==null;)B=n,bw(n,t,a),n=n.sibling;B=o,md=i,vt=u}Ev(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,B=n):Ev(e,t,a)}}function Ev(e){for(;B!==null;){var t=B;if((t.flags&8772)!==0){var a=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:vt||oc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!vt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:Ca(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&gv(t,n,r);break;case 3:var s=t.updateQueue;if(s!==null){if(a=null,t.child!==null)switch(t.child.tag){case 5:a=t.child.stateNode;break;case 1:a=t.child.stateNode}gv(t,s,a)}break;case 5:var i=t.stateNode;if(a===null&&t.flags&4){a=i;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break;case"img":l.src&&(a.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var c=d.dehydrated;c!==null&&dl(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}vt||t.flags&512&&rh(t)}catch(f){Ne(t,t.return,f)}}if(t===e){B=null;break}if(a=t.sibling,a!==null){a.return=t.return,B=a;break}B=t.return}}function Dv(e){for(;B!==null;){var t=B;if(t===e){B=null;break}var a=t.sibling;if(a!==null){a.return=t.return,B=a;break}B=t.return}}function Mv(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{oc(4,t)}catch(l){Ne(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ne(t,o,l)}}var n=t.return;try{rh(t)}catch(l){Ne(t,n,l)}break;case 5:var s=t.return;try{rh(t)}catch(l){Ne(t,s,l)}}}catch(l){Ne(t,t.return,l)}if(t===e){B=null;break}var i=t.sibling;if(i!==null){i.return=t.return,B=i;break}B=t.return}}var a1=Math.ceil,$d=cr.ReactCurrentDispatcher,Hh=cr.ReactCurrentOwner,ca=cr.ReactCurrentBatchConfig,de=0,tt=null,qe=null,it=0,Wt=0,Jn=Jr(0),Xe=0,Sl=null,jo=0,nc=0,zh=0,rl=null,Mt=null,$h=0,ds=1/0,ar=null,Wd=!1,sh=null,$r=null,hd=!1,Ur=null,Gd=0,ol=0,ih=null,Ld=-1,bd=0;function Tt(){return(de&6)!==0?Be():Ld!==-1?Ld:Ld=Be()}function Wr(e){return(e.mode&1)===0?1:(de&2)!==0&&it!==0?it&-it:UT.transition!==null?(bd===0&&(bd=l0()),bd):(e=he,e!==0||(e=window.event,e=e===void 0?16:h0(e.type)),e)}function ka(e,t,a,r){if(50<ol)throw ol=0,ih=null,Error(_(185));Cl(e,a,r),((de&2)===0||e!==tt)&&(e===tt&&((de&2)===0&&(nc|=a),Xe===4&&Fr(e,it)),Bt(e,r),a===1&&de===0&&(t.mode&1)===0&&(ds=Be()+500,tc&&Yr()))}function Bt(e,t){var a=e.callbackNode;jP(e,t);var r=Rd(e,e===tt?it:0);if(r===0)a!==null&&qx(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&qx(a),t===1)e.tag===0?BT(Nv.bind(null,e)):M0(Nv.bind(null,e)),MT(function(){(de&6)===0&&Yr()}),a=null;else{switch(u0(r)){case 1:a=yh;break;case 4:a=s0;break;case 16:a=Ad;break;case 536870912:a=i0;break;default:a=Ad}a=Ew(a,Iw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Iw(e,t){if(Ld=-1,bd=0,(de&6)!==0)throw Error(_(327));var a=e.callbackNode;if(rs()&&e.callbackNode!==a)return null;var r=Rd(e,e===tt?it:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Kd(e,r);else{t=r;var o=de;de|=2;var n=Pw();(tt!==e||it!==t)&&(ar=null,ds=Be()+500,Oo(e,t));do try{n1();break}catch(i){kw(e,i)}while(!0);Rh(),$d.current=n,de=o,qe!==null?t=0:(tt=null,it=0,t=Xe)}if(t!==0){if(t===2&&(o=Mm(e),o!==0&&(r=o,t=lh(e,o))),t===1)throw a=Sl,Oo(e,0),Fr(e,r),Bt(e,Be()),a;if(t===6)Fr(e,r);else{if(o=e.current.alternate,(r&30)===0&&!r1(o)&&(t=Kd(e,r),t===2&&(n=Mm(e),n!==0&&(r=n,t=lh(e,n))),t===1))throw a=Sl,Oo(e,0),Fr(e,r),Bt(e,Be()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:Eo(e,Mt,ar);break;case 3:if(Fr(e,r),(r&130023424)===r&&(t=$h+500-Be(),10<t)){if(Rd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Tt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=qm(Eo.bind(null,e,Mt,ar),t);break}Eo(e,Mt,ar);break;case 4:if(Fr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Ia(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=Be()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*a1(r/1960))-r,10<r){e.timeoutHandle=qm(Eo.bind(null,e,Mt,ar),r);break}Eo(e,Mt,ar);break;case 5:Eo(e,Mt,ar);break;default:throw Error(_(329))}}}return Bt(e,Be()),e.callbackNode===a?Iw.bind(null,e):null}function lh(e,t){var a=rl;return e.current.memoizedState.isDehydrated&&(Oo(e,t).flags|=256),e=Kd(e,t),e!==2&&(t=Mt,Mt=a,t!==null&&uh(t)),e}function uh(e){Mt===null?Mt=e:Mt.push.apply(Mt,e)}function r1(e){for(var t=e;;){if(t.flags&16384){var a=t.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var r=0;r<a.length;r++){var o=a[r],n=o.getSnapshot;o=o.value;try{if(!Pa(n(),o))return!1}catch{return!1}}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Fr(e,t){for(t&=~zh,t&=~nc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-Ia(t),r=1<<a;e[a]=-1,t&=~r}}function Nv(e){if((de&6)!==0)throw Error(_(327));rs();var t=Rd(e,0);if((t&1)===0)return Bt(e,Be()),null;var a=Kd(e,t);if(e.tag!==0&&a===2){var r=Mm(e);r!==0&&(t=r,a=lh(e,r))}if(a===1)throw a=Sl,Oo(e,0),Fr(e,t),Bt(e,Be()),a;if(a===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Eo(e,Mt,ar),Bt(e,Be()),null}function Wh(e,t){var a=de;de|=1;try{return e(t)}finally{de=a,de===0&&(ds=Be()+500,tc&&Yr())}}function qo(e){Ur!==null&&Ur.tag===0&&(de&6)===0&&rs();var t=de;de|=1;var a=ca.transition,r=he;try{if(ca.transition=null,he=1,e)return e()}finally{he=r,ca.transition=a,de=t,(de&6)===0&&Yr()}}function Gh(){Wt=Jn.current,Ie(Jn)}function Oo(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,DT(a)),qe!==null)for(a=qe.return;a!==null;){var r=a;switch(Ph(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Nd();break;case 3:ls(),Ie(Ot),Ie(wt),Oh();break;case 5:Nh(r);break;case 4:ls();break;case 13:Ie(Re);break;case 19:Ie(Re);break;case 10:_h(r.type._context);break;case 22:case 23:Gh()}a=a.return}if(tt=e,qe=e=Gr(e.current,null),it=Wt=t,Xe=0,Sl=null,zh=nc=jo=0,Mt=rl=null,Mo!==null){for(t=0;t<Mo.length;t++)if(a=Mo[t],r=a.interleaved,r!==null){a.interleaved=null;var o=r.next,n=a.pending;if(n!==null){var s=n.next;n.next=o,r.next=s}a.pending=r}Mo=null}return e}function kw(e,t){do{var a=qe;try{if(Rh(),wd.current=zd,Hd){for(var r=_e.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Hd=!1}if(Vo=0,et=Ke=_e=null,tl=!1,xl=0,Hh.current=null,a===null||a.return===null){Xe=1,Sl=t,qe=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=it,i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=i,c=d.tag;if((d.mode&1)===0&&(c===0||c===11||c===15)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Cv(s);if(m!==null){m.flags&=-257,Lv(m,s,i,n,t),m.mode&1&&Sv(n,u,t),t=m,l=u;var x=t.updateQueue;if(x===null){var w=new Set;w.add(l),t.updateQueue=w}else x.add(l);break e}else{if((t&1)===0){Sv(n,u,t),Kh();break e}l=Error(_(426))}}else if(Ae&&i.mode&1){var b=Cv(s);if(b!==null){(b.flags&65536)===0&&(b.flags|=256),Lv(b,s,i,n,t),Th(us(l,i));break e}}n=l=us(l,i),Xe!==4&&(Xe=2),rl===null?rl=[n]:rl.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var h=uw(n,l,t);hv(n,h);break e;case 1:i=l;var g=n.type,y=n.stateNode;if((n.flags&128)===0&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&($r===null||!$r.has(y)))){n.flags|=65536,t&=-t,n.lanes|=t;var C=dw(n,i,t);hv(n,C);break e}}n=n.return}while(n!==null)}Aw(a)}catch(L){t=L,qe===a&&a!==null&&(qe=a=a.return);continue}break}while(!0)}function Pw(){var e=$d.current;return $d.current=zd,e===null?zd:e}function Kh(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),tt===null||(jo&268435455)===0&&(nc&268435455)===0||Fr(tt,it)}function Kd(e,t){var a=de;de|=2;var r=Pw();(tt!==e||it!==t)&&(ar=null,Oo(e,t));do try{o1();break}catch(o){kw(e,o)}while(!0);if(Rh(),de=a,$d.current=r,qe!==null)throw Error(_(261));return tt=null,it=0,Xe}function o1(){for(;qe!==null;)Tw(qe)}function n1(){for(;qe!==null&&!EP();)Tw(qe)}function Tw(e){var t=_w(e.alternate,e,Wt);e.memoizedProps=e.pendingProps,t===null?Aw(e):qe=t,Hh.current=null}function Aw(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=JT(a,t,Wt),a!==null){qe=a;return}}else{if(a=YT(a,t),a!==null){a.flags&=32767,qe=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xe=6,qe=null;return}}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);Xe===0&&(Xe=5)}function Eo(e,t,a){var r=he,o=ca.transition;try{ca.transition=null,he=1,s1(e,t,a,r)}finally{ca.transition=o,he=r}return null}function s1(e,t,a,r){do rs();while(Ur!==null);if((de&6)!==0)throw Error(_(327));a=e.finishedWork;var o=e.finishedLanes;if(a===null)return null;if(e.finishedWork=null,e.finishedLanes=0,a===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var n=a.lanes|a.childLanes;if(qP(e,n),e===tt&&(qe=tt=null,it=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||hd||(hd=!0,Ew(Ad,function(){return rs(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=ca.transition,ca.transition=null;var s=he;he=1;var i=de;de|=4,Hh.current=null,e1(e,a),Lw(a,e),TT(Vm),_d=!!Um,Vm=Um=null,e.current=a,t1(a,e,o),DP(),de=i,he=s,ca.transition=n}else e.current=a;if(hd&&(hd=!1,Ur=e,Gd=o),n=e.pendingLanes,n===0&&($r=null),OP(a.stateNode,r),Bt(e,Be()),t!==null)for(r=e.onRecoverableError,a=0;a<t.length;a++)o=t[a],r(o.value,{componentStack:o.stack,digest:o.digest});if(Wd)throw Wd=!1,e=sh,sh=null,e;return(Gd&1)!==0&&e.tag!==0&&rs(),n=e.pendingLanes,(n&1)!==0?e===ih?ol++:(ol=0,ih=e):ol=0,Yr(),null}function rs(){if(Ur!==null){var e=u0(Gd),t=ca.transition,a=he;try{if(ca.transition=null,he=16>e?16:e,Ur===null)var r=!1;else{if(e=Ur,Ur=null,Gd=0,(de&6)!==0)throw Error(_(331));var o=de;for(de|=4,B=e.current;B!==null;){var n=B,s=n.child;if((B.flags&16)!==0){var i=n.deletions;if(i!==null){for(var l=0;l<i.length;l++){var u=i[l];for(B=u;B!==null;){var d=B;switch(d.tag){case 0:case 11:case 15:al(8,d,n)}var c=d.child;if(c!==null)c.return=d,B=c;else for(;B!==null;){d=B;var f=d.sibling,m=d.return;if(ww(d),d===u){B=null;break}if(f!==null){f.return=m,B=f;break}B=m}}}var x=n.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var b=w.sibling;w.sibling=null,w=b}while(w!==null)}}B=n}}if((n.subtreeFlags&2064)!==0&&s!==null)s.return=n,B=s;else e:for(;B!==null;){if(n=B,(n.flags&2048)!==0)switch(n.tag){case 0:case 11:case 15:al(9,n,n.return)}var h=n.sibling;if(h!==null){h.return=n.return,B=h;break e}B=n.return}}var g=e.current;for(B=g;B!==null;){s=B;var y=s.child;if((s.subtreeFlags&2064)!==0&&y!==null)y.return=s,B=y;else e:for(s=g;B!==null;){if(i=B,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:oc(9,i)}}catch(L){Ne(i,i.return,L)}if(i===s){B=null;break e}var C=i.sibling;if(C!==null){C.return=i.return,B=C;break e}B=i.return}}if(de=o,Yr(),Fa&&typeof Fa.onPostCommitFiberRoot=="function")try{Fa.onPostCommitFiberRoot(Qd,e)}catch{}r=!0}return r}finally{he=a,ca.transition=t}}return!1}function Ov(e,t,a){t=us(a,t),t=uw(e,t,1),e=zr(e,t,1),t=Tt(),e!==null&&(Cl(e,1,t),Bt(e,t))}function Ne(e,t,a){if(e.tag===3)Ov(e,e,a);else for(;t!==null;){if(t.tag===3){Ov(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&($r===null||!$r.has(r))){e=us(a,e),e=dw(t,e,1),t=zr(t,e,1),e=Tt(),t!==null&&(Cl(t,1,e),Bt(t,e));break}}t=t.return}}function i1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=Tt(),e.pingedLanes|=e.suspendedLanes&a,tt===e&&(it&a)===a&&(Xe===4||Xe===3&&(it&130023424)===it&&500>Be()-$h?Oo(e,0):zh|=a),Bt(e,t)}function Rw(e,t){t===0&&((e.mode&1)===0?t=1:(t=td,td<<=1,(td&130023424)===0&&(td=4194304)));var a=Tt();e=ur(e,t),e!==null&&(Cl(e,t,a),Bt(e,a))}function l1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Rw(e,a)}function u1(e,t){var a=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(a=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Rw(e,a)}var _w;_w=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ot.current)Nt=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return Nt=!1,QT(e,t,a);Nt=(e.flags&131072)!==0}else Nt=!1,Ae&&(t.flags&1048576)!==0&&N0(t,Bd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Cd(e,t),e=t.pendingProps;var o=ns(t,wt.current);as(t,a),o=Bh(null,t,r,e,o,a);var n=Uh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(r)?(n=!0,Od(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Dh(t),o.updater=rc,t.stateNode=o,o._reactInternals=t,Xm(t,r,e,a),t=Ym(null,t,r,!0,n,a)):(t.tag=0,Ae&&n&&kh(t),Pt(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(Cd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=c1(r),e=Ca(r,e),o){case 0:t=Jm(null,t,r,e,a);break e;case 1:t=kv(null,t,r,e,a);break e;case 11:t=bv(null,t,r,e,a);break e;case 14:t=Iv(null,t,r,Ca(r.type,e),a);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ca(r,o),Jm(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ca(r,o),kv(e,t,r,o,a);case 3:e:{if(mw(t),e===null)throw Error(_(387));r=t.pendingProps,n=t.memoizedState,o=n.element,j0(e,t),jd(t,r,null,a);var s=t.memoizedState;if(r=s.element,n.isDehydrated)if(n={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){o=us(Error(_(423)),t),t=Pv(e,t,r,a,o);break e}else if(r!==o){o=us(Error(_(424)),t),t=Pv(e,t,r,a,o);break e}else for(Gt=Hr(t.stateNode.containerInfo.firstChild),Kt=t,Ae=!0,ba=null,a=U0(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ss(),r===o){t=dr(e,t,a);break e}Pt(e,t,r,a)}t=t.child}return t;case 5:return q0(t),e===null&&Wm(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,jm(r,o)?s=null:n!==null&&jm(r,n)&&(t.flags|=32),pw(e,t),Pt(e,t,s,a),t.child;case 6:return e===null&&Wm(t),null;case 13:return hw(e,t,a);case 4:return Mh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=is(t,null,r,a):Pt(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ca(r,o),bv(e,t,r,o,a);case 7:return Pt(e,t,t.pendingProps,a),t.child;case 8:return Pt(e,t,t.pendingProps.children,a),t.child;case 12:return Pt(e,t,t.pendingProps.children,a),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,n=t.memoizedProps,s=o.value,we(Ud,r._currentValue),r._currentValue=s,n!==null)if(Pa(n.value,s)){if(n.children===o.children&&!Ot.current){t=dr(e,t,a);break e}}else for(n=t.child,n!==null&&(n.return=t);n!==null;){var i=n.dependencies;if(i!==null){s=n.child;for(var l=i.firstContext;l!==null;){if(l.context===r){if(n.tag===1){l=sr(-1,a&-a),l.tag=2;var u=n.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}n.lanes|=a,l=n.alternate,l!==null&&(l.lanes|=a),Gm(n.return,a,t),i.lanes|=a;break}l=l.next}}else if(n.tag===10)s=n.type===t.type?null:n.child;else if(n.tag===18){if(s=n.return,s===null)throw Error(_(341));s.lanes|=a,i=s.alternate,i!==null&&(i.lanes|=a),Gm(s,a,t),s=n.sibling}else s=n.child;if(s!==null)s.return=n;else for(s=n;s!==null;){if(s===t){s=null;break}if(n=s.sibling,n!==null){n.return=s.return,s=n;break}s=s.return}n=s}Pt(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,as(t,a),o=fa(o),r=r(o),t.flags|=1,Pt(e,t,r,a),t.child;case 14:return r=t.type,o=Ca(r,t.pendingProps),o=Ca(r.type,o),Iv(e,t,r,o,a);case 15:return cw(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ca(r,o),Cd(e,t),t.tag=1,Ft(r)?(e=!0,Od(t)):e=!1,as(t,a),lw(t,r,o),Xm(t,r,o,a),Ym(null,t,r,!0,e,a);case 19:return gw(e,t,a);case 22:return fw(e,t,a)}throw Error(_(156,t.tag))};function Ew(e,t){return n0(e,t)}function d1(e,t,a,r){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function da(e,t,a,r){return new d1(e,t,a,r)}function Xh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function c1(e){if(typeof e=="function")return Xh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mh)return 11;if(e===hh)return 14}return 2}function Gr(e,t){var a=e.alternate;return a===null?(a=da(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&14680064,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a}function Id(e,t,a,r,o,n){var s=2;if(r=e,typeof e=="function")Xh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case jn:return Fo(a.children,o,n,t);case ph:s=8,o|=8;break;case vm:return e=da(12,a,t,o|2),e.elementType=vm,e.lanes=n,e;case wm:return e=da(13,a,t,o),e.elementType=wm,e.lanes=n,e;case Sm:return e=da(19,a,t,o),e.elementType=Sm,e.lanes=n,e;case qv:return sc(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vv:s=10;break e;case jv:s=9;break e;case mh:s=11;break e;case hh:s=14;break e;case Mr:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=da(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Fo(e,t,a,r){return e=da(7,e,r,t),e.lanes=a,e}function sc(e,t,a,r){return e=da(22,e,r,t),e.elementType=qv,e.lanes=a,e.stateNode={isHidden:!1},e}function gm(e,t,a){return e=da(6,e,null,t),e.lanes=a,e}function ym(e,t,a){return t=da(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function f1(e,t,a,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=em(0),this.expirationTimes=em(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=em(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Qh(e,t,a,r,o,n,s,i,l){return e=new f1(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=da(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dh(n),e}function p1(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Dw(e){if(!e)return Xr;e=e._reactInternals;e:{if(zo(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var a=e.type;if(Ft(a))return D0(e,a,t)}return t}function Mw(e,t,a,r,o,n,s,i,l){return e=Qh(a,r,!0,e,o,n,s,i,l),e.context=Dw(null),a=e.current,r=Tt(),o=Wr(a),n=sr(r,o),n.callback=t??null,zr(a,n,o),e.current.lanes=o,Cl(e,o,r),Bt(e,r),e}function ic(e,t,a,r){var o=t.current,n=Tt(),s=Wr(o);return a=Dw(a),t.context===null?t.context=a:t.pendingContext=a,t=sr(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=zr(o,t,s),e!==null&&(ka(e,o,s,n),vd(e,o,s)),s}function Xd(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Fv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Jh(e,t){Fv(e,t),(e=e.alternate)&&Fv(e,t)}function m1(){return null}var Nw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Yh(e){this._internalRoot=e}lc.prototype.render=Yh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));ic(e,t,null,null)};lc.prototype.unmount=Yh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qo(function(){ic(null,e,null,null)}),t[lr]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var t=f0();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Or.length&&t!==0&&t<Or[a].priority;a++);Or.splice(a,0,e),a===0&&m0(e)}};function Zh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Bv(){}function h1(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=Xd(s);n.call(u)}}var s=Mw(t,r,e,0,null,!1,!1,"",Bv);return e._reactRootContainer=s,e[lr]=s.current,pl(e.nodeType===8?e.parentNode:e),qo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=Xd(l);i.call(u)}}var l=Qh(e,0,!1,null,null,!1,!1,"",Bv);return e._reactRootContainer=l,e[lr]=l.current,pl(e.nodeType===8?e.parentNode:e),qo(function(){ic(t,l,a,r)}),l}function dc(e,t,a,r,o){var n=a._reactRootContainer;if(n){var s=n;if(typeof o=="function"){var i=o;o=function(){var l=Xd(s);i.call(l)}}ic(t,s,e,o)}else s=h1(a,t,e,o,r);return Xd(s)}d0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=Ki(t.pendingLanes);a!==0&&(xh(t,a|1),Bt(t,Be()),(de&6)===0&&(ds=Be()+500,Yr()))}break;case 13:qo(function(){var r=ur(e,1);if(r!==null){var o=Tt();ka(r,e,1,o)}}),Jh(e,1)}};vh=function(e){if(e.tag===13){var t=ur(e,134217728);if(t!==null){var a=Tt();ka(t,e,134217728,a)}Jh(e,134217728)}};c0=function(e){if(e.tag===13){var t=Wr(e),a=ur(e,t);if(a!==null){var r=Tt();ka(a,e,t,r)}Jh(e,t)}};f0=function(){return he};p0=function(e,t){var a=he;try{return he=e,t()}finally{he=a}};_m=function(e,t,a){switch(t){case"input":if(bm(e,a),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<a.length;t++){var r=a[t];if(r!==e&&r.form===e.form){var o=ec(r);if(!o)throw Error(_(90));zv(r),bm(r,o)}}}break;case"textarea":Wv(e,a);break;case"select":t=a.value,t!=null&&Yn(e,!!a.multiple,t,!1)}};Zv=Wh;e0=qo;var g1={usingClientEntryPoint:!1,Events:[bl,$n,ec,Jv,Yv,Wh]},zi={findFiberByHostInstance:Do,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},y1={bundleType:zi.bundleType,version:zi.version,rendererPackageName:zi.rendererPackageName,rendererConfig:zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:cr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=r0(e),e===null?null:e.stateNode},findFiberByHostInstance:zi.findFiberByHostInstance||m1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&($i=__REACT_DEVTOOLS_GLOBAL_HOOK__,!$i.isDisabled&&$i.supportsFiber))try{Qd=$i.inject(y1),Fa=$i}catch{}var $i;Jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=g1;Jt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zh(t))throw Error(_(200));return p1(e,t,null,a)};Jt.createRoot=function(e,t){if(!Zh(e))throw Error(_(299));var a=!1,r="",o=Nw;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Qh(e,1,!1,null,null,a,!1,r,o),e[lr]=t.current,pl(e.nodeType===8?e.parentNode:e),new Yh(t)};Jt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=r0(t),e=e===null?null:e.stateNode,e};Jt.flushSync=function(e){return qo(e)};Jt.hydrate=function(e,t,a){if(!uc(t))throw Error(_(200));return dc(null,e,t,!0,a)};Jt.hydrateRoot=function(e,t,a){if(!Zh(e))throw Error(_(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=Nw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=Mw(t,null,e,1,a??null,o,!1,n,s),e[lr]=t.current,pl(e),r)for(e=0;e<r.length;e++)a=r[e],o=a._getVersion,o=o(a._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[a,o]:t.mutableSourceEagerHydrationData.push(a,o);return new lc(t)};Jt.render=function(e,t,a){if(!uc(t))throw Error(_(200));return dc(null,e,t,!1,a)};Jt.unmountComponentAtNode=function(e){if(!uc(e))throw Error(_(40));return e._reactRootContainer?(qo(function(){dc(null,null,e,!1,function(){e._reactRootContainer=null,e[lr]=null})}),!0):!1};Jt.unstable_batchedUpdates=Wh;Jt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!uc(a))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return dc(e,t,a,!1,r)};Jt.version="18.3.1-next-f1338f8080-20240426"});var eg=Ze((uM,Bw)=>{"use strict";function Fw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Fw)}catch(e){console.error(e)}}Fw(),Bw.exports=Ow()});var Vw=Ze(tg=>{"use strict";var Uw=eg();tg.createRoot=Uw.createRoot,tg.hydrateRoot=Uw.hydrateRoot;var dM});var $o={};nx($o,{Headers:()=>rg,Request:()=>w1,Response:()=>S1,default:()=>ag,fetch:()=>v1});var x1,ps,v1,ag,rg,w1,S1,Zr=eP(()=>{"use strict";x1=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},ps=x1(),v1=ps.fetch,ag=ps.fetch.bind(ps),rg=ps.Headers,w1=ps.Request,S1=ps.Response});var sg=Ze(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});var og=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};ng.default=og});var lg=Ze(Rl=>{"use strict";var qw=Rl&&Rl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rl,"__esModule",{value:!0});var L1=qw((Zr(),ix($o))),b1=qw(sg()),ig=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=L1.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,a){return this.headers=Object.assign({},this.headers),this.headers[t]=a,this}then(t,a){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let r=this.fetch,o=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{var s,i,l;let u=null,d=null,c=null,f=n.status,m=n.statusText;if(n.ok){if(this.method!=="HEAD"){let h=await n.text();h===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?d=h:d=JSON.parse(h))}let w=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),b=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");w&&b&&b.length>1&&(c=parseInt(b[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(d)&&(d.length>1?(u={code:"PGRST116",details:`Results contain ${d.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},d=null,c=null,f=406,m="Not Acceptable"):d.length===1?d=d[0]:d=null)}else{let w=await n.text();try{u=JSON.parse(w),Array.isArray(u)&&n.status===404&&(d=[],u=null,f=200,m="OK")}catch{n.status===404&&w===""?(f=204,m="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u?.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,f=200,m="OK"),u&&this.shouldThrowOnError)throw new b1.default(u)}return{error:u,data:d,count:c,status:f,statusText:m}});return this.shouldThrowOnError||(o=o.catch(n=>{var s,i,l;return{error:{message:`${(s=n?.name)!==null&&s!==void 0?s:"FetchError"}: ${n?.message}`,details:`${(i=n?.stack)!==null&&i!==void 0?i:""}`,hint:"",code:`${(l=n?.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),o.then(t,a)}returns(){return this}overrideTypes(){return this}};Rl.default=ig});var dg=Ze(_l=>{"use strict";var I1=_l&&_l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_l,"__esModule",{value:!0});var k1=I1(lg()),ug=class extends k1.default{select(t){let a=!1,r=(t??"*").split("").map(o=>/\s/.test(o)&&!a?"":(o==='"'&&(a=!a),o)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:a=!0,nullsFirst:r,foreignTable:o,referencedTable:n=o}={}){let s=n?`${n}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${t}.${a?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:a,referencedTable:r=a}={}){let o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(o,`${t}`),this}range(t,a,{foreignTable:r,referencedTable:o=r}={}){let n=typeof o>"u"?"offset":`${o}.offset`,s=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(n,`${t}`),this.url.searchParams.set(s,`${a-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:t=!1,verbose:a=!1,settings:r=!1,buffers:o=!1,wal:n=!1,format:s="text"}={}){var i;let l=[t?"analyze":null,a?"verbose":null,r?"settings":null,o?"buffers":null,n?"wal":null].filter(Boolean).join("|"),u=(i=this.headers.Accept)!==null&&i!==void 0?i:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${u}"; options=${l};`,s==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};_l.default=ug});var pc=Ze(El=>{"use strict";var P1=El&&El.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(El,"__esModule",{value:!0});var T1=P1(dg()),cg=class extends T1.default{eq(t,a){return this.url.searchParams.append(t,`eq.${a}`),this}neq(t,a){return this.url.searchParams.append(t,`neq.${a}`),this}gt(t,a){return this.url.searchParams.append(t,`gt.${a}`),this}gte(t,a){return this.url.searchParams.append(t,`gte.${a}`),this}lt(t,a){return this.url.searchParams.append(t,`lt.${a}`),this}lte(t,a){return this.url.searchParams.append(t,`lte.${a}`),this}like(t,a){return this.url.searchParams.append(t,`like.${a}`),this}likeAllOf(t,a){return this.url.searchParams.append(t,`like(all).{${a.join(",")}}`),this}likeAnyOf(t,a){return this.url.searchParams.append(t,`like(any).{${a.join(",")}}`),this}ilike(t,a){return this.url.searchParams.append(t,`ilike.${a}`),this}ilikeAllOf(t,a){return this.url.searchParams.append(t,`ilike(all).{${a.join(",")}}`),this}ilikeAnyOf(t,a){return this.url.searchParams.append(t,`ilike(any).{${a.join(",")}}`),this}is(t,a){return this.url.searchParams.append(t,`is.${a}`),this}in(t,a){let r=Array.from(new Set(a)).map(o=>typeof o=="string"&&new RegExp("[,()]").test(o)?`"${o}"`:`${o}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cs.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cs.{${a.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(a)}`),this}containedBy(t,a){return typeof a=="string"?this.url.searchParams.append(t,`cd.${a}`):Array.isArray(a)?this.url.searchParams.append(t,`cd.{${a.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(a)}`),this}rangeGt(t,a){return this.url.searchParams.append(t,`sr.${a}`),this}rangeGte(t,a){return this.url.searchParams.append(t,`nxl.${a}`),this}rangeLt(t,a){return this.url.searchParams.append(t,`sl.${a}`),this}rangeLte(t,a){return this.url.searchParams.append(t,`nxr.${a}`),this}rangeAdjacent(t,a){return this.url.searchParams.append(t,`adj.${a}`),this}overlaps(t,a){return typeof a=="string"?this.url.searchParams.append(t,`ov.${a}`):this.url.searchParams.append(t,`ov.{${a.join(",")}}`),this}textSearch(t,a,{config:r,type:o}={}){let n="";o==="plain"?n="pl":o==="phrase"?n="ph":o==="websearch"&&(n="w");let s=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${n}fts${s}.${a}`),this}match(t){return Object.entries(t).forEach(([a,r])=>{this.url.searchParams.append(a,`eq.${r}`)}),this}not(t,a,r){return this.url.searchParams.append(t,`not.${a}.${r}`),this}or(t,{foreignTable:a,referencedTable:r=a}={}){let o=r?`${r}.or`:"or";return this.url.searchParams.append(o,`(${t})`),this}filter(t,a,r){return this.url.searchParams.append(t,`${a}.${r}`),this}};El.default=cg});var pg=Ze(Ml=>{"use strict";var A1=Ml&&Ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ml,"__esModule",{value:!0});var Dl=A1(pc()),fg=class{constructor(t,{headers:a={},schema:r,fetch:o}){this.url=t,this.headers=a,this.schema=r,this.fetch=o}select(t,{head:a=!1,count:r}={}){let o=a?"HEAD":"GET",n=!1,s=(t??"*").split("").map(i=>/\s/.test(i)&&!n?"":(i==='"'&&(n=!n),i)).join("");return this.url.searchParams.set("select",s),r&&(this.headers.Prefer=`count=${r}`),new Dl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:a,defaultToNull:r=!0}={}){let o="POST",n=[];if(this.headers.Prefer&&n.push(this.headers.Prefer),a&&n.push(`count=${a}`),r||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(t)){let s=t.reduce((i,l)=>i.concat(Object.keys(l)),[]);if(s.length>0){let i=[...new Set(s)].map(l=>`"${l}"`);this.url.searchParams.set("columns",i.join(","))}}return new Dl.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:a,ignoreDuplicates:r=!1,count:o,defaultToNull:n=!0}={}){let s="POST",i=[`resolution=${r?"ignore":"merge"}-duplicates`];if(a!==void 0&&this.url.searchParams.set("on_conflict",a),this.headers.Prefer&&i.push(this.headers.Prefer),o&&i.push(`count=${o}`),n||i.push("missing=default"),this.headers.Prefer=i.join(","),Array.isArray(t)){let l=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){let u=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",u.join(","))}}return new Dl.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:a}={}){let r="PATCH",o=[];return this.headers.Prefer&&o.push(this.headers.Prefer),a&&o.push(`count=${a}`),this.headers.Prefer=o.join(","),new Dl.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){let a="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new Dl.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ml.default=fg});var Hw=Ze(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.version=void 0;mc.version="0.0.0-automated"});var zw=Ze(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.DEFAULT_HEADERS=void 0;var R1=Hw();hc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${R1.version}`}});var Ww=Ze(Nl=>{"use strict";var $w=Nl&&Nl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nl,"__esModule",{value:!0});var _1=$w(pg()),E1=$w(pc()),D1=zw(),mg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},D1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new _1.default(a,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,a={},{head:r=!1,get:o=!1,count:n}={}){let s,i=new URL(`${this.url}/rpc/${t}`),l;r||o?(s=r?"HEAD":"GET",Object.entries(a).filter(([d,c])=>c!==void 0).map(([d,c])=>[d,Array.isArray(c)?`{${c.join(",")}}`:`${c}`]).forEach(([d,c])=>{i.searchParams.append(d,c)})):(s="POST",l=a);let u=Object.assign({},this.headers);return n&&(u.Prefer=`count=${n}`),new E1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Nl.default=mg});var Zw=Ze(ut=>{"use strict";var ms=ut&&ut.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ut,"__esModule",{value:!0});ut.PostgrestError=ut.PostgrestBuilder=ut.PostgrestTransformBuilder=ut.PostgrestFilterBuilder=ut.PostgrestQueryBuilder=ut.PostgrestClient=void 0;var Gw=ms(Ww());ut.PostgrestClient=Gw.default;var Kw=ms(pg());ut.PostgrestQueryBuilder=Kw.default;var Xw=ms(pc());ut.PostgrestFilterBuilder=Xw.default;var Qw=ms(dg());ut.PostgrestTransformBuilder=Qw.default;var Jw=ms(lg());ut.PostgrestBuilder=Jw.default;var Yw=ms(sg());ut.PostgrestError=Yw.default;ut.default={PostgrestClient:Gw.default,PostgrestQueryBuilder:Kw.default,PostgrestFilterBuilder:Xw.default,PostgrestTransformBuilder:Qw.default,PostgrestBuilder:Jw.default,PostgrestError:Yw.default}});var uC=Ze(Fc=>{"use strict";var XA=W(),QA=Symbol.for("react.element"),JA=Symbol.for("react.fragment"),YA=Object.prototype.hasOwnProperty,ZA=XA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,eR={key:!0,ref:!0,__self:!0,__source:!0};function lC(e,t,a){var r,o={},n=null,s=null;a!==void 0&&(n=""+a),t.key!==void 0&&(n=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)YA.call(t,r)&&!eR.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:QA,type:e,key:n,ref:s,props:o,_owner:ZA.current}}Fc.Fragment=JA;Fc.jsx=lC;Fc.jsxs=lC});var ue=Ze((tO,dC)=>{"use strict";dC.exports=uC()});var YD={};nx(YD,{initKiteChat:()=>bp});var Za=M(W(),1),Ak=M(Vw(),1);var F=M(W(),1);var jw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Zr(),$o)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)};var kl=class extends Error{constructor(t,a="FunctionsError",r){super(t),this.name=a,this.context=r}},cc=class extends kl{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},Pl=class extends kl{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Tl=class extends kl{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},fc;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(fc||(fc={}));var C1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Al=class{constructor(t,{headers:a={},customFetch:r,region:o=fc.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=jw(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return C1(this,void 0,void 0,function*(){try{let{headers:o,method:n,body:s}=a,i={},{region:l}=a;l||(l=this.region);let u=new URL(`${this.url}/${t}`);l&&l!=="any"&&(i["x-region"]=l,u.searchParams.set("forceFunctionRegion",l));let d;s&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(i["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(i["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(i["Content-Type"]="application/json",d=JSON.stringify(s)));let c=yield this.fetch(u.toString(),{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},i),this.headers),o),body:d}).catch(w=>{throw new cc(w)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new Pl(c);if(!c.ok)throw new Tl(c);let m=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return m==="application/json"?x=yield c.json():m==="application/octet-stream"?x=yield c.blob():m==="text/event-stream"?x=c:m==="multipart/form-data"?x=yield c.formData():x=yield c.text(),{data:x,error:null,response:c}}catch(o){return{data:null,error:o,response:o instanceof Tl||o instanceof Pl?o.context:void 0}}})}};var eS=M(Zw(),1),{PostgrestClient:tS,PostgrestQueryBuilder:TM,PostgrestFilterBuilder:AM,PostgrestTransformBuilder:RM,PostgrestBuilder:_M,PostgrestError:M1}=eS.default;function aS(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}var rS=aS();var oS="2.11.15";var nS=`realtime-js/${oS}`,sS="1.0.0";var yc=1e4,iS=1e3,hs;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(hs||(hs={}));var dt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(dt||(dt={}));var Yt;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Yt||(Yt={}));var gc;(function(e){e.websocket="websocket"})(gc||(gc={}));var eo;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(eo||(eo={}));var Ol=class{constructor(){this.HEADER_LENGTH=1}decode(t,a){return t.constructor===ArrayBuffer?a(this._binaryDecode(t)):a(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){let a=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,a,r)}_decodeBroadcast(t,a,r){let o=a.getUint8(1),n=a.getUint8(2),s=this.HEADER_LENGTH+2,i=r.decode(t.slice(s,s+o));s=s+o;let l=r.decode(t.slice(s,s+n));s=s+n;let u=JSON.parse(r.decode(t.slice(s,t.byteLength)));return{ref:null,topic:i,event:l,payload:u}}};var Wo=class{constructor(t,a){this.callback=t,this.timerCalc=a,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=a}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}};var Se;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(Se||(Se={}));var gg=(e,t,a={})=>{var r;let o=(r=a.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((n,s)=>(n[s]=N1(s,e,t,o),n),{})},N1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?lS(n,s):hg(s)},lS=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return U1(t,a)}switch(e){case Se.bool:return O1(t);case Se.float4:case Se.float8:case Se.int2:case Se.int4:case Se.int8:case Se.numeric:case Se.oid:return F1(t);case Se.json:case Se.jsonb:return B1(t);case Se.timestamp:return V1(t);case Se.abstime:case Se.date:case Se.daterange:case Se.int4range:case Se.int8range:case Se.money:case Se.reltime:case Se.text:case Se.time:case Se.timestamptz:case Se.timetz:case Se.tsrange:case Se.tstzrange:return hg(t);default:return hg(t)}},hg=e=>e,O1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},F1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},B1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},U1=(e,t)=>{if(typeof e!="string")return e;let a=e.length-1,r=e[a];if(e[0]==="{"&&r==="}"){let n,s=e.slice(1,a);try{n=JSON.parse("["+s+"]")}catch{n=s?s.split(","):[]}return n.map(i=>lS(t,i))}return e},V1=e=>typeof e=="string"?e.replace(" ","T"):e,xc=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};var Go=class{constructor(t,a,r={},o=yc){this.channel=t,this.event=a,this.payload=r,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,a){var r;return this._hasReceived(t)&&a((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:a}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);let t=a=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=a,this._matchReceive(a)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,a){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:a})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:a}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(a))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}};var yg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(yg||(yg={}));var gs=class e{constructor(t,a){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=a?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.joinRef=this.channel._joinRef(),this.state=e.syncState(this.state,o,n,s),this.pendingDiffs.forEach(l=>{this.state=e.syncDiff(this.state,l,n,s)}),this.pendingDiffs=[],i()}),this.channel._on(r.diff,{},o=>{let{onJoin:n,onLeave:s,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=e.syncDiff(this.state,o,n,s),i())}),this.onJoin((o,n,s)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:n,newPresences:s})}),this.onLeave((o,n,s)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:n,leftPresences:s})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,a,r,o){let n=this.cloneDeep(t),s=this.transformState(a),i={},l={};return this.map(n,(u,d)=>{s[u]||(l[u]=d)}),this.map(s,(u,d)=>{let c=n[u];if(c){let f=d.map(b=>b.presence_ref),m=c.map(b=>b.presence_ref),x=d.filter(b=>m.indexOf(b.presence_ref)<0),w=c.filter(b=>f.indexOf(b.presence_ref)<0);x.length>0&&(i[u]=x),w.length>0&&(l[u]=w)}else i[u]=d}),this.syncDiff(n,{joins:i,leaves:l},r,o)}static syncDiff(t,a,r,o){let{joins:n,leaves:s}={joins:this.transformState(a.joins),leaves:this.transformState(a.leaves)};return r||(r=()=>{}),o||(o=()=>{}),this.map(n,(i,l)=>{var u;let d=(u=t[i])!==null&&u!==void 0?u:[];if(t[i]=this.cloneDeep(l),d.length>0){let c=t[i].map(m=>m.presence_ref),f=d.filter(m=>c.indexOf(m.presence_ref)<0);t[i].unshift(...f)}r(i,d,l)}),this.map(s,(i,l)=>{let u=t[i];if(!u)return;let d=l.map(c=>c.presence_ref);u=u.filter(c=>d.indexOf(c.presence_ref)<0),t[i]=u,o(i,u,l),u.length===0&&delete t[i]}),t}static map(t,a){return Object.getOwnPropertyNames(t).map(r=>a(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((a,r)=>{let o=t[r];return"metas"in o?a[r]=o.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):a[r]=o,a},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}};var xg;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(xg||(xg={}));var vg;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(vg||(vg={}));var Ua;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Ua||(Ua={}));var ys=class e{constructor(t,a={config:{}},r){this.topic=t,this.params=a,this.socket=r,this.bindings={},this.state=dt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},a.config),this.timeout=this.socket.timeout,this.joinPush=new Go(this,Yt.join,this.params,this.timeout),this.rejoinTimer=new Wo(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=dt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=dt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=dt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=dt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Yt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new gs(this),this.broadcastEndpointURL=xc(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,a=this.timeout){var r,o;if(this.socket.isConnected()||this.socket.connect(),this.state==dt.closed){let{config:{broadcast:n,presence:s,private:i}}=this.params;this._onError(d=>t?.(Ua.CHANNEL_ERROR,d)),this._onClose(()=>t?.(Ua.CLOSED));let l={},u={broadcast:n,presence:s,postgres_changes:(o=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(d=>d.filter))!==null&&o!==void 0?o:[],private:i};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(a),this.joinPush.receive("ok",async({postgres_changes:d})=>{var c;if(this.socket.setAuth(),d===void 0){t?.(Ua.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,m=(c=f?.length)!==null&&c!==void 0?c:0,x=[];for(let w=0;w<m;w++){let b=f[w],{filter:{event:h,schema:g,table:y,filter:C}}=b,L=d&&d[w];if(L&&L.event===h&&L.schema===g&&L.table===y&&L.filter===C)x.push(Object.assign(Object.assign({},b),{id:L.id}));else{this.unsubscribe(),this.state=dt.errored,t?.(Ua.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Ua.SUBSCRIBED);return}}).receive("error",d=>{this.state=dt.errored,t?.(Ua.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(Ua.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,a={}){return await this.send({type:"presence",event:"track",payload:t},a.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,a,r){return this._on(t,a,r)}async send(t,a={}){var r,o;if(!this._canPush()&&t.type==="broadcast"){let{event:n,payload:s}=t,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:s,private:this.private}]})};try{let u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=a.timeout)!==null&&r!==void 0?r:this.timeout);return await((o=u.body)===null||o===void 0?void 0:o.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var s,i,l;let u=this._push(t.type,t,a.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(i=(s=this.params)===null||s===void 0?void 0:s.config)===null||i===void 0?void 0:i.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),u.receive("ok",()=>n("ok")),u.receive("error",()=>n("error")),u.receive("timeout",()=>n("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=dt.leaving;let a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Yt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Go(this,Yt.leave,{},t),r.receive("ok",()=>{a(),o("ok")}).receive("timeout",()=>{a(),o("timed out")}).receive("error",()=>{o("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,a,r){let o=new AbortController,n=setTimeout(()=>o.abort(),r),s=await this.socket.fetch(t,Object.assign(Object.assign({},a),{signal:o.signal}));return clearTimeout(n),s}_push(t,a,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new Go(this,t,a,r);return this._canPush()?o.send():(o.startTimeout(),this.pushBuffer.push(o)),o}_onMessage(t,a,r){return a}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,a,r){var o,n;let s=t.toLocaleLowerCase(),{close:i,error:l,leave:u,join:d}=Yt;if(r&&[i,l,u,d].indexOf(s)>=0&&r!==this._joinRef())return;let f=this._onMessage(s,a,r);if(a&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(s)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(m=>{var x,w,b;return((x=m.filter)===null||x===void 0?void 0:x.event)==="*"||((b=(w=m.filter)===null||w===void 0?void 0:w.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===s}).map(m=>m.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(m=>{var x,w,b,h,g,y;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in m){let C=m.id,L=(x=m.filter)===null||x===void 0?void 0:x.event;return C&&((w=a.ids)===null||w===void 0?void 0:w.includes(C))&&(L==="*"||L?.toLocaleLowerCase()===((b=a.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{let C=(g=(h=m?.filter)===null||h===void 0?void 0:h.event)===null||g===void 0?void 0:g.toLocaleLowerCase();return C==="*"||C===((y=a?.event)===null||y===void 0?void 0:y.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===s}).map(m=>{if(typeof f=="object"&&"ids"in f){let x=f.data,{schema:w,table:b,commit_timestamp:h,type:g,errors:y}=x;f=Object.assign(Object.assign({},{schema:w,table:b,commit_timestamp:h,eventType:g,new:{},old:{},errors:y}),this._getPayloadRecords(x))}m.callback(f,r)})}_isClosed(){return this.state===dt.closed}_isJoined(){return this.state===dt.joined}_isJoining(){return this.state===dt.joining}_isLeaving(){return this.state===dt.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,a,r){let o=t.toLocaleLowerCase(),n={type:o,filter:a,callback:r};return this.bindings[o]?this.bindings[o].push(n):this.bindings[o]=[n],this}_off(t,a){let r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(o=>{var n;return!(((n=o.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===r&&e.isEqual(o.filter,a))}),this}static isEqual(t,a){if(Object.keys(t).length!==Object.keys(a).length)return!1;for(let r in t)if(t[r]!==a[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Yt.close,{},t)}_onError(t){this._on(Yt.error,{},a=>t(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=dt.joining,this.joinPush.resend(t))}_getPayloadRecords(t){let a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=gg(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=gg(t.columns,t.old_record)),a}};var uS=()=>{},q1=`
|
|
16
9
|
addEventListener("message", (e) => {
|
|
17
10
|
if (e.data.event === "start") {
|
|
18
11
|
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
19
12
|
}
|
|
20
|
-
});`,ks=class{constructor(t,r){var a;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=Dl,this.transport=null,this.heartbeatIntervalMs=ud.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=ag,this.ref=0,this.reconnectTimer=null,this.vsn=Yh,this.logger=ag,this.conn=null,this.sendBuffer=[],this.serializer=new Nl,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=o=>o?(...n)=>o(...n):(...n)=>fetch(...n),!(!((a=r?.params)===null||a===void 0)&&a.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${t}/${id.websocket}`,this.httpEndpoint=ld(t),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Jh.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");let r=t.message;throw r.includes("Node.js")?new Error(`${r}
|
|
21
|
-
|
|
22
|
-
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
23
|
-
|
|
24
|
-
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
25
|
-
Option 2: Install and provide the "ws" package:
|
|
26
|
-
|
|
27
|
-
npm install ws
|
|
28
|
-
|
|
29
|
-
import ws from "ws"
|
|
30
|
-
const client = new RealtimeClient(url, {
|
|
31
|
-
...options,
|
|
32
|
-
transport: ws
|
|
33
|
-
})`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){let a=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(a),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){let r=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){let t=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,r,a){this.logger(t,r,a)}connectionState(){switch(this.conn&&this.conn.readyState){case ha.connecting:return lo.Connecting;case ha.open:return lo.Open;case ha.closing:return lo.Closing;default:return lo.Closed}}isConnected(){return this.connectionState()===lo.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,r={config:{}}){let a=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===a);if(o)return o;{let n=new Is(`realtime:${t}`,r,this);return this.channels.push(n),n}}push(t){let{topic:r,event:a,payload:o,ref:n}=t,s=()=>{this.encode(t,i=>{var l;(l=this.conn)===null||l===void 0||l.send(i)})};this.log("push",`${r} ${a} (${n})`,o),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(zw,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},ud.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let r=this.channels.find(a=>a.topic===t&&(a._isJoined()||a._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${t}"`),r.unsubscribe())}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply"&&r.ref&&r.ref===this.pendingHeartbeatRef){let u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error",u)}catch(c){this.log("error","error in heartbeat callback",c)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}let{topic:a,event:o,payload:n,ref:s}=r,i=s?`(${s})`:"",l=n.status||"";this.log("receive",`${l} ${a} ${o} ${i}`.trim(),n),this.channels.filter(u=>u._isMember(a)).forEach(u=>u._trigger(o,n,s)),this._triggerStateCallbacks("message",r)})}_clearTimer(t){var r;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===ha.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===ha.open||this.conn.readyState===ha.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var r;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Zt.error))}_appendParams(t,r){if(Object.keys(r).length===0)return t;let a=t.match(/\?/)?"&":"?",o=new URLSearchParams(r);return`${t}${a}${o}`}_workerObjectUrl(t){let r;if(t)r=t;else{let a=new Blob([y_],{type:"application/javascript"});r=URL.createObjectURL(a)}return r}_setConnectionState(t,r=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(t=null){let r,a=!1;if(t)r=t,a=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),r=this.accessTokenValue}else r=this.accessTokenValue;a?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(o=>{let n={access_token:r,version:$w};r&&o.updateJoinPayload(n),o.joinedOnce&&o._isJoined()&&o._push(Zt.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_triggerStateCallbacks(t,r){try{this.stateChangeCallbacks[t].forEach(a=>{try{a(r)}catch(o){this.log("error",`error in ${t} callback`,o)}})}catch(a){this.log("error",`error triggering ${t} callbacks`,a)}}_setupReconnectionTimer(){this.reconnectTimer=new rn(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},ud.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var r,a,o,n,s,i,l,u,c,d,f,m;switch(this.transport=(r=t?.transport)!==null&&r!==void 0?r:null,this.timeout=(a=t?.timeout)!==null&&a!==void 0?a:Dl,this.heartbeatIntervalMs=(o=t?.heartbeatIntervalMs)!==null&&o!==void 0?o:ud.HEARTBEAT_INTERVAL,this.worker=(n=t?.worker)!==null&&n!==void 0?n:!1,this.accessToken=(s=t?.accessToken)!==null&&s!==void 0?s:null,this.heartbeatCallback=(i=t?.heartbeatCallback)!==null&&i!==void 0?i:ag,this.vsn=(l=t?.vsn)!==null&&l!==void 0?l:Yh,t?.params&&(this.params=t.params),t?.logger&&(this.logger=t.logger),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t?.reconnectAfterMs)!==null&&u!==void 0?u:(v=>h_[v-1]||g_),this.vsn){case Qh:this.encode=(c=t?.encode)!==null&&c!==void 0?c:((v,x)=>x(JSON.stringify(v))),this.decode=(d=t?.decode)!==null&&d!==void 0?d:((v,x)=>x(JSON.parse(v)));break;case Hw:this.encode=(f=t?.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(m=t?.decode)!==null&&m!==void 0?m:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t?.workerUrl}}};var Ml=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function v_(e,t,r){let a=new URL(t,e);if(r)for(let[o,n]of Object.entries(r))n!==void 0&&a.searchParams.set(o,n);return a.toString()}async function x_(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function w_(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:a,query:o,body:n,headers:s}){let i=v_(e.baseUrl,a,o),l=await x_(e.auth),u=await t(i,{method:r,headers:{...n?{"Content-Type":"application/json"}:{},...l,...s},body:n?JSON.stringify(n):void 0}),c=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),f=d&&c?JSON.parse(c):c;if(!u.ok){let m=d?f:void 0,v=m?.error;throw new Ml(v?.message??`Request failed with status ${u.status}`,{status:u.status,icebergType:v?.type,icebergCode:v?.code,details:m})}return{status:u.status,headers:u.headers,data:f}}}}function cd(e){return e.join("")}var S_=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:cd(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(a=>({namespace:a}))}async createNamespace(e,t){let r={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${cd(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${cd(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${cd(e.namespace)}`}),!0}catch(t){if(t instanceof Ml&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Ml&&r.status===409)return;throw r}}};function Ps(e){return e.join("")}var C_=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ps(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ps(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){let r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ps(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ps(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ps(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ps(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Ml&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Ml&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},Kw=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);let r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=w_({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new S_(this.client,t),this.tableOps=new C_(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};var dd=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function Be(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var b_=class extends dd{constructor(e,t,r){super(e),this.name="StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},sg=class extends dd{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}},ug=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),L_=()=>Response,ig=e=>{if(Array.isArray(e))return e.map(r=>ig(r));if(typeof e=="function"||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([r,a])=>{let o=r.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,""));t[o]=ig(a)}),t},I_=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},k_=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Ol(e){"@babel/helpers - typeof";return Ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ol(e)}function P_(e,t){if(Ol(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(Ol(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T_(e){var t=P_(e,"string");return Ol(t)=="symbol"?t:t+""}function __(e,t,r){return(t=T_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xw(Object(r),!0).forEach(function(a){__(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xw(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var og=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},A_=async(e,t,r)=>{e instanceof await L_()&&!r?.noResolveJson?e.json().then(a=>{let o=e.status||500,n=a?.statusCode||o+"";t(new b_(og(a),o,n))}).catch(a=>{t(new sg(og(a),a))}):t(new sg(og(e),e))},R_=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(I_(a)?(o.headers=X({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,t?.duplex&&(o.duplex=t.duplex),X(X({},o),r))};async function Fl(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,R_(t,a,o,n)).then(l=>{if(!l.ok)throw l;return a?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>A_(l,i,a))})}async function Bl(e,t,r,a){return Fl(e,"GET",t,r,a)}async function Rr(e,t,r,a,o){return Fl(e,"POST",t,a,o,r)}async function lg(e,t,r,a,o){return Fl(e,"PUT",t,a,o,r)}async function E_(e,t,r,a){return Fl(e,"HEAD",t,X(X({},r),{},{noResolveJson:!0}),a)}async function cg(e,t,r,a,o){return Fl(e,"DELETE",t,a,o,r)}var D_=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Be(t))return{data:null,error:t};throw t}}},Yw;Yw=Symbol.toStringTag;var N_=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Yw]="BlobDownloadBuilder",this.promise=null}asStream(){return new D_(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Be(t))return{data:null,error:t};throw t}}},M_={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Jw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},O_=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=r,this.fetch=ug(a)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,r,a){var o=this;try{let n,s=X(X({},Jw),a),i=X(X({},o.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(n=new FormData,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",o.encodeMetadata(l)),n.append("",r)):typeof FormData<"u"&&r instanceof FormData?(n=r,n.has("cacheControl")||n.append("cacheControl",s.cacheControl),l&&!n.has("metadata")&&n.append("metadata",o.encodeMetadata(l))):(n=r,i["cache-control"]=`max-age=${s.cacheControl}`,i["content-type"]=s.contentType,l&&(i["x-metadata"]=o.toBase64(o.encodeMetadata(l))),(typeof ReadableStream<"u"&&n instanceof ReadableStream||n&&typeof n=="object"&&"pipe"in n&&typeof n.pipe=="function")&&!s.duplex&&(s.duplex="half")),a?.headers&&(i=X(X({},i),a.headers));let u=o._removeEmptyFolders(t),c=o._getFinalPath(u),d=await(e=="PUT"?lg:Rr)(o.fetch,`${o.url}/object/${c}`,n,X({headers:i},s?.duplex?{duplex:s.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(n){if(o.shouldThrowOnError)throw n;if(Be(n))return{data:null,error:n};throw n}}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,a){var o=this;let n=o._removeEmptyFolders(e),s=o._getFinalPath(n),i=new URL(o.url+`/object/upload/sign/${s}`);i.searchParams.set("token",t);try{let l,u=X({upsert:Jw.upsert},a),c=X(X({},o.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType),{data:{path:n,fullPath:(await lg(o.fetch,i.toString(),l,{headers:c})).Key},error:null}}catch(l){if(o.shouldThrowOnError)throw l;if(Be(l))return{data:null,error:l};throw l}}async createSignedUploadUrl(e,t){var r=this;try{let a=r._getFinalPath(e),o=X({},r.headers);t?.upsert&&(o["x-upsert"]="true");let n=await Rr(r.fetch,`${r.url}/object/upload/sign/${a}`,{},{headers:o}),s=new URL(r.url+n.url),i=s.searchParams.get("token");if(!i)throw new dd("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:i},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Be(a))return{data:null,error:a};throw a}}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var a=this;try{return{data:await Rr(a.fetch,`${a.url}/object/move`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r?.destinationBucket},{headers:a.headers}),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Be(o))return{data:null,error:o};throw o}}async copy(e,t,r){var a=this;try{return{data:{path:(await Rr(a.fetch,`${a.url}/object/copy`,{bucketId:a.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r?.destinationBucket},{headers:a.headers})).Key},error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Be(o))return{data:null,error:o};throw o}}async createSignedUrl(e,t,r){var a=this;try{let o=a._getFinalPath(e),n=await Rr(a.fetch,`${a.url}/object/sign/${o}`,X({expiresIn:t},r?.transform?{transform:r.transform}:{}),{headers:a.headers}),s=r?.download?`&download=${r.download===!0?"":r.download}`:"";return n={signedUrl:encodeURI(`${a.url}${n.signedURL}${s}`)},{data:n,error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Be(o))return{data:null,error:o};throw o}}async createSignedUrls(e,t,r){var a=this;try{let o=await Rr(a.fetch,`${a.url}/object/sign/${a.bucketId}`,{expiresIn:t,paths:e},{headers:a.headers}),n=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:o.map(s=>X(X({},s),{},{signedUrl:s.signedURL?encodeURI(`${a.url}${s.signedURL}${n}`):null})),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Be(o))return{data:null,error:o};throw o}}download(e,t){let r=typeof t?.transform<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString(t?.transform||{}),o=a?`?${a}`:"",n=this._getFinalPath(e),s=()=>Bl(this.fetch,`${this.url}/${r}/${n}${o}`,{headers:this.headers,noResolveJson:!0});return new N_(s,this.shouldThrowOnError)}async info(e){var t=this;let r=t._getFinalPath(e);try{return{data:ig(await Bl(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})),error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(Be(a))return{data:null,error:a};throw a}}async exists(e){var t=this;let r=t._getFinalPath(e);try{return await E_(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(Be(a)&&a instanceof sg){let o=a.originalError;if([400,404].includes(o?.status))return{data:!1,error:a}}throw a}}getPublicUrl(e,t){let r=this._getFinalPath(e),a=[],o=t?.download?`download=${t.download===!0?"":t.download}`:"";o!==""&&a.push(o);let n=typeof t?.transform<"u"?"render/image":"object",s=this.transformOptsToQueryString(t?.transform||{});s!==""&&a.push(s);let i=a.join("&");return i!==""&&(i=`?${i}`),{data:{publicUrl:encodeURI(`${this.url}/${n}/public/${r}${i}`)}}}async remove(e){var t=this;try{return{data:await cg(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}async list(e,t,r){var a=this;try{let o=X(X(X({},M_),t),{},{prefix:e||""});return{data:await Rr(a.fetch,`${a.url}/object/list/${a.bucketId}`,o,{headers:a.headers},r),error:null}}catch(o){if(a.shouldThrowOnError)throw o;if(Be(o))return{data:null,error:o};throw o}}async listV2(e,t){var r=this;try{let a=X({},e);return{data:await Rr(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,a,{headers:r.headers},t),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Be(a))return{data:null,error:a};throw a}}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}},Zw="2.90.1",eS={"X-Client-Info":`storage-js/${Zw}`},B_=class{constructor(e,t={},r,a){this.shouldThrowOnError=!1;let o=new URL(e);a?.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase.")),this.url=o.href.replace(/\/$/,""),this.headers=X(X({},eS),t),this.fetch=ug(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{let r=t.listBucketOptionsToQueryString(e);return{data:await Bl(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await Bl(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}async createBucket(e,t={public:!1}){var r=this;try{return{data:await Rr(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Be(a))return{data:null,error:a};throw a}}async updateBucket(e,t){var r=this;try{return{data:await lg(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(Be(a))return{data:null,error:a};throw a}}async emptyBucket(e){var t=this;try{return{data:await Rr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await cg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}listBucketOptionsToQueryString(e){let t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},F_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},eS),t),this.fetch=ug(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Rr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}async listBuckets(e){var t=this;try{let r=new URLSearchParams;e?.limit!==void 0&&r.set("limit",e.limit.toString()),e?.offset!==void 0&&r.set("offset",e.offset.toString()),e?.sortColumn&&r.set("sortColumn",e.sortColumn),e?.sortOrder&&r.set("sortOrder",e.sortOrder),e?.search&&r.set("search",e.search);let a=r.toString(),o=a?`${t.url}/bucket?${a}`:`${t.url}/bucket`;return{data:await Bl(t.fetch,o,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await cg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Be(r))return{data:null,error:r};throw r}}from(e){var t=this;if(!k_(e))throw new dd("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");let r=new Kw({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),a=this.shouldThrowOnError;return new Proxy(r,{get(o,n){let s=o[n];return typeof s!="function"?s:async(...i)=>{try{return{data:await s.apply(o,i),error:null}}catch(l){if(a)throw l;return{data:null,error:l}}}}})}},dg={"X-Client-Info":`storage-js/${Zw}`,"Content-Type":"application/json"},tS=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function er(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var ng=class extends tS{constructor(e,t,r){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},U_=class extends tS{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};var fg=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);var V_=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var Qw=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),j_=async(e,t,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!r?.noResolveJson){let a=e.status||500,o=e;if(typeof o.json=="function")o.json().then(n=>{let s=n?.statusCode||n?.code||a+"";t(new ng(Qw(n),a,s))}).catch(()=>{let n=a+"";t(new ng(o.statusText||`HTTP ${a} error`,a,n))});else{let n=a+"";t(new ng(o.statusText||`HTTP ${a} error`,a,n))}}else t(new U_(Qw(e),e))},q_=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!a?o:(V_(a)?(o.headers=X({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(a)):o.body=a,X(X({},o),r))};async function $_(e,t,r,a,o,n){return new Promise((s,i)=>{e(r,q_(t,a,o,n)).then(l=>{if(!l.ok)throw l;if(a?.noResolveJson)return l;let u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>s(l)).catch(l=>j_(l,i,a))})}async function tr(e,t,r,a,o){return $_(e,"POST",t,a,o,r)}var H_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},dg),t),this.fetch=fg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await tr(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async getIndex(e,t){var r=this;try{return{data:await tr(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}),error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(er(a))return{data:null,error:a};throw a}}async listIndexes(e){var t=this;try{return{data:await tr(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async deleteIndex(e,t){var r=this;try{return{data:await tr(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{},error:null}}catch(a){if(r.shouldThrowOnError)throw a;if(er(a))return{data:null,error:a};throw a}}},z_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},dg),t),this.fetch=fg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await tr(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async getVectors(e){var t=this;try{return{data:await tr(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async listVectors(e){var t=this;try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:await tr(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async queryVectors(e){var t=this;try{return{data:await tr(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await tr(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}},W_=class{constructor(e,t={},r){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=X(X({},dg),t),this.fetch=fg(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await tr(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async getBucket(e){var t=this;try{return{data:await tr(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async listBuckets(e={}){var t=this;try{return{data:await tr(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}async deleteBucket(e){var t=this;try{return{data:await tr(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(er(r))return{data:null,error:r};throw r}}},G_=class extends W_{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new K_(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},K_=class extends H_{constructor(e,t,r,a){super(e,t,a),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new X_(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},X_=class extends z_{constructor(e,t,r,a,o){super(e,t,o),this.vectorBucketName=r,this.indexName=a}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,X(X({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},rS=class extends B_{constructor(e,t={},r,a){super(e,t,r,a)}from(e){return new O_(this.url,this.headers,e,this.fetch)}get vectors(){return new G_(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new F_(this.url+"/iceberg",this.headers,this.fetch)}};var fd="2.90.1";var on=30*1e3,pd=3,md=pd*on,aS="http://localhost:9999",oS="supabase.auth.token";var nS={"X-Client-Info":`gotrue-js/${fd}`};var Ul="X-Supabase-Api-Version",pg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},sS=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,iS=600*1e3;var uo=class extends Error{constructor(t,r,a){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=a}};function $(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var hd=class extends uo{constructor(t,r,a){super(t,r,a),this.name="AuthApiError",this.status=r,this.code=a}};function lS(e){return $(e)&&e.name==="AuthApiError"}var yr=class extends uo{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}},Er=class extends uo{constructor(t,r,a,o){super(t,a,o),this.name=r,this.status=a}},pt=class extends Er{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function uS(e){return $(e)&&e.name==="AuthSessionMissingError"}var ga=class extends Er{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},nn=class extends Er{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},sn=class extends Er{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function cS(e){return $(e)&&e.name==="AuthImplicitGrantRedirectError"}var Vl=class extends Er{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},gd=class extends Er{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}};var Ts=class extends Er{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}};function yd(e){return $(e)&&e.name==="AuthRetryableFetchError"}var jl=class extends Er{constructor(t,r,a){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=a}};var ln=class extends Er{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var vd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),dS=`
|
|
34
|
-
\r=`.split(""),J_=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<dS.length;t+=1)e[dS[t].charCodeAt(0)]=-2;for(let t=0;t<vd.length;t+=1)e[vd[t].charCodeAt(0)]=t;return e})();function fS(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){let a=t.queue>>t.queuedBits-6&63;r(vd[a]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){let a=t.queue>>t.queuedBits-6&63;r(vd[a]),t.queuedBits-=6}}function pS(e,t,r){let a=J_[e];if(a>-1)for(t.queue=t.queue<<6|a,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(a===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function mg(e){let t=[],r=s=>{t.push(String.fromCodePoint(s))},a={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{Z_(s,a,r)};for(let s=0;s<e.length;s+=1)pS(e.charCodeAt(s),o,n);return t.join("")}function Q_(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function Y_(e,t){for(let r=0;r<e.length;r+=1){let a=e.charCodeAt(r);if(a>55295&&a<=56319){let o=(a-55296)*1024&65535;a=(e.charCodeAt(r+1)-56320&65535|o)+65536,r+=1}Q_(a,t)}}function Z_(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let a=1;a<6;a+=1)if((e>>7-a&1)===0){t.utf8seq=a;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function co(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)pS(e.charCodeAt(o),r,a);return new Uint8Array(t)}function mS(e){let t=[];return Y_(e,r=>t.push(r)),new Uint8Array(t)}function ya(e){let t=[],r={queue:0,queuedBits:0},a=o=>{t.push(o)};return e.forEach(o=>fS(o,r,a)),fS(null,r,a),t.join("")}function hS(e){return Math.round(Date.now()/1e3)+e}function gS(){return Symbol("auth-callback")}var et=()=>typeof window<"u"&&typeof document<"u",un={tested:!1,writable:!1},xd=()=>{if(!et())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(un.tested)return un.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),un.tested=!0,un.writable=!0}catch{un.tested=!0,un.writable=!1}return un.writable};function yS(e){let t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((o,n)=>{t[n]=o})}catch{}return r.searchParams.forEach((a,o)=>{t[o]=a}),t}var wd=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),vS=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",cn=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},fo=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},st=async(e,t)=>{await e.removeItem(t)},ql=class e{constructor(){this.promise=new e.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}};ql.promiseConstructor=Promise;function Sd(e){let t=e.split(".");if(t.length!==3)throw new ln("Invalid JWT structure");for(let a=0;a<t.length;a++)if(!sS.test(t[a]))throw new ln("JWT not in base64url format");return{header:JSON.parse(mg(t[0])),payload:JSON.parse(mg(t[1])),signature:co(t[2]),raw:{header:t[0],payload:t[1]}}}async function xS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function wS(e,t){return new Promise((a,o)=>{(async()=>{for(let n=0;n<1/0;n++)try{let s=await e(n);if(!t(n,null,s)){a(s);return}}catch(s){if(!t(n,s)){o(s);return}}})()})}function eA(e){return("0"+e.toString(16)).substr(-2)}function tA(){let t=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",a=r.length,o="";for(let n=0;n<56;n++)o+=r.charAt(Math.floor(Math.random()*a));return o}return crypto.getRandomValues(t),Array.from(t,eA).join("")}async function rA(e){let r=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",r),o=new Uint8Array(a);return Array.from(o).map(n=>String.fromCharCode(n)).join("")}async function aA(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let r=await rA(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function dn(e,t,r=!1){let a=tA(),o=a;r&&(o+="/PASSWORD_RECOVERY"),await cn(e,`${t}-code-verifier`,o);let n=await aA(a);return[n,a===n?"plain":"s256"]}var oA=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function SS(e){let t=e.headers.get(Ul);if(!t||!t.match(oA))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function CS(e){if(!e)throw new Error("Missing exp claim");let t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function bS(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var nA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function fn(e){if(!nA.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Cd(){let e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){let a=r.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function LS(e,t){return new Proxy(e,{get:(r,a,o)=>{if(a==="__isInsecureUserWarningProxy")return!0;if(typeof a=="symbol"){let n=a.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)"||n==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,a,o)}return!t.value&&typeof a=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,a,o)}})}function hg(e){return JSON.parse(JSON.stringify(e))}var pn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),sA=[502,503,504];async function IS(e){var t;if(!vS(e))throw new Ts(pn(e),0);if(sA.includes(e.status))throw new Ts(pn(e),e.status);let r;try{r=await e.json()}catch(n){throw new yr(pn(n),n)}let a,o=SS(e);if(o&&o.getTime()>=pg["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?a=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(a=r.error_code),a){if(a==="weak_password")throw new jl(pn(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(a==="session_not_found")throw new pt}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0))throw new jl(pn(r),e.status,r.weak_password.reasons);throw new hd(pn(r),e.status||500,a)}var iA=(e,t,r,a)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(a),Object.assign(Object.assign({},o),r))};async function G(e,t,r,a){var o;let n=Object.assign({},a?.headers);n[Ul]||(n[Ul]=pg["2024-01-01"].name),a?.jwt&&(n.Authorization=`Bearer ${a.jwt}`);let s=(o=a?.query)!==null&&o!==void 0?o:{};a?.redirectTo&&(s.redirect_to=a.redirectTo);let i=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await lA(e,t,r+i,{headers:n,noResolveJson:a?.noResolveJson},{},a?.body);return a?.xform?a?.xform(l):{data:Object.assign({},l),error:null}}async function lA(e,t,r,a,o,n){let s=iA(t,a,o,n),i;try{i=await e(r,Object.assign({},s))}catch(l){throw console.error(l),new Ts(pn(l),0)}if(i.ok||await IS(i),a?.noResolveJson)return i;try{return await i.json()}catch(l){await IS(l)}}function vr(e){var t;let r=null;uA(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=hS(e.expires_in)));let a=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:a},error:null}}function gg(e){let t=vr(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,a)=>r&&typeof a=="string",!0)&&(t.data.weak_password=e.weak_password),t}function $r(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function kS(e){return{data:e,error:null}}function PS(e){let{action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n}=e,s=tn(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),i={action_link:t,email_otp:r,hashed_token:a,redirect_to:o,verification_type:n},l=Object.assign({},s);return{data:{properties:i,user:l},error:null}}function yg(e){return e}function uA(e){return e.access_token&&e.refresh_token&&e.expires_in}var bd=["global","local","others"];var mn=class{constructor({url:t="",headers:r={},fetch:a}){this.url=t,this.headers=r,this.fetch=wd(a),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,r=bd[0]){if(bd.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${bd.join(", ")}`);try{return await G(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(a){if($(a))return{data:null,error:a};throw a}}async inviteUserByEmail(t,r={}){try{return await G(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:$r})}catch(a){if($(a))return{data:{user:null},error:a};throw a}}async generateLink(t){try{let{options:r}=t,a=tn(t,["options"]),o=Object.assign(Object.assign({},a),r);return"newEmail"in a&&(o.new_email=a?.newEmail,delete o.newEmail),await G(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:PS,redirectTo:r?.redirectTo})}catch(r){if($(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await G(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:$r})}catch(r){if($(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,a,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await G(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:yg});if(c.error)throw c.error;let d=await c.json(),f=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,m=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(v=>{let x=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(v.split(";")[1].split("=")[1]);u[`${b}Page`]=x}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if($(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){fn(t);try{return await G(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:$r})}catch(r){if($(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){fn(t);try{return await G(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:$r})}catch(a){if($(a))return{data:{user:null},error:a};throw a}}async deleteUser(t,r=!1){fn(t);try{return await G(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:$r})}catch(a){if($(a))return{data:{user:null},error:a};throw a}}async _listFactors(t){fn(t.userId);try{let{data:r,error:a}=await G(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:r,error:a}}catch(r){if($(r))return{data:null,error:r};throw r}}async _deleteFactor(t){fn(t.userId),fn(t.id);try{return{data:await G(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if($(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,a,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},c=await G(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(a=(r=t?.page)===null||r===void 0?void 0:r.toString())!==null&&a!==void 0?a:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:yg});if(c.error)throw c.error;let d=await c.json(),f=(s=c.headers.get("x-total-count"))!==null&&s!==void 0?s:0,m=(l=(i=c.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(v=>{let x=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(v.split(";")[1].split("=")[1]);u[`${b}Page`]=x}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if($(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await G(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if($(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await G(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if($(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await G(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if($(a))return{data:null,error:a};throw a}}async _deleteOAuthClient(t){try{return await G(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if($(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await G(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if($(r))return{data:null,error:r};throw r}}};function vg(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}var hn={debug:!!(globalThis&&xd()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},$l=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Ld=class extends $l{};async function xg(e,t,r){hn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let a=new globalThis.AbortController;return t>0&&setTimeout(()=>{a.abort(),hn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:a.signal},async o=>{if(o){hn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await r()}finally{hn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw hn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Ld(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(hn.debug)try{let n=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(n,null," "))}catch(n){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",n)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function TS(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function wg(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function _S(e){return parseInt(e,16)}function AS(e){let t=new TextEncoder().encode(e);return"0x"+Array.from(t,a=>a.toString(16).padStart(2,"0")).join("")}function RS(e){var t;let{chainId:r,domain:a,expirationTime:o,issuedAt:n=new Date,nonce:s,notBefore:i,requestId:l,resources:u,scheme:c,uri:d,version:f}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!a)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(s&&s.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${s}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
|
|
35
|
-
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}let m=wg(e.address),v=c?`${c}://${a}`:a,x=e.statement?`${e.statement}
|
|
36
|
-
`:"",b=`${v} wants you to sign in with your Ethereum account:
|
|
37
|
-
${m}
|
|
38
|
-
|
|
39
|
-
${x}`,g=`URI: ${d}
|
|
40
|
-
Version: ${f}
|
|
41
|
-
Chain ID: ${r}${s?`
|
|
42
|
-
Nonce: ${s}`:""}
|
|
43
|
-
Issued At: ${n.toISOString()}`;if(o&&(g+=`
|
|
44
|
-
Expiration Time: ${o.toISOString()}`),i&&(g+=`
|
|
45
|
-
Not Before: ${i.toISOString()}`),l&&(g+=`
|
|
46
|
-
Request ID: ${l}`),u){let h=`
|
|
47
|
-
Resources:`;for(let y of u){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);h+=`
|
|
48
|
-
- ${y}`}g+=h}return`${b}
|
|
49
|
-
${g}`}var Fe=class extends Error{constructor({message:t,code:r,cause:a,name:o}){var n;super(t,{cause:a}),this.__isWebAuthnError=!0,this.name=(n=o??(a instanceof Error?a.name:void 0))!==null&&n!==void 0?n:"Unknown Error",this.code=r}},gn=class extends Fe{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}};function ES({error:e,options:t}){var r,a,o;let{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Fe({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=n.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Fe({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((a=n.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new Fe({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=n.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new Fe({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Fe({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Fe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return n.pubKeyCredParams.filter(i=>i.type==="public-key").length===0?new Fe({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Fe({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){let s=window.location.hostname;if(Sg(s)){if(n.rp.id!==s)return new Fe({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Fe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Fe({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Fe({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Fe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function DS({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Fe({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Fe({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){let a=window.location.hostname;if(Sg(a)){if(r.rpId!==a)return new Fe({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Fe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Fe({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Fe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}var Cg=class{createNewAbortSignal(){if(this.controller){let r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}let t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){let t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}},cA=new Cg;function MS(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:r,excludeCredentials:a}=e,o=tn(e,["challenge","user","excludeCredentials"]),n=co(t).buffer,s=Object.assign(Object.assign({},r),{id:co(r.id).buffer}),i=Object.assign(Object.assign({},o),{challenge:n,user:s});if(a&&a.length>0){i.excludeCredentials=new Array(a.length);for(let l=0;l<a.length;l++){let u=a[l];i.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:co(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return i}function OS(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);let{challenge:t,allowCredentials:r}=e,a=tn(e,["challenge","allowCredentials"]),o=co(t).buffer,n=Object.assign(Object.assign({},a),{challenge:o});if(r&&r.length>0){n.allowCredentials=new Array(r.length);for(let s=0;s<r.length;s++){let i=r[s];n.allowCredentials[s]=Object.assign(Object.assign({},i),{id:co(i.id).buffer,type:i.type||"public-key",transports:i.transports})}}return n}function BS(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();let r=e;return{id:e.id,rawId:e.id,response:{attestationObject:ya(new Uint8Array(e.response.attestationObject)),clientDataJSON:ya(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function FS(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();let r=e,a=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ya(new Uint8Array(o.authenticatorData)),clientDataJSON:ya(new Uint8Array(o.clientDataJSON)),signature:ya(new Uint8Array(o.signature)),userHandle:o.userHandle?ya(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:a,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Sg(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function NS(){var e,t;return!!(et()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function dA(e){try{let t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new gn("Browser returned unexpected credential type",t)}:{data:null,error:new gn("Empty credential response",t)}}catch(t){return{data:null,error:ES({error:t,options:e})}}}async function fA(e){try{let t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new gn("Browser returned unexpected credential type",t)}:{data:null,error:new gn("Empty credential response",t)}}catch(t){return{data:null,error:DS({error:t,options:e})}}}var pA={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},mA={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Id(...e){let t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),r=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),a={};for(let o of e)if(o)for(let n in o){let s=o[n];if(s!==void 0)if(Array.isArray(s))a[n]=s;else if(r(s))a[n]=s;else if(t(s)){let i=a[n];t(i)?a[n]=Id(i,s):a[n]=Id(s)}else a[n]=s}return a}function hA(e,t){return Id(pA,e,t||{})}function gA(e,t){return Id(mA,e,t||{})}var kd=class{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:a,signal:o},n){try{let{data:s,error:i}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!s)return{data:null,error:i};let l=o??cA.createNewAbortSignal();if(s.webauthn.type==="create"){let{user:u}=s.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${a}`),u.displayName||(u.displayName=u.name)}switch(s.webauthn.type){case"create":{let u=hA(s.webauthn.credential_options.publicKey,n?.create),{data:c,error:d}=await dA({publicKey:u,signal:l});return c?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}case"request":{let u=gA(s.webauthn.credential_options.publicKey,n?.request),{data:c,error:d}=await fA(Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:t,challengeId:s.id,webauthn:{type:s.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}}}catch(s){return $(s)?{data:null,error:s}:{data:null,error:new yr("Unexpected error in challenge",s)}}}async _verify({challengeId:t,factorId:r,webauthn:a}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:a})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},n){if(!r)return{data:null,error:new uo("rpId is required for WebAuthn authentication")};try{if(!NS())return{data:null,error:new yr("Browser does not support WebAuthn",null)};let{data:s,error:i}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:a},signal:o},{request:n});if(!s)return{data:null,error:i};let{webauthn:l}=s;return this._verify({factorId:t,challengeId:s.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:a,credential_response:l.credential_response}})}catch(s){return $(s)?{data:null,error:s}:{data:null,error:new yr("Unexpected error in authenticate",s)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:a=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},n){if(!r)return{data:null,error:new uo("rpId is required for WebAuthn registration")};try{if(!NS())return{data:null,error:new yr("Browser does not support WebAuthn",null)};let{data:s,error:i}=await this._enroll({friendlyName:t});if(!s)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===t&&f.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c?.id}):void 0),{data:null,error:i};let{data:l,error:u}=await this._challenge({factorId:s.id,friendlyName:s.friendly_name,webauthn:{rpId:r,rpOrigins:a},signal:o},{create:n});return l?this._verify({factorId:s.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:a,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(s){return $(s)?{data:null,error:s}:{data:null,error:new yr("Unexpected error in register",s)}}}};TS();var yA={url:aS,storageKey:oS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:nS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function US(e,t,r){return await r()}var _s={},Pd=class e{get jwks(){var t,r;return(r=(t=_s[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){_s[this.storageKey]=Object.assign(Object.assign({},_s[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=_s[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){_s[this.storageKey]=Object.assign(Object.assign({},_s[this.storageKey]),{cachedAt:t})}constructor(t){var r,a,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let n=Object.assign(Object.assign({},yA),t);if(this.storageKey=n.storageKey,this.instanceID=(r=e.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!n.debug,typeof n.debug=="function"&&(this.logger=n.debug),this.instanceID>0&&et()){let s=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(s),this.logDebugMessages&&console.trace(s)}if(this.persistSession=n.persistSession,this.autoRefreshToken=n.autoRefreshToken,this.admin=new mn({url:n.url,headers:n.headers,fetch:n.fetch}),this.url=n.url,this.headers=n.headers,this.fetch=wd(n.fetch),this.lock=n.lock||US,this.detectSessionInUrl=n.detectSessionInUrl,this.flowType=n.flowType,this.hasCustomAuthorizationHeader=n.hasCustomAuthorizationHeader,this.throwOnError=n.throwOnError,this.lockAcquireTimeout=n.lockAcquireTimeout,n.lock?this.lock=n.lock:this.persistSession&&et()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=xg:this.lock=US,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new kd(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(n.storage?this.storage=n.storage:xd()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=vg(this.memoryStorage)),n.userStorage&&(this.userStorage=n.userStorage)):(this.memoryStorage={},this.storage=vg(this.memoryStorage)),et()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${fd}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},a="none";if(et()&&(r=yS(window.location.href),this._isImplicitGrantCallback(r)?a="implicit":await this._isPKCECallback(r)&&(a="pkce")),et()&&this.detectSessionInUrl&&a!=="none"){let{data:o,error:n}=await this._getSessionFromURL(r,a);if(n){if(this._debug("#_initialize()","error detecting session from URL",n),cS(n)){let l=(t=n.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:n}}return{error:n}}let{session:s,redirectType:i}=o;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{i==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return $(r)?this._returnResult({error:r}):this._returnResult({error:new yr("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,a,o;try{let n=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(a=(r=t?.options)===null||r===void 0?void 0:r.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:vr}),{data:s,error:i}=n;if(i||!s)return this._returnResult({data:{user:null,session:null},error:i});let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(n){if($(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signUp(t){var r,a,o;try{let n;if("email"in t){let{email:c,password:d,options:f}=t,m=null,v=null;this.flowType==="pkce"&&([m,v]=await dn(this.storage,this.storageKey)),n=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:c,password:d,data:(r=f?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:m,code_challenge_method:v},xform:vr})}else if("phone"in t){let{phone:c,password:d,options:f}=t;n=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(a=f?.data)!==null&&a!==void 0?a:{},channel:(o=f?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:vr})}else throw new nn("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return await st(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:i});let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(n){if(await st(this.storage,`${this.storageKey}-code-verifier`),$(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithPassword(t){try{let r;if("email"in t){let{email:n,password:s,options:i}=t;r=await G(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:gg})}else if("phone"in t){let{phone:n,password:s,options:i}=t;r=await G(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:gg})}else throw new nn("You must provide either an email or phone number and a password");let{data:a,error:o}=r;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!a||!a.session||!a.user){let n=new ga;return this._returnResult({data:{user:null,session:null},error:n})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:Object.assign({user:a.user,session:a.session},a.weak_password?{weakPassword:a.weak_password}:null),error:o})}catch(r){if($(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,a,o,n;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(n=t.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){let{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,a,o,n,s,i,l,u,c,d,f;let m,v;if("message"in t)m=t.message,v=t.signature;else{let{chain:x,wallet:b,statement:g,options:h}=t,y;if(et())if(typeof b=="object")y=b;else{let F=window;if("ethereum"in F&&typeof F.ethereum=="object"&&"request"in F.ethereum&&typeof F.ethereum.request=="function")y=F.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!h?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=b}let w=new URL((r=h?.url)!==null&&r!==void 0?r:window.location.href),L=await y.request({method:"eth_requestAccounts"}).then(F=>F).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!L||L.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");let P=wg(L[0]),_=(a=h?.signInWithEthereum)===null||a===void 0?void 0:a.chainId;if(!_){let F=await y.request({method:"eth_chainId"});_=_S(F)}let A={domain:w.host,address:P,statement:g,uri:w.href,version:"1",chainId:_,nonce:(o=h?.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(s=(n=h?.signInWithEthereum)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date,expirationTime:(i=h?.signInWithEthereum)===null||i===void 0?void 0:i.expirationTime,notBefore:(l=h?.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=h?.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=h?.signInWithEthereum)===null||c===void 0?void 0:c.resources};m=RS(A),v=await y.request({method:"personal_sign",params:[AS(m),P]})}try{let{data:x,error:b}=await G(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:v},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:vr});if(b)throw b;if(!x||!x.session||!x.user){let g=new ga;return this._returnResult({data:{user:null,session:null},error:g})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:b})}catch(x){if($(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async signInWithSolana(t){var r,a,o,n,s,i,l,u,c,d,f,m;let v,x;if("message"in t)v=t.message,x=t.signature;else{let{chain:b,wallet:g,statement:h,options:y}=t,w;if(et())if(typeof g=="object")w=g;else{let P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))w=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!y?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=g}let L=new URL((r=y?.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in w&&w.signIn){let P=await w.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y?.signInWithSolana),{version:"1",domain:L.host,uri:L.href}),h?{statement:h}:null)),_;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")_=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)_=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)v=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),x=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in w)||typeof w.signMessage!="function"||!("publicKey"in w)||typeof w!="object"||!w.publicKey||!("toBase58"in w.publicKey)||typeof w.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${L.host} wants you to sign in with your Solana account:`,w.publicKey.toBase58(),...h?["",h,""]:[""],"Version: 1",`URI: ${L.href}`,`Issued At: ${(o=(a=y?.signInWithSolana)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=y?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((s=y?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((i=y?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((l=y?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((d=(c=y?.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...y.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
|
|
50
|
-
`);let P=await w.signMessage(new TextEncoder().encode(v),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=P}}try{let{data:b,error:g}=await G(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:ya(x)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:vr});if(g)throw g;if(!b||!b.session||!b.user){let h=new ga;return this._returnResult({data:{user:null,session:null},error:h})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:g})}catch(b){if($(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(t){let r=await fo(this.storage,`${this.storageKey}-code-verifier`),[a,o]=(r??"").split("/");try{if(!a&&this.flowType==="pkce")throw new gd;let{data:n,error:s}=await G(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:a},xform:vr});if(await st(this.storage,`${this.storageKey}-code-verifier`),s)throw s;if(!n||!n.session||!n.user){let i=new ga;return this._returnResult({data:{user:null,session:null,redirectType:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign(Object.assign({},n),{redirectType:o??null}),error:s})}catch(n){if(await st(this.storage,`${this.storageKey}-code-verifier`),$(n))return this._returnResult({data:{user:null,session:null,redirectType:null},error:n});throw n}}async signInWithIdToken(t){try{let{options:r,provider:a,token:o,access_token:n,nonce:s}=t,i=await G(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:a,id_token:o,access_token:n,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:vr}),{data:l,error:u}=i;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){let c=new ga;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if($(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,a,o,n,s;try{if("email"in t){let{email:i,options:l}=t,u=null,c=null;this.flowType==="pkce"&&([u,c]=await dn(this.storage,this.storageKey));let{error:d}=await G(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:i,data:(r=l?.data)!==null&&r!==void 0?r:{},create_user:(a=l?.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){let{phone:i,options:l}=t,{data:u,error:c}=await G(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:i,data:(o=l?.data)!==null&&o!==void 0?o:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u?.message_id},error:c})}throw new nn("You must provide either an email or phone number.")}catch(i){if(await st(this.storage,`${this.storageKey}-code-verifier`),$(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async verifyOtp(t){var r,a;try{let o,n;"options"in t&&(o=(r=t.options)===null||r===void 0?void 0:r.redirectTo,n=(a=t.options)===null||a===void 0?void 0:a.captchaToken);let{data:s,error:i}=await G(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:vr});if(i)throw i;if(!s)throw new Error("An error occurred on token verification.");let l=s.session,u=s.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(o){if($(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var r,a,o,n,s;try{let i=null,l=null;this.flowType==="pkce"&&([i,l]=await dn(this.storage,this.storageKey));let u=await G(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(a=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&a!==void 0?a:void 0}),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:l}),headers:this.headers,xform:kS});return!((n=u.data)===null||n===void 0)&&n.url&&et()&&!(!((s=t.options)===null||s===void 0)&&s.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(i){if(await st(this.storage,`${this.storageKey}-code-verifier`),$(i))return this._returnResult({data:null,error:i});throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{let{data:{session:r},error:a}=t;if(a)throw a;if(!r)throw new pt;let{error:o}=await G(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if($(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{let r=`${this.url}/resend`;if("email"in t){let{email:a,type:o,options:n}=t,{error:s}=await G(this.fetch,"POST",r,{headers:this.headers,body:{email:a,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:s})}else if("phone"in t){let{phone:a,type:o,options:n}=t,{data:s,error:i}=await G(this.fetch,"POST",r,{headers:this.headers,body:{phone:a,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:s?.message_id},error:i})}throw new nn("You must provide either an email or phone number and a type")}catch(r){if($(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){let a=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await a,await r()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let a=r();for(this.pendingInLock.push((async()=>{try{await a}catch{}})()),await a;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await a}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null,r=await fo(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let a=t.expires_at?t.expires_at*1e3-Date.now()<md:!1;if(this._debug("#__loadSession()",`session has${a?"":" not"} expired`,"expires_at",t.expires_at),!a){if(this.userStorage){let s=await fo(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Cd()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){let s={value:this.suppressGetSessionWarning};t.user=LS(t.user,s),s.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}let{data:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?this._returnResult({data:{session:null},error:n}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:$r}):await this._useSession(async r=>{var a,o,n;let{data:s,error:i}=r;if(i)throw i;return!(!((a=s.session)===null||a===void 0)&&a.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new pt}:await G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(n=(o=s.session)===null||o===void 0?void 0:o.access_token)!==null&&n!==void 0?n:void 0,xform:$r})})}catch(r){if($(r))return uS(r)&&(await this._removeSession(),await st(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async a=>{let{data:o,error:n}=a;if(n)throw n;if(!o.session)throw new pt;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await dn(this.storage,this.storageKey));let{data:u,error:c}=await G(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:i,code_challenge_method:l}),jwt:s.access_token,xform:$r});if(c)throw c;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),this._returnResult({data:{user:s.user},error:null})})}catch(a){if(await st(this.storage,`${this.storageKey}-code-verifier`),$(a))return this._returnResult({data:{user:null},error:a});throw a}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new pt;let r=Date.now()/1e3,a=r,o=!0,n=null,{payload:s}=Sd(t.access_token);if(s.exp&&(a=s.exp,o=a<=r),o){let{data:i,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!i)return{data:{user:null,session:null},error:null};n=i}else{let{data:i,error:l}=await this._getUser(t.access_token);if(l)throw l;n={access_token:t.access_token,refresh_token:t.refresh_token,user:i.user,token_type:"bearer",expires_in:a-r,expires_at:a},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return this._returnResult({data:{user:n.user,session:n},error:null})}catch(r){if($(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var a;if(!t){let{data:s,error:i}=r;if(i)throw i;t=(a=s.session)!==null&&a!==void 0?a:void 0}if(!t?.refresh_token)throw new pt;let{data:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?this._returnResult({data:{user:null,session:null},error:n}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if($(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!et())throw new sn("No browser detected.");if(t.error||t.error_description||t.error_code)throw new sn(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new Vl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new sn("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new Vl("No code detected.");let{data:h,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;let w=new URL(window.location.href);return w.searchParams.delete("code"),window.history.replaceState(window.history.state,"",w.toString()),{data:{session:h.session,redirectType:null},error:null}}let{provider_token:a,provider_refresh_token:o,access_token:n,refresh_token:s,expires_in:i,expires_at:l,token_type:u}=t;if(!n||!i||!s||!u)throw new sn("No session defined in URL");let c=Math.round(Date.now()/1e3),d=parseInt(i),f=c+d;l&&(f=parseInt(l));let m=f-c;m*1e3<=on&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${d}s`);let v=f-d;c-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,f,c):c-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,f,c);let{data:x,error:b}=await this._getUser(n);if(b)throw b;let g={provider_token:a,provider_refresh_token:o,access_token:n,expires_in:d,expires_at:f,refresh_token:s,token_type:u,user:x.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:g,redirectType:t.type},error:null})}catch(a){if($(a))return this._returnResult({data:{session:null,redirectType:null},error:a});throw a}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){let r=await fo(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({error:n});let s=(a=o.session)===null||a===void 0?void 0:a.access_token;if(s){let{error:i}=await this.admin.signOut(s,t);if(i&&!(lS(i)&&(i.status===404||i.status===401||i.status===403)))return this._returnResult({error:i})}return t!=="others"&&(await this._removeSession(),await st(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){let r=gS(),a={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,a),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:a}}}async _emitInitialSession(t){return await this._useSession(async r=>{var a,o;try{let{data:{session:n},error:s}=r;if(s)throw s;await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",t,"session",n)}catch(n){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",n),console.error(n)}})}async resetPasswordForEmail(t,r={}){let a=null,o=null;this.flowType==="pkce"&&([a,o]=await dn(this.storage,this.storageKey,!0));try{return await G(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:a,code_challenge_method:o,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(n){if(await st(this.storage,`${this.storageKey}-code-verifier`),$(n))return this._returnResult({data:null,error:n});throw n}}async getUserIdentities(){var t;try{let{data:r,error:a}=await this.getUser();if(a)throw a;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{let{data:a,error:o}=await this._useSession(async n=>{var s,i,l,u,c;let{data:d,error:f}=n;if(f)throw f;let m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await G(this.fetch,"GET",m,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(o)throw o;return et()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(a?.url),this._returnResult({data:{provider:t.provider,url:a?.url},error:null})}catch(a){if($(a))return this._returnResult({data:{provider:t.provider,url:null},error:a});throw a}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var a;try{let{error:o,data:{session:n}}=r;if(o)throw o;let{options:s,provider:i,token:l,access_token:u,nonce:c}=t,d=await G(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(a=n?.access_token)!==null&&a!==void 0?a:void 0,body:{provider:i,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:s?.captchaToken}},xform:vr}),{data:f,error:m}=d;return m?this._returnResult({data:{user:null,session:null},error:m}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new ga}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:m}))}catch(o){if(await st(this.storage,`${this.storageKey}-code-verifier`),$(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var a,o;let{data:n,error:s}=r;if(s)throw s;return await G(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(a=n.session)===null||a===void 0?void 0:a.access_token)!==null&&o!==void 0?o:void 0})})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){let r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{let a=Date.now();return await wS(async o=>(o>0&&await xS(200*Math.pow(2,o-1)),this._debug(r,"refreshing attempt",o),await G(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:vr})),(o,n)=>{let s=200*Math.pow(2,o);return n&&yd(n)&&Date.now()+s-a<on})}catch(a){if(this._debug(r,"error",a),$(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){let a=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",a),et()&&!r.skipBrowserRedirect&&window.location.assign(a),{data:{provider:t,url:a},error:null}}async _recoverAndRefresh(){var t,r;let a="#_recoverAndRefresh()";this._debug(a,"begin");try{let o=await fo(this.storage,this.storageKey);if(o&&this.userStorage){let s=await fo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await cn(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Cd()}else if(o&&!o.user&&!o.user){let s=await fo(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await st(this.storage,this.storageKey+"-user"),await cn(this.storage,this.storageKey,o)):o.user=Cd()}if(this._debug(a,"session from storage",o),!this._isValidSession(o)){this._debug(a,"session is not valid"),o!==null&&await this._removeSession();return}let n=((r=o.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<md;if(this._debug(a,`session has${n?"":" not"} expired with margin of ${md}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),yd(s)||(this._debug(a,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:i}=await this._getUser(o.access_token);!i&&s?.user?(o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(a,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(a,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(a,"error",o),console.error(o);return}finally{this._debug(a,"end")}}async _callRefreshToken(t){var r,a;if(!t)throw new pt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new ql;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new pt;await this._saveSession(n.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",n.session);let i={data:n.session,error:null};return this.refreshingDeferred.resolve(i),i}catch(n){if(this._debug(o,"error",n),$(n)){let s={data:null,error:n};return yd(n)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(a=this.refreshingDeferred)===null||a===void 0||a.reject(n),n}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,r,a=!0){let o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",r,`broadcast = ${a}`);try{this.broadcastChannel&&a&&this.broadcastChannel.postMessage({event:t,session:r});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(t,r)}catch(l){n.push(l)}});if(await Promise.all(s),n.length>0){for(let i=0;i<n.length;i+=1)console.error(n[i]);throw n[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await st(this.storage,`${this.storageKey}-code-verifier`);let r=Object.assign({},t),a=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!a&&r.user&&await cn(this.userStorage,this.storageKey+"-user",{user:r.user});let o=Object.assign({},r);delete o.user;let n=hg(o);await cn(this.storage,this.storageKey,n)}else{let o=hg(r);await cn(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await st(this.storage,this.storageKey),await st(this.storage,this.storageKey+"-code-verifier"),await st(this.storage,this.storageKey+"-user"),this.userStorage&&await st(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&et()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let t=setInterval(()=>this._autoRefreshTokenTick(),on);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);let r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);let r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let t=Date.now();try{return await this._useSession(async r=>{let{data:{session:a}}=r;if(!a||!a.refresh_token||!a.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let o=Math.floor((a.expires_at*1e3-t)/on);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${on}ms, refresh threshold is ${pd} ticks`),o<=pd&&await this._callRefreshToken(a.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof $l)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!et()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){let r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,a){let o=[`provider=${encodeURIComponent(r)}`];if(a?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(a.redirectTo)}`),a?.scopes&&o.push(`scopes=${encodeURIComponent(a.scopes)}`),this.flowType==="pkce"){let[n,s]=await dn(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(s)}`});o.push(i.toString())}if(a?.queryParams){let n=new URLSearchParams(a.queryParams);o.push(n.toString())}return a?.skipBrowserRedirect&&o.push(`skip_http_redirect=${a.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;return n?this._returnResult({data:null,error:n}):await G(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token})})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var a,o;let{data:n,error:s}=r;if(s)return this._returnResult({data:null,error:s});let i=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:u}=await G(this.fetch,"POST",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(a=n?.session)===null||a===void 0?void 0:a.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&l.type==="totp"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({data:null,error:n});let s=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?BS(t.webauthn.credential_response):FS(t.webauthn.credential_response)})}:{code:t.code}),{data:i,error:l}=await G(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:s,headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+i.expires_in},i)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",i),this._returnResult({data:i,error:l}))})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var a;let{data:o,error:n}=r;if(n)return this._returnResult({data:null,error:n});let s=await G(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(a=o?.session)===null||a===void 0?void 0:a.access_token});if(s.error)return s;let{data:i}=s;if(i.type!=="webauthn")return{data:i,error:null};switch(i.webauthn.type){case"create":return{data:Object.assign(Object.assign({},i),{webauthn:Object.assign(Object.assign({},i.webauthn),{credential_options:Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:MS(i.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},i),{webauthn:Object.assign(Object.assign({},i.webauthn),{credential_options:Object.assign(Object.assign({},i.webauthn.credential_options),{publicKey:OS(i.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){let{data:r,error:a}=await this._challenge({factorId:t.factorId});return a?this._returnResult({data:null,error:a}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;let{data:{user:r},error:a}=await this.getUser();if(a)return{data:null,error:a};let o={all:[],phone:[],totp:[],webauthn:[]};for(let n of(t=r?.factors)!==null&&t!==void 0?t:[])o.all.push(n),n.status==="verified"&&o[n.factor_type].push(n);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(){var t,r;let{data:{session:a},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:n}=Sd(a.access_token),s=null;n.aal&&(s=n.aal);let i=s;((r=(t=a.user.factors)===null||t===void 0?void 0:t.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(i="aal2");let u=n.amr||[];return{data:{currentLevel:s,nextLevel:i,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{let{data:{session:a},error:o}=r;return o?this._returnResult({data:null,error:o}):a?await G(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:a.access_token,xform:n=>({data:n,error:null})}):this._returnResult({data:null,error:new pt})})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async a=>{let{data:{session:o},error:n}=a;if(n)return this._returnResult({data:null,error:n});if(!o)return this._returnResult({data:null,error:new pt});let s=await G(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:i=>({data:i,error:null})});return s.data&&s.data.redirect_url&&et()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(a){if($(a))return this._returnResult({data:null,error:a});throw a}}async _denyAuthorization(t,r){try{return await this._useSession(async a=>{let{data:{session:o},error:n}=a;if(n)return this._returnResult({data:null,error:n});if(!o)return this._returnResult({data:null,error:new pt});let s=await G(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:i=>({data:i,error:null})});return s.data&&s.data.redirect_url&&et()&&!r?.skipBrowserRedirect&&window.location.assign(s.data.redirect_url),s})}catch(a){if($(a))return this._returnResult({data:null,error:a});throw a}}async _listOAuthGrants(){try{return await this._useSession(async t=>{let{data:{session:r},error:a}=t;return a?this._returnResult({data:null,error:a}):r?await G(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new pt})})}catch(t){if($(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{let{data:{session:a},error:o}=r;return o?this._returnResult({data:null,error:o}):a?(await G(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new pt})})}catch(r){if($(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let a=r.keys.find(i=>i.kid===t);if(a)return a;let o=Date.now();if(a=this.jwks.keys.find(i=>i.kid===t),a&&this.jwks_cached_at+iS>o)return a;let{data:n,error:s}=await G(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!n.keys||n.keys.length===0||(this.jwks=n,this.jwks_cached_at=o,a=n.keys.find(i=>i.kid===t),!a)?null:a}async getClaims(t,r={}){try{let a=t;if(!a){let{data:m,error:v}=await this.getSession();if(v||!m.session)return this._returnResult({data:null,error:v});a=m.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=Sd(a);r?.allowExpired||CS(n.exp);let u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,r?.keys?{keys:r.keys}:r?.jwks);if(!u){let{error:m}=await this.getUser(a);if(m)throw m;return{data:{claims:n,header:o,signature:s},error:null}}let c=bS(o.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,s,mS(`${i}.${l}`)))throw new ln("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(a){if($(a))return this._returnResult({data:null,error:a});throw a}}};Pd.nextInstanceID={};var bg=Pd;var vA=bg,Lg=vA;var xA="2.90.1",Hl="";typeof Deno<"u"?Hl="deno":typeof document<"u"?Hl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Hl="react-native":Hl="node";var wA={"X-Client-Info":`supabase-js-${Hl}/${xA}`},SA={headers:wA},CA={schema:"public"},bA={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},LA={};function zl(e){"@babel/helpers - typeof";return zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zl(e)}function IA(e,t){if(zl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(zl(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kA(e){var t=IA(e,"string");return zl(t)=="symbol"?t:t+""}function PA(e,t,r){return(t=kA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function qe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VS(Object(r),!0).forEach(function(a){PA(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VS(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var TA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),_A=()=>Headers,AA=(e,t,r)=>{let a=TA(r),o=_A();return async(n,s)=>{var i;let l=(i=await t())!==null&&i!==void 0?i:e,u=new o(s?.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),a(n,qe(qe({},s),{},{headers:u}))}};function RA(e){return e.endsWith("/")?e:e+"/"}function EA(e,t){var r,a;let{db:o,auth:n,realtime:s,global:i}=e,{db:l,auth:u,realtime:c,global:d}=t,f={db:qe(qe({},l),o),auth:qe(qe({},u),n),realtime:qe(qe({},c),s),storage:{},global:qe(qe(qe({},d),i),{},{headers:qe(qe({},(r=d?.headers)!==null&&r!==void 0?r:{}),(a=i?.headers)!==null&&a!==void 0?a:{})}),accessToken:async()=>""};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function DA(e){let t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(RA(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var NA=class extends Lg{constructor(e){super(e)}},MA=class{constructor(e,t,r){var a,o;this.supabaseUrl=e,this.supabaseKey=t;let n=DA(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",n),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",n),this.storageUrl=new URL("storage/v1",n),this.functionsUrl=new URL("functions/v1",n);let s=`sb-${n.hostname.split(".")[0]}-auth-token`,i={db:CA,realtime:LA,auth:qe(qe({},bA),{},{storageKey:s}),global:SA},l=EA(r??{},i);if(this.storageKey=(a=l.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=AA(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(qe({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&this.accessToken().then(c=>this.realtime.setAuth(c)).catch(c=>console.warn("Failed to set initial Realtime auth token:",c)),this.rest=new Vw(new URL("rest/v1",n).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new rS(this.storageUrl.href,this.headers,this.fetch,r?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new El(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();let{data:a}=await e.auth.getSession();return(t=(r=a.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:a,userStorage:o,storageKey:n,flowType:s,lock:i,debug:l,throwOnError:u},c,d){let f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new NA({url:this.authUrl.href,headers:qe(qe({},f),c),storageKey:n,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:a,userStorage:o,flowType:s,lock:i,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new ks(this.realtimeUrl.href,qe(qe({},e),{},{params:qe(qe({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}},jS=(e,t,r)=>new MA(e,t,r);function OA(){if(typeof window<"u")return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}OA()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function qS(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=qS(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Td(){for(var e,t,r=0,a="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=qS(e))&&(a&&(a+=" "),a+=t);return a}var BA=e=>{let t=UA(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),zS(i,t)||FA(s)},getConflictingClassGroupIds:(s,i)=>{let l=r[s]||[];return i&&a[s]?[...l,...a[s]]:l}}},zS=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],a=t.nextPart.get(r),o=a?zS(e.slice(1),a):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},$S=/^\[(.+)\]$/,FA=e=>{if($S.test(e)){let t=$S.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},UA=e=>{let{theme:t,prefix:r}=e,a={nextPart:new Map,validators:[]};return jA(Object.entries(e.classGroups),r).forEach(([n,s])=>{kg(s,a,n,t)}),a},kg=(e,t,r,a)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:HS(t,o);n.classGroupId=r;return}if(typeof o=="function"){if(VA(o)){kg(o(a),t,r,a);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([n,s])=>{kg(s,HS(t,n),r,a)})})},HS=(e,t)=>{let r=e;return t.split("-").forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},VA=e=>e.isThemeGetter,jA=(e,t)=>t?e.map(([r,a])=>{let o=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[r,o]}):e,qA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map,o=(n,s)=>{r.set(n,s),t++,t>e&&(t=0,a=r,r=new Map)};return{get(n){let s=r.get(n);if(s!==void 0)return s;if((s=a.get(n))!==void 0)return o(n,s),s},set(n,s){r.has(n)?r.set(n,s):o(n,s)}}};var $A=e=>{let{separator:t,experimentalParseClassName:r}=e,a=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,c=0,d;for(let b=0;b<i.length;b++){let g=i[b];if(u===0){if(g===o&&(a||i.slice(b,b+n)===t)){l.push(i.slice(c,b)),c=b+n;continue}if(g==="/"){d=b;continue}}g==="["?u++:g==="]"&&u--}let f=l.length===0?i:i.substring(c),m=f.startsWith("!"),v=m?f.substring(1):f,x=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:x}};return r?i=>r({className:i,parseClassName:s}):s},HA=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(a=>{a[0]==="["?(t.push(...r.sort(),a),r=[]):r.push(a)}),t.push(...r.sort()),t},zA=e=>({cache:qA(e.cacheSize),parseClassName:$A(e),...BA(e)}),WA=/\s+/,GA=(e,t)=>{let{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(WA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=r(u),v=!!m,x=a(v?f.substring(0,m):f);if(!x){if(!v){i=u+(i.length>0?" "+i:i);continue}if(x=a(f),!x){i=u+(i.length>0?" "+i:i);continue}v=!1}let b=HA(c).join(":"),g=d?b+"!":b,h=g+x;if(n.includes(h))continue;n.push(h);let y=o(x,v);for(let w=0;w<y.length;++w){let L=y[w];n.push(g+L)}i=u+(i.length>0?" "+i:i)}return i};function KA(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=WS(t))&&(a&&(a+=" "),a+=r);return a}var WS=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=WS(e[a]))&&(r&&(r+=" "),r+=t);return r};function XA(e,...t){let r,a,o,n=s;function s(l){let u=t.reduce((c,d)=>d(c),e());return r=zA(u),a=r.cache.get,o=r.cache.set,n=i,i(l)}function i(l){let u=a(l);if(u)return u;let c=GA(l,r);return o(l,c),c}return function(){return n(KA.apply(null,arguments))}}var Te=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},GS=/^\[(?:([a-z-]+):)?(.+)\]$/i,JA=/^\d+\/\d+$/,QA=new Set(["px","full","screen"]),YA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZA=/\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$/,eR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,rR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,va=e=>As(e)||QA.has(e)||JA.test(e),po=e=>Rs(e,"length",cR),As=e=>!!e&&!Number.isNaN(Number(e)),Ig=e=>Rs(e,"number",As),Wl=e=>!!e&&Number.isInteger(Number(e)),aR=e=>e.endsWith("%")&&As(e.slice(0,-1)),ee=e=>GS.test(e),mo=e=>YA.test(e),oR=new Set(["length","size","percentage"]),nR=e=>Rs(e,oR,KS),sR=e=>Rs(e,"position",KS),iR=new Set(["image","url"]),lR=e=>Rs(e,iR,fR),uR=e=>Rs(e,"",dR),Gl=()=>!0,Rs=(e,t,r)=>{let a=GS.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):r(a[2]):!1},cR=e=>ZA.test(e)&&!eR.test(e),KS=()=>!1,dR=e=>tR.test(e),fR=e=>rR.test(e);var pR=()=>{let e=Te("colors"),t=Te("spacing"),r=Te("blur"),a=Te("brightness"),o=Te("borderColor"),n=Te("borderRadius"),s=Te("borderSpacing"),i=Te("borderWidth"),l=Te("contrast"),u=Te("grayscale"),c=Te("hueRotate"),d=Te("invert"),f=Te("gap"),m=Te("gradientColorStops"),v=Te("gradientColorStopPositions"),x=Te("inset"),b=Te("margin"),g=Te("opacity"),h=Te("padding"),y=Te("saturate"),w=Te("scale"),L=Te("sepia"),P=Te("skew"),_=Te("space"),A=Te("translate"),F=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto",ee,t],ce=()=>[ee,t],we=()=>["",va,po],ea=()=>["auto",As,ee],ta=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ma=()=>["solid","dashed","dotted","double","none"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],De=()=>["start","end","center","between","around","evenly","stretch"],de=()=>["","0",ee],Oa=()=>["auto","avoid","all","avoid-page","page","left","right","column"],wr=()=>[As,ee];return{cacheSize:500,separator:":",theme:{colors:[Gl],spacing:[va,po],blur:["none","",mo,ee],brightness:wr(),borderColor:[e],borderRadius:["none","","full",mo,ee],borderSpacing:ce(),borderWidth:we(),contrast:wr(),grayscale:de(),hueRotate:wr(),invert:de(),gap:ce(),gradientColorStops:[e],gradientColorStopPositions:[aR,po],inset:me(),margin:me(),opacity:wr(),padding:ce(),saturate:wr(),scale:wr(),sepia:de(),skew:wr(),space:ce(),translate:ce()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[mo]}],"break-after":[{"break-after":Oa()}],"break-before":[{"break-before":Oa()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ta(),ee]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Wl,ee]}],basis:[{basis:me()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:de()}],shrink:[{shrink:de()}],order:[{order:["first","last","none",Wl,ee]}],"grid-cols":[{"grid-cols":[Gl]}],"col-start-end":[{col:["auto",{span:["full",Wl,ee]},ee]}],"col-start":[{"col-start":ea()}],"col-end":[{"col-end":ea()}],"grid-rows":[{"grid-rows":[Gl]}],"row-start-end":[{row:["auto",{span:[Wl,ee]},ee]}],"row-start":[{"row-start":ea()}],"row-end":[{"row-end":ea()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...De()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...De(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...De(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[h]}],px:[{px:[h]}],py:[{py:[h]}],ps:[{ps:[h]}],pe:[{pe:[h]}],pt:[{pt:[h]}],pr:[{pr:[h]}],pb:[{pb:[h]}],pl:[{pl:[h]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[mo]},mo]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",mo,po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ig]}],"font-family":[{font:[Gl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",As,Ig]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",va,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ma(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",va,po]}],"underline-offset":[{"underline-offset":["auto",va,ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ce()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ta(),sR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Ma(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Ma()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Ma()]}],"outline-offset":[{"outline-offset":[va,ee]}],"outline-w":[{outline:[va,po]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[va,po]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",mo,uR]}],"shadow-color":[{shadow:[Gl]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Re()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[a]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",mo,ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:wr()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:wr()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Wl,ee]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ce()}],"scroll-mx":[{"scroll-mx":ce()}],"scroll-my":[{"scroll-my":ce()}],"scroll-ms":[{"scroll-ms":ce()}],"scroll-me":[{"scroll-me":ce()}],"scroll-mt":[{"scroll-mt":ce()}],"scroll-mr":[{"scroll-mr":ce()}],"scroll-mb":[{"scroll-mb":ce()}],"scroll-ml":[{"scroll-ml":ce()}],"scroll-p":[{"scroll-p":ce()}],"scroll-px":[{"scroll-px":ce()}],"scroll-py":[{"scroll-py":ce()}],"scroll-ps":[{"scroll-ps":ce()}],"scroll-pe":[{"scroll-pe":ce()}],"scroll-pt":[{"scroll-pt":ce()}],"scroll-pr":[{"scroll-pr":ce()}],"scroll-pb":[{"scroll-pb":ce()}],"scroll-pl":[{"scroll-pl":ce()}],"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",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[va,po,Ig]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var XS=XA(pR);function rr(...e){return XS(Td(e))}var ZS=M(le(),1);function Ue({className:e,type:t,...r}){return(0,ZS.jsx)("input",{type:t,"data-slot":"input",className:rr("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var Xe=M(K(),1);var tC=M(K(),1);function eC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kl(...e){return t=>{let r=!1,a=e.map(o=>{let n=eC(o,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let o=0;o<a.length;o++){let n=a[o];typeof n=="function"?n():eC(e[o],null)}}}}function xa(...e){return tC.useCallback(Kl(...e),e)}var Ad=M(le(),1),wR=Symbol.for("react.lazy"),Rd=Xe[" use ".trim().toString()];function SR(e){return typeof e=="object"&&e!==null&&"then"in e}function rC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===wR&&"_payload"in e&&SR(e._payload)}function CR(e){let t=bR(e),r=Xe.forwardRef((a,o)=>{let{children:n,...s}=a;rC(n)&&typeof Rd=="function"&&(n=Rd(n._payload));let i=Xe.Children.toArray(n),l=i.find(IR);if(l){let u=l.props.children,c=i.map(d=>d===l?Xe.Children.count(u)>1?Xe.Children.only(null):Xe.isValidElement(u)?u.props.children:null:d);return(0,Ad.jsx)(t,{...s,ref:o,children:Xe.isValidElement(u)?Xe.cloneElement(u,void 0,c):null})}return(0,Ad.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}var aC=CR("Slot");function bR(e){let t=Xe.forwardRef((r,a)=>{let{children:o,...n}=r;if(rC(o)&&typeof Rd=="function"&&(o=Rd(o._payload)),Xe.isValidElement(o)){let s=PR(o),i=kR(n,o.props);return o.type!==Xe.Fragment&&(i.ref=a?Kl(a,s):s),Xe.cloneElement(o,i)}return Xe.Children.count(o)>1?Xe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var LR=Symbol("radix.slottable");function IR(e){return Xe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===LR}function kR(e,t){let r={...t};for(let a in t){let o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(r[a]=o):a==="style"?r[a]={...o,...n}:a==="className"&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function PR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var oC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nC=Td,sC=(e,t)=>r=>{var a;if(t?.variants==null)return nC(e,r?.class,r?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let c=r?.[u],d=n?.[u];if(c===null)return null;let f=oC(c)||oC(d);return o[u][f]}),i=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((u,c)=>{let{class:d,className:f,...m}=c;return Object.entries(m).every(v=>{let[x,b]=v;return Array.isArray(b)?b.includes({...n,...i}[x]):{...n,...i}[x]===b})?[...u,d,f]:u},[]);return nC(e,s,l,r?.class,r?.className)};var iC=M(le(),1),TR=sC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function it({className:e,variant:t,size:r,asChild:a=!1,...o}){return(0,iC.jsx)(a?aC:"button",{"data-slot":"button",className:rr(TR({variant:t,size:r,className:e})),...o})}var DC=M(K(),1);var W=M(K(),1);var uC=M(K(),1),NR=M(Gh(),1);var tt=M(K(),1);var Ed=M(le(),1);function lC(e){let t=_R(e),r=tt.forwardRef((a,o)=>{let{children:n,...s}=a,i=tt.Children.toArray(n),l=i.find(RR);if(l){let u=l.props.children,c=i.map(d=>d===l?tt.Children.count(u)>1?tt.Children.only(null):tt.isValidElement(u)?u.props.children:null:d);return(0,Ed.jsx)(t,{...s,ref:o,children:tt.isValidElement(u)?tt.cloneElement(u,void 0,c):null})}return(0,Ed.jsx)(t,{...s,ref:o,children:n})});return r.displayName=`${e}.Slot`,r}function _R(e){let t=tt.forwardRef((r,a)=>{let{children:o,...n}=r;if(tt.isValidElement(o)){let s=DR(o),i=ER(n,o.props);return o.type!==tt.Fragment&&(i.ref=a?Kl(a,s):s),tt.cloneElement(o,i)}return tt.Children.count(o)>1?tt.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AR=Symbol("radix.slottable");function RR(e){return tt.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AR}function ER(e,t){let r={...t};for(let a in t){let o=e[a],n=t[a];/^on[A-Z]/.test(a)?o&&n?r[a]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(r[a]=o):a==="style"?r[a]={...o,...n}:a==="className"&&(r[a]=[o,n].filter(Boolean).join(" "))}return{...e,...r}}function DR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var cC=M(le(),1),MR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Es=MR.reduce((e,t)=>{let r=lC(`Primitive.${t}`),a=uC.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,cC.jsx)(l,{...i,ref:n})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});var Vt=M(K(),1);var dC=M(K(),1),Xl=globalThis?.document?dC.useLayoutEffect:()=>{};var fC=M(K(),1);function OR(e,t){return fC.useReducer((r,a)=>t[r][a]??r,e)}var Ds=e=>{let{present:t,children:r}=e,a=BR(t),o=typeof r=="function"?r({present:a.isPresent}):Vt.Children.only(r),n=xa(a.ref,FR(o));return typeof r=="function"||a.isPresent?Vt.cloneElement(o,{ref:n}):null};Ds.displayName="Presence";function BR(e){let[t,r]=Vt.useState(),a=Vt.useRef(null),o=Vt.useRef(e),n=Vt.useRef("none"),s=e?"mounted":"unmounted",[i,l]=OR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Vt.useEffect(()=>{let u=Dd(a.current);n.current=i==="mounted"?u:"none"},[i]),Xl(()=>{let u=a.current,c=o.current;if(c!==e){let f=n.current,m=Dd(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(c&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Xl(()=>{if(t){let u,c=t.ownerDocument.defaultView??window,d=m=>{let x=Dd(a.current).includes(CSS.escape(m.animationName));if(m.target===t&&x&&(l("ANIMATION_END"),!o.current)){let b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=m=>{m.target===t&&(n.current=Dd(a.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:Vt.useCallback(u=>{a.current=u?getComputedStyle(u):null,r(u)},[])}}function Dd(e){return e?.animationName||"none"}function FR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var wa=M(K(),1),pC=M(le(),1);function mC(e,t=[]){let r=[];function a(n,s){let i=wa.createContext(s),l=r.length;r=[...r,s];let u=d=>{let{scope:f,children:m,...v}=d,x=f?.[e]?.[l]||i,b=wa.useMemo(()=>v,Object.values(v));return(0,pC.jsx)(x.Provider,{value:b,children:m})};u.displayName=n+"Provider";function c(d,f){let m=f?.[e]?.[l]||i,v=wa.useContext(m);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${n}\``)}return[u,c]}let o=()=>{let n=r.map(s=>wa.createContext(s));return function(i){let l=i?.[e]||n;return wa.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[a,UR(o,...t)]}function UR(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=a.reduce((i,{useScope:l,scopeName:u})=>{let d=l(n)[`__scope${u}`];return{...i,...d}},{});return wa.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Ns=M(K(),1);function ho(e){let t=Ns.useRef(e);return Ns.useEffect(()=>{t.current=e}),Ns.useMemo(()=>(...r)=>t.current?.(...r),[])}var Nd=M(K(),1),VR=M(le(),1),jR=Nd.createContext(void 0);function hC(e){let t=Nd.useContext(jR);return e||t||"ltr"}function gC(e,[t,r]){return Math.min(r,Math.max(t,e))}var F2=!!(typeof window<"u"&&window.document&&window.document.createElement);function go(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o.defaultPrevented)return t?.(o)}}var vC=M(K(),1),pe=M(le(),1);function qR(e,t){return vC.useReducer((r,a)=>t[r][a]??r,e)}var Pg="ScrollArea",[xC,X2]=mC(Pg),[$R,xr]=xC(Pg),wC=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,type:a="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=W.useState(null),[u,c]=W.useState(null),[d,f]=W.useState(null),[m,v]=W.useState(null),[x,b]=W.useState(null),[g,h]=W.useState(0),[y,w]=W.useState(0),[L,P]=W.useState(!1),[_,A]=W.useState(!1),F=xa(t,me=>l(me)),V=hC(o);return(0,pe.jsx)($R,{scope:r,type:a,dir:V,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:L,onScrollbarXEnabledChange:P,scrollbarY:x,onScrollbarYChange:b,scrollbarYEnabled:_,onScrollbarYEnabledChange:A,onCornerWidthChange:h,onCornerHeightChange:w,children:(0,pe.jsx)(Es.div,{dir:V,...s,ref:F,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});wC.displayName=Pg;var SC="ScrollAreaViewport",CC=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,children:a,nonce:o,...n}=e,s=xr(SC,r),i=W.useRef(null),l=xa(t,i,s.onViewportChange);return(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,pe.jsx)(Es.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,pe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:a})})]})});CC.displayName=SC;var Hr="ScrollAreaScrollbar",Tg=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=xr(Hr,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return W.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,pe.jsx)(HR,{...a,ref:t,forceMount:r}):o.type==="scroll"?(0,pe.jsx)(zR,{...a,ref:t,forceMount:r}):o.type==="auto"?(0,pe.jsx)(bC,{...a,ref:t,forceMount:r}):o.type==="always"?(0,pe.jsx)(_g,{...a,ref:t}):null});Tg.displayName=Hr;var HR=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=xr(Hr,e.__scopeScrollArea),[n,s]=W.useState(!1);return W.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},c=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",c),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",c)}}},[o.scrollArea,o.scrollHideDelay]),(0,pe.jsx)(Ds,{present:r||n,children:(0,pe.jsx)(bC,{"data-state":n?"visible":"hidden",...a,ref:t})})}),zR=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=xr(Hr,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Fd(()=>l("SCROLL_END"),100),[i,l]=qR("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return W.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),W.useEffect(()=>{let u=o.viewport,c=n?"scrollLeft":"scrollTop";if(u){let d=u[c],f=()=>{let m=u[c];d!==m&&(l("SCROLL"),s()),d=m};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,pe.jsx)(Ds,{present:r||i!=="hidden",children:(0,pe.jsx)(_g,{"data-state":i==="hidden"?"hidden":"visible",...a,ref:t,onPointerEnter:go(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:go(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),bC=W.forwardRef((e,t)=>{let r=xr(Hr,e.__scopeScrollArea),{forceMount:a,...o}=e,[n,s]=W.useState(!1),i=e.orientation==="horizontal",l=Fd(()=>{if(r.viewport){let u=r.viewport.offsetWidth<r.viewport.scrollWidth,c=r.viewport.offsetHeight<r.viewport.scrollHeight;s(i?u:c)}},10);return Ms(r.viewport,l),Ms(r.content,l),(0,pe.jsx)(Ds,{present:a||n,children:(0,pe.jsx)(_g,{"data-state":n?"visible":"hidden",...o,ref:t})})}),_g=W.forwardRef((e,t)=>{let{orientation:r="vertical",...a}=e,o=xr(Hr,e.__scopeScrollArea),n=W.useRef(null),s=W.useRef(0),[i,l]=W.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=PC(i.viewport,i.content),c={...a,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,m){return QR(f,s.current,i,m)}return r==="horizontal"?(0,pe.jsx)(WR,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,m=yC(f,i,o.dir);n.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):r==="vertical"?(0,pe.jsx)(GR,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,m=yC(f,i);n.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),WR=W.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=xr(Hr,e.__scopeScrollArea),[s,i]=W.useState(),l=W.useRef(null),u=xa(t,l,n.onScrollbarXChange);return W.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,pe.jsx)(IC,{"data-orientation":"horizontal",...o,ref:u,sizes:r,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Bd(r)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,d)=>{if(n.viewport){let f=n.viewport.scrollLeft+c.deltaX;e.onWheelScroll(f),_C(f,d)&&c.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&a({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Od(s.paddingLeft),paddingEnd:Od(s.paddingRight)}})}})}),GR=W.forwardRef((e,t)=>{let{sizes:r,onSizesChange:a,...o}=e,n=xr(Hr,e.__scopeScrollArea),[s,i]=W.useState(),l=W.useRef(null),u=xa(t,l,n.onScrollbarYChange);return W.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,pe.jsx)(IC,{"data-orientation":"vertical",...o,ref:u,sizes:r,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Bd(r)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,d)=>{if(n.viewport){let f=n.viewport.scrollTop+c.deltaY;e.onWheelScroll(f),_C(f,d)&&c.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&a({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Od(s.paddingTop),paddingEnd:Od(s.paddingBottom)}})}})}),[KR,LC]=xC(Hr),IC=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,sizes:a,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=e,m=xr(Hr,r),[v,x]=W.useState(null),b=xa(t,F=>x(F)),g=W.useRef(null),h=W.useRef(""),y=m.viewport,w=a.content-a.viewport,L=ho(c),P=ho(l),_=Fd(d,10);function A(F){if(g.current){let V=F.clientX-g.current.left,me=F.clientY-g.current.top;u({x:V,y:me})}}return W.useEffect(()=>{let F=V=>{let me=V.target;v?.contains(me)&&L(V,w)};return document.addEventListener("wheel",F,{passive:!1}),()=>document.removeEventListener("wheel",F,{passive:!1})},[y,v,w,L]),W.useEffect(P,[a,P]),Ms(v,_),Ms(m.content,_),(0,pe.jsx)(KR,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:ho(n),onThumbPointerUp:ho(s),onThumbPositionChange:P,onThumbPointerDown:ho(i),children:(0,pe.jsx)(Es.div,{...f,ref:b,style:{position:"absolute",...f.style},onPointerDown:go(e.onPointerDown,F=>{F.button===0&&(F.target.setPointerCapture(F.pointerId),g.current=v.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),A(F))}),onPointerMove:go(e.onPointerMove,A),onPointerUp:go(e.onPointerUp,F=>{let V=F.target;V.hasPointerCapture(F.pointerId)&&V.releasePointerCapture(F.pointerId),document.body.style.webkitUserSelect=h.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),Md="ScrollAreaThumb",Ag=W.forwardRef((e,t)=>{let{forceMount:r,...a}=e,o=LC(Md,e.__scopeScrollArea);return(0,pe.jsx)(Ds,{present:r||o.hasThumb,children:(0,pe.jsx)(XR,{ref:t,...a})})}),XR=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,style:a,...o}=e,n=xr(Md,r),s=LC(Md,r),{onThumbPositionChange:i}=s,l=xa(t,d=>s.onThumbChange(d)),u=W.useRef(void 0),c=Fd(()=>{u.current&&(u.current(),u.current=void 0)},100);return W.useEffect(()=>{let d=n.viewport;if(d){let f=()=>{if(c(),!u.current){let m=YR(d,i);u.current=m,i()}};return i(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[n.viewport,c,i]),(0,pe.jsx)(Es.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...a},onPointerDownCapture:go(e.onPointerDownCapture,d=>{let m=d.target.getBoundingClientRect(),v=d.clientX-m.left,x=d.clientY-m.top;s.onThumbPointerDown({x:v,y:x})}),onPointerUp:go(e.onPointerUp,s.onThumbPointerUp)})});Ag.displayName=Md;var Rg="ScrollAreaCorner",kC=W.forwardRef((e,t)=>{let r=xr(Rg,e.__scopeScrollArea),a=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&a?(0,pe.jsx)(JR,{...e,ref:t}):null});kC.displayName=Rg;var JR=W.forwardRef((e,t)=>{let{__scopeScrollArea:r,...a}=e,o=xr(Rg,r),[n,s]=W.useState(0),[i,l]=W.useState(0),u=!!(n&&i);return Ms(o.scrollbarX,()=>{let c=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(c),l(c)}),Ms(o.scrollbarY,()=>{let c=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(c),s(c)}),u?(0,pe.jsx)(Es.div,{...a,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Od(e){return e?parseInt(e,10):0}function PC(e,t){let r=e/t;return isNaN(r)?0:r}function Bd(e){let t=PC(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=(e.scrollbar.size-r)*t;return Math.max(a,18)}function QR(e,t,r,a="ltr"){let o=Bd(r),n=o/2,s=t||n,i=o-s,l=r.scrollbar.paddingStart+s,u=r.scrollbar.size-r.scrollbar.paddingEnd-i,c=r.content-r.viewport,d=a==="ltr"?[0,c]:[c*-1,0];return TC([l,u],d)(e)}function yC(e,t,r="ltr"){let a=Bd(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-a,l=r==="ltr"?[0,s]:[s*-1,0],u=gC(e,l);return TC([0,s],[0,i])(u)}function TC(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let a=(t[1]-t[0])/(e[1]-e[0]);return t[0]+a*(r-e[0])}}function _C(e,t){return e>0&&e<t}var YR=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},a=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=r.left!==n.left,i=r.top!==n.top;(s||i)&&t(),r=n,a=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(a)};function Fd(e,t){let r=ho(e),a=W.useRef(0);return W.useEffect(()=>()=>window.clearTimeout(a.current),[]),W.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(r,t)},[r,t])}function Ms(e,t){let r=ho(t);Xl(()=>{let a=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(a),a=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(a),o.unobserve(e)}}},[e,r])}var AC=wC,RC=CC;var EC=kC;var yo=M(le(),1),Eg=DC.forwardRef(({className:e,children:t,...r},a)=>(0,yo.jsxs)(AC,{"data-slot":"scroll-area",className:rr("relative",e),...r,children:[(0,yo.jsx)(RC,{ref:a,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,yo.jsx)(eE,{}),(0,yo.jsx)(EC,{})]}));Eg.displayName="ScrollArea";function eE({className:e,orientation:t="vertical",...r}){return(0,yo.jsx)(Tg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:rr("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:(0,yo.jsx)(Ag,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Vd=M(K());var NC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),Dg=e=>{let t=tE(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ud=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),MC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Jl=M(K());var OC={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"};var BC=(0,Jl.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:o="",children:n,iconNode:s,...i},l)=>(0,Jl.createElement)("svg",{ref:l,...OC,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:Ud("lucide",o),...!n&&!MC(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,c])=>(0,Jl.createElement)(u,c)),...Array.isArray(n)?n:[n]]));var q=(e,t)=>{let r=(0,Vd.forwardRef)(({className:a,...o},n)=>(0,Vd.createElement)(BC,{ref:n,iconNode:t,className:Ud(`lucide-${NC(Dg(e))}`,`lucide-${e}`,a),...o}));return r.displayName=Dg(e),r};var rE=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ql=q("activity",rE);var aE=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Os=q("arrow-left",aE);var oE=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Yl=q("arrow-up",oE);var nE=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Zl=q("calendar",nE);var sE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],eu=q("chevron-down",sE);var iE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Dr=q("circle-alert",iE);var lE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],lt=q("circle-check",lE);var uE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Nr=q("circle-x",uE);var cE=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],yn=q("clock",cE);var dE=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Sa=q("command",dE);var fE=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Ca=q("corner-down-left",fE);var pE=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],vn=q("credit-card",pE);var mE=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],xn=q("crown",mE);var hE=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],wn=q("dollar-sign",hE);var gE=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Bs=q("file-spreadsheet",gE);var yE=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Fs=q("key",yE);var vE=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],tu=q("laptop",vE);var xE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rt=q("loader-circle",xE);var wE=[["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"}]],Us=q("mail",wE);var SE=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Vs=q("map-pin",SE);var CE=[["path",{d:"M5 12h14",key:"1ays0h"}]],Sn=q("minus",CE);var bE=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ru=q("paperclip",bE);var LE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],js=q("refresh-cw",LE);var IE=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Cn=q("search",IE);var kE=[["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"}]],qs=q("shield",kE);var PE=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],au=q("smartphone",PE);var TE=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ar=q("sparkles",TE);var _E=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],jt=q("square-pen",_E);var AE=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ou=q("trending-up",AE);var RE=[["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"}]],$s=q("users",RE);var EE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ba=q("x",EE);var DE=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],nu=q("zap",DE);var iu=M(le(),1),zr=M(K(),1);var FC=M(K(),1),Hs=(0,FC.createContext)({});var UC=M(K(),1);function vo(e){let t=(0,UC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Mg=M(le(),1),HC=M(K(),1),bn=M(K(),1);var VC=M(K(),1),xo=(0,VC.createContext)(null);var qC=M(le(),1),jd=M(K(),1),La=M(K(),1);var jC=M(K(),1),zs=(0,jC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Ng=class extends jd.Component{getSnapshotBeforeUpdate(t){let r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){let a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function $C({children:e,isPresent:t}){let r=(0,La.useId)(),a=(0,La.useRef)(null),o=(0,La.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,La.useContext)(zs);return(0,La.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!a.current||!s||!i)return;a.current.dataset.motionPopId=r;let c=document.createElement("style");return n&&(c.nonce=n),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
|
|
51
|
-
[data-motion-pop-id="${r}"] {
|
|
13
|
+
});`,xs=class{constructor(t,a){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=yc,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=uS,this.ref=0,this.logger=uS,this.conn=null,this.sendBuffer=[],this.serializer=new Ol,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=n=>{let s;return n?s=n:typeof fetch>"u"?s=(...i)=>Promise.resolve().then(()=>(Zr(),$o)).then(({default:l})=>l(...i)):s=fetch,(...i)=>s(...i)},this.endPoint=`${t}/${gc.websocket}`,this.httpEndpoint=xc(t),a?.transport?this.transport=a.transport:this.transport=null,a?.params&&(this.params=a.params),a?.timeout&&(this.timeout=a.timeout),a?.logger&&(this.logger=a.logger),(a?.logLevel||a?.log_level)&&(this.logLevel=a.logLevel||a.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),a?.heartbeatIntervalMs&&(this.heartbeatIntervalMs=a.heartbeatIntervalMs);let o=(r=a?.params)===null||r===void 0?void 0:r.apikey;if(o&&(this.accessTokenValue=o,this.apiKey=o),this.reconnectAfterMs=a?.reconnectAfterMs?a.reconnectAfterMs:n=>[1e3,2e3,5e3,1e4][n-1]||1e4,this.encode=a?.encode?a.encode:(n,s)=>s(JSON.stringify(n)),this.decode=a?.decode?a.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new Wo(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(a?.fetch),a?.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=a?.worker||!1,this.workerUrl=a?.workerUrl}this.accessToken=a?.accessToken||null}connect(){if(!this.conn){if(this.transport||(this.transport=rS),!this.transport)throw new Error("No transport provided");this.conn=new this.transport(this.endpointURL()),this.setupConnection()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:sS}))}disconnect(t,a){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,a??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset(),this.channels.forEach(r=>r.teardown()))}getChannels(){return this.channels}async removeChannel(t){let a=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),a}async removeAllChannels(){let t=await Promise.all(this.channels.map(a=>a.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,a,r){this.logger(t,a,r)}connectionState(){switch(this.conn&&this.conn.readyState){case hs.connecting:return eo.Connecting;case hs.open:return eo.Open;case hs.closing:return eo.Closing;default:return eo.Closed}}isConnected(){return this.connectionState()===eo.Open}channel(t,a={config:{}}){let r=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===r);if(o)return o;{let n=new ys(`realtime:${t}`,a,this);return this.channels.push(n),n}}push(t){let{topic:a,event:r,payload:o,ref:n}=t,s=()=>{this.encode(t,i=>{var l;(l=this.conn)===null||l===void 0||l.send(i)})};this.log("push",`${a} ${r} (${n})`,o),this.isConnected()?s():this.sendBuffer.push(s)}async setAuth(t=null){let a=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;this.accessTokenValue!=a&&(this.accessTokenValue=a,this.channels.forEach(r=>{let o={access_token:a,version:nS};a&&r.updateJoinPayload(o),r.joinedOnce&&r._isJoined()&&r._push(Yt.access_token,{access_token:a})}))}async sendHeartbeat(){var t;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),(t=this.conn)===null||t===void 0||t.close(iS,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),await this.setAuth()}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let a=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));a&&(this.log("transport",`leaving duplicate topic "${t}"`),a.unsubscribe())}_remove(t){this.channels=this.channels.filter(a=>a.topic!==t.topic)}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,a=>{let{topic:r,event:o,payload:n,ref:s}=a;r==="phoenix"&&o==="phx_reply"&&this.heartbeatCallback(a.payload.status=="ok"?"ok":"error"),s&&s===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${n.status||""} ${r} ${o} ${s&&"("+s+")"||""}`,n),Array.from(this.channels).filter(i=>i._isMember(r)).forEach(i=>i._trigger(o,n,s)),this.stateChangeCallbacks.message.forEach(i=>i(a))})}_onConnOpen(){this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this.stateChangeCallbacks.open.forEach(t=>t())}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");let t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=a=>{this.log("worker","worker error",a.message),this.workerRef.terminate()},this.workerRef.onmessage=a=>{a.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(a=>a(t))}_onConnError(t){this.log("transport",`${t}`),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(a=>a(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(Yt.error))}_appendParams(t,a){if(Object.keys(a).length===0)return t;let r=t.match(/\?/)?"&":"?",o=new URLSearchParams(a);return`${t}${r}${o}`}_workerObjectUrl(t){let a;if(t)a=t;else{let r=new Blob([q1],{type:"application/javascript"});a=URL.createObjectURL(r)}return a}};var vs=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function He(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var vc=class extends vs{constructor(t,a,r){super(t),this.name="StorageApiError",this.status=a,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Ko=class extends vs{constructor(t,a){super(t),this.name="StorageUnknownError",this.originalError=a}};var H1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Sc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Zr(),$o)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},dS=()=>H1(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(Zr(),$o))).Response:Response}),wc=e=>{if(Array.isArray(e))return e.map(a=>wc(a));if(typeof e=="function"||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([a,r])=>{let o=a.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace(/[-_]/g,""));t[o]=wc(r)}),t},cS=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var Xo=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},wg=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),z1=(e,t,a)=>Xo(void 0,void 0,void 0,function*(){let r=yield dS();e instanceof r&&!a?.noResolveJson?e.json().then(o=>{let n=e.status||500,s=o?.statusCode||n+"";t(new vc(wg(o),n,s))}).catch(o=>{t(new Ko(wg(o),o))}):t(new Ko(wg(e),e))}),$1=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!r?o:(cS(r)?(o.headers=Object.assign({"Content-Type":"application/json"},t?.headers),o.body=JSON.stringify(r)):o.body=r,Object.assign(Object.assign({},o),a))};function Fl(e,t,a,r,o,n){return Xo(this,void 0,void 0,function*(){return new Promise((s,i)=>{e(a,$1(t,r,o,n)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>z1(l,i,r))})})}function ws(e,t,a,r){return Xo(this,void 0,void 0,function*(){return Fl(e,"GET",t,a,r)})}function Ta(e,t,a,r,o){return Xo(this,void 0,void 0,function*(){return Fl(e,"POST",t,r,o,a)})}function Bl(e,t,a,r,o){return Xo(this,void 0,void 0,function*(){return Fl(e,"PUT",t,r,o,a)})}function fS(e,t,a,r){return Xo(this,void 0,void 0,function*(){return Fl(e,"HEAD",t,Object.assign(Object.assign({},a),{noResolveJson:!0}),r)})}function Cc(e,t,a,r,o){return Xo(this,void 0,void 0,function*(){return Fl(e,"DELETE",t,r,o,a)})}var Ut=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},W1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},pS={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Ul=class{constructor(t,a={},r,o){this.url=t,this.headers=a,this.bucketId=r,this.fetch=Sc(o)}uploadOrUpdate(t,a,r,o){return Ut(this,void 0,void 0,function*(){try{let n,s=Object.assign(Object.assign({},pS),o),i=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(s.upsert)}),l=s.metadata;typeof Blob<"u"&&r instanceof Blob?(n=new FormData,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",this.encodeMetadata(l)),n.append("",r)):typeof FormData<"u"&&r instanceof FormData?(n=r,n.append("cacheControl",s.cacheControl),l&&n.append("metadata",this.encodeMetadata(l))):(n=r,i["cache-control"]=`max-age=${s.cacheControl}`,i["content-type"]=s.contentType,l&&(i["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),o?.headers&&(i=Object.assign(Object.assign({},i),o.headers));let u=this._removeEmptyFolders(a),d=this._getFinalPath(u),c=yield(t=="PUT"?Bl:Ta)(this.fetch,`${this.url}/object/${d}`,n,Object.assign({headers:i},s?.duplex?{duplex:s.duplex}:{}));return{data:{path:u,id:c.Id,fullPath:c.Key},error:null}}catch(n){if(He(n))return{data:null,error:n};throw n}})}upload(t,a,r){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,a,r)})}uploadToSignedUrl(t,a,r,o){return Ut(this,void 0,void 0,function*(){let n=this._removeEmptyFolders(t),s=this._getFinalPath(n),i=new URL(this.url+`/object/upload/sign/${s}`);i.searchParams.set("token",a);try{let l,u=Object.assign({upsert:pS.upsert},o),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType);let c=yield Bl(this.fetch,i.toString(),l,{headers:d});return{data:{path:n,fullPath:c.Key},error:null}}catch(l){if(He(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,a){return Ut(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t),o=Object.assign({},this.headers);a?.upsert&&(o["x-upsert"]="true");let n=yield Ta(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:o}),s=new URL(this.url+n.url),i=s.searchParams.get("token");if(!i)throw new vs("No token returned by API");return{data:{signedUrl:s.toString(),path:t,token:i},error:null}}catch(r){if(He(r))return{data:null,error:r};throw r}})}update(t,a,r){return Ut(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,a,r)})}move(t,a,r){return Ut(this,void 0,void 0,function*(){try{return{data:yield Ta(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(He(o))return{data:null,error:o};throw o}})}copy(t,a,r){return Ut(this,void 0,void 0,function*(){try{return{data:{path:(yield Ta(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(o){if(He(o))return{data:null,error:o};throw o}})}createSignedUrl(t,a,r){return Ut(this,void 0,void 0,function*(){try{let o=this._getFinalPath(t),n=yield Ta(this.fetch,`${this.url}/object/sign/${o}`,Object.assign({expiresIn:a},r?.transform?{transform:r.transform}:{}),{headers:this.headers}),s=r?.download?`&download=${r.download===!0?"":r.download}`:"";return n={signedUrl:encodeURI(`${this.url}${n.signedURL}${s}`)},{data:n,error:null}}catch(o){if(He(o))return{data:null,error:o};throw o}})}createSignedUrls(t,a,r){return Ut(this,void 0,void 0,function*(){try{let o=yield Ta(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:a,paths:t},{headers:this.headers}),n=r?.download?`&download=${r.download===!0?"":r.download}`:"";return{data:o.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${n}`):null})),error:null}}catch(o){if(He(o))return{data:null,error:o};throw o}})}download(t,a){return Ut(this,void 0,void 0,function*(){let o=typeof a?.transform<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString(a?.transform||{}),s=n?`?${n}`:"";try{let i=this._getFinalPath(t);return{data:yield(yield ws(this.fetch,`${this.url}/${o}/${i}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(i){if(He(i))return{data:null,error:i};throw i}})}info(t){return Ut(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{let r=yield ws(this.fetch,`${this.url}/object/info/${a}`,{headers:this.headers});return{data:wc(r),error:null}}catch(r){if(He(r))return{data:null,error:r};throw r}})}exists(t){return Ut(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{return yield fS(this.fetch,`${this.url}/object/${a}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(He(r)&&r instanceof Ko){let o=r.originalError;if([400,404].includes(o?.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,a){let r=this._getFinalPath(t),o=[],n=a?.download?`download=${a.download===!0?"":a.download}`:"";n!==""&&o.push(n);let i=typeof a?.transform<"u"?"render/image":"object",l=this.transformOptsToQueryString(a?.transform||{});l!==""&&o.push(l);let u=o.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}${u}`)}}}remove(t){return Ut(this,void 0,void 0,function*(){try{return{data:yield Cc(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(a){if(He(a))return{data:null,error:a};throw a}})}list(t,a,r){return Ut(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},W1),a),{prefix:t||""});return{data:yield Ta(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},r),error:null}}catch(o){if(He(o))return{data:null,error:o};throw o}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){let a=[];return t.width&&a.push(`width=${t.width}`),t.height&&a.push(`height=${t.height}`),t.resize&&a.push(`resize=${t.resize}`),t.format&&a.push(`format=${t.format}`),t.quality&&a.push(`quality=${t.quality}`),a.join("&")}};var mS="2.10.4";var hS={"X-Client-Info":`storage-js/${mS}`};var Ss=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Vl=class{constructor(t,a={},r,o){let n=new URL(t);o?.useNewHostname&&/supabase\.(co|in|red)$/.test(n.hostname)&&!n.hostname.includes("storage.supabase.")&&(n.hostname=n.hostname.replace("supabase.","storage.supabase.")),this.url=n.href,this.headers=Object.assign(Object.assign({},hS),a),this.fetch=Sc(r)}listBuckets(){return Ss(this,void 0,void 0,function*(){try{return{data:yield ws(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(He(t))return{data:null,error:t};throw t}})}getBucket(t){return Ss(this,void 0,void 0,function*(){try{return{data:yield ws(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(a){if(He(a))return{data:null,error:a};throw a}})}createBucket(t,a={public:!1}){return Ss(this,void 0,void 0,function*(){try{return{data:yield Ta(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:a.type,public:a.public,file_size_limit:a.fileSizeLimit,allowed_mime_types:a.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(He(r))return{data:null,error:r};throw r}})}updateBucket(t,a){return Ss(this,void 0,void 0,function*(){try{return{data:yield Bl(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:a.public,file_size_limit:a.fileSizeLimit,allowed_mime_types:a.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(He(r))return{data:null,error:r};throw r}})}emptyBucket(t){return Ss(this,void 0,void 0,function*(){try{return{data:yield Ta(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(a){if(He(a))return{data:null,error:a};throw a}})}deleteBucket(t){return Ss(this,void 0,void 0,function*(){try{return{data:yield Cc(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(a){if(He(a))return{data:null,error:a};throw a}})}};var jl=class extends Vl{constructor(t,a={},r,o){super(t,a,r,o)}from(t){return new Ul(this.url,this.headers,t,this.fetch)}};var gS="2.53.0";var ql="";typeof Deno<"u"?ql="deno":typeof document<"u"?ql="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ql="react-native":ql="node";var G1={"X-Client-Info":`supabase-js-${ql}/${gS}`},yS={headers:G1},xS={schema:"public"},vS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},wS={};Zr();var K1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},X1=e=>{let t;return e?t=e:typeof fetch>"u"?t=ag:t=fetch,(...a)=>t(...a)},Q1=()=>typeof Headers>"u"?rg:Headers,SS=(e,t,a)=>{let r=X1(a),o=Q1();return(n,s)=>K1(void 0,void 0,void 0,function*(){var i;let l=(i=yield t())!==null&&i!==void 0?i:e,u=new o(s?.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(n,Object.assign(Object.assign({},s),{headers:u}))})};var J1=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})};function CS(e){return e.endsWith("/")?e:e+"/"}function LS(e,t){var a,r;let{db:o,auth:n,realtime:s,global:i}=e,{db:l,auth:u,realtime:d,global:c}=t,f={db:Object.assign(Object.assign({},l),o),auth:Object.assign(Object.assign({},u),n),realtime:Object.assign(Object.assign({},d),s),storage:{},global:Object.assign(Object.assign(Object.assign({},c),i),{headers:Object.assign(Object.assign({},(a=c?.headers)!==null&&a!==void 0?a:{}),(r=i?.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>J1(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}var Lc="2.71.1";var Qo=30*1e3,bc=3,Ic=bc*Qo,bS="http://localhost:9999",IS="supabase.auth.token";var kS={"X-Client-Info":`gotrue-js/${Lc}`};var Hl="X-Supabase-Api-Version",Sg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},PS=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,TS=600*1e3;var zl=class extends Error{constructor(t,a,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=r}};function J(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}var kc=class extends zl{constructor(t,a,r){super(t,a,r),this.name="AuthApiError",this.status=a,this.code=r}};function AS(e){return J(e)&&e.name==="AuthApiError"}var Cs=class extends zl{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}},Va=class extends zl{constructor(t,a,r,o){super(t,r,o),this.name=a,this.status=r}},ma=class extends Va{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function RS(e){return J(e)&&e.name==="AuthSessionMissingError"}var Jo=class extends Va{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Yo=class extends Va{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},Zo=class extends Va{constructor(t,a=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};function _S(e){return J(e)&&e.name==="AuthImplicitGrantRedirectError"}var $l=class extends Va{constructor(t,a=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=a}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}},Ls=class extends Va{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}};function Pc(e){return J(e)&&e.name==="AuthRetryableFetchError"}var Wl=class extends Va{constructor(t,a,r){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=r}};var en=class extends Va{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var Tc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ES=`
|
|
14
|
+
\r=`.split(""),Y1=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<ES.length;t+=1)e[ES[t].charCodeAt(0)]=-2;for(let t=0;t<Tc.length;t+=1)e[Tc[t].charCodeAt(0)]=t;return e})();function DS(e,t,a){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){let r=t.queue>>t.queuedBits-6&63;a(Tc[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){let r=t.queue>>t.queuedBits-6&63;a(Tc[r]),t.queuedBits-=6}}function MS(e,t,a){let r=Y1[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)a(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Cg(e){let t=[],a=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{tA(s,r,a)};for(let s=0;s<e.length;s+=1)MS(e.charCodeAt(s),o,n);return t.join("")}function Z1(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function eA(e,t){for(let a=0;a<e.length;a+=1){let r=e.charCodeAt(a);if(r>55295&&r<=56319){let o=(r-55296)*1024&65535;r=(e.charCodeAt(a+1)-56320&65535|o)+65536,a+=1}Z1(r,t)}}function tA(e,t,a){if(t.utf8seq===0){if(e<=127){a(e);return}for(let r=1;r<6;r+=1)if((e>>7-r&1)===0){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&a(t.codepoint)}}function NS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)MS(e.charCodeAt(o),a,r);return new Uint8Array(t)}function OS(e){let t=[];return eA(e,a=>t.push(a)),new Uint8Array(t)}function FS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>DS(o,a,r)),DS(null,a,r),t.join("")}function BS(e){return Math.round(Date.now()/1e3)+e}function US(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}var ha=()=>typeof window<"u"&&typeof document<"u",tn={tested:!1,writable:!1},Ac=()=>{if(!ha())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(tn.tested)return tn.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),tn.tested=!0,tn.writable=!0}catch{tn.tested=!0,tn.writable=!1}return tn.writable};function VS(e){let t={},a=new URL(e);if(a.hash&&a.hash[0]==="#")try{new URLSearchParams(a.hash.substring(1)).forEach((o,n)=>{t[n]=o})}catch{}return a.searchParams.forEach((r,o)=>{t[o]=r}),t}var Rc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Zr(),$o)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},jS=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",an=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},to=async(e,t)=>{let a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return a}},fr=async(e,t)=>{await e.removeItem(t)},Gl=class e{constructor(){this.promise=new e.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}};Gl.promiseConstructor=Promise;function _c(e){let t=e.split(".");if(t.length!==3)throw new en("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!PS.test(t[r]))throw new en("JWT not in base64url format");return{header:JSON.parse(Cg(t[0])),payload:JSON.parse(Cg(t[1])),signature:NS(t[2]),raw:{header:t[0],payload:t[1]}}}async function qS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function HS(e,t){return new Promise((r,o)=>{(async()=>{for(let n=0;n<1/0;n++)try{let s=await e(n);if(!t(n,null,s)){r(s);return}}catch(s){if(!t(n,s)){o(s);return}}})()})}function aA(e){return("0"+e.toString(16)).substr(-2)}function rA(){let t=new Uint32Array(56);if(typeof crypto>"u"){let a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=a.length,o="";for(let n=0;n<56;n++)o+=a.charAt(Math.floor(Math.random()*r));return o}return crypto.getRandomValues(t),Array.from(t,aA).join("")}async function oA(e){let a=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",a),o=new Uint8Array(r);return Array.from(o).map(n=>String.fromCharCode(n)).join("")}async function nA(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let a=await oA(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function rn(e,t,a=!1){let r=rA(),o=r;a&&(o+="/PASSWORD_RECOVERY"),await an(e,`${t}-code-verifier`,o);let n=await nA(r);return[n,r===n?"plain":"s256"]}var sA=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function zS(e){let t=e.headers.get(Hl);if(!t||!t.match(sA))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function $S(e){if(!e)throw new Error("Missing exp claim");let t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function WS(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var iA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function on(e){if(!iA.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ec(){let e={};return new Proxy(e,{get:(t,a)=>{if(a==="__isUserNotAvailableProxy")return!0;if(typeof a=="symbol"){let r=a.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${a}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Lg(e){return JSON.parse(JSON.stringify(e))}var lA=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a},nn=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),uA=[502,503,504];async function GS(e){var t;if(!jS(e))throw new Ls(nn(e),0);if(uA.includes(e.status))throw new Ls(nn(e),e.status);let a;try{a=await e.json()}catch(n){throw new Cs(nn(n),n)}let r,o=zS(e);if(o&&o.getTime()>=Sg["2024-01-01"].timestamp&&typeof a=="object"&&a&&typeof a.code=="string"?r=a.code:typeof a=="object"&&a&&typeof a.error_code=="string"&&(r=a.error_code),r){if(r==="weak_password")throw new Wl(nn(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new ma}else if(typeof a=="object"&&a&&typeof a.weak_password=="object"&&a.weak_password&&Array.isArray(a.weak_password.reasons)&&a.weak_password.reasons.length&&a.weak_password.reasons.reduce((n,s)=>n&&typeof s=="string",!0))throw new Wl(nn(a),e.status,a.weak_password.reasons);throw new kc(nn(a),e.status||500,r)}var dA=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),o.body=JSON.stringify(r),Object.assign(Object.assign({},o),a))};async function te(e,t,a,r){var o;let n=Object.assign({},r?.headers);n[Hl]||(n[Hl]=Sg["2024-01-01"].name),r?.jwt&&(n.Authorization=`Bearer ${r.jwt}`);let s=(o=r?.query)!==null&&o!==void 0?o:{};r?.redirectTo&&(s.redirect_to=r.redirectTo);let i=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await cA(e,t,a+i,{headers:n,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(l):{data:Object.assign({},l),error:null}}async function cA(e,t,a,r,o,n){let s=dA(t,r,o,n),i;try{i=await e(a,Object.assign({},s))}catch(l){throw console.error(l),new Ls(nn(l),0)}if(i.ok||await GS(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await GS(l)}}function ja(e){var t;let a=null;fA(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=BS(e.expires_in)));let r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:a,user:r},error:null}}function bg(e){let t=ja(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((a,r)=>a&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function qa(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function KS(e){return{data:e,error:null}}function XS(e){let{action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n}=e,s=lA(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),i={action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n},l=Object.assign({},s);return{data:{properties:i,user:l},error:null}}function QS(e){return e}function fA(e){return e.access_token&&e.refresh_token&&e.expires_in}var Dc=["global","local","others"];var pA=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(a[r[o]]=e[r[o]]);return a},sn=class{constructor({url:t="",headers:a={},fetch:r}){this.url=t,this.headers=a,this.fetch=Rc(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,a=Dc[0]){if(Dc.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Dc.join(", ")}`);try{return await te(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,a={}){try{return await te(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:qa})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{let{options:a}=t,r=pA(t,["options"]),o=Object.assign(Object.assign({},r),a);return"newEmail"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await te(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:XS,redirectTo:a?.redirectTo})}catch(a){if(J(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await te(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:qa})}catch(a){if(J(a))return{data:{user:null},error:a};throw a}}async listUsers(t){var a,r,o,n,s,i,l;try{let u={nextPage:null,lastPage:0,total:0},d=await te(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(a=t?.page)===null||a===void 0?void 0:a.toString())!==null&&r!==void 0?r:"",per_page:(n=(o=t?.perPage)===null||o===void 0?void 0:o.toString())!==null&&n!==void 0?n:""},xform:QS});if(d.error)throw d.error;let c=await d.json(),f=(s=d.headers.get("x-total-count"))!==null&&s!==void 0?s:0,m=(l=(i=d.headers.get("link"))===null||i===void 0?void 0:i.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(x=>{let w=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);u[`${b}Page`]=w}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},c),u),error:null}}catch(u){if(J(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){on(t);try{return await te(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:qa})}catch(a){if(J(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){on(t);try{return await te(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:qa})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,a=!1){on(t);try{return await te(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:qa})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){on(t.userId);try{let{data:a,error:r}=await te(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:a,error:r}}catch(a){if(J(a))return{data:null,error:a};throw a}}async _deleteFactor(t){on(t.userId),on(t.id);try{return{data:await te(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(J(a))return{data:null,error:a};throw a}}};function Ig(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}function JS(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}var ln={debug:!!(globalThis&&Ac()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},Kl=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Mc=class extends Kl{};async function kg(e,t,a){ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),ln.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async o=>{if(o){ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw ln.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Mc(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(ln.debug)try{let n=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(n,null," "))}catch(n){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",n)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await a()}}))}JS();var mA={url:bS,storageKey:IS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:kS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function YS(e,t,a){return await a()}var bs={},un=class e{constructor(t){var a,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=e.nextInstanceID,e.nextInstanceID+=1,this.instanceID>0&&ha()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let o=Object.assign(Object.assign({},mA),t);if(this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.persistSession=o.persistSession,this.storageKey=o.storageKey,this.autoRefreshToken=o.autoRefreshToken,this.admin=new sn({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=Rc(o.fetch),this.lock=o.lock||YS,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:ha()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=kg:this.lock=YS,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:Ac()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Ig(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=Ig(this.memoryStorage)),ha()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(n){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",n)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async n=>{this._debug("received broadcast notification from other tab or client",n),await this._notifyAllSubscribers(n.data.event,n.data.session,!1)})}this.initialize()}get jwks(){var t,a;return(a=(t=bs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){bs[this.storageKey]=Object.assign(Object.assign({},bs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=bs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){bs[this.storageKey]=Object.assign(Object.assign({},bs[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Lc}) ${new Date().toISOString()}`,...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let a=VS(window.location.href),r="none";if(this._isImplicitGrantCallback(a)?r="implicit":await this._isPKCECallback(a)&&(r="pkce"),ha()&&this.detectSessionInUrl&&r!=="none"){let{data:o,error:n}=await this._getSessionFromURL(a,r);if(n){if(this._debug("#_initialize()","error detecting session from URL",n),_S(n)){let l=(t=n.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:n}}return await this._removeSession(),{error:n}}let{session:s,redirectType:i}=o;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{i==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(a){return J(a)?{error:a}:{error:new Cs("Unexpected error during initialization",a)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,r,o;try{let n=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(a=t?.options)===null||a===void 0?void 0:a.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(o=t?.options)===null||o===void 0?void 0:o.captchaToken}},xform:ja}),{data:s,error:i}=n;if(i||!s)return{data:{user:null,session:null},error:i};let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(n){if(J(n))return{data:{user:null,session:null},error:n};throw n}}async signUp(t){var a,r,o;try{let n;if("email"in t){let{email:d,password:c,options:f}=t,m=null,x=null;this.flowType==="pkce"&&([m,x]=await rn(this.storage,this.storageKey)),n=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f?.emailRedirectTo,body:{email:d,password:c,data:(a=f?.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:f?.captchaToken},code_challenge:m,code_challenge_method:x},xform:ja})}else if("phone"in t){let{phone:d,password:c,options:f}=t;n=await te(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:c,data:(r=f?.data)!==null&&r!==void 0?r:{},channel:(o=f?.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:f?.captchaToken}},xform:ja})}else throw new Yo("You must provide either an email or phone number and a password");let{data:s,error:i}=n;if(i||!s)return{data:{user:null,session:null},error:i};let l=s.session,u=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(n){if(J(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithPassword(t){try{let a;if("email"in t){let{email:n,password:s,options:i}=t;a=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:bg})}else if("phone"in t){let{phone:n,password:s,options:i}=t;a=await te(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:s,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:bg})}else throw new Yo("You must provide either an email or phone number and a password");let{data:r,error:o}=a;return o?{data:{user:null,session:null},error:o}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new Jo}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:o})}catch(a){if(J(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithOAuth(t){var a,r,o,n;return await this._handleProviderSignIn(t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(n=t.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){let{chain:a}=t;if(a==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${a}"`)}async signInWithSolana(t){var a,r,o,n,s,i,l,u,d,c,f,m;let x,w;if("message"in t)x=t.message,w=t.signature;else{let{chain:b,wallet:h,statement:g,options:y}=t,C;if(ha())if(typeof h=="object")C=h;else{let P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))C=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof h!="object"||!y?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");C=h}let L=new URL((a=y?.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in C&&C.signIn){let P=await C.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y?.signInWithSolana),{version:"1",domain:L.host,uri:L.href}),g?{statement:g}:null)),A;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")A=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)A=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in A&&"signature"in A&&(typeof A.signedMessage=="string"||A.signedMessage instanceof Uint8Array)&&A.signature instanceof Uint8Array)x=typeof A.signedMessage=="string"?A.signedMessage:new TextDecoder().decode(A.signedMessage),w=A.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in C)||typeof C.signMessage!="function"||!("publicKey"in C)||typeof C!="object"||!C.publicKey||!("toBase58"in C.publicKey)||typeof C.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${L.host} wants you to sign in with your Solana account:`,C.publicKey.toBase58(),...g?["",g,""]:[""],"Version: 1",`URI: ${L.href}`,`Issued At: ${(o=(r=y?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=y?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((s=y?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((i=y?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((l=y?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((u=y?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((c=(d=y?.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||c===void 0)&&c.length?["Resources",...y.signInWithSolana.resources.map(A=>`- ${A}`)]:[]].join(`
|
|
15
|
+
`);let P=await C.signMessage(new TextEncoder().encode(x),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=P}}try{let{data:b,error:h}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:FS(w)},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=t.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:ja});if(h)throw h;return!b||!b.session||!b.user?{data:{user:null,session:null},error:new Jo}:(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),{data:Object.assign({},b),error:h})}catch(b){if(J(b))return{data:{user:null,session:null},error:b};throw b}}async _exchangeCodeForSession(t){let a=await to(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(a??"").split("/");try{let{data:n,error:s}=await te(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:ja});if(await fr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new Jo}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign(Object.assign({},n),{redirectType:o??null}),error:s})}catch(n){if(J(n))return{data:{user:null,session:null,redirectType:null},error:n};throw n}}async signInWithIdToken(t){try{let{options:a,provider:r,token:o,access_token:n,nonce:s}=t,i=await te(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:o,access_token:n,nonce:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ja}),{data:l,error:u}=i;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new Jo}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(a){if(J(a))return{data:{user:null,session:null},error:a};throw a}}async signInWithOtp(t){var a,r,o,n,s;try{if("email"in t){let{email:i,options:l}=t,u=null,d=null;this.flowType==="pkce"&&([u,d]=await rn(this.storage,this.storageKey));let{error:c}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:i,data:(a=l?.data)!==null&&a!==void 0?a:{},create_user:(r=l?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:l?.emailRedirectTo});return{data:{user:null,session:null},error:c}}if("phone"in t){let{phone:i,options:l}=t,{data:u,error:d}=await te(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:i,data:(o=l?.data)!==null&&o!==void 0?o:{},create_user:(n=l?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l?.captchaToken},channel:(s=l?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:u?.message_id},error:d}}throw new Yo("You must provide either an email or phone number.")}catch(i){if(J(i))return{data:{user:null,session:null},error:i};throw i}}async verifyOtp(t){var a,r;try{let o,n;"options"in t&&(o=(a=t.options)===null||a===void 0?void 0:a.redirectTo,n=(r=t.options)===null||r===void 0?void 0:r.captchaToken);let{data:s,error:i}=await te(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:ja});if(i)throw i;if(!s)throw new Error("An error occurred on token verification.");let l=s.session,u=s.user;return l?.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(o){if(J(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithSSO(t){var a,r,o;try{let n=null,s=null;return this.flowType==="pkce"&&([n,s]=await rn(this.storage,this.storageKey)),await te(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(a=t.options)===null||a===void 0?void 0:a.redirectTo)!==null&&r!==void 0?r:void 0}),!((o=t?.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:s}),headers:this.headers,xform:KS})}catch(n){if(J(n))return{data:null,error:n};throw n}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{let{data:{session:a},error:r}=t;if(r)throw r;if(!a)throw new ma;let{error:o}=await te(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return{data:{user:null,session:null},error:o}})}catch(t){if(J(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{let a=`${this.url}/resend`;if("email"in t){let{email:r,type:o,options:n}=t,{error:s}=await te(this.fetch,"POST",a,{headers:this.headers,body:{email:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}},redirectTo:n?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in t){let{phone:r,type:o,options:n}=t,{data:s,error:i}=await te(this.fetch,"POST",a,{headers:this.headers,body:{phone:r,type:o,gotrue_meta_security:{captcha_token:n?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:i}}throw new Yo("You must provide either an email or phone number and a type")}catch(a){if(J(a))return{data:{user:null,session:null},error:a};throw a}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async a=>a))}async _acquireLock(t,a){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){let r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await r,await a()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let r=a();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){let o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{let a=await this.__loadSession();return await t(a)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null,a=await to(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",a),a!==null&&(this._isValidSession(a)?t=a:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};let r=t.expires_at?t.expires_at*1e3-Date.now()<Ic:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){let s=await to(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=Ec()}if(this.storage.isServer&&t.user){let s=this.suppressGetSessionWarning;t=new Proxy(t,{get:(l,u,d)=>(!s&&u==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,d))})}return{data:{session:t},error:null}}let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{session:null},error:n}:{data:{session:o},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:qa}):await this._useSession(async a=>{var r,o,n;let{data:s,error:i}=a;if(i)throw i;return!(!((r=s.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ma}:await te(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(n=(o=s.session)===null||o===void 0?void 0:o.access_token)!==null&&n!==void 0?n:void 0,xform:qa})})}catch(a){if(J(a))return RS(a)&&(await this._removeSession(),await fr(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:a};throw a}}async updateUser(t,a={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,a))}async _updateUser(t,a={}){try{return await this._useSession(async r=>{let{data:o,error:n}=r;if(n)throw n;if(!o.session)throw new ma;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await rn(this.storage,this.storageKey));let{data:u,error:d}=await te(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:a?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:i,code_challenge_method:l}),jwt:s.access_token,xform:qa});if(d)throw d;return s.user=u.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new ma;let a=Date.now()/1e3,r=a,o=!0,n=null,{payload:s}=_c(t.access_token);if(s.exp&&(r=s.exp,o=r<=a),o){let{session:i,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!i)return{data:{user:null,session:null},error:null};n=i}else{let{data:i,error:l}=await this._getUser(t.access_token);if(l)throw l;n={access_token:t.access_token,refresh_token:t.refresh_token,user:i.user,token_type:"bearer",expires_in:r-a,expires_at:r},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return{data:{user:n.user,session:n},error:null}}catch(a){if(J(a))return{data:{session:null,user:null},error:a};throw a}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async a=>{var r;if(!t){let{data:s,error:i}=a;if(i)throw i;t=(r=s.session)!==null&&r!==void 0?r:void 0}if(!t?.refresh_token)throw new ma;let{session:o,error:n}=await this._callRefreshToken(t.refresh_token);return n?{data:{user:null,session:null},error:n}:o?{data:{user:o.user,session:o},error:null}:{data:{user:null,session:null},error:null}})}catch(a){if(J(a))return{data:{user:null,session:null},error:a};throw a}}async _getSessionFromURL(t,a){try{if(!ha())throw new Zo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Zo(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(a){case"implicit":if(this.flowType==="pkce")throw new $l("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Zo("Not a valid implicit grant flow url.");break;default:}if(a==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new $l("No code detected.");let{data:g,error:y}=await this._exchangeCodeForSession(t.code);if(y)throw y;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:g.session,redirectType:null},error:null}}let{provider_token:r,provider_refresh_token:o,access_token:n,refresh_token:s,expires_in:i,expires_at:l,token_type:u}=t;if(!n||!i||!s||!u)throw new Zo("No session defined in URL");let d=Math.round(Date.now()/1e3),c=parseInt(i),f=d+c;l&&(f=parseInt(l));let m=f-d;m*1e3<=Qo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${m}s, should have been closer to ${c}s`);let x=f-c;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,f,d):d-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,f,d);let{data:w,error:b}=await this._getUser(n);if(b)throw b;let h={provider_token:r,provider_refresh_token:o,access_token:n,expires_in:c,expires_at:f,refresh_token:s,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:h,redirectType:t.type},error:null}}catch(r){if(J(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){let a=await to(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&a)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{error:n};let s=(r=o.session)===null||r===void 0?void 0:r.access_token;if(s){let{error:i}=await this.admin.signOut(s,t);if(i&&!(AS(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await fr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=US(),r={id:a,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",a),this.stateChangeEmitters.delete(a)}};return this._debug("#onAuthStateChange()","registered callback with id",a),this.stateChangeEmitters.set(a,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(a)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async a=>{var r,o;try{let{data:{session:n},error:s}=a;if(s)throw s;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",t,"session",n)}catch(n){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",n),console.error(n)}})}async resetPasswordForEmail(t,a={}){let r=null,o=null;this.flowType==="pkce"&&([r,o]=await rn(this.storage,this.storageKey,!0));try{return await te(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:o,gotrue_meta_security:{captcha_token:a.captchaToken}},headers:this.headers,redirectTo:a.redirectTo})}catch(n){if(J(n))return{data:null,error:n};throw n}}async getUserIdentities(){var t;try{let{data:a,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=a.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(a){if(J(a))return{data:null,error:a};throw a}}async linkIdentity(t){var a;try{let{data:r,error:o}=await this._useSession(async n=>{var s,i,l,u,d;let{data:c,error:f}=n;if(f)throw f;let m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(s=t.options)===null||s===void 0?void 0:s.redirectTo,scopes:(i=t.options)===null||i===void 0?void 0:i.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await te(this.fetch,"GET",m,{headers:this.headers,jwt:(d=(u=c.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(o)throw o;return ha()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(r?.url),{data:{provider:t.provider,url:r?.url},error:null}}catch(r){if(J(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)throw s;return await te(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&o!==void 0?o:void 0})})}catch(a){if(J(a))return{data:null,error:a};throw a}}async _refreshAccessToken(t){let a=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{let r=Date.now();return await HS(async o=>(o>0&&await qS(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await te(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:ja})),(o,n)=>{let s=200*Math.pow(2,o);return n&&Pc(n)&&Date.now()+s-r<Qo})}catch(r){if(this._debug(a,"error",r),J(r))return{data:{session:null,user:null},error:r};throw r}finally{this._debug(a,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,a){let r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:a.redirectTo,scopes:a.scopes,queryParams:a.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",a,"url",r),ha()&&!a.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,a;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let o=await to(this.storage,this.storageKey);if(o&&this.userStorage){let s=await to(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await an(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:Ec()}else if(o&&!o.user&&!o.user){let s=await to(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await fr(this.storage,this.storageKey+"-user"),await an(this.storage,this.storageKey,o)):o.user=Ec()}if(this._debug(r,"session from storage",o),!this._isValidSession(o)){this._debug(r,"session is not valid"),o!==null&&await this._removeSession();return}let n=((a=o.expires_at)!==null&&a!==void 0?a:1/0)*1e3-Date.now()<Ic;if(this._debug(r,`session has${n?"":" not"} expired with margin of ${Ic}s`),n){if(this.autoRefreshToken&&o.refresh_token){let{error:s}=await this._callRefreshToken(o.refresh_token);s&&(console.error(s),Pc(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{let{data:s,error:i}=await this._getUser(o.access_token);!i&&s?.user?(o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(s){console.error("Error getting user data:",s),this._debug(r,"error getting user data, skipping SIGNED_IN notification",s)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(r,"error",o),console.error(o);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var a,r;if(!t)throw new ma;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Gl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new ma;await this._saveSession(n.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",n.session);let i={session:n.session,error:null};return this.refreshingDeferred.resolve(i),i}catch(n){if(this._debug(o,"error",n),J(n)){let s={session:null,error:n};return Pc(n)||await this._removeSession(),(a=this.refreshingDeferred)===null||a===void 0||a.resolve(s),s}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(n),n}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,a,r=!0){let o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",a,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:a});let n=[],s=Array.from(this.stateChangeEmitters.values()).map(async i=>{try{await i.callback(t,a)}catch(l){n.push(l)}});if(await Promise.all(s),n.length>0){for(let i=0;i<n.length;i+=1)console.error(n[i]);throw n[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;let a=Object.assign({},t),r=a.user&&a.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&a.user&&await an(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=Lg(o);await an(this.storage,this.storageKey,n)}else{let o=Lg(a);await an(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await fr(this.storage,this.storageKey),await fr(this.storage,this.storageKey+"-code-verifier"),await fr(this.storage,this.storageKey+"-user"),this.userStorage&&await fr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ha()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(a){console.error("removing visibilitychange callback failed",a)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let t=setInterval(()=>this._autoRefreshTokenTick(),Qo);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let t=Date.now();try{return await this._useSession(async a=>{let{data:{session:r}}=a;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let o=Math.floor((r.expires_at*1e3-t)/Qo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Qo}ms, refresh threshold is ${bc} ticks`),o<=bc&&await this._callRefreshToken(r.refresh_token)})}catch(a){console.error("Auto refresh tick failed with error. This is likely a transient error.",a)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Kl)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ha()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){let a=`#_onVisibilityChanged(${t})`;this._debug(a,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(a,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,a,r){let o=[`provider=${encodeURIComponent(a)}`];if(r?.redirectTo&&o.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&o.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){let[n,s]=await rn(this.storage,this.storageKey),i=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(s)}`});o.push(i.toString())}if(r?.queryParams){let n=new URLSearchParams(r.queryParams);o.push(n.toString())}return r?.skipBrowserRedirect&&o.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await te(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(J(a))return{data:null,error:a};throw a}}async _enroll(t){try{return await this._useSession(async a=>{var r,o;let{data:n,error:s}=a;if(s)return{data:null,error:s};let i=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:u}=await te(this.fetch,"POST",`${this.url}/factors`,{body:i,headers:this.headers,jwt:(r=n?.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((o=l?.totp)===null||o===void 0)&&o.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(a){if(J(a))return{data:null,error:a};throw a}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;if(n)return{data:null,error:n};let{data:s,error:i}=await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});return i?{data:null,error:i}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:i})})}catch(a){if(J(a))return{data:null,error:a};throw a}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async a=>{var r;let{data:o,error:n}=a;return n?{data:null,error:n}:await te(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token})})}catch(a){if(J(a))return{data:null,error:a};throw a}})}async _challengeAndVerify(t){let{data:a,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:a.id,code:t.code})}async _listFactors(){let{data:{user:t},error:a}=await this.getUser();if(a)return{data:null,error:a};let r=t?.factors||[],o=r.filter(s=>s.factor_type==="totp"&&s.status==="verified"),n=r.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:r,totp:o,phone:n},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var a,r;let{data:{session:o},error:n}=t;if(n)return{data:null,error:n};if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:s}=_c(o.access_token),i=null;s.aal&&(i=s.aal);let l=i;((r=(a=o.user.factors)===null||a===void 0?void 0:a.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");let d=s.amr||[];return{data:{currentLevel:i,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(t,a={keys:[]}){let r=a.keys.find(i=>i.kid===t);if(r)return r;let o=Date.now();if(r=this.jwks.keys.find(i=>i.kid===t),r&&this.jwks_cached_at+TS>o)return r;let{data:n,error:s}=await te(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;return!n.keys||n.keys.length===0||(this.jwks=n,this.jwks_cached_at=o,r=n.keys.find(i=>i.kid===t),!r)?null:r}async getClaims(t,a={}){try{let r=t;if(!r){let{data:m,error:x}=await this.getSession();if(x||!m.session)return{data:null,error:x};r=m.session.access_token}let{header:o,payload:n,signature:s,raw:{header:i,payload:l}}=_c(r);a?.allowExpired||$S(n.exp);let u=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,a?.keys?{keys:a.keys}:a?.jwks);if(!u){let{error:m}=await this.getUser(r);if(m)throw m;return{data:{claims:n,header:o,signature:s},error:null}}let d=WS(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,OS(`${i}.${l}`)))throw new en("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}};un.nextInstanceID=0;var hA=un,Pg=hA;var Nc=class extends Pg{constructor(t){super(t)}};var gA=function(e,t,a,r){function o(n){return n instanceof a?n:new a(function(s){s(n)})}return new(a||(a=Promise))(function(n,s){function i(d){try{u(r.next(d))}catch(c){s(c)}}function l(d){try{u(r.throw(d))}catch(c){s(c)}}function u(d){d.done?n(d.value):o(d.value).then(i,l)}u((r=r.apply(e,t||[])).next())})},Xl=class{constructor(t,a,r){var o,n,s;if(this.supabaseUrl=t,this.supabaseKey=a,!t)throw new Error("supabaseUrl is required.");if(!a)throw new Error("supabaseKey is required.");let i=CS(t),l=new URL(i);this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);let u=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:xS,realtime:wS,auth:Object.assign(Object.assign({},vS),{storageKey:u}),global:yS},c=LS(r??{},d);this.storageKey=(o=c.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(n=c.global.headers)!==null&&n!==void 0?n:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=c.auth)!==null&&s!==void 0?s:{},this.headers,c.global.fetch),this.fetch=SS(a,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new tS(new URL("rest/v1",l).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new jl(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Al(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,a={},r={}){return this.rest.rpc(t,a,r)}channel(t,a={config:{}}){return this.realtime.channel(t,a)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,a;return gA(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:r}=yield this.auth.getSession();return(a=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&a!==void 0?a:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,storageKey:n,flowType:s,lock:i,debug:l},u,d){let c={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Nc({url:this.authUrl.href,headers:Object.assign(Object.assign({},c),u),storageKey:n,autoRefreshToken:t,persistSession:a,detectSessionInUrl:r,storage:o,flowType:s,lock:i,debug:l,fetch:d,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new xs(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((a,r)=>{this._handleTokenChanged(a,"CLIENT",r?.access_token)})}_handleTokenChanged(t,a,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),a=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};var ZS=(e,t,a)=>new Xl(e,t,a);function yA(){if(typeof window<"u"||typeof process>"u"||process.version===void 0||process.version===null)return!1;let e=process.version.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}yA()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function eC(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=eC(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function Oc(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=eC(e))&&(r&&(r+=" "),r+=t);return r}var xA=e=>{let t=wA(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),rC(i,t)||vA(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},rC=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?rC(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let n=e.join("-");return t.validators.find(({validator:s})=>s(n))?.classGroupId},tC=/^\[(.+)\]$/,vA=e=>{if(tC.test(e)){let t=tC.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},wA=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return CA(Object.entries(e.classGroups),a).forEach(([n,s])=>{Ag(s,r,n,t)}),r},Ag=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:aC(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(SA(o)){Ag(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{Ag(s,aC(t,n),a,r)})})},aC=(e,t)=>{let a=e;return t.split("-").forEach(r=>{a.nextPart.has(r)||a.nextPart.set(r,{nextPart:new Map,validators:[]}),a=a.nextPart.get(r)}),a},SA=e=>e.isThemeGetter,CA=(e,t)=>t?e.map(([a,r])=>{let o=r.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([s,i])=>[t+s,i])):n);return[a,o]}):e,LA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,r=new Map,o=(n,s)=>{a.set(n,s),t++,t>e&&(t=0,r=a,a=new Map)};return{get(n){let s=a.get(n);if(s!==void 0)return s;if((s=r.get(n))!==void 0)return o(n,s),s},set(n,s){a.has(n)?a.set(n,s):o(n,s)}}};var bA=e=>{let{separator:t,experimentalParseClassName:a}=e,r=t.length===1,o=t[0],n=t.length,s=i=>{let l=[],u=0,d=0,c;for(let b=0;b<i.length;b++){let h=i[b];if(u===0){if(h===o&&(r||i.slice(b,b+n)===t)){l.push(i.slice(d,b)),d=b+n;continue}if(h==="/"){c=b;continue}}h==="["?u++:h==="]"&&u--}let f=l.length===0?i:i.substring(d),m=f.startsWith("!"),x=m?f.substring(1):f,w=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:w}};return a?i=>a({className:i,parseClassName:s}):s},IA=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(r=>{r[0]==="["?(t.push(...a.sort(),r),a=[]):a.push(r)}),t.push(...a.sort()),t},kA=e=>({cache:LA(e.cacheSize),parseClassName:bA(e),...xA(e)}),PA=/\s+/,TA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(PA),i="";for(let l=s.length-1;l>=0;l-=1){let u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:m}=a(u),x=!!m,w=r(x?f.substring(0,m):f);if(!w){if(!x){i=u+(i.length>0?" "+i:i);continue}if(w=r(f),!w){i=u+(i.length>0?" "+i:i);continue}x=!1}let b=IA(d).join(":"),h=c?b+"!":b,g=h+w;if(n.includes(g))continue;n.push(g);let y=o(w,x);for(let C=0;C<y.length;++C){let L=y[C];n.push(h+L)}i=u+(i.length>0?" "+i:i)}return i};function AA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=oC(t))&&(r&&(r+=" "),r+=a);return r}var oC=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=oC(e[r]))&&(a&&(a+=" "),a+=t);return a};function RA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=kA(u),r=a.cache.get,o=a.cache.set,n=i,i(l)}function i(l){let u=r(l);if(u)return u;let d=TA(l,a);return o(l,d),d}return function(){return n(AA.apply(null,arguments))}}var ke=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},nC=/^\[(?:([a-z-]+):)?(.+)\]$/i,_A=/^\d+\/\d+$/,EA=new Set(["px","full","screen"]),DA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MA=/\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$/,NA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,OA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pr=e=>Is(e)||EA.has(e)||_A.test(e),ao=e=>ks(e,"length",$A),Is=e=>!!e&&!Number.isNaN(Number(e)),Tg=e=>ks(e,"number",Is),Ql=e=>!!e&&Number.isInteger(Number(e)),BA=e=>e.endsWith("%")&&Is(e.slice(0,-1)),Y=e=>nC.test(e),ro=e=>DA.test(e),UA=new Set(["length","size","percentage"]),VA=e=>ks(e,UA,sC),jA=e=>ks(e,"position",sC),qA=new Set(["image","url"]),HA=e=>ks(e,qA,GA),zA=e=>ks(e,"",WA),Jl=()=>!0,ks=(e,t,a)=>{let r=nC.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},$A=e=>MA.test(e)&&!NA.test(e),sC=()=>!1,WA=e=>OA.test(e),GA=e=>FA.test(e);var KA=()=>{let e=ke("colors"),t=ke("spacing"),a=ke("blur"),r=ke("brightness"),o=ke("borderColor"),n=ke("borderRadius"),s=ke("borderSpacing"),i=ke("borderWidth"),l=ke("contrast"),u=ke("grayscale"),d=ke("hueRotate"),c=ke("invert"),f=ke("gap"),m=ke("gradientColorStops"),x=ke("gradientColorStopPositions"),w=ke("inset"),b=ke("margin"),h=ke("opacity"),g=ke("padding"),y=ke("saturate"),C=ke("scale"),L=ke("sepia"),P=ke("skew"),A=ke("space"),R=ke("translate"),q=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",Y,t],le=()=>[Y,t],Rn=()=>["",pr,ao],oe=()=>["auto",Is,Y],Ti=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ya=()=>["solid","dashed","dotted","double","none"],Fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],We=()=>["start","end","center","between","around","evenly","stretch"],mt=()=>["","0",Y],sa=()=>["auto","avoid","all","avoid-page","page","left","right","column"],bt=()=>[Is,Y];return{cacheSize:500,separator:":",theme:{colors:[Jl],spacing:[pr,ao],blur:["none","",ro,Y],brightness:bt(),borderColor:[e],borderRadius:["none","","full",ro,Y],borderSpacing:le(),borderWidth:Rn(),contrast:bt(),grayscale:mt(),hueRotate:bt(),invert:mt(),gap:le(),gradientColorStops:[e],gradientColorStopPositions:[BA,ao],inset:pe(),margin:pe(),opacity:bt(),padding:le(),saturate:bt(),scale:bt(),sepia:mt(),skew:bt(),space:le(),translate:le()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[ro]}],"break-after":[{"break-after":sa()}],"break-before":[{"break-before":sa()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ti(),Y]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ql,Y]}],basis:[{basis:pe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:mt()}],shrink:[{shrink:mt()}],order:[{order:["first","last","none",Ql,Y]}],"grid-cols":[{"grid-cols":[Jl]}],"col-start-end":[{col:["auto",{span:["full",Ql,Y]},Y]}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":[Jl]}],"row-start-end":[{row:["auto",{span:[Ql,Y]},Y]}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...We()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...We(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...We(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[ro]},ro]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ro,ao]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Tg]}],"font-family":[{font:[Jl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Y]}],"line-clamp":[{"line-clamp":["none",Is,Tg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pr,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ya(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pr,ao]}],"underline-offset":[{"underline-offset":["auto",pr,Y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:le()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ti(),jA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",VA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},HA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ee":[{"rounded-ee":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...ya(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:ya()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...ya()]}],"outline-offset":[{"outline-offset":[pr,Y]}],"outline-w":[{outline:[pr,ao]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Rn()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[pr,ao]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ro,zA]}],"shadow-color":[{shadow:[Jl]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Fe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Fe()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ro,Y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[y]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:bt()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:bt()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ql,Y]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":le()}],"scroll-mx":[{"scroll-mx":le()}],"scroll-my":[{"scroll-my":le()}],"scroll-ms":[{"scroll-ms":le()}],"scroll-me":[{"scroll-me":le()}],"scroll-mt":[{"scroll-mt":le()}],"scroll-mr":[{"scroll-mr":le()}],"scroll-mb":[{"scroll-mb":le()}],"scroll-ml":[{"scroll-ml":le()}],"scroll-p":[{"scroll-p":le()}],"scroll-px":[{"scroll-px":le()}],"scroll-py":[{"scroll-py":le()}],"scroll-ps":[{"scroll-ps":le()}],"scroll-pe":[{"scroll-pe":le()}],"scroll-pt":[{"scroll-pt":le()}],"scroll-pr":[{"scroll-pr":le()}],"scroll-pb":[{"scroll-pb":le()}],"scroll-pl":[{"scroll-pl":le()}],"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",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pr,ao,Tg]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var iC=RA(KA);function Zt(...e){return iC(Oc(e))}var cC=M(ue(),1);function De({className:e,type:t,...a}){return(0,cC.jsx)("input",{type:t,"data-slot":"input",className:Zt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var ze=M(W(),1);var pC=M(W(),1);function fC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yl(...e){return t=>{let a=!1,r=e.map(o=>{let n=fC(o,t);return!a&&typeof n=="function"&&(a=!0),n});if(a)return()=>{for(let o=0;o<r.length;o++){let n=r[o];typeof n=="function"?n():fC(e[o],null)}}}}function mr(...e){return pC.useCallback(Yl(...e),e)}var Bc=M(ue(),1),tR=Symbol.for("react.lazy"),Uc=ze[" use ".trim().toString()];function aR(e){return typeof e=="object"&&e!==null&&"then"in e}function mC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tR&&"_payload"in e&&aR(e._payload)}function rR(e){let t=oR(e),a=ze.forwardRef((r,o)=>{let{children:n,...s}=r;mC(n)&&typeof Uc=="function"&&(n=Uc(n._payload));let i=ze.Children.toArray(n),l=i.find(sR);if(l){let u=l.props.children,d=i.map(c=>c===l?ze.Children.count(u)>1?ze.Children.only(null):ze.isValidElement(u)?u.props.children:null:c);return(0,Bc.jsx)(t,{...s,ref:o,children:ze.isValidElement(u)?ze.cloneElement(u,void 0,d):null})}return(0,Bc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var hC=rR("Slot");function oR(e){let t=ze.forwardRef((a,r)=>{let{children:o,...n}=a;if(mC(o)&&typeof Uc=="function"&&(o=Uc(o._payload)),ze.isValidElement(o)){let s=lR(o),i=iR(n,o.props);return o.type!==ze.Fragment&&(i.ref=r?Yl(r,s):s),ze.cloneElement(o,i)}return ze.Children.count(o)>1?ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nR=Symbol("radix.slottable");function sR(e){return ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nR}function iR(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function lR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var gC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yC=Oc,xC=(e,t)=>a=>{var r;if(t?.variants==null)return yC(e,a?.class,a?.className);let{variants:o,defaultVariants:n}=t,s=Object.keys(o).map(u=>{let d=a?.[u],c=n?.[u];if(d===null)return null;let f=gC(d)||gC(c);return o[u][f]}),i=a&&Object.entries(a).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...m}=d;return Object.entries(m).every(x=>{let[w,b]=x;return Array.isArray(b)?b.includes({...n,...i}[w]):{...n,...i}[w]===b})?[...u,c,f]:u},[]);return yC(e,s,l,a?.class,a?.className)};var vC=M(ue(),1),uR=xC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function at({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,vC.jsx)(r?hC:"button",{"data-slot":"button",className:Zt(uR({variant:t,size:a,className:e})),...o})}var $C=M(W(),1);var $=M(W(),1);var SC=M(W(),1),hR=M(eg(),1);var Qe=M(W(),1);var Vc=M(ue(),1);function wC(e){let t=dR(e),a=Qe.forwardRef((r,o)=>{let{children:n,...s}=r,i=Qe.Children.toArray(n),l=i.find(fR);if(l){let u=l.props.children,d=i.map(c=>c===l?Qe.Children.count(u)>1?Qe.Children.only(null):Qe.isValidElement(u)?u.props.children:null:c);return(0,Vc.jsx)(t,{...s,ref:o,children:Qe.isValidElement(u)?Qe.cloneElement(u,void 0,d):null})}return(0,Vc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function dR(e){let t=Qe.forwardRef((a,r)=>{let{children:o,...n}=a;if(Qe.isValidElement(o)){let s=mR(o),i=pR(n,o.props);return o.type!==Qe.Fragment&&(i.ref=r?Yl(r,s):s),Qe.cloneElement(o,i)}return Qe.Children.count(o)>1?Qe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cR=Symbol("radix.slottable");function fR(e){return Qe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cR}function pR(e,t){let a={...t};for(let r in t){let o=e[r],n=t[r];/^on[A-Z]/.test(r)?o&&n?a[r]=(...i)=>{let l=n(...i);return o(...i),l}:o&&(a[r]=o):r==="style"?a[r]={...o,...n}:r==="className"&&(a[r]=[o,n].filter(Boolean).join(" "))}return{...e,...a}}function mR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var CC=M(ue(),1),gR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ps=gR.reduce((e,t)=>{let a=wC(`Primitive.${t}`),r=SC.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,CC.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Vt=M(W(),1);var LC=M(W(),1),Zl=globalThis?.document?LC.useLayoutEffect:()=>{};var bC=M(W(),1);function yR(e,t){return bC.useReducer((a,r)=>t[a][r]??a,e)}var Ts=e=>{let{present:t,children:a}=e,r=xR(t),o=typeof a=="function"?a({present:r.isPresent}):Vt.Children.only(a),n=mr(r.ref,vR(o));return typeof a=="function"||r.isPresent?Vt.cloneElement(o,{ref:n}):null};Ts.displayName="Presence";function xR(e){let[t,a]=Vt.useState(),r=Vt.useRef(null),o=Vt.useRef(e),n=Vt.useRef("none"),s=e?"mounted":"unmounted",[i,l]=yR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Vt.useEffect(()=>{let u=jc(r.current);n.current=i==="mounted"?u:"none"},[i]),Zl(()=>{let u=r.current,d=o.current;if(d!==e){let f=n.current,m=jc(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Zl(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=m=>{let w=jc(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&w&&(l("ANIMATION_END"),!o.current)){let b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},f=m=>{m.target===t&&(n.current=jc(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:Vt.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function jc(e){return e?.animationName||"none"}function vR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var hr=M(W(),1),IC=M(ue(),1);function kC(e,t=[]){let a=[];function r(n,s){let i=hr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:m,...x}=c,w=f?.[e]?.[l]||i,b=hr.useMemo(()=>x,Object.values(x));return(0,IC.jsx)(w.Provider,{value:b,children:m})};u.displayName=n+"Provider";function d(c,f){let m=f?.[e]?.[l]||i,x=hr.useContext(m);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let o=()=>{let n=a.map(s=>hr.createContext(s));return function(i){let l=i?.[e]||n;return hr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,wR(o,...t)]}function wR(...e){let t=e[0];if(e.length===1)return t;let a=()=>{let r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(n){let s=r.reduce((i,{useScope:l,scopeName:u})=>{let c=l(n)[`__scope${u}`];return{...i,...c}},{});return hr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var As=M(W(),1);function oo(e){let t=As.useRef(e);return As.useEffect(()=>{t.current=e}),As.useMemo(()=>(...a)=>t.current?.(...a),[])}var qc=M(W(),1),SR=M(ue(),1),CR=qc.createContext(void 0);function PC(e){let t=qc.useContext(CR);return e||t||"ltr"}function TC(e,[t,a]){return Math.min(a,Math.max(t,e))}var IO=!!(typeof window<"u"&&window.document&&window.document.createElement);function no(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var RC=M(W(),1),fe=M(ue(),1);function LR(e,t){return RC.useReducer((a,r)=>t[a][r]??a,e)}var Rg="ScrollArea",[_C,OO]=kC(Rg),[bR,ga]=_C(Rg),EC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,type:r="hover",dir:o,scrollHideDelay:n=600,...s}=e,[i,l]=$.useState(null),[u,d]=$.useState(null),[c,f]=$.useState(null),[m,x]=$.useState(null),[w,b]=$.useState(null),[h,g]=$.useState(0),[y,C]=$.useState(0),[L,P]=$.useState(!1),[A,R]=$.useState(!1),q=mr(t,pe=>l(pe)),V=PC(o);return(0,fe.jsx)(bR,{scope:a,type:r,dir:V,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:f,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:L,onScrollbarXEnabledChange:P,scrollbarY:w,onScrollbarYChange:b,scrollbarYEnabled:A,onScrollbarYEnabledChange:R,onCornerWidthChange:g,onCornerHeightChange:C,children:(0,fe.jsx)(Ps.div,{dir:V,...s,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":y+"px",...e.style}})})});EC.displayName=Rg;var DC="ScrollAreaViewport",MC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=ga(DC,a),i=$.useRef(null),l=mr(t,i,s.onViewportChange);return(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,fe.jsx)(Ps.div,{"data-radix-scroll-area-viewport":"",...n,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,fe.jsx)("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});MC.displayName=DC;var Ha="ScrollAreaScrollbar",_g=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ga(Ha,e.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=o,i=e.orientation==="horizontal";return $.useEffect(()=>(i?n(!0):s(!0),()=>{i?n(!1):s(!1)}),[i,n,s]),o.type==="hover"?(0,fe.jsx)(IR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,fe.jsx)(kR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,fe.jsx)(NC,{...r,ref:t,forceMount:a}):o.type==="always"?(0,fe.jsx)(Eg,{...r,ref:t}):null});_g.displayName=Ha;var IR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ga(Ha,e.__scopeScrollArea),[n,s]=$.useState(!1);return $.useEffect(()=>{let i=o.scrollArea,l=0;if(i){let u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return i.addEventListener("pointerenter",u),i.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),i.removeEventListener("pointerenter",u),i.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),(0,fe.jsx)(Ts,{present:a||n,children:(0,fe.jsx)(NC,{"data-state":n?"visible":"hidden",...r,ref:t})})}),kR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ga(Ha,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Wc(()=>l("SCROLL_END"),100),[i,l]=LR("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return $.useEffect(()=>{if(i==="idle"){let u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[i,o.scrollHideDelay,l]),$.useEffect(()=>{let u=o.viewport,d=n?"scrollLeft":"scrollTop";if(u){let c=u[d],f=()=>{let m=u[d];c!==m&&(l("SCROLL"),s()),c=m};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[o.viewport,n,l,s]),(0,fe.jsx)(Ts,{present:a||i!=="hidden",children:(0,fe.jsx)(Eg,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:no(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:no(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),NC=$.forwardRef((e,t)=>{let a=ga(Ha,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=Wc(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return Rs(a.viewport,l),Rs(a.content,l),(0,fe.jsx)(Ts,{present:r||n,children:(0,fe.jsx)(Eg,{"data-state":n?"visible":"hidden",...o,ref:t})})}),Eg=$.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=ga(Ha,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=UC(i.viewport,i.content),d={...r,sizes:i,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function c(f,m){return ER(f,s.current,i,m)}return a==="horizontal"?(0,fe.jsx)(PR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,m=AC(f,i,o.dir);n.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=c(f,o.dir))}}):a==="vertical"?(0,fe.jsx)(TR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,m=AC(f,i);n.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=c(f))}}):null}),PR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ga(Ha,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=mr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(FC,{"data-orientation":"horizontal",...o,ref:u,sizes:a,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":$c(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollLeft+d.deltaX;e.onWheelScroll(f),jC(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:zc(s.paddingLeft),paddingEnd:zc(s.paddingRight)}})}})}),TR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ga(Ha,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=mr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(FC,{"data-orientation":"vertical",...o,ref:u,sizes:a,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":$c(a)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,c)=>{if(n.viewport){let f=n.viewport.scrollTop+d.deltaY;e.onWheelScroll(f),jC(f,c)&&d.preventDefault()}},onResize:()=>{l.current&&n.viewport&&s&&r({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:zc(s.paddingTop),paddingEnd:zc(s.paddingBottom)}})}})}),[AR,OC]=_C(Ha),FC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,sizes:r,hasThumb:o,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:i,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:c,...f}=e,m=ga(Ha,a),[x,w]=$.useState(null),b=mr(t,q=>w(q)),h=$.useRef(null),g=$.useRef(""),y=m.viewport,C=r.content-r.viewport,L=oo(d),P=oo(l),A=Wc(c,10);function R(q){if(h.current){let V=q.clientX-h.current.left,pe=q.clientY-h.current.top;u({x:V,y:pe})}}return $.useEffect(()=>{let q=V=>{let pe=V.target;x?.contains(pe)&&L(V,C)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[y,x,C,L]),$.useEffect(P,[r,P]),Rs(x,A),Rs(m.content,A),(0,fe.jsx)(AR,{scope:a,scrollbar:x,hasThumb:o,onThumbChange:oo(n),onThumbPointerUp:oo(s),onThumbPositionChange:P,onThumbPointerDown:oo(i),children:(0,fe.jsx)(Ps.div,{...f,ref:b,style:{position:"absolute",...f.style},onPointerDown:no(e.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),h.current=x.getBoundingClientRect(),g.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),R(q))}),onPointerMove:no(e.onPointerMove,R),onPointerUp:no(e.onPointerUp,q=>{let V=q.target;V.hasPointerCapture(q.pointerId)&&V.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=g.current,m.viewport&&(m.viewport.style.scrollBehavior=""),h.current=null})})})}),Hc="ScrollAreaThumb",Dg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=OC(Hc,e.__scopeScrollArea);return(0,fe.jsx)(Ts,{present:a||o.hasThumb,children:(0,fe.jsx)(RR,{ref:t,...r})})}),RR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=ga(Hc,a),s=OC(Hc,a),{onThumbPositionChange:i}=s,l=mr(t,c=>s.onThumbChange(c)),u=$.useRef(void 0),d=Wc(()=>{u.current&&(u.current(),u.current=void 0)},100);return $.useEffect(()=>{let c=n.viewport;if(c){let f=()=>{if(d(),!u.current){let m=DR(c,i);u.current=m,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,fe.jsx)(Ps.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:no(e.onPointerDownCapture,c=>{let m=c.target.getBoundingClientRect(),x=c.clientX-m.left,w=c.clientY-m.top;s.onThumbPointerDown({x,y:w})}),onPointerUp:no(e.onPointerUp,s.onThumbPointerUp)})});Dg.displayName=Hc;var Mg="ScrollAreaCorner",BC=$.forwardRef((e,t)=>{let a=ga(Mg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,fe.jsx)(_R,{...e,ref:t}):null});BC.displayName=Mg;var _R=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=ga(Mg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return Rs(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),Rs(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,fe.jsx)(Ps.div,{...r,ref:t,style:{width:n,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function zc(e){return e?parseInt(e,10):0}function UC(e,t){let a=e/t;return isNaN(a)?0:a}function $c(e){let t=UC(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function ER(e,t,a,r="ltr"){let o=$c(a),n=o/2,s=t||n,i=o-s,l=a.scrollbar.paddingStart+s,u=a.scrollbar.size-a.scrollbar.paddingEnd-i,d=a.content-a.viewport,c=r==="ltr"?[0,d]:[d*-1,0];return VC([l,u],c)(e)}function AC(e,t,a="ltr"){let r=$c(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=t.scrollbar.size-o,s=t.content-t.viewport,i=n-r,l=a==="ltr"?[0,s]:[s*-1,0],u=TC(e,l);return VC([0,s],[0,i])(u)}function VC(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}function jC(e,t){return e>0&&e<t}var DR=(e,t=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){let n={left:e.scrollLeft,top:e.scrollTop},s=a.left!==n.left,i=a.top!==n.top;(s||i)&&t(),a=n,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function Wc(e,t){let a=oo(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function Rs(e,t){let a=oo(t);Zl(()=>{let r=0;if(e){let o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(a)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,a])}var qC=EC,HC=MC;var zC=BC;var so=M(ue(),1),Ng=$C.forwardRef(({className:e,children:t,...a},r)=>(0,so.jsxs)(qC,{"data-slot":"scroll-area",className:Zt("relative",e),...a,children:[(0,so.jsx)(HC,{ref:r,"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,so.jsx)(NR,{}),(0,so.jsx)(zC,{})]}));Ng.displayName="ScrollArea";function NR({className:e,orientation:t="vertical",...a}){return(0,so.jsx)(_g,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Zt("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:(0,so.jsx)(Dg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Kc=M(W());var WC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Og=e=>{let t=OR(e);return t.charAt(0).toUpperCase()+t.slice(1)},Gc=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),GC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var eu=M(W());var KC={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"};var XC=(0,eu.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,eu.createElement)("svg",{ref:l,...KC,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Gc("lucide",o),...!n&&!GC(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,eu.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var U=(e,t)=>{let a=(0,Kc.forwardRef)(({className:r,...o},n)=>(0,Kc.createElement)(XC,{ref:n,iconNode:t,className:Gc(`lucide-${WC(Og(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Og(e),a};var FR=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],tu=U("activity",FR);var BR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_s=U("arrow-left",BR);var UR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],au=U("arrow-up",UR);var VR=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],ru=U("calendar",VR);var jR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ou=U("chevron-down",jR);var qR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Aa=U("circle-alert",qR);var HR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],rt=U("circle-check",HR);var zR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Ra=U("circle-x",zR);var $R=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],dn=U("clock",$R);var WR=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],gr=U("command",WR);var GR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],yr=U("corner-down-left",GR);var KR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],cn=U("credit-card",KR);var XR=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],fn=U("crown",XR);var QR=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],pn=U("dollar-sign",QR);var JR=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Es=U("file-spreadsheet",JR);var YR=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ds=U("key",YR);var ZR=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],nu=U("laptop",ZR);var e_=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rt=U("loader-circle",e_);var t_=[["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"}]],Ms=U("mail",t_);var a_=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Ns=U("map-pin",a_);var r_=[["path",{d:"M5 12h14",key:"1ays0h"}]],mn=U("minus",r_);var o_=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],su=U("paperclip",o_);var n_=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Os=U("refresh-cw",n_);var s_=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hn=U("search",s_);var i_=[["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"}]],Fs=U("shield",i_);var l_=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],iu=U("smartphone",l_);var u_=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],ea=U("sparkles",u_);var d_=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],jt=U("square-pen",d_);var c_=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],lu=U("trending-up",c_);var f_=[["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"}]],Bs=U("users",f_);var p_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xr=U("x",p_);var m_=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],uu=U("zap",m_);var cu=M(ue(),1),za=M(W(),1);var QC=M(W(),1),Us=(0,QC.createContext)({});var JC=M(W(),1);function io(e){let t=(0,JC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Bg=M(ue(),1),aL=M(W(),1),gn=M(W(),1);var YC=M(W(),1),lo=(0,YC.createContext)(null);var eL=M(ue(),1),Xc=M(W(),1),vr=M(W(),1);var ZC=M(W(),1),Vs=(0,ZC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Fg=class extends Xc.Component{getSnapshotBeforeUpdate(t){let a=this.props.childRef.current;if(a&&t.isPresent&&!this.props.isPresent){let r=this.props.sizeRef.current;r.height=a.offsetHeight||0,r.width=a.offsetWidth||0,r.top=a.offsetTop,r.left=a.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}};function tL({children:e,isPresent:t}){let a=(0,vr.useId)(),r=(0,vr.useRef)(null),o=(0,vr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,vr.useContext)(Vs);return(0,vr.useInsertionEffect)(()=>{let{width:s,height:i,top:l,left:u}=o.current;if(t||!r.current||!s||!i)return;r.current.dataset.motionPopId=a;let d=document.createElement("style");return n&&(d.nonce=n),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`
|
|
16
|
+
[data-motion-pop-id="${a}"] {
|
|
52
17
|
position: absolute !important;
|
|
53
18
|
width: ${s}px !important;
|
|
54
19
|
height: ${i}px !important;
|
|
55
20
|
top: ${l}px !important;
|
|
56
21
|
left: ${u}px !important;
|
|
57
22
|
}
|
|
58
|
-
`),()=>{document.head.removeChild(c)}},[t]),(0,qC.jsx)(Ng,{isPresent:t,childRef:a,sizeRef:o,children:jd.cloneElement(e,{ref:a})})}var zC=({children:e,initial:t,isPresent:r,onExitComplete:a,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=vo(NE),l=(0,bn.useId)(),u=(0,bn.useCallback)(d=>{i.set(d,!0);for(let f of i.values())if(!f)return;a&&a()},[i,a]),c=(0,bn.useMemo)(()=>({id:l,initial:t,isPresent:r,custom:o,onExitComplete:u,register:d=>(i.set(d,!1),()=>i.delete(d))}),n?[Math.random(),u]:[r,u]);return(0,bn.useMemo)(()=>{i.forEach((d,f)=>i.set(f,!1))},[r]),HC.useEffect(()=>{!r&&!i.size&&a&&a()},[r]),s==="popLayout"&&(e=(0,Mg.jsx)($C,{isPresent:r,children:e})),(0,Mg.jsx)(xo.Provider,{value:c,children:e})};function NE(){return new Map}var wo=M(K(),1);function qd(e=!0){let t=(0,wo.useContext)(xo);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:a,register:o}=t,n=(0,wo.useId)();(0,wo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,wo.useCallback)(()=>e&&a&&a(n),[n,a,e]);return!r&&a?[!1,s]:[!0]}var $d=M(K(),1),su=e=>e.key||"";function Og(e){let t=[];return $d.Children.forEach(e,r=>{(0,$d.isValidElement)(r)&&t.push(r)}),t}var Hd=M(K(),1);var Ws=typeof window<"u";var Gs=Ws?Hd.useLayoutEffect:Hd.useEffect;var Bg=({children:e,custom:t,initial:r=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=qd(s),u=(0,zr.useMemo)(()=>Og(e),[e]),c=s&&!i?[]:u.map(su),d=(0,zr.useRef)(!0),f=(0,zr.useRef)(u),m=vo(()=>new Map),[v,x]=(0,zr.useState)(u),[b,g]=(0,zr.useState)(u);Gs(()=>{d.current=!1,f.current=u;for(let w=0;w<b.length;w++){let L=su(b[w]);c.includes(L)?m.delete(L):m.get(L)!==!0&&m.set(L,!1)}},[b,c.length,c.join("-")]);let h=[];if(u!==v){let w=[...u];for(let L=0;L<b.length;L++){let P=b[L],_=su(P);c.includes(_)||(w.splice(L,0,P),h.push(P))}n==="wait"&&h.length&&(w=h),g(Og(w)),x(u);return}let{forceRender:y}=(0,zr.useContext)(Hs);return(0,iu.jsx)(iu.Fragment,{children:b.map(w=>{let L=su(w),P=s&&!i?!1:u===b||c.includes(L),_=()=>{if(m.has(L))m.set(L,!0);else return;let A=!0;m.forEach(F=>{F||(A=!1)}),A&&(y?.(),g(f.current),s&&l?.(),a&&a())};return(0,iu.jsx)(zC,{isPresent:P,initial:!d.current||r?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:_,children:w},L)})})};var ve=e=>e;var Ia=ve,qt=ve;function Ln(e){let t;return()=>(t===void 0&&(t=e()),t)}var or=(e,t,r)=>{let a=t-e;return a===0?1:(r-e)/a};var ze=e=>e*1e3,mt=e=>e/1e3;var Ks={skipAnimations:!1,useManualTiming:!1};function WC(e){let t=new Set,r=new Set,a=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,c=!1,d=!1)=>{let m=d&&a?t:r;return c&&n.add(u),m.has(u)||m.add(u),u},cancel:u=>{r.delete(u),n.delete(u)},process:u=>{if(s=u,a){o=!0;return}a=!0,[t,r]=[r,t],t.forEach(i),t.clear(),a=!1,o&&(o=!1,l.process(u))}};return l}var zd=["read","resolveKeyframes","update","preRender","render","postRender"],ME=40;function Wd(e,t){let r=!1,a=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>r=!0,s=zd.reduce((g,h)=>(g[h]=WC(n),g),{}),{read:i,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=s,m=()=>{let g=Ks.useManualTiming?o.timestamp:performance.now();r=!1,o.delta=a?1e3/60:Math.max(Math.min(g-o.timestamp,ME),1),o.timestamp=g,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),c.process(o),d.process(o),f.process(o),o.isProcessing=!1,r&&t&&(a=!1,e(m))},v=()=>{r=!0,a=!0,o.isProcessing||e(m)};return{schedule:zd.reduce((g,h)=>{let y=s[h];return g[h]=(w,L=!1,P=!1)=>(r||v(),y.schedule(w,L,P)),g},{}),cancel:g=>{for(let h=0;h<zd.length;h++)s[zd[h]].cancel(g)},state:o,steps:s}}var{schedule:te,cancel:nr,state:We,steps:Gd}=Wd(typeof requestAnimationFrame<"u"?requestAnimationFrame:ve,!0);var GC=M(K(),1),Kd=(0,GC.createContext)({strict:!1});var KC={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"]},ka={};for(let e in KC)ka[e]={isEnabled:t=>KC[e].some(r=>!!t[r])};function XC(e){for(let t in e)ka[t]={...ka[t],...e[t]}}var OE=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","ignoreStrict","viewport"]);function lu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||OE.has(e)}var JC=e=>!lu(e);function BE(e){e&&(JC=t=>t.startsWith("on")?!lu(t):e(t))}try{BE(Uk("@emotion/is-prop-valid").default)}catch{}function QC(e,t,r){let a={};for(let o in e)o==="values"&&typeof e.values=="object"||(JC(o)||r===!0&&lu(o)||!t&&!lu(o)||e.draggable&&o.startsWith("onDrag"))&&(a[o]=e[o]);return a}function YC(e){if(typeof Proxy>"u")return e;let t=new Map,r=(...a)=>e(...a);return new Proxy(r,{get:(a,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var ef=M(le(),1);var Qs=M(K(),1);var ZC=M(K(),1),So=(0,ZC.createContext)({});var Qd=M(K(),1);function Pa(e){return typeof e=="string"||Array.isArray(e)}function Co(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var Xd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],uu=["initial",...Xd];function In(e){return Co(e.animate)||uu.some(t=>Pa(e[t]))}function Jd(e){return!!(In(e)||e.variants)}function eb(e,t){if(In(e)){let{initial:r,animate:a}=e;return{initial:r===!1||Pa(r)?r:void 0,animate:Pa(a)?a:void 0}}return e.inherit!==!1?t:{}}function rb(e){let{initial:t,animate:r}=eb(e,(0,Qd.useContext)(So));return(0,Qd.useMemo)(()=>({initial:t,animate:r}),[tb(t),tb(r)])}function tb(e){return Array.isArray(e)?e.join(" "):e}var ab=Symbol.for("motionComponentSymbol");var ob=M(K(),1);function Ta(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function nb(e,t,r){return(0,ob.useCallback)(a=>{a&&e.onMount&&e.onMount(a),t&&(a?t.mount(a):t.unmount()),r&&(typeof r=="function"?r(a):Ta(r)&&(r.current=a))},[t])}var $t=M(K(),1);var Xs=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var FE="framerAppearId",Yd="data-"+Xs(FE);var{schedule:Js,cancel:mV}=Wd(queueMicrotask,!1);var sb=M(K(),1),Zd=(0,sb.createContext)({});function ib(e,t,r,a,o){var n,s;let{visualElement:i}=(0,$t.useContext)(So),l=(0,$t.useContext)(Kd),u=(0,$t.useContext)(xo),c=(0,$t.useContext)(zs).reducedMotion,d=(0,$t.useRef)(null);a=a||l.renderer,!d.current&&a&&(d.current=a(e,{visualState:t,parent:i,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));let f=d.current,m=(0,$t.useContext)(Zd);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&UE(d.current,r,o,m);let v=(0,$t.useRef)(!1);(0,$t.useInsertionEffect)(()=>{f&&v.current&&f.update(r,u)});let x=r[Yd],b=(0,$t.useRef)(!!x&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,x))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,x)));return Gs(()=>{f&&(v.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Js.render(f.render),b.current&&f.animationState&&f.animationState.animateChanges())}),(0,$t.useEffect)(()=>{f&&(!b.current&&f.animationState&&f.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,x)}),b.current=!1))}),f}function UE(e,t,r,a){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:lb(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&Ta(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}function lb(e){if(e)return e.options.allowProjection!==!1?e.projection:lb(e.parent)}function ub({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:a,Component:o}){var n,s;e&&XC(e);function i(u,c){let d,f={...(0,Qs.useContext)(zs),...u,layoutId:VE(u)},{isStatic:m}=f,v=rb(u),x=a(u,m);if(!m&&Ws){jE(f,e);let b=qE(f);d=b.MeasureLayout,v.visualElement=ib(o,x,f,t,b.ProjectionNode)}return(0,ef.jsxs)(So.Provider,{value:v,children:[d&&v.visualElement?(0,ef.jsx)(d,{visualElement:v.visualElement,...f}):null,r(o,u,nb(x,v.visualElement,c),x,m,v.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,Qs.forwardRef)(i);return l[ab]=o,l}function VE({layoutId:e}){let t=(0,Qs.useContext)(Hs).id;return t&&e!==void 0?t+"-"+e:e}function jE(e,t){let r=(0,Qs.useContext)(Kd).strict}function qE(e){let{drag:t,layout:r}=ka;if(!t&&!r)return{};let a={...t,...r};return{MeasureLayout:t?.isEnabled(e)||r?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}var cb=["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 Ys(e){return typeof e!="string"||e.includes("-")?!1:!!(cb.indexOf(e)>-1||/[A-Z]/u.test(e))}var Fg=M(K(),1);function db(e){let t=[{},{}];return e?.values.forEach((r,a)=>{t[0][a]=r.get(),t[1][a]=r.getVelocity()}),t}function Zs(e,t,r,a){if(typeof t=="function"){let[o,n]=db(a);t=t(r!==void 0?r:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=db(a);t=t(r!==void 0?r:e.custom,o,n)}return t}var cu=e=>Array.isArray(e);var fb=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),pb=e=>cu(e)?e[e.length-1]||0:e;var Le=e=>!!(e&&e.getVelocity);function ei(e){let t=Le(e)?e.get():e;return fb(t)?t.toValue():t}function $E({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},a,o,n){let s={latestValues:HE(a,o,n,e),renderState:t()};return r&&(s.onMount=i=>r({props:a,current:i,...s}),s.onUpdate=i=>r(i)),s}var tf=e=>(t,r)=>{let a=(0,Fg.useContext)(So),o=(0,Fg.useContext)(xo),n=()=>$E(e,t,a,o);return r?n():vo(n)};function HE(e,t,r,a){let o={},n=a(e,{});for(let f in n)o[f]=ei(n[f]);let{initial:s,animate:i}=e,l=In(e),u=Jd(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let c=r?r.initial===!1:!1;c=c||s===!1;let d=c?i:s;if(d&&typeof d!="boolean"&&!Co(d)){let f=Array.isArray(d)?d:[d];for(let m=0;m<f.length;m++){let v=Zs(e,f[m]);if(v){let{transitionEnd:x,transition:b,...g}=v;for(let h in g){let y=g[h];if(Array.isArray(y)){let w=c?y.length-1:0;y=y[w]}y!==null&&(o[h]=y)}for(let h in x)o[h]=x[h]}}}return o}var Wr=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ht=new Set(Wr);var mb=e=>t=>typeof t=="string"&&t.startsWith(e),rf=mb("--"),zE=mb("var(--"),ti=e=>zE(e)?WE.test(e.split("/*")[0].trim()):!1,WE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var af=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ht=(e,t,r)=>r>t?t:r<e?e:r;var Gr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},_a={...Gr,transform:e=>ht(0,1,e)},du={...Gr,default:1};var fu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Kr=fu("deg"),Et=fu("%"),H=fu("px"),hb=fu("vh"),gb=fu("vw"),Ug={...Et,parse:e=>Et.parse(e)/100,transform:e=>Et.transform(e*100)};var yb={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var vb={rotate:Kr,rotateX:Kr,rotateY:Kr,rotateZ:Kr,scale:du,scaleX:du,scaleY:du,scaleZ:du,skew:Kr,skewX:Kr,skewY:Kr,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:_a,originX:Ug,originY:Ug,originZ:H};var Vg={...Gr,transform:Math.round};var ri={...yb,...vb,zIndex:Vg,size:H,fillOpacity:_a,strokeOpacity:_a,numOctaves:Vg};var GE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},KE=Wr.length;function xb(e,t,r){let a="",o=!0;for(let n=0;n<KE;n++){let s=Wr[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||r){let u=af(i,ri[s]);if(!l){o=!1;let c=GE[s]||s;a+=`${c}(${u}) `}r&&(t[s]=u)}}return a=a.trim(),r?a=r(t,o?"":a):o&&(a="none"),a}function ai(e,t,r){let{style:a,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(Ht.has(l)){s=!0;continue}else if(rf(l)){o[l]=u;continue}else{let c=af(u,ri[l]);l.startsWith("origin")?(i=!0,n[l]=c):a[l]=c}}if(t.transform||(s||r?a.transform=xb(t,e.transform,r):a.transform&&(a.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:c=0}=n;a.transformOrigin=`${l} ${u} ${c}`}}var XE={offset:"stroke-dashoffset",array:"stroke-dasharray"},JE={offset:"strokeDashoffset",array:"strokeDasharray"};function wb(e,t,r=1,a=0,o=!0){e.pathLength=1;let n=o?XE:JE;e[n.offset]=H.transform(-a);let s=H.transform(t),i=H.transform(r);e[n.array]=`${s} ${i}`}function Sb(e,t,r){return typeof e=="string"?e:H.transform(t+r*e)}function Cb(e,t,r){let a=Sb(t,e.x,e.width),o=Sb(r,e.y,e.height);return`${a} ${o}`}function oi(e,{attrX:t,attrY:r,attrScale:a,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},c,d){if(ai(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m,dimensions:v}=e;f.transform&&(v&&(m.transform=f.transform),delete f.transform),v&&(o!==void 0||n!==void 0||m.transform)&&(m.transformOrigin=Cb(v,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),a!==void 0&&(f.scale=a),s!==void 0&&wb(f,s,i,l,!1)}var ni=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var of=()=>({...ni(),attrs:{}});var si=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nf(e,{style:t,vars:r},a,o){Object.assign(e.style,t,o&&o.getProjectionStyles(a));for(let n in r)e.style.setProperty(n,r[n])}var sf=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"]);function lf(e,t,r,a){nf(e,t,void 0,a);for(let o in t.attrs)e.setAttribute(sf.has(o)?o:Xs(o),t.attrs[o])}var ii={};function bb(e){Object.assign(ii,e)}function uf(e,{layout:t,layoutId:r}){return Ht.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!ii[e]||e==="opacity")}function li(e,t,r){var a;let{style:o}=e,n={};for(let s in o)(Le(o[s])||t.style&&Le(t.style[s])||uf(s,e)||((a=r?.getValue(s))===null||a===void 0?void 0:a.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function cf(e,t,r){let a=li(e,t,r);for(let o in e)if(Le(e[o])||Le(t[o])){let n=Wr.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;a[n]=e[o]}return a}function QE(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var Lb=["x","y","width","height","cx","cy","r"],Ib={useVisualState:tf({scrapeMotionValuesFromProps:cf,createRenderState:of,onUpdate:({props:e,prevProps:t,current:r,renderState:a,latestValues:o})=>{if(!r)return;let n=!!e.drag;if(!n){for(let i in o)if(Ht.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<Lb.length;i++){let l=Lb[i];e[l]!==t[l]&&(s=!0)}s&&te.read(()=>{QE(r,a),te.render(()=>{oi(a,o,si(r.tagName),e.transformTemplate),lf(r,a)})})}})};var kb={useVisualState:tf({scrapeMotionValuesFromProps:li,createRenderState:ni})};var ui=M(K(),1);var Pb=M(K(),1);function jg(e,t,r){for(let a in t)!Le(t[a])&&!uf(a,r)&&(e[a]=t[a])}function YE({transformTemplate:e},t){return(0,Pb.useMemo)(()=>{let r=ni();return ai(r,t,e),Object.assign({},r.vars,r.style)},[t])}function ZE(e,t){let r=e.style||{},a={};return jg(a,r,e),Object.assign(a,YE(e,t)),a}function Tb(e,t){let r={},a=ZE(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,a.userSelect=a.WebkitUserSelect=a.WebkitTouchCallout="none",a.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=a,r}var _b=M(K(),1);function Ab(e,t,r,a){let o=(0,_b.useMemo)(()=>{let n=of();return oi(n,t,si(a),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};jg(n,e.style,e),o.style={...n,...o.style}}return o}function Rb(e=!1){return(r,a,o,{latestValues:n},s)=>{let l=(Ys(r)?Ab:Tb)(a,n,s,r),u=QC(a,typeof r=="string",e),c=r!==ui.Fragment?{...u,...l,ref:o}:{},{children:d}=a,f=(0,ui.useMemo)(()=>Le(d)?d.get():d,[d]);return(0,ui.createElement)(r,{...c,children:f})}}function Eb(e,t){return function(a,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...Ys(a)?Ib:kb,preloadedFeatures:e,useRender:Rb(o),createVisualElement:t,Component:a};return ub(s)}}function qg(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let a=0;a<r;a++)if(t[a]!==e[a])return!1;return!0}function bo(e,t,r){let a=e.getProps();return Zs(a,t,r!==void 0?r:a.custom,e)}var $g=Ln(()=>window.ScrollTimeline!==void 0);var pu=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,r){for(let a=0;a<this.animations.length;a++)this.animations[a][t]=r}attachTimeline(t,r){let a=this.animations.map(o=>{if($g()&&o.attachTimeline)return o.attachTimeline(t);if(typeof r=="function")return r(o)});return()=>{a.forEach((o,n)=>{o&&o(),this.animations[n].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let r=0;r<this.animations.length;r++)t=Math.max(t,this.animations[r].duration);return t}runAll(t){this.animations.forEach(r=>r[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var mu=class extends pu{then(t,r){return Promise.all(this.animations).then(t).catch(r)}};function Lo(e,t){return e?e[t]||e.default||e:void 0}function ci(e){let t=0,r=50,a=e.next(t);for(;!a.done&&t<2e4;)t+=r,a=e.next(t);return t>=2e4?1/0:t}function Io(e){return typeof e=="function"}function hu(e,t){e.timeline=t,e.onfinish=null}var di=e=>Array.isArray(e)&&typeof e[0]=="number";var zg={linearEasing:void 0};function Db(e,t){let r=Ln(e);return()=>{var a;return(a=zg[t])!==null&&a!==void 0?a:r()}}var ko=Db(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var gu=(e,t,r=10)=>{let a="",o=Math.max(Math.round(t/r),2);for(let n=0;n<o;n++)a+=e(or(0,o-1,n))+", ";return`linear(${a.substring(0,a.length-2)})`};function ff(e){return!!(typeof e=="function"&&ko()||!e||typeof e=="string"&&(e in df||ko())||di(e)||Array.isArray(e)&&e.every(ff))}var fi=([e,t,r,a])=>`cubic-bezier(${e}, ${t}, ${r}, ${a})`,df={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fi([0,.65,.55,1]),circOut:fi([.55,0,1,.45]),backIn:fi([.31,.01,.66,-.59]),backOut:fi([.33,1.53,.69,.99])};function pi(e,t){if(e)return typeof e=="function"&&ko()?gu(e,t):di(e)?fi(e):Array.isArray(e)?e.map(r=>pi(r,t)||df.easeOut):df[e]}var sr={x:!1,y:!1};function mi(){return sr.x||sr.y}function Wg(e,t,r){var a;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(a=r?.[e])!==null&&a!==void 0?a:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function pf(e,t){let r=Wg(e),a=new AbortController,o={passive:!0,...t,signal:a.signal};return[r,o,()=>a.abort()]}function Nb(e){return t=>{t.pointerType==="touch"||mi()||e(t)}}function Gg(e,t,r={}){let[a,o,n]=pf(e,r),s=Nb(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let c=Nb(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,o)});return a.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var mf=(e,t)=>t?e===t?!0:mf(e,t.parentElement):!1;var kn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var e1=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Mb(e){return e1.has(e.tagName)||e.tabIndex!==-1}var Pn=new WeakSet;function Ob(e){return t=>{t.key==="Enter"&&e(t)}}function Kg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var Bb=(e,t)=>{let r=e.currentTarget;if(!r)return;let a=Ob(()=>{if(Pn.has(r))return;Kg(r,"down");let o=Ob(()=>{Kg(r,"up")}),n=()=>Kg(r,"cancel");r.addEventListener("keyup",o,t),r.addEventListener("blur",n,t)});r.addEventListener("keydown",a,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",a),t)};function Fb(e){return kn(e)&&!mi()}function Xg(e,t,r={}){let[a,o,n]=pf(e,r),s=i=>{let l=i.currentTarget;if(!Fb(i)||Pn.has(l))return;Pn.add(l);let u=t(i),c=(m,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Fb(m)||!Pn.has(l))&&(Pn.delete(l),typeof u=="function"&&u(m,{success:v}))},d=m=>{c(m,r.useGlobalTarget||mf(l,m.target))},f=m=>{c(m,!1)};window.addEventListener("pointerup",d,o),window.addEventListener("pointercancel",f,o)};return a.forEach(i=>{!Mb(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(r.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>Bb(u,o),o)}),n}function Jg(e){return e==="x"||e==="y"?sr[e]?null:(sr[e]=!0,()=>{sr[e]=!1}):sr.x||sr.y?null:(sr.x=sr.y=!0,()=>{sr.x=sr.y=!1})}var hf=new Set(["width","height","top","left","right","bottom",...Wr]);var gf;function r1(){gf=void 0}var Lt={now:()=>(gf===void 0&&Lt.set(We.isProcessing||Ks.useManualTiming?We.timestamp:performance.now()),gf),set:e=>{gf=e,queueMicrotask(r1)}};function hi(e,t){e.indexOf(t)===-1&&e.push(t)}function gi(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var Po=class{constructor(){this.subscriptions=[]}add(t){return hi(this.subscriptions,t),()=>gi(this.subscriptions,t)}notify(t,r,a){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,r,a);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,r,a)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function yf(e,t){return t?e*(1e3/t):0}var Vb=30,a1=e=>!isNaN(parseFloat(e)),jb={current:void 0},Qg=class{constructor(t,r={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(a,o=!0)=>{let n=Lt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(a),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Lt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=a1(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Po);let a=this.events[t].add(r);return t==="change"?()=>{a(),te.read(()=>{this.events.change.getSize()||this.stop()})}:a}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t,r=!0){!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,r,a){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-a}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return jb.current&&jb.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=Lt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vb)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Vb);return yf(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Aa(e,t){return new Qg(e,t)}function o1(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Aa(r))}function yu(e,t){let r=bo(e,t),{transitionEnd:a={},transition:o={},...n}=r||{};n={...n,...a};for(let s in n){let i=pb(n[s]);o1(e,s,i)}}function qb(e){return!!(Le(e)&&e.add)}function vu(e,t){let r=e.getValue("willChange");if(qb(r))return r.add(t)}function vf(e){return e.props[Yd]}var xf={current:!1};var $b=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,n1=1e-7,s1=12;function i1(e,t,r,a,o){let n,s,i=0;do s=t+(r-t)/2,n=$b(s,a,o)-e,n>0?r=s:t=s;while(Math.abs(n)>n1&&++i<s1);return s}function To(e,t,r,a){if(e===t&&r===a)return ve;let o=n=>i1(n,0,1,e,r);return n=>n===0||n===1?n:$b(o(n),t,a)}var wf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Sf=e=>t=>1-e(1-t);var Yg=To(.33,1.53,.69,.99),xu=Sf(Yg),Cf=wf(xu);var bf=e=>(e*=2)<1?.5*xu(e):.5*(2-Math.pow(2,-10*(e-1)));var Lf=e=>1-Math.sin(Math.acos(e)),If=Sf(Lf),kf=wf(Lf);var Pf=e=>/^0[^.\s]+$/u.test(e);function Hb(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Pf(e):!0}var _o=e=>Math.round(e*1e5)/1e5;var yi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zb(e){return e==null}var Wb=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var vi=(e,t)=>r=>!!(typeof r=="string"&&Wb.test(r)&&r.startsWith(e)||t&&!zb(r)&&Object.prototype.hasOwnProperty.call(r,t)),Tf=(e,t,r)=>a=>{if(typeof a!="string")return a;let[o,n,s,i]=a.match(yi);return{[e]:parseFloat(o),[t]:parseFloat(n),[r]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var l1=e=>ht(0,255,e),Zg={...Gr,transform:e=>Math.round(l1(e))},Xr={test:vi("rgb","red"),parse:Tf("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:a=1})=>"rgba("+Zg.transform(e)+", "+Zg.transform(t)+", "+Zg.transform(r)+", "+_o(_a.transform(a))+")"};function u1(e){let t="",r="",a="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),a=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),a=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,a+=a,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(a,16),alpha:o?parseInt(o,16)/255:1}}var wu={test:vi("#"),parse:u1,transform:Xr.transform};var Ao={test:vi("hsl","hue"),parse:Tf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+Et.transform(_o(t))+", "+Et.transform(_o(r))+", "+_o(_a.transform(a))+")"};var Je={test:e=>Xr.test(e)||wu.test(e)||Ao.test(e),parse:e=>Xr.test(e)?Xr.parse(e):Ao.test(e)?Ao.parse(e):wu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Xr.transform(e):Ao.transform(e)};var Gb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function c1(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(yi))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(Gb))===null||r===void 0?void 0:r.length)||0)>0}var Xb="number",Jb="color",d1="var",f1="var(",Kb="${}",p1=/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 Tn(e){let t=e.toString(),r=[],a={color:[],number:[],var:[]},o=[],n=0,i=t.replace(p1,l=>(Je.test(l)?(a.color.push(n),o.push(Jb),r.push(Je.parse(l))):l.startsWith(f1)?(a.var.push(n),o.push(d1),r.push(l)):(a.number.push(n),o.push(Xb),r.push(parseFloat(l))),++n,Kb)).split(Kb);return{values:r,split:i,indexes:a,types:o}}function Qb(e){return Tn(e).values}function Yb(e){let{split:t,types:r}=Tn(e),a=t.length;return o=>{let n="";for(let s=0;s<a;s++)if(n+=t[s],o[s]!==void 0){let i=r[s];i===Xb?n+=_o(o[s]):i===Jb?n+=Je.transform(o[s]):n+=o[s]}return n}}var m1=e=>typeof e=="number"?0:e;function h1(e){let t=Qb(e);return Yb(e)(t.map(m1))}var Dt={test:c1,parse:Qb,createTransformer:Yb,getAnimatableNone:h1};var g1=new Set(["brightness","contrast","saturate","opacity"]);function y1(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[a]=r.match(yi)||[];if(!a)return e;let o=r.replace(a,""),n=g1.has(t)?1:0;return a!==r&&(n*=100),t+"("+n+o+")"}var v1=/\b([a-z-]*)\(.*?\)/gu,Su={...Dt,getAnimatableNone:e=>{let t=e.match(v1);return t?t.map(y1).join(" "):e}};var x1={...ri,color:Je,backgroundColor:Je,outlineColor:Je,fill:Je,stroke:Je,borderColor:Je,borderTopColor:Je,borderRightColor:Je,borderBottomColor:Je,borderLeftColor:Je,filter:Su,WebkitFilter:Su},xi=e=>x1[e];function _f(e,t){let r=xi(e);return r!==Su&&(r=Dt),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var w1=new Set(["auto","none","0"]);function Zb(e,t,r){let a=0,o;for(;a<e.length&&!o;){let n=e[a];typeof n=="string"&&!w1.has(n)&&Tn(n).values.length&&(o=e[a]),a++}if(o&&r)for(let n of t)e[n]=_f(r,o)}var ey=e=>e===Gr||e===H,eL=(e,t)=>parseFloat(e.split(", ")[t]),tL=(e,t)=>(r,{transform:a})=>{if(a==="none"||!a)return 0;let o=a.match(/^matrix3d\((.+)\)$/u);if(o)return eL(o[1],t);{let n=a.match(/^matrix\((.+)\)$/u);return n?eL(n[1],e):0}},S1=new Set(["x","y","z"]),C1=Wr.filter(e=>!S1.has(e));function rL(e){let t=[];return C1.forEach(r=>{let a=e.getValue(r);a!==void 0&&(t.push([r,a.get()]),a.set(r.startsWith("scale")?1:0))}),t}var _n={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tL(4,13),y:tL(5,14)};_n.translateX=_n.x;_n.translateY=_n.y;var An=new Set,ty=!1,ry=!1;function aL(){if(ry){let e=Array.from(An).filter(a=>a.needsMeasurement),t=new Set(e.map(a=>a.element)),r=new Map;t.forEach(a=>{let o=rL(a);o.length&&(r.set(a,o),a.render())}),e.forEach(a=>a.measureInitialState()),t.forEach(a=>{a.render();let o=r.get(a);o&&o.forEach(([n,s])=>{var i;(i=a.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(a=>a.measureEndState()),e.forEach(a=>{a.suspendedScrollY!==void 0&&window.scrollTo(0,a.suspendedScrollY)})}ry=!1,ty=!1,An.forEach(e=>e.complete()),An.clear()}function oL(){An.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ry=!0)})}function nL(){oL(),aL()}var Ro=class{constructor(t,r,a,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=a,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(An.add(this),ty||(ty=!0,te.read(oL),te.resolveKeyframes(aL))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:a,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(a&&r){let l=a.readValue(r,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),An.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,An.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Af=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var b1=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function L1(e){let t=b1.exec(e);if(!t)return[,];let[,r,a,o]=t;return[`--${r??a}`,o]}var I1=4;function ay(e,t,r=1){qt(r<=I1,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[a,o]=L1(e);if(!a)return;let n=window.getComputedStyle(t).getPropertyValue(a);if(n){let s=n.trim();return Af(s)?parseFloat(s):s}return ti(o)?ay(o,t,r+1):o}var Rf=e=>t=>t.test(e);var sL={test:e=>e==="auto",parse:e=>e};var oy=[Gr,H,Et,Kr,gb,hb,sL],ny=e=>oy.find(Rf(e));var wi=class extends Ro{constructor(t,r,a,o,n){super(t,r,a,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:a}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),ti(u))){let c=ay(u,r.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!hf.has(a)||t.length!==2)return;let[o,n]=t,s=ny(o),i=ny(n);if(s!==i)if(ey(s)&&ey(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,a=[];for(let o=0;o<t.length;o++)Hb(t[o])&&a.push(o);a.length&&Zb(t,a,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:a}=this;if(!t||!t.current)return;a==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_n[a](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let o=r[r.length-1];o!==void 0&&t.getValue(a,o).jump(o,!1)}measureEndState(){var t;let{element:r,name:a,unresolvedKeyframes:o}=this;if(!r||!r.current)return;let n=r.getValue(a);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=_n[a](r.measureViewportBox(),window.getComputedStyle(r.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{r.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var sy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Dt.test(e)||e==="0")&&!e.startsWith("url("));function k1(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function iL(e,t,r,a){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=sy(o,t),i=sy(n,t);return Ia(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:k1(e)||(r==="spring"||Io(r))&&a}var P1=e=>e!==null;function Eo(e,{repeat:t,repeatType:r="loop"},a){let o=e.filter(P1),n=t&&r!=="loop"&&t%2===1?0:o.length-1;return!n||a===void 0?o[n]:a}var T1=40,Si=class{constructor({autoplay:t=!0,delay:r=0,type:a="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Lt.now(),this.options={autoplay:t,delay:r,type:a,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>T1?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nL(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Lt.now(),this.hasAttemptedResolve=!0;let{name:a,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!iL(t,a,o,n))if(xf.current||!s){l&&l(Eo(t,this.options,r)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let c=this.initPlayback(t,r);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...c},this.onPostResolved())}onPostResolved(){}then(t,r){return this.currentFinishedPromise.then(t,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};var ie=(e,t,r)=>e+(t-e)*r;function iy(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function lL({hue:e,saturation:t,lightness:r,alpha:a}){e/=360,t/=100,r/=100;let o=0,n=0,s=0;if(!t)o=n=s=r;else{let i=r<.5?r*(1+t):r+t-r*t,l=2*r-i;o=iy(l,i,e+1/3),n=iy(l,i,e),s=iy(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:a}}function Ci(e,t){return r=>r>0?t:e}var ly=(e,t,r)=>{let a=e*e,o=r*(t*t-a)+a;return o<0?0:Math.sqrt(o)},_1=[wu,Xr,Ao],A1=e=>_1.find(t=>t.test(e));function uL(e){let t=A1(e);if(Ia(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===Ao&&(r=lL(r)),r}var uy=(e,t)=>{let r=uL(e),a=uL(t);if(!r||!a)return Ci(e,t);let o={...r};return n=>(o.red=ly(r.red,a.red,n),o.green=ly(r.green,a.green,n),o.blue=ly(r.blue,a.blue,n),o.alpha=ie(r.alpha,a.alpha,n),Xr.transform(o))};var R1=(e,t)=>r=>t(e(r)),Jr=(...e)=>e.reduce(R1);var Ef=new Set(["none","hidden"]);function cL(e,t){return Ef.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function E1(e,t){return r=>ie(e,t,r)}function Df(e){return typeof e=="number"?E1:typeof e=="string"?ti(e)?Ci:Je.test(e)?uy:M1:Array.isArray(e)?dL:typeof e=="object"?Je.test(e)?uy:D1:Ci}function dL(e,t){let r=[...e],a=r.length,o=e.map((n,s)=>Df(n)(n,t[s]));return n=>{for(let s=0;s<a;s++)r[s]=o[s](n);return r}}function D1(e,t){let r={...e,...t},a={};for(let o in r)e[o]!==void 0&&t[o]!==void 0&&(a[o]=Df(e[o])(e[o],t[o]));return o=>{for(let n in a)r[n]=a[n](o);return r}}function N1(e,t){var r;let a=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(r=e.values[i])!==null&&r!==void 0?r:0;a[n]=l,o[s]++}return a}var M1=(e,t)=>{let r=Dt.createTransformer(t),a=Tn(e),o=Tn(t);return a.indexes.var.length===o.indexes.var.length&&a.indexes.color.length===o.indexes.color.length&&a.indexes.number.length>=o.indexes.number.length?Ef.has(e)&&!o.values.length||Ef.has(t)&&!a.values.length?cL(e,t):Jr(dL(N1(a,o),o.values),r):(Ia(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Ci(e,t))};function Nf(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?ie(e,t,r):Df(e)(e,t)}var O1=5;function Mf(e,t,r){let a=Math.max(t-O1,0);return yf(r-e(a),t-a)}var _e={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};var cy=.001;function fL({duration:e=_e.duration,bounce:t=_e.bounce,velocity:r=_e.velocity,mass:a=_e.mass}){let o,n;Ia(e<=ze(_e.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ht(_e.minDamping,_e.maxDamping,s),e=ht(_e.minDuration,_e.maxDuration,mt(e)),s<1?(o=u=>{let c=u*s,d=c*e,f=c-r,m=Of(u,s),v=Math.exp(-d);return cy-f/m*v},n=u=>{let d=u*s*e,f=d*r+r,m=Math.pow(s,2)*Math.pow(u,2)*e,v=Math.exp(-d),x=Of(Math.pow(u,2),s);return(-o(u)+cy>0?-1:1)*((f-m)*v)/x}):(o=u=>{let c=Math.exp(-u*e),d=(u-r)*e+1;return-cy+c*d},n=u=>{let c=Math.exp(-u*e),d=(r-u)*(e*e);return c*d});let i=5/e,l=F1(o,n,i);if(e=ze(e),isNaN(l))return{stiffness:_e.stiffness,damping:_e.damping,duration:e};{let u=Math.pow(l,2)*a;return{stiffness:u,damping:s*2*Math.sqrt(a*u),duration:e}}}var B1=12;function F1(e,t,r){let a=r;for(let o=1;o<B1;o++)a=a-e(a)/t(a);return a}function Of(e,t){return e*Math.sqrt(1-t*t)}var U1=["duration","bounce"],V1=["stiffness","damping","mass"];function pL(e,t){return t.some(r=>e[r]!==void 0)}function j1(e){let t={velocity:_e.velocity,stiffness:_e.stiffness,damping:_e.damping,mass:_e.mass,isResolvedFromDuration:!1,...e};if(!pL(e,V1)&&pL(e,U1))if(e.visualDuration){let r=e.visualDuration,a=2*Math.PI/(r*1.2),o=a*a,n=2*ht(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:_e.mass,stiffness:o,damping:n}}else{let r=fL(e);t={...t,...r,mass:_e.mass},t.isResolvedFromDuration=!0}return t}function Bf(e=_e.visualDuration,t=_e.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:a,restDelta:o}=r,n=r.keyframes[0],s=r.keyframes[r.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:m}=j1({...r,velocity:-mt(r.velocity||0)}),v=f||0,x=u/(2*Math.sqrt(l*c)),b=s-n,g=mt(Math.sqrt(l/c)),h=Math.abs(b)<5;a||(a=h?_e.restSpeed.granular:_e.restSpeed.default),o||(o=h?_e.restDelta.granular:_e.restDelta.default);let y;if(x<1){let L=Of(g,x);y=P=>{let _=Math.exp(-x*g*P);return s-_*((v+x*g*b)/L*Math.sin(L*P)+b*Math.cos(L*P))}}else if(x===1)y=L=>s-Math.exp(-g*L)*(b+(v+g*b)*L);else{let L=g*Math.sqrt(x*x-1);y=P=>{let _=Math.exp(-x*g*P),A=Math.min(L*P,300);return s-_*((v+x*g*b)*Math.sinh(A)+L*b*Math.cosh(A))/L}}let w={calculatedDuration:m&&d||null,next:L=>{let P=y(L);if(m)i.done=L>=d;else{let _=0;x<1&&(_=L===0?ze(v):Mf(y,L,P));let A=Math.abs(_)<=a,F=Math.abs(s-P)<=o;i.done=A&&F}return i.value=i.done?s:P,i},toString:()=>{let L=Math.min(ci(w),2e4),P=gu(_=>w.next(L*_).value,L,30);return L+"ms "+P}};return w}function dy({keyframes:e,velocity:t=0,power:r=.8,timeConstant:a=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:c}){let d=e[0],f={done:!1,value:d},m=A=>i!==void 0&&A<i||l!==void 0&&A>l,v=A=>i===void 0?l:l===void 0||Math.abs(i-A)<Math.abs(l-A)?i:l,x=r*t,b=d+x,g=s===void 0?b:s(b);g!==b&&(x=g-d);let h=A=>-x*Math.exp(-A/a),y=A=>g+h(A),w=A=>{let F=h(A),V=y(A);f.done=Math.abs(F)<=u,f.value=f.done?g:V},L,P,_=A=>{m(f.value)&&(L=A,P=Bf({keyframes:[f.value,v(f.value)],velocity:Mf(y,A,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:A=>{let F=!1;return!P&&L===void 0&&(F=!0,w(A),_(A)),L!==void 0&&A>=L?P.next(A-L):(!F&&w(A),f)}}}var mL=To(.42,0,1,1),hL=To(0,0,.58,1),Ff=To(.42,0,.58,1);var gL=e=>Array.isArray(e)&&typeof e[0]!="number";var yL={linear:ve,easeIn:mL,easeInOut:Ff,easeOut:hL,circIn:Lf,circInOut:kf,circOut:If,backIn:xu,backInOut:Cf,backOut:Yg,anticipate:bf},fy=e=>{if(di(e)){qt(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,r,a,o]=e;return To(t,r,a,o)}else if(typeof e=="string")return qt(yL[e]!==void 0,`Invalid easing type '${e}'`),yL[e];return e};function q1(e,t,r){let a=[],o=r||Nf,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||ve:t;i=Jr(l,i)}a.push(i)}return a}function vL(e,t,{clamp:r=!0,ease:a,mixer:o}={}){let n=e.length;if(qt(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=q1(t,a,o),l=i.length,u=c=>{if(s&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);let f=or(e[d],e[d+1],c);return i[d](f)};return r?c=>u(ht(e[0],e[n-1],c)):u}function xL(e,t){let r=e[e.length-1];for(let a=1;a<=t;a++){let o=or(0,t,a);e.push(ie(r,1,o))}}function wL(e){let t=[0];return xL(t,e.length-1),t}function SL(e,t){return e.map(r=>r*t)}function $1(e,t){return e.map(()=>t||Ff).splice(0,e.length-1)}function Cu({duration:e=300,keyframes:t,times:r,ease:a="easeInOut"}){let o=gL(a)?a.map(fy):fy(a),n={done:!1,value:t[0]},s=SL(r&&r.length===t.length?r:wL(t),e),i=vL(s,t,{ease:Array.isArray(o)?o:$1(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var CL=e=>{let t=({timestamp:r})=>e(r);return{start:()=>te.update(t,!0),stop:()=>nr(t),now:()=>We.isProcessing?We.timestamp:Lt.now()}};var H1={decay:dy,inertia:dy,tween:Cu,keyframes:Cu,spring:Bf},z1=e=>e/100,Rn=class extends Si{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();let{onStop:l}=this.options;l&&l()};let{name:r,motionValue:a,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||Ro,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,r,a,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:r="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=Io(r)?r:H1[r]||Cu,l,u;i!==Cu&&typeof t[0]!="number"&&(l=Jr(z1,Nf(t[0],t[1])),t=[0,100]);let c=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=ci(c));let{calculatedDuration:d}=c,f=d+o,m=f*(a+1)-o;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:m}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,r=!1){let{resolved:a}=this;if(!a){let{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=a;if(this.startTime===null)return n.next(0);let{delay:f,repeat:m,repeatType:v,repeatDelay:x,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),r?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let g=this.currentTime-f*(this.speed>=0?1:-1),h=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let y=this.currentTime,w=n;if(m){let A=Math.min(this.currentTime,c)/d,F=Math.floor(A),V=A%1;!V&&A>=1&&(V=1),V===1&&F--,F=Math.min(F,m+1),F%2&&(v==="reverse"?(V=1-V,x&&(V-=x/d)):v==="mirror"&&(w=s)),y=ht(0,1,V)*d}let L=h?{done:!1,value:l[0]}:w.next(y);i&&(L.value=i(L.value));let{done:P}=L;!h&&u!==null&&(P=this.speed>=0?this.currentTime>=c:this.currentTime<=0);let _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return _&&o!==void 0&&(L.value=Eo(l,this.options,o)),b&&b(L.value),_&&this.finish(),L}get duration(){let{resolved:t}=this;return t?mt(t.calculatedDuration):0}get time(){return mt(this.currentTime)}set time(t){t=ze(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=mt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=CL,onPlay:r,startTime:a}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),r&&r();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=a??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}};var bL=new Set(["opacity","clipPath","filter","transform"]);function LL(e,t,r,{delay:a=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:r};l&&(u.offset=l);let c=pi(i,o);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:a,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var IL=Ln(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Uf=10,W1=2e4;function G1(e){return Io(e.type)||e.type==="spring"||!ff(e.ease)}function K1(e,t){let r=new Rn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),a={done:!1,value:e[0]},o=[],n=0;for(;!a.done&&n<W1;)a=r.sample(n),o.push(a.value),n+=Uf;return{times:void 0,keyframes:o,duration:n-Uf,ease:"linear"}}var kL={anticipate:bf,backInOut:Cf,circInOut:kf};function X1(e){return e in kL}var bu=class extends Si{constructor(t){super(t);let{name:r,motionValue:a,element:o,keyframes:n}=this.options;this.resolver=new wi(n,(s,i)=>this.onKeyframesResolved(s,i),r,a,o),this.resolver.scheduleResolve()}initPlayback(t,r){let{duration:a=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&ko()&&X1(n)&&(n=kL[n]),G1(this.options)){let{onComplete:d,onUpdate:f,motionValue:m,element:v,...x}=this.options,b=K1(t,x);t=b.keyframes,t.length===1&&(t[1]=t[0]),a=b.duration,o=b.times,n=b.ease,s="keyframes"}let c=LL(i.owner.current,l,t,{...this.options,duration:a,times:o,ease:n});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(hu(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:d}=this.options;i.set(Eo(t,this.options,r)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:a,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:r}=t;return mt(r)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:r}=t;return mt(r.currentTime||0)}set time(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.currentTime=ze(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:r}=t;return r.playbackRate}set speed(t){let{resolved:r}=this;if(!r)return;let{animation:a}=r;a.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:r}=t;return r.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:r}=t;return r.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:r}=this;if(!r)return ve;let{animation:a}=r;hu(a,t)}return ve}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:r,keyframes:a,duration:o,type:n,ease:s,times:i}=t;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:c,onComplete:d,element:f,...m}=this.options,v=new Rn({...m,keyframes:a,duration:o,type:n,ease:s,times:i,isGenerator:!0}),x=ze(this.time);u.setWithVelocity(v.sample(x-Uf).value,v.sample(x).value,Uf)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:r,name:a,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!r||!r.owner||!(r.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=r.owner.getProps();return IL()&&a&&bL.has(a)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var J1={type:"spring",stiffness:500,damping:25,restSpeed:10},Q1=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Y1={type:"keyframes",duration:.8},Z1={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PL=(e,{keyframes:t})=>t.length>2?Y1:Ht.has(e)?e.startsWith("scale")?Q1(t[1]):J1:Z1;function TL({when:e,delay:t,delayChildren:r,staggerChildren:a,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...c}){return!!Object.keys(c).length}var bi=(e,t,r,a={},o,n)=>s=>{let i=Lo(a,e)||{},l=i.delay||a.delay||0,{elapsed:u=0}=a;u=u-ze(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};TL(i)||(c={...c,...PL(e,c)}),c.duration&&(c.duration=ze(c.duration)),c.repeatDelay&&(c.repeatDelay=ze(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),(xf.current||Ks.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),d&&!n&&t.get()!==void 0){let f=Eo(c.keyframes,i);if(f!==void 0)return te.update(()=>{c.onUpdate(f),c.onComplete()}),new mu([])}return!n&&bu.supports(c)?new bu(c):new Rn(c)};function eD({protectedKeys:e,needsAnimating:t},r){let a=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,a}function Vf(e,t,{delay:r=0,transitionOverride:a,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;a&&(s=a);let u=[],c=o&&e.animationState&&e.animationState.getState()[o];for(let d in l){let f=e.getValue(d,(n=e.latestValues[d])!==null&&n!==void 0?n:null),m=l[d];if(m===void 0||c&&eD(c,d))continue;let v={delay:r,...Lo(s||{},d)},x=!1;if(window.MotionHandoffAnimation){let g=vf(e);if(g){let h=window.MotionHandoffAnimation(g,d,te);h!==null&&(v.startTime=h,x=!0)}}vu(e,d),f.start(bi(d,f,m,e.shouldReduceMotion&&hf.has(d)?{type:!1}:v,e,x));let b=f.animation;b&&u.push(b)}return i&&Promise.all(u).then(()=>{te.update(()=>{i&&yu(e,i)})}),u}function jf(e,t,r={}){var a;let o=bo(e,t,r.type==="exit"?(a=e.presenceContext)===null||a===void 0?void 0:a.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(n=r.transitionOverride);let s=o?()=>Promise.all(Vf(e,o,r)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=n;return tD(e,t,c+u,d,f,r)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,c]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>c())}else return Promise.all([s(),i(r.delay)])}function tD(e,t,r=0,a=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*a,l=o===1?(u=0)=>u*a:(u=0)=>i-u*a;return Array.from(e.variantChildren).sort(rD).forEach((u,c)=>{u.notify("AnimationStart",t),s.push(jf(u,t,{...n,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function rD(e,t){return e.sortNodePosition(t)}function qf(e,t,r={}){e.notify("AnimationStart",t);let a;if(Array.isArray(t)){let o=t.map(n=>jf(e,n,r));a=Promise.all(o)}else if(typeof t=="string")a=jf(e,t,r);else{let o=typeof t=="function"?bo(e,t,r.custom):t;a=Promise.all(Vf(e,o,r))}return a.then(()=>{e.notify("AnimationComplete",t)})}var aD=uu.length;function py(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?py(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<aD;r++){let a=uu[r],o=e.props[a];(Pa(o)||o===!1)&&(t[a]=o)}return t}var oD=[...Xd].reverse(),nD=Xd.length;function sD(e){return t=>Promise.all(t.map(({animation:r,options:a})=>qf(e,r,a)))}function AL(e){let t=sD(e),r=_L(),a=!0,o=l=>(u,c)=>{var d;let f=bo(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){let{transition:m,transitionEnd:v,...x}=f;u={...u,...x,...v}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,c=py(e.parent)||{},d=[],f=new Set,m={},v=1/0;for(let b=0;b<nD;b++){let g=oD[b],h=r[g],y=u[g]!==void 0?u[g]:c[g],w=Pa(y),L=g===l?h.isActive:null;L===!1&&(v=b);let P=y===c[g]&&y!==u[g]&&w;if(P&&a&&e.manuallyAnimateOnMount&&(P=!1),h.protectedKeys={...m},!h.isActive&&L===null||!y&&!h.prevProp||Co(y)||typeof y=="boolean")continue;let _=iD(h.prevProp,y),A=_||g===l&&h.isActive&&!P&&w||b>v&&w,F=!1,V=Array.isArray(y)?y:[y],me=V.reduce(o(g),{});L===!1&&(me={});let{prevResolvedValues:ce={}}=h,we={...ce,...me},ea=Re=>{A=!0,f.has(Re)&&(F=!0,f.delete(Re)),h.needsAnimating[Re]=!0;let De=e.getValue(Re);De&&(De.liveStyle=!1)};for(let Re in we){let De=me[Re],de=ce[Re];if(m.hasOwnProperty(Re))continue;let Oa=!1;cu(De)&&cu(de)?Oa=!qg(De,de):Oa=De!==de,Oa?De!=null?ea(Re):f.add(Re):De!==void 0&&f.has(Re)?ea(Re):h.protectedKeys[Re]=!0}h.prevProp=y,h.prevResolvedValues=me,h.isActive&&(m={...m,...me}),a&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&_)||F)&&d.push(...V.map(Re=>({animation:Re,options:{type:g}})))}if(f.size){let b={};f.forEach(g=>{let h=e.getBaseTarget(g),y=e.getValue(g);y&&(y.liveStyle=!0),b[g]=h??null}),d.push({animation:b})}let x=!!d.length;return a&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(x=!1),a=!1,x?t(d):Promise.resolve()}function i(l,u){var c;if(r[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),r[l].isActive=u;let d=s(l);for(let f in r)r[f].protectedKeys={};return d}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>r,reset:()=>{r=_L(),a=!0}}}function iD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!qg(t,e):!1}function En(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _L(){return{animate:En(!0),whileInView:En(),whileHover:En(),whileTap:En(),whileDrag:En(),whileFocus:En(),exit:En()}}var ut=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var $f=class extends ut{constructor(t){super(t),t.animationState||(t.animationState=AL(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Co(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}};var lD=0,Hf=class extends ut{constructor(){super(...arguments),this.id=lD++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:a}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===a)return;let o=this.node.animationState.setActive("exit",!t);r&&!t&&o.then(()=>r(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var RL={animation:{Feature:$f},exit:{Feature:Hf}};function Ra(e,t,r,a={passive:!0}){return e.addEventListener(t,r,a),()=>e.removeEventListener(t,r)}function Ea(e){return{point:{x:e.pageX,y:e.pageY}}}var EL=e=>t=>kn(t)&&e(t,Ea(t));function Do(e,t,r,a){return Ra(e,t,EL(r),a)}var DL=(e,t)=>Math.abs(e-t);function NL(e,t){let r=DL(e.x,t.x),a=DL(e.y,t.y);return Math.sqrt(r**2+a**2)}var Li=class{constructor(t,r,{transformPagePoint:a,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let d=hy(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=NL(d.offset,{x:0,y:0})>=3;if(!f&&!m)return;let{point:v}=d,{timestamp:x}=We;this.history.push({...v,timestamp:x});let{onStart:b,onMove:g}=this.handlers;f||(b&&b(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=my(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();let{onEnd:m,onSessionEnd:v,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let b=hy(d.type==="pointercancel"?this.lastMoveEventInfo:my(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,b),v&&v(d,b)},!kn(t))return;this.dragSnapToOrigin=n,this.handlers=r,this.transformPagePoint=a,this.contextWindow=o||window;let s=Ea(t),i=my(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=We;this.history=[{...l,timestamp:u}];let{onSessionStart:c}=r;c&&c(t,hy(i,this.history)),this.removeListeners=Jr(Do(this.contextWindow,"pointermove",this.handlePointerMove),Do(this.contextWindow,"pointerup",this.handlePointerUp),Do(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),nr(this.updatePoint)}};function my(e,t){return t?{point:t(e.point)}:e}function ML(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hy({point:e},t){return{point:e,delta:ML(e,OL(t)),offset:ML(e,uD(t)),velocity:cD(t,.1)}}function uD(e){return e[0]}function OL(e){return e[e.length-1]}function cD(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,a=null,o=OL(e);for(;r>=0&&(a=e[r],!(o.timestamp-a.timestamp>ze(t)));)r--;if(!a)return{x:0,y:0};let n=mt(o.timestamp-a.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-a.x)/n,y:(o.y-a.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var VL=1e-4,dD=1-VL,fD=1+VL,jL=.01,pD=0-jL,mD=0+jL;function gt(e){return e.max-e.min}function qL(e,t,r){return Math.abs(e-t)<=r}function BL(e,t,r,a=.5){e.origin=a,e.originPoint=ie(t.min,t.max,e.origin),e.scale=gt(r)/gt(t),e.translate=ie(r.min,r.max,e.origin)-e.originPoint,(e.scale>=dD&&e.scale<=fD||isNaN(e.scale))&&(e.scale=1),(e.translate>=pD&&e.translate<=mD||isNaN(e.translate))&&(e.translate=0)}function Ii(e,t,r,a){BL(e.x,t.x,r.x,a?a.originX:void 0),BL(e.y,t.y,r.y,a?a.originY:void 0)}function FL(e,t,r){e.min=r.min+t.min,e.max=e.min+gt(t)}function $L(e,t,r){FL(e.x,t.x,r.x),FL(e.y,t.y,r.y)}function UL(e,t,r){e.min=t.min-r.min,e.max=e.min+gt(t)}function ki(e,t,r){UL(e.x,t.x,r.x),UL(e.y,t.y,r.y)}function KL(e,{min:t,max:r},a){return t!==void 0&&e<t?e=a?ie(t,e,a.min):Math.max(e,t):r!==void 0&&e>r&&(e=a?ie(r,e,a.max):Math.min(e,r)),e}function HL(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function XL(e,{top:t,left:r,bottom:a,right:o}){return{x:HL(e.x,r,o),y:HL(e.y,t,a)}}function zL(e,t){let r=t.min-e.min,a=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,a]=[a,r]),{min:r,max:a}}function JL(e,t){return{x:zL(e.x,t.x),y:zL(e.y,t.y)}}function QL(e,t){let r=.5,a=gt(e),o=gt(t);return o>a?r=or(t.min,t.max-a,e.min):a>o&&(r=or(e.min,e.max-o,t.min)),ht(0,1,r)}function YL(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var zf=.35;function ZL(e=zf){return e===!1?e=0:e===!0&&(e=zf),{x:WL(e,"left","right"),y:WL(e,"top","bottom")}}function WL(e,t,r){return{min:GL(e,t),max:GL(e,r)}}function GL(e,t){return typeof e=="number"?e:e[t]||0}var eI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Dn=()=>({x:eI(),y:eI()}),tI=()=>({min:0,max:0}),Ae=()=>({x:tI(),y:tI()});function zt(e){return[e("x"),e("y")]}function Wf({top:e,left:t,right:r,bottom:a}){return{x:{min:t,max:r},y:{min:e,max:a}}}function rI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function aI(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),a=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:a.y,right:a.x}}function gy(e){return e===void 0||e===1}function Gf({scale:e,scaleX:t,scaleY:r}){return!gy(e)||!gy(t)||!gy(r)}function Da(e){return Gf(e)||yy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yy(e){return oI(e.x)||oI(e.y)}function oI(e){return e&&e!=="0%"}function Lu(e,t,r){let a=e-r,o=t*a;return r+o}function nI(e,t,r,a,o){return o!==void 0&&(e=Lu(e,o,a)),Lu(e,r,a)+t}function vy(e,t=0,r=1,a,o){e.min=nI(e.min,t,r,a,o),e.max=nI(e.max,t,r,a,o)}function xy(e,{x:t,y:r}){vy(e.x,t.translate,t.scale,t.originPoint),vy(e.y,r.translate,r.scale,r.originPoint)}var sI=.999999999999,iI=1.0000000000001;function uI(e,t,r,a=!1){let o=r.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=r[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(a&&n.options.layoutScroll&&n.scroll&&n!==n.root&&Nn(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,xy(e,s)),a&&Da(n.latestValues)&&Nn(e,n.latestValues))}t.x<iI&&t.x>sI&&(t.x=1),t.y<iI&&t.y>sI&&(t.y=1)}function No(e,t){e.min=e.min+t,e.max=e.max+t}function lI(e,t,r,a,o=.5){let n=ie(e.min,e.max,o);vy(e,t,r,n,a)}function Nn(e,t){lI(e.x,t.x,t.scaleX,t.scale,t.originX),lI(e.y,t.y,t.scaleY,t.scale,t.originY)}function wy(e,t){return Wf(aI(e.getBoundingClientRect(),t))}function cI(e,t,r){let a=wy(e,r),{scroll:o}=t;return o&&(No(a.x,o.offset.x),No(a.y,o.offset.y)),a}var Kf=({current:e})=>e?e.ownerDocument.defaultView:null;var hD=new WeakMap,Jf=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ae(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){let{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;let o=c=>{let{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Ea(c).point)},n=(c,d)=>{let{drag:f,dragPropagation:m,onDragStart:v}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Jg(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),zt(b=>{let g=this.getAxisMotionValue(b).get()||0;if(Et.test(g)){let{projection:h}=this.visualElement;if(h&&h.layout){let y=h.layout.layoutBox[b];y&&(g=gt(y)*(parseFloat(g)/100))}}this.originPoint[b]=g}),v&&te.postRender(()=>v(c,d)),vu(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},s=(c,d)=>{let{dragPropagation:f,dragDirectionLock:m,onDirectionLock:v,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:b}=d;if(m&&this.currentDirection===null){this.currentDirection=gD(b),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,b),this.updateAxis("y",d.point,b),this.visualElement.render(),x&&x(c,d)},i=(c,d)=>this.stop(c,d),l=()=>zt(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Li(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Kf(this.visualElement)})}stop(t,r){let a=this.isDragging;if(this.cancel(),!a)return;let{velocity:o}=r;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&te.postRender(()=>n(t,r))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:a}=this.getProps();!a&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,a){let{drag:o}=this.getProps();if(!a||!Xf(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+a[t];this.constraints&&this.constraints[t]&&(s=KL(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:r,dragElastic:a}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;r&&Ta(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=XL(o.layoutBox,r):this.constraints=!1,this.elastic=ZL(a),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&zt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=YL(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Ta(t))return!1;let a=t.current;qt(a!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=cI(a,o.root,this.visualElement.getTransformPagePoint()),s=JL(o.layout.layoutBox,n);if(r){let i=r(rI(s));this.hasMutatedConstraints=!!i,i&&(s=Wf(i))}return s}startAnimation(t){let{drag:r,dragMomentum:a,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=zt(c=>{if(!Xf(c,r,this.currentDirection))return;let d=l&&l[c]||{};s&&(d={min:0,max:0});let f=o?200:1e6,m=o?40:1e7,v={type:"inertia",velocity:a?t[c]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...n,...d};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(i)}startAxisValueAnimation(t,r){let a=this.getAxisMotionValue(t);return vu(this.visualElement,t),a.start(bi(t,a,0,r,this.visualElement,!1))}stopAnimation(){zt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){zt(t=>{var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(t){let r=`_drag${t.toUpperCase()}`,a=this.visualElement.getProps(),o=a[r];return o||this.visualElement.getValue(t,(a.initial?a.initial[t]:void 0)||0)}snapToCursor(t){zt(r=>{let{drag:a}=this.getProps();if(!Xf(r,a,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(r);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[r];n.set(t[r]-ie(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:a}=this.visualElement;if(!Ta(r)||!a||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};zt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=QL({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",a.root&&a.root.updateScroll(),a.updateLayout(),this.resolveConstraints(),zt(s=>{if(!Xf(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(ie(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;hD.set(this.visualElement,this);let t=this.visualElement.current,r=Do(t,"pointerdown",l=>{let{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),a=()=>{let{dragConstraints:l}=this.getProps();Ta(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),te.read(a);let s=Ra(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(zt(c=>{let d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())}));return()=>{s(),r(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:a=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=zf,dragMomentum:i=!0}=t;return{...t,drag:r,dragDirectionLock:a,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function Xf(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function gD(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var Qf=class extends ut{constructor(t){super(t),this.removeGroupControls=ve,this.removeListeners=ve,this.controls=new Jf(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ve}unmount(){this.removeGroupControls(),this.removeListeners()}};var dI=e=>(t,r)=>{e&&te.postRender(()=>e(t,r))},Yf=class extends ut{constructor(){super(...arguments),this.removePointerDownListener=ve}onPointerDown(t){this.session=new Li(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Kf(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:a,onPanEnd:o}=this.node.getProps();return{onSessionStart:dI(t),onStart:dI(r),onMove:a,onEnd:(n,s)=>{delete this.session,o&&te.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=Do(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var mI=M(le(),1),Iu=M(K(),1);var Pi={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function fI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ti={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let r=fI(e,t.target.x),a=fI(e,t.target.y);return`${r}% ${a}%`}};var pI={correct:(e,{treeScale:t,projectionDelta:r})=>{let a=e,o=Dt.parse(e);if(o.length>5)return a;let n=Dt.createTransformer(e),s=typeof o[0]!="number"?1:0,i=r.x.scale*t.x,l=r.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=ie(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var Sy=class extends Iu.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a,layoutId:o}=this.props,{projection:n}=t;bb(yD),n&&(r.group&&r.group.add(n),a&&a.register&&o&&a.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),Pi.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:a,drag:o,isPresent:n}=this.props,s=a.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==r||r===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||te.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Js.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:a}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(o),a&&a.deregister&&a.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function Zf(e){let[t,r]=qd(),a=(0,Iu.useContext)(Hs);return(0,mI.jsx)(Sy,{...e,layoutGroup:a,switchLayoutGroup:(0,Iu.useContext)(Zd),isPresent:t,safeToRemove:r})}var yD={borderRadius:{...Ti,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ti,borderTopRightRadius:Ti,borderBottomLeftRadius:Ti,borderBottomRightRadius:Ti,boxShadow:pI};function hI(e,t,r){let a=Le(e)?e:Aa(e);return a.start(bi("",a,t,r)),a.animation}function gI(e){return e instanceof SVGElement&&e.tagName!=="svg"}var yI=(e,t)=>e.depth-t.depth;var ep=class{constructor(){this.children=[],this.isDirty=!1}add(t){hi(this.children,t),this.isDirty=!0}remove(t){gi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(yI),this.isDirty=!1,this.children.forEach(t)}};function vI(e,t){let r=Lt.now(),a=({timestamp:o})=>{let n=o-r;n>=t&&(nr(a),e(n-t))};return te.read(a,!0),()=>nr(a)}var CI=["TopLeft","TopRight","BottomLeft","BottomRight"],vD=CI.length,xI=e=>typeof e=="string"?parseFloat(e):e,wI=e=>typeof e=="number"||H.test(e);function bI(e,t,r,a,o,n){o?(e.opacity=ie(0,r.opacity!==void 0?r.opacity:1,xD(a)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,wD(a))):n&&(e.opacity=ie(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,a));for(let s=0;s<vD;s++){let i=`border${CI[s]}Radius`,l=SI(t,i),u=SI(r,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||wI(l)===wI(u)?(e[i]=Math.max(ie(xI(l),xI(u),a),0),(Et.test(u)||Et.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||r.rotate)&&(e.rotate=ie(t.rotate||0,r.rotate||0,a))}function SI(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var xD=LI(0,.5,If),wD=LI(.5,.95,ve);function LI(e,t,r){return a=>a<e?0:a>t?1:r(or(e,t,a))}function II(e,t){e.min=t.min,e.max=t.max}function ir(e,t){II(e.x,t.x),II(e.y,t.y)}function Cy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function kI(e,t,r,a,o){return e-=t,e=Lu(e,1/r,a),o!==void 0&&(e=Lu(e,1/o,a)),e}function SD(e,t=0,r=1,a=.5,o,n=e,s=e){if(Et.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=ie(n.min,n.max,a);e===n&&(i-=t),e.min=kI(e.min,t,r,i,o),e.max=kI(e.max,t,r,i,o)}function PI(e,t,[r,a,o],n,s){SD(e,t[r],t[a],t[o],t.scale,n,s)}var CD=["x","scaleX","originX"],bD=["y","scaleY","originY"];function by(e,t,r,a){PI(e.x,t,CD,r?r.x:void 0,a?a.x:void 0),PI(e.y,t,bD,r?r.y:void 0,a?a.y:void 0)}function TI(e){return e.translate===0&&e.scale===1}function Ly(e){return TI(e.x)&&TI(e.y)}function _I(e,t){return e.min===t.min&&e.max===t.max}function RI(e,t){return _I(e.x,t.x)&&_I(e.y,t.y)}function AI(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Iy(e,t){return AI(e.x,t.x)&&AI(e.y,t.y)}function ky(e){return gt(e.x)/gt(e.y)}function Py(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var tp=class{constructor(){this.members=[]}add(t){hi(this.members,t),t.scheduleRender()}remove(t){if(gi(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){let r=this.members.findIndex(o=>t===o);if(r===0)return!1;let a;for(let o=r;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){a=n;break}}return a?(this.promote(a),!0):!1}promote(t,r){let a=this.lead;if(t!==a&&(this.prevLead=a,this.lead=t,t.show(),a)){a.instance&&a.scheduleRender(),t.scheduleRender(),t.resumeFrom=a,r&&(t.resumeFrom.preserveOpacity=!0),a.snapshot&&(t.snapshot=a.snapshot,t.snapshot.latestValues=a.animationValues||a.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&a.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:r,resumingFrom:a}=t;r.onExitComplete&&r.onExitComplete(),a&&a.options.onExitComplete&&a.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function EI(e,t,r){let a="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=r?.z||0;if((o||n||s)&&(a=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(a+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:m,skewY:v}=r;u&&(a=`perspective(${u}px) ${a}`),c&&(a+=`rotate(${c}deg) `),d&&(a+=`rotateX(${d}deg) `),f&&(a+=`rotateY(${f}deg) `),m&&(a+=`skewX(${m}deg) `),v&&(a+=`skewY(${v}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(a+=`scale(${i}, ${l})`),a||"none"}var Mn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ku=typeof window<"u"&&window.MotionDebug!==void 0,Ty=["","X","Y","Z"],LD={visibility:"hidden"},DI=1e3,ID=0;function _y(e,t,r,a){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),a&&(a[e]=0))}function jI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=vf(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",te,!(o||n))}let{parent:a}=e;a&&!a.hasCheckedOptimisedAppear&&jI(a)}function rp({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:a,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=ID++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ku&&(Mn.totalNodes=Mn.resolvedTargetDeltas=Mn.recalculatedProjection=0),this.nodes.forEach(TD),this.nodes.forEach(DD),this.nodes.forEach(ND),this.nodes.forEach(_D),ku&&window.MotionDebug.record(Mn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new ep)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Po),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=gI(s),this.instance=s;let{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let d,f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=vI(f,250),Pi.hasAnimatedSinceResize&&(Pi.hasAnimatedSinceResize=!1,this.nodes.forEach(MI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let x=this.options.transition||c.getDefaultTransition()||UD,{onLayoutAnimationStart:b,onLayoutAnimationComplete:g}=c.getProps(),h=!this.targetLayout||!Iy(this.targetLayout,v)||m,y=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||f&&(h||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,y);let w={...Lo(x,"layout"),onPlay:b,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||MI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,nr(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(MD),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){let d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(NI);return}this.isUpdating||this.nodes.forEach(RD),this.isUpdating=!1,this.nodes.forEach(ED),this.nodes.forEach(kD),this.nodes.forEach(PD),this.clearAllSnapshots();let i=Lt.now();We.delta=ht(0,1e3/60,i-We.timestamp),We.timestamp=i,We.isProcessing=!0,Gd.update.process(We),Gd.preRender.process(We),Gd.render.process(We),We.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Js.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(AD),this.sharedNodes.forEach(OD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ae(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=a(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!Ly(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;s&&(i||Da(this.latestValues)||c)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),VD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Ae();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(jD))){let{scroll:c}=this.root;c&&(No(l.x,c.offset.x),No(l.y,c.offset.y))}return l}removeElementScroll(s){var i;let l=Ae();if(ir(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let c=this.path[u],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&ir(l,s),No(l.x,d.offset.x),No(l.y,d.offset.y))}return l}applyTransform(s,i=!1){let l=Ae();ir(l,s);for(let u=0;u<this.path.length;u++){let c=this.path[u];!i&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Nn(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Da(c.latestValues)&&Nn(l,c.latestValues)}return Da(this.latestValues)&&Nn(l,this.latestValues),l}removeTransform(s){let i=Ae();ir(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Da(u.latestValues))continue;Gf(u.latestValues)&&u.updateSnapshot();let c=Ae(),d=u.measurePageBox();ir(c,d),by(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Da(this.latestValues)&&by(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==We.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=We.timestamp,!this.targetDelta&&!this.relativeTarget){let m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),ki(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ae(),this.targetWithTransforms=Ae()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),$L(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ir(this.target,this.layout.layoutBox),xy(this.target,this.targetDelta)):ir(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ae(),this.relativeTargetOrigin=Ae(),ki(this.relativeTargetOrigin,this.target,m.target),ir(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ku&&Mn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Gf(this.parent.latestValues)||yy(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===We.timestamp&&(u=!1),u)return;let{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;ir(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;uI(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Ae());let{target:v}=i;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cy(this.prevProjectionDelta.x,this.projectionDelta.x),Cy(this.prevProjectionDelta.y,this.projectionDelta.y)),Ii(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Py(this.projectionDelta.x,this.prevProjectionDelta.x)||!Py(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),ku&&Mn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Dn(),this.projectionDelta=Dn(),this.projectionDeltaWithTransform=Dn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Dn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Ae(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,x=m!==v,b=this.getStack(),g=!b||b.members.length<=1,h=!!(x&&!g&&this.options.crossfade===!0&&!this.path.some(FD));this.animationProgress=0;let y;this.mixTargetDelta=w=>{let L=w/1e3;OI(d.x,s.x,L),OI(d.y,s.y,L),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ki(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),BD(this.relativeTarget,this.relativeTargetOrigin,f,L),y&&RI(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Ae()),ir(y,this.relativeTarget)),x&&(this.animationValues=c,bI(c,u,this.latestValues,L,h,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(nr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{Pi.hasAnimatedSinceResize=!0,this.currentAnimation=hI(0,DI,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.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);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(DI),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:c}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&qI(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ae();let d=gt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+d;let f=gt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}ir(i,l),Nn(i,c),Ii(this.projectionDeltaWithTransform,this.layoutCorrected,i,c)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new tp),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&_y("z",s,u,this.animationValues);for(let c=0;c<Ty.length;c++)_y(`rotate${Ty[c]}`,s,u,this.animationValues),_y(`skew${Ty[c]}`,s,u,this.animationValues);s.render();for(let c in u)s.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return LD;let u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=ei(s?.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;let d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){let x={};return this.options.layoutId&&(x.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,x.pointerEvents=ei(s?.pointerEvents)||""),this.hasProjected&&!Da(this.latestValues)&&(x.transform=c?c({},""):"none",this.hasProjected=!1),x}let f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=EI(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));let{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(i=f.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let x in ii){if(f[x]===void 0)continue;let{correct:b,applyTo:g}=ii[x],h=u.transform==="none"?f[x]:b(f[x],d);if(g){let y=g.length;for(let w=0;w<y;w++)u[g[w]]=h}else u[x]=h}return this.options.layoutId&&(u.pointerEvents=d===this?ei(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(NI),this.root.sharedNodes.clear()}}}function kD(e){e.updateLayout()}function PD(e){var t;let r=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){let{layoutBox:a,measuredBox:o}=e.layout,{animationType:n}=e.options,s=r.source!==e.layout.source;n==="size"?zt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],m=gt(f);f.min=a[d].min,f.max=f.min+m}):qI(n,r.layoutBox,a)&&zt(d=>{let f=s?r.measuredBox[d]:r.layoutBox[d],m=gt(a[d]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});let i=Dn();Ii(i,a,r.layoutBox);let l=Dn();s?Ii(l,e.applyTransform(o,!0),r.measuredBox):Ii(l,a,r.layoutBox);let u=!Ly(i),c=!1;if(!e.resumeFrom){let d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){let{snapshot:f,layout:m}=d;if(f&&m){let v=Ae();ki(v,r.layoutBox,f.layoutBox);let x=Ae();ki(x,a,m.layoutBox),Iy(v,x)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:a,snapshot:r,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){let{onExitComplete:a}=e.options;a&&a()}e.options.transition=void 0}function TD(e){ku&&Mn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function _D(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function AD(e){e.clearSnapshot()}function NI(e){e.clearMeasurements()}function RD(e){e.isLayoutDirty=!1}function ED(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function MI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function DD(e){e.resolveTargetDelta()}function ND(e){e.calcProjection()}function MD(e){e.resetSkewAndRotation()}function OD(e){e.removeLeadSnapshot()}function OI(e,t,r){e.translate=ie(t.translate,0,r),e.scale=ie(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function BI(e,t,r,a){e.min=ie(t.min,r.min,a),e.max=ie(t.max,r.max,a)}function BD(e,t,r,a){BI(e.x,t.x,r.x,a),BI(e.y,t.y,r.y,a)}function FD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var UD={duration:.45,ease:[.4,0,.1,1]},FI=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),UI=FI("applewebkit/")&&!FI("chrome/")?Math.round:ve;function VI(e){e.min=UI(e.min),e.max=UI(e.max)}function VD(e){VI(e.x),VI(e.y)}function qI(e,t,r){return e==="position"||e==="preserve-aspect"&&!qL(ky(t),ky(r),.2)}function jD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var $I=rp({attachResizeListener:(e,t)=>Ra(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var Ay={current:void 0},ap=rp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ay.current){let e=new $I({});e.mount(window),e.setOptions({layoutScroll:!0}),Ay.current=e}return Ay.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var HI={pan:{Feature:Yf},drag:{Feature:Qf,ProjectionNode:ap,MeasureLayout:Zf}};function zI(e,t,r){let{props:a}=e;e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",r==="Start");let o="onHover"+r,n=a[o];n&&te.postRender(()=>n(t,Ea(t)))}var op=class extends ut{mount(){let{current:t}=this.node;t&&(this.unmount=Gg(t,r=>(zI(this.node,r,"Start"),a=>zI(this.node,a,"End"))))}unmount(){}};var np=class extends ut{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Jr(Ra(this.node.current,"focus",()=>this.onFocus()),Ra(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function WI(e,t,r){let{props:a}=e;e.animationState&&a.whileTap&&e.animationState.setActive("whileTap",r==="Start");let o="onTap"+(r==="End"?"":r),n=a[o];n&&te.postRender(()=>n(t,Ea(t)))}var sp=class extends ut{mount(){let{current:t}=this.node;t&&(this.unmount=Xg(t,r=>(WI(this.node,r,"Start"),(a,{success:o})=>WI(this.node,a,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Ey=new WeakMap,Ry=new WeakMap,qD=e=>{let t=Ey.get(e.target);t&&t(e)},$D=e=>{e.forEach(qD)};function HD({root:e,...t}){let r=e||document;Ry.has(r)||Ry.set(r,{});let a=Ry.get(r),o=JSON.stringify(t);return a[o]||(a[o]=new IntersectionObserver($D,{root:e,...t})),a[o]}function GI(e,t,r){let a=HD(t);return Ey.set(e,r),a.observe(e),()=>{Ey.delete(e),a.unobserve(e)}}var zD={some:0,all:1},ip=class extends ut{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:r,margin:a,amount:o="some",once:n}=t,s={root:r?r.current:void 0,rootMargin:a,threshold:typeof o=="number"?o:zD[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return GI(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(WD(t,r))&&this.startObserver()}unmount(){}};function WD({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var KI={inView:{Feature:ip},tap:{Feature:sp},focus:{Feature:np},hover:{Feature:op}};var XI={layout:{ProjectionNode:ap,MeasureLayout:Zf}};var ek=M(K(),1);var Pu={current:null},lp={current:!1};function JI(){if(lp.current=!0,!!Ws)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Pu.current=e.matches;e.addListener(t),t()}else Pu.current=!1}var GD=[...oy,Je,Dt],QI=e=>GD.find(Rf(e));var Dy=new WeakMap;function YI(e,t,r){for(let a in t){let o=t[a],n=r[a];if(Le(o))e.addValue(a,o);else if(Le(n))e.addValue(a,Aa(o,{owner:e}));else if(n!==o)if(e.hasValue(a)){let s=e.getValue(a);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(a);e.addValue(a,Aa(s!==void 0?s:o,{owner:e}))}}for(let a in r)t[a]===void 0&&e.removeValue(a);return t}var ZI=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],up=class{scrapeMotionValuesFromProps(t,r,a){return{}}constructor({parent:t,props:r,presenceContext:a,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ro,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=()=>{let m=Lt.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,te.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:c}=s;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=r.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=r,this.presenceContext=a,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=In(r),this.isVariantNode=Jd(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:d,...f}=this.scrapeMotionValuesFromProps(r,{},this);for(let m in f){let v=f[m];l[m]!==void 0&&Le(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Dy.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,a)=>this.bindToMotionValue(a,r)),lp.current||JI(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Pu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Dy.delete(this.current),this.projection&&this.projection.unmount(),nr(this.notifyUpdate),nr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let a=Ht.has(t),o=r.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&te.preRender(this.notifyUpdate),a&&this.projection&&(this.projection.isTransformDirty=!0)}),n=r.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ka){let r=ka[t];if(!r)continue;let{isEnabled:a,Feature:o}=r;if(!this.features[t]&&o&&a(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ae()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let a=0;a<ZI.length;a++){let o=ZI[a];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=YI(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let a=this.values.get(t);r!==a&&(a&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let a=this.values.get(t);return a===void 0&&r!==void 0&&(a=Aa(r===null?void 0:r,{owner:this}),this.addValue(t,a)),a}readValue(t,r){var a;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(a=this.getBaseTargetFromProps(this.props,t))!==null&&a!==void 0?a:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Af(o)||Pf(o))?o=parseFloat(o):!QI(o)&&Dt.test(r)&&(o=_f(t,r)),this.setBaseTarget(t,Le(o)?o.get():o)),Le(o)?o.get():o}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var r;let{initial:a}=this.props,o;if(typeof a=="string"||typeof a=="object"){let s=Zs(this.props,a,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);s&&(o=s[t])}if(a&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Le(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Po),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}};var _i=class extends up{constructor(){super(...arguments),this.KeyframeResolver=wi}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:a}){delete r[t],delete a[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Le(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};function KD(e){return window.getComputedStyle(e)}var cp=class extends _i{constructor(){super(...arguments),this.type="html",this.renderInstance=nf}readValueFromInstance(t,r){if(Ht.has(r)){let a=xi(r);return a&&a.default||0}else{let a=KD(t),o=(rf(r)?a.getPropertyValue(r):a[r])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:r}){return wy(t,r)}build(t,r,a){ai(t,r,a.transformTemplate)}scrapeMotionValuesFromProps(t,r,a){return li(t,r,a)}};var dp=class extends _i{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ae}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Ht.has(r)){let a=xi(r);return a&&a.default||0}return r=sf.has(r)?r:Xs(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,a){return cf(t,r,a)}build(t,r,a){oi(t,r,this.isSVGTag,a.transformTemplate)}renderInstance(t,r,a,o){lf(t,r,a,o)}mount(t){this.isSVGTag=si(t.tagName),super.mount(t)}};var tk=(e,t)=>Ys(e)?new dp(t):new cp(t,{allowProjection:e!==ek.Fragment});var rk=Eb({...RL,...KI,...HI,...XI},tk);var Tu=YC(rk);function XD(e){e.values.forEach(t=>t.stop())}function Ny(e,t){[...t].reverse().forEach(a=>{let o=e.getVariant(a);o&&yu(e,o),e.variantChildren&&e.variantChildren.forEach(n=>{Ny(n,t)})})}function JD(e,t){if(Array.isArray(t))return Ny(e,t);if(typeof t=="string")return Ny(e,[t]);yu(e,t)}function ak(){let e=!1,t=new Set,r={subscribe(a){return t.add(a),()=>{t.delete(a)}},start(a,o){qt(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");let n=[];return t.forEach(s=>{n.push(qf(s,a,{transitionOverride:o}))}),Promise.all(n)},set(a){return qt(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),t.forEach(o=>{JD(o,a)})},stop(){t.forEach(a=>{XD(a)})},mount(){return e=!0,()=>{e=!1,r.stop()}}};return r}function My(){let e=vo(ak);return Gs(e.mount,[]),e}var $e=M(le(),1);function ok({phase:e,progressSteps:t=[]}){return(0,$e.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,$e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$e.jsx)(Rt,{className:"h-3.5 w-3.5 animate-spin"}),(0,$e.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,$e.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,$e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$e.jsx)(Cn,{className:"h-3.5 w-3.5 opacity-70"}),(0,$e.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,$e.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,$e.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,$e.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,$e.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,$e.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((r,a)=>(0,$e.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${r.completed?"opacity-60":"opacity-100"}`,children:[r.completed?(0,$e.jsx)(lt,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,$e.jsx)(Rt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,$e.jsx)("span",{className:r.completed?"line-through":"",children:r.message})]},a)),e==="responding"&&(0,$e.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,$e.jsx)(Rt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,$e.jsx)("span",{children:"Preparing response..."})]})]})]})}var nk=M(K(),1);var Mr=M(le(),1);function sk({title:e,links:t}){let[r,a]=nk.useState(!1);return(0,Mr.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Mr.jsx)("button",{type:"button",onClick:()=>a(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":r,children:(0,Mr.jsxs)("div",{className:"flex items-center gap-1.5",children:[r?(0,Mr.jsx)(eu,{className:"h-3 w-3 opacity-70"}):(0,Mr.jsx)(Cn,{className:"h-3 w-3 opacity-70"}),(0,Mr.jsx)("span",{children:e})]})}),r&&t.length>0&&(0,Mr.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Mr.jsx)("li",{children:(0,Mr.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var _u=M(le(),1);function ik({x:e,y:t,visible:r,onClick:a=!1}){return(0,_u.jsx)(Bg,{children:r&&(0,_u.jsx)(Tu.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,_u.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,_u.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var Ai=M(K(),1);function lk(){let[e,t]=Ai.useState({x:0,y:0,visible:!1,onClick:!1}),r=Ai.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),a=Ai.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=Ai.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:r,hide:a,show:o}}var Na=M(K(),1);function uk({productBackendUrl:e,sessionId:t,enabled:r=!0}){let[a,o]=Na.useState({status:"idle"}),n=Na.useRef(null),s=Na.useCallback(async()=>{if(!e||!r){console.log("[useUserAuth] Skipping auth - productBackendUrl:",e,"enabled:",r),o({status:"idle"});return}console.log("[useUserAuth] Starting auth request to product backend..."),console.log("[useUserAuth] Product backend URL:",e),console.log("[useUserAuth] Full request URL:",`${e}/users/me`),o({status:"loading"});try{let l=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(console.log("[useUserAuth] Response received - status:",l.status,"ok:",l.ok),!l.ok)throw console.log("[useUserAuth] Auth request failed with status:",l.status),l.status===401?new Error("Please log in to use the chat assistant."):l.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${l.status})`);let u=await l.json();console.log("[useUserAuth] Auth SUCCESS - parsed user data:"),console.log("[useUserAuth] id:",u.id),console.log("[useUserAuth] email:",u.email),console.log("[useUserAuth] name:",u.name),console.log("[useUserAuth] role:",u.role),console.log("[useUserAuth] isInternal:",u.isInternal),console.log("[useUserAuth] agreementsSigned:",u.agreementsSigned),console.log("[useUserAuth] lastLoginTime:",u.lastLoginTime),o({status:"authenticated",user:u})}catch(l){console.log("[useUserAuth] Auth ERROR:",l);let u=l instanceof Error?l.message:"Unable to verify your identity. Please try again.";o({status:"error",error:u})}},[e,r]);Na.useEffect(()=>{t!==n.current&&(n.current=t,s())},[t,s]);let i=Na.useCallback(()=>{s()},[s]);return{authState:a,retry:i}}var fp=M(K(),1);function ck({agentUrl:e,orgId:t}){let[r,a]=fp.useState({status:"idle",config:null,error:null});return fp.useEffect(()=>{if(!e||!t){console.log("[useOrgConfig] Skipping - missing agentUrl or orgId",{agentUrl:e,orgId:t});return}(async()=>{a({status:"loading",config:null,error:null});let n=`${e}/org/${t}/config`;console.log("[useOrgConfig] Fetching org config from:",n);try{let s=await fetch(n,{method:"GET",headers:{Accept:"application/json"}});if(!s.ok)throw new Error(`Failed to fetch org config (${s.status})`);let i=await s.json();console.log("[useOrgConfig] Received config:",i),a({status:"success",config:i,error:null})}catch(s){let i=s instanceof Error?s.message:"Failed to fetch org config";console.error("[useOrgConfig] Error:",i),a({status:"error",config:null,error:i})}})()},[e,t]),r}var Oy=M(K(),1);function dk({productBackendUrl:e,agentUrl:t,sessionId:r}){let a=(0,Oy.useCallback)(async n=>{try{await fetch(`${t}/chat/tool-result`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(s){console.error("[FrontendToolExecutor] Failed to send tool result:",s)}},[t]);return{executeToolRequest:(0,Oy.useCallback)(async n=>{let{call_id:s,tool_name:i,arguments:l,endpoint:u,method:c,path_params:d}=n;console.log("[FrontendToolExecutor] Executing tool:",i,"with args:",l);try{let f=u;for(let h of d)l[h]&&(f=f.replace(`{${h}}`,encodeURIComponent(l[h])));let m=new URLSearchParams;for(let[h,y]of Object.entries(l))!d.includes(h)&&y!==void 0&&y!==null&&m.append(h,String(y));let v=m.toString(),x=`${e}${f}${v?"?"+v:""}`;console.log("[FrontendToolExecutor] Fetching:",x);let b=await fetch(x,{method:c,credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}}),g;if(b.ok)g=await b.json(),console.log("[FrontendToolExecutor] Tool result:",g);else{let h=await b.text();throw new Error(`HTTP ${b.status}: ${h}`)}await a({session_id:r,call_id:s,result:g})}catch(f){console.error("[FrontendToolExecutor] Tool execution failed:",f),await a({session_id:r,call_id:s,error:f instanceof Error?f.message:"Unknown error"})}},[e,r,a])}}var Ri=M(le(),1);function It({className:e,...t}){return(0,Ri.jsx)("div",{"data-slot":"card",className:rr("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Qr({className:e,...t}){return(0,Ri.jsx)("div",{"data-slot":"card-header",className:rr("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Yr({className:e,...t}){return(0,Ri.jsx)("div",{"data-slot":"card-title",className:rr("leading-none font-semibold",e),...t})}function By({className:e,...t}){return(0,Ri.jsx)("div",{"data-slot":"card-description",className:rr("text-muted-foreground text-sm",e),...t})}function kt({className:e,...t}){return(0,Ri.jsx)("div",{"data-slot":"card-content",className:rr("px-6",e),...t})}var C=M(le(),1),Fy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),pp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),Uy=e=>{switch(e){case"Enterprise":return xn;case"Professional":return nu;default:return Ql}},mp=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function Au({status:e,type:t="default"}){let a=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:lt};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:Nr};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:yn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:js};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Dr}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:lt};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Nr};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:Dr};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:yn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Dr}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:lt};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Nr};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Dr}}})(),o=a.icon;return(0,C.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${a.color}`,children:[(0,C.jsx)(o,{className:"h-3 w-3"}),e]})}function QD({subscription:e}){let t=Uy(e.plan);return(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,C.jsx)(Qr,{className:"pb-3",children:(0,C.jsxs)("div",{className:"flex items-start justify-between",children:[(0,C.jsxs)("div",{className:"space-y-1",children:[(0,C.jsxs)(Yr,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,C.jsx)(vn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,C.jsxs)(By,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,C.jsx)(Us,{className:"h-3 w-3"}),e.customer_email]})]}),(0,C.jsx)(Au,{status:e.status,type:"subscription"})]})}),(0,C.jsx)(kt,{className:"pt-0",children:(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,C.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${mp(e.plan)}`,children:[(0,C.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,C.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[pp(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,C.jsxs)("div",{className:"text-sm text-gray-700",children:[Fy(e.current_period_start)," - ",Fy(e.current_period_end)]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,C.jsx)("div",{className:"text-sm text-gray-700",children:Fy(e.created_at)})]})]})]})})]})}function YD({subscriptions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,C.jsx)(It,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(kt,{className:"py-8 text-center",children:[(0,C.jsx)(vn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Qr,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Yr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(vn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,C.jsxs)(kt,{className:"p-0",children:[(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>{let n=Uy(o.plan);return(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,C.jsx)("div",{className:`p-2 rounded-lg ${mp(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,C.jsx)(n,{className:"h-4 w-4"})}),(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,C.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",pp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,C.jsx)(Au,{status:o.status,type:"subscription"})]})},o.id)})}),a&&(0,C.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,C.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function ZD({customer:e}){let t=Uy(e.subscription);return(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,C.jsx)(Qr,{className:"pb-3",children:(0,C.jsxs)("div",{className:"flex items-start justify-between",children:[(0,C.jsx)("div",{className:"flex items-center gap-3",children:(0,C.jsxs)("div",{children:[(0,C.jsx)(Yr,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,C.jsxs)(By,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,C.jsx)(Us,{className:"h-3 w-3"}),e.email]})]})}),(0,C.jsx)(Au,{status:e.status,type:"customer"})]})}),(0,C.jsx)(kt,{className:"pt-0",children:(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,C.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${mp(e.subscription)}`,children:[(0,C.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,C.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,C.jsx)(wn,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,C.jsxs)("div",{className:"space-y-3",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,C.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,C.jsx)(Vs,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,C.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,C.jsx)(Zl,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function eN({customers:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,C.jsx)(It,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(kt,{className:"py-8 text-center",children:[(0,C.jsx)($s,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Qr,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Yr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)($s,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,C.jsxs)(kt,{className:"p-0",children:[(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,C.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${mp(o.subscription)}`,children:o.subscription}),(0,C.jsx)(Au,{status:o.status,type:"customer"})]})]})},o.id))}),a&&(0,C.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,C.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function fk({transactions:e,maxItems:t=5}){let r=e.slice(0,t),a=e.length>t;return e.length===0?(0,C.jsx)(It,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(kt,{className:"py-8 text-center",children:[(0,C.jsx)(wn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Qr,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Yr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(wn,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,C.jsxs)(kt,{className:"p-0",children:[(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:r.map(o=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,C.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,C.jsx)(lt,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,C.jsx)(Nr,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,C.jsx)(js,{className:"h-4 w-4 text-slate-600"}):(0,C.jsx)(yn,{className:"h-4 w-4 text-amber-600"})}),(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,C.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,C.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,C.jsx)(Au,{status:o.status,type:"transaction"})]})]})},o.id))}),a&&(0,C.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,C.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function tN({apiKeys:e}){return e.length===0?(0,C.jsx)(It,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(kt,{className:"py-8 text-center",children:[(0,C.jsx)(Fs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Qr,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Yr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(Fs,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,C.jsx)(kt,{className:"p-0",children:(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,C.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,C.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},r))})})]})}function rN({sessions:e}){let t=r=>{let a=r.toLowerCase();return a.includes("mobile")||a.includes("iphone")||a.includes("android")?au:tu};return e.length===0?(0,C.jsx)(It,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(kt,{className:"py-8 text-center",children:[(0,C.jsx)(qs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Qr,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Yr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(qs,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,C.jsx)(kt,{className:"p-0",children:(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((r,a)=>{let o=t(r.device);return(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3",children:[(0,C.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,C.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900",children:r.device}),(0,C.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,C.jsx)(Vs,{className:"h-3 w-3"}),r.location]})]})]}),(0,C.jsx)("div",{className:"text-xs text-gray-500",children:r.time})]})},a)})})})]})}function aN({stats:e}){return(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Qr,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Yr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(ou,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,C.jsx)(kt,{className:"p-4",children:(0,C.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,C.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,C.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:pp(e.revenue.total)}),e.revenue.change!==0&&(0,C.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,C.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,C.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,C.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,C.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,C.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,C.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,C.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,C.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,C.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,C.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function oN({customers:e}){return e.length===0?(0,C.jsx)(It,{className:"border-gray-200 shadow-sm bg-white",children:(0,C.jsxs)(kt,{className:"py-8 text-center",children:[(0,C.jsx)(xn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,C.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,C.jsxs)(It,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,C.jsx)(Qr,{className:"pb-2 border-b border-gray-100",children:(0,C.jsxs)(Yr,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,C.jsx)(xn,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,C.jsx)(kt,{className:"p-0",children:(0,C.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,r)=>(0,C.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,C.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${r===0?"bg-amber-100 text-amber-700":r===1?"bg-slate-100 text-slate-700":r===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:r+1}),(0,C.jsxs)("div",{className:"min-w-0",children:[(0,C.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,C.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,C.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?pp(t.revenue):t.revenue})]})},r))})})]})}function pk({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,C.jsx)(QD,{subscription:t});case"subscriptions":let r=t.subscriptions||t||[];return(0,C.jsx)(YD,{subscriptions:Array.isArray(r)?r:[r]});case"customer":return(0,C.jsx)(ZD,{customer:t.customer||t});case"customers":let a=t.customers||t||[];return(0,C.jsx)(eN,{customers:Array.isArray(a)?a:[a]});case"transactions":let o=t.transactions||t||[];return(0,C.jsx)(fk,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,C.jsx)(fk,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,C.jsx)(aN,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,C.jsx)(oN,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,C.jsx)(tN,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,C.jsx)(rN,{sessions:Array.isArray(i)?i:[i]});default:return null}}var On=M(le(),1);function mk({className:e=""}){return(0,On.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,On.jsxs)("div",{className:"flex items-center gap-1",children:[(0,On.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,On.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,On.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=M(le(),1),nN="0.2.49",sN="http://localhost:5002",hp=400,iN=600;function lN(e){return e.replace(/\\\\n/g,`
|
|
23
|
+
`),()=>{document.head.removeChild(d)}},[t]),(0,eL.jsx)(Fg,{isPresent:t,childRef:r,sizeRef:o,children:Xc.cloneElement(e,{ref:r})})}var rL=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=io(h_),l=(0,gn.useId)(),u=(0,gn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,gn.useMemo)(()=>({id:l,initial:t,isPresent:a,custom:o,onExitComplete:u,register:c=>(i.set(c,!1),()=>i.delete(c))}),n?[Math.random(),u]:[a,u]);return(0,gn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),aL.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Bg.jsx)(tL,{isPresent:a,children:e})),(0,Bg.jsx)(lo.Provider,{value:d,children:e})};function h_(){return new Map}var uo=M(W(),1);function Qc(e=!0){let t=(0,uo.useContext)(lo);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,uo.useId)();(0,uo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,uo.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var Jc=M(W(),1),du=e=>e.key||"";function Ug(e){let t=[];return Jc.Children.forEach(e,a=>{(0,Jc.isValidElement)(a)&&t.push(a)}),t}var Yc=M(W(),1);var js=typeof window<"u";var qs=js?Yc.useLayoutEffect:Yc.useEffect;var Vg=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Qc(s),u=(0,za.useMemo)(()=>Ug(e),[e]),d=s&&!i?[]:u.map(du),c=(0,za.useRef)(!0),f=(0,za.useRef)(u),m=io(()=>new Map),[x,w]=(0,za.useState)(u),[b,h]=(0,za.useState)(u);qs(()=>{c.current=!1,f.current=u;for(let C=0;C<b.length;C++){let L=du(b[C]);d.includes(L)?m.delete(L):m.get(L)!==!0&&m.set(L,!1)}},[b,d.length,d.join("-")]);let g=[];if(u!==x){let C=[...u];for(let L=0;L<b.length;L++){let P=b[L],A=du(P);d.includes(A)||(C.splice(L,0,P),g.push(P))}n==="wait"&&g.length&&(C=g),h(Ug(C)),w(u);return}let{forceRender:y}=(0,za.useContext)(Us);return(0,cu.jsx)(cu.Fragment,{children:b.map(C=>{let L=du(C),P=s&&!i?!1:u===b||d.includes(L),A=()=>{if(m.has(L))m.set(L,!0);else return;let R=!0;m.forEach(q=>{q||(R=!1)}),R&&(y?.(),h(f.current),s&&l?.(),r&&r())};return(0,cu.jsx)(rL,{isPresent:P,initial:!c.current||a?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:A,children:C},L)})})};var ye=e=>e;var wr=ye,qt=ye;function yn(e){let t;return()=>(t===void 0&&(t=e()),t)}var ta=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Ue=e=>e*1e3,ct=e=>e/1e3;var Hs={skipAnimations:!1,useManualTiming:!1};function oL(e){let t=new Set,a=new Set,r=!1,o=!1,n=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1};function i(u){n.has(u)&&(l.schedule(u),e()),u(s)}let l={schedule:(u,d=!1,c=!1)=>{let m=c&&r?t:a;return d&&n.add(u),m.has(u)||m.add(u),u},cancel:u=>{a.delete(u),n.delete(u)},process:u=>{if(s=u,r){o=!0;return}r=!0,[t,a]=[a,t],t.forEach(i),t.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}var Zc=["read","resolveKeyframes","update","preRender","render","postRender"],g_=40;function ef(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=Zc.reduce((h,g)=>(h[g]=oL(n),h),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,m=()=>{let h=Hs.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(h-o.timestamp,g_),1),o.timestamp=h,o.isProcessing=!0,i.process(o),l.process(o),u.process(o),d.process(o),c.process(o),f.process(o),o.isProcessing=!1,a&&t&&(r=!1,e(m))},x=()=>{a=!0,r=!0,o.isProcessing||e(m)};return{schedule:Zc.reduce((h,g)=>{let y=s[g];return h[g]=(C,L=!1,P=!1)=>(a||x(),y.schedule(C,L,P)),h},{}),cancel:h=>{for(let g=0;g<Zc.length;g++)s[Zc[g]].cancel(h)},state:o,steps:s}}var{schedule:Z,cancel:aa,state:Ve,steps:tf}=ef(typeof requestAnimationFrame<"u"?requestAnimationFrame:ye,!0);var nL=M(W(),1),af=(0,nL.createContext)({strict:!1});var sL={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"]},Sr={};for(let e in sL)Sr[e]={isEnabled:t=>sL[e].some(a=>!!t[a])};function iL(e){for(let t in e)Sr[t]={...Sr[t],...e[t]}}var y_=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","ignoreStrict","viewport"]);function fu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||y_.has(e)}var lL=e=>!fu(e);function x_(e){e&&(lL=t=>t.startsWith("on")?!fu(t):e(t))}try{x_(Zk("@emotion/is-prop-valid").default)}catch{}function uL(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(lL(o)||a===!0&&fu(o)||!t&&!fu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function dL(e){if(typeof Proxy>"u")return e;let t=new Map,a=(...r)=>e(...r);return new Proxy(a,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}var uf=M(ue(),1);var Ws=M(W(),1);var cL=M(W(),1),co=(0,cL.createContext)({});var nf=M(W(),1);function Cr(e){return typeof e=="string"||Array.isArray(e)}function fo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var rf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pu=["initial",...rf];function xn(e){return fo(e.animate)||pu.some(t=>Cr(e[t]))}function of(e){return!!(xn(e)||e.variants)}function fL(e,t){if(xn(e)){let{initial:a,animate:r}=e;return{initial:a===!1||Cr(a)?a:void 0,animate:Cr(r)?r:void 0}}return e.inherit!==!1?t:{}}function mL(e){let{initial:t,animate:a}=fL(e,(0,nf.useContext)(co));return(0,nf.useMemo)(()=>({initial:t,animate:a}),[pL(t),pL(a)])}function pL(e){return Array.isArray(e)?e.join(" "):e}var hL=Symbol.for("motionComponentSymbol");var gL=M(W(),1);function Lr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function yL(e,t,a){return(0,gL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):Lr(a)&&(a.current=r))},[t])}var Ht=M(W(),1);var zs=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var v_="framerAppearId",sf="data-"+zs(v_);var{schedule:$s,cancel:tV}=ef(queueMicrotask,!1);var xL=M(W(),1),lf=(0,xL.createContext)({});function vL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,Ht.useContext)(co),l=(0,Ht.useContext)(af),u=(0,Ht.useContext)(lo),d=(0,Ht.useContext)(Vs).reducedMotion,c=(0,Ht.useRef)(null);r=r||l.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:a,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));let f=c.current,m=(0,Ht.useContext)(lf);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&w_(c.current,a,o,m);let x=(0,Ht.useRef)(!1);(0,Ht.useInsertionEffect)(()=>{f&&x.current&&f.update(a,u)});let w=a[sf],b=(0,Ht.useRef)(!!w&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,w))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,w)));return qs(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),$s.render(f.render),b.current&&f.animationState&&f.animationState.animateChanges())}),(0,Ht.useEffect)(()=>{f&&(!b.current&&f.animationState&&f.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)===null||h===void 0||h.call(window,w)}),b.current=!1))}),f}function w_(e,t,a,r){let{layoutId:o,layout:n,drag:s,dragConstraints:i,layoutScroll:l,layoutRoot:u}=t;e.projection=new a(e.latestValues,t["data-framer-portal-id"]?void 0:wL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&Lr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function wL(e){if(e)return e.options.allowProjection!==!1?e.projection:wL(e.parent)}function SL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&iL(e);function i(u,d){let c,f={...(0,Ws.useContext)(Vs),...u,layoutId:S_(u)},{isStatic:m}=f,x=mL(u),w=r(u,m);if(!m&&js){C_(f,e);let b=L_(f);c=b.MeasureLayout,x.visualElement=vL(o,w,f,t,b.ProjectionNode)}return(0,uf.jsxs)(co.Provider,{value:x,children:[c&&x.visualElement?(0,uf.jsx)(c,{visualElement:x.visualElement,...f}):null,a(o,u,yL(w,x.visualElement,d),w,m,x.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${(s=(n=o.displayName)!==null&&n!==void 0?n:o.name)!==null&&s!==void 0?s:""})`}`;let l=(0,Ws.forwardRef)(i);return l[hL]=o,l}function S_({layoutId:e}){let t=(0,Ws.useContext)(Us).id;return t&&e!==void 0?t+"-"+e:e}function C_(e,t){let a=(0,Ws.useContext)(af).strict}function L_(e){let{drag:t,layout:a}=Sr;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var CL=["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 Gs(e){return typeof e!="string"||e.includes("-")?!1:!!(CL.indexOf(e)>-1||/[A-Z]/u.test(e))}var jg=M(W(),1);function LL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Ks(e,t,a,r){if(typeof t=="function"){let[o,n]=LL(r);t=t(a!==void 0?a:e.custom,o,n)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[o,n]=LL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var mu=e=>Array.isArray(e);var bL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),IL=e=>mu(e)?e[e.length-1]||0:e;var Ce=e=>!!(e&&e.getVelocity);function Xs(e){let t=Ce(e)?e.get():e;return bL(t)?t.toValue():t}function b_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:I_(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var df=e=>(t,a)=>{let r=(0,jg.useContext)(co),o=(0,jg.useContext)(lo),n=()=>b_(e,t,r,o);return a?n():io(n)};function I_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=Xs(n[f]);let{initial:s,animate:i}=e,l=xn(e),u=of(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),i===void 0&&(i=t.animate));let d=a?a.initial===!1:!1;d=d||s===!1;let c=d?i:s;if(c&&typeof c!="boolean"&&!fo(c)){let f=Array.isArray(c)?c:[c];for(let m=0;m<f.length;m++){let x=Ks(e,f[m]);if(x){let{transitionEnd:w,transition:b,...h}=x;for(let g in h){let y=h[g];if(Array.isArray(y)){let C=d?y.length-1:0;y=y[C]}y!==null&&(o[g]=y)}for(let g in w)o[g]=w[g]}}}return o}var $a=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zt=new Set($a);var kL=e=>t=>typeof t=="string"&&t.startsWith(e),cf=kL("--"),k_=kL("var(--"),Qs=e=>k_(e)?P_.test(e.split("/*")[0].trim()):!1,P_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var ff=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ft=(e,t,a)=>a>t?t:a<e?e:a;var Wa={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},br={...Wa,transform:e=>ft(0,1,e)},hu={...Wa,default:1};var gu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ga=gu("deg"),_t=gu("%"),H=gu("px"),PL=gu("vh"),TL=gu("vw"),qg={..._t,parse:e=>_t.parse(e)/100,transform:e=>_t.transform(e*100)};var AL={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,radius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,backgroundPositionX:H,backgroundPositionY:H};var RL={rotate:Ga,rotateX:Ga,rotateY:Ga,rotateZ:Ga,scale:hu,scaleX:hu,scaleY:hu,scaleZ:hu,skew:Ga,skewX:Ga,skewY:Ga,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:br,originX:qg,originY:qg,originZ:H};var Hg={...Wa,transform:Math.round};var Js={...AL,...RL,zIndex:Hg,size:H,fillOpacity:br,strokeOpacity:br,numOctaves:Hg};var T_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},A_=$a.length;function _L(e,t,a){let r="",o=!0;for(let n=0;n<A_;n++){let s=$a[n],i=e[s];if(i===void 0)continue;let l=!0;if(typeof i=="number"?l=i===(s.startsWith("scale")?1:0):l=parseFloat(i)===0,!l||a){let u=ff(i,Js[s]);if(!l){o=!1;let d=T_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Ys(e,t,a){let{style:r,vars:o,transformOrigin:n}=e,s=!1,i=!1;for(let l in t){let u=t[l];if(zt.has(l)){s=!0;continue}else if(cf(l)){o[l]=u;continue}else{let d=ff(u,Js[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=_L(t,e.transform,a):r.transform&&(r.transform="none")),i){let{originX:l="50%",originY:u="50%",originZ:d=0}=n;r.transformOrigin=`${l} ${u} ${d}`}}var R_={offset:"stroke-dashoffset",array:"stroke-dasharray"},__={offset:"strokeDashoffset",array:"strokeDasharray"};function EL(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?R_:__;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function DL(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function ML(e,t,a){let r=DL(t,e.x,e.width),o=DL(a,e.y,e.height);return`${r} ${o}`}function Zs(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Ys(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m,dimensions:x}=e;f.transform&&(x&&(m.transform=f.transform),delete f.transform),x&&(o!==void 0||n!==void 0||m.transform)&&(m.transformOrigin=ML(x,o!==void 0?o:.5,n!==void 0?n:.5)),t!==void 0&&(f.x=t),a!==void 0&&(f.y=a),r!==void 0&&(f.scale=r),s!==void 0&&EL(f,s,i,l,!1)}var ei=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var pf=()=>({...ei(),attrs:{}});var ti=e=>typeof e=="string"&&e.toLowerCase()==="svg";function mf(e,{style:t,vars:a},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(let n in a)e.style.setProperty(n,a[n])}var hf=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"]);function gf(e,t,a,r){mf(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(hf.has(o)?o:zs(o),t.attrs[o])}var ai={};function NL(e){Object.assign(ai,e)}function yf(e,{layout:t,layoutId:a}){return zt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!ai[e]||e==="opacity")}function ri(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Ce(o[s])||t.style&&Ce(t.style[s])||yf(s,e)||((r=a?.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function xf(e,t,a){let r=ri(e,t,a);for(let o in e)if(Ce(e[o])||Ce(t[o])){let n=$a.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function E_(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}var OL=["x","y","width","height","cx","cy","r"],FL={useVisualState:df({scrapeMotionValuesFromProps:xf,createRenderState:pf,onUpdate:({props:e,prevProps:t,current:a,renderState:r,latestValues:o})=>{if(!a)return;let n=!!e.drag;if(!n){for(let i in o)if(zt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<OL.length;i++){let l=OL[i];e[l]!==t[l]&&(s=!0)}s&&Z.read(()=>{E_(a,r),Z.render(()=>{Zs(r,o,ti(a.tagName),e.transformTemplate),gf(a,r)})})}})};var BL={useVisualState:df({scrapeMotionValuesFromProps:ri,createRenderState:ei})};var oi=M(W(),1);var UL=M(W(),1);function zg(e,t,a){for(let r in t)!Ce(t[r])&&!yf(r,a)&&(e[r]=t[r])}function D_({transformTemplate:e},t){return(0,UL.useMemo)(()=>{let a=ei();return Ys(a,t,e),Object.assign({},a.vars,a.style)},[t])}function M_(e,t){let a=e.style||{},r={};return zg(r,a,e),Object.assign(r,D_(e,t)),r}function VL(e,t){let a={},r=M_(e,t);return e.drag&&e.dragListener!==!1&&(a.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(a.tabIndex=0),a.style=r,a}var jL=M(W(),1);function qL(e,t,a,r){let o=(0,jL.useMemo)(()=>{let n=pf();return Zs(n,t,ti(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};zg(n,e.style,e),o.style={...n,...o.style}}return o}function HL(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(Gs(a)?qL:VL)(r,n,s,a),u=uL(r,typeof a=="string",e),d=a!==oi.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,oi.useMemo)(()=>Ce(c)?c.get():c,[c]);return(0,oi.createElement)(a,{...d,children:f})}}function zL(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...Gs(r)?FL:BL,preloadedFeatures:e,useRender:HL(o),createVisualElement:t,Component:r};return SL(s)}}function $g(e,t){if(!Array.isArray(t))return!1;let a=t.length;if(a!==e.length)return!1;for(let r=0;r<a;r++)if(t[r]!==e[r])return!1;return!0}function po(e,t,a){let r=e.getProps();return Ks(r,t,a!==void 0?a:r.custom,e)}var Wg=yn(()=>window.ScrollTimeline!==void 0);var yu=class{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,a){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=a}attachTimeline(t,a){let r=this.animations.map(o=>{if(Wg()&&o.attachTimeline)return o.attachTimeline(t);if(typeof a=="function")return a(o)});return()=>{r.forEach((o,n)=>{o&&o(),this.animations[n].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let a=0;a<this.animations.length;a++)t=Math.max(t,this.animations[a].duration);return t}runAll(t){this.animations.forEach(a=>a[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}};var xu=class extends yu{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function mo(e,t){return e?e[t]||e.default||e:void 0}function ni(e){let t=0,a=50,r=e.next(t);for(;!r.done&&t<2e4;)t+=a,r=e.next(t);return t>=2e4?1/0:t}function ho(e){return typeof e=="function"}function vu(e,t){e.timeline=t,e.onfinish=null}var si=e=>Array.isArray(e)&&typeof e[0]=="number";var Kg={linearEasing:void 0};function $L(e,t){let a=yn(e);return()=>{var r;return(r=Kg[t])!==null&&r!==void 0?r:a()}}var go=$L(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var wu=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(ta(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function wf(e){return!!(typeof e=="function"&&go()||!e||typeof e=="string"&&(e in vf||go())||si(e)||Array.isArray(e)&&e.every(wf))}var ii=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,vf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ii([0,.65,.55,1]),circOut:ii([.55,0,1,.45]),backIn:ii([.31,.01,.66,-.59]),backOut:ii([.33,1.53,.69,.99])};function li(e,t){if(e)return typeof e=="function"&&go()?wu(e,t):si(e)?ii(e):Array.isArray(e)?e.map(a=>li(a,t)||vf.easeOut):vf[e]}var ra={x:!1,y:!1};function ui(){return ra.x||ra.y}function Xg(e,t,a){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let o=document;t&&(o=t.current);let n=(r=a?.[e])!==null&&r!==void 0?r:o.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}function Sf(e,t){let a=Xg(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function WL(e){return t=>{t.pointerType==="touch"||ui()||e(t)}}function Qg(e,t,a={}){let[r,o,n]=Sf(e,a),s=WL(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=WL(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var Cf=(e,t)=>t?e===t?!0:Cf(e,t.parentElement):!1;var vn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var N_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function GL(e){return N_.has(e.tagName)||e.tabIndex!==-1}var wn=new WeakSet;function KL(e){return t=>{t.key==="Enter"&&e(t)}}function Jg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var XL=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=KL(()=>{if(wn.has(a))return;Jg(a,"down");let o=KL(()=>{Jg(a,"up")}),n=()=>Jg(a,"cancel");a.addEventListener("keyup",o,t),a.addEventListener("blur",n,t)});a.addEventListener("keydown",r,t),a.addEventListener("blur",()=>a.removeEventListener("keydown",r),t)};function QL(e){return vn(e)&&!ui()}function Yg(e,t,a={}){let[r,o,n]=Sf(e,a),s=i=>{let l=i.currentTarget;if(!QL(i)||wn.has(l))return;wn.add(l);let u=t(i),d=(m,x)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!QL(m)||!wn.has(l))&&(wn.delete(l),typeof u=="function"&&u(m,{success:x}))},c=m=>{d(m,a.useGlobalTarget||Cf(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!GL(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>XL(u,o),o)}),n}function Zg(e){return e==="x"||e==="y"?ra[e]?null:(ra[e]=!0,()=>{ra[e]=!1}):ra.x||ra.y?null:(ra.x=ra.y=!0,()=>{ra.x=ra.y=!1})}var Lf=new Set(["width","height","top","left","right","bottom",...$a]);var bf;function F_(){bf=void 0}var St={now:()=>(bf===void 0&&St.set(Ve.isProcessing||Hs.useManualTiming?Ve.timestamp:performance.now()),bf),set:e=>{bf=e,queueMicrotask(F_)}};function di(e,t){e.indexOf(t)===-1&&e.push(t)}function ci(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var yo=class{constructor(){this.subscriptions=[]}add(t){return di(this.subscriptions,t),()=>ci(this.subscriptions,t)}notify(t,a,r){let o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,a,r);else for(let n=0;n<o;n++){let s=this.subscriptions[n];s&&s(t,a,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};function If(e,t){return t?e*(1e3/t):0}var YL=30,B_=e=>!isNaN(parseFloat(e)),ZL={current:void 0},ey=class{constructor(t,a={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{let n=St.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=a.owner}setCurrent(t){this.current=t,this.updatedAt=St.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=B_(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,a){this.events[t]||(this.events[t]=new yo);let r=this.events[t].add(a);return t==="change"?()=>{r(),Z.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,a){this.passiveEffect=t,this.stopPassiveEffect=a}set(t,a=!0){!a||!this.passiveEffect?this.updateAndNotify(t,a):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,a,r){this.set(a),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,a=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,a&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ZL.current&&ZL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=St.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>YL)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,YL);return If(parseFloat(this.current)-parseFloat(this.prevFrameValue),a)}start(t){return this.stop(),new Promise(a=>{this.hasAnimated=!0,this.animation=t(a),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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Ir(e,t){return new ey(e,t)}function U_(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Ir(a))}function Su(e,t){let a=po(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=IL(n[s]);U_(e,s,i)}}function eb(e){return!!(Ce(e)&&e.add)}function Cu(e,t){let a=e.getValue("willChange");if(eb(a))return a.add(t)}function kf(e){return e.props[sf]}var Pf={current:!1};var tb=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,V_=1e-7,j_=12;function q_(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=tb(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>V_&&++i<j_);return s}function xo(e,t,a,r){if(e===t&&a===r)return ye;let o=n=>q_(n,0,1,e,a);return n=>n===0||n===1?n:tb(o(n),t,r)}var Tf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Af=e=>t=>1-e(1-t);var ty=xo(.33,1.53,.69,.99),Lu=Af(ty),Rf=Tf(Lu);var _f=e=>(e*=2)<1?.5*Lu(e):.5*(2-Math.pow(2,-10*(e-1)));var Ef=e=>1-Math.sin(Math.acos(e)),Df=Af(Ef),Mf=Tf(Ef);var Nf=e=>/^0[^.\s]+$/u.test(e);function ab(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Nf(e):!0}var vo=e=>Math.round(e*1e5)/1e5;var fi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function rb(e){return e==null}var ob=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var pi=(e,t)=>a=>!!(typeof a=="string"&&ob.test(a)&&a.startsWith(e)||t&&!rb(a)&&Object.prototype.hasOwnProperty.call(a,t)),Of=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(fi);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var H_=e=>ft(0,255,e),ay={...Wa,transform:e=>Math.round(H_(e))},Ka={test:pi("rgb","red"),parse:Of("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+ay.transform(e)+", "+ay.transform(t)+", "+ay.transform(a)+", "+vo(br.transform(r))+")"};function z_(e){let t="",a="",r="",o="";return e.length>5?(t=e.substring(1,3),a=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),a=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,a+=a,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(a,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}var bu={test:pi("#"),parse:z_,transform:Ka.transform};var wo={test:pi("hsl","hue"),parse:Of("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+_t.transform(vo(t))+", "+_t.transform(vo(a))+", "+vo(br.transform(r))+")"};var $e={test:e=>Ka.test(e)||bu.test(e)||wo.test(e),parse:e=>Ka.test(e)?Ka.parse(e):wo.test(e)?wo.parse(e):bu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ka.transform(e):wo.transform(e)};var nb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function $_(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(fi))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(nb))===null||a===void 0?void 0:a.length)||0)>0}var ib="number",lb="color",W_="var",G_="var(",sb="${}",K_=/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 Sn(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(K_,l=>($e.test(l)?(r.color.push(n),o.push(lb),a.push($e.parse(l))):l.startsWith(G_)?(r.var.push(n),o.push(W_),a.push(l)):(r.number.push(n),o.push(ib),a.push(parseFloat(l))),++n,sb)).split(sb);return{values:a,split:i,indexes:r,types:o}}function ub(e){return Sn(e).values}function db(e){let{split:t,types:a}=Sn(e),r=t.length;return o=>{let n="";for(let s=0;s<r;s++)if(n+=t[s],o[s]!==void 0){let i=a[s];i===ib?n+=vo(o[s]):i===lb?n+=$e.transform(o[s]):n+=o[s]}return n}}var X_=e=>typeof e=="number"?0:e;function Q_(e){let t=ub(e);return db(e)(t.map(X_))}var Et={test:$_,parse:ub,createTransformer:db,getAnimatableNone:Q_};var J_=new Set(["brightness","contrast","saturate","opacity"]);function Y_(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(fi)||[];if(!r)return e;let o=a.replace(r,""),n=J_.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var Z_=/\b([a-z-]*)\(.*?\)/gu,Iu={...Et,getAnimatableNone:e=>{let t=e.match(Z_);return t?t.map(Y_).join(" "):e}};var eE={...Js,color:$e,backgroundColor:$e,outlineColor:$e,fill:$e,stroke:$e,borderColor:$e,borderTopColor:$e,borderRightColor:$e,borderBottomColor:$e,borderLeftColor:$e,filter:Iu,WebkitFilter:Iu},mi=e=>eE[e];function Ff(e,t){let a=mi(e);return a!==Iu&&(a=Et),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var tE=new Set(["auto","none","0"]);function cb(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!tE.has(n)&&Sn(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Ff(a,o)}var ry=e=>e===Wa||e===H,fb=(e,t)=>parseFloat(e.split(", ")[t]),pb=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return fb(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?fb(n[1],e):0}},aE=new Set(["x","y","z"]),rE=$a.filter(e=>!aE.has(e));function mb(e){let t=[];return rE.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var Cn={width:({x:e},{paddingLeft:t="0",paddingRight:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),height:({y:e},{paddingTop:t="0",paddingBottom:a="0"})=>e.max-e.min-parseFloat(t)-parseFloat(a),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:pb(4,13),y:pb(5,14)};Cn.translateX=Cn.x;Cn.translateY=Cn.y;var Ln=new Set,oy=!1,ny=!1;function hb(){if(ny){let e=Array.from(Ln).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=mb(r);o.length&&(a.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();let o=a.get(r);o&&o.forEach(([n,s])=>{var i;(i=r.getValue(n))===null||i===void 0||i.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ny=!1,oy=!1,Ln.forEach(e=>e.complete()),Ln.clear()}function gb(){Ln.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ny=!0)})}function yb(){gb(),hb()}var So=class{constructor(t,a,r,o,n,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=a,this.name=r,this.motionValue=o,this.element=n,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ln.add(this),oy||(oy=!0,Z.read(gb),Z.resolveKeyframes(hb))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:a,element:r,motionValue:o}=this;for(let n=0;n<t.length;n++)if(t[n]===null)if(n===0){let s=o?.get(),i=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&a){let l=r.readValue(a,i);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=i),o&&s===void 0&&o.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ln.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ln.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Bf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var oE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function nE(e){let t=oE.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var sE=4;function sy(e,t,a=1){qt(a<=sE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=nE(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return Bf(s)?parseFloat(s):s}return Qs(o)?sy(o,t,a+1):o}var Uf=e=>t=>t.test(e);var xb={test:e=>e==="auto",parse:e=>e};var iy=[Wa,H,_t,Ga,TL,PL,xb],ly=e=>iy.find(Uf(e));var hi=class extends So{constructor(t,a,r,o,n){super(t,a,r,o,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:a,name:r}=this;if(!a||!a.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),Qs(u))){let d=sy(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Lf.has(r)||t.length!==2)return;let[o,n]=t,s=ly(o),i=ly(n);if(s!==i)if(ry(s)&&ry(i))for(let l=0;l<t.length;l++){let u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:a}=this,r=[];for(let o=0;o<t.length;o++)ab(t[o])&&r.push(o);r.length&&cb(t,r,a)}measureInitialState(){let{element:t,unresolvedKeyframes:a,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Cn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),a[0]=this.measuredOrigin;let o=a[a.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;let{element:a,name:r,unresolvedKeyframes:o}=this;if(!a||!a.current)return;let n=a.getValue(r);n&&n.jump(this.measuredOrigin,!1);let s=o.length-1,i=o[s];o[s]=Cn[r](a.measureViewportBox(),window.getComputedStyle(a.current)),i!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=i),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{a.getValue(l).set(u)}),this.resolveNoneKeyframes()}};var uy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Et.test(e)||e==="0")&&!e.startsWith("url("));function iE(e){let t=e[0];if(e.length===1)return!0;for(let a=0;a<e.length;a++)if(e[a]!==t)return!0}function vb(e,t,a,r){let o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;let n=e[e.length-1],s=uy(o,t),i=uy(n,t);return wr(s===i,`You are trying to animate ${t} from "${o}" to "${n}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${n} via the \`style\` property.`),!s||!i?!1:iE(e)||(a==="spring"||ho(a))&&r}var lE=e=>e!==null;function Co(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(lE),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var uE=40,gi=class{constructor({autoplay:t=!0,delay:a=0,type:r="keyframes",repeat:o=0,repeatDelay:n=0,repeatType:s="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=St.now(),this.options={autoplay:t,delay:a,type:r,repeat:o,repeatDelay:n,repeatType:s,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>uE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&yb(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=St.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!vb(t,r,o,n))if(Pf.current||!s){l&&l(Co(t,this.options,a)),i&&i(),this.resolveFinishedPromise();return}else this.options.duration=0;let d=this.initPlayback(t,a);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:a,...d},this.onPostResolved())}onPostResolved(){}then(t,a){return this.currentFinishedPromise.then(t,a)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}};var ie=(e,t,a)=>e+(t-e)*a;function dy(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*6*a:a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function wb({hue:e,saturation:t,lightness:a,alpha:r}){e/=360,t/=100,a/=100;let o=0,n=0,s=0;if(!t)o=n=s=a;else{let i=a<.5?a*(1+t):a+t-a*t,l=2*a-i;o=dy(l,i,e+1/3),n=dy(l,i,e),s=dy(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function yi(e,t){return a=>a>0?t:e}var cy=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},dE=[bu,Ka,wo],cE=e=>dE.find(t=>t.test(e));function Sb(e){let t=cE(e);if(wr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===wo&&(a=wb(a)),a}var fy=(e,t)=>{let a=Sb(e),r=Sb(t);if(!a||!r)return yi(e,t);let o={...a};return n=>(o.red=cy(a.red,r.red,n),o.green=cy(a.green,r.green,n),o.blue=cy(a.blue,r.blue,n),o.alpha=ie(a.alpha,r.alpha,n),Ka.transform(o))};var fE=(e,t)=>a=>t(e(a)),Xa=(...e)=>e.reduce(fE);var Vf=new Set(["none","hidden"]);function Cb(e,t){return Vf.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function pE(e,t){return a=>ie(e,t,a)}function jf(e){return typeof e=="number"?pE:typeof e=="string"?Qs(e)?yi:$e.test(e)?fy:gE:Array.isArray(e)?Lb:typeof e=="object"?$e.test(e)?fy:mE:yi}function Lb(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>jf(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function mE(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=jf(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function hE(e,t){var a;let r=[],o={color:0,var:0,number:0};for(let n=0;n<t.values.length;n++){let s=t.types[n],i=e.indexes[s][o[s]],l=(a=e.values[i])!==null&&a!==void 0?a:0;r[n]=l,o[s]++}return r}var gE=(e,t)=>{let a=Et.createTransformer(t),r=Sn(e),o=Sn(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Vf.has(e)&&!o.values.length||Vf.has(t)&&!r.values.length?Cb(e,t):Xa(Lb(hE(r,o),o.values),a):(wr(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),yi(e,t))};function qf(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ie(e,t,a):jf(e)(e,t)}var yE=5;function Hf(e,t,a){let r=Math.max(t-yE,0);return If(a-e(r),t-r)}var Pe={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};var py=.001;function bb({duration:e=Pe.duration,bounce:t=Pe.bounce,velocity:a=Pe.velocity,mass:r=Pe.mass}){let o,n;wr(e<=Ue(Pe.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ft(Pe.minDamping,Pe.maxDamping,s),e=ft(Pe.minDuration,Pe.maxDuration,ct(e)),s<1?(o=u=>{let d=u*s,c=d*e,f=d-a,m=zf(u,s),x=Math.exp(-c);return py-f/m*x},n=u=>{let c=u*s*e,f=c*a+a,m=Math.pow(s,2)*Math.pow(u,2)*e,x=Math.exp(-c),w=zf(Math.pow(u,2),s);return(-o(u)+py>0?-1:1)*((f-m)*x)/w}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-py+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=vE(o,n,i);if(e=Ue(e),isNaN(l))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var xE=12;function vE(e,t,a){let r=a;for(let o=1;o<xE;o++)r=r-e(r)/t(r);return r}function zf(e,t){return e*Math.sqrt(1-t*t)}var wE=["duration","bounce"],SE=["stiffness","damping","mass"];function Ib(e,t){return t.some(a=>e[a]!==void 0)}function CE(e){let t={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...e};if(!Ib(e,SE)&&Ib(e,wE))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*ft(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pe.mass,stiffness:o,damping:n}}else{let a=bb(e);t={...t,...a,mass:Pe.mass},t.isResolvedFromDuration=!0}return t}function $f(e=Pe.visualDuration,t=Pe.bounce){let a=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:r,restDelta:o}=a,n=a.keyframes[0],s=a.keyframes[a.keyframes.length-1],i={done:!1,value:n},{stiffness:l,damping:u,mass:d,duration:c,velocity:f,isResolvedFromDuration:m}=CE({...a,velocity:-ct(a.velocity||0)}),x=f||0,w=u/(2*Math.sqrt(l*d)),b=s-n,h=ct(Math.sqrt(l/d)),g=Math.abs(b)<5;r||(r=g?Pe.restSpeed.granular:Pe.restSpeed.default),o||(o=g?Pe.restDelta.granular:Pe.restDelta.default);let y;if(w<1){let L=zf(h,w);y=P=>{let A=Math.exp(-w*h*P);return s-A*((x+w*h*b)/L*Math.sin(L*P)+b*Math.cos(L*P))}}else if(w===1)y=L=>s-Math.exp(-h*L)*(b+(x+h*b)*L);else{let L=h*Math.sqrt(w*w-1);y=P=>{let A=Math.exp(-w*h*P),R=Math.min(L*P,300);return s-A*((x+w*h*b)*Math.sinh(R)+L*b*Math.cosh(R))/L}}let C={calculatedDuration:m&&c||null,next:L=>{let P=y(L);if(m)i.done=L>=c;else{let A=0;w<1&&(A=L===0?Ue(x):Hf(y,L,P));let R=Math.abs(A)<=r,q=Math.abs(s-P)<=o;i.done=R&&q}return i.value=i.done?s:P,i},toString:()=>{let L=Math.min(ni(C),2e4),P=wu(A=>C.next(L*A).value,L,30);return L+"ms "+P}};return C}function my({keyframes:e,velocity:t=0,power:a=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:n=500,modifyTarget:s,min:i,max:l,restDelta:u=.5,restSpeed:d}){let c=e[0],f={done:!1,value:c},m=R=>i!==void 0&&R<i||l!==void 0&&R>l,x=R=>i===void 0?l:l===void 0||Math.abs(i-R)<Math.abs(l-R)?i:l,w=a*t,b=c+w,h=s===void 0?b:s(b);h!==b&&(w=h-c);let g=R=>-w*Math.exp(-R/r),y=R=>h+g(R),C=R=>{let q=g(R),V=y(R);f.done=Math.abs(q)<=u,f.value=f.done?h:V},L,P,A=R=>{m(f.value)&&(L=R,P=$f({keyframes:[f.value,x(f.value)],velocity:Hf(y,R,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:R=>{let q=!1;return!P&&L===void 0&&(q=!0,C(R),A(R)),L!==void 0&&R>=L?P.next(R-L):(!q&&C(R),f)}}}var kb=xo(.42,0,1,1),Pb=xo(0,0,.58,1),Wf=xo(.42,0,.58,1);var Tb=e=>Array.isArray(e)&&typeof e[0]!="number";var Ab={linear:ye,easeIn:kb,easeInOut:Wf,easeOut:Pb,circIn:Ef,circInOut:Mf,circOut:Df,backIn:Lu,backInOut:Rf,backOut:ty,anticipate:_f},hy=e=>{if(si(e)){qt(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return xo(t,a,r,o)}else if(typeof e=="string")return qt(Ab[e]!==void 0,`Invalid easing type '${e}'`),Ab[e];return e};function LE(e,t,a){let r=[],o=a||qf,n=e.length-1;for(let s=0;s<n;s++){let i=o(e[s],e[s+1]);if(t){let l=Array.isArray(t)?t[s]||ye:t;i=Xa(l,i)}r.push(i)}return r}function Rb(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(qt(n===t.length,"Both input and output ranges must be the same length"),n===1)return()=>t[0];if(n===2&&t[0]===t[1])return()=>t[1];let s=e[0]===e[1];e[0]>e[n-1]&&(e=[...e].reverse(),t=[...t].reverse());let i=LE(t,r,o),l=i.length,u=d=>{if(s&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);let f=ta(e[c],e[c+1],d);return i[c](f)};return a?d=>u(ft(e[0],e[n-1],d)):u}function _b(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=ta(0,t,r);e.push(ie(a,1,o))}}function Eb(e){let t=[0];return _b(t,e.length-1),t}function Db(e,t){return e.map(a=>a*t)}function bE(e,t){return e.map(()=>t||Wf).splice(0,e.length-1)}function ku({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=Tb(r)?r.map(hy):hy(r),n={done:!1,value:t[0]},s=Db(a&&a.length===t.length?a:Eb(t),e),i=Rb(s,t,{ease:Array.isArray(o)?o:bE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var Mb=e=>{let t=({timestamp:a})=>e(a);return{start:()=>Z.update(t,!0),stop:()=>aa(t),now:()=>Ve.isProcessing?Ve.timestamp:St.now()}};var IE={decay:my,inertia:my,tween:ku,keyframes:ku,spring:$f},kE=e=>e/100,bn=class extends gi{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();let{onStop:l}=this.options;l&&l()};let{name:a,motionValue:r,element:o,keyframes:n}=this.options,s=o?.KeyframeResolver||So,i=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new s(n,i,a,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){let{type:a="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:n,velocity:s=0}=this.options,i=ho(a)?a:IE[a]||ku,l,u;i!==ku&&typeof t[0]!="number"&&(l=Xa(kE,qf(t[0],t[1])),t=[0,100]);let d=i({...this.options,keyframes:t});n==="mirror"&&(u=i({...this.options,keyframes:[...t].reverse(),velocity:-s})),d.calculatedDuration===null&&(d.calculatedDuration=ni(d));let{calculatedDuration:c}=d,f=c+o,m=f*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:m}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,a=!1){let{resolved:r}=this;if(!r){let{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}let{finalKeyframe:o,generator:n,mirroredGenerator:s,mapPercentToKeyframes:i,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return n.next(0);let{delay:f,repeat:m,repeatType:x,repeatDelay:w,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),a?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let h=this.currentTime-f*(this.speed>=0?1:-1),g=this.speed>=0?h<0:h>d;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let y=this.currentTime,C=n;if(m){let R=Math.min(this.currentTime,d)/c,q=Math.floor(R),V=R%1;!V&&R>=1&&(V=1),V===1&&q--,q=Math.min(q,m+1),q%2&&(x==="reverse"?(V=1-V,w&&(V-=w/c)):x==="mirror"&&(C=s)),y=ft(0,1,V)*c}let L=g?{done:!1,value:l[0]}:C.next(y);i&&(L.value=i(L.value));let{done:P}=L;!g&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);let A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return A&&o!==void 0&&(L.value=Co(l,this.options,o)),b&&b(L.value),A&&this.finish(),L}get duration(){let{resolved:t}=this;return t?ct(t.calculatedDuration):0}get time(){return ct(this.currentTime)}set time(t){t=Ue(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let a=this.playbackSpeed!==t;this.playbackSpeed=t,a&&(this.time=ct(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=Mb,onPlay:a,startTime:r}=this.options;this.driver||(this.driver=t(n=>this.tick(n))),a&&a();let o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}};var Nb=new Set(["opacity","clipPath","filter","transform"]);function Ob(e,t,a,{delay:r=0,duration:o=300,repeat:n=0,repeatType:s="loop",ease:i="easeInOut",times:l}={}){let u={[t]:a};l&&(u.offset=l);let d=li(i,o);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:o,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:n+1,direction:s==="reverse"?"alternate":"normal"})}var Fb=yn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Gf=10,PE=2e4;function TE(e){return ho(e.type)||e.type==="spring"||!wf(e.ease)}function AE(e,t){let a=new bn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<PE;)r=a.sample(n),o.push(r.value),n+=Gf;return{times:void 0,keyframes:o,duration:n-Gf,ease:"linear"}}var Bb={anticipate:_f,backInOut:Rf,circInOut:Mf};function RE(e){return e in Bb}var Pu=class extends gi{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new hi(n,(s,i)=>this.onKeyframesResolved(s,i),a,r,o),this.resolver.scheduleResolve()}initPlayback(t,a){let{duration:r=300,times:o,ease:n,type:s,motionValue:i,name:l,startTime:u}=this.options;if(!i.owner||!i.owner.current)return!1;if(typeof n=="string"&&go()&&RE(n)&&(n=Bb[n]),TE(this.options)){let{onComplete:c,onUpdate:f,motionValue:m,element:x,...w}=this.options,b=AE(t,w);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,o=b.times,n=b.ease,s="keyframes"}let d=Ob(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(vu(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(Co(t,this.options,a)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:n,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:a}=t;return ct(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return ct(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=Ue(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:a}=t;return a.playbackRate}set speed(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:a}=t;return a.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:a}=t;return a.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{let{resolved:a}=this;if(!a)return ye;let{animation:r}=a;vu(r,t)}return ye}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.playState==="finished"&&this.updateFinishedPromise(),a.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:a}=t;a.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:a,keyframes:r,duration:o,type:n,ease:s,times:i}=t;if(a.playState==="idle"||a.playState==="finished")return;if(this.time){let{motionValue:u,onUpdate:d,onComplete:c,element:f,...m}=this.options,x=new bn({...m,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=Ue(this.time);u.setWithVelocity(x.sample(w-Gf).value,x.sample(w).value,Gf)}let{onStop:l}=this.options;l&&l(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:a,name:r,repeatDelay:o,repeatType:n,damping:s,type:i}=t;if(!a||!a.owner||!(a.owner.current instanceof HTMLElement))return!1;let{onUpdate:l,transformTemplate:u}=a.owner.getProps();return Fb()&&r&&Nb.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var _E={type:"spring",stiffness:500,damping:25,restSpeed:10},EE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),DE={type:"keyframes",duration:.8},ME={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ub=(e,{keyframes:t})=>t.length>2?DE:zt.has(e)?e.startsWith("scale")?EE(t[1]):_E:ME;function Vb({when:e,delay:t,delayChildren:a,staggerChildren:r,staggerDirection:o,repeat:n,repeatType:s,repeatDelay:i,from:l,elapsed:u,...d}){return!!Object.keys(d).length}var xi=(e,t,a,r={},o,n)=>s=>{let i=mo(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-Ue(l);let d={keyframes:Array.isArray(a)?a:[null,a],ease:"easeOut",velocity:t.getVelocity(),...i,delay:-u,onUpdate:f=>{t.set(f),i.onUpdate&&i.onUpdate(f)},onComplete:()=>{s(),i.onComplete&&i.onComplete()},name:e,motionValue:t,element:n?void 0:o};Vb(i)||(d={...d,...Ub(e,d)}),d.duration&&(d.duration=Ue(d.duration)),d.repeatDelay&&(d.repeatDelay=Ue(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),(Pf.current||Hs.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=Co(d.keyframes,i);if(f!==void 0)return Z.update(()=>{d.onUpdate(f),d.onComplete()}),new xu([])}return!n&&Pu.supports(d)?new Pu(d):new bn(d)};function NE({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function Kf(e,t,{delay:a=0,transitionOverride:r,type:o}={}){var n;let{transition:s=e.getDefaultTransition(),transitionEnd:i,...l}=t;r&&(s=r);let u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(let c in l){let f=e.getValue(c,(n=e.latestValues[c])!==null&&n!==void 0?n:null),m=l[c];if(m===void 0||d&&NE(d,c))continue;let x={delay:a,...mo(s||{},c)},w=!1;if(window.MotionHandoffAnimation){let h=kf(e);if(h){let g=window.MotionHandoffAnimation(h,c,Z);g!==null&&(x.startTime=g,w=!0)}}Cu(e,c),f.start(xi(c,f,m,e.shouldReduceMotion&&Lf.has(c)?{type:!1}:x,e,w));let b=f.animation;b&&u.push(b)}return i&&Promise.all(u).then(()=>{Z.update(()=>{i&&Su(e,i)})}),u}function Xf(e,t,a={}){var r;let o=po(e,t,a.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0),{transition:n=e.getDefaultTransition()||{}}=o||{};a.transitionOverride&&(n=a.transitionOverride);let s=o?()=>Promise.all(Kf(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=n;return OE(e,t,d+u,c,f,a)}:()=>Promise.resolve(),{when:l}=n;if(l){let[u,d]=l==="beforeChildren"?[s,i]:[i,s];return u().then(()=>d())}else return Promise.all([s(),i(a.delay)])}function OE(e,t,a=0,r=0,o=1,n){let s=[],i=(e.variantChildren.size-1)*r,l=o===1?(u=0)=>u*r:(u=0)=>i-u*r;return Array.from(e.variantChildren).sort(FE).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Xf(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function FE(e,t){return e.sortNodePosition(t)}function Qf(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>Xf(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=Xf(e,t,a);else{let o=typeof t=="function"?po(e,t,a.custom):t;r=Promise.all(Kf(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var BE=pu.length;function gy(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?gy(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<BE;a++){let r=pu[a],o=e.props[r];(Cr(o)||o===!1)&&(t[r]=o)}return t}var UE=[...rf].reverse(),VE=rf.length;function jE(e){return t=>Promise.all(t.map(({animation:a,options:r})=>Qf(e,a,r)))}function qb(e){let t=jE(e),a=jb(),r=!0,o=l=>(u,d)=>{var c;let f=po(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:m,transitionEnd:x,...w}=f;u={...u,...w,...x}}return u};function n(l){t=l(e)}function s(l){let{props:u}=e,d=gy(e.parent)||{},c=[],f=new Set,m={},x=1/0;for(let b=0;b<VE;b++){let h=UE[b],g=a[h],y=u[h]!==void 0?u[h]:d[h],C=Cr(y),L=h===l?g.isActive:null;L===!1&&(x=b);let P=y===d[h]&&y!==u[h]&&C;if(P&&r&&e.manuallyAnimateOnMount&&(P=!1),g.protectedKeys={...m},!g.isActive&&L===null||!y&&!g.prevProp||fo(y)||typeof y=="boolean")continue;let A=qE(g.prevProp,y),R=A||h===l&&g.isActive&&!P&&C||b>x&&C,q=!1,V=Array.isArray(y)?y:[y],pe=V.reduce(o(h),{});L===!1&&(pe={});let{prevResolvedValues:le={}}=g,Rn={...le,...pe},oe=Fe=>{R=!0,f.has(Fe)&&(q=!0,f.delete(Fe)),g.needsAnimating[Fe]=!0;let We=e.getValue(Fe);We&&(We.liveStyle=!1)};for(let Fe in Rn){let We=pe[Fe],mt=le[Fe];if(m.hasOwnProperty(Fe))continue;let sa=!1;mu(We)&&mu(mt)?sa=!$g(We,mt):sa=We!==mt,sa?We!=null?oe(Fe):f.add(Fe):We!==void 0&&f.has(Fe)?oe(Fe):g.protectedKeys[Fe]=!0}g.prevProp=y,g.prevResolvedValues=pe,g.isActive&&(m={...m,...pe}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(P&&A)||q)&&c.push(...V.map(Fe=>({animation:Fe,options:{type:h}})))}if(f.size){let b={};f.forEach(h=>{let g=e.getBaseTarget(h),y=e.getValue(h);y&&(y.liveStyle=!0),b[h]=g??null}),c.push({animation:b})}let w=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(c):Promise.resolve()}function i(l,u){var d;if(a[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),a[l].isActive=u;let c=s(l);for(let f in a)a[f].protectedKeys={};return c}return{animateChanges:s,setActive:i,setAnimateFunction:n,getState:()=>a,reset:()=>{a=jb(),r=!0}}}function qE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!$g(t,e):!1}function In(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jb(){return{animate:In(!0),whileInView:In(),whileHover:In(),whileTap:In(),whileDrag:In(),whileFocus:In(),exit:In()}}var ot=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var Jf=class extends ot{constructor(t){super(t),t.animationState||(t.animationState=qb(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();fo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:a}=this.node.prevProps||{};t!==a&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}};var HE=0,Yf=class extends ot{constructor(){super(...arguments),this.id=HE++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:a}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let o=this.node.animationState.setActive("exit",!t);a&&!t&&o.then(()=>a(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}};var Hb={animation:{Feature:Jf},exit:{Feature:Yf}};function kr(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function Pr(e){return{point:{x:e.pageX,y:e.pageY}}}var zb=e=>t=>vn(t)&&e(t,Pr(t));function Lo(e,t,a,r){return kr(e,t,zb(a),r)}var $b=(e,t)=>Math.abs(e-t);function Wb(e,t){let a=$b(e.x,t.x),r=$b(e.y,t.y);return Math.sqrt(a**2+r**2)}var vi=class{constructor(t,a,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let c=xy(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=Wb(c.offset,{x:0,y:0})>=3;if(!f&&!m)return;let{point:x}=c,{timestamp:w}=Ve;this.history.push({...x,timestamp:w});let{onStart:b,onMove:h}=this.handlers;f||(b&&b(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=yy(f,this.transformPagePoint),Z.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();let{onEnd:m,onSessionEnd:x,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let b=xy(c.type==="pointercancel"?this.lastMoveEventInfo:yy(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(c,b),x&&x(c,b)},!vn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=Pr(t),i=yy(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=Ve;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,xy(i,this.history)),this.removeListeners=Xa(Lo(this.contextWindow,"pointermove",this.handlePointerMove),Lo(this.contextWindow,"pointerup",this.handlePointerUp),Lo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),aa(this.updatePoint)}};function yy(e,t){return t?{point:t(e.point)}:e}function Gb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xy({point:e},t){return{point:e,delta:Gb(e,Kb(t)),offset:Gb(e,zE(t)),velocity:$E(t,.1)}}function zE(e){return e[0]}function Kb(e){return e[e.length-1]}function $E(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=Kb(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Ue(t)));)a--;if(!r)return{x:0,y:0};let n=ct(o.timestamp-r.timestamp);if(n===0)return{x:0,y:0};let s={x:(o.x-r.x)/n,y:(o.y-r.y)/n};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}var Yb=1e-4,WE=1-Yb,GE=1+Yb,Zb=.01,KE=0-Zb,XE=0+Zb;function pt(e){return e.max-e.min}function eI(e,t,a){return Math.abs(e-t)<=a}function Xb(e,t,a,r=.5){e.origin=r,e.originPoint=ie(t.min,t.max,e.origin),e.scale=pt(a)/pt(t),e.translate=ie(a.min,a.max,e.origin)-e.originPoint,(e.scale>=WE&&e.scale<=GE||isNaN(e.scale))&&(e.scale=1),(e.translate>=KE&&e.translate<=XE||isNaN(e.translate))&&(e.translate=0)}function wi(e,t,a,r){Xb(e.x,t.x,a.x,r?r.originX:void 0),Xb(e.y,t.y,a.y,r?r.originY:void 0)}function Qb(e,t,a){e.min=a.min+t.min,e.max=e.min+pt(t)}function tI(e,t,a){Qb(e.x,t.x,a.x),Qb(e.y,t.y,a.y)}function Jb(e,t,a){e.min=t.min-a.min,e.max=e.min+pt(t)}function Si(e,t,a){Jb(e.x,t.x,a.x),Jb(e.y,t.y,a.y)}function sI(e,{min:t,max:a},r){return t!==void 0&&e<t?e=r?ie(t,e,r.min):Math.max(e,t):a!==void 0&&e>a&&(e=r?ie(a,e,r.max):Math.min(e,a)),e}function aI(e,t,a){return{min:t!==void 0?e.min+t:void 0,max:a!==void 0?e.max+a-(e.max-e.min):void 0}}function iI(e,{top:t,left:a,bottom:r,right:o}){return{x:aI(e.x,a,o),y:aI(e.y,t,r)}}function rI(e,t){let a=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([a,r]=[r,a]),{min:a,max:r}}function lI(e,t){return{x:rI(e.x,t.x),y:rI(e.y,t.y)}}function uI(e,t){let a=.5,r=pt(e),o=pt(t);return o>r?a=ta(t.min,t.max-r,e.min):r>o&&(a=ta(e.min,e.max-o,t.min)),ft(0,1,a)}function dI(e,t){let a={};return t.min!==void 0&&(a.min=t.min-e.min),t.max!==void 0&&(a.max=t.max-e.min),a}var Zf=.35;function cI(e=Zf){return e===!1?e=0:e===!0&&(e=Zf),{x:oI(e,"left","right"),y:oI(e,"top","bottom")}}function oI(e,t,a){return{min:nI(e,t),max:nI(e,a)}}function nI(e,t){return typeof e=="number"?e:e[t]||0}var fI=()=>({translate:0,scale:1,origin:0,originPoint:0}),kn=()=>({x:fI(),y:fI()}),pI=()=>({min:0,max:0}),Te=()=>({x:pI(),y:pI()});function $t(e){return[e("x"),e("y")]}function ep({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function mI({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hI(e,t){if(!t)return e;let a=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:a.y,left:a.x,bottom:r.y,right:r.x}}function vy(e){return e===void 0||e===1}function tp({scale:e,scaleX:t,scaleY:a}){return!vy(e)||!vy(t)||!vy(a)}function Tr(e){return tp(e)||wy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function wy(e){return gI(e.x)||gI(e.y)}function gI(e){return e&&e!=="0%"}function Tu(e,t,a){let r=e-a,o=t*r;return a+o}function yI(e,t,a,r,o){return o!==void 0&&(e=Tu(e,o,r)),Tu(e,a,r)+t}function Sy(e,t=0,a=1,r,o){e.min=yI(e.min,t,a,r,o),e.max=yI(e.max,t,a,r,o)}function Cy(e,{x:t,y:a}){Sy(e.x,t.translate,t.scale,t.originPoint),Sy(e.y,a.translate,a.scale,a.originPoint)}var xI=.999999999999,vI=1.0000000000001;function SI(e,t,a,r=!1){let o=a.length;if(!o)return;t.x=t.y=1;let n,s;for(let i=0;i<o;i++){n=a[i],s=n.projectionDelta;let{visualElement:l}=n.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&n.options.layoutScroll&&n.scroll&&n!==n.root&&Pn(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Cy(e,s)),r&&Tr(n.latestValues)&&Pn(e,n.latestValues))}t.x<vI&&t.x>xI&&(t.x=1),t.y<vI&&t.y>xI&&(t.y=1)}function bo(e,t){e.min=e.min+t,e.max=e.max+t}function wI(e,t,a,r,o=.5){let n=ie(e.min,e.max,o);Sy(e,t,a,n,r)}function Pn(e,t){wI(e.x,t.x,t.scaleX,t.scale,t.originX),wI(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ly(e,t){return ep(hI(e.getBoundingClientRect(),t))}function CI(e,t,a){let r=Ly(e,a),{scroll:o}=t;return o&&(bo(r.x,o.offset.x),bo(r.y,o.offset.y)),r}var ap=({current:e})=>e?e.ownerDocument.defaultView:null;var QE=new WeakMap,op=class{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Te(),this.visualElement=t}start(t,{snapToCursor:a=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let o=d=>{let{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),a&&this.snapToCursor(Pr(d).point)},n=(d,c)=>{let{drag:f,dragPropagation:m,onDragStart:x}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Zg(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$t(b=>{let h=this.getAxisMotionValue(b).get()||0;if(_t.test(h)){let{projection:g}=this.visualElement;if(g&&g.layout){let y=g.layout.layoutBox[b];y&&(h=pt(y)*(parseFloat(h)/100))}}this.originPoint[b]=h}),x&&Z.postRender(()=>x(d,c)),Cu(this.visualElement,"transform");let{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:f,dragDirectionLock:m,onDirectionLock:x,onDrag:w}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:b}=c;if(m&&this.currentDirection===null){this.currentDirection=JE(b),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",c.point,b),this.updateAxis("y",c.point,b),this.visualElement.render(),w&&w(d,c)},i=(d,c)=>this.stop(d,c),l=()=>$t(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new vi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:ap(this.visualElement)})}stop(t,a){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:o}=a;this.startAnimation(o);let{onDragEnd:n}=this.getProps();n&&Z.postRender(()=>n(t,a))}cancel(){this.isDragging=!1;let{projection:t,animationState:a}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),a&&a.setActive("whileDrag",!1)}updateAxis(t,a,r){let{drag:o}=this.getProps();if(!r||!rp(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=sI(s,this.constraints[t],this.elastic[t])),n.set(s)}resolveConstraints(){var t;let{dragConstraints:a,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,n=this.constraints;a&&Lr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=iI(o.layoutBox,a):this.constraints=!1,this.elastic=cI(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&$t(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=dI(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!Lr(t))return!1;let r=t.current;qt(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let n=CI(r,o.root,this.visualElement.getTransformPagePoint()),s=lI(o.layout.layoutBox,n);if(a){let i=a(mI(s));this.hasMutatedConstraints=!!i,i&&(s=ep(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=$t(d=>{if(!rp(d,a,this.currentDirection))return;let c=l&&l[d]||{};s&&(c={min:0,max:0});let f=o?200:1e6,m=o?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...n,...c};return this.startAxisValueAnimation(d,x)});return Promise.all(u).then(i)}startAxisValueAnimation(t,a){let r=this.getAxisMotionValue(t);return Cu(this.visualElement,t),r.start(xi(t,r,0,a,this.visualElement,!1))}stopAnimation(){$t(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$t(t=>{var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.pause()})}getAnimationState(t){var a;return(a=this.getAxisMotionValue(t).animation)===null||a===void 0?void 0:a.state}getAxisMotionValue(t){let a=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[a];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){$t(a=>{let{drag:r}=this.getProps();if(!rp(a,r,this.currentDirection))return;let{projection:o}=this.visualElement,n=this.getAxisMotionValue(a);if(o&&o.layout){let{min:s,max:i}=o.layout.layoutBox[a];n.set(t[a]-ie(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:a}=this.getProps(),{projection:r}=this.visualElement;if(!Lr(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};$t(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=uI({min:l,max:l},this.constraints[s])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),$t(s=>{if(!rp(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(ie(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;QE.set(this.visualElement,this);let t=this.visualElement.current,a=Lo(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();Lr(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,n=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Z.read(r);let s=kr(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&($t(d=>{let c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())}));return()=>{s(),a(),n(),i&&i()}}getProps(){let t=this.visualElement.getProps(),{drag:a=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:n=!1,dragElastic:s=Zf,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function rp(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function JE(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var np=class extends ot{constructor(t){super(t),this.removeGroupControls=ye,this.removeListeners=ye,this.controls=new op(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ye}unmount(){this.removeGroupControls(),this.removeListeners()}};var LI=e=>(t,a)=>{e&&Z.postRender(()=>e(t,a))},sp=class extends ot{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new vi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ap(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:LI(t),onStart:LI(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&Z.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=Lo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var kI=M(ue(),1),Au=M(W(),1);var Ci={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function bI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Li={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=bI(e,t.target.x),r=bI(e,t.target.y);return`${a}% ${r}%`}};var II={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=Et.parse(e);if(o.length>5)return r;let n=Et.createTransformer(e),s=typeof o[0]!="number"?1:0,i=a.x.scale*t.x,l=a.y.scale*t.y;o[0+s]/=i,o[1+s]/=l;let u=ie(i,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),n(o)}};var by=class extends Au.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;NL(YE),n&&(a.group&&a.group.add(n),r&&r.register&&o&&r.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),Ci.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:a,visualElement:r,drag:o,isPresent:n}=this.props,s=r.projection;return s&&(s.isPresent=n,o||t.layoutDependency!==a||a===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==n&&(n?s.promote():s.relegate()||Z.postRender(()=>{let i=s.getStack();(!i||!i.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),$s.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),a&&a.group&&a.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function ip(e){let[t,a]=Qc(),r=(0,Au.useContext)(Us);return(0,kI.jsx)(by,{...e,layoutGroup:r,switchLayoutGroup:(0,Au.useContext)(lf),isPresent:t,safeToRemove:a})}var YE={borderRadius:{...Li,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Li,borderTopRightRadius:Li,borderBottomLeftRadius:Li,borderBottomRightRadius:Li,boxShadow:II};function PI(e,t,a){let r=Ce(e)?e:Ir(e);return r.start(xi("",r,t,a)),r.animation}function TI(e){return e instanceof SVGElement&&e.tagName!=="svg"}var AI=(e,t)=>e.depth-t.depth;var lp=class{constructor(){this.children=[],this.isDirty=!1}add(t){di(this.children,t),this.isDirty=!0}remove(t){ci(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(AI),this.isDirty=!1,this.children.forEach(t)}};function RI(e,t){let a=St.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(aa(r),e(n-t))};return Z.read(r,!0),()=>aa(r)}var MI=["TopLeft","TopRight","BottomLeft","BottomRight"],ZE=MI.length,_I=e=>typeof e=="string"?parseFloat(e):e,EI=e=>typeof e=="number"||H.test(e);function NI(e,t,a,r,o,n){o?(e.opacity=ie(0,a.opacity!==void 0?a.opacity:1,eD(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,tD(r))):n&&(e.opacity=ie(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,r));for(let s=0;s<ZE;s++){let i=`border${MI[s]}Radius`,l=DI(t,i),u=DI(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||EI(l)===EI(u)?(e[i]=Math.max(ie(_I(l),_I(u),r),0),(_t.test(u)||_t.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ie(t.rotate||0,a.rotate||0,r))}function DI(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var eD=OI(0,.5,Df),tD=OI(.5,.95,ye);function OI(e,t,a){return r=>r<e?0:r>t?1:a(ta(e,t,r))}function FI(e,t){e.min=t.min,e.max=t.max}function oa(e,t){FI(e.x,t.x),FI(e.y,t.y)}function Iy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function BI(e,t,a,r,o){return e-=t,e=Tu(e,1/a,r),o!==void 0&&(e=Tu(e,1/o,r)),e}function aD(e,t=0,a=1,r=.5,o,n=e,s=e){if(_t.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=ie(n.min,n.max,r);e===n&&(i-=t),e.min=BI(e.min,t,a,i,o),e.max=BI(e.max,t,a,i,o)}function UI(e,t,[a,r,o],n,s){aD(e,t[a],t[r],t[o],t.scale,n,s)}var rD=["x","scaleX","originX"],oD=["y","scaleY","originY"];function ky(e,t,a,r){UI(e.x,t,rD,a?a.x:void 0,r?r.x:void 0),UI(e.y,t,oD,a?a.y:void 0,r?r.y:void 0)}function VI(e){return e.translate===0&&e.scale===1}function Py(e){return VI(e.x)&&VI(e.y)}function jI(e,t){return e.min===t.min&&e.max===t.max}function HI(e,t){return jI(e.x,t.x)&&jI(e.y,t.y)}function qI(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ty(e,t){return qI(e.x,t.x)&&qI(e.y,t.y)}function Ay(e){return pt(e.x)/pt(e.y)}function Ry(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var up=class{constructor(){this.members=[]}add(t){di(this.members,t),t.scheduleRender()}remove(t){if(ci(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let a=this.members[this.members.length-1];a&&this.promote(a)}}relegate(t){let a=this.members.findIndex(o=>t===o);if(a===0)return!1;let r;for(let o=a;o>=0;o--){let n=this.members[o];if(n.isPresent!==!1){r=n;break}}return r?(this.promote(r),!0):!1}promote(t,a){let r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,a&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:a,resumingFrom:r}=t;a.onExitComplete&&a.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}};function zI(e,t,a){let r="",o=e.x.translate/t.x,n=e.y.translate/t.y,s=a?.z||0;if((o||n||s)&&(r=`translate3d(${o}px, ${n}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),a){let{transformPerspective:u,rotate:d,rotateX:c,rotateY:f,skewX:m,skewY:x}=a;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),c&&(r+=`rotateX(${c}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),x&&(r+=`skewY(${x}deg) `)}let i=e.x.scale*t.x,l=e.y.scale*t.y;return(i!==1||l!==1)&&(r+=`scale(${i}, ${l})`),r||"none"}var Tn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ru=typeof window<"u"&&window.MotionDebug!==void 0,_y=["","X","Y","Z"],nD={visibility:"hidden"},$I=1e3,sD=0;function Ey(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ZI(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=kf(t);if(window.MotionHasOptimisedAnimation(a,"transform")){let{layout:o,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(a,"transform",Z,!(o||n))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ZI(r)}function dp({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=sD++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ru&&(Tn.totalNodes=Tn.resolvedTargetDeltas=Tn.recalculatedProjection=0),this.nodes.forEach(uD),this.nodes.forEach(mD),this.nodes.forEach(hD),this.nodes.forEach(dD),Ru&&window.MotionDebug.record(Tn)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new lp)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new yo),this.eventHandlers.get(s).add(i)}notifyListeners(s,...i){let l=this.eventHandlers.get(s);l&&l.notify(...i)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=TI(s),this.instance=s;let{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(u||l)&&(this.isLayoutDirty=!0),e){let c,f=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=RI(f,250),Ci.hasAnimatedSinceResize&&(Ci.hasAnimatedSinceResize=!1,this.nodes.forEach(GI))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeTargetChanged:m,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let w=this.options.transition||d.getDefaultTransition()||wD,{onLayoutAnimationStart:b,onLayoutAnimationComplete:h}=d.getProps(),g=!this.targetLayout||!Ty(this.targetLayout,x)||m,y=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||f&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,y);let C={...mo(w,"layout"),onPlay:b,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else f||GI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,aa(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(gD),this.animationId++)}getTransformTemplate(){let{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ZI(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){let c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}let{layoutId:i,layout:l}=this.options;if(i===void 0&&!l)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(WI);return}this.isUpdating||this.nodes.forEach(fD),this.isUpdating=!1,this.nodes.forEach(pD),this.nodes.forEach(iD),this.nodes.forEach(lD),this.clearAllSnapshots();let i=St.now();Ve.delta=ft(0,1e3/60,i-Ve.timestamp),Ve.timestamp=i,Ve.isProcessing=!0,tf.update.process(Ve),tf.preRender.process(Ve),tf.render.process(Ve),Ve.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$s.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cD),this.sharedNodes.forEach(yD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Z.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Z.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();let s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Te(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:i}=this.options;i&&i.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let i=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(i=!1),i){let l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:a(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;let s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,i=this.projectionDelta&&!Py(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||Tr(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){let i=this.measurePageBox(),l=this.removeElementScroll(i);return s&&(l=this.removeTransform(l)),SD(l),{animationId:this.root.animationId,measuredBox:i,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var s;let{visualElement:i}=this.options;if(!i)return Te();let l=i.measureViewportBox();if(!(((s=this.scroll)===null||s===void 0?void 0:s.wasRoot)||this.path.some(CD))){let{scroll:d}=this.root;d&&(bo(l.x,d.offset.x),bo(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Te();if(oa(l,s),!((i=this.scroll)===null||i===void 0)&&i.wasRoot)return l;for(let u=0;u<this.path.length;u++){let d=this.path[u],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&oa(l,s),bo(l.x,c.offset.x),bo(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Te();oa(l,s);for(let u=0;u<this.path.length;u++){let d=this.path[u];!i&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Pn(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Tr(d.latestValues)&&Pn(l,d.latestValues)}return Tr(this.latestValues)&&Pn(l,this.latestValues),l}removeTransform(s){let i=Te();oa(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Tr(u.latestValues))continue;tp(u.latestValues)&&u.updateSnapshot();let d=Te(),c=u.measurePageBox();oa(d,c),ky(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Tr(this.latestValues)&&ky(i,this.latestValues),i}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.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!==Ve.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var i;let l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=Ve.timestamp,!this.targetDelta&&!this.relativeTarget){let m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Si(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),oa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Te(),this.targetWithTransforms=Te()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),tI(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):oa(this.target,this.layout.layoutBox),Cy(this.target,this.targetDelta)):oa(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Te(),this.relativeTargetOrigin=Te(),Si(this.relativeTargetOrigin,this.target,m.target),oa(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ru&&Tn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||tp(this.parent.latestValues)||wy(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;let i=this.getLead(),l=!!this.resumingFrom||this!==i,u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ve.timestamp&&(u=!1),u)return;let{layout:d,layoutId:c}=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||c))return;oa(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;SI(this.layoutCorrected,this.treeScale,this.path,l),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=Te());let{target:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Iy(this.prevProjectionDelta.x,this.projectionDelta.x),Iy(this.prevProjectionDelta.y,this.projectionDelta.y)),wi(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ry(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ry(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Ru&&Tn.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){var i;if((i=this.options.visualElement)===null||i===void 0||i.scheduleRender(),s){let l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=kn(),this.projectionDelta=kn(),this.projectionDeltaWithTransform=kn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=kn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Te(),m=l?l.source:void 0,x=this.layout?this.layout.source:void 0,w=m!==x,b=this.getStack(),h=!b||b.members.length<=1,g=!!(w&&!h&&this.options.crossfade===!0&&!this.path.some(vD));this.animationProgress=0;let y;this.mixTargetDelta=C=>{let L=C/1e3;KI(c.x,s.x,L),KI(c.y,s.y,L),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Si(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xD(this.relativeTarget,this.relativeTargetOrigin,f,L),y&&HI(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Te()),oa(y,this.relativeTarget)),w&&(this.animationValues=d,NI(d,u,this.latestValues,L,g,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(aa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Z.update(()=>{Ci.hasAnimatedSinceResize=!0,this.currentAnimation=PI(0,$I,{...s,onUpdate:i=>{this.mixTargetDelta(i),s.onUpdate&&s.onUpdate(i)},onComplete:()=>{s.onComplete&&s.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);let s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($I),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let s=this.getLead(),{targetWithTransforms:i,target:l,layout:u,latestValues:d}=s;if(!(!i||!l||!u)){if(this!==s&&this.layout&&u&&ek(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Te();let c=pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let f=pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}oa(i,l),Pn(i,d),wi(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new up),this.sharedNodes.get(s).add(i);let u=i.options.initialPromotionConfig;i.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(i):void 0})}isLead(){let s=this.getStack();return s?s.lead===this:!0}getLead(){var s;let{layoutId:i}=this.options;return i?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;let{layoutId:i}=this.options;return i?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){let{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:i,preserveFollowOpacity:l}={}){let u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),i&&this.setOptions({transition:i})}relegate(){let s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){let{visualElement:s}=this.options;if(!s)return;let i=!1,{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(i=!0),!i)return;let u={};l.z&&Ey("z",s,u,this.animationValues);for(let d=0;d<_y.length;d++)Ey(`rotate${_y[d]}`,s,u,this.animationValues),Ey(`skew${_y[d]}`,s,u,this.animationValues);s.render();for(let d in u)s.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);s.scheduleRender()}getProjectionStyles(s){var i,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return nD;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Xs(s?.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=Xs(s?.pointerEvents)||""),this.hasProjected&&!Tr(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=zI(this.projectionDeltaWithTransform,this.treeScale,f),d&&(u.transform=d(f,u.transform));let{x:m,y:x}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${x.origin*100}% 0`,c.animationValues?u.opacity=c===this?(l=(i=f.opacity)!==null&&i!==void 0?i:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(let w in ai){if(f[w]===void 0)continue;let{correct:b,applyTo:h}=ai[w],g=u.transform==="none"?f[w]:b(f[w],c);if(h){let y=h.length;for(let C=0;C<y;C++)u[h[C]]=g}else u[w]=g}return this.options.layoutId&&(u.pointerEvents=c===this?Xs(s?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var i;return(i=s.currentAnimation)===null||i===void 0?void 0:i.stop()}),this.root.nodes.forEach(WI),this.root.sharedNodes.clear()}}}function iD(e){e.updateLayout()}function lD(e){var t;let a=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&a&&e.hasListeners("didUpdate")){let{layoutBox:r,measuredBox:o}=e.layout,{animationType:n}=e.options,s=a.source!==e.layout.source;n==="size"?$t(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],m=pt(f);f.min=r[c].min,f.max=f.min+m}):ek(n,a.layoutBox,r)&&$t(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],m=pt(r[c]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+m)});let i=kn();wi(i,r,a.layoutBox);let l=kn();s?wi(l,e.applyTransform(o,!0),a.measuredBox):wi(l,r,a.layoutBox);let u=!Py(i),d=!1;if(!e.resumeFrom){let c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){let{snapshot:f,layout:m}=c;if(f&&m){let x=Te();Si(x,a.layoutBox,f.layoutBox);let w=Te();Si(w,r,m.layoutBox),Ty(x,w)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:a,delta:l,layoutDelta:i,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){let{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function uD(e){Ru&&Tn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function dD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cD(e){e.clearSnapshot()}function WI(e){e.clearMeasurements()}function fD(e){e.isLayoutDirty=!1}function pD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function GI(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function mD(e){e.resolveTargetDelta()}function hD(e){e.calcProjection()}function gD(e){e.resetSkewAndRotation()}function yD(e){e.removeLeadSnapshot()}function KI(e,t,a){e.translate=ie(t.translate,0,a),e.scale=ie(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function XI(e,t,a,r){e.min=ie(t.min,a.min,r),e.max=ie(t.max,a.max,r)}function xD(e,t,a,r){XI(e.x,t.x,a.x,r),XI(e.y,t.y,a.y,r)}function vD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var wD={duration:.45,ease:[.4,0,.1,1]},QI=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),JI=QI("applewebkit/")&&!QI("chrome/")?Math.round:ye;function YI(e){e.min=JI(e.min),e.max=JI(e.max)}function SD(e){YI(e.x),YI(e.y)}function ek(e,t,a){return e==="position"||e==="preserve-aspect"&&!eI(Ay(t),Ay(a),.2)}function CD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var tk=dp({attachResizeListener:(e,t)=>kr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var Dy={current:void 0},cp=dp({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Dy.current){let e=new tk({});e.mount(window),e.setOptions({layoutScroll:!0}),Dy.current=e}return Dy.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var ak={pan:{Feature:sp},drag:{Feature:np,ProjectionNode:cp,MeasureLayout:ip}};function rk(e,t,a){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",a==="Start");let o="onHover"+a,n=r[o];n&&Z.postRender(()=>n(t,Pr(t)))}var fp=class extends ot{mount(){let{current:t}=this.node;t&&(this.unmount=Qg(t,a=>(rk(this.node,a,"Start"),r=>rk(this.node,r,"End"))))}unmount(){}};var pp=class extends ot{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Xa(kr(this.node.current,"focus",()=>this.onFocus()),kr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function ok(e,t,a){let{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",a==="Start");let o="onTap"+(a==="End"?"":a),n=r[o];n&&Z.postRender(()=>n(t,Pr(t)))}var mp=class extends ot{mount(){let{current:t}=this.node;t&&(this.unmount=Yg(t,a=>(ok(this.node,a,"Start"),(r,{success:o})=>ok(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Ny=new WeakMap,My=new WeakMap,LD=e=>{let t=Ny.get(e.target);t&&t(e)},bD=e=>{e.forEach(LD)};function ID({root:e,...t}){let a=e||document;My.has(a)||My.set(a,{});let r=My.get(a),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(bD,{root:e,...t})),r[o]}function nk(e,t,a){let r=ID(t);return Ny.set(e,a),r.observe(e),()=>{Ny.delete(e),r.unobserve(e)}}var kD={some:0,all:1},hp=class extends ot{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:a,margin:r,amount:o="some",once:n}=t,s={root:a?a.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:kD[o]},i=l=>{let{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,n&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);let{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return nk(this.node.current,s,i)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;let{props:t,prevProps:a}=this.node;["amount","margin","root"].some(PD(t,a))&&this.startObserver()}unmount(){}};function PD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var sk={inView:{Feature:hp},tap:{Feature:mp},focus:{Feature:pp},hover:{Feature:fp}};var ik={layout:{ProjectionNode:cp,MeasureLayout:ip}};var fk=M(W(),1);var _u={current:null},gp={current:!1};function lk(){if(gp.current=!0,!!js)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_u.current=e.matches;e.addListener(t),t()}else _u.current=!1}var TD=[...iy,$e,Et],uk=e=>TD.find(Uf(e));var Oy=new WeakMap;function dk(e,t,a){for(let r in t){let o=t[r],n=a[r];if(Ce(o))e.addValue(r,o);else if(Ce(n))e.addValue(r,Ir(o,{owner:e}));else if(n!==o)if(e.hasValue(r)){let s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{let s=e.getStaticValue(r);e.addValue(r,Ir(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var ck=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],yp=class{scrapeMotionValuesFromProps(t,a,r){return{}}constructor({parent:t,props:a,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:n,visualState:s},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=So,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=()=>{let m=St.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Z.render(this.render,!1,!0))};let{latestValues:l,renderState:u,onUpdate:d}=s;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=a.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=a,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=i,this.blockInitialAnimation=!!n,this.isControllingVariants=xn(a),this.isVariantNode=of(a),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:c,...f}=this.scrapeMotionValuesFromProps(a,{},this);for(let m in f){let x=f[m];l[m]!==void 0&&Ce(x)&&x.set(l[m],!1)}}mount(t){this.current=t,Oy.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((a,r)=>this.bindToMotionValue(r,a)),gp.current||lk(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_u.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Oy.delete(this.current),this.projection&&this.projection.unmount(),aa(this.notifyUpdate),aa(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(let t in this.events)this.events[t].clear();for(let t in this.features){let a=this.features[t];a&&(a.unmount(),a.isMounted=!1)}this.current=null}bindToMotionValue(t,a){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let r=zt.has(t),o=a.on("change",i=>{this.latestValues[t]=i,this.props.onUpdate&&Z.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),n=a.on("renderRequest",this.scheduleRender),s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,a)),this.valueSubscriptions.set(t,()=>{o(),n(),s&&s(),a.owner&&a.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Sr){let a=Sr[t];if(!a)continue;let{isEnabled:r,Feature:o}=a;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){let n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Te()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,a){this.latestValues[t]=a}update(t,a){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=a;for(let r=0;r<ck.length;r++){let o=ck[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);let n="on"+o,s=t[n];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=dk(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]: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(t){let a=this.getClosestVariantNode();if(a)return a.variantChildren&&a.variantChildren.add(t),()=>a.variantChildren.delete(t)}addValue(t,a){let r=this.values.get(t);a!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,a),this.values.set(t,a),this.latestValues[t]=a.get())}removeValue(t){this.values.delete(t);let a=this.valueSubscriptions.get(t);a&&(a(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,a){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&a!==void 0&&(r=Ir(a===null?void 0:a,{owner:this}),this.addValue(t,r)),r}readValue(t,a){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Bf(o)||Nf(o))?o=parseFloat(o):!uk(o)&&Et.test(a)&&(o=Ff(t,a)),this.setBaseTarget(t,Ce(o)?o.get():o)),Ce(o)?o.get():o}setBaseTarget(t,a){this.baseTarget[t]=a}getBaseTarget(t){var a;let{initial:r}=this.props,o;if(typeof r=="string"||typeof r=="object"){let s=Ks(this.props,r,(a=this.presenceContext)===null||a===void 0?void 0:a.custom);s&&(o=s[t])}if(r&&o!==void 0)return o;let n=this.getBaseTargetFromProps(this.props,t);return n!==void 0&&!Ce(n)?n:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,a){return this.events[t]||(this.events[t]=new yo),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var bi=class extends yp{constructor(){super(...arguments),this.KeyframeResolver=hi}sortInstanceNodePosition(t,a){return t.compareDocumentPosition(a)&2?1:-1}getBaseTargetFromProps(t,a){return t.style?t.style[a]:void 0}removeValueFromRenderState(t,{vars:a,style:r}){delete a[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;Ce(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function AD(e){return window.getComputedStyle(e)}var xp=class extends bi{constructor(){super(...arguments),this.type="html",this.renderInstance=mf}readValueFromInstance(t,a){if(zt.has(a)){let r=mi(a);return r&&r.default||0}else{let r=AD(t),o=(cf(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return Ly(t,a)}build(t,a,r){Ys(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return ri(t,a,r)}};var vp=class extends bi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Te}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(zt.has(a)){let r=mi(a);return r&&r.default||0}return a=hf.has(a)?a:zs(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return xf(t,a,r)}build(t,a,r){Zs(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){gf(t,a,r,o)}mount(t){this.isSVGTag=ti(t.tagName),super.mount(t)}};var pk=(e,t)=>Gs(e)?new vp(t):new xp(t,{allowProjection:e!==fk.Fragment});var mk=zL({...Hb,...sk,...ak,...ik},pk);var Eu=dL(mk);function RD(e){e.values.forEach(t=>t.stop())}function Fy(e,t){[...t].reverse().forEach(r=>{let o=e.getVariant(r);o&&Su(e,o),e.variantChildren&&e.variantChildren.forEach(n=>{Fy(n,t)})})}function _D(e,t){if(Array.isArray(t))return Fy(e,t);if(typeof t=="string")return Fy(e,[t]);Su(e,t)}function hk(){let e=!1,t=new Set,a={subscribe(r){return t.add(r),()=>{t.delete(r)}},start(r,o){qt(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");let n=[];return t.forEach(s=>{n.push(Qf(s,r,{transitionOverride:o}))}),Promise.all(n)},set(r){return qt(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),t.forEach(o=>{_D(o,r)})},stop(){t.forEach(r=>{RD(r)})},mount(){return e=!0,()=>{e=!1,a.stop()}}};return a}function By(){let e=io(hk);return qs(e.mount,[]),e}var Oe=M(ue(),1);function gk({phase:e,progressSteps:t=[]}){return(0,Oe.jsxs)("div",{className:"mb-3 rounded-lg bg-muted/40 px-3 py-3 text-xs text-muted-foreground transition-colors",children:[e==="thinking"&&t.length===0&&(0,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(Rt,{className:"h-3.5 w-3.5 animate-spin"}),(0,Oe.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Oe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Oe.jsx)(hn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Oe.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Oe.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Oe.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Oe.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Oe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Oe.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Oe.jsx)(rt,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Oe.jsx)(Rt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Oe.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Oe.jsx)(Rt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Oe.jsx)("span",{children:"Preparing response..."})]})]})]})}var yk=M(W(),1);var _a=M(ue(),1);function xk({title:e,links:t}){let[a,r]=yk.useState(!1);return(0,_a.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,_a.jsx)("button",{type:"button",onClick:()=>r(o=>!o),className:"flex w-full items-center gap-2 px-0 py-0","aria-expanded":a,children:(0,_a.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,_a.jsx)(ou,{className:"h-3 w-3 opacity-70"}):(0,_a.jsx)(hn,{className:"h-3 w-3 opacity-70"}),(0,_a.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,_a.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,_a.jsx)("li",{children:(0,_a.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var Du=M(ue(),1);function vk({x:e,y:t,visible:a,onClick:r=!1}){return(0,Du.jsx)(Vg,{children:a&&(0,Du.jsx)(Eu.div,{className:"fixed pointer-events-none z-[9999]",initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1,x:e,y:t},exit:{opacity:0,scale:.5},transition:{type:"spring",stiffness:200,damping:20},style:{left:0,top:0},children:(0,Du.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Du.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var Ii=M(W(),1);function wk(){let[e,t]=Ii.useState({x:0,y:0,visible:!1,onClick:!1}),a=Ii.useCallback(n=>{let s=document.querySelector(n.selector);if(s){let i=s.getBoundingClientRect(),l=n.offset?.x||0,u=n.offset?.y||0;t({x:i.left+i.width/2+l,y:i.top+i.height/2+u,visible:!0,onClick:n.onClick||!1})}},[]),r=Ii.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=Ii.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var Qa=M(W(),1);function Sk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=Qa.useState({status:"idle"}),n=Qa.useRef(null),s=Qa.useRef(a),i=Qa.useCallback(async()=>{if(!e||!a){o({status:"idle"});return}o({status:"loading"});try{let u=await fetch(`${e}/users/me`,{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(!u.ok)throw u.status===401?new Error("Please log in to use the chat assistant."):u.status===403?new Error("You do not have permission to access this feature."):new Error(`Authentication failed (${u.status})`);let d=await u.json();o({status:"authenticated",user:d})}catch(u){if(u instanceof Error){let c=u.message.toLowerCase(),f=u instanceof TypeError||c.includes("failed to fetch")||c.includes("network"),m=c.includes("404");if(f||m){console.warn("[useUserAuth] Auth endpoint unavailable, falling back to unauthenticated mode:",u.message),o({status:"idle"});return}}let d=u instanceof Error?u.message:"Unable to verify your identity. Please try again.";o({status:"error",error:d})}},[e,a]);Qa.useEffect(()=>{let u=t!==n.current,d=a!==s.current,c=a&&!s.current;u&&(n.current=t),d&&(s.current=a),(u||c)&&i()},[t,a,i]);let l=Qa.useCallback(()=>{i()},[i]);return{authState:r,retry:l}}var wp=M(W(),1);function Ck({agentUrl:e,orgId:t}){let[a,r]=wp.useState({status:"idle",config:null,error:null});return wp.useEffect(()=>{if(!e||!t)return;(async()=>{r({status:"loading",config:null,error:null});let n=`${e}/org/${t}/config`;try{let s=await fetch(n,{method:"GET",headers:{Accept:"application/json"}});if(!s.ok)throw new Error(`Failed to fetch org config (${s.status})`);let i=await s.json();r({status:"success",config:i,error:null})}catch(s){let i=s instanceof Error?s.message:"Failed to fetch org config";console.error("[useOrgConfig] Error:",i),r({status:"error",config:null,error:i})}})()},[e,t]),a}var Uy=M(W(),1);function Lk({productBackendUrl:e,agentUrl:t,sessionId:a}){let r=(0,Uy.useCallback)(async n=>{try{await fetch(`${t}/chat/tool-result`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(s){console.error("[FrontendToolExecutor] Failed to send tool result:",s)}},[t]);return{executeToolRequest:(0,Uy.useCallback)(async n=>{let{call_id:s,arguments:i,endpoint:l,method:u,path_params:d}=n;try{let c=l;for(let h of d)i[h]&&(c=c.replace(`{${h}}`,encodeURIComponent(i[h])));let f=new URLSearchParams;for(let[h,g]of Object.entries(i))!d.includes(h)&&g!==void 0&&g!==null&&f.append(h,String(g));let m=f.toString(),x=`${e}${c}${m?"?"+m:""}`,w=await fetch(x,{method:u,credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"}}),b;if(w.ok)b=await w.json();else{let h=await w.text();throw new Error(`HTTP ${w.status}: ${h}`)}await r({session_id:a,call_id:s,result:b})}catch(c){console.error("[FrontendToolExecutor] Tool execution failed:",c),await r({session_id:a,call_id:s,error:c instanceof Error?c.message:"Unknown error"})}},[e,a,r])}}var ki=M(ue(),1);function Ct({className:e,...t}){return(0,ki.jsx)("div",{"data-slot":"card",className:Zt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ja({className:e,...t}){return(0,ki.jsx)("div",{"data-slot":"card-header",className:Zt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Ya({className:e,...t}){return(0,ki.jsx)("div",{"data-slot":"card-title",className:Zt("leading-none font-semibold",e),...t})}function Vy({className:e,...t}){return(0,ki.jsx)("div",{"data-slot":"card-description",className:Zt("text-muted-foreground text-sm",e),...t})}function Lt({className:e,...t}){return(0,ki.jsx)("div",{"data-slot":"card-content",className:Zt("px-6",e),...t})}var S=M(ue(),1),jy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Sp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),qy=e=>{switch(e){case"Enterprise":return fn;case"Professional":return uu;default:return tu}},Cp=e=>{switch(e){case"Enterprise":return"bg-purple-50 text-purple-700 border-purple-200";case"Professional":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-gray-50 text-gray-700 border-gray-200"}};function Mu({status:e,type:t="default"}){let r=(()=>{let n=e.toLowerCase();if(t==="transaction")switch(n){case"paid":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:rt};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:Ra};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:dn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Os};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Aa}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:rt};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ra};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:Aa};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:dn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Aa}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:rt};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ra};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Aa}}})(),o=r.icon;return(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium border ${r.color}`,children:[(0,S.jsx)(o,{className:"h-3 w-3"}),e]})}function ED({subscription:e}){let t=qy(e.plan);return(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":e.status==="past_due"?"bg-red-500":"bg-slate-300"}`}),(0,S.jsx)(Ja,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsxs)("div",{className:"space-y-1",children:[(0,S.jsxs)(Ya,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(cn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(Vy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(Ms,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(Mu,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(Lt,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Cp(e.plan)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.plan]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Billing"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900",children:[Sp(e.amount,e.currency)," / ",e.billing_cycle]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Current Period"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700",children:[jy(e.current_period_start)," - ",jy(e.current_period_end)]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Created"}),(0,S.jsx)("div",{className:"text-sm text-gray-700",children:jy(e.created_at)})]})]})]})})]})}function DD({subscriptions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(cn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No subscriptions found"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ja,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ya,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(cn,{className:"h-4 w-4"}),e.length," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=qy(o.plan);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${Cp(o.plan).replace("text-","text-").replace("border-","bg-").split(" ")[0]}`,children:(0,S.jsx)(n,{className:"h-4 w-4"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer_email||o.customer_id}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.plan," \xB7 ",Sp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(Mu,{status:o.status,type:"subscription"})]})},o.id)})}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more subscription",e.length-t!==1?"s":""]})})]})]})}function MD({customer:e}){let t=qy(e.subscription);return(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)("div",{className:`h-1 ${e.status==="active"?"bg-emerald-500":"bg-slate-300"}`}),(0,S.jsx)(Ja,{className:"pb-3",children:(0,S.jsxs)("div",{className:"flex items-start justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3",children:(0,S.jsxs)("div",{children:[(0,S.jsx)(Ya,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(Vy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(Ms,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(Mu,{status:e.status,type:"customer"})]})}),(0,S.jsx)(Lt,{className:"pt-0",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Plan"}),(0,S.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium border ${Cp(e.subscription)}`,children:[(0,S.jsx)(t,{className:"h-3 w-3"}),e.subscription]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Revenue"}),(0,S.jsxs)("div",{className:"text-sm font-medium text-gray-900 flex items-center gap-1",children:[(0,S.jsx)(pn,{className:"h-3 w-3 text-emerald-500"}),e.revenue]})]})]}),(0,S.jsxs)("div",{className:"space-y-3",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Location"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(Ns,{className:"h-3 w-3 text-gray-400"}),e.location||"Not specified"]})]}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:"Customer Since"}),(0,S.jsxs)("div",{className:"text-sm text-gray-700 flex items-center gap-1",children:[(0,S.jsx)(ru,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function ND({customers:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Bs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No customers found"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ja,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ya,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Bs,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:o.email})]})}),(0,S.jsxs)("div",{className:"flex items-center gap-2",children:[(0,S.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Cp(o.subscription)}`,children:o.subscription}),(0,S.jsx)(Mu,{status:o.status,type:"customer"})]})]})},o.id))}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more customer",e.length-t!==1?"s":""]})})]})]})}function bk({transactions:e,maxItems:t=5}){let a=e.slice(0,t),r=e.length>t;return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(pn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No transactions found"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ja,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ya,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(pn,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(Lt,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`p-2 rounded-lg ${o.status==="paid"?"bg-emerald-50":o.status==="failed"?"bg-red-50":o.status==="refunded"?"bg-slate-50":"bg-amber-50"}`,children:o.status==="paid"?(0,S.jsx)(rt,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(Ra,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)(Os,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(dn,{className:"h-4 w-4 text-amber-600"})}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:o.customer}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:[o.date,o.decline_reason&&(0,S.jsxs)("span",{className:"text-red-500 ml-2",children:["\xB7 ",o.decline_reason]})]})]})]}),(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsxs)("span",{className:`text-sm font-semibold ${o.status==="paid"?"text-emerald-600":o.status==="failed"?"text-red-600":o.status==="refunded"?"text-slate-600":"text-amber-600"}`,children:[o.status==="refunded"?"-":"",o.amount]}),(0,S.jsx)(Mu,{status:o.status,type:"transaction"})]})]})},o.id))}),r&&(0,S.jsx)("div",{className:"px-4 py-2 bg-gray-50 border-t border-gray-100 text-center",children:(0,S.jsxs)("span",{className:"text-xs text-gray-500",children:["+",e.length-t," more transaction",e.length-t!==1?"s":""]})})]})]})}function OD({apiKeys:e}){return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Ds,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No API keys found"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ja,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ya,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ds,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:t.name}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 font-mono",children:[t.key.slice(0,12),"...",t.key.slice(-4)]})]}),(0,S.jsxs)("div",{className:"text-xs text-gray-500",children:["Last used: ",t.lastUsed]})]})},a))})})]})}function FD({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?iu:nu};return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(Fs,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No active sessions"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ja,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ya,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Fs,{className:"h-4 w-4"}),e.length," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((a,r)=>{let o=t(a.device);return(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3",children:[(0,S.jsx)("div",{className:"p-2 rounded-lg bg-gray-100",children:(0,S.jsx)(o,{className:"h-4 w-4 text-gray-600"})}),(0,S.jsxs)("div",{children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900",children:a.device}),(0,S.jsxs)("div",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(Ns,{className:"h-3 w-3"}),a.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function BD({stats:e}){return(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ja,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ya,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(lu,{className:"h-4 w-4"}),"Dashboard Overview"]})}),(0,S.jsx)(Lt,{className:"p-4",children:(0,S.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[e.revenue&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-emerald-50 border border-emerald-100",children:[(0,S.jsx)("div",{className:"text-xs text-emerald-600 font-medium mb-1",children:"Revenue"}),(0,S.jsx)("div",{className:"text-lg font-bold text-emerald-700",children:Sp(e.revenue.total)}),e.revenue.change!==0&&(0,S.jsxs)("div",{className:`text-xs ${e.revenue.change>0?"text-emerald-600":"text-red-600"}`,children:[e.revenue.change>0?"+":"",e.revenue.change,"% from last period"]})]}),e.subscriptions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-100",children:[(0,S.jsx)("div",{className:"text-xs text-blue-600 font-medium mb-1",children:"Subscriptions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-blue-700",children:[e.subscriptions.active," active"]}),(0,S.jsxs)("div",{className:"text-xs text-blue-600",children:[e.subscriptions.total," total"]})]}),e.customers&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-purple-50 border border-purple-100",children:[(0,S.jsx)("div",{className:"text-xs text-purple-600 font-medium mb-1",children:"Customers"}),(0,S.jsx)("div",{className:"text-lg font-bold text-purple-700",children:e.customers.total}),e.customers.new>0&&(0,S.jsxs)("div",{className:"text-xs text-purple-600",children:["+",e.customers.new," new this period"]})]}),e.transactions&&(0,S.jsxs)("div",{className:"p-3 rounded-lg bg-amber-50 border border-amber-100",children:[(0,S.jsx)("div",{className:"text-xs text-amber-600 font-medium mb-1",children:"Transactions"}),(0,S.jsxs)("div",{className:"text-lg font-bold text-amber-700",children:[e.transactions.successful," successful"]}),e.transactions.failed>0&&(0,S.jsxs)("div",{className:"text-xs text-red-600",children:[e.transactions.failed," failed"]})]})]})})]})}function UD({customers:e}){return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(Lt,{className:"py-8 text-center",children:[(0,S.jsx)(fn,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),(0,S.jsx)("p",{className:"text-sm text-gray-500",children:"No top customers data"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ja,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ya,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(fn,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(Lt,{className:"p-0",children:(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:e.map((t,a)=>(0,S.jsx)("div",{className:"px-4 py-3 hover:bg-gray-50 transition-colors",children:(0,S.jsxs)("div",{className:"flex items-center justify-between",children:[(0,S.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,S.jsx)("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs font-bold ${a===0?"bg-amber-100 text-amber-700":a===1?"bg-slate-100 text-slate-700":a===2?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"}`,children:a+1}),(0,S.jsxs)("div",{className:"min-w-0",children:[(0,S.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:t.name}),(0,S.jsx)("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),(0,S.jsx)("div",{className:"text-sm font-semibold text-emerald-600",children:typeof t.revenue=="number"?Sp(t.revenue):t.revenue})]})},a))})})]})}function Ik({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(ED,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,S.jsx)(DD,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,S.jsx)(MD,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,S.jsx)(ND,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(bk,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(bk,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(BD,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(UD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(OD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(FD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var An=M(ue(),1);function kk({className:e=""}){return(0,An.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,An.jsxs)("div",{className:"flex items-center gap-1",children:[(0,An.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,An.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,An.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=M(ue(),1);var VD="http://localhost:5002",Lp=400,jD=600;function qD(e){return e.replace(/\\\\n/g,`
|
|
59
24
|
`).replace(/\\\\t/g," ").replace(/\\\\"/g,'"').replace(/\\\\\\\\/g,"\\").replace(/\\n/g,`
|
|
60
|
-
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function
|
|
61
|
-
`),
|
|
62
|
-
`)})},r.length)),o=!1,n=[],s=""):(l(),o=!0,s=c.slice(3).trim());continue}if(o){n.push(c);continue}let d=c.match(/^(#{1,6})\s+(.+)/);if(d){l();let v=d[1].length,x=i(d[2]),b=v===1?"text-lg font-bold my-1":v===2?"text-base font-bold my-1":"text-sm font-semibold my-1";r.push((0,p.jsx)("div",{className:b,children:x},r.length));continue}let f=c.match(/^[-*]\s+(.+)/);if(f){(!a||a.type!=="ul")&&(l(),a={type:"ul",items:[]}),a.items.push(i(f[1]));continue}let m=c.match(/^\d+[.)]\s+(.+)/);if(m){(!a||a.type!=="ol")&&(l(),a={type:"ol",items:[]}),a.items.push(i(m[1]));continue}if(c.trim()===""){l(),r.push((0,p.jsx)("div",{className:"h-2"},r.length));continue}if(c.match(/^[-*_]{3,}$/)){l(),r.push((0,p.jsx)("hr",{className:"my-2 border-gray-200"},r.length));continue}l(),r.push((0,p.jsx)("div",{children:i(c)},r.length))}return l(),(0,p.jsx)(p.Fragment,{children:r})}var cN=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],hk=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],Vy={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},dN=[];function fN(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Rt,{className:"h-8 w-8 animate-spin text-gray-400 mb-3"}),(0,p.jsx)("p",{className:"text-xs text-gray-500",children:"Verifying your identity..."})]})}function pN({error:e,onRetry:t}){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[(0,p.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mb-4",children:(0,p.jsx)(ba,{className:"h-6 w-6 text-red-600"})}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Unable to Start Chat"}),(0,p.jsx)("p",{className:"text-xs text-gray-500 mb-4 max-w-[240px]",children:e}),(0,p.jsx)(it,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function mN({isOpen:e=!0,onClose:t,onOpen:r,onBack:a,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=sN,startingQuestions:l,startingQuestionsEndpoint:u,userId:c,orgId:d,userName:f,userEmail:m,supabaseUrl:v,supabaseAnonKey:x,initialCorner:b="bottom-left",onCornerChange:g,productBackendUrl:h}={}){let[y,w]=B.useState(dN),[L,P]=B.useState(""),[_,A]=B.useState(b),[F,V]=B.useState(!1),me=My(),ce=B.useCallback((S,k)=>{me.set({x:0,y:0}),V(!1);let D=window.innerWidth,E=k.point.x<D/2?"bottom-left":"bottom-right";E!==_&&(A(E),g?.(E))},[_,g,me]),[we,ea]=B.useState(()=>crypto.randomUUID()),[ta,Ma]=B.useState(null),Re=ck({agentUrl:i,orgId:d||""}),De=Re.config?.productBackendUrl||h,{authState:de,retry:Oa}=uk({productBackendUrl:De,sessionId:we,enabled:!!De&&Re.status==="success"}),{executeToolRequest:wr}=dk({productBackendUrl:De||"",agentUrl:i,sessionId:we});B.useEffect(()=>{if(!De||Re.status!=="success")return;(async()=>{let k=`${De}/getDocument/snowkite/categories/`;console.log("[KiteChat TEST] Testing product backend connectivity..."),console.log("[KiteChat TEST] URL:",k);try{let D=await fetch(k,{method:"GET",headers:{Accept:"application/json"}});if(console.log("[KiteChat TEST] Response status:",D.status),console.log("[KiteChat TEST] Response ok:",D.ok),D.ok){let N=await D.json();console.log("[KiteChat TEST] SUCCESS - product backend reachable, data:",N)}else{let N=await D.text();console.log("[KiteChat TEST] FAILED - status:",D.status,"body:",N)}}catch(D){console.error("[KiteChat TEST] ERROR:",D)}})()},[De,Re.status]);let yp=B.useMemo(()=>ta||(de.status==="authenticated"?{userId:de.user.id,userName:de.user.name,userEmail:de.user.email,userRole:de.user.role,isInternal:de.user.isInternal}:{userId:c||"anonymous",userName:f||"Anonymous User",userEmail:m||"Not provided",userRole:void 0,isInternal:!1}),[ta,de,c,f,m]);B.useEffect(()=>{de.status==="authenticated"&&ta===null&&(Ma({userId:de.user.id,userName:de.user.name,userEmail:de.user.email,userRole:de.user.role,isInternal:de.user.isInternal}),console.log("[ChatPanel] Session user captured:",de.user.id))},[de,ta]);let vk=B.useMemo(()=>De?de.status==="loading"||de.status==="idle":!1,[De,de.status]),[yt,qy]=B.useState(!1),Sr=B.useRef(null),[xk,vp]=B.useState(!1),ur=B.useRef(null),Mo=B.useRef(null),Di=B.useRef(null);B.useEffect(()=>{console.log(`[KiteChat] Chat Panel v${nN} loaded`)},[]);let xp=B.useCallback(()=>{console.log("[KiteChat] resetSession called",{isEscalated:yt,hasSupabase:!!ur.current,sessionId:we}),yt&&ur.current&&we?(console.log("[KiteChat] Updating customer_status to disconnected for session:",we),ur.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",we).then(S=>{console.log("[KiteChat] Disconnect update result:",S)},S=>{console.error("[KiteChat] Disconnect update failed:",S)})):console.log("[KiteChat] Skipping disconnect update - conditions not met"),Ma(null),ea(crypto.randomUUID()),qy(!1),Sr.current&&(Sr.current.close(),Sr.current=null),vp(!1),Mo.current&&(Mo.current.unsubscribe(),Mo.current=null)},[yt,we]);B.useEffect(()=>{v&&x&&!ur.current&&(ur.current=jS(v,x))},[v,x]),B.useEffect(()=>{if(!yt||!we||!ur.current)return;let S=`typing:${we}`,k=ur.current.channel(S);return console.log(`[KiteChat] Subscribing to typing channel: ${S}`),k.on("broadcast",{event:"typing"},D=>{console.log("[KiteChat] Received typing broadcast:",D);let{sender:N,isTyping:E}=D.payload;N==="agent"&&(console.log(`[KiteChat] Agent typing: ${E}`),vp(E),E&&(Di.current&&window.clearTimeout(Di.current),Di.current=window.setTimeout(()=>{vp(!1)},5e3)))}).subscribe(D=>{console.log(`[KiteChat] Typing channel status: ${D}`),D==="SUBSCRIBED"&&(Mo.current=k,console.log("[KiteChat] Typing channel ready"))}),()=>{k.unsubscribe(),Mo.current=null,Di.current&&window.clearTimeout(Di.current)}},[yt,we]);let Ru=B.useRef(null),Ba=B.useCallback(async S=>{if(!(!ur.current||!we))try{await ur.current.from("escalations").update({customer_status:S,customer_last_seen:new Date().toISOString()}).eq("session_id",we)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[we]);B.useEffect(()=>{if(!yt||!we||!ur.current)return;let S=we,k=ur.current;Ba("active"),Ru.current=window.setInterval(()=>{Ba("active")},6e4);let D=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",S)},N=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",S):document.visibilityState==="visible"&&Ba("active")};return window.addEventListener("beforeunload",D),document.addEventListener("visibilitychange",N),()=>{window.removeEventListener("beforeunload",D),document.removeEventListener("visibilitychange",N),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",S).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},E=>{console.error("[KiteChat] Failed to mark disconnected:",E)}),Ru.current&&(window.clearInterval(Ru.current),Ru.current=null)}},[yt,we,Ba]);let Eu=B.useCallback(S=>{if(!Mo.current){console.log("[KiteChat] Cannot send typing - channel not ready");return}if(!yt){console.log("[KiteChat] Cannot send typing - not escalated");return}console.log(`[KiteChat] Sending typing indicator: ${S}`),Mo.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:S}})},[yt]),Bn=B.useRef(null),wk=B.useCallback(()=>{!yt||!ur.current||(Eu(!0),Ba("active"),Bn.current&&window.clearTimeout(Bn.current),Bn.current=window.setTimeout(()=>{Eu(!1)},1500))},[yt,Eu,Ba]),Fn=B.useRef({}),$y=y.length===0,[Un,xe]=B.useState("idle"),[Sk,Ie]=B.useState([]),Fa=B.useRef([]),Ck=y.length?y[y.length-1].role:void 0,[wp,Oo]=B.useState("landing"),[Hy,Bo]=B.useState(void 0),[bk,zy]=B.useState(l||cN),[Lk,Wy]=B.useState(!1);B.useEffect(()=>{u&&!l&&(Wy(!0),fetch(u).then(S=>S.json()).then(S=>{Array.isArray(S)&&S.length>0&&zy(S)}).catch(S=>{console.warn("[KiteChat] Failed to fetch starting questions:",S)}).finally(()=>Wy(!1)))},[u,l]),B.useEffect(()=>{l&&zy(l)},[l]);let[ye,Ua]=B.useState(void 0),Ve=B.useRef(void 0),Gy=B.useRef(null),[Ni,Mi]=B.useState(!1);B.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let S=()=>{if(!localStorage.getItem("gmailNotificationSeen")){Oo("landing"),Bo(void 0);let D=Date.now(),N="I see you're exploring integrations. Let me know if there are any other connections we should add.",E={id:D,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};w(Z=>[...Z,E]),ra(D,N),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",S),()=>{window.removeEventListener("integrationTabClicked",S)}},[]),B.useEffect(()=>{ye?(!Ve.current||Ve.current.id!==ye.id||Ve.current.stepIndex!==ye.stepIndex)&&(Ve.current=ye):Ve.current=void 0},[ye]);let[Oi,Du]=B.useState(null),[rt,Sp]=B.useState(null),[ne,se]=B.useState({}),Ky=B.useRef(null),Cp=B.useRef(null),Nu=B.useRef(null),{cursorState:Mu,moveTo:Fo,hide:Vn}=lk(),[Uo,bp]=B.useState(null),[Xy,Va]=B.useState(null),Lp=B.useRef(null),jn=B.useRef(null),[Jy,Bi]=B.useState(!1),[qn,Ou]=B.useState(""),Qy=B.useRef(null);B.useEffect(()=>{if(!ye||ye.id!=="add-api-key"||ye.stepIndex!==2)return;let k=setInterval(()=>{let D=document.querySelector('[role="dialog"]'),N=Ve.current;if(D&&N&&N.id==="add-api-key"&&N.stepIndex===2){Vn();let E=Date.now()+1;w(Z=>[...Z,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Ua(void 0),Mi(!0)}},300);return()=>clearInterval(k)},[ye,Vn]),B.useEffect(()=>()=>{Object.values(Fn.current).forEach(S=>window.clearInterval(S)),Fn.current={},Fa.current.forEach(S=>window.clearTimeout(S)),Fa.current=[]},[]),B.useEffect(()=>{if(ye&&y.length>0){let S=y[y.length-1];if((S.kind==="guideStep"||S.kind==="guideComplete")&&Nu.current&&Cp.current){let k=Cp.current,D=Nu.current,N=k.getBoundingClientRect(),Z=D.getBoundingClientRect().top-N.top+k.scrollTop;k.scrollTop=Z}}else!ye&&y.length>0&&Ky.current?.scrollIntoView({behavior:"smooth"})},[y,Un,ye]);let Yy=B.useMemo(()=>{for(let S=y.length-1;S>=0;S--){let k=y[S];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[y]);B.useEffect(()=>{Gy.current=Yy},[Yy]),B.useEffect(()=>{Lp.current=Xy},[Xy]),B.useEffect(()=>{let S=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let D=Lp.current;if(D){k.preventDefault(),k.stopPropagation(),Pp(D);return}if(rt){k.preventDefault(),k.stopPropagation(),kp();return}if(Oi){k.preventDefault(),k.stopPropagation(),Ip(Oi);return}let N=Gy.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",N,"onNavigate:",!!o),N&&o){console.log("[DEBUG] Navigating via keyboard to:",N.page),k.preventDefault(),k.stopPropagation(),o(N.page,N.subtab);return}if(Ni){k.preventDefault(),k.stopPropagation(),ev();return}if(Ve.current){k.preventDefault(),k.stopPropagation(),Tp();return}}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[rt,Oi,ye,Ni,o]);let Zy=B.useCallback(S=>{if(!i)return;Sr.current&&Sr.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${S}`,D=new WebSocket(k);D.onmessage=N=>{try{let E=JSON.parse(N.data);E.type==="agent_message"?w(Z=>{let Y=E.content,T=E.message_id;return(T?Z.some(I=>I.serverMessageId===T):Z.slice(-5).some(I=>I.content===Y))?(console.debug("[KiteChat] Skipping duplicate agent message:",T||Y.slice(0,30)),Z):[...Z,{id:Date.now(),role:"agent",kind:"text",content:Y,serverMessageId:T}]}):E.type==="error"&&console.error("[KiteChat] Escalation error:",E.message)}catch(E){console.error("[KiteChat] Failed to parse escalation message:",E)}},D.onerror=N=>{console.error("[KiteChat] Escalation WebSocket error:",N)},D.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},Sr.current=D},[i]),Ik=B.useCallback(async S=>{if(!Sr.current||Sr.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return Sr.current.send(JSON.stringify({type:"user_message",content:S})),Ba("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[Ba]);B.useEffect(()=>()=>{Sr.current&&Sr.current.close()},[]),B.useEffect(()=>{yt&&we&&Zy(we)},[yt,we,Zy]);function ra(S,k,D){let N=k||"",E=D;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let O=0,I=0;for(let J=0;J<k.length;J++)if(k[J]==="{")O++;else if(k[J]==="}"&&(O--,O===0)){I=J+1;break}let Q=I>0?k.slice(0,I):k,ae=JSON.parse(Q);ae.response&&typeof ae.response=="string"&&(N=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}N=lN(N);let Z=N.split(" "),Y=0,T=window.setInterval(()=>{Y+=1,w(O=>O.map(I=>I.id===S?{...I,content:Z.slice(0,Y).join(" ")}:I)),Y>=Z.length&&(window.clearInterval(T),delete Fn.current[S],E&&E.length>0&&w(O=>O.map(I=>I.id===S?{...I,followups:E}:I)),xe("idle"))},25);Fn.current[S]=T}function kk(S,k){w(D=>D.map(N=>N.id===S?{...N,followupSelected:!0}:N)),Bu(k.label)}function ev(){Object.values(Fn.current).forEach(S=>window.clearInterval(S)),Fn.current={},Fa.current.forEach(S=>window.clearTimeout(S)),Fa.current=[],Vn(),xp(),w([]),P(""),xe("idle"),Oo("landing"),Bo(void 0),Ua(void 0),Mi(!1),Du(null),Sp(null),se({}),a&&a()}function xN(S){Oo("folder"),Bo(S)}function Pk(){Oo("landing"),Bo(void 0)}function Tk(S){S.preventDefault();let k=L.trim();if(Uo){if(!k){let D={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};w(N=>[...N,D]);return}Ak(k,Uo),P(""),bp(null),jn.current&&(jn.current.value="");return}if(k){if(yt){let D={id:Date.now(),role:"user",content:k};w(N=>[...N,D]),Ik(k),Eu(!1),Bn.current&&(window.clearTimeout(Bn.current),Bn.current=null),P("");return}Bu(k),P("")}}function _k(S){let k={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(S.page==="settings"&&S.subtab){let D={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${D[S.subtab]} tab)`}return k[S.page]}function Ip(S){o&&o(S.page,S.subtab),Du(null),w(k=>k.map(D=>D.kind==="navigationAction"&&D.navigationTarget?.page===S.page&&D.navigationTarget?.subtab===S.subtab?{...D,navigationTarget:void 0}:D))}function kp(){if(!rt)return;let S=ne;if(rt.type!=="updateCompanyInfo"){if(rt.type==="addApiKey"){let k=S;if(!k.name||!k.name.trim())return}else if(rt.type==="addCustomer"){let k=S;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(rt.type==="changePassword"){let k=S;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(rt.type==="addWebhook"){let k=S;if(!k.url||!k.url.trim())return}else if(rt.type==="addPaymentMethod"){let k=S;if(!k.cardNumber||!k.expiryDate)return}else if(rt.type==="deleteApiKey"){let k=S;if(!k.keyId&&!k.name)return}else if(rt.type==="refundPayment"){let k=S;if(!k.transactionId&&!k.customer)return}else if(rt.type==="createSubscription"){let k=S;if(!k.customerEmail&&!k.customerId)return}else if((rt.type==="toggleBlockRule"||rt.type==="enableBlockRule"||rt.type==="disableBlockRule")&&!S.ruleId)return}n&&n(rt.type,S),w(k=>k.map(D=>D.kind==="actionForm"&&D.actionType===rt.type?{...D,isSubmitted:!0}:D)),Sp(null),se({})}async function Bu(S){Fa.current.forEach(Y=>window.clearTimeout(Y)),Fa.current=[];let D=[...y].reverse().find(Y=>Y.role==="assistant")?.isNotificationMessage===!0,N=Date.now(),E={id:N,role:"user",content:S};if(w(Y=>Y.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(E)),D){let Y=Date.now()+1,T={id:Y,role:"assistant",kind:"text",content:""};w(O=>[...O,T]),ra(Y,"Thank you, your feedback is saved.");return}Du(null),xe("thinking"),Ie([]);let Z=!1;try{let Y=new AbortController,T=setTimeout(()=>Y.abort(),6e4);console.log("[ChatPanel] Sending chat request to agent backend..."),console.log("[ChatPanel] Agent URL:",i),console.log("[ChatPanel] User data being sent:"),console.log("[ChatPanel] user_id:",yp.userId),console.log("[ChatPanel] user_name:",yp.userName),console.log("[ChatPanel] user_email:",yp.userEmail),console.log("[ChatPanel] org_id:",d),console.log("[ChatPanel] authState.status:",de.status);let O=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:we,message:S,current_page:s||"dashboard",user_id:c,org_id:d,user_name:f,user_email:m}),signal:Y.signal});if(clearTimeout(T),!O.ok)throw new Error(`Agent request failed: ${O.status}`);let I=O.body?.getReader();if(!I)throw new Error("No response body");let Q=new TextDecoder,ae="";for(;;){let{done:J,value:he}=await I.read();if(J)break;ae+=Q.decode(he,{stream:!0});let at=ae.split(`
|
|
25
|
+
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function HD(e){if(!e)return null;let t=e.split(`
|
|
26
|
+
`),a=[],r=null,o=!1,n=[],s="",i=u=>{let d=[],c=u,f=0;for(;c.length>0;){let m=c.match(/^`([^`]+)`/);if(m){d.push((0,p.jsx)("code",{className:"bg-gray-100 px-1 py-0.5 rounded text-xs font-mono",children:m[1]},f++)),c=c.slice(m[0].length);continue}let x=c.match(/^\*\*([^*]+)\*\*/);if(x){d.push((0,p.jsx)("strong",{children:x[1]},f++)),c=c.slice(x[0].length);continue}let w=c.match(/^\*([^*]+)\*/);if(w){d.push((0,p.jsx)("em",{children:w[1]},f++)),c=c.slice(w[0].length);continue}let b=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(b){d.push((0,p.jsx)("a",{href:b[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:b[1]},f++)),c=c.slice(b[0].length);continue}let h=c.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);if(h){let C=h[1],L=C.startsWith("www.")?`https://${C}`:C;d.push((0,p.jsx)("a",{href:L,className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:C},f++)),c=c.slice(C.length);continue}let g=c.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);if(g){let C=g[1];d.push((0,p.jsx)("a",{href:`mailto:${C}`,className:"kite-link",children:C},f++)),c=c.slice(C.length);continue}let y=c.search(/[`*\[@h]/);if(y===-1){d.push(c);break}else y===0?(d.push(c[0]),c=c.slice(1)):(d.push(c.slice(0,y)),c=c.slice(y))}return d.length===1?d[0]:(0,p.jsx)(p.Fragment,{children:d})},l=()=>{if(r){let u=r.type==="ul"?"ul":"ol";a.push((0,p.jsx)(u,{className:`${r.type==="ul"?"list-disc":"list-decimal"} ml-4 my-1`,children:r.items.map((d,c)=>(0,p.jsx)("li",{className:"ml-2",children:d},c))},a.length)),r=null}};for(let u=0;u<t.length;u++){let d=t[u];if(d.startsWith("```")){o?(a.push((0,p.jsx)("pre",{className:"bg-gray-100 rounded p-2 my-1 overflow-x-auto",children:(0,p.jsx)("code",{className:"text-xs font-mono",children:n.join(`
|
|
27
|
+
`)})},a.length)),o=!1,n=[],s=""):(l(),o=!0,s=d.slice(3).trim());continue}if(o){n.push(d);continue}let c=d.match(/^(#{1,6})\s+(.+)/);if(c){l();let x=c[1].length,w=i(c[2]),b=x===1?"text-lg font-bold my-1":x===2?"text-base font-bold my-1":"text-sm font-semibold my-1";a.push((0,p.jsx)("div",{className:b,children:w},a.length));continue}let f=d.match(/^[-*]\s+(.+)/);if(f){(!r||r.type!=="ul")&&(l(),r={type:"ul",items:[]}),r.items.push(i(f[1]));continue}let m=d.match(/^\d+[.)]\s+(.+)/);if(m){(!r||r.type!=="ol")&&(l(),r={type:"ol",items:[]}),r.items.push(i(m[1]));continue}if(d.trim()===""){l(),a.push((0,p.jsx)("div",{className:"h-2"},a.length));continue}if(d.match(/^[-*_]{3,}$/)){l(),a.push((0,p.jsx)("hr",{className:"my-2 border-gray-200"},a.length));continue}l(),a.push((0,p.jsx)("div",{children:i(d)},a.length))}return l(),(0,p.jsx)(p.Fragment,{children:a})}var zD=[{id:"changing-layouts",label:"Changing layouts",prompt:"How do I change the layout of my profiles or folders?",icon:"layout"},{id:"bulk-uploads",label:"Bulk uploads",prompt:"How do I bulk upload profiles using a CSV file?",icon:"upload"},{id:"example-setups",label:"Example setups",prompt:"Can you show me some example folder setups?",icon:"setup"}],Pk=[{id:"customers",title:"Customer Management",topics:[{id:"add-customer",label:"Add a new customer",prompt:"How do I add a new customer to the system and what information is required?"},{id:"customer-details",label:"View customer details",prompt:"Show me how to view and edit customer information and their payment history."}]},{id:"payments",title:"Payment Processing",topics:[{id:"process-payment",label:"Process a payment",prompt:"How do I process a one-time payment for a customer?"},{id:"refund-payment",label:"Issue a refund",prompt:"Walk me through issuing a refund for a customer payment."}]},{id:"subscriptions",title:"Subscription Management",topics:[{id:"create-subscription",label:"Create a subscription",prompt:"How do I set up a new subscription plan for a customer?"},{id:"update-subscription",label:"Update subscription tier",prompt:"How can I change a customer's subscription plan or upgrade them?"}]},{id:"billing",title:"Billing",topics:[{id:"payment-methods",label:"Manage payment methods",prompt:"How do customers add or update their payment methods?"}]}],Hy={"getting-started":{id:"getting-started",title:"Getting started",steps:[{text:"Step 1: Let's open the Customers page. This is where you'll manage all your customers - you can view, add, and edit customer information here.",navigation:{page:"customers"},cursorTarget:{selector:'[data-page="customers"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Now let's open the Add customer dialog. This is where you'll enter information for your first customer, including their name, email, and other details.",navigation:{page:"customers"},cursorTarget:{selector:'[data-testid="add-customer-button"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Settings page. This is where you manage your account settings, company information, and preferences. We're going to verify your company address is correct.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 4: Here's the address field in the Company Information section. It's important to verify this address is accurate since it's used for billing and shipping purposes. Make sure it's up to date.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-testid="company-address-input"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 5: Let's open the API Keys tab. This section shows all your API keys - you'll need these to connect your application to our services. We're going to create a production API key.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 6: Let's open the Create API Key dialog. Here you can create a new API key for your application. You'll want to give it a descriptive name like 'Production Key' so you can easily identify it later.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"add-api-key":{id:"add-api-key",title:"How to add an API key",steps:[{text:"Step 1: Let's open the Settings page. This is where you manage your account settings and preferences. We need to go here to access the API Keys section.",navigation:{page:"settings",subtab:"general"},cursorTarget:{selector:'[data-page="settings"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 2: Let's open the API Keys tab. This section shows all your API keys and allows you to create new ones. You'll need API keys to connect your application to our services.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-settings-tab="api"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 3: Let's open the Create API Key dialog. This is where you'll create your new API key - you can give it a name to help you identify it later, then click Create to generate it.",navigation:{page:"settings",subtab:"api"},cursorTarget:{selector:'[data-testid="create-api-key-button"]',offset:{x:0,y:0},onClick:!0}}]},"refund-payment":{id:"refund-payment",title:"How to refund a payment",steps:[{text:"Step 1: Let's open the Home page. This is your dashboard where you can view today's activity, your payment overview, and recent transactions. We need to go here to find the payment you want to refund.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-page="dashboard"]',offset:{x:0,y:0},onClick:!0}},{text:"Step 2: Scroll down to see the Recent transactions section at the bottom. This shows your latest payment transactions with their status. We're looking for a transaction with 'paid' status - only paid transactions can be refunded.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="recent-activity-card"]',offset:{x:0,y:0},onClick:!1}},{text:"Step 3: Let's open the dropdown menu for this paid transaction. Each transaction has a menu button (three dots) that gives you options like refunding. Click it to see the available actions, including the 'Refund payment' option.",navigation:{page:"dashboard"},cursorTarget:{selector:'[data-testid="transaction-menu-button"]',offset:{x:0,y:0},onClick:!0}}]}},$D=[];function WD(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Rt,{className:"h-8 w-8 animate-spin text-gray-400 mb-3"}),(0,p.jsx)("p",{className:"text-xs text-gray-500",children:"Verifying your identity..."})]})}function GD({error:e,onRetry:t}){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[(0,p.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mb-4",children:(0,p.jsx)(xr,{className:"h-6 w-6 text-red-600"})}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Unable to Start Chat"}),(0,p.jsx)("p",{className:"text-xs text-gray-500 mb-4 max-w-[240px]",children:e}),(0,p.jsx)(at,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function KD({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=VD,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:m,supabaseUrl:x,supabaseAnonKey:w,initialCorner:b="bottom-left",onCornerChange:h,productBackendUrl:g,getAuthHeaders:y}={}){let[C,L]=F.useState($D),[P,A]=F.useState(""),[R,q]=F.useState(b),[V,pe]=F.useState(!1),le=By(),Rn=F.useCallback((v,k)=>{le.set({x:0,y:0}),pe(!1);let O=window.innerWidth,E=k.point.x<O/2?"bottom-left":"bottom-right";E!==R&&(q(E),h?.(E))},[R,h,le]),[oe,Ti]=F.useState(()=>crypto.randomUUID()),[ya,Fe]=F.useState(null),We=Ck({agentUrl:i,orgId:c||""}),mt=We.config?.productBackendUrl||g,sa=We.config?.supabaseUrl||x,bt=We.config?.supabaseAnonKey||w,{authState:je,retry:Rk}=Sk({productBackendUrl:mt,sessionId:oe,enabled:!!mt&&We.status==="success"}),{executeToolRequest:_k}=Lk({productBackendUrl:mt||"",agentUrl:i,sessionId:oe}),ZD=F.useMemo(()=>ya||(je.status==="authenticated"?{userId:je.user.id,userName:je.user.name,userEmail:je.user.email,userRole:je.user.role,isInternal:je.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:m||"Not provided",userRole:void 0,isInternal:!1}),[ya,je,d,f,m]);F.useEffect(()=>{je.status==="authenticated"&&ya===null&&Fe({userId:je.user.id,userName:je.user.name,userEmail:je.user.email,userRole:je.user.role,isInternal:je.user.isInternal})},[je,ya]);let Ek=F.useMemo(()=>mt?je.status==="loading"||je.status==="idle":!1,[mt,je.status]),[nt,$y]=F.useState(!1),xa=F.useRef(null),[Dk,Ip]=F.useState(!1),ht=F.useRef(null),Io=F.useRef(null),Ai=F.useRef(null),kp=F.useCallback(()=>{nt&&ht.current&&oe&&ht.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",oe).then(()=>{},v=>{console.error("[KiteChat] Disconnect update failed:",v)}),Fe(null),Ti(crypto.randomUUID()),$y(!1),xa.current&&(xa.current.close(),xa.current=null),Ip(!1),Io.current&&(Io.current.unsubscribe(),Io.current=null)},[nt,oe]);F.useEffect(()=>{sa&&bt&&!ht.current&&(ht.current=ZS(sa,bt))},[sa,bt]),F.useEffect(()=>{if(!nt||!oe||!ht.current)return;let v=`typing:${oe}`,k=ht.current.channel(v);return k.on("broadcast",{event:"typing"},O=>{let{sender:N,isTyping:E}=O.payload;N==="agent"&&(Ip(E),E&&(Ai.current&&window.clearTimeout(Ai.current),Ai.current=window.setTimeout(()=>{Ip(!1)},5e3)))}).subscribe(O=>{O==="SUBSCRIBED"?(Io.current=k,console.log("[KiteChat] Typing channel subscribed successfully")):O==="CHANNEL_ERROR"&&console.error("[KiteChat] Typing channel subscription failed")}),()=>{k.unsubscribe(),Io.current=null,Ai.current&&window.clearTimeout(Ai.current)}},[nt,oe]),F.useEffect(()=>{!e&&nt&&ht.current&&oe&&(console.log("[KiteChat] Panel closed during live chat, marking disconnected"),ht.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",oe).then(()=>console.log("[KiteChat] Successfully marked disconnected on panel close"),v=>{console.error("[KiteChat] Failed to mark disconnected on panel close:",v)}))},[e,nt,oe]);let Nu=F.useRef(null),eM=F.useCallback(async v=>{if(!(!ht.current||!oe))try{await ht.current.from("escalations").update({customer_status:v,customer_last_seen:new Date().toISOString()}).eq("session_id",oe)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[oe]);F.useEffect(()=>{if(!nt||!oe||!ht.current)return;let v=oe,k=ht.current,O=sa,N=bt,E=()=>{k.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{},D=>console.error("[KiteChat] Failed to update customer status:",D))},K=()=>{if(!O||!N)return;let D=`${O}/rest/v1/escalations?session_id=eq.${v}`;fetch(D,{method:"PATCH",headers:{"Content-Type":"application/json",apikey:N,Authorization:`Bearer ${N}`,Prefer:"return=minimal"},body:JSON.stringify({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}),keepalive:!0}).catch(()=>{})};console.log("[KiteChat] Starting presence heartbeat for live chat"),E(),Nu.current=window.setInterval(()=>{E()},6e4);let G=()=>{K()},T=()=>{document.visibilityState==="hidden"?K():document.visibilityState==="visible"&&E()};return window.addEventListener("beforeunload",G),document.addEventListener("visibilitychange",T),()=>{window.removeEventListener("beforeunload",G),document.removeEventListener("visibilitychange",T),console.log("[KiteChat] Escalation ended, marking disconnected"),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>console.log("[KiteChat] Successfully marked disconnected on escalation end"),D=>{console.error("[KiteChat] Failed to mark disconnected:",D)}),Nu.current&&(window.clearInterval(Nu.current),Nu.current=null)}},[nt,oe,sa,bt]);let Ou=F.useCallback(v=>{if(!Io.current||!nt){v&&console.warn("[KiteChat] Typing channel not ready, cannot send typing indicator");return}Io.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:v}})},[nt]),_n=F.useRef(null),Mk=F.useCallback(()=>{!nt||!ht.current||!oe||(Ou(!0),ht.current.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",oe).then(()=>{},v=>console.error("[KiteChat] Failed to update presence:",v)),_n.current&&window.clearTimeout(_n.current),_n.current=window.setTimeout(()=>{Ou(!1)},1500))},[nt,Ou,oe]),En=F.useRef({}),Wy=C.length===0,[Dn,xe]=F.useState("idle"),[Nk,Le]=F.useState([]),Ar=F.useRef([]),Ok=C.length?C[C.length-1].role:void 0,[Pp,ko]=F.useState("landing"),[Gy,Po]=F.useState(void 0),[Fk,Ky]=F.useState(l||zD),[Bk,Xy]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Xy(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Ky(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>Xy(!1)))},[u,l]),F.useEffect(()=>{l&&Ky(l)},[l]);let[ge,Rr]=F.useState(void 0),Me=F.useRef(void 0),Qy=F.useRef(null),[Ri,_i]=F.useState(!1);F.useEffect(()=>{let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){ko("landing"),Po(void 0);let O=Date.now(),N="I see you're exploring integrations. Let me know if there are any other connections we should add.",E={id:O,role:"assistant",kind:"text",content:"",isNotificationMessage:!0};L(K=>[...K,E]),er(O,N),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),F.useEffect(()=>{ge?(!Me.current||Me.current.id!==ge.id||Me.current.stepIndex!==ge.stepIndex)&&(Me.current=ge):Me.current=void 0},[ge]);let[Ei,Fu]=F.useState(null),[Je,Tp]=F.useState(null),[ne,se]=F.useState({}),Jy=F.useRef(null),Ap=F.useRef(null),Bu=F.useRef(null),{cursorState:Uu,moveTo:To,hide:Mn}=wk(),[Ao,Rp]=F.useState(null),[Yy,_r]=F.useState(null),_p=F.useRef(null),Nn=F.useRef(null),[Zy,Di]=F.useState(!1),[On,Vu]=F.useState(""),ex=F.useRef(null);F.useEffect(()=>{if(!ge||ge.id!=="add-api-key"||ge.stepIndex!==2)return;let k=setInterval(()=>{let O=document.querySelector('[role="dialog"]'),N=Me.current;if(O&&N&&N.id==="add-api-key"&&N.stepIndex===2){Mn();let E=Date.now()+1;L(K=>[...K,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Rr(void 0),_i(!0)}},300);return()=>clearInterval(k)},[ge,Mn]),F.useEffect(()=>()=>{Object.values(En.current).forEach(v=>window.clearInterval(v)),En.current={},Ar.current.forEach(v=>window.clearTimeout(v)),Ar.current=[]},[]),F.useEffect(()=>{if(ge&&C.length>0){let v=C[C.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Bu.current&&Ap.current){let k=Ap.current,O=Bu.current,N=k.getBoundingClientRect(),K=O.getBoundingClientRect().top-N.top+k.scrollTop;k.scrollTop=K}}else!ge&&C.length>0&&Jy.current?.scrollIntoView({behavior:"smooth"})},[C,Dn,ge]);let tx=F.useMemo(()=>{for(let v=C.length-1;v>=0;v--){let k=C[v];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[C]);F.useEffect(()=>{Qy.current=tx},[tx]),F.useEffect(()=>{_p.current=Yy},[Yy]),F.useEffect(()=>{let v=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let O=_p.current;if(O){k.preventDefault(),k.stopPropagation(),Mp(O);return}if(Je){k.preventDefault(),k.stopPropagation(),Dp();return}if(Ei){k.preventDefault(),k.stopPropagation(),Ep(Ei);return}let N=Qy.current;if(N&&o){k.preventDefault(),k.stopPropagation(),o(N.page,N.subtab);return}if(Ri){k.preventDefault(),k.stopPropagation(),rx();return}if(Me.current){k.preventDefault(),k.stopPropagation(),Np();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Je,Ei,ge,Ri,o]);let ax=F.useCallback(v=>{if(!i)return;xa.current&&xa.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,O=new WebSocket(k);O.onmessage=N=>{try{let E=JSON.parse(N.data);E.type==="agent_message"?L(K=>{let G=E.content,T=E.message_id;return(T?K.some(I=>I.serverMessageId===T):K.slice(-5).some(I=>I.content===G))?K:[...K,{id:Date.now(),role:"agent",kind:"text",content:G,serverMessageId:T}]}):E.type==="error"&&console.error("[KiteChat] Escalation error:",E.message)}catch(E){console.error("[KiteChat] Failed to parse escalation message:",E)}},O.onerror=N=>{console.error("[KiteChat] Escalation WebSocket error:",N)},O.onclose=()=>{},xa.current=O},[i]),Uk=F.useCallback(async v=>{if(!xa.current||xa.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return xa.current.send(JSON.stringify({type:"user_message",content:v})),ht.current&&oe&&ht.current.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",oe).then(()=>{},k=>console.error("[KiteChat] Failed to update presence:",k)),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[oe]);F.useEffect(()=>()=>{xa.current&&xa.current.close()},[]),F.useEffect(()=>{nt&&oe&&ax(oe)},[nt,oe,ax]);function er(v,k,O){let N=k||"",E=O;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let D=0,I=0;for(let X=0;X<k.length;X++)if(k[X]==="{")D++;else if(k[X]==="}"&&(D--,D===0)){I=X+1;break}let Q=I>0?k.slice(0,I):k,ae=JSON.parse(Q);ae.response&&typeof ae.response=="string"&&(N=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}N=qD(N);let K=N.split(" "),G=0,T=window.setInterval(()=>{G+=1,L(D=>D.map(I=>I.id===v?{...I,content:K.slice(0,G).join(" ")}:I)),G>=K.length&&(window.clearInterval(T),delete En.current[v],E&&E.length>0&&L(D=>D.map(I=>I.id===v?{...I,followups:E}:I)),xe("idle"))},25);En.current[v]=T}function Vk(v,k){L(O=>O.map(N=>N.id===v?{...N,followupSelected:!0}:N)),ju(k.label)}function rx(){Object.values(En.current).forEach(v=>window.clearInterval(v)),En.current={},Ar.current.forEach(v=>window.clearTimeout(v)),Ar.current=[],Mn(),kp(),L([]),A(""),xe("idle"),ko("landing"),Po(void 0),Rr(void 0),_i(!1),Fu(null),Tp(null),se({}),r&&r()}function tM(v){ko("folder"),Po(v)}function jk(){ko("landing"),Po(void 0)}function qk(v){v.preventDefault();let k=P.trim();if(Ao){if(!k){let O={id:Date.now(),role:"assistant",kind:"text",content:"Please describe what you'd like to do with this CSV file. For example: 'Create customers from this file' or 'Add these subscriptions'."};L(N=>[...N,O]);return}zk(k,Ao),A(""),Rp(null),Nn.current&&(Nn.current.value="");return}if(k){if(nt){let O={id:Date.now(),role:"user",content:k};L(N=>[...N,O]),Uk(k),Ou(!1),_n.current&&(window.clearTimeout(_n.current),_n.current=null),A("");return}ju(k),A("")}}function Hk(v){let k={dashboard:"dashboard",customers:"customers page",payments:"payments page",settings:"settings page",support:"support page",disputes:"disputes page",radar:"radar page"};if(v.page==="settings"&&v.subtab){let O={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${O[v.subtab]} tab)`}return k[v.page]}function Ep(v){o&&o(v.page,v.subtab),Fu(null),L(k=>k.map(O=>O.kind==="navigationAction"&&O.navigationTarget?.page===v.page&&O.navigationTarget?.subtab===v.subtab?{...O,navigationTarget:void 0}:O))}function Dp(){if(!Je)return;let v=ne;if(Je.type!=="updateCompanyInfo"){if(Je.type==="addApiKey"){let k=v;if(!k.name||!k.name.trim())return}else if(Je.type==="addCustomer"){let k=v;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Je.type==="changePassword"){let k=v;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Je.type==="addWebhook"){let k=v;if(!k.url||!k.url.trim())return}else if(Je.type==="addPaymentMethod"){let k=v;if(!k.cardNumber||!k.expiryDate)return}else if(Je.type==="deleteApiKey"){let k=v;if(!k.keyId&&!k.name)return}else if(Je.type==="refundPayment"){let k=v;if(!k.transactionId&&!k.customer)return}else if(Je.type==="createSubscription"){let k=v;if(!k.customerEmail&&!k.customerId)return}else if((Je.type==="toggleBlockRule"||Je.type==="enableBlockRule"||Je.type==="disableBlockRule")&&!v.ruleId)return}n&&n(Je.type,v),L(k=>k.map(O=>O.kind==="actionForm"&&O.actionType===Je.type?{...O,isSubmitted:!0}:O)),Tp(null),se({})}async function ju(v){Ar.current.forEach(G=>window.clearTimeout(G)),Ar.current=[];let O=[...C].reverse().find(G=>G.role==="assistant")?.isNotificationMessage===!0,N=Date.now(),E={id:N,role:"user",content:v};if(L(G=>G.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(E)),O){let G=Date.now()+1,T={id:G,role:"assistant",kind:"text",content:""};L(D=>[...D,T]),er(G,"Thank you, your feedback is saved.");return}Fu(null),xe("thinking"),Le([]);let K=!1;try{let G=new AbortController,T=setTimeout(()=>G.abort(),6e4),D=await fetch(`${i}/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:oe,message:v,current_page:s||"dashboard",user_id:d,org_id:c,user_name:f,user_email:m}),signal:G.signal});if(clearTimeout(T),!D.ok)throw new Error(`Agent request failed: ${D.status}`);let I=D.body?.getReader();if(!I)throw new Error("No response body");let Q=new TextDecoder,ae="";for(;;){let{done:X,value:me}=await I.read();if(X)break;ae+=Q.decode(me,{stream:!0});let Ye=ae.split(`
|
|
63
28
|
|
|
64
|
-
`);ae=
|
|
65
|
-
`),
|
|
29
|
+
`);ae=Ye.pop()||"";for(let It of Ye){if(!It.trim())continue;let tr=It.split(`
|
|
30
|
+
`),Ge="",va="";for(let z of tr)z.startsWith("event: ")?Ge=z.slice(7):z.startsWith("data: ")&&(va=z.slice(6));if(!(!Ge||!va))try{let z=JSON.parse(va);if(Ge==="progress")z.status==="thinking"?(xe("thinking"),Le([{message:z.message,completed:!1}])):z.status==="searching"?(xe("thinking"),Le([{message:z.message||"Searching knowledge base...",completed:!1}])):z.status==="evaluating"?(xe("thinking"),Le([{message:z.message||"Evaluating sources...",completed:!1}])):z.status==="executing"?(xe("executing"),Le(j=>{let ee=j.map(Dt=>({...Dt,completed:!0})),ce=ee[ee.length-1];return(!ce||ce.message!==z.message)&&ee.push({message:z.message,completed:!1}),ee})):z.status==="responding"&&(xe("responding"),Le(j=>j.map(ee=>({...ee,completed:!0}))));else if(Ge==="response"){Le([]),K=!0;let j=z;if(j.action==="navigate"&&j.navigation){let ee={page:j.navigation.page,subtab:j.navigation.subtab};Fu(ee);let ce={id:N+1,role:"assistant",kind:"navigationAction",content:j.response||`I can take you to the ${Hk(ee)}.`,navigationTarget:ee};L(Dt=>[...Dt,ce]),xe("idle")}else if(j.action==="show_form"&&j.actionType){Tp({type:j.actionType,data:j.actionData||{}}),se(j.actionData||{});let ee={id:N+1,role:"assistant",kind:"actionForm",content:j.response||j.message||"Please fill in the details below:",actionType:j.actionType,actionData:j.actionData||{}};L(ce=>[...ce,ee]),xe("idle")}else if(j.action==="suggest_bulk"){let ee=N+1,ce={id:ee,role:"assistant",kind:"text",content:""};L(Dt=>[...Dt,ce]),er(ee,j.response||j.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",j.followups),K=!0}else if(j.action==="bulk_preview"){_r(j.bulk_session_id);let ee={id:N+1,role:"assistant",kind:"bulkPreview",content:j.message||`I found ${j.csv_data?.rowCount||0} items. Here's a preview:`,csvData:j.csv_data?{rowCount:j.csv_data.rowCount,columns:j.csv_data.columns,sampleRows:j.csv_data.sampleRows,fileName:"From context"}:void 0,suggestedAction:j.suggested_action,bulkSessionId:j.bulk_session_id};L(ce=>[...ce,ee]),xe("idle"),K=!0}else if(j.action==="execute"&&j.executionResult){let ee=N+1,ce={id:ee,role:"assistant",kind:"text",content:"",structuredData:j.structuredData||void 0};L(Dt=>[...Dt,ce]),er(ee,j.response||"Action completed successfully.",j.followups),K=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:j.executionResult}}))},100)}else{let ee=N+1,ce={id:ee,role:"assistant",kind:"text",content:""};L(Dt=>[...Dt,ce]),er(ee,j.response||j.message||"",j.followups),K=!0}}else if(Ge==="error"){xe("idle"),Le([]),K=!0;let j=N+1,ee={id:j,role:"assistant",kind:"text",content:""};L(ce=>[...ce,ee]),er(j,z.message||"An error occurred processing your request.")}else if(Ge==="done")Le([]),xe("idle"),K=!0;else if(Ge==="escalation"){$y(!0),xe("idle");let ee={id:Date.now()+2,role:"assistant",kind:"text",content:z.message||"You've been connected to our support queue. An agent will be with you shortly."};L(ce=>[...ce,ee])}else Ge==="tool_request"&&_k(z).catch(ee=>{console.error("[KiteChat] Tool execution failed:",ee)})}catch(z){console.error("Failed to parse SSE event:",z)}}}Le([]),K||xe("idle")}catch(G){console.error("Agent request failed:",G),Le([]);let T=N+1,D={id:T,role:"assistant",kind:"text",content:""};L(Q=>[...Q,D]);let I="I'm having trouble connecting to my backend.";G instanceof Error&&(G.name==="AbortError"?I="The request timed out. The server might be busy - please try again.":G.message.includes("Failed to fetch")||G.message.includes("NetworkError")?I="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":G.message.includes("Agent request failed:")&&(I="The server encountered an error. Please try again.")),I+=" For simple navigation requests, I can still help you locally.",er(T,I)}finally{Le([])}}async function zk(v,k){Ar.current.forEach(E=>window.clearTimeout(E)),Ar.current=[];let O=Date.now(),N={id:O,role:"user",content:`\u{1F4CE} ${k.name}
|
|
66
31
|
|
|
67
|
-
${
|
|
32
|
+
${v}`};L(E=>[...E,N]),xe("thinking"),Le([{message:"Analyzing CSV file...",completed:!1}]);try{let E=new FormData;E.append("file",k),E.append("message",v),E.append("session_id",oe),E.append("current_page",s||"dashboard"),c&&E.append("org_id",c);let K=new AbortController,G=setTimeout(()=>K.abort(),12e4),T=await fetch(`${i}/chat/bulk/stream`,{method:"POST",body:E,signal:K.signal});if(clearTimeout(G),!T.ok)throw new Error(`Bulk upload failed: ${T.status}`);let D=T.body?.getReader();if(!D)throw new Error("No response body");let I=new TextDecoder,Q="",ae=null;for(;;){let{done:X,value:me}=await D.read();if(X)break;Q+=I.decode(me,{stream:!0});let Ye=Q.split(`
|
|
68
33
|
|
|
69
|
-
`);Q=
|
|
70
|
-
`),
|
|
34
|
+
`);Q=Ye.pop()||"";for(let It of Ye){if(!It.trim())continue;let tr=It.split(`
|
|
35
|
+
`),Ge="",va="";for(let z of tr)z.startsWith("event: ")?Ge=z.slice(7):z.startsWith("data: ")&&(va=z.slice(6));if(!(!Ge||!va))try{let z=JSON.parse(va);if(Ge==="preview"){xe("idle"),Le([]),ae=z.bulk_session_id,_r(ae);let j={id:O+1,role:"assistant",kind:"bulkPreview",content:z.message||`I found ${z.csv_data.rowCount} rows in your CSV. Here's a preview:`,csvData:{rowCount:z.csv_data.rowCount,columns:z.csv_data.columns,sampleRows:z.csv_data.sampleRows,fileName:k.name},suggestedAction:z.suggested_action,bulkSessionId:ae||void 0};L(ee=>[...ee,j])}else if(Ge==="progress")xe("executing"),Le([{message:`Processing row ${z.row} of ${z.total}...`,completed:!1}]),L(j=>j[j.length-1]?.kind==="bulkProgress"?j.map((ce,Dt)=>Dt===j.length-1?{...ce,bulkProgress:{processed:z.row,total:z.total,successes:z.successes||0,failures:z.failures||0}}:ce):[...j,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:z.row,total:z.total,successes:z.successes||0,failures:z.failures||0}}]);else if(Ge==="summary")xe("idle"),Le([]),_r(null),L(j=>[...j.filter(ce=>ce.kind!=="bulkProgress"),{id:Date.now(),role:"assistant",kind:"bulkSummary",content:z.message,bulkSummary:{total:z.total,successes:z.successes,failures:z.failures||[],navigationPage:z.navigationPage}}]),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:z.total,successes:z.successes}}}))},100);else if(Ge==="error"){xe("idle"),Le([]),_r(null);let j={id:O+1,role:"assistant",kind:"text",content:z.message||"An error occurred processing your CSV file."};L(ee=>[...ee,j])}else Ge==="done"&&(xe("idle"),Le([]))}catch(z){console.error("Failed to parse bulk SSE event:",z)}}}Le([]),xe("idle")}catch(E){console.error("Bulk upload failed:",E),Le([]),xe("idle");let K="I'm having trouble processing your CSV file.";E instanceof Error&&(E.name==="AbortError"?K="The bulk upload request timed out. The file might be too large or the server is busy - please try again.":E.message.includes("Failed to fetch")||E.message.includes("NetworkError")?K="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":E.message.includes("Bulk upload failed:")&&(K="The server encountered an error processing your CSV file. Please try again.")),K+=" Please try again.";let G={id:O+1,role:"assistant",kind:"text",content:K};L(T=>[...T,G])}}async function Mp(v){xe("executing"),Le([{message:"Starting bulk operation...",completed:!1}]);try{let k=await fetch(`${i}/chat/bulk/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bulk_session_id:v})});if(!k.ok)throw new Error(`Confirm failed: ${k.status}`);let O=k.body?.getReader();if(!O)throw new Error("No response body");let N=new TextDecoder,E="";for(;;){let{done:K,value:G}=await O.read();if(K)break;E+=N.decode(G,{stream:!0});let T=E.split(`
|
|
71
36
|
|
|
72
|
-
`);E=T.pop()||"";for(let
|
|
73
|
-
`),Q="",ae="";for(let J of I)J.startsWith("event: ")?Q=J.slice(7):J.startsWith("data: ")&&(ae=J.slice(6));if(!(!Q||!ae))try{let J=JSON.parse(ae);if(Q==="progress")Ie([{message:`Processing row ${J.row} of ${J.total}...`,completed:!1}]),w(he=>he[he.length-1]?.kind==="bulkProgress"?he.map((vt,aa)=>aa===he.length-1?{...vt,bulkProgress:{processed:J.row,total:J.total,successes:J.successes||0,failures:J.failures||0}}:vt):[...he,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:J.row,total:J.total,successes:J.successes||0,failures:J.failures||0}}]);else if(Q==="summary")console.log("[DEBUG] Received summary event - data:",J),console.log("[DEBUG] navigationPage from backend:",J.navigationPage),xe("idle"),Ie([]),Va(null),w(he=>{let at=he.filter(aa=>aa.kind!=="bulkProgress"&&aa.kind!=="bulkPreview"),vt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:J.message,bulkSummary:{total:J.total,successes:J.successes,failures:J.failures||[],navigationPage:J.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",vt),[...at,vt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:J.total,successes:J.successes}}}))},100);else if(Q==="error"){xe("idle"),Ie([]),Va(null);let he={id:Date.now(),role:"assistant",kind:"text",content:J.message||"An error occurred during bulk processing."};w(at=>[...at,he])}}catch(J){console.error("Failed to parse confirm SSE event:",J)}}}}catch(k){console.error("Bulk confirm failed:",k),xe("idle"),Ie([]),Va(null);let D={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};w(N=>[...N,D])}}function Rk(){Va(null),w(S=>S.filter(k=>k.kind!=="bulkPreview"))}function tv(S){Bu(S)}function Ek(S){let k=Date.now()+Math.floor(Math.random()*1e3);w(D=>[...D,{id:k,role:"assistant",kind:"text",content:S}])}function wN(S){let k=Vy[S];if(!k)return;Oo("landing"),Bo(void 0);let D={id:S,stepIndex:0};Ua(D),Ve.current=D,Ek(`I'll help you with ${k.title}.`);let N=k.steps[0],E=N.cursorTarget?.selector.includes("[data-page="),Z=N.cursorTarget?.selector.includes("[data-settings-tab=");if(N.cursorTarget&&(E||Z)){let T=N.cursorTarget;Z&&N.navigation&&o&&o(N.navigation.page,void 0),setTimeout(()=>{let I=()=>{let Q=document.querySelector(T.selector);Q&&Q.offsetParent!==null?(Fo(T),T.onClick&&setTimeout(()=>{Q.click()},1200)):setTimeout(I,200)};I()},Z?800:400)}else if(N.navigation&&o&&o(N.navigation.page,N.navigation.subtab),N.cursorTarget){let T=N.cursorTarget,O=T.selector.includes("data-settings-tab"),I=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let ae=()=>{let J=document.querySelector(T.selector);J&&J.offsetParent!==null?(Fo(T),T.onClick&&setTimeout(()=>{J.click()},1e3)):O||I?setTimeout(ae,200):(Fo(T),T.onClick&&setTimeout(()=>{let he=document.querySelector(T.selector);he&&he.click()},1e3))};ae()},I?700:O?600:400)}let Y={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};w(T=>[...T,Y]),ra(Y.id,N.text)}function Tp(){if(!ye)return;let S=Vy[ye.id];if(!S)return;let k=Ve.current;(!k||k.id!==ye.id)&&(k=ye,Ve.current=ye);let N=k.stepIndex+1;if(N>=S.steps.length){Vn();let I=Date.now()+1;w(Q=>[...Q,{id:I,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Ua(void 0),Mi(!0);return}let E=S.steps[N],Z={id:ye.id,stepIndex:N};Ua(Z),Ve.current=Z;let Y={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:N};w(I=>[...I,Y]);let T=E.cursorTarget?.selector.includes("[data-page="),O=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(T||O)){let I=E.cursorTarget;O&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let ae=Ve.current;if(!ae||ae.id!==S.id||ae.stepIndex!==N)return;let J=()=>{let he=Ve.current;if(!he||he.id!==S.id||he.stepIndex!==N)return;let at=document.querySelector(I.selector);at&&at.offsetParent!==null?(Fo(I),I.onClick&&setTimeout(()=>{let vt=Ve.current;!vt||vt.id!==S.id||vt.stepIndex!==N||at.click()},1200)):setTimeout(J,200)};J()},O?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let I=E.cursorTarget,Q=I.selector.includes("dialog")||I.selector.includes("api-key-name-input"),ae=I.selector.includes("data-settings-tab"),J=E.navigation?.subtab&&ae&&I.selector.includes(`data-settings-tab="${E.navigation.subtab}"`),he=I.onClick&&!J,at=!!E.navigation,Qe=(!!E.navigation?.subtab?700:at?400:0)+(Q?700:ae?600:400);setTimeout(()=>{let Cr=Ve.current;if(!Cr||Cr.id!==S.id||Cr.stepIndex!==N)return;let z=()=>{let j=Ve.current;if(!j||j.id!==S.id||j.stepIndex!==N)return;let re=document.querySelector(I.selector);re&&re.offsetParent!==null?(Fo(I),he&&setTimeout(()=>{let fe=Ve.current;!fe||fe.id!==S.id||fe.stepIndex!==N||re.click()},1e3)):Q||ae||I.selector.includes("data-testid")?setTimeout(z,200):(Fo(I),he&&setTimeout(()=>{let fe=Ve.current;if(!fe||fe.id!==S.id||fe.stepIndex!==N)return;let Nt=document.querySelector(I.selector);Nt&&Nt.click()},1e3))};z()},Qe)}else Vn();ra(Y.id,E.text)}function Dk(){if(!ye)return;let S=Vy[ye.id];if(!S)return;let k=ye.stepIndex-1;if(k>=0){Ua({id:ye.id,stepIndex:k});let D=S.steps[k];D.navigation&&o&&o(D.navigation.page,D.navigation.subtab),D.cursorTarget?setTimeout(()=>{Fo(D.cursorTarget)},500):Vn();let N=y.filter(E=>E.kind!=="guideStep"&&E.kind!=="guideComplete");w([...N,{id:Date.now(),role:"assistant",kind:"guideStep",content:D.text}])}}if(!e)return(0,p.jsx)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:(0,p.jsx)("div",{className:`flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${Jy?"w-[480px]":"w-[320px]"}`,children:Jy?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("input",{ref:Qy,type:"text",value:qn,onChange:S=>Ou(S.target.value),onKeyDown:S=>{S.key==="Enter"&&qn.trim()?(S.preventDefault(),r?.(),Bu(qn.trim()),Ou(""),Bi(!1)):S.key==="Escape"&&(Bi(!1),Ou(""))},onBlur:()=>{qn.trim()||setTimeout(()=>Bi(!1),200)},placeholder:"Ask a question...",className:"flex-1 text-sm text-gray-700 outline-none bg-transparent"}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u21B5 Enter"}),(0,p.jsx)("button",{onClick:()=>{r?.(),qn.trim()&&P(qn),Ou(""),Bi(!1)},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",children:(0,p.jsx)(ar,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})]}):(0,p.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,p.jsxs)("button",{onClick:()=>{Bi(!0),setTimeout(()=>Qy.current?.focus(),100)},className:"flex items-center gap-3 flex-1 group",children:[(0,p.jsx)("span",{className:"text-sm text-gray-500 flex-1 text-left",children:"Ask a question..."}),(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u2318I"})]}),(0,p.jsx)("button",{onClick:()=>{r?.()},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:(0,p.jsx)(ar,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})});if(Re.status==="loading")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${hp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ar,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(it,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(ba,{className:"h-4 w-4"})})]}),(0,p.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,p.jsxs)("div",{className:"text-center",children:[(0,p.jsx)(Rt,{className:"h-8 w-8 animate-spin text-gray-400 mx-auto mb-3"}),(0,p.jsx)("p",{className:"text-sm text-gray-500",children:"Loading..."})]})})]});if(De){if(de.status==="loading")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${hp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ar,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(it,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(Sn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(fN,{})]});if(de.status==="error")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${hp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ar,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(it,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(Sn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(pN,{error:de.error,onRetry:Oa})]})}return(0,p.jsxs)(Tu.section,{drag:!0,dragMomentum:!1,dragElastic:0,animate:me,onDragStart:()=>V(!0),onDragEnd:ce,className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${F?"cursor-grabbing":""} ${_==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${hp}px`,height:`${iN}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0 cursor-grab active:cursor-grabbing",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ar,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsxs)("div",{className:"flex items-center gap-1",children:[(0,p.jsx)(it,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{xp(),w([]),Oo("landing"),Bo(void 0),Ua(void 0),Ve.current=void 0,Mi(!1)},children:(0,p.jsx)(jt,{className:"h-3 w-3"})}),(0,p.jsx)(it,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{yt&&(xp(),w([]),Oo("landing"),Bo(void 0),Ua(void 0),Ve.current=void 0,Mi(!1)),t?.()},children:(0,p.jsx)(Sn,{className:"h-3.5 w-3.5"})})]})]}),(0,p.jsx)("div",{className:$y?"grid flex-1 place-items-center transition-all duration-300":"flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",children:$y?(0,p.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,p.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,p.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:wp==="folder"?hk.find(S=>S.id===Hy)?.title||"":"How can I help?"})}),(0,p.jsxs)("div",{className:"pb-4 px-4",children:[wp==="landing"&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex flex-col gap-1",children:Lk?(0,p.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,p.jsx)(Rt,{className:"h-4 w-4 animate-spin text-gray-400"})}):bk.map((S,k)=>{let D=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,p.jsxs)(it,{type:"button",size:"sm",variant:"ghost",className:"w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",onClick:()=>tv(S.prompt),children:[(0,p.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${D[k%D.length]}`}),S.label]},S.id)})})}),wp==="folder"&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,p.jsx)(it,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:Pk,"aria-label":"Back to suggestions",children:(0,p.jsx)(Os,{className:"h-4 w-4 text-gray-500"})}),(0,p.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,p.jsx)("div",{className:"flex flex-col gap-1.5",children:hk.find(S=>S.id===Hy)?.topics.map(S=>(0,p.jsx)(it,{type:"button",size:"sm",variant:"secondary",className:"justify-start rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700 shadow-none transition-all hover:bg-gray-100 hover:border-gray-300 h-auto",onClick:()=>tv(S.prompt),children:S.label},S.id))})]})]})]}):(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,p.jsx)(Eg,{ref:Cp,className:"h-full",children:(0,p.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[y.map((S,k)=>{let D=S.role==="user",N=k>0?y[k-1].role:void 0,E=N!==void 0&&N!==S.role,Z=Ve.current||ye,Y=!1;if(Z&&S.kind==="guideStep"?S.guideStepIndex!==void 0?Y=S.guideStepIndex===Z.stepIndex:Y=k===y.length-1:S.kind==="guideComplete"&&(Y=k===y.length-1),S.kind==="guideStep"&&!Y)return null;if(D)return(0,p.jsx)("div",{className:`flex justify-end ${E?"mt-3":""}`,children:(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-sm text-white shadow-sm",children:S.content})},S.id);if(S.role==="agent")return(0,p.jsxs)("div",{className:`flex flex-col items-start ${E?"mt-3":""}`,children:[E&&(0,p.jsx)("span",{className:"text-[10px] text-gray-500 mb-1 ml-1",children:"Agent"}),(0,p.jsx)("div",{className:"max-w-[300px] rounded-2xl rounded-bl-md bg-gray-100 px-4 py-3 text-sm text-gray-700",children:S.content})]},S.id);if(S.kind==="searchSummary")return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsx)(sk,{title:S.title??"Search results",links:S.links??[]})},S.id);if(S.kind==="guideComplete")return(0,p.jsx)("div",{ref:Y?Nu:null,className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6",children:[(0,p.jsx)(lt,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,p.jsx)("span",{className:"font-medium text-green-800",children:S.content})]})},S.id);if(S.kind==="navigationAction")return(0,p.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:S.content||""}),S.navigationTarget&&(0,p.jsx)("div",{className:"mt-2",children:(0,p.jsxs)(it,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>S.navigationTarget&&Ip(S.navigationTarget),children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Sa,{className:"h-3 w-3"}),(0,p.jsx)(Ca,{className:"h-3 w-3"})]})]})})]},S.id);if(S.kind==="actionForm"){let T=S.actionType,O=Object.keys(ne).length>0?ne:S.actionData||{};if(S.isSubmitted){let I="";return T==="updateCompanyInfo"?I="Company information has been updated successfully.":T==="addApiKey"?I="API key has been added successfully.":T==="addCustomer"?I="Customer has been added successfully.":T==="enable2FA"?I="Two-factor authentication has been enabled successfully.":T==="disable2FA"?I="Two-factor authentication has been disabled successfully.":T==="changePassword"?I="Your password has been changed successfully.":T==="revokeSession"?I="Session has been revoked successfully.":T==="toggleNotification"?I="Notification preferences have been updated successfully.":T==="connectIntegration"?I="Integration has been connected successfully.":T==="disconnectIntegration"?I="Integration has been disconnected successfully.":T==="addPaymentMethod"?I="Payment method has been added successfully.":T==="removePaymentMethod"?I="Payment method has been removed successfully.":T==="deleteApiKey"?I="API key has been deleted successfully.":T==="addWebhook"?I="Webhook endpoint has been added successfully.":T==="updateCurrency"?I="Currency preference has been updated successfully.":T==="updateTimezone"?I="Timezone has been updated successfully.":T==="refundPayment"?I="Refund has been processed successfully.":T==="exportCertificate"?I="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?I="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?I="Block rule has been updated successfully.":I="Action completed successfully.",(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:I})},S.id)}return(0,p.jsxs)("div",{className:`min-w-0 ${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:S.content||""}),T==="updateCompanyInfo"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(Ue,{placeholder:"Acme Corporation",value:O.companyName||"",onChange:I=>se({...ne,companyName:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(Ue,{type:"email",placeholder:"contact@acme.com",value:O.email||"",onChange:I=>se({...ne,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,p.jsx)(Ue,{placeholder:"123 Main St, San Francisco, CA",value:O.address||"",onChange:I=>se({...ne,address:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,p.jsx)(Ue,{type:"tel",placeholder:"+1 (555) 123-4567",value:O.phone||"",onChange:I=>se({...ne,phone:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,p.jsx)(Ue,{type:"url",placeholder:"https://acme.com",value:O.website||"",onChange:I=>se({...ne,website:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),T==="addApiKey"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,p.jsx)(Ue,{placeholder:"Production Key",value:O.name||"",onChange:I=>se({...ne,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})}),T==="addCustomer"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(Ue,{placeholder:"Acme Corporation",value:O.name||"",onChange:I=>se({...ne,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(Ue,{type:"email",placeholder:"contact@acme.com",value:O.email||"",onChange:I=>se({...ne,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,p.jsx)(Ue,{placeholder:"San Francisco, CA",value:O.location||"",onChange:I=>se({...ne,location:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,p.jsxs)("select",{value:O.subscription||"Starter",onChange:I=>se({...ne,subscription:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter"}),(0,p.jsx)("option",{value:"Professional",children:"Professional"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(T==="enable2FA"||T==="disable2FA")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enable2FA"?"This will enable two-factor authentication for your account. You'll need to set up an authenticator app.":"This will disable two-factor authentication for your account. Your account will be less secure."})}),T==="changePassword"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,p.jsx)(Ue,{type:"password",value:O.currentPassword||"",onChange:I=>se({...ne,currentPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,p.jsx)(Ue,{type:"password",value:O.newPassword||"",onChange:I=>se({...ne,newPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,p.jsx)(Ue,{type:"password",value:O.confirmPassword||"",onChange:I=>se({...ne,confirmPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="toggleNotification"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,p.jsxs)("select",{value:O.notificationType||"paymentReceived",onChange:I=>se({...ne,notificationType:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,p.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,p.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,p.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,p.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("input",{type:"checkbox",checked:O.enabled!==!1,onChange:I=>se({...ne,enabled:I.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),(0,p.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(T==="connectIntegration"||T==="disconnectIntegration")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,p.jsxs)("select",{value:O.integrationName||"Slack",onChange:I=>se({...ne,integrationName:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Slack",children:"Slack"}),(0,p.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,p.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),T==="addPaymentMethod"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,p.jsx)(Ue,{placeholder:"1234 5678 9012 3456",value:O.cardNumber||"",onChange:I=>se({...ne,cardNumber:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,p.jsx)(Ue,{placeholder:"MM/YY",value:O.expiryDate||"",onChange:I=>se({...ne,expiryDate:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="removePaymentMethod"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),T==="refundPayment"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,p.jsx)(Ue,{placeholder:"e.g., txn_1234 or Acme Corp",value:O.transactionId||O.customer||"",onChange:I=>{let Q=I.target.value;Q.startsWith("txn_")||/^\d+$/.test(Q)?se({...ne,transactionId:Q,customer:void 0}):se({...ne,customer:Q,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,p.jsx)(Ue,{placeholder:"$0.00",value:O.amount||"",onChange:I=>se({...ne,amount:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,p.jsx)(Ue,{placeholder:"e.g., Customer request",value:O.reason||"",onChange:I=>se({...ne,reason:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="deleteApiKey"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,p.jsx)(Ue,{placeholder:"Production Key",value:O.keyId||O.name||"",onChange:I=>se({...ne,keyId:I.target.value,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),T==="addWebhook"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,p.jsx)(Ue,{type:"url",placeholder:"https://example.com/webhook",value:O.url||"",onChange:I=>se({...ne,url:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,p.jsx)(Ue,{placeholder:"Production Webhook",value:O.name||"",onChange:I=>se({...ne,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="updateCurrency"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,p.jsxs)("select",{value:O.currency||"USD",onChange:I=>se({...ne,currency:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"USD",children:"USD ($)"}),(0,p.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,p.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,p.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),T==="updateTimezone"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,p.jsxs)("select",{value:O.timezone||"America/Los_Angeles",onChange:I=>se({...ne,timezone:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,p.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,p.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,p.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),T==="revokeSession"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,p.jsx)(Ue,{placeholder:"MacBook Pro",value:O.device||"",onChange:I=>se({...ne,device:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),T==="createSubscription"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,p.jsx)(Ue,{type:"email",placeholder:"customer@example.com",value:O.customerEmail||"",onChange:I=>se({...ne,customerEmail:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,p.jsxs)("select",{value:O.plan||"Starter",onChange:I=>se({...ne,plan:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,p.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,p.jsxs)("select",{value:O.billingCycle||"monthly",onChange:I=>se({...ne,billingCycle:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"monthly",children:"Monthly"}),(0,p.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),T==="exportCertificate"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,p.jsxs)("select",{value:O.format||"pdf",onChange:I=>se({...ne,format:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"pdf",children:"PDF"}),(0,p.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule")&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,p.jsxs)("select",{value:O.ruleId||"rule_1",onChange:I=>se({...ne,ruleId:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,p.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,p.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,p.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":T==="disableBlockRule"?"This will disable the selected block rule. Matching payments will no longer be blocked.":"This will toggle the selected block rule's state."})]}),(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsxs)(it,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:kp,children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Sa,{className:"h-3 w-3"}),(0,p.jsx)(Ca,{className:"h-3 w-3"})]})]})})]},S.id)}if(S.kind==="bulkPreview"&&S.csvData)return(0,p.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:S.content||""}),(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,p.jsx)(Bs,{className:"h-4 w-4 text-gray-600"}),(0,p.jsx)("span",{className:"text-xs font-medium text-gray-700",children:S.csvData.fileName}),(0,p.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",S.csvData.rowCount," rows"]})]}),(0,p.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,p.jsx)("div",{className:"flex flex-wrap gap-1",children:S.csvData.columns.map((T,O)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},O))})]}),S.csvData.sampleRows.length>0&&(0,p.jsxs)("div",{className:"px-3 py-2",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,p.jsx)("div",{className:"space-y-1",children:S.csvData.sampleRows.slice(0,3).map((T,O)=>(0,p.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(T).slice(0,3).map(([I,Q],ae)=>(0,p.jsxs)("span",{children:[ae>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[I,":"]})," ",Q]},I)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},O))})]}),S.suggestedAction&&(0,p.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,p.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,p.jsx)("strong",{children:S.suggestedAction.replace(/_/g," ")})]})})]}),S.bulkSessionId&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,p.jsxs)(it,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>S.bulkSessionId&&Pp(S.bulkSessionId),children:[(0,p.jsxs)("span",{children:["Process ",S.csvData.rowCount," rows"]}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(Sa,{className:"h-3 w-3"}),(0,p.jsx)(Ca,{className:"h-3 w-3"})]})]}),(0,p.jsx)(it,{type:"button",size:"sm",variant:"ghost",className:"h-8 rounded-xl px-3 text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100",onClick:Rk,children:"Cancel"})]})]},S.id);if(S.kind==="bulkProgress"&&S.bulkProgress){let{processed:T,total:O,successes:I,failures:Q}=S.bulkProgress,ae=Math.round(T/O*100);return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(Rt,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,p.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",T," of ",O]})]}),(0,p.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,p.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${ae}%`}})}),(0,p.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1",children:[(0,p.jsx)(lt,{className:"h-3 w-3 text-green-600"}),I," successful"]}),Q>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(ba,{className:"h-3 w-3"}),Q," failed"]})]})]})},S.id)}if(S.kind==="bulkSummary"&&S.bulkSummary){let{total:T,successes:O,failures:I,navigationPage:Q}=S.bulkSummary,ae=I.length>0,J=Q?.page==="customers"?"Customers":Q?.page==="dashboard"?"Dashboard":Q?.page==="settings"?"Settings":"Results";return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:`rounded-lg border p-3 ${ae?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(lt,{className:`h-5 w-5 ${ae?"text-amber-600":"text-green-600"}`}),(0,p.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,p.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:S.content||`Processed ${T} rows: ${O} successful${ae?`, ${I.length} failed`:""}.`}),(0,p.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,p.jsx)(lt,{className:"h-3 w-3"}),O," successful"]}),ae&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(ba,{className:"h-3 w-3"}),I.length," failed"]})]}),ae&&(0,p.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,p.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[I.slice(0,5).map((he,at)=>(0,p.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",he.row,":"," ",he.error||"Unknown error"]},at)),I.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",I.length-5," more"]})]})]}),Q&&O>0&&(0,p.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,p.jsxs)("button",{type:"button",onClick:he=>{he.preventDefault(),he.stopPropagation(),console.log("[DEBUG] Button clicked - navigationPage:",Q,"onNavigate:",!!o),o&&Q.page?(console.log("[DEBUG] Calling onNavigate with page:",Q.page),o(Q.page,Q.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",Q.page)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200",children:[(0,p.jsx)(Sa,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(Ca,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",J]})]})})]})},S.id)}return(0,p.jsx)(B.Fragment,{children:(0,p.jsxs)("div",{ref:Y?Nu:null,className:`${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let T=S.content||"";if(S.kind==="guideStep"){let O=T.match(/^(Step\s+\d+:)([\s\S]*)/);if(O)return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("strong",{children:O[1]}),O[2]]})}return S.role==="assistant"&&T?uN(T):T||(0,p.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),S.role==="assistant"&&S.structuredData&&(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsx)(pk,{type:S.structuredData.type,data:S.structuredData.data})}),S.role==="assistant"&&S.followups&&S.followups.length>0&&!S.followupSelected&&(0,p.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:S.followups.map(T=>(0,p.jsx)("button",{type:"button",onClick:()=>kk(S.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
37
|
+
`);E=T.pop()||"";for(let D of T){if(!D.trim())continue;let I=D.split(`
|
|
38
|
+
`),Q="",ae="";for(let X of I)X.startsWith("event: ")?Q=X.slice(7):X.startsWith("data: ")&&(ae=X.slice(6));if(!(!Q||!ae))try{let X=JSON.parse(ae);if(Q==="progress")Le([{message:`Processing row ${X.row} of ${X.total}...`,completed:!1}]),L(me=>me[me.length-1]?.kind==="bulkProgress"?me.map((It,tr)=>tr===me.length-1?{...It,bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}:It):[...me,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:X.row,total:X.total,successes:X.successes||0,failures:X.failures||0}}]);else if(Q==="summary")xe("idle"),Le([]),_r(null),L(me=>{let Ye=me.filter(tr=>tr.kind!=="bulkProgress"&&tr.kind!=="bulkPreview"),It={id:Date.now(),role:"assistant",kind:"bulkSummary",content:X.message,bulkSummary:{total:X.total,successes:X.successes,failures:X.failures||[],navigationPage:X.navigationPage}};return[...Ye,It]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:X.total,successes:X.successes}}}))},100);else if(Q==="error"){xe("idle"),Le([]),_r(null);let me={id:Date.now(),role:"assistant",kind:"text",content:X.message||"An error occurred during bulk processing."};L(Ye=>[...Ye,me])}}catch(X){console.error("Failed to parse confirm SSE event:",X)}}}}catch(k){console.error("Bulk confirm failed:",k),xe("idle"),Le([]),_r(null);let O={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};L(N=>[...N,O])}}function $k(){_r(null),L(v=>v.filter(k=>k.kind!=="bulkPreview"))}function ox(v){ju(v)}function Wk(v){let k=Date.now()+Math.floor(Math.random()*1e3);L(O=>[...O,{id:k,role:"assistant",kind:"text",content:v}])}function aM(v){let k=Hy[v];if(!k)return;ko("landing"),Po(void 0);let O={id:v,stepIndex:0};Rr(O),Me.current=O,Wk(`I'll help you with ${k.title}.`);let N=k.steps[0],E=N.cursorTarget?.selector.includes("[data-page="),K=N.cursorTarget?.selector.includes("[data-settings-tab=");if(N.cursorTarget&&(E||K)){let T=N.cursorTarget;K&&N.navigation&&o&&o(N.navigation.page,void 0),setTimeout(()=>{let I=()=>{let Q=document.querySelector(T.selector);Q&&Q.offsetParent!==null?(To(T),T.onClick&&setTimeout(()=>{Q.click()},1200)):setTimeout(I,200)};I()},K?800:400)}else if(N.navigation&&o&&o(N.navigation.page,N.navigation.subtab),N.cursorTarget){let T=N.cursorTarget,D=T.selector.includes("data-settings-tab"),I=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let ae=()=>{let X=document.querySelector(T.selector);X&&X.offsetParent!==null?(To(T),T.onClick&&setTimeout(()=>{X.click()},1e3)):D||I?setTimeout(ae,200):(To(T),T.onClick&&setTimeout(()=>{let me=document.querySelector(T.selector);me&&me.click()},1e3))};ae()},I?700:D?600:400)}let G={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};L(T=>[...T,G]),er(G.id,N.text)}function Np(){if(!ge)return;let v=Hy[ge.id];if(!v)return;let k=Me.current;(!k||k.id!==ge.id)&&(k=ge,Me.current=ge);let N=k.stepIndex+1;if(N>=v.steps.length){Mn();let I=Date.now()+1;L(Q=>[...Q,{id:I,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Rr(void 0),_i(!0);return}let E=v.steps[N],K={id:ge.id,stepIndex:N};Rr(K),Me.current=K;let G={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:N};L(I=>[...I,G]);let T=E.cursorTarget?.selector.includes("[data-page="),D=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(T||D)){let I=E.cursorTarget;D&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let ae=Me.current;if(!ae||ae.id!==v.id||ae.stepIndex!==N)return;let X=()=>{let me=Me.current;if(!me||me.id!==v.id||me.stepIndex!==N)return;let Ye=document.querySelector(I.selector);Ye&&Ye.offsetParent!==null?(To(I),I.onClick&&setTimeout(()=>{let It=Me.current;!It||It.id!==v.id||It.stepIndex!==N||Ye.click()},1200)):setTimeout(X,200)};X()},D?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let I=E.cursorTarget,Q=I.selector.includes("dialog")||I.selector.includes("api-key-name-input"),ae=I.selector.includes("data-settings-tab"),X=E.navigation?.subtab&&ae&&I.selector.includes(`data-settings-tab="${E.navigation.subtab}"`),me=I.onClick&&!X,Ye=!!E.navigation,Ge=(!!E.navigation?.subtab?700:Ye?400:0)+(Q?700:ae?600:400);setTimeout(()=>{let va=Me.current;if(!va||va.id!==v.id||va.stepIndex!==N)return;let z=()=>{let j=Me.current;if(!j||j.id!==v.id||j.stepIndex!==N)return;let ee=document.querySelector(I.selector);ee&&ee.offsetParent!==null?(To(I),me&&setTimeout(()=>{let ce=Me.current;!ce||ce.id!==v.id||ce.stepIndex!==N||ee.click()},1e3)):Q||ae||I.selector.includes("data-testid")?setTimeout(z,200):(To(I),me&&setTimeout(()=>{let ce=Me.current;if(!ce||ce.id!==v.id||ce.stepIndex!==N)return;let Dt=document.querySelector(I.selector);Dt&&Dt.click()},1e3))};z()},Ge)}else Mn();er(G.id,E.text)}function Gk(){if(!ge)return;let v=Hy[ge.id];if(!v)return;let k=ge.stepIndex-1;if(k>=0){Rr({id:ge.id,stepIndex:k});let O=v.steps[k];O.navigation&&o&&o(O.navigation.page,O.navigation.subtab),O.cursorTarget?setTimeout(()=>{To(O.cursorTarget)},500):Mn();let N=C.filter(E=>E.kind!=="guideStep"&&E.kind!=="guideComplete");L([...N,{id:Date.now(),role:"assistant",kind:"guideStep",content:O.text}])}}if(!e)return(0,p.jsx)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 z-50",children:(0,p.jsx)("div",{className:`flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${Zy?"w-[480px]":"w-[320px]"}`,children:Zy?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("input",{ref:ex,type:"text",value:On,onChange:v=>Vu(v.target.value),onKeyDown:v=>{v.key==="Enter"&&On.trim()?(v.preventDefault(),a?.(),ju(On.trim()),Vu(""),Di(!1)):v.key==="Escape"&&(Di(!1),Vu(""))},onBlur:()=>{On.trim()||setTimeout(()=>Di(!1),200)},placeholder:"Ask a question...",className:"flex-1 text-sm text-gray-700 outline-none bg-transparent"}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u21B5 Enter"}),(0,p.jsx)("button",{onClick:()=>{a?.(),On.trim()&&A(On),Vu(""),Di(!1)},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors cursor-pointer",children:(0,p.jsx)(ea,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})]}):(0,p.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[(0,p.jsxs)("button",{onClick:()=>{Di(!0),setTimeout(()=>ex.current?.focus(),100)},className:"flex items-center gap-3 flex-1 group",children:[(0,p.jsx)("span",{className:"text-sm text-gray-500 flex-1 text-left",children:"Ask a question..."}),(0,p.jsx)("span",{className:"text-xs text-gray-400 font-medium",children:"\u2318I"})]}),(0,p.jsx)("button",{onClick:()=>{a?.()},className:"h-7 w-7 rounded-lg bg-gray-100 hover:bg-gray-200 flex items-center justify-center transition-colors",children:(0,p.jsx)(ea,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})});if(We.status==="loading")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${Lp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ea,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(at,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(xr,{className:"h-4 w-4"})})]}),(0,p.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,p.jsxs)("div",{className:"text-center",children:[(0,p.jsx)(Rt,{className:"h-8 w-8 animate-spin text-gray-400 mx-auto mb-3"}),(0,p.jsx)("p",{className:"text-sm text-gray-500",children:"Loading..."})]})})]});if(mt){if(je.status==="loading")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${Lp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ea,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(at,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(mn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(WD,{})]});if(je.status==="error")return(0,p.jsxs)("section",{className:`fixed top-0 right-0 z-40 flex flex-col bg-white border-l border-gray-200 h-full overflow-hidden transition-transform duration-300 ${e?"translate-x-0":"translate-x-full"}`,style:{width:`${Lp}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ea,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsx)(at,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>t?.(),children:(0,p.jsx)(mn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(GD,{error:je.error,onRetry:Rk})]})}return(0,p.jsxs)(Eu.section,{drag:!0,dragMomentum:!1,dragElastic:0,animate:le,onDragStart:()=>pe(!0),onDragEnd:Rn,className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${V?"cursor-grabbing":""} ${R==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Lp}px`,height:`${jD}px`},children:[(0,p.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0 cursor-grab active:cursor-grabbing",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,p.jsx)(ea,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"}),(0,p.jsx)("h3",{className:"text-sm font-semibold text-gray-800",children:"Copilot"})]}),(0,p.jsxs)("div",{className:"flex items-center gap-1",children:[(0,p.jsx)(at,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{kp(),L([]),ko("landing"),Po(void 0),Rr(void 0),Me.current=void 0,_i(!1)},children:(0,p.jsx)(jt,{className:"h-3 w-3"})}),(0,p.jsx)(at,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",onClick:()=>{nt&&(kp(),L([]),ko("landing"),Po(void 0),Rr(void 0),Me.current=void 0,_i(!1)),t?.()},children:(0,p.jsx)(mn,{className:"h-3.5 w-3.5"})})]})]}),(0,p.jsx)("div",{className:Wy?"grid flex-1 place-items-center transition-all duration-300":"flex flex-1 flex-col transition-all duration-300 min-h-0 overflow-hidden",children:Wy?(0,p.jsxs)("div",{className:"w-full overflow-y-auto px-4",children:[(0,p.jsx)("div",{className:"py-3 transition-all duration-300",children:(0,p.jsx)("h2",{className:"text-center text-2xl font-semibold text-gray-900",children:Pp==="folder"?Pk.find(v=>v.id===Gy)?.title||"":"How can I help?"})}),(0,p.jsxs)("div",{className:"pb-4 px-4",children:[Pp==="landing"&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex flex-col gap-1",children:Bk?(0,p.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,p.jsx)(Rt,{className:"h-4 w-4 animate-spin text-gray-400"})}):Fk.map((v,k)=>{let O=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,p.jsxs)(at,{type:"button",size:"sm",variant:"ghost",className:"w-full justify-start rounded-lg px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 h-auto",onClick:()=>ox(v.prompt),children:[(0,p.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${O[k%O.length]}`}),v.label]},v.id)})})}),Pp==="folder"&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,p.jsx)(at,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:jk,"aria-label":"Back to suggestions",children:(0,p.jsx)(_s,{className:"h-4 w-4 text-gray-500"})}),(0,p.jsx)("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:"Topics"})]}),(0,p.jsx)("div",{className:"flex flex-col gap-1.5",children:Pk.find(v=>v.id===Gy)?.topics.map(v=>(0,p.jsx)(at,{type:"button",size:"sm",variant:"secondary",className:"justify-start rounded-xl border border-gray-200 bg-gray-50 px-3 py-2.5 text-xs text-gray-700 shadow-none transition-all hover:bg-gray-100 hover:border-gray-300 h-auto",onClick:()=>ox(v.prompt),children:v.label},v.id))})]})]})]}):(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,p.jsx)(Ng,{ref:Ap,className:"h-full",children:(0,p.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-3",children:[C.map((v,k)=>{let O=v.role==="user",N=k>0?C[k-1].role:void 0,E=N!==void 0&&N!==v.role,K=Me.current||ge,G=!1;if(K&&v.kind==="guideStep"?v.guideStepIndex!==void 0?G=v.guideStepIndex===K.stepIndex:G=k===C.length-1:v.kind==="guideComplete"&&(G=k===C.length-1),v.kind==="guideStep"&&!G)return null;if(O)return(0,p.jsx)("div",{className:`flex justify-end ${E?"mt-3":""}`,children:(0,p.jsx)("div",{className:"max-w-[260px] rounded-2xl rounded-br-md bg-gray-900 px-3 py-2 text-sm text-white shadow-sm",children:v.content})},v.id);if(v.role==="agent")return(0,p.jsxs)("div",{className:`flex flex-col items-start ${E?"mt-3":""}`,children:[E&&(0,p.jsx)("span",{className:"text-[10px] text-gray-500 mb-1 ml-1",children:"Agent"}),(0,p.jsx)("div",{className:"max-w-[300px] rounded-2xl rounded-bl-md bg-gray-100 px-4 py-3 text-sm text-gray-700",children:v.content})]},v.id);if(v.kind==="searchSummary")return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsx)(xk,{title:v.title??"Search results",links:v.links??[]})},v.id);if(v.kind==="guideComplete")return(0,p.jsx)("div",{ref:G?Bu:null,className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"flex items-center gap-2 rounded-xl bg-green-50 border border-green-200 px-3 py-2.5 text-sm leading-6",children:[(0,p.jsx)(rt,{className:"h-5 w-5 text-green-600 flex-shrink-0"}),(0,p.jsx)("span",{className:"font-medium text-green-800",children:v.content})]})},v.id);if(v.kind==="navigationAction")return(0,p.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-2 text-gray-700",children:v.content||""}),v.navigationTarget&&(0,p.jsx)("div",{className:"mt-2",children:(0,p.jsxs)(at,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>v.navigationTarget&&Ep(v.navigationTarget),children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(gr,{className:"h-3 w-3"}),(0,p.jsx)(yr,{className:"h-3 w-3"})]})]})})]},v.id);if(v.kind==="actionForm"){let T=v.actionType,D=Object.keys(ne).length>0?ne:v.actionData||{};if(v.isSubmitted){let I="";return T==="updateCompanyInfo"?I="Company information has been updated successfully.":T==="addApiKey"?I="API key has been added successfully.":T==="addCustomer"?I="Customer has been added successfully.":T==="enable2FA"?I="Two-factor authentication has been enabled successfully.":T==="disable2FA"?I="Two-factor authentication has been disabled successfully.":T==="changePassword"?I="Your password has been changed successfully.":T==="revokeSession"?I="Session has been revoked successfully.":T==="toggleNotification"?I="Notification preferences have been updated successfully.":T==="connectIntegration"?I="Integration has been connected successfully.":T==="disconnectIntegration"?I="Integration has been disconnected successfully.":T==="addPaymentMethod"?I="Payment method has been added successfully.":T==="removePaymentMethod"?I="Payment method has been removed successfully.":T==="deleteApiKey"?I="API key has been deleted successfully.":T==="addWebhook"?I="Webhook endpoint has been added successfully.":T==="updateCurrency"?I="Currency preference has been updated successfully.":T==="updateTimezone"?I="Timezone has been updated successfully.":T==="refundPayment"?I="Refund has been processed successfully.":T==="exportCertificate"?I="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?I="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?I="Block rule has been updated successfully.":I="Action completed successfully.",(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 text-gray-700",children:I})},v.id)}return(0,p.jsxs)("div",{className:`min-w-0 ${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:v.content||""}),T==="updateCompanyInfo"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(De,{placeholder:"Acme Corporation",value:D.companyName||"",onChange:I=>se({...ne,companyName:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(De,{type:"email",placeholder:"contact@acme.com",value:D.email||"",onChange:I=>se({...ne,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Address"}),(0,p.jsx)(De,{placeholder:"123 Main St, San Francisco, CA",value:D.address||"",onChange:I=>se({...ne,address:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Phone"}),(0,p.jsx)(De,{type:"tel",placeholder:"+1 (555) 123-4567",value:D.phone||"",onChange:I=>se({...ne,phone:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Website"}),(0,p.jsx)(De,{type:"url",placeholder:"https://acme.com",value:D.website||"",onChange:I=>se({...ne,website:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]})]}),T==="addApiKey"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name"}),(0,p.jsx)(De,{placeholder:"Production Key",value:D.name||"",onChange:I=>se({...ne,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})}),T==="addCustomer"&&(0,p.jsxs)("div",{className:"space-y-2 bg-gray-50 rounded-lg p-2 border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Company Name"}),(0,p.jsx)(De,{placeholder:"Acme Corporation",value:D.name||"",onChange:I=>se({...ne,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Email"}),(0,p.jsx)(De,{type:"email",placeholder:"contact@acme.com",value:D.email||"",onChange:I=>se({...ne,email:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Location"}),(0,p.jsx)(De,{placeholder:"San Francisco, CA",value:D.location||"",onChange:I=>se({...ne,location:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Subscription Tier"}),(0,p.jsxs)("select",{value:D.subscription||"Starter",onChange:I=>se({...ne,subscription:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter"}),(0,p.jsx)("option",{value:"Professional",children:"Professional"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise"})]})]})]}),(T==="enable2FA"||T==="disable2FA")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enable2FA"?"This will enable two-factor authentication for your account. You'll need to set up an authenticator app.":"This will disable two-factor authentication for your account. Your account will be less secure."})}),T==="changePassword"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Current Password"}),(0,p.jsx)(De,{type:"password",value:D.currentPassword||"",onChange:I=>se({...ne,currentPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"New Password"}),(0,p.jsx)(De,{type:"password",value:D.newPassword||"",onChange:I=>se({...ne,newPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Confirm New Password"}),(0,p.jsx)(De,{type:"password",value:D.confirmPassword||"",onChange:I=>se({...ne,confirmPassword:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="toggleNotification"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Notification Type"}),(0,p.jsxs)("select",{value:D.notificationType||"paymentReceived",onChange:I=>se({...ne,notificationType:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"paymentReceived",children:"Payment Received"}),(0,p.jsx)("option",{value:"paymentFailed",children:"Payment Failed"}),(0,p.jsx)("option",{value:"invoicePaid",children:"Invoice Paid"}),(0,p.jsx)("option",{value:"monthlySummary",children:"Monthly Summary"}),(0,p.jsx)("option",{value:"productUpdates",children:"Product Updates"})]})]}),(0,p.jsxs)("div",{className:"flex items-center gap-2",children:[(0,p.jsx)("input",{type:"checkbox",checked:D.enabled!==!1,onChange:I=>se({...ne,enabled:I.target.checked}),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),(0,p.jsx)("label",{className:"text-xs text-black",children:"Enable this notification"})]})]}),(T==="connectIntegration"||T==="disconnectIntegration")&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Integration"}),(0,p.jsxs)("select",{value:D.integrationName||"Slack",onChange:I=>se({...ne,integrationName:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Slack",children:"Slack"}),(0,p.jsx)("option",{value:"Zapier",children:"Zapier"}),(0,p.jsx)("option",{value:"Webhook",children:"Webhook"})]})]})}),T==="addPaymentMethod"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Card Number"}),(0,p.jsx)(De,{placeholder:"1234 5678 9012 3456",value:D.cardNumber||"",onChange:I=>se({...ne,cardNumber:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Expiry Date"}),(0,p.jsx)(De,{placeholder:"MM/YY",value:D.expiryDate||"",onChange:I=>se({...ne,expiryDate:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="removePaymentMethod"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsx)("p",{className:"text-xs text-black",children:"This will remove the default payment method from your account."})}),T==="refundPayment"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Transaction ID or Customer Name"}),(0,p.jsx)(De,{placeholder:"e.g., txn_1234 or Acme Corp",value:D.transactionId||D.customer||"",onChange:I=>{let Q=I.target.value;Q.startsWith("txn_")||/^\d+$/.test(Q)?se({...ne,transactionId:Q,customer:void 0}):se({...ne,customer:Q,transactionId:void 0})},className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Amount (optional)"}),(0,p.jsx)(De,{placeholder:"$0.00",value:D.amount||"",onChange:I=>se({...ne,amount:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Reason (optional)"}),(0,p.jsx)(De,{placeholder:"e.g., Customer request",value:D.reason||"",onChange:I=>se({...ne,reason:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="deleteApiKey"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"API Key Name or ID"}),(0,p.jsx)(De,{placeholder:"Production Key",value:D.keyId||D.name||"",onChange:I=>se({...ne,keyId:I.target.value,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-red-600",children:"Warning: This action cannot be undone. The API key will be permanently deleted."})]}),T==="addWebhook"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Webhook URL"}),(0,p.jsx)(De,{type:"url",placeholder:"https://example.com/webhook",value:D.url||"",onChange:I=>se({...ne,url:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Name (optional)"}),(0,p.jsx)(De,{placeholder:"Production Webhook",value:D.name||"",onChange:I=>se({...ne,name:I.target.value}),className:"h-8 text-xs border-gray-200"})]})]}),T==="updateCurrency"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Currency"}),(0,p.jsxs)("select",{value:D.currency||"USD",onChange:I=>se({...ne,currency:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"USD",children:"USD ($)"}),(0,p.jsx)("option",{value:"EUR",children:"EUR (\u20AC)"}),(0,p.jsx)("option",{value:"GBP",children:"GBP (\xA3)"}),(0,p.jsx)("option",{value:"JPY",children:"JPY (\xA5)"})]})]})}),T==="updateTimezone"&&(0,p.jsx)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Timezone"}),(0,p.jsxs)("select",{value:D.timezone||"America/Los_Angeles",onChange:I=>se({...ne,timezone:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"America/Los_Angeles",children:"Pacific Time (PT)"}),(0,p.jsx)("option",{value:"America/New_York",children:"Eastern Time (ET)"}),(0,p.jsx)("option",{value:"Europe/London",children:"GMT"}),(0,p.jsx)("option",{value:"Asia/Tokyo",children:"JST"})]})]})}),T==="revokeSession"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Device/Session"}),(0,p.jsx)(De,{placeholder:"MacBook Pro",value:D.device||"",onChange:I=>se({...ne,device:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:"This will sign out the device and invalidate its session."})]}),T==="createSubscription"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Customer Email"}),(0,p.jsx)(De,{type:"email",placeholder:"customer@example.com",value:D.customerEmail||"",onChange:I=>se({...ne,customerEmail:I.target.value}),className:"h-8 text-xs border-gray-200"})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Plan"}),(0,p.jsxs)("select",{value:D.plan||"Starter",onChange:I=>se({...ne,plan:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"Starter",children:"Starter ($29/mo)"}),(0,p.jsx)("option",{value:"Professional",children:"Professional ($99/mo)"}),(0,p.jsx)("option",{value:"Enterprise",children:"Enterprise ($299/mo)"})]})]}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Billing Cycle"}),(0,p.jsxs)("select",{value:D.billingCycle||"monthly",onChange:I=>se({...ne,billingCycle:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"monthly",children:"Monthly"}),(0,p.jsx)("option",{value:"yearly",children:"Yearly (Save 15%)"})]})]})]}),T==="exportCertificate"&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsx)("p",{className:"text-xs text-black",children:"This will export your certificate of incorporation document."}),(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Format"}),(0,p.jsxs)("select",{value:D.format||"pdf",onChange:I=>se({...ne,format:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"pdf",children:"PDF"}),(0,p.jsx)("option",{value:"json",children:"JSON"})]})]})]}),(T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule")&&(0,p.jsxs)("div",{className:"space-y-3 bg-gray-50 rounded-lg p-3 border border-gray-200",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)("label",{className:"text-xs font-medium text-black mb-1.5 block",children:"Block Rule"}),(0,p.jsxs)("select",{value:D.ruleId||"rule_1",onChange:I=>se({...ne,ruleId:I.target.value}),className:"h-8 w-full rounded-md border border-gray-200 bg-transparent px-3 py-1 text-xs shadow-xs transition-colors focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none",children:[(0,p.jsx)("option",{value:"rule_1",children:"Block if risk level = 'highest'"}),(0,p.jsx)("option",{value:"rule_2",children:"Block if matches Stripe block lists"}),(0,p.jsx)("option",{value:"rule_3",children:"Block if CVC verification fails"}),(0,p.jsx)("option",{value:"rule_4",children:"Block if Postal code verification fails"})]})]}),(0,p.jsx)("p",{className:"text-xs text-black",children:T==="enableBlockRule"?"This will enable the selected block rule to actively block matching payments.":T==="disableBlockRule"?"This will disable the selected block rule. Matching payments will no longer be blocked.":"This will toggle the selected block rule's state."})]}),(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsxs)(at,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Dp,children:[(0,p.jsx)("span",{children:"Confirm"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(gr,{className:"h-3 w-3"}),(0,p.jsx)(yr,{className:"h-3 w-3"})]})]})})]},v.id)}if(v.kind==="bulkPreview"&&v.csvData)return(0,p.jsxs)("div",{className:`${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"whitespace-pre-wrap text-sm leading-6 mb-3 text-gray-700",children:v.content||""}),(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 overflow-hidden",children:[(0,p.jsxs)("div",{className:"bg-gray-100 px-3 py-2 border-b border-gray-200 flex items-center gap-2",children:[(0,p.jsx)(Es,{className:"h-4 w-4 text-gray-600"}),(0,p.jsx)("span",{className:"text-xs font-medium text-gray-700",children:v.csvData.fileName}),(0,p.jsxs)("span",{className:"text-xs text-gray-500",children:["\u2022 ",v.csvData.rowCount," rows"]})]}),(0,p.jsxs)("div",{className:"px-3 py-2 border-b border-gray-100",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Columns"}),(0,p.jsx)("div",{className:"flex flex-wrap gap-1",children:v.csvData.columns.map((T,D)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},D))})]}),v.csvData.sampleRows.length>0&&(0,p.jsxs)("div",{className:"px-3 py-2",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-gray-500 mb-1",children:"Sample Data"}),(0,p.jsx)("div",{className:"space-y-1",children:v.csvData.sampleRows.slice(0,3).map((T,D)=>(0,p.jsxs)("div",{className:"text-xs text-gray-600 bg-white rounded px-2 py-1 border border-gray-100",children:[Object.entries(T).slice(0,3).map(([I,Q],ae)=>(0,p.jsxs)("span",{children:[ae>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[I,":"]})," ",Q]},I)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},D))})]}),v.suggestedAction&&(0,p.jsx)("div",{className:"px-3 py-2 bg-blue-50 border-t border-blue-100",children:(0,p.jsxs)("span",{className:"text-xs text-blue-700",children:["Suggested action:"," ",(0,p.jsx)("strong",{children:v.suggestedAction.replace(/_/g," ")})]})})]}),v.bulkSessionId&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,p.jsxs)(at,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:()=>v.bulkSessionId&&Mp(v.bulkSessionId),children:[(0,p.jsxs)("span",{children:["Process ",v.csvData.rowCount," rows"]}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(gr,{className:"h-3 w-3"}),(0,p.jsx)(yr,{className:"h-3 w-3"})]})]}),(0,p.jsx)(at,{type:"button",size:"sm",variant:"ghost",className:"h-8 rounded-xl px-3 text-xs text-gray-500 hover:text-gray-700 hover:bg-gray-100",onClick:$k,children:"Cancel"})]})]},v.id);if(v.kind==="bulkProgress"&&v.bulkProgress){let{processed:T,total:D,successes:I,failures:Q}=v.bulkProgress,ae=Math.round(T/D*100);return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:"bg-gray-50 rounded-lg border border-gray-200 p-3",children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(Rt,{className:"h-4 w-4 animate-spin text-blue-600"}),(0,p.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing... ",T," of ",D]})]}),(0,p.jsx)("div",{className:"h-2 bg-gray-200 rounded-full overflow-hidden mb-2",children:(0,p.jsx)("div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${ae}%`}})}),(0,p.jsxs)("div",{className:"flex items-center gap-3 text-xs text-gray-600",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1",children:[(0,p.jsx)(rt,{className:"h-3 w-3 text-green-600"}),I," successful"]}),Q>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(xr,{className:"h-3 w-3"}),Q," failed"]})]})]})},v.id)}if(v.kind==="bulkSummary"&&v.bulkSummary){let{total:T,successes:D,failures:I,navigationPage:Q}=v.bulkSummary,ae=I.length>0,X=Q?.page==="customers"?"Customers":Q?.page==="dashboard"?"Dashboard":Q?.page==="settings"?"Settings":"Results";return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:`rounded-lg border p-3 ${ae?"bg-amber-50 border-amber-200":"bg-green-50 border-green-200"}`,children:[(0,p.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,p.jsx)(rt,{className:`h-5 w-5 ${ae?"text-amber-600":"text-green-600"}`}),(0,p.jsx)("span",{className:"text-sm font-medium text-gray-800",children:"Bulk operation complete"})]}),(0,p.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:v.content||`Processed ${T} rows: ${D} successful${ae?`, ${I.length} failed`:""}.`}),(0,p.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 text-green-700",children:[(0,p.jsx)(rt,{className:"h-3 w-3"}),D," successful"]}),ae&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(xr,{className:"h-3 w-3"}),I.length," failed"]})]}),ae&&(0,p.jsxs)("div",{className:"mt-3 pt-2 border-t border-amber-200",children:[(0,p.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-amber-700 mb-1",children:"Failed Rows"}),(0,p.jsxs)("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:[I.slice(0,5).map((me,Ye)=>(0,p.jsxs)("div",{className:"text-xs text-red-700 bg-red-50 rounded px-2 py-1",children:["Row ",me.row,":"," ",me.error||"Unknown error"]},Ye)),I.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",I.length-5," more"]})]})]}),Q&&D>0&&(0,p.jsx)("div",{className:"mt-3 pt-2 border-t border-gray-200",children:(0,p.jsxs)("button",{type:"button",onClick:me=>{me.preventDefault(),me.stopPropagation(),o&&Q.page&&o(Q.page,Q.subtab)},className:"flex items-center gap-2 text-xs text-gray-500 hover:text-gray-700 transition-colors group cursor-pointer",children:[(0,p.jsxs)("span",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-gray-100 rounded text-[10px] font-medium text-gray-600 group-hover:bg-gray-200",children:[(0,p.jsx)(gr,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(yr,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",X]})]})})]})},v.id)}return(0,p.jsx)(F.Fragment,{children:(0,p.jsxs)("div",{ref:G?Bu:null,className:`${E?"mt-3":""}`,children:[(0,p.jsx)("div",{className:"text-sm leading-6 text-gray-700",children:(()=>{let T=v.content||"";if(v.kind==="guideStep"){let D=T.match(/^(Step\s+\d+:)([\s\S]*)/);if(D)return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("strong",{children:D[1]}),D[2]]})}return v.role==="assistant"&&T?HD(T):T||(0,p.jsx)("span",{className:"opacity-70",children:"Thinking\u2026"})})()}),v.role==="assistant"&&v.structuredData&&(0,p.jsx)("div",{className:"mt-3",children:(0,p.jsx)(Ik,{type:v.structuredData.type,data:v.structuredData.data})}),v.role==="assistant"&&v.followups&&v.followups.length>0&&!v.followupSelected&&(0,p.jsx)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:v.followups.map(T=>(0,p.jsx)("button",{type:"button",onClick:()=>Vk(v.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
74
39
|
bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800
|
|
75
40
|
border border-gray-200 hover:border-gray-300 shadow-sm
|
|
76
|
-
transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},
|
|
77
|
-
@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){#kite-chat-root *,#kite-chat-root :before,#kite-chat-root :after,#kite-chat-root ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial}}:root,#kite-chat-root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-400:oklch(75% .183 55.934);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-bounce:bounce 1s infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}#kite-chat-root *,#kite-chat-root :after,#kite-chat-root :before,#kite-chat-root ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root,#kite-chat-root{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}#kite-chat-root hr{height:0;color:inherit;border-top-width:1px}#kite-chat-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#kite-chat-root h1,#kite-chat-root h2,#kite-chat-root h3,#kite-chat-root h4,#kite-chat-root h5,#kite-chat-root h6{font-size:inherit;font-weight:inherit}#kite-chat-root a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}#kite-chat-root b,#kite-chat-root strong{font-weight:bolder}#kite-chat-root code,#kite-chat-root kbd,#kite-chat-root samp,#kite-chat-root pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}#kite-chat-root small{font-size:80%}#kite-chat-root sub,#kite-chat-root sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}#kite-chat-root sub{bottom:-.25em}#kite-chat-root sup{top:-.5em}#kite-chat-root table{text-indent:0;border-color:inherit;border-collapse:collapse}#kite-chat-root :-moz-focusring{outline:auto}#kite-chat-root progress{vertical-align:baseline}#kite-chat-root summary{display:list-item}#kite-chat-root ol,#kite-chat-root ul,#kite-chat-root menu{list-style:none}#kite-chat-root img,#kite-chat-root svg,#kite-chat-root video,#kite-chat-root canvas,#kite-chat-root audio,#kite-chat-root iframe,#kite-chat-root embed,#kite-chat-root object{vertical-align:middle;display:block}#kite-chat-root img,#kite-chat-root video{max-width:100%;height:auto}#kite-chat-root button,#kite-chat-root input,#kite-chat-root select,#kite-chat-root optgroup,#kite-chat-root textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root :where(select:is([multiple],[size])) optgroup{font-weight:bolder}#kite-chat-root :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}#kite-chat-root ::file-selector-button{margin-inline-end:4px}#kite-chat-root ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){#kite-chat-root ::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){#kite-chat-root ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}#kite-chat-root textarea{resize:vertical}#kite-chat-root ::-webkit-search-decoration{-webkit-appearance:none}#kite-chat-root ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}#kite-chat-root ::-webkit-datetime-edit{display:inline-flex}#kite-chat-root ::-webkit-datetime-edit-fields-wrapper{padding:0}#kite-chat-root ::-webkit-datetime-edit{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-year-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-month-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-day-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-hour-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-minute-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-second-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-millisecond-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-meridiem-field{padding-block:0}#kite-chat-root ::-webkit-calendar-picker-indicator{line-height:1}#kite-chat-root :-moz-ui-invalid{box-shadow:none}#kite-chat-root button,#kite-chat-root input:where([type=button],[type=reset],[type=submit]){appearance:button}#kite-chat-root ::file-selector-button{appearance:button}#kite-chat-root ::-webkit-inner-spin-button{height:auto}#kite-chat-root ::-webkit-outer-spin-button{height:auto}#kite-chat-root [hidden]:where(:not([hidden=until-found])){display:none!important}#kite-chat-root .\\@container\\/card-header{container:card-header/inline-size}#kite-chat-root .pointer-events-none{pointer-events:none}#kite-chat-root .collapse{visibility:collapse}#kite-chat-root .visible{visibility:visible}#kite-chat-root .fixed{position:fixed}#kite-chat-root .relative{position:relative}#kite-chat-root .top-0{top:calc(var(--spacing)*0)}#kite-chat-root .top-1\\/2{top:50%}#kite-chat-root .right-0{right:calc(var(--spacing)*0)}#kite-chat-root .right-4{right:calc(var(--spacing)*4)}#kite-chat-root .bottom-4{bottom:calc(var(--spacing)*4)}#kite-chat-root .bottom-6{bottom:calc(var(--spacing)*6)}#kite-chat-root .left-1\\/2{left:50%}#kite-chat-root .left-4{left:calc(var(--spacing)*4)}#kite-chat-root .z-40{z-index:40}#kite-chat-root .z-50{z-index:50}#kite-chat-root .z-\\[9999\\]{z-index:9999}#kite-chat-root .col-start-2{grid-column-start:2}#kite-chat-root .row-span-2{grid-row:span 2/span 2}#kite-chat-root .row-start-1{grid-row-start:1}#kite-chat-root .container{width:100%}@media (min-width:40rem){#kite-chat-root .container{max-width:40rem}}@media (min-width:48rem){#kite-chat-root .container{max-width:48rem}}@media (min-width:64rem){#kite-chat-root .container{max-width:64rem}}@media (min-width:80rem){#kite-chat-root .container{max-width:80rem}}@media (min-width:96rem){#kite-chat-root .container{max-width:96rem}}#kite-chat-root .mx-auto{margin-inline:auto}#kite-chat-root .my-1{margin-block:calc(var(--spacing)*1)}#kite-chat-root .my-2{margin-block:calc(var(--spacing)*2)}#kite-chat-root .mt-1{margin-top:calc(var(--spacing)*1)}#kite-chat-root .mt-2{margin-top:calc(var(--spacing)*2)}#kite-chat-root .mt-3{margin-top:calc(var(--spacing)*3)}#kite-chat-root .mr-2{margin-right:calc(var(--spacing)*2)}#kite-chat-root .mb-1{margin-bottom:calc(var(--spacing)*1)}#kite-chat-root .mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}#kite-chat-root .mb-2{margin-bottom:calc(var(--spacing)*2)}#kite-chat-root .mb-3{margin-bottom:calc(var(--spacing)*3)}#kite-chat-root .mb-4{margin-bottom:calc(var(--spacing)*4)}#kite-chat-root .ml-1{margin-left:calc(var(--spacing)*1)}#kite-chat-root .ml-2{margin-left:calc(var(--spacing)*2)}#kite-chat-root .ml-4{margin-left:calc(var(--spacing)*4)}#kite-chat-root .ml-5{margin-left:calc(var(--spacing)*5)}#kite-chat-root .ml-6{margin-left:calc(var(--spacing)*6)}#kite-chat-root .block{display:block}#kite-chat-root .contents{display:contents}#kite-chat-root .flex{display:flex}#kite-chat-root .grid{display:grid}#kite-chat-root .hidden{display:none}#kite-chat-root .inline{display:inline}#kite-chat-root .inline-block{display:inline-block}#kite-chat-root .inline-flex{display:inline-flex}#kite-chat-root .table{display:table}#kite-chat-root .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}#kite-chat-root .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}#kite-chat-root .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}#kite-chat-root .size-full{width:100%;height:100%}#kite-chat-root .h-1{height:calc(var(--spacing)*1)}#kite-chat-root .h-1\\.5{height:calc(var(--spacing)*1.5)}#kite-chat-root .h-2{height:calc(var(--spacing)*2)}#kite-chat-root .h-2\\.5{height:calc(var(--spacing)*2.5)}#kite-chat-root .h-3{height:calc(var(--spacing)*3)}#kite-chat-root .h-3\\.5{height:calc(var(--spacing)*3.5)}#kite-chat-root .h-4{height:calc(var(--spacing)*4)}#kite-chat-root .h-5{height:calc(var(--spacing)*5)}#kite-chat-root .h-6{height:calc(var(--spacing)*6)}#kite-chat-root .h-7{height:calc(var(--spacing)*7)}#kite-chat-root .h-8{height:calc(var(--spacing)*8)}#kite-chat-root .h-9{height:calc(var(--spacing)*9)}#kite-chat-root .h-10{height:calc(var(--spacing)*10)}#kite-chat-root .h-12{height:calc(var(--spacing)*12)}#kite-chat-root .h-16{height:calc(var(--spacing)*16)}#kite-chat-root .h-auto{height:auto}#kite-chat-root .h-full{height:100%}#kite-chat-root .max-h-32{max-height:calc(var(--spacing)*32)}#kite-chat-root .min-h-0{min-height:calc(var(--spacing)*0)}#kite-chat-root .w-1\\.5{width:calc(var(--spacing)*1.5)}#kite-chat-root .w-2{width:calc(var(--spacing)*2)}#kite-chat-root .w-2\\.5{width:calc(var(--spacing)*2.5)}#kite-chat-root .w-3{width:calc(var(--spacing)*3)}#kite-chat-root .w-3\\.5{width:calc(var(--spacing)*3.5)}#kite-chat-root .w-4{width:calc(var(--spacing)*4)}#kite-chat-root .w-5{width:calc(var(--spacing)*5)}#kite-chat-root .w-6{width:calc(var(--spacing)*6)}#kite-chat-root .w-7{width:calc(var(--spacing)*7)}#kite-chat-root .w-8{width:calc(var(--spacing)*8)}#kite-chat-root .w-10{width:calc(var(--spacing)*10)}#kite-chat-root .w-12{width:calc(var(--spacing)*12)}#kite-chat-root .w-\\[320px\\]{width:320px}#kite-chat-root .w-\\[480px\\]{width:480px}#kite-chat-root .w-full{width:100%}#kite-chat-root .max-w-\\[240px\\]{max-width:240px}#kite-chat-root .max-w-\\[260px\\]{max-width:260px}#kite-chat-root .max-w-\\[300px\\]{max-width:300px}#kite-chat-root .min-w-0{min-width:calc(var(--spacing)*0)}#kite-chat-root .flex-1{flex:1}#kite-chat-root .flex-shrink-0,#kite-chat-root .shrink-0{flex-shrink:0}#kite-chat-root .-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}#kite-chat-root .animate-bounce{animation:var(--animate-bounce)}#kite-chat-root .animate-spin{animation:var(--animate-spin)}#kite-chat-root .cursor-grab{cursor:grab}#kite-chat-root .cursor-grabbing{cursor:grabbing}#kite-chat-root .cursor-pointer{cursor:pointer}#kite-chat-root .touch-none{touch-action:none}#kite-chat-root .resize-none{resize:none}#kite-chat-root .list-decimal{list-style-type:decimal}#kite-chat-root .list-disc{list-style-type:disc}#kite-chat-root .auto-rows-min{grid-auto-rows:min-content}#kite-chat-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#kite-chat-root .grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}#kite-chat-root .flex-col{flex-direction:column}#kite-chat-root .flex-wrap{flex-wrap:wrap}#kite-chat-root .place-items-center{place-items:center}#kite-chat-root .items-center{align-items:center}#kite-chat-root .items-start{align-items:flex-start}#kite-chat-root .justify-between{justify-content:space-between}#kite-chat-root .justify-center{justify-content:center}#kite-chat-root .justify-end{justify-content:flex-end}#kite-chat-root .justify-start{justify-content:flex-start}#kite-chat-root .gap-0\\.5{gap:calc(var(--spacing)*.5)}#kite-chat-root .gap-1{gap:calc(var(--spacing)*1)}#kite-chat-root .gap-1\\.5{gap:calc(var(--spacing)*1.5)}#kite-chat-root .gap-2{gap:calc(var(--spacing)*2)}#kite-chat-root .gap-2\\.5{gap:calc(var(--spacing)*2.5)}#kite-chat-root .gap-3{gap:calc(var(--spacing)*3)}#kite-chat-root .gap-4{gap:calc(var(--spacing)*4)}#kite-chat-root .gap-6{gap:calc(var(--spacing)*6)}#kite-chat-root :where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}#kite-chat-root :where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}#kite-chat-root .self-start{align-self:flex-start}#kite-chat-root .justify-self-end{justify-self:flex-end}#kite-chat-root .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#kite-chat-root .overflow-hidden{overflow:hidden}#kite-chat-root .overflow-x-auto{overflow-x:auto}#kite-chat-root .overflow-y-auto{overflow-y:auto}#kite-chat-root .rounded{border-radius:.25rem}#kite-chat-root .rounded-2xl{border-radius:var(--radius-2xl)}#kite-chat-root .rounded-\\[inherit\\]{border-radius:inherit}#kite-chat-root .rounded-full{border-radius:3.40282e38px}#kite-chat-root .rounded-lg{border-radius:var(--kite-radius)}#kite-chat-root .rounded-md{border-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-xl{border-radius:calc(var(--kite-radius) + 4px)}#kite-chat-root .rounded-l-lg{border-top-left-radius:var(--kite-radius);border-bottom-left-radius:var(--kite-radius)}#kite-chat-root .rounded-br-md{border-bottom-right-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-bl-md{border-bottom-left-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .border{border-style:var(--tw-border-style);border-width:1px}#kite-chat-root .border-0{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}#kite-chat-root .border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}#kite-chat-root .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}#kite-chat-root .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}#kite-chat-root .border-amber-100{border-color:var(--color-amber-100)}#kite-chat-root .border-amber-200{border-color:var(--color-amber-200)}#kite-chat-root .border-blue-100{border-color:var(--color-blue-100)}#kite-chat-root .border-blue-200{border-color:var(--color-blue-200)}#kite-chat-root .border-emerald-100{border-color:var(--color-emerald-100)}#kite-chat-root .border-emerald-200{border-color:var(--color-emerald-200)}#kite-chat-root .border-gray-100{border-color:var(--color-gray-100)}#kite-chat-root .border-gray-200{border-color:var(--color-gray-200)}#kite-chat-root .border-gray-300{border-color:var(--color-gray-300)}#kite-chat-root .border-green-200{border-color:var(--color-green-200)}#kite-chat-root .border-input{border-color:var(--kite-input)}#kite-chat-root .border-primary\\/20{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .border-primary\\/20{border-color:color-mix(in oklab,var(--kite-primary)20%,transparent)}}#kite-chat-root .border-purple-100{border-color:var(--color-purple-100)}#kite-chat-root .border-purple-200{border-color:var(--color-purple-200)}#kite-chat-root .border-red-200{border-color:var(--color-red-200)}#kite-chat-root .border-slate-200{border-color:var(--color-slate-200)}#kite-chat-root .border-t-transparent{border-top-color:#0000}#kite-chat-root .border-l-transparent{border-left-color:#0000}#kite-chat-root .bg-amber-50{background-color:var(--color-amber-50)}#kite-chat-root .bg-amber-100{background-color:var(--color-amber-100)}#kite-chat-root .bg-background{background-color:var(--kite-background)}#kite-chat-root .bg-blue-50{background-color:var(--color-blue-50)}#kite-chat-root .bg-blue-100{background-color:var(--color-blue-100)}#kite-chat-root .bg-blue-400{background-color:var(--color-blue-400)}#kite-chat-root .bg-blue-600{background-color:var(--color-blue-600)}#kite-chat-root .bg-border{background-color:var(--kite-border)}#kite-chat-root .bg-card{background-color:var(--kite-card)}#kite-chat-root .bg-destructive{background-color:var(--kite-destructive)}#kite-chat-root .bg-emerald-50{background-color:var(--color-emerald-50)}#kite-chat-root .bg-emerald-500{background-color:var(--color-emerald-500)}#kite-chat-root .bg-gray-50{background-color:var(--color-gray-50)}#kite-chat-root .bg-gray-100{background-color:var(--color-gray-100)}#kite-chat-root .bg-gray-200{background-color:var(--color-gray-200)}#kite-chat-root .bg-gray-400{background-color:var(--color-gray-400)}#kite-chat-root .bg-gray-900{background-color:var(--color-gray-900)}#kite-chat-root .bg-green-50{background-color:var(--color-green-50)}#kite-chat-root .bg-green-400{background-color:var(--color-green-400)}#kite-chat-root .bg-muted\\/40{background-color:var(--kite-muted)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-muted\\/40{background-color:color-mix(in oklab,var(--kite-muted)40%,transparent)}}#kite-chat-root .bg-orange-100{background-color:var(--color-orange-100)}#kite-chat-root .bg-orange-400{background-color:var(--color-orange-400)}#kite-chat-root .bg-pink-400{background-color:var(--color-pink-400)}#kite-chat-root .bg-primary,#kite-chat-root .bg-primary\\/5{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-primary\\/5{background-color:color-mix(in oklab,var(--kite-primary)5%,transparent)}}#kite-chat-root .bg-purple-50{background-color:var(--color-purple-50)}#kite-chat-root .bg-purple-400{background-color:var(--color-purple-400)}#kite-chat-root .bg-red-50{background-color:var(--color-red-50)}#kite-chat-root .bg-red-100{background-color:var(--color-red-100)}#kite-chat-root .bg-red-500{background-color:var(--color-red-500)}#kite-chat-root .bg-secondary{background-color:var(--kite-secondary)}#kite-chat-root .bg-slate-50{background-color:var(--color-slate-50)}#kite-chat-root .bg-slate-100{background-color:var(--color-slate-100)}#kite-chat-root .bg-slate-300{background-color:var(--color-slate-300)}#kite-chat-root .bg-transparent{background-color:#0000}#kite-chat-root .bg-white{background-color:var(--color-white)}#kite-chat-root .bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}#kite-chat-root .from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .p-0{padding:calc(var(--spacing)*0)}#kite-chat-root .p-2{padding:calc(var(--spacing)*2)}#kite-chat-root .p-3{padding:calc(var(--spacing)*3)}#kite-chat-root .p-4{padding:calc(var(--spacing)*4)}#kite-chat-root .p-6{padding:calc(var(--spacing)*6)}#kite-chat-root .p-px{padding:1px}#kite-chat-root .px-0{padding-inline:calc(var(--spacing)*0)}#kite-chat-root .px-1{padding-inline:calc(var(--spacing)*1)}#kite-chat-root .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}#kite-chat-root .px-2{padding-inline:calc(var(--spacing)*2)}#kite-chat-root .px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .px-3{padding-inline:calc(var(--spacing)*3)}#kite-chat-root .px-4{padding-inline:calc(var(--spacing)*4)}#kite-chat-root .px-6{padding-inline:calc(var(--spacing)*6)}#kite-chat-root .py-0{padding-block:calc(var(--spacing)*0)}#kite-chat-root .py-0\\.5{padding-block:calc(var(--spacing)*.5)}#kite-chat-root .py-1{padding-block:calc(var(--spacing)*1)}#kite-chat-root .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}#kite-chat-root .py-2{padding-block:calc(var(--spacing)*2)}#kite-chat-root .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}#kite-chat-root .py-3{padding-block:calc(var(--spacing)*3)}#kite-chat-root .py-4{padding-block:calc(var(--spacing)*4)}#kite-chat-root .py-6{padding-block:calc(var(--spacing)*6)}#kite-chat-root .py-8{padding-block:calc(var(--spacing)*8)}#kite-chat-root .pt-0{padding-top:calc(var(--spacing)*0)}#kite-chat-root .pt-2{padding-top:calc(var(--spacing)*2)}#kite-chat-root .pb-2{padding-bottom:calc(var(--spacing)*2)}#kite-chat-root .pb-3{padding-bottom:calc(var(--spacing)*3)}#kite-chat-root .pb-4{padding-bottom:calc(var(--spacing)*4)}#kite-chat-root .text-center{text-align:center}#kite-chat-root .text-left{text-align:left}#kite-chat-root .font-mono{font-family:var(--font-mono)}#kite-chat-root .text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}#kite-chat-root .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}#kite-chat-root .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}#kite-chat-root .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}#kite-chat-root .text-\\[10px\\]{font-size:10px}#kite-chat-root .leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}#kite-chat-root .leading-none{--tw-leading:1;line-height:1}#kite-chat-root .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}#kite-chat-root .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}#kite-chat-root .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}#kite-chat-root .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}#kite-chat-root .whitespace-nowrap{white-space:nowrap}#kite-chat-root .whitespace-pre-wrap{white-space:pre-wrap}#kite-chat-root .text-amber-500{color:var(--color-amber-500)}#kite-chat-root .text-amber-600{color:var(--color-amber-600)}#kite-chat-root .text-amber-700{color:var(--color-amber-700)}#kite-chat-root .text-black{color:var(--color-black)}#kite-chat-root .text-blue-600{color:var(--color-blue-600)}#kite-chat-root .text-blue-700{color:var(--color-blue-700)}#kite-chat-root .text-card-foreground{color:var(--kite-card-foreground)}#kite-chat-root .text-emerald-500{color:var(--color-emerald-500)}#kite-chat-root .text-emerald-600{color:var(--color-emerald-600)}#kite-chat-root .text-emerald-700{color:var(--color-emerald-700)}#kite-chat-root .text-gray-300{color:var(--color-gray-300)}#kite-chat-root .text-gray-400{color:var(--color-gray-400)}#kite-chat-root .text-gray-500{color:var(--color-gray-500)}#kite-chat-root .text-gray-600{color:var(--color-gray-600)}#kite-chat-root .text-gray-700{color:var(--color-gray-700)}#kite-chat-root .text-gray-800{color:var(--color-gray-800)}#kite-chat-root .text-gray-900{color:var(--color-gray-900)}#kite-chat-root .text-green-500{color:var(--color-green-500)}#kite-chat-root .text-green-600{color:var(--color-green-600)}#kite-chat-root .text-green-700{color:var(--color-green-700)}#kite-chat-root .text-green-800{color:var(--color-green-800)}#kite-chat-root .text-muted-foreground{color:var(--kite-muted-foreground)}#kite-chat-root .text-orange-700{color:var(--color-orange-700)}#kite-chat-root .text-primary{color:var(--kite-primary)}#kite-chat-root .text-primary-foreground{color:var(--kite-primary-foreground)}#kite-chat-root .text-purple-600{color:var(--color-purple-600)}#kite-chat-root .text-purple-700{color:var(--color-purple-700)}#kite-chat-root .text-red-500{color:var(--color-red-500)}#kite-chat-root .text-red-600{color:var(--color-red-600)}#kite-chat-root .text-red-700{color:var(--color-red-700)}#kite-chat-root .text-secondary-foreground{color:var(--kite-secondary-foreground)}#kite-chat-root .text-slate-600{color:var(--color-slate-600)}#kite-chat-root .text-slate-700{color:var(--color-slate-700)}#kite-chat-root .text-white{color:var(--color-white)}#kite-chat-root .uppercase{text-transform:uppercase}#kite-chat-root .italic{font-style:italic}#kite-chat-root .line-through{text-decoration-line:line-through}#kite-chat-root .underline-offset-4{text-underline-offset:4px}#kite-chat-root .opacity-0{opacity:0}#kite-chat-root .opacity-60{opacity:.6}#kite-chat-root .opacity-70{opacity:.7}#kite-chat-root .opacity-90{opacity:.9}#kite-chat-root .opacity-100{opacity:1}#kite-chat-root .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .outline{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .duration-150{--tw-duration:.15s;transition-duration:.15s}#kite-chat-root .duration-200{--tw-duration:.2s;transition-duration:.2s}#kite-chat-root .duration-300{--tw-duration:.3s;transition-duration:.3s}#kite-chat-root .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}#kite-chat-root .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}#kite-chat-root .outline-none{--tw-outline-style:none;outline-style:none}#kite-chat-root .select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){#kite-chat-root .group-hover\\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}}#kite-chat-root .selection\\:bg-primary ::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:bg-primary::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:text-primary-foreground ::selection{color:var(--kite-primary-foreground)}#kite-chat-root .selection\\:text-primary-foreground::selection{color:var(--kite-primary-foreground)}#kite-chat-root .file\\:inline-flex::file-selector-button{display:inline-flex}#kite-chat-root .file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}#kite-chat-root .file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .file\\:bg-transparent::file-selector-button{background-color:#0000}#kite-chat-root .file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .file\\:text-foreground::file-selector-button{color:var(--kite-foreground)}#kite-chat-root .placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}#kite-chat-root .placeholder\\:text-muted-foreground::placeholder{color:var(--kite-muted-foreground)}#kite-chat-root .focus-within\\:border-gray-700:focus-within{border-color:var(--color-gray-700)}@media (hover:hover){#kite-chat-root .hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--kite-primary)30%,transparent)}}#kite-chat-root .hover\\:bg-accent:hover{background-color:var(--kite-accent)}#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--kite-destructive)90%,transparent)}}#kite-chat-root .hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}#kite-chat-root .hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}#kite-chat-root .hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}#kite-chat-root .hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:color-mix(in oklab,var(--kite-primary)10%,transparent)}}#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--kite-primary)90%,transparent)}}#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:var(--kite-secondary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--kite-secondary)80%,transparent)}}#kite-chat-root .hover\\:text-accent-foreground:hover{color:var(--kite-accent-foreground)}#kite-chat-root .hover\\:text-blue-800:hover{color:var(--color-blue-800)}#kite-chat-root .hover\\:text-gray-600:hover{color:var(--color-gray-600)}#kite-chat-root .hover\\:text-gray-700:hover{color:var(--color-gray-700)}#kite-chat-root .hover\\:text-gray-800:hover{color:var(--color-gray-800)}#kite-chat-root .hover\\:underline:hover{text-decoration-line:underline}#kite-chat-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}#kite-chat-root .focus\\:ring-primary:focus{--tw-ring-color:var(--kite-primary)}#kite-chat-root .focus-visible\\:border-ring:focus-visible{border-color:var(--kite-ring)}#kite-chat-root .focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--kite-ring)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-ring)50%,transparent)}}#kite-chat-root .focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}#kite-chat-root .focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .active\\:cursor-grabbing:active{cursor:grabbing}#kite-chat-root .disabled\\:pointer-events-none:disabled{pointer-events:none}#kite-chat-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#kite-chat-root .disabled\\:bg-gray-300:disabled{background-color:var(--color-gray-300)}#kite-chat-root .disabled\\:opacity-50:disabled{opacity:.5}#kite-chat-root .has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}#kite-chat-root .has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}#kite-chat-root .has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}#kite-chat-root .aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--kite-destructive)}#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}@media (min-width:48rem){#kite-chat-root .md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}#kite-chat-root .dark\\:border-input:is(.dark *){border-color:var(--kite-input)}#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--kite-destructive)60%,transparent)}}#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--kite-input)30%,transparent)}}@media (hover:hover){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--kite-accent)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-accent)50%,transparent)}}#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-input)50%,transparent)}}}#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}#kite-chat-root .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}#kite-chat-root .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}#kite-chat-root .\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}#kite-chat-root .\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:root{--kite-radius:.625rem;--kite-background:oklch(100% 0 0);--kite-foreground:oklch(14.5% 0 0);--kite-card:oklch(100% 0 0);--kite-card-foreground:oklch(14.5% 0 0);--kite-popover:oklch(100% 0 0);--kite-popover-foreground:oklch(14.5% 0 0);--kite-primary:oklch(20.5% 0 0);--kite-primary-foreground:oklch(98.5% 0 0);--kite-secondary:oklch(97% 0 0);--kite-secondary-foreground:oklch(20.5% 0 0);--kite-muted:oklch(97% 0 0);--kite-muted-foreground:oklch(55.6% 0 0);--kite-accent:oklch(97% 0 0);--kite-accent-foreground:oklch(20.5% 0 0);--kite-destructive:oklch(57.7% .245 27.325);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(92.2% 0 0);--kite-input:oklch(92.2% 0 0);--kite-ring:oklch(70.8% 0 0)}.dark{--kite-background:oklch(14.5% 0 0);--kite-foreground:oklch(98.5% 0 0);--kite-card:oklch(20.5% 0 0);--kite-card-foreground:oklch(98.5% 0 0);--kite-popover:oklch(20.5% 0 0);--kite-popover-foreground:oklch(98.5% 0 0);--kite-primary:oklch(92.2% 0 0);--kite-primary-foreground:oklch(20.5% 0 0);--kite-secondary:oklch(26.9% 0 0);--kite-secondary-foreground:oklch(98.5% 0 0);--kite-muted:oklch(26.9% 0 0);--kite-muted-foreground:oklch(70.8% 0 0);--kite-accent:oklch(26.9% 0 0);--kite-accent-foreground:oklch(98.5% 0 0);--kite-destructive:oklch(70.4% .191 22.216);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(100% 0 0/.1);--kite-input:oklch(100% 0 0/.15);--kite-ring:oklch(55.6% 0 0);--kite-link:oklch(65% .15 250)}#kite-chat-root *{border-color:var(--kite-border)}#kite-chat-root section form input{color:var(--kite-foreground,#1a1a1a)!important}#kite-chat-root section form input::placeholder{color:var(--kite-muted-foreground,#9ca3af)!important}#kite-chat-root section .space-y-1>div+div{margin-top:.625rem}#kite-chat-root section>div.flex-1>div.overflow-y-auto{padding:1rem 1.25rem!important}#kite-chat-root section .mt-6.pt-4.border-t{margin-top:1.25rem;padding-top:1rem}#kite-chat-root section button.w-full.text-left.px-3{padding:.75rem 1rem}#kite-chat-root section .text-sm.leading-6{line-height:1.625rem}@keyframes spin{to{transform:rotate(360deg)}}#kite-chat-root .animate-spin{animation:1s linear infinite spin}#kite-chat-root [data-motion]{will-change:transform,opacity}#kite-chat-root a,#kite-chat-root .kite-link{word-break:break-word;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;text-decoration:none;color:var(--kite-link)!important}#kite-chat-root a:hover,#kite-chat-root .kite-link:hover{text-decoration:underline}#kite-chat-root .text-sm.leading-6{overflow-wrap:break-word;word-break:break-word;max-width:100%}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#kite-chat-root{--kite-link:oklch(55% .15 250)}`,document.head.appendChild(e),console.log("[KiteChat-Debug] Style injected",{styleInHead:!!document.getElementById("kite-chat-styles"),cssLength:e.textContent?.length||0});let t=document.createElement("style");t.id="kite-chat-position",t.textContent=`
|
|
41
|
+
transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},v.id)}),(ge||Ri)&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[ge&&ge.stepIndex>0&&(0,p.jsx)(at,{type:"button",size:"sm",variant:"secondary",className:"h-7 w-7 rounded-full p-0 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Gk,children:(0,p.jsx)(_s,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,p.jsxs)(at,{type:"button",size:"sm",variant:"secondary",className:"h-8 rounded-xl px-3 text-xs gap-1.5 bg-gray-100 hover:bg-gray-200 border border-gray-200",onClick:Ri?rx:Np,children:[(0,p.jsx)("span",{children:Ri?"Done":"Next"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(gr,{className:"h-3 w-3"}),(0,p.jsx)(yr,{className:"h-3 w-3"})]})]})]}),(Dn==="thinking"||Dn==="searching"||Dn==="executing"||Dn==="responding")&&(0,p.jsx)("div",{className:`${Ok==="user"?"mt-3":""}`,children:(0,p.jsx)(gk,{phase:Dn,progressSteps:Nk})}),nt&&Dk&&(0,p.jsx)("div",{className:"mt-2",children:(0,p.jsx)(kk,{})}),!ge&&(0,p.jsx)("div",{ref:Jy})]})})})})}),(0,p.jsxs)("div",{className:"px-4 py-3 bg-white shrink-0",children:[Ao&&(0,p.jsxs)("div",{className:"mb-2 flex items-center gap-2 rounded-xl bg-blue-50 border border-blue-200 px-3 py-2",children:[(0,p.jsx)(Es,{className:"h-4 w-4 text-blue-600"}),(0,p.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:Ao.name}),(0,p.jsx)("button",{type:"button",onClick:()=>{Rp(null),Nn.current&&(Nn.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,p.jsx)(xr,{className:"h-4 w-4"})})]}),(0,p.jsxs)("form",{onSubmit:qk,className:"w-full",children:[(0,p.jsx)("input",{ref:Nn,type:"file",accept:".csv",className:"hidden",onChange:v=>{let k=v.target.files?.[0];k&&Rp(k)}}),(0,p.jsxs)("div",{className:"flex w-full items-start gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 shadow-sm",children:[(0,p.jsx)(at,{type:"button",size:"icon",variant:"ghost",onClick:()=>Nn.current?.click(),className:"h-5 w-5 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100",title:"Upload CSV for bulk operations",children:(0,p.jsx)(su,{className:"h-2.5 w-2.5"})}),(0,p.jsx)("textarea",{placeholder:Ao?"Describe what to do with this CSV...":"Ask anything...",value:P,onChange:v=>{A(v.target.value),v.target.value.length>0&&Mk()},rows:1,className:"flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-gray-400 resize-none overflow-hidden outline-none",style:{minHeight:"20px",maxHeight:"120px"},onInput:v=>{let k=v.target;k.style.height="auto",k.style.height=Math.min(k.scrollHeight,120)+"px"},onKeyDown:v=>{if(v.key==="Enter"&&!v.shiftKey&&!v.metaKey&&!v.ctrlKey){if(v.preventDefault(),P.trim()||Ao){let k=v.currentTarget.closest("form");k&&k.requestSubmit()}return}if((v.metaKey||v.ctrlKey)&&v.key==="Enter"){let k=_p.current;if(k){v.preventDefault(),v.stopPropagation(),Mp(k);return}if(Je){v.preventDefault(),v.stopPropagation(),Dp();return}if(Ei){v.preventDefault(),v.stopPropagation(),Ep(Ei);return}if(Me.current){v.preventDefault(),v.stopPropagation(),Np();return}}}}),(0,p.jsx)(at,{type:"submit",size:"icon",disabled:!P.trim()&&!Ao||Ek,className:"h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",children:(0,p.jsx)(au,{className:"h-2.5 w-2.5"})})]})]})]}),(0,p.jsx)(vk,{x:Uu.x,y:Uu.y,visible:Uu.visible,onClick:Uu.onClick})]})}function Tk({onNavigate:e,onActionComplete:t,currentPage:a,agentUrl:r,startingQuestions:o,startingQuestionsEndpoint:n,defaultOpen:s=!1,isOpen:i,onOpenChange:l,userId:u,orgId:d,userName:c,userEmail:f,supabaseUrl:m,supabaseAnonKey:x,initialCorner:w,onCornerChange:b,productBackendUrl:h,getAuthHeaders:g}){let[y,C]=F.useState(s),L=i!==void 0?i:y,P=A=>{i===void 0&&C(A),l?.(A)};return(0,p.jsx)(KD,{isOpen:L,onClose:()=>P(!1),onOpen:()=>P(!0),onNavigate:e,onActionComplete:t,currentPage:a,agentUrl:r,startingQuestions:o,startingQuestionsEndpoint:n,userId:u,orgId:d,userName:c,userEmail:f,supabaseUrl:m,supabaseAnonKey:x,initialCorner:w,onCornerChange:b,productBackendUrl:h,getAuthHeaders:g})}var zy=M(ue(),1),Pi=null,Ea=null,na={};function XD({initialConfig:e}){let[t,a]=(0,Za.useState)(e),[r,o]=(0,Za.useState)(e.currentPage||"dashboard"),[n,s]=(0,Za.useState)(!1),i=(0,Za.useRef)(!1);return(0,Za.useEffect)(()=>{i.current=n},[n]),(0,Za.useEffect)(()=>(na.setCurrentPage=o,na.setConfig=l=>a(u=>({...u,...l})),na.setIsOpen=s,na.getIsOpen=()=>i.current,()=>{na={}}),[]),(0,Za.useEffect)(()=>{t.theme==="dark"?Ea?.classList.add("dark"):Ea?.classList.remove("dark")},[t.theme]),(0,zy.jsx)(Tk,{isOpen:n,onOpenChange:s,currentPage:r,agentUrl:t.agentUrl,onNavigate:(l,u)=>t.onNavigate?.(l,u),onActionComplete:t.onActionComplete,startingQuestions:t.startingQuestions,startingQuestionsEndpoint:t.startingQuestionsEndpoint,userId:t.userId,orgId:t.orgId,userName:t.userName,userEmail:t.userEmail,supabaseUrl:t.supabaseUrl,supabaseAnonKey:t.supabaseAnonKey,productBackendUrl:t.productBackendUrl,getAuthHeaders:t.getAuthHeaders})}function QD(){if(document.getElementById("kite-chat-styles"))return;let e=document.createElement("style");e.id="kite-chat-styles",e.textContent=`/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
|
|
42
|
+
@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){#kite-chat-root *,#kite-chat-root :before,#kite-chat-root :after,#kite-chat-root ::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial;--tw-ease:initial}}:root,#kite-chat-root{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-400:oklch(75% .183 55.934);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-100:oklch(94.6% .033 307.174);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-pink-400:oklch(71.8% .202 349.761);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-2xl:1rem;--ease-out:cubic-bezier(0,0,.2,1);--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-bounce:bounce 1s infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}#kite-chat-root *,#kite-chat-root :after,#kite-chat-root :before,#kite-chat-root ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}#kite-chat-root,#kite-chat-root{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}#kite-chat-root hr{height:0;color:inherit;border-top-width:1px}#kite-chat-root abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#kite-chat-root h1,#kite-chat-root h2,#kite-chat-root h3,#kite-chat-root h4,#kite-chat-root h5,#kite-chat-root h6{font-size:inherit;font-weight:inherit}#kite-chat-root a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}#kite-chat-root b,#kite-chat-root strong{font-weight:bolder}#kite-chat-root code,#kite-chat-root kbd,#kite-chat-root samp,#kite-chat-root pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}#kite-chat-root small{font-size:80%}#kite-chat-root sub,#kite-chat-root sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}#kite-chat-root sub{bottom:-.25em}#kite-chat-root sup{top:-.5em}#kite-chat-root table{text-indent:0;border-color:inherit;border-collapse:collapse}#kite-chat-root :-moz-focusring{outline:auto}#kite-chat-root progress{vertical-align:baseline}#kite-chat-root summary{display:list-item}#kite-chat-root ol,#kite-chat-root ul,#kite-chat-root menu{list-style:none}#kite-chat-root img,#kite-chat-root svg,#kite-chat-root video,#kite-chat-root canvas,#kite-chat-root audio,#kite-chat-root iframe,#kite-chat-root embed,#kite-chat-root object{vertical-align:middle;display:block}#kite-chat-root img,#kite-chat-root video{max-width:100%;height:auto}#kite-chat-root button,#kite-chat-root input,#kite-chat-root select,#kite-chat-root optgroup,#kite-chat-root textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}#kite-chat-root :where(select:is([multiple],[size])) optgroup{font-weight:bolder}#kite-chat-root :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}#kite-chat-root ::file-selector-button{margin-inline-end:4px}#kite-chat-root ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){#kite-chat-root ::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){#kite-chat-root ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}#kite-chat-root textarea{resize:vertical}#kite-chat-root ::-webkit-search-decoration{-webkit-appearance:none}#kite-chat-root ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}#kite-chat-root ::-webkit-datetime-edit{display:inline-flex}#kite-chat-root ::-webkit-datetime-edit-fields-wrapper{padding:0}#kite-chat-root ::-webkit-datetime-edit{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-year-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-month-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-day-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-hour-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-minute-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-second-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-millisecond-field{padding-block:0}#kite-chat-root ::-webkit-datetime-edit-meridiem-field{padding-block:0}#kite-chat-root ::-webkit-calendar-picker-indicator{line-height:1}#kite-chat-root :-moz-ui-invalid{box-shadow:none}#kite-chat-root button,#kite-chat-root input:where([type=button],[type=reset],[type=submit]){appearance:button}#kite-chat-root ::file-selector-button{appearance:button}#kite-chat-root ::-webkit-inner-spin-button{height:auto}#kite-chat-root ::-webkit-outer-spin-button{height:auto}#kite-chat-root [hidden]:where(:not([hidden=until-found])){display:none!important}#kite-chat-root .\\@container\\/card-header{container:card-header/inline-size}#kite-chat-root .pointer-events-none{pointer-events:none}#kite-chat-root .collapse{visibility:collapse}#kite-chat-root .visible{visibility:visible}#kite-chat-root .fixed{position:fixed}#kite-chat-root .relative{position:relative}#kite-chat-root .top-0{top:calc(var(--spacing)*0)}#kite-chat-root .top-1\\/2{top:50%}#kite-chat-root .right-0{right:calc(var(--spacing)*0)}#kite-chat-root .right-4{right:calc(var(--spacing)*4)}#kite-chat-root .bottom-4{bottom:calc(var(--spacing)*4)}#kite-chat-root .bottom-6{bottom:calc(var(--spacing)*6)}#kite-chat-root .left-1\\/2{left:50%}#kite-chat-root .left-4{left:calc(var(--spacing)*4)}#kite-chat-root .z-40{z-index:40}#kite-chat-root .z-50{z-index:50}#kite-chat-root .z-\\[9999\\]{z-index:9999}#kite-chat-root .col-start-2{grid-column-start:2}#kite-chat-root .row-span-2{grid-row:span 2/span 2}#kite-chat-root .row-start-1{grid-row-start:1}#kite-chat-root .container{width:100%}@media (min-width:40rem){#kite-chat-root .container{max-width:40rem}}@media (min-width:48rem){#kite-chat-root .container{max-width:48rem}}@media (min-width:64rem){#kite-chat-root .container{max-width:64rem}}@media (min-width:80rem){#kite-chat-root .container{max-width:80rem}}@media (min-width:96rem){#kite-chat-root .container{max-width:96rem}}#kite-chat-root .mx-auto{margin-inline:auto}#kite-chat-root .my-1{margin-block:calc(var(--spacing)*1)}#kite-chat-root .my-2{margin-block:calc(var(--spacing)*2)}#kite-chat-root .mt-1{margin-top:calc(var(--spacing)*1)}#kite-chat-root .mt-2{margin-top:calc(var(--spacing)*2)}#kite-chat-root .mt-3{margin-top:calc(var(--spacing)*3)}#kite-chat-root .mr-2{margin-right:calc(var(--spacing)*2)}#kite-chat-root .mb-1{margin-bottom:calc(var(--spacing)*1)}#kite-chat-root .mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}#kite-chat-root .mb-2{margin-bottom:calc(var(--spacing)*2)}#kite-chat-root .mb-3{margin-bottom:calc(var(--spacing)*3)}#kite-chat-root .mb-4{margin-bottom:calc(var(--spacing)*4)}#kite-chat-root .ml-1{margin-left:calc(var(--spacing)*1)}#kite-chat-root .ml-2{margin-left:calc(var(--spacing)*2)}#kite-chat-root .ml-4{margin-left:calc(var(--spacing)*4)}#kite-chat-root .ml-5{margin-left:calc(var(--spacing)*5)}#kite-chat-root .ml-6{margin-left:calc(var(--spacing)*6)}#kite-chat-root .block{display:block}#kite-chat-root .contents{display:contents}#kite-chat-root .flex{display:flex}#kite-chat-root .grid{display:grid}#kite-chat-root .hidden{display:none}#kite-chat-root .inline{display:inline}#kite-chat-root .inline-block{display:inline-block}#kite-chat-root .inline-flex{display:inline-flex}#kite-chat-root .table{display:table}#kite-chat-root .size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}#kite-chat-root .size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}#kite-chat-root .size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}#kite-chat-root .size-full{width:100%;height:100%}#kite-chat-root .h-1{height:calc(var(--spacing)*1)}#kite-chat-root .h-1\\.5{height:calc(var(--spacing)*1.5)}#kite-chat-root .h-2{height:calc(var(--spacing)*2)}#kite-chat-root .h-2\\.5{height:calc(var(--spacing)*2.5)}#kite-chat-root .h-3{height:calc(var(--spacing)*3)}#kite-chat-root .h-3\\.5{height:calc(var(--spacing)*3.5)}#kite-chat-root .h-4{height:calc(var(--spacing)*4)}#kite-chat-root .h-5{height:calc(var(--spacing)*5)}#kite-chat-root .h-6{height:calc(var(--spacing)*6)}#kite-chat-root .h-7{height:calc(var(--spacing)*7)}#kite-chat-root .h-8{height:calc(var(--spacing)*8)}#kite-chat-root .h-9{height:calc(var(--spacing)*9)}#kite-chat-root .h-10{height:calc(var(--spacing)*10)}#kite-chat-root .h-12{height:calc(var(--spacing)*12)}#kite-chat-root .h-16{height:calc(var(--spacing)*16)}#kite-chat-root .h-auto{height:auto}#kite-chat-root .h-full{height:100%}#kite-chat-root .max-h-32{max-height:calc(var(--spacing)*32)}#kite-chat-root .min-h-0{min-height:calc(var(--spacing)*0)}#kite-chat-root .w-1\\.5{width:calc(var(--spacing)*1.5)}#kite-chat-root .w-2{width:calc(var(--spacing)*2)}#kite-chat-root .w-2\\.5{width:calc(var(--spacing)*2.5)}#kite-chat-root .w-3{width:calc(var(--spacing)*3)}#kite-chat-root .w-3\\.5{width:calc(var(--spacing)*3.5)}#kite-chat-root .w-4{width:calc(var(--spacing)*4)}#kite-chat-root .w-5{width:calc(var(--spacing)*5)}#kite-chat-root .w-6{width:calc(var(--spacing)*6)}#kite-chat-root .w-7{width:calc(var(--spacing)*7)}#kite-chat-root .w-8{width:calc(var(--spacing)*8)}#kite-chat-root .w-10{width:calc(var(--spacing)*10)}#kite-chat-root .w-12{width:calc(var(--spacing)*12)}#kite-chat-root .w-\\[320px\\]{width:320px}#kite-chat-root .w-\\[480px\\]{width:480px}#kite-chat-root .w-full{width:100%}#kite-chat-root .max-w-\\[240px\\]{max-width:240px}#kite-chat-root .max-w-\\[260px\\]{max-width:260px}#kite-chat-root .max-w-\\[300px\\]{max-width:300px}#kite-chat-root .min-w-0{min-width:calc(var(--spacing)*0)}#kite-chat-root .flex-1{flex:1}#kite-chat-root .flex-shrink-0,#kite-chat-root .shrink-0{flex-shrink:0}#kite-chat-root .-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-0{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x)var(--tw-translate-y)}#kite-chat-root .scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}#kite-chat-root .transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}#kite-chat-root .animate-bounce{animation:var(--animate-bounce)}#kite-chat-root .animate-spin{animation:var(--animate-spin)}#kite-chat-root .cursor-grab{cursor:grab}#kite-chat-root .cursor-grabbing{cursor:grabbing}#kite-chat-root .cursor-pointer{cursor:pointer}#kite-chat-root .touch-none{touch-action:none}#kite-chat-root .resize-none{resize:none}#kite-chat-root .list-decimal{list-style-type:decimal}#kite-chat-root .list-disc{list-style-type:disc}#kite-chat-root .auto-rows-min{grid-auto-rows:min-content}#kite-chat-root .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#kite-chat-root .grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}#kite-chat-root .flex-col{flex-direction:column}#kite-chat-root .flex-wrap{flex-wrap:wrap}#kite-chat-root .place-items-center{place-items:center}#kite-chat-root .items-center{align-items:center}#kite-chat-root .items-start{align-items:flex-start}#kite-chat-root .justify-between{justify-content:space-between}#kite-chat-root .justify-center{justify-content:center}#kite-chat-root .justify-end{justify-content:flex-end}#kite-chat-root .justify-start{justify-content:flex-start}#kite-chat-root .gap-0\\.5{gap:calc(var(--spacing)*.5)}#kite-chat-root .gap-1{gap:calc(var(--spacing)*1)}#kite-chat-root .gap-1\\.5{gap:calc(var(--spacing)*1.5)}#kite-chat-root .gap-2{gap:calc(var(--spacing)*2)}#kite-chat-root .gap-2\\.5{gap:calc(var(--spacing)*2.5)}#kite-chat-root .gap-3{gap:calc(var(--spacing)*3)}#kite-chat-root .gap-4{gap:calc(var(--spacing)*4)}#kite-chat-root .gap-6{gap:calc(var(--spacing)*6)}#kite-chat-root :where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}#kite-chat-root :where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}#kite-chat-root :where(.divide-gray-100>:not(:last-child)){border-color:var(--color-gray-100)}#kite-chat-root .self-start{align-self:flex-start}#kite-chat-root .justify-self-end{justify-self:flex-end}#kite-chat-root .truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}#kite-chat-root .overflow-hidden{overflow:hidden}#kite-chat-root .overflow-x-auto{overflow-x:auto}#kite-chat-root .overflow-y-auto{overflow-y:auto}#kite-chat-root .rounded{border-radius:.25rem}#kite-chat-root .rounded-2xl{border-radius:var(--radius-2xl)}#kite-chat-root .rounded-\\[inherit\\]{border-radius:inherit}#kite-chat-root .rounded-full{border-radius:3.40282e38px}#kite-chat-root .rounded-lg{border-radius:var(--kite-radius)}#kite-chat-root .rounded-md{border-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-xl{border-radius:calc(var(--kite-radius) + 4px)}#kite-chat-root .rounded-l-lg{border-top-left-radius:var(--kite-radius);border-bottom-left-radius:var(--kite-radius)}#kite-chat-root .rounded-br-md{border-bottom-right-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .rounded-bl-md{border-bottom-left-radius:calc(var(--kite-radius) - 2px)}#kite-chat-root .border{border-style:var(--tw-border-style);border-width:1px}#kite-chat-root .border-0{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .border-t{border-top-style:var(--tw-border-style);border-top-width:1px}#kite-chat-root .border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}#kite-chat-root .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}#kite-chat-root .border-l{border-left-style:var(--tw-border-style);border-left-width:1px}#kite-chat-root .border-amber-100{border-color:var(--color-amber-100)}#kite-chat-root .border-amber-200{border-color:var(--color-amber-200)}#kite-chat-root .border-blue-100{border-color:var(--color-blue-100)}#kite-chat-root .border-blue-200{border-color:var(--color-blue-200)}#kite-chat-root .border-emerald-100{border-color:var(--color-emerald-100)}#kite-chat-root .border-emerald-200{border-color:var(--color-emerald-200)}#kite-chat-root .border-gray-100{border-color:var(--color-gray-100)}#kite-chat-root .border-gray-200{border-color:var(--color-gray-200)}#kite-chat-root .border-gray-300{border-color:var(--color-gray-300)}#kite-chat-root .border-green-200{border-color:var(--color-green-200)}#kite-chat-root .border-input{border-color:var(--kite-input)}#kite-chat-root .border-primary\\/20{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .border-primary\\/20{border-color:color-mix(in oklab,var(--kite-primary)20%,transparent)}}#kite-chat-root .border-purple-100{border-color:var(--color-purple-100)}#kite-chat-root .border-purple-200{border-color:var(--color-purple-200)}#kite-chat-root .border-red-200{border-color:var(--color-red-200)}#kite-chat-root .border-slate-200{border-color:var(--color-slate-200)}#kite-chat-root .border-t-transparent{border-top-color:#0000}#kite-chat-root .border-l-transparent{border-left-color:#0000}#kite-chat-root .bg-amber-50{background-color:var(--color-amber-50)}#kite-chat-root .bg-amber-100{background-color:var(--color-amber-100)}#kite-chat-root .bg-background{background-color:var(--kite-background)}#kite-chat-root .bg-blue-50{background-color:var(--color-blue-50)}#kite-chat-root .bg-blue-100{background-color:var(--color-blue-100)}#kite-chat-root .bg-blue-400{background-color:var(--color-blue-400)}#kite-chat-root .bg-blue-600{background-color:var(--color-blue-600)}#kite-chat-root .bg-border{background-color:var(--kite-border)}#kite-chat-root .bg-card{background-color:var(--kite-card)}#kite-chat-root .bg-destructive{background-color:var(--kite-destructive)}#kite-chat-root .bg-emerald-50{background-color:var(--color-emerald-50)}#kite-chat-root .bg-emerald-500{background-color:var(--color-emerald-500)}#kite-chat-root .bg-gray-50{background-color:var(--color-gray-50)}#kite-chat-root .bg-gray-100{background-color:var(--color-gray-100)}#kite-chat-root .bg-gray-200{background-color:var(--color-gray-200)}#kite-chat-root .bg-gray-400{background-color:var(--color-gray-400)}#kite-chat-root .bg-gray-900{background-color:var(--color-gray-900)}#kite-chat-root .bg-green-50{background-color:var(--color-green-50)}#kite-chat-root .bg-green-400{background-color:var(--color-green-400)}#kite-chat-root .bg-muted\\/40{background-color:var(--kite-muted)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-muted\\/40{background-color:color-mix(in oklab,var(--kite-muted)40%,transparent)}}#kite-chat-root .bg-orange-100{background-color:var(--color-orange-100)}#kite-chat-root .bg-orange-400{background-color:var(--color-orange-400)}#kite-chat-root .bg-pink-400{background-color:var(--color-pink-400)}#kite-chat-root .bg-primary,#kite-chat-root .bg-primary\\/5{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .bg-primary\\/5{background-color:color-mix(in oklab,var(--kite-primary)5%,transparent)}}#kite-chat-root .bg-purple-50{background-color:var(--color-purple-50)}#kite-chat-root .bg-purple-400{background-color:var(--color-purple-400)}#kite-chat-root .bg-red-50{background-color:var(--color-red-50)}#kite-chat-root .bg-red-100{background-color:var(--color-red-100)}#kite-chat-root .bg-red-500{background-color:var(--color-red-500)}#kite-chat-root .bg-secondary{background-color:var(--kite-secondary)}#kite-chat-root .bg-slate-50{background-color:var(--color-slate-50)}#kite-chat-root .bg-slate-100{background-color:var(--color-slate-100)}#kite-chat-root .bg-slate-300{background-color:var(--color-slate-300)}#kite-chat-root .bg-transparent{background-color:#0000}#kite-chat-root .bg-white{background-color:var(--color-white)}#kite-chat-root .bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}#kite-chat-root .from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}#kite-chat-root .p-0{padding:calc(var(--spacing)*0)}#kite-chat-root .p-2{padding:calc(var(--spacing)*2)}#kite-chat-root .p-3{padding:calc(var(--spacing)*3)}#kite-chat-root .p-4{padding:calc(var(--spacing)*4)}#kite-chat-root .p-6{padding:calc(var(--spacing)*6)}#kite-chat-root .p-px{padding:1px}#kite-chat-root .px-0{padding-inline:calc(var(--spacing)*0)}#kite-chat-root .px-1{padding-inline:calc(var(--spacing)*1)}#kite-chat-root .px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}#kite-chat-root .px-2{padding-inline:calc(var(--spacing)*2)}#kite-chat-root .px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .px-3{padding-inline:calc(var(--spacing)*3)}#kite-chat-root .px-4{padding-inline:calc(var(--spacing)*4)}#kite-chat-root .px-6{padding-inline:calc(var(--spacing)*6)}#kite-chat-root .py-0{padding-block:calc(var(--spacing)*0)}#kite-chat-root .py-0\\.5{padding-block:calc(var(--spacing)*.5)}#kite-chat-root .py-1{padding-block:calc(var(--spacing)*1)}#kite-chat-root .py-1\\.5{padding-block:calc(var(--spacing)*1.5)}#kite-chat-root .py-2{padding-block:calc(var(--spacing)*2)}#kite-chat-root .py-2\\.5{padding-block:calc(var(--spacing)*2.5)}#kite-chat-root .py-3{padding-block:calc(var(--spacing)*3)}#kite-chat-root .py-4{padding-block:calc(var(--spacing)*4)}#kite-chat-root .py-6{padding-block:calc(var(--spacing)*6)}#kite-chat-root .py-8{padding-block:calc(var(--spacing)*8)}#kite-chat-root .pt-0{padding-top:calc(var(--spacing)*0)}#kite-chat-root .pt-2{padding-top:calc(var(--spacing)*2)}#kite-chat-root .pb-2{padding-bottom:calc(var(--spacing)*2)}#kite-chat-root .pb-3{padding-bottom:calc(var(--spacing)*3)}#kite-chat-root .pb-4{padding-bottom:calc(var(--spacing)*4)}#kite-chat-root .text-center{text-align:center}#kite-chat-root .text-left{text-align:left}#kite-chat-root .font-mono{font-family:var(--font-mono)}#kite-chat-root .text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}#kite-chat-root .text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}#kite-chat-root .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}#kite-chat-root .text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}#kite-chat-root .text-\\[10px\\]{font-size:10px}#kite-chat-root .leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}#kite-chat-root .leading-none{--tw-leading:1;line-height:1}#kite-chat-root .font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}#kite-chat-root .font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}#kite-chat-root .tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}#kite-chat-root .tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}#kite-chat-root .whitespace-nowrap{white-space:nowrap}#kite-chat-root .whitespace-pre-wrap{white-space:pre-wrap}#kite-chat-root .text-amber-500{color:var(--color-amber-500)}#kite-chat-root .text-amber-600{color:var(--color-amber-600)}#kite-chat-root .text-amber-700{color:var(--color-amber-700)}#kite-chat-root .text-black{color:var(--color-black)}#kite-chat-root .text-blue-600{color:var(--color-blue-600)}#kite-chat-root .text-blue-700{color:var(--color-blue-700)}#kite-chat-root .text-card-foreground{color:var(--kite-card-foreground)}#kite-chat-root .text-emerald-500{color:var(--color-emerald-500)}#kite-chat-root .text-emerald-600{color:var(--color-emerald-600)}#kite-chat-root .text-emerald-700{color:var(--color-emerald-700)}#kite-chat-root .text-gray-300{color:var(--color-gray-300)}#kite-chat-root .text-gray-400{color:var(--color-gray-400)}#kite-chat-root .text-gray-500{color:var(--color-gray-500)}#kite-chat-root .text-gray-600{color:var(--color-gray-600)}#kite-chat-root .text-gray-700{color:var(--color-gray-700)}#kite-chat-root .text-gray-800{color:var(--color-gray-800)}#kite-chat-root .text-gray-900{color:var(--color-gray-900)}#kite-chat-root .text-green-500{color:var(--color-green-500)}#kite-chat-root .text-green-600{color:var(--color-green-600)}#kite-chat-root .text-green-700{color:var(--color-green-700)}#kite-chat-root .text-green-800{color:var(--color-green-800)}#kite-chat-root .text-muted-foreground{color:var(--kite-muted-foreground)}#kite-chat-root .text-orange-700{color:var(--color-orange-700)}#kite-chat-root .text-primary{color:var(--kite-primary)}#kite-chat-root .text-primary-foreground{color:var(--kite-primary-foreground)}#kite-chat-root .text-purple-600{color:var(--color-purple-600)}#kite-chat-root .text-purple-700{color:var(--color-purple-700)}#kite-chat-root .text-red-500{color:var(--color-red-500)}#kite-chat-root .text-red-600{color:var(--color-red-600)}#kite-chat-root .text-red-700{color:var(--color-red-700)}#kite-chat-root .text-secondary-foreground{color:var(--kite-secondary-foreground)}#kite-chat-root .text-slate-600{color:var(--color-slate-600)}#kite-chat-root .text-slate-700{color:var(--color-slate-700)}#kite-chat-root .text-white{color:var(--color-white)}#kite-chat-root .uppercase{text-transform:uppercase}#kite-chat-root .italic{font-style:italic}#kite-chat-root .line-through{text-decoration-line:line-through}#kite-chat-root .underline-offset-4{text-underline-offset:4px}#kite-chat-root .opacity-0{opacity:0}#kite-chat-root .opacity-60{opacity:.6}#kite-chat-root .opacity-70{opacity:.7}#kite-chat-root .opacity-90{opacity:.9}#kite-chat-root .opacity-100{opacity:1}#kite-chat-root .shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .outline{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}#kite-chat-root .duration-150{--tw-duration:.15s;transition-duration:.15s}#kite-chat-root .duration-200{--tw-duration:.2s;transition-duration:.2s}#kite-chat-root .duration-300{--tw-duration:.3s;transition-duration:.3s}#kite-chat-root .ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}#kite-chat-root .ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}#kite-chat-root .outline-none{--tw-outline-style:none;outline-style:none}#kite-chat-root .select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){#kite-chat-root .group-hover\\:bg-gray-200:is(:where(.group):hover *){background-color:var(--color-gray-200)}}#kite-chat-root .selection\\:bg-primary ::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:bg-primary::selection{background-color:var(--kite-primary)}#kite-chat-root .selection\\:text-primary-foreground ::selection{color:var(--kite-primary-foreground)}#kite-chat-root .selection\\:text-primary-foreground::selection{color:var(--kite-primary-foreground)}#kite-chat-root .file\\:inline-flex::file-selector-button{display:inline-flex}#kite-chat-root .file\\:h-7::file-selector-button{height:calc(var(--spacing)*7)}#kite-chat-root .file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}#kite-chat-root .file\\:bg-transparent::file-selector-button{background-color:#0000}#kite-chat-root .file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}#kite-chat-root .file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}#kite-chat-root .file\\:text-foreground::file-selector-button{color:var(--kite-foreground)}#kite-chat-root .placeholder\\:text-gray-400::placeholder{color:var(--color-gray-400)}#kite-chat-root .placeholder\\:text-muted-foreground::placeholder{color:var(--kite-muted-foreground)}#kite-chat-root .focus-within\\:border-gray-700:focus-within{border-color:var(--color-gray-700)}@media (hover:hover){#kite-chat-root .hover\\:border-gray-300:hover{border-color:var(--color-gray-300)}#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:border-primary\\/30:hover{border-color:color-mix(in oklab,var(--kite-primary)30%,transparent)}}#kite-chat-root .hover\\:bg-accent:hover{background-color:var(--kite-accent)}#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab,var(--kite-destructive)90%,transparent)}}#kite-chat-root .hover\\:bg-gray-50:hover{background-color:var(--color-gray-50)}#kite-chat-root .hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}#kite-chat-root .hover\\:bg-gray-200:hover{background-color:var(--color-gray-200)}#kite-chat-root .hover\\:bg-gray-800:hover{background-color:var(--color-gray-800)}#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/10:hover{background-color:color-mix(in oklab,var(--kite-primary)10%,transparent)}}#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:var(--kite-primary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--kite-primary)90%,transparent)}}#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:var(--kite-secondary)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab,var(--kite-secondary)80%,transparent)}}#kite-chat-root .hover\\:text-accent-foreground:hover{color:var(--kite-accent-foreground)}#kite-chat-root .hover\\:text-blue-800:hover{color:var(--color-blue-800)}#kite-chat-root .hover\\:text-gray-600:hover{color:var(--color-gray-600)}#kite-chat-root .hover\\:text-gray-700:hover{color:var(--color-gray-700)}#kite-chat-root .hover\\:text-gray-800:hover{color:var(--color-gray-800)}#kite-chat-root .hover\\:underline:hover{text-decoration-line:underline}#kite-chat-root .hover\\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}#kite-chat-root .focus\\:ring-primary:focus{--tw-ring-color:var(--kite-primary)}#kite-chat-root .focus-visible\\:border-ring:focus-visible{border-color:var(--kite-ring)}#kite-chat-root .focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--kite-ring)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-ring)50%,transparent)}}#kite-chat-root .focus-visible\\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}#kite-chat-root .focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}#kite-chat-root .active\\:cursor-grabbing:active{cursor:grabbing}#kite-chat-root .disabled\\:pointer-events-none:disabled{pointer-events:none}#kite-chat-root .disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}#kite-chat-root .disabled\\:bg-gray-300:disabled{background-color:var(--color-gray-300)}#kite-chat-root .disabled\\:opacity-50:disabled{opacity:.5}#kite-chat-root .has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}#kite-chat-root .has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}#kite-chat-root .has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}#kite-chat-root .has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}#kite-chat-root .aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--kite-destructive)}#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)20%,transparent)}}@media (min-width:48rem){#kite-chat-root .md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}#kite-chat-root .dark\\:border-input:is(.dark *){border-color:var(--kite-input)}#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab,var(--kite-destructive)60%,transparent)}}#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab,var(--kite-input)30%,transparent)}}@media (hover:hover){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--kite-accent)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-accent)50%,transparent)}}#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--kite-input)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--kite-input)50%,transparent)}}}#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--kite-destructive)}@supports (color:color-mix(in lab, red, red)){#kite-chat-root .dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab,var(--kite-destructive)40%,transparent)}}#kite-chat-root .\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}#kite-chat-root .\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}#kite-chat-root .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}#kite-chat-root .\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing)*6)}#kite-chat-root .\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing)*6)}:root{--kite-radius:.625rem;--kite-background:oklch(100% 0 0);--kite-foreground:oklch(14.5% 0 0);--kite-card:oklch(100% 0 0);--kite-card-foreground:oklch(14.5% 0 0);--kite-popover:oklch(100% 0 0);--kite-popover-foreground:oklch(14.5% 0 0);--kite-primary:oklch(20.5% 0 0);--kite-primary-foreground:oklch(98.5% 0 0);--kite-secondary:oklch(97% 0 0);--kite-secondary-foreground:oklch(20.5% 0 0);--kite-muted:oklch(97% 0 0);--kite-muted-foreground:oklch(55.6% 0 0);--kite-accent:oklch(97% 0 0);--kite-accent-foreground:oklch(20.5% 0 0);--kite-destructive:oklch(57.7% .245 27.325);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(92.2% 0 0);--kite-input:oklch(92.2% 0 0);--kite-ring:oklch(70.8% 0 0)}.dark{--kite-background:oklch(14.5% 0 0);--kite-foreground:oklch(98.5% 0 0);--kite-card:oklch(20.5% 0 0);--kite-card-foreground:oklch(98.5% 0 0);--kite-popover:oklch(20.5% 0 0);--kite-popover-foreground:oklch(98.5% 0 0);--kite-primary:oklch(92.2% 0 0);--kite-primary-foreground:oklch(20.5% 0 0);--kite-secondary:oklch(26.9% 0 0);--kite-secondary-foreground:oklch(98.5% 0 0);--kite-muted:oklch(26.9% 0 0);--kite-muted-foreground:oklch(70.8% 0 0);--kite-accent:oklch(26.9% 0 0);--kite-accent-foreground:oklch(98.5% 0 0);--kite-destructive:oklch(70.4% .191 22.216);--kite-destructive-foreground:oklch(98.5% 0 0);--kite-border:oklch(100% 0 0/.1);--kite-input:oklch(100% 0 0/.15);--kite-ring:oklch(55.6% 0 0);--kite-link:oklch(65% .15 250)}#kite-chat-root *{border-color:var(--kite-border)}#kite-chat-root section form input{color:var(--kite-foreground,#1a1a1a)!important}#kite-chat-root section form input::placeholder{color:var(--kite-muted-foreground,#9ca3af)!important}#kite-chat-root section .space-y-1>div+div{margin-top:.625rem}#kite-chat-root section>div.flex-1>div.overflow-y-auto{padding:1rem 1.25rem!important}#kite-chat-root section .mt-6.pt-4.border-t{margin-top:1.25rem;padding-top:1rem}#kite-chat-root section button.w-full.text-left.px-3{padding:.75rem 1rem}#kite-chat-root section .text-sm.leading-6{line-height:1.625rem}@keyframes spin{to{transform:rotate(360deg)}}#kite-chat-root .animate-spin{animation:1s linear infinite spin}#kite-chat-root [data-motion]{will-change:transform,opacity}#kite-chat-root a,#kite-chat-root .kite-link{word-break:break-word;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;text-decoration:none;color:var(--kite-link)!important}#kite-chat-root a:hover,#kite-chat-root .kite-link:hover{text-decoration:underline}#kite-chat-root .text-sm.leading-6{overflow-wrap:break-word;word-break:break-word;max-width:100%}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}#kite-chat-root{--kite-link:oklch(55% .15 250)}`,document.head.appendChild(e);let t=document.createElement("style");t.id="kite-chat-position",t.textContent=`
|
|
78
43
|
#kite-chat-root {
|
|
79
44
|
/* Container is just a mount point - ChatPanel handles its own positioning */
|
|
80
45
|
}
|
|
81
|
-
`,document.head.appendChild(t)}function
|
|
46
|
+
`,document.head.appendChild(t)}function bp(){let e=window.KiteChatConfig;if(!e){console.error("[KiteChat] Missing window.KiteChatConfig");return}if(!e.userId){console.error("[KiteChat] userId is required");return}if(Pi){console.warn("[KiteChat] Already initialized");return}if(QD(),e.container){let t=typeof e.container=="string"?document.querySelector(e.container):e.container;if(!t){console.error(`[KiteChat] Container not found: ${e.container}`);return}Ea=document.createElement("div"),Ea.id="kite-chat-root",t.appendChild(Ea)}else Ea=document.createElement("div"),Ea.id="kite-chat-root",document.body.appendChild(Ea);Pi=(0,Ak.createRoot)(Ea),Pi.render((0,zy.jsx)(XD,{initialConfig:e})),window.KiteChat=JD()}function JD(){return{setCurrentPage:e=>na.setCurrentPage?.(e),setUser:e=>na.setConfig?.({userId:e}),setConfig:e=>na.setConfig?.(e),open:()=>na.setIsOpen?.(!0),close:()=>na.setIsOpen?.(!1),toggle:()=>{let e=na.getIsOpen?.()??!1;na.setIsOpen?.(!e)},isOpen:()=>na.getIsOpen?.()??!1,destroy:()=>{Pi?.unmount(),Pi=null,Ea?.remove(),Ea=null,window.KiteChat=void 0},isMounted:()=>Pi!==null}}typeof window<"u"&&(window.KiteChatInit=bp,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",bp):bp());return ix(YD);})();
|
|
82
47
|
/*! Bundled license information:
|
|
83
48
|
|
|
84
49
|
react/cjs/react.production.min.js:
|