@kite-copilot/chat-panel 0.2.48 → 0.2.50
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 +38 -0
- package/dist/auto.cjs +176 -150
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-LOTJ3U5L.js → chunk-BLSVIF7H.js} +168 -142
- 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 +22 -22
- package/dist/index.cjs +176 -150
- 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,18 +1,18 @@
|
|
|
1
|
-
"use strict";var KiteChatEmbed=(()=>{var zk=Object.create;var qu=Object.defineProperty;var $k=Object.getOwnPropertyDescriptor;var Wk=Object.getOwnPropertyNames;var Gk=Object.getPrototypeOf,Kk=Object.prototype.hasOwnProperty;var Xk=(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 Qk=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ox=(e,t)=>{for(var a in t)qu(e,a,{get:t[a],enumerable:!0})},nx=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wk(t))!Kk.call(e,o)&&o!==a&&qu(e,o,{get:()=>t[o],enumerable:!(r=$k(t,o))||r.enumerable});return e};var N=(e,t,a)=>(a=e!=null?zk(Gk(e)):{},nx(t||!e||!e.__esModule?qu(a,"default",{value:e,enumerable:!0}):a,e)),sx=e=>nx(qu({},"__esModule",{value:!0}),e);var xx=Ze(re=>{"use strict";var Mi=Symbol.for("react.element"),Jk=Symbol.for("react.portal"),Yk=Symbol.for("react.fragment"),Zk=Symbol.for("react.strict_mode"),eP=Symbol.for("react.profiler"),tP=Symbol.for("react.provider"),aP=Symbol.for("react.context"),rP=Symbol.for("react.forward_ref"),oP=Symbol.for("react.suspense"),nP=Symbol.for("react.memo"),sP=Symbol.for("react.lazy"),ix=Symbol.iterator;function iP(e){return e===null||typeof e!="object"?null:(e=ix&&e[ix]||e["@@iterator"],typeof e=="function"?e:null)}var dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cx=Object.assign,fx={};function Bn(e,t,a){this.props=e,this.context=t,this.refs=fx,this.updater=a||dx}Bn.prototype.isReactComponent={};Bn.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")};Bn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function px(){}px.prototype=Bn.prototype;function Fp(e,t,a){this.props=e,this.context=t,this.refs=fx,this.updater=a||dx}var Bp=Fp.prototype=new px;Bp.constructor=Fp;cx(Bp,Bn.prototype);Bp.isPureReactComponent=!0;var lx=Array.isArray,mx=Object.prototype.hasOwnProperty,Up={current:null},hx={key:!0,ref:!0,__self:!0,__source:!0};function gx(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)mx.call(t,r)&&!hx.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 lP(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 uP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var ux=/\/+/g;function Op(e,t){return typeof e=="object"&&e!==null&&e.key!=null?uP(""+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 Jk:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Op(s,0):r,lx(o)?(a="",e!=null&&(a=e.replace(ux,"$&/")+"/"),zu(o,t,a,"",function(u){return u})):o!=null&&(Vp(o)&&(o=lP(o,a+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(ux,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",lx(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=iP(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 dP(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 Lt={current:null},$u={transition:null},cP={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:$u,ReactCurrentOwner:Up};function yx(){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=Bn;re.Fragment=Yk;re.Profiler=eP;re.PureComponent=Fp;re.StrictMode=Zk;re.Suspense=oP;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cP;re.act=yx;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=cx({},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)mx.call(t,l)&&!hx.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:aP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:tP,_context:e},e.Consumer=e};re.createElement=gx;re.createFactory=function(e){var t=gx.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:rP,render:e}};re.isValidElement=Vp;re.lazy=function(e){return{$$typeof:sP,_payload:{_status:-1,_result:e},_init:dP}};re.memo=function(e,t){return{$$typeof:nP,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=yx;re.useCallback=function(e,t){return Lt.current.useCallback(e,t)};re.useContext=function(e){return Lt.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};re.useEffect=function(e,t){return Lt.current.useEffect(e,t)};re.useId=function(){return Lt.current.useId()};re.useImperativeHandle=function(e,t,a){return Lt.current.useImperativeHandle(e,t,a)};re.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return Lt.current.useMemo(e,t)};re.useReducer=function(e,t,a){return Lt.current.useReducer(e,t,a)};re.useRef=function(e){return Lt.current.useRef(e)};re.useState=function(e){return Lt.current.useState(e)};re.useSyncExternalStore=function(e,t,a){return Lt.current.useSyncExternalStore(e,t,a)};re.useTransition=function(){return Lt.current.useTransition()};re.version="18.3.1"});var W=Ze((eM,vx)=>{"use strict";vx.exports=xx()});var Ax=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 xa(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"?(wx=performance,ve.unstable_now=function(){return wx.now()}):(jp=Date,Cx=jp.now(),ve.unstable_now=function(){return jp.now()-Cx});var wx,jp,Cx,Ra=[],Mr=[],fP=1,sa=null,ht=3,Xu=!1,Eo=!1,Oi=!1,Ix=typeof setTimeout=="function"?setTimeout:null,bx=typeof clearTimeout=="function"?clearTimeout:null,Sx=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=xa(Mr);t!==null;){if(t.callback===null)Ku(Mr);else if(t.startTime<=e)Ku(Mr),t.sortIndex=t.expirationTime,zp(Ra,t);else break;t=xa(Mr)}}function Wp(e){if(Oi=!1,$p(e),!Eo)if(xa(Ra)!==null)Eo=!0,Kp(Gp);else{var t=xa(Mr);t!==null&&Xp(Wp,t.startTime-e)}}function Gp(e,t){Eo=!1,Oi&&(Oi=!1,bx(Fi),Fi=-1),Xu=!0;var a=ht;try{for($p(t),sa=xa(Ra);sa!==null&&(!(sa.expirationTime>t)||e&&!Tx());){var r=sa.callback;if(typeof r=="function"){sa.callback=null,ht=sa.priorityLevel;var o=r(sa.expirationTime<=t);t=ve.unstable_now(),typeof o=="function"?sa.callback=o:sa===xa(Ra)&&Ku(Ra),$p(t)}else Ku(Ra);sa=xa(Ra)}if(sa!==null)var n=!0;else{var s=xa(Mr);s!==null&&Xp(Wp,s.startTime-t),n=!1}return n}finally{sa=null,ht=a,Xu=!1}}var Qu=!1,Gu=null,Fi=-1,kx=5,Px=-1;function Tx(){return!(ve.unstable_now()-Px<kx)}function qp(){if(Gu!==null){var e=ve.unstable_now();Px=e;var t=!0;try{t=Gu(!0,e)}finally{t?Ni():(Qu=!1,Gu=null)}}else Qu=!1}var Ni;typeof Sx=="function"?Ni=function(){Sx(qp)}:typeof MessageChannel<"u"?(Hp=new MessageChannel,Lx=Hp.port2,Hp.port1.onmessage=qp,Ni=function(){Lx.postMessage(null)}):Ni=function(){Ix(qp,0)};var Hp,Lx;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(){Eo||Xu||(Eo=!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"):kx=0<e?Math.floor(1e3/e):5};ve.unstable_getCurrentPriorityLevel=function(){return ht};ve.unstable_getFirstCallbackNode=function(){return xa(Ra)};ve.unstable_next=function(e){switch(ht){case 1:case 2:case 3:var t=3;break;default:t=ht}var a=ht;ht=t;try{return e()}finally{ht=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=ht;ht=e;try{return t()}finally{ht=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:fP++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,zp(Mr,e),xa(Ra)===null&&e===xa(Mr)&&(Oi?(bx(Fi),Fi=-1):Oi=!0,Xp(Wp,a-r))):(e.sortIndex=o,zp(Ra,e),Eo||Xu||(Eo=!0,Kp(Gp))),e};ve.unstable_shouldYield=Tx;ve.unstable_wrapCallback=function(e){var t=ht;return function(){var a=ht;ht=t;try{return e.apply(this,arguments)}finally{ht=a}}}});var _x=Ze((aM,Rx)=>{"use strict";Rx.exports=Ax()});var Nw=Ze(Qt=>{"use strict";var pP=W(),Kt=_x();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 Bv=new Set,nl={};function $o(e,t){ns(e,t),ns(e+"Capture",t)}function ns(e,t){for(nl[e]=t,e=0;e<t.length;e++)Bv.add(t[e])}var nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xm=Object.prototype.hasOwnProperty,mP=/^[: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]*$/,Ex={},Dx={};function hP(e){return xm.call(Dx,e)?!0:xm.call(Ex,e)?!1:mP.test(e)?Dx[e]=!0:(Ex[e]=!0,!1)}function gP(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 yP(e,t,a,r){if(t===null||typeof t>"u"||gP(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 kt(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 it={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){it[e]=new kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];it[t]=new kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){it[e]=new kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){it[e]=new kt(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){it[e]=new kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){it[e]=new kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){it[e]=new kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){it[e]=new kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){it[e]=new kt(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);it[t]=new kt(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);it[t]=new kt(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);it[t]=new kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){it[e]=new kt(e,1,!1,e.toLowerCase(),null,!1,!1)});it.xlinkHref=new kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){it[e]=new kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function fh(e,t,a,r){var o=it.hasOwnProperty(t)?it[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(yP(t,a,o,r)&&(a=null),r||o===null?hP(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 ur=pP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ju=Symbol.for("react.element"),jn=Symbol.for("react.portal"),qn=Symbol.for("react.fragment"),ph=Symbol.for("react.strict_mode"),vm=Symbol.for("react.profiler"),Uv=Symbol.for("react.provider"),Vv=Symbol.for("react.context"),mh=Symbol.for("react.forward_ref"),wm=Symbol.for("react.suspense"),Cm=Symbol.for("react.suspense_list"),hh=Symbol.for("react.memo"),Or=Symbol.for("react.lazy"),jv=Symbol.for("react.offscreen"),Mx=Symbol.iterator;function Bi(e){return e===null||typeof e!="object"?null:(e=Mx&&e[Mx]||e["@@iterator"],typeof e=="function"?e:null)}var Me=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
|
-
`+
|
|
1
|
+
"use strict";var KiteChatEmbed=(()=>{var Wk=Object.create;var ju=Object.defineProperty;var Gk=Object.getOwnPropertyDescriptor;var Kk=Object.getOwnPropertyNames;var Xk=Object.getPrototypeOf,Qk=Object.prototype.hasOwnProperty;var Jk=(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 Yk=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ye=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ox=(e,t)=>{for(var a in t)ju(e,a,{get:t[a],enumerable:!0})},nx=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Kk(t))!Qk.call(e,o)&&o!==a&&ju(e,o,{get:()=>t[o],enumerable:!(r=Gk(t,o))||r.enumerable});return e};var D=(e,t,a)=>(a=e!=null?Wk(Xk(e)):{},nx(t||!e||!e.__esModule?ju(a,"default",{value:e,enumerable:!0}):a,e)),sx=e=>nx(ju({},"__esModule",{value:!0}),e);var xx=Ye(re=>{"use strict";var Di=Symbol.for("react.element"),Zk=Symbol.for("react.portal"),eP=Symbol.for("react.fragment"),tP=Symbol.for("react.strict_mode"),aP=Symbol.for("react.profiler"),rP=Symbol.for("react.provider"),oP=Symbol.for("react.context"),nP=Symbol.for("react.forward_ref"),sP=Symbol.for("react.suspense"),iP=Symbol.for("react.memo"),lP=Symbol.for("react.lazy"),ix=Symbol.iterator;function uP(e){return e===null||typeof e!="object"?null:(e=ix&&e[ix]||e["@@iterator"],typeof e=="function"?e:null)}var dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cx=Object.assign,fx={};function On(e,t,a){this.props=e,this.context=t,this.refs=fx,this.updater=a||dx}On.prototype.isReactComponent={};On.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")};On.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function px(){}px.prototype=On.prototype;function Op(e,t,a){this.props=e,this.context=t,this.refs=fx,this.updater=a||dx}var Fp=Op.prototype=new px;Fp.constructor=Op;cx(Fp,On.prototype);Fp.isPureReactComponent=!0;var lx=Array.isArray,mx=Object.prototype.hasOwnProperty,Bp={current:null},hx={key:!0,ref:!0,__self:!0,__source:!0};function gx(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)mx.call(t,r)&&!hx.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:Di,type:e,key:n,ref:s,props:o,_owner:Bp.current}}function dP(e,t){return{$$typeof:Di,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Up(e){return typeof e=="object"&&e!==null&&e.$$typeof===Di}function cP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(a){return t[a]})}var ux=/\/+/g;function Np(e,t){return typeof e=="object"&&e!==null&&e.key!=null?cP(""+e.key):t.toString(36)}function Hu(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 Di:case Zk:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Np(s,0):r,lx(o)?(a="",e!=null&&(a=e.replace(ux,"$&/")+"/"),Hu(o,t,a,"",function(u){return u})):o!=null&&(Up(o)&&(o=dP(o,a+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(ux,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",lx(e))for(var i=0;i<e.length;i++){n=e[i];var l=r+Np(n,i);s+=Hu(n,t,a,l,o)}else if(l=uP(e),typeof l=="function")for(e=l.call(e),i=0;!(n=e.next()).done;)n=n.value,l=r+Np(n,i++),s+=Hu(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 qu(e,t,a){if(e==null)return e;var r=[],o=0;return Hu(e,r,"","",function(n){return t.call(a,n,o++)}),r}function fP(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 bt={current:null},zu={transition:null},pP={ReactCurrentDispatcher:bt,ReactCurrentBatchConfig:zu,ReactCurrentOwner:Bp};function yx(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:qu,forEach:function(e,t,a){qu(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return qu(e,function(){t++}),t},toArray:function(e){return qu(e,function(t){return t})||[]},only:function(e){if(!Up(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=On;re.Fragment=eP;re.Profiler=aP;re.PureComponent=Op;re.StrictMode=tP;re.Suspense=sP;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pP;re.act=yx;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=cx({},e.props),o=e.key,n=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(n=t.ref,s=Bp.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)mx.call(t,l)&&!hx.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:Di,type:e.type,key:o,ref:n,props:r,_owner:s}};re.createContext=function(e){return e={$$typeof:oP,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rP,_context:e},e.Consumer=e};re.createElement=gx;re.createFactory=function(e){var t=gx.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:nP,render:e}};re.isValidElement=Up;re.lazy=function(e){return{$$typeof:lP,_payload:{_status:-1,_result:e},_init:fP}};re.memo=function(e,t){return{$$typeof:iP,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=zu.transition;zu.transition={};try{e()}finally{zu.transition=t}};re.unstable_act=yx;re.useCallback=function(e,t){return bt.current.useCallback(e,t)};re.useContext=function(e){return bt.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return bt.current.useDeferredValue(e)};re.useEffect=function(e,t){return bt.current.useEffect(e,t)};re.useId=function(){return bt.current.useId()};re.useImperativeHandle=function(e,t,a){return bt.current.useImperativeHandle(e,t,a)};re.useInsertionEffect=function(e,t){return bt.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return bt.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return bt.current.useMemo(e,t)};re.useReducer=function(e,t,a){return bt.current.useReducer(e,t,a)};re.useRef=function(e){return bt.current.useRef(e)};re.useState=function(e){return bt.current.useState(e)};re.useSyncExternalStore=function(e,t,a){return bt.current.useSyncExternalStore(e,t,a)};re.useTransition=function(){return bt.current.useTransition()};re.version="18.3.1"});var W=Ye((rM,vx)=>{"use strict";vx.exports=xx()});var Ax=Ye(we=>{"use strict";function Hp(e,t){var a=e.length;e.push(t);e:for(;0<a;){var r=a-1>>>1,o=e[r];if(0<$u(o,t))e[r]=t,e[a]=o,a=r;else break e}}function va(e){return e.length===0?null:e[0]}function Gu(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>$u(i,a))l<o&&0>$u(u,i)?(e[r]=u,e[l]=a,r=l):(e[r]=i,e[s]=a,r=s);else if(l<o&&0>$u(u,a))e[r]=u,e[l]=a,r=l;else break e}}return t}function $u(e,t){var a=e.sortIndex-t.sortIndex;return a!==0?a:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(wx=performance,we.unstable_now=function(){return wx.now()}):(Vp=Date,Sx=Vp.now(),we.unstable_now=function(){return Vp.now()-Sx});var wx,Vp,Sx,Ea=[],_r=[],mP=1,na=null,gt=3,Ku=!1,Ao=!1,Ni=!1,Ix=typeof setTimeout=="function"?setTimeout:null,bx=typeof clearTimeout=="function"?clearTimeout:null,Cx=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function zp(e){for(var t=va(_r);t!==null;){if(t.callback===null)Gu(_r);else if(t.startTime<=e)Gu(_r),t.sortIndex=t.expirationTime,Hp(Ea,t);else break;t=va(_r)}}function $p(e){if(Ni=!1,zp(e),!Ao)if(va(Ea)!==null)Ao=!0,Gp(Wp);else{var t=va(_r);t!==null&&Kp($p,t.startTime-e)}}function Wp(e,t){Ao=!1,Ni&&(Ni=!1,bx(Oi),Oi=-1),Ku=!0;var a=gt;try{for(zp(t),na=va(Ea);na!==null&&(!(na.expirationTime>t)||e&&!Tx());){var r=na.callback;if(typeof r=="function"){na.callback=null,gt=na.priorityLevel;var o=r(na.expirationTime<=t);t=we.unstable_now(),typeof o=="function"?na.callback=o:na===va(Ea)&&Gu(Ea),zp(t)}else Gu(Ea);na=va(Ea)}if(na!==null)var n=!0;else{var s=va(_r);s!==null&&Kp($p,s.startTime-t),n=!1}return n}finally{na=null,gt=a,Ku=!1}}var Xu=!1,Wu=null,Oi=-1,kx=5,Px=-1;function Tx(){return!(we.unstable_now()-Px<kx)}function jp(){if(Wu!==null){var e=we.unstable_now();Px=e;var t=!0;try{t=Wu(!0,e)}finally{t?Mi():(Xu=!1,Wu=null)}}else Xu=!1}var Mi;typeof Cx=="function"?Mi=function(){Cx(jp)}:typeof MessageChannel<"u"?(qp=new MessageChannel,Lx=qp.port2,qp.port1.onmessage=jp,Mi=function(){Lx.postMessage(null)}):Mi=function(){Ix(jp,0)};var qp,Lx;function Gp(e){Wu=e,Xu||(Xu=!0,Mi())}function Kp(e,t){Oi=Ix(function(){e(we.unstable_now())},t)}we.unstable_IdlePriority=5;we.unstable_ImmediatePriority=1;we.unstable_LowPriority=4;we.unstable_NormalPriority=3;we.unstable_Profiling=null;we.unstable_UserBlockingPriority=2;we.unstable_cancelCallback=function(e){e.callback=null};we.unstable_continueExecution=function(){Ao||Ku||(Ao=!0,Gp(Wp))};we.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"):kx=0<e?Math.floor(1e3/e):5};we.unstable_getCurrentPriorityLevel=function(){return gt};we.unstable_getFirstCallbackNode=function(){return va(Ea)};we.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}};we.unstable_pauseExecution=function(){};we.unstable_requestPaint=function(){};we.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}};we.unstable_scheduleCallback=function(e,t,a){var r=we.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:mP++,callback:t,priorityLevel:e,startTime:a,expirationTime:o,sortIndex:-1},a>r?(e.sortIndex=a,Hp(_r,e),va(Ea)===null&&e===va(_r)&&(Ni?(bx(Oi),Oi=-1):Ni=!0,Kp($p,a-r))):(e.sortIndex=o,Hp(Ea,e),Ao||Ku||(Ao=!0,Gp(Wp))),e};we.unstable_shouldYield=Tx;we.unstable_wrapCallback=function(e){var t=gt;return function(){var a=gt;gt=t;try{return e.apply(this,arguments)}finally{gt=a}}}});var _x=Ye((nM,Rx)=>{"use strict";Rx.exports=Ax()});var Nw=Ye(Qt=>{"use strict";var hP=W(),Kt=_x();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 Bv=new Set,ol={};function qo(e,t){rs(e,t),rs(e+"Capture",t)}function rs(e,t){for(ol[e]=t,e=0;e<t.length;e++)Bv.add(t[e])}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ym=Object.prototype.hasOwnProperty,gP=/^[: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]*$/,Ex={},Dx={};function yP(e){return ym.call(Dx,e)?!0:ym.call(Ex,e)?!1:gP.test(e)?Dx[e]=!0:(Ex[e]=!0,!1)}function xP(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 vP(e,t,a,r){if(t===null||typeof t>"u"||xP(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 Tt(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 Tt(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 Tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){lt[e]=new Tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){lt[e]=new Tt(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 Tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){lt[e]=new Tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){lt[e]=new Tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){lt[e]=new Tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){lt[e]=new Tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var uh=/[\-:]([a-z])/g;function dh(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(uh,dh);lt[t]=new Tt(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(uh,dh);lt[t]=new Tt(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(uh,dh);lt[t]=new Tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){lt[e]=new Tt(e,1,!1,e.toLowerCase(),null,!1,!1)});lt.xlinkHref=new Tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){lt[e]=new Tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ch(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")&&(vP(t,a,o,r)&&(a=null),r||o===null?yP(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 dr=hP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qu=Symbol.for("react.element"),Un=Symbol.for("react.portal"),Vn=Symbol.for("react.fragment"),fh=Symbol.for("react.strict_mode"),xm=Symbol.for("react.profiler"),Uv=Symbol.for("react.provider"),Vv=Symbol.for("react.context"),ph=Symbol.for("react.forward_ref"),vm=Symbol.for("react.suspense"),wm=Symbol.for("react.suspense_list"),mh=Symbol.for("react.memo"),Dr=Symbol.for("react.lazy"),jv=Symbol.for("react.offscreen"),Mx=Symbol.iterator;function Fi(e){return e===null||typeof e!="object"?null:(e=Mx&&e[Mx]||e["@@iterator"],typeof e=="function"?e:null)}var De=Object.assign,Xp;function $i(e){if(Xp===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Xp=t&&t[1]||""}return`
|
|
2
|
+
`+Xp+e}var Qp=!1;function Jp(e,t){if(!e||Qp)return"";Qp=!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
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{Jp=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?Wi(e):""}function xP(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 Sm(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 qn:return"Fragment";case jn:return"Portal";case vm:return"Profiler";case ph:return"StrictMode";case wm:return"Suspense";case Cm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Vv:return(e.displayName||"Context")+".Consumer";case Uv: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:Sm(e.type)||"Memo";case Or:t=e._payload,e=e._init;try{return Sm(e(t))}catch{}}return null}function vP(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 Sm(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 Qr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wP(e){var t=qv(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=wP(e))}function Hv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=qv(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 Me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Nx(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Qr(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 zv(e,t){t=t.checked,t!=null&&fh(e,"checked",t,!1)}function Im(e,t){zv(e,t);var a=Qr(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")?bm(e,t.type,a):t.hasOwnProperty("defaultValue")&&bm(e,t.type,Qr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ox(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 bm(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 Zn(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=""+Qr(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 Me({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fx(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:Qr(a)}}function $v(e,t){var a=Qr(t.value),r=Qr(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 Bx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Wv(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"?Wv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zu,Gv=(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},CP=["Webkit","ms","Moz","O"];Object.keys(Qi).forEach(function(e){CP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qi[t]=Qi[e]})});function Kv(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 Xv(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Kv(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var SP=Me({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(SP[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,es=null,ts=null;function Ux(e){if(e=Il(e)){if(typeof _m!="function")throw Error(_(280));var t=e.stateNode;t&&(t=ec(t),_m(e.stateNode,e.type,t))}}function Qv(e){es?ts?ts.push(e):ts=[e]:es=e}function Jv(){if(es){var e=es,t=ts;if(ts=es=null,Ux(e),t)for(e=0;e<t.length;e++)Ux(t[e])}}function Yv(e,t){return e(t)}function Zv(){}var Zp=!1;function e0(e,t,a){if(Zp)return e(t,a);Zp=!0;try{return Yv(e,t,a)}finally{Zp=!1,(es!==null||ts!==null)&&(Zv(),Jv())}}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(nr)try{Un={},Object.defineProperty(Un,"passive",{get:function(){Em=!0}}),window.addEventListener("test",Un,Un),window.removeEventListener("test",Un,Un)}catch{Em=!1}var Un;function LP(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,IP={onError:function(e){Ji=!0,Pd=e}};function bP(e,t,a,r,o,n,s,i,l){Ji=!1,Pd=null,LP.apply(IP,arguments)}function kP(e,t,a,r,o,n,s,i,l){if(bP.apply(this,arguments),Ji){if(Ji){var u=Pd;Ji=!1,Pd=null}else throw Error(_(198));Td||(Td=!0,Dm=u)}}function Wo(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 t0(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 Vx(e){if(Wo(e)!==e)throw Error(_(188))}function PP(e){var t=e.alternate;if(!t){if(t=Wo(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 Vx(o),e;if(n===r)return Vx(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 a0(e){return e=PP(e),e!==null?r0(e):null}function r0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=r0(e);if(t!==null)return t;e=e.sibling}return null}var o0=Kt.unstable_scheduleCallback,jx=Kt.unstable_cancelCallback,TP=Kt.unstable_shouldYield,AP=Kt.unstable_requestPaint,Ve=Kt.unstable_now,RP=Kt.unstable_getCurrentPriorityLevel,yh=Kt.unstable_ImmediatePriority,n0=Kt.unstable_UserBlockingPriority,Ad=Kt.unstable_NormalPriority,_P=Kt.unstable_LowPriority,s0=Kt.unstable_IdlePriority,Qd=null,Ma=null;function EP(e){if(Ma&&typeof Ma.onCommitFiberRoot=="function")try{Ma.onCommitFiberRoot(Qd,e,void 0,(e.current.flags&128)===128)}catch{}}var La=Math.clz32?Math.clz32:NP,DP=Math.log,MP=Math.LN2;function NP(e){return e>>>=0,e===0?32:31-(DP(e)/MP|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-La(t),o=1<<a,r|=e[a],t&=~o;return r}function OP(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 FP(e,t){for(var a=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,n=e.pendingLanes;0<n;){var s=31-La(n),i=1<<s,l=o[s];l===-1?((i&a)===0||(i&r)!==0)&&(o[s]=OP(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 i0(){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 Sl(e,t,a){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-La(t),e[t]=a}function BP(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-La(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-La(a),o=1<<r;o&t|e[r]&t&&(e[r]|=t),a&=~o}}var he=0;function l0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var u0,vh,d0,c0,f0,Nm=!1,ad=[],qr=null,Hr=null,zr=null,ll=new Map,ul=new Map,Br=[],UP="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 qx(e,t){switch(e){case"focusin":case"focusout":qr=null;break;case"dragenter":case"dragleave":Hr=null;break;case"mouseover":case"mouseout":zr=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=Il(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function VP(e,t,a,r,o){switch(t){case"focusin":return qr=Ui(qr,e,t,a,r,o),!0;case"dragenter":return Hr=Ui(Hr,e,t,a,r,o),!0;case"mouseover":return zr=Ui(zr,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 p0(e){var t=No(e.target);if(t!==null){var a=Wo(t);if(a!==null){if(t=a.tag,t===13){if(t=t0(a),t!==null){e.blockedOn=t,f0(e.priority,function(){d0(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=Il(a),t!==null&&vh(t),e.blockedOn=a,!1;t.shift()}return!0}function Hx(e,t,a){gd(e)&&a.delete(t)}function jP(){Nm=!1,qr!==null&&gd(qr)&&(qr=null),Hr!==null&&gd(Hr)&&(Hr=null),zr!==null&&gd(zr)&&(zr=null),ll.forEach(Hx),ul.forEach(Hx)}function Vi(e,t){e.blockedOn===t&&(e.blockedOn=null,Nm||(Nm=!0,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,jP)))}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(qr!==null&&Vi(qr,e),Hr!==null&&Vi(Hr,e),zr!==null&&Vi(zr,e),ll.forEach(t),ul.forEach(t),a=0;a<Br.length;a++)r=Br[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<Br.length&&(a=Br[0],a.blockedOn===null);)p0(a),a.blockedOn===null&&Br.shift()}var as=ur.ReactCurrentBatchConfig,_d=!0;function qP(e,t,a,r){var o=he,n=as.transition;as.transition=null;try{he=1,wh(e,t,a,r)}finally{he=o,as.transition=n}}function HP(e,t,a,r){var o=he,n=as.transition;as.transition=null;try{he=4,wh(e,t,a,r)}finally{he=o,as.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),qx(e,r);else if(VP(o,e,t,a,r))r.stopPropagation();else if(qx(e,r),t&4&&-1<UP.indexOf(e)){for(;o!==null;){var n=Il(o);if(n!==null&&u0(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=No(e),e!==null)if(t=Wo(e),t===null)e=null;else if(a=t.tag,a===13){if(e=t0(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 m0(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(RP()){case yh:return 1;case n0:return 4;case Ad:case _P:return 16;case s0:return 536870912;default:return 16}default:return 16}}var Vr=null,Ch=null,yd=null;function h0(){if(yd)return yd;var e,t=Ch,a=t.length,r,o="value"in Vr?Vr.value:Vr.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 zx(){return!1}function Xt(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:zx,this.isPropagationStopped=zx,this}return Me(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 fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sh=Xt(fs),Ll=Me({},fs,{view:0,detail:0}),zP=Xt(Ll),tm,am,ji,Jd=Me({},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}}),$x=Xt(Jd),$P=Me({},Jd,{dataTransfer:0}),WP=Xt($P),GP=Me({},Ll,{relatedTarget:0}),rm=Xt(GP),KP=Me({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),XP=Xt(KP),QP=Me({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),JP=Xt(QP),YP=Me({},fs,{data:0}),Wx=Xt(YP),ZP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eT={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"},tT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function aT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tT[e])?!!t[e]:!1}function Lh(){return aT}var rT=Me({},Ll,{key:function(e){if(e.key){var t=ZP[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"?eT[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}}),oT=Xt(rT),nT=Me({},Jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gx=Xt(nT),sT=Me({},Ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Lh}),iT=Xt(sT),lT=Me({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),uT=Xt(lT),dT=Me({},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}),cT=Xt(dT),fT=[9,13,27,32],Ih=nr&&"CompositionEvent"in window,Yi=null;nr&&"documentMode"in document&&(Yi=document.documentMode);var pT=nr&&"TextEvent"in window&&!Yi,g0=nr&&(!Ih||Yi&&8<Yi&&11>=Yi),Kx=" ",Xx=!1;function y0(e,t){switch(e){case"keyup":return fT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function x0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hn=!1;function mT(e,t){switch(e){case"compositionend":return x0(t);case"keypress":return t.which!==32?null:(Xx=!0,Kx);case"textInput":return e=t.data,e===Kx&&Xx?null:e;default:return null}}function hT(e,t){if(Hn)return e==="compositionend"||!Ih&&y0(e,t)?(e=h0(),yd=Ch=Vr=null,Hn=!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 g0&&t.locale!=="ko"?null:t.data;default:return null}}var gT={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 Qx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gT[e.type]:t==="textarea"}function v0(e,t,a,r){Qv(r),t=Dd(t,"onChange"),0<t.length&&(a=new Sh("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Zi=null,cl=null;function yT(e){R0(e,0)}function Yd(e){var t=Wn(e);if(Hv(t))return e}function xT(e,t){if(e==="change")return t}var w0=!1;nr&&(nr?(nd="oninput"in document,nd||(om=document.createElement("div"),om.setAttribute("oninput","return;"),nd=typeof om.oninput=="function"),od=nd):od=!1,w0=od&&(!document.documentMode||9<document.documentMode));var od,nd,om;function Jx(){Zi&&(Zi.detachEvent("onpropertychange",C0),cl=Zi=null)}function C0(e){if(e.propertyName==="value"&&Yd(cl)){var t=[];v0(t,cl,e,gh(e)),e0(yT,t)}}function vT(e,t,a){e==="focusin"?(Jx(),Zi=t,cl=a,Zi.attachEvent("onpropertychange",C0)):e==="focusout"&&Jx()}function wT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yd(cl)}function CT(e,t){if(e==="click")return Yd(t)}function ST(e,t){if(e==="input"||e==="change")return Yd(t)}function LT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ba=typeof Object.is=="function"?Object.is:LT;function fl(e,t){if(ba(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)||!ba(e[o],t[o]))return!1}return!0}function Yx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zx(e,t){var a=Yx(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=Yx(a)}}function S0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?S0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function L0(){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 bh(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 IT(e){var t=L0(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&S0(a.ownerDocument.documentElement,a)){if(r!==null&&bh(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=Zx(a,n);var s=Zx(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 bT=nr&&"documentMode"in document&&11>=document.documentMode,zn=null,Fm=null,el=null,Bm=!1;function ev(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Bm||zn==null||zn!==kd(r)||(r=zn,"selectionStart"in r&&bh(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 Sh("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=zn)))}function sd(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var $n={animationend:sd("Animation","AnimationEnd"),animationiteration:sd("Animation","AnimationIteration"),animationstart:sd("Animation","AnimationStart"),transitionend:sd("Transition","TransitionEnd")},nm={},I0={};nr&&(I0=document.createElement("div").style,"AnimationEvent"in window||(delete $n.animationend.animation,delete $n.animationiteration.animation,delete $n.animationstart.animation),"TransitionEvent"in window||delete $n.transitionend.transition);function Zd(e){if(nm[e])return nm[e];if(!$n[e])return e;var t=$n[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in I0)return nm[e]=t[a];return e}var b0=Zd("animationend"),k0=Zd("animationiteration"),P0=Zd("animationstart"),T0=Zd("transitionend"),A0=new Map,tv="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 Yr(e,t){A0.set(e,t),$o(t,[e])}for(id=0;id<tv.length;id++)ld=tv[id],av=ld.toLowerCase(),rv=ld[0].toUpperCase()+ld.slice(1),Yr(av,"on"+rv);var ld,av,rv,id;Yr(b0,"onAnimationEnd");Yr(k0,"onAnimationIteration");Yr(P0,"onAnimationStart");Yr("dblclick","onDoubleClick");Yr("focusin","onFocus");Yr("focusout","onBlur");Yr(T0,"onTransitionEnd");ns("onMouseEnter",["mouseout","mouseover"]);ns("onMouseLeave",["mouseout","mouseover"]);ns("onPointerEnter",["pointerout","pointerover"]);ns("onPointerLeave",["pointerout","pointerover"]);$o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$o("onBeforeInput",["compositionend","keypress","textInput","paste"]);$o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$o("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(" "),kT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xi));function ov(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,kP(r,t,void 0,e),e.currentTarget=null}function R0(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;ov(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;ov(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)||(_0(t,e,2,!1),a.add(r))}function sm(e,t,a){var r=0;t&&(r|=4),_0(a,e,r,t)}var ud="_reactListening"+Math.random().toString(36).slice(2);function pl(e){if(!e[ud]){e[ud]=!0,Bv.forEach(function(a){a!=="selectionchange"&&(kT.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 _0(e,t,a,r){switch(m0(t)){case 1:var o=qP;break;case 4:o=HP;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=No(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}e0(function(){var u=n,d=gh(a),c=[];e:{var f=A0.get(e);if(f!==void 0){var m=Sh,x=e;switch(e){case"keypress":if(xd(a)===0)break e;case"keydown":case"keyup":m=oT;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=$x;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=WP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=iT;break;case b0:case k0:case P0:m=XP;break;case T0:m=uT;break;case"scroll":m=zP;break;case"wheel":m=cT;break;case"copy":case"cut":case"paste":m=JP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Gx}var C=(t&4)!==0,L=!C&&e==="scroll",h=C?f!==null?f+"Capture":null:f;C=[];for(var y=u,g;y!==null;){g=y;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,h!==null&&(w=il(y,h),w!=null&&C.push(ml(y,w,g)))),L)break;y=y.return}0<C.length&&(f=new m(f,x,null,a,d),c.push({event:f,listeners:C}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&a!==Rm&&(x=a.relatedTarget||a.fromElement)&&(No(x)||x[sr]))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?No(x):null,x!==null&&(L=Wo(x),x!==L||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=u),m!==x)){if(C=$x,w="onMouseLeave",h="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(C=Gx,w="onPointerLeave",h="onPointerEnter",y="pointer"),L=m==null?f:Wn(m),g=x==null?f:Wn(x),f=new C(w,y+"leave",m,a,d),f.target=L,f.relatedTarget=g,w=null,No(d)===u&&(C=new C(h,y+"enter",x,a,d),C.target=g,C.relatedTarget=L,w=C),L=w,m&&x)t:{for(C=m,h=x,y=0,g=C;g;g=Vn(g))y++;for(g=0,w=h;w;w=Vn(w))g++;for(;0<y-g;)C=Vn(C),y--;for(;0<g-y;)h=Vn(h),g--;for(;y--;){if(C===h||h!==null&&C===h.alternate)break t;C=Vn(C),h=Vn(h)}C=null}else C=null;m!==null&&nv(c,f,m,C,!1),x!==null&&L!==null&&nv(c,L,x,C,!0)}}e:{if(f=u?Wn(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var I=xT;else if(Qx(f))if(w0)I=ST;else{I=wT;var P=vT}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(I=CT);if(I&&(I=I(e,u))){v0(c,I,a,d);break e}P&&P(e,f,u),e==="focusout"&&(P=f._wrapperState)&&P.controlled&&f.type==="number"&&bm(f,"number",f.value)}switch(P=u?Wn(u):window,e){case"focusin":(Qx(P)||P.contentEditable==="true")&&(zn=P,Fm=u,el=null);break;case"focusout":el=Fm=zn=null;break;case"mousedown":Bm=!0;break;case"contextmenu":case"mouseup":case"dragend":Bm=!1,ev(c,a,d);break;case"selectionchange":if(bT)break;case"keydown":case"keyup":ev(c,a,d)}var A;if(Ih)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 Hn?y0(e,a)&&(R="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(R="onCompositionStart");R&&(g0&&a.locale!=="ko"&&(Hn||R!=="onCompositionStart"?R==="onCompositionEnd"&&Hn&&(A=h0()):(Vr=d,Ch="value"in Vr?Vr.value:Vr.textContent,Hn=!0)),P=Dd(u,R),0<P.length&&(R=new Wx(R,e,null,a,d),c.push({event:R,listeners:P}),A?R.data=A:(A=x0(a),A!==null&&(R.data=A)))),(A=pT?mT(e,a):hT(e,a))&&(u=Dd(u,"onBeforeInput"),0<u.length&&(d=new Wx("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=A))}R0(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 Vn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function nv(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 PT=/\r\n?/g,TT=/\u0000|\uFFFD/g;function sv(e){return(typeof e=="string"?e:""+e).replace(PT,`
|
|
6
|
-
`).replace(TT,"")}function dd(e,t,a){if(t=sv(t),sv(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,AT=typeof clearTimeout=="function"?clearTimeout:void 0,iv=typeof Promise=="function"?Promise:void 0,RT=typeof queueMicrotask=="function"?queueMicrotask:typeof iv<"u"?function(e){return iv.resolve(null).then(e).catch(_T)}:qm;function _T(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 $r(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 lv(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 ps=Math.random().toString(36).slice(2),Da="__reactFiber$"+ps,hl="__reactProps$"+ps,sr="__reactContainer$"+ps,Hm="__reactEvents$"+ps,ET="__reactListeners$"+ps,DT="__reactHandles$"+ps;function No(e){var t=e[Da];if(t)return t;for(var a=e.parentNode;a;){if(t=a[sr]||a[Da]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=lv(e);e!==null;){if(a=e[Da])return a;e=lv(e)}return t}e=a,a=e.parentNode}return null}function Il(e){return e=e[Da]||e[sr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Wn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function ec(e){return e[hl]||null}var zm=[],Gn=-1;function Zr(e){return{current:e}}function ke(e){0>Gn||(e.current=zm[Gn],zm[Gn]=null,Gn--)}function we(e,t){Gn++,zm[Gn]=e.current,e.current=t}var Jr={},vt=Zr(Jr),Dt=Zr(!1),Vo=Jr;function ss(e,t){var a=e.type.contextTypes;if(!a)return Jr;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 Mt(e){return e=e.childContextTypes,e!=null}function Nd(){ke(Dt),ke(vt)}function uv(e,t,a){if(vt.current!==Jr)throw Error(_(168));we(vt,t),we(Dt,a)}function E0(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,vP(e)||"Unknown",o));return Me({},a,r)}function Od(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jr,Vo=vt.current,we(vt,e),we(Dt,Dt.current),!0}function dv(e,t,a){var r=e.stateNode;if(!r)throw Error(_(169));a?(e=E0(e,t,Vo),r.__reactInternalMemoizedMergedChildContext=e,ke(Dt),ke(vt),we(vt,e)):ke(Dt),we(Dt,a)}var tr=null,tc=!1,um=!1;function D0(e){tr===null?tr=[e]:tr.push(e)}function MT(e){tc=!0,D0(e)}function eo(){if(!um&&tr!==null){um=!0;var e=0,t=he;try{var a=tr;for(he=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}tr=null,tc=!1}catch(o){throw tr!==null&&(tr=tr.slice(e+1)),o0(yh,eo),o}finally{he=t,um=!1}}return null}var Kn=[],Xn=0,Fd=null,Bd=0,ia=[],la=0,jo=null,ar=1,rr="";function Do(e,t){Kn[Xn++]=Bd,Kn[Xn++]=Fd,Fd=e,Bd=t}function M0(e,t,a){ia[la++]=ar,ia[la++]=rr,ia[la++]=jo,jo=e;var r=ar;e=rr;var o=32-La(r)-1;r&=~(1<<o),a+=1;var n=32-La(t)+o;if(30<n){var s=o-o%5;n=(r&(1<<s)-1).toString(32),r>>=s,o-=s,ar=1<<32-La(t)+o|a<<o|r,rr=n+e}else ar=1<<n|a<<o|r,rr=e}function kh(e){e.return!==null&&(Do(e,1),M0(e,1,0))}function Ph(e){for(;e===Fd;)Fd=Kn[--Xn],Kn[Xn]=null,Bd=Kn[--Xn],Kn[Xn]=null;for(;e===jo;)jo=ia[--la],ia[la]=null,rr=ia[--la],ia[la]=null,ar=ia[--la],ia[la]=null}var Gt=null,Wt=null,_e=!1,Sa=null;function N0(e,t){var a=ua(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 cv(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,Gt=e,Wt=$r(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gt=e,Wt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=jo!==null?{id:ar,overflow:rr}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=ua(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Gt=e,Wt=null,!0):!1;default:return!1}}function $m(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wm(e){if(_e){var t=Wt;if(t){var a=t;if(!cv(e,t)){if($m(e))throw Error(_(418));t=$r(a.nextSibling);var r=Gt;t&&cv(e,t)?N0(r,a):(e.flags=e.flags&-4097|2,_e=!1,Gt=e)}}else{if($m(e))throw Error(_(418));e.flags=e.flags&-4097|2,_e=!1,Gt=e}}}function fv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function cd(e){if(e!==Gt)return!1;if(!_e)return fv(e),_e=!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=Wt)){if($m(e))throw O0(),Error(_(418));for(;t;)N0(e,t),t=$r(t.nextSibling)}if(fv(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){Wt=$r(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}Wt=null}}else Wt=Gt?$r(e.stateNode.nextSibling):null;return!0}function O0(){for(var e=Wt;e;)e=$r(e.nextSibling)}function is(){Wt=Gt=null,_e=!1}function Th(e){Sa===null?Sa=[e]:Sa.push(e)}var NT=ur.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 pv(e){var t=e._init;return t(e._payload)}function F0(e){function t(h,y){if(e){var g=h.deletions;g===null?(h.deletions=[y],h.flags|=16):g.push(y)}}function a(h,y){if(!e)return null;for(;y!==null;)t(h,y),y=y.sibling;return null}function r(h,y){for(h=new Map;y!==null;)y.key!==null?h.set(y.key,y):h.set(y.index,y),y=y.sibling;return h}function o(h,y){return h=Xr(h,y),h.index=0,h.sibling=null,h}function n(h,y,g){return h.index=g,e?(g=h.alternate,g!==null?(g=g.index,g<y?(h.flags|=2,y):g):(h.flags|=2,y)):(h.flags|=1048576,y)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function i(h,y,g,w){return y===null||y.tag!==6?(y=gm(g,h.mode,w),y.return=h,y):(y=o(y,g),y.return=h,y)}function l(h,y,g,w){var I=g.type;return I===qn?d(h,y,g.props.children,w,g.key):y!==null&&(y.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Or&&pv(I)===y.type)?(w=o(y,g.props),w.ref=qi(h,y,g),w.return=h,w):(w=bd(g.type,g.key,g.props,null,h.mode,w),w.ref=qi(h,y,g),w.return=h,w)}function u(h,y,g,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=ym(g,h.mode,w),y.return=h,y):(y=o(y,g.children||[]),y.return=h,y)}function d(h,y,g,w,I){return y===null||y.tag!==7?(y=Uo(g,h.mode,w,I),y.return=h,y):(y=o(y,g),y.return=h,y)}function c(h,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=gm(""+y,h.mode,g),y.return=h,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ju:return g=bd(y.type,y.key,y.props,null,h.mode,g),g.ref=qi(h,null,y),g.return=h,g;case jn:return y=ym(y,h.mode,g),y.return=h,y;case Or:var w=y._init;return c(h,w(y._payload),g)}if(Gi(y)||Bi(y))return y=Uo(y,h.mode,g,null),y.return=h,y;fd(h,y)}return null}function f(h,y,g,w){var I=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return I!==null?null:i(h,y,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ju:return g.key===I?l(h,y,g,w):null;case jn:return g.key===I?u(h,y,g,w):null;case Or:return I=g._init,f(h,y,I(g._payload),w)}if(Gi(g)||Bi(g))return I!==null?null:d(h,y,g,w,null);fd(h,g)}return null}function m(h,y,g,w,I){if(typeof w=="string"&&w!==""||typeof w=="number")return h=h.get(g)||null,i(y,h,""+w,I);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ju:return h=h.get(w.key===null?g:w.key)||null,l(y,h,w,I);case jn:return h=h.get(w.key===null?g:w.key)||null,u(y,h,w,I);case Or:var P=w._init;return m(h,y,g,P(w._payload),I)}if(Gi(w)||Bi(w))return h=h.get(g)||null,d(y,h,w,I,null);fd(y,w)}return null}function x(h,y,g,w){for(var I=null,P=null,A=y,R=y=0,q=null;A!==null&&R<g.length;R++){A.index>R?(q=A,A=null):q=A.sibling;var U=f(h,A,g[R],w);if(U===null){A===null&&(A=q);break}e&&A&&U.alternate===null&&t(h,A),y=n(U,y,R),P===null?I=U:P.sibling=U,P=U,A=q}if(R===g.length)return a(h,A),_e&&Do(h,R),I;if(A===null){for(;R<g.length;R++)A=c(h,g[R],w),A!==null&&(y=n(A,y,R),P===null?I=A:P.sibling=A,P=A);return _e&&Do(h,R),I}for(A=r(h,A);R<g.length;R++)q=m(A,h,R,g[R],w),q!==null&&(e&&q.alternate!==null&&A.delete(q.key===null?R:q.key),y=n(q,y,R),P===null?I=q:P.sibling=q,P=q);return e&&A.forEach(function(pe){return t(h,pe)}),_e&&Do(h,R),I}function C(h,y,g,w){var I=Bi(g);if(typeof I!="function")throw Error(_(150));if(g=I.call(g),g==null)throw Error(_(151));for(var P=I=null,A=y,R=y=0,q=null,U=g.next();A!==null&&!U.done;R++,U=g.next()){A.index>R?(q=A,A=null):q=A.sibling;var pe=f(h,A,U.value,w);if(pe===null){A===null&&(A=q);break}e&&A&&pe.alternate===null&&t(h,A),y=n(pe,y,R),P===null?I=pe:P.sibling=pe,P=pe,A=q}if(U.done)return a(h,A),_e&&Do(h,R),I;if(A===null){for(;!U.done;R++,U=g.next())U=c(h,U.value,w),U!==null&&(y=n(U,y,R),P===null?I=U:P.sibling=U,P=U);return _e&&Do(h,R),I}for(A=r(h,A);!U.done;R++,U=g.next())U=m(A,h,R,U.value,w),U!==null&&(e&&U.alternate!==null&&A.delete(U.key===null?R:U.key),y=n(U,y,R),P===null?I=U:P.sibling=U,P=U);return e&&A.forEach(function(ue){return t(h,ue)}),_e&&Do(h,R),I}function L(h,y,g,w){if(typeof g=="object"&&g!==null&&g.type===qn&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Ju:e:{for(var I=g.key,P=y;P!==null;){if(P.key===I){if(I=g.type,I===qn){if(P.tag===7){a(h,P.sibling),y=o(P,g.props.children),y.return=h,h=y;break e}}else if(P.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===Or&&pv(I)===P.type){a(h,P.sibling),y=o(P,g.props),y.ref=qi(h,P,g),y.return=h,h=y;break e}a(h,P);break}else t(h,P);P=P.sibling}g.type===qn?(y=Uo(g.props.children,h.mode,w,g.key),y.return=h,h=y):(w=bd(g.type,g.key,g.props,null,h.mode,w),w.ref=qi(h,y,g),w.return=h,h=w)}return s(h);case jn:e:{for(P=g.key;y!==null;){if(y.key===P)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){a(h,y.sibling),y=o(y,g.children||[]),y.return=h,h=y;break e}else{a(h,y);break}else t(h,y);y=y.sibling}y=ym(g,h.mode,w),y.return=h,h=y}return s(h);case Or:return P=g._init,L(h,y,P(g._payload),w)}if(Gi(g))return x(h,y,g,w);if(Bi(g))return C(h,y,g,w);fd(h,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(a(h,y.sibling),y=o(y,g),y.return=h,h=y):(a(h,y),y=gm(g,h.mode,w),y.return=h,h=y),s(h)):a(h,y)}return L}var ls=F0(!0),B0=F0(!1),Ud=Zr(null),Vd=null,Qn=null,Ah=null;function Rh(){Ah=Qn=Vd=null}function _h(e){var t=Ud.current;ke(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 rs(e,t){Vd=e,Ah=Qn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Et=!0),e.firstContext=null)}function ca(e){var t=e._currentValue;if(Ah!==e)if(e={context:e,memoizedValue:t,next:null},Qn===null){if(Vd===null)throw Error(_(308));Qn=e,Vd.dependencies={lanes:0,firstContext:e}}else Qn=Qn.next=e;return t}var Oo=null;function Eh(e){Oo===null?Oo=[e]:Oo.push(e)}function U0(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,ir(e,r)}function ir(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 Fr=!1;function Dh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function V0(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 or(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wr(e,t,a){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(le&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ir(e,a)}return o=r.interleaved,o===null?(t.next=t,Eh(r)):(t.next=o.next,o.next=t),r.interleaved=t,ir(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 mv(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;Fr=!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,C=i;switch(f=t,m=a,C.tag){case 1:if(x=C.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=C.payload,f=typeof x=="function"?x.call(m,c,f):x,f==null)break e;c=Me({},c,f);break e;case 2:Fr=!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);Ho|=s,e.lanes=s,e.memoizedState=c}}function hv(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 bl={},Na=Zr(bl),gl=Zr(bl),yl=Zr(bl);function Fo(e){if(e===bl)throw Error(_(174));return e}function Mh(e,t){switch(we(yl,t),we(gl,e),we(Na,bl),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)}ke(Na),we(Na,t)}function us(){ke(Na),ke(gl),ke(yl)}function j0(e){Fo(yl.current);var t=Fo(Na.current),a=Pm(t,e.type);t!==a&&(we(gl,e),we(Na,a))}function Nh(e){gl.current===e&&(ke(Na),ke(gl))}var Ee=Zr(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=ur.ReactCurrentDispatcher,cm=ur.ReactCurrentBatchConfig,qo=0,De=null,Ge=null,et=null,Hd=!1,tl=!1,xl=0,OT=0;function gt(){throw Error(_(321))}function Fh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ba(e[a],t[a]))return!1;return!0}function Bh(e,t,a,r,o,n){if(qo=n,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,wd.current=e===null||e.memoizedState===null?VT:jT,e=a(r,o),tl){n=0;do{if(tl=!1,xl=0,25<=n)throw Error(_(301));n+=1,et=Ge=null,t.updateQueue=null,wd.current=qT,e=a(r,o)}while(tl)}if(wd.current=zd,t=Ge!==null&&Ge.next!==null,qo=0,et=Ge=De=null,Hd=!1,t)throw Error(_(300));return e}function Uh(){var e=xl!==0;return xl=0,e}function Ea(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?De.memoizedState=et=e:et=et.next=e,et}function fa(){if(Ge===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=et===null?De.memoizedState:et.next;if(t!==null)et=t,Ge=e;else{if(e===null)throw Error(_(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},et===null?De.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=fa(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=Ge,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((qo&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,De.lanes|=d,Ho|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,ba(r,t.memoizedState)||(Et=!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,De.lanes|=n,Ho|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function pm(e){var t=fa(),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);ba(n,t.memoizedState)||(Et=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function q0(){}function H0(e,t){var a=De,r=fa(),o=t(),n=!ba(r.memoizedState,o);if(n&&(r.memoizedState=o,Et=!0),r=r.queue,Vh(W0.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||et!==null&&et.memoizedState.tag&1){if(a.flags|=2048,wl(9,$0.bind(null,a,r,o,t),void 0,null),tt===null)throw Error(_(349));(qo&30)!==0||z0(a,t,o)}return o}function z0(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function $0(e,t,a,r){t.value=a,t.getSnapshot=r,G0(t)&&K0(e)}function W0(e,t,a){return a(function(){G0(t)&&K0(e)})}function G0(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ba(e,a)}catch{return!0}}function K0(e){var t=ir(e,1);t!==null&&Ia(t,e,1,-1)}function gv(e){var t=Ea();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=UT.bind(null,De,e),[t.memoizedState,e]}function wl(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.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 X0(){return fa().memoizedState}function Cd(e,t,a,r){var o=Ea();De.flags|=e,o.memoizedState=wl(1|t,a,void 0,r===void 0?null:r)}function ac(e,t,a,r){var o=fa();r=r===void 0?null:r;var n=void 0;if(Ge!==null){var s=Ge.memoizedState;if(n=s.destroy,r!==null&&Fh(r,s.deps)){o.memoizedState=wl(t,a,n,r);return}}De.flags|=e,o.memoizedState=wl(1|t,a,n,r)}function yv(e,t){return Cd(8390656,8,e,t)}function Vh(e,t){return ac(2048,8,e,t)}function Q0(e,t){return ac(4,2,e,t)}function J0(e,t){return ac(4,4,e,t)}function Y0(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 Z0(e,t,a){return a=a!=null?a.concat([e]):null,ac(4,4,Y0.bind(null,t,e),a)}function jh(){}function ew(e,t){var a=fa();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 tw(e,t){var a=fa();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 aw(e,t,a){return(qo&21)===0?(e.baseState&&(e.baseState=!1,Et=!0),e.memoizedState=a):(ba(a,t)||(a=i0(),De.lanes|=a,Ho|=a,e.baseState=!0),t)}function FT(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 rw(){return fa().memoizedState}function BT(e,t,a){var r=Kr(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},ow(e))nw(t,a);else if(a=U0(e,t,a,r),a!==null){var o=bt();Ia(a,e,r,o),sw(a,t,r)}}function UT(e,t,a){var r=Kr(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(ow(e))nw(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,ba(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=U0(e,t,o,r),a!==null&&(o=bt(),Ia(a,e,r,o),sw(a,t,r))}}function ow(e){var t=e.alternate;return e===De||t!==null&&t===De}function nw(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 sw(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:ca,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},VT={readContext:ca,useCallback:function(e,t){return Ea().memoizedState=[e,t===void 0?null:t],e},useContext:ca,useEffect:yv,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,Cd(4194308,4,Y0.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Cd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cd(4,2,e,t)},useMemo:function(e,t){var a=Ea();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=Ea();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=BT.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=Ea();return e={current:e},t.memoizedState=e},useState:gv,useDebugValue:jh,useDeferredValue:function(e){return Ea().memoizedState=e},useTransition:function(){var e=gv(!1),t=e[0];return e=FT.bind(null,e[1]),Ea().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=De,o=Ea();if(_e){if(a===void 0)throw Error(_(407));a=a()}else{if(a=t(),tt===null)throw Error(_(349));(qo&30)!==0||z0(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,yv(W0.bind(null,r,n,e),[e]),r.flags|=2048,wl(9,$0.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=Ea(),t=tt.identifierPrefix;if(_e){var a=rr,r=ar;a=(r&~(1<<32-La(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=xl++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=OT++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jT={readContext:ca,useCallback:ew,useContext:ca,useEffect:Vh,useImperativeHandle:Z0,useInsertionEffect:Q0,useLayoutEffect:J0,useMemo:tw,useReducer:fm,useRef:X0,useState:function(){return fm(vl)},useDebugValue:jh,useDeferredValue:function(e){var t=fa();return aw(t,Ge.memoizedState,e)},useTransition:function(){var e=fm(vl)[0],t=fa().memoizedState;return[e,t]},useMutableSource:q0,useSyncExternalStore:H0,useId:rw,unstable_isNewReconciler:!1},qT={readContext:ca,useCallback:ew,useContext:ca,useEffect:Vh,useImperativeHandle:Z0,useInsertionEffect:Q0,useLayoutEffect:J0,useMemo:tw,useReducer:pm,useRef:X0,useState:function(){return pm(vl)},useDebugValue:jh,useDeferredValue:function(e){var t=fa();return Ge===null?t.memoizedState=e:aw(t,Ge.memoizedState,e)},useTransition:function(){var e=pm(vl)[0],t=fa().memoizedState;return[e,t]},useMutableSource:q0,useSyncExternalStore:H0,useId:rw,unstable_isNewReconciler:!1};function wa(e,t){if(e&&e.defaultProps){t=Me({},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:Me({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var rc={isMounted:function(e){return(e=e._reactInternals)?Wo(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=bt(),o=Kr(e),n=or(r,o);n.payload=t,a!=null&&(n.callback=a),t=Wr(e,n,o),t!==null&&(Ia(t,e,o,r),vd(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=bt(),o=Kr(e),n=or(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Wr(e,n,o),t!==null&&(Ia(t,e,o,r),vd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=bt(),r=Kr(e),o=or(a,r);o.tag=2,t!=null&&(o.callback=t),t=Wr(e,o,r),t!==null&&(Ia(t,e,r,a),vd(t,e,r))}};function xv(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 iw(e,t,a){var r=!1,o=Jr,n=t.contextType;return typeof n=="object"&&n!==null?n=ca(n):(o=Mt(t)?Vo:vt.current,r=t.contextTypes,n=(r=r!=null)?ss(e,o):Jr),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 vv(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=ca(n):(n=Mt(t)?Vo:vt.current,o.context=ss(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 ds(e,t){try{var a="",r=t;do a+=xP(r),r=r.return;while(r);var o=a}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{Qp=!1,Error.prepareStackTrace=a}return(e=e?e.displayName||e.name:"")?$i(e):""}function wP(e){switch(e.tag){case 5:return $i(e.type);case 16:return $i("Lazy");case 13:return $i("Suspense");case 19:return $i("SuspenseList");case 0:case 2:case 15:return e=Jp(e.type,!1),e;case 11:return e=Jp(e.type.render,!1),e;case 1:return e=Jp(e.type,!0),e;default:return""}}function Sm(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 Vn:return"Fragment";case Un:return"Portal";case xm:return"Profiler";case fh:return"StrictMode";case vm:return"Suspense";case wm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Vv:return(e.displayName||"Context")+".Consumer";case Uv:return(e._context.displayName||"Context")+".Provider";case ph:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mh:return t=e.displayName||null,t!==null?t:Sm(e.type)||"Memo";case Dr:t=e._payload,e=e._init;try{return Sm(e(t))}catch{}}return null}function SP(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 Sm(t);case 8:return t===fh?"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 Gr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function CP(e){var t=qv(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 Ju(e){e._valueTracker||(e._valueTracker=CP(e))}function Hv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),r="";return e&&(r=qv(e)?e.checked?"true":"false":e.value),e=r,e!==a?(t.setValue(e),!0):!1}function bd(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 Cm(e,t){var a=t.checked;return De({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??e._wrapperState.initialChecked})}function Nx(e,t){var a=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;a=Gr(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 zv(e,t){t=t.checked,t!=null&&ch(e,"checked",t,!1)}function Lm(e,t){zv(e,t);var a=Gr(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,Gr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ox(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"||bd(e.ownerDocument)!==e)&&(a==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+a&&(e.defaultValue=""+a))}var Wi=Array.isArray;function Jn(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=""+Gr(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 bm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return De({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Fx(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(Wi(a)){if(1<a.length)throw Error(_(93));a=a[0]}t=a}t==null&&(t=""),a=t}e._wrapperState={initialValue:Gr(a)}}function $v(e,t){var a=Gr(t.value),r=Gr(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 Bx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Wv(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 km(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Wv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Yu,Gv=(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(Yu=Yu||document.createElement("div"),Yu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Yu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Xi={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},LP=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){LP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function Kv(e,t,a){return t==null||typeof t=="boolean"||t===""?"":a||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function Xv(e,t){e=e.style;for(var a in t)if(t.hasOwnProperty(a)){var r=a.indexOf("--")===0,o=Kv(a,t[a],r);a==="float"&&(a="cssFloat"),r?e.setProperty(a,o):e[a]=o}}var IP=De({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 Pm(e,t){if(t){if(IP[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 Tm(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 Am=null;function hh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rm=null,Yn=null,Zn=null;function Ux(e){if(e=Ll(e)){if(typeof Rm!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Zd(t),Rm(e.stateNode,e.type,t))}}function Qv(e){Yn?Zn?Zn.push(e):Zn=[e]:Yn=e}function Jv(){if(Yn){var e=Yn,t=Zn;if(Zn=Yn=null,Ux(e),t)for(e=0;e<t.length;e++)Ux(t[e])}}function Yv(e,t){return e(t)}function Zv(){}var Yp=!1;function e0(e,t,a){if(Yp)return e(t,a);Yp=!0;try{return Yv(e,t,a)}finally{Yp=!1,(Yn!==null||Zn!==null)&&(Zv(),Jv())}}function sl(e,t){var a=e.stateNode;if(a===null)return null;var r=Zd(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 _m=!1;if(sr)try{Fn={},Object.defineProperty(Fn,"passive",{get:function(){_m=!0}}),window.addEventListener("test",Fn,Fn),window.removeEventListener("test",Fn,Fn)}catch{_m=!1}var Fn;function bP(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 Qi=!1,kd=null,Pd=!1,Em=null,kP={onError:function(e){Qi=!0,kd=e}};function PP(e,t,a,r,o,n,s,i,l){Qi=!1,kd=null,bP.apply(kP,arguments)}function TP(e,t,a,r,o,n,s,i,l){if(PP.apply(this,arguments),Qi){if(Qi){var u=kd;Qi=!1,kd=null}else throw Error(_(198));Pd||(Pd=!0,Em=u)}}function Ho(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 t0(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 Vx(e){if(Ho(e)!==e)throw Error(_(188))}function AP(e){var t=e.alternate;if(!t){if(t=Ho(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 Vx(o),e;if(n===r)return Vx(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 a0(e){return e=AP(e),e!==null?r0(e):null}function r0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=r0(e);if(t!==null)return t;e=e.sibling}return null}var o0=Kt.unstable_scheduleCallback,jx=Kt.unstable_cancelCallback,RP=Kt.unstable_shouldYield,_P=Kt.unstable_requestPaint,Ue=Kt.unstable_now,EP=Kt.unstable_getCurrentPriorityLevel,gh=Kt.unstable_ImmediatePriority,n0=Kt.unstable_UserBlockingPriority,Td=Kt.unstable_NormalPriority,DP=Kt.unstable_LowPriority,s0=Kt.unstable_IdlePriority,Xd=null,Oa=null;function MP(e){if(Oa&&typeof Oa.onCommitFiberRoot=="function")try{Oa.onCommitFiberRoot(Xd,e,void 0,(e.current.flags&128)===128)}catch{}}var Ia=Math.clz32?Math.clz32:FP,NP=Math.log,OP=Math.LN2;function FP(e){return e>>>=0,e===0?32:31-(NP(e)/OP|0)|0}var Zu=64,ed=4194304;function Gi(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 Ad(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=Gi(i):(n&=s,n!==0&&(r=Gi(n)))}else s=a&~o,s!==0?r=Gi(s):n!==0&&(r=Gi(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 BP(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 UP(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]=BP(i,t)):l<=t&&(e.expiredLanes|=i),n&=~i}}function Dm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function i0(){var e=Zu;return Zu<<=1,(Zu&4194240)===0&&(Zu=64),e}function Zp(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Sl(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 VP(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 yh(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 l0(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var u0,xh,d0,c0,f0,Mm=!1,td=[],Ur=null,Vr=null,jr=null,il=new Map,ll=new Map,Nr=[],jP="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 qx(e,t){switch(e){case"focusin":case"focusout":Ur=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":jr=null;break;case"pointerover":case"pointerout":il.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ll.delete(t.pointerId)}}function Bi(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=Ll(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function qP(e,t,a,r,o){switch(t){case"focusin":return Ur=Bi(Ur,e,t,a,r,o),!0;case"dragenter":return Vr=Bi(Vr,e,t,a,r,o),!0;case"mouseover":return jr=Bi(jr,e,t,a,r,o),!0;case"pointerover":var n=o.pointerId;return il.set(n,Bi(il.get(n)||null,e,t,a,r,o)),!0;case"gotpointercapture":return n=o.pointerId,ll.set(n,Bi(ll.get(n)||null,e,t,a,r,o)),!0}return!1}function p0(e){var t=Eo(e.target);if(t!==null){var a=Ho(t);if(a!==null){if(t=a.tag,t===13){if(t=t0(a),t!==null){e.blockedOn=t,f0(e.priority,function(){d0(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 hd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Nm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(a===null){a=e.nativeEvent;var r=new a.constructor(a.type,a);Am=r,a.target.dispatchEvent(r),Am=null}else return t=Ll(a),t!==null&&xh(t),e.blockedOn=a,!1;t.shift()}return!0}function Hx(e,t,a){hd(e)&&a.delete(t)}function HP(){Mm=!1,Ur!==null&&hd(Ur)&&(Ur=null),Vr!==null&&hd(Vr)&&(Vr=null),jr!==null&&hd(jr)&&(jr=null),il.forEach(Hx),ll.forEach(Hx)}function Ui(e,t){e.blockedOn===t&&(e.blockedOn=null,Mm||(Mm=!0,Kt.unstable_scheduleCallback(Kt.unstable_NormalPriority,HP)))}function ul(e){function t(o){return Ui(o,e)}if(0<td.length){Ui(td[0],e);for(var a=1;a<td.length;a++){var r=td[a];r.blockedOn===e&&(r.blockedOn=null)}}for(Ur!==null&&Ui(Ur,e),Vr!==null&&Ui(Vr,e),jr!==null&&Ui(jr,e),il.forEach(t),ll.forEach(t),a=0;a<Nr.length;a++)r=Nr[a],r.blockedOn===e&&(r.blockedOn=null);for(;0<Nr.length&&(a=Nr[0],a.blockedOn===null);)p0(a),a.blockedOn===null&&Nr.shift()}var es=dr.ReactCurrentBatchConfig,Rd=!0;function zP(e,t,a,r){var o=he,n=es.transition;es.transition=null;try{he=1,vh(e,t,a,r)}finally{he=o,es.transition=n}}function $P(e,t,a,r){var o=he,n=es.transition;es.transition=null;try{he=4,vh(e,t,a,r)}finally{he=o,es.transition=n}}function vh(e,t,a,r){if(Rd){var o=Nm(e,t,a,r);if(o===null)sm(e,t,r,_d,a),qx(e,r);else if(qP(o,e,t,a,r))r.stopPropagation();else if(qx(e,r),t&4&&-1<jP.indexOf(e)){for(;o!==null;){var n=Ll(o);if(n!==null&&u0(n),n=Nm(e,t,a,r),n===null&&sm(e,t,r,_d,a),n===o)break;o=n}o!==null&&r.stopPropagation()}else sm(e,t,r,null,a)}}var _d=null;function Nm(e,t,a,r){if(_d=null,e=hh(r),e=Eo(e),e!==null)if(t=Ho(e),t===null)e=null;else if(a=t.tag,a===13){if(e=t0(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 _d=e,null}function m0(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(EP()){case gh:return 1;case n0:return 4;case Td:case DP:return 16;case s0:return 536870912;default:return 16}default:return 16}}var Fr=null,wh=null,gd=null;function h0(){if(gd)return gd;var e,t=wh,a=t.length,r,o="value"in Fr?Fr.value:Fr.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 gd=o.slice(e,1<r?1-r:void 0)}function yd(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 ad(){return!0}function zx(){return!1}function Xt(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)?ad:zx,this.isPropagationStopped=zx,this}return De(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=ad)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ad)},persist:function(){},isPersistent:ad}),t}var ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sh=Xt(ds),Cl=De({},ds,{view:0,detail:0}),WP=Xt(Cl),em,tm,Vi,Qd=De({},Cl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ch,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!==Vi&&(Vi&&e.type==="mousemove"?(em=e.screenX-Vi.screenX,tm=e.screenY-Vi.screenY):tm=em=0,Vi=e),em)},movementY:function(e){return"movementY"in e?e.movementY:tm}}),$x=Xt(Qd),GP=De({},Qd,{dataTransfer:0}),KP=Xt(GP),XP=De({},Cl,{relatedTarget:0}),am=Xt(XP),QP=De({},ds,{animationName:0,elapsedTime:0,pseudoElement:0}),JP=Xt(QP),YP=De({},ds,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ZP=Xt(YP),eT=De({},ds,{data:0}),Wx=Xt(eT),tT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aT={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"},rT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rT[e])?!!t[e]:!1}function Ch(){return oT}var nT=De({},Cl,{key:function(e){if(e.key){var t=tT[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=yd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?aT[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ch,charCode:function(e){return e.type==="keypress"?yd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sT=Xt(nT),iT=De({},Qd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gx=Xt(iT),lT=De({},Cl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ch}),uT=Xt(lT),dT=De({},ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),cT=Xt(dT),fT=De({},Qd,{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}),pT=Xt(fT),mT=[9,13,27,32],Lh=sr&&"CompositionEvent"in window,Ji=null;sr&&"documentMode"in document&&(Ji=document.documentMode);var hT=sr&&"TextEvent"in window&&!Ji,g0=sr&&(!Lh||Ji&&8<Ji&&11>=Ji),Kx=" ",Xx=!1;function y0(e,t){switch(e){case"keyup":return mT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function x0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jn=!1;function gT(e,t){switch(e){case"compositionend":return x0(t);case"keypress":return t.which!==32?null:(Xx=!0,Kx);case"textInput":return e=t.data,e===Kx&&Xx?null:e;default:return null}}function yT(e,t){if(jn)return e==="compositionend"||!Lh&&y0(e,t)?(e=h0(),gd=wh=Fr=null,jn=!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 g0&&t.locale!=="ko"?null:t.data;default:return null}}var xT={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 Qx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!xT[e.type]:t==="textarea"}function v0(e,t,a,r){Qv(r),t=Ed(t,"onChange"),0<t.length&&(a=new Sh("onChange","change",null,a,r),e.push({event:a,listeners:t}))}var Yi=null,dl=null;function vT(e){R0(e,0)}function Jd(e){var t=zn(e);if(Hv(t))return e}function wT(e,t){if(e==="change")return t}var w0=!1;sr&&(sr?(od="oninput"in document,od||(rm=document.createElement("div"),rm.setAttribute("oninput","return;"),od=typeof rm.oninput=="function"),rd=od):rd=!1,w0=rd&&(!document.documentMode||9<document.documentMode));var rd,od,rm;function Jx(){Yi&&(Yi.detachEvent("onpropertychange",S0),dl=Yi=null)}function S0(e){if(e.propertyName==="value"&&Jd(dl)){var t=[];v0(t,dl,e,hh(e)),e0(vT,t)}}function ST(e,t,a){e==="focusin"?(Jx(),Yi=t,dl=a,Yi.attachEvent("onpropertychange",S0)):e==="focusout"&&Jx()}function CT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jd(dl)}function LT(e,t){if(e==="click")return Jd(t)}function IT(e,t){if(e==="input"||e==="change")return Jd(t)}function bT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ka=typeof Object.is=="function"?Object.is:bT;function cl(e,t){if(ka(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(!ym.call(t,o)||!ka(e[o],t[o]))return!1}return!0}function Yx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zx(e,t){var a=Yx(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=Yx(a)}}function C0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function L0(){for(var e=window,t=bd();t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=bd(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 kT(e){var t=L0(),a=e.focusedElem,r=e.selectionRange;if(t!==a&&a&&a.ownerDocument&&C0(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=Zx(a,n);var s=Zx(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 PT=sr&&"documentMode"in document&&11>=document.documentMode,qn=null,Om=null,Zi=null,Fm=!1;function ev(e,t,a){var r=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Fm||qn==null||qn!==bd(r)||(r=qn,"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}),Zi&&cl(Zi,r)||(Zi=r,r=Ed(Om,"onSelect"),0<r.length&&(t=new Sh("onSelect","select",null,t,a),e.push({event:t,listeners:r}),t.target=qn)))}function nd(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Hn={animationend:nd("Animation","AnimationEnd"),animationiteration:nd("Animation","AnimationIteration"),animationstart:nd("Animation","AnimationStart"),transitionend:nd("Transition","TransitionEnd")},om={},I0={};sr&&(I0=document.createElement("div").style,"AnimationEvent"in window||(delete Hn.animationend.animation,delete Hn.animationiteration.animation,delete Hn.animationstart.animation),"TransitionEvent"in window||delete Hn.transitionend.transition);function Yd(e){if(om[e])return om[e];if(!Hn[e])return e;var t=Hn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in I0)return om[e]=t[a];return e}var b0=Yd("animationend"),k0=Yd("animationiteration"),P0=Yd("animationstart"),T0=Yd("transitionend"),A0=new Map,tv="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 Xr(e,t){A0.set(e,t),qo(t,[e])}for(sd=0;sd<tv.length;sd++)id=tv[sd],av=id.toLowerCase(),rv=id[0].toUpperCase()+id.slice(1),Xr(av,"on"+rv);var id,av,rv,sd;Xr(b0,"onAnimationEnd");Xr(k0,"onAnimationIteration");Xr(P0,"onAnimationStart");Xr("dblclick","onDoubleClick");Xr("focusin","onFocus");Xr("focusout","onBlur");Xr(T0,"onTransitionEnd");rs("onMouseEnter",["mouseout","mouseover"]);rs("onMouseLeave",["mouseout","mouseover"]);rs("onPointerEnter",["pointerout","pointerover"]);rs("onPointerLeave",["pointerout","pointerover"]);qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qo("onBeforeInput",["compositionend","keypress","textInput","paste"]);qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ki="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(" "),TT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ki));function ov(e,t,a){var r=e.type||"unknown-event";e.currentTarget=a,TP(r,t,void 0,e),e.currentTarget=null}function R0(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;ov(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;ov(o,i,u),n=l}}}if(Pd)throw e=Em,Pd=!1,Em=null,e}function be(e,t){var a=t[qm];a===void 0&&(a=t[qm]=new Set);var r=e+"__bubble";a.has(r)||(_0(t,e,2,!1),a.add(r))}function nm(e,t,a){var r=0;t&&(r|=4),_0(a,e,r,t)}var ld="_reactListening"+Math.random().toString(36).slice(2);function fl(e){if(!e[ld]){e[ld]=!0,Bv.forEach(function(a){a!=="selectionchange"&&(TT.has(a)||nm(a,!1,e),nm(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ld]||(t[ld]=!0,nm("selectionchange",!1,t))}}function _0(e,t,a,r){switch(m0(t)){case 1:var o=zP;break;case 4:o=$P;break;default:o=vh}a=o.bind(null,t,a,e),o=void 0,!_m||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 sm(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=Eo(i),s===null)return;if(l=s.tag,l===5||l===6){r=n=s;continue e}i=i.parentNode}}r=r.return}e0(function(){var u=n,d=hh(a),c=[];e:{var f=A0.get(e);if(f!==void 0){var m=Sh,x=e;switch(e){case"keypress":if(yd(a)===0)break e;case"keydown":case"keyup":m=sT;break;case"focusin":x="focus",m=am;break;case"focusout":x="blur",m=am;break;case"beforeblur":case"afterblur":m=am;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=$x;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=KP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=uT;break;case b0:case k0:case P0:m=JP;break;case T0:m=cT;break;case"scroll":m=WP;break;case"wheel":m=pT;break;case"copy":case"cut":case"paste":m=ZP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Gx}var w=(t&4)!==0,I=!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=sl(g,h),C!=null&&w.push(pl(g,C,y)))),I)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!==Am&&(x=a.relatedTarget||a.fromElement)&&(Eo(x)||x[ir]))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?Eo(x):null,x!==null&&(I=Ho(x),x!==I||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=u),m!==x)){if(w=$x,C="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=Gx,C="onPointerLeave",h="onPointerEnter",g="pointer"),I=m==null?f:zn(m),y=x==null?f:zn(x),f=new w(C,g+"leave",m,a,d),f.target=I,f.relatedTarget=y,C=null,Eo(d)===u&&(w=new w(h,g+"enter",x,a,d),w.target=y,w.relatedTarget=I,C=w),I=C,m&&x)t:{for(w=m,h=x,g=0,y=w;y;y=Bn(y))g++;for(y=0,C=h;C;C=Bn(C))y++;for(;0<g-y;)w=Bn(w),g--;for(;0<y-g;)h=Bn(h),y--;for(;g--;){if(w===h||h!==null&&w===h.alternate)break t;w=Bn(w),h=Bn(h)}w=null}else w=null;m!==null&&nv(c,f,m,w,!1),x!==null&&I!==null&&nv(c,I,x,w,!0)}}e:{if(f=u?zn(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var L=wT;else if(Qx(f))if(w0)L=IT;else{L=CT;var P=ST}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(L=LT);if(L&&(L=L(e,u))){v0(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?zn(u):window,e){case"focusin":(Qx(P)||P.contentEditable==="true")&&(qn=P,Om=u,Zi=null);break;case"focusout":Zi=Om=qn=null;break;case"mousedown":Fm=!0;break;case"contextmenu":case"mouseup":case"dragend":Fm=!1,ev(c,a,d);break;case"selectionchange":if(PT)break;case"keydown":case"keyup":ev(c,a,d)}var A;if(Lh)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 jn?y0(e,a)&&(R="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(R="onCompositionStart");R&&(g0&&a.locale!=="ko"&&(jn||R!=="onCompositionStart"?R==="onCompositionEnd"&&jn&&(A=h0()):(Fr=d,wh="value"in Fr?Fr.value:Fr.textContent,jn=!0)),P=Ed(u,R),0<P.length&&(R=new Wx(R,e,null,a,d),c.push({event:R,listeners:P}),A?R.data=A:(A=x0(a),A!==null&&(R.data=A)))),(A=hT?gT(e,a):yT(e,a))&&(u=Ed(u,"onBeforeInput"),0<u.length&&(d=new Wx("onBeforeInput","beforeinput",null,a,d),c.push({event:d,listeners:u}),d.data=A))}R0(c,t)})}function pl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ed(e,t){for(var a=t+"Capture",r=[];e!==null;){var o=e,n=o.stateNode;o.tag===5&&n!==null&&(o=n,n=sl(e,a),n!=null&&r.unshift(pl(e,n,o)),n=sl(e,t),n!=null&&r.push(pl(e,n,o))),e=e.return}return r}function Bn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function nv(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=sl(a,n),l!=null&&s.unshift(pl(a,l,i))):o||(l=sl(a,n),l!=null&&s.push(pl(a,l,i)))),a=a.return}s.length!==0&&e.push({event:t,listeners:s})}var AT=/\r\n?/g,RT=/\u0000|\uFFFD/g;function sv(e){return(typeof e=="string"?e:""+e).replace(AT,`
|
|
6
|
+
`).replace(RT,"")}function ud(e,t,a){if(t=sv(t),sv(e)!==t&&a)throw Error(_(425))}function Dd(){}var Bm=null,Um=null;function Vm(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 jm=typeof setTimeout=="function"?setTimeout:void 0,_T=typeof clearTimeout=="function"?clearTimeout:void 0,iv=typeof Promise=="function"?Promise:void 0,ET=typeof queueMicrotask=="function"?queueMicrotask:typeof iv<"u"?function(e){return iv.resolve(null).then(e).catch(DT)}:jm;function DT(e){setTimeout(function(){throw e})}function im(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),ul(t);return}r--}else a!=="$"&&a!=="$?"&&a!=="$!"||r++;a=o}while(a);ul(t)}function qr(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 lv(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 cs=Math.random().toString(36).slice(2),Na="__reactFiber$"+cs,ml="__reactProps$"+cs,ir="__reactContainer$"+cs,qm="__reactEvents$"+cs,MT="__reactListeners$"+cs,NT="__reactHandles$"+cs;function Eo(e){var t=e[Na];if(t)return t;for(var a=e.parentNode;a;){if(t=a[ir]||a[Na]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=lv(e);e!==null;){if(a=e[Na])return a;e=lv(e)}return t}e=a,a=e.parentNode}return null}function Ll(e){return e=e[Na]||e[ir],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function zn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function Zd(e){return e[ml]||null}var Hm=[],$n=-1;function Qr(e){return{current:e}}function ke(e){0>$n||(e.current=Hm[$n],Hm[$n]=null,$n--)}function Se(e,t){$n++,Hm[$n]=e.current,e.current=t}var Kr={},wt=Qr(Kr),Nt=Qr(!1),Fo=Kr;function os(e,t){var a=e.type.contextTypes;if(!a)return Kr;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 Ot(e){return e=e.childContextTypes,e!=null}function Md(){ke(Nt),ke(wt)}function uv(e,t,a){if(wt.current!==Kr)throw Error(_(168));Se(wt,t),Se(Nt,a)}function E0(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,SP(e)||"Unknown",o));return De({},a,r)}function Nd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Kr,Fo=wt.current,Se(wt,e),Se(Nt,Nt.current),!0}function dv(e,t,a){var r=e.stateNode;if(!r)throw Error(_(169));a?(e=E0(e,t,Fo),r.__reactInternalMemoizedMergedChildContext=e,ke(Nt),ke(wt),Se(wt,e)):ke(Nt),Se(Nt,a)}var ar=null,ec=!1,lm=!1;function D0(e){ar===null?ar=[e]:ar.push(e)}function OT(e){ec=!0,D0(e)}function Jr(){if(!lm&&ar!==null){lm=!0;var e=0,t=he;try{var a=ar;for(he=1;e<a.length;e++){var r=a[e];do r=r(!0);while(r!==null)}ar=null,ec=!1}catch(o){throw ar!==null&&(ar=ar.slice(e+1)),o0(gh,Jr),o}finally{he=t,lm=!1}}return null}var Wn=[],Gn=0,Od=null,Fd=0,sa=[],ia=0,Bo=null,rr=1,or="";function Ro(e,t){Wn[Gn++]=Fd,Wn[Gn++]=Od,Od=e,Fd=t}function M0(e,t,a){sa[ia++]=rr,sa[ia++]=or,sa[ia++]=Bo,Bo=e;var r=rr;e=or;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,rr=1<<32-Ia(t)+o|a<<o|r,or=n+e}else rr=1<<n|a<<o|r,or=e}function bh(e){e.return!==null&&(Ro(e,1),M0(e,1,0))}function kh(e){for(;e===Od;)Od=Wn[--Gn],Wn[Gn]=null,Fd=Wn[--Gn],Wn[Gn]=null;for(;e===Bo;)Bo=sa[--ia],sa[ia]=null,or=sa[--ia],sa[ia]=null,rr=sa[--ia],sa[ia]=null}var Gt=null,Wt=null,Re=!1,La=null;function N0(e,t){var a=la(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 cv(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,Gt=e,Wt=qr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Gt=e,Wt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(a=Bo!==null?{id:rr,overflow:or}:null,e.memoizedState={dehydrated:t,treeContext:a,retryLane:1073741824},a=la(18,null,null,0),a.stateNode=t,a.return=e,e.child=a,Gt=e,Wt=null,!0):!1;default:return!1}}function zm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $m(e){if(Re){var t=Wt;if(t){var a=t;if(!cv(e,t)){if(zm(e))throw Error(_(418));t=qr(a.nextSibling);var r=Gt;t&&cv(e,t)?N0(r,a):(e.flags=e.flags&-4097|2,Re=!1,Gt=e)}}else{if(zm(e))throw Error(_(418));e.flags=e.flags&-4097|2,Re=!1,Gt=e}}}function fv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function dd(e){if(e!==Gt)return!1;if(!Re)return fv(e),Re=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vm(e.type,e.memoizedProps)),t&&(t=Wt)){if(zm(e))throw O0(),Error(_(418));for(;t;)N0(e,t),t=qr(t.nextSibling)}if(fv(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){Wt=qr(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++}e=e.nextSibling}Wt=null}}else Wt=Gt?qr(e.stateNode.nextSibling):null;return!0}function O0(){for(var e=Wt;e;)e=qr(e.nextSibling)}function ns(){Wt=Gt=null,Re=!1}function Ph(e){La===null?La=[e]:La.push(e)}var FT=dr.ReactCurrentBatchConfig;function ji(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 cd(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function pv(e){var t=e._init;return t(e._payload)}function F0(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=Wr(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=hm(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===Vn?d(h,g,y.props.children,C,y.key):g!==null&&(g.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Dr&&pv(L)===g.type)?(C=o(g,y.props),C.ref=ji(h,g,y),C.return=h,C):(C=Id(y.type,y.key,y.props,null,h.mode,C),C.ref=ji(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=gm(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=Oo(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=hm(""+g,h.mode,y),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Qu:return y=Id(g.type,g.key,g.props,null,h.mode,y),y.ref=ji(h,null,g),y.return=h,y;case Un:return g=gm(g,h.mode,y),g.return=h,g;case Dr:var C=g._init;return c(h,C(g._payload),y)}if(Wi(g)||Fi(g))return g=Oo(g,h.mode,y,null),g.return=h,g;cd(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 Qu:return y.key===L?l(h,g,y,C):null;case Un:return y.key===L?u(h,g,y,C):null;case Dr:return L=y._init,f(h,g,L(y._payload),C)}if(Wi(y)||Fi(y))return L!==null?null:d(h,g,y,C,null);cd(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 Qu:return h=h.get(C.key===null?y:C.key)||null,l(g,h,C,L);case Un:return h=h.get(C.key===null?y:C.key)||null,u(g,h,C,L);case Dr:var P=C._init;return m(h,g,y,P(C._payload),L)}if(Wi(C)||Fi(C))return h=h.get(y)||null,d(g,h,C,L,null);cd(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),Re&&Ro(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 Re&&Ro(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)}),Re&&Ro(h,R),L}function w(h,g,y,C){var L=Fi(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),Re&&Ro(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 Re&&Ro(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)}),Re&&Ro(h,R),L}function I(h,g,y,C){if(typeof y=="object"&&y!==null&&y.type===Vn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Qu:e:{for(var L=y.key,P=g;P!==null;){if(P.key===L){if(L=y.type,L===Vn){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===Dr&&pv(L)===P.type){a(h,P.sibling),g=o(P,y.props),g.ref=ji(h,P,y),g.return=h,h=g;break e}a(h,P);break}else t(h,P);P=P.sibling}y.type===Vn?(g=Oo(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=ji(h,g,y),C.return=h,h=C)}return s(h);case Un: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=gm(y,h.mode,C),g.return=h,h=g}return s(h);case Dr:return P=y._init,I(h,g,P(y._payload),C)}if(Wi(y))return x(h,g,y,C);if(Fi(y))return w(h,g,y,C);cd(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=hm(y,h.mode,C),g.return=h,h=g),s(h)):a(h,g)}return I}var ss=F0(!0),B0=F0(!1),Bd=Qr(null),Ud=null,Kn=null,Th=null;function Ah(){Th=Kn=Ud=null}function Rh(e){var t=Bd.current;ke(Bd),e._currentValue=t}function Wm(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 ts(e,t){Ud=e,Th=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Mt=!0),e.firstContext=null)}function da(e){var t=e._currentValue;if(Th!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(Ud===null)throw Error(_(308));Kn=e,Ud.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var Do=null;function _h(e){Do===null?Do=[e]:Do.push(e)}function U0(e,t,a,r){var o=t.interleaved;return o===null?(a.next=a,_h(t)):(a.next=o.next,o.next=a),t.interleaved=a,lr(e,r)}function lr(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 Mr=!1;function Eh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function V0(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 nr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Hr(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,lr(e,a)}return o=r.interleaved,o===null?(t.next=t,_h(r)):(t.next=o.next,o.next=t),r.interleaved=t,lr(e,a)}function xd(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,yh(e,a)}}function mv(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 Vd(e,t,a,r){var o=e.updateQueue;Mr=!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=De({},c,f);break e;case 2:Mr=!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);Vo|=s,e.lanes=s,e.memoizedState=c}}function hv(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={},Fa=Qr(Il),hl=Qr(Il),gl=Qr(Il);function Mo(e){if(e===Il)throw Error(_(174));return e}function Dh(e,t){switch(Se(gl,t),Se(hl,e),Se(Fa,Il),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:km(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=km(t,e)}ke(Fa),Se(Fa,t)}function is(){ke(Fa),ke(hl),ke(gl)}function j0(e){Mo(gl.current);var t=Mo(Fa.current),a=km(t,e.type);t!==a&&(Se(hl,e),Se(Fa,a))}function Mh(e){hl.current===e&&(ke(Fa),ke(hl))}var _e=Qr(0);function jd(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 um=[];function Nh(){for(var e=0;e<um.length;e++)um[e]._workInProgressVersionPrimary=null;um.length=0}var vd=dr.ReactCurrentDispatcher,dm=dr.ReactCurrentBatchConfig,Uo=0,Ee=null,Ge=null,Ze=null,qd=!1,el=!1,yl=0,BT=0;function yt(){throw Error(_(321))}function Oh(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ka(e[a],t[a]))return!1;return!0}function Fh(e,t,a,r,o,n){if(Uo=n,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,vd.current=e===null||e.memoizedState===null?qT:HT,e=a(r,o),el){n=0;do{if(el=!1,yl=0,25<=n)throw Error(_(301));n+=1,Ze=Ge=null,t.updateQueue=null,vd.current=zT,e=a(r,o)}while(el)}if(vd.current=Hd,t=Ge!==null&&Ge.next!==null,Uo=0,Ze=Ge=Ee=null,qd=!1,t)throw Error(_(300));return e}function Bh(){var e=yl!==0;return yl=0,e}function Ma(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?Ee.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function ca(){if(Ge===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=Ze===null?Ee.memoizedState:Ze.next;if(t!==null)Ze=t,Ge=e;else{if(e===null)throw Error(_(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},Ze===null?Ee.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function xl(e,t){return typeof t=="function"?t(e):t}function cm(e){var t=ca(),a=t.queue;if(a===null)throw Error(_(311));a.lastRenderedReducer=e;var r=Ge,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((Uo&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,Ee.lanes|=d,Vo|=d}u=u.next}while(u!==null&&u!==n);l===null?s=r:l.next=i,ka(r,t.memoizedState)||(Mt=!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,Ee.lanes|=n,Vo|=n,o=o.next;while(o!==e)}else o===null&&(a.lanes=0);return[t.memoizedState,a.dispatch]}function fm(e){var t=ca(),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);ka(n,t.memoizedState)||(Mt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),a.lastRenderedState=n}return[n,r]}function q0(){}function H0(e,t){var a=Ee,r=ca(),o=t(),n=!ka(r.memoizedState,o);if(n&&(r.memoizedState=o,Mt=!0),r=r.queue,Uh(W0.bind(null,a,r,e),[e]),r.getSnapshot!==t||n||Ze!==null&&Ze.memoizedState.tag&1){if(a.flags|=2048,vl(9,$0.bind(null,a,r,o,t),void 0,null),et===null)throw Error(_(349));(Uo&30)!==0||z0(a,t,o)}return o}function z0(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function $0(e,t,a,r){t.value=a,t.getSnapshot=r,G0(t)&&K0(e)}function W0(e,t,a){return a(function(){G0(t)&&K0(e)})}function G0(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ka(e,a)}catch{return!0}}function K0(e){var t=lr(e,1);t!==null&&ba(t,e,1,-1)}function gv(e){var t=Ma();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:e},t.queue=e,e=e.dispatch=jT.bind(null,Ee,e),[t.memoizedState,e]}function vl(e,t,a,r){return e={tag:e,create:t,destroy:a,deps:r,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.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 X0(){return ca().memoizedState}function wd(e,t,a,r){var o=Ma();Ee.flags|=e,o.memoizedState=vl(1|t,a,void 0,r===void 0?null:r)}function tc(e,t,a,r){var o=ca();r=r===void 0?null:r;var n=void 0;if(Ge!==null){var s=Ge.memoizedState;if(n=s.destroy,r!==null&&Oh(r,s.deps)){o.memoizedState=vl(t,a,n,r);return}}Ee.flags|=e,o.memoizedState=vl(1|t,a,n,r)}function yv(e,t){return wd(8390656,8,e,t)}function Uh(e,t){return tc(2048,8,e,t)}function Q0(e,t){return tc(4,2,e,t)}function J0(e,t){return tc(4,4,e,t)}function Y0(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 Z0(e,t,a){return a=a!=null?a.concat([e]):null,tc(4,4,Y0.bind(null,t,e),a)}function Vh(){}function ew(e,t){var a=ca();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Oh(t,r[1])?r[0]:(a.memoizedState=[e,t],e)}function tw(e,t){var a=ca();t=t===void 0?null:t;var r=a.memoizedState;return r!==null&&t!==null&&Oh(t,r[1])?r[0]:(e=e(),a.memoizedState=[e,t],e)}function aw(e,t,a){return(Uo&21)===0?(e.baseState&&(e.baseState=!1,Mt=!0),e.memoizedState=a):(ka(a,t)||(a=i0(),Ee.lanes|=a,Vo|=a,e.baseState=!0),t)}function UT(e,t){var a=he;he=a!==0&&4>a?a:4,e(!0);var r=dm.transition;dm.transition={};try{e(!1),t()}finally{he=a,dm.transition=r}}function rw(){return ca().memoizedState}function VT(e,t,a){var r=$r(e);if(a={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null},ow(e))nw(t,a);else if(a=U0(e,t,a,r),a!==null){var o=Pt();ba(a,e,r,o),sw(a,t,r)}}function jT(e,t,a){var r=$r(e),o={lane:r,action:a,hasEagerState:!1,eagerState:null,next:null};if(ow(e))nw(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,ka(i,s)){var l=t.interleaved;l===null?(o.next=o,_h(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}a=U0(e,t,o,r),a!==null&&(o=Pt(),ba(a,e,r,o),sw(a,t,r))}}function ow(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function nw(e,t){el=qd=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function sw(e,t,a){if((a&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,a|=r,t.lanes=a,yh(e,a)}}var Hd={readContext:da,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},qT={readContext:da,useCallback:function(e,t){return Ma().memoizedState=[e,t===void 0?null:t],e},useContext:da,useEffect:yv,useImperativeHandle:function(e,t,a){return a=a!=null?a.concat([e]):null,wd(4194308,4,Y0.bind(null,t,e),a)},useLayoutEffect:function(e,t){return wd(4194308,4,e,t)},useInsertionEffect:function(e,t){return wd(4,2,e,t)},useMemo:function(e,t){var a=Ma();return t=t===void 0?null:t,e=e(),a.memoizedState=[e,t],e},useReducer:function(e,t,a){var r=Ma();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=VT.bind(null,Ee,e),[r.memoizedState,e]},useRef:function(e){var t=Ma();return e={current:e},t.memoizedState=e},useState:gv,useDebugValue:Vh,useDeferredValue:function(e){return Ma().memoizedState=e},useTransition:function(){var e=gv(!1),t=e[0];return e=UT.bind(null,e[1]),Ma().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,a){var r=Ee,o=Ma();if(Re){if(a===void 0)throw Error(_(407));a=a()}else{if(a=t(),et===null)throw Error(_(349));(Uo&30)!==0||z0(r,t,a)}o.memoizedState=a;var n={value:a,getSnapshot:t};return o.queue=n,yv(W0.bind(null,r,n,e),[e]),r.flags|=2048,vl(9,$0.bind(null,r,n,a,t),void 0,null),a},useId:function(){var e=Ma(),t=et.identifierPrefix;if(Re){var a=or,r=rr;a=(r&~(1<<32-Ia(r)-1)).toString(32)+a,t=":"+t+"R"+a,a=yl++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=BT++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},HT={readContext:da,useCallback:ew,useContext:da,useEffect:Uh,useImperativeHandle:Z0,useInsertionEffect:Q0,useLayoutEffect:J0,useMemo:tw,useReducer:cm,useRef:X0,useState:function(){return cm(xl)},useDebugValue:Vh,useDeferredValue:function(e){var t=ca();return aw(t,Ge.memoizedState,e)},useTransition:function(){var e=cm(xl)[0],t=ca().memoizedState;return[e,t]},useMutableSource:q0,useSyncExternalStore:H0,useId:rw,unstable_isNewReconciler:!1},zT={readContext:da,useCallback:ew,useContext:da,useEffect:Uh,useImperativeHandle:Z0,useInsertionEffect:Q0,useLayoutEffect:J0,useMemo:tw,useReducer:fm,useRef:X0,useState:function(){return fm(xl)},useDebugValue:Vh,useDeferredValue:function(e){var t=ca();return Ge===null?t.memoizedState=e:aw(t,Ge.memoizedState,e)},useTransition:function(){var e=fm(xl)[0],t=ca().memoizedState;return[e,t]},useMutableSource:q0,useSyncExternalStore:H0,useId:rw,unstable_isNewReconciler:!1};function Sa(e,t){if(e&&e.defaultProps){t=De({},t),e=e.defaultProps;for(var a in e)t[a]===void 0&&(t[a]=e[a]);return t}return t}function Gm(e,t,a,r){t=e.memoizedState,a=a(r,t),a=a==null?t:De({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ac={isMounted:function(e){return(e=e._reactInternals)?Ho(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var r=Pt(),o=$r(e),n=nr(r,o);n.payload=t,a!=null&&(n.callback=a),t=Hr(e,n,o),t!==null&&(ba(t,e,o,r),xd(t,e,o))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var r=Pt(),o=$r(e),n=nr(r,o);n.tag=1,n.payload=t,a!=null&&(n.callback=a),t=Hr(e,n,o),t!==null&&(ba(t,e,o,r),xd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Pt(),r=$r(e),o=nr(a,r);o.tag=2,t!=null&&(o.callback=t),t=Hr(e,o,r),t!==null&&(ba(t,e,r,a),xd(t,e,r))}};function xv(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?!cl(a,r)||!cl(o,n):!0}function iw(e,t,a){var r=!1,o=Kr,n=t.contextType;return typeof n=="object"&&n!==null?n=da(n):(o=Ot(t)?Fo:wt.current,r=t.contextTypes,n=(r=r!=null)?os(e,o):Kr),t=new t(a,n),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ac,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=n),t}function vv(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&&ac.enqueueReplaceState(t,t.state,null)}function Km(e,t,a,r){var o=e.stateNode;o.props=a,o.state=e.memoizedState,o.refs={},Eh(e);var n=t.contextType;typeof n=="object"&&n!==null?o.context=da(n):(n=Ot(t)?Fo:wt.current,o.context=os(e,n)),o.state=e.memoizedState,n=t.getDerivedStateFromProps,typeof n=="function"&&(Gm(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&&ac.enqueueReplaceState(o,o.state,null),Vd(e,a,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ls(e,t){try{var a="",r=t;do a+=wP(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 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 HT=typeof WeakMap=="function"?WeakMap:Map;function lw(e,t,a){a=or(-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 uw(e,t,a){a=or(-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"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function wv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new HT;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=r1.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 Sv(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=or(-1,1),t.tag=2,Wr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var zT=ur.ReactCurrentOwner,Et=!1;function It(e,t,a,r){t.child=e===null?B0(t,null,a,r):ls(t,e.child,a,r)}function Lv(e,t,a,r,o){a=a.render;var n=t.ref;return rs(t,o),r=Bh(e,t,a,r,n,o),a=Uh(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,lr(e,t,o)):(_e&&a&&kh(t),t.flags|=1,It(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,dw(e,t,n,r,o)):(e=bd(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 lr(e,t,o)}return t.flags|=1,e=Xr(n,r),e.ref=t.ref,e.return=t,t.child=e}function dw(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(fl(n,r)&&e.ref===t.ref)if(Et=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Et=!0);else return t.lanes=e.lanes,lr(e,t,o)}return Jm(e,t,a,r,o)}function cw(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(Yn,$t),$t|=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(Yn,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,we(Yn,$t),$t|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,we(Yn,$t),$t|=r;return It(e,t,o,a),t.child}function fw(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=Mt(a)?Vo:vt.current;return n=ss(t,n),rs(t,o),a=Bh(e,t,a,r,n,o),r=Uh(),e!==null&&!Et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,lr(e,t,o)):(_e&&r&&kh(t),t.flags|=1,It(e,t,a,o),t.child)}function bv(e,t,a,r,o){if(Mt(a)){var n=!0;Od(t)}else n=!1;if(rs(t,o),t.stateNode===null)Sd(e,t),iw(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=ca(u):(u=Mt(a)?Vo:vt.current,u=ss(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)&&vv(t,s,r,u),Fr=!1;var f=t.memoizedState;s.state=f,jd(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Dt.current||Fr?(typeof d=="function"&&(Km(t,a,d,r),l=t.memoizedState),(i=Fr||xv(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,V0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:wa(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=ca(l):(l=Mt(a)?Vo:vt.current,l=ss(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)&&vv(t,s,r,l),Fr=!1,f=t.memoizedState,s.state=f,jd(t,r,s,o);var x=t.memoizedState;i!==c||f!==x||Dt.current||Fr?(typeof m=="function"&&(Km(t,a,m,r),x=t.memoizedState),(u=Fr||xv(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){fw(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&dv(t,a,!1),lr(e,t,n);r=t.stateNode,zT.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=ls(t,e.child,null,n),t.child=ls(t,null,i,n)):It(e,t,i,n),t.memoizedState=r.state,o&&dv(t,a,!0),t.child}function pw(e){var t=e.stateNode;t.pendingContext?uv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uv(e,t.context,!1),Mh(e,t.containerInfo)}function kv(e,t,a,r,o){return is(),Th(o),t.flags|=256,It(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 mw(e,t,a){var r=t.pendingProps,o=Ee.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(Ee,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=Uo(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 $T(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=Xr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Xr(i,n):(n=Uo(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=Xr(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),ls(t,e.child,null,a),e=qh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $T(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=Uo(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&ls(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,Et||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,ir(e,o),Ia(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=o1.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Wt=$r(o.nextSibling),Gt=t,_e=!0,Sa=null,e!==null&&(ia[la++]=ar,ia[la++]=rr,ia[la++]=jo,ar=e.id,rr=e.overflow,jo=t),t=qh(t,r.children),t.flags|=4096,t)}function Pv(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 hw(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(It(e,t,r.children,a),r=Ee.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&&Pv(e,a,t);else if(e.tag===19)Pv(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(Ee,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 Sd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function lr(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ho|=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=Xr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Xr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function WT(e,t,a){switch(t.tag){case 3:pw(t),is();break;case 5:j0(t);break;case 1:Mt(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(Ee,Ee.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?mw(e,t,a):(we(Ee,Ee.current&1),e=lr(e,t,a),e!==null?e.sibling:null);we(Ee,Ee.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return hw(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),we(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,cw(e,t,a)}return lr(e,t,a)}var gw,th,yw,xw;gw=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(){};yw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Fo(Na.current);var n=null;switch(a){case"input":o=Lm(e,o),r=Lm(e,r),n=[];break;case"select":o=Me({},o,{value:void 0}),r=Me({},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)}};xw=function(e,t,a,r){a!==r&&(t.flags|=4)};function Hi(e,t){if(!_e)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 yt(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 GT(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 yt(t),null;case 1:return Mt(t.type)&&Nd(),yt(t),null;case 3:return r=t.stateNode,us(),ke(Dt),ke(vt),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,Sa!==null&&(uh(Sa),Sa=null))),th(e,t),yt(t),null;case 5:Nh(t);var o=Fo(yl.current);if(a=t.type,e!==null&&t.stateNode!=null)yw(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 yt(t),null}if(e=Fo(Na.current),cd(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Da]=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":Nx(r,n),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},be("invalid",r);break;case"textarea":Fx(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),Ox(r,n,!0);break;case"textarea":Yu(r),Bx(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=Wv(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[Da]=t,e[hl]=r,gw(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":Nx(e,r),o=Lm(e,r),be("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Me({},r,{value:void 0}),be("invalid",e);break;case"textarea":Fx(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"?Xv(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Gv(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),Ox(e,r,!1);break;case"textarea":Yu(e),Bx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Qr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Zn(e,!!r.multiple,n,!1):r.defaultValue!=null&&Zn(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 yt(t),null;case 6:if(e&&t.stateNode!=null)xw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(a=Fo(yl.current),Fo(Na.current),cd(t)){if(r=t.stateNode,a=t.memoizedProps,r[Da]=t,(n=r.nodeValue!==a)&&(e=Gt,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[Da]=t,t.stateNode=r}return yt(t),null;case 13:if(ke(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&Wt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)O0(),is(),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[Da]=t}else is(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;yt(t),n=!1}else Sa!==null&&(uh(Sa),Sa=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||(Ee.current&1)!==0?Ke===0&&(Ke=3):Kh())),t.updateQueue!==null&&(t.flags|=4),yt(t),null);case 4:return us(),th(e,t),e===null&&pl(t.stateNode.containerInfo),yt(t),null;case 10:return _h(t.type._context),yt(t),null;case 17:return Mt(t.type)&&Nd(),yt(t),null;case 19:if(ke(Ee),n=t.memoizedState,n===null)return yt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)Hi(n,!1);else{if(Ke!==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(Ee,Ee.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ve()>cs&&(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&&!_e)return yt(t),null}else 2*Ve()-n.renderingStartTime>cs&&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=Ve(),t.sibling=null,a=Ee.current,we(Ee,r?a&1|2:a&1),t):(yt(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?($t&1073741824)!==0&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function KT(e,t){switch(Ph(t),t.tag){case 1:return Mt(t.type)&&Nd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return us(),ke(Dt),ke(vt),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(ke(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Ee),null;case 4:return us(),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,xt=!1,XT=typeof WeakSet=="function"?WeakSet:Set,B=null;function Jn(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Be(e,t,r)}else a.current=null}function ah(e,t,a){try{a()}catch(r){Be(e,t,r)}}var Tv=!1;function QT(e,t){if(Um=_d,e=L0(),bh(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 C=x.memoizedProps,L=x.memoizedState,h=t.stateNode,y=h.getSnapshotBeforeUpdate(t.elementType===t.type?C:wa(t.type,C),L);h.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(w){Be(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return x=Tv,Tv=!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 vw(e){var t=e.alternate;t!==null&&(e.alternate=null,vw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Da],delete t[hl],delete t[Hm],delete t[ET],delete t[DT])),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 ww(e){return e.tag===5||e.tag===3||e.tag===4}function Av(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ww(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 nt=null,Ca=!1;function Nr(e,t,a){for(a=a.child;a!==null;)Cw(e,t,a),a=a.sibling}function Cw(e,t,a){if(Ma&&typeof Ma.onCommitFiberUnmount=="function")try{Ma.onCommitFiberUnmount(Qd,a)}catch{}switch(a.tag){case 5:xt||Jn(a,t);case 6:var r=nt,o=Ca;nt=null,Nr(e,t,a),nt=r,Ca=o,nt!==null&&(Ca?(e=nt,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):nt.removeChild(a.stateNode));break;case 18:nt!==null&&(Ca?(e=nt,a=a.stateNode,e.nodeType===8?lm(e.parentNode,a):e.nodeType===1&&lm(e,a),dl(e)):lm(nt,a.stateNode));break;case 4:r=nt,o=Ca,nt=a.stateNode.containerInfo,Ca=!0,Nr(e,t,a),nt=r,Ca=o;break;case 0:case 11:case 14:case 15:if(!xt&&(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)}Nr(e,t,a);break;case 1:if(!xt&&(Jn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Be(a,t,i)}Nr(e,t,a);break;case 21:Nr(e,t,a);break;case 22:a.mode&1?(xt=(r=xt)||a.memoizedState!==null,Nr(e,t,a),xt=r):Nr(e,t,a);break;default:Nr(e,t,a)}}function Rv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new XT),t.forEach(function(r){var o=n1.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function va(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:nt=i.stateNode,Ca=!1;break e;case 3:nt=i.stateNode.containerInfo,Ca=!0;break e;case 4:nt=i.stateNode.containerInfo,Ca=!0;break e}i=i.return}if(nt===null)throw Error(_(160));Cw(n,s,o),nt=null,Ca=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Be(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Sw(t,e),t=t.sibling}function Sw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(va(t,e),_a(e),r&4){try{al(3,e,e.return),oc(3,e)}catch(C){Be(e,e.return,C)}try{al(5,e,e.return)}catch(C){Be(e,e.return,C)}}break;case 1:va(t,e),_a(e),r&512&&a!==null&&Jn(a,a.return);break;case 5:if(va(t,e),_a(e),r&512&&a!==null&&Jn(a,a.return),e.flags&32){var o=e.stateNode;try{sl(o,"")}catch(C){Be(e,e.return,C)}}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&&zv(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"?Xv(o,c):d==="dangerouslySetInnerHTML"?Gv(o,c):d==="children"?sl(o,c):fh(o,d,c,u)}switch(i){case"input":Im(o,n);break;case"textarea":$v(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var m=n.value;m!=null?Zn(o,!!n.multiple,m,!1):f!==!!n.multiple&&(n.defaultValue!=null?Zn(o,!!n.multiple,n.defaultValue,!0):Zn(o,!!n.multiple,n.multiple?[]:"",!1))}o[hl]=n}catch(C){Be(e,e.return,C)}}break;case 6:if(va(t,e),_a(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(C){Be(e,e.return,C)}}break;case 3:if(va(t,e),_a(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{dl(t.containerInfo)}catch(C){Be(e,e.return,C)}break;case 4:va(t,e),_a(e);break;case 13:va(t,e),_a(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||($h=Ve())),r&4&&Rv(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(xt=(u=xt)||d,va(t,e),xt=u):va(t,e),_a(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:Jn(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(C){Be(r,a,C)}}break;case 5:Jn(f,f.return);break;case 22:if(f.memoizedState!==null){Ev(c);continue}}m!==null?(m.return=f,B=m):Ev(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=Kv("display",s))}catch(C){Be(e,e.return,C)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(C){Be(e,e.return,C)}}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:va(t,e),_a(e),r&4&&Rv(e);break;case 21:break;default:va(t,e),_a(e)}}function _a(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(ww(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=Av(e);nh(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=Av(e);oh(e,i,s);break;default:throw Error(_(161))}}catch(l){Be(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function JT(e,t,a){B=e,Lw(e,t,a)}function Lw(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||xt;i=md;var u=xt;if(md=s,(xt=l)&&!u)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?Dv(o):l!==null?(l.return=s,B=l):Dv(o);for(;n!==null;)B=n,Lw(n,t,a),n=n.sibling;B=o,md=i,xt=u}_v(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,B=n):_v(e,t,a)}}function _v(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:xt||oc(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!xt)if(a===null)r.componentDidMount();else{var o=t.elementType===t.type?a.memoizedProps:wa(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&hv(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}hv(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))}xt||t.flags&512&&rh(t)}catch(f){Be(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 Ev(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 Dv(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){Be(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Be(t,o,l)}}var n=t.return;try{rh(t)}catch(l){Be(t,n,l)}break;case 5:var s=t.return;try{rh(t)}catch(l){Be(t,s,l)}}}catch(l){Be(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 YT=Math.ceil,$d=ur.ReactCurrentDispatcher,Hh=ur.ReactCurrentOwner,da=ur.ReactCurrentBatchConfig,le=0,tt=null,He=null,st=0,$t=0,Yn=Zr(0),Ke=0,Cl=null,Ho=0,nc=0,zh=0,rl=null,_t=null,$h=0,cs=1/0,er=null,Wd=!1,sh=null,Gr=null,hd=!1,jr=null,Gd=0,ol=0,ih=null,Ld=-1,Id=0;function bt(){return(le&6)!==0?Ve():Ld!==-1?Ld:Ld=Ve()}function Kr(e){return(e.mode&1)===0?1:(le&2)!==0&&st!==0?st&-st:NT.transition!==null?(Id===0&&(Id=i0()),Id):(e=he,e!==0||(e=window.event,e=e===void 0?16:m0(e.type)),e)}function Ia(e,t,a,r){if(50<ol)throw ol=0,ih=null,Error(_(185));Sl(e,a,r),((le&2)===0||e!==tt)&&(e===tt&&((le&2)===0&&(nc|=a),Ke===4&&Ur(e,st)),Nt(e,r),a===1&&le===0&&(t.mode&1)===0&&(cs=Ve()+500,tc&&eo()))}function Nt(e,t){var a=e.callbackNode;FP(e,t);var r=Rd(e,e===tt?st:0);if(r===0)a!==null&&jx(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&jx(a),t===1)e.tag===0?MT(Mv.bind(null,e)):D0(Mv.bind(null,e)),RT(function(){(le&6)===0&&eo()}),a=null;else{switch(l0(r)){case 1:a=yh;break;case 4:a=n0;break;case 16:a=Ad;break;case 536870912:a=s0;break;default:a=Ad}a=_w(a,Iw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Iw(e,t){if(Ld=-1,Id=0,(le&6)!==0)throw Error(_(327));var a=e.callbackNode;if(os()&&e.callbackNode!==a)return null;var r=Rd(e,e===tt?st:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Kd(e,r);else{t=r;var o=le;le|=2;var n=kw();(tt!==e||st!==t)&&(er=null,cs=Ve()+500,Bo(e,t));do try{t1();break}catch(i){bw(e,i)}while(!0);Rh(),$d.current=n,le=o,He!==null?t=0:(tt=null,st=0,t=Ke)}if(t!==0){if(t===2&&(o=Mm(e),o!==0&&(r=o,t=lh(e,o))),t===1)throw a=Cl,Bo(e,0),Ur(e,r),Nt(e,Ve()),a;if(t===6)Ur(e,r);else{if(o=e.current.alternate,(r&30)===0&&!ZT(o)&&(t=Kd(e,r),t===2&&(n=Mm(e),n!==0&&(r=n,t=lh(e,n))),t===1))throw a=Cl,Bo(e,0),Ur(e,r),Nt(e,Ve()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:Mo(e,_t,er);break;case 3:if(Ur(e,r),(r&130023424)===r&&(t=$h+500-Ve(),10<t)){if(Rd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){bt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=qm(Mo.bind(null,e,_t,er),t);break}Mo(e,_t,er);break;case 4:if(Ur(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-La(r);n=1<<s,s=t[s],s>o&&(o=s),r&=~n}if(r=o,r=Ve()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*YT(r/1960))-r,10<r){e.timeoutHandle=qm(Mo.bind(null,e,_t,er),r);break}Mo(e,_t,er);break;case 5:Mo(e,_t,er);break;default:throw Error(_(329))}}}return Nt(e,Ve()),e.callbackNode===a?Iw.bind(null,e):null}function lh(e,t){var a=rl;return e.current.memoizedState.isDehydrated&&(Bo(e,t).flags|=256),e=Kd(e,t),e!==2&&(t=_t,_t=a,t!==null&&uh(t)),e}function uh(e){_t===null?_t=e:_t.push.apply(_t,e)}function ZT(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(!ba(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 Ur(e,t){for(t&=~zh,t&=~nc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var a=31-La(t),r=1<<a;e[a]=-1,t&=~r}}function Mv(e){if((le&6)!==0)throw Error(_(327));os();var t=Rd(e,0);if((t&1)===0)return Nt(e,Ve()),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=Cl,Bo(e,0),Ur(e,t),Nt(e,Ve()),a;if(a===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Mo(e,_t,er),Nt(e,Ve()),null}function Wh(e,t){var a=le;le|=1;try{return e(t)}finally{le=a,le===0&&(cs=Ve()+500,tc&&eo())}}function zo(e){jr!==null&&jr.tag===0&&(le&6)===0&&os();var t=le;le|=1;var a=da.transition,r=he;try{if(da.transition=null,he=1,e)return e()}finally{he=r,da.transition=a,le=t,(le&6)===0&&eo()}}function Gh(){$t=Yn.current,ke(Yn)}function Bo(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,AT(a)),He!==null)for(a=He.return;a!==null;){var r=a;switch(Ph(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Nd();break;case 3:us(),ke(Dt),ke(vt),Oh();break;case 5:Nh(r);break;case 4:us();break;case 13:ke(Ee);break;case 19:ke(Ee);break;case 10:_h(r.type._context);break;case 22:case 23:Gh()}a=a.return}if(tt=e,He=e=Xr(e.current,null),st=$t=t,Ke=0,Cl=null,zh=nc=Ho=0,_t=rl=null,Oo!==null){for(t=0;t<Oo.length;t++)if(a=Oo[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}Oo=null}return e}function bw(e,t){do{var a=He;try{if(Rh(),wd.current=zd,Hd){for(var r=De.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Hd=!1}if(qo=0,et=Ge=De=null,tl=!1,xl=0,Hh.current=null,a===null||a.return===null){Ke=1,Cl=t,He=null;break}e:{var n=e,s=a.return,i=a,l=t;if(t=st,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,Sv(m,s,i,n,t),m.mode&1&&wv(n,u,t),t=m,l=u;var x=t.updateQueue;if(x===null){var C=new Set;C.add(l),t.updateQueue=C}else x.add(l);break e}else{if((t&1)===0){wv(n,u,t),Kh();break e}l=Error(_(426))}}else if(_e&&i.mode&1){var L=Cv(s);if(L!==null){(L.flags&65536)===0&&(L.flags|=256),Sv(L,s,i,n,t),Th(ds(l,i));break e}}n=l=ds(l,i),Ke!==4&&(Ke=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=lw(n,l,t);mv(n,h);break e;case 1:i=l;var y=n.type,g=n.stateNode;if((n.flags&128)===0&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Gr===null||!Gr.has(g)))){n.flags|=65536,t&=-t,n.lanes|=t;var w=uw(n,i,t);mv(n,w);break e}}n=n.return}while(n!==null)}Tw(a)}catch(I){t=I,He===a&&a!==null&&(He=a=a.return);continue}break}while(!0)}function kw(){var e=$d.current;return $d.current=zd,e===null?zd:e}function Kh(){(Ke===0||Ke===3||Ke===2)&&(Ke=4),tt===null||(Ho&268435455)===0&&(nc&268435455)===0||Ur(tt,st)}function Kd(e,t){var a=le;le|=2;var r=kw();(tt!==e||st!==t)&&(er=null,Bo(e,t));do try{e1();break}catch(o){bw(e,o)}while(!0);if(Rh(),le=a,$d.current=r,He!==null)throw Error(_(261));return tt=null,st=0,Ke}function e1(){for(;He!==null;)Pw(He)}function t1(){for(;He!==null&&!TP();)Pw(He)}function Pw(e){var t=Rw(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?Tw(e):He=t,Hh.current=null}function Tw(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=GT(a,t,$t),a!==null){He=a;return}}else{if(a=KT(a,t),a!==null){a.flags&=32767,He=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ke=6,He=null;return}}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);Ke===0&&(Ke=5)}function Mo(e,t,a){var r=he,o=da.transition;try{da.transition=null,he=1,a1(e,t,a,r)}finally{da.transition=o,he=r}return null}function a1(e,t,a,r){do os();while(jr!==null);if((le&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(BP(e,n),e===tt&&(He=tt=null,st=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||hd||(hd=!0,_w(Ad,function(){return os(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=da.transition,da.transition=null;var s=he;he=1;var i=le;le|=4,Hh.current=null,QT(e,a),Sw(a,e),IT(Vm),_d=!!Um,Vm=Um=null,e.current=a,JT(a,e,o),AP(),le=i,he=s,da.transition=n}else e.current=a;if(hd&&(hd=!1,jr=e,Gd=o),n=e.pendingLanes,n===0&&(Gr=null),EP(a.stateNode,r),Nt(e,Ve()),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&&os(),n=e.pendingLanes,(n&1)!==0?e===ih?ol++:(ol=0,ih=e):ol=0,eo(),null}function os(){if(jr!==null){var e=l0(Gd),t=da.transition,a=he;try{if(da.transition=null,he=16>e?16:e,jr===null)var r=!1;else{if(e=jr,jr=null,Gd=0,(le&6)!==0)throw Error(_(331));var o=le;for(le|=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(vw(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 C=x.child;if(C!==null){x.child=null;do{var L=C.sibling;C.sibling=null,C=L}while(C!==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 y=e.current;for(B=y;B!==null;){s=B;var g=s.child;if((s.subtreeFlags&2064)!==0&&g!==null)g.return=s,B=g;else e:for(s=y;B!==null;){if(i=B,(i.flags&2048)!==0)try{switch(i.tag){case 0:case 11:case 15:oc(9,i)}}catch(I){Be(i,i.return,I)}if(i===s){B=null;break e}var w=i.sibling;if(w!==null){w.return=i.return,B=w;break e}B=i.return}}if(le=o,eo(),Ma&&typeof Ma.onPostCommitFiberRoot=="function")try{Ma.onPostCommitFiberRoot(Qd,e)}catch{}r=!0}return r}finally{he=a,da.transition=t}}return!1}function Nv(e,t,a){t=ds(a,t),t=lw(e,t,1),e=Wr(e,t,1),t=bt(),e!==null&&(Sl(e,1,t),Nt(e,t))}function Be(e,t,a){if(e.tag===3)Nv(e,e,a);else for(;t!==null;){if(t.tag===3){Nv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Gr===null||!Gr.has(r))){e=ds(a,e),e=uw(t,e,1),t=Wr(t,e,1),e=bt(),t!==null&&(Sl(t,1,e),Nt(t,e));break}}t=t.return}}function r1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&a,tt===e&&(st&a)===a&&(Ke===4||Ke===3&&(st&130023424)===st&&500>Ve()-$h?Bo(e,0):zh|=a),Nt(e,t)}function Aw(e,t){t===0&&((e.mode&1)===0?t=1:(t=td,td<<=1,(td&130023424)===0&&(td=4194304)));var a=bt();e=ir(e,t),e!==null&&(Sl(e,t,a),Nt(e,a))}function o1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Aw(e,a)}function n1(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),Aw(e,a)}var Rw;Rw=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dt.current)Et=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return Et=!1,WT(e,t,a);Et=(e.flags&131072)!==0}else Et=!1,_e&&(t.flags&1048576)!==0&&M0(t,Bd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Sd(e,t),e=t.pendingProps;var o=ss(t,vt.current);rs(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,Mt(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,_e&&n&&kh(t),It(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(Sd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=i1(r),e=wa(r,e),o){case 0:t=Jm(null,t,r,e,a);break e;case 1:t=bv(null,t,r,e,a);break e;case 11:t=Lv(null,t,r,e,a);break e;case 14:t=Iv(null,t,r,wa(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:wa(r,o),Jm(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:wa(r,o),bv(e,t,r,o,a);case 3:e:{if(pw(t),e===null)throw Error(_(387));r=t.pendingProps,n=t.memoizedState,o=n.element,V0(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=ds(Error(_(423)),t),t=kv(e,t,r,a,o);break e}else if(r!==o){o=ds(Error(_(424)),t),t=kv(e,t,r,a,o);break e}else for(Wt=$r(t.stateNode.containerInfo.firstChild),Gt=t,_e=!0,Sa=null,a=B0(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(is(),r===o){t=lr(e,t,a);break e}It(e,t,r,a)}t=t.child}return t;case 5:return j0(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),fw(e,t),It(e,t,s,a),t.child;case 6:return e===null&&Wm(t),null;case 13:return mw(e,t,a);case 4:return Mh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ls(t,null,r,a):It(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:wa(r,o),Lv(e,t,r,o,a);case 7:return It(e,t,t.pendingProps,a),t.child;case 8:return It(e,t,t.pendingProps.children,a),t.child;case 12:return It(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(ba(n.value,s)){if(n.children===o.children&&!Dt.current){t=lr(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=or(-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}It(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,rs(t,a),o=ca(o),r=r(o),t.flags|=1,It(e,t,r,a),t.child;case 14:return r=t.type,o=wa(r,t.pendingProps),o=wa(r.type,o),Iv(e,t,r,o,a);case 15:return dw(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:wa(r,o),Sd(e,t),t.tag=1,Mt(r)?(e=!0,Od(t)):e=!1,rs(t,a),iw(t,r,o),Xm(t,r,o,a),Ym(null,t,r,!0,e,a);case 19:return hw(e,t,a);case 22:return cw(e,t,a)}throw Error(_(156,t.tag))};function _w(e,t){return o0(e,t)}function s1(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 ua(e,t,a,r){return new s1(e,t,a,r)}function Xh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function i1(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 Xr(e,t){var a=e.alternate;return a===null?(a=ua(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 bd(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 qn:return Uo(a.children,o,n,t);case ph:s=8,o|=8;break;case vm:return e=ua(12,a,t,o|2),e.elementType=vm,e.lanes=n,e;case wm:return e=ua(13,a,t,o),e.elementType=wm,e.lanes=n,e;case Cm:return e=ua(19,a,t,o),e.elementType=Cm,e.lanes=n,e;case jv:return sc(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Uv:s=10;break e;case Vv:s=9;break e;case mh:s=11;break e;case hh:s=14;break e;case Or:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=ua(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Uo(e,t,a,r){return e=ua(7,e,r,t),e.lanes=a,e}function sc(e,t,a,r){return e=ua(22,e,r,t),e.elementType=jv,e.lanes=a,e.stateNode={isHidden:!1},e}function gm(e,t,a){return e=ua(6,e,null,t),e.lanes=a,e}function ym(e,t,a){return t=ua(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function l1(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 l1(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=ua(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 u1(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:jn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Ew(e){if(!e)return Jr;e=e._reactInternals;e:{if(Wo(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(Mt(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(Mt(a))return E0(e,a,t)}return t}function Dw(e,t,a,r,o,n,s,i,l){return e=Qh(a,r,!0,e,o,n,s,i,l),e.context=Ew(null),a=e.current,r=bt(),o=Kr(a),n=or(r,o),n.callback=t??null,Wr(a,n,o),e.current.lanes=o,Sl(e,o,r),Nt(e,r),e}function ic(e,t,a,r){var o=t.current,n=bt(),s=Kr(o);return a=Ew(a),t.context===null?t.context=a:t.pendingContext=a,t=or(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Wr(o,t,s),e!==null&&(Ia(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 Ov(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){Ov(e,t),(e=e.alternate)&&Ov(e,t)}function d1(){return null}var Mw=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;zo(function(){ic(null,e,null,null)}),t[sr]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var t=c0();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Br.length&&t!==0&&t<Br[a].priority;a++);Br.splice(a,0,e),a===0&&p0(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 Fv(){}function c1(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=Dw(t,r,e,0,null,!1,!1,"",Fv);return e._reactRootContainer=s,e[sr]=s.current,pl(e.nodeType===8?e.parentNode:e),zo(),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,"",Fv);return e._reactRootContainer=l,e[sr]=l.current,pl(e.nodeType===8?e.parentNode:e),zo(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=c1(a,t,e,o,r);return Xd(s)}u0=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),Nt(t,Ve()),(le&6)===0&&(cs=Ve()+500,eo()))}break;case 13:zo(function(){var r=ir(e,1);if(r!==null){var o=bt();Ia(r,e,1,o)}}),Jh(e,1)}};vh=function(e){if(e.tag===13){var t=ir(e,134217728);if(t!==null){var a=bt();Ia(t,e,134217728,a)}Jh(e,134217728)}};d0=function(e){if(e.tag===13){var t=Kr(e),a=ir(e,t);if(a!==null){var r=bt();Ia(a,e,t,r)}Jh(e,t)}};c0=function(){return he};f0=function(e,t){var a=he;try{return he=e,t()}finally{he=a}};_m=function(e,t,a){switch(t){case"input":if(Im(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));Hv(r),Im(r,o)}}}break;case"textarea":$v(e,a);break;case"select":t=a.value,t!=null&&Zn(e,!!a.multiple,t,!1)}};Yv=Wh;Zv=zo;var f1={usingClientEntryPoint:!1,Events:[Il,Wn,ec,Qv,Jv,Wh]},zi={findFiberByHostInstance:No,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},p1={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:ur.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=a0(e),e===null?null:e.stateNode},findFiberByHostInstance:zi.findFiberByHostInstance||d1,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(p1),Ma=$i}catch{}var $i;Qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f1;Qt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zh(t))throw Error(_(200));return u1(e,t,null,a)};Qt.createRoot=function(e,t){if(!Zh(e))throw Error(_(299));var a=!1,r="",o=Mw;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[sr]=t.current,pl(e.nodeType===8?e.parentNode:e),new Yh(t)};Qt.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=a0(t),e=e===null?null:e.stateNode,e};Qt.flushSync=function(e){return zo(e)};Qt.hydrate=function(e,t,a){if(!uc(t))throw Error(_(200));return dc(null,e,t,!0,a)};Qt.hydrateRoot=function(e,t,a){if(!Zh(e))throw Error(_(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=Mw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=Dw(t,null,e,1,a??null,o,!1,n,s),e[sr]=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)};Qt.render=function(e,t,a){if(!uc(t))throw Error(_(200));return dc(null,e,t,!1,a)};Qt.unmountComponentAtNode=function(e){if(!uc(e))throw Error(_(40));return e._reactRootContainer?(zo(function(){dc(null,null,e,!1,function(){e._reactRootContainer=null,e[sr]=null})}),!0):!1};Qt.unstable_batchedUpdates=Wh;Qt.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)};Qt.version="18.3.1-next-f1338f8080-20240426"});var eg=Ze((oM,Fw)=>{"use strict";function Ow(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ow)}catch(e){console.error(e)}}Ow(),Fw.exports=Nw()});var Uw=Ze(tg=>{"use strict";var Bw=eg();tg.createRoot=Bw.createRoot,tg.hydrateRoot=Bw.hydrateRoot;var nM});var Go={};ox(Go,{Headers:()=>rg,Request:()=>g1,Response:()=>y1,default:()=>ag,fetch:()=>h1});var m1,ms,h1,ag,rg,g1,y1,to=Qk(()=>{"use strict";m1=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")},ms=m1(),h1=ms.fetch,ag=ms.fetch.bind(ms),rg=ms.Headers,g1=ms.Request,y1=ms.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 jw=Rl&&Rl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rl,"__esModule",{value:!0});var v1=jw((to(),sx(Go))),w1=jw(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=v1.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 C=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),L=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");C&&L&&L.length>1&&(c=parseInt(L[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 C=await n.text();try{u=JSON.parse(C),Array.isArray(u)&&n.status===404&&(d=[],u=null,f=200,m="OK")}catch{n.status===404&&C===""?(f=204,m="No Content"):u={message:C}}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 w1.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 C1=_l&&_l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_l,"__esModule",{value:!0});var S1=C1(lg()),ug=class extends S1.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 L1=El&&El.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(El,"__esModule",{value:!0});var I1=L1(dg()),cg=class extends I1.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 b1=Ml&&Ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ml,"__esModule",{value:!0});var Dl=b1(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 qw=Ze(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.version=void 0;mc.version="0.0.0-automated"});var Hw=Ze(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.DEFAULT_HEADERS=void 0;var k1=qw();hc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${k1.version}`}});var $w=Ze(Nl=>{"use strict";var zw=Nl&&Nl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nl,"__esModule",{value:!0});var P1=zw(pg()),T1=zw(pc()),A1=Hw(),mg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},A1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new P1.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 T1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Nl.default=mg});var Yw=Ze(lt=>{"use strict";var hs=lt&<.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lt,"__esModule",{value:!0});lt.PostgrestError=lt.PostgrestBuilder=lt.PostgrestTransformBuilder=lt.PostgrestFilterBuilder=lt.PostgrestQueryBuilder=lt.PostgrestClient=void 0;var Ww=hs($w());lt.PostgrestClient=Ww.default;var Gw=hs(pg());lt.PostgrestQueryBuilder=Gw.default;var Kw=hs(pc());lt.PostgrestFilterBuilder=Kw.default;var Xw=hs(dg());lt.PostgrestTransformBuilder=Xw.default;var Qw=hs(lg());lt.PostgrestBuilder=Qw.default;var Jw=hs(sg());lt.PostgrestError=Jw.default;lt.default={PostgrestClient:Ww.default,PostgrestQueryBuilder:Gw.default,PostgrestFilterBuilder:Kw.default,PostgrestTransformBuilder:Xw.default,PostgrestBuilder:Qw.default,PostgrestError:Jw.default}});var lS=Ze(Fc=>{"use strict";var $A=W(),WA=Symbol.for("react.element"),GA=Symbol.for("react.fragment"),KA=Object.prototype.hasOwnProperty,XA=$A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,QA={key:!0,ref:!0,__self:!0,__source:!0};function iS(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)KA.call(t,r)&&!QA.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:WA,type:e,key:n,ref:s,props:o,_owner:XA.current}}Fc.Fragment=GA;Fc.jsx=iS;Fc.jsxs=iS});var ie=Ze((QN,uS)=>{"use strict";uS.exports=lS()});var XD={};ox(XD,{initKiteChat:()=>Ip});var Xa=N(W(),1),Pk=N(Uw(),1);var F=N(W(),1);var Vw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(to(),Go)).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 x1=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=Vw(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return x1(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(C=>{throw new cc(C)}),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 Zw=N(Yw(),1),{PostgrestClient:eC,PostgrestQueryBuilder:LM,PostgrestFilterBuilder:IM,PostgrestTransformBuilder:bM,PostgrestBuilder:kM,PostgrestError:R1}=Zw.default;function tC(){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 aC=tC();var rC="2.11.15";var oC=`realtime-js/${rC}`,nC="1.0.0";var yc=1e4,sC=1e3,gs;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(gs||(gs={}));var ut;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(ut||(ut={}));var Jt;(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"})(Jt||(Jt={}));var gc;(function(e){e.websocket="websocket"})(gc||(gc={}));var ao;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(ao||(ao={}));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 Ko=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 Ce;(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"})(Ce||(Ce={}));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]=_1(s,e,t,o),n),{})},_1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?iC(n,s):hg(s)},iC=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return N1(t,a)}switch(e){case Ce.bool:return E1(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return D1(t);case Ce.json:case Ce.jsonb:return M1(t);case Ce.timestamp:return O1(t);case Ce.abstime:case Ce.date:case Ce.daterange:case Ce.int4range:case Ce.int8range:case Ce.money:case Ce.reltime:case Ce.text:case Ce.time:case Ce.timestamptz:case Ce.timetz:case Ce.tsrange:case Ce.tstzrange:return hg(t);default:return hg(t)}},hg=e=>e,E1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},D1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},M1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},N1=(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=>iC(t,i))}return e},O1=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 Xo=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 ys=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(L=>L.presence_ref),m=c.map(L=>L.presence_ref),x=d.filter(L=>m.indexOf(L.presence_ref)<0),C=c.filter(L=>f.indexOf(L.presence_ref)<0);x.length>0&&(i[u]=x),C.length>0&&(l[u]=C)}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 Oa;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Oa||(Oa={}));var xs=class e{constructor(t,a={config:{}},r){this.topic=t,this.params=a,this.socket=r,this.bindings={},this.state=ut.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 Xo(this,Jt.join,this.params,this.timeout),this.rejoinTimer=new Ko(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ut.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=ut.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ut.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Jt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new ys(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==ut.closed){let{config:{broadcast:n,presence:s,private:i}}=this.params;this._onError(d=>t?.(Oa.CHANNEL_ERROR,d)),this._onClose(()=>t?.(Oa.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?.(Oa.SUBSCRIBED);return}else{let f=this.bindings.postgres_changes,m=(c=f?.length)!==null&&c!==void 0?c:0,x=[];for(let C=0;C<m;C++){let L=f[C],{filter:{event:h,schema:y,table:g,filter:w}}=L,I=d&&d[C];if(I&&I.event===h&&I.schema===y&&I.table===g&&I.filter===w)x.push(Object.assign(Object.assign({},L),{id:I.id}));else{this.unsubscribe(),this.state=ut.errored,t?.(Oa.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Oa.SUBSCRIBED);return}}).receive("error",d=>{this.state=ut.errored,t?.(Oa.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(Oa.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=ut.leaving;let a=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Jt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Xo(this,Jt.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 Xo(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}=Jt;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,C,L;return((x=m.filter)===null||x===void 0?void 0:x.event)==="*"||((L=(C=m.filter)===null||C===void 0?void 0:C.event)===null||L===void 0?void 0:L.toLocaleLowerCase())===s}).map(m=>m.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(m=>{var x,C,L,h,y,g;if(["broadcast","presence","postgres_changes"].includes(s))if("id"in m){let w=m.id,I=(x=m.filter)===null||x===void 0?void 0:x.event;return w&&((C=a.ids)===null||C===void 0?void 0:C.includes(w))&&(I==="*"||I?.toLocaleLowerCase()===((L=a.data)===null||L===void 0?void 0:L.type.toLocaleLowerCase()))}else{let w=(y=(h=m?.filter)===null||h===void 0?void 0:h.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return w==="*"||w===((g=a?.event)===null||g===void 0?void 0:g.toLocaleLowerCase())}else return m.type.toLocaleLowerCase()===s}).map(m=>{if(typeof f=="object"&&"ids"in f){let x=f.data,{schema:C,table:L,commit_timestamp:h,type:y,errors:g}=x;f=Object.assign(Object.assign({},{schema:C,table:L,commit_timestamp:h,eventType:y,new:{},old:{},errors:g}),this._getPayloadRecords(x))}m.callback(f,r)})}_isClosed(){return this.state===ut.closed}_isJoined(){return this.state===ut.joined}_isJoining(){return this.state===ut.joining}_isLeaving(){return this.state===ut.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(Jt.close,{},t)}_onError(t){this._on(Jt.error,{},a=>t(a))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ut.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 lC=()=>{},B1=`
|
|
8
|
+
`+n.stack}return{value:e,source:t,stack:o,digest:null}}function pm(e,t,a){return{value:e,source:null,stack:a??null,digest:t??null}}function Xm(e,t){try{console.error(t.value)}catch(a){setTimeout(function(){throw a})}}var $T=typeof WeakMap=="function"?WeakMap:Map;function lw(e,t,a){a=nr(-1,a),a.tag=3,a.payload={element:null};var r=t.value;return a.callback=function(){$d||($d=!0,nh=r),Xm(e,t)},a}function uw(e,t,a){a=nr(-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(){Xm(e,t)}}var n=e.stateNode;return n!==null&&typeof n.componentDidCatch=="function"&&(a.callback=function(){Xm(e,t),typeof r!="function"&&(zr===null?zr=new Set([this]):zr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),a}function wv(e,t,a){var r=e.pingCache;if(r===null){r=e.pingCache=new $T;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=n1.bind(null,e,t,a),t.then(e,e))}function Sv(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 Cv(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=nr(-1,1),t.tag=2,Hr(a,t,1))),a.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var WT=dr.ReactCurrentOwner,Mt=!1;function kt(e,t,a,r){t.child=e===null?B0(t,null,a,r):ss(t,e.child,a,r)}function Lv(e,t,a,r,o){a=a.render;var n=t.ref;return ts(t,o),r=Fh(e,t,a,r,n,o),a=Bh(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ur(e,t,o)):(Re&&a&&bh(t),t.flags|=1,kt(e,t,r,o),t.child)}function Iv(e,t,a,r,o){if(e===null){var n=a.type;return typeof n=="function"&&!Kh(n)&&n.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(t.tag=15,t.type=n,dw(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:cl,a(s,r)&&e.ref===t.ref)return ur(e,t,o)}return t.flags|=1,e=Wr(n,r),e.ref=t.ref,e.return=t,t.child=e}function dw(e,t,a,r,o){if(e!==null){var n=e.memoizedProps;if(cl(n,r)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=r=n,(e.lanes&o)!==0)(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,ur(e,t,o)}return Qm(e,t,a,r,o)}function cw(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},Se(Qn,$t),$t|=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,Se(Qn,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=n!==null?n.baseLanes:a,Se(Qn,$t),$t|=r}else n!==null?(r=n.baseLanes|a,t.memoizedState=null):r=a,Se(Qn,$t),$t|=r;return kt(e,t,o,a),t.child}function fw(e,t){var a=t.ref;(e===null&&a!==null||e!==null&&e.ref!==a)&&(t.flags|=512,t.flags|=2097152)}function Qm(e,t,a,r,o){var n=Ot(a)?Fo:wt.current;return n=os(t,n),ts(t,o),a=Fh(e,t,a,r,n,o),r=Bh(),e!==null&&!Mt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ur(e,t,o)):(Re&&r&&bh(t),t.flags|=1,kt(e,t,a,o),t.child)}function bv(e,t,a,r,o){if(Ot(a)){var n=!0;Nd(t)}else n=!1;if(ts(t,o),t.stateNode===null)Sd(e,t),iw(t,a,r),Km(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=da(u):(u=Ot(a)?Fo:wt.current,u=os(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)&&vv(t,s,r,u),Mr=!1;var f=t.memoizedState;s.state=f,Vd(t,r,s,o),l=t.memoizedState,i!==r||f!==l||Nt.current||Mr?(typeof d=="function"&&(Gm(t,a,d,r),l=t.memoizedState),(i=Mr||xv(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,V0(e,t),i=t.memoizedProps,u=t.type===t.elementType?i:Sa(t.type,i),s.props=u,c=t.pendingProps,f=s.context,l=a.contextType,typeof l=="object"&&l!==null?l=da(l):(l=Ot(a)?Fo:wt.current,l=os(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)&&vv(t,s,r,l),Mr=!1,f=t.memoizedState,s.state=f,Vd(t,r,s,o);var x=t.memoizedState;i!==c||f!==x||Nt.current||Mr?(typeof m=="function"&&(Gm(t,a,m,r),x=t.memoizedState),(u=Mr||xv(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 Jm(e,t,a,r,n,o)}function Jm(e,t,a,r,o,n){fw(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&dv(t,a,!1),ur(e,t,n);r=t.stateNode,WT.current=t;var i=s&&typeof a.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=ss(t,e.child,null,n),t.child=ss(t,null,i,n)):kt(e,t,i,n),t.memoizedState=r.state,o&&dv(t,a,!0),t.child}function pw(e){var t=e.stateNode;t.pendingContext?uv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uv(e,t.context,!1),Dh(e,t.containerInfo)}function kv(e,t,a,r,o){return ns(),Ph(o),t.flags|=256,kt(e,t,a,r),t.child}var Ym={dehydrated:null,treeContext:null,retryLane:0};function Zm(e){return{baseLanes:e,cachePool:null,transitions:null}}function mw(e,t,a){var r=t.pendingProps,o=_e.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),Se(_e,o&1),e===null)return $m(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=nc(s,r,0,null),e=Oo(e,r,a,null),n.return=t,e.return=t,n.sibling=e,t.child=n,t.child.memoizedState=Zm(a),t.memoizedState=Ym,e):jh(t,s));if(o=e.memoizedState,o!==null&&(i=o.dehydrated,i!==null))return GT(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=Wr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),i!==null?n=Wr(i,n):(n=Oo(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?Zm(a):{baseLanes:s.baseLanes|a,cachePool:null,transitions:s.transitions},n.memoizedState=s,n.childLanes=e.childLanes&~a,t.memoizedState=Ym,r}return n=e.child,e=n.sibling,r=Wr(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 jh(e,t){return t=nc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fd(e,t,a,r){return r!==null&&Ph(r),ss(t,e.child,null,a),e=jh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function GT(e,t,a,r,o,n,s){if(a)return t.flags&256?(t.flags&=-257,r=pm(Error(_(422))),fd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(n=r.fallback,o=t.mode,r=nc({mode:"visible",children:r.children},o,0,null),n=Oo(n,o,s,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,(t.mode&1)!==0&&ss(t,e.child,null,s),t.child.memoizedState=Zm(s),t.memoizedState=Ym,n);if((t.mode&1)===0)return fd(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=pm(n,r,void 0),fd(e,t,s,r)}if(i=(s&e.childLanes)!==0,Mt||i){if(r=et,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,lr(e,o),ba(r,e,o,-1))}return Gh(),r=pm(Error(_(421))),fd(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=s1.bind(null,e),o._reactRetry=t,null):(e=n.treeContext,Wt=qr(o.nextSibling),Gt=t,Re=!0,La=null,e!==null&&(sa[ia++]=rr,sa[ia++]=or,sa[ia++]=Bo,rr=e.id,or=e.overflow,Bo=t),t=jh(t,r.children),t.flags|=4096,t)}function Pv(e,t,a){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wm(e.return,t,a)}function mm(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 hw(e,t,a){var r=t.pendingProps,o=r.revealOrder,n=r.tail;if(kt(e,t,r.children,a),r=_e.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&&Pv(e,a,t);else if(e.tag===19)Pv(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(Se(_e,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&&jd(e)===null&&(o=a),a=a.sibling;a=o,a===null?(o=t.child,t.child=null):(o=a.sibling,a.sibling=null),mm(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&&jd(e)===null){t.child=o;break}e=o.sibling,o.sibling=a,a=o,o=e}mm(t,!0,a,null,n);break;case"together":mm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Sd(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ur(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Vo|=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=Wr(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Wr(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function KT(e,t,a){switch(t.tag){case 3:pw(t),ns();break;case 5:j0(t);break;case 1:Ot(t.type)&&Nd(t);break;case 4:Dh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Se(Bd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Se(_e,_e.current&1),t.flags|=128,null):(a&t.child.childLanes)!==0?mw(e,t,a):(Se(_e,_e.current&1),e=ur(e,t,a),e!==null?e.sibling:null);Se(_e,_e.current&1);break;case 19:if(r=(a&t.childLanes)!==0,(e.flags&128)!==0){if(r)return hw(e,t,a);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Se(_e,_e.current),r)break;return null;case 22:case 23:return t.lanes=0,cw(e,t,a)}return ur(e,t,a)}var gw,eh,yw,xw;gw=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}};eh=function(){};yw=function(e,t,a,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Mo(Fa.current);var n=null;switch(a){case"input":o=Cm(e,o),r=Cm(e,r),n=[];break;case"select":o=De({},o,{value:void 0}),r=De({},r,{value:void 0}),n=[];break;case"textarea":o=bm(e,o),r=bm(e,r),n=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Dd)}Pm(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"&&(ol.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"&&(ol.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)}};xw=function(e,t,a,r){a!==r&&(t.flags|=4)};function qi(e,t){if(!Re)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 XT(e,t,a){var r=t.pendingProps;switch(kh(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 Ot(t.type)&&Md(),xt(t),null;case 3:return r=t.stateNode,is(),ke(Nt),ke(wt),Nh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(dd(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,La!==null&&(lh(La),La=null))),eh(e,t),xt(t),null;case 5:Mh(t);var o=Mo(gl.current);if(a=t.type,e!==null&&t.stateNode!=null)yw(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=Mo(Fa.current),dd(t)){r=t.stateNode,a=t.type;var n=t.memoizedProps;switch(r[Na]=t,r[ml]=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<Ki.length;o++)be(Ki[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":Nx(r,n),be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!n.multiple},be("invalid",r);break;case"textarea":Fx(r,n),be("invalid",r)}Pm(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&&ud(r.textContent,i,e),o=["children",i]):typeof i=="number"&&r.textContent!==""+i&&(n.suppressHydrationWarning!==!0&&ud(r.textContent,i,e),o=["children",""+i]):ol.hasOwnProperty(s)&&i!=null&&s==="onScroll"&&be("scroll",r)}switch(a){case"input":Ju(r),Ox(r,n,!0);break;case"textarea":Ju(r),Bx(r);break;case"select":case"option":break;default:typeof n.onClick=="function"&&(r.onclick=Dd)}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=Wv(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[Na]=t,e[ml]=r,gw(e,t,!1,!1),t.stateNode=e;e:{switch(s=Tm(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<Ki.length;o++)be(Ki[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":Nx(e,r),o=Cm(e,r),be("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=De({},r,{value:void 0}),be("invalid",e);break;case"textarea":Fx(e,r),o=bm(e,r),be("invalid",e);break;default:o=r}Pm(a,o),i=o;for(n in i)if(i.hasOwnProperty(n)){var l=i[n];n==="style"?Xv(e,l):n==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Gv(e,l)):n==="children"?typeof l=="string"?(a!=="textarea"||l!=="")&&nl(e,l):typeof l=="number"&&nl(e,""+l):n!=="suppressContentEditableWarning"&&n!=="suppressHydrationWarning"&&n!=="autoFocus"&&(ol.hasOwnProperty(n)?l!=null&&n==="onScroll"&&be("scroll",e):l!=null&&ch(e,n,l,s))}switch(a){case"input":Ju(e),Ox(e,r,!1);break;case"textarea":Ju(e),Bx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Gr(r.value));break;case"select":e.multiple=!!r.multiple,n=r.value,n!=null?Jn(e,!!r.multiple,n,!1):r.defaultValue!=null&&Jn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Dd)}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)xw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(a=Mo(gl.current),Mo(Fa.current),dd(t)){if(r=t.stateNode,a=t.memoizedProps,r[Na]=t,(n=r.nodeValue!==a)&&(e=Gt,e!==null))switch(e.tag){case 3:ud(r.nodeValue,a,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ud(r.nodeValue,a,(e.mode&1)!==0)}n&&(t.flags|=4)}else r=(a.nodeType===9?a:a.ownerDocument).createTextNode(r),r[Na]=t,t.stateNode=r}return xt(t),null;case 13:if(ke(_e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Re&&Wt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)O0(),ns(),t.flags|=98560,n=!1;else if(n=dd(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[Na]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),n=!1}else La!==null&&(lh(La),La=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||(_e.current&1)!==0?Ke===0&&(Ke=3):Gh())),t.updateQueue!==null&&(t.flags|=4),xt(t),null);case 4:return is(),eh(e,t),e===null&&fl(t.stateNode.containerInfo),xt(t),null;case 10:return Rh(t.type._context),xt(t),null;case 17:return Ot(t.type)&&Md(),xt(t),null;case 19:if(ke(_e),n=t.memoizedState,n===null)return xt(t),null;if(r=(t.flags&128)!==0,s=n.rendering,s===null)if(r)qi(n,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=jd(e),s!==null){for(t.flags|=128,qi(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 Se(_e,_e.current&1|2),t.child}e=e.sibling}n.tail!==null&&Ue()>us&&(t.flags|=128,r=!0,qi(n,!1),t.lanes=4194304)}else{if(!r)if(e=jd(s),e!==null){if(t.flags|=128,r=!0,a=e.updateQueue,a!==null&&(t.updateQueue=a,t.flags|=4),qi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate&&!Re)return xt(t),null}else 2*Ue()-n.renderingStartTime>us&&a!==1073741824&&(t.flags|=128,r=!0,qi(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=Ue(),t.sibling=null,a=_e.current,Se(_e,r?a&1|2:a&1),t):(xt(t),null);case 22:case 23:return Wh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?($t&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 QT(e,t){switch(kh(t),t.tag){case 1:return Ot(t.type)&&Md(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return is(),ke(Nt),ke(wt),Nh(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Mh(t),null;case 13:if(ke(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(_e),null;case 4:return is(),null;case 10:return Rh(t.type._context),null;case 22:case 23:return Wh(),null;case 24:return null;default:return null}}var pd=!1,vt=!1,JT=typeof WeakSet=="function"?WeakSet:Set,B=null;function Xn(e,t){var a=e.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(r){Oe(e,t,r)}else a.current=null}function th(e,t,a){try{a()}catch(r){Oe(e,t,r)}}var Tv=!1;function YT(e,t){if(Bm=Rd,e=L0(),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(Um={focusedElem:e,selectionRange:a},Rd=!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,I=x.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:Sa(t.type,w),I);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){Oe(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return x=Tv,Tv=!1,x}function tl(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&&th(t,a,n)}o=o.next}while(o!==r)}}function rc(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 ah(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 vw(e){var t=e.alternate;t!==null&&(e.alternate=null,vw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Na],delete t[ml],delete t[qm],delete t[MT],delete t[NT])),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 ww(e){return e.tag===5||e.tag===3||e.tag===4}function Av(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ww(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 rh(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=Dd));else if(r!==4&&(e=e.child,e!==null))for(rh(e,t,a),e=e.sibling;e!==null;)rh(e,t,a),e=e.sibling}function oh(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(oh(e,t,a),e=e.sibling;e!==null;)oh(e,t,a),e=e.sibling}var st=null,Ca=!1;function Er(e,t,a){for(a=a.child;a!==null;)Sw(e,t,a),a=a.sibling}function Sw(e,t,a){if(Oa&&typeof Oa.onCommitFiberUnmount=="function")try{Oa.onCommitFiberUnmount(Xd,a)}catch{}switch(a.tag){case 5:vt||Xn(a,t);case 6:var r=st,o=Ca;st=null,Er(e,t,a),st=r,Ca=o,st!==null&&(Ca?(e=st,a=a.stateNode,e.nodeType===8?e.parentNode.removeChild(a):e.removeChild(a)):st.removeChild(a.stateNode));break;case 18:st!==null&&(Ca?(e=st,a=a.stateNode,e.nodeType===8?im(e.parentNode,a):e.nodeType===1&&im(e,a),ul(e)):im(st,a.stateNode));break;case 4:r=st,o=Ca,st=a.stateNode.containerInfo,Ca=!0,Er(e,t,a),st=r,Ca=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)&&th(a,t,s),o=o.next}while(o!==r)}Er(e,t,a);break;case 1:if(!vt&&(Xn(a,t),r=a.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=a.memoizedProps,r.state=a.memoizedState,r.componentWillUnmount()}catch(i){Oe(a,t,i)}Er(e,t,a);break;case 21:Er(e,t,a);break;case 22:a.mode&1?(vt=(r=vt)||a.memoizedState!==null,Er(e,t,a),vt=r):Er(e,t,a);break;default:Er(e,t,a)}}function Rv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var a=e.stateNode;a===null&&(a=e.stateNode=new JT),t.forEach(function(r){var o=i1.bind(null,e,r);a.has(r)||(a.add(r),r.then(o,o))})}}function wa(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,Ca=!1;break e;case 3:st=i.stateNode.containerInfo,Ca=!0;break e;case 4:st=i.stateNode.containerInfo,Ca=!0;break e}i=i.return}if(st===null)throw Error(_(160));Sw(n,s,o),st=null,Ca=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Oe(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Cw(t,e),t=t.sibling}function Cw(e,t){var a=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wa(t,e),Da(e),r&4){try{tl(3,e,e.return),rc(3,e)}catch(w){Oe(e,e.return,w)}try{tl(5,e,e.return)}catch(w){Oe(e,e.return,w)}}break;case 1:wa(t,e),Da(e),r&512&&a!==null&&Xn(a,a.return);break;case 5:if(wa(t,e),Da(e),r&512&&a!==null&&Xn(a,a.return),e.flags&32){var o=e.stateNode;try{nl(o,"")}catch(w){Oe(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&&zv(o,n),Tm(i,s);var u=Tm(i,n);for(s=0;s<l.length;s+=2){var d=l[s],c=l[s+1];d==="style"?Xv(o,c):d==="dangerouslySetInnerHTML"?Gv(o,c):d==="children"?nl(o,c):ch(o,d,c,u)}switch(i){case"input":Lm(o,n);break;case"textarea":$v(o,n);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!n.multiple;var m=n.value;m!=null?Jn(o,!!n.multiple,m,!1):f!==!!n.multiple&&(n.defaultValue!=null?Jn(o,!!n.multiple,n.defaultValue,!0):Jn(o,!!n.multiple,n.multiple?[]:"",!1))}o[ml]=n}catch(w){Oe(e,e.return,w)}}break;case 6:if(wa(t,e),Da(e),r&4){if(e.stateNode===null)throw Error(_(162));o=e.stateNode,n=e.memoizedProps;try{o.nodeValue=n}catch(w){Oe(e,e.return,w)}}break;case 3:if(wa(t,e),Da(e),r&4&&a!==null&&a.memoizedState.isDehydrated)try{ul(t.containerInfo)}catch(w){Oe(e,e.return,w)}break;case 4:wa(t,e),Da(e);break;case 13:wa(t,e),Da(e),o=e.child,o.flags&8192&&(n=o.memoizedState!==null,o.stateNode.isHidden=n,!n||o.alternate!==null&&o.alternate.memoizedState!==null||(zh=Ue())),r&4&&Rv(e);break;case 22:if(d=a!==null&&a.memoizedState!==null,e.mode&1?(vt=(u=vt)||d,wa(t,e),vt=u):wa(t,e),Da(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:tl(4,f,f.return);break;case 1:Xn(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){Oe(r,a,w)}}break;case 5:Xn(f,f.return);break;case 22:if(f.memoizedState!==null){Ev(c);continue}}m!==null?(m.return=f,B=m):Ev(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=Kv("display",s))}catch(w){Oe(e,e.return,w)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(w){Oe(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:wa(t,e),Da(e),r&4&&Rv(e);break;case 21:break;default:wa(t,e),Da(e)}}function Da(e){var t=e.flags;if(t&2){try{e:{for(var a=e.return;a!==null;){if(ww(a)){var r=a;break e}a=a.return}throw Error(_(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(nl(o,""),r.flags&=-33);var n=Av(e);oh(e,n,o);break;case 3:case 4:var s=r.stateNode.containerInfo,i=Av(e);rh(e,i,s);break;default:throw Error(_(161))}}catch(l){Oe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ZT(e,t,a){B=e,Lw(e,t,a)}function Lw(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||pd;if(!s){var i=o.alternate,l=i!==null&&i.memoizedState!==null||vt;i=pd;var u=vt;if(pd=s,(vt=l)&&!u)for(B=o;B!==null;)s=B,l=s.child,s.tag===22&&s.memoizedState!==null?Dv(o):l!==null?(l.return=s,B=l):Dv(o);for(;n!==null;)B=n,Lw(n,t,a),n=n.sibling;B=o,pd=i,vt=u}_v(e,t,a)}else(o.subtreeFlags&8772)!==0&&n!==null?(n.return=o,B=n):_v(e,t,a)}}function _v(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||rc(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:Sa(t.type,a.memoizedProps);r.componentDidUpdate(o,a.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var n=t.updateQueue;n!==null&&hv(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}hv(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&&ul(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}vt||t.flags&512&&ah(t)}catch(f){Oe(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 Ev(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 Dv(e){for(;B!==null;){var t=B;try{switch(t.tag){case 0:case 11:case 15:var a=t.return;try{rc(4,t)}catch(l){Oe(t,a,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Oe(t,o,l)}}var n=t.return;try{ah(t)}catch(l){Oe(t,n,l)}break;case 5:var s=t.return;try{ah(t)}catch(l){Oe(t,s,l)}}}catch(l){Oe(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 e1=Math.ceil,zd=dr.ReactCurrentDispatcher,qh=dr.ReactCurrentOwner,ua=dr.ReactCurrentBatchConfig,de=0,et=null,qe=null,it=0,$t=0,Qn=Qr(0),Ke=0,wl=null,Vo=0,oc=0,Hh=0,al=null,Dt=null,zh=0,us=1/0,tr=null,$d=!1,nh=null,zr=null,md=!1,Br=null,Wd=0,rl=0,sh=null,Cd=-1,Ld=0;function Pt(){return(de&6)!==0?Ue():Cd!==-1?Cd:Cd=Ue()}function $r(e){return(e.mode&1)===0?1:(de&2)!==0&&it!==0?it&-it:FT.transition!==null?(Ld===0&&(Ld=i0()),Ld):(e=he,e!==0||(e=window.event,e=e===void 0?16:m0(e.type)),e)}function ba(e,t,a,r){if(50<rl)throw rl=0,sh=null,Error(_(185));Sl(e,a,r),((de&2)===0||e!==et)&&(e===et&&((de&2)===0&&(oc|=a),Ke===4&&Or(e,it)),Ft(e,r),a===1&&de===0&&(t.mode&1)===0&&(us=Ue()+500,ec&&Jr()))}function Ft(e,t){var a=e.callbackNode;UP(e,t);var r=Ad(e,e===et?it:0);if(r===0)a!==null&&jx(a),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(a!=null&&jx(a),t===1)e.tag===0?OT(Mv.bind(null,e)):D0(Mv.bind(null,e)),ET(function(){(de&6)===0&&Jr()}),a=null;else{switch(l0(r)){case 1:a=gh;break;case 4:a=n0;break;case 16:a=Td;break;case 536870912:a=s0;break;default:a=Td}a=_w(a,Iw.bind(null,e))}e.callbackPriority=t,e.callbackNode=a}}function Iw(e,t){if(Cd=-1,Ld=0,(de&6)!==0)throw Error(_(327));var a=e.callbackNode;if(as()&&e.callbackNode!==a)return null;var r=Ad(e,e===et?it:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=Gd(e,r);else{t=r;var o=de;de|=2;var n=kw();(et!==e||it!==t)&&(tr=null,us=Ue()+500,No(e,t));do try{r1();break}catch(i){bw(e,i)}while(!0);Ah(),zd.current=n,de=o,qe!==null?t=0:(et=null,it=0,t=Ke)}if(t!==0){if(t===2&&(o=Dm(e),o!==0&&(r=o,t=ih(e,o))),t===1)throw a=wl,No(e,0),Or(e,r),Ft(e,Ue()),a;if(t===6)Or(e,r);else{if(o=e.current.alternate,(r&30)===0&&!t1(o)&&(t=Gd(e,r),t===2&&(n=Dm(e),n!==0&&(r=n,t=ih(e,n))),t===1))throw a=wl,No(e,0),Or(e,r),Ft(e,Ue()),a;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:_o(e,Dt,tr);break;case 3:if(Or(e,r),(r&130023424)===r&&(t=zh+500-Ue(),10<t)){if(Ad(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Pt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=jm(_o.bind(null,e,Dt,tr),t);break}_o(e,Dt,tr);break;case 4:if(Or(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=Ue()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*e1(r/1960))-r,10<r){e.timeoutHandle=jm(_o.bind(null,e,Dt,tr),r);break}_o(e,Dt,tr);break;case 5:_o(e,Dt,tr);break;default:throw Error(_(329))}}}return Ft(e,Ue()),e.callbackNode===a?Iw.bind(null,e):null}function ih(e,t){var a=al;return e.current.memoizedState.isDehydrated&&(No(e,t).flags|=256),e=Gd(e,t),e!==2&&(t=Dt,Dt=a,t!==null&&lh(t)),e}function lh(e){Dt===null?Dt=e:Dt.push.apply(Dt,e)}function t1(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(!ka(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 Or(e,t){for(t&=~Hh,t&=~oc,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 Mv(e){if((de&6)!==0)throw Error(_(327));as();var t=Ad(e,0);if((t&1)===0)return Ft(e,Ue()),null;var a=Gd(e,t);if(e.tag!==0&&a===2){var r=Dm(e);r!==0&&(t=r,a=ih(e,r))}if(a===1)throw a=wl,No(e,0),Or(e,t),Ft(e,Ue()),a;if(a===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,_o(e,Dt,tr),Ft(e,Ue()),null}function $h(e,t){var a=de;de|=1;try{return e(t)}finally{de=a,de===0&&(us=Ue()+500,ec&&Jr())}}function jo(e){Br!==null&&Br.tag===0&&(de&6)===0&&as();var t=de;de|=1;var a=ua.transition,r=he;try{if(ua.transition=null,he=1,e)return e()}finally{he=r,ua.transition=a,de=t,(de&6)===0&&Jr()}}function Wh(){$t=Qn.current,ke(Qn)}function No(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;if(a!==-1&&(e.timeoutHandle=-1,_T(a)),qe!==null)for(a=qe.return;a!==null;){var r=a;switch(kh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Md();break;case 3:is(),ke(Nt),ke(wt),Nh();break;case 5:Mh(r);break;case 4:is();break;case 13:ke(_e);break;case 19:ke(_e);break;case 10:Rh(r.type._context);break;case 22:case 23:Wh()}a=a.return}if(et=e,qe=e=Wr(e.current,null),it=$t=t,Ke=0,wl=null,Hh=oc=Vo=0,Dt=al=null,Do!==null){for(t=0;t<Do.length;t++)if(a=Do[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}Do=null}return e}function bw(e,t){do{var a=qe;try{if(Ah(),vd.current=Hd,qd){for(var r=Ee.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}qd=!1}if(Uo=0,Ze=Ge=Ee=null,el=!1,yl=0,qh.current=null,a===null||a.return===null){Ke=1,wl=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=Sv(s);if(m!==null){m.flags&=-257,Cv(m,s,i,n,t),m.mode&1&&wv(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){wv(n,u,t),Gh();break e}l=Error(_(426))}}else if(Re&&i.mode&1){var I=Sv(s);if(I!==null){(I.flags&65536)===0&&(I.flags|=256),Cv(I,s,i,n,t),Ph(ls(l,i));break e}}n=l=ls(l,i),Ke!==4&&(Ke=2),al===null?al=[n]:al.push(n),n=s;do{switch(n.tag){case 3:n.flags|=65536,t&=-t,n.lanes|=t;var h=lw(n,l,t);mv(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"&&(zr===null||!zr.has(y)))){n.flags|=65536,t&=-t,n.lanes|=t;var C=uw(n,i,t);mv(n,C);break e}}n=n.return}while(n!==null)}Tw(a)}catch(L){t=L,qe===a&&a!==null&&(qe=a=a.return);continue}break}while(!0)}function kw(){var e=zd.current;return zd.current=Hd,e===null?Hd:e}function Gh(){(Ke===0||Ke===3||Ke===2)&&(Ke=4),et===null||(Vo&268435455)===0&&(oc&268435455)===0||Or(et,it)}function Gd(e,t){var a=de;de|=2;var r=kw();(et!==e||it!==t)&&(tr=null,No(e,t));do try{a1();break}catch(o){bw(e,o)}while(!0);if(Ah(),de=a,zd.current=r,qe!==null)throw Error(_(261));return et=null,it=0,Ke}function a1(){for(;qe!==null;)Pw(qe)}function r1(){for(;qe!==null&&!RP();)Pw(qe)}function Pw(e){var t=Rw(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?Tw(e):qe=t,qh.current=null}function Tw(e){var t=e;do{var a=t.alternate;if(e=t.return,(t.flags&32768)===0){if(a=XT(a,t,$t),a!==null){qe=a;return}}else{if(a=QT(a,t),a!==null){a.flags&=32767,qe=a;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ke=6,qe=null;return}}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);Ke===0&&(Ke=5)}function _o(e,t,a){var r=he,o=ua.transition;try{ua.transition=null,he=1,o1(e,t,a,r)}finally{ua.transition=o,he=r}return null}function o1(e,t,a,r){do as();while(Br!==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(VP(e,n),e===et&&(qe=et=null,it=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||md||(md=!0,_w(Td,function(){return as(),null})),n=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||n){n=ua.transition,ua.transition=null;var s=he;he=1;var i=de;de|=4,qh.current=null,YT(e,a),Cw(a,e),kT(Um),Rd=!!Bm,Um=Bm=null,e.current=a,ZT(a,e,o),_P(),de=i,he=s,ua.transition=n}else e.current=a;if(md&&(md=!1,Br=e,Wd=o),n=e.pendingLanes,n===0&&(zr=null),MP(a.stateNode,r),Ft(e,Ue()),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($d)throw $d=!1,e=nh,nh=null,e;return(Wd&1)!==0&&e.tag!==0&&as(),n=e.pendingLanes,(n&1)!==0?e===sh?rl++:(rl=0,sh=e):rl=0,Jr(),null}function as(){if(Br!==null){var e=l0(Wd),t=ua.transition,a=he;try{if(ua.transition=null,he=16>e?16:e,Br===null)var r=!1;else{if(e=Br,Br=null,Wd=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:tl(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(vw(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 I=w.sibling;w.sibling=null,w=I}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:tl(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:rc(9,i)}}catch(L){Oe(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,Jr(),Oa&&typeof Oa.onPostCommitFiberRoot=="function")try{Oa.onPostCommitFiberRoot(Xd,e)}catch{}r=!0}return r}finally{he=a,ua.transition=t}}return!1}function Nv(e,t,a){t=ls(a,t),t=lw(e,t,1),e=Hr(e,t,1),t=Pt(),e!==null&&(Sl(e,1,t),Ft(e,t))}function Oe(e,t,a){if(e.tag===3)Nv(e,e,a);else for(;t!==null;){if(t.tag===3){Nv(t,e,a);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(zr===null||!zr.has(r))){e=ls(a,e),e=uw(t,e,1),t=Hr(t,e,1),e=Pt(),t!==null&&(Sl(t,1,e),Ft(t,e));break}}t=t.return}}function n1(e,t,a){var r=e.pingCache;r!==null&&r.delete(t),t=Pt(),e.pingedLanes|=e.suspendedLanes&a,et===e&&(it&a)===a&&(Ke===4||Ke===3&&(it&130023424)===it&&500>Ue()-zh?No(e,0):Hh|=a),Ft(e,t)}function Aw(e,t){t===0&&((e.mode&1)===0?t=1:(t=ed,ed<<=1,(ed&130023424)===0&&(ed=4194304)));var a=Pt();e=lr(e,t),e!==null&&(Sl(e,t,a),Ft(e,a))}function s1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Aw(e,a)}function i1(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),Aw(e,a)}var Rw;Rw=function(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps||Nt.current)Mt=!0;else{if((e.lanes&a)===0&&(t.flags&128)===0)return Mt=!1,KT(e,t,a);Mt=(e.flags&131072)!==0}else Mt=!1,Re&&(t.flags&1048576)!==0&&M0(t,Fd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Sd(e,t),e=t.pendingProps;var o=os(t,wt.current);ts(t,a),o=Fh(null,t,r,e,o,a);var n=Bh();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,Ot(r)?(n=!0,Nd(t)):n=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Eh(t),o.updater=ac,t.stateNode=o,o._reactInternals=t,Km(t,r,e,a),t=Jm(null,t,r,!0,n,a)):(t.tag=0,Re&&n&&bh(t),kt(null,t,o,a),t=t.child),t;case 16:r=t.elementType;e:{switch(Sd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=u1(r),e=Sa(r,e),o){case 0:t=Qm(null,t,r,e,a);break e;case 1:t=bv(null,t,r,e,a);break e;case 11:t=Lv(null,t,r,e,a);break e;case 14:t=Iv(null,t,r,Sa(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:Sa(r,o),Qm(e,t,r,o,a);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sa(r,o),bv(e,t,r,o,a);case 3:e:{if(pw(t),e===null)throw Error(_(387));r=t.pendingProps,n=t.memoizedState,o=n.element,V0(e,t),Vd(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=ls(Error(_(423)),t),t=kv(e,t,r,a,o);break e}else if(r!==o){o=ls(Error(_(424)),t),t=kv(e,t,r,a,o);break e}else for(Wt=qr(t.stateNode.containerInfo.firstChild),Gt=t,Re=!0,La=null,a=B0(t,null,r,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ns(),r===o){t=ur(e,t,a);break e}kt(e,t,r,a)}t=t.child}return t;case 5:return j0(t),e===null&&$m(t),r=t.type,o=t.pendingProps,n=e!==null?e.memoizedProps:null,s=o.children,Vm(r,o)?s=null:n!==null&&Vm(r,n)&&(t.flags|=32),fw(e,t),kt(e,t,s,a),t.child;case 6:return e===null&&$m(t),null;case 13:return mw(e,t,a);case 4:return Dh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ss(t,null,r,a):kt(e,t,r,a),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sa(r,o),Lv(e,t,r,o,a);case 7:return kt(e,t,t.pendingProps,a),t.child;case 8:return kt(e,t,t.pendingProps.children,a),t.child;case 12:return kt(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,Se(Bd,r._currentValue),r._currentValue=s,n!==null)if(ka(n.value,s)){if(n.children===o.children&&!Nt.current){t=ur(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=nr(-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),Wm(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),Wm(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}kt(e,t,o.children,a),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ts(t,a),o=da(o),r=r(o),t.flags|=1,kt(e,t,r,a),t.child;case 14:return r=t.type,o=Sa(r,t.pendingProps),o=Sa(r.type,o),Iv(e,t,r,o,a);case 15:return dw(e,t,t.type,t.pendingProps,a);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sa(r,o),Sd(e,t),t.tag=1,Ot(r)?(e=!0,Nd(t)):e=!1,ts(t,a),iw(t,r,o),Km(t,r,o,a),Jm(null,t,r,!0,e,a);case 19:return hw(e,t,a);case 22:return cw(e,t,a)}throw Error(_(156,t.tag))};function _w(e,t){return o0(e,t)}function l1(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 la(e,t,a,r){return new l1(e,t,a,r)}function Kh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u1(e){if(typeof e=="function")return Kh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ph)return 11;if(e===mh)return 14}return 2}function Wr(e,t){var a=e.alternate;return a===null?(a=la(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")Kh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Vn:return Oo(a.children,o,n,t);case fh:s=8,o|=8;break;case xm:return e=la(12,a,t,o|2),e.elementType=xm,e.lanes=n,e;case vm:return e=la(13,a,t,o),e.elementType=vm,e.lanes=n,e;case wm:return e=la(19,a,t,o),e.elementType=wm,e.lanes=n,e;case jv:return nc(a,o,n,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Uv:s=10;break e;case Vv:s=9;break e;case ph:s=11;break e;case mh:s=14;break e;case Dr:s=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=la(s,a,t,o),t.elementType=e,t.type=r,t.lanes=n,t}function Oo(e,t,a,r){return e=la(7,e,r,t),e.lanes=a,e}function nc(e,t,a,r){return e=la(22,e,r,t),e.elementType=jv,e.lanes=a,e.stateNode={isHidden:!1},e}function hm(e,t,a){return e=la(6,e,null,t),e.lanes=a,e}function gm(e,t,a){return t=la(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function d1(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=Zp(0),this.expirationTimes=Zp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Xh(e,t,a,r,o,n,s,i,l){return e=new d1(e,t,a,i,l),t===1?(t=1,n===!0&&(t|=8)):t=0,n=la(3,null,null,t),e.current=n,n.stateNode=e,n.memoizedState={element:r,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Eh(n),e}function c1(e,t,a){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Un,key:r==null?null:""+r,children:e,containerInfo:t,implementation:a}}function Ew(e){if(!e)return Kr;e=e._reactInternals;e:{if(Ho(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(Ot(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(Ot(a))return E0(e,a,t)}return t}function Dw(e,t,a,r,o,n,s,i,l){return e=Xh(a,r,!0,e,o,n,s,i,l),e.context=Ew(null),a=e.current,r=Pt(),o=$r(a),n=nr(r,o),n.callback=t??null,Hr(a,n,o),e.current.lanes=o,Sl(e,o,r),Ft(e,r),e}function sc(e,t,a,r){var o=t.current,n=Pt(),s=$r(o);return a=Ew(a),t.context===null?t.context=a:t.pendingContext=a,t=nr(n,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Hr(o,t,s),e!==null&&(ba(e,o,s,n),xd(e,o,s)),s}function Kd(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Ov(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Qh(e,t){Ov(e,t),(e=e.alternate)&&Ov(e,t)}function f1(){return null}var Mw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jh(e){this._internalRoot=e}ic.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));sc(e,t,null,null)};ic.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;jo(function(){sc(null,e,null,null)}),t[ir]=null}};function ic(e){this._internalRoot=e}ic.prototype.unstable_scheduleHydration=function(e){if(e){var t=c0();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Nr.length&&t!==0&&t<Nr[a].priority;a++);Nr.splice(a,0,e),a===0&&p0(e)}};function Yh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function lc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fv(){}function p1(e,t,a,r,o){if(o){if(typeof r=="function"){var n=r;r=function(){var u=Kd(s);n.call(u)}}var s=Dw(t,r,e,0,null,!1,!1,"",Fv);return e._reactRootContainer=s,e[ir]=s.current,fl(e.nodeType===8?e.parentNode:e),jo(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var i=r;r=function(){var u=Kd(l);i.call(u)}}var l=Xh(e,0,!1,null,null,!1,!1,"",Fv);return e._reactRootContainer=l,e[ir]=l.current,fl(e.nodeType===8?e.parentNode:e),jo(function(){sc(t,l,a,r)}),l}function uc(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=Kd(s);i.call(l)}}sc(t,s,e,o)}else s=p1(a,t,e,o,r);return Kd(s)}u0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var a=Gi(t.pendingLanes);a!==0&&(yh(t,a|1),Ft(t,Ue()),(de&6)===0&&(us=Ue()+500,Jr()))}break;case 13:jo(function(){var r=lr(e,1);if(r!==null){var o=Pt();ba(r,e,1,o)}}),Qh(e,1)}};xh=function(e){if(e.tag===13){var t=lr(e,134217728);if(t!==null){var a=Pt();ba(t,e,134217728,a)}Qh(e,134217728)}};d0=function(e){if(e.tag===13){var t=$r(e),a=lr(e,t);if(a!==null){var r=Pt();ba(a,e,t,r)}Qh(e,t)}};c0=function(){return he};f0=function(e,t){var a=he;try{return he=e,t()}finally{he=a}};Rm=function(e,t,a){switch(t){case"input":if(Lm(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=Zd(r);if(!o)throw Error(_(90));Hv(r),Lm(r,o)}}}break;case"textarea":$v(e,a);break;case"select":t=a.value,t!=null&&Jn(e,!!a.multiple,t,!1)}};Yv=$h;Zv=jo;var m1={usingClientEntryPoint:!1,Events:[Ll,zn,Zd,Qv,Jv,$h]},Hi={findFiberByHostInstance:Eo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},h1={bundleType:Hi.bundleType,version:Hi.version,rendererPackageName:Hi.rendererPackageName,rendererConfig:Hi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:dr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=a0(e),e===null?null:e.stateNode},findFiberByHostInstance:Hi.findFiberByHostInstance||f1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(zi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!zi.isDisabled&&zi.supportsFiber))try{Xd=zi.inject(h1),Oa=zi}catch{}var zi;Qt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=m1;Qt.createPortal=function(e,t){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yh(t))throw Error(_(200));return c1(e,t,null,a)};Qt.createRoot=function(e,t){if(!Yh(e))throw Error(_(299));var a=!1,r="",o=Mw;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Xh(e,1,!1,null,null,a,!1,r,o),e[ir]=t.current,fl(e.nodeType===8?e.parentNode:e),new Jh(t)};Qt.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=a0(t),e=e===null?null:e.stateNode,e};Qt.flushSync=function(e){return jo(e)};Qt.hydrate=function(e,t,a){if(!lc(t))throw Error(_(200));return uc(null,e,t,!0,a)};Qt.hydrateRoot=function(e,t,a){if(!Yh(e))throw Error(_(405));var r=a!=null&&a.hydratedSources||null,o=!1,n="",s=Mw;if(a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(n=a.identifierPrefix),a.onRecoverableError!==void 0&&(s=a.onRecoverableError)),t=Dw(t,null,e,1,a??null,o,!1,n,s),e[ir]=t.current,fl(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 ic(t)};Qt.render=function(e,t,a){if(!lc(t))throw Error(_(200));return uc(null,e,t,!1,a)};Qt.unmountComponentAtNode=function(e){if(!lc(e))throw Error(_(40));return e._reactRootContainer?(jo(function(){uc(null,null,e,!1,function(){e._reactRootContainer=null,e[ir]=null})}),!0):!1};Qt.unstable_batchedUpdates=$h;Qt.unstable_renderSubtreeIntoContainer=function(e,t,a,r){if(!lc(a))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return uc(e,t,a,!1,r)};Qt.version="18.3.1-next-f1338f8080-20240426"});var Zh=Ye((iM,Fw)=>{"use strict";function Ow(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ow)}catch(e){console.error(e)}}Ow(),Fw.exports=Nw()});var Uw=Ye(eg=>{"use strict";var Bw=Zh();eg.createRoot=Bw.createRoot,eg.hydrateRoot=Bw.hydrateRoot;var lM});var zo={};ox(zo,{Headers:()=>ag,Request:()=>x1,Response:()=>v1,default:()=>tg,fetch:()=>y1});var g1,fs,y1,tg,ag,x1,v1,Yr=Yk(()=>{"use strict";g1=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")},fs=g1(),y1=fs.fetch,tg=fs.fetch.bind(fs),ag=fs.Headers,x1=fs.Request,v1=fs.Response});var ng=Ye(og=>{"use strict";Object.defineProperty(og,"__esModule",{value:!0});var rg=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};og.default=rg});var ig=Ye(Al=>{"use strict";var jw=Al&&Al.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Al,"__esModule",{value:!0});var S1=jw((Yr(),sx(zo))),C1=jw(ng()),sg=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=S1.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)/),I=(i=n.headers.get("content-range"))===null||i===void 0?void 0:i.split("/");w&&I&&I.length>1&&(c=parseInt(I[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 C1.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}};Al.default=sg});var ug=Ye(Rl=>{"use strict";var L1=Rl&&Rl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rl,"__esModule",{value:!0});var I1=L1(ig()),lg=class extends I1.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}};Rl.default=lg});var fc=Ye(_l=>{"use strict";var b1=_l&&_l.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_l,"__esModule",{value:!0});var k1=b1(ug()),dg=class extends k1.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}};_l.default=dg});var fg=Ye(Dl=>{"use strict";var P1=Dl&&Dl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dl,"__esModule",{value:!0});var El=P1(fc()),cg=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 El.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 El.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 El.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 El.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 El.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Dl.default=cg});var qw=Ye(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.version=void 0;pc.version="0.0.0-automated"});var Hw=Ye(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.DEFAULT_HEADERS=void 0;var T1=qw();mc.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${T1.version}`}});var $w=Ye(Ml=>{"use strict";var zw=Ml&&Ml.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ml,"__esModule",{value:!0});var A1=zw(fg()),R1=zw(fc()),_1=Hw(),pg=class e{constructor(t,{headers:a={},schema:r,fetch:o}={}){this.url=t,this.headers=Object.assign(Object.assign({},_1.DEFAULT_HEADERS),a),this.schemaName=r,this.fetch=o}from(t){let a=new URL(`${this.url}/${t}`);return new A1.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 R1.default({method:s,url:i,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Ml.default=pg});var Yw=Ye(ut=>{"use strict";var ps=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 Ww=ps($w());ut.PostgrestClient=Ww.default;var Gw=ps(fg());ut.PostgrestQueryBuilder=Gw.default;var Kw=ps(fc());ut.PostgrestFilterBuilder=Kw.default;var Xw=ps(ug());ut.PostgrestTransformBuilder=Xw.default;var Qw=ps(ig());ut.PostgrestBuilder=Qw.default;var Jw=ps(ng());ut.PostgrestError=Jw.default;ut.default={PostgrestClient:Ww.default,PostgrestQueryBuilder:Gw.default,PostgrestFilterBuilder:Kw.default,PostgrestTransformBuilder:Xw.default,PostgrestBuilder:Qw.default,PostgrestError:Jw.default}});var lC=Ye(Oc=>{"use strict";var GA=W(),KA=Symbol.for("react.element"),XA=Symbol.for("react.fragment"),QA=Object.prototype.hasOwnProperty,JA=GA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,YA={key:!0,ref:!0,__self:!0,__source:!0};function iC(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)QA.call(t,r)&&!YA.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:KA,type:e,key:n,ref:s,props:o,_owner:JA.current}}Oc.Fragment=XA;Oc.jsx=iC;Oc.jsxs=iC});var ue=Ye((ZN,uC)=>{"use strict";uC.exports=lC()});var QD={};ox(QD,{initKiteChat:()=>Lp});var Ya=D(W(),1),Tk=D(Uw(),1);var F=D(W(),1);var Vw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Yr(),zo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)};var bl=class extends Error{constructor(t,a="FunctionsError",r){super(t),this.name=a,this.context=r}},dc=class extends bl{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}},kl=class extends bl{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}},Pl=class extends bl{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}},cc;(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"})(cc||(cc={}));var w1=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())})},Tl=class{constructor(t,{headers:a={},customFetch:r,region:o=cc.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=Vw(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,a={}){var r;return w1(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 dc(w)}),f=c.headers.get("x-relay-error");if(f&&f==="true")throw new kl(c);if(!c.ok)throw new Pl(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 Pl||o instanceof kl?o.context:void 0}}})}};var Zw=D(Yw(),1),{PostgrestClient:eS,PostgrestQueryBuilder:kM,PostgrestFilterBuilder:PM,PostgrestTransformBuilder:TM,PostgrestBuilder:AM,PostgrestError:E1}=Zw.default;function tS(){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 aS=tS();var rS="2.11.15";var oS=`realtime-js/${rS}`,nS="1.0.0";var gc=1e4,sS=1e3,ms;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(ms||(ms={}));var dt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(dt||(dt={}));var Jt;(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"})(Jt||(Jt={}));var hc;(function(e){e.websocket="websocket"})(hc||(hc={}));var Zr;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Zr||(Zr={}));var Nl=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 $o=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 Ce;(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"})(Ce||(Ce={}));var hg=(e,t,a={})=>{var r;let o=(r=a.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((n,s)=>(n[s]=D1(s,e,t,o),n),{})},D1=(e,t,a,r)=>{let o=t.find(i=>i.name===e),n=o?.type,s=a[e];return n&&!r.includes(n)?iS(n,s):mg(s)},iS=(e,t)=>{if(e.charAt(0)==="_"){let a=e.slice(1,e.length);return F1(t,a)}switch(e){case Ce.bool:return M1(t);case Ce.float4:case Ce.float8:case Ce.int2:case Ce.int4:case Ce.int8:case Ce.numeric:case Ce.oid:return N1(t);case Ce.json:case Ce.jsonb:return O1(t);case Ce.timestamp:return B1(t);case Ce.abstime:case Ce.date:case Ce.daterange:case Ce.int4range:case Ce.int8range:case Ce.money:case Ce.reltime:case Ce.text:case Ce.time:case Ce.timestamptz:case Ce.timetz:case Ce.tsrange:case Ce.tstzrange:return mg(t);default:return mg(t)}},mg=e=>e,M1=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},N1=e=>{if(typeof e=="string"){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},O1=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},F1=(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=>iS(t,i))}return e},B1=e=>typeof e=="string"?e.replace(" ","T"):e,yc=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};var Wo=class{constructor(t,a,r={},o=gc){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 gg;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(gg||(gg={}));var hs=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(I=>I.presence_ref),m=c.map(I=>I.presence_ref),x=d.filter(I=>m.indexOf(I.presence_ref)<0),w=c.filter(I=>f.indexOf(I.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 yg;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(yg||(yg={}));var xg;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(xg||(xg={}));var Ba;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Ba||(Ba={}));var gs=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 Wo(this,Jt.join,this.params,this.timeout),this.rejoinTimer=new $o(()=>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(Jt.reply,{},(o,n)=>{this._trigger(this._replyEventName(n),o)}),this.presence=new hs(this),this.broadcastEndpointURL=yc(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?.(Ba.CHANNEL_ERROR,d)),this._onClose(()=>t?.(Ba.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?.(Ba.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 I=f[w],{filter:{event:h,schema:g,table:y,filter:C}}=I,L=d&&d[w];if(L&&L.event===h&&L.schema===g&&L.table===y&&L.filter===C)x.push(Object.assign(Object.assign({},I),{id:L.id}));else{this.unsubscribe(),this.state=dt.errored,t?.(Ba.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=x,t&&t(Ba.SUBSCRIBED);return}}).receive("error",d=>{this.state=dt.errored,t?.(Ba.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{t?.(Ba.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(Jt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(o=>{r=new Wo(this,Jt.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 Wo(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}=Jt;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,I;return((x=m.filter)===null||x===void 0?void 0:x.event)==="*"||((I=(w=m.filter)===null||w===void 0?void 0:w.event)===null||I===void 0?void 0:I.toLocaleLowerCase())===s}).map(m=>m.callback(f,r)):(n=this.bindings[s])===null||n===void 0||n.filter(m=>{var x,w,I,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()===((I=a.data)===null||I===void 0?void 0:I.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:I,commit_timestamp:h,type:g,errors:y}=x;f=Object.assign(Object.assign({},{schema:w,table:I,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(Jt.close,{},t)}_onError(t){this._on(Jt.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=hg(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=hg(t.columns,t.old_record)),a}};var lS=()=>{},V1=`
|
|
9
9
|
addEventListener("message", (e) => {
|
|
10
10
|
if (e.data.event === "start") {
|
|
11
11
|
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
12
12
|
}
|
|
13
|
-
});`,vs=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=lC,this.ref=0,this.logger=lC,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(()=>(to(),Go)).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 Ko(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=aC),!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:nC}))}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 gs.connecting:return ao.Connecting;case gs.open:return ao.Open;case gs.closing:return ao.Closing;default:return ao.Closed}}isConnected(){return this.connectionState()===ao.Open}channel(t,a={config:{}}){let r=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===r);if(o)return o;{let n=new xs(`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:oC};a&&r.updateJoinPayload(o),r.joinedOnce&&r._isJoined()&&r._push(Jt.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(sC,"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(Jt.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([B1],{type:"application/javascript"});a=URL.createObjectURL(r)}return a}};var ws=class extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}};function ze(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var vc=class extends ws{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}}},Qo=class extends ws{constructor(t,a){super(t),this.name="StorageUnknownError",this.originalError=a}};var U1=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())})},Cc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(to(),Go)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},uC=()=>U1(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(to(),Go))).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},dC=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 Jo=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),V1=(e,t,a)=>Jo(void 0,void 0,void 0,function*(){let r=yield uC();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 Qo(wg(o),o))}):t(new Qo(wg(e),e))}),j1=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!r?o:(dC(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 Jo(this,void 0,void 0,function*(){return new Promise((s,i)=>{e(a,j1(t,r,o,n)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>V1(l,i,r))})})}function Cs(e,t,a,r){return Jo(this,void 0,void 0,function*(){return Fl(e,"GET",t,a,r)})}function ka(e,t,a,r,o){return Jo(this,void 0,void 0,function*(){return Fl(e,"POST",t,r,o,a)})}function Bl(e,t,a,r,o){return Jo(this,void 0,void 0,function*(){return Fl(e,"PUT",t,r,o,a)})}function cC(e,t,a,r){return Jo(this,void 0,void 0,function*(){return Fl(e,"HEAD",t,Object.assign(Object.assign({},a),{noResolveJson:!0}),r)})}function Sc(e,t,a,r,o){return Jo(this,void 0,void 0,function*(){return Fl(e,"DELETE",t,r,o,a)})}var Ot=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())})},q1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},fC={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=Cc(o)}uploadOrUpdate(t,a,r,o){return Ot(this,void 0,void 0,function*(){try{let n,s=Object.assign(Object.assign({},fC),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:ka)(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(ze(n))return{data:null,error:n};throw n}})}upload(t,a,r){return Ot(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,a,r)})}uploadToSignedUrl(t,a,r,o){return Ot(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:fC.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(ze(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,a){return Ot(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 ka(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 ws("No token returned by API");return{data:{signedUrl:s.toString(),path:t,token:i},error:null}}catch(r){if(ze(r))return{data:null,error:r};throw r}})}update(t,a,r){return Ot(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,a,r)})}move(t,a,r){return Ot(this,void 0,void 0,function*(){try{return{data:yield ka(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:a,destinationBucket:r?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(ze(o))return{data:null,error:o};throw o}})}copy(t,a,r){return Ot(this,void 0,void 0,function*(){try{return{data:{path:(yield ka(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(ze(o))return{data:null,error:o};throw o}})}createSignedUrl(t,a,r){return Ot(this,void 0,void 0,function*(){try{let o=this._getFinalPath(t),n=yield ka(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(ze(o))return{data:null,error:o};throw o}})}createSignedUrls(t,a,r){return Ot(this,void 0,void 0,function*(){try{let o=yield ka(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(ze(o))return{data:null,error:o};throw o}})}download(t,a){return Ot(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 Cs(this.fetch,`${this.url}/${o}/${i}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(i){if(ze(i))return{data:null,error:i};throw i}})}info(t){return Ot(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{let r=yield Cs(this.fetch,`${this.url}/object/info/${a}`,{headers:this.headers});return{data:wc(r),error:null}}catch(r){if(ze(r))return{data:null,error:r};throw r}})}exists(t){return Ot(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{return yield cC(this.fetch,`${this.url}/object/${a}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(ze(r)&&r instanceof Qo){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 Ot(this,void 0,void 0,function*(){try{return{data:yield Sc(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(a){if(ze(a))return{data:null,error:a};throw a}})}list(t,a,r){return Ot(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},q1),a),{prefix:t||""});return{data:yield ka(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},r),error:null}}catch(o){if(ze(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 pC="2.10.4";var mC={"X-Client-Info":`storage-js/${pC}`};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({},mC),a),this.fetch=Cc(r)}listBuckets(){return Ss(this,void 0,void 0,function*(){try{return{data:yield Cs(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(ze(t))return{data:null,error:t};throw t}})}getBucket(t){return Ss(this,void 0,void 0,function*(){try{return{data:yield Cs(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(a){if(ze(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 ka(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(ze(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(ze(r))return{data:null,error:r};throw r}})}emptyBucket(t){return Ss(this,void 0,void 0,function*(){try{return{data:yield ka(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(a){if(ze(a))return{data:null,error:a};throw a}})}deleteBucket(t){return Ss(this,void 0,void 0,function*(){try{return{data:yield Sc(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(a){if(ze(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 hC="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 H1={"X-Client-Info":`supabase-js-${ql}/${hC}`},gC={headers:H1},yC={schema:"public"},xC={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},vC={};to();var z1=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())})},$1=e=>{let t;return e?t=e:typeof fetch>"u"?t=ag:t=fetch,(...a)=>t(...a)},W1=()=>typeof Headers>"u"?rg:Headers,wC=(e,t,a)=>{let r=$1(a),o=W1();return(n,s)=>z1(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 G1=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 CC(e){return e.endsWith("/")?e:e+"/"}function SC(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:()=>G1(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}var Lc="2.71.1";var Yo=30*1e3,Ic=3,bc=Ic*Yo,LC="http://localhost:9999",IC="supabase.auth.token";var bC={"X-Client-Info":`gotrue-js/${Lc}`};var Hl="X-Supabase-Api-Version",Cg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},kC=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,PC=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 Q(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 TC(e){return Q(e)&&e.name==="AuthApiError"}var Ls=class extends zl{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}},Fa=class extends zl{constructor(t,a,r,o){super(t,r,o),this.name=a,this.status=r}},pa=class extends Fa{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function AC(e){return Q(e)&&e.name==="AuthSessionMissingError"}var Zo=class extends Fa{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},en=class extends Fa{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},tn=class extends Fa{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 RC(e){return Q(e)&&e.name==="AuthImplicitGrantRedirectError"}var $l=class extends Fa{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}}},Is=class extends Fa{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}};function Pc(e){return Q(e)&&e.name==="AuthRetryableFetchError"}var Wl=class extends Fa{constructor(t,a,r){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=r}};var an=class extends Fa{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var Tc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),_C=`
|
|
14
|
-
\r=`.split(""),K1=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<_C.length;t+=1)e[_C[t].charCodeAt(0)]=-2;for(let t=0;t<Tc.length;t+=1)e[Tc[t].charCodeAt(0)]=t;return e})();function EC(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 DC(e,t,a){let r=K1[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 Sg(e){let t=[],a=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{J1(s,r,a)};for(let s=0;s<e.length;s+=1)DC(e.charCodeAt(s),o,n);return t.join("")}function X1(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 Q1(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}X1(r,t)}}function J1(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 MC(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)DC(e.charCodeAt(o),a,r);return new Uint8Array(t)}function NC(e){let t=[];return Q1(e,a=>t.push(a)),new Uint8Array(t)}function OC(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>EC(o,a,r)),EC(null,a,r),t.join("")}function FC(e){return Math.round(Date.now()/1e3)+e}function BC(){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 ma=()=>typeof window<"u"&&typeof document<"u",rn={tested:!1,writable:!1},Ac=()=>{if(!ma())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(rn.tested)return rn.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),rn.tested=!0,rn.writable=!0}catch{rn.tested=!0,rn.writable=!1}return rn.writable};function UC(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(()=>(to(),Go)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},VC=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",on=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},ro=async(e,t)=>{let a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return a}},dr=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 an("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!kC.test(t[r]))throw new an("JWT not in base64url format");return{header:JSON.parse(Sg(t[0])),payload:JSON.parse(Sg(t[1])),signature:MC(t[2]),raw:{header:t[0],payload:t[1]}}}async function jC(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function qC(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 Y1(e){return("0"+e.toString(16)).substr(-2)}function Z1(){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,Y1).join("")}async function eA(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 tA(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 eA(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function nn(e,t,a=!1){let r=Z1(),o=r;a&&(o+="/PASSWORD_RECOVERY"),await on(e,`${t}-code-verifier`,o);let n=await tA(r);return[n,r===n?"plain":"s256"]}var aA=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function HC(e){let t=e.headers.get(Hl);if(!t||!t.match(aA))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function zC(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 $C(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 rA=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function sn(e){if(!rA.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 oA=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},ln=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),nA=[502,503,504];async function WC(e){var t;if(!VC(e))throw new Is(ln(e),0);if(nA.includes(e.status))throw new Is(ln(e),e.status);let a;try{a=await e.json()}catch(n){throw new Ls(ln(n),n)}let r,o=HC(e);if(o&&o.getTime()>=Cg["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(ln(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new pa}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(ln(a),e.status,a.weak_password.reasons);throw new kc(ln(a),e.status||500,r)}var sA=(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 ee(e,t,a,r){var o;let n=Object.assign({},r?.headers);n[Hl]||(n[Hl]=Cg["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 iA(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 iA(e,t,a,r,o,n){let s=sA(t,r,o,n),i;try{i=await e(a,Object.assign({},s))}catch(l){throw console.error(l),new Is(ln(l),0)}if(i.ok||await WC(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await WC(l)}}function Ba(e){var t;let a=null;lA(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=FC(e.expires_in)));let r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:a,user:r},error:null}}function Ig(e){let t=Ba(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 Ua(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function GC(e){return{data:e,error:null}}function KC(e){let{action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n}=e,s=oA(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 XC(e){return e}function lA(e){return e.access_token&&e.refresh_token&&e.expires_in}var Dc=["global","local","others"];var uA=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},un=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 ee(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,a={}){try{return await ee(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:Ua})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{let{options:a}=t,r=uA(t,["options"]),o=Object.assign(Object.assign({},r),a);return"newEmail"in r&&(o.new_email=r?.newEmail,delete o.newEmail),await ee(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:KC,redirectTo:a?.redirectTo})}catch(a){if(Q(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await ee(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ua})}catch(a){if(Q(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 ee(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:XC});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 C=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),L=JSON.parse(x.split(";")[1].split("=")[1]);u[`${L}Page`]=C}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},c),u),error:null}}catch(u){if(Q(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){sn(t);try{return await ee(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ua})}catch(a){if(Q(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){sn(t);try{return await ee(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:Ua})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,a=!1){sn(t);try{return await ee(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:Ua})}catch(r){if(Q(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){sn(t.userId);try{let{data:a,error:r}=await ee(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(Q(a))return{data:null,error:a};throw a}}async _deleteFactor(t){sn(t.userId),sn(t.id);try{return{data:await ee(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(Q(a))return{data:null,error:a};throw a}}};function bg(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}function QC(){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 dn={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){dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),dn.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){dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw dn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Mc(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(dn.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()}}))}QC();var dA={url:LC,storageKey:IC,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:bC,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function JC(e,t,a){return await a()}var bs={},cn=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&&ma()&&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({},dA),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 un({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||JC,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:ma()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=kg:this.lock=JC,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=bg(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=bg(this.memoryStorage)),ma()&&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=UC(window.location.href),r="none";if(this._isImplicitGrantCallback(a)?r="implicit":await this._isPKCECallback(a)&&(r="pkce"),ma()&&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),RC(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 Q(a)?{error:a}:{error:new Ls("Unexpected error during initialization",a)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,r,o;try{let n=await ee(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:Ba}),{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(Q(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 nn(this.storage,this.storageKey)),n=await ee(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:Ba})}else if("phone"in t){let{phone:d,password:c,options:f}=t;n=await ee(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:Ba})}else throw new en("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(Q(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 ee(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:Ig})}else if("phone"in t){let{phone:n,password:s,options:i}=t;a=await ee(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:Ig})}else throw new en("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 Zo}:(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(Q(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,C;if("message"in t)x=t.message,C=t.signature;else{let{chain:L,wallet:h,statement:y,options:g}=t,w;if(ma())if(typeof h=="object")w=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"))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 h!="object"||!g?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=h}let I=new URL((a=g?.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in w&&w.signIn){let P=await w.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},g?.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),y?{statement:y}: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),C=A.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");x=[`${I.host} wants you to sign in with your Solana account:`,w.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(o=(r=g?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((n=g?.signInWithSolana)===null||n===void 0)&&n.notBefore?[`Not Before: ${g.signInWithSolana.notBefore}`]:[],...!((s=g?.signInWithSolana)===null||s===void 0)&&s.expirationTime?[`Expiration Time: ${g.signInWithSolana.expirationTime}`]:[],...!((i=g?.signInWithSolana)===null||i===void 0)&&i.chainId?[`Chain ID: ${g.signInWithSolana.chainId}`]:[],...!((l=g?.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${g.signInWithSolana.nonce}`]:[],...!((u=g?.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${g.signInWithSolana.requestId}`]:[],...!((c=(d=g?.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||c===void 0)&&c.length?["Resources",...g.signInWithSolana.resources.map(A=>`- ${A}`)]:[]].join(`
|
|
15
|
-
`);let P=await w.signMessage(new TextEncoder().encode(x),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");C=P}}try{let{data:L,error:h}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:OC(C)},!((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:Ba});if(h)throw h;return!L||!L.session||!L.user?{data:{user:null,session:null},error:new Zo}:(L.session&&(await this._saveSession(L.session),await this._notifyAllSubscribers("SIGNED_IN",L.session)),{data:Object.assign({},L),error:h})}catch(L){if(Q(L))return{data:{user:null,session:null},error:L};throw L}}async _exchangeCodeForSession(t){let a=await ro(this.storage,`${this.storageKey}-code-verifier`),[r,o]=(a??"").split("/");try{let{data:n,error:s}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Ba});if(await dr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new Zo}:(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(Q(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 ee(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:Ba}),{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 Zo}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(a){if(Q(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 nn(this.storage,this.storageKey));let{error:c}=await ee(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 ee(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 en("You must provide either an email or phone number.")}catch(i){if(Q(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 ee(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:n}}),redirectTo:o,xform:Ba});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(Q(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 nn(this.storage,this.storageKey)),await ee(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:GC})}catch(n){if(Q(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 pa;let{error:o}=await ee(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return{data:{user:null,session:null},error:o}})}catch(t){if(Q(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 ee(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 ee(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 en("You must provide either an email or phone number and a type")}catch(a){if(Q(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 ro(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()<bc:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){let s=await ro(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 ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ua}):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 pa}:await ee(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:Ua})})}catch(a){if(Q(a))return AC(a)&&(await this._removeSession(),await dr(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 pa;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await nn(this.storage,this.storageKey));let{data:u,error:d}=await ee(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:Ua});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(Q(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 pa;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(Q(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 pa;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(Q(a))return{data:{user:null,session:null},error:a};throw a}}async _getSessionFromURL(t,a){try{if(!ma())throw new tn("No browser detected.");if(t.error||t.error_description||t.error_code)throw new tn(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 tn("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:y,error:g}=await this._exchangeCodeForSession(t.code);if(g)throw g;let w=new URL(window.location.href);return w.searchParams.delete("code"),window.history.replaceState(window.history.state,"",w.toString()),{data:{session:y.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 tn("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<=Yo&&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:C,error:L}=await this._getUser(n);if(L)throw L;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:C.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:h,redirectType:t.type},error:null}}catch(r){if(Q(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 ro(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&&!(TC(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await dr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=BC(),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 nn(this.storage,this.storageKey,!0));try{return await ee(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(Q(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(Q(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 ee(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 ma()&&!(!((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(Q(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 ee(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(Q(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 qC(async o=>(o>0&&await jC(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await ee(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ba})),(o,n)=>{let s=200*Math.pow(2,o);return n&&Pc(n)&&Date.now()+s-r<Yo})}catch(r){if(this._debug(a,"error",r),Q(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),ma()&&!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 ro(this.storage,this.storageKey);if(o&&this.userStorage){let s=await ro(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await on(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 ro(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await dr(this.storage,this.storageKey+"-user"),await on(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()<bc;if(this._debug(r,`session has${n?"":" not"} expired with margin of ${bc}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 pa;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 pa;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),Q(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 on(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=Lg(o);await on(this.storage,this.storageKey,n)}else{let o=Lg(a);await on(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await dr(this.storage,this.storageKey),await dr(this.storage,this.storageKey+"-code-verifier"),await dr(this.storage,this.storageKey+"-user"),this.userStorage&&await dr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ma()&&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(),Yo);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)/Yo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Yo}ms, refresh threshold is ${Ic} ticks`),o<=Ic&&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()"),!ma()||!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 nn(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 ee(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(Q(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 ee(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(Q(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 ee(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(Q(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 ee(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(Q(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+PC>o)return r;let{data:n,error:s}=await ee(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||zC(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=$C(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,NC(`${i}.${l}`)))throw new an("Invalid JWT signature");return{data:{claims:n,header:o,signature:s},error:null}}catch(r){if(Q(r))return{data:null,error:r};throw r}}};cn.nextInstanceID=0;var cA=cn,Pg=cA;var Nc=class extends Pg{constructor(t){super(t)}};var fA=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=CC(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:yC,realtime:vC,auth:Object.assign(Object.assign({},xC),{storageKey:u}),global:gC},c=SC(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=wC(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 eC(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 fA(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 vs(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 YC=(e,t,a)=>new Xl(e,t,a);function pA(){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}pA()&&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 ZC(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=ZC(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=ZC(e))&&(r&&(r+=" "),r+=t);return r}var mA=e=>{let t=gA(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),aS(i,t)||hA(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},aS=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?aS(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},eS=/^\[(.+)\]$/,hA=e=>{if(eS.test(e)){let t=eS.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},gA=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return xA(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:tS(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(yA(o)){Ag(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{Ag(s,tS(t,n),a,r)})})},tS=(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},yA=e=>e.isThemeGetter,xA=(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,vA=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 wA=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 L=0;L<i.length;L++){let h=i[L];if(u===0){if(h===o&&(r||i.slice(L,L+n)===t)){l.push(i.slice(d,L)),d=L+n;continue}if(h==="/"){c=L;continue}}h==="["?u++:h==="]"&&u--}let f=l.length===0?i:i.substring(d),m=f.startsWith("!"),x=m?f.substring(1):f,C=c&&c>d?c-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:C}};return a?i=>a({className:i,parseClassName:s}):s},CA=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},SA=e=>({cache:vA(e.cacheSize),parseClassName:wA(e),...mA(e)}),LA=/\s+/,IA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(LA),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,C=r(x?f.substring(0,m):f);if(!C){if(!x){i=u+(i.length>0?" "+i:i);continue}if(C=r(f),!C){i=u+(i.length>0?" "+i:i);continue}x=!1}let L=CA(d).join(":"),h=c?L+"!":L,y=h+C;if(n.includes(y))continue;n.push(y);let g=o(C,x);for(let w=0;w<g.length;++w){let I=g[w];n.push(h+I)}i=u+(i.length>0?" "+i:i)}return i};function bA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=rS(t))&&(r&&(r+=" "),r+=a);return r}var rS=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=rS(e[r]))&&(a&&(a+=" "),a+=t);return a};function kA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=SA(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=IA(l,a);return o(l,d),d}return function(){return n(bA.apply(null,arguments))}}var Pe=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},oS=/^\[(?:([a-z-]+):)?(.+)\]$/i,PA=/^\d+\/\d+$/,TA=new Set(["px","full","screen"]),AA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RA=/\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$/,_A=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,EA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=e=>ks(e)||TA.has(e)||PA.test(e),oo=e=>Ps(e,"length",jA),ks=e=>!!e&&!Number.isNaN(Number(e)),Tg=e=>Ps(e,"number",ks),Ql=e=>!!e&&Number.isInteger(Number(e)),MA=e=>e.endsWith("%")&&ks(e.slice(0,-1)),Y=e=>oS.test(e),no=e=>AA.test(e),NA=new Set(["length","size","percentage"]),OA=e=>Ps(e,NA,nS),FA=e=>Ps(e,"position",nS),BA=new Set(["image","url"]),UA=e=>Ps(e,BA,HA),VA=e=>Ps(e,"",qA),Jl=()=>!0,Ps=(e,t,a)=>{let r=oS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},jA=e=>RA.test(e)&&!_A.test(e),nS=()=>!1,qA=e=>EA.test(e),HA=e=>DA.test(e);var zA=()=>{let e=Pe("colors"),t=Pe("spacing"),a=Pe("blur"),r=Pe("brightness"),o=Pe("borderColor"),n=Pe("borderRadius"),s=Pe("borderSpacing"),i=Pe("borderWidth"),l=Pe("contrast"),u=Pe("grayscale"),d=Pe("hueRotate"),c=Pe("invert"),f=Pe("gap"),m=Pe("gradientColorStops"),x=Pe("gradientColorStopPositions"),C=Pe("inset"),L=Pe("margin"),h=Pe("opacity"),y=Pe("padding"),g=Pe("saturate"),w=Pe("scale"),I=Pe("sepia"),P=Pe("skew"),A=Pe("space"),R=Pe("translate"),q=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",Y,t],ue=()=>[Y,t],Le=()=>["",cr,oo],Qa=()=>["auto",ks,Y],Ja=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Tr=()=>["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"],Oe=()=>["start","end","center","between","around","evenly","stretch"],de=()=>["","0",Y],Ar=()=>["auto","avoid","all","avoid-page","page","left","right","column"],zt=()=>[ks,Y];return{cacheSize:500,separator:":",theme:{colors:[Jl],spacing:[cr,oo],blur:["none","",no,Y],brightness:zt(),borderColor:[e],borderRadius:["none","","full",no,Y],borderSpacing:ue(),borderWidth:Le(),contrast:zt(),grayscale:de(),hueRotate:zt(),invert:de(),gap:ue(),gradientColorStops:[e],gradientColorStopPositions:[MA,oo],inset:pe(),margin:pe(),opacity:zt(),padding:ue(),saturate:zt(),scale:zt(),sepia:de(),skew:zt(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[no]}],"break-after":[{"break-after":Ar()}],"break-before":[{"break-before":Ar()}],"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:[...Ja(),Y]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[C]}],"inset-x":[{"inset-x":[C]}],"inset-y":[{"inset-y":[C]}],start:[{start:[C]}],end:[{end:[C]}],top:[{top:[C]}],right:[{right:[C]}],bottom:[{bottom:[C]}],left:[{left:[C]}],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:de()}],shrink:[{shrink:de()}],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":Qa()}],"col-end":[{"col-end":Qa()}],"grid-rows":[{"grid-rows":[Jl]}],"row-start-end":[{row:["auto",{span:[Ql,Y]},Y]}],"row-start":[{"row-start":Qa()}],"row-end":[{"row-end":Qa()}],"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",...Oe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Oe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Oe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[L]}],mx:[{mx:[L]}],my:[{my:[L]}],ms:[{ms:[L]}],me:[{me:[L]}],mt:[{mt:[L]}],mr:[{mr:[L]}],mb:[{mb:[L]}],ml:[{ml:[L]}],"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:[no]},no]}],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",no,oo]}],"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",ks,Tg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cr,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:[...Tr(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cr,oo]}],"underline-offset":[{"underline-offset":["auto",cr,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:ue()}],"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:[...Ja(),FA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",OA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},UA]}],"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:[...Tr(),"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:Tr()}],"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:["",...Tr()]}],"outline-offset":[{"outline-offset":[cr,Y]}],"outline-w":[{outline:[cr,oo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[cr,oo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",no,VA]}],"shadow-color":[{shadow:[Jl]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Re()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",no,Y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[g]}],sepia:[{sepia:[I]}],"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":[g]}],"backdrop-sepia":[{"backdrop-sepia":[I]}],"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:zt()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:zt()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],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":ue()}],"scroll-mx":[{"scroll-mx":ue()}],"scroll-my":[{"scroll-my":ue()}],"scroll-ms":[{"scroll-ms":ue()}],"scroll-me":[{"scroll-me":ue()}],"scroll-mt":[{"scroll-mt":ue()}],"scroll-mr":[{"scroll-mr":ue()}],"scroll-mb":[{"scroll-mb":ue()}],"scroll-ml":[{"scroll-ml":ue()}],"scroll-p":[{"scroll-p":ue()}],"scroll-px":[{"scroll-px":ue()}],"scroll-py":[{"scroll-py":ue()}],"scroll-ps":[{"scroll-ps":ue()}],"scroll-pe":[{"scroll-pe":ue()}],"scroll-pt":[{"scroll-pt":ue()}],"scroll-pr":[{"scroll-pr":ue()}],"scroll-pb":[{"scroll-pb":ue()}],"scroll-pl":[{"scroll-pl":ue()}],"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:[cr,oo,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 sS=kA(zA);function Yt(...e){return sS(Oc(e))}var dS=N(ie(),1);function Ne({className:e,type:t,...a}){return(0,dS.jsx)("input",{type:t,"data-slot":"input",className:Yt("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 $e=N(W(),1);var fS=N(W(),1);function cS(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=cS(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():cS(e[o],null)}}}}function fr(...e){return fS.useCallback(Yl(...e),e)}var Bc=N(ie(),1),JA=Symbol.for("react.lazy"),Uc=$e[" use ".trim().toString()];function YA(e){return typeof e=="object"&&e!==null&&"then"in e}function pS(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===JA&&"_payload"in e&&YA(e._payload)}function ZA(e){let t=eR(e),a=$e.forwardRef((r,o)=>{let{children:n,...s}=r;pS(n)&&typeof Uc=="function"&&(n=Uc(n._payload));let i=$e.Children.toArray(n),l=i.find(aR);if(l){let u=l.props.children,d=i.map(c=>c===l?$e.Children.count(u)>1?$e.Children.only(null):$e.isValidElement(u)?u.props.children:null:c);return(0,Bc.jsx)(t,{...s,ref:o,children:$e.isValidElement(u)?$e.cloneElement(u,void 0,d):null})}return(0,Bc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var mS=ZA("Slot");function eR(e){let t=$e.forwardRef((a,r)=>{let{children:o,...n}=a;if(pS(o)&&typeof Uc=="function"&&(o=Uc(o._payload)),$e.isValidElement(o)){let s=oR(o),i=rR(n,o.props);return o.type!==$e.Fragment&&(i.ref=r?Yl(r,s):s),$e.cloneElement(o,i)}return $e.Children.count(o)>1?$e.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tR=Symbol("radix.slottable");function aR(e){return $e.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tR}function rR(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 oR(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 hS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gS=Oc,yS=(e,t)=>a=>{var r;if(t?.variants==null)return gS(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=hS(d)||hS(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[C,L]=x;return Array.isArray(L)?L.includes({...n,...i}[C]):{...n,...i}[C]===L})?[...u,c,f]:u},[]);return gS(e,s,l,a?.class,a?.className)};var xS=N(ie(),1),nR=yS("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,xS.jsx)(r?mS:"button",{"data-slot":"button",className:Yt(nR({variant:t,size:a,className:e})),...o})}var zS=N(W(),1);var $=N(W(),1);var wS=N(W(),1),cR=N(eg(),1);var Xe=N(W(),1);var Vc=N(ie(),1);function vS(e){let t=sR(e),a=Xe.forwardRef((r,o)=>{let{children:n,...s}=r,i=Xe.Children.toArray(n),l=i.find(lR);if(l){let u=l.props.children,d=i.map(c=>c===l?Xe.Children.count(u)>1?Xe.Children.only(null):Xe.isValidElement(u)?u.props.children:null:c);return(0,Vc.jsx)(t,{...s,ref:o,children:Xe.isValidElement(u)?Xe.cloneElement(u,void 0,d):null})}return(0,Vc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function sR(e){let t=Xe.forwardRef((a,r)=>{let{children:o,...n}=a;if(Xe.isValidElement(o)){let s=dR(o),i=uR(n,o.props);return o.type!==Xe.Fragment&&(i.ref=r?Yl(r,s):s),Xe.cloneElement(o,i)}return Xe.Children.count(o)>1?Xe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var iR=Symbol("radix.slottable");function lR(e){return Xe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iR}function uR(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 dR(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 CS=N(ie(),1),fR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ts=fR.reduce((e,t)=>{let a=vS(`Primitive.${t}`),r=wS.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,CS.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Ft=N(W(),1);var SS=N(W(),1),Zl=globalThis?.document?SS.useLayoutEffect:()=>{};var LS=N(W(),1);function pR(e,t){return LS.useReducer((a,r)=>t[a][r]??a,e)}var As=e=>{let{present:t,children:a}=e,r=mR(t),o=typeof a=="function"?a({present:r.isPresent}):Ft.Children.only(a),n=fr(r.ref,hR(o));return typeof a=="function"||r.isPresent?Ft.cloneElement(o,{ref:n}):null};As.displayName="Presence";function mR(e){let[t,a]=Ft.useState(),r=Ft.useRef(null),o=Ft.useRef(e),n=Ft.useRef("none"),s=e?"mounted":"unmounted",[i,l]=pR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ft.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 C=jc(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&C&&(l("ANIMATION_END"),!o.current)){let L=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=L)})}},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:Ft.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function jc(e){return e?.animationName||"none"}function hR(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 pr=N(W(),1),IS=N(ie(),1);function bS(e,t=[]){let a=[];function r(n,s){let i=pr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:m,...x}=c,C=f?.[e]?.[l]||i,L=pr.useMemo(()=>x,Object.values(x));return(0,IS.jsx)(C.Provider,{value:L,children:m})};u.displayName=n+"Provider";function d(c,f){let m=f?.[e]?.[l]||i,x=pr.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=>pr.createContext(s));return function(i){let l=i?.[e]||n;return pr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,gR(o,...t)]}function gR(...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 pr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var Rs=N(W(),1);function so(e){let t=Rs.useRef(e);return Rs.useEffect(()=>{t.current=e}),Rs.useMemo(()=>(...a)=>t.current?.(...a),[])}var qc=N(W(),1),yR=N(ie(),1),xR=qc.createContext(void 0);function kS(e){let t=qc.useContext(xR);return e||t||"ltr"}function PS(e,[t,a]){return Math.min(a,Math.max(t,e))}var wO=!!(typeof window<"u"&&window.document&&window.document.createElement);function io(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var AS=N(W(),1),fe=N(ie(),1);function vR(e,t){return AS.useReducer((a,r)=>t[a][r]??a,e)}var Rg="ScrollArea",[RS,_O]=bS(Rg),[wR,ha]=RS(Rg),_S=$.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),[C,L]=$.useState(null),[h,y]=$.useState(0),[g,w]=$.useState(0),[I,P]=$.useState(!1),[A,R]=$.useState(!1),q=fr(t,pe=>l(pe)),U=kS(o);return(0,fe.jsx)(wR,{scope:a,type:r,dir:U,scrollHideDelay:n,scrollArea:i,viewport:u,onViewportChange:d,content:c,onContentChange:f,scrollbarX:m,onScrollbarXChange:x,scrollbarXEnabled:I,onScrollbarXEnabledChange:P,scrollbarY:C,onScrollbarYChange:L,scrollbarYEnabled:A,onScrollbarYEnabledChange:R,onCornerWidthChange:y,onCornerHeightChange:w,children:(0,fe.jsx)(Ts.div,{dir:U,...s,ref:q,style:{position:"relative","--radix-scroll-area-corner-width":h+"px","--radix-scroll-area-corner-height":g+"px",...e.style}})})});_S.displayName=Rg;var ES="ScrollAreaViewport",DS=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=ha(ES,a),i=$.useRef(null),l=fr(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)(Ts.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})})]})});DS.displayName=ES;var Va="ScrollAreaScrollbar",_g=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ha(Va,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)(CR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,fe.jsx)(SR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,fe.jsx)(MS,{...r,ref:t,forceMount:a}):o.type==="always"?(0,fe.jsx)(Eg,{...r,ref:t}):null});_g.displayName=Va;var CR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ha(Va,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)(As,{present:a||n,children:(0,fe.jsx)(MS,{"data-state":n?"visible":"hidden",...r,ref:t})})}),SR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ha(Va,e.__scopeScrollArea),n=e.orientation==="horizontal",s=Wc(()=>l("SCROLL_END"),100),[i,l]=vR("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)(As,{present:a||i!=="hidden",children:(0,fe.jsx)(Eg,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:io(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:io(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),MS=$.forwardRef((e,t)=>{let a=ha(Va,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 _s(a.viewport,l),_s(a.content,l),(0,fe.jsx)(As,{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=ha(Va,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=BS(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 TR(f,s.current,i,m)}return a==="horizontal"?(0,fe.jsx)(LR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,m=TS(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)(IR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,m=TS(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}),LR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ha(Va,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=fr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(OS,{"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),VS(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)}})}})}),IR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ha(Va,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=fr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(OS,{"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),VS(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)}})}})}),[bR,NS]=RS(Va),OS=$.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=ha(Va,a),[x,C]=$.useState(null),L=fr(t,q=>C(q)),h=$.useRef(null),y=$.useRef(""),g=m.viewport,w=r.content-r.viewport,I=so(d),P=so(l),A=Wc(c,10);function R(q){if(h.current){let U=q.clientX-h.current.left,pe=q.clientY-h.current.top;u({x:U,y:pe})}}return $.useEffect(()=>{let q=U=>{let pe=U.target;x?.contains(pe)&&I(U,w)};return document.addEventListener("wheel",q,{passive:!1}),()=>document.removeEventListener("wheel",q,{passive:!1})},[g,x,w,I]),$.useEffect(P,[r,P]),_s(x,A),_s(m.content,A),(0,fe.jsx)(bR,{scope:a,scrollbar:x,hasThumb:o,onThumbChange:so(n),onThumbPointerUp:so(s),onThumbPositionChange:P,onThumbPointerDown:so(i),children:(0,fe.jsx)(Ts.div,{...f,ref:L,style:{position:"absolute",...f.style},onPointerDown:io(e.onPointerDown,q=>{q.button===0&&(q.target.setPointerCapture(q.pointerId),h.current=x.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),R(q))}),onPointerMove:io(e.onPointerMove,R),onPointerUp:io(e.onPointerUp,q=>{let U=q.target;U.hasPointerCapture(q.pointerId)&&U.releasePointerCapture(q.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=""),h.current=null})})})}),Hc="ScrollAreaThumb",Dg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=NS(Hc,e.__scopeScrollArea);return(0,fe.jsx)(As,{present:a||o.hasThumb,children:(0,fe.jsx)(kR,{ref:t,...r})})}),kR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=ha(Hc,a),s=NS(Hc,a),{onThumbPositionChange:i}=s,l=fr(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=AR(c,i);u.current=m,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,fe.jsx)(Ts.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:io(e.onPointerDownCapture,c=>{let m=c.target.getBoundingClientRect(),x=c.clientX-m.left,C=c.clientY-m.top;s.onThumbPointerDown({x,y:C})}),onPointerUp:io(e.onPointerUp,s.onThumbPointerUp)})});Dg.displayName=Hc;var Mg="ScrollAreaCorner",FS=$.forwardRef((e,t)=>{let a=ha(Mg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,fe.jsx)(PR,{...e,ref:t}):null});FS.displayName=Mg;var PR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=ha(Mg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return _s(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),_s(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,fe.jsx)(Ts.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 BS(e,t){let a=e/t;return isNaN(a)?0:a}function $c(e){let t=BS(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function TR(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 US([l,u],c)(e)}function TS(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=PS(e,l);return US([0,s],[0,i])(u)}function US(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 VS(e,t){return e>0&&e<t}var AR=(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=so(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function _s(e,t){let a=so(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 jS=_S,qS=DS;var HS=FS;var lo=N(ie(),1),Ng=zS.forwardRef(({className:e,children:t,...a},r)=>(0,lo.jsxs)(jS,{"data-slot":"scroll-area",className:Yt("relative",e),...a,children:[(0,lo.jsx)(qS,{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,lo.jsx)(_R,{}),(0,lo.jsx)(HS,{})]}));Ng.displayName="ScrollArea";function _R({className:e,orientation:t="vertical",...a}){return(0,lo.jsx)(_g,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Yt("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,lo.jsx)(Dg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Kc=N(W());var $S=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ER=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Og=e=>{let t=ER(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(),WS=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var eu=N(W());var GS={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 KS=(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,...GS,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Gc("lucide",o),...!n&&!WS(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,eu.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var V=(e,t)=>{let a=(0,Kc.forwardRef)(({className:r,...o},n)=>(0,Kc.createElement)(KS,{ref:n,iconNode:t,className:Gc(`lucide-${$S(Og(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Og(e),a};var DR=[["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=V("activity",DR);var MR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Es=V("arrow-left",MR);var NR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],au=V("arrow-up",NR);var OR=[["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=V("calendar",OR);var FR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ou=V("chevron-down",FR);var BR=[["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"}]],Pa=V("circle-alert",BR);var UR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],rt=V("circle-check",UR);var VR=[["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"}]],Ta=V("circle-x",VR);var jR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fn=V("clock",jR);var qR=[["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"}]],mr=V("command",qR);var HR=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],hr=V("corner-down-left",HR);var zR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],pn=V("credit-card",zR);var $R=[["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"}]],mn=V("crown",$R);var WR=[["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"}]],hn=V("dollar-sign",WR);var GR=[["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"}]],Ds=V("file-spreadsheet",GR);var KR=[["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"}]],Ms=V("key",KR);var XR=[["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=V("laptop",XR);var QR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pt=V("loader-circle",QR);var JR=[["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"}]],Ns=V("mail",JR);var YR=[["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"}]],Os=V("map-pin",YR);var ZR=[["path",{d:"M5 12h14",key:"1ays0h"}]],gn=V("minus",ZR);var e_=[["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=V("paperclip",e_);var t_=[["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"}]],Fs=V("refresh-cw",t_);var a_=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yn=V("search",a_);var r_=[["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"}]],Bs=V("shield",r_);var o_=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],iu=V("smartphone",o_);var n_=[["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"}]],Zt=V("sparkles",n_);var s_=[["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"}]],Bt=V("square-pen",s_);var i_=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],lu=V("trending-up",i_);var l_=[["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"}]],Us=V("users",l_);var u_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gr=V("x",u_);var d_=[["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=V("zap",d_);var cu=N(ie(),1),ja=N(W(),1);var XS=N(W(),1),Vs=(0,XS.createContext)({});var QS=N(W(),1);function uo(e){let t=(0,QS.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Bg=N(ie(),1),tL=N(W(),1),xn=N(W(),1);var JS=N(W(),1),co=(0,JS.createContext)(null);var ZS=N(ie(),1),Xc=N(W(),1),yr=N(W(),1);var YS=N(W(),1),js=(0,YS.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 eL({children:e,isPresent:t}){let a=(0,yr.useId)(),r=(0,yr.useRef)(null),o=(0,yr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,yr.useContext)(js);return(0,yr.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(`
|
|
13
|
+
});`,ys=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=gc,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=lS,this.ref=0,this.logger=lS,this.conn=null,this.sendBuffer=[],this.serializer=new Nl,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(()=>(Yr(),zo)).then(({default:l})=>l(...i)):s=fetch,(...i)=>s(...i)},this.endPoint=`${t}/${hc.websocket}`,this.httpEndpoint=yc(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 $o(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=aS),!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:nS}))}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 ms.connecting:return Zr.Connecting;case ms.open:return Zr.Open;case ms.closing:return Zr.Closing;default:return Zr.Closed}}isConnected(){return this.connectionState()===Zr.Open}channel(t,a={config:{}}){let r=`realtime:${t}`,o=this.getChannels().find(n=>n.topic===r);if(o)return o;{let n=new gs(`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:oS};a&&r.updateJoinPayload(o),r.joinedOnce&&r._isJoined()&&r._push(Jt.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(sS,"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(Jt.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([V1],{type:"application/javascript"});a=URL.createObjectURL(r)}return a}};var xs=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 xc=class extends xs{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}}},Go=class extends xs{constructor(t,a){super(t),this.name="StorageUnknownError",this.originalError=a}};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())})},wc=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Yr(),zo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},uS=()=>j1(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>(Yr(),zo))).Response:Response}),vc=e=>{if(Array.isArray(e))return e.map(a=>vc(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]=vc(r)}),t},dS=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 Ko=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())})},vg=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),q1=(e,t,a)=>Ko(void 0,void 0,void 0,function*(){let r=yield uS();e instanceof r&&!a?.noResolveJson?e.json().then(o=>{let n=e.status||500,s=o?.statusCode||n+"";t(new xc(vg(o),n,s))}).catch(o=>{t(new Go(vg(o),o))}):t(new Go(vg(e),e))}),H1=(e,t,a,r)=>{let o={method:e,headers:t?.headers||{}};return e==="GET"||!r?o:(dS(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 Ol(e,t,a,r,o,n){return Ko(this,void 0,void 0,function*(){return new Promise((s,i)=>{e(a,H1(t,r,o,n)).then(l=>{if(!l.ok)throw l;return r?.noResolveJson?l:l.json()}).then(l=>s(l)).catch(l=>q1(l,i,r))})})}function vs(e,t,a,r){return Ko(this,void 0,void 0,function*(){return Ol(e,"GET",t,a,r)})}function Pa(e,t,a,r,o){return Ko(this,void 0,void 0,function*(){return Ol(e,"POST",t,r,o,a)})}function Fl(e,t,a,r,o){return Ko(this,void 0,void 0,function*(){return Ol(e,"PUT",t,r,o,a)})}function cS(e,t,a,r){return Ko(this,void 0,void 0,function*(){return Ol(e,"HEAD",t,Object.assign(Object.assign({},a),{noResolveJson:!0}),r)})}function Sc(e,t,a,r,o){return Ko(this,void 0,void 0,function*(){return Ol(e,"DELETE",t,r,o,a)})}var Bt=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())})},z1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},fS={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Bl=class{constructor(t,a={},r,o){this.url=t,this.headers=a,this.bucketId=r,this.fetch=wc(o)}uploadOrUpdate(t,a,r,o){return Bt(this,void 0,void 0,function*(){try{let n,s=Object.assign(Object.assign({},fS),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"?Fl:Pa)(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 Bt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,a,r)})}uploadToSignedUrl(t,a,r,o){return Bt(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:fS.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 Fl(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 Bt(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 Pa(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 xs("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 Bt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,a,r)})}move(t,a,r){return Bt(this,void 0,void 0,function*(){try{return{data:yield Pa(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 Bt(this,void 0,void 0,function*(){try{return{data:{path:(yield Pa(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 Bt(this,void 0,void 0,function*(){try{let o=this._getFinalPath(t),n=yield Pa(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 Bt(this,void 0,void 0,function*(){try{let o=yield Pa(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 Bt(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 vs(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 Bt(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{let r=yield vs(this.fetch,`${this.url}/object/info/${a}`,{headers:this.headers});return{data:vc(r),error:null}}catch(r){if(He(r))return{data:null,error:r};throw r}})}exists(t){return Bt(this,void 0,void 0,function*(){let a=this._getFinalPath(t);try{return yield cS(this.fetch,`${this.url}/object/${a}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(He(r)&&r instanceof Go){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 Bt(this,void 0,void 0,function*(){try{return{data:yield Sc(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 Bt(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},z1),a),{prefix:t||""});return{data:yield Pa(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 pS="2.10.4";var mS={"X-Client-Info":`storage-js/${pS}`};var ws=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())})},Ul=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({},mS),a),this.fetch=wc(r)}listBuckets(){return ws(this,void 0,void 0,function*(){try{return{data:yield vs(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 ws(this,void 0,void 0,function*(){try{return{data:yield vs(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 ws(this,void 0,void 0,function*(){try{return{data:yield Pa(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 ws(this,void 0,void 0,function*(){try{return{data:yield Fl(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 ws(this,void 0,void 0,function*(){try{return{data:yield Pa(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 ws(this,void 0,void 0,function*(){try{return{data:yield Sc(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(a){if(He(a))return{data:null,error:a};throw a}})}};var Vl=class extends Ul{constructor(t,a={},r,o){super(t,a,r,o)}from(t){return new Bl(this.url,this.headers,t,this.fetch)}};var hS="2.53.0";var jl="";typeof Deno<"u"?jl="deno":typeof document<"u"?jl="web":typeof navigator<"u"&&navigator.product==="ReactNative"?jl="react-native":jl="node";var $1={"X-Client-Info":`supabase-js-${jl}/${hS}`},gS={headers:$1},yS={schema:"public"},xS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},vS={};Yr();var W1=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())})},G1=e=>{let t;return e?t=e:typeof fetch>"u"?t=tg:t=fetch,(...a)=>t(...a)},K1=()=>typeof Headers>"u"?ag:Headers,wS=(e,t,a)=>{let r=G1(a),o=K1();return(n,s)=>W1(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 X1=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 SS(e){return e.endsWith("/")?e:e+"/"}function CS(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:()=>X1(this,void 0,void 0,function*(){return""})};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}var Cc="2.71.1";var Xo=30*1e3,Lc=3,Ic=Lc*Xo,LS="http://localhost:9999",IS="supabase.auth.token";var bS={"X-Client-Info":`gotrue-js/${Cc}`};var ql="X-Supabase-Api-Version",wg={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},kS=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,PS=600*1e3;var Hl=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 bc=class extends Hl{constructor(t,a,r){super(t,a,r),this.name="AuthApiError",this.status=a,this.code=r}};function TS(e){return J(e)&&e.name==="AuthApiError"}var Ss=class extends Hl{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}},Ua=class extends Hl{constructor(t,a,r,o){super(t,r,o),this.name=a,this.status=r}},fa=class extends Ua{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};function AS(e){return J(e)&&e.name==="AuthSessionMissingError"}var Qo=class extends Ua{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}},Jo=class extends Ua{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}},Yo=class extends Ua{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 RS(e){return J(e)&&e.name==="AuthImplicitGrantRedirectError"}var zl=class extends Ua{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}}},Cs=class extends Ua{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}};function kc(e){return J(e)&&e.name==="AuthRetryableFetchError"}var $l=class extends Ua{constructor(t,a,r){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=r}};var Zo=class extends Ua{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}};var Pc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),_S=`
|
|
14
|
+
\r=`.split(""),Q1=(()=>{let e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<_S.length;t+=1)e[_S[t].charCodeAt(0)]=-2;for(let t=0;t<Pc.length;t+=1)e[Pc[t].charCodeAt(0)]=t;return e})();function ES(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(Pc[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(Pc[r]),t.queuedBits-=6}}function DS(e,t,a){let r=Q1[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 Sg(e){let t=[],a=s=>{t.push(String.fromCodePoint(s))},r={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},n=s=>{Z1(s,r,a)};for(let s=0;s<e.length;s+=1)DS(e.charCodeAt(s),o,n);return t.join("")}function J1(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 Y1(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}J1(r,t)}}function Z1(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 MS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)DS(e.charCodeAt(o),a,r);return new Uint8Array(t)}function NS(e){let t=[];return Y1(e,a=>t.push(a)),new Uint8Array(t)}function OS(e){let t=[],a={queue:0,queuedBits:0},r=o=>{t.push(o)};return e.forEach(o=>ES(o,a,r)),ES(null,a,r),t.join("")}function FS(e){return Math.round(Date.now()/1e3)+e}function BS(){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 pa=()=>typeof window<"u"&&typeof document<"u",en={tested:!1,writable:!1},Tc=()=>{if(!pa())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(en.tested)return en.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),en.tested=!0,en.writable=!0}catch{en.tested=!0,en.writable=!1}return en.writable};function US(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 Ac=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...a)=>Promise.resolve().then(()=>(Yr(),zo)).then(({default:r})=>r(...a)):t=fetch,(...a)=>t(...a)},VS=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",tn=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},eo=async(e,t)=>{let a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return a}},cr=async(e,t)=>{await e.removeItem(t)},Wl=class e{constructor(){this.promise=new e.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}};Wl.promiseConstructor=Promise;function Rc(e){let t=e.split(".");if(t.length!==3)throw new Zo("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!kS.test(t[r]))throw new Zo("JWT not in base64url format");return{header:JSON.parse(Sg(t[0])),payload:JSON.parse(Sg(t[1])),signature:MS(t[2]),raw:{header:t[0],payload:t[1]}}}async function jS(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function qS(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 eA(e){return("0"+e.toString(16)).substr(-2)}function tA(){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,eA).join("")}async function aA(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 rA(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 aA(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function an(e,t,a=!1){let r=tA(),o=r;a&&(o+="/PASSWORD_RECOVERY"),await tn(e,`${t}-code-verifier`,o);let n=await rA(r);return[n,r===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 HS(e){let t=e.headers.get(ql);if(!t||!t.match(oA))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function zS(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 $S(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 rn(e){if(!nA.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function _c(){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 Cg(e){return JSON.parse(JSON.stringify(e))}var sA=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},on=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),iA=[502,503,504];async function WS(e){var t;if(!VS(e))throw new Cs(on(e),0);if(iA.includes(e.status))throw new Cs(on(e),e.status);let a;try{a=await e.json()}catch(n){throw new Ss(on(n),n)}let r,o=HS(e);if(o&&o.getTime()>=wg["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 $l(on(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new fa}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 $l(on(a),e.status,a.weak_password.reasons);throw new bc(on(a),e.status||500,r)}var lA=(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[ql]||(n[ql]=wg["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 uA(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 uA(e,t,a,r,o,n){let s=lA(t,r,o,n),i;try{i=await e(a,Object.assign({},s))}catch(l){throw console.error(l),new Cs(on(l),0)}if(i.ok||await WS(i),r?.noResolveJson)return i;try{return await i.json()}catch(l){await WS(l)}}function Va(e){var t;let a=null;dA(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=FS(e.expires_in)));let r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:a,user:r},error:null}}function Lg(e){let t=Va(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 ja(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function GS(e){return{data:e,error:null}}function KS(e){let{action_link:t,email_otp:a,hashed_token:r,redirect_to:o,verification_type:n}=e,s=sA(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 XS(e){return e}function dA(e){return e.access_token&&e.refresh_token&&e.expires_in}var Ec=["global","local","others"];var cA=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=class{constructor({url:t="",headers:a={},fetch:r}){this.url=t,this.headers=a,this.fetch=Ac(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(t,a=Ec[0]){if(Ec.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ec.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:ja})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{let{options:a}=t,r=cA(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:KS,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:ja})}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:XS});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)),I=JSON.parse(x.split(";")[1].split("=")[1]);u[`${I}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){rn(t);try{return await te(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ja})}catch(a){if(J(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){rn(t);try{return await te(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:ja})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,a=!1){rn(t);try{return await te(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:ja})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){rn(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){rn(t.userId),rn(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 QS(){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 sn={debug:!!(globalThis&&Tc()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")},Gl=class extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}},Dc=class extends Gl{};async function bg(e,t,a){sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);let r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),sn.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){sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await a()}finally{sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw sn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Dc(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(sn.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()}}))}QS();var fA={url:LS,storageKey:IS,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:bS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function JS(e,t,a){return await a()}var Ls={},ln=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&&pa()&&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({},fA),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 nn({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=Ac(o.fetch),this.lock=o.lock||JS,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:pa()&&(!((a=globalThis?.navigator)===null||a===void 0)&&a.locks)?this.lock=bg:this.lock=JS,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:Tc()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Ig(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=Ig(this.memoryStorage)),pa()&&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=Ls[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){Ls[this.storageKey]=Object.assign(Object.assign({},Ls[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=Ls[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Ls[this.storageKey]=Object.assign(Object.assign({},Ls[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Cc}) ${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=US(window.location.href),r="none";if(this._isImplicitGrantCallback(a)?r="implicit":await this._isPKCECallback(a)&&(r="pkce"),pa()&&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),RS(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 Ss("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:Va}),{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 an(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:Va})}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:Va})}else throw new Jo("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:Lg})}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:Lg})}else throw new Jo("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 Qo}:(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:I,wallet:h,statement:g,options:y}=t,C;if(pa())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:I,error:h}=await te(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:OS(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:Va});if(h)throw h;return!I||!I.session||!I.user?{data:{user:null,session:null},error:new Qo}:(I.session&&(await this._saveSession(I.session),await this._notifyAllSubscribers("SIGNED_IN",I.session)),{data:Object.assign({},I),error:h})}catch(I){if(J(I))return{data:{user:null,session:null},error:I};throw I}}async _exchangeCodeForSession(t){let a=await eo(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:Va});if(await cr(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!n||!n.session||!n.user?{data:{user:null,session:null,redirectType:null},error:new Qo}:(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:Va}),{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 Qo}:(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 an(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 Jo("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:Va});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 an(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:GS})}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 fa;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 Jo("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 eo(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 eo(this.userStorage,this.storageKey+"-user");s?.user?t.user=s.user:t.user=_c()}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:ja}):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 fa}: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:ja})})}catch(a){if(J(a))return AS(a)&&(await this._removeSession(),await cr(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 fa;let s=o.session,i=null,l=null;this.flowType==="pkce"&&t.email!=null&&([i,l]=await an(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:ja});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 fa;let a=Date.now()/1e3,r=a,o=!0,n=null,{payload:s}=Rc(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 fa;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(!pa())throw new Yo("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Yo(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 zl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Yo("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 zl("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 Yo("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<=Xo&&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:I}=await this._getUser(n);if(I)throw I;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 eo(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&&!(TS(i)&&(i.status===404||i.status===401||i.status===403)))return{error:i}}return t!=="others"&&(await this._removeSession(),await cr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){let a=BS(),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 an(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 pa()&&!(!((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 qS(async o=>(o>0&&await jS(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:Va})),(o,n)=>{let s=200*Math.pow(2,o);return n&&kc(n)&&Date.now()+s-r<Xo})}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),pa()&&!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 eo(this.storage,this.storageKey);if(o&&this.userStorage){let s=await eo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!s&&(s={user:o.user},await tn(this.userStorage,this.storageKey+"-user",s)),o.user=(t=s?.user)!==null&&t!==void 0?t:_c()}else if(o&&!o.user&&!o.user){let s=await eo(this.storage,this.storageKey+"-user");s&&s?.user?(o.user=s.user,await cr(this.storage,this.storageKey+"-user"),await tn(this.storage,this.storageKey,o)):o.user=_c()}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),kc(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 fa;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Wl;let{data:n,error:s}=await this._refreshAccessToken(t);if(s)throw s;if(!n.session)throw new fa;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 kc(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 tn(this.userStorage,this.storageKey+"-user",{user:a.user});let o=Object.assign({},a);delete o.user;let n=Cg(o);await tn(this.storage,this.storageKey,n)}else{let o=Cg(a);await tn(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await cr(this.storage,this.storageKey),await cr(this.storage,this.storageKey+"-code-verifier"),await cr(this.storage,this.storageKey+"-user"),this.userStorage&&await cr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&pa()&&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(),Xo);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)/Xo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${Xo}ms, refresh threshold is ${Lc} ticks`),o<=Lc&&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 Gl)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!pa()||!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 an(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}=Rc(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+PS>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}}=Rc(r);a?.allowExpired||zS(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=$S(o.alg),c=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,c,s,NS(`${i}.${l}`)))throw new Zo("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}}};ln.nextInstanceID=0;var pA=ln,kg=pA;var Mc=class extends kg{constructor(t){super(t)}};var mA=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())})},Kl=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=SS(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:yS,realtime:vS,auth:Object.assign(Object.assign({},xS),{storageKey:u}),global:gS},c=CS(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=wS(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 eS(new URL("rest/v1",l).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Vl(this.storageUrl.href,this.headers,this.fetch,r?.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new Tl(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 mA(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 Mc({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 ys(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 YS=(e,t,a)=>new Kl(e,t,a);function hA(){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}hA()&&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 ZS(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=ZS(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}function Nc(){for(var e,t,a=0,r="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=ZS(e))&&(r&&(r+=" "),r+=t);return r}var gA=e=>{let t=xA(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{let i=s.split("-");return i[0]===""&&i.length!==1&&i.shift(),aC(i,t)||yA(s)},getConflictingClassGroupIds:(s,i)=>{let l=a[s]||[];return i&&r[s]?[...l,...r[s]]:l}}},aC=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],r=t.nextPart.get(a),o=r?aC(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},eC=/^\[(.+)\]$/,yA=e=>{if(eC.test(e)){let t=eC.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},xA=e=>{let{theme:t,prefix:a}=e,r={nextPart:new Map,validators:[]};return wA(Object.entries(e.classGroups),a).forEach(([n,s])=>{Tg(s,r,n,t)}),r},Tg=(e,t,a,r)=>{e.forEach(o=>{if(typeof o=="string"){let n=o===""?t:tC(t,o);n.classGroupId=a;return}if(typeof o=="function"){if(vA(o)){Tg(o(r),t,a,r);return}t.validators.push({validator:o,classGroupId:a});return}Object.entries(o).forEach(([n,s])=>{Tg(s,tC(t,n),a,r)})})},tC=(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},vA=e=>e.isThemeGetter,wA=(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,SA=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 CA=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 I=0;I<i.length;I++){let h=i[I];if(u===0){if(h===o&&(r||i.slice(I,I+n)===t)){l.push(i.slice(d,I)),d=I+n;continue}if(h==="/"){c=I;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},LA=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},IA=e=>({cache:SA(e.cacheSize),parseClassName:CA(e),...gA(e)}),bA=/\s+/,kA=(e,t)=>{let{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:o}=t,n=[],s=e.trim().split(bA),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 I=LA(d).join(":"),h=c?I+"!":I,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 PA(){let e=0,t,a,r="";for(;e<arguments.length;)(t=arguments[e++])&&(a=rC(t))&&(r&&(r+=" "),r+=a);return r}var rC=e=>{if(typeof e=="string")return e;let t,a="";for(let r=0;r<e.length;r++)e[r]&&(t=rC(e[r]))&&(a&&(a+=" "),a+=t);return a};function TA(e,...t){let a,r,o,n=s;function s(l){let u=t.reduce((d,c)=>c(d),e());return a=IA(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=kA(l,a);return o(l,d),d}return function(){return n(PA.apply(null,arguments))}}var Pe=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},oC=/^\[(?:([a-z-]+):)?(.+)\]$/i,AA=/^\d+\/\d+$/,RA=new Set(["px","full","screen"]),_A=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,EA=/\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$/,DA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,MA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=e=>Is(e)||RA.has(e)||AA.test(e),to=e=>bs(e,"length",HA),Is=e=>!!e&&!Number.isNaN(Number(e)),Pg=e=>bs(e,"number",Is),Xl=e=>!!e&&Number.isInteger(Number(e)),OA=e=>e.endsWith("%")&&Is(e.slice(0,-1)),Y=e=>oC.test(e),ao=e=>_A.test(e),FA=new Set(["length","size","percentage"]),BA=e=>bs(e,FA,nC),UA=e=>bs(e,"position",nC),VA=new Set(["image","url"]),jA=e=>bs(e,VA,$A),qA=e=>bs(e,"",zA),Ql=()=>!0,bs=(e,t,a)=>{let r=oC.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):a(r[2]):!1},HA=e=>EA.test(e)&&!DA.test(e),nC=()=>!1,zA=e=>MA.test(e),$A=e=>NA.test(e);var WA=()=>{let e=Pe("colors"),t=Pe("spacing"),a=Pe("blur"),r=Pe("brightness"),o=Pe("borderColor"),n=Pe("borderRadius"),s=Pe("borderSpacing"),i=Pe("borderWidth"),l=Pe("contrast"),u=Pe("grayscale"),d=Pe("hueRotate"),c=Pe("invert"),f=Pe("gap"),m=Pe("gradientColorStops"),x=Pe("gradientColorStopPositions"),w=Pe("inset"),I=Pe("margin"),h=Pe("opacity"),g=Pe("padding"),y=Pe("saturate"),C=Pe("scale"),L=Pe("sepia"),P=Pe("skew"),A=Pe("space"),R=Pe("translate"),q=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",Y,t],le=()=>[Y,t],An=()=>["",fr,to],oe=()=>["auto",Is,Y],Pi=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ha=()=>["solid","dashed","dotted","double","none"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ot=()=>["start","end","center","between","around","evenly","stretch"],mt=()=>["","0",Y],xe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ga=()=>[Is,Y];return{cacheSize:500,separator:":",theme:{colors:[Ql],spacing:[fr,to],blur:["none","",ao,Y],brightness:ga(),borderColor:[e],borderRadius:["none","","full",ao,Y],borderSpacing:le(),borderWidth:An(),contrast:ga(),grayscale:mt(),hueRotate:ga(),invert:mt(),gap:le(),gradientColorStops:[e],gradientColorStopPositions:[OA,to],inset:pe(),margin:pe(),opacity:ga(),padding:le(),saturate:ga(),scale:ga(),sepia:mt(),skew:ga(),space:le(),translate:le()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[ao]}],"break-after":[{"break-after":xe()}],"break-before":[{"break-before":xe()}],"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:[...Pi(),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",Xl,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",Xl,Y]}],"grid-cols":[{"grid-cols":[Ql]}],"col-start-end":[{col:["auto",{span:["full",Xl,Y]},Y]}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":[Ql]}],"row-start-end":[{row:["auto",{span:[Xl,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",...ot()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ot(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ot(),"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:[I]}],mx:[{mx:[I]}],my:[{my:[I]}],ms:[{ms:[I]}],me:[{me:[I]}],mt:[{mt:[I]}],mr:[{mr:[I]}],mb:[{mb:[I]}],ml:[{ml:[I]}],"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:[ao]},ao]}],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",ao,to]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pg]}],"font-family":[{font:[Ql]}],"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,Pg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",fr,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:[...ha(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",fr,to]}],"underline-offset":[{"underline-offset":["auto",fr,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:[...Pi(),UA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",BA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},jA]}],"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:[...ha(),"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:ha()}],"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:["",...ha()]}],"outline-offset":[{"outline-offset":[fr,Y]}],"outline-w":[{outline:[fr,to]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:An()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[fr,to]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ao,qA]}],"shadow-color":[{shadow:[Ql]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Be(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Be()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ao,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:ga()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:ga()}],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:[Xl,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:[fr,to,Pg]}],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 sC=TA(WA);function Yt(...e){return sC(Nc(e))}var dC=D(ue(),1);function Me({className:e,type:t,...a}){return(0,dC.jsx)("input",{type:t,"data-slot":"input",className:Yt("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=D(W(),1);var fC=D(W(),1);function cC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Jl(...e){return t=>{let a=!1,r=e.map(o=>{let n=cC(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():cC(e[o],null)}}}}function pr(...e){return fC.useCallback(Jl(...e),e)}var Fc=D(ue(),1),ZA=Symbol.for("react.lazy"),Bc=ze[" use ".trim().toString()];function eR(e){return typeof e=="object"&&e!==null&&"then"in e}function pC(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ZA&&"_payload"in e&&eR(e._payload)}function tR(e){let t=aR(e),a=ze.forwardRef((r,o)=>{let{children:n,...s}=r;pC(n)&&typeof Bc=="function"&&(n=Bc(n._payload));let i=ze.Children.toArray(n),l=i.find(oR);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,Fc.jsx)(t,{...s,ref:o,children:ze.isValidElement(u)?ze.cloneElement(u,void 0,d):null})}return(0,Fc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}var mC=tR("Slot");function aR(e){let t=ze.forwardRef((a,r)=>{let{children:o,...n}=a;if(pC(o)&&typeof Bc=="function"&&(o=Bc(o._payload)),ze.isValidElement(o)){let s=sR(o),i=nR(n,o.props);return o.type!==ze.Fragment&&(i.ref=r?Jl(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 rR=Symbol("radix.slottable");function oR(e){return ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rR}function nR(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 sR(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 hC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gC=Nc,yC=(e,t)=>a=>{var r;if(t?.variants==null)return gC(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=hC(d)||hC(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,I]=x;return Array.isArray(I)?I.includes({...n,...i}[w]):{...n,...i}[w]===I})?[...u,c,f]:u},[]);return gC(e,s,l,a?.class,a?.className)};var xC=D(ue(),1),iR=yC("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 tt({className:e,variant:t,size:a,asChild:r=!1,...o}){return(0,xC.jsx)(r?mC:"button",{"data-slot":"button",className:Yt(iR({variant:t,size:a,className:e})),...o})}var zC=D(W(),1);var $=D(W(),1);var wC=D(W(),1),pR=D(Zh(),1);var Xe=D(W(),1);var Uc=D(ue(),1);function vC(e){let t=lR(e),a=Xe.forwardRef((r,o)=>{let{children:n,...s}=r,i=Xe.Children.toArray(n),l=i.find(dR);if(l){let u=l.props.children,d=i.map(c=>c===l?Xe.Children.count(u)>1?Xe.Children.only(null):Xe.isValidElement(u)?u.props.children:null:c);return(0,Uc.jsx)(t,{...s,ref:o,children:Xe.isValidElement(u)?Xe.cloneElement(u,void 0,d):null})}return(0,Uc.jsx)(t,{...s,ref:o,children:n})});return a.displayName=`${e}.Slot`,a}function lR(e){let t=Xe.forwardRef((a,r)=>{let{children:o,...n}=a;if(Xe.isValidElement(o)){let s=fR(o),i=cR(n,o.props);return o.type!==Xe.Fragment&&(i.ref=r?Jl(r,s):s),Xe.cloneElement(o,i)}return Xe.Children.count(o)>1?Xe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uR=Symbol("radix.slottable");function dR(e){return Xe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uR}function cR(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 fR(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 SC=D(ue(),1),mR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ks=mR.reduce((e,t)=>{let a=vC(`Primitive.${t}`),r=wC.forwardRef((o,n)=>{let{asChild:s,...i}=o,l=s?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,SC.jsx)(l,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});var Ut=D(W(),1);var CC=D(W(),1),Yl=globalThis?.document?CC.useLayoutEffect:()=>{};var LC=D(W(),1);function hR(e,t){return LC.useReducer((a,r)=>t[a][r]??a,e)}var Ps=e=>{let{present:t,children:a}=e,r=gR(t),o=typeof a=="function"?a({present:r.isPresent}):Ut.Children.only(a),n=pr(r.ref,yR(o));return typeof a=="function"||r.isPresent?Ut.cloneElement(o,{ref:n}):null};Ps.displayName="Presence";function gR(e){let[t,a]=Ut.useState(),r=Ut.useRef(null),o=Ut.useRef(e),n=Ut.useRef("none"),s=e?"mounted":"unmounted",[i,l]=hR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Ut.useEffect(()=>{let u=Vc(r.current);n.current=i==="mounted"?u:"none"},[i]),Yl(()=>{let u=r.current,d=o.current;if(d!==e){let f=n.current,m=Vc(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Yl(()=>{if(t){let u,d=t.ownerDocument.defaultView??window,c=m=>{let w=Vc(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&w&&(l("ANIMATION_END"),!o.current)){let I=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=I)})}},f=m=>{m.target===t&&(n.current=Vc(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:Ut.useCallback(u=>{r.current=u?getComputedStyle(u):null,a(u)},[])}}function Vc(e){return e?.animationName||"none"}function yR(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 mr=D(W(),1),IC=D(ue(),1);function bC(e,t=[]){let a=[];function r(n,s){let i=mr.createContext(s),l=a.length;a=[...a,s];let u=c=>{let{scope:f,children:m,...x}=c,w=f?.[e]?.[l]||i,I=mr.useMemo(()=>x,Object.values(x));return(0,IC.jsx)(w.Provider,{value:I,children:m})};u.displayName=n+"Provider";function d(c,f){let m=f?.[e]?.[l]||i,x=mr.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=>mr.createContext(s));return function(i){let l=i?.[e]||n;return mr.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,xR(o,...t)]}function xR(...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 mr.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return a.scopeName=t.scopeName,a}var Ts=D(W(),1);function ro(e){let t=Ts.useRef(e);return Ts.useEffect(()=>{t.current=e}),Ts.useMemo(()=>(...a)=>t.current?.(...a),[])}var jc=D(W(),1),vR=D(ue(),1),wR=jc.createContext(void 0);function kC(e){let t=jc.useContext(wR);return e||t||"ltr"}function PC(e,[t,a]){return Math.min(a,Math.max(t,e))}var LO=!!(typeof window<"u"&&window.document&&window.document.createElement);function oo(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e?.(o),a===!1||!o.defaultPrevented)return t?.(o)}}var AC=D(W(),1),fe=D(ue(),1);function SR(e,t){return AC.useReducer((a,r)=>t[a][r]??a,e)}var Ag="ScrollArea",[RC,MO]=bC(Ag),[CR,ma]=RC(Ag),_C=$.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,I]=$.useState(null),[h,g]=$.useState(0),[y,C]=$.useState(0),[L,P]=$.useState(!1),[A,R]=$.useState(!1),q=pr(t,pe=>l(pe)),V=kC(o);return(0,fe.jsx)(CR,{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:I,scrollbarYEnabled:A,onScrollbarYEnabledChange:R,onCornerWidthChange:g,onCornerHeightChange:C,children:(0,fe.jsx)(ks.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}})})});_C.displayName=Ag;var EC="ScrollAreaViewport",DC=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,children:r,nonce:o,...n}=e,s=ma(EC,a),i=$.useRef(null),l=pr(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)(ks.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})})]})});DC.displayName=EC;var qa="ScrollAreaScrollbar",Rg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ma(qa,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)(LR,{...r,ref:t,forceMount:a}):o.type==="scroll"?(0,fe.jsx)(IR,{...r,ref:t,forceMount:a}):o.type==="auto"?(0,fe.jsx)(MC,{...r,ref:t,forceMount:a}):o.type==="always"?(0,fe.jsx)(_g,{...r,ref:t}):null});Rg.displayName=qa;var LR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ma(qa,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)(Ps,{present:a||n,children:(0,fe.jsx)(MC,{"data-state":n?"visible":"hidden",...r,ref:t})})}),IR=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=ma(qa,e.__scopeScrollArea),n=e.orientation==="horizontal",s=$c(()=>l("SCROLL_END"),100),[i,l]=SR("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)(Ps,{present:a||i!=="hidden",children:(0,fe.jsx)(_g,{"data-state":i==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:oo(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:oo(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),MC=$.forwardRef((e,t)=>{let a=ma(qa,e.__scopeScrollArea),{forceMount:r,...o}=e,[n,s]=$.useState(!1),i=e.orientation==="horizontal",l=$c(()=>{if(a.viewport){let u=a.viewport.offsetWidth<a.viewport.scrollWidth,d=a.viewport.offsetHeight<a.viewport.scrollHeight;s(i?u:d)}},10);return As(a.viewport,l),As(a.content,l),(0,fe.jsx)(Ps,{present:r||n,children:(0,fe.jsx)(_g,{"data-state":n?"visible":"hidden",...o,ref:t})})}),_g=$.forwardRef((e,t)=>{let{orientation:a="vertical",...r}=e,o=ma(qa,e.__scopeScrollArea),n=$.useRef(null),s=$.useRef(0),[i,l]=$.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=BC(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 RR(f,s.current,i,m)}return a==="horizontal"?(0,fe.jsx)(bR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollLeft,m=TC(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)(kR,{...d,ref:t,onThumbPositionChange:()=>{if(o.viewport&&n.current){let f=o.viewport.scrollTop,m=TC(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}),bR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ma(qa,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=pr(t,l,n.onScrollbarXChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(OC,{"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":zc(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),VC(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:Hc(s.paddingLeft),paddingEnd:Hc(s.paddingRight)}})}})}),kR=$.forwardRef((e,t)=>{let{sizes:a,onSizesChange:r,...o}=e,n=ma(qa,e.__scopeScrollArea),[s,i]=$.useState(),l=$.useRef(null),u=pr(t,l,n.onScrollbarYChange);return $.useEffect(()=>{l.current&&i(getComputedStyle(l.current))},[l]),(0,fe.jsx)(OC,{"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":zc(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),VC(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:Hc(s.paddingTop),paddingEnd:Hc(s.paddingBottom)}})}})}),[PR,NC]=RC(qa),OC=$.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=ma(qa,a),[x,w]=$.useState(null),I=pr(t,q=>w(q)),h=$.useRef(null),g=$.useRef(""),y=m.viewport,C=r.content-r.viewport,L=ro(d),P=ro(l),A=$c(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]),As(x,A),As(m.content,A),(0,fe.jsx)(PR,{scope:a,scrollbar:x,hasThumb:o,onThumbChange:ro(n),onThumbPointerUp:ro(s),onThumbPositionChange:P,onThumbPointerDown:ro(i),children:(0,fe.jsx)(ks.div,{...f,ref:I,style:{position:"absolute",...f.style},onPointerDown:oo(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:oo(e.onPointerMove,R),onPointerUp:oo(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})})})}),qc="ScrollAreaThumb",Eg=$.forwardRef((e,t)=>{let{forceMount:a,...r}=e,o=NC(qc,e.__scopeScrollArea);return(0,fe.jsx)(Ps,{present:a||o.hasThumb,children:(0,fe.jsx)(TR,{ref:t,...r})})}),TR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,style:r,...o}=e,n=ma(qc,a),s=NC(qc,a),{onThumbPositionChange:i}=s,l=pr(t,c=>s.onThumbChange(c)),u=$.useRef(void 0),d=$c(()=>{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=_R(c,i);u.current=m,i()}};return i(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[n.viewport,d,i]),(0,fe.jsx)(ks.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:oo(e.onPointerDownCapture,c=>{let m=c.target.getBoundingClientRect(),x=c.clientX-m.left,w=c.clientY-m.top;s.onThumbPointerDown({x,y:w})}),onPointerUp:oo(e.onPointerUp,s.onThumbPointerUp)})});Eg.displayName=qc;var Dg="ScrollAreaCorner",FC=$.forwardRef((e,t)=>{let a=ma(Dg,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?(0,fe.jsx)(AR,{...e,ref:t}):null});FC.displayName=Dg;var AR=$.forwardRef((e,t)=>{let{__scopeScrollArea:a,...r}=e,o=ma(Dg,a),[n,s]=$.useState(0),[i,l]=$.useState(0),u=!!(n&&i);return As(o.scrollbarX,()=>{let d=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(d),l(d)}),As(o.scrollbarY,()=>{let d=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(d),s(d)}),u?(0,fe.jsx)(ks.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 Hc(e){return e?parseInt(e,10):0}function BC(e,t){let a=e/t;return isNaN(a)?0:a}function zc(e){let t=BC(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function RR(e,t,a,r="ltr"){let o=zc(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 UC([l,u],c)(e)}function TC(e,t,a="ltr"){let r=zc(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=PC(e,l);return UC([0,s],[0,i])(u)}function UC(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 VC(e,t){return e>0&&e<t}var _R=(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 $c(e,t){let a=ro(e),r=$.useRef(0);return $.useEffect(()=>()=>window.clearTimeout(r.current),[]),$.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function As(e,t){let a=ro(t);Yl(()=>{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 jC=_C,qC=DC;var HC=FC;var no=D(ue(),1),Mg=zC.forwardRef(({className:e,children:t,...a},r)=>(0,no.jsxs)(jC,{"data-slot":"scroll-area",className:Yt("relative",e),...a,children:[(0,no.jsx)(qC,{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,no.jsx)(DR,{}),(0,no.jsx)(HC,{})]}));Mg.displayName="ScrollArea";function DR({className:e,orientation:t="vertical",...a}){return(0,no.jsx)(Rg,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Yt("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,no.jsx)(Eg,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Gc=D(W());var $C=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,r)=>r?r.toUpperCase():a.toLowerCase()),Ng=e=>{let t=MR(e);return t.charAt(0).toUpperCase()+t.slice(1)},Wc=(...e)=>e.filter((t,a,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===a).join(" ").trim(),WC=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Zl=D(W());var GC={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 KC=(0,Zl.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:o="",children:n,iconNode:s,...i},l)=>(0,Zl.createElement)("svg",{ref:l,...GC,width:t,height:t,stroke:e,strokeWidth:r?Number(a)*24/Number(t):a,className:Wc("lucide",o),...!n&&!WC(i)&&{"aria-hidden":"true"},...i},[...s.map(([u,d])=>(0,Zl.createElement)(u,d)),...Array.isArray(n)?n:[n]]));var U=(e,t)=>{let a=(0,Gc.forwardRef)(({className:r,...o},n)=>(0,Gc.createElement)(KC,{ref:n,iconNode:t,className:Wc(`lucide-${$C(Ng(e))}`,`lucide-${e}`,r),...o}));return a.displayName=Ng(e),a};var NR=[["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"}]],eu=U("activity",NR);var OR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Rs=U("arrow-left",OR);var FR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],tu=U("arrow-up",FR);var BR=[["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"}]],au=U("calendar",BR);var UR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ru=U("chevron-down",UR);var VR=[["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"}]],Ta=U("circle-alert",VR);var jR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],at=U("circle-check",jR);var qR=[["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"}]],Aa=U("circle-x",qR);var HR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],un=U("clock",HR);var zR=[["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"}]],hr=U("command",zR);var $R=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],gr=U("corner-down-left",$R);var WR=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],dn=U("credit-card",WR);var GR=[["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"}]],cn=U("crown",GR);var KR=[["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"}]],fn=U("dollar-sign",KR);var XR=[["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"}]],_s=U("file-spreadsheet",XR);var QR=[["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"}]],Es=U("key",QR);var JR=[["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"}]],ou=U("laptop",JR);var YR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],At=U("loader-circle",YR);var ZR=[["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"}]],Ds=U("mail",ZR);var e_=[["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"}]],Ms=U("map-pin",e_);var t_=[["path",{d:"M5 12h14",key:"1ays0h"}]],pn=U("minus",t_);var a_=[["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"}]],nu=U("paperclip",a_);var r_=[["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"}]],Ns=U("refresh-cw",r_);var o_=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],mn=U("search",o_);var n_=[["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"}]],Os=U("shield",n_);var s_=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],su=U("smartphone",s_);var i_=[["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"}]],Zt=U("sparkles",i_);var l_=[["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"}]],Vt=U("square-pen",l_);var u_=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],iu=U("trending-up",u_);var d_=[["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"}]],Fs=U("users",d_);var c_=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yr=U("x",c_);var f_=[["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"}]],lu=U("zap",f_);var du=D(ue(),1),Ha=D(W(),1);var XC=D(W(),1),Bs=(0,XC.createContext)({});var QC=D(W(),1);function so(e){let t=(0,QC.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Fg=D(ue(),1),tL=D(W(),1),hn=D(W(),1);var JC=D(W(),1),io=(0,JC.createContext)(null);var ZC=D(ue(),1),Kc=D(W(),1),xr=D(W(),1);var YC=D(W(),1),Us=(0,YC.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Og=class extends Kc.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 eL({children:e,isPresent:t}){let a=(0,xr.useId)(),r=(0,xr.useRef)(null),o=(0,xr.useRef)({width:0,height:0,top:0,left:0}),{nonce:n}=(0,xr.useContext)(Us);return(0,xr.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
16
|
[data-motion-pop-id="${a}"] {
|
|
17
17
|
position: absolute !important;
|
|
18
18
|
width: ${s}px !important;
|
|
@@ -20,30 +20,30 @@ Error generating stack: `+n.message+`
|
|
|
20
20
|
top: ${l}px !important;
|
|
21
21
|
left: ${u}px !important;
|
|
22
22
|
}
|
|
23
|
-
`),()=>{document.head.removeChild(d)}},[t]),(0,ZS.jsx)(Fg,{isPresent:t,childRef:r,sizeRef:o,children:Xc.cloneElement(e,{ref:r})})}var aL=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=uo(c_),l=(0,xn.useId)(),u=(0,xn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,xn.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,xn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),tL.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Bg.jsx)(eL,{isPresent:a,children:e})),(0,Bg.jsx)(co.Provider,{value:d,children:e})};function c_(){return new Map}var fo=N(W(),1);function Qc(e=!0){let t=(0,fo.useContext)(co);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,fo.useId)();(0,fo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,fo.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var Jc=N(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=N(W(),1);var qs=typeof window<"u";var Hs=qs?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,ja.useMemo)(()=>Ug(e),[e]),d=s&&!i?[]:u.map(du),c=(0,ja.useRef)(!0),f=(0,ja.useRef)(u),m=uo(()=>new Map),[x,C]=(0,ja.useState)(u),[L,h]=(0,ja.useState)(u);Hs(()=>{c.current=!1,f.current=u;for(let w=0;w<L.length;w++){let I=du(L[w]);d.includes(I)?m.delete(I):m.get(I)!==!0&&m.set(I,!1)}},[L,d.length,d.join("-")]);let y=[];if(u!==x){let w=[...u];for(let I=0;I<L.length;I++){let P=L[I],A=du(P);d.includes(A)||(w.splice(I,0,P),y.push(P))}n==="wait"&&y.length&&(w=y),h(Ug(w)),C(u);return}let{forceRender:g}=(0,ja.useContext)(Vs);return(0,cu.jsx)(cu.Fragment,{children:L.map(w=>{let I=du(w),P=s&&!i?!1:u===L||d.includes(I),A=()=>{if(m.has(I))m.set(I,!0);else return;let R=!0;m.forEach(q=>{q||(R=!1)}),R&&(g?.(),h(f.current),s&&l?.(),r&&r())};return(0,cu.jsx)(aL,{isPresent:P,initial:!c.current||a?void 0:!1,custom:P?void 0:t,presenceAffectsLayout:o,mode:n,onExitComplete:P?void 0:A,children:w},I)})})};var ye=e=>e;var xr=ye,Ut=ye;function vn(e){let t;return()=>(t===void 0&&(t=e()),t)}var ea=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var je=e=>e*1e3,dt=e=>e/1e3;var zs={skipAnimations:!1,useManualTiming:!1};function rL(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"],f_=40;function ef(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=Zc.reduce((h,y)=>(h[y]=rL(n),h),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,m=()=>{let h=zs.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(h-o.timestamp,f_),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,y)=>{let g=s[y];return h[y]=(w,I=!1,P=!1)=>(a||x(),g.schedule(w,I,P)),h},{}),cancel:h=>{for(let y=0;y<Zc.length;y++)s[Zc[y]].cancel(h)},state:o,steps:s}}var{schedule:Z,cancel:ta,state:qe,steps:tf}=ef(typeof requestAnimationFrame<"u"?requestAnimationFrame:ye,!0);var oL=N(W(),1),af=(0,oL.createContext)({strict:!1});var nL={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"]},vr={};for(let e in nL)vr[e]={isEnabled:t=>nL[e].some(a=>!!t[a])};function sL(e){for(let t in e)vr[t]={...vr[t],...e[t]}}var p_=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")||p_.has(e)}var iL=e=>!fu(e);function m_(e){e&&(iL=t=>t.startsWith("on")?!fu(t):e(t))}try{m_(Xk("@emotion/is-prop-valid").default)}catch{}function lL(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(iL(o)||a===!0&&fu(o)||!t&&!fu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function uL(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=N(ie(),1);var Gs=N(W(),1);var dL=N(W(),1),po=(0,dL.createContext)({});var nf=N(W(),1);function wr(e){return typeof e=="string"||Array.isArray(e)}function mo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var rf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pu=["initial",...rf];function wn(e){return mo(e.animate)||pu.some(t=>wr(e[t]))}function of(e){return!!(wn(e)||e.variants)}function cL(e,t){if(wn(e)){let{initial:a,animate:r}=e;return{initial:a===!1||wr(a)?a:void 0,animate:wr(r)?r:void 0}}return e.inherit!==!1?t:{}}function pL(e){let{initial:t,animate:a}=cL(e,(0,nf.useContext)(po));return(0,nf.useMemo)(()=>({initial:t,animate:a}),[fL(t),fL(a)])}function fL(e){return Array.isArray(e)?e.join(" "):e}var mL=Symbol.for("motionComponentSymbol");var hL=N(W(),1);function Cr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gL(e,t,a){return(0,hL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):Cr(a)&&(a.current=r))},[t])}var Vt=N(W(),1);var $s=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var h_="framerAppearId",sf="data-"+$s(h_);var{schedule:Ws,cancel:QU}=ef(queueMicrotask,!1);var yL=N(W(),1),lf=(0,yL.createContext)({});function xL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,Vt.useContext)(po),l=(0,Vt.useContext)(af),u=(0,Vt.useContext)(co),d=(0,Vt.useContext)(js).reducedMotion,c=(0,Vt.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,Vt.useContext)(lf);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&g_(c.current,a,o,m);let x=(0,Vt.useRef)(!1);(0,Vt.useInsertionEffect)(()=>{f&&x.current&&f.update(a,u)});let C=a[sf],L=(0,Vt.useRef)(!!C&&!(!((n=window.MotionHandoffIsComplete)===null||n===void 0)&&n.call(window,C))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,C)));return Hs(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Ws.render(f.render),L.current&&f.animationState&&f.animationState.animateChanges())}),(0,Vt.useEffect)(()=>{f&&(!L.current&&f.animationState&&f.animationState.animateChanges(),L.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)===null||h===void 0||h.call(window,C)}),L.current=!1))}),f}function g_(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:vL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&Cr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function vL(e){if(e)return e.options.allowProjection!==!1?e.projection:vL(e.parent)}function wL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&sL(e);function i(u,d){let c,f={...(0,Gs.useContext)(js),...u,layoutId:y_(u)},{isStatic:m}=f,x=pL(u),C=r(u,m);if(!m&&qs){x_(f,e);let L=v_(f);c=L.MeasureLayout,x.visualElement=xL(o,C,f,t,L.ProjectionNode)}return(0,uf.jsxs)(po.Provider,{value:x,children:[c&&x.visualElement?(0,uf.jsx)(c,{visualElement:x.visualElement,...f}):null,a(o,u,gL(C,x.visualElement,d),C,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,Gs.forwardRef)(i);return l[mL]=o,l}function y_({layoutId:e}){let t=(0,Gs.useContext)(Vs).id;return t&&e!==void 0?t+"-"+e:e}function x_(e,t){let a=(0,Gs.useContext)(af).strict}function v_(e){let{drag:t,layout:a}=vr;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 Ks(e){return typeof e!="string"||e.includes("-")?!1:!!(CL.indexOf(e)>-1||/[A-Z]/u.test(e))}var jg=N(W(),1);function SL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Xs(e,t,a,r){if(typeof t=="function"){let[o,n]=SL(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]=SL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var mu=e=>Array.isArray(e);var LL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),IL=e=>mu(e)?e[e.length-1]||0:e;var Se=e=>!!(e&&e.getVelocity);function Qs(e){let t=Se(e)?e.get():e;return LL(t)?t.toValue():t}function w_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:C_(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)(po),o=(0,jg.useContext)(co),n=()=>w_(e,t,r,o);return a?n():uo(n)};function C_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=Qs(n[f]);let{initial:s,animate:i}=e,l=wn(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"&&!mo(c)){let f=Array.isArray(c)?c:[c];for(let m=0;m<f.length;m++){let x=Xs(e,f[m]);if(x){let{transitionEnd:C,transition:L,...h}=x;for(let y in h){let g=h[y];if(Array.isArray(g)){let w=d?g.length-1:0;g=g[w]}g!==null&&(o[y]=g)}for(let y in C)o[y]=C[y]}}}return o}var qa=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],jt=new Set(qa);var bL=e=>t=>typeof t=="string"&&t.startsWith(e),cf=bL("--"),S_=bL("var(--"),Js=e=>S_(e)?L_.test(e.split("/*")[0].trim()):!1,L_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var ff=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ct=(e,t,a)=>a>t?t:a<e?e:a;var Ha={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Sr={...Ha,transform:e=>ct(0,1,e)},hu={...Ha,default:1};var gu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),za=gu("deg"),Tt=gu("%"),H=gu("px"),kL=gu("vh"),PL=gu("vw"),qg={...Tt,parse:e=>Tt.parse(e)/100,transform:e=>Tt.transform(e*100)};var TL={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 AL={rotate:za,rotateX:za,rotateY:za,rotateZ:za,scale:hu,scaleX:hu,scaleY:hu,scaleZ:hu,skew:za,skewX:za,skewY:za,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:Sr,originX:qg,originY:qg,originZ:H};var Hg={...Ha,transform:Math.round};var Ys={...TL,...AL,zIndex:Hg,size:H,fillOpacity:Sr,strokeOpacity:Sr,numOctaves:Hg};var I_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},b_=qa.length;function RL(e,t,a){let r="",o=!0;for(let n=0;n<b_;n++){let s=qa[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,Ys[s]);if(!l){o=!1;let d=I_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Zs(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(jt.has(l)){s=!0;continue}else if(cf(l)){o[l]=u;continue}else{let d=ff(u,Ys[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=RL(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 k_={offset:"stroke-dashoffset",array:"stroke-dasharray"},P_={offset:"strokeDashoffset",array:"strokeDasharray"};function _L(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?k_:P_;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function EL(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function DL(e,t,a){let r=EL(t,e.x,e.width),o=EL(a,e.y,e.height);return`${r} ${o}`}function ei(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Zs(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=DL(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&&_L(f,s,i,l,!1)}var ti=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var pf=()=>({...ti(),attrs:{}});var ai=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:$s(o),t.attrs[o])}var ri={};function ML(e){Object.assign(ri,e)}function yf(e,{layout:t,layoutId:a}){return jt.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!ri[e]||e==="opacity")}function oi(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Se(o[s])||t.style&&Se(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=oi(e,t,a);for(let o in e)if(Se(e[o])||Se(t[o])){let n=qa.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function T_(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 NL=["x","y","width","height","cx","cy","r"],OL={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(jt.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<NL.length;i++){let l=NL[i];e[l]!==t[l]&&(s=!0)}s&&Z.read(()=>{T_(a,r),Z.render(()=>{ei(r,o,ai(a.tagName),e.transformTemplate),gf(a,r)})})}})};var FL={useVisualState:df({scrapeMotionValuesFromProps:oi,createRenderState:ti})};var ni=N(W(),1);var BL=N(W(),1);function zg(e,t,a){for(let r in t)!Se(t[r])&&!yf(r,a)&&(e[r]=t[r])}function A_({transformTemplate:e},t){return(0,BL.useMemo)(()=>{let a=ti();return Zs(a,t,e),Object.assign({},a.vars,a.style)},[t])}function R_(e,t){let a=e.style||{},r={};return zg(r,a,e),Object.assign(r,A_(e,t)),r}function UL(e,t){let a={},r=R_(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 VL=N(W(),1);function jL(e,t,a,r){let o=(0,VL.useMemo)(()=>{let n=pf();return ei(n,t,ai(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 qL(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(Ks(a)?jL:UL)(r,n,s,a),u=lL(r,typeof a=="string",e),d=a!==ni.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,ni.useMemo)(()=>Se(c)?c.get():c,[c]);return(0,ni.createElement)(a,{...d,children:f})}}function HL(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...Ks(r)?OL:FL,preloadedFeatures:e,useRender:qL(o),createVisualElement:t,Component:r};return wL(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 ho(e,t,a){let r=e.getProps();return Xs(r,t,a!==void 0?a:r.custom,e)}var Wg=vn(()=>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 go(e,t){return e?e[t]||e.default||e:void 0}function si(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 yo(e){return typeof e=="function"}function vu(e,t){e.timeline=t,e.onfinish=null}var ii=e=>Array.isArray(e)&&typeof e[0]=="number";var Kg={linearEasing:void 0};function zL(e,t){let a=vn(e);return()=>{var r;return(r=Kg[t])!==null&&r!==void 0?r:a()}}var xo=zL(()=>{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(ea(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function wf(e){return!!(typeof e=="function"&&xo()||!e||typeof e=="string"&&(e in vf||xo())||ii(e)||Array.isArray(e)&&e.every(wf))}var li=([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:li([0,.65,.55,1]),circOut:li([.55,0,1,.45]),backIn:li([.31,.01,.66,-.59]),backOut:li([.33,1.53,.69,.99])};function ui(e,t){if(e)return typeof e=="function"&&xo()?wu(e,t):ii(e)?li(e):Array.isArray(e)?e.map(a=>ui(a,t)||vf.easeOut):vf[e]}var aa={x:!1,y:!1};function di(){return aa.x||aa.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 Cf(e,t){let a=Xg(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function $L(e){return t=>{t.pointerType==="touch"||di()||e(t)}}function Qg(e,t,a={}){let[r,o,n]=Cf(e,a),s=$L(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=$L(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var Sf=(e,t)=>t?e===t?!0:Sf(e,t.parentElement):!1;var Cn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var __=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WL(e){return __.has(e.tagName)||e.tabIndex!==-1}var Sn=new WeakSet;function GL(e){return t=>{t.key==="Enter"&&e(t)}}function Jg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var KL=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=GL(()=>{if(Sn.has(a))return;Jg(a,"down");let o=GL(()=>{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 XL(e){return Cn(e)&&!di()}function Yg(e,t,a={}){let[r,o,n]=Cf(e,a),s=i=>{let l=i.currentTarget;if(!XL(i)||Sn.has(l))return;Sn.add(l);let u=t(i),d=(m,x)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!XL(m)||!Sn.has(l))&&(Sn.delete(l),typeof u=="function"&&u(m,{success:x}))},c=m=>{d(m,a.useGlobalTarget||Sf(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!WL(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>KL(u,o),o)}),n}function Zg(e){return e==="x"||e==="y"?aa[e]?null:(aa[e]=!0,()=>{aa[e]=!1}):aa.x||aa.y?null:(aa.x=aa.y=!0,()=>{aa.x=aa.y=!1})}var Lf=new Set(["width","height","top","left","right","bottom",...qa]);var If;function D_(){If=void 0}var wt={now:()=>(If===void 0&&wt.set(qe.isProcessing||zs.useManualTiming?qe.timestamp:performance.now()),If),set:e=>{If=e,queueMicrotask(D_)}};function ci(e,t){e.indexOf(t)===-1&&e.push(t)}function fi(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var vo=class{constructor(){this.subscriptions=[]}add(t){return ci(this.subscriptions,t),()=>fi(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 bf(e,t){return t?e*(1e3/t):0}var JL=30,M_=e=>!isNaN(parseFloat(e)),YL={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=wt.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=wt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=M_(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 vo);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 YL.current&&YL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=wt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>JL)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,JL);return bf(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 Lr(e,t){return new ey(e,t)}function N_(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Lr(a))}function Cu(e,t){let a=ho(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=IL(n[s]);N_(e,s,i)}}function ZL(e){return!!(Se(e)&&e.add)}function Su(e,t){let a=e.getValue("willChange");if(ZL(a))return a.add(t)}function kf(e){return e.props[sf]}var Pf={current:!1};var eI=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,O_=1e-7,F_=12;function B_(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=eI(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>O_&&++i<F_);return s}function wo(e,t,a,r){if(e===t&&a===r)return ye;let o=n=>B_(n,0,1,e,a);return n=>n===0||n===1?n:eI(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=wo(.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 tI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Nf(e):!0}var Co=e=>Math.round(e*1e5)/1e5;var pi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function aI(e){return e==null}var rI=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var mi=(e,t)=>a=>!!(typeof a=="string"&&rI.test(a)&&a.startsWith(e)||t&&!aI(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(pi);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var U_=e=>ct(0,255,e),ay={...Ha,transform:e=>Math.round(U_(e))},$a={test:mi("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)+", "+Co(Sr.transform(r))+")"};function V_(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 Iu={test:mi("#"),parse:V_,transform:$a.transform};var So={test:mi("hsl","hue"),parse:Of("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Tt.transform(Co(t))+", "+Tt.transform(Co(a))+", "+Co(Sr.transform(r))+")"};var We={test:e=>$a.test(e)||Iu.test(e)||So.test(e),parse:e=>$a.test(e)?$a.parse(e):So.test(e)?So.parse(e):Iu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?$a.transform(e):So.transform(e)};var oI=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function j_(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(pi))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(oI))===null||a===void 0?void 0:a.length)||0)>0}var sI="number",iI="color",q_="var",H_="var(",nI="${}",z_=/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 Ln(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(z_,l=>(We.test(l)?(r.color.push(n),o.push(iI),a.push(We.parse(l))):l.startsWith(H_)?(r.var.push(n),o.push(q_),a.push(l)):(r.number.push(n),o.push(sI),a.push(parseFloat(l))),++n,nI)).split(nI);return{values:a,split:i,indexes:r,types:o}}function lI(e){return Ln(e).values}function uI(e){let{split:t,types:a}=Ln(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===sI?n+=Co(o[s]):i===iI?n+=We.transform(o[s]):n+=o[s]}return n}}var $_=e=>typeof e=="number"?0:e;function W_(e){let t=lI(e);return uI(e)(t.map($_))}var At={test:j_,parse:lI,createTransformer:uI,getAnimatableNone:W_};var G_=new Set(["brightness","contrast","saturate","opacity"]);function K_(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(pi)||[];if(!r)return e;let o=a.replace(r,""),n=G_.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var X_=/\b([a-z-]*)\(.*?\)/gu,bu={...At,getAnimatableNone:e=>{let t=e.match(X_);return t?t.map(K_).join(" "):e}};var Q_={...Ys,color:We,backgroundColor:We,outlineColor:We,fill:We,stroke:We,borderColor:We,borderTopColor:We,borderRightColor:We,borderBottomColor:We,borderLeftColor:We,filter:bu,WebkitFilter:bu},hi=e=>Q_[e];function Ff(e,t){let a=hi(e);return a!==bu&&(a=At),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var J_=new Set(["auto","none","0"]);function dI(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!J_.has(n)&&Ln(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Ff(a,o)}var ry=e=>e===Ha||e===H,cI=(e,t)=>parseFloat(e.split(", ")[t]),fI=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return cI(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?cI(n[1],e):0}},Y_=new Set(["x","y","z"]),Z_=qa.filter(e=>!Y_.has(e));function pI(e){let t=[];return Z_.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var In={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:fI(4,13),y:fI(5,14)};In.translateX=In.x;In.translateY=In.y;var bn=new Set,oy=!1,ny=!1;function mI(){if(ny){let e=Array.from(bn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=pI(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,bn.forEach(e=>e.complete()),bn.clear()}function hI(){bn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ny=!0)})}function gI(){hI(),mI()}var Lo=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?(bn.add(this),oy||(oy=!0,Z.read(hI),Z.resolveKeyframes(mI))):(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),bn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,bn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Bf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var eE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tE(e){let t=eE.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var aE=4;function sy(e,t,a=1){Ut(a<=aE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=tE(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return Bf(s)?parseFloat(s):s}return Js(o)?sy(o,t,a+1):o}var Uf=e=>t=>t.test(e);var yI={test:e=>e==="auto",parse:e=>e};var iy=[Ha,H,Tt,za,PL,kL,yI],ly=e=>iy.find(Uf(e));var gi=class extends Lo{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(),Js(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++)tI(t[o])&&r.push(o);r.length&&dI(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=In[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]=In[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"&&(At.test(e)||e==="0")&&!e.startsWith("url("));function rE(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 xI(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 xr(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:rE(e)||(a==="spring"||yo(a))&&r}var oE=e=>e!==null;function Io(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(oE),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var nE=40,yi=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=wt.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>nE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&gI(),this._resolved}onKeyframesResolved(t,a){this.resolvedAt=wt.now(),this.hasAttemptedResolve=!0;let{name:r,type:o,velocity:n,delay:s,onComplete:i,onUpdate:l,isGenerator:u}=this.options;if(!u&&!xI(t,r,o,n))if(Pf.current||!s){l&&l(Io(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 se=(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 vI({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 xi(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)},sE=[Iu,$a,So],iE=e=>sE.find(t=>t.test(e));function wI(e){let t=iE(e);if(xr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===So&&(a=vI(a)),a}var fy=(e,t)=>{let a=wI(e),r=wI(t);if(!a||!r)return xi(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=se(a.alpha,r.alpha,n),$a.transform(o))};var lE=(e,t)=>a=>t(e(a)),Wa=(...e)=>e.reduce(lE);var Vf=new Set(["none","hidden"]);function CI(e,t){return Vf.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function uE(e,t){return a=>se(e,t,a)}function jf(e){return typeof e=="number"?uE:typeof e=="string"?Js(e)?xi:We.test(e)?fy:fE:Array.isArray(e)?SI:typeof e=="object"?We.test(e)?fy:dE:xi}function SI(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 dE(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 cE(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 fE=(e,t)=>{let a=At.createTransformer(t),r=Ln(e),o=Ln(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?CI(e,t):Wa(SI(cE(r,o),o.values),a):(xr(!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.`),xi(e,t))};function qf(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?se(e,t,a):jf(e)(e,t)}var pE=5;function Hf(e,t,a){let r=Math.max(t-pE,0);return bf(a-e(r),t-r)}var Te={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 LI({duration:e=Te.duration,bounce:t=Te.bounce,velocity:a=Te.velocity,mass:r=Te.mass}){let o,n;xr(e<=je(Te.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ct(Te.minDamping,Te.maxDamping,s),e=ct(Te.minDuration,Te.maxDuration,dt(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),C=zf(Math.pow(u,2),s);return(-o(u)+py>0?-1:1)*((f-m)*x)/C}):(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=hE(o,n,i);if(e=je(e),isNaN(l))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var mE=12;function hE(e,t,a){let r=a;for(let o=1;o<mE;o++)r=r-e(r)/t(r);return r}function zf(e,t){return e*Math.sqrt(1-t*t)}var gE=["duration","bounce"],yE=["stiffness","damping","mass"];function II(e,t){return t.some(a=>e[a]!==void 0)}function xE(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!II(e,yE)&&II(e,gE))if(e.visualDuration){let a=e.visualDuration,r=2*Math.PI/(a*1.2),o=r*r,n=2*ct(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Te.mass,stiffness:o,damping:n}}else{let a=LI(e);t={...t,...a,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function $f(e=Te.visualDuration,t=Te.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}=xE({...a,velocity:-dt(a.velocity||0)}),x=f||0,C=u/(2*Math.sqrt(l*d)),L=s-n,h=dt(Math.sqrt(l/d)),y=Math.abs(L)<5;r||(r=y?Te.restSpeed.granular:Te.restSpeed.default),o||(o=y?Te.restDelta.granular:Te.restDelta.default);let g;if(C<1){let I=zf(h,C);g=P=>{let A=Math.exp(-C*h*P);return s-A*((x+C*h*L)/I*Math.sin(I*P)+L*Math.cos(I*P))}}else if(C===1)g=I=>s-Math.exp(-h*I)*(L+(x+h*L)*I);else{let I=h*Math.sqrt(C*C-1);g=P=>{let A=Math.exp(-C*h*P),R=Math.min(I*P,300);return s-A*((x+C*h*L)*Math.sinh(R)+I*L*Math.cosh(R))/I}}let w={calculatedDuration:m&&c||null,next:I=>{let P=g(I);if(m)i.done=I>=c;else{let A=0;C<1&&(A=I===0?je(x):Hf(g,I,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 I=Math.min(si(w),2e4),P=wu(A=>w.next(I*A).value,I,30);return I+"ms "+P}};return w}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,C=a*t,L=c+C,h=s===void 0?L:s(L);h!==L&&(C=h-c);let y=R=>-C*Math.exp(-R/r),g=R=>h+y(R),w=R=>{let q=y(R),U=g(R);f.done=Math.abs(q)<=u,f.value=f.done?h:U},I,P,A=R=>{m(f.value)&&(I=R,P=$f({keyframes:[f.value,x(f.value)],velocity:Hf(g,R,f.value),damping:o,stiffness:n,restDelta:u,restSpeed:d}))};return A(0),{calculatedDuration:null,next:R=>{let q=!1;return!P&&I===void 0&&(q=!0,w(R),A(R)),I!==void 0&&R>=I?P.next(R-I):(!q&&w(R),f)}}}var bI=wo(.42,0,1,1),kI=wo(0,0,.58,1),Wf=wo(.42,0,.58,1);var PI=e=>Array.isArray(e)&&typeof e[0]!="number";var TI={linear:ye,easeIn:bI,easeInOut:Wf,easeOut:kI,circIn:Ef,circInOut:Mf,circOut:Df,backIn:Lu,backInOut:Rf,backOut:ty,anticipate:_f},hy=e=>{if(ii(e)){Ut(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return wo(t,a,r,o)}else if(typeof e=="string")return Ut(TI[e]!==void 0,`Invalid easing type '${e}'`),TI[e];return e};function vE(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=Wa(l,i)}r.push(i)}return r}function AI(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(Ut(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=vE(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=ea(e[c],e[c+1],d);return i[c](f)};return a?d=>u(ct(e[0],e[n-1],d)):u}function RI(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=ea(0,t,r);e.push(se(a,1,o))}}function _I(e){let t=[0];return RI(t,e.length-1),t}function EI(e,t){return e.map(a=>a*t)}function wE(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=PI(r)?r.map(hy):hy(r),n={done:!1,value:t[0]},s=EI(a&&a.length===t.length?a:_I(t),e),i=AI(s,t,{ease:Array.isArray(o)?o:wE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var DI=e=>{let t=({timestamp:a})=>e(a);return{start:()=>Z.update(t,!0),stop:()=>ta(t),now:()=>qe.isProcessing?qe.timestamp:wt.now()}};var CE={decay:my,inertia:my,tween:ku,keyframes:ku,spring:$f},SE=e=>e/100,kn=class extends yi{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||Lo,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=yo(a)?a:CE[a]||ku,l,u;i!==ku&&typeof t[0]!="number"&&(l=Wa(SE,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=si(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:C,onUpdate:L}=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),y=this.speed>=0?h<0:h>d;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let g=this.currentTime,w=n;if(m){let R=Math.min(this.currentTime,d)/c,q=Math.floor(R),U=R%1;!U&&R>=1&&(U=1),U===1&&q--,q=Math.min(q,m+1),q%2&&(x==="reverse"?(U=1-U,C&&(U-=C/c)):x==="mirror"&&(w=s)),g=ct(0,1,U)*c}let I=y?{done:!1,value:l[0]}:w.next(g);i&&(I.value=i(I.value));let{done:P}=I;!y&&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&&(I.value=Io(l,this.options,o)),L&&L(I.value),A&&this.finish(),I}get duration(){let{resolved:t}=this;return t?dt(t.calculatedDuration):0}get time(){return dt(this.currentTime)}set time(t){t=je(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=dt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=DI,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 MI=new Set(["opacity","clipPath","filter","transform"]);function NI(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=ui(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 OI=vn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Gf=10,LE=2e4;function IE(e){return yo(e.type)||e.type==="spring"||!wf(e.ease)}function bE(e,t){let a=new kn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<LE;)r=a.sample(n),o.push(r.value),n+=Gf;return{times:void 0,keyframes:o,duration:n-Gf,ease:"linear"}}var FI={anticipate:_f,backInOut:Rf,circInOut:Mf};function kE(e){return e in FI}var Pu=class extends yi{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new gi(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"&&xo()&&kE(n)&&(n=FI[n]),IE(this.options)){let{onComplete:c,onUpdate:f,motionValue:m,element:x,...C}=this.options,L=bE(t,C);t=L.keyframes,t.length===1&&(t[1]=t[0]),r=L.duration,o=L.times,n=L.ease,s="keyframes"}let d=NI(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(Io(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 dt(a)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:a}=t;return dt(a.currentTime||0)}set time(t){let{resolved:a}=this;if(!a)return;let{animation:r}=a;r.currentTime=je(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 kn({...m,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),C=je(this.time);u.setWithVelocity(x.sample(C-Gf).value,x.sample(C).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 OI()&&r&&MI.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var PE={type:"spring",stiffness:500,damping:25,restSpeed:10},TE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),AE={type:"keyframes",duration:.8},RE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?AE:jt.has(e)?e.startsWith("scale")?TE(t[1]):PE:RE;function UI({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 vi=(e,t,a,r={},o,n)=>s=>{let i=go(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-je(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};UI(i)||(d={...d,...BI(e,d)}),d.duration&&(d.duration=je(d.duration)),d.repeatDelay&&(d.repeatDelay=je(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||zs.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=Io(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 kn(d)};function _E({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&&_E(d,c))continue;let x={delay:a,...go(s||{},c)},C=!1;if(window.MotionHandoffAnimation){let h=kf(e);if(h){let y=window.MotionHandoffAnimation(h,c,Z);y!==null&&(x.startTime=y,C=!0)}}Su(e,c),f.start(vi(c,f,m,e.shouldReduceMotion&&Lf.has(c)?{type:!1}:x,e,C));let L=f.animation;L&&u.push(L)}return i&&Promise.all(u).then(()=>{Z.update(()=>{i&&Cu(e,i)})}),u}function Xf(e,t,a={}){var r;let o=ho(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 EE(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 EE(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(DE).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 DE(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"?ho(e,t,a.custom):t;r=Promise.all(Kf(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var ME=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<ME;a++){let r=pu[a],o=e.props[r];(wr(o)||o===!1)&&(t[r]=o)}return t}var NE=[...rf].reverse(),OE=rf.length;function FE(e){return t=>Promise.all(t.map(({animation:a,options:r})=>Qf(e,a,r)))}function jI(e){let t=FE(e),a=VI(),r=!0,o=l=>(u,d)=>{var c;let f=ho(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.custom:void 0);if(f){let{transition:m,transitionEnd:x,...C}=f;u={...u,...C,...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 L=0;L<OE;L++){let h=NE[L],y=a[h],g=u[h]!==void 0?u[h]:d[h],w=wr(g),I=h===l?y.isActive:null;I===!1&&(x=L);let P=g===d[h]&&g!==u[h]&&w;if(P&&r&&e.manuallyAnimateOnMount&&(P=!1),y.protectedKeys={...m},!y.isActive&&I===null||!g&&!y.prevProp||mo(g)||typeof g=="boolean")continue;let A=BE(y.prevProp,g),R=A||h===l&&y.isActive&&!P&&w||L>x&&w,q=!1,U=Array.isArray(g)?g:[g],pe=U.reduce(o(h),{});I===!1&&(pe={});let{prevResolvedValues:ue={}}=y,Le={...ue,...pe},Qa=Re=>{R=!0,f.has(Re)&&(q=!0,f.delete(Re)),y.needsAnimating[Re]=!0;let Oe=e.getValue(Re);Oe&&(Oe.liveStyle=!1)};for(let Re in Le){let Oe=pe[Re],de=ue[Re];if(m.hasOwnProperty(Re))continue;let Ar=!1;mu(Oe)&&mu(de)?Ar=!$g(Oe,de):Ar=Oe!==de,Ar?Oe!=null?Qa(Re):f.add(Re):Oe!==void 0&&f.has(Re)?Qa(Re):y.protectedKeys[Re]=!0}y.prevProp=g,y.prevResolvedValues=pe,y.isActive&&(m={...m,...pe}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(P&&A)||q)&&c.push(...U.map(Re=>({animation:Re,options:{type:h}})))}if(f.size){let L={};f.forEach(h=>{let y=e.getBaseTarget(h),g=e.getValue(h);g&&(g.liveStyle=!0),L[h]=y??null}),c.push({animation:L})}let C=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?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=VI(),r=!0}}}function BE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!$g(t,e):!1}function Pn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function VI(){return{animate:Pn(!0),whileInView:Pn(),whileHover:Pn(),whileTap:Pn(),whileDrag:Pn(),whileFocus:Pn(),exit:Pn()}}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=jI(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();mo(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 UE=0,Yf=class extends ot{constructor(){super(...arguments),this.id=UE++}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 qI={animation:{Feature:Jf},exit:{Feature:Yf}};function Ir(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function br(e){return{point:{x:e.pageX,y:e.pageY}}}var HI=e=>t=>Cn(t)&&e(t,br(t));function bo(e,t,a,r){return Ir(e,t,HI(a),r)}var zI=(e,t)=>Math.abs(e-t);function $I(e,t){let a=zI(e.x,t.x),r=zI(e.y,t.y);return Math.sqrt(a**2+r**2)}var wi=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=$I(c.offset,{x:0,y:0})>=3;if(!f&&!m)return;let{point:x}=c,{timestamp:C}=qe;this.history.push({...x,timestamp:C});let{onStart:L,onMove:h}=this.handlers;f||(L&&L(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:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let L=xy(c.type==="pointercancel"?this.lastMoveEventInfo:yy(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(c,L),x&&x(c,L)},!Cn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=br(t),i=yy(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=qe;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,xy(i,this.history)),this.removeListeners=Wa(bo(this.contextWindow,"pointermove",this.handlePointerMove),bo(this.contextWindow,"pointerup",this.handlePointerUp),bo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ta(this.updatePoint)}};function yy(e,t){return t?{point:t(e.point)}:e}function WI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xy({point:e},t){return{point:e,delta:WI(e,GI(t)),offset:WI(e,VE(t)),velocity:jE(t,.1)}}function VE(e){return e[0]}function GI(e){return e[e.length-1]}function jE(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=GI(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>je(t)));)a--;if(!r)return{x:0,y:0};let n=dt(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 JI=1e-4,qE=1-JI,HE=1+JI,YI=.01,zE=0-YI,$E=0+YI;function ft(e){return e.max-e.min}function ZI(e,t,a){return Math.abs(e-t)<=a}function KI(e,t,a,r=.5){e.origin=r,e.originPoint=se(t.min,t.max,e.origin),e.scale=ft(a)/ft(t),e.translate=se(a.min,a.max,e.origin)-e.originPoint,(e.scale>=qE&&e.scale<=HE||isNaN(e.scale))&&(e.scale=1),(e.translate>=zE&&e.translate<=$E||isNaN(e.translate))&&(e.translate=0)}function Ci(e,t,a,r){KI(e.x,t.x,a.x,r?r.originX:void 0),KI(e.y,t.y,a.y,r?r.originY:void 0)}function XI(e,t,a){e.min=a.min+t.min,e.max=e.min+ft(t)}function eb(e,t,a){XI(e.x,t.x,a.x),XI(e.y,t.y,a.y)}function QI(e,t,a){e.min=t.min-a.min,e.max=e.min+ft(t)}function Si(e,t,a){QI(e.x,t.x,a.x),QI(e.y,t.y,a.y)}function nb(e,{min:t,max:a},r){return t!==void 0&&e<t?e=r?se(t,e,r.min):Math.max(e,t):a!==void 0&&e>a&&(e=r?se(a,e,r.max):Math.min(e,a)),e}function tb(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 sb(e,{top:t,left:a,bottom:r,right:o}){return{x:tb(e.x,a,o),y:tb(e.y,t,r)}}function ab(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 ib(e,t){return{x:ab(e.x,t.x),y:ab(e.y,t.y)}}function lb(e,t){let a=.5,r=ft(e),o=ft(t);return o>r?a=ea(t.min,t.max-r,e.min):r>o&&(a=ea(e.min,e.max-o,t.min)),ct(0,1,a)}function ub(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 db(e=Zf){return e===!1?e=0:e===!0&&(e=Zf),{x:rb(e,"left","right"),y:rb(e,"top","bottom")}}function rb(e,t,a){return{min:ob(e,t),max:ob(e,a)}}function ob(e,t){return typeof e=="number"?e:e[t]||0}var cb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Tn=()=>({x:cb(),y:cb()}),fb=()=>({min:0,max:0}),Ae=()=>({x:fb(),y:fb()});function qt(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 pb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mb(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 kr(e){return tp(e)||wy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function wy(e){return hb(e.x)||hb(e.y)}function hb(e){return e&&e!=="0%"}function Tu(e,t,a){let r=e-a,o=t*r;return a+o}function gb(e,t,a,r,o){return o!==void 0&&(e=Tu(e,o,r)),Tu(e,a,r)+t}function Cy(e,t=0,a=1,r,o){e.min=gb(e.min,t,a,r,o),e.max=gb(e.max,t,a,r,o)}function Sy(e,{x:t,y:a}){Cy(e.x,t.translate,t.scale,t.originPoint),Cy(e.y,a.translate,a.scale,a.originPoint)}var yb=.999999999999,xb=1.0000000000001;function wb(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&&An(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Sy(e,s)),r&&kr(n.latestValues)&&An(e,n.latestValues))}t.x<xb&&t.x>yb&&(t.x=1),t.y<xb&&t.y>yb&&(t.y=1)}function ko(e,t){e.min=e.min+t,e.max=e.max+t}function vb(e,t,a,r,o=.5){let n=se(e.min,e.max,o);Cy(e,t,a,n,r)}function An(e,t){vb(e.x,t.x,t.scaleX,t.scale,t.originX),vb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ly(e,t){return ep(mb(e.getBoundingClientRect(),t))}function Cb(e,t,a){let r=Ly(e,a),{scroll:o}=t;return o&&(ko(r.x,o.offset.x),ko(r.y,o.offset.y)),r}var ap=({current:e})=>e?e.ownerDocument.defaultView:null;var WE=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=Ae(),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(br(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),qt(L=>{let h=this.getAxisMotionValue(L).get()||0;if(Tt.test(h)){let{projection:y}=this.visualElement;if(y&&y.layout){let g=y.layout.layoutBox[L];g&&(h=ft(g)*(parseFloat(h)/100))}}this.originPoint[L]=h}),x&&Z.postRender(()=>x(d,c)),Su(this.visualElement,"transform");let{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},s=(d,c)=>{let{dragPropagation:f,dragDirectionLock:m,onDirectionLock:x,onDrag:C}=this.getProps();if(!f&&!this.openDragLock)return;let{offset:L}=c;if(m&&this.currentDirection===null){this.currentDirection=GE(L),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",c.point,L),this.updateAxis("y",c.point,L),this.visualElement.render(),C&&C(d,c)},i=(d,c)=>this.stop(d,c),l=()=>qt(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 wi(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=nb(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&&Cr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=sb(o.layoutBox,a):this.constraints=!1,this.elastic=db(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&qt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ub(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!Cr(t))return!1;let r=t.current;Ut(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=Cb(r,o.root,this.visualElement.getTransformPagePoint()),s=ib(o.layout.layoutBox,n);if(a){let i=a(pb(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=qt(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 Su(this.visualElement,t),r.start(vi(t,r,0,a,this.visualElement,!1))}stopAnimation(){qt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){qt(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){qt(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]-se(s,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:a}=this.getProps(),{projection:r}=this.visualElement;if(!Cr(a)||!r||!this.constraints)return;this.stopAnimation();let o={x:0,y:0};qt(s=>{let i=this.getAxisMotionValue(s);if(i&&this.constraints!==!1){let l=i.get();o[s]=lb({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(),qt(s=>{if(!rp(s,t,null))return;let i=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];i.set(se(l,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;WE.set(this.visualElement,this);let t=this.visualElement.current,a=bo(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();Cr(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=Ir(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(qt(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 GE(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 Sb=e=>(t,a)=>{e&&Z.postRender(()=>e(t,a))},sp=class extends ot{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new wi(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:Sb(t),onStart:Sb(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&Z.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=bo(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 bb=N(ie(),1),Au=N(W(),1);var Li={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Lb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ii={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=Lb(e,t.target.x),r=Lb(e,t.target.y);return`${a}% ${r}%`}};var Ib={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=At.parse(e);if(o.length>5)return r;let n=At.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=se(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 Iy=class extends Au.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;ML(KE),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()})),Li.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(),Ws.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)(Vs);return(0,bb.jsx)(Iy,{...e,layoutGroup:r,switchLayoutGroup:(0,Au.useContext)(lf),isPresent:t,safeToRemove:a})}var KE={borderRadius:{...Ii,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ii,borderTopRightRadius:Ii,borderBottomLeftRadius:Ii,borderBottomRightRadius:Ii,boxShadow:Ib};function kb(e,t,a){let r=Se(e)?e:Lr(e);return r.start(vi("",r,t,a)),r.animation}function Pb(e){return e instanceof SVGElement&&e.tagName!=="svg"}var Tb=(e,t)=>e.depth-t.depth;var lp=class{constructor(){this.children=[],this.isDirty=!1}add(t){ci(this.children,t),this.isDirty=!0}remove(t){fi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Tb),this.isDirty=!1,this.children.forEach(t)}};function Ab(e,t){let a=wt.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(ta(r),e(n-t))};return Z.read(r,!0),()=>ta(r)}var Db=["TopLeft","TopRight","BottomLeft","BottomRight"],XE=Db.length,Rb=e=>typeof e=="string"?parseFloat(e):e,_b=e=>typeof e=="number"||H.test(e);function Mb(e,t,a,r,o,n){o?(e.opacity=se(0,a.opacity!==void 0?a.opacity:1,QE(r)),e.opacityExit=se(t.opacity!==void 0?t.opacity:1,0,JE(r))):n&&(e.opacity=se(t.opacity!==void 0?t.opacity:1,a.opacity!==void 0?a.opacity:1,r));for(let s=0;s<XE;s++){let i=`border${Db[s]}Radius`,l=Eb(t,i),u=Eb(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||_b(l)===_b(u)?(e[i]=Math.max(se(Rb(l),Rb(u),r),0),(Tt.test(u)||Tt.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=se(t.rotate||0,a.rotate||0,r))}function Eb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var QE=Nb(0,.5,Df),JE=Nb(.5,.95,ye);function Nb(e,t,a){return r=>r<e?0:r>t?1:a(ea(e,t,r))}function Ob(e,t){e.min=t.min,e.max=t.max}function ra(e,t){Ob(e.x,t.x),Ob(e.y,t.y)}function by(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Fb(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 YE(e,t=0,a=1,r=.5,o,n=e,s=e){if(Tt.test(t)&&(t=parseFloat(t),t=se(s.min,s.max,t/100)-s.min),typeof t!="number")return;let i=se(n.min,n.max,r);e===n&&(i-=t),e.min=Fb(e.min,t,a,i,o),e.max=Fb(e.max,t,a,i,o)}function Bb(e,t,[a,r,o],n,s){YE(e,t[a],t[r],t[o],t.scale,n,s)}var ZE=["x","scaleX","originX"],eD=["y","scaleY","originY"];function ky(e,t,a,r){Bb(e.x,t,ZE,a?a.x:void 0,r?r.x:void 0),Bb(e.y,t,eD,a?a.y:void 0,r?r.y:void 0)}function Ub(e){return e.translate===0&&e.scale===1}function Py(e){return Ub(e.x)&&Ub(e.y)}function Vb(e,t){return e.min===t.min&&e.max===t.max}function qb(e,t){return Vb(e.x,t.x)&&Vb(e.y,t.y)}function jb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ty(e,t){return jb(e.x,t.x)&&jb(e.y,t.y)}function Ay(e){return ft(e.x)/ft(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){ci(this.members,t),t.scheduleRender()}remove(t){if(fi(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 Hb(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 Rn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ru=typeof window<"u"&&window.MotionDebug!==void 0,_y=["","X","Y","Z"],tD={visibility:"hidden"},zb=1e3,aD=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 Yb(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&&Yb(r)}function dp({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=aD++,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&&(Rn.totalNodes=Rn.resolvedTargetDeltas=Rn.recalculatedProjection=0),this.nodes.forEach(nD),this.nodes.forEach(dD),this.nodes.forEach(cD),this.nodes.forEach(sD),Ru&&window.MotionDebug.record(Rn)},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 vo),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=Pb(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=Ab(f,250),Li.hasAnimatedSinceResize&&(Li.hasAnimatedSinceResize=!1,this.nodes.forEach(Wb))})}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 C=this.options.transition||d.getDefaultTransition()||gD,{onLayoutAnimationStart:L,onLayoutAnimationComplete:h}=d.getProps(),y=!this.targetLayout||!Ty(this.targetLayout,x)||m,g=!f&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,g);let w={...go(C,"layout"),onPlay:L,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else f||Wb(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,ta(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(fD),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&&Yb(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($b);return}this.isUpdating||this.nodes.forEach(lD),this.isUpdating=!1,this.nodes.forEach(uD),this.nodes.forEach(rD),this.nodes.forEach(oD),this.clearAllSnapshots();let i=wt.now();qe.delta=ct(0,1e3/60,i-qe.timestamp),qe.timestamp=i,qe.isProcessing=!0,tf.update.process(qe),tf.preRender.process(qe),tf.render.process(qe),qe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ws.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(iD),this.sharedNodes.forEach(pD)}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=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=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||kr(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)),yD(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(xD))){let{scroll:d}=this.root;d&&(ko(l.x,d.offset.x),ko(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Ae();if(ra(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&&ra(l,s),ko(l.x,c.offset.x),ko(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Ae();ra(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&&An(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),kr(d.latestValues)&&An(l,d.latestValues)}return kr(this.latestValues)&&An(l,this.latestValues),l}removeTransform(s){let i=Ae();ra(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!kr(u.latestValues))continue;tp(u.latestValues)&&u.updateSnapshot();let d=Ae(),c=u.measurePageBox();ra(d,c),ky(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return kr(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!==qe.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=qe.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(),Si(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),ra(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(),eb(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ra(this.target,this.layout.layoutBox),Sy(this.target,this.targetDelta)):ra(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(),Si(this.relativeTargetOrigin,this.target,m.target),ra(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ru&&Rn.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===qe.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;ra(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;wb(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:x}=i;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(by(this.prevProjectionDelta.x,this.projectionDelta.x),by(this.prevProjectionDelta.y,this.projectionDelta.y)),Ci(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&&Rn.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=Tn(),this.projectionDelta=Tn(),this.projectionDeltaWithTransform=Tn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=Tn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Ae(),m=l?l.source:void 0,x=this.layout?this.layout.source:void 0,C=m!==x,L=this.getStack(),h=!L||L.members.length<=1,y=!!(C&&!h&&this.options.crossfade===!0&&!this.path.some(hD));this.animationProgress=0;let g;this.mixTargetDelta=w=>{let I=w/1e3;Gb(c.x,s.x,I),Gb(c.y,s.y,I),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Si(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mD(this.relativeTarget,this.relativeTargetOrigin,f,I),g&&qb(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=Ae()),ra(g,this.relativeTarget)),C&&(this.animationValues=d,Mb(d,u,this.latestValues,I,y,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},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&&(ta(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Z.update(()=>{Li.hasAnimatedSinceResize=!0,this.currentAnimation=kb(0,zb,{...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(zb),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&&Zb(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ae();let c=ft(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+c;let f=ft(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+f}ra(i,l),An(i,d),Ci(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 tD;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Qs(s?.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){let C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=Qs(s?.pointerEvents)||""),this.hasProjected&&!kr(this.latestValues)&&(C.transform=d?d({},""):"none",this.hasProjected=!1),C}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=Hb(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 C in ri){if(f[C]===void 0)continue;let{correct:L,applyTo:h}=ri[C],y=u.transform==="none"?f[C]:L(f[C],c);if(h){let g=h.length;for(let w=0;w<g;w++)u[h[w]]=y}else u[C]=y}return this.options.layoutId&&(u.pointerEvents=c===this?Qs(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($b),this.root.sharedNodes.clear()}}}function rD(e){e.updateLayout()}function oD(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"?qt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],m=ft(f);f.min=r[c].min,f.max=f.min+m}):Zb(n,a.layoutBox,r)&&qt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],m=ft(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=Tn();Ci(i,r,a.layoutBox);let l=Tn();s?Ci(l,e.applyTransform(o,!0),a.measuredBox):Ci(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=Ae();Si(x,a.layoutBox,f.layoutBox);let C=Ae();Si(C,r,m.layoutBox),Ty(x,C)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=C,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 nD(e){Ru&&Rn.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 sD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function iD(e){e.clearSnapshot()}function $b(e){e.clearMeasurements()}function lD(e){e.isLayoutDirty=!1}function uD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function dD(e){e.resolveTargetDelta()}function cD(e){e.calcProjection()}function fD(e){e.resetSkewAndRotation()}function pD(e){e.removeLeadSnapshot()}function Gb(e,t,a){e.translate=se(t.translate,0,a),e.scale=se(t.scale,1,a),e.origin=t.origin,e.originPoint=t.originPoint}function Kb(e,t,a,r){e.min=se(t.min,a.min,r),e.max=se(t.max,a.max,r)}function mD(e,t,a,r){Kb(e.x,t.x,a.x,r),Kb(e.y,t.y,a.y,r)}function hD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var gD={duration:.45,ease:[.4,0,.1,1]},Xb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Qb=Xb("applewebkit/")&&!Xb("chrome/")?Math.round:ye;function Jb(e){e.min=Qb(e.min),e.max=Qb(e.max)}function yD(e){Jb(e.x),Jb(e.y)}function Zb(e,t,a){return e==="position"||e==="preserve-aspect"&&!ZI(Ay(t),Ay(a),.2)}function xD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var ek=dp({attachResizeListener:(e,t)=>Ir(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 ek({});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 tk={pan:{Feature:sp},drag:{Feature:np,ProjectionNode:cp,MeasureLayout:ip}};function ak(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,br(t)))}var fp=class extends ot{mount(){let{current:t}=this.node;t&&(this.unmount=Qg(t,a=>(ak(this.node,a,"Start"),r=>ak(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=Wa(Ir(this.node.current,"focus",()=>this.onFocus()),Ir(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function rk(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,br(t)))}var mp=class extends ot{mount(){let{current:t}=this.node;t&&(this.unmount=Yg(t,a=>(rk(this.node,a,"Start"),(r,{success:o})=>rk(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var Ny=new WeakMap,My=new WeakMap,vD=e=>{let t=Ny.get(e.target);t&&t(e)},wD=e=>{e.forEach(vD)};function CD({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(wD,{root:e,...t})),r[o]}function ok(e,t,a){let r=CD(t);return Ny.set(e,a),r.observe(e),()=>{Ny.delete(e),r.unobserve(e)}}var SD={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:SD[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 ok(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(LD(t,a))&&this.startObserver()}unmount(){}};function LD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var nk={inView:{Feature:hp},tap:{Feature:mp},focus:{Feature:pp},hover:{Feature:fp}};var sk={layout:{ProjectionNode:cp,MeasureLayout:ip}};var ck=N(W(),1);var _u={current:null},gp={current:!1};function ik(){if(gp.current=!0,!!qs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_u.current=e.matches;e.addListener(t),t()}else _u.current=!1}var ID=[...iy,We,At],lk=e=>ID.find(Uf(e));var Oy=new WeakMap;function uk(e,t,a){for(let r in t){let o=t[r],n=a[r];if(Se(o))e.addValue(r,o);else if(Se(n))e.addValue(r,Lr(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,Lr(s!==void 0?s:o,{owner:e}))}}for(let r in a)t[r]===void 0&&e.removeValue(r);return t}var dk=["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=Lo,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=wt.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=wn(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&&Se(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||ik(),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(),ta(this.notifyUpdate),ta(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=jt.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 vr){let a=vr[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):Ae()}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<dk.length;r++){let o=dk[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=uk(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=Lr(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):!lk(o)&&At.test(a)&&(o=Ff(t,a)),this.setBaseTarget(t,Se(o)?o.get():o)),Se(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=Xs(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&&!Se(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 vo),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=gi}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;Se(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function bD(e){return window.getComputedStyle(e)}var xp=class extends bi{constructor(){super(...arguments),this.type="html",this.renderInstance=mf}readValueFromInstance(t,a){if(jt.has(a)){let r=hi(a);return r&&r.default||0}else{let r=bD(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){Zs(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return oi(t,a,r)}};var vp=class extends bi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ae}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(jt.has(a)){let r=hi(a);return r&&r.default||0}return a=hf.has(a)?a:$s(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return xf(t,a,r)}build(t,a,r){ei(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){gf(t,a,r,o)}mount(t){this.isSVGTag=ai(t.tagName),super.mount(t)}};var fk=(e,t)=>Ks(e)?new vp(t):new xp(t,{allowProjection:e!==ck.Fragment});var pk=HL({...qI,...nk,...tk,...sk},fk);var Eu=uL(pk);function kD(e){e.values.forEach(t=>t.stop())}function Fy(e,t){[...t].reverse().forEach(r=>{let o=e.getVariant(r);o&&Cu(e,o),e.variantChildren&&e.variantChildren.forEach(n=>{Fy(n,t)})})}function PD(e,t){if(Array.isArray(t))return Fy(e,t);if(typeof t=="string")return Fy(e,[t]);Cu(e,t)}function mk(){let e=!1,t=new Set,a={subscribe(r){return t.add(r),()=>{t.delete(r)}},start(r,o){Ut(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 Ut(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),t.forEach(o=>{PD(o,r)})},stop(){t.forEach(r=>{kD(r)})},mount(){return e=!0,()=>{e=!1,a.stop()}}};return a}function By(){let e=uo(mk);return Hs(e.mount,[]),e}var Ue=N(ie(),1);function hk({phase:e,progressSteps:t=[]}){return(0,Ue.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,Ue.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ue.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin"}),(0,Ue.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Ue.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Ue.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ue.jsx)(yn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Ue.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Ue.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Ue.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Ue.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Ue.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Ue.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Ue.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Ue.jsx)(rt,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Ue.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ue.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Ue.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Ue.jsx)(Pt,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Ue.jsx)("span",{children:"Preparing response..."})]})]})]})}var gk=N(W(),1);var Aa=N(ie(),1);function yk({title:e,links:t}){let[a,r]=gk.useState(!1);return(0,Aa.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Aa.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,Aa.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,Aa.jsx)(ou,{className:"h-3 w-3 opacity-70"}):(0,Aa.jsx)(yn,{className:"h-3 w-3 opacity-70"}),(0,Aa.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,Aa.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Aa.jsx)("li",{children:(0,Aa.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var Du=N(ie(),1);function xk({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 ki=N(W(),1);function vk(){let[e,t]=ki.useState({x:0,y:0,visible:!1,onClick:!1}),a=ki.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=ki.useCallback(()=>{t(n=>({...n,visible:!1}))},[]),o=ki.useCallback(()=>{t(n=>({...n,visible:!0}))},[]);return{cursorState:e,moveTo:a,hide:r,show:o}}var Pr=N(W(),1);function wk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=Pr.useState({status:"idle"}),n=Pr.useRef(null),s=Pr.useCallback(async()=>{if(!e||!a){console.log("[useUserAuth] Skipping auth - productBackendUrl:",e,"enabled:",a),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,a]);Pr.useEffect(()=>{t!==n.current&&(n.current=t,s())},[t,s]);let i=Pr.useCallback(()=>{s()},[s]);return{authState:r,retry:i}}var wp=N(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){console.log("[useOrgConfig] Skipping - missing agentUrl or orgId",{agentUrl:e,orgId:t});return}(async()=>{r({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),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 Pi=N(ie(),1);function Ct({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card",className:Yt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Ga({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-header",className:Yt("@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 Ka({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-title",className:Yt("leading-none font-semibold",e),...t})}function Uy({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-description",className:Yt("text-muted-foreground text-sm",e),...t})}function St({className:e,...t}){return(0,Pi.jsx)("div",{"data-slot":"card-content",className:Yt("px-6",e),...t})}var S=N(ie(),1),Vy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Cp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),jy=e=>{switch(e){case"Enterprise":return mn;case"Professional":return uu;default:return tu}},Sp=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:Ta};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:fn};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Fs};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Pa}}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:Ta};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:Pa};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:fn};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Pa}}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:Ta};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Pa}}})(),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 TD({subscription:e}){let t=jy(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)(Ga,{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)(Ka,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(pn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(Uy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(Ns,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(Mu,{status:e.status,type:"subscription"})]})}),(0,S.jsx)(St,{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 ${Sp(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:[Cp(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:[Vy(e.current_period_start)," - ",Vy(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:Vy(e.created_at)})]})]})]})})]})}function AD({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)(St,{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 subscriptions found"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ka,{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," Subscription",e.length!==1?"s":""]})}),(0,S.jsxs)(St,{className:"p-0",children:[(0,S.jsx)("div",{className:"divide-y divide-gray-100",children:a.map(o=>{let n=jy(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 ${Sp(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 ",Cp(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 RD({customer:e}){let t=jy(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)(Ga,{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)(Ka,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(Uy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(Ns,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(Mu,{status:e.status,type:"customer"})]})}),(0,S.jsx)(St,{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 ${Sp(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)(hn,{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)(Os,{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 _D({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)(St,{className:"py-8 text-center",children:[(0,S.jsx)(Us,{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)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Us,{className:"h-4 w-4"}),e.length," Customer",e.length!==1?"s":""]})}),(0,S.jsxs)(St,{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 ${Sp(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 Sk({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)(St,{className:"py-8 text-center",children:[(0,S.jsx)(hn,{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)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(hn,{className:"h-4 w-4"}),e.length," Transaction",e.length!==1?"s":""]})}),(0,S.jsxs)(St,{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)(Ta,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)(Fs,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(fn,{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 ED({apiKeys:e}){return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(St,{className:"py-8 text-center",children:[(0,S.jsx)(Ms,{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)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Ms,{className:"h-4 w-4"}),e.length," API Key",e.length!==1?"s":""]})}),(0,S.jsx)(St,{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 DD({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)(St,{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 active sessions"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ka,{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," Active Session",e.length!==1?"s":""]})}),(0,S.jsx)(St,{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)(Os,{className:"h-3 w-3"}),a.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function MD({stats:e}){return(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ka,{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)(St,{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:Cp(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 ND({customers:e}){return e.length===0?(0,S.jsx)(Ct,{className:"border-gray-200 shadow-sm bg-white",children:(0,S.jsxs)(St,{className:"py-8 text-center",children:[(0,S.jsx)(mn,{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)(Ga,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ka,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(mn,{className:"h-4 w-4 text-amber-500"}),"Top Customers"]})}),(0,S.jsx)(St,{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"?Cp(t.revenue):t.revenue})]})},a))})})]})}function Lk({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(TD,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,S.jsx)(AD,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,S.jsx)(RD,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,S.jsx)(_D,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(Sk,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(Sk,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(MD,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(ND,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(ED,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(DD,{sessions:Array.isArray(i)?i:[i]});default:return null}}var _n=N(ie(),1);function Ik({className:e=""}){return(0,_n.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,_n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,_n.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,_n.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,_n.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=N(ie(),1),OD="0.2.48",FD="http://localhost:5002",Lp=400,BD=600;function UD(e){return e.replace(/\\\\n/g,`
|
|
23
|
+
`),()=>{document.head.removeChild(d)}},[t]),(0,ZC.jsx)(Og,{isPresent:t,childRef:r,sizeRef:o,children:Kc.cloneElement(e,{ref:r})})}var aL=({children:e,initial:t,isPresent:a,onExitComplete:r,custom:o,presenceAffectsLayout:n,mode:s})=>{let i=so(p_),l=(0,hn.useId)(),u=(0,hn.useCallback)(c=>{i.set(c,!0);for(let f of i.values())if(!f)return;r&&r()},[i,r]),d=(0,hn.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,hn.useMemo)(()=>{i.forEach((c,f)=>i.set(f,!1))},[a]),tL.useEffect(()=>{!a&&!i.size&&r&&r()},[a]),s==="popLayout"&&(e=(0,Fg.jsx)(eL,{isPresent:a,children:e})),(0,Fg.jsx)(io.Provider,{value:d,children:e})};function p_(){return new Map}var lo=D(W(),1);function Xc(e=!0){let t=(0,lo.useContext)(io);if(t===null)return[!0,null];let{isPresent:a,onExitComplete:r,register:o}=t,n=(0,lo.useId)();(0,lo.useEffect)(()=>{e&&o(n)},[e]);let s=(0,lo.useCallback)(()=>e&&r&&r(n),[n,r,e]);return!a&&r?[!1,s]:[!0]}var Qc=D(W(),1),uu=e=>e.key||"";function Bg(e){let t=[];return Qc.Children.forEach(e,a=>{(0,Qc.isValidElement)(a)&&t.push(a)}),t}var Jc=D(W(),1);var Vs=typeof window<"u";var js=Vs?Jc.useLayoutEffect:Jc.useEffect;var Ug=({children:e,custom:t,initial:a=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:n="sync",propagate:s=!1})=>{let[i,l]=Xc(s),u=(0,Ha.useMemo)(()=>Bg(e),[e]),d=s&&!i?[]:u.map(uu),c=(0,Ha.useRef)(!0),f=(0,Ha.useRef)(u),m=so(()=>new Map),[x,w]=(0,Ha.useState)(u),[I,h]=(0,Ha.useState)(u);js(()=>{c.current=!1,f.current=u;for(let C=0;C<I.length;C++){let L=uu(I[C]);d.includes(L)?m.delete(L):m.get(L)!==!0&&m.set(L,!1)}},[I,d.length,d.join("-")]);let g=[];if(u!==x){let C=[...u];for(let L=0;L<I.length;L++){let P=I[L],A=uu(P);d.includes(A)||(C.splice(L,0,P),g.push(P))}n==="wait"&&g.length&&(C=g),h(Bg(C)),w(u);return}let{forceRender:y}=(0,Ha.useContext)(Bs);return(0,du.jsx)(du.Fragment,{children:I.map(C=>{let L=uu(C),P=s&&!i?!1:u===I||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,du.jsx)(aL,{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 vr=ye,jt=ye;function gn(e){let t;return()=>(t===void 0&&(t=e()),t)}var ea=(e,t,a)=>{let r=t-e;return r===0?1:(a-e)/r};var Ve=e=>e*1e3,ct=e=>e/1e3;var qs={skipAnimations:!1,useManualTiming:!1};function rL(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 Yc=["read","resolveKeyframes","update","preRender","render","postRender"],m_=40;function Zc(e,t){let a=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},n=()=>a=!0,s=Yc.reduce((h,g)=>(h[g]=rL(n),h),{}),{read:i,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=s,m=()=>{let h=qs.useManualTiming?o.timestamp:performance.now();a=!1,o.delta=r?1e3/60:Math.max(Math.min(h-o.timestamp,m_),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:Yc.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<Yc.length;g++)s[Yc[g]].cancel(h)},state:o,steps:s}}var{schedule:Z,cancel:ta,state:je,steps:ef}=Zc(typeof requestAnimationFrame<"u"?requestAnimationFrame:ye,!0);var oL=D(W(),1),tf=(0,oL.createContext)({strict:!1});var nL={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"]},wr={};for(let e in nL)wr[e]={isEnabled:t=>nL[e].some(a=>!!t[a])};function sL(e){for(let t in e)wr[t]={...wr[t],...e[t]}}var h_=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 cu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h_.has(e)}var iL=e=>!cu(e);function g_(e){e&&(iL=t=>t.startsWith("on")?!cu(t):e(t))}try{g_(Jk("@emotion/is-prop-valid").default)}catch{}function lL(e,t,a){let r={};for(let o in e)o==="values"&&typeof e.values=="object"||(iL(o)||a===!0&&cu(o)||!t&&!cu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function uL(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 lf=D(ue(),1);var $s=D(W(),1);var dL=D(W(),1),uo=(0,dL.createContext)({});var of=D(W(),1);function Sr(e){return typeof e=="string"||Array.isArray(e)}function co(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}var af=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fu=["initial",...af];function yn(e){return co(e.animate)||fu.some(t=>Sr(e[t]))}function rf(e){return!!(yn(e)||e.variants)}function cL(e,t){if(yn(e)){let{initial:a,animate:r}=e;return{initial:a===!1||Sr(a)?a:void 0,animate:Sr(r)?r:void 0}}return e.inherit!==!1?t:{}}function pL(e){let{initial:t,animate:a}=cL(e,(0,of.useContext)(uo));return(0,of.useMemo)(()=>({initial:t,animate:a}),[fL(t),fL(a)])}function fL(e){return Array.isArray(e)?e.join(" "):e}var mL=Symbol.for("motionComponentSymbol");var hL=D(W(),1);function Cr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gL(e,t,a){return(0,hL.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),a&&(typeof a=="function"?a(r):Cr(a)&&(a.current=r))},[t])}var qt=D(W(),1);var Hs=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var y_="framerAppearId",nf="data-"+Hs(y_);var{schedule:zs,cancel:ZU}=Zc(queueMicrotask,!1);var yL=D(W(),1),sf=(0,yL.createContext)({});function xL(e,t,a,r,o){var n,s;let{visualElement:i}=(0,qt.useContext)(uo),l=(0,qt.useContext)(tf),u=(0,qt.useContext)(io),d=(0,qt.useContext)(Us).reducedMotion,c=(0,qt.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,qt.useContext)(sf);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&x_(c.current,a,o,m);let x=(0,qt.useRef)(!1);(0,qt.useInsertionEffect)(()=>{f&&x.current&&f.update(a,u)});let w=a[nf],I=(0,qt.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 js(()=>{f&&(x.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),zs.render(f.render),I.current&&f.animationState&&f.animationState.animateChanges())}),(0,qt.useEffect)(()=>{f&&(!I.current&&f.animationState&&f.animationState.animateChanges(),I.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)===null||h===void 0||h.call(window,w)}),I.current=!1))}),f}function x_(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:vL(e.parent)),e.projection.setOptions({layoutId:o,layout:n,alwaysMeasureLayout:!!s||i&&Cr(i),visualElement:e,animationType:typeof n=="string"?n:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function vL(e){if(e)return e.options.allowProjection!==!1?e.projection:vL(e.parent)}function wL({preloadedFeatures:e,createVisualElement:t,useRender:a,useVisualState:r,Component:o}){var n,s;e&&sL(e);function i(u,d){let c,f={...(0,$s.useContext)(Us),...u,layoutId:v_(u)},{isStatic:m}=f,x=pL(u),w=r(u,m);if(!m&&Vs){w_(f,e);let I=S_(f);c=I.MeasureLayout,x.visualElement=xL(o,w,f,t,I.ProjectionNode)}return(0,lf.jsxs)(uo.Provider,{value:x,children:[c&&x.visualElement?(0,lf.jsx)(c,{visualElement:x.visualElement,...f}):null,a(o,u,gL(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,$s.forwardRef)(i);return l[mL]=o,l}function v_({layoutId:e}){let t=(0,$s.useContext)(Bs).id;return t&&e!==void 0?t+"-"+e:e}function w_(e,t){let a=(0,$s.useContext)(tf).strict}function S_(e){let{drag:t,layout:a}=wr;if(!t&&!a)return{};let r={...t,...a};return{MeasureLayout:t?.isEnabled(e)||a?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var SL=["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 Ws(e){return typeof e!="string"||e.includes("-")?!1:!!(SL.indexOf(e)>-1||/[A-Z]/u.test(e))}var Vg=D(W(),1);function CL(e){let t=[{},{}];return e?.values.forEach((a,r)=>{t[0][r]=a.get(),t[1][r]=a.getVelocity()}),t}function Gs(e,t,a,r){if(typeof t=="function"){let[o,n]=CL(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]=CL(r);t=t(a!==void 0?a:e.custom,o,n)}return t}var pu=e=>Array.isArray(e);var LL=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),IL=e=>pu(e)?e[e.length-1]||0:e;var Le=e=>!!(e&&e.getVelocity);function Ks(e){let t=Le(e)?e.get():e;return LL(t)?t.toValue():t}function C_({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:a},r,o,n){let s={latestValues:L_(r,o,n,e),renderState:t()};return a&&(s.onMount=i=>a({props:r,current:i,...s}),s.onUpdate=i=>a(i)),s}var uf=e=>(t,a)=>{let r=(0,Vg.useContext)(uo),o=(0,Vg.useContext)(io),n=()=>C_(e,t,r,o);return a?n():so(n)};function L_(e,t,a,r){let o={},n=r(e,{});for(let f in n)o[f]=Ks(n[f]);let{initial:s,animate:i}=e,l=yn(e),u=rf(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"&&!co(c)){let f=Array.isArray(c)?c:[c];for(let m=0;m<f.length;m++){let x=Gs(e,f[m]);if(x){let{transitionEnd:w,transition:I,...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 za=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ht=new Set(za);var bL=e=>t=>typeof t=="string"&&t.startsWith(e),df=bL("--"),I_=bL("var(--"),Xs=e=>I_(e)?b_.test(e.split("/*")[0].trim()):!1,b_=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var cf=(e,t)=>t&&typeof e=="number"?t.transform(e):e;var ft=(e,t,a)=>a>t?t:a<e?e:a;var $a={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Lr={...$a,transform:e=>ft(0,1,e)},mu={...$a,default:1};var hu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Wa=hu("deg"),Rt=hu("%"),H=hu("px"),kL=hu("vh"),PL=hu("vw"),jg={...Rt,parse:e=>Rt.parse(e)/100,transform:e=>Rt.transform(e*100)};var TL={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 AL={rotate:Wa,rotateX:Wa,rotateY:Wa,rotateZ:Wa,scale:mu,scaleX:mu,scaleY:mu,scaleZ:mu,skew:Wa,skewX:Wa,skewY:Wa,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:Lr,originX:jg,originY:jg,originZ:H};var qg={...$a,transform:Math.round};var Qs={...TL,...AL,zIndex:qg,size:H,fillOpacity:Lr,strokeOpacity:Lr,numOctaves:qg};var k_={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},P_=za.length;function RL(e,t,a){let r="",o=!0;for(let n=0;n<P_;n++){let s=za[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=cf(i,Qs[s]);if(!l){o=!1;let d=k_[s]||s;r+=`${d}(${u}) `}a&&(t[s]=u)}}return r=r.trim(),a?r=a(t,o?"":r):o&&(r="none"),r}function Js(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(Ht.has(l)){s=!0;continue}else if(df(l)){o[l]=u;continue}else{let d=cf(u,Qs[l]);l.startsWith("origin")?(i=!0,n[l]=d):r[l]=d}}if(t.transform||(s||a?r.transform=RL(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 T_={offset:"stroke-dashoffset",array:"stroke-dasharray"},A_={offset:"strokeDashoffset",array:"strokeDasharray"};function _L(e,t,a=1,r=0,o=!0){e.pathLength=1;let n=o?T_:A_;e[n.offset]=H.transform(-r);let s=H.transform(t),i=H.transform(a);e[n.array]=`${s} ${i}`}function EL(e,t,a){return typeof e=="string"?e:H.transform(t+a*e)}function DL(e,t,a){let r=EL(t,e.x,e.width),o=EL(a,e.y,e.height);return`${r} ${o}`}function Ys(e,{attrX:t,attrY:a,attrScale:r,originX:o,originY:n,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...u},d,c){if(Js(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=DL(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&&_L(f,s,i,l,!1)}var Zs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});var ff=()=>({...Zs(),attrs:{}});var ei=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pf(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 mf=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 hf(e,t,a,r){pf(e,t,void 0,r);for(let o in t.attrs)e.setAttribute(mf.has(o)?o:Hs(o),t.attrs[o])}var ti={};function ML(e){Object.assign(ti,e)}function gf(e,{layout:t,layoutId:a}){return Ht.has(e)||e.startsWith("origin")||(t||a!==void 0)&&(!!ti[e]||e==="opacity")}function ai(e,t,a){var r;let{style:o}=e,n={};for(let s in o)(Le(o[s])||t.style&&Le(t.style[s])||gf(s,e)||((r=a?.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(n[s]=o[s]);return n}function yf(e,t,a){let r=ai(e,t,a);for(let o in e)if(Le(e[o])||Le(t[o])){let n=za.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[n]=e[o]}return r}function R_(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 NL=["x","y","width","height","cx","cy","r"],OL={useVisualState:uf({scrapeMotionValuesFromProps:yf,createRenderState:ff,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(Ht.has(i)){n=!0;break}}if(!n)return;let s=!t;if(t)for(let i=0;i<NL.length;i++){let l=NL[i];e[l]!==t[l]&&(s=!0)}s&&Z.read(()=>{R_(a,r),Z.render(()=>{Ys(r,o,ei(a.tagName),e.transformTemplate),hf(a,r)})})}})};var FL={useVisualState:uf({scrapeMotionValuesFromProps:ai,createRenderState:Zs})};var ri=D(W(),1);var BL=D(W(),1);function Hg(e,t,a){for(let r in t)!Le(t[r])&&!gf(r,a)&&(e[r]=t[r])}function __({transformTemplate:e},t){return(0,BL.useMemo)(()=>{let a=Zs();return Js(a,t,e),Object.assign({},a.vars,a.style)},[t])}function E_(e,t){let a=e.style||{},r={};return Hg(r,a,e),Object.assign(r,__(e,t)),r}function UL(e,t){let a={},r=E_(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 VL=D(W(),1);function jL(e,t,a,r){let o=(0,VL.useMemo)(()=>{let n=ff();return Ys(n,t,ei(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let n={};Hg(n,e.style,e),o.style={...n,...o.style}}return o}function qL(e=!1){return(a,r,o,{latestValues:n},s)=>{let l=(Ws(a)?jL:UL)(r,n,s,a),u=lL(r,typeof a=="string",e),d=a!==ri.Fragment?{...u,...l,ref:o}:{},{children:c}=r,f=(0,ri.useMemo)(()=>Le(c)?c.get():c,[c]);return(0,ri.createElement)(a,{...d,children:f})}}function HL(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){let s={...Ws(r)?OL:FL,preloadedFeatures:e,useRender:qL(o),createVisualElement:t,Component:r};return wL(s)}}function zg(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 fo(e,t,a){let r=e.getProps();return Gs(r,t,a!==void 0?a:r.custom,e)}var $g=gn(()=>window.ScrollTimeline!==void 0);var gu=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($g()&&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 yu=class extends gu{then(t,a){return Promise.all(this.animations).then(t).catch(a)}};function po(e,t){return e?e[t]||e.default||e:void 0}function oi(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 mo(e){return typeof e=="function"}function xu(e,t){e.timeline=t,e.onfinish=null}var ni=e=>Array.isArray(e)&&typeof e[0]=="number";var Gg={linearEasing:void 0};function zL(e,t){let a=gn(e);return()=>{var r;return(r=Gg[t])!==null&&r!==void 0?r:a()}}var ho=zL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");var vu=(e,t,a=10)=>{let r="",o=Math.max(Math.round(t/a),2);for(let n=0;n<o;n++)r+=e(ea(0,o-1,n))+", ";return`linear(${r.substring(0,r.length-2)})`};function vf(e){return!!(typeof e=="function"&&ho()||!e||typeof e=="string"&&(e in xf||ho())||ni(e)||Array.isArray(e)&&e.every(vf))}var si=([e,t,a,r])=>`cubic-bezier(${e}, ${t}, ${a}, ${r})`,xf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:si([0,.65,.55,1]),circOut:si([.55,0,1,.45]),backIn:si([.31,.01,.66,-.59]),backOut:si([.33,1.53,.69,.99])};function ii(e,t){if(e)return typeof e=="function"&&ho()?vu(e,t):ni(e)?si(e):Array.isArray(e)?e.map(a=>ii(a,t)||xf.easeOut):xf[e]}var aa={x:!1,y:!1};function li(){return aa.x||aa.y}function Kg(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 wf(e,t){let a=Kg(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[a,o,()=>r.abort()]}function $L(e){return t=>{t.pointerType==="touch"||li()||e(t)}}function Xg(e,t,a={}){let[r,o,n]=wf(e,a),s=$L(i=>{let{target:l}=i,u=t(i);if(typeof u!="function"||!l)return;let d=$L(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,o)});return r.forEach(i=>{i.addEventListener("pointerenter",s,o)}),n}var Sf=(e,t)=>t?e===t?!0:Sf(e,t.parentElement):!1;var xn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var D_=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function WL(e){return D_.has(e.tagName)||e.tabIndex!==-1}var vn=new WeakSet;function GL(e){return t=>{t.key==="Enter"&&e(t)}}function Qg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var KL=(e,t)=>{let a=e.currentTarget;if(!a)return;let r=GL(()=>{if(vn.has(a))return;Qg(a,"down");let o=GL(()=>{Qg(a,"up")}),n=()=>Qg(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 XL(e){return xn(e)&&!li()}function Jg(e,t,a={}){let[r,o,n]=wf(e,a),s=i=>{let l=i.currentTarget;if(!XL(i)||vn.has(l))return;vn.add(l);let u=t(i),d=(m,x)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!XL(m)||!vn.has(l))&&(vn.delete(l),typeof u=="function"&&u(m,{success:x}))},c=m=>{d(m,a.useGlobalTarget||Sf(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",c,o),window.addEventListener("pointercancel",f,o)};return r.forEach(i=>{!WL(i)&&i.getAttribute("tabindex")===null&&(i.tabIndex=0),(a.useGlobalTarget?window:i).addEventListener("pointerdown",s,o),i.addEventListener("focus",u=>KL(u,o),o)}),n}function Yg(e){return e==="x"||e==="y"?aa[e]?null:(aa[e]=!0,()=>{aa[e]=!1}):aa.x||aa.y?null:(aa.x=aa.y=!0,()=>{aa.x=aa.y=!1})}var Cf=new Set(["width","height","top","left","right","bottom",...za]);var Lf;function N_(){Lf=void 0}var St={now:()=>(Lf===void 0&&St.set(je.isProcessing||qs.useManualTiming?je.timestamp:performance.now()),Lf),set:e=>{Lf=e,queueMicrotask(N_)}};function ui(e,t){e.indexOf(t)===-1&&e.push(t)}function di(e,t){let a=e.indexOf(t);a>-1&&e.splice(a,1)}var go=class{constructor(){this.subscriptions=[]}add(t){return ui(this.subscriptions,t),()=>di(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 JL=30,O_=e=>!isNaN(parseFloat(e)),YL={current:void 0},Zg=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=O_(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 go);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 YL.current&&YL.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=St.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>JL)return 0;let a=Math.min(this.updatedAt-this.prevUpdatedAt,JL);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 Zg(e,t)}function F_(e,t,a){e.hasValue(t)?e.getValue(t).set(a):e.addValue(t,Ir(a))}function wu(e,t){let a=fo(e,t),{transitionEnd:r={},transition:o={},...n}=a||{};n={...n,...r};for(let s in n){let i=IL(n[s]);F_(e,s,i)}}function ZL(e){return!!(Le(e)&&e.add)}function Su(e,t){let a=e.getValue("willChange");if(ZL(a))return a.add(t)}function bf(e){return e.props[nf]}var kf={current:!1};var eI=(e,t,a)=>(((1-3*a+3*t)*e+(3*a-6*t))*e+3*t)*e,B_=1e-7,U_=12;function V_(e,t,a,r,o){let n,s,i=0;do s=t+(a-t)/2,n=eI(s,r,o)-e,n>0?a=s:t=s;while(Math.abs(n)>B_&&++i<U_);return s}function yo(e,t,a,r){if(e===t&&a===r)return ye;let o=n=>V_(n,0,1,e,a);return n=>n===0||n===1?n:eI(o(n),t,r)}var Pf=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Tf=e=>t=>1-e(1-t);var ey=yo(.33,1.53,.69,.99),Cu=Tf(ey),Af=Pf(Cu);var Rf=e=>(e*=2)<1?.5*Cu(e):.5*(2-Math.pow(2,-10*(e-1)));var _f=e=>1-Math.sin(Math.acos(e)),Ef=Tf(_f),Df=Pf(_f);var Mf=e=>/^0[^.\s]+$/u.test(e);function tI(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Mf(e):!0}var xo=e=>Math.round(e*1e5)/1e5;var ci=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function aI(e){return e==null}var rI=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var fi=(e,t)=>a=>!!(typeof a=="string"&&rI.test(a)&&a.startsWith(e)||t&&!aI(a)&&Object.prototype.hasOwnProperty.call(a,t)),Nf=(e,t,a)=>r=>{if(typeof r!="string")return r;let[o,n,s,i]=r.match(ci);return{[e]:parseFloat(o),[t]:parseFloat(n),[a]:parseFloat(s),alpha:i!==void 0?parseFloat(i):1}};var j_=e=>ft(0,255,e),ty={...$a,transform:e=>Math.round(j_(e))},Ga={test:fi("rgb","red"),parse:Nf("red","green","blue"),transform:({red:e,green:t,blue:a,alpha:r=1})=>"rgba("+ty.transform(e)+", "+ty.transform(t)+", "+ty.transform(a)+", "+xo(Lr.transform(r))+")"};function q_(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 Lu={test:fi("#"),parse:q_,transform:Ga.transform};var vo={test:fi("hsl","hue"),parse:Nf("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:a,alpha:r=1})=>"hsla("+Math.round(e)+", "+Rt.transform(xo(t))+", "+Rt.transform(xo(a))+", "+xo(Lr.transform(r))+")"};var $e={test:e=>Ga.test(e)||Lu.test(e)||vo.test(e),parse:e=>Ga.test(e)?Ga.parse(e):vo.test(e)?vo.parse(e):Lu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ga.transform(e):vo.transform(e)};var oI=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function H_(e){var t,a;return isNaN(e)&&typeof e=="string"&&(((t=e.match(ci))===null||t===void 0?void 0:t.length)||0)+(((a=e.match(oI))===null||a===void 0?void 0:a.length)||0)>0}var sI="number",iI="color",z_="var",$_="var(",nI="${}",W_=/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 wn(e){let t=e.toString(),a=[],r={color:[],number:[],var:[]},o=[],n=0,i=t.replace(W_,l=>($e.test(l)?(r.color.push(n),o.push(iI),a.push($e.parse(l))):l.startsWith($_)?(r.var.push(n),o.push(z_),a.push(l)):(r.number.push(n),o.push(sI),a.push(parseFloat(l))),++n,nI)).split(nI);return{values:a,split:i,indexes:r,types:o}}function lI(e){return wn(e).values}function uI(e){let{split:t,types:a}=wn(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===sI?n+=xo(o[s]):i===iI?n+=$e.transform(o[s]):n+=o[s]}return n}}var G_=e=>typeof e=="number"?0:e;function K_(e){let t=lI(e);return uI(e)(t.map(G_))}var _t={test:H_,parse:lI,createTransformer:uI,getAnimatableNone:K_};var X_=new Set(["brightness","contrast","saturate","opacity"]);function Q_(e){let[t,a]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[r]=a.match(ci)||[];if(!r)return e;let o=a.replace(r,""),n=X_.has(t)?1:0;return r!==a&&(n*=100),t+"("+n+o+")"}var J_=/\b([a-z-]*)\(.*?\)/gu,Iu={..._t,getAnimatableNone:e=>{let t=e.match(J_);return t?t.map(Q_).join(" "):e}};var Y_={...Qs,color:$e,backgroundColor:$e,outlineColor:$e,fill:$e,stroke:$e,borderColor:$e,borderTopColor:$e,borderRightColor:$e,borderBottomColor:$e,borderLeftColor:$e,filter:Iu,WebkitFilter:Iu},pi=e=>Y_[e];function Of(e,t){let a=pi(e);return a!==Iu&&(a=_t),a.getAnimatableNone?a.getAnimatableNone(t):void 0}var Z_=new Set(["auto","none","0"]);function dI(e,t,a){let r=0,o;for(;r<e.length&&!o;){let n=e[r];typeof n=="string"&&!Z_.has(n)&&wn(n).values.length&&(o=e[r]),r++}if(o&&a)for(let n of t)e[n]=Of(a,o)}var ay=e=>e===$a||e===H,cI=(e,t)=>parseFloat(e.split(", ")[t]),fI=(e,t)=>(a,{transform:r})=>{if(r==="none"||!r)return 0;let o=r.match(/^matrix3d\((.+)\)$/u);if(o)return cI(o[1],t);{let n=r.match(/^matrix\((.+)\)$/u);return n?cI(n[1],e):0}},eE=new Set(["x","y","z"]),tE=za.filter(e=>!eE.has(e));function pI(e){let t=[];return tE.forEach(a=>{let r=e.getValue(a);r!==void 0&&(t.push([a,r.get()]),r.set(a.startsWith("scale")?1:0))}),t}var Sn={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:fI(4,13),y:fI(5,14)};Sn.translateX=Sn.x;Sn.translateY=Sn.y;var Cn=new Set,ry=!1,oy=!1;function mI(){if(oy){let e=Array.from(Cn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),a=new Map;t.forEach(r=>{let o=pI(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)})}oy=!1,ry=!1,Cn.forEach(e=>e.complete()),Cn.clear()}function hI(){Cn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(oy=!0)})}function gI(){hI(),mI()}var wo=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?(Cn.add(this),ry||(ry=!0,Z.read(hI),Z.resolveKeyframes(mI))):(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),Cn.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Cn.delete(this))}resume(){this.isComplete||this.scheduleResolve()}};var Ff=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var aE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function rE(e){let t=aE.exec(e);if(!t)return[,];let[,a,r,o]=t;return[`--${a??r}`,o]}var oE=4;function ny(e,t,a=1){jt(a<=oE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[r,o]=rE(e);if(!r)return;let n=window.getComputedStyle(t).getPropertyValue(r);if(n){let s=n.trim();return Ff(s)?parseFloat(s):s}return Xs(o)?ny(o,t,a+1):o}var Bf=e=>t=>t.test(e);var yI={test:e=>e==="auto",parse:e=>e};var sy=[$a,H,Rt,Wa,PL,kL,yI],iy=e=>sy.find(Bf(e));var mi=class extends wo{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(),Xs(u))){let d=ny(u,a.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Cf.has(r)||t.length!==2)return;let[o,n]=t,s=iy(o),i=iy(n);if(s!==i)if(ay(s)&&ay(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++)tI(t[o])&&r.push(o);r.length&&dI(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=Sn[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]=Sn[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 ly=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(_t.test(e)||e==="0")&&!e.startsWith("url("));function nE(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 xI(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=ly(o,t),i=ly(n,t);return vr(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:nE(e)||(a==="spring"||mo(a))&&r}var sE=e=>e!==null;function So(e,{repeat:t,repeatType:a="loop"},r){let o=e.filter(sE),n=t&&a!=="loop"&&t%2===1?0:o.length-1;return!n||r===void 0?o[n]:r}var iE=40,hi=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>iE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&gI(),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&&!xI(t,r,o,n))if(kf.current||!s){l&&l(So(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 uy(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 vI({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=uy(l,i,e+1/3),n=uy(l,i,e),s=uy(l,i,e-1/3)}return{red:Math.round(o*255),green:Math.round(n*255),blue:Math.round(s*255),alpha:r}}function gi(e,t){return a=>a>0?t:e}var dy=(e,t,a)=>{let r=e*e,o=a*(t*t-r)+r;return o<0?0:Math.sqrt(o)},lE=[Lu,Ga,vo],uE=e=>lE.find(t=>t.test(e));function wI(e){let t=uE(e);if(vr(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let a=t.parse(e);return t===vo&&(a=vI(a)),a}var cy=(e,t)=>{let a=wI(e),r=wI(t);if(!a||!r)return gi(e,t);let o={...a};return n=>(o.red=dy(a.red,r.red,n),o.green=dy(a.green,r.green,n),o.blue=dy(a.blue,r.blue,n),o.alpha=ie(a.alpha,r.alpha,n),Ga.transform(o))};var dE=(e,t)=>a=>t(e(a)),Ka=(...e)=>e.reduce(dE);var Uf=new Set(["none","hidden"]);function SI(e,t){return Uf.has(e)?a=>a<=0?e:t:a=>a>=1?t:e}function cE(e,t){return a=>ie(e,t,a)}function Vf(e){return typeof e=="number"?cE:typeof e=="string"?Xs(e)?gi:$e.test(e)?cy:mE:Array.isArray(e)?CI:typeof e=="object"?$e.test(e)?cy:fE:gi}function CI(e,t){let a=[...e],r=a.length,o=e.map((n,s)=>Vf(n)(n,t[s]));return n=>{for(let s=0;s<r;s++)a[s]=o[s](n);return a}}function fE(e,t){let a={...e,...t},r={};for(let o in a)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Vf(e[o])(e[o],t[o]));return o=>{for(let n in r)a[n]=r[n](o);return a}}function pE(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 mE=(e,t)=>{let a=_t.createTransformer(t),r=wn(e),o=wn(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?Uf.has(e)&&!o.values.length||Uf.has(t)&&!r.values.length?SI(e,t):Ka(CI(pE(r,o),o.values),a):(vr(!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.`),gi(e,t))};function jf(e,t,a){return typeof e=="number"&&typeof t=="number"&&typeof a=="number"?ie(e,t,a):Vf(e)(e,t)}var hE=5;function qf(e,t,a){let r=Math.max(t-hE,0);return If(a-e(r),t-r)}var Te={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 fy=.001;function LI({duration:e=Te.duration,bounce:t=Te.bounce,velocity:a=Te.velocity,mass:r=Te.mass}){let o,n;vr(e<=Ve(Te.maxDuration),"Spring duration must be 10 seconds or less");let s=1-t;s=ft(Te.minDamping,Te.maxDamping,s),e=ft(Te.minDuration,Te.maxDuration,ct(e)),s<1?(o=u=>{let d=u*s,c=d*e,f=d-a,m=Hf(u,s),x=Math.exp(-c);return fy-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=Hf(Math.pow(u,2),s);return(-o(u)+fy>0?-1:1)*((f-m)*x)/w}):(o=u=>{let d=Math.exp(-u*e),c=(u-a)*e+1;return-fy+d*c},n=u=>{let d=Math.exp(-u*e),c=(a-u)*(e*e);return d*c});let i=5/e,l=yE(o,n,i);if(e=Ve(e),isNaN(l))return{stiffness:Te.stiffness,damping:Te.damping,duration:e};{let u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}var gE=12;function yE(e,t,a){let r=a;for(let o=1;o<gE;o++)r=r-e(r)/t(r);return r}function Hf(e,t){return e*Math.sqrt(1-t*t)}var xE=["duration","bounce"],vE=["stiffness","damping","mass"];function II(e,t){return t.some(a=>e[a]!==void 0)}function wE(e){let t={velocity:Te.velocity,stiffness:Te.stiffness,damping:Te.damping,mass:Te.mass,isResolvedFromDuration:!1,...e};if(!II(e,vE)&&II(e,xE))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:Te.mass,stiffness:o,damping:n}}else{let a=LI(e);t={...t,...a,mass:Te.mass},t.isResolvedFromDuration=!0}return t}function zf(e=Te.visualDuration,t=Te.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}=wE({...a,velocity:-ct(a.velocity||0)}),x=f||0,w=u/(2*Math.sqrt(l*d)),I=s-n,h=ct(Math.sqrt(l/d)),g=Math.abs(I)<5;r||(r=g?Te.restSpeed.granular:Te.restSpeed.default),o||(o=g?Te.restDelta.granular:Te.restDelta.default);let y;if(w<1){let L=Hf(h,w);y=P=>{let A=Math.exp(-w*h*P);return s-A*((x+w*h*I)/L*Math.sin(L*P)+I*Math.cos(L*P))}}else if(w===1)y=L=>s-Math.exp(-h*L)*(I+(x+h*I)*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*I)*Math.sinh(R)+L*I*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?Ve(x):qf(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(oi(C),2e4),P=vu(A=>C.next(L*A).value,L,30);return L+"ms "+P}};return C}function py({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,I=c+w,h=s===void 0?I:s(I);h!==I&&(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=zf({keyframes:[f.value,x(f.value)],velocity:qf(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 bI=yo(.42,0,1,1),kI=yo(0,0,.58,1),$f=yo(.42,0,.58,1);var PI=e=>Array.isArray(e)&&typeof e[0]!="number";var TI={linear:ye,easeIn:bI,easeInOut:$f,easeOut:kI,circIn:_f,circInOut:Df,circOut:Ef,backIn:Cu,backInOut:Af,backOut:ey,anticipate:Rf},my=e=>{if(ni(e)){jt(e.length===4,"Cubic bezier arrays must contain four numerical values.");let[t,a,r,o]=e;return yo(t,a,r,o)}else if(typeof e=="string")return jt(TI[e]!==void 0,`Invalid easing type '${e}'`),TI[e];return e};function SE(e,t,a){let r=[],o=a||jf,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=Ka(l,i)}r.push(i)}return r}function AI(e,t,{clamp:a=!0,ease:r,mixer:o}={}){let n=e.length;if(jt(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=SE(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=ea(e[c],e[c+1],d);return i[c](f)};return a?d=>u(ft(e[0],e[n-1],d)):u}function RI(e,t){let a=e[e.length-1];for(let r=1;r<=t;r++){let o=ea(0,t,r);e.push(ie(a,1,o))}}function _I(e){let t=[0];return RI(t,e.length-1),t}function EI(e,t){return e.map(a=>a*t)}function CE(e,t){return e.map(()=>t||$f).splice(0,e.length-1)}function bu({duration:e=300,keyframes:t,times:a,ease:r="easeInOut"}){let o=PI(r)?r.map(my):my(r),n={done:!1,value:t[0]},s=EI(a&&a.length===t.length?a:_I(t),e),i=AI(s,t,{ease:Array.isArray(o)?o:CE(t,o)});return{calculatedDuration:e,next:l=>(n.value=i(l),n.done=l>=e,n)}}var DI=e=>{let t=({timestamp:a})=>e(a);return{start:()=>Z.update(t,!0),stop:()=>ta(t),now:()=>je.isProcessing?je.timestamp:St.now()}};var LE={decay:py,inertia:py,tween:bu,keyframes:bu,spring:zf},IE=e=>e/100,Ln=class extends hi{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||wo,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=mo(a)?a:LE[a]||bu,l,u;i!==bu&&typeof t[0]!="number"&&(l=Ka(IE,jf(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=oi(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:I}=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=So(l,this.options,o)),I&&I(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=Ve(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=DI,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 MI=new Set(["opacity","clipPath","filter","transform"]);function NI(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=ii(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 OI=gn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));var Wf=10,bE=2e4;function kE(e){return mo(e.type)||e.type==="spring"||!vf(e.ease)}function PE(e,t){let a=new Ln({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),r={done:!1,value:e[0]},o=[],n=0;for(;!r.done&&n<bE;)r=a.sample(n),o.push(r.value),n+=Wf;return{times:void 0,keyframes:o,duration:n-Wf,ease:"linear"}}var FI={anticipate:Rf,backInOut:Af,circInOut:Df};function TE(e){return e in FI}var ku=class extends hi{constructor(t){super(t);let{name:a,motionValue:r,element:o,keyframes:n}=this.options;this.resolver=new mi(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"&&ho()&&TE(n)&&(n=FI[n]),kE(this.options)){let{onComplete:c,onUpdate:f,motionValue:m,element:x,...w}=this.options,I=PE(t,w);t=I.keyframes,t.length===1&&(t[1]=t[0]),r=I.duration,o=I.times,n=I.ease,s="keyframes"}let d=NI(i.owner.current,l,t,{...this.options,duration:r,times:o,ease:n});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(xu(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:c}=this.options;i.set(So(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=Ve(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;xu(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 Ln({...m,keyframes:r,duration:o,type:n,ease:s,times:i,isGenerator:!0}),w=Ve(this.time);u.setWithVelocity(x.sample(w-Wf).value,x.sample(w).value,Wf)}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 OI()&&r&&MI.has(r)&&!l&&!u&&!o&&n!=="mirror"&&s!==0&&i!=="inertia"}};var AE={type:"spring",stiffness:500,damping:25,restSpeed:10},RE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_E={type:"keyframes",duration:.8},EE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BI=(e,{keyframes:t})=>t.length>2?_E:Ht.has(e)?e.startsWith("scale")?RE(t[1]):AE:EE;function UI({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 yi=(e,t,a,r={},o,n)=>s=>{let i=po(r,e)||{},l=i.delay||r.delay||0,{elapsed:u=0}=r;u=u-Ve(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};UI(i)||(d={...d,...BI(e,d)}),d.duration&&(d.duration=Ve(d.duration)),d.repeatDelay&&(d.repeatDelay=Ve(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)),(kf.current||qs.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!n&&t.get()!==void 0){let f=So(d.keyframes,i);if(f!==void 0)return Z.update(()=>{d.onUpdate(f),d.onComplete()}),new yu([])}return!n&&ku.supports(d)?new ku(d):new Ln(d)};function DE({protectedKeys:e,needsAnimating:t},a){let r=e.hasOwnProperty(a)&&t[a]!==!0;return t[a]=!1,r}function Gf(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&&DE(d,c))continue;let x={delay:a,...po(s||{},c)},w=!1;if(window.MotionHandoffAnimation){let h=bf(e);if(h){let g=window.MotionHandoffAnimation(h,c,Z);g!==null&&(x.startTime=g,w=!0)}}Su(e,c),f.start(yi(c,f,m,e.shouldReduceMotion&&Cf.has(c)?{type:!1}:x,e,w));let I=f.animation;I&&u.push(I)}return i&&Promise.all(u).then(()=>{Z.update(()=>{i&&wu(e,i)})}),u}function Kf(e,t,a={}){var r;let o=fo(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(Gf(e,o,a)):()=>Promise.resolve(),i=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=n;return ME(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 ME(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(NE).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(Kf(u,t,{...n,delay:a+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function NE(e,t){return e.sortNodePosition(t)}function Xf(e,t,a={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){let o=t.map(n=>Kf(e,n,a));r=Promise.all(o)}else if(typeof t=="string")r=Kf(e,t,a);else{let o=typeof t=="function"?fo(e,t,a.custom):t;r=Promise.all(Gf(e,o,a))}return r.then(()=>{e.notify("AnimationComplete",t)})}var OE=fu.length;function hy(e){if(!e)return;if(!e.isControllingVariants){let a=e.parent?hy(e.parent)||{}:{};return e.props.initial!==void 0&&(a.initial=e.props.initial),a}let t={};for(let a=0;a<OE;a++){let r=fu[a],o=e.props[r];(Sr(o)||o===!1)&&(t[r]=o)}return t}var FE=[...af].reverse(),BE=af.length;function UE(e){return t=>Promise.all(t.map(({animation:a,options:r})=>Xf(e,a,r)))}function jI(e){let t=UE(e),a=VI(),r=!0,o=l=>(u,d)=>{var c;let f=fo(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=hy(e.parent)||{},c=[],f=new Set,m={},x=1/0;for(let I=0;I<BE;I++){let h=FE[I],g=a[h],y=u[h]!==void 0?u[h]:d[h],C=Sr(y),L=h===l?g.isActive:null;L===!1&&(x=I);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||co(y)||typeof y=="boolean")continue;let A=VE(g.prevProp,y),R=A||h===l&&g.isActive&&!P&&C||I>x&&C,q=!1,V=Array.isArray(y)?y:[y],pe=V.reduce(o(h),{});L===!1&&(pe={});let{prevResolvedValues:le={}}=g,An={...le,...pe},oe=Be=>{R=!0,f.has(Be)&&(q=!0,f.delete(Be)),g.needsAnimating[Be]=!0;let ot=e.getValue(Be);ot&&(ot.liveStyle=!1)};for(let Be in An){let ot=pe[Be],mt=le[Be];if(m.hasOwnProperty(Be))continue;let xe=!1;pu(ot)&&pu(mt)?xe=!zg(ot,mt):xe=ot!==mt,xe?ot!=null?oe(Be):f.add(Be):ot!==void 0&&f.has(Be)?oe(Be):g.protectedKeys[Be]=!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(Be=>({animation:Be,options:{type:h}})))}if(f.size){let I={};f.forEach(h=>{let g=e.getBaseTarget(h),y=e.getValue(h);y&&(y.liveStyle=!0),I[h]=g??null}),c.push({animation:I})}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=VI(),r=!0}}}function VE(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!zg(t,e):!1}function In(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function VI(){return{animate:In(!0),whileInView:In(),whileHover:In(),whileTap:In(),whileDrag:In(),whileFocus:In(),exit:In()}}var rt=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};var Qf=class extends rt{constructor(t){super(t),t.animationState||(t.animationState=jI(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: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 jE=0,Jf=class extends rt{constructor(){super(...arguments),this.id=jE++}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 qI={animation:{Feature:Qf},exit:{Feature:Jf}};function br(e,t,a,r={passive:!0}){return e.addEventListener(t,a,r),()=>e.removeEventListener(t,a)}function kr(e){return{point:{x:e.pageX,y:e.pageY}}}var HI=e=>t=>xn(t)&&e(t,kr(t));function Co(e,t,a,r){return br(e,t,HI(a),r)}var zI=(e,t)=>Math.abs(e-t);function $I(e,t){let a=zI(e.x,t.x),r=zI(e.y,t.y);return Math.sqrt(a**2+r**2)}var xi=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=yy(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=$I(c.offset,{x:0,y:0})>=3;if(!f&&!m)return;let{point:x}=c,{timestamp:w}=je;this.history.push({...x,timestamp:w});let{onStart:I,onMove:h}=this.handlers;f||(I&&I(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=gy(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 I=yy(c.type==="pointercancel"?this.lastMoveEventInfo:gy(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(c,I),x&&x(c,I)},!xn(t))return;this.dragSnapToOrigin=n,this.handlers=a,this.transformPagePoint=r,this.contextWindow=o||window;let s=kr(t),i=gy(s,this.transformPagePoint),{point:l}=i,{timestamp:u}=je;this.history=[{...l,timestamp:u}];let{onSessionStart:d}=a;d&&d(t,yy(i,this.history)),this.removeListeners=Ka(Co(this.contextWindow,"pointermove",this.handlePointerMove),Co(this.contextWindow,"pointerup",this.handlePointerUp),Co(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ta(this.updatePoint)}};function gy(e,t){return t?{point:t(e.point)}:e}function WI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function yy({point:e},t){return{point:e,delta:WI(e,GI(t)),offset:WI(e,qE(t)),velocity:HE(t,.1)}}function qE(e){return e[0]}function GI(e){return e[e.length-1]}function HE(e,t){if(e.length<2)return{x:0,y:0};let a=e.length-1,r=null,o=GI(e);for(;a>=0&&(r=e[a],!(o.timestamp-r.timestamp>Ve(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 JI=1e-4,zE=1-JI,$E=1+JI,YI=.01,WE=0-YI,GE=0+YI;function pt(e){return e.max-e.min}function ZI(e,t,a){return Math.abs(e-t)<=a}function KI(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>=zE&&e.scale<=$E||isNaN(e.scale))&&(e.scale=1),(e.translate>=WE&&e.translate<=GE||isNaN(e.translate))&&(e.translate=0)}function vi(e,t,a,r){KI(e.x,t.x,a.x,r?r.originX:void 0),KI(e.y,t.y,a.y,r?r.originY:void 0)}function XI(e,t,a){e.min=a.min+t.min,e.max=e.min+pt(t)}function eb(e,t,a){XI(e.x,t.x,a.x),XI(e.y,t.y,a.y)}function QI(e,t,a){e.min=t.min-a.min,e.max=e.min+pt(t)}function wi(e,t,a){QI(e.x,t.x,a.x),QI(e.y,t.y,a.y)}function nb(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 tb(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 sb(e,{top:t,left:a,bottom:r,right:o}){return{x:tb(e.x,a,o),y:tb(e.y,t,r)}}function ab(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 ib(e,t){return{x:ab(e.x,t.x),y:ab(e.y,t.y)}}function lb(e,t){let a=.5,r=pt(e),o=pt(t);return o>r?a=ea(t.min,t.max-r,e.min):r>o&&(a=ea(e.min,e.max-o,t.min)),ft(0,1,a)}function ub(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 Yf=.35;function db(e=Yf){return e===!1?e=0:e===!0&&(e=Yf),{x:rb(e,"left","right"),y:rb(e,"top","bottom")}}function rb(e,t,a){return{min:ob(e,t),max:ob(e,a)}}function ob(e,t){return typeof e=="number"?e:e[t]||0}var cb=()=>({translate:0,scale:1,origin:0,originPoint:0}),bn=()=>({x:cb(),y:cb()}),fb=()=>({min:0,max:0}),Ae=()=>({x:fb(),y:fb()});function zt(e){return[e("x"),e("y")]}function Zf({top:e,left:t,right:a,bottom:r}){return{x:{min:t,max:a},y:{min:e,max:r}}}function pb({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mb(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 xy(e){return e===void 0||e===1}function ep({scale:e,scaleX:t,scaleY:a}){return!xy(e)||!xy(t)||!xy(a)}function Pr(e){return ep(e)||vy(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function vy(e){return hb(e.x)||hb(e.y)}function hb(e){return e&&e!=="0%"}function Pu(e,t,a){let r=e-a,o=t*r;return a+o}function gb(e,t,a,r,o){return o!==void 0&&(e=Pu(e,o,r)),Pu(e,a,r)+t}function wy(e,t=0,a=1,r,o){e.min=gb(e.min,t,a,r,o),e.max=gb(e.max,t,a,r,o)}function Sy(e,{x:t,y:a}){wy(e.x,t.translate,t.scale,t.originPoint),wy(e.y,a.translate,a.scale,a.originPoint)}var yb=.999999999999,xb=1.0000000000001;function wb(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&&kn(e,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Sy(e,s)),r&&Pr(n.latestValues)&&kn(e,n.latestValues))}t.x<xb&&t.x>yb&&(t.x=1),t.y<xb&&t.y>yb&&(t.y=1)}function Lo(e,t){e.min=e.min+t,e.max=e.max+t}function vb(e,t,a,r,o=.5){let n=ie(e.min,e.max,o);wy(e,t,a,n,r)}function kn(e,t){vb(e.x,t.x,t.scaleX,t.scale,t.originX),vb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Cy(e,t){return Zf(mb(e.getBoundingClientRect(),t))}function Sb(e,t,a){let r=Cy(e,a),{scroll:o}=t;return o&&(Lo(r.x,o.offset.x),Lo(r.y,o.offset.y)),r}var tp=({current:e})=>e?e.ownerDocument.defaultView:null;var KE=new WeakMap,rp=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: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(kr(d).point)},n=(d,c)=>{let{drag:f,dragPropagation:m,onDragStart:x}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Yg(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(I=>{let h=this.getAxisMotionValue(I).get()||0;if(Rt.test(h)){let{projection:g}=this.visualElement;if(g&&g.layout){let y=g.layout.layoutBox[I];y&&(h=pt(y)*(parseFloat(h)/100))}}this.originPoint[I]=h}),x&&Z.postRender(()=>x(d,c)),Su(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:I}=c;if(m&&this.currentDirection===null){this.currentDirection=XE(I),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",c.point,I),this.updateAxis("y",c.point,I),this.visualElement.render(),w&&w(d,c)},i=(d,c)=>this.stop(d,c),l=()=>zt(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 xi(t,{onSessionStart:o,onStart:n,onMove:s,onSessionEnd:i,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:tp(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||!ap(t,o,this.currentDirection))return;let n=this.getAxisMotionValue(t),s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=nb(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&&Cr(a)?this.constraints||(this.constraints=this.resolveRefConstraints()):a&&o?this.constraints=sb(o.layoutBox,a):this.constraints=!1,this.elastic=db(r),n!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&zt(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=ub(o.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:a}=this.getProps();if(!t||!Cr(t))return!1;let r=t.current;jt(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=Sb(r,o.root,this.visualElement.getTransformPagePoint()),s=ib(o.layout.layoutBox,n);if(a){let i=a(pb(s));this.hasMutatedConstraints=!!i,i&&(s=Zf(i))}return s}startAnimation(t){let{drag:a,dragMomentum:r,dragElastic:o,dragTransition:n,dragSnapToOrigin:s,onDragTransitionEnd:i}=this.getProps(),l=this.constraints||{},u=zt(d=>{if(!ap(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 Su(this.visualElement,t),r.start(yi(t,r,0,a,this.visualElement,!1))}stopAnimation(){zt(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){zt(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){zt(a=>{let{drag:r}=this.getProps();if(!ap(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(!Cr(a)||!r||!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]=lb({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(),zt(s=>{if(!ap(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;KE.set(this.visualElement,this);let t=this.visualElement.current,a=Co(t,"pointerdown",l=>{let{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{let{dragConstraints:l}=this.getProps();Cr(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=br(window,"resize",()=>this.scalePositionWithinConstraints()),i=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(zt(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=Yf,dragMomentum:i=!0}=t;return{...t,drag:a,dragDirectionLock:r,dragPropagation:o,dragConstraints:n,dragElastic:s,dragMomentum:i}}};function ap(e,t,a){return(t===!0||t===e)&&(a===null||a===e)}function XE(e,t=10){let a=null;return Math.abs(e.y)>t?a="y":Math.abs(e.x)>t&&(a="x"),a}var op=class extends rt{constructor(t){super(t),this.removeGroupControls=ye,this.removeListeners=ye,this.controls=new rp(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 Cb=e=>(t,a)=>{e&&Z.postRender(()=>e(t,a))},np=class extends rt{constructor(){super(...arguments),this.removePointerDownListener=ye}onPointerDown(t){this.session=new xi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tp(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:a,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Cb(t),onStart:Cb(a),onMove:r,onEnd:(n,s)=>{delete this.session,o&&Z.postRender(()=>o(n,s))}}}mount(){this.removePointerDownListener=Co(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 bb=D(ue(),1),Tu=D(W(),1);var Si={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Lb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ci={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(H.test(e))e=parseFloat(e);else return e;let a=Lb(e,t.target.x),r=Lb(e,t.target.y);return`${a}% ${r}%`}};var Ib={correct:(e,{treeScale:t,projectionDelta:a})=>{let r=e,o=_t.parse(e);if(o.length>5)return r;let n=_t.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 Ly=class extends Tu.Component{componentDidMount(){let{visualElement:t,layoutGroup:a,switchLayoutGroup:r,layoutId:o}=this.props,{projection:n}=t;ML(QE),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()})),Si.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(),zs.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 sp(e){let[t,a]=Xc(),r=(0,Tu.useContext)(Bs);return(0,bb.jsx)(Ly,{...e,layoutGroup:r,switchLayoutGroup:(0,Tu.useContext)(sf),isPresent:t,safeToRemove:a})}var QE={borderRadius:{...Ci,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ci,borderTopRightRadius:Ci,borderBottomLeftRadius:Ci,borderBottomRightRadius:Ci,boxShadow:Ib};function kb(e,t,a){let r=Le(e)?e:Ir(e);return r.start(yi("",r,t,a)),r.animation}function Pb(e){return e instanceof SVGElement&&e.tagName!=="svg"}var Tb=(e,t)=>e.depth-t.depth;var ip=class{constructor(){this.children=[],this.isDirty=!1}add(t){ui(this.children,t),this.isDirty=!0}remove(t){di(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Tb),this.isDirty=!1,this.children.forEach(t)}};function Ab(e,t){let a=St.now(),r=({timestamp:o})=>{let n=o-a;n>=t&&(ta(r),e(n-t))};return Z.read(r,!0),()=>ta(r)}var Db=["TopLeft","TopRight","BottomLeft","BottomRight"],JE=Db.length,Rb=e=>typeof e=="string"?parseFloat(e):e,_b=e=>typeof e=="number"||H.test(e);function Mb(e,t,a,r,o,n){o?(e.opacity=ie(0,a.opacity!==void 0?a.opacity:1,YE(r)),e.opacityExit=ie(t.opacity!==void 0?t.opacity:1,0,ZE(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<JE;s++){let i=`border${Db[s]}Radius`,l=Eb(t,i),u=Eb(a,i);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||_b(l)===_b(u)?(e[i]=Math.max(ie(Rb(l),Rb(u),r),0),(Rt.test(u)||Rt.test(l))&&(e[i]+="%")):e[i]=u}(t.rotate||a.rotate)&&(e.rotate=ie(t.rotate||0,a.rotate||0,r))}function Eb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var YE=Nb(0,.5,Ef),ZE=Nb(.5,.95,ye);function Nb(e,t,a){return r=>r<e?0:r>t?1:a(ea(e,t,r))}function Ob(e,t){e.min=t.min,e.max=t.max}function ra(e,t){Ob(e.x,t.x),Ob(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 Fb(e,t,a,r,o){return e-=t,e=Pu(e,1/a,r),o!==void 0&&(e=Pu(e,1/o,r)),e}function eD(e,t=0,a=1,r=.5,o,n=e,s=e){if(Rt.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=Fb(e.min,t,a,i,o),e.max=Fb(e.max,t,a,i,o)}function Bb(e,t,[a,r,o],n,s){eD(e,t[a],t[r],t[o],t.scale,n,s)}var tD=["x","scaleX","originX"],aD=["y","scaleY","originY"];function by(e,t,a,r){Bb(e.x,t,tD,a?a.x:void 0,r?r.x:void 0),Bb(e.y,t,aD,a?a.y:void 0,r?r.y:void 0)}function Ub(e){return e.translate===0&&e.scale===1}function ky(e){return Ub(e.x)&&Ub(e.y)}function Vb(e,t){return e.min===t.min&&e.max===t.max}function qb(e,t){return Vb(e.x,t.x)&&Vb(e.y,t.y)}function jb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Py(e,t){return jb(e.x,t.x)&&jb(e.y,t.y)}function Ty(e){return pt(e.x)/pt(e.y)}function Ay(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var lp=class{constructor(){this.members=[]}add(t){ui(this.members,t),t.scheduleRender()}remove(t){if(di(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 Hb(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 Pn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Au=typeof window<"u"&&window.MotionDebug!==void 0,Ry=["","X","Y","Z"],rD={visibility:"hidden"},zb=1e3,oD=0;function _y(e,t,a,r){let{latestValues:o}=t;o[e]&&(a[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Yb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let a=bf(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&&Yb(r)}function up({attachResizeListener:e,defaultParent:t,measureScroll:a,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},i=t?.()){this.id=oD++,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,Au&&(Pn.totalNodes=Pn.resolvedTargetDeltas=Pn.recalculatedProjection=0),this.nodes.forEach(iD),this.nodes.forEach(fD),this.nodes.forEach(pD),this.nodes.forEach(lD),Au&&window.MotionDebug.record(Pn)},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 ip)}addEventListener(s,i){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new go),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=Pb(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=Ab(f,250),Si.hasAnimatedSinceResize&&(Si.hasAnimatedSinceResize=!1,this.nodes.forEach(Wb))})}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()||xD,{onLayoutAnimationStart:I,onLayoutAnimationComplete:h}=d.getProps(),g=!this.targetLayout||!Py(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={...po(w,"layout"),onPlay:I,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else f||Wb(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,ta(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&&Yb(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($b);return}this.isUpdating||this.nodes.forEach(dD),this.isUpdating=!1,this.nodes.forEach(cD),this.nodes.forEach(nD),this.nodes.forEach(sD),this.clearAllSnapshots();let i=St.now();je.delta=ft(0,1e3/60,i-je.timestamp),je.timestamp=i,je.isProcessing=!0,ef.update.process(je),ef.preRender.process(je),ef.render.process(je),je.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(uD),this.sharedNodes.forEach(hD)}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=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=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&&!ky(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(i||Pr(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)),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(wD))){let{scroll:d}=this.root;d&&(Lo(l.x,d.offset.x),Lo(l.y,d.offset.y))}return l}removeElementScroll(s){var i;let l=Ae();if(ra(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&&ra(l,s),Lo(l.x,c.offset.x),Lo(l.y,c.offset.y))}return l}applyTransform(s,i=!1){let l=Ae();ra(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&&kn(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Pr(d.latestValues)&&kn(l,d.latestValues)}return Pr(this.latestValues)&&kn(l,this.latestValues),l}removeTransform(s){let i=Ae();ra(i,s);for(let l=0;l<this.path.length;l++){let u=this.path[l];if(!u.instance||!Pr(u.latestValues))continue;ep(u.latestValues)&&u.updateSnapshot();let d=Ae(),c=u.measurePageBox();ra(d,c),by(i,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Pr(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!==je.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=je.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(),wi(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),ra(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(),eb(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ra(this.target,this.layout.layoutBox),Sy(this.target,this.targetDelta)):ra(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(),wi(this.relativeTargetOrigin,this.target,m.target),ra(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Au&&Pn.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ep(this.parent.latestValues)||vy(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===je.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;ra(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;wb(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: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)),vi(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ay(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ay(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),Au&&Pn.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=bn(),this.projectionDelta=bn(),this.projectionDeltaWithTransform=bn()}setAnimationOrigin(s,i=!1){let l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=bn();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!i;let f=Ae(),m=l?l.source:void 0,x=this.layout?this.layout.source:void 0,w=m!==x,I=this.getStack(),h=!I||I.members.length<=1,g=!!(w&&!h&&this.options.crossfade===!0&&!this.path.some(yD));this.animationProgress=0;let y;this.mixTargetDelta=C=>{let L=C/1e3;Gb(c.x,s.x,L),Gb(c.y,s.y,L),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(wi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gD(this.relativeTarget,this.relativeTargetOrigin,f,L),y&&qb(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Ae()),ra(y,this.relativeTarget)),w&&(this.animationValues=d,Mb(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&&(ta(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Z.update(()=>{Si.hasAnimatedSinceResize=!0,this.currentAnimation=kb(0,zb,{...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(zb),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&&Zb(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ae();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}ra(i,l),kn(i,d),vi(this.projectionDeltaWithTransform,this.layoutCorrected,i,d)}}registerSharedNode(s,i){this.sharedNodes.has(s)||this.sharedNodes.set(s,new lp),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 d=0;d<Ry.length;d++)_y(`rotate${Ry[d]}`,s,u,this.animationValues),_y(`skew${Ry[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 rD;let u={visibility:""},d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Ks(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=Ks(s?.pointerEvents)||""),this.hasProjected&&!Pr(this.latestValues)&&(w.transform=d?d({},""):"none",this.hasProjected=!1),w}let f=c.animationValues||c.latestValues;this.applyTransformsToTarget(),u.transform=Hb(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 ti){if(f[w]===void 0)continue;let{correct:I,applyTo:h}=ti[w],g=u.transform==="none"?f[w]:I(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?Ks(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($b),this.root.sharedNodes.clear()}}}function nD(e){e.updateLayout()}function sD(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"?zt(c=>{let f=s?a.measuredBox[c]:a.layoutBox[c],m=pt(f);f.min=r[c].min,f.max=f.min+m}):Zb(n,a.layoutBox,r)&&zt(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=bn();vi(i,r,a.layoutBox);let l=bn();s?vi(l,e.applyTransform(o,!0),a.measuredBox):vi(l,r,a.layoutBox);let u=!ky(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=Ae();wi(x,a.layoutBox,f.layoutBox);let w=Ae();wi(w,r,m.layoutBox),Py(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 iD(e){Au&&Pn.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 lD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function uD(e){e.clearSnapshot()}function $b(e){e.clearMeasurements()}function dD(e){e.isLayoutDirty=!1}function cD(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function fD(e){e.resolveTargetDelta()}function pD(e){e.calcProjection()}function mD(e){e.resetSkewAndRotation()}function hD(e){e.removeLeadSnapshot()}function Gb(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 Kb(e,t,a,r){e.min=ie(t.min,a.min,r),e.max=ie(t.max,a.max,r)}function gD(e,t,a,r){Kb(e.x,t.x,a.x,r),Kb(e.y,t.y,a.y,r)}function yD(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var xD={duration:.45,ease:[.4,0,.1,1]},Xb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Qb=Xb("applewebkit/")&&!Xb("chrome/")?Math.round:ye;function Jb(e){e.min=Qb(e.min),e.max=Qb(e.max)}function vD(e){Jb(e.x),Jb(e.y)}function Zb(e,t,a){return e==="position"||e==="preserve-aspect"&&!ZI(Ty(t),Ty(a),.2)}function wD(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}var ek=up({attachResizeListener:(e,t)=>br(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0});var Ey={current:void 0},dp=up({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ey.current){let e=new ek({});e.mount(window),e.setOptions({layoutScroll:!0}),Ey.current=e}return Ey.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var tk={pan:{Feature:np},drag:{Feature:op,ProjectionNode:dp,MeasureLayout:sp}};function ak(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,kr(t)))}var cp=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Xg(t,a=>(ak(this.node,a,"Start"),r=>ak(this.node,r,"End"))))}unmount(){}};var fp=class extends rt{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=Ka(br(this.node.current,"focus",()=>this.onFocus()),br(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function rk(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,kr(t)))}var pp=class extends rt{mount(){let{current:t}=this.node;t&&(this.unmount=Jg(t,a=>(rk(this.node,a,"Start"),(r,{success:o})=>rk(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};var My=new WeakMap,Dy=new WeakMap,SD=e=>{let t=My.get(e.target);t&&t(e)},CD=e=>{e.forEach(SD)};function LD({root:e,...t}){let a=e||document;Dy.has(a)||Dy.set(a,{});let r=Dy.get(a),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(CD,{root:e,...t})),r[o]}function ok(e,t,a){let r=LD(t);return My.set(e,a),r.observe(e),()=>{My.delete(e),r.unobserve(e)}}var ID={some:0,all:1},mp=class extends rt{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:ID[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 ok(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(bD(t,a))&&this.startObserver()}unmount(){}};function bD({viewport:e={}},{viewport:t={}}={}){return a=>e[a]!==t[a]}var nk={inView:{Feature:mp},tap:{Feature:pp},focus:{Feature:fp},hover:{Feature:cp}};var sk={layout:{ProjectionNode:dp,MeasureLayout:sp}};var ck=D(W(),1);var Ru={current:null},hp={current:!1};function ik(){if(hp.current=!0,!!Vs)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ru.current=e.matches;e.addListener(t),t()}else Ru.current=!1}var kD=[...sy,$e,_t],lk=e=>kD.find(Bf(e));var Ny=new WeakMap;function uk(e,t,a){for(let r in t){let o=t[r],n=a[r];if(Le(o))e.addValue(r,o);else if(Le(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 dk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],gp=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=wo,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=yn(a),this.isVariantNode=rf(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&&Le(x)&&x.set(l[m],!1)}}mount(t){this.current=t,Ny.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)),hp.current||ik(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ru.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ny.delete(this.current),this.projection&&this.projection.unmount(),ta(this.notifyUpdate),ta(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=Ht.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 wr){let a=wr[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):Ae()}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<dk.length;r++){let o=dk[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=uk(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"&&(Ff(o)||Mf(o))?o=parseFloat(o):!lk(o)&&_t.test(a)&&(o=Of(t,a)),this.setBaseTarget(t,Le(o)?o.get():o)),Le(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=Gs(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&&!Le(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 go),this.events[t].add(a)}notify(t,...a){this.events[t]&&this.events[t].notify(...a)}};var Li=class extends gp{constructor(){super(...arguments),this.KeyframeResolver=mi}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;Le(t)&&(this.childSubscription=t.on("change",a=>{this.current&&(this.current.textContent=`${a}`)}))}};function PD(e){return window.getComputedStyle(e)}var yp=class extends Li{constructor(){super(...arguments),this.type="html",this.renderInstance=pf}readValueFromInstance(t,a){if(Ht.has(a)){let r=pi(a);return r&&r.default||0}else{let r=PD(t),o=(df(a)?r.getPropertyValue(a):r[a])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:a}){return Cy(t,a)}build(t,a,r){Js(t,a,r.transformTemplate)}scrapeMotionValuesFromProps(t,a,r){return ai(t,a,r)}};var xp=class extends Li{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ae}getBaseTargetFromProps(t,a){return t[a]}readValueFromInstance(t,a){if(Ht.has(a)){let r=pi(a);return r&&r.default||0}return a=mf.has(a)?a:Hs(a),t.getAttribute(a)}scrapeMotionValuesFromProps(t,a,r){return yf(t,a,r)}build(t,a,r){Ys(t,a,this.isSVGTag,r.transformTemplate)}renderInstance(t,a,r,o){hf(t,a,r,o)}mount(t){this.isSVGTag=ei(t.tagName),super.mount(t)}};var fk=(e,t)=>Ws(e)?new xp(t):new yp(t,{allowProjection:e!==ck.Fragment});var pk=HL({...qI,...nk,...tk,...sk},fk);var _u=uL(pk);function TD(e){e.values.forEach(t=>t.stop())}function Oy(e,t){[...t].reverse().forEach(r=>{let o=e.getVariant(r);o&&wu(e,o),e.variantChildren&&e.variantChildren.forEach(n=>{Oy(n,t)})})}function AD(e,t){if(Array.isArray(t))return Oy(e,t);if(typeof t=="string")return Oy(e,[t]);wu(e,t)}function mk(){let e=!1,t=new Set,a={subscribe(r){return t.add(r),()=>{t.delete(r)}},start(r,o){jt(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(Xf(s,r,{transitionOverride:o}))}),Promise.all(n)},set(r){return jt(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),t.forEach(o=>{AD(o,r)})},stop(){t.forEach(r=>{TD(r)})},mount(){return e=!0,()=>{e=!1,a.stop()}}};return a}function Fy(){let e=so(mk);return js(e.mount,[]),e}var Fe=D(ue(),1);function hk({phase:e,progressSteps:t=[]}){return(0,Fe.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,Fe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Fe.jsx)(At,{className:"h-3.5 w-3.5 animate-spin"}),(0,Fe.jsx)("span",{children:"Thinking\u2026"})]}),e==="searching"&&(0,Fe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-300",children:[(0,Fe.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Fe.jsx)(mn,{className:"h-3.5 w-3.5 opacity-70"}),(0,Fe.jsx)("span",{children:"Searching across pages\u2026"})]}),(0,Fe.jsxs)("ul",{className:"ml-6 list-disc space-y-1",children:[(0,Fe.jsx)("li",{className:"opacity-90",children:"Checking recent changes"}),(0,Fe.jsx)("li",{className:"opacity-90",children:"Scanning documentation"}),(0,Fe.jsx)("li",{className:"opacity-90",children:"Summarizing relevant sections"})]})]}),(e==="thinking"||e==="executing"||e==="responding")&&t.length>0&&(0,Fe.jsxs)("div",{className:"space-y-2 animate-in fade-in-0 duration-200",children:[t.map((a,r)=>(0,Fe.jsxs)("div",{className:`flex items-center gap-2 transition-opacity duration-200 ${a.completed?"opacity-60":"opacity-100"}`,children:[a.completed?(0,Fe.jsx)(at,{className:"h-3.5 w-3.5 text-green-500 flex-shrink-0"}):(0,Fe.jsx)(At,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Fe.jsx)("span",{className:a.completed?"line-through":"",children:a.message})]},r)),e==="responding"&&(0,Fe.jsxs)("div",{className:"flex items-center gap-2 opacity-100 animate-in fade-in-0 duration-200",children:[(0,Fe.jsx)(At,{className:"h-3.5 w-3.5 animate-spin flex-shrink-0"}),(0,Fe.jsx)("span",{children:"Preparing response..."})]})]})]})}var gk=D(W(),1);var Ra=D(ue(),1);function yk({title:e,links:t}){let[a,r]=gk.useState(!1);return(0,Ra.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,Ra.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,Ra.jsxs)("div",{className:"flex items-center gap-1.5",children:[a?(0,Ra.jsx)(ru,{className:"h-3 w-3 opacity-70"}):(0,Ra.jsx)(mn,{className:"h-3 w-3 opacity-70"}),(0,Ra.jsx)("span",{children:e})]})}),a&&t.length>0&&(0,Ra.jsx)("ul",{className:"ml-5 mt-1 space-y-0.5",children:t.map(o=>(0,Ra.jsx)("li",{children:(0,Ra.jsx)("a",{href:o.href,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:o.label})},o.href))})]})}var Eu=D(ue(),1);function xk({x:e,y:t,visible:a,onClick:r=!1}){return(0,Eu.jsx)(Ug,{children:a&&(0,Eu.jsx)(_u.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,Eu.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Eu.jsx)("path",{d:"M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z",fill:"#C4B5FD"})})})})}var Ii=D(W(),1);function vk(){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 Xa=D(W(),1);function wk({productBackendUrl:e,sessionId:t,enabled:a=!0}){let[r,o]=Xa.useState({status:"idle"}),n=Xa.useRef(null),s=Xa.useRef(a),i=Xa.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=c.includes("cors")||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]);Xa.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=Xa.useCallback(()=>{i()},[i]);return{authState:r,retry:l}}var vp=D(W(),1);function Sk({agentUrl:e,orgId:t}){let[a,r]=vp.useState({status:"idle",config:null,error:null});return vp.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 By=D(W(),1);function Ck({productBackendUrl:e,agentUrl:t,sessionId:a}){let r=(0,By.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,By.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"}}),I;if(w.ok)I=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:I})}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 bi=D(ue(),1);function Ct({className:e,...t}){return(0,bi.jsx)("div",{"data-slot":"card",className:Yt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Qa({className:e,...t}){return(0,bi.jsx)("div",{"data-slot":"card-header",className:Yt("@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 Ja({className:e,...t}){return(0,bi.jsx)("div",{"data-slot":"card-title",className:Yt("leading-none font-semibold",e),...t})}function Uy({className:e,...t}){return(0,bi.jsx)("div",{"data-slot":"card-description",className:Yt("text-muted-foreground text-sm",e),...t})}function Lt({className:e,...t}){return(0,bi.jsx)("div",{"data-slot":"card-content",className:Yt("px-6",e),...t})}var S=D(ue(),1),Vy=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),wp=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),jy=e=>{switch(e){case"Enterprise":return cn;case"Professional":return lu;default:return eu}},Sp=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 Du({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:at};case"failed":return{color:"bg-red-50 text-red-700 border-red-200",icon:Aa};case"pending":return{color:"bg-amber-50 text-amber-700 border-amber-200",icon:un};case"refunded":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Ns};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Ta}}if(t==="subscription")switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"cancelled":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Aa};case"past_due":return{color:"bg-red-50 text-red-700 border-red-200",icon:Ta};case"trialing":return{color:"bg-blue-50 text-blue-700 border-blue-200",icon:un};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Ta}}switch(n){case"active":return{color:"bg-emerald-50 text-emerald-700 border-emerald-200",icon:at};case"inactive":return{color:"bg-slate-50 text-slate-700 border-slate-200",icon:Aa};default:return{color:"bg-gray-50 text-gray-700 border-gray-200",icon:Ta}}})(),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 RD({subscription:e}){let t=jy(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)(Qa,{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)(Ja,{className:"text-base font-semibold text-gray-900 flex items-center gap-2",children:[(0,S.jsx)(dn,{className:"h-4 w-4 text-gray-500"}),e.id]}),e.customer_email&&(0,S.jsxs)(Uy,{className:"text-sm text-gray-500 flex items-center gap-1.5",children:[(0,S.jsx)(Ds,{className:"h-3 w-3"}),e.customer_email]})]}),(0,S.jsx)(Du,{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 ${Sp(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:[wp(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:[Vy(e.current_period_start)," - ",Vy(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:Vy(e.created_at)})]})]})]})})]})}function _D({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)(dn,{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)(Qa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ja,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(dn,{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=jy(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 ${Sp(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 ",wp(o.amount,o.currency),"/",o.billing_cycle]})]})]}),(0,S.jsx)(Du,{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 ED({customer:e}){let t=jy(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)(Qa,{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)(Ja,{className:"text-base font-semibold text-gray-900",children:e.name}),(0,S.jsxs)(Uy,{className:"text-sm text-gray-500 flex items-center gap-1",children:[(0,S.jsx)(Ds,{className:"h-3 w-3"}),e.email]})]})}),(0,S.jsx)(Du,{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 ${Sp(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)(fn,{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)(Ms,{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)(au,{className:"h-3 w-3 text-gray-400"}),e.joinDate]})]})]})]})})]})}function DD({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)(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 customers found"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Qa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ja,{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," 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 ${Sp(o.subscription)}`,children:o.subscription}),(0,S.jsx)(Du,{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 Lk({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)(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 transactions found"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Qa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ja,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(fn,{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)(at,{className:"h-4 w-4 text-emerald-600"}):o.status==="failed"?(0,S.jsx)(Aa,{className:"h-4 w-4 text-red-600"}):o.status==="refunded"?(0,S.jsx)(Ns,{className:"h-4 w-4 text-slate-600"}):(0,S.jsx)(un,{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)(Du,{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 MD({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)(Es,{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)(Qa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ja,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Es,{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 ND({sessions:e}){let t=a=>{let r=a.toLowerCase();return r.includes("mobile")||r.includes("iphone")||r.includes("android")?su:ou};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)(Os,{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)(Qa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ja,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(Os,{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)(Ms,{className:"h-3 w-3"}),a.location]})]})]}),(0,S.jsx)("div",{className:"text-xs text-gray-500",children:a.time})]})},r)})})})]})}function OD({stats:e}){return(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Qa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ja,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(iu,{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:wp(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 FD({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)(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 top customers data"})]})}):(0,S.jsxs)(Ct,{className:"border-gray-200 shadow-sm bg-white overflow-hidden",children:[(0,S.jsx)(Qa,{className:"pb-2 border-b border-gray-100",children:(0,S.jsxs)(Ja,{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[(0,S.jsx)(cn,{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"?wp(t.revenue):t.revenue})]})},a))})})]})}function Ik({type:e,data:t}){if(!t)return null;switch(e){case"subscription":return(0,S.jsx)(RD,{subscription:t});case"subscriptions":let a=t.subscriptions||t||[];return(0,S.jsx)(_D,{subscriptions:Array.isArray(a)?a:[a]});case"customer":return(0,S.jsx)(ED,{customer:t.customer||t});case"customers":let r=t.customers||t||[];return(0,S.jsx)(DD,{customers:Array.isArray(r)?r:[r]});case"transactions":let o=t.transactions||t||[];return(0,S.jsx)(Lk,{transactions:Array.isArray(o)?o:[o]});case"transaction":return(0,S.jsx)(Lk,{transactions:[t],maxItems:1});case"dashboard_stats":return(0,S.jsx)(OD,{stats:t});case"top_customers":let n=t.customers||t||[];return(0,S.jsx)(FD,{customers:Array.isArray(n)?n:[n]});case"api_keys":let s=t.api_keys||t||[];return(0,S.jsx)(MD,{apiKeys:Array.isArray(s)?s:[s]});case"sessions":let i=t.sessions||t||[];return(0,S.jsx)(ND,{sessions:Array.isArray(i)?i:[i]});default:return null}}var Tn=D(ue(),1);function bk({className:e=""}){return(0,Tn.jsx)("div",{className:`flex items-center gap-1 px-4 py-3 ${e}`,children:(0,Tn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Tn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms",animationDuration:"600ms"}}),(0,Tn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms",animationDuration:"600ms"}}),(0,Tn.jsx)("span",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms",animationDuration:"600ms"}})]})})}var p=D(ue(),1);var BD="http://localhost:5002",Cp=400,UD=600;function VD(e){return e.replace(/\\\\n/g,`
|
|
24
24
|
`).replace(/\\\\t/g," ").replace(/\\\\"/g,'"').replace(/\\\\\\\\/g,"\\").replace(/\\n/g,`
|
|
25
|
-
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function
|
|
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
|
|
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,C=i(c[2]),L=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:L,children:C},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 jD=[{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"}],bk=[{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?"}]}],qy={"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}}]}},qD=[];function HD(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(Pt,{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 zD({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)(gr,{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 $D({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=FD,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:m,supabaseUrl:x,supabaseAnonKey:C,initialCorner:L="bottom-left",onCornerChange:h,productBackendUrl:y}={}){let[g,w]=F.useState(qD),[I,P]=F.useState(""),[A,R]=F.useState(L),[q,U]=F.useState(!1),pe=By(),ue=F.useCallback((v,k)=>{pe.set({x:0,y:0}),U(!1);let D=window.innerWidth,E=k.point.x<D/2?"bottom-left":"bottom-right";E!==A&&(R(E),h?.(E))},[A,h,pe]),[Le,Qa]=F.useState(()=>crypto.randomUUID()),[Ja,Tr]=F.useState(null),Re=Ck({agentUrl:i,orgId:c||""}),Oe=Re.config?.productBackendUrl||y,{authState:de,retry:Ar}=wk({productBackendUrl:Oe,sessionId:Le,enabled:!!Oe&&Re.status==="success"});F.useEffect(()=>{if(!Oe||Re.status!=="success")return;(async()=>{let k=`${Oe}/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 M=await D.json();console.log("[KiteChat TEST] SUCCESS - product backend reachable, data:",M)}else{let M=await D.text();console.log("[KiteChat TEST] FAILED - status:",D.status,"body:",M)}}catch(D){console.error("[KiteChat TEST] ERROR:",D)}})()},[Oe,Re.status]);let zt=F.useMemo(()=>Ja||(de.status==="authenticated"?{userId:de.user.id,userName:de.user.name,userEmail:de.user.email,userRole:de.user.role,isInternal:de.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:m||"Not provided",userRole:void 0,isInternal:!1}),[Ja,de,d,f,m]);F.useEffect(()=>{de.status==="authenticated"&&Ja===null&&(Tr({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,Ja]);let Tk=F.useMemo(()=>Oe?de.status==="loading"||de.status==="idle":!1,[Oe,de.status]),[pt,zy]=F.useState(!1),ga=F.useRef(null),[Ak,bp]=F.useState(!1),na=F.useRef(null),Po=F.useRef(null),Ai=F.useRef(null);F.useEffect(()=>{console.log(`[KiteChat] Chat Panel v${OD} loaded`)},[]);let kp=F.useCallback(()=>{console.log("[KiteChat] resetSession called",{isEscalated:pt,hasSupabase:!!na.current,sessionId:Le}),pt&&na.current&&Le?(console.log("[KiteChat] Updating customer_status to disconnected for session:",Le),na.current.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",Le).then(v=>{console.log("[KiteChat] Disconnect update result:",v)},v=>{console.error("[KiteChat] Disconnect update failed:",v)})):console.log("[KiteChat] Skipping disconnect update - conditions not met"),Tr(null),Qa(crypto.randomUUID()),zy(!1),ga.current&&(ga.current.close(),ga.current=null),bp(!1),Po.current&&(Po.current.unsubscribe(),Po.current=null)},[pt,Le]);F.useEffect(()=>{x&&C&&!na.current&&(na.current=YC(x,C))},[x,C]),F.useEffect(()=>{if(!pt||!Le||!na.current)return;let v=`typing:${Le}`,k=na.current.channel(v);return console.log(`[KiteChat] Subscribing to typing channel: ${v}`),k.on("broadcast",{event:"typing"},D=>{console.log("[KiteChat] Received typing broadcast:",D);let{sender:M,isTyping:E}=D.payload;M==="agent"&&(console.log(`[KiteChat] Agent typing: ${E}`),bp(E),E&&(Ai.current&&window.clearTimeout(Ai.current),Ai.current=window.setTimeout(()=>{bp(!1)},5e3)))}).subscribe(D=>{console.log(`[KiteChat] Typing channel status: ${D}`),D==="SUBSCRIBED"&&(Po.current=k,console.log("[KiteChat] Typing channel ready"))}),()=>{k.unsubscribe(),Po.current=null,Ai.current&&window.clearTimeout(Ai.current)}},[pt,Le]);let Nu=F.useRef(null),Rr=F.useCallback(async v=>{if(!(!na.current||!Le))try{await na.current.from("escalations").update({customer_status:v,customer_last_seen:new Date().toISOString()}).eq("session_id",Le)}catch(k){console.error("[KiteChat] Failed to update customer status:",k)}},[Le]);F.useEffect(()=>{if(!pt||!Le||!na.current)return;let v=Le,k=na.current;Rr("active"),Nu.current=window.setInterval(()=>{Rr("active")},6e4);let D=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v)},M=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v):document.visibilityState==="visible"&&Rr("active")};return window.addEventListener("beforeunload",D),document.addEventListener("visibilitychange",M),()=>{window.removeEventListener("beforeunload",D),document.removeEventListener("visibilitychange",M),k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{console.log("[KiteChat] Marked customer as disconnected")},E=>{console.error("[KiteChat] Failed to mark disconnected:",E)}),Nu.current&&(window.clearInterval(Nu.current),Nu.current=null)}},[pt,Le,Rr]);let Ou=F.useCallback(v=>{if(!Po.current){console.log("[KiteChat] Cannot send typing - channel not ready");return}if(!pt){console.log("[KiteChat] Cannot send typing - not escalated");return}console.log(`[KiteChat] Sending typing indicator: ${v}`),Po.current.send({type:"broadcast",event:"typing",payload:{sender:"user",isTyping:v}})},[pt]),En=F.useRef(null),Rk=F.useCallback(()=>{!pt||!na.current||(Ou(!0),Rr("active"),En.current&&window.clearTimeout(En.current),En.current=window.setTimeout(()=>{Ou(!1)},1500))},[pt,Ou,Rr]),Dn=F.useRef({}),$y=g.length===0,[Mn,xe]=F.useState("idle"),[_k,Ie]=F.useState([]),_r=F.useRef([]),Ek=g.length?g[g.length-1].role:void 0,[Pp,To]=F.useState("landing"),[Wy,Ao]=F.useState(void 0),[Dk,Gy]=F.useState(l||jD),[Mk,Ky]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Ky(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Gy(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>Ky(!1)))},[u,l]),F.useEffect(()=>{l&&Gy(l)},[l]);let[ge,Er]=F.useState(void 0),Fe=F.useRef(void 0),Xy=F.useRef(null),[Ri,_i]=F.useState(!1);F.useEffect(()=>{window.resetIntegrationNotification=()=>{localStorage.removeItem("gmailNotificationSeen"),console.log("Integration notification reset! Click the Integrations tab to see it again.")};let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){To("landing"),Ao(void 0);let D=Date.now(),M="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(J=>[...J,E]),Ya(D,M),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),F.useEffect(()=>{ge?(!Fe.current||Fe.current.id!==ge.id||Fe.current.stepIndex!==ge.stepIndex)&&(Fe.current=ge):Fe.current=void 0},[ge]);let[Ei,Fu]=F.useState(null),[Qe,Tp]=F.useState(null),[oe,ne]=F.useState({}),Qy=F.useRef(null),Ap=F.useRef(null),Bu=F.useRef(null),{cursorState:Uu,moveTo:Ro,hide:Nn}=vk(),[_o,Rp]=F.useState(null),[Jy,Dr]=F.useState(null),_p=F.useRef(null),On=F.useRef(null),[Yy,Di]=F.useState(!1),[Fn,Vu]=F.useState(""),Zy=F.useRef(null);F.useEffect(()=>{if(!ge||ge.id!=="add-api-key"||ge.stepIndex!==2)return;let k=setInterval(()=>{let D=document.querySelector('[role="dialog"]'),M=Fe.current;if(D&&M&&M.id==="add-api-key"&&M.stepIndex===2){Nn();let E=Date.now()+1;w(J=>[...J,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Er(void 0),_i(!0)}},300);return()=>clearInterval(k)},[ge,Nn]),F.useEffect(()=>()=>{Object.values(Dn.current).forEach(v=>window.clearInterval(v)),Dn.current={},_r.current.forEach(v=>window.clearTimeout(v)),_r.current=[]},[]),F.useEffect(()=>{if(ge&&g.length>0){let v=g[g.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Bu.current&&Ap.current){let k=Ap.current,D=Bu.current,M=k.getBoundingClientRect(),J=D.getBoundingClientRect().top-M.top+k.scrollTop;k.scrollTop=J}}else!ge&&g.length>0&&Qy.current?.scrollIntoView({behavior:"smooth"})},[g,Mn,ge]);let ex=F.useMemo(()=>{for(let v=g.length-1;v>=0;v--){let k=g[v];if(k.kind==="bulkSummary"&&k.bulkSummary?.navigationPage&&k.bulkSummary.successes>0)return k.bulkSummary.navigationPage}return null},[g]);F.useEffect(()=>{Xy.current=ex},[ex]),F.useEffect(()=>{_p.current=Jy},[Jy]),F.useEffect(()=>{let v=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let D=_p.current;if(D){k.preventDefault(),k.stopPropagation(),Mp(D);return}if(Qe){k.preventDefault(),k.stopPropagation(),Dp();return}if(Ei){k.preventDefault(),k.stopPropagation(),Ep(Ei);return}let M=Xy.current;if(console.log("[DEBUG] Keyboard handler - latestBulkSummaryNavigation:",M,"onNavigate:",!!o),M&&o){console.log("[DEBUG] Navigating via keyboard to:",M.page),k.preventDefault(),k.stopPropagation(),o(M.page,M.subtab);return}if(Ri){k.preventDefault(),k.stopPropagation(),ax();return}if(Fe.current){k.preventDefault(),k.stopPropagation(),Np();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Qe,Ei,ge,Ri,o]);let tx=F.useCallback(v=>{if(!i)return;ga.current&&ga.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,D=new WebSocket(k);D.onmessage=M=>{try{let E=JSON.parse(M.data);E.type==="agent_message"?w(J=>{let X=E.content,T=E.message_id;return(T?J.some(b=>b.serverMessageId===T):J.slice(-5).some(b=>b.content===X))?(console.debug("[KiteChat] Skipping duplicate agent message:",T||X.slice(0,30)),J):[...J,{id:Date.now(),role:"agent",kind:"text",content:X,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=M=>{console.error("[KiteChat] Escalation WebSocket error:",M)},D.onclose=()=>{console.log("[KiteChat] Escalation WebSocket closed")},ga.current=D},[i]),Nk=F.useCallback(async v=>{if(!ga.current||ga.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return ga.current.send(JSON.stringify({type:"user_message",content:v})),Rr("active"),!0}catch(k){return console.error("[KiteChat] Failed to send escalated message:",k),!1}},[Rr]);F.useEffect(()=>()=>{ga.current&&ga.current.close()},[]),F.useEffect(()=>{pt&&Le&&tx(Le)},[pt,Le,tx]);function Ya(v,k,D){let M=k||"",E=D;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let O=0,b=0;for(let G=0;G<k.length;G++)if(k[G]==="{")O++;else if(k[G]==="}"&&(O--,O===0)){b=G+1;break}let K=b>0?k.slice(0,b):k,te=JSON.parse(K);te.response&&typeof te.response=="string"&&(M=te.response,!E&&te.followups&&(E=te.followups))}catch{}M=UD(M);let J=M.split(" "),X=0,T=window.setInterval(()=>{X+=1,w(O=>O.map(b=>b.id===v?{...b,content:J.slice(0,X).join(" ")}:b)),X>=J.length&&(window.clearInterval(T),delete Dn.current[v],E&&E.length>0&&w(O=>O.map(b=>b.id===v?{...b,followups:E}:b)),xe("idle"))},25);Dn.current[v]=T}function Ok(v,k){w(D=>D.map(M=>M.id===v?{...M,followupSelected:!0}:M)),ju(k.label)}function ax(){Object.values(Dn.current).forEach(v=>window.clearInterval(v)),Dn.current={},_r.current.forEach(v=>window.clearTimeout(v)),_r.current=[],Nn(),kp(),w([]),P(""),xe("idle"),To("landing"),Ao(void 0),Er(void 0),_i(!1),Fu(null),Tp(null),ne({}),r&&r()}function QD(v){To("folder"),Ao(v)}function Fk(){To("landing"),Ao(void 0)}function Bk(v){v.preventDefault();let k=I.trim();if(_o){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(M=>[...M,D]);return}Vk(k,_o),P(""),Rp(null),On.current&&(On.current.value="");return}if(k){if(pt){let D={id:Date.now(),role:"user",content:k};w(M=>[...M,D]),Nk(k),Ou(!1),En.current&&(window.clearTimeout(En.current),En.current=null),P("");return}ju(k),P("")}}function Uk(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 D={general:"General",billing:"Billing",security:"Security",api:"API Keys",notifications:"Notifications",integrations:"Integrations"};return`${k.settings} (${D[v.subtab]} tab)`}return k[v.page]}function Ep(v){o&&o(v.page,v.subtab),Fu(null),w(k=>k.map(D=>D.kind==="navigationAction"&&D.navigationTarget?.page===v.page&&D.navigationTarget?.subtab===v.subtab?{...D,navigationTarget:void 0}:D))}function Dp(){if(!Qe)return;let v=oe;if(Qe.type!=="updateCompanyInfo"){if(Qe.type==="addApiKey"){let k=v;if(!k.name||!k.name.trim())return}else if(Qe.type==="addCustomer"){let k=v;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Qe.type==="changePassword"){let k=v;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Qe.type==="addWebhook"){let k=v;if(!k.url||!k.url.trim())return}else if(Qe.type==="addPaymentMethod"){let k=v;if(!k.cardNumber||!k.expiryDate)return}else if(Qe.type==="deleteApiKey"){let k=v;if(!k.keyId&&!k.name)return}else if(Qe.type==="refundPayment"){let k=v;if(!k.transactionId&&!k.customer)return}else if(Qe.type==="createSubscription"){let k=v;if(!k.customerEmail&&!k.customerId)return}else if((Qe.type==="toggleBlockRule"||Qe.type==="enableBlockRule"||Qe.type==="disableBlockRule")&&!v.ruleId)return}n&&n(Qe.type,v),w(k=>k.map(D=>D.kind==="actionForm"&&D.actionType===Qe.type?{...D,isSubmitted:!0}:D)),Tp(null),ne({})}async function ju(v){_r.current.forEach(X=>window.clearTimeout(X)),_r.current=[];let D=[...g].reverse().find(X=>X.role==="assistant")?.isNotificationMessage===!0,M=Date.now(),E={id:M,role:"user",content:v};if(w(X=>X.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(E)),D){let X=Date.now()+1,T={id:X,role:"assistant",kind:"text",content:""};w(O=>[...O,T]),Ya(X,"Thank you, your feedback is saved.");return}Fu(null),xe("thinking"),Ie([]);let J=!1;try{let X=new AbortController,T=setTimeout(()=>X.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:",zt.userId),console.log("[ChatPanel] user_name:",zt.userName),console.log("[ChatPanel] user_email:",zt.userEmail),console.log("[ChatPanel] org_id:",c),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:Le,message:v,current_page:s||"dashboard",user_id:d,org_id:c,user_name:f,user_email:m}),signal:X.signal});if(clearTimeout(T),!O.ok)throw new Error(`Agent request failed: ${O.status}`);let b=O.body?.getReader();if(!b)throw new Error("No response body");let K=new TextDecoder,te="";for(;;){let{done:G,value:me}=await b.read();if(G)break;te+=K.decode(me,{stream:!0});let Je=te.split(`
|
|
25
|
+
`).replace(/\\t/g," ").replace(/\\"/g,'"').replace(/\\\\/g,"\\")}function jD(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 I=c.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(I){d.push((0,p.jsx)("a",{href:I[2],className:"kite-link",target:"_blank",rel:"noopener noreferrer",children:I[1]},f++)),c=c.slice(I[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]),I=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:I,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 qD=[{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"}],kk=[{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?"}]}],qy={"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}}]}},HD=[];function zD(){return(0,p.jsxs)("div",{className:"flex flex-col items-center justify-center h-full p-6",children:[(0,p.jsx)(At,{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 $D({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)(yr,{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)(tt,{variant:"secondary",size:"sm",onClick:t,className:"h-8 px-4 text-xs",children:"Try Again"})]})}function WD({isOpen:e=!0,onClose:t,onOpen:a,onBack:r,onNavigate:o,onActionComplete:n,currentPage:s,agentUrl:i=BD,startingQuestions:l,startingQuestionsEndpoint:u,userId:d,orgId:c,userName:f,userEmail:m,supabaseUrl:x,supabaseAnonKey:w,initialCorner:I="bottom-left",onCornerChange:h,productBackendUrl:g,getAuthHeaders:y}={}){let[C,L]=F.useState(HD),[P,A]=F.useState(""),[R,q]=F.useState(I),[V,pe]=F.useState(!1),le=Fy(),An=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,Pi]=F.useState(()=>crypto.randomUUID()),[ha,Be]=F.useState(null),ot=Sk({agentUrl:i,orgId:c||""}),mt=ot.config?.productBackendUrl||g,{authState:xe,retry:ga}=wk({productBackendUrl:mt,sessionId:oe,enabled:!!mt&&ot.status==="success"}),{executeToolRequest:Ak}=Ck({productBackendUrl:mt||"",agentUrl:i,sessionId:oe}),JD=F.useMemo(()=>ha||(xe.status==="authenticated"?{userId:xe.user.id,userName:xe.user.name,userEmail:xe.user.email,userRole:xe.user.role,isInternal:xe.user.isInternal}:{userId:d||"anonymous",userName:f||"Anonymous User",userEmail:m||"Not provided",userRole:void 0,isInternal:!1}),[ha,xe,d,f,m]);F.useEffect(()=>{xe.status==="authenticated"&&ha===null&&Be({userId:xe.user.id,userName:xe.user.name,userEmail:xe.user.email,userRole:xe.user.role,isInternal:xe.user.isInternal})},[xe,ha]);let Rk=F.useMemo(()=>mt?xe.status==="loading"||xe.status==="idle":!1,[mt,xe.status]),[nt,zy]=F.useState(!1),ya=F.useRef(null),[_k,Ip]=F.useState(!1),ht=F.useRef(null),Io=F.useRef(null),Ti=F.useRef(null),bp=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)}),Be(null),Pi(crypto.randomUUID()),zy(!1),ya.current&&(ya.current.close(),ya.current=null),Ip(!1),Io.current&&(Io.current.unsubscribe(),Io.current=null)},[nt,oe]);F.useEffect(()=>{x&&w&&!ht.current&&(ht.current=YS(x,w))},[x,w]),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:M,isTyping:E}=O.payload;M==="agent"&&(Ip(E),E&&(Ti.current&&window.clearTimeout(Ti.current),Ti.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,Ti.current&&window.clearTimeout(Ti.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 Mu=F.useRef(null),YD=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=()=>{k.from("escalations").update({customer_status:"active",customer_last_seen:new Date().toISOString()}).eq("session_id",v).then(()=>{},G=>console.error("[KiteChat] Failed to update customer status:",G))};console.log("[KiteChat] Starting presence heartbeat for live chat"),O(),Mu.current=window.setInterval(()=>{O()},6e4);let M=()=>{k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v)},E=()=>{document.visibilityState==="hidden"?k.from("escalations").update({customer_status:"disconnected",customer_last_seen:new Date().toISOString()}).eq("session_id",v):document.visibilityState==="visible"&&O()};return window.addEventListener("beforeunload",M),document.addEventListener("visibilitychange",E),()=>{window.removeEventListener("beforeunload",M),document.removeEventListener("visibilitychange",E),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"),G=>{console.error("[KiteChat] Failed to mark disconnected:",G)}),Mu.current&&(window.clearInterval(Mu.current),Mu.current=null)}},[nt,oe]);let Nu=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]),Rn=F.useRef(null),Ek=F.useCallback(()=>{!nt||!ht.current||!oe||(Nu(!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)),Rn.current&&window.clearTimeout(Rn.current),Rn.current=window.setTimeout(()=>{Nu(!1)},1500))},[nt,Nu,oe]),_n=F.useRef({}),$y=C.length===0,[En,ve]=F.useState("idle"),[Dk,Ie]=F.useState([]),Tr=F.useRef([]),Mk=C.length?C[C.length-1].role:void 0,[kp,bo]=F.useState("landing"),[Wy,ko]=F.useState(void 0),[Nk,Gy]=F.useState(l||qD),[Ok,Ky]=F.useState(!1);F.useEffect(()=>{u&&!l&&(Ky(!0),fetch(u).then(v=>v.json()).then(v=>{Array.isArray(v)&&v.length>0&&Gy(v)}).catch(v=>{console.warn("[KiteChat] Failed to fetch starting questions:",v)}).finally(()=>Ky(!1)))},[u,l]),F.useEffect(()=>{l&&Gy(l)},[l]);let[ge,Ar]=F.useState(void 0),Ne=F.useRef(void 0),Xy=F.useRef(null),[Ai,Ri]=F.useState(!1);F.useEffect(()=>{let v=()=>{if(!localStorage.getItem("gmailNotificationSeen")){bo("landing"),ko(void 0);let O=Date.now(),M="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(G=>[...G,E]),Za(O,M),localStorage.setItem("gmailNotificationSeen","true")}};return window.addEventListener("integrationTabClicked",v),()=>{window.removeEventListener("integrationTabClicked",v)}},[]),F.useEffect(()=>{ge?(!Ne.current||Ne.current.id!==ge.id||Ne.current.stepIndex!==ge.stepIndex)&&(Ne.current=ge):Ne.current=void 0},[ge]);let[_i,Ou]=F.useState(null),[Qe,Pp]=F.useState(null),[ne,se]=F.useState({}),Qy=F.useRef(null),Tp=F.useRef(null),Fu=F.useRef(null),{cursorState:Bu,moveTo:Po,hide:Dn}=vk(),[To,Ap]=F.useState(null),[Jy,Rr]=F.useState(null),Rp=F.useRef(null),Mn=F.useRef(null),[Yy,Ei]=F.useState(!1),[Nn,Uu]=F.useState(""),Zy=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"]'),M=Ne.current;if(O&&M&&M.id==="add-api-key"&&M.stepIndex===2){Dn();let E=Date.now()+1;L(G=>[...G,{id:E,role:"assistant",kind:"guideComplete",content:"Perfect! The dialog is now open. You can enter a name and create your API key."}]),Ar(void 0),Ri(!0)}},300);return()=>clearInterval(k)},[ge,Dn]),F.useEffect(()=>()=>{Object.values(_n.current).forEach(v=>window.clearInterval(v)),_n.current={},Tr.current.forEach(v=>window.clearTimeout(v)),Tr.current=[]},[]),F.useEffect(()=>{if(ge&&C.length>0){let v=C[C.length-1];if((v.kind==="guideStep"||v.kind==="guideComplete")&&Fu.current&&Tp.current){let k=Tp.current,O=Fu.current,M=k.getBoundingClientRect(),G=O.getBoundingClientRect().top-M.top+k.scrollTop;k.scrollTop=G}}else!ge&&C.length>0&&Qy.current?.scrollIntoView({behavior:"smooth"})},[C,En,ge]);let ex=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(()=>{Xy.current=ex},[ex]),F.useEffect(()=>{Rp.current=Jy},[Jy]),F.useEffect(()=>{let v=k=>{if((k.metaKey||k.ctrlKey)&&k.key==="Enter"){let O=Rp.current;if(O){k.preventDefault(),k.stopPropagation(),Dp(O);return}if(Qe){k.preventDefault(),k.stopPropagation(),Ep();return}if(_i){k.preventDefault(),k.stopPropagation(),_p(_i);return}let M=Xy.current;if(M&&o){k.preventDefault(),k.stopPropagation(),o(M.page,M.subtab);return}if(Ai){k.preventDefault(),k.stopPropagation(),ax();return}if(Ne.current){k.preventDefault(),k.stopPropagation(),Mp();return}}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[Qe,_i,ge,Ai,o]);let tx=F.useCallback(v=>{if(!i)return;ya.current&&ya.current.close();let k=i.replace(/^http/,"ws")+`/ws/escalation/${v}`,O=new WebSocket(k);O.onmessage=M=>{try{let E=JSON.parse(M.data);E.type==="agent_message"?L(G=>{let X=E.content,T=E.message_id;return(T?G.some(b=>b.serverMessageId===T):G.slice(-5).some(b=>b.content===X))?G:[...G,{id:Date.now(),role:"agent",kind:"text",content:X,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=M=>{console.error("[KiteChat] Escalation WebSocket error:",M)},O.onclose=()=>{},ya.current=O},[i]),Fk=F.useCallback(async v=>{if(!ya.current||ya.current.readyState!==WebSocket.OPEN)return console.error("[KiteChat] Escalation WebSocket not connected"),!1;try{return ya.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(()=>()=>{ya.current&&ya.current.close()},[]),F.useEffect(()=>{nt&&oe&&tx(oe)},[nt,oe,tx]);function Za(v,k,O){let M=k||"",E=O;if(k&&k.startsWith("{")&&k.includes('"response"'))try{let N=0,b=0;for(let K=0;K<k.length;K++)if(k[K]==="{")N++;else if(k[K]==="}"&&(N--,N===0)){b=K+1;break}let Q=b>0?k.slice(0,b):k,ae=JSON.parse(Q);ae.response&&typeof ae.response=="string"&&(M=ae.response,!E&&ae.followups&&(E=ae.followups))}catch{}M=VD(M);let G=M.split(" "),X=0,T=window.setInterval(()=>{X+=1,L(N=>N.map(b=>b.id===v?{...b,content:G.slice(0,X).join(" ")}:b)),X>=G.length&&(window.clearInterval(T),delete _n.current[v],E&&E.length>0&&L(N=>N.map(b=>b.id===v?{...b,followups:E}:b)),ve("idle"))},25);_n.current[v]=T}function Bk(v,k){L(O=>O.map(M=>M.id===v?{...M,followupSelected:!0}:M)),Vu(k.label)}function ax(){Object.values(_n.current).forEach(v=>window.clearInterval(v)),_n.current={},Tr.current.forEach(v=>window.clearTimeout(v)),Tr.current=[],Dn(),bp(),L([]),A(""),ve("idle"),bo("landing"),ko(void 0),Ar(void 0),Ri(!1),Ou(null),Pp(null),se({}),r&&r()}function ZD(v){bo("folder"),ko(v)}function Uk(){bo("landing"),ko(void 0)}function Vk(v){v.preventDefault();let k=P.trim();if(To){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(M=>[...M,O]);return}qk(k,To),A(""),Ap(null),Mn.current&&(Mn.current.value="");return}if(k){if(nt){let O={id:Date.now(),role:"user",content:k};L(M=>[...M,O]),Fk(k),Nu(!1),Rn.current&&(window.clearTimeout(Rn.current),Rn.current=null),A("");return}Vu(k),A("")}}function jk(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 _p(v){o&&o(v.page,v.subtab),Ou(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 Ep(){if(!Qe)return;let v=ne;if(Qe.type!=="updateCompanyInfo"){if(Qe.type==="addApiKey"){let k=v;if(!k.name||!k.name.trim())return}else if(Qe.type==="addCustomer"){let k=v;if(!k.name||!k.name.trim()||!k.email||!k.email.trim())return}else if(Qe.type==="changePassword"){let k=v;if(!k.currentPassword||!k.newPassword||!k.confirmPassword||k.newPassword!==k.confirmPassword)return}else if(Qe.type==="addWebhook"){let k=v;if(!k.url||!k.url.trim())return}else if(Qe.type==="addPaymentMethod"){let k=v;if(!k.cardNumber||!k.expiryDate)return}else if(Qe.type==="deleteApiKey"){let k=v;if(!k.keyId&&!k.name)return}else if(Qe.type==="refundPayment"){let k=v;if(!k.transactionId&&!k.customer)return}else if(Qe.type==="createSubscription"){let k=v;if(!k.customerEmail&&!k.customerId)return}else if((Qe.type==="toggleBlockRule"||Qe.type==="enableBlockRule"||Qe.type==="disableBlockRule")&&!v.ruleId)return}n&&n(Qe.type,v),L(k=>k.map(O=>O.kind==="actionForm"&&O.actionType===Qe.type?{...O,isSubmitted:!0}:O)),Pp(null),se({})}async function Vu(v){Tr.current.forEach(X=>window.clearTimeout(X)),Tr.current=[];let O=[...C].reverse().find(X=>X.role==="assistant")?.isNotificationMessage===!0,M=Date.now(),E={id:M,role:"user",content:v};if(L(X=>X.map(T=>T.followups&&T.followups.length>0?{...T,followupSelected:!0}:T).concat(E)),O){let X=Date.now()+1,T={id:X,role:"assistant",kind:"text",content:""};L(N=>[...N,T]),Za(X,"Thank you, your feedback is saved.");return}Ou(null),ve("thinking"),Ie([]);let G=!1;try{let X=new AbortController,T=setTimeout(()=>X.abort(),6e4),N=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:X.signal});if(clearTimeout(T),!N.ok)throw new Error(`Agent request failed: ${N.status}`);let b=N.body?.getReader();if(!b)throw new Error("No response body");let Q=new TextDecoder,ae="";for(;;){let{done:K,value:me}=await b.read();if(K)break;ae+=Q.decode(me,{stream:!0});let Je=ae.split(`
|
|
28
28
|
|
|
29
|
-
`);
|
|
30
|
-
`),
|
|
29
|
+
`);ae=Je.pop()||"";for(let It of Je){if(!It.trim())continue;let er=It.split(`
|
|
30
|
+
`),We="",xa="";for(let z of er)z.startsWith("event: ")?We=z.slice(7):z.startsWith("data: ")&&(xa=z.slice(6));if(!(!We||!xa))try{let z=JSON.parse(xa);if(We==="progress")z.status==="thinking"?(ve("thinking"),Ie([{message:z.message,completed:!1}])):z.status==="searching"?(ve("thinking"),Ie([{message:z.message||"Searching knowledge base...",completed:!1}])):z.status==="evaluating"?(ve("thinking"),Ie([{message:z.message||"Evaluating sources...",completed:!1}])):z.status==="executing"?(ve("executing"),Ie(j=>{let ee=j.map(Et=>({...Et,completed:!0})),ce=ee[ee.length-1];return(!ce||ce.message!==z.message)&&ee.push({message:z.message,completed:!1}),ee})):z.status==="responding"&&(ve("responding"),Ie(j=>j.map(ee=>({...ee,completed:!0}))));else if(We==="response"){Ie([]),G=!0;let j=z;if(j.action==="navigate"&&j.navigation){let ee={page:j.navigation.page,subtab:j.navigation.subtab};Ou(ee);let ce={id:M+1,role:"assistant",kind:"navigationAction",content:j.response||`I can take you to the ${jk(ee)}.`,navigationTarget:ee};L(Et=>[...Et,ce]),ve("idle")}else if(j.action==="show_form"&&j.actionType){Pp({type:j.actionType,data:j.actionData||{}}),se(j.actionData||{});let ee={id:M+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]),ve("idle")}else if(j.action==="suggest_bulk"){let ee=M+1,ce={id:ee,role:"assistant",kind:"text",content:""};L(Et=>[...Et,ce]),Za(ee,j.response||j.message||"For bulk operations, you can upload a CSV file - just click the \u{1F4CE} button!",j.followups),G=!0}else if(j.action==="bulk_preview"){Rr(j.bulk_session_id);let ee={id:M+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]),ve("idle"),G=!0}else if(j.action==="execute"&&j.executionResult){let ee=M+1,ce={id:ee,role:"assistant",kind:"text",content:"",structuredData:j.structuredData||void 0};L(Et=>[...Et,ce]),Za(ee,j.response||"Action completed successfully.",j.followups),G=!0,setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:j.executionResult}}))},100)}else{let ee=M+1,ce={id:ee,role:"assistant",kind:"text",content:""};L(Et=>[...Et,ce]),Za(ee,j.response||j.message||"",j.followups),G=!0}}else if(We==="error"){ve("idle"),Ie([]),G=!0;let j=M+1,ee={id:j,role:"assistant",kind:"text",content:""};L(ce=>[...ce,ee]),Za(j,z.message||"An error occurred processing your request.")}else if(We==="done")Ie([]),ve("idle"),G=!0;else if(We==="escalation"){zy(!0),ve("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 We==="tool_request"&&Ak(z).catch(ee=>{console.error("[KiteChat] Tool execution failed:",ee)})}catch(z){console.error("Failed to parse SSE event:",z)}}}Ie([]),G||ve("idle")}catch(X){console.error("Agent request failed:",X),Ie([]);let T=M+1,N={id:T,role:"assistant",kind:"text",content:""};L(Q=>[...Q,N]);let b="I'm having trouble connecting to my backend.";X instanceof Error&&(X.name==="AbortError"?b="The request timed out. The server might be busy - please try again.":X.message.includes("Failed to fetch")||X.message.includes("NetworkError")?b="I'm having trouble connecting to my backend. Please make sure the agent server is running on port 5002.":X.message.includes("Agent request failed:")&&(b="The server encountered an error. Please try again.")),b+=" For simple navigation requests, I can still help you locally.",Za(T,b)}finally{Ie([])}}async function qk(v,k){Tr.current.forEach(E=>window.clearTimeout(E)),Tr.current=[];let O=Date.now(),M={id:O,role:"user",content:`\u{1F4CE} ${k.name}
|
|
31
31
|
|
|
32
|
-
${v}`};
|
|
32
|
+
${v}`};L(E=>[...E,M]),ve("thinking"),Ie([{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 G=new AbortController,X=setTimeout(()=>G.abort(),12e4),T=await fetch(`${i}/chat/bulk/stream`,{method:"POST",body:E,signal:G.signal});if(clearTimeout(X),!T.ok)throw new Error(`Bulk upload failed: ${T.status}`);let N=T.body?.getReader();if(!N)throw new Error("No response body");let b=new TextDecoder,Q="",ae=null;for(;;){let{done:K,value:me}=await N.read();if(K)break;Q+=b.decode(me,{stream:!0});let Je=Q.split(`
|
|
33
33
|
|
|
34
|
-
`);
|
|
35
|
-
`),
|
|
34
|
+
`);Q=Je.pop()||"";for(let It of Je){if(!It.trim())continue;let er=It.split(`
|
|
35
|
+
`),We="",xa="";for(let z of er)z.startsWith("event: ")?We=z.slice(7):z.startsWith("data: ")&&(xa=z.slice(6));if(!(!We||!xa))try{let z=JSON.parse(xa);if(We==="preview"){ve("idle"),Ie([]),ae=z.bulk_session_id,Rr(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(We==="progress")ve("executing"),Ie([{message:`Processing row ${z.row} of ${z.total}...`,completed:!1}]),L(j=>j[j.length-1]?.kind==="bulkProgress"?j.map((ce,Et)=>Et===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(We==="summary")ve("idle"),Ie([]),Rr(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(We==="error"){ve("idle"),Ie([]),Rr(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 We==="done"&&(ve("idle"),Ie([]))}catch(z){console.error("Failed to parse bulk SSE event:",z)}}}Ie([]),ve("idle")}catch(E){console.error("Bulk upload failed:",E),Ie([]),ve("idle");let G="I'm having trouble processing your CSV file.";E instanceof Error&&(E.name==="AbortError"?G="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")?G="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:")&&(G="The server encountered an error processing your CSV file. Please try again.")),G+=" Please try again.";let X={id:O+1,role:"assistant",kind:"text",content:G};L(T=>[...T,X])}}async function Dp(v){ve("executing"),Ie([{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 M=new TextDecoder,E="";for(;;){let{done:G,value:X}=await O.read();if(G)break;E+=M.decode(X,{stream:!0});let T=E.split(`
|
|
36
36
|
|
|
37
|
-
`);E=T.pop()||"";for(let
|
|
38
|
-
`),K="",te="";for(let G of b)G.startsWith("event: ")?K=G.slice(7):G.startsWith("data: ")&&(te=G.slice(6));if(!(!K||!te))try{let G=JSON.parse(te);if(K==="progress")Ie([{message:`Processing row ${G.row} of ${G.total}...`,completed:!1}]),w(me=>me[me.length-1]?.kind==="bulkProgress"?me.map((mt,Za)=>Za===me.length-1?{...mt,bulkProgress:{processed:G.row,total:G.total,successes:G.successes||0,failures:G.failures||0}}:mt):[...me,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:G.row,total:G.total,successes:G.successes||0,failures:G.failures||0}}]);else if(K==="summary")console.log("[DEBUG] Received summary event - data:",G),console.log("[DEBUG] navigationPage from backend:",G.navigationPage),xe("idle"),Ie([]),Dr(null),w(me=>{let Je=me.filter(Za=>Za.kind!=="bulkProgress"&&Za.kind!=="bulkPreview"),mt={id:Date.now(),role:"assistant",kind:"bulkSummary",content:G.message,bulkSummary:{total:G.total,successes:G.successes,failures:G.failures||[],navigationPage:G.navigationPage}};return console.log("[DEBUG] Creating bulkSummary message:",mt),[...Je,mt]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:G.total,successes:G.successes}}}))},100);else if(K==="error"){xe("idle"),Ie([]),Dr(null);let me={id:Date.now(),role:"assistant",kind:"text",content:G.message||"An error occurred during bulk processing."};w(Je=>[...Je,me])}}catch(G){console.error("Failed to parse confirm SSE event:",G)}}}}catch(k){console.error("Bulk confirm failed:",k),xe("idle"),Ie([]),Dr(null);let D={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};w(M=>[...M,D])}}function jk(){Dr(null),w(v=>v.filter(k=>k.kind!=="bulkPreview"))}function rx(v){ju(v)}function qk(v){let k=Date.now()+Math.floor(Math.random()*1e3);w(D=>[...D,{id:k,role:"assistant",kind:"text",content:v}])}function JD(v){let k=qy[v];if(!k)return;To("landing"),Ao(void 0);let D={id:v,stepIndex:0};Er(D),Fe.current=D,qk(`I'll help you with ${k.title}.`);let M=k.steps[0],E=M.cursorTarget?.selector.includes("[data-page="),J=M.cursorTarget?.selector.includes("[data-settings-tab=");if(M.cursorTarget&&(E||J)){let T=M.cursorTarget;J&&M.navigation&&o&&o(M.navigation.page,void 0),setTimeout(()=>{let b=()=>{let K=document.querySelector(T.selector);K&&K.offsetParent!==null?(Ro(T),T.onClick&&setTimeout(()=>{K.click()},1200)):setTimeout(b,200)};b()},J?800:400)}else if(M.navigation&&o&&o(M.navigation.page,M.navigation.subtab),M.cursorTarget){let T=M.cursorTarget,O=T.selector.includes("data-settings-tab"),b=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let te=()=>{let G=document.querySelector(T.selector);G&&G.offsetParent!==null?(Ro(T),T.onClick&&setTimeout(()=>{G.click()},1e3)):O||b?setTimeout(te,200):(Ro(T),T.onClick&&setTimeout(()=>{let me=document.querySelector(T.selector);me&&me.click()},1e3))};te()},b?700:O?600:400)}let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};w(T=>[...T,X]),Ya(X.id,M.text)}function Np(){if(!ge)return;let v=qy[ge.id];if(!v)return;let k=Fe.current;(!k||k.id!==ge.id)&&(k=ge,Fe.current=ge);let M=k.stepIndex+1;if(M>=v.steps.length){Nn();let b=Date.now()+1;w(K=>[...K,{id:b,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Er(void 0),_i(!0);return}let E=v.steps[M],J={id:ge.id,stepIndex:M};Er(J),Fe.current=J;let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:M};w(b=>[...b,X]);let T=E.cursorTarget?.selector.includes("[data-page="),O=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(T||O)){let b=E.cursorTarget;O&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let te=Fe.current;if(!te||te.id!==v.id||te.stepIndex!==M)return;let G=()=>{let me=Fe.current;if(!me||me.id!==v.id||me.stepIndex!==M)return;let Je=document.querySelector(b.selector);Je&&Je.offsetParent!==null?(Ro(b),b.onClick&&setTimeout(()=>{let mt=Fe.current;!mt||mt.id!==v.id||mt.stepIndex!==M||Je.click()},1200)):setTimeout(G,200)};G()},O?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let b=E.cursorTarget,K=b.selector.includes("dialog")||b.selector.includes("api-key-name-input"),te=b.selector.includes("data-settings-tab"),G=E.navigation?.subtab&&te&&b.selector.includes(`data-settings-tab="${E.navigation.subtab}"`),me=b.onClick&&!G,Je=!!E.navigation,Ye=(!!E.navigation?.subtab?700:Je?400:0)+(K?700:te?600:400);setTimeout(()=>{let ya=Fe.current;if(!ya||ya.id!==v.id||ya.stepIndex!==M)return;let z=()=>{let j=Fe.current;if(!j||j.id!==v.id||j.stepIndex!==M)return;let ae=document.querySelector(b.selector);ae&&ae.offsetParent!==null?(Ro(b),me&&setTimeout(()=>{let ce=Fe.current;!ce||ce.id!==v.id||ce.stepIndex!==M||ae.click()},1e3)):K||te||b.selector.includes("data-testid")?setTimeout(z,200):(Ro(b),me&&setTimeout(()=>{let ce=Fe.current;if(!ce||ce.id!==v.id||ce.stepIndex!==M)return;let Rt=document.querySelector(b.selector);Rt&&Rt.click()},1e3))};z()},Ye)}else Nn();Ya(X.id,E.text)}function Hk(){if(!ge)return;let v=qy[ge.id];if(!v)return;let k=ge.stepIndex-1;if(k>=0){Er({id:ge.id,stepIndex:k});let D=v.steps[k];D.navigation&&o&&o(D.navigation.page,D.navigation.subtab),D.cursorTarget?setTimeout(()=>{Ro(D.cursorTarget)},500):Nn();let M=g.filter(E=>E.kind!=="guideStep"&&E.kind!=="guideComplete");w([...M,{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 ${Yy?"w-[480px]":"w-[320px]"}`,children:Yy?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("input",{ref:Zy,type:"text",value:Fn,onChange:v=>Vu(v.target.value),onKeyDown:v=>{v.key==="Enter"&&Fn.trim()?(v.preventDefault(),a?.(),ju(Fn.trim()),Vu(""),Di(!1)):v.key==="Escape"&&(Di(!1),Vu(""))},onBlur:()=>{Fn.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?.(),Fn.trim()&&P(Fn),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)(Zt,{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(()=>Zy.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)(Zt,{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:`${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)(Zt,{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)(gr,{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)(Pt,{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(Oe){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:`${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)(Zt,{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)(gn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(HD,{})]});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:`${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)(Zt,{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)(gn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(zD,{error:de.error,onRetry:Ar})]})}return(0,p.jsxs)(Eu.section,{drag:!0,dragMomentum:!1,dragElastic:0,animate:pe,onDragStart:()=>U(!0),onDragEnd:ue,className:`fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${q?"cursor-grabbing":""} ${A==="bottom-left"?"left-4":"right-4"} ${e?"opacity-100 scale-100":"opacity-0 scale-95 pointer-events-none"}`,style:{width:`${Lp}px`,height:`${BD}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)(Zt,{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(),w([]),To("landing"),Ao(void 0),Er(void 0),Fe.current=void 0,_i(!1)},children:(0,p.jsx)(Bt,{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:()=>{pt&&(kp(),w([]),To("landing"),Ao(void 0),Er(void 0),Fe.current=void 0,_i(!1)),t?.()},children:(0,p.jsx)(gn,{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:Pp==="folder"?bk.find(v=>v.id===Wy)?.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:Mk?(0,p.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,p.jsx)(Pt,{className:"h-4 w-4 animate-spin text-gray-400"})}):Dk.map((v,k)=>{let D=["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:()=>rx(v.prompt),children:[(0,p.jsx)("span",{className:`mr-2 inline-block h-1.5 w-1.5 rounded-full ${D[k%D.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:Fk,"aria-label":"Back to suggestions",children:(0,p.jsx)(Es,{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:bk.find(v=>v.id===Wy)?.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:()=>rx(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:[g.map((v,k)=>{let D=v.role==="user",M=k>0?g[k-1].role:void 0,E=M!==void 0&&M!==v.role,J=Fe.current||ge,X=!1;if(J&&v.kind==="guideStep"?v.guideStepIndex!==void 0?X=v.guideStepIndex===J.stepIndex:X=k===g.length-1:v.kind==="guideComplete"&&(X=k===g.length-1),v.kind==="guideStep"&&!X)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: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)(yk,{title:v.title??"Search results",links:v.links??[]})},v.id);if(v.kind==="guideComplete")return(0,p.jsx)("div",{ref:X?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)(mr,{className:"h-3 w-3"}),(0,p.jsx)(hr,{className:"h-3 w-3"})]})]})})]},v.id);if(v.kind==="actionForm"){let T=v.actionType,O=Object.keys(oe).length>0?oe:v.actionData||{};if(v.isSubmitted){let b="";return T==="updateCompanyInfo"?b="Company information has been updated successfully.":T==="addApiKey"?b="API key has been added successfully.":T==="addCustomer"?b="Customer has been added successfully.":T==="enable2FA"?b="Two-factor authentication has been enabled successfully.":T==="disable2FA"?b="Two-factor authentication has been disabled successfully.":T==="changePassword"?b="Your password has been changed successfully.":T==="revokeSession"?b="Session has been revoked successfully.":T==="toggleNotification"?b="Notification preferences have been updated successfully.":T==="connectIntegration"?b="Integration has been connected successfully.":T==="disconnectIntegration"?b="Integration has been disconnected successfully.":T==="addPaymentMethod"?b="Payment method has been added successfully.":T==="removePaymentMethod"?b="Payment method has been removed successfully.":T==="deleteApiKey"?b="API key has been deleted successfully.":T==="addWebhook"?b="Webhook endpoint has been added successfully.":T==="updateCurrency"?b="Currency preference has been updated successfully.":T==="updateTimezone"?b="Timezone has been updated successfully.":T==="refundPayment"?b="Refund has been processed successfully.":T==="exportCertificate"?b="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?b="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?b="Block rule has been updated successfully.":b="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:b})},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)(Ne,{placeholder:"Acme Corporation",value:O.companyName||"",onChange:b=>ne({...oe,companyName:b.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)(Ne,{type:"email",placeholder:"contact@acme.com",value:O.email||"",onChange:b=>ne({...oe,email:b.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)(Ne,{placeholder:"123 Main St, San Francisco, CA",value:O.address||"",onChange:b=>ne({...oe,address:b.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)(Ne,{type:"tel",placeholder:"+1 (555) 123-4567",value:O.phone||"",onChange:b=>ne({...oe,phone:b.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)(Ne,{type:"url",placeholder:"https://acme.com",value:O.website||"",onChange:b=>ne({...oe,website:b.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)(Ne,{placeholder:"Production Key",value:O.name||"",onChange:b=>ne({...oe,name:b.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)(Ne,{placeholder:"Acme Corporation",value:O.name||"",onChange:b=>ne({...oe,name:b.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)(Ne,{type:"email",placeholder:"contact@acme.com",value:O.email||"",onChange:b=>ne({...oe,email:b.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)(Ne,{placeholder:"San Francisco, CA",value:O.location||"",onChange:b=>ne({...oe,location:b.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:b=>ne({...oe,subscription:b.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)(Ne,{type:"password",value:O.currentPassword||"",onChange:b=>ne({...oe,currentPassword:b.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)(Ne,{type:"password",value:O.newPassword||"",onChange:b=>ne({...oe,newPassword:b.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)(Ne,{type:"password",value:O.confirmPassword||"",onChange:b=>ne({...oe,confirmPassword:b.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:b=>ne({...oe,notificationType:b.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:b=>ne({...oe,enabled:b.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:b=>ne({...oe,integrationName:b.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)(Ne,{placeholder:"1234 5678 9012 3456",value:O.cardNumber||"",onChange:b=>ne({...oe,cardNumber:b.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)(Ne,{placeholder:"MM/YY",value:O.expiryDate||"",onChange:b=>ne({...oe,expiryDate:b.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)(Ne,{placeholder:"e.g., txn_1234 or Acme Corp",value:O.transactionId||O.customer||"",onChange:b=>{let K=b.target.value;K.startsWith("txn_")||/^\d+$/.test(K)?ne({...oe,transactionId:K,customer:void 0}):ne({...oe,customer:K,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)(Ne,{placeholder:"$0.00",value:O.amount||"",onChange:b=>ne({...oe,amount:b.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)(Ne,{placeholder:"e.g., Customer request",value:O.reason||"",onChange:b=>ne({...oe,reason:b.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)(Ne,{placeholder:"Production Key",value:O.keyId||O.name||"",onChange:b=>ne({...oe,keyId:b.target.value,name:b.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)(Ne,{type:"url",placeholder:"https://example.com/webhook",value:O.url||"",onChange:b=>ne({...oe,url:b.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)(Ne,{placeholder:"Production Webhook",value:O.name||"",onChange:b=>ne({...oe,name:b.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:b=>ne({...oe,currency:b.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:b=>ne({...oe,timezone:b.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)(Ne,{placeholder:"MacBook Pro",value:O.device||"",onChange:b=>ne({...oe,device:b.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)(Ne,{type:"email",placeholder:"customer@example.com",value:O.customerEmail||"",onChange:b=>ne({...oe,customerEmail:b.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:b=>ne({...oe,plan:b.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:b=>ne({...oe,billingCycle:b.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:b=>ne({...oe,format:b.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:b=>ne({...oe,ruleId:b.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)(mr,{className:"h-3 w-3"}),(0,p.jsx)(hr,{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)(Ds,{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,O)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},O))})]}),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,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(([b,K],te)=>(0,p.jsxs)("span",{children:[te>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[b,":"]})," ",K]},b)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},O))})]}),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)(mr,{className:"h-3 w-3"}),(0,p.jsx)(hr,{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:jk,children:"Cancel"})]})]},v.id);if(v.kind==="bulkProgress"&&v.bulkProgress){let{processed:T,total:O,successes:b,failures:K}=v.bulkProgress,te=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)(Pt,{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:`${te}%`}})}),(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"}),b," successful"]}),K>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(gr,{className:"h-3 w-3"}),K," failed"]})]})]})},v.id)}if(v.kind==="bulkSummary"&&v.bulkSummary){let{total:T,successes:O,failures:b,navigationPage:K}=v.bulkSummary,te=b.length>0,G=K?.page==="customers"?"Customers":K?.page==="dashboard"?"Dashboard":K?.page==="settings"?"Settings":"Results";return(0,p.jsx)("div",{className:`${E?"mt-3":""}`,children:(0,p.jsxs)("div",{className:`rounded-lg border p-3 ${te?"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 ${te?"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: ${O} successful${te?`, ${b.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"}),O," successful"]}),te&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(gr,{className:"h-3 w-3"}),b.length," failed"]})]}),te&&(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:[b.slice(0,5).map((me,Je)=>(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"]},Je)),b.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",b.length-5," more"]})]})]}),K&&O>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(),console.log("[DEBUG] Button clicked - navigationPage:",K,"onNavigate:",!!o),o&&K.page?(console.log("[DEBUG] Calling onNavigate with page:",K.page),o(K.page,K.subtab)):console.log("[DEBUG] Condition failed - onNavigate:",!!o,"navigationPage.page:",K.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)(mr,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(hr,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",G]})]})})]})},v.id)}return(0,p.jsx)(F.Fragment,{children:(0,p.jsxs)("div",{ref:X?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 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 v.role==="assistant"&&T?VD(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)(Lk,{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:()=>Ok(v.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
37
|
+
`);E=T.pop()||"";for(let N of T){if(!N.trim())continue;let b=N.split(`
|
|
38
|
+
`),Q="",ae="";for(let K of b)K.startsWith("event: ")?Q=K.slice(7):K.startsWith("data: ")&&(ae=K.slice(6));if(!(!Q||!ae))try{let K=JSON.parse(ae);if(Q==="progress")Ie([{message:`Processing row ${K.row} of ${K.total}...`,completed:!1}]),L(me=>me[me.length-1]?.kind==="bulkProgress"?me.map((It,er)=>er===me.length-1?{...It,bulkProgress:{processed:K.row,total:K.total,successes:K.successes||0,failures:K.failures||0}}:It):[...me,{id:Date.now(),role:"assistant",kind:"bulkProgress",bulkProgress:{processed:K.row,total:K.total,successes:K.successes||0,failures:K.failures||0}}]);else if(Q==="summary")ve("idle"),Ie([]),Rr(null),L(me=>{let Je=me.filter(er=>er.kind!=="bulkProgress"&&er.kind!=="bulkPreview"),It={id:Date.now(),role:"assistant",kind:"bulkSummary",content:K.message,bulkSummary:{total:K.total,successes:K.successes,failures:K.failures||[],navigationPage:K.navigationPage}};return[...Je,It]}),setTimeout(()=>{window.dispatchEvent(new CustomEvent("agentActionComplete",{detail:{result:{bulk:!0,total:K.total,successes:K.successes}}}))},100);else if(Q==="error"){ve("idle"),Ie([]),Rr(null);let me={id:Date.now(),role:"assistant",kind:"text",content:K.message||"An error occurred during bulk processing."};L(Je=>[...Je,me])}}catch(K){console.error("Failed to parse confirm SSE event:",K)}}}}catch(k){console.error("Bulk confirm failed:",k),ve("idle"),Ie([]),Rr(null);let O={id:Date.now(),role:"assistant",kind:"text",content:"Failed to start bulk operation. Please try again."};L(M=>[...M,O])}}function Hk(){Rr(null),L(v=>v.filter(k=>k.kind!=="bulkPreview"))}function rx(v){Vu(v)}function zk(v){let k=Date.now()+Math.floor(Math.random()*1e3);L(O=>[...O,{id:k,role:"assistant",kind:"text",content:v}])}function eM(v){let k=qy[v];if(!k)return;bo("landing"),ko(void 0);let O={id:v,stepIndex:0};Ar(O),Ne.current=O,zk(`I'll help you with ${k.title}.`);let M=k.steps[0],E=M.cursorTarget?.selector.includes("[data-page="),G=M.cursorTarget?.selector.includes("[data-settings-tab=");if(M.cursorTarget&&(E||G)){let T=M.cursorTarget;G&&M.navigation&&o&&o(M.navigation.page,void 0),setTimeout(()=>{let b=()=>{let Q=document.querySelector(T.selector);Q&&Q.offsetParent!==null?(Po(T),T.onClick&&setTimeout(()=>{Q.click()},1200)):setTimeout(b,200)};b()},G?800:400)}else if(M.navigation&&o&&o(M.navigation.page,M.navigation.subtab),M.cursorTarget){let T=M.cursorTarget,N=T.selector.includes("data-settings-tab"),b=T.selector.includes("dialog")||T.selector.includes("api-key-name-input");setTimeout(()=>{let ae=()=>{let K=document.querySelector(T.selector);K&&K.offsetParent!==null?(Po(T),T.onClick&&setTimeout(()=>{K.click()},1e3)):N||b?setTimeout(ae,200):(Po(T),T.onClick&&setTimeout(()=>{let me=document.querySelector(T.selector);me&&me.click()},1e3))};ae()},b?700:N?600:400)}let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:0};L(T=>[...T,X]),Za(X.id,M.text)}function Mp(){if(!ge)return;let v=qy[ge.id];if(!v)return;let k=Ne.current;(!k||k.id!==ge.id)&&(k=ge,Ne.current=ge);let M=k.stepIndex+1;if(M>=v.steps.length){Dn();let b=Date.now()+1;L(Q=>[...Q,{id:b,role:"assistant",kind:"guideComplete",content:"Guide Complete"}]),Ar(void 0),Ri(!0);return}let E=v.steps[M],G={id:ge.id,stepIndex:M};Ar(G),Ne.current=G;let X={id:Date.now()+1,role:"assistant",kind:"guideStep",content:"",guideStepIndex:M};L(b=>[...b,X]);let T=E.cursorTarget?.selector.includes("[data-page="),N=E.cursorTarget?.selector.includes("[data-settings-tab=");if(E.cursorTarget&&(T||N)){let b=E.cursorTarget;N&&E.navigation&&o&&o(E.navigation.page,void 0),setTimeout(()=>{let ae=Ne.current;if(!ae||ae.id!==v.id||ae.stepIndex!==M)return;let K=()=>{let me=Ne.current;if(!me||me.id!==v.id||me.stepIndex!==M)return;let Je=document.querySelector(b.selector);Je&&Je.offsetParent!==null?(Po(b),b.onClick&&setTimeout(()=>{let It=Ne.current;!It||It.id!==v.id||It.stepIndex!==M||Je.click()},1200)):setTimeout(K,200)};K()},N?800:400)}else if(E.navigation&&o&&o(E.navigation.page,E.navigation.subtab),E.cursorTarget){let b=E.cursorTarget,Q=b.selector.includes("dialog")||b.selector.includes("api-key-name-input"),ae=b.selector.includes("data-settings-tab"),K=E.navigation?.subtab&&ae&&b.selector.includes(`data-settings-tab="${E.navigation.subtab}"`),me=b.onClick&&!K,Je=!!E.navigation,We=(!!E.navigation?.subtab?700:Je?400:0)+(Q?700:ae?600:400);setTimeout(()=>{let xa=Ne.current;if(!xa||xa.id!==v.id||xa.stepIndex!==M)return;let z=()=>{let j=Ne.current;if(!j||j.id!==v.id||j.stepIndex!==M)return;let ee=document.querySelector(b.selector);ee&&ee.offsetParent!==null?(Po(b),me&&setTimeout(()=>{let ce=Ne.current;!ce||ce.id!==v.id||ce.stepIndex!==M||ee.click()},1e3)):Q||ae||b.selector.includes("data-testid")?setTimeout(z,200):(Po(b),me&&setTimeout(()=>{let ce=Ne.current;if(!ce||ce.id!==v.id||ce.stepIndex!==M)return;let Et=document.querySelector(b.selector);Et&&Et.click()},1e3))};z()},We)}else Dn();Za(X.id,E.text)}function $k(){if(!ge)return;let v=qy[ge.id];if(!v)return;let k=ge.stepIndex-1;if(k>=0){Ar({id:ge.id,stepIndex:k});let O=v.steps[k];O.navigation&&o&&o(O.navigation.page,O.navigation.subtab),O.cursorTarget?setTimeout(()=>{Po(O.cursorTarget)},500):Dn();let M=C.filter(E=>E.kind!=="guideStep"&&E.kind!=="guideComplete");L([...M,{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 ${Yy?"w-[480px]":"w-[320px]"}`,children:Yy?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("input",{ref:Zy,type:"text",value:Nn,onChange:v=>Uu(v.target.value),onKeyDown:v=>{v.key==="Enter"&&Nn.trim()?(v.preventDefault(),a?.(),Vu(Nn.trim()),Uu(""),Ei(!1)):v.key==="Escape"&&(Ei(!1),Uu(""))},onBlur:()=>{Nn.trim()||setTimeout(()=>Ei(!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?.(),Nn.trim()&&A(Nn),Uu(""),Ei(!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)(Zt,{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:()=>{Ei(!0),setTimeout(()=>Zy.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)(Zt,{className:"h-3.5 w-3.5 text-black",fill:"currentColor"})})]})})});if(ot.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:`${Cp}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)(Zt,{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)(tt,{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)(yr,{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)(At,{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(xe.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:`${Cp}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)(Zt,{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)(tt,{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)(pn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)(zD,{})]});if(xe.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:`${Cp}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)(Zt,{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)(tt,{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)(pn,{className:"h-3.5 w-3.5"})})]}),(0,p.jsx)($D,{error:xe.error,onRetry:ga})]})}return(0,p.jsxs)(_u.section,{drag:!0,dragMomentum:!1,dragElastic:0,animate:le,onDragStart:()=>pe(!0),onDragEnd:An,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:`${Cp}px`,height:`${UD}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)(Zt,{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)(tt,{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:()=>{bp(),L([]),bo("landing"),ko(void 0),Ar(void 0),Ne.current=void 0,Ri(!1)},children:(0,p.jsx)(Vt,{className:"h-3 w-3"})}),(0,p.jsx)(tt,{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&&(bp(),L([]),bo("landing"),ko(void 0),Ar(void 0),Ne.current=void 0,Ri(!1)),t?.()},children:(0,p.jsx)(pn,{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:kp==="folder"?kk.find(v=>v.id===Wy)?.title||"":"How can I help?"})}),(0,p.jsxs)("div",{className:"pb-4 px-4",children:[kp==="landing"&&(0,p.jsx)(p.Fragment,{children:(0,p.jsx)("div",{className:"flex flex-col gap-1",children:Ok?(0,p.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,p.jsx)(At,{className:"h-4 w-4 animate-spin text-gray-400"})}):Nk.map((v,k)=>{let O=["bg-blue-400","bg-green-400","bg-purple-400","bg-orange-400","bg-pink-400"];return(0,p.jsxs)(tt,{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:()=>rx(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)})})}),kp==="folder"&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,p.jsx)(tt,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 rounded-full hover:bg-gray-100",onClick:Uk,"aria-label":"Back to suggestions",children:(0,p.jsx)(Rs,{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:kk.find(v=>v.id===Wy)?.topics.map(v=>(0,p.jsx)(tt,{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:()=>rx(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)(Mg,{ref:Tp,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",M=k>0?C[k-1].role:void 0,E=M!==void 0&&M!==v.role,G=Ne.current||ge,X=!1;if(G&&v.kind==="guideStep"?v.guideStepIndex!==void 0?X=v.guideStepIndex===G.stepIndex:X=k===C.length-1:v.kind==="guideComplete"&&(X=k===C.length-1),v.kind==="guideStep"&&!X)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)(yk,{title:v.title??"Search results",links:v.links??[]})},v.id);if(v.kind==="guideComplete")return(0,p.jsx)("div",{ref:X?Fu: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)(at,{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)(tt,{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&&_p(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)(hr,{className:"h-3 w-3"}),(0,p.jsx)(gr,{className:"h-3 w-3"})]})]})})]},v.id);if(v.kind==="actionForm"){let T=v.actionType,N=Object.keys(ne).length>0?ne:v.actionData||{};if(v.isSubmitted){let b="";return T==="updateCompanyInfo"?b="Company information has been updated successfully.":T==="addApiKey"?b="API key has been added successfully.":T==="addCustomer"?b="Customer has been added successfully.":T==="enable2FA"?b="Two-factor authentication has been enabled successfully.":T==="disable2FA"?b="Two-factor authentication has been disabled successfully.":T==="changePassword"?b="Your password has been changed successfully.":T==="revokeSession"?b="Session has been revoked successfully.":T==="toggleNotification"?b="Notification preferences have been updated successfully.":T==="connectIntegration"?b="Integration has been connected successfully.":T==="disconnectIntegration"?b="Integration has been disconnected successfully.":T==="addPaymentMethod"?b="Payment method has been added successfully.":T==="removePaymentMethod"?b="Payment method has been removed successfully.":T==="deleteApiKey"?b="API key has been deleted successfully.":T==="addWebhook"?b="Webhook endpoint has been added successfully.":T==="updateCurrency"?b="Currency preference has been updated successfully.":T==="updateTimezone"?b="Timezone has been updated successfully.":T==="refundPayment"?b="Refund has been processed successfully.":T==="exportCertificate"?b="Certificate of Incorporation has been downloaded successfully.":T==="createSubscription"?b="Subscription has been created successfully.":T==="toggleBlockRule"||T==="enableBlockRule"||T==="disableBlockRule"?b="Block rule has been updated successfully.":b="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:b})},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)(Me,{placeholder:"Acme Corporation",value:N.companyName||"",onChange:b=>se({...ne,companyName:b.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)(Me,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:b=>se({...ne,email:b.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)(Me,{placeholder:"123 Main St, San Francisco, CA",value:N.address||"",onChange:b=>se({...ne,address:b.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)(Me,{type:"tel",placeholder:"+1 (555) 123-4567",value:N.phone||"",onChange:b=>se({...ne,phone:b.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)(Me,{type:"url",placeholder:"https://acme.com",value:N.website||"",onChange:b=>se({...ne,website:b.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)(Me,{placeholder:"Production Key",value:N.name||"",onChange:b=>se({...ne,name:b.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)(Me,{placeholder:"Acme Corporation",value:N.name||"",onChange:b=>se({...ne,name:b.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)(Me,{type:"email",placeholder:"contact@acme.com",value:N.email||"",onChange:b=>se({...ne,email:b.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)(Me,{placeholder:"San Francisco, CA",value:N.location||"",onChange:b=>se({...ne,location:b.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:N.subscription||"Starter",onChange:b=>se({...ne,subscription:b.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)(Me,{type:"password",value:N.currentPassword||"",onChange:b=>se({...ne,currentPassword:b.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)(Me,{type:"password",value:N.newPassword||"",onChange:b=>se({...ne,newPassword:b.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)(Me,{type:"password",value:N.confirmPassword||"",onChange:b=>se({...ne,confirmPassword:b.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:N.notificationType||"paymentReceived",onChange:b=>se({...ne,notificationType:b.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:N.enabled!==!1,onChange:b=>se({...ne,enabled:b.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:N.integrationName||"Slack",onChange:b=>se({...ne,integrationName:b.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)(Me,{placeholder:"1234 5678 9012 3456",value:N.cardNumber||"",onChange:b=>se({...ne,cardNumber:b.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)(Me,{placeholder:"MM/YY",value:N.expiryDate||"",onChange:b=>se({...ne,expiryDate:b.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)(Me,{placeholder:"e.g., txn_1234 or Acme Corp",value:N.transactionId||N.customer||"",onChange:b=>{let Q=b.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)(Me,{placeholder:"$0.00",value:N.amount||"",onChange:b=>se({...ne,amount:b.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)(Me,{placeholder:"e.g., Customer request",value:N.reason||"",onChange:b=>se({...ne,reason:b.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)(Me,{placeholder:"Production Key",value:N.keyId||N.name||"",onChange:b=>se({...ne,keyId:b.target.value,name:b.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)(Me,{type:"url",placeholder:"https://example.com/webhook",value:N.url||"",onChange:b=>se({...ne,url:b.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)(Me,{placeholder:"Production Webhook",value:N.name||"",onChange:b=>se({...ne,name:b.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:N.currency||"USD",onChange:b=>se({...ne,currency:b.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:N.timezone||"America/Los_Angeles",onChange:b=>se({...ne,timezone:b.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)(Me,{placeholder:"MacBook Pro",value:N.device||"",onChange:b=>se({...ne,device:b.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)(Me,{type:"email",placeholder:"customer@example.com",value:N.customerEmail||"",onChange:b=>se({...ne,customerEmail:b.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:N.plan||"Starter",onChange:b=>se({...ne,plan:b.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:N.billingCycle||"monthly",onChange:b=>se({...ne,billingCycle:b.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:N.format||"pdf",onChange:b=>se({...ne,format:b.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:N.ruleId||"rule_1",onChange:b=>se({...ne,ruleId:b.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)(tt,{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:Ep,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)(hr,{className:"h-3 w-3"}),(0,p.jsx)(gr,{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)(_s,{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,N)=>(0,p.jsx)("span",{className:"text-xs bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",children:T},N))})]}),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,N)=>(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(([b,Q],ae)=>(0,p.jsxs)("span",{children:[ae>0&&" \u2022 ",(0,p.jsxs)("span",{className:"text-gray-400",children:[b,":"]})," ",Q]},b)),Object.keys(T).length>3&&(0,p.jsxs)("span",{className:"text-gray-400",children:[" ","..."]})]},N))})]}),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)(tt,{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&&Dp(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)(hr,{className:"h-3 w-3"}),(0,p.jsx)(gr,{className:"h-3 w-3"})]})]}),(0,p.jsx)(tt,{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:Hk,children:"Cancel"})]})]},v.id);if(v.kind==="bulkProgress"&&v.bulkProgress){let{processed:T,total:N,successes:b,failures:Q}=v.bulkProgress,ae=Math.round(T/N*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)(At,{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 ",N]})]}),(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)(at,{className:"h-3 w-3 text-green-600"}),b," successful"]}),Q>0&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(yr,{className:"h-3 w-3"}),Q," failed"]})]})]})},v.id)}if(v.kind==="bulkSummary"&&v.bulkSummary){let{total:T,successes:N,failures:b,navigationPage:Q}=v.bulkSummary,ae=b.length>0,K=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)(at,{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: ${N} successful${ae?`, ${b.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)(at,{className:"h-3 w-3"}),N," successful"]}),ae&&(0,p.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,p.jsx)(yr,{className:"h-3 w-3"}),b.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:[b.slice(0,5).map((me,Je)=>(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"]},Je)),b.length>5&&(0,p.jsxs)("div",{className:"text-xs text-amber-600",children:["...and ",b.length-5," more"]})]})]}),Q&&N>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)(hr,{className:"h-2.5 w-2.5"}),(0,p.jsx)("span",{children:"+"}),(0,p.jsx)(gr,{className:"h-2.5 w-2.5"})]}),(0,p.jsxs)("span",{children:["View ",K]})]})})]})},v.id)}return(0,p.jsx)(F.Fragment,{children:(0,p.jsxs)("div",{ref:X?Fu: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 N=T.match(/^(Step\s+\d+:)([\s\S]*)/);if(N)return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("strong",{children:N[1]}),N[2]]})}return v.role==="assistant"&&T?jD(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:()=>Bk(v.id,T),className:`inline-flex items-center px-3 py-1.5 text-xs font-medium rounded-xl
|
|
39
39
|
bg-white hover:bg-gray-50 text-gray-600 hover:text-gray-800
|
|
40
40
|
border border-gray-200 hover:border-gray-300 shadow-sm
|
|
41
|
-
transition-all duration-150 ease-in-out`,children:T.label},T.id))})]})},v.id)}),(ge||
|
|
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),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||Ai)&&(0,p.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[ge&&ge.stepIndex>0&&(0,p.jsx)(tt,{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:$k,children:(0,p.jsx)(Rs,{className:"h-3.5 w-3.5 text-gray-600"})}),(0,p.jsxs)(tt,{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:Ai?ax:Mp,children:[(0,p.jsx)("span",{children:Ai?"Done":"Next"}),(0,p.jsxs)("span",{className:"flex items-center gap-0.5 text-gray-400",children:[(0,p.jsx)(hr,{className:"h-3 w-3"}),(0,p.jsx)(gr,{className:"h-3 w-3"})]})]})]}),(En==="thinking"||En==="searching"||En==="executing"||En==="responding")&&(0,p.jsx)("div",{className:`${Mk==="user"?"mt-3":""}`,children:(0,p.jsx)(hk,{phase:En,progressSteps:Dk})}),nt&&_k&&(0,p.jsx)("div",{className:"mt-2",children:(0,p.jsx)(bk,{})}),!ge&&(0,p.jsx)("div",{ref:Qy})]})})})})}),(0,p.jsxs)("div",{className:"px-4 py-3 bg-white shrink-0",children:[To&&(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)(_s,{className:"h-4 w-4 text-blue-600"}),(0,p.jsx)("span",{className:"text-xs text-blue-700 flex-1 truncate",children:To.name}),(0,p.jsx)("button",{type:"button",onClick:()=>{Ap(null),Mn.current&&(Mn.current.value="")},className:"text-blue-600 hover:text-blue-800",children:(0,p.jsx)(yr,{className:"h-4 w-4"})})]}),(0,p.jsxs)("form",{onSubmit:Vk,className:"w-full",children:[(0,p.jsx)("input",{ref:Mn,type:"file",accept:".csv",className:"hidden",onChange:v=>{let k=v.target.files?.[0];k&&Ap(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)(tt,{type:"button",size:"icon",variant:"ghost",onClick:()=>Mn.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)(nu,{className:"h-2.5 w-2.5"})}),(0,p.jsx)("textarea",{placeholder:To?"Describe what to do with this CSV...":"Ask anything...",value:P,onChange:v=>{A(v.target.value),v.target.value.length>0&&Ek()},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()||To){let k=v.currentTarget.closest("form");k&&k.requestSubmit()}return}if((v.metaKey||v.ctrlKey)&&v.key==="Enter"){let k=Rp.current;if(k){v.preventDefault(),v.stopPropagation(),Dp(k);return}if(Qe){v.preventDefault(),v.stopPropagation(),Ep();return}if(_i){v.preventDefault(),v.stopPropagation(),_p(_i);return}if(Ne.current){v.preventDefault(),v.stopPropagation(),Mp();return}}}}),(0,p.jsx)(tt,{type:"submit",size:"icon",disabled:!P.trim()&&!To||Rk,className:"h-6 w-6 rounded-full bg-gray-900 hover:bg-gray-800 disabled:bg-gray-300",children:(0,p.jsx)(tu,{className:"h-2.5 w-2.5"})})]})]})]}),(0,p.jsx)(xk,{x:Bu.x,y:Bu.y,visible:Bu.visible,onClick:Bu.onClick})]})}function Pk({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:I,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)(WD,{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:I,productBackendUrl:h,getAuthHeaders:g})}var Hy=D(ue(),1),ki=null,_a=null,oa={};function GD({initialConfig:e}){let[t,a]=(0,Ya.useState)(e),[r,o]=(0,Ya.useState)(e.currentPage||"dashboard"),[n,s]=(0,Ya.useState)(!1),i=(0,Ya.useRef)(!1);return(0,Ya.useEffect)(()=>{i.current=n},[n]),(0,Ya.useEffect)(()=>(oa.setCurrentPage=o,oa.setConfig=l=>a(u=>({...u,...l})),oa.setIsOpen=s,oa.getIsOpen=()=>i.current,()=>{oa={}}),[]),(0,Ya.useEffect)(()=>{t.theme==="dark"?_a?.classList.add("dark"):_a?.classList.remove("dark")},[t.theme]),(0,Hy.jsx)(Pk,{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 KD(){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=`
|
|
43
43
|
#kite-chat-root {
|
|
44
44
|
/* Container is just a mount point - ChatPanel handles its own positioning */
|
|
45
45
|
}
|
|
46
|
-
`,document.head.appendChild(t)}function
|
|
46
|
+
`,document.head.appendChild(t)}function Lp(){let e=window.KiteChatConfig;if(!e){console.error("[KiteChat] Missing window.KiteChatConfig");return}if(!e.userId){console.error("[KiteChat] userId is required");return}if(ki){console.warn("[KiteChat] Already initialized");return}if(KD(),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}_a=document.createElement("div"),_a.id="kite-chat-root",t.appendChild(_a)}else _a=document.createElement("div"),_a.id="kite-chat-root",document.body.appendChild(_a);ki=(0,Tk.createRoot)(_a),ki.render((0,Hy.jsx)(GD,{initialConfig:e})),window.KiteChat=XD()}function XD(){return{setCurrentPage:e=>oa.setCurrentPage?.(e),setUser:e=>oa.setConfig?.({userId:e}),setConfig:e=>oa.setConfig?.(e),open:()=>oa.setIsOpen?.(!0),close:()=>oa.setIsOpen?.(!1),toggle:()=>{let e=oa.getIsOpen?.()??!1;oa.setIsOpen?.(!e)},isOpen:()=>oa.getIsOpen?.()??!1,destroy:()=>{ki?.unmount(),ki=null,_a?.remove(),_a=null,window.KiteChat=void 0},isMounted:()=>ki!==null}}typeof window<"u"&&(window.KiteChatInit=Lp,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Lp):Lp());return sx(QD);})();
|
|
47
47
|
/*! Bundled license information:
|
|
48
48
|
|
|
49
49
|
react/cjs/react.production.min.js:
|