@alfatech/livechat 2026.3.1-5.2 → 2026.3.1-5.3

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/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- var wg=e=>{throw TypeError(e)};var BC=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Zu=(e,t,n)=>t.has(e)||wg("Cannot "+n);var j=(e,t,n)=>(Zu(e,t,"read from private field"),n?n.call(e):t.get(e)),pe=(e,t,n)=>t.has(e)?wg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),le=(e,t,n,r)=>(Zu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),we=(e,t,n)=>(Zu(e,t,"access private method"),n);var fl=(e,t,n,r)=>({set _(i){le(e,t,i,n)},get _(){return j(e,t,r)}});var F6=BC((nn,rn)=>{function $C(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ah=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bx={exports:{}},nu={},$x={exports:{}},Se={};/**
1
+ var xg=e=>{throw TypeError(e)};var BC=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Xu=(e,t,n)=>t.has(e)||xg("Cannot "+n);var j=(e,t,n)=>(Xu(e,t,"read from private field"),n?n.call(e):t.get(e)),pe=(e,t,n)=>t.has(e)?xg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),le=(e,t,n,r)=>(Xu(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),we=(e,t,n)=>(Xu(e,t,"access private method"),n);var fl=(e,t,n,r)=>({set _(i){le(e,t,i,n)},get _(){return j(e,t,r)}});var F6=BC((nn,rn)=>{function $C(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var oh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fx={exports:{}},nu={},Bx={exports:{}},Se={};/**
2
2
  * @license React
3
3
  * react.production.min.js
4
4
  *
@@ -6,7 +6,7 @@ var wg=e=>{throw TypeError(e)};var BC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Xa=Symbol.for("react.element"),zC=Symbol.for("react.portal"),VC=Symbol.for("react.fragment"),UC=Symbol.for("react.strict_mode"),HC=Symbol.for("react.profiler"),WC=Symbol.for("react.provider"),qC=Symbol.for("react.context"),GC=Symbol.for("react.forward_ref"),YC=Symbol.for("react.suspense"),QC=Symbol.for("react.memo"),KC=Symbol.for("react.lazy"),bg=Symbol.iterator;function XC(e){return e===null||typeof e!="object"?null:(e=bg&&e[bg]||e["@@iterator"],typeof e=="function"?e:null)}var zx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vx=Object.assign,Ux={};function bo(e,t,n){this.props=e,this.context=t,this.refs=Ux,this.updater=n||zx}bo.prototype.isReactComponent={};bo.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")};bo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hx(){}Hx.prototype=bo.prototype;function lh(e,t,n){this.props=e,this.context=t,this.refs=Ux,this.updater=n||zx}var ch=lh.prototype=new Hx;ch.constructor=lh;Vx(ch,bo.prototype);ch.isPureReactComponent=!0;var kg=Array.isArray,Wx=Object.prototype.hasOwnProperty,uh={current:null},qx={key:!0,ref:!0,__self:!0,__source:!0};function Gx(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Wx.call(t,r)&&!qx.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Xa,type:e,key:s,ref:o,props:i,_owner:uh.current}}function ZC(e,t){return{$$typeof:Xa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function dh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xa}function JC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Sg=/\/+/g;function Ju(e,t){return typeof e=="object"&&e!==null&&e.key!=null?JC(""+e.key):t.toString(36)}function Ul(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Xa:case zC:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Ju(o,0):r,kg(i)?(n="",e!=null&&(n=e.replace(Sg,"$&/")+"/"),Ul(i,t,n,"",function(u){return u})):i!=null&&(dh(i)&&(i=ZC(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Sg,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",kg(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+Ju(s,a);o+=Ul(s,t,n,l,i)}else if(l=XC(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+Ju(s,a++),o+=Ul(s,t,n,l,i);else if(s==="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 o}function pl(e,t,n){if(e==null)return e;var r=[],i=0;return Ul(e,r,"","",function(s){return t.call(n,s,i++)}),r}function e2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lt={current:null},Hl={transition:null},t2={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:Hl,ReactCurrentOwner:uh};function Yx(){throw Error("act(...) is not supported in production builds of React.")}Se.Children={map:pl,forEach:function(e,t,n){pl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return pl(e,function(){t++}),t},toArray:function(e){return pl(e,function(t){return t})||[]},only:function(e){if(!dh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Se.Component=bo;Se.Fragment=VC;Se.Profiler=HC;Se.PureComponent=lh;Se.StrictMode=UC;Se.Suspense=YC;Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t2;Se.act=Yx;Se.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Vx({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=uh.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Wx.call(t,l)&&!qx.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Xa,type:e.type,key:i,ref:s,props:r,_owner:o}};Se.createContext=function(e){return e={$$typeof:qC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:WC,_context:e},e.Consumer=e};Se.createElement=Gx;Se.createFactory=function(e){var t=Gx.bind(null,e);return t.type=e,t};Se.createRef=function(){return{current:null}};Se.forwardRef=function(e){return{$$typeof:GC,render:e}};Se.isValidElement=dh;Se.lazy=function(e){return{$$typeof:KC,_payload:{_status:-1,_result:e},_init:e2}};Se.memo=function(e,t){return{$$typeof:QC,type:e,compare:t===void 0?null:t}};Se.startTransition=function(e){var t=Hl.transition;Hl.transition={};try{e()}finally{Hl.transition=t}};Se.unstable_act=Yx;Se.useCallback=function(e,t){return Lt.current.useCallback(e,t)};Se.useContext=function(e){return Lt.current.useContext(e)};Se.useDebugValue=function(){};Se.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};Se.useEffect=function(e,t){return Lt.current.useEffect(e,t)};Se.useId=function(){return Lt.current.useId()};Se.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};Se.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};Se.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};Se.useMemo=function(e,t){return Lt.current.useMemo(e,t)};Se.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};Se.useRef=function(e){return Lt.current.useRef(e)};Se.useState=function(e){return Lt.current.useState(e)};Se.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};Se.useTransition=function(){return Lt.current.useTransition()};Se.version="18.3.1";$x.exports=Se;var g=$x.exports;const X=Ar(g),n2=$C({__proto__:null,default:X},[g]);/**
9
+ */var Xa=Symbol.for("react.element"),zC=Symbol.for("react.portal"),VC=Symbol.for("react.fragment"),UC=Symbol.for("react.strict_mode"),HC=Symbol.for("react.profiler"),WC=Symbol.for("react.provider"),qC=Symbol.for("react.context"),GC=Symbol.for("react.forward_ref"),YC=Symbol.for("react.suspense"),QC=Symbol.for("react.memo"),KC=Symbol.for("react.lazy"),wg=Symbol.iterator;function XC(e){return e===null||typeof e!="object"?null:(e=wg&&e[wg]||e["@@iterator"],typeof e=="function"?e:null)}var $x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zx=Object.assign,Vx={};function bo(e,t,n){this.props=e,this.context=t,this.refs=Vx,this.updater=n||$x}bo.prototype.isReactComponent={};bo.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")};bo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ux(){}Ux.prototype=bo.prototype;function ah(e,t,n){this.props=e,this.context=t,this.refs=Vx,this.updater=n||$x}var lh=ah.prototype=new Ux;lh.constructor=ah;zx(lh,bo.prototype);lh.isPureReactComponent=!0;var bg=Array.isArray,Hx=Object.prototype.hasOwnProperty,ch={current:null},Wx={key:!0,ref:!0,__self:!0,__source:!0};function qx(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Hx.call(t,r)&&!Wx.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Xa,type:e,key:s,ref:o,props:i,_owner:ch.current}}function ZC(e,t){return{$$typeof:Xa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function uh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xa}function JC(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var kg=/\/+/g;function Zu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?JC(""+e.key):t.toString(36)}function Ul(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Xa:case zC:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Zu(o,0):r,bg(i)?(n="",e!=null&&(n=e.replace(kg,"$&/")+"/"),Ul(i,t,n,"",function(c){return c})):i!=null&&(uh(i)&&(i=ZC(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(kg,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",bg(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+Zu(s,a);o+=Ul(s,t,n,l,i)}else if(l=XC(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+Zu(s,a++),o+=Ul(s,t,n,l,i);else if(s==="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 o}function pl(e,t,n){if(e==null)return e;var r=[],i=0;return Ul(e,r,"","",function(s){return t.call(n,s,i++)}),r}function e2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lt={current:null},Hl={transition:null},t2={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:Hl,ReactCurrentOwner:ch};function Gx(){throw Error("act(...) is not supported in production builds of React.")}Se.Children={map:pl,forEach:function(e,t,n){pl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return pl(e,function(){t++}),t},toArray:function(e){return pl(e,function(t){return t})||[]},only:function(e){if(!uh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Se.Component=bo;Se.Fragment=VC;Se.Profiler=HC;Se.PureComponent=ah;Se.StrictMode=UC;Se.Suspense=YC;Se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t2;Se.act=Gx;Se.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=zx({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=ch.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Hx.call(t,l)&&!Wx.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Xa,type:e.type,key:i,ref:s,props:r,_owner:o}};Se.createContext=function(e){return e={$$typeof:qC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:WC,_context:e},e.Consumer=e};Se.createElement=qx;Se.createFactory=function(e){var t=qx.bind(null,e);return t.type=e,t};Se.createRef=function(){return{current:null}};Se.forwardRef=function(e){return{$$typeof:GC,render:e}};Se.isValidElement=uh;Se.lazy=function(e){return{$$typeof:KC,_payload:{_status:-1,_result:e},_init:e2}};Se.memo=function(e,t){return{$$typeof:QC,type:e,compare:t===void 0?null:t}};Se.startTransition=function(e){var t=Hl.transition;Hl.transition={};try{e()}finally{Hl.transition=t}};Se.unstable_act=Gx;Se.useCallback=function(e,t){return Lt.current.useCallback(e,t)};Se.useContext=function(e){return Lt.current.useContext(e)};Se.useDebugValue=function(){};Se.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};Se.useEffect=function(e,t){return Lt.current.useEffect(e,t)};Se.useId=function(){return Lt.current.useId()};Se.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};Se.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};Se.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};Se.useMemo=function(e,t){return Lt.current.useMemo(e,t)};Se.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};Se.useRef=function(e){return Lt.current.useRef(e)};Se.useState=function(e){return Lt.current.useState(e)};Se.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};Se.useTransition=function(){return Lt.current.useTransition()};Se.version="18.3.1";Bx.exports=Se;var v=Bx.exports;const X=Rr(v),n2=$C({__proto__:null,default:X},[v]);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -14,7 +14,7 @@ var wg=e=>{throw TypeError(e)};var BC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var r2=g,i2=Symbol.for("react.element"),s2=Symbol.for("react.fragment"),o2=Object.prototype.hasOwnProperty,a2=r2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l2={key:!0,ref:!0,__self:!0,__source:!0};function Qx(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)o2.call(t,r)&&!l2.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:i2,type:e,key:s,ref:o,props:i,_owner:a2.current}}nu.Fragment=s2;nu.jsx=Qx;nu.jsxs=Qx;Bx.exports=nu;var p=Bx.exports,Kx={exports:{}},an={},Xx={exports:{}},Zx={};/**
17
+ */var r2=v,i2=Symbol.for("react.element"),s2=Symbol.for("react.fragment"),o2=Object.prototype.hasOwnProperty,a2=r2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l2={key:!0,ref:!0,__self:!0,__source:!0};function Yx(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)o2.call(t,r)&&!l2.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:i2,type:e,key:s,ref:o,props:i,_owner:a2.current}}nu.Fragment=s2;nu.jsx=Yx;nu.jsxs=Yx;Fx.exports=nu;var f=Fx.exports,Qx={exports:{}},an={},Kx={exports:{}},Xx={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -22,7 +22,7 @@ var wg=e=>{throw TypeError(e)};var BC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(_,P){var F=_.length;_.push(P);e:for(;0<F;){var $=F-1>>>1,W=_[$];if(0<i(W,P))_[$]=P,_[F]=W,F=$;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var P=_[0],F=_.pop();if(F!==P){_[0]=F;e:for(var $=0,W=_.length,Q=W>>>1;$<Q;){var se=2*($+1)-1,he=_[se],ue=se+1,q=_[ue];if(0>i(he,F))ue<W&&0>i(q,he)?(_[$]=q,_[ue]=F,$=ue):(_[$]=he,_[se]=F,$=se);else if(ue<W&&0>i(q,F))_[$]=q,_[ue]=F,$=ue;else break e}}return P}function i(_,P){var F=_.sortIndex-P.sortIndex;return F!==0?F:_.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,c=null,f=3,m=!1,y=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(_){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=_)r(u),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(u)}}function T(_){if(x=!1,b(_),!y)if(n(l)!==null)y=!0,I(C);else{var P=n(u);P!==null&&H(T,P.startTime-_)}}function C(_,P){y=!1,x&&(x=!1,h(A),A=-1),m=!0;var F=f;try{for(b(P),c=n(l);c!==null&&(!(c.expirationTime>P)||_&&!N());){var $=c.callback;if(typeof $=="function"){c.callback=null,f=c.priorityLevel;var W=$(c.expirationTime<=P);P=e.unstable_now(),typeof W=="function"?c.callback=W:c===n(l)&&r(l),b(P)}else r(l);c=n(l)}if(c!==null)var Q=!0;else{var se=n(u);se!==null&&H(T,se.startTime-P),Q=!1}return Q}finally{c=null,f=F,m=!1}}var E=!1,S=null,A=-1,B=5,L=-1;function N(){return!(e.unstable_now()-L<B)}function ee(){if(S!==null){var _=e.unstable_now();L=_;var P=!0;try{P=S(!0,_)}finally{P?Z():(E=!1,S=null)}}else E=!1}var Z;if(typeof v=="function")Z=function(){v(ee)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,O=V.port2;V.port1.onmessage=ee,Z=function(){O.postMessage(null)}}else Z=function(){w(ee,0)};function I(_){S=_,E||(E=!0,Z())}function H(_,P){A=w(function(){_(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(_){_.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,I(C))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(_){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var F=f;f=P;try{return _()}finally{f=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,P){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var F=f;f=_;try{return P()}finally{f=F}},e.unstable_scheduleCallback=function(_,P,F){var $=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?$+F:$):F=$,_){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=F+W,_={id:d++,callback:P,priorityLevel:_,startTime:F,expirationTime:W,sortIndex:-1},F>$?(_.sortIndex=F,t(u,_),n(l)===null&&_===n(u)&&(x?(h(A),A=-1):x=!0,H(T,F-$))):(_.sortIndex=W,t(l,_),y||m||(y=!0,I(C))),_},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(_){var P=f;return function(){var F=f;f=P;try{return _.apply(this,arguments)}finally{f=F}}}})(Zx);Xx.exports=Zx;var c2=Xx.exports;/**
25
+ */(function(e){function t(C,P){var F=C.length;C.push(P);e:for(;0<F;){var $=F-1>>>1,W=C[$];if(0<i(W,P))C[$]=P,C[F]=W,F=$;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var P=C[0],F=C.pop();if(F!==P){C[0]=F;e:for(var $=0,W=C.length,Q=W>>>1;$<Q;){var se=2*($+1)-1,he=C[se],ue=se+1,q=C[ue];if(0>i(he,F))ue<W&&0>i(q,he)?(C[$]=q,C[ue]=F,$=ue):(C[$]=he,C[se]=F,$=se);else if(ue<W&&0>i(q,F))C[$]=q,C[ue]=F,$=ue;else break e}}return P}function i(C,P){var F=C.sortIndex-P.sortIndex;return F!==0?F:C.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,u=null,p=3,m=!1,y=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(C){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=C)r(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(c)}}function T(C){if(x=!1,b(C),!y)if(n(l)!==null)y=!0,I(_);else{var P=n(c);P!==null&&H(T,P.startTime-C)}}function _(C,P){y=!1,x&&(x=!1,h(A),A=-1),m=!0;var F=p;try{for(b(P),u=n(l);u!==null&&(!(u.expirationTime>P)||C&&!N());){var $=u.callback;if(typeof $=="function"){u.callback=null,p=u.priorityLevel;var W=$(u.expirationTime<=P);P=e.unstable_now(),typeof W=="function"?u.callback=W:u===n(l)&&r(l),b(P)}else r(l);u=n(l)}if(u!==null)var Q=!0;else{var se=n(c);se!==null&&H(T,se.startTime-P),Q=!1}return Q}finally{u=null,p=F,m=!1}}var E=!1,S=null,A=-1,B=5,L=-1;function N(){return!(e.unstable_now()-L<B)}function ee(){if(S!==null){var C=e.unstable_now();L=C;var P=!0;try{P=S(!0,C)}finally{P?Z():(E=!1,S=null)}}else E=!1}var Z;if(typeof g=="function")Z=function(){g(ee)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,O=V.port2;V.port1.onmessage=ee,Z=function(){O.postMessage(null)}}else Z=function(){w(ee,0)};function I(C){S=C,E||(E=!0,Z())}function H(C,P){A=w(function(){C(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,I(_))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(C){switch(p){case 1:case 2:case 3:var P=3;break;default:P=p}var F=p;p=P;try{return C()}finally{p=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,P){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var F=p;p=C;try{return P()}finally{p=F}},e.unstable_scheduleCallback=function(C,P,F){var $=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?$+F:$):F=$,C){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=F+W,C={id:d++,callback:P,priorityLevel:C,startTime:F,expirationTime:W,sortIndex:-1},F>$?(C.sortIndex=F,t(c,C),n(l)===null&&C===n(c)&&(x?(h(A),A=-1):x=!0,H(T,F-$))):(C.sortIndex=W,t(l,C),y||m||(y=!0,I(_))),C},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(C){var P=p;return function(){var F=p;p=P;try{return C.apply(this,arguments)}finally{p=F}}}})(Xx);Kx.exports=Xx;var c2=Kx.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@ var wg=e=>{throw TypeError(e)};var BC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var u2=g,on=c2;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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 Jx=new Set,ma={};function ss(e,t){oo(e,t),oo(e+"Capture",t)}function oo(e,t){for(ma[e]=t,e=0;e<t.length;e++)Jx.add(t[e])}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),of=Object.prototype.hasOwnProperty,d2=/^[: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]*$/,Cg={},_g={};function f2(e){return of.call(_g,e)?!0:of.call(Cg,e)?!1:d2.test(e)?_g[e]=!0:(Cg[e]=!0,!1)}function p2(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function h2(e,t,n,r){if(t===null||typeof t>"u"||p2(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 Ft(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Ft(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){kt[e]=new Ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var fh=/[\-:]([a-z])/g;function ph(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(fh,ph);kt[t]=new Ft(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(fh,ph);kt[t]=new Ft(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(fh,ph);kt[t]=new Ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function hh(e,t,n,r){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(h2(t,n,i,r)&&(n=null),r||i===null?f2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Rr=u2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hl=Symbol.for("react.element"),ks=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),mh=Symbol.for("react.strict_mode"),af=Symbol.for("react.profiler"),e1=Symbol.for("react.provider"),t1=Symbol.for("react.context"),gh=Symbol.for("react.forward_ref"),lf=Symbol.for("react.suspense"),cf=Symbol.for("react.suspense_list"),vh=Symbol.for("react.memo"),Lr=Symbol.for("react.lazy"),n1=Symbol.for("react.offscreen"),Tg=Symbol.iterator;function Mo(e){return e===null||typeof e!="object"?null:(e=Tg&&e[Tg]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Object.assign,ed;function Uo(e){if(ed===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ed=t&&t[1]||""}return`
34
- `+ed+e}var td=!1;function nd(e,t){if(!e||td)return"";td=!0;var n=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 i=u.stack.split(`
33
+ */var u2=v,on=c2;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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 Zx=new Set,ma={};function ss(e,t){oo(e,t),oo(e+"Capture",t)}function oo(e,t){for(ma[e]=t,e=0;e<t.length;e++)Zx.add(t[e])}var _r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sf=Object.prototype.hasOwnProperty,d2=/^[: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]*$/,Sg={},Cg={};function f2(e){return sf.call(Cg,e)?!0:sf.call(Sg,e)?!1:d2.test(e)?Cg[e]=!0:(Sg[e]=!0,!1)}function p2(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function h2(e,t,n,r){if(t===null||typeof t>"u"||p2(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 Ft(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Ft(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){kt[e]=new Ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var dh=/[\-:]([a-z])/g;function fh(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,fh);kt[t]=new Ft(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,fh);kt[t]=new Ft(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,fh);kt[t]=new Ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function ph(e,t,n,r){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(h2(t,n,i,r)&&(n=null),r||i===null?f2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Pr=u2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,hl=Symbol.for("react.element"),ks=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),hh=Symbol.for("react.strict_mode"),of=Symbol.for("react.profiler"),Jx=Symbol.for("react.provider"),e1=Symbol.for("react.context"),mh=Symbol.for("react.forward_ref"),af=Symbol.for("react.suspense"),lf=Symbol.for("react.suspense_list"),gh=Symbol.for("react.memo"),Fr=Symbol.for("react.lazy"),t1=Symbol.for("react.offscreen"),_g=Symbol.iterator;function Mo(e){return e===null||typeof e!="object"?null:(e=_g&&e[_g]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Object.assign,Ju;function Uo(e){if(Ju===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ju=t&&t[1]||""}return`
34
+ `+Ju+e}var ed=!1;function td(e,t){if(!e||ed)return"";ed=!0;var n=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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
35
  `),s=r.stack.split(`
36
36
  `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
37
- `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{td=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Uo(e):""}function m2(e){switch(e.tag){case 5:return Uo(e.type);case 16:return Uo("Lazy");case 13:return Uo("Suspense");case 19:return Uo("SuspenseList");case 0:case 2:case 15:return e=nd(e.type,!1),e;case 11:return e=nd(e.type.render,!1),e;case 1:return e=nd(e.type,!0),e;default:return""}}function uf(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 Ss:return"Fragment";case ks:return"Portal";case af:return"Profiler";case mh:return"StrictMode";case lf:return"Suspense";case cf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case t1:return(e.displayName||"Context")+".Consumer";case e1:return(e._context.displayName||"Context")+".Provider";case gh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vh:return t=e.displayName||null,t!==null?t:uf(e.type)||"Memo";case Lr:t=e._payload,e=e._init;try{return uf(e(t))}catch{}}return null}function g2(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 uf(t);case 8:return t===mh?"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 ui(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function r1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function v2(e){var t=r1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ml(e){e._valueTracker||(e._valueTracker=v2(e))}function i1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=r1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fc(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 df(e,t){var n=t.checked;return Ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Eg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ui(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function s1(e,t){t=t.checked,t!=null&&hh(e,"checked",t,!1)}function ff(e,t){s1(e,t);var n=ui(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pf(e,t.type,n):t.hasOwnProperty("defaultValue")&&pf(e,t.type,ui(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jg(e,t,n){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,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pf(e,t,n){(t!=="number"||fc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ho=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ui(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function hf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return Ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ag(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(G(92));if(Ho(n)){if(1<n.length)throw Error(G(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ui(n)}}function o1(e,t){var n=ui(t.value),r=ui(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Rg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function a1(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 mf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?a1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gl,l1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(gl=gl||document.createElement("div"),gl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ga(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zo={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},y2=["Webkit","ms","Moz","O"];Object.keys(Zo).forEach(function(e){y2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zo[t]=Zo[e]})});function c1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zo.hasOwnProperty(e)&&Zo[e]?(""+t).trim():t+"px"}function u1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=c1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var x2=Ye({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 gf(e,t){if(t){if(x2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function vf(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 yf=null;function yh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xf=null,zs=null,Vs=null;function Pg(e){if(e=el(e)){if(typeof xf!="function")throw Error(G(280));var t=e.stateNode;t&&(t=au(t),xf(e.stateNode,e.type,t))}}function d1(e){zs?Vs?Vs.push(e):Vs=[e]:zs=e}function f1(){if(zs){var e=zs,t=Vs;if(Vs=zs=null,Pg(e),t)for(e=0;e<t.length;e++)Pg(t[e])}}function p1(e,t){return e(t)}function h1(){}var rd=!1;function m1(e,t,n){if(rd)return e(t,n);rd=!0;try{return p1(e,t,n)}finally{rd=!1,(zs!==null||Vs!==null)&&(h1(),f1())}}function va(e,t){var n=e.stateNode;if(n===null)return null;var r=au(n);if(r===null)return null;n=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(n&&typeof n!="function")throw Error(G(231,t,typeof n));return n}var wf=!1;if(Cr)try{var Oo={};Object.defineProperty(Oo,"passive",{get:function(){wf=!0}}),window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{wf=!1}function w2(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Jo=!1,pc=null,hc=!1,bf=null,b2={onError:function(e){Jo=!0,pc=e}};function k2(e,t,n,r,i,s,o,a,l){Jo=!1,pc=null,w2.apply(b2,arguments)}function S2(e,t,n,r,i,s,o,a,l){if(k2.apply(this,arguments),Jo){if(Jo){var u=pc;Jo=!1,pc=null}else throw Error(G(198));hc||(hc=!0,bf=u)}}function os(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function g1(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 Mg(e){if(os(e)!==e)throw Error(G(188))}function C2(e){var t=e.alternate;if(!t){if(t=os(e),t===null)throw Error(G(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Mg(i),e;if(s===r)return Mg(i),t;s=s.sibling}throw Error(G(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(G(189))}}if(n.alternate!==r)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?e:t}function v1(e){return e=C2(e),e!==null?y1(e):null}function y1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=y1(e);if(t!==null)return t;e=e.sibling}return null}var x1=on.unstable_scheduleCallback,Og=on.unstable_cancelCallback,_2=on.unstable_shouldYield,T2=on.unstable_requestPaint,nt=on.unstable_now,E2=on.unstable_getCurrentPriorityLevel,xh=on.unstable_ImmediatePriority,w1=on.unstable_UserBlockingPriority,mc=on.unstable_NormalPriority,j2=on.unstable_LowPriority,b1=on.unstable_IdlePriority,ru=null,tr=null;function A2(e){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(ru,e,void 0,(e.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:M2,R2=Math.log,P2=Math.LN2;function M2(e){return e>>>=0,e===0?32:31-(R2(e)/P2|0)|0}var vl=64,yl=4194304;function Wo(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 gc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Wo(a):(s&=o,s!==0&&(r=Wo(s)))}else o=n&~i,o!==0?r=Wo(o):s!==0&&(r=Wo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fn(t),i=1<<n,r|=e[n],t&=~i;return r}function O2(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 N2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Fn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=O2(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function kf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function k1(){var e=vl;return vl<<=1,!(vl&4194240)&&(vl=64),e}function id(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Za(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=n}function D2(e,t){var n=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<n;){var i=31-Fn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function wh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Re=0;function S1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var C1,bh,_1,T1,E1,Sf=!1,xl=[],ei=null,ti=null,ni=null,ya=new Map,xa=new Map,$r=[],I2="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 Ng(e,t){switch(e){case"focusin":case"focusout":ei=null;break;case"dragenter":case"dragleave":ti=null;break;case"mouseover":case"mouseout":ni=null;break;case"pointerover":case"pointerout":ya.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xa.delete(t.pointerId)}}function No(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=el(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function L2(e,t,n,r,i){switch(t){case"focusin":return ei=No(ei,e,t,n,r,i),!0;case"dragenter":return ti=No(ti,e,t,n,r,i),!0;case"mouseover":return ni=No(ni,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ya.set(s,No(ya.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,xa.set(s,No(xa.get(s)||null,e,t,n,r,i)),!0}return!1}function j1(e){var t=Pi(e.target);if(t!==null){var n=os(t);if(n!==null){if(t=n.tag,t===13){if(t=g1(n),t!==null){e.blockedOn=t,E1(e.priority,function(){_1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yf=r,n.target.dispatchEvent(r),yf=null}else return t=el(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Dg(e,t,n){Wl(e)&&n.delete(t)}function F2(){Sf=!1,ei!==null&&Wl(ei)&&(ei=null),ti!==null&&Wl(ti)&&(ti=null),ni!==null&&Wl(ni)&&(ni=null),ya.forEach(Dg),xa.forEach(Dg)}function Do(e,t){e.blockedOn===t&&(e.blockedOn=null,Sf||(Sf=!0,on.unstable_scheduleCallback(on.unstable_NormalPriority,F2)))}function wa(e){function t(i){return Do(i,e)}if(0<xl.length){Do(xl[0],e);for(var n=1;n<xl.length;n++){var r=xl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ei!==null&&Do(ei,e),ti!==null&&Do(ti,e),ni!==null&&Do(ni,e),ya.forEach(t),xa.forEach(t),n=0;n<$r.length;n++)r=$r[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$r.length&&(n=$r[0],n.blockedOn===null);)j1(n),n.blockedOn===null&&$r.shift()}var Us=Rr.ReactCurrentBatchConfig,vc=!0;function B2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=1,kh(e,t,n,r)}finally{Re=i,Us.transition=s}}function $2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=4,kh(e,t,n,r)}finally{Re=i,Us.transition=s}}function kh(e,t,n,r){if(vc){var i=Cf(e,t,n,r);if(i===null)hd(e,t,r,yc,n),Ng(e,r);else if(L2(i,e,t,n,r))r.stopPropagation();else if(Ng(e,r),t&4&&-1<I2.indexOf(e)){for(;i!==null;){var s=el(i);if(s!==null&&C1(s),s=Cf(e,t,n,r),s===null&&hd(e,t,r,yc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else hd(e,t,r,null,n)}}var yc=null;function Cf(e,t,n,r){if(yc=null,e=yh(r),e=Pi(e),e!==null)if(t=os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=g1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return yc=e,null}function A1(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(E2()){case xh:return 1;case w1:return 4;case mc:case j2:return 16;case b1:return 536870912;default:return 16}default:return 16}}var Xr=null,Sh=null,ql=null;function R1(){if(ql)return ql;var e,t=Sh,n=t.length,r,i="value"in Xr?Xr.value:Xr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return ql=i.slice(e,1<r?1-r:void 0)}function Gl(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 wl(){return!0}function Ig(){return!1}function ln(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?wl:Ig,this.isPropagationStopped=Ig,this}return Ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=wl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=wl)},persist:function(){},isPersistent:wl}),t}var ko={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ch=ln(ko),Ja=Ye({},ko,{view:0,detail:0}),z2=ln(Ja),sd,od,Io,iu=Ye({},Ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_h,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!==Io&&(Io&&e.type==="mousemove"?(sd=e.screenX-Io.screenX,od=e.screenY-Io.screenY):od=sd=0,Io=e),sd)},movementY:function(e){return"movementY"in e?e.movementY:od}}),Lg=ln(iu),V2=Ye({},iu,{dataTransfer:0}),U2=ln(V2),H2=Ye({},Ja,{relatedTarget:0}),ad=ln(H2),W2=Ye({},ko,{animationName:0,elapsedTime:0,pseudoElement:0}),q2=ln(W2),G2=Ye({},ko,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Y2=ln(G2),Q2=Ye({},ko,{data:0}),Fg=ln(Q2),K2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X2={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"},Z2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function J2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z2[e])?!!t[e]:!1}function _h(){return J2}var e_=Ye({},Ja,{key:function(e){if(e.key){var t=K2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_h,charCode:function(e){return e.type==="keypress"?Gl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),t_=ln(e_),n_=Ye({},iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bg=ln(n_),r_=Ye({},Ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_h}),i_=ln(r_),s_=Ye({},ko,{propertyName:0,elapsedTime:0,pseudoElement:0}),o_=ln(s_),a_=Ye({},iu,{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}),l_=ln(a_),c_=[9,13,27,32],Th=Cr&&"CompositionEvent"in window,ea=null;Cr&&"documentMode"in document&&(ea=document.documentMode);var u_=Cr&&"TextEvent"in window&&!ea,P1=Cr&&(!Th||ea&&8<ea&&11>=ea),$g=" ",zg=!1;function M1(e,t){switch(e){case"keyup":return c_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function O1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function d_(e,t){switch(e){case"compositionend":return O1(t);case"keypress":return t.which!==32?null:(zg=!0,$g);case"textInput":return e=t.data,e===$g&&zg?null:e;default:return null}}function f_(e,t){if(Cs)return e==="compositionend"||!Th&&M1(e,t)?(e=R1(),ql=Sh=Xr=null,Cs=!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 P1&&t.locale!=="ko"?null:t.data;default:return null}}var p_={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 Vg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!p_[e.type]:t==="textarea"}function N1(e,t,n,r){d1(r),t=xc(t,"onChange"),0<t.length&&(n=new Ch("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ta=null,ba=null;function h_(e){W1(e,0)}function su(e){var t=Es(e);if(i1(t))return e}function m_(e,t){if(e==="change")return t}var D1=!1;if(Cr){var ld;if(Cr){var cd="oninput"in document;if(!cd){var Ug=document.createElement("div");Ug.setAttribute("oninput","return;"),cd=typeof Ug.oninput=="function"}ld=cd}else ld=!1;D1=ld&&(!document.documentMode||9<document.documentMode)}function Hg(){ta&&(ta.detachEvent("onpropertychange",I1),ba=ta=null)}function I1(e){if(e.propertyName==="value"&&su(ba)){var t=[];N1(t,ba,e,yh(e)),m1(h_,t)}}function g_(e,t,n){e==="focusin"?(Hg(),ta=t,ba=n,ta.attachEvent("onpropertychange",I1)):e==="focusout"&&Hg()}function v_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return su(ba)}function y_(e,t){if(e==="click")return su(t)}function x_(e,t){if(e==="input"||e==="change")return su(t)}function w_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zn=typeof Object.is=="function"?Object.is:w_;function ka(e,t){if(zn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!of.call(t,i)||!zn(e[i],t[i]))return!1}return!0}function Wg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qg(e,t){var n=Wg(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wg(n)}}function L1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?L1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function F1(){for(var e=window,t=fc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fc(e.document)}return t}function Eh(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 b_(e){var t=F1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&L1(n.ownerDocument.documentElement,n)){if(r!==null&&Eh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=qg(n,s);var o=qg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var k_=Cr&&"documentMode"in document&&11>=document.documentMode,_s=null,_f=null,na=null,Tf=!1;function Gg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tf||_s==null||_s!==fc(r)||(r=_s,"selectionStart"in r&&Eh(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}),na&&ka(na,r)||(na=r,r=xc(_f,"onSelect"),0<r.length&&(t=new Ch("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=_s)))}function bl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ts={animationend:bl("Animation","AnimationEnd"),animationiteration:bl("Animation","AnimationIteration"),animationstart:bl("Animation","AnimationStart"),transitionend:bl("Transition","TransitionEnd")},ud={},B1={};Cr&&(B1=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function ou(e){if(ud[e])return ud[e];if(!Ts[e])return e;var t=Ts[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in B1)return ud[e]=t[n];return e}var $1=ou("animationend"),z1=ou("animationiteration"),V1=ou("animationstart"),U1=ou("transitionend"),H1=new Map,Yg="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 vi(e,t){H1.set(e,t),ss(t,[e])}for(var dd=0;dd<Yg.length;dd++){var fd=Yg[dd],S_=fd.toLowerCase(),C_=fd[0].toUpperCase()+fd.slice(1);vi(S_,"on"+C_)}vi($1,"onAnimationEnd");vi(z1,"onAnimationIteration");vi(V1,"onAnimationStart");vi("dblclick","onDoubleClick");vi("focusin","onFocus");vi("focusout","onBlur");vi(U1,"onTransitionEnd");oo("onMouseEnter",["mouseout","mouseover"]);oo("onMouseLeave",["mouseout","mouseover"]);oo("onPointerEnter",["pointerout","pointerover"]);oo("onPointerLeave",["pointerout","pointerover"]);ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ss("onBeforeInput",["compositionend","keypress","textInput","paste"]);ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="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(" "),__=new Set("cancel close invalid load scroll toggle".split(" ").concat(qo));function Qg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,S2(r,t,void 0,e),e.currentTarget=null}function W1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Qg(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Qg(i,a,u),s=l}}}if(hc)throw e=bf,hc=!1,bf=null,e}function Fe(e,t){var n=t[Pf];n===void 0&&(n=t[Pf]=new Set);var r=e+"__bubble";n.has(r)||(q1(t,e,2,!1),n.add(r))}function pd(e,t,n){var r=0;t&&(r|=4),q1(n,e,r,t)}var kl="_reactListening"+Math.random().toString(36).slice(2);function Sa(e){if(!e[kl]){e[kl]=!0,Jx.forEach(function(n){n!=="selectionchange"&&(__.has(n)||pd(n,!1,e),pd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kl]||(t[kl]=!0,pd("selectionchange",!1,t))}}function q1(e,t,n,r){switch(A1(t)){case 1:var i=B2;break;case 4:i=$2;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!wf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function hd(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}m1(function(){var u=s,d=yh(n),c=[];e:{var f=H1.get(e);if(f!==void 0){var m=Ch,y=e;switch(e){case"keypress":if(Gl(n)===0)break e;case"keydown":case"keyup":m=t_;break;case"focusin":y="focus",m=ad;break;case"focusout":y="blur",m=ad;break;case"beforeblur":case"afterblur":m=ad;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Lg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=U2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=i_;break;case $1:case z1:case V1:m=q2;break;case U1:m=o_;break;case"scroll":m=z2;break;case"wheel":m=l_;break;case"copy":case"cut":case"paste":m=Y2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Bg}var x=(t&4)!==0,w=!x&&e==="scroll",h=x?f!==null?f+"Capture":null:f;x=[];for(var v=u,b;v!==null;){b=v;var T=b.stateNode;if(b.tag===5&&T!==null&&(b=T,h!==null&&(T=va(v,h),T!=null&&x.push(Ca(v,T,b)))),w)break;v=v.return}0<x.length&&(f=new m(f,y,null,n,d),c.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==yf&&(y=n.relatedTarget||n.fromElement)&&(Pi(y)||y[_r]))break e;if((m||f)&&(f=d.window===d?d:(f=d.ownerDocument)?f.defaultView||f.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=u,y=y?Pi(y):null,y!==null&&(w=os(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(x=Lg,T="onMouseLeave",h="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=Bg,T="onPointerLeave",h="onPointerEnter",v="pointer"),w=m==null?f:Es(m),b=y==null?f:Es(y),f=new x(T,v+"leave",m,n,d),f.target=w,f.relatedTarget=b,T=null,Pi(d)===u&&(x=new x(h,v+"enter",y,n,d),x.target=b,x.relatedTarget=w,T=x),w=T,m&&y)t:{for(x=m,h=y,v=0,b=x;b;b=ws(b))v++;for(b=0,T=h;T;T=ws(T))b++;for(;0<v-b;)x=ws(x),v--;for(;0<b-v;)h=ws(h),b--;for(;v--;){if(x===h||h!==null&&x===h.alternate)break t;x=ws(x),h=ws(h)}x=null}else x=null;m!==null&&Kg(c,f,m,x,!1),y!==null&&w!==null&&Kg(c,w,y,x,!0)}}e:{if(f=u?Es(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var C=m_;else if(Vg(f))if(D1)C=x_;else{C=v_;var E=g_}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=y_);if(C&&(C=C(e,u))){N1(c,C,n,d);break e}E&&E(e,f,u),e==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&pf(f,"number",f.value)}switch(E=u?Es(u):window,e){case"focusin":(Vg(E)||E.contentEditable==="true")&&(_s=E,_f=u,na=null);break;case"focusout":na=_f=_s=null;break;case"mousedown":Tf=!0;break;case"contextmenu":case"mouseup":case"dragend":Tf=!1,Gg(c,n,d);break;case"selectionchange":if(k_)break;case"keydown":case"keyup":Gg(c,n,d)}var S;if(Th)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Cs?M1(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(P1&&n.locale!=="ko"&&(Cs||A!=="onCompositionStart"?A==="onCompositionEnd"&&Cs&&(S=R1()):(Xr=d,Sh="value"in Xr?Xr.value:Xr.textContent,Cs=!0)),E=xc(u,A),0<E.length&&(A=new Fg(A,e,null,n,d),c.push({event:A,listeners:E}),S?A.data=S:(S=O1(n),S!==null&&(A.data=S)))),(S=u_?d_(e,n):f_(e,n))&&(u=xc(u,"onBeforeInput"),0<u.length&&(d=new Fg("onBeforeInput","beforeinput",null,n,d),c.push({event:d,listeners:u}),d.data=S))}W1(c,t)})}function Ca(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=va(e,n),s!=null&&r.unshift(Ca(e,s,i)),s=va(e,t),s!=null&&r.push(Ca(e,s,i))),e=e.return}return r}function ws(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Kg(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=va(n,s),l!=null&&o.unshift(Ca(n,l,a))):i||(l=va(n,s),l!=null&&o.push(Ca(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var T_=/\r\n?/g,E_=/\u0000|\uFFFD/g;function Xg(e){return(typeof e=="string"?e:""+e).replace(T_,`
38
- `).replace(E_,"")}function Sl(e,t,n){if(t=Xg(t),Xg(e)!==t&&n)throw Error(G(425))}function wc(){}var Ef=null,jf=null;function Af(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 Rf=typeof setTimeout=="function"?setTimeout:void 0,j_=typeof clearTimeout=="function"?clearTimeout:void 0,Zg=typeof Promise=="function"?Promise:void 0,A_=typeof queueMicrotask=="function"?queueMicrotask:typeof Zg<"u"?function(e){return Zg.resolve(null).then(e).catch(R_)}:Rf;function R_(e){setTimeout(function(){throw e})}function md(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),wa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);wa(t)}function ri(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 Jg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var So=Math.random().toString(36).slice(2),Jn="__reactFiber$"+So,_a="__reactProps$"+So,_r="__reactContainer$"+So,Pf="__reactEvents$"+So,P_="__reactListeners$"+So,M_="__reactHandles$"+So;function Pi(e){var t=e[Jn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_r]||n[Jn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jg(e);e!==null;){if(n=e[Jn])return n;e=Jg(e)}return t}e=n,n=e.parentNode}return null}function el(e){return e=e[Jn]||e[_r],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function au(e){return e[_a]||null}var Mf=[],js=-1;function yi(e){return{current:e}}function $e(e){0>js||(e.current=Mf[js],Mf[js]=null,js--)}function Ie(e,t){js++,Mf[js]=e.current,e.current=t}var di={},Pt=yi(di),Yt=yi(!1),Xi=di;function ao(e,t){var n=e.type.contextTypes;if(!n)return di;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qt(e){return e=e.childContextTypes,e!=null}function bc(){$e(Yt),$e(Pt)}function ev(e,t,n){if(Pt.current!==di)throw Error(G(168));Ie(Pt,t),Ie(Yt,n)}function G1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(G(108,g2(e)||"Unknown",i));return Ye({},n,r)}function kc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||di,Xi=Pt.current,Ie(Pt,e),Ie(Yt,Yt.current),!0}function tv(e,t,n){var r=e.stateNode;if(!r)throw Error(G(169));n?(e=G1(e,t,Xi),r.__reactInternalMemoizedMergedChildContext=e,$e(Yt),$e(Pt),Ie(Pt,e)):$e(Yt),Ie(Yt,n)}var vr=null,lu=!1,gd=!1;function Y1(e){vr===null?vr=[e]:vr.push(e)}function O_(e){lu=!0,Y1(e)}function xi(){if(!gd&&vr!==null){gd=!0;var e=0,t=Re;try{var n=vr;for(Re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vr=null,lu=!1}catch(i){throw vr!==null&&(vr=vr.slice(e+1)),x1(xh,xi),i}finally{Re=t,gd=!1}}return null}var As=[],Rs=0,Sc=null,Cc=0,yn=[],xn=0,Zi=null,wr=1,br="";function Ti(e,t){As[Rs++]=Cc,As[Rs++]=Sc,Sc=e,Cc=t}function Q1(e,t,n){yn[xn++]=wr,yn[xn++]=br,yn[xn++]=Zi,Zi=e;var r=wr;e=br;var i=32-Fn(r)-1;r&=~(1<<i),n+=1;var s=32-Fn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wr=1<<32-Fn(t)+i|n<<i|r,br=s+e}else wr=1<<s|n<<i|r,br=e}function jh(e){e.return!==null&&(Ti(e,1),Q1(e,1,0))}function Ah(e){for(;e===Sc;)Sc=As[--Rs],As[Rs]=null,Cc=As[--Rs],As[Rs]=null;for(;e===Zi;)Zi=yn[--xn],yn[xn]=null,br=yn[--xn],yn[xn]=null,wr=yn[--xn],yn[xn]=null}var sn=null,tn=null,Ue=!1,Dn=null;function K1(e,t){var n=bn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function nv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sn=e,tn=ri(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sn=e,tn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zi!==null?{id:wr,overflow:br}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=bn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sn=e,tn=null,!0):!1;default:return!1}}function Of(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Nf(e){if(Ue){var t=tn;if(t){var n=t;if(!nv(e,t)){if(Of(e))throw Error(G(418));t=ri(n.nextSibling);var r=sn;t&&nv(e,t)?K1(r,n):(e.flags=e.flags&-4097|2,Ue=!1,sn=e)}}else{if(Of(e))throw Error(G(418));e.flags=e.flags&-4097|2,Ue=!1,sn=e}}}function rv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sn=e}function Cl(e){if(e!==sn)return!1;if(!Ue)return rv(e),Ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Af(e.type,e.memoizedProps)),t&&(t=tn)){if(Of(e))throw X1(),Error(G(418));for(;t;)K1(e,t),t=ri(t.nextSibling)}if(rv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tn=ri(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tn=null}}else tn=sn?ri(e.stateNode.nextSibling):null;return!0}function X1(){for(var e=tn;e;)e=ri(e.nextSibling)}function lo(){tn=sn=null,Ue=!1}function Rh(e){Dn===null?Dn=[e]:Dn.push(e)}var N_=Rr.ReactCurrentBatchConfig;function Lo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(G(309));var r=n.stateNode}if(!r)throw Error(G(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(G(284));if(!n._owner)throw Error(G(290,e))}return e}function _l(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function iv(e){var t=e._init;return t(e._payload)}function Z1(e){function t(h,v){if(e){var b=h.deletions;b===null?(h.deletions=[v],h.flags|=16):b.push(v)}}function n(h,v){if(!e)return null;for(;v!==null;)t(h,v),v=v.sibling;return null}function r(h,v){for(h=new Map;v!==null;)v.key!==null?h.set(v.key,v):h.set(v.index,v),v=v.sibling;return h}function i(h,v){return h=ai(h,v),h.index=0,h.sibling=null,h}function s(h,v,b){return h.index=b,e?(b=h.alternate,b!==null?(b=b.index,b<v?(h.flags|=2,v):b):(h.flags|=2,v)):(h.flags|=1048576,v)}function o(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,v,b,T){return v===null||v.tag!==6?(v=Sd(b,h.mode,T),v.return=h,v):(v=i(v,b),v.return=h,v)}function l(h,v,b,T){var C=b.type;return C===Ss?d(h,v,b.props.children,T,b.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Lr&&iv(C)===v.type)?(T=i(v,b.props),T.ref=Lo(h,v,b),T.return=h,T):(T=ec(b.type,b.key,b.props,null,h.mode,T),T.ref=Lo(h,v,b),T.return=h,T)}function u(h,v,b,T){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=Cd(b,h.mode,T),v.return=h,v):(v=i(v,b.children||[]),v.return=h,v)}function d(h,v,b,T,C){return v===null||v.tag!==7?(v=Wi(b,h.mode,T,C),v.return=h,v):(v=i(v,b),v.return=h,v)}function c(h,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Sd(""+v,h.mode,b),v.return=h,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case hl:return b=ec(v.type,v.key,v.props,null,h.mode,b),b.ref=Lo(h,null,v),b.return=h,b;case ks:return v=Cd(v,h.mode,b),v.return=h,v;case Lr:var T=v._init;return c(h,T(v._payload),b)}if(Ho(v)||Mo(v))return v=Wi(v,h.mode,b,null),v.return=h,v;_l(h,v)}return null}function f(h,v,b,T){var C=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return C!==null?null:a(h,v,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case hl:return b.key===C?l(h,v,b,T):null;case ks:return b.key===C?u(h,v,b,T):null;case Lr:return C=b._init,f(h,v,C(b._payload),T)}if(Ho(b)||Mo(b))return C!==null?null:d(h,v,b,T,null);_l(h,b)}return null}function m(h,v,b,T,C){if(typeof T=="string"&&T!==""||typeof T=="number")return h=h.get(b)||null,a(v,h,""+T,C);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case hl:return h=h.get(T.key===null?b:T.key)||null,l(v,h,T,C);case ks:return h=h.get(T.key===null?b:T.key)||null,u(v,h,T,C);case Lr:var E=T._init;return m(h,v,b,E(T._payload),C)}if(Ho(T)||Mo(T))return h=h.get(b)||null,d(v,h,T,C,null);_l(v,T)}return null}function y(h,v,b,T){for(var C=null,E=null,S=v,A=v=0,B=null;S!==null&&A<b.length;A++){S.index>A?(B=S,S=null):B=S.sibling;var L=f(h,S,b[A],T);if(L===null){S===null&&(S=B);break}e&&S&&L.alternate===null&&t(h,S),v=s(L,v,A),E===null?C=L:E.sibling=L,E=L,S=B}if(A===b.length)return n(h,S),Ue&&Ti(h,A),C;if(S===null){for(;A<b.length;A++)S=c(h,b[A],T),S!==null&&(v=s(S,v,A),E===null?C=S:E.sibling=S,E=S);return Ue&&Ti(h,A),C}for(S=r(h,S);A<b.length;A++)B=m(S,h,A,b[A],T),B!==null&&(e&&B.alternate!==null&&S.delete(B.key===null?A:B.key),v=s(B,v,A),E===null?C=B:E.sibling=B,E=B);return e&&S.forEach(function(N){return t(h,N)}),Ue&&Ti(h,A),C}function x(h,v,b,T){var C=Mo(b);if(typeof C!="function")throw Error(G(150));if(b=C.call(b),b==null)throw Error(G(151));for(var E=C=null,S=v,A=v=0,B=null,L=b.next();S!==null&&!L.done;A++,L=b.next()){S.index>A?(B=S,S=null):B=S.sibling;var N=f(h,S,L.value,T);if(N===null){S===null&&(S=B);break}e&&S&&N.alternate===null&&t(h,S),v=s(N,v,A),E===null?C=N:E.sibling=N,E=N,S=B}if(L.done)return n(h,S),Ue&&Ti(h,A),C;if(S===null){for(;!L.done;A++,L=b.next())L=c(h,L.value,T),L!==null&&(v=s(L,v,A),E===null?C=L:E.sibling=L,E=L);return Ue&&Ti(h,A),C}for(S=r(h,S);!L.done;A++,L=b.next())L=m(S,h,A,L.value,T),L!==null&&(e&&L.alternate!==null&&S.delete(L.key===null?A:L.key),v=s(L,v,A),E===null?C=L:E.sibling=L,E=L);return e&&S.forEach(function(ee){return t(h,ee)}),Ue&&Ti(h,A),C}function w(h,v,b,T){if(typeof b=="object"&&b!==null&&b.type===Ss&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case hl:e:{for(var C=b.key,E=v;E!==null;){if(E.key===C){if(C=b.type,C===Ss){if(E.tag===7){n(h,E.sibling),v=i(E,b.props.children),v.return=h,h=v;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Lr&&iv(C)===E.type){n(h,E.sibling),v=i(E,b.props),v.ref=Lo(h,E,b),v.return=h,h=v;break e}n(h,E);break}else t(h,E);E=E.sibling}b.type===Ss?(v=Wi(b.props.children,h.mode,T,b.key),v.return=h,h=v):(T=ec(b.type,b.key,b.props,null,h.mode,T),T.ref=Lo(h,v,b),T.return=h,h=T)}return o(h);case ks:e:{for(E=b.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(h,v.sibling),v=i(v,b.children||[]),v.return=h,h=v;break e}else{n(h,v);break}else t(h,v);v=v.sibling}v=Cd(b,h.mode,T),v.return=h,h=v}return o(h);case Lr:return E=b._init,w(h,v,E(b._payload),T)}if(Ho(b))return y(h,v,b,T);if(Mo(b))return x(h,v,b,T);_l(h,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(h,v.sibling),v=i(v,b),v.return=h,h=v):(n(h,v),v=Sd(b,h.mode,T),v.return=h,h=v),o(h)):n(h,v)}return w}var co=Z1(!0),J1=Z1(!1),_c=yi(null),Tc=null,Ps=null,Ph=null;function Mh(){Ph=Ps=Tc=null}function Oh(e){var t=_c.current;$e(_c),e._currentValue=t}function Df(e,t,n){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===n)break;e=e.return}}function Hs(e,t){Tc=e,Ph=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gt=!0),e.firstContext=null)}function Cn(e){var t=e._currentValue;if(Ph!==e)if(e={context:e,memoizedValue:t,next:null},Ps===null){if(Tc===null)throw Error(G(308));Ps=e,Tc.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return t}var Mi=null;function Nh(e){Mi===null?Mi=[e]:Mi.push(e)}function ew(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Nh(t)):(n.next=i.next,i.next=n),t.interleaved=n,Tr(e,r)}function Tr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.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 tw(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 kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ii(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ee&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Tr(e,n)}return i=r.interleaved,i===null?(t.next=t,Nh(r)):(t.next=i.next,i.next=t),r.interleaved=t,Tr(e,n)}function Yl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wh(e,n)}}function sv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ec(e,t,n,r){var i=e.updateQueue;Fr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(s!==null){var c=i.baseState;o=0,d=u=l=null,a=s;do{var f=a.lane,m=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,x=a;switch(f=t,m=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){c=y.call(m,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,f=typeof y=="function"?y.call(m,c,f):y,f==null)break e;c=Ye({},c,f);break e;case 2:Fr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else m={eventTime:m,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=m,l=c):d=d.next=m,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(d===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);es|=o,e.lanes=o,e.memoizedState=c}}function ov(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(G(191,i));i.call(r)}}}var tl={},nr=yi(tl),Ta=yi(tl),Ea=yi(tl);function Oi(e){if(e===tl)throw Error(G(174));return e}function Ih(e,t){switch(Ie(Ea,t),Ie(Ta,e),Ie(nr,tl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mf(t,e)}$e(nr),Ie(nr,t)}function uo(){$e(nr),$e(Ta),$e(Ea)}function nw(e){Oi(Ea.current);var t=Oi(nr.current),n=mf(t,e.type);t!==n&&(Ie(Ta,e),Ie(nr,n))}function Lh(e){Ta.current===e&&($e(nr),$e(Ta))}var We=yi(0);function jc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 vd=[];function Fh(){for(var e=0;e<vd.length;e++)vd[e]._workInProgressVersionPrimary=null;vd.length=0}var Ql=Rr.ReactCurrentDispatcher,yd=Rr.ReactCurrentBatchConfig,Ji=0,Ge=null,lt=null,pt=null,Ac=!1,ra=!1,ja=0,D_=0;function Ct(){throw Error(G(321))}function Bh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zn(e[n],t[n]))return!1;return!0}function $h(e,t,n,r,i,s){if(Ji=s,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ql.current=e===null||e.memoizedState===null?B_:$_,e=n(r,i),ra){s=0;do{if(ra=!1,ja=0,25<=s)throw Error(G(301));s+=1,pt=lt=null,t.updateQueue=null,Ql.current=z_,e=n(r,i)}while(ra)}if(Ql.current=Rc,t=lt!==null&&lt.next!==null,Ji=0,pt=lt=Ge=null,Ac=!1,t)throw Error(G(300));return e}function zh(){var e=ja!==0;return ja=0,e}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ge.memoizedState=pt=e:pt=pt.next=e,pt}function _n(){if(lt===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=pt===null?Ge.memoizedState:pt.next;if(t!==null)pt=t,lt=e;else{if(e===null)throw Error(G(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},pt===null?Ge.memoizedState=pt=e:pt=pt.next=e}return pt}function Aa(e,t){return typeof t=="function"?t(e):t}function xd(e){var t=_n(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var d=u.lane;if((Ji&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?(a=l=c,o=r):l=l.next=c,Ge.lanes|=d,es|=d}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,zn(r,t.memoizedState)||(Gt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ge.lanes|=s,es|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wd(e){var t=_n(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);zn(s,t.memoizedState)||(Gt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function rw(){}function iw(e,t){var n=Ge,r=_n(),i=t(),s=!zn(r.memoizedState,i);if(s&&(r.memoizedState=i,Gt=!0),r=r.queue,Vh(aw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||pt!==null&&pt.memoizedState.tag&1){if(n.flags|=2048,Ra(9,ow.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(G(349));Ji&30||sw(n,t,i)}return i}function sw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ow(e,t,n,r){t.value=n,t.getSnapshot=r,lw(t)&&cw(e)}function aw(e,t,n){return n(function(){lw(t)&&cw(e)})}function lw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zn(e,n)}catch{return!0}}function cw(e){var t=Tr(e,1);t!==null&&Bn(t,e,1,-1)}function av(e){var t=Gn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:e},t.queue=e,e=e.dispatch=F_.bind(null,Ge,e),[t.memoizedState,e]}function Ra(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function uw(){return _n().memoizedState}function Kl(e,t,n,r){var i=Gn();Ge.flags|=e,i.memoizedState=Ra(1|t,n,void 0,r===void 0?null:r)}function cu(e,t,n,r){var i=_n();r=r===void 0?null:r;var s=void 0;if(lt!==null){var o=lt.memoizedState;if(s=o.destroy,r!==null&&Bh(r,o.deps)){i.memoizedState=Ra(t,n,s,r);return}}Ge.flags|=e,i.memoizedState=Ra(1|t,n,s,r)}function lv(e,t){return Kl(8390656,8,e,t)}function Vh(e,t){return cu(2048,8,e,t)}function dw(e,t){return cu(4,2,e,t)}function fw(e,t){return cu(4,4,e,t)}function pw(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 hw(e,t,n){return n=n!=null?n.concat([e]):null,cu(4,4,pw.bind(null,t,e),n)}function Uh(){}function mw(e,t){var n=_n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gw(e,t){var n=_n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function vw(e,t,n){return Ji&21?(zn(n,t)||(n=k1(),Ge.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gt=!0),e.memoizedState=n)}function I_(e,t){var n=Re;Re=n!==0&&4>n?n:4,e(!0);var r=yd.transition;yd.transition={};try{e(!1),t()}finally{Re=n,yd.transition=r}}function yw(){return _n().memoizedState}function L_(e,t,n){var r=oi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xw(e))ww(t,n);else if(n=ew(e,t,n,r),n!==null){var i=It();Bn(n,e,r,i),bw(n,t,r)}}function F_(e,t,n){var r=oi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xw(e))ww(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,zn(a,o)){var l=t.interleaved;l===null?(i.next=i,Nh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=ew(e,t,i,r),n!==null&&(i=It(),Bn(n,e,r,i),bw(n,t,r))}}function xw(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function ww(e,t){ra=Ac=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wh(e,n)}}var Rc={readContext:Cn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},B_={readContext:Cn,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:Cn,useEffect:lv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Kl(4194308,4,pw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Kl(4,2,e,t)},useMemo:function(e,t){var n=Gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gn();return t=n!==void 0?n(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=L_.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:av,useDebugValue:Uh,useDeferredValue:function(e){return Gn().memoizedState=e},useTransition:function(){var e=av(!1),t=e[0];return e=I_.bind(null,e[1]),Gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,i=Gn();if(Ue){if(n===void 0)throw Error(G(407));n=n()}else{if(n=t(),ht===null)throw Error(G(349));Ji&30||sw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,lv(aw.bind(null,r,s,e),[e]),r.flags|=2048,Ra(9,ow.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Gn(),t=ht.identifierPrefix;if(Ue){var n=br,r=wr;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ja++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=D_++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$_={readContext:Cn,useCallback:mw,useContext:Cn,useEffect:Vh,useImperativeHandle:hw,useInsertionEffect:dw,useLayoutEffect:fw,useMemo:gw,useReducer:xd,useRef:uw,useState:function(){return xd(Aa)},useDebugValue:Uh,useDeferredValue:function(e){var t=_n();return vw(t,lt.memoizedState,e)},useTransition:function(){var e=xd(Aa)[0],t=_n().memoizedState;return[e,t]},useMutableSource:rw,useSyncExternalStore:iw,useId:yw,unstable_isNewReconciler:!1},z_={readContext:Cn,useCallback:mw,useContext:Cn,useEffect:Vh,useImperativeHandle:hw,useInsertionEffect:dw,useLayoutEffect:fw,useMemo:gw,useReducer:wd,useRef:uw,useState:function(){return wd(Aa)},useDebugValue:Uh,useDeferredValue:function(e){var t=_n();return lt===null?t.memoizedState=e:vw(t,lt.memoizedState,e)},useTransition:function(){var e=wd(Aa)[0],t=_n().memoizedState;return[e,t]},useMutableSource:rw,useSyncExternalStore:iw,useId:yw,unstable_isNewReconciler:!1};function Pn(e,t){if(e&&e.defaultProps){t=Ye({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function If(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ye({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var uu={isMounted:function(e){return(e=e._reactInternals)?os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=It(),i=oi(e),s=kr(r,i);s.payload=t,n!=null&&(s.callback=n),t=ii(e,s,i),t!==null&&(Bn(t,e,i,r),Yl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=It(),i=oi(e),s=kr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ii(e,s,i),t!==null&&(Bn(t,e,i,r),Yl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=It(),r=oi(e),i=kr(n,r);i.tag=2,t!=null&&(i.callback=t),t=ii(e,i,r),t!==null&&(Bn(t,e,r,n),Yl(t,e,r))}};function cv(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!ka(n,r)||!ka(i,s):!0}function kw(e,t,n){var r=!1,i=di,s=t.contextType;return typeof s=="object"&&s!==null?s=Cn(s):(i=Qt(t)?Xi:Pt.current,r=t.contextTypes,s=(r=r!=null)?ao(e,i):di),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=uu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function uv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&uu.enqueueReplaceState(t,t.state,null)}function Lf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Dh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Cn(s):(s=Qt(t)?Xi:Pt.current,i.context=ao(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(If(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&uu.enqueueReplaceState(i,i.state,null),Ec(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function fo(e,t){try{var n="",r=t;do n+=m2(r),r=r.return;while(r);var i=n}catch(s){i=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{ed=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Uo(e):""}function m2(e){switch(e.tag){case 5:return Uo(e.type);case 16:return Uo("Lazy");case 13:return Uo("Suspense");case 19:return Uo("SuspenseList");case 0:case 2:case 15:return e=td(e.type,!1),e;case 11:return e=td(e.type.render,!1),e;case 1:return e=td(e.type,!0),e;default:return""}}function cf(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 Ss:return"Fragment";case ks:return"Portal";case of:return"Profiler";case hh:return"StrictMode";case af:return"Suspense";case lf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case e1:return(e.displayName||"Context")+".Consumer";case Jx: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 gh:return t=e.displayName||null,t!==null?t:cf(e.type)||"Memo";case Fr:t=e._payload,e=e._init;try{return cf(e(t))}catch{}}return null}function g2(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 cf(t);case 8:return t===hh?"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 di(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function n1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function v2(e){var t=n1(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ml(e){e._valueTracker||(e._valueTracker=v2(e))}function r1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=n1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fc(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 uf(e,t){var n=t.checked;return Ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Tg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=di(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function i1(e,t){t=t.checked,t!=null&&ph(e,"checked",t,!1)}function df(e,t){i1(e,t);var n=di(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ff(e,t.type,n):t.hasOwnProperty("defaultValue")&&ff(e,t.type,di(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Eg(e,t,n){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,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ff(e,t,n){(t!=="number"||fc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ho=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+di(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function pf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return Ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function jg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(G(92));if(Ho(n)){if(1<n.length)throw Error(G(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:di(n)}}function s1(e,t){var n=di(t.value),r=di(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Ag(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function o1(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 hf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?o1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gl,a1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(gl=gl||document.createElement("div"),gl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ga(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zo={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},y2=["Webkit","ms","Moz","O"];Object.keys(Zo).forEach(function(e){y2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zo[t]=Zo[e]})});function l1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zo.hasOwnProperty(e)&&Zo[e]?(""+t).trim():t+"px"}function c1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=l1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var x2=Ye({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 mf(e,t){if(t){if(x2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function gf(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 vf=null;function vh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yf=null,zs=null,Vs=null;function Rg(e){if(e=el(e)){if(typeof yf!="function")throw Error(G(280));var t=e.stateNode;t&&(t=au(t),yf(e.stateNode,e.type,t))}}function u1(e){zs?Vs?Vs.push(e):Vs=[e]:zs=e}function d1(){if(zs){var e=zs,t=Vs;if(Vs=zs=null,Rg(e),t)for(e=0;e<t.length;e++)Rg(t[e])}}function f1(e,t){return e(t)}function p1(){}var nd=!1;function h1(e,t,n){if(nd)return e(t,n);nd=!0;try{return f1(e,t,n)}finally{nd=!1,(zs!==null||Vs!==null)&&(p1(),d1())}}function va(e,t){var n=e.stateNode;if(n===null)return null;var r=au(n);if(r===null)return null;n=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(n&&typeof n!="function")throw Error(G(231,t,typeof n));return n}var xf=!1;if(_r)try{var Oo={};Object.defineProperty(Oo,"passive",{get:function(){xf=!0}}),window.addEventListener("test",Oo,Oo),window.removeEventListener("test",Oo,Oo)}catch{xf=!1}function w2(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Jo=!1,pc=null,hc=!1,wf=null,b2={onError:function(e){Jo=!0,pc=e}};function k2(e,t,n,r,i,s,o,a,l){Jo=!1,pc=null,w2.apply(b2,arguments)}function S2(e,t,n,r,i,s,o,a,l){if(k2.apply(this,arguments),Jo){if(Jo){var c=pc;Jo=!1,pc=null}else throw Error(G(198));hc||(hc=!0,wf=c)}}function os(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function m1(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 Pg(e){if(os(e)!==e)throw Error(G(188))}function C2(e){var t=e.alternate;if(!t){if(t=os(e),t===null)throw Error(G(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Pg(i),e;if(s===r)return Pg(i),t;s=s.sibling}throw Error(G(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(G(189))}}if(n.alternate!==r)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?e:t}function g1(e){return e=C2(e),e!==null?v1(e):null}function v1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=v1(e);if(t!==null)return t;e=e.sibling}return null}var y1=on.unstable_scheduleCallback,Mg=on.unstable_cancelCallback,_2=on.unstable_shouldYield,T2=on.unstable_requestPaint,nt=on.unstable_now,E2=on.unstable_getCurrentPriorityLevel,yh=on.unstable_ImmediatePriority,x1=on.unstable_UserBlockingPriority,mc=on.unstable_NormalPriority,j2=on.unstable_LowPriority,w1=on.unstable_IdlePriority,ru=null,tr=null;function A2(e){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(ru,e,void 0,(e.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:M2,R2=Math.log,P2=Math.LN2;function M2(e){return e>>>=0,e===0?32:31-(R2(e)/P2|0)|0}var vl=64,yl=4194304;function Wo(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 gc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Wo(a):(s&=o,s!==0&&(r=Wo(s)))}else o=n&~i,o!==0?r=Wo(o):s!==0&&(r=Wo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fn(t),i=1<<n,r|=e[n],t&=~i;return r}function O2(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 N2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Fn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=O2(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function bf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function b1(){var e=vl;return vl<<=1,!(vl&4194240)&&(vl=64),e}function rd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Za(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=n}function D2(e,t){var n=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<n;){var i=31-Fn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function xh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Re=0;function k1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var S1,wh,C1,_1,T1,kf=!1,xl=[],ti=null,ni=null,ri=null,ya=new Map,xa=new Map,zr=[],I2="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 Og(e,t){switch(e){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":ya.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xa.delete(t.pointerId)}}function No(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=el(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function L2(e,t,n,r,i){switch(t){case"focusin":return ti=No(ti,e,t,n,r,i),!0;case"dragenter":return ni=No(ni,e,t,n,r,i),!0;case"mouseover":return ri=No(ri,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return ya.set(s,No(ya.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,xa.set(s,No(xa.get(s)||null,e,t,n,r,i)),!0}return!1}function E1(e){var t=Pi(e.target);if(t!==null){var n=os(t);if(n!==null){if(t=n.tag,t===13){if(t=m1(n),t!==null){e.blockedOn=t,T1(e.priority,function(){C1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vf=r,n.target.dispatchEvent(r),vf=null}else return t=el(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function Ng(e,t,n){Wl(e)&&n.delete(t)}function F2(){kf=!1,ti!==null&&Wl(ti)&&(ti=null),ni!==null&&Wl(ni)&&(ni=null),ri!==null&&Wl(ri)&&(ri=null),ya.forEach(Ng),xa.forEach(Ng)}function Do(e,t){e.blockedOn===t&&(e.blockedOn=null,kf||(kf=!0,on.unstable_scheduleCallback(on.unstable_NormalPriority,F2)))}function wa(e){function t(i){return Do(i,e)}if(0<xl.length){Do(xl[0],e);for(var n=1;n<xl.length;n++){var r=xl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ti!==null&&Do(ti,e),ni!==null&&Do(ni,e),ri!==null&&Do(ri,e),ya.forEach(t),xa.forEach(t),n=0;n<zr.length;n++)r=zr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<zr.length&&(n=zr[0],n.blockedOn===null);)E1(n),n.blockedOn===null&&zr.shift()}var Us=Pr.ReactCurrentBatchConfig,vc=!0;function B2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=1,bh(e,t,n,r)}finally{Re=i,Us.transition=s}}function $2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=4,bh(e,t,n,r)}finally{Re=i,Us.transition=s}}function bh(e,t,n,r){if(vc){var i=Sf(e,t,n,r);if(i===null)pd(e,t,r,yc,n),Og(e,r);else if(L2(i,e,t,n,r))r.stopPropagation();else if(Og(e,r),t&4&&-1<I2.indexOf(e)){for(;i!==null;){var s=el(i);if(s!==null&&S1(s),s=Sf(e,t,n,r),s===null&&pd(e,t,r,yc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else pd(e,t,r,null,n)}}var yc=null;function Sf(e,t,n,r){if(yc=null,e=vh(r),e=Pi(e),e!==null)if(t=os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=m1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return yc=e,null}function j1(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(E2()){case yh:return 1;case x1:return 4;case mc:case j2:return 16;case w1:return 536870912;default:return 16}default:return 16}}var Zr=null,kh=null,ql=null;function A1(){if(ql)return ql;var e,t=kh,n=t.length,r,i="value"in Zr?Zr.value:Zr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return ql=i.slice(e,1<r?1-r:void 0)}function Gl(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 wl(){return!0}function Dg(){return!1}function ln(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?wl:Dg,this.isPropagationStopped=Dg,this}return Ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=wl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=wl)},persist:function(){},isPersistent:wl}),t}var ko={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sh=ln(ko),Ja=Ye({},ko,{view:0,detail:0}),z2=ln(Ja),id,sd,Io,iu=Ye({},Ja,{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!==Io&&(Io&&e.type==="mousemove"?(id=e.screenX-Io.screenX,sd=e.screenY-Io.screenY):sd=id=0,Io=e),id)},movementY:function(e){return"movementY"in e?e.movementY:sd}}),Ig=ln(iu),V2=Ye({},iu,{dataTransfer:0}),U2=ln(V2),H2=Ye({},Ja,{relatedTarget:0}),od=ln(H2),W2=Ye({},ko,{animationName:0,elapsedTime:0,pseudoElement:0}),q2=ln(W2),G2=Ye({},ko,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Y2=ln(G2),Q2=Ye({},ko,{data:0}),Lg=ln(Q2),K2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},X2={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"},Z2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function J2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Z2[e])?!!t[e]:!1}function Ch(){return J2}var e_=Ye({},Ja,{key:function(e){if(e.key){var t=K2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Gl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?X2[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"?Gl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Gl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),t_=ln(e_),n_=Ye({},iu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fg=ln(n_),r_=Ye({},Ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ch}),i_=ln(r_),s_=Ye({},ko,{propertyName:0,elapsedTime:0,pseudoElement:0}),o_=ln(s_),a_=Ye({},iu,{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}),l_=ln(a_),c_=[9,13,27,32],_h=_r&&"CompositionEvent"in window,ea=null;_r&&"documentMode"in document&&(ea=document.documentMode);var u_=_r&&"TextEvent"in window&&!ea,R1=_r&&(!_h||ea&&8<ea&&11>=ea),Bg=" ",$g=!1;function P1(e,t){switch(e){case"keyup":return c_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function M1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function d_(e,t){switch(e){case"compositionend":return M1(t);case"keypress":return t.which!==32?null:($g=!0,Bg);case"textInput":return e=t.data,e===Bg&&$g?null:e;default:return null}}function f_(e,t){if(Cs)return e==="compositionend"||!_h&&P1(e,t)?(e=A1(),ql=kh=Zr=null,Cs=!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 R1&&t.locale!=="ko"?null:t.data;default:return null}}var p_={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 zg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!p_[e.type]:t==="textarea"}function O1(e,t,n,r){u1(r),t=xc(t,"onChange"),0<t.length&&(n=new Sh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ta=null,ba=null;function h_(e){H1(e,0)}function su(e){var t=Es(e);if(r1(t))return e}function m_(e,t){if(e==="change")return t}var N1=!1;if(_r){var ad;if(_r){var ld="oninput"in document;if(!ld){var Vg=document.createElement("div");Vg.setAttribute("oninput","return;"),ld=typeof Vg.oninput=="function"}ad=ld}else ad=!1;N1=ad&&(!document.documentMode||9<document.documentMode)}function Ug(){ta&&(ta.detachEvent("onpropertychange",D1),ba=ta=null)}function D1(e){if(e.propertyName==="value"&&su(ba)){var t=[];O1(t,ba,e,vh(e)),h1(h_,t)}}function g_(e,t,n){e==="focusin"?(Ug(),ta=t,ba=n,ta.attachEvent("onpropertychange",D1)):e==="focusout"&&Ug()}function v_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return su(ba)}function y_(e,t){if(e==="click")return su(t)}function x_(e,t){if(e==="input"||e==="change")return su(t)}function w_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zn=typeof Object.is=="function"?Object.is:w_;function ka(e,t){if(zn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!sf.call(t,i)||!zn(e[i],t[i]))return!1}return!0}function Hg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wg(e,t){var n=Hg(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Hg(n)}}function I1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?I1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function L1(){for(var e=window,t=fc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fc(e.document)}return t}function Th(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 b_(e){var t=L1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&I1(n.ownerDocument.documentElement,n)){if(r!==null&&Th(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Wg(n,s);var o=Wg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var k_=_r&&"documentMode"in document&&11>=document.documentMode,_s=null,Cf=null,na=null,_f=!1;function qg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_f||_s==null||_s!==fc(r)||(r=_s,"selectionStart"in r&&Th(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}),na&&ka(na,r)||(na=r,r=xc(Cf,"onSelect"),0<r.length&&(t=new Sh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=_s)))}function bl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ts={animationend:bl("Animation","AnimationEnd"),animationiteration:bl("Animation","AnimationIteration"),animationstart:bl("Animation","AnimationStart"),transitionend:bl("Transition","TransitionEnd")},cd={},F1={};_r&&(F1=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function ou(e){if(cd[e])return cd[e];if(!Ts[e])return e;var t=Ts[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in F1)return cd[e]=t[n];return e}var B1=ou("animationend"),$1=ou("animationiteration"),z1=ou("animationstart"),V1=ou("transitionend"),U1=new Map,Gg="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 vi(e,t){U1.set(e,t),ss(t,[e])}for(var ud=0;ud<Gg.length;ud++){var dd=Gg[ud],S_=dd.toLowerCase(),C_=dd[0].toUpperCase()+dd.slice(1);vi(S_,"on"+C_)}vi(B1,"onAnimationEnd");vi($1,"onAnimationIteration");vi(z1,"onAnimationStart");vi("dblclick","onDoubleClick");vi("focusin","onFocus");vi("focusout","onBlur");vi(V1,"onTransitionEnd");oo("onMouseEnter",["mouseout","mouseover"]);oo("onMouseLeave",["mouseout","mouseover"]);oo("onPointerEnter",["pointerout","pointerover"]);oo("onPointerLeave",["pointerout","pointerover"]);ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ss("onBeforeInput",["compositionend","keypress","textInput","paste"]);ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="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(" "),__=new Set("cancel close invalid load scroll toggle".split(" ").concat(qo));function Yg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,S2(r,t,void 0,e),e.currentTarget=null}function H1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Yg(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Yg(i,a,c),s=l}}}if(hc)throw e=wf,hc=!1,wf=null,e}function Fe(e,t){var n=t[Rf];n===void 0&&(n=t[Rf]=new Set);var r=e+"__bubble";n.has(r)||(W1(t,e,2,!1),n.add(r))}function fd(e,t,n){var r=0;t&&(r|=4),W1(n,e,r,t)}var kl="_reactListening"+Math.random().toString(36).slice(2);function Sa(e){if(!e[kl]){e[kl]=!0,Zx.forEach(function(n){n!=="selectionchange"&&(__.has(n)||fd(n,!1,e),fd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[kl]||(t[kl]=!0,fd("selectionchange",!1,t))}}function W1(e,t,n,r){switch(j1(t)){case 1:var i=B2;break;case 4:i=$2;break;default:i=bh}n=i.bind(null,t,n,e),i=void 0,!xf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function pd(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}h1(function(){var c=s,d=vh(n),u=[];e:{var p=U1.get(e);if(p!==void 0){var m=Sh,y=e;switch(e){case"keypress":if(Gl(n)===0)break e;case"keydown":case"keyup":m=t_;break;case"focusin":y="focus",m=od;break;case"focusout":y="blur",m=od;break;case"beforeblur":case"afterblur":m=od;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Ig;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=U2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=i_;break;case B1:case $1:case z1:m=q2;break;case V1:m=o_;break;case"scroll":m=z2;break;case"wheel":m=l_;break;case"copy":case"cut":case"paste":m=Y2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Fg}var x=(t&4)!==0,w=!x&&e==="scroll",h=x?p!==null?p+"Capture":null:p;x=[];for(var g=c,b;g!==null;){b=g;var T=b.stateNode;if(b.tag===5&&T!==null&&(b=T,h!==null&&(T=va(g,h),T!=null&&x.push(Ca(g,T,b)))),w)break;g=g.return}0<x.length&&(p=new m(p,y,null,n,d),u.push({event:p,listeners:x}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==vf&&(y=n.relatedTarget||n.fromElement)&&(Pi(y)||y[Tr]))break e;if((m||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=c,y=y?Pi(y):null,y!==null&&(w=os(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=c),m!==y)){if(x=Ig,T="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(x=Fg,T="onPointerLeave",h="onPointerEnter",g="pointer"),w=m==null?p:Es(m),b=y==null?p:Es(y),p=new x(T,g+"leave",m,n,d),p.target=w,p.relatedTarget=b,T=null,Pi(d)===c&&(x=new x(h,g+"enter",y,n,d),x.target=b,x.relatedTarget=w,T=x),w=T,m&&y)t:{for(x=m,h=y,g=0,b=x;b;b=ws(b))g++;for(b=0,T=h;T;T=ws(T))b++;for(;0<g-b;)x=ws(x),g--;for(;0<b-g;)h=ws(h),b--;for(;g--;){if(x===h||h!==null&&x===h.alternate)break t;x=ws(x),h=ws(h)}x=null}else x=null;m!==null&&Qg(u,p,m,x,!1),y!==null&&w!==null&&Qg(u,w,y,x,!0)}}e:{if(p=c?Es(c):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var _=m_;else if(zg(p))if(N1)_=x_;else{_=v_;var E=g_}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(_=y_);if(_&&(_=_(e,c))){O1(u,_,n,d);break e}E&&E(e,p,c),e==="focusout"&&(E=p._wrapperState)&&E.controlled&&p.type==="number"&&ff(p,"number",p.value)}switch(E=c?Es(c):window,e){case"focusin":(zg(E)||E.contentEditable==="true")&&(_s=E,Cf=c,na=null);break;case"focusout":na=Cf=_s=null;break;case"mousedown":_f=!0;break;case"contextmenu":case"mouseup":case"dragend":_f=!1,qg(u,n,d);break;case"selectionchange":if(k_)break;case"keydown":case"keyup":qg(u,n,d)}var S;if(_h)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Cs?P1(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(R1&&n.locale!=="ko"&&(Cs||A!=="onCompositionStart"?A==="onCompositionEnd"&&Cs&&(S=A1()):(Zr=d,kh="value"in Zr?Zr.value:Zr.textContent,Cs=!0)),E=xc(c,A),0<E.length&&(A=new Lg(A,e,null,n,d),u.push({event:A,listeners:E}),S?A.data=S:(S=M1(n),S!==null&&(A.data=S)))),(S=u_?d_(e,n):f_(e,n))&&(c=xc(c,"onBeforeInput"),0<c.length&&(d=new Lg("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=S))}H1(u,t)})}function Ca(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=va(e,n),s!=null&&r.unshift(Ca(e,s,i)),s=va(e,t),s!=null&&r.push(Ca(e,s,i))),e=e.return}return r}function ws(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qg(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=va(n,s),l!=null&&o.unshift(Ca(n,l,a))):i||(l=va(n,s),l!=null&&o.push(Ca(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var T_=/\r\n?/g,E_=/\u0000|\uFFFD/g;function Kg(e){return(typeof e=="string"?e:""+e).replace(T_,`
38
+ `).replace(E_,"")}function Sl(e,t,n){if(t=Kg(t),Kg(e)!==t&&n)throw Error(G(425))}function wc(){}var Tf=null,Ef=null;function jf(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 Af=typeof setTimeout=="function"?setTimeout:void 0,j_=typeof clearTimeout=="function"?clearTimeout:void 0,Xg=typeof Promise=="function"?Promise:void 0,A_=typeof queueMicrotask=="function"?queueMicrotask:typeof Xg<"u"?function(e){return Xg.resolve(null).then(e).catch(R_)}:Af;function R_(e){setTimeout(function(){throw e})}function hd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),wa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);wa(t)}function ii(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 Zg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var So=Math.random().toString(36).slice(2),Jn="__reactFiber$"+So,_a="__reactProps$"+So,Tr="__reactContainer$"+So,Rf="__reactEvents$"+So,P_="__reactListeners$"+So,M_="__reactHandles$"+So;function Pi(e){var t=e[Jn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Tr]||n[Jn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Zg(e);e!==null;){if(n=e[Jn])return n;e=Zg(e)}return t}e=n,n=e.parentNode}return null}function el(e){return e=e[Jn]||e[Tr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function au(e){return e[_a]||null}var Pf=[],js=-1;function yi(e){return{current:e}}function $e(e){0>js||(e.current=Pf[js],Pf[js]=null,js--)}function Ie(e,t){js++,Pf[js]=e.current,e.current=t}var fi={},Pt=yi(fi),Yt=yi(!1),Xi=fi;function ao(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qt(e){return e=e.childContextTypes,e!=null}function bc(){$e(Yt),$e(Pt)}function Jg(e,t,n){if(Pt.current!==fi)throw Error(G(168));Ie(Pt,t),Ie(Yt,n)}function q1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(G(108,g2(e)||"Unknown",i));return Ye({},n,r)}function kc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,Xi=Pt.current,Ie(Pt,e),Ie(Yt,Yt.current),!0}function ev(e,t,n){var r=e.stateNode;if(!r)throw Error(G(169));n?(e=q1(e,t,Xi),r.__reactInternalMemoizedMergedChildContext=e,$e(Yt),$e(Pt),Ie(Pt,e)):$e(Yt),Ie(Yt,n)}var yr=null,lu=!1,md=!1;function G1(e){yr===null?yr=[e]:yr.push(e)}function O_(e){lu=!0,G1(e)}function xi(){if(!md&&yr!==null){md=!0;var e=0,t=Re;try{var n=yr;for(Re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}yr=null,lu=!1}catch(i){throw yr!==null&&(yr=yr.slice(e+1)),y1(yh,xi),i}finally{Re=t,md=!1}}return null}var As=[],Rs=0,Sc=null,Cc=0,yn=[],xn=0,Zi=null,br=1,kr="";function Ti(e,t){As[Rs++]=Cc,As[Rs++]=Sc,Sc=e,Cc=t}function Y1(e,t,n){yn[xn++]=br,yn[xn++]=kr,yn[xn++]=Zi,Zi=e;var r=br;e=kr;var i=32-Fn(r)-1;r&=~(1<<i),n+=1;var s=32-Fn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,br=1<<32-Fn(t)+i|n<<i|r,kr=s+e}else br=1<<s|n<<i|r,kr=e}function Eh(e){e.return!==null&&(Ti(e,1),Y1(e,1,0))}function jh(e){for(;e===Sc;)Sc=As[--Rs],As[Rs]=null,Cc=As[--Rs],As[Rs]=null;for(;e===Zi;)Zi=yn[--xn],yn[xn]=null,kr=yn[--xn],yn[xn]=null,br=yn[--xn],yn[xn]=null}var sn=null,tn=null,Ue=!1,Dn=null;function Q1(e,t){var n=bn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function tv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sn=e,tn=ii(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sn=e,tn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zi!==null?{id:br,overflow:kr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=bn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sn=e,tn=null,!0):!1;default:return!1}}function Mf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Of(e){if(Ue){var t=tn;if(t){var n=t;if(!tv(e,t)){if(Mf(e))throw Error(G(418));t=ii(n.nextSibling);var r=sn;t&&tv(e,t)?Q1(r,n):(e.flags=e.flags&-4097|2,Ue=!1,sn=e)}}else{if(Mf(e))throw Error(G(418));e.flags=e.flags&-4097|2,Ue=!1,sn=e}}}function nv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sn=e}function Cl(e){if(e!==sn)return!1;if(!Ue)return nv(e),Ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!jf(e.type,e.memoizedProps)),t&&(t=tn)){if(Mf(e))throw K1(),Error(G(418));for(;t;)Q1(e,t),t=ii(t.nextSibling)}if(nv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tn=ii(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tn=null}}else tn=sn?ii(e.stateNode.nextSibling):null;return!0}function K1(){for(var e=tn;e;)e=ii(e.nextSibling)}function lo(){tn=sn=null,Ue=!1}function Ah(e){Dn===null?Dn=[e]:Dn.push(e)}var N_=Pr.ReactCurrentBatchConfig;function Lo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(G(309));var r=n.stateNode}if(!r)throw Error(G(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(G(284));if(!n._owner)throw Error(G(290,e))}return e}function _l(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function rv(e){var t=e._init;return t(e._payload)}function X1(e){function t(h,g){if(e){var b=h.deletions;b===null?(h.deletions=[g],h.flags|=16):b.push(g)}}function n(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 i(h,g){return h=li(h,g),h.index=0,h.sibling=null,h}function s(h,g,b){return h.index=b,e?(b=h.alternate,b!==null?(b=b.index,b<g?(h.flags|=2,g):b):(h.flags|=2,g)):(h.flags|=1048576,g)}function o(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,g,b,T){return g===null||g.tag!==6?(g=kd(b,h.mode,T),g.return=h,g):(g=i(g,b),g.return=h,g)}function l(h,g,b,T){var _=b.type;return _===Ss?d(h,g,b.props.children,T,b.key):g!==null&&(g.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Fr&&rv(_)===g.type)?(T=i(g,b.props),T.ref=Lo(h,g,b),T.return=h,T):(T=ec(b.type,b.key,b.props,null,h.mode,T),T.ref=Lo(h,g,b),T.return=h,T)}function c(h,g,b,T){return g===null||g.tag!==4||g.stateNode.containerInfo!==b.containerInfo||g.stateNode.implementation!==b.implementation?(g=Sd(b,h.mode,T),g.return=h,g):(g=i(g,b.children||[]),g.return=h,g)}function d(h,g,b,T,_){return g===null||g.tag!==7?(g=Wi(b,h.mode,T,_),g.return=h,g):(g=i(g,b),g.return=h,g)}function u(h,g,b){if(typeof g=="string"&&g!==""||typeof g=="number")return g=kd(""+g,h.mode,b),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case hl:return b=ec(g.type,g.key,g.props,null,h.mode,b),b.ref=Lo(h,null,g),b.return=h,b;case ks:return g=Sd(g,h.mode,b),g.return=h,g;case Fr:var T=g._init;return u(h,T(g._payload),b)}if(Ho(g)||Mo(g))return g=Wi(g,h.mode,b,null),g.return=h,g;_l(h,g)}return null}function p(h,g,b,T){var _=g!==null?g.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return _!==null?null:a(h,g,""+b,T);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case hl:return b.key===_?l(h,g,b,T):null;case ks:return b.key===_?c(h,g,b,T):null;case Fr:return _=b._init,p(h,g,_(b._payload),T)}if(Ho(b)||Mo(b))return _!==null?null:d(h,g,b,T,null);_l(h,b)}return null}function m(h,g,b,T,_){if(typeof T=="string"&&T!==""||typeof T=="number")return h=h.get(b)||null,a(g,h,""+T,_);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case hl:return h=h.get(T.key===null?b:T.key)||null,l(g,h,T,_);case ks:return h=h.get(T.key===null?b:T.key)||null,c(g,h,T,_);case Fr:var E=T._init;return m(h,g,b,E(T._payload),_)}if(Ho(T)||Mo(T))return h=h.get(b)||null,d(g,h,T,_,null);_l(g,T)}return null}function y(h,g,b,T){for(var _=null,E=null,S=g,A=g=0,B=null;S!==null&&A<b.length;A++){S.index>A?(B=S,S=null):B=S.sibling;var L=p(h,S,b[A],T);if(L===null){S===null&&(S=B);break}e&&S&&L.alternate===null&&t(h,S),g=s(L,g,A),E===null?_=L:E.sibling=L,E=L,S=B}if(A===b.length)return n(h,S),Ue&&Ti(h,A),_;if(S===null){for(;A<b.length;A++)S=u(h,b[A],T),S!==null&&(g=s(S,g,A),E===null?_=S:E.sibling=S,E=S);return Ue&&Ti(h,A),_}for(S=r(h,S);A<b.length;A++)B=m(S,h,A,b[A],T),B!==null&&(e&&B.alternate!==null&&S.delete(B.key===null?A:B.key),g=s(B,g,A),E===null?_=B:E.sibling=B,E=B);return e&&S.forEach(function(N){return t(h,N)}),Ue&&Ti(h,A),_}function x(h,g,b,T){var _=Mo(b);if(typeof _!="function")throw Error(G(150));if(b=_.call(b),b==null)throw Error(G(151));for(var E=_=null,S=g,A=g=0,B=null,L=b.next();S!==null&&!L.done;A++,L=b.next()){S.index>A?(B=S,S=null):B=S.sibling;var N=p(h,S,L.value,T);if(N===null){S===null&&(S=B);break}e&&S&&N.alternate===null&&t(h,S),g=s(N,g,A),E===null?_=N:E.sibling=N,E=N,S=B}if(L.done)return n(h,S),Ue&&Ti(h,A),_;if(S===null){for(;!L.done;A++,L=b.next())L=u(h,L.value,T),L!==null&&(g=s(L,g,A),E===null?_=L:E.sibling=L,E=L);return Ue&&Ti(h,A),_}for(S=r(h,S);!L.done;A++,L=b.next())L=m(S,h,A,L.value,T),L!==null&&(e&&L.alternate!==null&&S.delete(L.key===null?A:L.key),g=s(L,g,A),E===null?_=L:E.sibling=L,E=L);return e&&S.forEach(function(ee){return t(h,ee)}),Ue&&Ti(h,A),_}function w(h,g,b,T){if(typeof b=="object"&&b!==null&&b.type===Ss&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case hl:e:{for(var _=b.key,E=g;E!==null;){if(E.key===_){if(_=b.type,_===Ss){if(E.tag===7){n(h,E.sibling),g=i(E,b.props.children),g.return=h,h=g;break e}}else if(E.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Fr&&rv(_)===E.type){n(h,E.sibling),g=i(E,b.props),g.ref=Lo(h,E,b),g.return=h,h=g;break e}n(h,E);break}else t(h,E);E=E.sibling}b.type===Ss?(g=Wi(b.props.children,h.mode,T,b.key),g.return=h,h=g):(T=ec(b.type,b.key,b.props,null,h.mode,T),T.ref=Lo(h,g,b),T.return=h,h=T)}return o(h);case ks:e:{for(E=b.key;g!==null;){if(g.key===E)if(g.tag===4&&g.stateNode.containerInfo===b.containerInfo&&g.stateNode.implementation===b.implementation){n(h,g.sibling),g=i(g,b.children||[]),g.return=h,h=g;break e}else{n(h,g);break}else t(h,g);g=g.sibling}g=Sd(b,h.mode,T),g.return=h,h=g}return o(h);case Fr:return E=b._init,w(h,g,E(b._payload),T)}if(Ho(b))return y(h,g,b,T);if(Mo(b))return x(h,g,b,T);_l(h,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,g!==null&&g.tag===6?(n(h,g.sibling),g=i(g,b),g.return=h,h=g):(n(h,g),g=kd(b,h.mode,T),g.return=h,h=g),o(h)):n(h,g)}return w}var co=X1(!0),Z1=X1(!1),_c=yi(null),Tc=null,Ps=null,Rh=null;function Ph(){Rh=Ps=Tc=null}function Mh(e){var t=_c.current;$e(_c),e._currentValue=t}function Nf(e,t,n){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===n)break;e=e.return}}function Hs(e,t){Tc=e,Rh=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gt=!0),e.firstContext=null)}function Cn(e){var t=e._currentValue;if(Rh!==e)if(e={context:e,memoizedValue:t,next:null},Ps===null){if(Tc===null)throw Error(G(308));Ps=e,Tc.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return t}var Mi=null;function Oh(e){Mi===null?Mi=[e]:Mi.push(e)}function J1(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Oh(t)):(n.next=i.next,i.next=n),t.interleaved=n,Er(e,r)}function Er(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Br=!1;function Nh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ew(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Sr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ee&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Er(e,n)}return i=r.interleaved,i===null?(t.next=t,Oh(r)):(t.next=i.next,i.next=t),r.interleaved=t,Er(e,n)}function Yl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xh(e,n)}}function iv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ec(e,t,n,r){var i=e.updateQueue;Br=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,x=a;switch(p=t,m=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){u=y.call(m,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,p=typeof y=="function"?y.call(m,u,p):y,p==null)break e;u=Ye({},u,p);break e;case 2:Br=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,l=u):d=d.next=m,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);es|=o,e.lanes=o,e.memoizedState=u}}function sv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(G(191,i));i.call(r)}}}var tl={},nr=yi(tl),Ta=yi(tl),Ea=yi(tl);function Oi(e){if(e===tl)throw Error(G(174));return e}function Dh(e,t){switch(Ie(Ea,t),Ie(Ta,e),Ie(nr,tl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hf(t,e)}$e(nr),Ie(nr,t)}function uo(){$e(nr),$e(Ta),$e(Ea)}function tw(e){Oi(Ea.current);var t=Oi(nr.current),n=hf(t,e.type);t!==n&&(Ie(Ta,e),Ie(nr,n))}function Ih(e){Ta.current===e&&($e(nr),$e(Ta))}var We=yi(0);function jc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 gd=[];function Lh(){for(var e=0;e<gd.length;e++)gd[e]._workInProgressVersionPrimary=null;gd.length=0}var Ql=Pr.ReactCurrentDispatcher,vd=Pr.ReactCurrentBatchConfig,Ji=0,Ge=null,lt=null,pt=null,Ac=!1,ra=!1,ja=0,D_=0;function Ct(){throw Error(G(321))}function Fh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zn(e[n],t[n]))return!1;return!0}function Bh(e,t,n,r,i,s){if(Ji=s,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ql.current=e===null||e.memoizedState===null?B_:$_,e=n(r,i),ra){s=0;do{if(ra=!1,ja=0,25<=s)throw Error(G(301));s+=1,pt=lt=null,t.updateQueue=null,Ql.current=z_,e=n(r,i)}while(ra)}if(Ql.current=Rc,t=lt!==null&&lt.next!==null,Ji=0,pt=lt=Ge=null,Ac=!1,t)throw Error(G(300));return e}function $h(){var e=ja!==0;return ja=0,e}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ge.memoizedState=pt=e:pt=pt.next=e,pt}function _n(){if(lt===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=pt===null?Ge.memoizedState:pt.next;if(t!==null)pt=t,lt=e;else{if(e===null)throw Error(G(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},pt===null?Ge.memoizedState=pt=e:pt=pt.next=e}return pt}function Aa(e,t){return typeof t=="function"?t(e):t}function yd(e){var t=_n(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((Ji&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=u,o=r):l=l.next=u,Ge.lanes|=d,es|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,zn(r,t.memoizedState)||(Gt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ge.lanes|=s,es|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function xd(e){var t=_n(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);zn(s,t.memoizedState)||(Gt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function nw(){}function rw(e,t){var n=Ge,r=_n(),i=t(),s=!zn(r.memoizedState,i);if(s&&(r.memoizedState=i,Gt=!0),r=r.queue,zh(ow.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||pt!==null&&pt.memoizedState.tag&1){if(n.flags|=2048,Ra(9,sw.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(G(349));Ji&30||iw(n,t,i)}return i}function iw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function sw(e,t,n,r){t.value=n,t.getSnapshot=r,aw(t)&&lw(e)}function ow(e,t,n){return n(function(){aw(t)&&lw(e)})}function aw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zn(e,n)}catch{return!0}}function lw(e){var t=Er(e,1);t!==null&&Bn(t,e,1,-1)}function ov(e){var t=Gn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Aa,lastRenderedState:e},t.queue=e,e=e.dispatch=F_.bind(null,Ge,e),[t.memoizedState,e]}function Ra(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function cw(){return _n().memoizedState}function Kl(e,t,n,r){var i=Gn();Ge.flags|=e,i.memoizedState=Ra(1|t,n,void 0,r===void 0?null:r)}function cu(e,t,n,r){var i=_n();r=r===void 0?null:r;var s=void 0;if(lt!==null){var o=lt.memoizedState;if(s=o.destroy,r!==null&&Fh(r,o.deps)){i.memoizedState=Ra(t,n,s,r);return}}Ge.flags|=e,i.memoizedState=Ra(1|t,n,s,r)}function av(e,t){return Kl(8390656,8,e,t)}function zh(e,t){return cu(2048,8,e,t)}function uw(e,t){return cu(4,2,e,t)}function dw(e,t){return cu(4,4,e,t)}function fw(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 pw(e,t,n){return n=n!=null?n.concat([e]):null,cu(4,4,fw.bind(null,t,e),n)}function Vh(){}function hw(e,t){var n=_n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function mw(e,t){var n=_n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gw(e,t,n){return Ji&21?(zn(n,t)||(n=b1(),Ge.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gt=!0),e.memoizedState=n)}function I_(e,t){var n=Re;Re=n!==0&&4>n?n:4,e(!0);var r=vd.transition;vd.transition={};try{e(!1),t()}finally{Re=n,vd.transition=r}}function vw(){return _n().memoizedState}function L_(e,t,n){var r=ai(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yw(e))xw(t,n);else if(n=J1(e,t,n,r),n!==null){var i=It();Bn(n,e,r,i),ww(n,t,r)}}function F_(e,t,n){var r=ai(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yw(e))xw(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,zn(a,o)){var l=t.interleaved;l===null?(i.next=i,Oh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=J1(e,t,i,r),n!==null&&(i=It(),Bn(n,e,r,i),ww(n,t,r))}}function yw(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function xw(e,t){ra=Ac=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ww(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xh(e,n)}}var Rc={readContext:Cn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},B_={readContext:Cn,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:Cn,useEffect:av,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Kl(4194308,4,fw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Kl(4,2,e,t)},useMemo:function(e,t){var n=Gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gn();return t=n!==void 0?n(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=L_.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:ov,useDebugValue:Vh,useDeferredValue:function(e){return Gn().memoizedState=e},useTransition:function(){var e=ov(!1),t=e[0];return e=I_.bind(null,e[1]),Gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,i=Gn();if(Ue){if(n===void 0)throw Error(G(407));n=n()}else{if(n=t(),ht===null)throw Error(G(349));Ji&30||iw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,av(ow.bind(null,r,s,e),[e]),r.flags|=2048,Ra(9,sw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Gn(),t=ht.identifierPrefix;if(Ue){var n=kr,r=br;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ja++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=D_++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$_={readContext:Cn,useCallback:hw,useContext:Cn,useEffect:zh,useImperativeHandle:pw,useInsertionEffect:uw,useLayoutEffect:dw,useMemo:mw,useReducer:yd,useRef:cw,useState:function(){return yd(Aa)},useDebugValue:Vh,useDeferredValue:function(e){var t=_n();return gw(t,lt.memoizedState,e)},useTransition:function(){var e=yd(Aa)[0],t=_n().memoizedState;return[e,t]},useMutableSource:nw,useSyncExternalStore:rw,useId:vw,unstable_isNewReconciler:!1},z_={readContext:Cn,useCallback:hw,useContext:Cn,useEffect:zh,useImperativeHandle:pw,useInsertionEffect:uw,useLayoutEffect:dw,useMemo:mw,useReducer:xd,useRef:cw,useState:function(){return xd(Aa)},useDebugValue:Vh,useDeferredValue:function(e){var t=_n();return lt===null?t.memoizedState=e:gw(t,lt.memoizedState,e)},useTransition:function(){var e=xd(Aa)[0],t=_n().memoizedState;return[e,t]},useMutableSource:nw,useSyncExternalStore:rw,useId:vw,unstable_isNewReconciler:!1};function Pn(e,t){if(e&&e.defaultProps){t=Ye({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Df(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ye({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var uu={isMounted:function(e){return(e=e._reactInternals)?os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=Sr(r,i);s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&(Bn(t,e,i,r),Yl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=Sr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&(Bn(t,e,i,r),Yl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=It(),r=ai(e),i=Sr(n,r);i.tag=2,t!=null&&(i.callback=t),t=si(e,i,r),t!==null&&(Bn(t,e,r,n),Yl(t,e,r))}};function lv(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!ka(n,r)||!ka(i,s):!0}function bw(e,t,n){var r=!1,i=fi,s=t.contextType;return typeof s=="object"&&s!==null?s=Cn(s):(i=Qt(t)?Xi:Pt.current,r=t.contextTypes,s=(r=r!=null)?ao(e,i):fi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=uu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function cv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&uu.enqueueReplaceState(t,t.state,null)}function If(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Nh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Cn(s):(s=Qt(t)?Xi:Pt.current,i.context=ao(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Df(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&uu.enqueueReplaceState(i,i.state,null),Ec(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function fo(e,t){try{var n="",r=t;do n+=m2(r),r=r.return;while(r);var i=n}catch(s){i=`
39
39
  Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:i,digest:null}}function bd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ff(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var V_=typeof WeakMap=="function"?WeakMap:Map;function Sw(e,t,n){n=kr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Mc||(Mc=!0,Yf=r),Ff(e,t)},n}function Cw(e,t,n){n=kr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ff(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Ff(e,t),typeof r!="function"&&(si===null?si=new Set([this]):si.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function dv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new V_;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=nT.bind(null,e,t,n),t.then(e,e))}function fv(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 pv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kr(-1,1),t.tag=2,ii(n,t,1))),n.lanes|=1),e)}var U_=Rr.ReactCurrentOwner,Gt=!1;function Nt(e,t,n,r){t.child=e===null?J1(t,null,n,r):co(t,e.child,n,r)}function hv(e,t,n,r,i){n=n.render;var s=t.ref;return Hs(t,i),r=$h(e,t,n,r,s,i),n=zh(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(Ue&&n&&jh(t),t.flags|=1,Nt(e,t,r,i),t.child)}function mv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Xh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,_w(e,t,s,r,i)):(e=ec(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ka,n(o,r)&&e.ref===t.ref)return Er(e,t,i)}return t.flags|=1,e=ai(s,r),e.ref=t.ref,e.return=t,t.child=e}function _w(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ka(s,r)&&e.ref===t.ref)if(Gt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Gt=!0);else return t.lanes=e.lanes,Er(e,t,i)}return Bf(e,t,n,r,i)}function Tw(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ie(Os,en),en|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ie(Os,en),en|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ie(Os,en),en|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ie(Os,en),en|=r;return Nt(e,t,i,n),t.child}function Ew(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Bf(e,t,n,r,i){var s=Qt(n)?Xi:Pt.current;return s=ao(t,s),Hs(t,i),n=$h(e,t,n,r,s,i),r=zh(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(Ue&&r&&jh(t),t.flags|=1,Nt(e,t,n,i),t.child)}function gv(e,t,n,r,i){if(Qt(n)){var s=!0;kc(t)}else s=!1;if(Hs(t,i),t.stateNode===null)Xl(e,t),kw(t,n,r),Lf(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Cn(u):(u=Qt(n)?Xi:Pt.current,u=ao(t,u));var d=n.getDerivedStateFromProps,c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";c||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&uv(t,o,r,u),Fr=!1;var f=t.memoizedState;o.state=f,Ec(t,r,o,i),l=t.memoizedState,a!==r||f!==l||Yt.current||Fr?(typeof d=="function"&&(If(t,n,d,r),l=t.memoizedState),(a=Fr||cv(t,n,a,r,f,l,u))?(c||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,tw(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Pn(t.type,a),o.props=u,c=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Cn(l):(l=Qt(n)?Xi:Pt.current,l=ao(t,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==c||f!==l)&&uv(t,o,r,l),Fr=!1,f=t.memoizedState,o.state=f,Ec(t,r,o,i);var y=t.memoizedState;a!==c||f!==y||Yt.current||Fr?(typeof m=="function"&&(If(t,n,m,r),y=t.memoizedState),(u=Fr||cv(t,n,u,r,f,y,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return $f(e,t,n,r,s,i)}function $f(e,t,n,r,i,s){Ew(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&tv(t,n,!1),Er(e,t,s);r=t.stateNode,U_.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=co(t,e.child,null,s),t.child=co(t,null,a,s)):Nt(e,t,a,s),t.memoizedState=r.state,i&&tv(t,n,!0),t.child}function jw(e){var t=e.stateNode;t.pendingContext?ev(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ev(e,t.context,!1),Ih(e,t.containerInfo)}function vv(e,t,n,r,i){return lo(),Rh(i),t.flags|=256,Nt(e,t,n,r),t.child}var zf={dehydrated:null,treeContext:null,retryLane:0};function Vf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Aw(e,t,n){var r=t.pendingProps,i=We.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ie(We,i&1),e===null)return Nf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pu(o,r,0,null),e=Wi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Vf(n),t.memoizedState=zf,e):Hh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return H_(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ai(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=ai(a,s):(s=Wi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Vf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=zf,r}return s=e.child,e=s.sibling,r=ai(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Hh(e,t){return t=pu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Tl(e,t,n,r){return r!==null&&Rh(r),co(t,e.child,null,n),e=Hh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function H_(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=bd(Error(G(422))),Tl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=pu({mode:"visible",children:r.children},i,0,null),s=Wi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&co(t,e.child,null,o),t.child.memoizedState=Vf(o),t.memoizedState=zf,s);if(!(t.mode&1))return Tl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(G(419)),r=bd(s,r,void 0),Tl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Gt||a){if(r=ht,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Tr(e,i),Bn(r,e,i,-1))}return Kh(),r=bd(Error(G(421))),Tl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=rT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,tn=ri(i.nextSibling),sn=t,Ue=!0,Dn=null,e!==null&&(yn[xn++]=wr,yn[xn++]=br,yn[xn++]=Zi,wr=e.id,br=e.overflow,Zi=t),t=Hh(t,r.children),t.flags|=4096,t)}function yv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Df(e.return,t,n)}function kd(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Rw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Nt(e,t,r.children,n),r=We.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yv(e,n,t);else if(e.tag===19)yv(e,n,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(Ie(We,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&jc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kd(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kd(t,!0,n,null,s);break;case"together":kd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Er(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function W_(e,t,n){switch(t.tag){case 3:jw(t),lo();break;case 5:nw(t);break;case 1:Qt(t.type)&&kc(t);break;case 4:Ih(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ie(_c,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ie(We,We.current&1),t.flags|=128,null):n&t.child.childLanes?Aw(e,t,n):(Ie(We,We.current&1),e=Er(e,t,n),e!==null?e.sibling:null);Ie(We,We.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Rw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ie(We,We.current),r)break;return null;case 22:case 23:return t.lanes=0,Tw(e,t,n)}return Er(e,t,n)}var Pw,Uf,Mw,Ow;Pw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Uf=function(){};Mw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Oi(nr.current);var s=null;switch(n){case"input":i=df(e,i),r=df(e,r),s=[];break;case"select":i=Ye({},i,{value:void 0}),r=Ye({},r,{value:void 0}),s=[];break;case"textarea":i=hf(e,i),r=hf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=wc)}gf(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ma.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ma.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Fe("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};Ow=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fo(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function q_(e,t,n){var r=t.pendingProps;switch(Ah(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(t),null;case 1:return Qt(t.type)&&bc(),_t(t),null;case 3:return r=t.stateNode,uo(),$e(Yt),$e(Pt),Fh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Cl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dn!==null&&(Xf(Dn),Dn=null))),Uf(e,t),_t(t),null;case 5:Lh(t);var i=Oi(Ea.current);if(n=t.type,e!==null&&t.stateNode!=null)Mw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(G(166));return _t(t),null}if(e=Oi(nr.current),Cl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Jn]=t,r[_a]=s,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(i=0;i<qo.length;i++)Fe(qo[i],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":Eg(r,s),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Fe("invalid",r);break;case"textarea":Ag(r,s),Fe("invalid",r)}gf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Sl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Sl(r.textContent,a,e),i=["children",""+a]):ma.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Fe("scroll",r)}switch(n){case"input":ml(r),jg(r,s,!0);break;case"textarea":ml(r),Rg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=wc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=a1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Jn]=t,e[_a]=r,Pw(e,t,!1,!1),t.stateNode=e;e:{switch(o=vf(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),i=r;break;case"iframe":case"object":case"embed":Fe("load",e),i=r;break;case"video":case"audio":for(i=0;i<qo.length;i++)Fe(qo[i],e);i=r;break;case"source":Fe("error",e),i=r;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=r;break;case"details":Fe("toggle",e),i=r;break;case"input":Eg(e,r),i=df(e,r),Fe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ye({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":Ag(e,r),i=hf(e,r),Fe("invalid",e);break;default:i=r}gf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?u1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&l1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ga(e,l):typeof l=="number"&&ga(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ma.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Fe("scroll",e):l!=null&&hh(e,s,l,o))}switch(n){case"input":ml(e),jg(e,r,!1);break;case"textarea":ml(e),Rg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ui(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?$s(e,!!r.multiple,s,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=wc)}switch(n){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 _t(t),null;case 6:if(e&&t.stateNode!=null)Ow(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(G(166));if(n=Oi(Ea.current),Oi(nr.current),Cl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Jn]=t,(s=r.nodeValue!==n)&&(e=sn,e!==null))switch(e.tag){case 3:Sl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Jn]=t,t.stateNode=r}return _t(t),null;case 13:if($e(We),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ue&&tn!==null&&t.mode&1&&!(t.flags&128))X1(),lo(),t.flags|=98560,s=!1;else if(s=Cl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(G(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(G(317));s[Jn]=t}else lo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_t(t),s=!1}else Dn!==null&&(Xf(Dn),Dn=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||We.current&1?ut===0&&(ut=3):Kh())),t.updateQueue!==null&&(t.flags|=4),_t(t),null);case 4:return uo(),Uf(e,t),e===null&&Sa(t.stateNode.containerInfo),_t(t),null;case 10:return Oh(t.type._context),_t(t),null;case 17:return Qt(t.type)&&bc(),_t(t),null;case 19:if($e(We),s=t.memoizedState,s===null)return _t(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Fo(s,!1);else{if(ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jc(e),o!==null){for(t.flags|=128,Fo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ie(We,We.current&1|2),t.child}e=e.sibling}s.tail!==null&&nt()>po&&(t.flags|=128,r=!0,Fo(s,!1),t.lanes=4194304)}else{if(!r)if(e=jc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ue)return _t(t),null}else 2*nt()-s.renderingStartTime>po&&n!==1073741824&&(t.flags|=128,r=!0,Fo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=nt(),t.sibling=null,n=We.current,Ie(We,r?n&1|2:n&1),t):(_t(t),null);case 22:case 23:return Qh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?en&1073741824&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function G_(e,t){switch(Ah(t),t.tag){case 1:return Qt(t.type)&&bc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),$e(Yt),$e(Pt),Fh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lh(t),null;case 13:if($e(We),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(We),null;case 4:return uo(),null;case 10:return Oh(t.type._context),null;case 22:case 23:return Qh(),null;case 24:return null;default:return null}}var El=!1,jt=!1,Y_=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function Hf(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var xv=!1;function Q_(e,t){if(Ef=vc,e=F1(),Eh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==n||i!==0&&c.nodeType!==3||(a=o+i),c!==s||r!==0&&c.nodeType!==3||(l=o+r),c.nodeType===3&&(o+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++d===r&&(l=o),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(jf={focusedElem:e,selectionRange:n},vc=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,w=y.memoizedState,h=t.stateNode,v=h.getSnapshotBeforeUpdate(t.elementType===t.type?x:Pn(t.type,x),w);h.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(T){Xe(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return y=xv,xv=!1,y}function ia(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Hf(t,n,s)}i=i.next}while(i!==r)}}function du(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Wf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Nw(e){var t=e.alternate;t!==null&&(e.alternate=null,Nw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jn],delete t[_a],delete t[Pf],delete t[P_],delete t[M_])),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 Dw(e){return e.tag===5||e.tag===3||e.tag===4}function wv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dw(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 qf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wc));else if(r!==4&&(e=e.child,e!==null))for(qf(e,t,n),e=e.sibling;e!==null;)qf(e,t,n),e=e.sibling}function Gf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Gf(e,t,n),e=e.sibling;e!==null;)Gf(e,t,n),e=e.sibling}var xt=null,On=!1;function Nr(e,t,n){for(n=n.child;n!==null;)Iw(e,t,n),n=n.sibling}function Iw(e,t,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(ru,n)}catch{}switch(n.tag){case 5:jt||Ms(n,t);case 6:var r=xt,i=On;xt=null,Nr(e,t,n),xt=r,On=i,xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?md(e.parentNode,n):e.nodeType===1&&md(e,n),wa(e)):md(xt,n.stateNode));break;case 4:r=xt,i=On,xt=n.stateNode.containerInfo,On=!0,Nr(e,t,n),xt=r,On=i;break;case 0:case 11:case 14:case 15:if(!jt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Hf(n,t,o),i=i.next}while(i!==r)}Nr(e,t,n);break;case 1:if(!jt&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Xe(n,t,a)}Nr(e,t,n);break;case 21:Nr(e,t,n);break;case 22:n.mode&1?(jt=(r=jt)||n.memoizedState!==null,Nr(e,t,n),jt=r):Nr(e,t,n);break;default:Nr(e,t,n)}}function bv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Y_),t.forEach(function(r){var i=iT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:xt=a.stateNode,On=!1;break e;case 3:xt=a.stateNode.containerInfo,On=!0;break e;case 4:xt=a.stateNode.containerInfo,On=!0;break e}a=a.return}if(xt===null)throw Error(G(160));Iw(s,o,i),xt=null,On=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Xe(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Lw(t,e),t=t.sibling}function Lw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),Hn(e),r&4){try{ia(3,e,e.return),du(3,e)}catch(x){Xe(e,e.return,x)}try{ia(5,e,e.return)}catch(x){Xe(e,e.return,x)}}break;case 1:jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var i=e.stateNode;try{ga(i,"")}catch(x){Xe(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&s1(i,s),vf(a,o);var u=vf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],c=l[o+1];d==="style"?u1(i,c):d==="dangerouslySetInnerHTML"?l1(i,c):d==="children"?ga(i,c):hh(i,d,c,u)}switch(a){case"input":ff(i,s);break;case"textarea":o1(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?$s(i,!!s.multiple,m,!1):f!==!!s.multiple&&(s.defaultValue!=null?$s(i,!!s.multiple,s.defaultValue,!0):$s(i,!!s.multiple,s.multiple?[]:"",!1))}i[_a]=s}catch(x){Xe(e,e.return,x)}}break;case 6:if(jn(t,e),Hn(e),r&4){if(e.stateNode===null)throw Error(G(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){Xe(e,e.return,x)}}break;case 3:if(jn(t,e),Hn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wa(t.containerInfo)}catch(x){Xe(e,e.return,x)}break;case 4:jn(t,e),Hn(e);break;case 13:jn(t,e),Hn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Gh=nt())),r&4&&bv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(jt=(u=jt)||d,jn(t,e),jt=u):jn(t,e),Hn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ce=e,d=e.child;d!==null;){for(c=ce=d;ce!==null;){switch(f=ce,m=f.child,f.tag){case 0:case 11:case 14:case 15:ia(4,f,f.return);break;case 1:Ms(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){Xe(r,n,x)}}break;case 5:Ms(f,f.return);break;case 22:if(f.memoizedState!==null){Sv(c);continue}}m!==null?(m.return=f,ce=m):Sv(c)}d=d.sibling}e:for(d=null,c=e;;){if(c.tag===5){if(d===null){d=c;try{i=c.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=c.stateNode,l=c.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=c1("display",o))}catch(x){Xe(e,e.return,x)}}}else if(c.tag===6){if(d===null)try{c.stateNode.nodeValue=u?"":c.memoizedProps}catch(x){Xe(e,e.return,x)}}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:jn(t,e),Hn(e),r&4&&bv(e);break;case 21:break;default:jn(t,e),Hn(e)}}function Hn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Dw(n)){var r=n;break e}n=n.return}throw Error(G(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ga(i,""),r.flags&=-33);var s=wv(e);Gf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=wv(e);qf(e,a,o);break;default:throw Error(G(161))}}catch(l){Xe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function K_(e,t,n){ce=e,Fw(e)}function Fw(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var i=ce,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||El;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||jt;a=El;var u=jt;if(El=o,(jt=l)&&!u)for(ce=i;ce!==null;)o=ce,l=o.child,o.tag===22&&o.memoizedState!==null?Cv(i):l!==null?(l.return=o,ce=l):Cv(i);for(;s!==null;)ce=s,Fw(s),s=s.sibling;ce=i,El=a,jt=u}kv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ce=s):kv(e)}}function kv(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||du(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!jt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Pn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ov(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ov(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.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&&wa(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}jt||t.flags&512&&Wf(t)}catch(f){Xe(t,t.return,f)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Sv(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Cv(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{du(4,t)}catch(l){Xe(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Xe(t,i,l)}}var s=t.return;try{Wf(t)}catch(l){Xe(t,s,l)}break;case 5:var o=t.return;try{Wf(t)}catch(l){Xe(t,o,l)}}}catch(l){Xe(t,t.return,l)}if(t===e){ce=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ce=a;break}ce=t.return}}var X_=Math.ceil,Pc=Rr.ReactCurrentDispatcher,Wh=Rr.ReactCurrentOwner,kn=Rr.ReactCurrentBatchConfig,Ee=0,ht=null,it=null,bt=0,en=0,Os=yi(0),ut=0,Pa=null,es=0,fu=0,qh=0,sa=null,Ht=null,Gh=0,po=1/0,gr=null,Mc=!1,Yf=null,si=null,jl=!1,Zr=null,Oc=0,oa=0,Qf=null,Zl=-1,Jl=0;function It(){return Ee&6?nt():Zl!==-1?Zl:Zl=nt()}function oi(e){return e.mode&1?Ee&2&&bt!==0?bt&-bt:N_.transition!==null?(Jl===0&&(Jl=k1()),Jl):(e=Re,e!==0||(e=window.event,e=e===void 0?16:A1(e.type)),e):1}function Bn(e,t,n,r){if(50<oa)throw oa=0,Qf=null,Error(G(185));Za(e,n,r),(!(Ee&2)||e!==ht)&&(e===ht&&(!(Ee&2)&&(fu|=n),ut===4&&zr(e,bt)),Kt(e,r),n===1&&Ee===0&&!(t.mode&1)&&(po=nt()+500,lu&&xi()))}function Kt(e,t){var n=e.callbackNode;N2(e,t);var r=gc(e,e===ht?bt:0);if(r===0)n!==null&&Og(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Og(n),t===1)e.tag===0?O_(_v.bind(null,e)):Y1(_v.bind(null,e)),A_(function(){!(Ee&6)&&xi()}),n=null;else{switch(S1(r)){case 1:n=xh;break;case 4:n=w1;break;case 16:n=mc;break;case 536870912:n=b1;break;default:n=mc}n=qw(n,Bw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Bw(e,t){if(Zl=-1,Jl=0,Ee&6)throw Error(G(327));var n=e.callbackNode;if(Ws()&&e.callbackNode!==n)return null;var r=gc(e,e===ht?bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Nc(e,r);else{t=r;var i=Ee;Ee|=2;var s=zw();(ht!==e||bt!==t)&&(gr=null,po=nt()+500,Hi(e,t));do try{eT();break}catch(a){$w(e,a)}while(!0);Mh(),Pc.current=s,Ee=i,it!==null?t=0:(ht=null,bt=0,t=ut)}if(t!==0){if(t===2&&(i=kf(e),i!==0&&(r=i,t=Kf(e,i))),t===1)throw n=Pa,Hi(e,0),zr(e,r),Kt(e,nt()),n;if(t===6)zr(e,r);else{if(i=e.current.alternate,!(r&30)&&!Z_(i)&&(t=Nc(e,r),t===2&&(s=kf(e),s!==0&&(r=s,t=Kf(e,s))),t===1))throw n=Pa,Hi(e,0),zr(e,r),Kt(e,nt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(G(345));case 2:Ei(e,Ht,gr);break;case 3:if(zr(e,r),(r&130023424)===r&&(t=Gh+500-nt(),10<t)){if(gc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){It(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Rf(Ei.bind(null,e,Ht,gr),t);break}Ei(e,Ht,gr);break;case 4:if(zr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Fn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*X_(r/1960))-r,10<r){e.timeoutHandle=Rf(Ei.bind(null,e,Ht,gr),r);break}Ei(e,Ht,gr);break;case 5:Ei(e,Ht,gr);break;default:throw Error(G(329))}}}return Kt(e,nt()),e.callbackNode===n?Bw.bind(null,e):null}function Kf(e,t){var n=sa;return e.current.memoizedState.isDehydrated&&(Hi(e,t).flags|=256),e=Nc(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&Xf(t)),e}function Xf(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function Z_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!zn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 zr(e,t){for(t&=~qh,t&=~fu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fn(t),r=1<<n;e[n]=-1,t&=~r}}function _v(e){if(Ee&6)throw Error(G(327));Ws();var t=gc(e,0);if(!(t&1))return Kt(e,nt()),null;var n=Nc(e,t);if(e.tag!==0&&n===2){var r=kf(e);r!==0&&(t=r,n=Kf(e,r))}if(n===1)throw n=Pa,Hi(e,0),zr(e,t),Kt(e,nt()),n;if(n===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,Ht,gr),Kt(e,nt()),null}function Yh(e,t){var n=Ee;Ee|=1;try{return e(t)}finally{Ee=n,Ee===0&&(po=nt()+500,lu&&xi())}}function ts(e){Zr!==null&&Zr.tag===0&&!(Ee&6)&&Ws();var t=Ee;Ee|=1;var n=kn.transition,r=Re;try{if(kn.transition=null,Re=1,e)return e()}finally{Re=r,kn.transition=n,Ee=t,!(Ee&6)&&xi()}}function Qh(){en=Os.current,$e(Os)}function Hi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,j_(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(Ah(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&bc();break;case 3:uo(),$e(Yt),$e(Pt),Fh();break;case 5:Lh(r);break;case 4:uo();break;case 13:$e(We);break;case 19:$e(We);break;case 10:Oh(r.type._context);break;case 22:case 23:Qh()}n=n.return}if(ht=e,it=e=ai(e.current,null),bt=en=t,ut=0,Pa=null,qh=fu=es=0,Ht=sa=null,Mi!==null){for(t=0;t<Mi.length;t++)if(n=Mi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Mi=null}return e}function $w(e,t){do{var n=it;try{if(Mh(),Ql.current=Rc,Ac){for(var r=Ge.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ac=!1}if(Ji=0,pt=lt=Ge=null,ra=!1,ja=0,Wh.current=null,n===null||n.return===null){ut=1,Pa=t,it=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,c=d.tag;if(!(d.mode&1)&&(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=fv(o);if(m!==null){m.flags&=-257,pv(m,o,a,s,t),m.mode&1&&dv(s,u,t),t=m,l=u;var y=t.updateQueue;if(y===null){var x=new Set;x.add(l),t.updateQueue=x}else y.add(l);break e}else{if(!(t&1)){dv(s,u,t),Kh();break e}l=Error(G(426))}}else if(Ue&&a.mode&1){var w=fv(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),pv(w,o,a,s,t),Rh(fo(l,a));break e}}s=l=fo(l,a),ut!==4&&(ut=2),sa===null?sa=[s]:sa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var h=Sw(s,l,t);sv(s,h);break e;case 1:a=l;var v=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(si===null||!si.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var T=Cw(s,a,t);sv(s,T);break e}}s=s.return}while(s!==null)}Uw(n)}catch(C){t=C,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function zw(){var e=Pc.current;return Pc.current=Rc,e===null?Rc:e}function Kh(){(ut===0||ut===3||ut===2)&&(ut=4),ht===null||!(es&268435455)&&!(fu&268435455)||zr(ht,bt)}function Nc(e,t){var n=Ee;Ee|=2;var r=zw();(ht!==e||bt!==t)&&(gr=null,Hi(e,t));do try{J_();break}catch(i){$w(e,i)}while(!0);if(Mh(),Ee=n,Pc.current=r,it!==null)throw Error(G(261));return ht=null,bt=0,ut}function J_(){for(;it!==null;)Vw(it)}function eT(){for(;it!==null&&!_2();)Vw(it)}function Vw(e){var t=Ww(e.alternate,e,en);e.memoizedProps=e.pendingProps,t===null?Uw(e):it=t,Wh.current=null}function Uw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=G_(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,it=null;return}}else if(n=q_(n,t,en),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);ut===0&&(ut=5)}function Ei(e,t,n){var r=Re,i=kn.transition;try{kn.transition=null,Re=1,tT(e,t,n,r)}finally{kn.transition=i,Re=r}return null}function tT(e,t,n,r){do Ws();while(Zr!==null);if(Ee&6)throw Error(G(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(D2(e,s),e===ht&&(it=ht=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||jl||(jl=!0,qw(mc,function(){return Ws(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=kn.transition,kn.transition=null;var o=Re;Re=1;var a=Ee;Ee|=4,Wh.current=null,Q_(e,n),Lw(n,e),b_(jf),vc=!!Ef,jf=Ef=null,e.current=n,K_(n),T2(),Ee=a,Re=o,kn.transition=s}else e.current=n;if(jl&&(jl=!1,Zr=e,Oc=i),s=e.pendingLanes,s===0&&(si=null),A2(n.stateNode),Kt(e,nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Mc)throw Mc=!1,e=Yf,Yf=null,e;return Oc&1&&e.tag!==0&&Ws(),s=e.pendingLanes,s&1?e===Qf?oa++:(oa=0,Qf=e):oa=0,xi(),null}function Ws(){if(Zr!==null){var e=S1(Oc),t=kn.transition,n=Re;try{if(kn.transition=null,Re=16>e?16:e,Zr===null)var r=!1;else{if(e=Zr,Zr=null,Oc=0,Ee&6)throw Error(G(331));var i=Ee;for(Ee|=4,ce=e.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(ce=u;ce!==null;){var d=ce;switch(d.tag){case 0:case 11:case 15:ia(8,d,s)}var c=d.child;if(c!==null)c.return=d,ce=c;else for(;ce!==null;){d=ce;var f=d.sibling,m=d.return;if(Nw(d),d===u){ce=null;break}if(f!==null){f.return=m,ce=f;break}ce=m}}}var y=s.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==null)}}ce=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ce=o;else e:for(;ce!==null;){if(s=ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ia(9,s,s.return)}var h=s.sibling;if(h!==null){h.return=s.return,ce=h;break e}ce=s.return}}var v=e.current;for(ce=v;ce!==null;){o=ce;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,ce=b;else e:for(o=v;ce!==null;){if(a=ce,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:du(9,a)}}catch(C){Xe(a,a.return,C)}if(a===o){ce=null;break e}var T=a.sibling;if(T!==null){T.return=a.return,ce=T;break e}ce=a.return}}if(Ee=i,xi(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(ru,e)}catch{}r=!0}return r}finally{Re=n,kn.transition=t}}return!1}function Tv(e,t,n){t=fo(n,t),t=Sw(e,t,1),e=ii(e,t,1),t=It(),e!==null&&(Za(e,1,t),Kt(e,t))}function Xe(e,t,n){if(e.tag===3)Tv(e,e,n);else for(;t!==null;){if(t.tag===3){Tv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(si===null||!si.has(r))){e=fo(n,e),e=Cw(t,e,1),t=ii(t,e,1),e=It(),t!==null&&(Za(t,1,e),Kt(t,e));break}}t=t.return}}function nT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=It(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(bt&n)===n&&(ut===4||ut===3&&(bt&130023424)===bt&&500>nt()-Gh?Hi(e,0):qh|=n),Kt(e,t)}function Hw(e,t){t===0&&(e.mode&1?(t=yl,yl<<=1,!(yl&130023424)&&(yl=4194304)):t=1);var n=It();e=Tr(e,t),e!==null&&(Za(e,t,n),Kt(e,n))}function rT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Hw(e,n)}function iT(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(G(314))}r!==null&&r.delete(t),Hw(e,n)}var Ww;Ww=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yt.current)Gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gt=!1,W_(e,t,n);Gt=!!(e.flags&131072)}else Gt=!1,Ue&&t.flags&1048576&&Q1(t,Cc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xl(e,t),e=t.pendingProps;var i=ao(t,Pt.current);Hs(t,n),i=$h(null,t,r,e,i,n);var s=zh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qt(r)?(s=!0,kc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dh(t),i.updater=uu,t.stateNode=i,i._reactInternals=t,Lf(t,r,e,n),t=$f(null,t,r,!0,s,n)):(t.tag=0,Ue&&s&&jh(t),Nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=oT(r),e=Pn(r,e),i){case 0:t=Bf(null,t,r,e,n);break e;case 1:t=gv(null,t,r,e,n);break e;case 11:t=hv(null,t,r,e,n);break e;case 14:t=mv(null,t,r,Pn(r.type,e),n);break e}throw Error(G(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),Bf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),gv(e,t,r,i,n);case 3:e:{if(jw(t),e===null)throw Error(G(387));r=t.pendingProps,s=t.memoizedState,i=s.element,tw(e,t),Ec(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=fo(Error(G(423)),t),t=vv(e,t,r,n,i);break e}else if(r!==i){i=fo(Error(G(424)),t),t=vv(e,t,r,n,i);break e}else for(tn=ri(t.stateNode.containerInfo.firstChild),sn=t,Ue=!0,Dn=null,n=J1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lo(),r===i){t=Er(e,t,n);break e}Nt(e,t,r,n)}t=t.child}return t;case 5:return nw(t),e===null&&Nf(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Af(r,i)?o=null:s!==null&&Af(r,s)&&(t.flags|=32),Ew(e,t),Nt(e,t,o,n),t.child;case 6:return e===null&&Nf(t),null;case 13:return Aw(e,t,n);case 4:return Ih(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),hv(e,t,r,i,n);case 7:return Nt(e,t,t.pendingProps,n),t.child;case 8:return Nt(e,t,t.pendingProps.children,n),t.child;case 12:return Nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Ie(_c,r._currentValue),r._currentValue=o,s!==null)if(zn(s.value,o)){if(s.children===i.children&&!Yt.current){t=Er(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kr(-1,n&-n),l.tag=2;var u=s.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}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Df(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(G(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Df(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=Cn(i),r=r(i),t.flags|=1,Nt(e,t,r,n),t.child;case 14:return r=t.type,i=Pn(r,t.pendingProps),i=Pn(r.type,i),mv(e,t,r,i,n);case 15:return _w(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),Xl(e,t),t.tag=1,Qt(r)?(e=!0,kc(t)):e=!1,Hs(t,n),kw(t,r,i),Lf(t,r,i,n),$f(null,t,r,!0,e,n);case 19:return Rw(e,t,n);case 22:return Tw(e,t,n)}throw Error(G(156,t.tag))};function qw(e,t){return x1(e,t)}function sT(e,t,n,r){this.tag=e,this.key=n,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 bn(e,t,n,r){return new sT(e,t,n,r)}function Xh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oT(e){if(typeof e=="function")return Xh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gh)return 11;if(e===vh)return 14}return 2}function ai(e,t){var n=e.alternate;return n===null?(n=bn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ec(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Xh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Wi(n.children,i,s,t);case mh:o=8,i|=8;break;case af:return e=bn(12,n,t,i|2),e.elementType=af,e.lanes=s,e;case lf:return e=bn(13,n,t,i),e.elementType=lf,e.lanes=s,e;case cf:return e=bn(19,n,t,i),e.elementType=cf,e.lanes=s,e;case n1:return pu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case e1:o=10;break e;case t1:o=9;break e;case gh:o=11;break e;case vh:o=14;break e;case Lr:o=16,r=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=bn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=bn(7,e,r,t),e.lanes=n,e}function pu(e,t,n,r){return e=bn(22,e,r,t),e.elementType=n1,e.lanes=n,e.stateNode={isHidden:!1},e}function Sd(e,t,n){return e=bn(6,e,null,t),e.lanes=n,e}function Cd(e,t,n){return t=bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function aT(e,t,n,r,i){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=id(0),this.expirationTimes=id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=id(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Zh(e,t,n,r,i,s,o,a,l){return e=new aT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=bn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dh(s),e}function lT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Gw(e){if(!e)return di;e=e._reactInternals;e:{if(os(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var n=e.type;if(Qt(n))return G1(e,n,t)}return t}function Yw(e,t,n,r,i,s,o,a,l){return e=Zh(n,r,!0,e,i,s,o,a,l),e.context=Gw(null),n=e.current,r=It(),i=oi(n),s=kr(r,i),s.callback=t??null,ii(n,s,i),e.current.lanes=i,Za(e,i,r),Kt(e,r),e}function hu(e,t,n,r){var i=t.current,s=It(),o=oi(i);return n=Gw(n),t.context===null?t.context=n:t.pendingContext=n,t=kr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ii(i,t,o),e!==null&&(Bn(e,i,o,s),Yl(e,i,o)),o}function Dc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ev(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jh(e,t){Ev(e,t),(e=e.alternate)&&Ev(e,t)}function cT(){return null}var Qw=typeof reportError=="function"?reportError:function(e){console.error(e)};function em(e){this._internalRoot=e}mu.prototype.render=em.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));hu(e,t,null,null)};mu.prototype.unmount=em.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){hu(null,e,null,null)}),t[_r]=null}};function mu(e){this._internalRoot=e}mu.prototype.unstable_scheduleHydration=function(e){if(e){var t=T1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$r.length&&t!==0&&t<$r[n].priority;n++);$r.splice(n,0,e),n===0&&j1(e)}};function tm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function jv(){}function uT(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Dc(o);s.call(u)}}var o=Yw(t,r,e,0,null,!1,!1,"",jv);return e._reactRootContainer=o,e[_r]=o.current,Sa(e.nodeType===8?e.parentNode:e),ts(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Dc(l);a.call(u)}}var l=Zh(e,0,!1,null,null,!1,!1,"",jv);return e._reactRootContainer=l,e[_r]=l.current,Sa(e.nodeType===8?e.parentNode:e),ts(function(){hu(t,l,n,r)}),l}function vu(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Dc(o);a.call(l)}}hu(t,o,e,i)}else o=uT(n,t,e,i,r);return Dc(o)}C1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Wo(t.pendingLanes);n!==0&&(wh(t,n|1),Kt(t,nt()),!(Ee&6)&&(po=nt()+500,xi()))}break;case 13:ts(function(){var r=Tr(e,1);if(r!==null){var i=It();Bn(r,e,1,i)}}),Jh(e,1)}};bh=function(e){if(e.tag===13){var t=Tr(e,134217728);if(t!==null){var n=It();Bn(t,e,134217728,n)}Jh(e,134217728)}};_1=function(e){if(e.tag===13){var t=oi(e),n=Tr(e,t);if(n!==null){var r=It();Bn(n,e,t,r)}Jh(e,t)}};T1=function(){return Re};E1=function(e,t){var n=Re;try{return Re=e,t()}finally{Re=n}};xf=function(e,t,n){switch(t){case"input":if(ff(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=au(r);if(!i)throw Error(G(90));i1(r),ff(r,i)}}}break;case"textarea":o1(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};p1=Yh;h1=ts;var dT={usingClientEntryPoint:!1,Events:[el,Es,au,d1,f1,Yh]},Bo={findFiberByHostInstance:Pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fT={bundleType:Bo.bundleType,version:Bo.version,rendererPackageName:Bo.rendererPackageName,rendererConfig:Bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Rr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=v1(e),e===null?null:e.stateNode},findFiberByHostInstance:Bo.findFiberByHostInstance||cT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Al=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Al.isDisabled&&Al.supportsFiber)try{ru=Al.inject(fT),tr=Al}catch{}}an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dT;an.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tm(t))throw Error(G(200));return lT(e,t,null,n)};an.createRoot=function(e,t){if(!tm(e))throw Error(G(299));var n=!1,r="",i=Qw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Zh(e,1,!1,null,null,n,!1,r,i),e[_r]=t.current,Sa(e.nodeType===8?e.parentNode:e),new em(t)};an.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(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=v1(t),e=e===null?null:e.stateNode,e};an.flushSync=function(e){return ts(e)};an.hydrate=function(e,t,n){if(!gu(t))throw Error(G(200));return vu(null,e,t,!0,n)};an.hydrateRoot=function(e,t,n){if(!tm(e))throw Error(G(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Qw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Yw(t,null,e,1,n??null,i,!1,s,o),e[_r]=t.current,Sa(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new mu(t)};an.render=function(e,t,n){if(!gu(t))throw Error(G(200));return vu(null,e,t,!1,n)};an.unmountComponentAtNode=function(e){if(!gu(e))throw Error(G(40));return e._reactRootContainer?(ts(function(){vu(null,null,e,!1,function(){e._reactRootContainer=null,e[_r]=null})}),!0):!1};an.unstable_batchedUpdates=Yh;an.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!gu(n))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return vu(e,t,n,!1,r)};an.version="18.3.1-next-f1338f8080-20240426";function Kw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Kw)}catch(e){console.error(e)}}Kw(),Kx.exports=an;var yu=Kx.exports;const pT=Ar(yu);var Xw,Av=yu;Xw=Av.createRoot,Av.hydrateRoot;const hT="@alfatech/livechat",mT="v2026.03.15.2",gT="module",vT="https://api.chatier.app",yT="wss://api.chatier.app",xT=["dist","README.md","component/chatier.js"],wT="dist/widget.js",bT={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},kT={dev:"vite",dev2:"vite --config vite.config.2.ts",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint",preview:"vite preview","build:mobile":"tsc -b && vite build --config vite.config.app.ts && mv dist-app/index-app.html dist-app/index.html","preview:mobile":"vite preview --config vite.config.app.ts --outDir dist-app","dev:mobile":"vite --config vite.config.app.ts"},ST={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},CT={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},Zw={name:hT,private:!1,version:mT,type:gT,apiURL:vT,wsURL:yT,files:xT,main:wT,author:bT,scripts:kT,dependencies:ST,devDependencies:CT,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},Jw=Zw.apiURL,_T=Zw.wsURL,TT=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],ET=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],jT={429:TT,404:ET};async function Pr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${Jw}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>new Response(null,{status:500}));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{}const o=jT[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const $n=e=>[200,201,204].includes(e),AT=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var Co=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ns=typeof window>"u"||"Deno"in globalThis;function vn(){}function RT(e,t){return typeof e=="function"?e(t):e}function Zf(e){return typeof e=="number"&&e>=0&&e!==1/0}function eb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qs(e,t){return typeof e=="function"?e(t):e}function In(e,t){return typeof e=="function"?e(t):e}function Rv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==nm(o,t.options))return!1}else if(!Ma(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Pv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(rs(t.options.mutationKey)!==rs(s))return!1}else if(!Ma(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function nm(e,t){return((t==null?void 0:t.queryKeyHashFn)||rs)(e)}function rs(e){return JSON.stringify(e,(t,n)=>Jf(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ma(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ma(e[n],t[n])):!1}function tb(e,t){if(e===t)return e;const n=Mv(e)&&Mv(t);if(n||Jf(e)&&Jf(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let u=0;u<o;u++){const d=n?u:s[u];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=tb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Ic(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Mv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Jf(e){if(!Ov(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ov(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ov(e){return Object.prototype.toString.call(e)==="[object Object]"}function PT(e){return new Promise(t=>{setTimeout(t,e)})}function ep(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?tb(e,t):t}function MT(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function OT(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var rm=Symbol();function nb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===rm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Li,Vr,Gs,Ax,NT=(Ax=class extends Co{constructor(){super();pe(this,Li);pe(this,Vr);pe(this,Gs);le(this,Gs,t=>{if(!ns&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){j(this,Vr)||this.setEventListener(j(this,Gs))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,Vr))==null||t.call(this),le(this,Vr,void 0))}setEventListener(t){var n;le(this,Gs,t),(n=j(this,Vr))==null||n.call(this),le(this,Vr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){j(this,Li)!==t&&(le(this,Li,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof j(this,Li)=="boolean"?j(this,Li):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Li=new WeakMap,Vr=new WeakMap,Gs=new WeakMap,Ax),im=new NT,Ys,Ur,Qs,Rx,DT=(Rx=class extends Co{constructor(){super();pe(this,Ys,!0);pe(this,Ur);pe(this,Qs);le(this,Qs,t=>{if(!ns&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){j(this,Ur)||this.setEventListener(j(this,Qs))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,Ur))==null||t.call(this),le(this,Ur,void 0))}setEventListener(t){var n;le(this,Qs,t),(n=j(this,Ur))==null||n.call(this),le(this,Ur,t(this.setOnline.bind(this)))}setOnline(t){j(this,Ys)!==t&&(le(this,Ys,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return j(this,Ys)}},Ys=new WeakMap,Ur=new WeakMap,Qs=new WeakMap,Rx),Lc=new DT;function tp(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function IT(e){return Math.min(1e3*2**e,3e4)}function rb(e){return(e??"online")==="online"?Lc.isOnline():!0}var ib=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function _d(e){return e instanceof ib}function sb(e){let t=!1,n=0,r=!1,i;const s=tp(),o=x=>{var w;r||(f(new ib(x)),(w=e.abort)==null||w.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>im.isFocused()&&(e.networkMode==="always"||Lc.isOnline())&&e.canRun(),d=()=>rb(e.networkMode)&&e.canRun(),c=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),s.resolve(x))},f=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s.reject(x))},m=()=>new Promise(x=>{var w;i=h=>{(r||u())&&x(h)},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;const w=n===0?e.initialPromise:void 0;try{x=w??e.fn()}catch(h){x=Promise.reject(h)}Promise.resolve(x).then(c).catch(h=>{var E;if(r)return;const v=e.retry??(ns?0:3),b=e.retryDelay??IT,T=typeof b=="function"?b(n,h):b,C=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,h);if(t||!C){f(h);return}n++,(E=e.onFail)==null||E.call(e,n,h),PT(T).then(()=>u()?void 0:m()).then(()=>{t?f(h):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():m().then(y),s)}}function LT(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var ct=LT(),Fi,Px,ob=(Px=class{constructor(){pe(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Zf(this.gcTime)&&le(this,Fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ns?1/0:5*60*1e3))}clearGcTimeout(){j(this,Fi)&&(clearTimeout(j(this,Fi)),le(this,Fi,void 0))}},Fi=new WeakMap,Px),Ks,Xs,gn,Tt,Ga,Bi,Mn,hr,Mx,FT=(Mx=class extends ob{constructor(t){super();pe(this,Mn);pe(this,Ks);pe(this,Xs);pe(this,gn);pe(this,Tt);pe(this,Ga);pe(this,Bi);le(this,Bi,!1),le(this,Ga,t.defaultOptions),this.setOptions(t.options),this.observers=[],le(this,gn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,le(this,Ks,BT(this.options)),this.state=t.state??j(this,Ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=j(this,Tt))==null?void 0:t.promise}setOptions(t){this.options={...j(this,Ga),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&j(this,gn).remove(this)}setData(t,n){const r=ep(this.state.data,t,this.options);return we(this,Mn,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){we(this,Mn,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=j(this,Tt))==null?void 0:r.promise;return(i=j(this,Tt))==null||i.cancel(t),n?n.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(j(this,Ks))}isActive(){return this.observers.some(t=>In(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===rm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!eb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=j(this,Tt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=j(this,Tt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),j(this,gn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(j(this,Tt)&&(j(this,Bi)?j(this,Tt).cancel({revert:!0}):j(this,Tt).cancelRetry()),this.scheduleGc()),j(this,gn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||we(this,Mn,hr).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(j(this,Tt))return j(this,Tt).continueRetry(),j(this,Tt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(le(this,Bi,!0),r.signal)})},s=()=>{const c=nb(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),le(this,Bi,!1),this.options.persister?this.options.persister(c,f,this):c(f)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),le(this,Xs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&we(this,Mn,hr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=c=>{var f,m,y,x;_d(c)&&c.silent||we(this,Mn,hr).call(this,{type:"error",error:c}),_d(c)||((m=(f=j(this,gn).config).onError)==null||m.call(f,c,this),(x=(y=j(this,gn).config).onSettled)==null||x.call(y,this.state.data,c,this)),this.scheduleGc()};return le(this,Tt,sb({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,m,y,x;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(w){a(w);return}(m=(f=j(this,gn).config).onSuccess)==null||m.call(f,c,this),(x=(y=j(this,gn).config).onSettled)==null||x.call(y,c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,f)=>{we(this,Mn,hr).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{we(this,Mn,hr).call(this,{type:"pause"})},onContinue:()=>{we(this,Mn,hr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),j(this,Tt).start()}},Ks=new WeakMap,Xs=new WeakMap,gn=new WeakMap,Tt=new WeakMap,Ga=new WeakMap,Bi=new WeakMap,Mn=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ab(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return _d(i)&&i.revert&&j(this,Xs)?{...j(this,Xs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ct.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),j(this,gn).notify({query:this,type:"updated",action:t})})},Mx);function ab(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qn,Ox,$T=(Ox=class extends Co{constructor(t={}){super();pe(this,Qn);this.config=t,le(this,Qn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??nm(i,n);let o=this.get(s);return o||(o=new FT({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){j(this,Qn).has(t.queryHash)||(j(this,Qn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=j(this,Qn).get(t.queryHash);n&&(t.destroy(),n===t&&j(this,Qn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return j(this,Qn).get(t)}getAll(){return[...j(this,Qn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Rv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Rv(t,r)):n}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qn=new WeakMap,Ox),Kn,Mt,$i,Xn,Dr,Nx,zT=(Nx=class extends ob{constructor(t){super();pe(this,Xn);pe(this,Kn);pe(this,Mt);pe(this,$i);this.mutationId=t.mutationId,le(this,Mt,t.mutationCache),le(this,Kn,[]),this.state=t.state||lb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){j(this,Kn).includes(t)||(j(this,Kn).push(t),this.clearGcTimeout(),j(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){le(this,Kn,j(this,Kn).filter(n=>n!==t)),this.scheduleGc(),j(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){j(this,Kn).length||(this.state.status==="pending"?this.scheduleGc():j(this,Mt).remove(this))}continue(){var t;return((t=j(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,u,d,c,f,m,y,x,w,h,v,b,T,C,E,S;le(this,$i,sb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,B)=>{we(this,Xn,Dr).call(this,{type:"failed",failureCount:A,error:B})},onPause:()=>{we(this,Xn,Dr).call(this,{type:"pause"})},onContinue:()=>{we(this,Xn,Dr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>j(this,Mt).canRun(this)}));const n=this.state.status==="pending",r=!j(this,$i).canStart();try{if(!n){we(this,Xn,Dr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=j(this,Mt).config).onMutate)==null?void 0:s.call(i,t,this));const B=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));B!==this.state.context&&we(this,Xn,Dr).call(this,{type:"pending",context:B,variables:t,isPaused:r})}const A=await j(this,$i).start();return await((u=(l=j(this,Mt).config).onSuccess)==null?void 0:u.call(l,A,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,A,t,this.state.context)),await((m=(f=j(this,Mt).config).onSettled)==null?void 0:m.call(f,A,null,this.state.variables,this.state.context,this)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,A,null,t,this.state.context)),we(this,Xn,Dr).call(this,{type:"success",data:A}),A}catch(A){try{throw await((h=(w=j(this,Mt).config).onError)==null?void 0:h.call(w,A,t,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,A,t,this.state.context)),await((C=(T=j(this,Mt).config).onSettled)==null?void 0:C.call(T,void 0,A,this.state.variables,this.state.context,this)),await((S=(E=this.options).onSettled)==null?void 0:S.call(E,void 0,A,t,this.state.context)),A}finally{we(this,Xn,Dr).call(this,{type:"error",error:A})}}finally{j(this,Mt).runNext(this)}}},Kn=new WeakMap,Mt=new WeakMap,$i=new WeakMap,Xn=new WeakSet,Dr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ct.batch(()=>{j(this,Kn).forEach(r=>{r.onMutationUpdate(t)}),j(this,Mt).notify({mutation:this,type:"updated",action:t})})},Nx);function lb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jt,Ya,Dx,VT=(Dx=class extends Co{constructor(t={}){super();pe(this,Jt);pe(this,Ya);this.config=t,le(this,Jt,new Map),le(this,Ya,Date.now())}build(t,n,r){const i=new zT({mutationCache:this,mutationId:++fl(this,Ya)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Rl(t),r=j(this,Jt).get(n)??[];r.push(t),j(this,Jt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Rl(t);if(j(this,Jt).has(n)){const i=(r=j(this,Jt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?j(this,Jt).delete(n):j(this,Jt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=j(this,Jt).get(Rl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=j(this,Jt).get(Rl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...j(this,Jt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Pv(n,r))}findAll(t={}){return this.getAll().filter(n=>Pv(t,n))}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ct.batch(()=>Promise.all(t.map(n=>n.continue().catch(vn))))}},Jt=new WeakMap,Ya=new WeakMap,Dx);function Rl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Nv(e){return{onFetch:(t,n)=>{var d,c,f,m,y;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let x=!1;const w=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},h=nb(t.options,t.fetchOptions),v=async(b,T,C)=>{if(x)return Promise.reject();if(T==null&&b.pages.length)return Promise.resolve(b);const E={queryKey:t.queryKey,pageParam:T,direction:C?"backward":"forward",meta:t.options.meta};w(E);const S=await h(E),{maxPages:A}=t.options,B=C?OT:MT;return{pages:B(b.pages,S,A),pageParams:B(b.pageParams,T,A)}};if(i&&s.length){const b=i==="backward",T=b?UT:Dv,C={pages:s,pageParams:o},E=T(r,C);a=await v(C,E,b)}else{const b=e??s.length;do{const T=l===0?o[0]??r.initialPageParam:Dv(r,a);if(l>0&&T==null)break;a=await v(a,T),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var x,w;return(w=(x=t.options).persister)==null?void 0:w.call(x,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Dv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function UT(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Qe,Hr,Wr,Zs,Js,qr,eo,to,Ix,HT=(Ix=class{constructor(e={}){pe(this,Qe);pe(this,Hr);pe(this,Wr);pe(this,Zs);pe(this,Js);pe(this,qr);pe(this,eo);pe(this,to);le(this,Qe,e.queryCache||new $T),le(this,Hr,e.mutationCache||new VT),le(this,Wr,e.defaultOptions||{}),le(this,Zs,new Map),le(this,Js,new Map),le(this,qr,0)}mount(){fl(this,qr)._++,j(this,qr)===1&&(le(this,eo,im.subscribe(async e=>{e&&(await this.resumePausedMutations(),j(this,Qe).onFocus())})),le(this,to,Lc.subscribe(async e=>{e&&(await this.resumePausedMutations(),j(this,Qe).onOnline())})))}unmount(){var e,t;fl(this,qr)._--,j(this,qr)===0&&((e=j(this,eo))==null||e.call(this),le(this,eo,void 0),(t=j(this,to))==null||t.call(this),le(this,to,void 0))}isFetching(e){return j(this,Qe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return j(this,Hr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=j(this,Qe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=j(this,Qe).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return j(this,Qe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=j(this,Qe).get(r.queryHash),s=i==null?void 0:i.state.data,o=RT(t,s);if(o!==void 0)return j(this,Qe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ct.batch(()=>j(this,Qe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=j(this,Qe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=j(this,Qe);ct.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=j(this,Qe),r={type:"active",...e};return ct.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ct.batch(()=>j(this,Qe).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return ct.batch(()=>{if(j(this,Qe).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ct.batch(()=>j(this,Qe).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(vn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=j(this,Qe).build(this,t);return n.isStaleByTime(qs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e.behavior=Nv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e.behavior=Nv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Lc.isOnline()?j(this,Hr).resumePausedMutations():Promise.resolve()}getQueryCache(){return j(this,Qe)}getMutationCache(){return j(this,Hr)}getDefaultOptions(){return j(this,Wr)}setDefaultOptions(e){le(this,Wr,e)}setQueryDefaults(e,t){j(this,Zs).set(rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...j(this,Zs).values()],n={};return t.forEach(r=>{Ma(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){j(this,Js).set(rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...j(this,Js).values()];let n={};return t.forEach(r=>{Ma(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...j(this,Wr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=nm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===rm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...j(this,Wr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){j(this,Qe).clear(),j(this,Hr).clear()}},Qe=new WeakMap,Hr=new WeakMap,Wr=new WeakMap,Zs=new WeakMap,Js=new WeakMap,qr=new WeakMap,eo=new WeakMap,to=new WeakMap,Ix),zt,_e,Qa,Ot,zi,no,Gr,Zn,Ka,ro,io,Vi,Ui,Yr,so,Ae,Go,np,rp,ip,sp,op,ap,lp,cb,Lx,WT=(Lx=class extends Co{constructor(t,n){super();pe(this,Ae);pe(this,zt);pe(this,_e);pe(this,Qa);pe(this,Ot);pe(this,zi);pe(this,no);pe(this,Gr);pe(this,Zn);pe(this,Ka);pe(this,ro);pe(this,io);pe(this,Vi);pe(this,Ui);pe(this,Yr);pe(this,so,new Set);this.options=n,le(this,zt,t),le(this,Zn,null),le(this,Gr,tp()),this.options.experimental_prefetchInRender||j(this,Gr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(j(this,_e).addObserver(this),Iv(j(this,_e),this.options)?we(this,Ae,Go).call(this):this.updateResult(),we(this,Ae,sp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cp(j(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cp(j(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,we(this,Ae,op).call(this),we(this,Ae,ap).call(this),j(this,_e).removeObserver(this)}setOptions(t,n){const r=this.options,i=j(this,_e);if(this.options=j(this,zt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof In(this.options.enabled,j(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");we(this,Ae,lp).call(this),j(this,_e).setOptions(this.options),r._defaulted&&!Ic(this.options,r)&&j(this,zt).getQueryCache().notify({type:"observerOptionsUpdated",query:j(this,_e),observer:this});const s=this.hasListeners();s&&Lv(j(this,_e),i,this.options,r)&&we(this,Ae,Go).call(this),this.updateResult(n),s&&(j(this,_e)!==i||In(this.options.enabled,j(this,_e))!==In(r.enabled,j(this,_e))||qs(this.options.staleTime,j(this,_e))!==qs(r.staleTime,j(this,_e)))&&we(this,Ae,np).call(this);const o=we(this,Ae,rp).call(this);s&&(j(this,_e)!==i||In(this.options.enabled,j(this,_e))!==In(r.enabled,j(this,_e))||o!==j(this,Yr))&&we(this,Ae,ip).call(this,o)}getOptimisticResult(t){const n=j(this,zt).getQueryCache().build(j(this,zt),t),r=this.createResult(n,t);return GT(this,r)&&(le(this,Ot,r),le(this,no,this.options),le(this,zi,j(this,_e).state)),r}getCurrentResult(){return j(this,Ot)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){j(this,so).add(t)}getCurrentQuery(){return j(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=j(this,zt).defaultQueryOptions(t),r=j(this,zt).getQueryCache().build(j(this,zt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return we(this,Ae,Go).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),j(this,Ot)))}createResult(t,n){var A;const r=j(this,_e),i=this.options,s=j(this,Ot),o=j(this,zi),a=j(this,no),u=t!==r?t.state:j(this,Qa),{state:d}=t;let c={...d},f=!1,m;if(n._optimisticResults){const B=this.hasListeners(),L=!B&&Iv(t,n),N=B&&Lv(t,r,n,i);(L||N)&&(c={...c,...ab(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:w}=c;if(n.select&&c.data!==void 0)if(s&&c.data===(o==null?void 0:o.data)&&n.select===j(this,Ka))m=j(this,ro);else try{le(this,Ka,n.select),m=n.select(c.data),m=ep(s==null?void 0:s.data,m,n),le(this,ro,m),le(this,Zn,null)}catch(B){le(this,Zn,B)}else m=c.data;if(n.placeholderData!==void 0&&m===void 0&&w==="pending"){let B;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))B=s.data;else if(B=typeof n.placeholderData=="function"?n.placeholderData((A=j(this,io))==null?void 0:A.state.data,j(this,io)):n.placeholderData,n.select&&B!==void 0)try{B=n.select(B),le(this,Zn,null)}catch(L){le(this,Zn,L)}B!==void 0&&(w="success",m=ep(s==null?void 0:s.data,B,n),f=!0)}j(this,Zn)&&(y=j(this,Zn),m=j(this,ro),x=Date.now(),w="error");const h=c.fetchStatus==="fetching",v=w==="pending",b=w==="error",T=v&&h,C=m!==void 0,S={status:w,fetchStatus:c.fetchStatus,isPending:v,isSuccess:w==="success",isError:b,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:c.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:h,isRefetching:h&&!v,isLoadingError:b&&!C,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&C,isStale:sm(t,n),refetch:this.refetch,promise:j(this,Gr)};if(this.options.experimental_prefetchInRender){const B=ee=>{S.status==="error"?ee.reject(S.error):S.data!==void 0&&ee.resolve(S.data)},L=()=>{const ee=le(this,Gr,S.promise=tp());B(ee)},N=j(this,Gr);switch(N.status){case"pending":t.queryHash===r.queryHash&&B(N);break;case"fulfilled":(S.status==="error"||S.data!==N.value)&&L();break;case"rejected":(S.status!=="error"||S.error!==N.reason)&&L();break}}return S}updateResult(t){const n=j(this,Ot),r=this.createResult(j(this,_e),this.options);if(le(this,zi,j(this,_e).state),le(this,no,this.options),j(this,zi).data!==void 0&&le(this,io,j(this,_e)),Ic(r,n))return;le(this,Ot,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!j(this,so).size)return!0;const l=new Set(a??j(this,so));return this.options.throwOnError&&l.add("error"),Object.keys(j(this,Ot)).some(u=>{const d=u;return j(this,Ot)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),we(this,Ae,cb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&we(this,Ae,sp).call(this)}},zt=new WeakMap,_e=new WeakMap,Qa=new WeakMap,Ot=new WeakMap,zi=new WeakMap,no=new WeakMap,Gr=new WeakMap,Zn=new WeakMap,Ka=new WeakMap,ro=new WeakMap,io=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,Yr=new WeakMap,so=new WeakMap,Ae=new WeakSet,Go=function(t){we(this,Ae,lp).call(this);let n=j(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vn)),n},np=function(){we(this,Ae,op).call(this);const t=qs(this.options.staleTime,j(this,_e));if(ns||j(this,Ot).isStale||!Zf(t))return;const r=eb(j(this,Ot).dataUpdatedAt,t)+1;le(this,Vi,setTimeout(()=>{j(this,Ot).isStale||this.updateResult()},r))},rp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(j(this,_e)):this.options.refetchInterval)??!1},ip=function(t){we(this,Ae,ap).call(this),le(this,Yr,t),!(ns||In(this.options.enabled,j(this,_e))===!1||!Zf(j(this,Yr))||j(this,Yr)===0)&&le(this,Ui,setInterval(()=>{(this.options.refetchIntervalInBackground||im.isFocused())&&we(this,Ae,Go).call(this)},j(this,Yr)))},sp=function(){we(this,Ae,np).call(this),we(this,Ae,ip).call(this,we(this,Ae,rp).call(this))},op=function(){j(this,Vi)&&(clearTimeout(j(this,Vi)),le(this,Vi,void 0))},ap=function(){j(this,Ui)&&(clearInterval(j(this,Ui)),le(this,Ui,void 0))},lp=function(){const t=j(this,zt).getQueryCache().build(j(this,zt),this.options);if(t===j(this,_e))return;const n=j(this,_e);le(this,_e,t),le(this,Qa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},cb=function(t){ct.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(j(this,Ot))}),j(this,zt).getQueryCache().notify({query:j(this,_e),type:"observerResultsUpdated"})})},Lx);function qT(e,t){return In(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Iv(e,t){return qT(e,t)||e.state.data!==void 0&&cp(e,t,t.refetchOnMount)}function cp(e,t,n){if(In(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&sm(e,t)}return!1}function Lv(e,t,n,r){return(e!==t||In(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&sm(e,n)}function sm(e,t){return In(t.enabled,e)!==!1&&e.isStaleByTime(qs(t.staleTime,e))}function GT(e,t){return!Ic(e.getCurrentResult(),t)}var Qr,Kr,Vt,xr,Sr,tc,up,Fx,YT=(Fx=class extends Co{constructor(t,n){super();pe(this,Sr);pe(this,Qr);pe(this,Kr);pe(this,Vt);pe(this,xr);le(this,Qr,t),this.setOptions(n),this.bindMethods(),we(this,Sr,tc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=j(this,Qr).defaultMutationOptions(t),Ic(this.options,n)||j(this,Qr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:j(this,Vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rs(n.mutationKey)!==rs(this.options.mutationKey)?this.reset():((r=j(this,Vt))==null?void 0:r.state.status)==="pending"&&j(this,Vt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=j(this,Vt))==null||t.removeObserver(this)}onMutationUpdate(t){we(this,Sr,tc).call(this),we(this,Sr,up).call(this,t)}getCurrentResult(){return j(this,Kr)}reset(){var t;(t=j(this,Vt))==null||t.removeObserver(this),le(this,Vt,void 0),we(this,Sr,tc).call(this),we(this,Sr,up).call(this)}mutate(t,n){var r;return le(this,xr,n),(r=j(this,Vt))==null||r.removeObserver(this),le(this,Vt,j(this,Qr).getMutationCache().build(j(this,Qr),this.options)),j(this,Vt).addObserver(this),j(this,Vt).execute(t)}},Qr=new WeakMap,Kr=new WeakMap,Vt=new WeakMap,xr=new WeakMap,Sr=new WeakSet,tc=function(){var n;const t=((n=j(this,Vt))==null?void 0:n.state)??lb();le(this,Kr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},up=function(t){ct.batch(()=>{var n,r,i,s,o,a,l,u;if(j(this,xr)&&this.hasListeners()){const d=j(this,Kr).variables,c=j(this,Kr).context;(t==null?void 0:t.type)==="success"?((r=(n=j(this,xr)).onSuccess)==null||r.call(n,t.data,d,c),(s=(i=j(this,xr)).onSettled)==null||s.call(i,t.data,null,d,c)):(t==null?void 0:t.type)==="error"&&((a=(o=j(this,xr)).onError)==null||a.call(o,t.error,d,c),(u=(l=j(this,xr)).onSettled)==null||u.call(l,void 0,t.error,d,c))}this.listeners.forEach(d=>{d(j(this,Kr))})})},Fx),ub=g.createContext(void 0),db=e=>{const t=g.useContext(ub);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QT=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(ub.Provider,{value:e,children:t})),fb=g.createContext(!1),KT=()=>g.useContext(fb);fb.Provider;function XT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ZT=g.createContext(XT()),JT=()=>g.useContext(ZT);function pb(e,t){return typeof e=="function"?e(...t):!!e}function dp(){}var eE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},tE=e=>{g.useEffect(()=>{e.clearReset()},[e])},nE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&pb(n,[e.error,r]),rE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},iE=(e,t)=>e.isLoading&&e.isFetching&&!t,sE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Fv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function oE(e,t,n){var d,c,f,m,y;const r=db(),i=KT(),s=JT(),o=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",rE(o),eE(o,s),tE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=g.useState(()=>new t(r,o)),u=l.getOptimisticResult(o);if(g.useSyncExternalStore(g.useCallback(x=>{const w=i?dp:l.subscribe(ct.batchCalls(x));return l.updateResult(),w},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),g.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),sE(o,u))throw Fv(o,l,s);if(nE({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw u.error;if((m=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,o,u),o.experimental_prefetchInRender&&!ns&&iE(u,i)){const x=a?Fv(o,l,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;x==null||x.catch(dp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function hb(e,t){return oE(e,WT)}function om(e,t){const n=db(),[r]=g.useState(()=>new YT(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const i=g.useSyncExternalStore(g.useCallback(o=>r.subscribe(ct.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=g.useCallback((o,a)=>{r.mutate(o,a).catch(dp)},[r]);if(i.error&&pb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const aE=(e,t)=>hb({queryKey:["widgets",e,t],queryFn:()=>lE(e,t),retry:!1,throwOnError:!1}),lE=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await Pr(n);if(i===204)throw new Error("User is banned");return r};var k=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.MessageAgentBackground="widget_message_agent_background",e.MessageAgentText="widget_message_agent_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e.CloseButtonBackground="widget_close_button_background",e.CloseButtonText="widget_close_button_text",e.CloseButtonHover="widget_close_button_hover",e.IconColor="widget_icon_color",e.IconBackground="widget_icon_background",e.ErrorBackground="widget_error_background",e.ErrorText="widget_error_text",e.ErrorBorder="widget_error_border",e.SuccessBackground="widget_success_background",e.SuccessText="widget_success_text",e.SuccessBorder="widget_success_border",e.WarningBackground="widget_warning_background",e.WarningText="widget_warning_text",e.WarningBorder="widget_warning_border",e.LinkColor="widget_link_color",e.LinkHoverColor="widget_link_hover_color",e.DividerColor="widget_divider_color",e.ShadowColor="widget_shadow_color",e.StarActiveColor="widget_star_active_color",e.StarInactiveColor="widget_star_inactive_color",e.ModalOverlayColor="widget_modal_overlay_color",e.ChatCloseConfirmText="widget_chat_close_confirm_text",e.RatingHeaderBackground="widget_rating_header_background",e.RatingHeaderText="widget_rating_header_text",e.RatingSuccessBackground="widget_rating_success_background",e.RatingSuccessText="widget_rating_success_text",e.RatingRateConversationText="widget_rating_rate_conversation_text",e))(k||{}),J=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e.NotificationSoundOn="notification_sound_on",e.NotificationSoundOff="notification_sound_off",e))(J||{}),Ne=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Ne||{});function cE(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function wd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Lf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var V_=typeof WeakMap=="function"?WeakMap:Map;function kw(e,t,n){n=Sr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Mc||(Mc=!0,Gf=r),Lf(e,t)},n}function Sw(e,t,n){n=Sr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Lf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Lf(e,t),typeof r!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function uv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new V_;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=nT.bind(null,e,t,n),t.then(e,e))}function dv(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 fv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Sr(-1,1),t.tag=2,si(n,t,1))),n.lanes|=1),e)}var U_=Pr.ReactCurrentOwner,Gt=!1;function Nt(e,t,n,r){t.child=e===null?Z1(t,null,n,r):co(t,e.child,n,r)}function pv(e,t,n,r,i){n=n.render;var s=t.ref;return Hs(t,i),r=Bh(e,t,n,r,s,i),n=$h(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jr(e,t,i)):(Ue&&n&&Eh(t),t.flags|=1,Nt(e,t,r,i),t.child)}function hv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Kh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Cw(e,t,s,r,i)):(e=ec(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ka,n(o,r)&&e.ref===t.ref)return jr(e,t,i)}return t.flags|=1,e=li(s,r),e.ref=t.ref,e.return=t,t.child=e}function Cw(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(ka(s,r)&&e.ref===t.ref)if(Gt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Gt=!0);else return t.lanes=e.lanes,jr(e,t,i)}return Ff(e,t,n,r,i)}function _w(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ie(Os,en),en|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ie(Os,en),en|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ie(Os,en),en|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ie(Os,en),en|=r;return Nt(e,t,i,n),t.child}function Tw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ff(e,t,n,r,i){var s=Qt(n)?Xi:Pt.current;return s=ao(t,s),Hs(t,i),n=Bh(e,t,n,r,s,i),r=$h(),e!==null&&!Gt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jr(e,t,i)):(Ue&&r&&Eh(t),t.flags|=1,Nt(e,t,n,i),t.child)}function mv(e,t,n,r,i){if(Qt(n)){var s=!0;kc(t)}else s=!1;if(Hs(t,i),t.stateNode===null)Xl(e,t),bw(t,n,r),If(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Cn(c):(c=Qt(n)?Xi:Pt.current,c=ao(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&cv(t,o,r,c),Br=!1;var p=t.memoizedState;o.state=p,Ec(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Yt.current||Br?(typeof d=="function"&&(Df(t,n,d,r),l=t.memoizedState),(a=Br||lv(t,n,a,r,p,l,c))?(u||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ew(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Pn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Cn(l):(l=Qt(n)?Xi:Pt.current,l=ao(t,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||p!==l)&&cv(t,o,r,l),Br=!1,p=t.memoizedState,o.state=p,Ec(t,r,o,i);var y=t.memoizedState;a!==u||p!==y||Yt.current||Br?(typeof m=="function"&&(Df(t,n,m,r),y=t.memoizedState),(c=Br||lv(t,n,c,r,p,y,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Bf(e,t,n,r,s,i)}function Bf(e,t,n,r,i,s){Tw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&ev(t,n,!1),jr(e,t,s);r=t.stateNode,U_.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=co(t,e.child,null,s),t.child=co(t,null,a,s)):Nt(e,t,a,s),t.memoizedState=r.state,i&&ev(t,n,!0),t.child}function Ew(e){var t=e.stateNode;t.pendingContext?Jg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jg(e,t.context,!1),Dh(e,t.containerInfo)}function gv(e,t,n,r,i){return lo(),Ah(i),t.flags|=256,Nt(e,t,n,r),t.child}var $f={dehydrated:null,treeContext:null,retryLane:0};function zf(e){return{baseLanes:e,cachePool:null,transitions:null}}function jw(e,t,n){var r=t.pendingProps,i=We.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ie(We,i&1),e===null)return Of(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pu(o,r,0,null),e=Wi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=zf(n),t.memoizedState=$f,e):Uh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return H_(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=li(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=li(a,s):(s=Wi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?zf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=$f,r}return s=e.child,e=s.sibling,r=li(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Uh(e,t){return t=pu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Tl(e,t,n,r){return r!==null&&Ah(r),co(t,e.child,null,n),e=Uh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function H_(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=wd(Error(G(422))),Tl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=pu({mode:"visible",children:r.children},i,0,null),s=Wi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&co(t,e.child,null,o),t.child.memoizedState=zf(o),t.memoizedState=$f,s);if(!(t.mode&1))return Tl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(G(419)),r=wd(s,r,void 0),Tl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Gt||a){if(r=ht,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Er(e,i),Bn(r,e,i,-1))}return Qh(),r=wd(Error(G(421))),Tl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=rT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,tn=ii(i.nextSibling),sn=t,Ue=!0,Dn=null,e!==null&&(yn[xn++]=br,yn[xn++]=kr,yn[xn++]=Zi,br=e.id,kr=e.overflow,Zi=t),t=Uh(t,r.children),t.flags|=4096,t)}function vv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Nf(e.return,t,n)}function bd(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Aw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Nt(e,t,r.children,n),r=We.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&vv(e,n,t);else if(e.tag===19)vv(e,n,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(Ie(We,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&jc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bd(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bd(t,!0,n,null,s);break;case"together":bd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function jr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function W_(e,t,n){switch(t.tag){case 3:Ew(t),lo();break;case 5:tw(t);break;case 1:Qt(t.type)&&kc(t);break;case 4:Dh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ie(_c,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ie(We,We.current&1),t.flags|=128,null):n&t.child.childLanes?jw(e,t,n):(Ie(We,We.current&1),e=jr(e,t,n),e!==null?e.sibling:null);Ie(We,We.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Aw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ie(We,We.current),r)break;return null;case 22:case 23:return t.lanes=0,_w(e,t,n)}return jr(e,t,n)}var Rw,Vf,Pw,Mw;Rw=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Vf=function(){};Pw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Oi(nr.current);var s=null;switch(n){case"input":i=uf(e,i),r=uf(e,r),s=[];break;case"select":i=Ye({},i,{value:void 0}),r=Ye({},r,{value:void 0}),s=[];break;case"textarea":i=pf(e,i),r=pf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=wc)}mf(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ma.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ma.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Fe("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Mw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fo(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function _t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function q_(e,t,n){var r=t.pendingProps;switch(jh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(t),null;case 1:return Qt(t.type)&&bc(),_t(t),null;case 3:return r=t.stateNode,uo(),$e(Yt),$e(Pt),Lh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Cl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dn!==null&&(Kf(Dn),Dn=null))),Vf(e,t),_t(t),null;case 5:Ih(t);var i=Oi(Ea.current);if(n=t.type,e!==null&&t.stateNode!=null)Pw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(G(166));return _t(t),null}if(e=Oi(nr.current),Cl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Jn]=t,r[_a]=s,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(i=0;i<qo.length;i++)Fe(qo[i],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":Tg(r,s),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Fe("invalid",r);break;case"textarea":jg(r,s),Fe("invalid",r)}mf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Sl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Sl(r.textContent,a,e),i=["children",""+a]):ma.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Fe("scroll",r)}switch(n){case"input":ml(r),Eg(r,s,!0);break;case"textarea":ml(r),Ag(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=wc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=o1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Jn]=t,e[_a]=r,Rw(e,t,!1,!1),t.stateNode=e;e:{switch(o=gf(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),i=r;break;case"iframe":case"object":case"embed":Fe("load",e),i=r;break;case"video":case"audio":for(i=0;i<qo.length;i++)Fe(qo[i],e);i=r;break;case"source":Fe("error",e),i=r;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=r;break;case"details":Fe("toggle",e),i=r;break;case"input":Tg(e,r),i=uf(e,r),Fe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ye({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":jg(e,r),i=pf(e,r),Fe("invalid",e);break;default:i=r}mf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?c1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&a1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ga(e,l):typeof l=="number"&&ga(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ma.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Fe("scroll",e):l!=null&&ph(e,s,l,o))}switch(n){case"input":ml(e),Eg(e,r,!1);break;case"textarea":ml(e),Ag(e);break;case"option":r.value!=null&&e.setAttribute("value",""+di(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?$s(e,!!r.multiple,s,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=wc)}switch(n){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 _t(t),null;case 6:if(e&&t.stateNode!=null)Mw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(G(166));if(n=Oi(Ea.current),Oi(nr.current),Cl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Jn]=t,(s=r.nodeValue!==n)&&(e=sn,e!==null))switch(e.tag){case 3:Sl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Jn]=t,t.stateNode=r}return _t(t),null;case 13:if($e(We),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ue&&tn!==null&&t.mode&1&&!(t.flags&128))K1(),lo(),t.flags|=98560,s=!1;else if(s=Cl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(G(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(G(317));s[Jn]=t}else lo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_t(t),s=!1}else Dn!==null&&(Kf(Dn),Dn=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||We.current&1?ut===0&&(ut=3):Qh())),t.updateQueue!==null&&(t.flags|=4),_t(t),null);case 4:return uo(),Vf(e,t),e===null&&Sa(t.stateNode.containerInfo),_t(t),null;case 10:return Mh(t.type._context),_t(t),null;case 17:return Qt(t.type)&&bc(),_t(t),null;case 19:if($e(We),s=t.memoizedState,s===null)return _t(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Fo(s,!1);else{if(ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=jc(e),o!==null){for(t.flags|=128,Fo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ie(We,We.current&1|2),t.child}e=e.sibling}s.tail!==null&&nt()>po&&(t.flags|=128,r=!0,Fo(s,!1),t.lanes=4194304)}else{if(!r)if(e=jc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ue)return _t(t),null}else 2*nt()-s.renderingStartTime>po&&n!==1073741824&&(t.flags|=128,r=!0,Fo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=nt(),t.sibling=null,n=We.current,Ie(We,r?n&1|2:n&1),t):(_t(t),null);case 22:case 23:return Yh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?en&1073741824&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function G_(e,t){switch(jh(t),t.tag){case 1:return Qt(t.type)&&bc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),$e(Yt),$e(Pt),Lh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ih(t),null;case 13:if($e(We),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(We),null;case 4:return uo(),null;case 10:return Mh(t.type._context),null;case 22:case 23:return Yh(),null;case 24:return null;default:return null}}var El=!1,jt=!1,Y_=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function Uf(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var yv=!1;function Q_(e,t){if(Tf=vc,e=L1(),Th(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,u=e,p=null;t:for(;;){for(var m;u!==n||i!==0&&u.nodeType!==3||(a=o+i),u!==s||r!==0&&u.nodeType!==3||(l=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(m=u.firstChild)!==null;)p=u,u=m;for(;;){if(u===e)break t;if(p===n&&++c===i&&(a=o),p===s&&++d===r&&(l=o),(m=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ef={focusedElem:e,selectionRange:n},vc=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,w=y.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?x:Pn(t.type,x),w);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(T){Xe(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return y=yv,yv=!1,y}function ia(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Uf(t,n,s)}i=i.next}while(i!==r)}}function du(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Hf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ow(e){var t=e.alternate;t!==null&&(e.alternate=null,Ow(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jn],delete t[_a],delete t[Rf],delete t[P_],delete t[M_])),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 Nw(e){return e.tag===5||e.tag===3||e.tag===4}function xv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nw(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 Wf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wc));else if(r!==4&&(e=e.child,e!==null))for(Wf(e,t,n),e=e.sibling;e!==null;)Wf(e,t,n),e=e.sibling}function qf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qf(e,t,n),e=e.sibling;e!==null;)qf(e,t,n),e=e.sibling}var xt=null,On=!1;function Dr(e,t,n){for(n=n.child;n!==null;)Dw(e,t,n),n=n.sibling}function Dw(e,t,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(ru,n)}catch{}switch(n.tag){case 5:jt||Ms(n,t);case 6:var r=xt,i=On;xt=null,Dr(e,t,n),xt=r,On=i,xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?hd(e.parentNode,n):e.nodeType===1&&hd(e,n),wa(e)):hd(xt,n.stateNode));break;case 4:r=xt,i=On,xt=n.stateNode.containerInfo,On=!0,Dr(e,t,n),xt=r,On=i;break;case 0:case 11:case 14:case 15:if(!jt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Uf(n,t,o),i=i.next}while(i!==r)}Dr(e,t,n);break;case 1:if(!jt&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Xe(n,t,a)}Dr(e,t,n);break;case 21:Dr(e,t,n);break;case 22:n.mode&1?(jt=(r=jt)||n.memoizedState!==null,Dr(e,t,n),jt=r):Dr(e,t,n);break;default:Dr(e,t,n)}}function wv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Y_),t.forEach(function(r){var i=iT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:xt=a.stateNode,On=!1;break e;case 3:xt=a.stateNode.containerInfo,On=!0;break e;case 4:xt=a.stateNode.containerInfo,On=!0;break e}a=a.return}if(xt===null)throw Error(G(160));Dw(s,o,i),xt=null,On=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Xe(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Iw(t,e),t=t.sibling}function Iw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),Hn(e),r&4){try{ia(3,e,e.return),du(3,e)}catch(x){Xe(e,e.return,x)}try{ia(5,e,e.return)}catch(x){Xe(e,e.return,x)}}break;case 1:jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var i=e.stateNode;try{ga(i,"")}catch(x){Xe(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&i1(i,s),gf(a,o);var c=gf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?c1(i,u):d==="dangerouslySetInnerHTML"?a1(i,u):d==="children"?ga(i,u):ph(i,d,u,c)}switch(a){case"input":df(i,s);break;case"textarea":s1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?$s(i,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?$s(i,!!s.multiple,s.defaultValue,!0):$s(i,!!s.multiple,s.multiple?[]:"",!1))}i[_a]=s}catch(x){Xe(e,e.return,x)}}break;case 6:if(jn(t,e),Hn(e),r&4){if(e.stateNode===null)throw Error(G(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){Xe(e,e.return,x)}}break;case 3:if(jn(t,e),Hn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{wa(t.containerInfo)}catch(x){Xe(e,e.return,x)}break;case 4:jn(t,e),Hn(e);break;case 13:jn(t,e),Hn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(qh=nt())),r&4&&wv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(jt=(c=jt)||d,jn(t,e),jt=c):jn(t,e),Hn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ce=e,d=e.child;d!==null;){for(u=ce=d;ce!==null;){switch(p=ce,m=p.child,p.tag){case 0:case 11:case 14:case 15:ia(4,p,p.return);break;case 1:Ms(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){Xe(r,n,x)}}break;case 5:Ms(p,p.return);break;case 22:if(p.memoizedState!==null){kv(u);continue}}m!==null?(m.return=p,ce=m):kv(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=u.stateNode,l=u.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=l1("display",o))}catch(x){Xe(e,e.return,x)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(x){Xe(e,e.return,x)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:jn(t,e),Hn(e),r&4&&wv(e);break;case 21:break;default:jn(t,e),Hn(e)}}function Hn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Nw(n)){var r=n;break e}n=n.return}throw Error(G(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ga(i,""),r.flags&=-33);var s=xv(e);qf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=xv(e);Wf(e,a,o);break;default:throw Error(G(161))}}catch(l){Xe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function K_(e,t,n){ce=e,Lw(e)}function Lw(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var i=ce,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||El;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||jt;a=El;var c=jt;if(El=o,(jt=l)&&!c)for(ce=i;ce!==null;)o=ce,l=o.child,o.tag===22&&o.memoizedState!==null?Sv(i):l!==null?(l.return=o,ce=l):Sv(i);for(;s!==null;)ce=s,Lw(s),s=s.sibling;ce=i,El=a,jt=c}bv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ce=s):bv(e)}}function bv(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||du(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!jt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Pn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&sv(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}sv(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&wa(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}jt||t.flags&512&&Hf(t)}catch(p){Xe(t,t.return,p)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function kv(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Sv(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{du(4,t)}catch(l){Xe(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Xe(t,i,l)}}var s=t.return;try{Hf(t)}catch(l){Xe(t,s,l)}break;case 5:var o=t.return;try{Hf(t)}catch(l){Xe(t,o,l)}}}catch(l){Xe(t,t.return,l)}if(t===e){ce=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ce=a;break}ce=t.return}}var X_=Math.ceil,Pc=Pr.ReactCurrentDispatcher,Hh=Pr.ReactCurrentOwner,kn=Pr.ReactCurrentBatchConfig,Ee=0,ht=null,it=null,bt=0,en=0,Os=yi(0),ut=0,Pa=null,es=0,fu=0,Wh=0,sa=null,Ht=null,qh=0,po=1/0,vr=null,Mc=!1,Gf=null,oi=null,jl=!1,Jr=null,Oc=0,oa=0,Yf=null,Zl=-1,Jl=0;function It(){return Ee&6?nt():Zl!==-1?Zl:Zl=nt()}function ai(e){return e.mode&1?Ee&2&&bt!==0?bt&-bt:N_.transition!==null?(Jl===0&&(Jl=b1()),Jl):(e=Re,e!==0||(e=window.event,e=e===void 0?16:j1(e.type)),e):1}function Bn(e,t,n,r){if(50<oa)throw oa=0,Yf=null,Error(G(185));Za(e,n,r),(!(Ee&2)||e!==ht)&&(e===ht&&(!(Ee&2)&&(fu|=n),ut===4&&Vr(e,bt)),Kt(e,r),n===1&&Ee===0&&!(t.mode&1)&&(po=nt()+500,lu&&xi()))}function Kt(e,t){var n=e.callbackNode;N2(e,t);var r=gc(e,e===ht?bt:0);if(r===0)n!==null&&Mg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Mg(n),t===1)e.tag===0?O_(Cv.bind(null,e)):G1(Cv.bind(null,e)),A_(function(){!(Ee&6)&&xi()}),n=null;else{switch(k1(r)){case 1:n=yh;break;case 4:n=x1;break;case 16:n=mc;break;case 536870912:n=w1;break;default:n=mc}n=Ww(n,Fw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Fw(e,t){if(Zl=-1,Jl=0,Ee&6)throw Error(G(327));var n=e.callbackNode;if(Ws()&&e.callbackNode!==n)return null;var r=gc(e,e===ht?bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Nc(e,r);else{t=r;var i=Ee;Ee|=2;var s=$w();(ht!==e||bt!==t)&&(vr=null,po=nt()+500,Hi(e,t));do try{eT();break}catch(a){Bw(e,a)}while(!0);Ph(),Pc.current=s,Ee=i,it!==null?t=0:(ht=null,bt=0,t=ut)}if(t!==0){if(t===2&&(i=bf(e),i!==0&&(r=i,t=Qf(e,i))),t===1)throw n=Pa,Hi(e,0),Vr(e,r),Kt(e,nt()),n;if(t===6)Vr(e,r);else{if(i=e.current.alternate,!(r&30)&&!Z_(i)&&(t=Nc(e,r),t===2&&(s=bf(e),s!==0&&(r=s,t=Qf(e,s))),t===1))throw n=Pa,Hi(e,0),Vr(e,r),Kt(e,nt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(G(345));case 2:Ei(e,Ht,vr);break;case 3:if(Vr(e,r),(r&130023424)===r&&(t=qh+500-nt(),10<t)){if(gc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){It(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Af(Ei.bind(null,e,Ht,vr),t);break}Ei(e,Ht,vr);break;case 4:if(Vr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Fn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*X_(r/1960))-r,10<r){e.timeoutHandle=Af(Ei.bind(null,e,Ht,vr),r);break}Ei(e,Ht,vr);break;case 5:Ei(e,Ht,vr);break;default:throw Error(G(329))}}}return Kt(e,nt()),e.callbackNode===n?Fw.bind(null,e):null}function Qf(e,t){var n=sa;return e.current.memoizedState.isDehydrated&&(Hi(e,t).flags|=256),e=Nc(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&Kf(t)),e}function Kf(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function Z_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!zn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Vr(e,t){for(t&=~Wh,t&=~fu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fn(t),r=1<<n;e[n]=-1,t&=~r}}function Cv(e){if(Ee&6)throw Error(G(327));Ws();var t=gc(e,0);if(!(t&1))return Kt(e,nt()),null;var n=Nc(e,t);if(e.tag!==0&&n===2){var r=bf(e);r!==0&&(t=r,n=Qf(e,r))}if(n===1)throw n=Pa,Hi(e,0),Vr(e,t),Kt(e,nt()),n;if(n===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,Ht,vr),Kt(e,nt()),null}function Gh(e,t){var n=Ee;Ee|=1;try{return e(t)}finally{Ee=n,Ee===0&&(po=nt()+500,lu&&xi())}}function ts(e){Jr!==null&&Jr.tag===0&&!(Ee&6)&&Ws();var t=Ee;Ee|=1;var n=kn.transition,r=Re;try{if(kn.transition=null,Re=1,e)return e()}finally{Re=r,kn.transition=n,Ee=t,!(Ee&6)&&xi()}}function Yh(){en=Os.current,$e(Os)}function Hi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,j_(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(jh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&bc();break;case 3:uo(),$e(Yt),$e(Pt),Lh();break;case 5:Ih(r);break;case 4:uo();break;case 13:$e(We);break;case 19:$e(We);break;case 10:Mh(r.type._context);break;case 22:case 23:Yh()}n=n.return}if(ht=e,it=e=li(e.current,null),bt=en=t,ut=0,Pa=null,Wh=fu=es=0,Ht=sa=null,Mi!==null){for(t=0;t<Mi.length;t++)if(n=Mi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Mi=null}return e}function Bw(e,t){do{var n=it;try{if(Ph(),Ql.current=Rc,Ac){for(var r=Ge.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ac=!1}if(Ji=0,pt=lt=Ge=null,ra=!1,ja=0,Hh.current=null,n===null||n.return===null){ut=1,Pa=t,it=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=dv(o);if(m!==null){m.flags&=-257,fv(m,o,a,s,t),m.mode&1&&uv(s,c,t),t=m,l=c;var y=t.updateQueue;if(y===null){var x=new Set;x.add(l),t.updateQueue=x}else y.add(l);break e}else{if(!(t&1)){uv(s,c,t),Qh();break e}l=Error(G(426))}}else if(Ue&&a.mode&1){var w=dv(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),fv(w,o,a,s,t),Ah(fo(l,a));break e}}s=l=fo(l,a),ut!==4&&(ut=2),sa===null?sa=[s]:sa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var h=kw(s,l,t);iv(s,h);break e;case 1:a=l;var g=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(oi===null||!oi.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var T=Sw(s,a,t);iv(s,T);break e}}s=s.return}while(s!==null)}Vw(n)}catch(_){t=_,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function $w(){var e=Pc.current;return Pc.current=Rc,e===null?Rc:e}function Qh(){(ut===0||ut===3||ut===2)&&(ut=4),ht===null||!(es&268435455)&&!(fu&268435455)||Vr(ht,bt)}function Nc(e,t){var n=Ee;Ee|=2;var r=$w();(ht!==e||bt!==t)&&(vr=null,Hi(e,t));do try{J_();break}catch(i){Bw(e,i)}while(!0);if(Ph(),Ee=n,Pc.current=r,it!==null)throw Error(G(261));return ht=null,bt=0,ut}function J_(){for(;it!==null;)zw(it)}function eT(){for(;it!==null&&!_2();)zw(it)}function zw(e){var t=Hw(e.alternate,e,en);e.memoizedProps=e.pendingProps,t===null?Vw(e):it=t,Hh.current=null}function Vw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=G_(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,it=null;return}}else if(n=q_(n,t,en),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);ut===0&&(ut=5)}function Ei(e,t,n){var r=Re,i=kn.transition;try{kn.transition=null,Re=1,tT(e,t,n,r)}finally{kn.transition=i,Re=r}return null}function tT(e,t,n,r){do Ws();while(Jr!==null);if(Ee&6)throw Error(G(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(D2(e,s),e===ht&&(it=ht=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||jl||(jl=!0,Ww(mc,function(){return Ws(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=kn.transition,kn.transition=null;var o=Re;Re=1;var a=Ee;Ee|=4,Hh.current=null,Q_(e,n),Iw(n,e),b_(Ef),vc=!!Tf,Ef=Tf=null,e.current=n,K_(n),T2(),Ee=a,Re=o,kn.transition=s}else e.current=n;if(jl&&(jl=!1,Jr=e,Oc=i),s=e.pendingLanes,s===0&&(oi=null),A2(n.stateNode),Kt(e,nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Mc)throw Mc=!1,e=Gf,Gf=null,e;return Oc&1&&e.tag!==0&&Ws(),s=e.pendingLanes,s&1?e===Yf?oa++:(oa=0,Yf=e):oa=0,xi(),null}function Ws(){if(Jr!==null){var e=k1(Oc),t=kn.transition,n=Re;try{if(kn.transition=null,Re=16>e?16:e,Jr===null)var r=!1;else{if(e=Jr,Jr=null,Oc=0,Ee&6)throw Error(G(331));var i=Ee;for(Ee|=4,ce=e.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ce=c;ce!==null;){var d=ce;switch(d.tag){case 0:case 11:case 15:ia(8,d,s)}var u=d.child;if(u!==null)u.return=d,ce=u;else for(;ce!==null;){d=ce;var p=d.sibling,m=d.return;if(Ow(d),d===c){ce=null;break}if(p!==null){p.return=m,ce=p;break}ce=m}}}var y=s.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==null)}}ce=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ce=o;else e:for(;ce!==null;){if(s=ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ia(9,s,s.return)}var h=s.sibling;if(h!==null){h.return=s.return,ce=h;break e}ce=s.return}}var g=e.current;for(ce=g;ce!==null;){o=ce;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,ce=b;else e:for(o=g;ce!==null;){if(a=ce,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:du(9,a)}}catch(_){Xe(a,a.return,_)}if(a===o){ce=null;break e}var T=a.sibling;if(T!==null){T.return=a.return,ce=T;break e}ce=a.return}}if(Ee=i,xi(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(ru,e)}catch{}r=!0}return r}finally{Re=n,kn.transition=t}}return!1}function _v(e,t,n){t=fo(n,t),t=kw(e,t,1),e=si(e,t,1),t=It(),e!==null&&(Za(e,1,t),Kt(e,t))}function Xe(e,t,n){if(e.tag===3)_v(e,e,n);else for(;t!==null;){if(t.tag===3){_v(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(oi===null||!oi.has(r))){e=fo(n,e),e=Sw(t,e,1),t=si(t,e,1),e=It(),t!==null&&(Za(t,1,e),Kt(t,e));break}}t=t.return}}function nT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=It(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(bt&n)===n&&(ut===4||ut===3&&(bt&130023424)===bt&&500>nt()-qh?Hi(e,0):Wh|=n),Kt(e,t)}function Uw(e,t){t===0&&(e.mode&1?(t=yl,yl<<=1,!(yl&130023424)&&(yl=4194304)):t=1);var n=It();e=Er(e,t),e!==null&&(Za(e,t,n),Kt(e,n))}function rT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Uw(e,n)}function iT(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(G(314))}r!==null&&r.delete(t),Uw(e,n)}var Hw;Hw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yt.current)Gt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gt=!1,W_(e,t,n);Gt=!!(e.flags&131072)}else Gt=!1,Ue&&t.flags&1048576&&Y1(t,Cc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xl(e,t),e=t.pendingProps;var i=ao(t,Pt.current);Hs(t,n),i=Bh(null,t,r,e,i,n);var s=$h();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qt(r)?(s=!0,kc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Nh(t),i.updater=uu,t.stateNode=i,i._reactInternals=t,If(t,r,e,n),t=Bf(null,t,r,!0,s,n)):(t.tag=0,Ue&&s&&Eh(t),Nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=oT(r),e=Pn(r,e),i){case 0:t=Ff(null,t,r,e,n);break e;case 1:t=mv(null,t,r,e,n);break e;case 11:t=pv(null,t,r,e,n);break e;case 14:t=hv(null,t,r,Pn(r.type,e),n);break e}throw Error(G(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),Ff(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),mv(e,t,r,i,n);case 3:e:{if(Ew(t),e===null)throw Error(G(387));r=t.pendingProps,s=t.memoizedState,i=s.element,ew(e,t),Ec(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=fo(Error(G(423)),t),t=gv(e,t,r,n,i);break e}else if(r!==i){i=fo(Error(G(424)),t),t=gv(e,t,r,n,i);break e}else for(tn=ii(t.stateNode.containerInfo.firstChild),sn=t,Ue=!0,Dn=null,n=Z1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lo(),r===i){t=jr(e,t,n);break e}Nt(e,t,r,n)}t=t.child}return t;case 5:return tw(t),e===null&&Of(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,jf(r,i)?o=null:s!==null&&jf(r,s)&&(t.flags|=32),Tw(e,t),Nt(e,t,o,n),t.child;case 6:return e===null&&Of(t),null;case 13:return jw(e,t,n);case 4:return Dh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),pv(e,t,r,i,n);case 7:return Nt(e,t,t.pendingProps,n),t.child;case 8:return Nt(e,t,t.pendingProps.children,n),t.child;case 12:return Nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Ie(_c,r._currentValue),r._currentValue=o,s!==null)if(zn(s.value,o)){if(s.children===i.children&&!Yt.current){t=jr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Sr(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Nf(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(G(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Nf(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=Cn(i),r=r(i),t.flags|=1,Nt(e,t,r,n),t.child;case 14:return r=t.type,i=Pn(r,t.pendingProps),i=Pn(r.type,i),hv(e,t,r,i,n);case 15:return Cw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),Xl(e,t),t.tag=1,Qt(r)?(e=!0,kc(t)):e=!1,Hs(t,n),bw(t,r,i),If(t,r,i,n),Bf(null,t,r,!0,e,n);case 19:return Aw(e,t,n);case 22:return _w(e,t,n)}throw Error(G(156,t.tag))};function Ww(e,t){return y1(e,t)}function sT(e,t,n,r){this.tag=e,this.key=n,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 bn(e,t,n,r){return new sT(e,t,n,r)}function Kh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oT(e){if(typeof e=="function")return Kh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mh)return 11;if(e===gh)return 14}return 2}function li(e,t){var n=e.alternate;return n===null?(n=bn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ec(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Kh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Wi(n.children,i,s,t);case hh:o=8,i|=8;break;case of:return e=bn(12,n,t,i|2),e.elementType=of,e.lanes=s,e;case af:return e=bn(13,n,t,i),e.elementType=af,e.lanes=s,e;case lf:return e=bn(19,n,t,i),e.elementType=lf,e.lanes=s,e;case t1:return pu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jx:o=10;break e;case e1:o=9;break e;case mh:o=11;break e;case gh:o=14;break e;case Fr:o=16,r=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=bn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=bn(7,e,r,t),e.lanes=n,e}function pu(e,t,n,r){return e=bn(22,e,r,t),e.elementType=t1,e.lanes=n,e.stateNode={isHidden:!1},e}function kd(e,t,n){return e=bn(6,e,null,t),e.lanes=n,e}function Sd(e,t,n){return t=bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function aT(e,t,n,r,i){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=rd(0),this.expirationTimes=rd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Xh(e,t,n,r,i,s,o,a,l){return e=new aT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=bn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Nh(s),e}function lT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function qw(e){if(!e)return fi;e=e._reactInternals;e:{if(os(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var n=e.type;if(Qt(n))return q1(e,n,t)}return t}function Gw(e,t,n,r,i,s,o,a,l){return e=Xh(n,r,!0,e,i,s,o,a,l),e.context=qw(null),n=e.current,r=It(),i=ai(n),s=Sr(r,i),s.callback=t??null,si(n,s,i),e.current.lanes=i,Za(e,i,r),Kt(e,r),e}function hu(e,t,n,r){var i=t.current,s=It(),o=ai(i);return n=qw(n),t.context===null?t.context=n:t.pendingContext=n,t=Sr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=si(i,t,o),e!==null&&(Bn(e,i,o,s),Yl(e,i,o)),o}function Dc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Tv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zh(e,t){Tv(e,t),(e=e.alternate)&&Tv(e,t)}function cT(){return null}var Yw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jh(e){this._internalRoot=e}mu.prototype.render=Jh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));hu(e,t,null,null)};mu.prototype.unmount=Jh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){hu(null,e,null,null)}),t[Tr]=null}};function mu(e){this._internalRoot=e}mu.prototype.unstable_scheduleHydration=function(e){if(e){var t=_1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zr.length&&t!==0&&t<zr[n].priority;n++);zr.splice(n,0,e),n===0&&E1(e)}};function em(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Ev(){}function uT(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Dc(o);s.call(c)}}var o=Gw(t,r,e,0,null,!1,!1,"",Ev);return e._reactRootContainer=o,e[Tr]=o.current,Sa(e.nodeType===8?e.parentNode:e),ts(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Dc(l);a.call(c)}}var l=Xh(e,0,!1,null,null,!1,!1,"",Ev);return e._reactRootContainer=l,e[Tr]=l.current,Sa(e.nodeType===8?e.parentNode:e),ts(function(){hu(t,l,n,r)}),l}function vu(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Dc(o);a.call(l)}}hu(t,o,e,i)}else o=uT(n,t,e,i,r);return Dc(o)}S1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Wo(t.pendingLanes);n!==0&&(xh(t,n|1),Kt(t,nt()),!(Ee&6)&&(po=nt()+500,xi()))}break;case 13:ts(function(){var r=Er(e,1);if(r!==null){var i=It();Bn(r,e,1,i)}}),Zh(e,1)}};wh=function(e){if(e.tag===13){var t=Er(e,134217728);if(t!==null){var n=It();Bn(t,e,134217728,n)}Zh(e,134217728)}};C1=function(e){if(e.tag===13){var t=ai(e),n=Er(e,t);if(n!==null){var r=It();Bn(n,e,t,r)}Zh(e,t)}};_1=function(){return Re};T1=function(e,t){var n=Re;try{return Re=e,t()}finally{Re=n}};yf=function(e,t,n){switch(t){case"input":if(df(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=au(r);if(!i)throw Error(G(90));r1(r),df(r,i)}}}break;case"textarea":s1(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};f1=Gh;p1=ts;var dT={usingClientEntryPoint:!1,Events:[el,Es,au,u1,d1,Gh]},Bo={findFiberByHostInstance:Pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fT={bundleType:Bo.bundleType,version:Bo.version,rendererPackageName:Bo.rendererPackageName,rendererConfig:Bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=g1(e),e===null?null:e.stateNode},findFiberByHostInstance:Bo.findFiberByHostInstance||cT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Al=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Al.isDisabled&&Al.supportsFiber)try{ru=Al.inject(fT),tr=Al}catch{}}an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dT;an.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!em(t))throw Error(G(200));return lT(e,t,null,n)};an.createRoot=function(e,t){if(!em(e))throw Error(G(299));var n=!1,r="",i=Yw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Xh(e,1,!1,null,null,n,!1,r,i),e[Tr]=t.current,Sa(e.nodeType===8?e.parentNode:e),new Jh(t)};an.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(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=g1(t),e=e===null?null:e.stateNode,e};an.flushSync=function(e){return ts(e)};an.hydrate=function(e,t,n){if(!gu(t))throw Error(G(200));return vu(null,e,t,!0,n)};an.hydrateRoot=function(e,t,n){if(!em(e))throw Error(G(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Yw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Gw(t,null,e,1,n??null,i,!1,s,o),e[Tr]=t.current,Sa(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new mu(t)};an.render=function(e,t,n){if(!gu(t))throw Error(G(200));return vu(null,e,t,!1,n)};an.unmountComponentAtNode=function(e){if(!gu(e))throw Error(G(40));return e._reactRootContainer?(ts(function(){vu(null,null,e,!1,function(){e._reactRootContainer=null,e[Tr]=null})}),!0):!1};an.unstable_batchedUpdates=Gh;an.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!gu(n))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return vu(e,t,n,!1,r)};an.version="18.3.1-next-f1338f8080-20240426";function Qw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qw)}catch(e){console.error(e)}}Qw(),Qx.exports=an;var Kw=Qx.exports;const pT=Rr(Kw);var Xw,jv=Kw;Xw=jv.createRoot,jv.hydrateRoot;const hT="@alfatech/livechat",mT="v2026.03.15.3",gT="module",vT="https://api.chatier.app",yT="wss://api.chatier.app",xT=["dist","README.md","component/chatier.js"],wT="dist/widget.js",bT={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},kT={dev:"vite",dev2:"vite --config vite.config.2.ts",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint",preview:"vite preview","build:mobile":"tsc -b && vite build --config vite.config.app.ts && mv dist-app/index-app.html dist-app/index.html","preview:mobile":"vite preview --config vite.config.app.ts --outDir dist-app","dev:mobile":"vite --config vite.config.app.ts"},ST={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},CT={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},Zw={name:hT,private:!1,version:mT,type:gT,apiURL:vT,wsURL:yT,files:xT,main:wT,author:bT,scripts:kT,dependencies:ST,devDependencies:CT,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},Jw=Zw.apiURL,_T=Zw.wsURL,TT=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],ET=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],jT={429:TT,404:ET};async function Mr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${Jw}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>new Response(null,{status:500}));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{}const o=jT[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const $n=e=>[200,201,204].includes(e),AT=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var Co=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ns=typeof window>"u"||"Deno"in globalThis;function vn(){}function RT(e,t){return typeof e=="function"?e(t):e}function Xf(e){return typeof e=="number"&&e>=0&&e!==1/0}function eb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qs(e,t){return typeof e=="function"?e(t):e}function In(e,t){return typeof e=="function"?e(t):e}function Av(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==tm(o,t.options))return!1}else if(!Ma(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Rv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(rs(t.options.mutationKey)!==rs(s))return!1}else if(!Ma(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function tm(e,t){return((t==null?void 0:t.queryKeyHashFn)||rs)(e)}function rs(e){return JSON.stringify(e,(t,n)=>Zf(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ma(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ma(e[n],t[n])):!1}function tb(e,t){if(e===t)return e;const n=Pv(e)&&Pv(t);if(n||Zf(e)&&Zf(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=tb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Ic(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Pv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Zf(e){if(!Mv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Mv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Mv(e){return Object.prototype.toString.call(e)==="[object Object]"}function PT(e){return new Promise(t=>{setTimeout(t,e)})}function Jf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?tb(e,t):t}function MT(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function OT(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var nm=Symbol();function nb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===nm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Li,Ur,Gs,jx,NT=(jx=class extends Co{constructor(){super();pe(this,Li);pe(this,Ur);pe(this,Gs);le(this,Gs,t=>{if(!ns&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){j(this,Ur)||this.setEventListener(j(this,Gs))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,Ur))==null||t.call(this),le(this,Ur,void 0))}setEventListener(t){var n;le(this,Gs,t),(n=j(this,Ur))==null||n.call(this),le(this,Ur,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){j(this,Li)!==t&&(le(this,Li,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof j(this,Li)=="boolean"?j(this,Li):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Li=new WeakMap,Ur=new WeakMap,Gs=new WeakMap,jx),rm=new NT,Ys,Hr,Qs,Ax,DT=(Ax=class extends Co{constructor(){super();pe(this,Ys,!0);pe(this,Hr);pe(this,Qs);le(this,Qs,t=>{if(!ns&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){j(this,Hr)||this.setEventListener(j(this,Qs))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,Hr))==null||t.call(this),le(this,Hr,void 0))}setEventListener(t){var n;le(this,Qs,t),(n=j(this,Hr))==null||n.call(this),le(this,Hr,t(this.setOnline.bind(this)))}setOnline(t){j(this,Ys)!==t&&(le(this,Ys,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return j(this,Ys)}},Ys=new WeakMap,Hr=new WeakMap,Qs=new WeakMap,Ax),Lc=new DT;function ep(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function IT(e){return Math.min(1e3*2**e,3e4)}function rb(e){return(e??"online")==="online"?Lc.isOnline():!0}var ib=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Cd(e){return e instanceof ib}function sb(e){let t=!1,n=0,r=!1,i;const s=ep(),o=x=>{var w;r||(p(new ib(x)),(w=e.abort)==null||w.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>rm.isFocused()&&(e.networkMode==="always"||Lc.isOnline())&&e.canRun(),d=()=>rb(e.networkMode)&&e.canRun(),u=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),s.resolve(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s.reject(x))},m=()=>new Promise(x=>{var w;i=h=>{(r||c())&&x(h)},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;const w=n===0?e.initialPromise:void 0;try{x=w??e.fn()}catch(h){x=Promise.reject(h)}Promise.resolve(x).then(u).catch(h=>{var E;if(r)return;const g=e.retry??(ns?0:3),b=e.retryDelay??IT,T=typeof b=="function"?b(n,h):b,_=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,h);if(t||!_){p(h);return}n++,(E=e.onFail)==null||E.call(e,n,h),PT(T).then(()=>c()?void 0:m()).then(()=>{t?p(h):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():m().then(y),s)}}function LT(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var ct=LT(),Fi,Rx,ob=(Rx=class{constructor(){pe(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xf(this.gcTime)&&le(this,Fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ns?1/0:5*60*1e3))}clearGcTimeout(){j(this,Fi)&&(clearTimeout(j(this,Fi)),le(this,Fi,void 0))}},Fi=new WeakMap,Rx),Ks,Xs,gn,Tt,Ga,Bi,Mn,mr,Px,FT=(Px=class extends ob{constructor(t){super();pe(this,Mn);pe(this,Ks);pe(this,Xs);pe(this,gn);pe(this,Tt);pe(this,Ga);pe(this,Bi);le(this,Bi,!1),le(this,Ga,t.defaultOptions),this.setOptions(t.options),this.observers=[],le(this,gn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,le(this,Ks,BT(this.options)),this.state=t.state??j(this,Ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=j(this,Tt))==null?void 0:t.promise}setOptions(t){this.options={...j(this,Ga),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&j(this,gn).remove(this)}setData(t,n){const r=Jf(this.state.data,t,this.options);return we(this,Mn,mr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){we(this,Mn,mr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=j(this,Tt))==null?void 0:r.promise;return(i=j(this,Tt))==null||i.cancel(t),n?n.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(j(this,Ks))}isActive(){return this.observers.some(t=>In(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!eb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=j(this,Tt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=j(this,Tt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),j(this,gn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(j(this,Tt)&&(j(this,Bi)?j(this,Tt).cancel({revert:!0}):j(this,Tt).cancelRetry()),this.scheduleGc()),j(this,gn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||we(this,Mn,mr).call(this,{type:"invalidate"})}fetch(t,n){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(j(this,Tt))return j(this,Tt).continueRetry(),j(this,Tt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(p=>p.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(le(this,Bi,!0),r.signal)})},s=()=>{const u=nb(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),le(this,Bi,!1),this.options.persister?this.options.persister(u,p,this):u(p)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),le(this,Xs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&we(this,Mn,mr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,m,y,x;Cd(u)&&u.silent||we(this,Mn,mr).call(this,{type:"error",error:u}),Cd(u)||((m=(p=j(this,gn).config).onError)==null||m.call(p,u,this),(x=(y=j(this,gn).config).onSettled)==null||x.call(y,this.state.data,u,this)),this.scheduleGc()};return le(this,Tt,sb({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,m,y,x;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(w){a(w);return}(m=(p=j(this,gn).config).onSuccess)==null||m.call(p,u,this),(x=(y=j(this,gn).config).onSettled)==null||x.call(y,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{we(this,Mn,mr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{we(this,Mn,mr).call(this,{type:"pause"})},onContinue:()=>{we(this,Mn,mr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),j(this,Tt).start()}},Ks=new WeakMap,Xs=new WeakMap,gn=new WeakMap,Tt=new WeakMap,Ga=new WeakMap,Bi=new WeakMap,Mn=new WeakSet,mr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ab(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Cd(i)&&i.revert&&j(this,Xs)?{...j(this,Xs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ct.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),j(this,gn).notify({query:this,type:"updated",action:t})})},Px);function ab(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function BT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qn,Mx,$T=(Mx=class extends Co{constructor(t={}){super();pe(this,Qn);this.config=t,le(this,Qn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??tm(i,n);let o=this.get(s);return o||(o=new FT({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){j(this,Qn).has(t.queryHash)||(j(this,Qn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=j(this,Qn).get(t.queryHash);n&&(t.destroy(),n===t&&j(this,Qn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return j(this,Qn).get(t)}getAll(){return[...j(this,Qn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Av(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Av(t,r)):n}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qn=new WeakMap,Mx),Kn,Mt,$i,Xn,Ir,Ox,zT=(Ox=class extends ob{constructor(t){super();pe(this,Xn);pe(this,Kn);pe(this,Mt);pe(this,$i);this.mutationId=t.mutationId,le(this,Mt,t.mutationCache),le(this,Kn,[]),this.state=t.state||lb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){j(this,Kn).includes(t)||(j(this,Kn).push(t),this.clearGcTimeout(),j(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){le(this,Kn,j(this,Kn).filter(n=>n!==t)),this.scheduleGc(),j(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){j(this,Kn).length||(this.state.status==="pending"?this.scheduleGc():j(this,Mt).remove(this))}continue(){var t;return((t=j(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,m,y,x,w,h,g,b,T,_,E,S;le(this,$i,sb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,B)=>{we(this,Xn,Ir).call(this,{type:"failed",failureCount:A,error:B})},onPause:()=>{we(this,Xn,Ir).call(this,{type:"pause"})},onContinue:()=>{we(this,Xn,Ir).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>j(this,Mt).canRun(this)}));const n=this.state.status==="pending",r=!j(this,$i).canStart();try{if(!n){we(this,Xn,Ir).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=j(this,Mt).config).onMutate)==null?void 0:s.call(i,t,this));const B=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));B!==this.state.context&&we(this,Xn,Ir).call(this,{type:"pending",context:B,variables:t,isPaused:r})}const A=await j(this,$i).start();return await((c=(l=j(this,Mt).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,A,t,this.state.context)),await((m=(p=j(this,Mt).config).onSettled)==null?void 0:m.call(p,A,null,this.state.variables,this.state.context,this)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,A,null,t,this.state.context)),we(this,Xn,Ir).call(this,{type:"success",data:A}),A}catch(A){try{throw await((h=(w=j(this,Mt).config).onError)==null?void 0:h.call(w,A,t,this.state.context,this)),await((b=(g=this.options).onError)==null?void 0:b.call(g,A,t,this.state.context)),await((_=(T=j(this,Mt).config).onSettled)==null?void 0:_.call(T,void 0,A,this.state.variables,this.state.context,this)),await((S=(E=this.options).onSettled)==null?void 0:S.call(E,void 0,A,t,this.state.context)),A}finally{we(this,Xn,Ir).call(this,{type:"error",error:A})}}finally{j(this,Mt).runNext(this)}}},Kn=new WeakMap,Mt=new WeakMap,$i=new WeakMap,Xn=new WeakSet,Ir=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ct.batch(()=>{j(this,Kn).forEach(r=>{r.onMutationUpdate(t)}),j(this,Mt).notify({mutation:this,type:"updated",action:t})})},Ox);function lb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Jt,Ya,Nx,VT=(Nx=class extends Co{constructor(t={}){super();pe(this,Jt);pe(this,Ya);this.config=t,le(this,Jt,new Map),le(this,Ya,Date.now())}build(t,n,r){const i=new zT({mutationCache:this,mutationId:++fl(this,Ya)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Rl(t),r=j(this,Jt).get(n)??[];r.push(t),j(this,Jt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Rl(t);if(j(this,Jt).has(n)){const i=(r=j(this,Jt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?j(this,Jt).delete(n):j(this,Jt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=j(this,Jt).get(Rl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=j(this,Jt).get(Rl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...j(this,Jt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Rv(n,r))}findAll(t={}){return this.getAll().filter(n=>Rv(t,n))}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ct.batch(()=>Promise.all(t.map(n=>n.continue().catch(vn))))}},Jt=new WeakMap,Ya=new WeakMap,Nx);function Rl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Ov(e){return{onFetch:(t,n)=>{var d,u,p,m,y;const r=t.options,i=(p=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:p.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let x=!1;const w=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},h=nb(t.options,t.fetchOptions),g=async(b,T,_)=>{if(x)return Promise.reject();if(T==null&&b.pages.length)return Promise.resolve(b);const E={queryKey:t.queryKey,pageParam:T,direction:_?"backward":"forward",meta:t.options.meta};w(E);const S=await h(E),{maxPages:A}=t.options,B=_?OT:MT;return{pages:B(b.pages,S,A),pageParams:B(b.pageParams,T,A)}};if(i&&s.length){const b=i==="backward",T=b?UT:Nv,_={pages:s,pageParams:o},E=T(r,_);a=await g(_,E,b)}else{const b=e??s.length;do{const T=l===0?o[0]??r.initialPageParam:Nv(r,a);if(l>0&&T==null)break;a=await g(a,T),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var x,w;return(w=(x=t.options).persister)==null?void 0:w.call(x,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Nv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function UT(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Qe,Wr,qr,Zs,Js,Gr,eo,to,Dx,HT=(Dx=class{constructor(e={}){pe(this,Qe);pe(this,Wr);pe(this,qr);pe(this,Zs);pe(this,Js);pe(this,Gr);pe(this,eo);pe(this,to);le(this,Qe,e.queryCache||new $T),le(this,Wr,e.mutationCache||new VT),le(this,qr,e.defaultOptions||{}),le(this,Zs,new Map),le(this,Js,new Map),le(this,Gr,0)}mount(){fl(this,Gr)._++,j(this,Gr)===1&&(le(this,eo,rm.subscribe(async e=>{e&&(await this.resumePausedMutations(),j(this,Qe).onFocus())})),le(this,to,Lc.subscribe(async e=>{e&&(await this.resumePausedMutations(),j(this,Qe).onOnline())})))}unmount(){var e,t;fl(this,Gr)._--,j(this,Gr)===0&&((e=j(this,eo))==null||e.call(this),le(this,eo,void 0),(t=j(this,to))==null||t.call(this),le(this,to,void 0))}isFetching(e){return j(this,Qe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return j(this,Wr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=j(this,Qe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=j(this,Qe).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return j(this,Qe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=j(this,Qe).get(r.queryHash),s=i==null?void 0:i.state.data,o=RT(t,s);if(o!==void 0)return j(this,Qe).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ct.batch(()=>j(this,Qe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=j(this,Qe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=j(this,Qe);ct.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=j(this,Qe),r={type:"active",...e};return ct.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ct.batch(()=>j(this,Qe).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return ct.batch(()=>{if(j(this,Qe).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ct.batch(()=>j(this,Qe).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(vn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=j(this,Qe).build(this,t);return n.isStaleByTime(qs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e.behavior=Ov(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e.behavior=Ov(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Lc.isOnline()?j(this,Wr).resumePausedMutations():Promise.resolve()}getQueryCache(){return j(this,Qe)}getMutationCache(){return j(this,Wr)}getDefaultOptions(){return j(this,qr)}setDefaultOptions(e){le(this,qr,e)}setQueryDefaults(e,t){j(this,Zs).set(rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...j(this,Zs).values()],n={};return t.forEach(r=>{Ma(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){j(this,Js).set(rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...j(this,Js).values()];let n={};return t.forEach(r=>{Ma(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...j(this,qr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=tm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===nm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...j(this,qr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){j(this,Qe).clear(),j(this,Wr).clear()}},Qe=new WeakMap,Wr=new WeakMap,qr=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Gr=new WeakMap,eo=new WeakMap,to=new WeakMap,Dx),zt,_e,Qa,Ot,zi,no,Yr,Zn,Ka,ro,io,Vi,Ui,Qr,so,Ae,Go,tp,np,rp,ip,sp,op,ap,cb,Ix,WT=(Ix=class extends Co{constructor(t,n){super();pe(this,Ae);pe(this,zt);pe(this,_e);pe(this,Qa);pe(this,Ot);pe(this,zi);pe(this,no);pe(this,Yr);pe(this,Zn);pe(this,Ka);pe(this,ro);pe(this,io);pe(this,Vi);pe(this,Ui);pe(this,Qr);pe(this,so,new Set);this.options=n,le(this,zt,t),le(this,Zn,null),le(this,Yr,ep()),this.options.experimental_prefetchInRender||j(this,Yr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(j(this,_e).addObserver(this),Dv(j(this,_e),this.options)?we(this,Ae,Go).call(this):this.updateResult(),we(this,Ae,ip).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lp(j(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lp(j(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,we(this,Ae,sp).call(this),we(this,Ae,op).call(this),j(this,_e).removeObserver(this)}setOptions(t,n){const r=this.options,i=j(this,_e);if(this.options=j(this,zt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof In(this.options.enabled,j(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");we(this,Ae,ap).call(this),j(this,_e).setOptions(this.options),r._defaulted&&!Ic(this.options,r)&&j(this,zt).getQueryCache().notify({type:"observerOptionsUpdated",query:j(this,_e),observer:this});const s=this.hasListeners();s&&Iv(j(this,_e),i,this.options,r)&&we(this,Ae,Go).call(this),this.updateResult(n),s&&(j(this,_e)!==i||In(this.options.enabled,j(this,_e))!==In(r.enabled,j(this,_e))||qs(this.options.staleTime,j(this,_e))!==qs(r.staleTime,j(this,_e)))&&we(this,Ae,tp).call(this);const o=we(this,Ae,np).call(this);s&&(j(this,_e)!==i||In(this.options.enabled,j(this,_e))!==In(r.enabled,j(this,_e))||o!==j(this,Qr))&&we(this,Ae,rp).call(this,o)}getOptimisticResult(t){const n=j(this,zt).getQueryCache().build(j(this,zt),t),r=this.createResult(n,t);return GT(this,r)&&(le(this,Ot,r),le(this,no,this.options),le(this,zi,j(this,_e).state)),r}getCurrentResult(){return j(this,Ot)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){j(this,so).add(t)}getCurrentQuery(){return j(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=j(this,zt).defaultQueryOptions(t),r=j(this,zt).getQueryCache().build(j(this,zt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return we(this,Ae,Go).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),j(this,Ot)))}createResult(t,n){var A;const r=j(this,_e),i=this.options,s=j(this,Ot),o=j(this,zi),a=j(this,no),c=t!==r?t.state:j(this,Qa),{state:d}=t;let u={...d},p=!1,m;if(n._optimisticResults){const B=this.hasListeners(),L=!B&&Dv(t,n),N=B&&Iv(t,r,n,i);(L||N)&&(u={...u,...ab(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:w}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===j(this,Ka))m=j(this,ro);else try{le(this,Ka,n.select),m=n.select(u.data),m=Jf(s==null?void 0:s.data,m,n),le(this,ro,m),le(this,Zn,null)}catch(B){le(this,Zn,B)}else m=u.data;if(n.placeholderData!==void 0&&m===void 0&&w==="pending"){let B;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))B=s.data;else if(B=typeof n.placeholderData=="function"?n.placeholderData((A=j(this,io))==null?void 0:A.state.data,j(this,io)):n.placeholderData,n.select&&B!==void 0)try{B=n.select(B),le(this,Zn,null)}catch(L){le(this,Zn,L)}B!==void 0&&(w="success",m=Jf(s==null?void 0:s.data,B,n),p=!0)}j(this,Zn)&&(y=j(this,Zn),m=j(this,ro),x=Date.now(),w="error");const h=u.fetchStatus==="fetching",g=w==="pending",b=w==="error",T=g&&h,_=m!==void 0,S={status:w,fetchStatus:u.fetchStatus,isPending:g,isSuccess:w==="success",isError:b,isInitialLoading:T,isLoading:T,data:m,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:b&&!_,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:b&&_,isStale:im(t,n),refetch:this.refetch,promise:j(this,Yr)};if(this.options.experimental_prefetchInRender){const B=ee=>{S.status==="error"?ee.reject(S.error):S.data!==void 0&&ee.resolve(S.data)},L=()=>{const ee=le(this,Yr,S.promise=ep());B(ee)},N=j(this,Yr);switch(N.status){case"pending":t.queryHash===r.queryHash&&B(N);break;case"fulfilled":(S.status==="error"||S.data!==N.value)&&L();break;case"rejected":(S.status!=="error"||S.error!==N.reason)&&L();break}}return S}updateResult(t){const n=j(this,Ot),r=this.createResult(j(this,_e),this.options);if(le(this,zi,j(this,_e).state),le(this,no,this.options),j(this,zi).data!==void 0&&le(this,io,j(this,_e)),Ic(r,n))return;le(this,Ot,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!j(this,so).size)return!0;const l=new Set(a??j(this,so));return this.options.throwOnError&&l.add("error"),Object.keys(j(this,Ot)).some(c=>{const d=c;return j(this,Ot)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),we(this,Ae,cb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&we(this,Ae,ip).call(this)}},zt=new WeakMap,_e=new WeakMap,Qa=new WeakMap,Ot=new WeakMap,zi=new WeakMap,no=new WeakMap,Yr=new WeakMap,Zn=new WeakMap,Ka=new WeakMap,ro=new WeakMap,io=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,Qr=new WeakMap,so=new WeakMap,Ae=new WeakSet,Go=function(t){we(this,Ae,ap).call(this);let n=j(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vn)),n},tp=function(){we(this,Ae,sp).call(this);const t=qs(this.options.staleTime,j(this,_e));if(ns||j(this,Ot).isStale||!Xf(t))return;const r=eb(j(this,Ot).dataUpdatedAt,t)+1;le(this,Vi,setTimeout(()=>{j(this,Ot).isStale||this.updateResult()},r))},np=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(j(this,_e)):this.options.refetchInterval)??!1},rp=function(t){we(this,Ae,op).call(this),le(this,Qr,t),!(ns||In(this.options.enabled,j(this,_e))===!1||!Xf(j(this,Qr))||j(this,Qr)===0)&&le(this,Ui,setInterval(()=>{(this.options.refetchIntervalInBackground||rm.isFocused())&&we(this,Ae,Go).call(this)},j(this,Qr)))},ip=function(){we(this,Ae,tp).call(this),we(this,Ae,rp).call(this,we(this,Ae,np).call(this))},sp=function(){j(this,Vi)&&(clearTimeout(j(this,Vi)),le(this,Vi,void 0))},op=function(){j(this,Ui)&&(clearInterval(j(this,Ui)),le(this,Ui,void 0))},ap=function(){const t=j(this,zt).getQueryCache().build(j(this,zt),this.options);if(t===j(this,_e))return;const n=j(this,_e);le(this,_e,t),le(this,Qa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},cb=function(t){ct.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(j(this,Ot))}),j(this,zt).getQueryCache().notify({query:j(this,_e),type:"observerResultsUpdated"})})},Ix);function qT(e,t){return In(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Dv(e,t){return qT(e,t)||e.state.data!==void 0&&lp(e,t,t.refetchOnMount)}function lp(e,t,n){if(In(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&im(e,t)}return!1}function Iv(e,t,n,r){return(e!==t||In(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&im(e,n)}function im(e,t){return In(t.enabled,e)!==!1&&e.isStaleByTime(qs(t.staleTime,e))}function GT(e,t){return!Ic(e.getCurrentResult(),t)}var Kr,Xr,Vt,wr,Cr,tc,cp,Lx,YT=(Lx=class extends Co{constructor(t,n){super();pe(this,Cr);pe(this,Kr);pe(this,Xr);pe(this,Vt);pe(this,wr);le(this,Kr,t),this.setOptions(n),this.bindMethods(),we(this,Cr,tc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=j(this,Kr).defaultMutationOptions(t),Ic(this.options,n)||j(this,Kr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:j(this,Vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rs(n.mutationKey)!==rs(this.options.mutationKey)?this.reset():((r=j(this,Vt))==null?void 0:r.state.status)==="pending"&&j(this,Vt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=j(this,Vt))==null||t.removeObserver(this)}onMutationUpdate(t){we(this,Cr,tc).call(this),we(this,Cr,cp).call(this,t)}getCurrentResult(){return j(this,Xr)}reset(){var t;(t=j(this,Vt))==null||t.removeObserver(this),le(this,Vt,void 0),we(this,Cr,tc).call(this),we(this,Cr,cp).call(this)}mutate(t,n){var r;return le(this,wr,n),(r=j(this,Vt))==null||r.removeObserver(this),le(this,Vt,j(this,Kr).getMutationCache().build(j(this,Kr),this.options)),j(this,Vt).addObserver(this),j(this,Vt).execute(t)}},Kr=new WeakMap,Xr=new WeakMap,Vt=new WeakMap,wr=new WeakMap,Cr=new WeakSet,tc=function(){var n;const t=((n=j(this,Vt))==null?void 0:n.state)??lb();le(this,Xr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},cp=function(t){ct.batch(()=>{var n,r,i,s,o,a,l,c;if(j(this,wr)&&this.hasListeners()){const d=j(this,Xr).variables,u=j(this,Xr).context;(t==null?void 0:t.type)==="success"?((r=(n=j(this,wr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=j(this,wr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=j(this,wr)).onError)==null||a.call(o,t.error,d,u),(c=(l=j(this,wr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(j(this,Xr))})})},Lx),ub=v.createContext(void 0),db=e=>{const t=v.useContext(ub);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QT=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(ub.Provider,{value:e,children:t})),fb=v.createContext(!1),KT=()=>v.useContext(fb);fb.Provider;function XT(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ZT=v.createContext(XT()),JT=()=>v.useContext(ZT);function pb(e,t){return typeof e=="function"?e(...t):!!e}function up(){}var eE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},tE=e=>{v.useEffect(()=>{e.clearReset()},[e])},nE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&pb(n,[e.error,r]),rE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},iE=(e,t)=>e.isLoading&&e.isFetching&&!t,sE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Lv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function oE(e,t,n){var d,u,p,m,y;const r=db(),i=KT(),s=JT(),o=r.defaultQueryOptions(e);(u=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||u.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",rE(o),eE(o,s),tE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(x=>{const w=i?up:l.subscribe(ct.batchCalls(x));return l.updateResult(),w},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),sE(o,c))throw Lv(o,l,s);if(nE({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;if((m=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||m.call(p,o,c),o.experimental_prefetchInRender&&!ns&&iE(c,i)){const x=a?Lv(o,l,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;x==null||x.catch(up).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function hb(e,t){return oE(e,WT)}function sm(e,t){const n=db(),[r]=v.useState(()=>new YT(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(ct.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(up)},[r]);if(i.error&&pb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const aE=(e,t)=>hb({queryKey:["widgets",e,t],queryFn:()=>lE(e,t),retry:!1,throwOnError:!1}),lE=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await Mr(n);if(i===204)throw new Error("User is banned");return r};var k=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.MessageAgentBackground="widget_message_agent_background",e.MessageAgentText="widget_message_agent_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e.CloseButtonBackground="widget_close_button_background",e.CloseButtonText="widget_close_button_text",e.CloseButtonHover="widget_close_button_hover",e.IconColor="widget_icon_color",e.IconBackground="widget_icon_background",e.ErrorBackground="widget_error_background",e.ErrorText="widget_error_text",e.ErrorBorder="widget_error_border",e.SuccessBackground="widget_success_background",e.SuccessText="widget_success_text",e.SuccessBorder="widget_success_border",e.WarningBackground="widget_warning_background",e.WarningText="widget_warning_text",e.WarningBorder="widget_warning_border",e.LinkColor="widget_link_color",e.LinkHoverColor="widget_link_hover_color",e.DividerColor="widget_divider_color",e.ShadowColor="widget_shadow_color",e.StarActiveColor="widget_star_active_color",e.StarInactiveColor="widget_star_inactive_color",e.ModalOverlayColor="widget_modal_overlay_color",e.ChatCloseConfirmText="widget_chat_close_confirm_text",e.RatingHeaderBackground="widget_rating_header_background",e.RatingHeaderText="widget_rating_header_text",e.RatingSuccessBackground="widget_rating_success_background",e.RatingSuccessText="widget_rating_success_text",e.RatingRateConversationText="widget_rating_rate_conversation_text",e))(k||{}),J=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e.NotificationSoundOn="notification_sound_on",e.NotificationSoundOff="notification_sound_off",e))(J||{}),Ne=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Ne||{});function cE(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
41
41
  * @remix-run/router v1.21.0
42
42
  *
43
43
  * Copyright (c) Remix Software Inc.
@@ -46,7 +46,7 @@ Error generating stack: `+s.message+`
46
46
  * LICENSE.md file in the root directory of this source tree.
47
47
  *
48
48
  * @license MIT
49
- */function Fc(){return Fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fc.apply(this,arguments)}var Jr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Jr||(Jr={}));function uE(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((m,y)=>d(m,typeof m=="string"?null:m.state,y===0?"default":void 0));let s=l(n??i.length-1),o=Jr.Pop,a=null;function l(m){return Math.min(Math.max(m,0),i.length-1)}function u(){return i[s]}function d(m,y,x){y===void 0&&(y=null);let w=fE(i?u().pathname:"/",m,y,x);return am(w.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(m)),w}function c(m){return typeof m=="string"?m:pE(m)}return{get index(){return s},get action(){return o},get location(){return u()},createHref:c,createURL(m){return new URL(c(m),"http://localhost")},encodeLocation(m){let y=typeof m=="string"?as(m):m;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(m,y){o=Jr.Push;let x=d(m,y);s+=1,i.splice(s,i.length,x),r&&a&&a({action:o,location:x,delta:1})},replace(m,y){o=Jr.Replace;let x=d(m,y);i[s]=x,r&&a&&a({action:o,location:x,delta:0})},go(m){o=Jr.Pop;let y=l(s+m),x=i[y];s=y,a&&a({action:o,location:x,delta:m})},listen(m){return a=m,()=>{a=null}}}}function mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function am(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dE(){return Math.random().toString(36).substr(2,8)}function fE(e,t,n,r){return n===void 0&&(n=null),Fc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?as(t):t,{state:n,key:t&&t.key||r||dE()})}function pE(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function as(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Bv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Bv||(Bv={}));function hE(e,t,n){return n===void 0&&(n="/"),mE(e,t,n,!1)}function mE(e,t,n,r){let i=typeof t=="string"?as(t):t,s=vb(i.pathname||"/",n);if(s==null)return null;let o=mb(e);gE(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=EE(s);a=_E(o[l],u,r)}return a}function mb(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(mt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=qi([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(mt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),mb(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:SE(u,s.index),routesMeta:d})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of gb(s.path))i(s,o,l)}),t}function gb(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=gb(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function gE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:CE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vE=/^:[\w-]+$/,yE=3,xE=2,wE=1,bE=10,kE=-2,$v=e=>e==="*";function SE(e,t){let n=e.split("/"),r=n.length;return n.some($v)&&(r+=kE),t&&(r+=xE),n.filter(i=>!$v(i)).reduce((i,s)=>i+(vE.test(s)?yE:s===""?wE:bE),r)}function CE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function _E(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",c=zv({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},d),f=l.route;if(!c&&u&&n&&!r[r.length-1].route.index&&(c=zv({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!c)return null;Object.assign(i,c.params),o.push({params:i,pathname:qi([s,c.pathname]),pathnameBase:OE(qi([s,c.pathnameBase])),route:f}),c.pathnameBase!=="/"&&(s=qi([s,c.pathnameBase]))}return o}function zv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=TE(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,d,c)=>{let{paramName:f,isOptional:m}=d;if(f==="*"){let x=a[c]||"";o=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const y=a[c];return m&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function TE(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),am(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function EE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return am(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function vb(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function jE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?as(e):e;return{pathname:n?n.startsWith("/")?n:AE(n,t):t,search:NE(r),hash:DE(i)}}function AE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Td(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function RE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function PE(e,t){let n=RE(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ME(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=as(e):(i=Fc({},e),mt(!i.pathname||!i.pathname.includes("?"),Td("?","pathname","search",i)),mt(!i.pathname||!i.pathname.includes("#"),Td("#","pathname","hash",i)),mt(!i.search||!i.search.includes("#"),Td("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let c=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),c-=1;i.pathname=f.join("/")}a=c>=0?t[c]:"/"}let l=jE(i,a),u=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const qi=e=>e.join("/").replace(/\/\/+/g,"/"),OE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function IE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yb=["post","put","patch","delete"];new Set(yb);const LE=["get",...yb];new Set(LE);/**
49
+ */function Fc(){return Fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fc.apply(this,arguments)}var ei;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ei||(ei={}));function uE(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((m,y)=>d(m,typeof m=="string"?null:m.state,y===0?"default":void 0));let s=l(n??i.length-1),o=ei.Pop,a=null;function l(m){return Math.min(Math.max(m,0),i.length-1)}function c(){return i[s]}function d(m,y,x){y===void 0&&(y=null);let w=fE(i?c().pathname:"/",m,y,x);return om(w.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(m)),w}function u(m){return typeof m=="string"?m:pE(m)}return{get index(){return s},get action(){return o},get location(){return c()},createHref:u,createURL(m){return new URL(u(m),"http://localhost")},encodeLocation(m){let y=typeof m=="string"?as(m):m;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(m,y){o=ei.Push;let x=d(m,y);s+=1,i.splice(s,i.length,x),r&&a&&a({action:o,location:x,delta:1})},replace(m,y){o=ei.Replace;let x=d(m,y);i[s]=x,r&&a&&a({action:o,location:x,delta:0})},go(m){o=ei.Pop;let y=l(s+m),x=i[y];s=y,a&&a({action:o,location:x,delta:m})},listen(m){return a=m,()=>{a=null}}}}function mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function om(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function dE(){return Math.random().toString(36).substr(2,8)}function fE(e,t,n,r){return n===void 0&&(n=null),Fc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?as(t):t,{state:n,key:t&&t.key||r||dE()})}function pE(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function as(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var Fv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Fv||(Fv={}));function hE(e,t,n){return n===void 0&&(n="/"),mE(e,t,n,!1)}function mE(e,t,n,r){let i=typeof t=="string"?as(t):t,s=vb(i.pathname||"/",n);if(s==null)return null;let o=mb(e);gE(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=EE(s);a=_E(o[l],c,r)}return a}function mb(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(mt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=qi([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(mt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),mb(s.children,t,d,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:SE(c,s.index),routesMeta:d})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of gb(s.path))i(s,o,l)}),t}function gb(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=gb(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function gE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:CE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vE=/^:[\w-]+$/,yE=3,xE=2,wE=1,bE=10,kE=-2,Bv=e=>e==="*";function SE(e,t){let n=e.split("/"),r=n.length;return n.some(Bv)&&(r+=kE),t&&(r+=xE),n.filter(i=>!Bv(i)).reduce((i,s)=>i+(vE.test(s)?yE:s===""?wE:bE),r)}function CE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function _E(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",u=$v({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),p=l.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=$v({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:qi([s,u.pathname]),pathnameBase:OE(qi([s,u.pathnameBase])),route:p}),u.pathnameBase!=="/"&&(s=qi([s,u.pathnameBase]))}return o}function $v(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=TE(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,d,u)=>{let{paramName:p,isOptional:m}=d;if(p==="*"){let x=a[u]||"";o=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const y=a[u];return m&&!y?c[p]=void 0:c[p]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function TE(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),om(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function EE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return om(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function vb(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function jE(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?as(e):e;return{pathname:n?n.startsWith("/")?n:AE(n,t):t,search:NE(r),hash:DE(i)}}function AE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function _d(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function RE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function PE(e,t){let n=RE(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function ME(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=as(e):(i=Fc({},e),mt(!i.pathname||!i.pathname.includes("?"),_d("?","pathname","search",i)),mt(!i.pathname||!i.pathname.includes("#"),_d("#","pathname","hash",i)),mt(!i.search||!i.search.includes("#"),_d("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),u-=1;i.pathname=p.join("/")}a=u>=0?t[u]:"/"}let l=jE(i,a),c=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const qi=e=>e.join("/").replace(/\/\/+/g,"/"),OE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function IE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const yb=["post","put","patch","delete"];new Set(yb);const LE=["get",...yb];new Set(LE);/**
50
50
  * React Router v6.28.0
51
51
  *
52
52
  * Copyright (c) Remix Software Inc.
@@ -55,19 +55,19 @@ Error generating stack: `+s.message+`
55
55
  * LICENSE.md file in the root directory of this source tree.
56
56
  *
57
57
  * @license MIT
58
- */function Oa(){return Oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oa.apply(this,arguments)}const lm=g.createContext(null),FE=g.createContext(null),xu=g.createContext(null),wu=g.createContext(null),_o=g.createContext({outlet:null,matches:[],isDataRoute:!1}),xb=g.createContext(null);function bu(){return g.useContext(wu)!=null}function cm(){return bu()||mt(!1),g.useContext(wu).location}function wb(e){g.useContext(xu).static||g.useLayoutEffect(e)}function BE(){let{isDataRoute:e}=g.useContext(_o);return e?ZE():$E()}function $E(){bu()||mt(!1);let e=g.useContext(lm),{basename:t,future:n,navigator:r}=g.useContext(xu),{matches:i}=g.useContext(_o),{pathname:s}=cm(),o=JSON.stringify(PE(i,n.v7_relativeSplatPath)),a=g.useRef(!1);return wb(()=>{a.current=!0}),g.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let c=ME(u,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:qi([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,o,s,e])}function zE(e,t){return VE(e,t)}function VE(e,t,n,r){bu()||mt(!1);let{navigator:i}=g.useContext(xu),{matches:s}=g.useContext(_o),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=cm(),d;if(t){var c;let w=typeof t=="string"?as(t):t;l==="/"||(c=w.pathname)!=null&&c.startsWith(l)||mt(!1),d=w}else d=u;let f=d.pathname||"/",m=f;if(l!=="/"){let w=l.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=hE(e,{pathname:m}),x=GE(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:qi([l,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:qi([l,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,n,r);return t&&x?g.createElement(wu.Provider,{value:{location:Oa({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Jr.Pop}},x):x}function UE(){let e=XE(),t=IE(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:i},n):null,null)}const HE=g.createElement(UE,null);class WE extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(_o.Provider,{value:this.props.routeContext},g.createElement(xb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qE(e){let{routeContext:t,match:n,children:r}=e,i=g.useContext(lm);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(_o.Provider,{value:t},r)}function GE(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let d=o.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id])!==void 0);d>=0||mt(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let c=o[d];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(u=d),c.route.id){let{loaderData:f,errors:m}=n,y=c.route.loader&&f[c.route.id]===void 0&&(!m||m[c.route.id]===void 0);if(c.route.lazy||y){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,c,f)=>{let m,y=!1,x=null,w=null;n&&(m=a&&c.route.id?a[c.route.id]:void 0,x=c.route.errorElement||HE,l&&(u<0&&f===0?(y=!0,w=null):u===f&&(y=!0,w=c.route.hydrateFallbackElement||null)));let h=t.concat(o.slice(0,f+1)),v=()=>{let b;return m?b=x:y?b=w:c.route.Component?b=g.createElement(c.route.Component,null):c.route.element?b=c.route.element:b=d,g.createElement(qE,{match:c,routeContext:{outlet:d,matches:h,isDataRoute:n!=null},children:b})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?g.createElement(WE,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:v(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):v()},null)}var bb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bb||{}),Bc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bc||{});function YE(e){let t=g.useContext(lm);return t||mt(!1),t}function QE(e){let t=g.useContext(FE);return t||mt(!1),t}function KE(e){let t=g.useContext(_o);return t||mt(!1),t}function kb(e){let t=KE(),n=t.matches[t.matches.length-1];return n.route.id||mt(!1),n.route.id}function XE(){var e;let t=g.useContext(xb),n=QE(Bc.UseRouteError),r=kb(Bc.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ZE(){let{router:e}=YE(bb.UseNavigateStable),t=kb(Bc.UseNavigateStable),n=g.useRef(!1);return wb(()=>{n.current=!0}),g.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Oa({fromRouteId:t},s)))},[e,t])}const Vv={};function JE(e,t){Vv[t]||(Vv[t]=!0,console.warn(t))}const Uv=(e,t,n)=>JE(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function ej(e,t){e!=null&&e.v7_startTransition||Uv("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&!t&&Uv("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}const tj="startTransition",Hv=n2[tj];function nj(e){let{basename:t,children:n,initialEntries:r,initialIndex:i,future:s}=e,o=g.useRef();o.current==null&&(o.current=uE({initialEntries:r,initialIndex:i,v5Compat:!0}));let a=o.current,[l,u]=g.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},c=g.useCallback(f=>{d&&Hv?Hv(()=>u(f)):u(f)},[u,d]);return g.useLayoutEffect(()=>a.listen(c),[a,c]),g.useEffect(()=>ej(s),[s]),g.createElement(rj,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:s})}function fp(e){mt(!1)}function rj(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Jr.Pop,navigator:s,static:o=!1,future:a}=e;bu()&&mt(!1);let l=t.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:l,navigator:s,static:o,future:Oa({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=as(r));let{pathname:d="/",search:c="",hash:f="",state:m=null,key:y="default"}=r,x=g.useMemo(()=>{let w=vb(d,l);return w==null?null:{location:{pathname:w,search:c,hash:f,state:m,key:y},navigationType:i}},[l,d,c,f,m,y,i]);return x==null?null:g.createElement(xu.Provider,{value:u},g.createElement(wu.Provider,{children:n,value:x}))}function ij(e){let{children:t,location:n}=e;return zE(pp(t),n)}new Promise(()=>{});function pp(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,i)=>{if(!g.isValidElement(r))return;let s=[...t,i];if(r.type===g.Fragment){n.push.apply(n,pp(r.props.children,s));return}r.type!==fp&&mt(!1),!r.props.index||!r.props.children||mt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=pp(r.props.children,s)),n.push(o)}),n}var Sb={exports:{}};/*!
58
+ */function Oa(){return Oa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oa.apply(this,arguments)}const am=v.createContext(null),FE=v.createContext(null),yu=v.createContext(null),xu=v.createContext(null),_o=v.createContext({outlet:null,matches:[],isDataRoute:!1}),xb=v.createContext(null);function wu(){return v.useContext(xu)!=null}function lm(){return wu()||mt(!1),v.useContext(xu).location}function wb(e){v.useContext(yu).static||v.useLayoutEffect(e)}function BE(){let{isDataRoute:e}=v.useContext(_o);return e?ZE():$E()}function $E(){wu()||mt(!1);let e=v.useContext(am),{basename:t,future:n,navigator:r}=v.useContext(yu),{matches:i}=v.useContext(_o),{pathname:s}=lm(),o=JSON.stringify(PE(i,n.v7_relativeSplatPath)),a=v.useRef(!1);return wb(()=>{a.current=!0}),v.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let u=ME(c,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:qi([t,u.pathname])),(d.replace?r.replace:r.push)(u,d.state,d)},[t,r,o,s,e])}function zE(e,t){return VE(e,t)}function VE(e,t,n,r){wu()||mt(!1);let{navigator:i}=v.useContext(yu),{matches:s}=v.useContext(_o),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=lm(),d;if(t){var u;let w=typeof t=="string"?as(t):t;l==="/"||(u=w.pathname)!=null&&u.startsWith(l)||mt(!1),d=w}else d=c;let p=d.pathname||"/",m=p;if(l!=="/"){let w=l.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=hE(e,{pathname:m}),x=GE(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:qi([l,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:qi([l,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,n,r);return t&&x?v.createElement(xu.Provider,{value:{location:Oa({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ei.Pop}},x):x}function UE(){let e=XE(),t=IE(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,null)}const HE=v.createElement(UE,null);class WE extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(_o.Provider,{value:this.props.routeContext},v.createElement(xb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function qE(e){let{routeContext:t,match:n,children:r}=e,i=v.useContext(am);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(_o.Provider,{value:t},r)}function GE(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let d=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);d>=0||mt(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let u=o[d];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(c=d),u.route.id){let{loaderData:p,errors:m}=n,y=u.route.loader&&p[u.route.id]===void 0&&(!m||m[u.route.id]===void 0);if(u.route.lazy||y){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,u,p)=>{let m,y=!1,x=null,w=null;n&&(m=a&&u.route.id?a[u.route.id]:void 0,x=u.route.errorElement||HE,l&&(c<0&&p===0?(y=!0,w=null):c===p&&(y=!0,w=u.route.hydrateFallbackElement||null)));let h=t.concat(o.slice(0,p+1)),g=()=>{let b;return m?b=x:y?b=w:u.route.Component?b=v.createElement(u.route.Component,null):u.route.element?b=u.route.element:b=d,v.createElement(qE,{match:u,routeContext:{outlet:d,matches:h,isDataRoute:n!=null},children:b})};return n&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?v.createElement(WE,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var bb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bb||{}),Bc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bc||{});function YE(e){let t=v.useContext(am);return t||mt(!1),t}function QE(e){let t=v.useContext(FE);return t||mt(!1),t}function KE(e){let t=v.useContext(_o);return t||mt(!1),t}function kb(e){let t=KE(),n=t.matches[t.matches.length-1];return n.route.id||mt(!1),n.route.id}function XE(){var e;let t=v.useContext(xb),n=QE(Bc.UseRouteError),r=kb(Bc.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ZE(){let{router:e}=YE(bb.UseNavigateStable),t=kb(Bc.UseNavigateStable),n=v.useRef(!1);return wb(()=>{n.current=!0}),v.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Oa({fromRouteId:t},s)))},[e,t])}const zv={};function JE(e,t){zv[t]||(zv[t]=!0,console.warn(t))}const Vv=(e,t,n)=>JE(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function ej(e,t){e!=null&&e.v7_startTransition||Vv("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&!t&&Vv("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}const tj="startTransition",Uv=n2[tj];function nj(e){let{basename:t,children:n,initialEntries:r,initialIndex:i,future:s}=e,o=v.useRef();o.current==null&&(o.current=uE({initialEntries:r,initialIndex:i,v5Compat:!0}));let a=o.current,[l,c]=v.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},u=v.useCallback(p=>{d&&Uv?Uv(()=>c(p)):c(p)},[c,d]);return v.useLayoutEffect(()=>a.listen(u),[a,u]),v.useEffect(()=>ej(s),[s]),v.createElement(rj,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:s})}function dp(e){mt(!1)}function rj(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ei.Pop,navigator:s,static:o=!1,future:a}=e;wu()&&mt(!1);let l=t.replace(/^\/*/,"/"),c=v.useMemo(()=>({basename:l,navigator:s,static:o,future:Oa({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=as(r));let{pathname:d="/",search:u="",hash:p="",state:m=null,key:y="default"}=r,x=v.useMemo(()=>{let w=vb(d,l);return w==null?null:{location:{pathname:w,search:u,hash:p,state:m,key:y},navigationType:i}},[l,d,u,p,m,y,i]);return x==null?null:v.createElement(yu.Provider,{value:c},v.createElement(xu.Provider,{children:n,value:x}))}function ij(e){let{children:t,location:n}=e;return zE(fp(t),n)}new Promise(()=>{});function fp(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let s=[...t,i];if(r.type===v.Fragment){n.push.apply(n,fp(r.props.children,s));return}r.type!==dp&&mt(!1),!r.props.index||!r.props.children||mt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=fp(r.props.children,s)),n.push(o)}),n}var Sb={exports:{}};/*!
59
59
  Copyright (c) 2018 Jed Watson.
60
60
  Licensed under the MIT License (MIT), see
61
61
  http://jedwatson.github.io/classnames
62
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Sb);var sj=Sb.exports;const ze=Ar(sj);function oj(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const aj=e=>{switch(e){case"success":return uj;case"info":return fj;case"warning":return dj;case"error":return pj;default:return null}},lj=Array(12).fill(0),cj=({visible:e,className:t})=>X.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},X.createElement("div",{className:"sonner-spinner"},lj.map((n,r)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),uj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),dj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),fj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),pj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),hj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},X.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),X.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),mj=()=>{const[e,t]=X.useState(document.hidden);return X.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let hp=1;class gj{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:hp++,o=this.toasts.find(l=>l.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,o;const a=i.then(async u=>{if(o=["resolve",u],X.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(yj(u)&&!u.ok){s=!1;const c=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,f=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description,m=typeof c=="object"?c:{message:c};this.create({id:r,type:"error",description:f,...m})}else if(u instanceof Error){s=!1;const c=typeof n.error=="function"?await n.error(u):n.error,f=typeof n.description=="function"?await n.description(u):n.description,m=typeof c=="object"?c:{message:c};this.create({id:r,type:"error",description:f,...m})}else if(n.success!==void 0){s=!1;const c=typeof n.success=="function"?await n.success(u):n.success,f=typeof n.description=="function"?await n.description(u):n.description,m=typeof c=="object"?c:{message:c};this.create({id:r,type:"success",description:f,...m})}}).catch(async u=>{if(o=["reject",u],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(u):n.error,c=typeof n.description=="function"?await n.description(u):n.description,f=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:c,...f})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((u,d)=>a.then(()=>o[0]==="reject"?d(o[1]):u(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||hp++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new gj,vj=(e,t)=>{const n=(t==null?void 0:t.id)||hp++;return Ut.addToast({title:e,...t,id:n}),n},yj=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",xj=vj,wj=()=>Ut.toasts,bj=()=>Ut.getActiveToasts(),Cb=Object.assign(xj,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:wj,getToasts:bj});oj("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Pl(e){return e.label!==void 0}const kj=3,Sj="24px",Cj="16px",Wv=4e3,_j=356,Tj=14,Ej=45,jj=200;function Wn(...e){return e.filter(Boolean).join(" ")}function Aj(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Rj=e=>{var t,n,r,i,s,o,a,l,u;const{invert:d,toast:c,unstyled:f,interacting:m,setHeights:y,visibleToasts:x,heights:w,index:h,toasts:v,expanded:b,removeToast:T,defaultRichColors:C,closeButton:E,style:S,cancelButtonStyle:A,actionButtonStyle:B,className:L="",descriptionClassName:N="",duration:ee,position:Z,gap:V,expandByDefault:O,classNames:I,icons:H,closeButtonAriaLabel:_="Close toast"}=e,[P,F]=X.useState(null),[$,W]=X.useState(null),[Q,se]=X.useState(!1),[he,ue]=X.useState(!1),[q,oe]=X.useState(!1),[z,ne]=X.useState(!1),[D,te]=X.useState(!1),[de,Ce]=X.useState(0),[ge,Ze]=X.useState(0),ot=X.useRef(c.duration||ee||Wv),Bt=X.useRef(null),re=X.useRef(null),be=h===0,Je=h+1<=x,R=c.type,K=c.dismissible!==!1,M=c.className||"",U=c.descriptionClassName||"",ae=X.useMemo(()=>w.findIndex(xe=>xe.toastId===c.id)||0,[w,c.id]),fe=X.useMemo(()=>{var xe;return(xe=c.closeButton)!=null?xe:E},[c.closeButton,E]),ke=X.useMemo(()=>c.duration||ee||Wv,[c.duration,ee]),at=X.useRef(0),vt=X.useRef(0),Vn=X.useRef(0),un=X.useRef(null),[ys,fr]=Z.split("-"),Or=X.useMemo(()=>w.reduce((xe,dt,St)=>St>=ae?xe:xe+dt.height,0),[w,ae]),xs=mj(),Po=c.invert||d,ki=R==="loading";vt.current=X.useMemo(()=>ae*V+Or,[ae,Or]),X.useEffect(()=>{ot.current=ke},[ke]),X.useEffect(()=>{se(!0)},[]),X.useEffect(()=>{const xe=re.current;if(xe){const dt=xe.getBoundingClientRect().height;return Ze(dt),y(St=>[{toastId:c.id,height:dt,position:c.position},...St]),()=>y(St=>St.filter(Xt=>Xt.toastId!==c.id))}},[y,c.id]),X.useLayoutEffect(()=>{if(!Q)return;const xe=re.current,dt=xe.style.height;xe.style.height="auto";const St=xe.getBoundingClientRect().height;xe.style.height=dt,Ze(St),y(Xt=>Xt.find(yt=>yt.toastId===c.id)?Xt.map(yt=>yt.toastId===c.id?{...yt,height:St}:yt):[{toastId:c.id,height:St,position:c.position},...Xt])},[Q,c.title,c.description,y,c.id]);const Un=X.useCallback(()=>{ue(!0),Ce(vt.current),y(xe=>xe.filter(dt=>dt.toastId!==c.id)),setTimeout(()=>{T(c)},jj)},[c,T,y,vt]);X.useEffect(()=>{if(c.promise&&R==="loading"||c.duration===1/0||c.type==="loading")return;let xe;return b||m||xs?(()=>{if(Vn.current<at.current){const Xt=new Date().getTime()-at.current;ot.current=ot.current-Xt}Vn.current=new Date().getTime()})():(()=>{ot.current!==1/0&&(at.current=new Date().getTime(),xe=setTimeout(()=>{c.onAutoClose==null||c.onAutoClose.call(c,c),Un()},ot.current))})(),()=>clearTimeout(xe)},[b,m,c,R,xs,Un]),X.useEffect(()=>{c.delete&&Un()},[Un,c.delete]);function FC(){var xe;if(H!=null&&H.loading){var dt;return X.createElement("div",{className:Wn(I==null?void 0:I.loader,c==null||(dt=c.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":R==="loading"},H.loading)}return X.createElement(cj,{className:Wn(I==null?void 0:I.loader,c==null||(xe=c.classNames)==null?void 0:xe.loader),visible:R==="loading"})}var vg,yg;return X.createElement("li",{tabIndex:0,ref:re,className:Wn(L,M,I==null?void 0:I.toast,c==null||(t=c.classNames)==null?void 0:t.toast,I==null?void 0:I.default,I==null?void 0:I[R],c==null||(n=c.classNames)==null?void 0:n[R]),"data-sonner-toast":"","data-rich-colors":(vg=c.richColors)!=null?vg:C,"data-styled":!(c.jsx||c.unstyled||f),"data-mounted":Q,"data-promise":!!c.promise,"data-swiped":D,"data-removed":he,"data-visible":Je,"data-y-position":ys,"data-x-position":fr,"data-index":h,"data-front":be,"data-swiping":q,"data-dismissible":K,"data-type":R,"data-invert":Po,"data-swipe-out":z,"data-swipe-direction":$,"data-expanded":!!(b||O&&Q),style:{"--index":h,"--toasts-before":h,"--z-index":v.length-h,"--offset":`${he?de:vt.current}px`,"--initial-height":O?"auto":`${ge}px`,...S,...c.style},onDragEnd:()=>{oe(!1),F(null),un.current=null},onPointerDown:xe=>{ki||!K||(Bt.current=new Date,Ce(vt.current),xe.target.setPointerCapture(xe.pointerId),xe.target.tagName!=="BUTTON"&&(oe(!0),un.current={x:xe.clientX,y:xe.clientY}))},onPointerUp:()=>{var xe,dt,St;if(z||!K)return;un.current=null;const Xt=Number(((xe=re.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ul=Number(((dt=re.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((St=Bt.current)==null?void 0:St.getTime()),dn=P==="x"?Xt:ul,dl=Math.abs(dn)/yt;if(Math.abs(dn)>=Ej||dl>.11){Ce(vt.current),c.onDismiss==null||c.onDismiss.call(c,c),W(P==="x"?Xt>0?"right":"left":ul>0?"down":"up"),Un(),ne(!0);return}else{var Tn,En;(Tn=re.current)==null||Tn.style.setProperty("--swipe-amount-x","0px"),(En=re.current)==null||En.style.setProperty("--swipe-amount-y","0px")}te(!1),oe(!1),F(null)},onPointerMove:xe=>{var dt,St,Xt;if(!un.current||!K||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;const yt=xe.clientY-un.current.y,dn=xe.clientX-un.current.x;var dl;const Tn=(dl=e.swipeDirections)!=null?dl:Aj(Z);!P&&(Math.abs(dn)>1||Math.abs(yt)>1)&&F(Math.abs(dn)>Math.abs(yt)?"x":"y");let En={x:0,y:0};const xg=Si=>1/(1.5+Math.abs(Si)/20);if(P==="y"){if(Tn.includes("top")||Tn.includes("bottom"))if(Tn.includes("top")&&yt<0||Tn.includes("bottom")&&yt>0)En.y=yt;else{const Si=yt*xg(yt);En.y=Math.abs(Si)<Math.abs(yt)?Si:yt}}else if(P==="x"&&(Tn.includes("left")||Tn.includes("right")))if(Tn.includes("left")&&dn<0||Tn.includes("right")&&dn>0)En.x=dn;else{const Si=dn*xg(dn);En.x=Math.abs(Si)<Math.abs(dn)?Si:dn}(Math.abs(En.x)>0||Math.abs(En.y)>0)&&te(!0),(St=re.current)==null||St.style.setProperty("--swipe-amount-x",`${En.x}px`),(Xt=re.current)==null||Xt.style.setProperty("--swipe-amount-y",`${En.y}px`)}},fe&&!c.jsx&&R!=="loading"?X.createElement("button",{"aria-label":_,"data-disabled":ki,"data-close-button":!0,onClick:ki||!K?()=>{}:()=>{Un(),c.onDismiss==null||c.onDismiss.call(c,c)},className:Wn(I==null?void 0:I.closeButton,c==null||(r=c.classNames)==null?void 0:r.closeButton)},(yg=H==null?void 0:H.close)!=null?yg:hj):null,R||c.icon||c.promise?X.createElement("div",{"data-icon":"",className:Wn(I==null?void 0:I.icon,c==null||(i=c.classNames)==null?void 0:i.icon)},c.promise||c.type==="loading"&&!c.icon?c.icon||FC():null,c.type!=="loading"?c.icon||(H==null?void 0:H[R])||aj(R):null):null,X.createElement("div",{"data-content":"",className:Wn(I==null?void 0:I.content,c==null||(s=c.classNames)==null?void 0:s.content)},X.createElement("div",{"data-title":"",className:Wn(I==null?void 0:I.title,c==null||(o=c.classNames)==null?void 0:o.title)},c.jsx?c.jsx:typeof c.title=="function"?c.title():c.title),c.description?X.createElement("div",{"data-description":"",className:Wn(N,U,I==null?void 0:I.description,c==null||(a=c.classNames)==null?void 0:a.description)},typeof c.description=="function"?c.description():c.description):null),X.isValidElement(c.cancel)?c.cancel:c.cancel&&Pl(c.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:c.cancelButtonStyle||A,onClick:xe=>{Pl(c.cancel)&&K&&(c.cancel.onClick==null||c.cancel.onClick.call(c.cancel,xe),Un())},className:Wn(I==null?void 0:I.cancelButton,c==null||(l=c.classNames)==null?void 0:l.cancelButton)},c.cancel.label):null,X.isValidElement(c.action)?c.action:c.action&&Pl(c.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:c.actionButtonStyle||B,onClick:xe=>{Pl(c.action)&&(c.action.onClick==null||c.action.onClick.call(c.action,xe),!xe.defaultPrevented&&Un())},className:Wn(I==null?void 0:I.actionButton,c==null||(u=c.classNames)==null?void 0:u.actionButton)},c.action.label):null)};function qv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Pj(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?Cj:Sj;function l(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=a:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):l(a)}),n}const Mj=X.forwardRef(function(t,n){const{invert:r,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:u,mobileOffset:d,theme:c="light",richColors:f,duration:m,style:y,visibleToasts:x=kj,toastOptions:w,dir:h=qv(),gap:v=Tj,icons:b,containerAriaLabel:T="Notifications"}=t,[C,E]=X.useState([]),S=X.useMemo(()=>Array.from(new Set([i].concat(C.filter($=>$.position).map($=>$.position)))),[C,i]),[A,B]=X.useState([]),[L,N]=X.useState(!1),[ee,Z]=X.useState(!1),[V,O]=X.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=X.useRef(null),H=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=X.useRef(null),P=X.useRef(!1),F=X.useCallback($=>{E(W=>{var Q;return(Q=W.find(se=>se.id===$.id))!=null&&Q.delete||Ut.dismiss($.id),W.filter(({id:se})=>se!==$.id)})},[]);return X.useEffect(()=>Ut.subscribe($=>{if($.dismiss){const W=C.map(Q=>Q.id===$.id?{...Q,delete:!0}:Q);requestAnimationFrame(()=>{E(W)});return}setTimeout(()=>{pT.flushSync(()=>{E(W=>{const Q=W.findIndex(se=>se.id===$.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...$},...W.slice(Q+1)]:[$,...W]})})})}),[C]),X.useEffect(()=>{if(c!=="system"){O(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{O(W?"dark":"light")})}catch{$.addListener(({matches:Q})=>{try{O(Q?"dark":"light")}catch(se){console.error(se)}})}},[c]),X.useEffect(()=>{C.length<=1&&N(!1)},[C]),X.useEffect(()=>{const $=W=>{var Q;if(s.every(ue=>W[ue]||W.code===ue)){var he;N(!0),(he=I.current)==null||he.focus()}W.code==="Escape"&&(document.activeElement===I.current||(Q=I.current)!=null&&Q.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),X.useEffect(()=>{if(I.current)return()=>{_.current&&(_.current.focus({preventScroll:!0}),_.current=null,P.current=!1)}},[I.current]),X.createElement("section",{ref:n,"aria-label":`${T} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map(($,W)=>{var Q;const[se,he]=$.split("-");return C.length?X.createElement("ol",{key:$,dir:h==="auto"?qv():h,tabIndex:-1,ref:I,className:l,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":se,"data-lifted":L&&C.length>1&&!o,"data-x-position":he,style:{"--front-toast-height":`${((Q=A[0])==null?void 0:Q.height)||0}px`,"--width":`${_j}px`,"--gap":`${v}px`,...y,...Pj(u,d)},onBlur:ue=>{P.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(P.current=!1,_.current&&(_.current.focus({preventScroll:!0}),_.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||P.current||(P.current=!0,_.current=ue.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{ee||N(!1)},onDragEnd:()=>N(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},C.filter(ue=>!ue.position&&W===0||ue.position===$).map((ue,q)=>{var oe,z;return X.createElement(Rj,{key:ue.id,icons:b,index:q,toast:ue,defaultRichColors:f,duration:(oe=w==null?void 0:w.duration)!=null?oe:m,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:r,visibleToasts:x,closeButton:(z=w==null?void 0:w.closeButton)!=null?z:a,interacting:ee,position:$,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,closeButtonAriaLabel:w==null?void 0:w.closeButtonAriaLabel,removeToast:F,toasts:C.filter(ne=>ne.position==ue.position),heights:A.filter(ne=>ne.position==ue.position),setHeights:B,expandByDefault:o,gap:v,expanded:L,swipeDirections:t.swipeDirections})})):null}))});function er(e){return Cb.custom(t=>p.jsx(Oj,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Ed={success:{bg:"bg-green-100 border-green-200",text:"text-green-800"},error:{bg:"bg-red-100 border-red-200",text:"text-red-800"},warning:{bg:"bg-orange-100 border-orange-200",text:"text-orange-800"},info:{bg:"bg-blue-100 border-blue-200",text:"text-blue-800"}};function Oj(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return p.jsxs("div",{className:ze("flex rounded-lg shadow-lg ring-1 ring-black/5 w-full md:max-w-[364px] items-center p-3 backdrop-blur-sm border mb-2",Ed[s||"info"].bg),children:[p.jsx("div",{className:"flex flex-1 items-center",children:p.jsxs("div",{className:"w-full",children:[t&&p.jsx("p",{className:ze("text-sm font-medium",Ed[s||"info"].text),children:t}),p.jsx("p",{className:ze("text-sm",Ed[s||"info"].text,{"mt-1":!!t}),children:n})]})}),r&&p.jsx("div",{className:"ml-5 shrink-0 rounded-md text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden",children:p.jsx("button",{className:"rounded bg-indigo-50 px-3 py-1 text-sm font-semibold text-indigo-600 hover:bg-indigo-100",onClick:()=>{r.onClick(),Cb.dismiss(i)},children:r.label})})]})}function Nj(e){return Array.isArray(e)&&e[0].field!==void 0}const ho=(e,t)=>{var n;if(Nj(e)){for(const r of e)(n=t==null?void 0:t.form)==null||n.setFieldError(r.field,r.message);return}if(e&&e.message){t!=null&&t.noToast||er({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||er({description:e.error,variant:"error"});return}},Dj=[{code:429,text:"Çok fazla istek gönderdiniz. Lütfen biraz bekleyin"},{code:401,text:"Bu işlemi yapabilmek için giriş yapmalısınız"},{code:403,text:"Bu işlemi yapabilmek için yetkiniz yok"},{code:500,text:"Sunucu hatası oluştu"},{code:422,text:"Form doğrulaması başarısız oldu"},{code:413,text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Ij=[{code:"FST_REQ_FILE_TOO_LARGE",text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Lj=(e,t)=>{if($n(t))return!1;if(e===null)return er({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=Ij.find(s=>s.code===r);if(i)return er({description:i.text,variant:"error"}),!0}if(e.message)return er({description:e.message,variant:"error"}),!0}const n=Dj.find(r=>r.code===t);return er({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},Fj={xs:{default:"!p-1",rounded:"!p-1"},sm:{default:"text-xs px-2 py-1.5",rounded:"p-1.5"},md:{default:"text-xs px-3 py-1.5",rounded:"p-2"},lg:{default:"text-xs px-4 py-2",rounded:"p-2.5"},xl:{default:"text-sm px-5 py-3",rounded:"p-3"}},Gv={primary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},secondary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},danger:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},success:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},warning:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"}},um=g.createContext({});function ku(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const dm=typeof window<"u",_b=dm?g.useLayoutEffect:g.useEffect,Su=g.createContext(null),fm=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Bj extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function $j({children:e,isPresent:t,anchorX:n}){const r=g.useId(),i=g.useRef(null),s=g.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=g.useContext(fm);return g.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:d,right:c}=s.current;if(t||!i.current||!a||!l)return;const f=n==="left"?`left: ${d}`:`right: ${c}`;i.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
62
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Sb);var sj=Sb.exports;const ze=Rr(sj);function oj(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const aj=e=>{switch(e){case"success":return uj;case"info":return fj;case"warning":return dj;case"error":return pj;default:return null}},lj=Array(12).fill(0),cj=({visible:e,className:t})=>X.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},X.createElement("div",{className:"sonner-spinner"},lj.map((n,r)=>X.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),uj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),dj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),fj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),pj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},X.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),hj=X.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},X.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),X.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),mj=()=>{const[e,t]=X.useState(document.hidden);return X.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let pp=1;class gj{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:pp++,o=this.toasts.find(l=>l.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],X.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(yj(c)&&!c.ok){s=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...m})}else if(c instanceof Error){s=!1;const u=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...m})}else if(n.success!==void 0){s=!1;const u=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"success",description:p,...m})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,p=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:u,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||pp++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new gj,vj=(e,t)=>{const n=(t==null?void 0:t.id)||pp++;return Ut.addToast({title:e,...t,id:n}),n},yj=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",xj=vj,wj=()=>Ut.toasts,bj=()=>Ut.getActiveToasts(),Cb=Object.assign(xj,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:wj,getToasts:bj});oj("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Pl(e){return e.label!==void 0}const kj=3,Sj="24px",Cj="16px",Hv=4e3,_j=356,Tj=14,Ej=45,jj=200;function Wn(...e){return e.filter(Boolean).join(" ")}function Aj(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Rj=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:m,setHeights:y,visibleToasts:x,heights:w,index:h,toasts:g,expanded:b,removeToast:T,defaultRichColors:_,closeButton:E,style:S,cancelButtonStyle:A,actionButtonStyle:B,className:L="",descriptionClassName:N="",duration:ee,position:Z,gap:V,expandByDefault:O,classNames:I,icons:H,closeButtonAriaLabel:C="Close toast"}=e,[P,F]=X.useState(null),[$,W]=X.useState(null),[Q,se]=X.useState(!1),[he,ue]=X.useState(!1),[q,oe]=X.useState(!1),[z,ne]=X.useState(!1),[D,te]=X.useState(!1),[de,Ce]=X.useState(0),[ge,Ze]=X.useState(0),ot=X.useRef(u.duration||ee||Hv),Bt=X.useRef(null),re=X.useRef(null),be=h===0,Je=h+1<=x,R=u.type,K=u.dismissible!==!1,M=u.className||"",U=u.descriptionClassName||"",ae=X.useMemo(()=>w.findIndex(xe=>xe.toastId===u.id)||0,[w,u.id]),fe=X.useMemo(()=>{var xe;return(xe=u.closeButton)!=null?xe:E},[u.closeButton,E]),ke=X.useMemo(()=>u.duration||ee||Hv,[u.duration,ee]),at=X.useRef(0),vt=X.useRef(0),Vn=X.useRef(0),un=X.useRef(null),[ys,pr]=Z.split("-"),Nr=X.useMemo(()=>w.reduce((xe,dt,St)=>St>=ae?xe:xe+dt.height,0),[w,ae]),xs=mj(),Po=u.invert||d,ki=R==="loading";vt.current=X.useMemo(()=>ae*V+Nr,[ae,Nr]),X.useEffect(()=>{ot.current=ke},[ke]),X.useEffect(()=>{se(!0)},[]),X.useEffect(()=>{const xe=re.current;if(xe){const dt=xe.getBoundingClientRect().height;return Ze(dt),y(St=>[{toastId:u.id,height:dt,position:u.position},...St]),()=>y(St=>St.filter(Xt=>Xt.toastId!==u.id))}},[y,u.id]),X.useLayoutEffect(()=>{if(!Q)return;const xe=re.current,dt=xe.style.height;xe.style.height="auto";const St=xe.getBoundingClientRect().height;xe.style.height=dt,Ze(St),y(Xt=>Xt.find(yt=>yt.toastId===u.id)?Xt.map(yt=>yt.toastId===u.id?{...yt,height:St}:yt):[{toastId:u.id,height:St,position:u.position},...Xt])},[Q,u.title,u.description,y,u.id]);const Un=X.useCallback(()=>{ue(!0),Ce(vt.current),y(xe=>xe.filter(dt=>dt.toastId!==u.id)),setTimeout(()=>{T(u)},jj)},[u,T,y,vt]);X.useEffect(()=>{if(u.promise&&R==="loading"||u.duration===1/0||u.type==="loading")return;let xe;return b||m||xs?(()=>{if(Vn.current<at.current){const Xt=new Date().getTime()-at.current;ot.current=ot.current-Xt}Vn.current=new Date().getTime()})():(()=>{ot.current!==1/0&&(at.current=new Date().getTime(),xe=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Un()},ot.current))})(),()=>clearTimeout(xe)},[b,m,u,R,xs,Un]),X.useEffect(()=>{u.delete&&Un()},[Un,u.delete]);function FC(){var xe;if(H!=null&&H.loading){var dt;return X.createElement("div",{className:Wn(I==null?void 0:I.loader,u==null||(dt=u.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":R==="loading"},H.loading)}return X.createElement(cj,{className:Wn(I==null?void 0:I.loader,u==null||(xe=u.classNames)==null?void 0:xe.loader),visible:R==="loading"})}var gg,vg;return X.createElement("li",{tabIndex:0,ref:re,className:Wn(L,M,I==null?void 0:I.toast,u==null||(t=u.classNames)==null?void 0:t.toast,I==null?void 0:I.default,I==null?void 0:I[R],u==null||(n=u.classNames)==null?void 0:n[R]),"data-sonner-toast":"","data-rich-colors":(gg=u.richColors)!=null?gg:_,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":Q,"data-promise":!!u.promise,"data-swiped":D,"data-removed":he,"data-visible":Je,"data-y-position":ys,"data-x-position":pr,"data-index":h,"data-front":be,"data-swiping":q,"data-dismissible":K,"data-type":R,"data-invert":Po,"data-swipe-out":z,"data-swipe-direction":$,"data-expanded":!!(b||O&&Q),style:{"--index":h,"--toasts-before":h,"--z-index":g.length-h,"--offset":`${he?de:vt.current}px`,"--initial-height":O?"auto":`${ge}px`,...S,...u.style},onDragEnd:()=>{oe(!1),F(null),un.current=null},onPointerDown:xe=>{ki||!K||(Bt.current=new Date,Ce(vt.current),xe.target.setPointerCapture(xe.pointerId),xe.target.tagName!=="BUTTON"&&(oe(!0),un.current={x:xe.clientX,y:xe.clientY}))},onPointerUp:()=>{var xe,dt,St;if(z||!K)return;un.current=null;const Xt=Number(((xe=re.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ul=Number(((dt=re.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((St=Bt.current)==null?void 0:St.getTime()),dn=P==="x"?Xt:ul,dl=Math.abs(dn)/yt;if(Math.abs(dn)>=Ej||dl>.11){Ce(vt.current),u.onDismiss==null||u.onDismiss.call(u,u),W(P==="x"?Xt>0?"right":"left":ul>0?"down":"up"),Un(),ne(!0);return}else{var Tn,En;(Tn=re.current)==null||Tn.style.setProperty("--swipe-amount-x","0px"),(En=re.current)==null||En.style.setProperty("--swipe-amount-y","0px")}te(!1),oe(!1),F(null)},onPointerMove:xe=>{var dt,St,Xt;if(!un.current||!K||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;const yt=xe.clientY-un.current.y,dn=xe.clientX-un.current.x;var dl;const Tn=(dl=e.swipeDirections)!=null?dl:Aj(Z);!P&&(Math.abs(dn)>1||Math.abs(yt)>1)&&F(Math.abs(dn)>Math.abs(yt)?"x":"y");let En={x:0,y:0};const yg=Si=>1/(1.5+Math.abs(Si)/20);if(P==="y"){if(Tn.includes("top")||Tn.includes("bottom"))if(Tn.includes("top")&&yt<0||Tn.includes("bottom")&&yt>0)En.y=yt;else{const Si=yt*yg(yt);En.y=Math.abs(Si)<Math.abs(yt)?Si:yt}}else if(P==="x"&&(Tn.includes("left")||Tn.includes("right")))if(Tn.includes("left")&&dn<0||Tn.includes("right")&&dn>0)En.x=dn;else{const Si=dn*yg(dn);En.x=Math.abs(Si)<Math.abs(dn)?Si:dn}(Math.abs(En.x)>0||Math.abs(En.y)>0)&&te(!0),(St=re.current)==null||St.style.setProperty("--swipe-amount-x",`${En.x}px`),(Xt=re.current)==null||Xt.style.setProperty("--swipe-amount-y",`${En.y}px`)}},fe&&!u.jsx&&R!=="loading"?X.createElement("button",{"aria-label":C,"data-disabled":ki,"data-close-button":!0,onClick:ki||!K?()=>{}:()=>{Un(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Wn(I==null?void 0:I.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(vg=H==null?void 0:H.close)!=null?vg:hj):null,R||u.icon||u.promise?X.createElement("div",{"data-icon":"",className:Wn(I==null?void 0:I.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||FC():null,u.type!=="loading"?u.icon||(H==null?void 0:H[R])||aj(R):null):null,X.createElement("div",{"data-content":"",className:Wn(I==null?void 0:I.content,u==null||(s=u.classNames)==null?void 0:s.content)},X.createElement("div",{"data-title":"",className:Wn(I==null?void 0:I.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?X.createElement("div",{"data-description":"",className:Wn(N,U,I==null?void 0:I.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),X.isValidElement(u.cancel)?u.cancel:u.cancel&&Pl(u.cancel)?X.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:xe=>{Pl(u.cancel)&&K&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,xe),Un())},className:Wn(I==null?void 0:I.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,X.isValidElement(u.action)?u.action:u.action&&Pl(u.action)?X.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||B,onClick:xe=>{Pl(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,xe),!xe.defaultPrevented&&Un())},className:Wn(I==null?void 0:I.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Wv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Pj(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?Cj:Sj;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const Mj=X.forwardRef(function(t,n){const{invert:r,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:p,duration:m,style:y,visibleToasts:x=kj,toastOptions:w,dir:h=Wv(),gap:g=Tj,icons:b,containerAriaLabel:T="Notifications"}=t,[_,E]=X.useState([]),S=X.useMemo(()=>Array.from(new Set([i].concat(_.filter($=>$.position).map($=>$.position)))),[_,i]),[A,B]=X.useState([]),[L,N]=X.useState(!1),[ee,Z]=X.useState(!1),[V,O]=X.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=X.useRef(null),H=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=X.useRef(null),P=X.useRef(!1),F=X.useCallback($=>{E(W=>{var Q;return(Q=W.find(se=>se.id===$.id))!=null&&Q.delete||Ut.dismiss($.id),W.filter(({id:se})=>se!==$.id)})},[]);return X.useEffect(()=>Ut.subscribe($=>{if($.dismiss){const W=_.map(Q=>Q.id===$.id?{...Q,delete:!0}:Q);requestAnimationFrame(()=>{E(W)});return}setTimeout(()=>{pT.flushSync(()=>{E(W=>{const Q=W.findIndex(se=>se.id===$.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...$},...W.slice(Q+1)]:[$,...W]})})})}),[_]),X.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{O(W?"dark":"light")})}catch{$.addListener(({matches:Q})=>{try{O(Q?"dark":"light")}catch(se){console.error(se)}})}},[u]),X.useEffect(()=>{_.length<=1&&N(!1)},[_]),X.useEffect(()=>{const $=W=>{var Q;if(s.every(ue=>W[ue]||W.code===ue)){var he;N(!0),(he=I.current)==null||he.focus()}W.code==="Escape"&&(document.activeElement===I.current||(Q=I.current)!=null&&Q.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),X.useEffect(()=>{if(I.current)return()=>{C.current&&(C.current.focus({preventScroll:!0}),C.current=null,P.current=!1)}},[I.current]),X.createElement("section",{ref:n,"aria-label":`${T} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},S.map(($,W)=>{var Q;const[se,he]=$.split("-");return _.length?X.createElement("ol",{key:$,dir:h==="auto"?Wv():h,tabIndex:-1,ref:I,className:l,"data-sonner-toaster":!0,"data-sonner-theme":V,"data-y-position":se,"data-lifted":L&&_.length>1&&!o,"data-x-position":he,style:{"--front-toast-height":`${((Q=A[0])==null?void 0:Q.height)||0}px`,"--width":`${_j}px`,"--gap":`${g}px`,...y,...Pj(c,d)},onBlur:ue=>{P.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(P.current=!1,C.current&&(C.current.focus({preventScroll:!0}),C.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||P.current||(P.current=!0,C.current=ue.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{ee||N(!1)},onDragEnd:()=>N(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},_.filter(ue=>!ue.position&&W===0||ue.position===$).map((ue,q)=>{var oe,z;return X.createElement(Rj,{key:ue.id,icons:b,index:q,toast:ue,defaultRichColors:p,duration:(oe=w==null?void 0:w.duration)!=null?oe:m,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:r,visibleToasts:x,closeButton:(z=w==null?void 0:w.closeButton)!=null?z:a,interacting:ee,position:$,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,closeButtonAriaLabel:w==null?void 0:w.closeButtonAriaLabel,removeToast:F,toasts:_.filter(ne=>ne.position==ue.position),heights:A.filter(ne=>ne.position==ue.position),setHeights:B,expandByDefault:o,gap:g,expanded:L,swipeDirections:t.swipeDirections})})):null}))});function er(e){return Cb.custom(t=>f.jsx(Oj,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Td={success:{bg:"bg-green-100 border-green-200",text:"text-green-800"},error:{bg:"bg-red-100 border-red-200",text:"text-red-800"},warning:{bg:"bg-orange-100 border-orange-200",text:"text-orange-800"},info:{bg:"bg-blue-100 border-blue-200",text:"text-blue-800"}};function Oj(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return f.jsxs("div",{className:ze("flex rounded-lg shadow-lg ring-1 ring-black/5 w-full md:max-w-[364px] items-center p-3 backdrop-blur-sm border mb-2",Td[s||"info"].bg),children:[f.jsx("div",{className:"flex flex-1 items-center",children:f.jsxs("div",{className:"w-full",children:[t&&f.jsx("p",{className:ze("text-sm font-medium",Td[s||"info"].text),children:t}),f.jsx("p",{className:ze("text-sm",Td[s||"info"].text,{"mt-1":!!t}),children:n})]})}),r&&f.jsx("div",{className:"ml-5 shrink-0 rounded-md text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden",children:f.jsx("button",{className:"rounded bg-indigo-50 px-3 py-1 text-sm font-semibold text-indigo-600 hover:bg-indigo-100",onClick:()=>{r.onClick(),Cb.dismiss(i)},children:r.label})})]})}function Nj(e){return Array.isArray(e)&&e[0].field!==void 0}const ho=(e,t)=>{var n;if(Nj(e)){for(const r of e)(n=t==null?void 0:t.form)==null||n.setFieldError(r.field,r.message);return}if(e&&e.message){t!=null&&t.noToast||er({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||er({description:e.error,variant:"error"});return}},Dj=[{code:429,text:"Çok fazla istek gönderdiniz. Lütfen biraz bekleyin"},{code:401,text:"Bu işlemi yapabilmek için giriş yapmalısınız"},{code:403,text:"Bu işlemi yapabilmek için yetkiniz yok"},{code:500,text:"Sunucu hatası oluştu"},{code:422,text:"Form doğrulaması başarısız oldu"},{code:413,text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Ij=[{code:"FST_REQ_FILE_TOO_LARGE",text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Lj=(e,t)=>{if($n(t))return!1;if(e===null)return er({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=Ij.find(s=>s.code===r);if(i)return er({description:i.text,variant:"error"}),!0}if(e.message)return er({description:e.message,variant:"error"}),!0}const n=Dj.find(r=>r.code===t);return er({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},Fj={xs:{default:"!p-1",rounded:"!p-1"},sm:{default:"text-xs px-2 py-1.5",rounded:"p-1.5"},md:{default:"text-xs px-3 py-1.5",rounded:"p-2"},lg:{default:"text-xs px-4 py-2",rounded:"p-2.5"},xl:{default:"text-sm px-5 py-3",rounded:"p-3"}},qv={primary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},secondary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},danger:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},success:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},warning:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"}},cm=v.createContext({});function bu(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const um=typeof window<"u",_b=um?v.useLayoutEffect:v.useEffect,ku=v.createContext(null),dm=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class Bj extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function $j({children:e,isPresent:t,anchorX:n}){const r=v.useId(),i=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=v.useContext(dm);return v.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:d,right:u}=s.current;if(t||!i.current||!a||!l)return;const p=n==="left"?`left: ${d}`:`right: ${u}`;i.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
63
63
  [data-motion-pop-id="${r}"] {
64
64
  position: absolute !important;
65
65
  width: ${a}px !important;
66
66
  height: ${l}px !important;
67
- ${f}px !important;
68
- top: ${u}px !important;
67
+ ${p}px !important;
68
+ top: ${c}px !important;
69
69
  }
70
- `),()=>{document.head.removeChild(m)}},[t]),p.jsx(Bj,{isPresent:t,childRef:i,sizeRef:s,children:g.cloneElement(e,{ref:i})})}const zj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=ku(Vj),u=g.useId();let d=!0,c=g.useMemo(()=>(d=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:f=>{l.set(f,!0);for(const m of l.values())if(!m)return;r&&r()},register:f=>(l.set(f,!1),()=>l.delete(f))}),[n,l,r]);return s&&d&&(c={...c}),g.useMemo(()=>{l.forEach((f,m)=>l.set(m,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.jsx($j,{isPresent:n,anchorX:a,children:e})),p.jsx(Su.Provider,{value:c,children:e})};function Vj(){return new Map}function Tb(e=!0){const t=g.useContext(Su);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=g.useId();g.useEffect(()=>{if(e)return i(s)},[e]);const o=g.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ml=e=>e.key||"";function Yv(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const fi=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=Tb(o),d=g.useMemo(()=>Yv(e),[e]),c=o&&!l?[]:d.map(Ml),f=g.useRef(!0),m=g.useRef(d),y=ku(()=>new Map),[x,w]=g.useState(d),[h,v]=g.useState(d);_b(()=>{f.current=!1,m.current=d;for(let C=0;C<h.length;C++){const E=Ml(h[C]);c.includes(E)?y.delete(E):y.get(E)!==!0&&y.set(E,!1)}},[h,c.length,c.join("-")]);const b=[];if(d!==x){let C=[...d];for(let E=0;E<h.length;E++){const S=h[E],A=Ml(S);c.includes(A)||(C.splice(E,0,S),b.push(S))}return s==="wait"&&b.length&&(C=b),v(Yv(C)),w(d),null}const{forceRender:T}=g.useContext(um);return p.jsx(p.Fragment,{children:h.map(C=>{const E=Ml(C),S=o&&!l?!1:d===h||c.includes(E),A=()=>{if(y.has(E))y.set(E,!0);else return;let B=!0;y.forEach(L=>{L||(B=!1)}),B&&(T==null||T(),v(m.current),o&&(u==null||u()),r&&r())};return p.jsx(zj,{isPresent:S,initial:!f.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:S?void 0:A,anchorX:a,children:C},E)})})};function pm(e,t){e.indexOf(t)===-1&&e.push(t)}function hm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let mp=()=>{};const gp={skipAnimations:!1,useManualTiming:!1};function mm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Sn=e=>e,Na=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class gm{constructor(){this.subscriptions=[]}add(t){return pm(this.subscriptions,t),()=>hm(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rr=e=>e*1e3,ir=e=>e/1e3;function Eb(e,t){return t?e*(1e3/t):0}const Uj=mm(()=>window.ScrollTimeline!==void 0);class Hj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Uj()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].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 n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Wj extends Hj{then(t,n){return this.finished.finally(t).then(()=>{})}}const Qv={value:null,addProjectionMetrics:null},vm=e=>Array.isArray(e)&&typeof e[0]=="number",qj={};function Gj(e,t){const n=mm(e);return()=>qj[t]??n()}const Da=Gj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Yo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,vp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yo([0,.65,.55,1]),circOut:Yo([.55,0,1,.45]),backIn:Yo([.31,.01,.66,-.59]),backOut:Yo([.33,1.53,.69,.99])};function Ab(e,t){if(e)return typeof e=="function"&&Da()?jb(e,t):vm(e)?Yo(e):Array.isArray(e)?e.map(n=>Ab(n,t)||vp.easeOut):vp[e]}function Yj(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const d={[t]:n};l&&(d.offset=l);const c=Ab(a,i);return Array.isArray(c)&&(d.easing=c),e.animate(d,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:u})}function ym(e){return typeof e=="function"&&"applyToOptions"in e}function xm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const $c=2e4;function wm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<$c;)t+=n,r=e.next(t);return t>=$c?1/0:t}function Qj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(wm(r),$c);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:ir(i)}}function Rb(e){return!!(typeof e=="function"&&Da()||!e||typeof e=="string"&&(e in vp||Da())||vm(e)||Array.isArray(e)&&e.every(Rb))}function Kv(e,t){e.timeline=t,e.onfinish=null}const Ol=["read","resolveKeyframes","update","preRender","render","postRender"];function Kj(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(c){o.has(c)&&(d.schedule(c),e()),l++,c(a)}const d={schedule:(c,f=!1,m=!1)=>{const x=m&&i?n:r;return f&&o.add(c),x.has(c)||x.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(a=c,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),t&&Qv.value&&Qv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(c))}};return d}const Xj=40;function Pb(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ol.reduce((h,v)=>(h[v]=Kj(s,t?v:void 0),h),{}),{read:a,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=o,m=()=>{const h=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(h-i.timestamp,Xj),1),i.timestamp=h,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),d.process(i),c.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:Ol.reduce((h,v)=>{const b=o[v];return h[v]=(T,C=!1,E=!1)=>(n||y(),b.schedule(T,C,E)),h},{}),cancel:h=>{for(let v=0;v<Ol.length;v++)o[Ol[v]].cancel(h)},state:i,steps:o}}const{schedule:bm,cancel:z6}=Pb(queueMicrotask,!1),{schedule:Le,cancel:pi,state:wt,steps:jd}=Pb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0);let nc;function Zj(){nc=void 0}const sr={now:()=>(nc===void 0&&sr.set(wt.isProcessing||gp.useManualTiming?wt.timestamp:performance.now()),nc),set:e=>{nc=e,queueMicrotask(Zj)}},Rn={x:!1,y:!1};function Mb(){return Rn.x||Rn.y}function Jj(e){return e==="x"||e==="y"?Rn[e]?null:(Rn[e]=!0,()=>{Rn[e]=!1}):Rn.x||Rn.y?null:(Rn.x=Rn.y=!0,()=>{Rn.x=Rn.y=!1})}function eA(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Ob(e,t){const n=eA(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Xv(e){return!(e.pointerType==="touch"||Mb())}function tA(e,t,n={}){const[r,i,s]=Ob(e,n),o=a=>{if(!Xv(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const d=c=>{Xv(c)&&(u(c),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Nb=(e,t)=>t?e===t?!0:Nb(e,t.parentElement):!1,km=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,nA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function rA(e){return nA.has(e.tagName)||e.tabIndex!==-1}const Qo=new WeakSet;function Zv(e){return t=>{t.key==="Enter"&&e(t)}}function Ad(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const iA=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Zv(()=>{if(Qo.has(n))return;Ad(n,"down");const i=Zv(()=>{Ad(n,"up")}),s=()=>Ad(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Jv(e){return km(e)&&!Mb()}function sA(e,t,n={}){const[r,i,s]=Ob(e,n),o=a=>{const l=a.currentTarget;if(!Jv(a)||Qo.has(l))return;Qo.add(l);const u=t(l,a),d=(m,y)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!Jv(m)||!Qo.has(l))&&(Qo.delete(l),typeof u=="function"&&u(m,{success:y}))},c=m=>{d(m,l===window||l===document||n.useGlobalTarget||Nb(l,m.target))},f=m=>{d(m,!1)};window.addEventListener("pointerup",c,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",u=>iA(u,i)),!rA(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const ey=30,oA=e=>!isNaN(parseFloat(e));class aA{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=sr.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=oA(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new gm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Le.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ey)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ey);return Eb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ia(e,t){return new aA(e,t)}const Db=g.createContext({strict:!1}),ty={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"]},mo={};for(const e in ty)mo[e]={isEnabled:t=>ty[e].some(n=>!!t[n])};function lA(e){for(const t in e)mo[t]={...mo[t],...e[t]}}const cA=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 zc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||cA.has(e)}let Ib=e=>!zc(e);function uA(e){e&&(Ib=t=>t.startsWith("on")?!zc(t):e(t))}try{uA(require("@emotion/is-prop-valid").default)}catch{}function dA(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Ib(i)||n===!0&&zc(i)||!t&&!zc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function fA(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Cu=g.createContext({});function _u(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function La(e){return typeof e=="string"||Array.isArray(e)}const Sm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cm=["initial",...Sm];function Tu(e){return _u(e.animate)||Cm.some(t=>La(e[t]))}function Lb(e){return!!(Tu(e)||e.variants)}function pA(e,t){if(Tu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||La(n)?n:void 0,animate:La(r)?r:void 0}}return e.inherit!==!1?t:{}}function hA(e){const{initial:t,animate:n}=pA(e,g.useContext(Cu));return g.useMemo(()=>({initial:t,animate:n}),[ny(t),ny(n)])}function ny(e){return Array.isArray(e)?e.join(" "):e}const mA=Symbol.for("motionComponentSymbol");function Ns(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gA(e,t,n){return g.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ns(n)&&(n.current=r))},[t])}const _m=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vA="framerAppearId",Fb="data-"+_m(vA),Bb=g.createContext({});function yA(e,t,n,r,i){var x,w;const{visualElement:s}=g.useContext(Cu),o=g.useContext(Db),a=g.useContext(Su),l=g.useContext(fm).reducedMotion,u=g.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=u.current,c=g.useContext(Bb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&xA(u.current,n,i,c);const f=g.useRef(!1);g.useInsertionEffect(()=>{d&&f.current&&d.update(n,a)});const m=n[Fb],y=g.useRef(!!m&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,m))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,m)));return _b(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),bm.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),g.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)==null||h.call(window,m)}),y.current=!1))}),d}function xA(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:$b(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ns(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function $b(e){if(e)return e.options.allowProjection!==!1?e.projection:$b(e.parent)}function wA({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&lA(e);function s(a,l){let u;const d={...g.useContext(fm),...a,layoutId:bA(a)},{isStatic:c}=d,f=hA(a),m=r(a,c);if(!c&&dm){kA();const y=SA(d);u=y.MeasureLayout,f.visualElement=yA(i,m,d,t,y.ProjectionNode)}return p.jsxs(Cu.Provider,{value:f,children:[u&&f.visualElement?p.jsx(u,{visualElement:f.visualElement,...d}):null,n(i,a,gA(m,f.visualElement,l),m,c,f.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=g.forwardRef(s);return o[mA]=i,o}function bA({layoutId:e}){const t=g.useContext(um).id;return t&&e!==void 0?t+"-"+e:e}function kA(e,t){g.useContext(Db).strict}function SA(e){const{drag:t,layout:n}=mo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const zb=e=>t=>typeof t=="string"&&t.startsWith(e),Tm=zb("--"),CA=zb("var(--"),Em=e=>CA(e)?_A.test(e.split("/*")[0].trim()):!1,_A=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Fa={};function TA(e){for(const t in e)Fa[t]=e[t],Tm(t)&&(Fa[t].isCSSVariable=!0)}const To=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ls=new Set(To);function Vb(e,{layout:t,layoutId:n}){return ls.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Fa[e]||e==="opacity")}const At=e=>!!(e&&e.getVelocity),Ub=(e,t)=>t&&typeof e=="number"?t.transform(e):e,jr=(e,t,n)=>n>t?t:n<e?e:n,Eo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ba={...Eo,transform:e=>jr(0,1,e)},Nl={...Eo,default:1},nl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ir=nl("deg"),or=nl("%"),me=nl("px"),EA=nl("vh"),jA=nl("vw"),ry={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},AA={borderWidth:me,borderTopWidth:me,borderRightWidth:me,borderBottomWidth:me,borderLeftWidth:me,borderRadius:me,radius:me,borderTopLeftRadius:me,borderTopRightRadius:me,borderBottomRightRadius:me,borderBottomLeftRadius:me,width:me,maxWidth:me,height:me,maxHeight:me,top:me,right:me,bottom:me,left:me,padding:me,paddingTop:me,paddingRight:me,paddingBottom:me,paddingLeft:me,margin:me,marginTop:me,marginRight:me,marginBottom:me,marginLeft:me,backgroundPositionX:me,backgroundPositionY:me},RA={rotate:Ir,rotateX:Ir,rotateY:Ir,rotateZ:Ir,scale:Nl,scaleX:Nl,scaleY:Nl,scaleZ:Nl,skew:Ir,skewX:Ir,skewY:Ir,distance:me,translateX:me,translateY:me,translateZ:me,x:me,y:me,z:me,perspective:me,transformPerspective:me,opacity:Ba,originX:ry,originY:ry,originZ:me},iy={...Eo,transform:Math.round},jm={...AA,...RA,zIndex:iy,size:me,fillOpacity:Ba,strokeOpacity:Ba,numOctaves:iy},PA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},MA=To.length;function OA(e,t,n){let r="",i=!0;for(let s=0;s<MA;s++){const o=To[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Ub(a,jm[o]);if(!l){i=!1;const d=PA[o]||o;r+=`${d}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Am(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(ls.has(l)){o=!0;continue}else if(Tm(l)){i[l]=u;continue}else{const d=Ub(u,jm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=OA(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${u} ${d}`}}const Rm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hb(e,t,n){for(const r in t)!At(t[r])&&!Vb(r,n)&&(e[r]=t[r])}function NA({transformTemplate:e},t){return g.useMemo(()=>{const n=Rm();return Am(n,t,e),Object.assign({},n.vars,n.style)},[t])}function DA(e,t){const n=e.style||{},r={};return Hb(r,n,e),Object.assign(r,NA(e,t)),r}function IA(e,t){const n={},r=DA(e,t);return e.drag&&e.dragListener!==!1&&(n.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)&&(n.tabIndex=0),n.style=r,n}const LA=["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 Pm(e){return typeof e!="string"||e.includes("-")?!1:!!(LA.indexOf(e)>-1||/[A-Z]/u.test(e))}const FA={offset:"stroke-dashoffset",array:"stroke-dasharray"},BA={offset:"strokeDashoffset",array:"strokeDasharray"};function $A(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?FA:BA;e[s.offset]=me.transform(-r);const o=me.transform(t),a=me.transform(n);e[s.array]=`${o} ${a}`}function sy(e,t,n){return typeof e=="string"?e:me.transform(t+n*e)}function zA(e,t,n){const r=sy(t,e.x,e.width),i=sy(n,e.y,e.height);return`${r} ${i}`}function Mm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},d,c){if(Am(e,u,c),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m,dimensions:y}=e;f.transform&&(y&&(m.transform=f.transform),delete f.transform),y&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=zA(y,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&$A(f,o,a,l,!1)}const Wb=()=>({...Rm(),attrs:{}}),Om=e=>typeof e=="string"&&e.toLowerCase()==="svg";function VA(e,t,n,r){const i=g.useMemo(()=>{const s=Wb();return Mm(s,t,Om(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Hb(s,e.style,e),i.style={...s,...i.style}}return i}function UA(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Pm(n)?VA:IA)(r,s,o,n),u=dA(r,typeof n=="string",e),d=n!==g.Fragment?{...u,...l,ref:i}:{},{children:c}=r,f=g.useMemo(()=>At(c)?c.get():c,[c]);return g.createElement(n,{...d,children:f})}}function oy(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Nm(e,t,n,r){if(typeof t=="function"){const[i,s]=oy(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=oy(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const yp=e=>Array.isArray(e),HA=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),WA=e=>yp(e)?e[e.length-1]||0:e;function rc(e){const t=At(e)?e.get():e;return HA(t)?t.toValue():t}function qA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:GA(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const qb=e=>(t,n)=>{const r=g.useContext(Cu),i=g.useContext(Su),s=()=>qA(e,t,r,i);return n?s():ku(s)};function GA(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=rc(s[f]);let{initial:o,animate:a}=e;const l=Tu(e),u=Lb(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const c=d?a:o;if(c&&typeof c!="boolean"&&!_u(c)){const f=Array.isArray(c)?c:[c];for(let m=0;m<f.length;m++){const y=Nm(e,f[m]);if(y){const{transitionEnd:x,transition:w,...h}=y;for(const v in h){let b=h[v];if(Array.isArray(b)){const T=d?b.length-1:0;b=b[T]}b!==null&&(i[v]=b)}for(const v in x)i[v]=x[v]}}}return i}function Dm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(At(r[o])||t.style&&At(t.style[o])||Vb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const YA={useVisualState:qb({scrapeMotionValuesFromProps:Dm,createRenderState:Rm})};function Gb(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function Yb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Qb=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 Kb(e,t,n,r){Yb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Qb.has(i)?i:_m(i),t.attrs[i])}function Xb(e,t,n){const r=Dm(e,t,n);for(const i in e)if(At(e[i])||At(t[i])){const s=To.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const ay=["x","y","width","height","cx","cy","r"],QA={useVisualState:qb({scrapeMotionValuesFromProps:Xb,createRenderState:Wb,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ls.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<ay.length;a++){const l=ay[a];e[l]!==t[l]&&(o=!0)}o&&Le.read(()=>{Gb(n,r),Le.render(()=>{Mm(r,i,Om(n.tagName),e.transformTemplate),Kb(n,r)})})}})};function KA(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Pm(r)?QA:YA,preloadedFeatures:e,useRender:UA(i),createVisualElement:t,Component:r};return wA(o)}}function $a(e,t,n){const r=e.getProps();return Nm(r,t,n!==void 0?n:r.custom,e)}const Zb=new Set(["width","height","top","left","right","bottom",...To]);function XA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ia(n))}function ZA(e,t){const n=$a(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=WA(s[o]);XA(e,o,a)}}function JA(e){return!!(At(e)&&e.add)}function xp(e,t){const n=e.getValue("willChange");if(JA(n))return n.add(t);if(!n&&gp.WillChange){const r=new gp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Jb(e){return e.props[Fb]}const ek=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,e5=1e-7,t5=12;function n5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=ek(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>e5&&++a<t5);return o}function rl(e,t,n,r){if(e===t&&n===r)return Sn;const i=s=>n5(s,0,1,e,n);return s=>s===0||s===1?s:ek(i(s),t,r)}const tk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,nk=e=>t=>1-e(1-t),rk=rl(.33,1.53,.69,.99),Im=nk(rk),ik=tk(Im),sk=e=>(e*=2)<1?.5*Im(e):.5*(2-Math.pow(2,-10*(e-1))),Lm=e=>1-Math.sin(Math.acos(e)),ok=nk(Lm),ak=tk(Lm),lk=e=>/^0[^.\s]+$/u.test(e);function r5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||lk(e):!0}const aa=e=>Math.round(e*1e5)/1e5,Fm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function i5(e){return e==null}const s5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bm=(e,t)=>n=>!!(typeof n=="string"&&s5.test(n)&&n.startsWith(e)||t&&!i5(n)&&Object.prototype.hasOwnProperty.call(n,t)),ck=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Fm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},o5=e=>jr(0,255,e),Rd={...Eo,transform:e=>Math.round(o5(e))},Ni={test:Bm("rgb","red"),parse:ck("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rd.transform(e)+", "+Rd.transform(t)+", "+Rd.transform(n)+", "+aa(Ba.transform(r))+")"};function a5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const wp={test:Bm("#"),parse:a5,transform:Ni.transform},Ds={test:Bm("hsl","hue"),parse:ck("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(aa(t))+", "+or.transform(aa(n))+", "+aa(Ba.transform(r))+")"},Et={test:e=>Ni.test(e)||wp.test(e)||Ds.test(e),parse:e=>Ni.test(e)?Ni.parse(e):Ds.test(e)?Ds.parse(e):wp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ni.transform(e):Ds.transform(e)},l5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function c5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fm))==null?void 0:t.length)||0)+(((n=e.match(l5))==null?void 0:n.length)||0)>0}const uk="number",dk="color",u5="var",d5="var(",ly="${}",f5=/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 za(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(f5,l=>(Et.test(l)?(r.color.push(s),i.push(dk),n.push(Et.parse(l))):l.startsWith(d5)?(r.var.push(s),i.push(u5),n.push(l)):(r.number.push(s),i.push(uk),n.push(parseFloat(l))),++s,ly)).split(ly);return{values:n,split:a,indexes:r,types:i}}function fk(e){return za(e).values}function pk(e){const{split:t,types:n}=za(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===uk?s+=aa(i[o]):a===dk?s+=Et.transform(i[o]):s+=i[o]}return s}}const p5=e=>typeof e=="number"?0:e;function h5(e){const t=fk(e);return pk(e)(t.map(p5))}const hi={test:c5,parse:fk,createTransformer:pk,getAnimatableNone:h5},m5=new Set(["brightness","contrast","saturate","opacity"]);function g5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fm)||[];if(!r)return e;const i=n.replace(r,"");let s=m5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const v5=/\b([a-z-]*)\(.*?\)/gu,bp={...hi,getAnimatableNone:e=>{const t=e.match(v5);return t?t.map(g5).join(" "):e}},y5={...jm,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:bp,WebkitFilter:bp},hk=e=>y5[e];function mk(e,t){let n=hk(e);return n!==bp&&(n=hi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const x5=new Set(["auto","none","0"]);function w5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!x5.has(s)&&za(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=mk(n,i)}const Di=e=>e*180/Math.PI,kp=e=>{const t=Di(Math.atan2(e[1],e[0]));return Sp(t)},b5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:kp,rotateZ:kp,skewX:e=>Di(Math.atan(e[1])),skewY:e=>Di(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sp=e=>(e=e%360,e<0&&(e+=360),e),cy=kp,uy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),k5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:uy,scaleY:dy,scale:e=>(uy(e)+dy(e))/2,rotateX:e=>Sp(Di(Math.atan2(e[6],e[5]))),rotateY:e=>Sp(Di(Math.atan2(-e[2],e[0]))),rotateZ:cy,rotate:cy,skewX:e=>Di(Math.atan(e[4])),skewY:e=>Di(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fy(e){return e.includes("scale")?1:0}function Cp(e,t){if(!e||e==="none")return fy(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=k5,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=b5,i=a}if(!i)return fy(t);const s=r[t],o=i[1].split(",").map(C5);return typeof s=="function"?s(o):o[s]}const S5=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Cp(n,t)};function C5(e){return parseFloat(e.trim())}const py=e=>e===Eo||e===me,_5=new Set(["x","y","z"]),T5=To.filter(e=>!_5.has(e));function E5(e){const t=[];return T5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const go={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),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:(e,{transform:t})=>Cp(t,"x"),y:(e,{transform:t})=>Cp(t,"y")};go.translateX=go.x;go.translateY=go.y;const Gi=new Set;let _p=!1,Tp=!1;function gk(){if(Tp){const e=Array.from(Gi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=E5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Tp=!1,_p=!1,Gi.forEach(e=>e.complete()),Gi.clear()}function vk(){Gi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Tp=!0)})}function j5(){vk(),gk()}class $m{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gi.add(this),_p||(_p=!0,Le.read(vk),Le.resolveKeyframes(gk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const yk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),A5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function R5(e){const t=A5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function xk(e,t,n=1){const[r,i]=R5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return yk(o)?parseFloat(o):o}return Em(i)?xk(i,t,n+1):i}const wk=e=>t=>t.test(e),P5={test:e=>e==="auto",parse:e=>e},bk=[Eo,me,or,Ir,jA,EA,P5],hy=e=>bk.find(wk(e));class kk extends $m{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),Em(u))){const d=xk(u,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Zb.has(r)||t.length!==2)return;const[i,s]=t,o=hy(i),a=hy(s);if(o!==a)if(py(o)&&py(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)r5(t[i])&&r.push(i);r.length&&w5(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=go[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=go[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const my=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hi.test(e)||e==="0")&&!e.startsWith("url("));function M5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function O5(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=my(i,t),a=my(s,t);return!o||!a?!1:M5(e)||(n==="spring"||ym(n))&&r}const N5=e=>e!==null;function Eu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(N5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const D5=40;class Sk{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=sr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>D5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&j5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=sr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!O5(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Eu(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const qe=(e,t,n)=>e+(t-e)*n;function Pd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function I5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Pd(l,a,e+1/3),s=Pd(l,a,e),o=Pd(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Vc(e,t){return n=>n>0?t:e}const Md=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},L5=[wp,Ni,Ds],F5=e=>L5.find(t=>t.test(e));function gy(e){const t=F5(e);if(!t)return!1;let n=t.parse(e);return t===Ds&&(n=I5(n)),n}const vy=(e,t)=>{const n=gy(e),r=gy(t);if(!n||!r)return Vc(e,t);const i={...n};return s=>(i.red=Md(n.red,r.red,s),i.green=Md(n.green,r.green,s),i.blue=Md(n.blue,r.blue,s),i.alpha=qe(n.alpha,r.alpha,s),Ni.transform(i))},B5=(e,t)=>n=>t(e(n)),il=(...e)=>e.reduce(B5),Ep=new Set(["none","hidden"]);function $5(e,t){return Ep.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function z5(e,t){return n=>qe(e,t,n)}function zm(e){return typeof e=="number"?z5:typeof e=="string"?Em(e)?Vc:Et.test(e)?vy:H5:Array.isArray(e)?Ck:typeof e=="object"?Et.test(e)?vy:V5:Vc}function Ck(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>zm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function V5(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=zm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function U5(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const H5=(e,t)=>{const n=hi.createTransformer(t),r=za(e),i=za(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ep.has(e)&&!i.values.length||Ep.has(t)&&!r.values.length?$5(e,t):il(Ck(U5(r,i),i.values),n):Vc(e,t)};function _k(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qe(e,t,n):zm(e)(e,t)}const W5=5;function Tk(e,t,n){const r=Math.max(t-W5,0);return Eb(n-e(r),t-r)}const Ke={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},Od=.001;function q5({duration:e=Ke.duration,bounce:t=Ke.bounce,velocity:n=Ke.velocity,mass:r=Ke.mass}){let i,s,o=1-t;o=jr(Ke.minDamping,Ke.maxDamping,o),e=jr(Ke.minDuration,Ke.maxDuration,ir(e)),o<1?(i=u=>{const d=u*o,c=d*e,f=d-n,m=jp(u,o),y=Math.exp(-c);return Od-f/m*y},s=u=>{const c=u*o*e,f=c*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,y=Math.exp(-c),x=jp(Math.pow(u,2),o);return(-i(u)+Od>0?-1:1)*((f-m)*y)/x}):(i=u=>{const d=Math.exp(-u*e),c=(u-n)*e+1;return-Od+d*c},s=u=>{const d=Math.exp(-u*e),c=(n-u)*(e*e);return d*c});const a=5/e,l=Y5(i,s,a);if(e=rr(e),isNaN(l))return{stiffness:Ke.stiffness,damping:Ke.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const G5=12;function Y5(e,t,n){let r=n;for(let i=1;i<G5;i++)r=r-e(r)/t(r);return r}function jp(e,t){return e*Math.sqrt(1-t*t)}const Q5=["duration","bounce"],K5=["stiffness","damping","mass"];function yy(e,t){return t.some(n=>e[n]!==void 0)}function X5(e){let t={velocity:Ke.velocity,stiffness:Ke.stiffness,damping:Ke.damping,mass:Ke.mass,isResolvedFromDuration:!1,...e};if(!yy(e,K5)&&yy(e,Q5))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*jr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ke.mass,stiffness:i,damping:s}}else{const n=q5(e);t={...t,...n,mass:Ke.mass},t.isResolvedFromDuration=!0}return t}function Uc(e=Ke.visualDuration,t=Ke.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:d,duration:c,velocity:f,isResolvedFromDuration:m}=X5({...n,velocity:-ir(n.velocity||0)}),y=f||0,x=u/(2*Math.sqrt(l*d)),w=o-s,h=ir(Math.sqrt(l/d)),v=Math.abs(w)<5;r||(r=v?Ke.restSpeed.granular:Ke.restSpeed.default),i||(i=v?Ke.restDelta.granular:Ke.restDelta.default);let b;if(x<1){const C=jp(h,x);b=E=>{const S=Math.exp(-x*h*E);return o-S*((y+x*h*w)/C*Math.sin(C*E)+w*Math.cos(C*E))}}else if(x===1)b=C=>o-Math.exp(-h*C)*(w+(y+h*w)*C);else{const C=h*Math.sqrt(x*x-1);b=E=>{const S=Math.exp(-x*h*E),A=Math.min(C*E,300);return o-S*((y+x*h*w)*Math.sinh(A)+C*w*Math.cosh(A))/C}}const T={calculatedDuration:m&&c||null,next:C=>{const E=b(C);if(m)a.done=C>=c;else{let S=0;x<1&&(S=C===0?rr(y):Tk(b,C,E));const A=Math.abs(S)<=r,B=Math.abs(o-E)<=i;a.done=A&&B}return a.value=a.done?o:E,a},toString:()=>{const C=Math.min(wm(T),$c),E=jb(S=>T.next(C*S).value,C,30);return C+"ms "+E},toTransition:()=>{}};return T}Uc.applyToOptions=e=>{const t=Qj(e,100,Uc);return e.ease=Da()?t.ease:"easeOut",e.duration=rr(t.duration),e.type="keyframes",e};function xy({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const c=e[0],f={done:!1,value:c},m=A=>a!==void 0&&A<a||l!==void 0&&A>l,y=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let x=n*t;const w=c+x,h=o===void 0?w:o(w);h!==w&&(x=h-c);const v=A=>-x*Math.exp(-A/r),b=A=>h+v(A),T=A=>{const B=v(A),L=b(A);f.done=Math.abs(B)<=u,f.value=f.done?h:L};let C,E;const S=A=>{m(f.value)&&(C=A,E=Uc({keyframes:[f.value,y(f.value)],velocity:Tk(b,A,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return S(0),{calculatedDuration:null,next:A=>{let B=!1;return!E&&C===void 0&&(B=!0,T(A),S(A)),C!==void 0&&A>=C?E.next(A-C):(!B&&T(A),f)}}}const Z5=rl(.42,0,1,1),J5=rl(0,0,.58,1),Ek=rl(.42,0,.58,1),e3=e=>Array.isArray(e)&&typeof e[0]!="number",wy={linear:Sn,easeIn:Z5,easeInOut:Ek,easeOut:J5,circIn:Lm,circInOut:ak,circOut:ok,backIn:Im,backInOut:ik,backOut:rk,anticipate:sk},by=e=>{if(vm(e)){mp(e.length===4);const[t,n,r,i]=e;return rl(t,n,r,i)}else if(typeof e=="string")return mp(wy[e]!==void 0),wy[e];return e};function t3(e,t,n){const r=[],i=n||_k,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Sn:t;a=il(l,a)}r.push(a)}return r}function n3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(mp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=t3(t,r,i),l=a.length,u=d=>{if(o&&d<e[0])return t[0];let c=0;if(l>1)for(;c<e.length-2&&!(d<e[c+1]);c++);const f=Na(e[c],e[c+1],d);return a[c](f)};return n?d=>u(jr(e[0],e[s-1],d)):u}function r3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Na(0,t,r);e.push(qe(n,1,i))}}function i3(e){const t=[0];return r3(t,e.length-1),t}function s3(e,t){return e.map(n=>n*t)}function o3(e,t){return e.map(()=>t||Ek).splice(0,e.length-1)}function Hc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=e3(r)?r.map(by):by(r),s={done:!1,value:t[0]},o=s3(n&&n.length===t.length?n:i3(t),e),a=n3(o,t,{ease:Array.isArray(i)?i:o3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const a3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Le.update(t,!0),stop:()=>pi(t),now:()=>wt.isProcessing?wt.timestamp:sr.now()}},l3={decay:xy,inertia:xy,tween:Hc,keyframes:Hc,spring:Uc},c3=e=>e/100;class Vm extends Sk{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();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||$m,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=ym(n)?n:l3[n]||Hc;let l,u;a!==Hc&&typeof t[0]!="number"&&(l=il(c3,_k(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=wm(d));const{calculatedDuration:c}=d,f=c+i,m=f*(r+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:d,resolvedDuration:c}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:m,repeatType:y,repeatDelay:x,onUpdate:w}=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)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const h=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?h<0:h>d;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,T=s;if(m){const A=Math.min(this.currentTime,d)/c;let B=Math.floor(A),L=A%1;!L&&A>=1&&(L=1),L===1&&B--,B=Math.min(B,m+1),!!(B%2)&&(y==="reverse"?(L=1-L,x&&(L-=x/c)):y==="mirror"&&(T=o)),b=jr(0,1,L)*c}const C=v?{done:!1,value:l[0]}:T.next(b);a&&(C.value=a(C.value));let{done:E}=C;!v&&u!==null&&(E=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return S&&i!==void 0&&(C.value=Eu(l,this.options,i)),w&&w(C.value),S&&this.finish(),C}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=rr(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){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=a3,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{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)}get finished(){return this.currentFinishedPromise}}const u3=new Set(["opacity","clipPath","filter","transform"]),d3=mm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Wc=10,f3=2e4;function p3(e){return ym(e.type)||e.type==="spring"||!Rb(e.ease)}function h3(e,t){const n=new Vm({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<f3;)r=n.sample(s),i.push(r.value),s+=Wc;return{times:void 0,keyframes:i,duration:s-Wc,ease:"linear"}}const jk={anticipate:sk,backInOut:ik,circInOut:ak};function m3(e){return e in jk}class ky extends Sk{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new kk(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&Da()&&m3(s)&&(s=jk[s]),p3(this.options)){const{onComplete:c,onUpdate:f,motionValue:m,element:y,...x}=this.options,w=h3(t,x);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,i=w.times,s=w.ease,o="keyframes"}const d=Yj(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Kv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:c}=this.options;a.set(Eu(t,this.options,n)),c&&c(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=rr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;Kv(r,t)}return Sn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:c,element:f,...m}=this.options,y=new Vm({...m,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),x=rr(this.time);u.setWithVelocity(y.sample(x-Wc).value,y.sample(x).value,Wc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return d3()&&r&&u3.has(r)&&(r!=="transform"||!u)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const g3={type:"spring",stiffness:500,damping:25,restSpeed:10},v3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),y3={type:"keyframes",duration:.8},x3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},w3=(e,{keyframes:t})=>t.length>2?y3:ls.has(e)?e.startsWith("scale")?v3(t[1]):g3:x3;function b3({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const Um=(e,t,n,r={},i,s)=>o=>{const a=xm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-rr(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};b3(a)||(d={...d,...w3(e,d)}),d.duration&&(d.duration=rr(d.duration)),d.repeatDelay&&(d.repeatDelay=rr(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)),d.allowFlatten=!a.type&&!a.ease,c&&!s&&t.get()!==void 0){const f=Eu(d.keyframes,a);if(f!==void 0)return Le.update(()=>{d.onUpdate(f),d.onComplete()}),new Wj([])}return!s&&ky.supports(d)?new ky(d):new Vm(d)};function k3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ak(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const c=e.getValue(d,e.latestValues[d]??null),f=a[d];if(f===void 0||u&&k3(u,d))continue;const m={delay:n,...xm(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const w=Jb(e);if(w){const h=window.MotionHandoffAnimation(w,d,Le);h!==null&&(m.startTime=h,y=!0)}}xp(e,d),c.start(Um(d,c,f,e.shouldReduceMotion&&Zb.has(d)?{type:!1}:m,e,y));const x=c.animation;x&&l.push(x)}return o&&Promise.all(l).then(()=>{Le.update(()=>{o&&ZA(e,o)})}),l}function Ap(e,t,n={}){var l;const r=$a(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Ak(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=i;return S3(e,t,d+u,c,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,d]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function S3(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(C3).forEach((u,d)=>{u.notify("AnimationStart",t),o.push(Ap(u,t,{...s,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function C3(e,t){return e.sortNodePosition(t)}function _3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Ap(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Ap(e,t,n);else{const i=typeof t=="function"?$a(e,t,n.custom):t;r=Promise.all(Ak(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Rk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const T3=Cm.length;function Pk(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Pk(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<T3;n++){const r=Cm[n],i=e.props[r];(La(i)||i===!1)&&(t[r]=i)}return t}const E3=[...Sm].reverse(),j3=Sm.length;function A3(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_3(e,n,r)))}function R3(e){let t=A3(e),n=Sy(),r=!0;const i=l=>(u,d)=>{var f;const c=$a(e,d,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(c){const{transition:m,transitionEnd:y,...x}=c;u={...u,...x,...y}}return u};function s(l){t=l(e)}function o(l){const{props:u}=e,d=Pk(e.parent)||{},c=[],f=new Set;let m={},y=1/0;for(let w=0;w<j3;w++){const h=E3[w],v=n[h],b=u[h]!==void 0?u[h]:d[h],T=La(b),C=h===l?v.isActive:null;C===!1&&(y=w);let E=b===d[h]&&b!==u[h]&&T;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),v.protectedKeys={...m},!v.isActive&&C===null||!b&&!v.prevProp||_u(b)||typeof b=="boolean")continue;const S=P3(v.prevProp,b);let A=S||h===l&&v.isActive&&!E&&T||w>y&&T,B=!1;const L=Array.isArray(b)?b:[b];let N=L.reduce(i(h),{});C===!1&&(N={});const{prevResolvedValues:ee={}}=v,Z={...ee,...N},V=H=>{A=!0,f.has(H)&&(B=!0,f.delete(H)),v.needsAnimating[H]=!0;const _=e.getValue(H);_&&(_.liveStyle=!1)};for(const H in Z){const _=N[H],P=ee[H];if(m.hasOwnProperty(H))continue;let F=!1;yp(_)&&yp(P)?F=!Rk(_,P):F=_!==P,F?_!=null?V(H):f.add(H):_!==void 0&&f.has(H)?V(H):v.protectedKeys[H]=!0}v.prevProp=b,v.prevResolvedValues=N,v.isActive&&(m={...m,...N}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(E&&S)||B)&&c.push(...L.map(H=>({animation:H,options:{type:h}})))}if(f.size){const w={};if(typeof u.initial!="boolean"){const h=$a(e,Array.isArray(u.initial)?u.initial[0]:u.initial);h&&h.transition&&(w.transition=h.transition)}f.forEach(h=>{const v=e.getBaseTarget(h),b=e.getValue(h);b&&(b.liveStyle=!0),w[h]=v??null}),c.push({animation:w})}let x=!!c.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(c):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)==null||c.forEach(f=>{var m;return(m=f.animationState)==null?void 0:m.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Sy(),r=!0}}}function P3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Rk(t,e):!1}function Ci(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Sy(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}class wi{constructor(t){this.isMounted=!1,this.node=t}update(){}}class M3 extends wi{constructor(t){super(t),t.animationState||(t.animationState=R3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_u(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let O3=0;class N3 extends wi{constructor(){super(...arguments),this.id=O3++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const D3={animation:{Feature:M3},exit:{Feature:N3}};function Va(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function sl(e){return{point:{x:e.pageX,y:e.pageY}}}const I3=e=>t=>km(t)&&e(t,sl(t));function la(e,t,n,r){return Va(e,t,I3(n),r)}function Mk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function L3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function F3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ok=1e-4,B3=1-Ok,$3=1+Ok,Nk=.01,z3=0-Nk,V3=0+Nk;function Dt(e){return e.max-e.min}function U3(e,t,n){return Math.abs(e-t)<=n}function Cy(e,t,n,r=.5){e.origin=r,e.originPoint=qe(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=B3&&e.scale<=$3||isNaN(e.scale))&&(e.scale=1),(e.translate>=z3&&e.translate<=V3||isNaN(e.translate))&&(e.translate=0)}function ca(e,t,n,r){Cy(e.x,t.x,n.x,r?r.originX:void 0),Cy(e.y,t.y,n.y,r?r.originY:void 0)}function _y(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function H3(e,t,n){_y(e.x,t.x,n.x),_y(e.y,t.y,n.y)}function Ty(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function ua(e,t,n){Ty(e.x,t.x,n.x),Ty(e.y,t.y,n.y)}const Ey=()=>({translate:0,scale:1,origin:0,originPoint:0}),Is=()=>({x:Ey(),y:Ey()}),jy=()=>({min:0,max:0}),et=()=>({x:jy(),y:jy()});function hn(e){return[e("x"),e("y")]}function Nd(e){return e===void 0||e===1}function Rp({scale:e,scaleX:t,scaleY:n}){return!Nd(e)||!Nd(t)||!Nd(n)}function ji(e){return Rp(e)||Dk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dk(e){return Ay(e.x)||Ay(e.y)}function Ay(e){return e&&e!=="0%"}function qc(e,t,n){const r=e-n,i=t*r;return n+i}function Ry(e,t,n,r,i){return i!==void 0&&(e=qc(e,i,r)),qc(e,n,r)+t}function Pp(e,t=0,n=1,r,i){e.min=Ry(e.min,t,n,r,i),e.max=Ry(e.max,t,n,r,i)}function Ik(e,{x:t,y:n}){Pp(e.x,t.translate,t.scale,t.originPoint),Pp(e.y,n.translate,n.scale,n.originPoint)}const Py=.999999999999,My=1.0000000000001;function W3(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Fs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ik(e,o)),r&&ji(s.latestValues)&&Fs(e,s.latestValues))}t.x<My&&t.x>Py&&(t.x=1),t.y<My&&t.y>Py&&(t.y=1)}function Ls(e,t){e.min=e.min+t,e.max=e.max+t}function Oy(e,t,n,r,i=.5){const s=qe(e.min,e.max,i);Pp(e,t,n,s,r)}function Fs(e,t){Oy(e.x,t.x,t.scaleX,t.scale,t.originX),Oy(e.y,t.y,t.scaleY,t.scale,t.originY)}function Lk(e,t){return Mk(F3(e.getBoundingClientRect(),t))}function q3(e,t,n){const r=Lk(e,n),{scroll:i}=t;return i&&(Ls(r.x,i.offset.x),Ls(r.y,i.offset.y)),r}const Fk=({current:e})=>e?e.ownerDocument.defaultView:null,Ny=(e,t)=>Math.abs(e-t);function G3(e,t){const n=Ny(e.x,t.x),r=Ny(e.y,t.y);return Math.sqrt(n**2+r**2)}class Bk{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const c=Id(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=G3(c.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:y}=c,{timestamp:x}=wt;this.history.push({...y,timestamp:x});const{onStart:w,onMove:h}=this.handlers;f||(w&&w(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=Dd(f,this.transformPagePoint),Le.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Id(c.type==="pointercancel"?this.lastMoveEventInfo:Dd(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(c,w),y&&y(c,w)},!km(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=sl(t),a=Dd(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=wt;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Id(a,this.history)),this.removeListeners=il(la(this.contextWindow,"pointermove",this.handlePointerMove),la(this.contextWindow,"pointerup",this.handlePointerUp),la(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pi(this.updatePoint)}}function Dd(e,t){return t?{point:t(e.point)}:e}function Dy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Id({point:e},t){return{point:e,delta:Dy(e,$k(t)),offset:Dy(e,Y3(t)),velocity:Q3(t,.1)}}function Y3(e){return e[0]}function $k(e){return e[e.length-1]}function Q3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=$k(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>rr(t)));)n--;if(!r)return{x:0,y:0};const s=ir(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function K3(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qe(n,e,r.max):Math.min(e,n)),e}function Iy(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function X3(e,{top:t,left:n,bottom:r,right:i}){return{x:Iy(e.x,n,i),y:Iy(e.y,t,r)}}function Ly(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Z3(e,t){return{x:Ly(e.x,t.x),y:Ly(e.y,t.y)}}function J3(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=Na(t.min,t.max-r,e.min):r>i&&(n=Na(e.min,e.max-i,t.min)),jr(0,1,n)}function eR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Mp=.35;function tR(e=Mp){return e===!1?e=0:e===!0&&(e=Mp),{x:Fy(e,"left","right"),y:Fy(e,"top","bottom")}}function Fy(e,t,n){return{min:By(e,t),max:By(e,n)}}function By(e,t){return typeof e=="number"?e:e[t]||0}const nR=new WeakMap;class rR{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=et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(sl(d).point)},s=(d,c)=>{const{drag:f,dragPropagation:m,onDragStart:y}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Jj(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),hn(w=>{let h=this.getAxisMotionValue(w).get()||0;if(or.test(h)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[w];b&&(h=Dt(b)*(parseFloat(h)/100))}}this.originPoint[w]=h}),y&&Le.postRender(()=>y(d,c)),xp(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(d,c)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:y,onDrag:x}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:w}=c;if(m&&this.currentDirection===null){this.currentDirection=iR(w),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",c.point,w),this.updateAxis("y",c.point,w),this.visualElement.render(),x&&x(d,c)},a=(d,c)=>this.stop(d,c),l=()=>hn(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)==null?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Bk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Fk(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Le.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Dl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=K3(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ns(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=X3(r.layoutBox,t):this.constraints=!1,this.elastic=tR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&hn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=eR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ns(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=q3(r,i.root,this.visualElement.getTransformPagePoint());let o=Z3(i.layout.layoutBox,s);if(n){const a=n(L3(o));this.hasMutatedConstraints=!!a,a&&(o=Mk(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=hn(d=>{if(!Dl(d,n,this.currentDirection))return;let c=l&&l[d]||{};o&&(c={min:0,max:0});const f=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...c};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return xp(this.visualElement,t),r.start(Um(t,r,0,n,this.visualElement,!1))}stopAnimation(){hn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){hn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){hn(n=>{const{drag:r}=this.getProps();if(!Dl(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-qe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ns(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};hn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=J3({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),hn(o=>{if(!Dl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(qe(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;nR.set(this.visualElement,this);const t=this.visualElement.current,n=la(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ns(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Le.read(r);const o=Va(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(hn(d=>{const c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Mp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Dl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function iR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class sR extends wi{constructor(t){super(t),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new rR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const $y=e=>(t,n)=>{e&&Le.postRender(()=>e(t,n))};class oR extends wi{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(t){this.session=new Bk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fk(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:$y(t),onStart:$y(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Le.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=la(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ic={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function zy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $o={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(me.test(e))e=parseFloat(e);else return e;const n=zy(e,t.target.x),r=zy(e,t.target.y);return`${n}% ${r}%`}},aR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hi.parse(e);if(i.length>5)return r;const s=hi.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=qe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class lR extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;TA(cR),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ic.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Le.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),bm.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zk(e){const[t,n]=Tb(),r=g.useContext(um);return p.jsx(lR,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(Bb),isPresent:t,safeToRemove:n})}const cR={borderRadius:{...$o,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$o,borderTopRightRadius:$o,borderBottomLeftRadius:$o,borderBottomRightRadius:$o,boxShadow:aR};function uR(e,t,n){const r=At(e)?e:Ia(e);return r.start(Um("",r,t,n)),r.animation}function dR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const fR=(e,t)=>e.depth-t.depth;class pR{constructor(){this.children=[],this.isDirty=!1}add(t){pm(this.children,t),this.isDirty=!0}remove(t){hm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fR),this.isDirty=!1,this.children.forEach(t)}}function hR(e,t){const n=sr.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(pi(r),e(s-t))};return Le.read(r,!0),()=>pi(r)}const Vk=["TopLeft","TopRight","BottomLeft","BottomRight"],mR=Vk.length,Vy=e=>typeof e=="string"?parseFloat(e):e,Uy=e=>typeof e=="number"||me.test(e);function gR(e,t,n,r,i,s){i?(e.opacity=qe(0,n.opacity??1,vR(r)),e.opacityExit=qe(t.opacity??1,0,yR(r))):s&&(e.opacity=qe(t.opacity??1,n.opacity??1,r));for(let o=0;o<mR;o++){const a=`border${Vk[o]}Radius`;let l=Hy(t,a),u=Hy(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Uy(l)===Uy(u)?(e[a]=Math.max(qe(Vy(l),Vy(u),r),0),(or.test(u)||or.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=qe(t.rotate||0,n.rotate||0,r))}function Hy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const vR=Uk(0,.5,ok),yR=Uk(.5,.95,Sn);function Uk(e,t,n){return r=>r<e?0:r>t?1:n(Na(e,t,r))}function Wy(e,t){e.min=t.min,e.max=t.max}function fn(e,t){Wy(e.x,t.x),Wy(e.y,t.y)}function qy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Gy(e,t,n,r,i){return e-=t,e=qc(e,1/n,r),i!==void 0&&(e=qc(e,1/i,r)),e}function xR(e,t=0,n=1,r=.5,i,s=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=qe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=qe(s.min,s.max,r);e===s&&(a-=t),e.min=Gy(e.min,t,n,a,i),e.max=Gy(e.max,t,n,a,i)}function Yy(e,t,[n,r,i],s,o){xR(e,t[n],t[r],t[i],t.scale,s,o)}const wR=["x","scaleX","originX"],bR=["y","scaleY","originY"];function Qy(e,t,n,r){Yy(e.x,t,wR,n?n.x:void 0,r?r.x:void 0),Yy(e.y,t,bR,n?n.y:void 0,r?r.y:void 0)}function Ky(e){return e.translate===0&&e.scale===1}function Hk(e){return Ky(e.x)&&Ky(e.y)}function Xy(e,t){return e.min===t.min&&e.max===t.max}function kR(e,t){return Xy(e.x,t.x)&&Xy(e.y,t.y)}function Zy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Wk(e,t){return Zy(e.x,t.x)&&Zy(e.y,t.y)}function Jy(e){return Dt(e.x)/Dt(e.y)}function e0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class SR{constructor(){this.members=[]}add(t){pm(this.members,t),t.scheduleRender()}remove(t){if(hm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(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);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.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 CR(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:c,rotateY:f,skewX:m,skewY:y}=n;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) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ld=["","X","Y","Z"],_R={visibility:"hidden"},t0=1e3;let TR=0;function Fd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Jb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Le,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qk(r)}function Gk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=TR++,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,this.nodes.forEach(AR),this.nodes.forEach(NR),this.nodes.forEach(DR),this.nodes.forEach(RR)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new pR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new gm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=dR(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let c;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,c&&c(),c=hR(f,250),ic.hasAnimatedSinceResize&&(ic.hasAnimatedSinceResize=!1,this.nodes.forEach(r0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||$R,{onLayoutAnimationStart:w,onLayoutAnimationComplete:h}=d.getProps(),v=!this.targetLayout||!Wk(this.targetLayout,y),b=!f&&m;if(this.options.layoutRoot||this.resumeFrom||b||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(c,b);const T={...xm(x,"layout"),onPlay:w,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else f||r0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pi(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(IR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const c=this.path[d];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(n0);return}this.isUpdating||this.nodes.forEach(MR),this.isUpdating=!1,this.nodes.forEach(OR),this.nodes.forEach(ER),this.nodes.forEach(jR),this.clearAllSnapshots();const a=sr.now();wt.delta=jr(0,1e3/60,a-wt.timestamp),wt.timestamp=a,wt.isProcessing=!0,jd.update.process(wt),jd.preRender.process(wt),jd.render.process(wt),wt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,bm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(PR),this.sharedNodes.forEach(LR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Hk(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&(a||ji(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),zR(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return et();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(VR))){const{scroll:d}=this.root;d&&(Ls(a.x,d.offset.x),Ls(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=et();if(fn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:c,options:f}=d;d!==this.root&&c&&f.layoutScroll&&(c.wasRoot&&fn(a,o),Ls(a.x,c.offset.x),Ls(a.y,c.offset.y))}return a}applyTransform(o,a=!1){const l=et();fn(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Fs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ji(d.latestValues)&&Fs(l,d.latestValues)}return ji(this.latestValues)&&Fs(l,this.latestValues),l}removeTransform(o){const a=et();fn(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!ji(u.latestValues))continue;Rp(u.latestValues)&&u.updateSnapshot();const d=et(),c=u.measurePageBox();fn(d,c),Qy(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return ji(this.latestValues)&&Qy(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var f;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:c}=this.options;if(!(!this.layout||!(d||c))){if(this.resolvedRelativeTargetAt=wt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),ua(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=et(),this.targetWithTransforms=et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),H3(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):fn(this.target,this.layout.layoutBox),Ik(this.target,this.targetDelta)):fn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),ua(this.relativeTargetOrigin,this.target,m.target),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Rp(this.parent.latestValues)||Dk(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 y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===wt.timestamp&&(l=!1),l)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;fn(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,f=this.treeScale.y;W3(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=et());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(qy(this.prevProjectionDelta.x,this.projectionDelta.x),qy(this.prevProjectionDelta.y,this.projectionDelta.y)),ca(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==f||!e0(this.projectionDelta.x,this.prevProjectionDelta.x)||!e0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Is(),this.projectionDelta=Is(),this.projectionDeltaWithTransform=Is()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},c=Is();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=et(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,x=m!==y,w=this.getStack(),h=!w||w.members.length<=1,v=!!(x&&!h&&this.options.crossfade===!0&&!this.path.some(BR));this.animationProgress=0;let b;this.mixTargetDelta=T=>{const C=T/1e3;i0(c.x,o.x,C),i0(c.y,o.y,C),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ua(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),FR(this.relativeTarget,this.relativeTargetOrigin,f,C),b&&kR(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=et()),fn(b,this.relativeTarget)),x&&(this.animationValues=d,gR(d,u,this.latestValues,C,v,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Le.update(()=>{ic.hasAnimatedSinceResize=!0,this.currentAnimation=uR(0,t0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(t0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Yk(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||et();const c=Dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+c;const f=Dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}fn(a,l),Fs(a,d),ca(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new SR),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Fd("z",o,u,this.animationValues);for(let d=0;d<Ld.length;d++)Fd(`rotate${Ld[d]}`,o,u,this.animationValues),Fd(`skew${Ld[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return _R;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=rc(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=rc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ji(this.latestValues)&&(m.transform=l?l({},""):"none",this.hasProjected=!1),m}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=CR(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:c,y:f}=this.projectionDelta;a.transformOrigin=`${c.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in Fa){if(d[m]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:w}=Fa[m],h=a.transform==="none"?d[m]:y(d[m],u);if(x){const v=x.length;for(let b=0;b<v;b++)a[x[b]]=h}else w?this.options.visualElement.renderState.vars[m]=h:a[m]=h}return this.options.layoutId&&(a.pointerEvents=u===this?rc(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(n0),this.root.sharedNodes.clear()}}}function ER(e){e.updateLayout()}function jR(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?hn(c=>{const f=o?t.measuredBox[c]:t.layoutBox[c],m=Dt(f);f.min=r[c].min,f.max=f.min+m}):Yk(s,t.layoutBox,r)&&hn(c=>{const f=o?t.measuredBox[c]:t.layoutBox[c],m=Dt(r[c]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+m)});const a=Is();ca(a,r,t.layoutBox);const l=Is();o?ca(l,e.applyTransform(i,!0),t.measuredBox):ca(l,r,t.layoutBox);const u=!Hk(a);let d=!1;if(!e.resumeFrom){const c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:f,layout:m}=c;if(f&&m){const y=et();ua(y,t.layoutBox,f.layoutBox);const x=et();ua(x,r,m.layoutBox),Wk(y,x)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=y,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function AR(e){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 RR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function PR(e){e.clearSnapshot()}function n0(e){e.clearMeasurements()}function MR(e){e.isLayoutDirty=!1}function OR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function r0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function NR(e){e.resolveTargetDelta()}function DR(e){e.calcProjection()}function IR(e){e.resetSkewAndRotation()}function LR(e){e.removeLeadSnapshot()}function i0(e,t,n){e.translate=qe(t.translate,0,n),e.scale=qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function s0(e,t,n,r){e.min=qe(t.min,n.min,r),e.max=qe(t.max,n.max,r)}function FR(e,t,n,r){s0(e.x,t.x,n.x,r),s0(e.y,t.y,n.y,r)}function BR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $R={duration:.45,ease:[.4,0,.1,1]},o0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),a0=o0("applewebkit/")&&!o0("chrome/")?Math.round:Sn;function l0(e){e.min=a0(e.min),e.max=a0(e.max)}function zR(e){l0(e.x),l0(e.y)}function Yk(e,t,n){return e==="position"||e==="preserve-aspect"&&!U3(Jy(t),Jy(n),.2)}function VR(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const UR=Gk({attachResizeListener:(e,t)=>Va(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Bd={current:void 0},Qk=Gk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Bd.current){const e=new UR({});e.mount(window),e.setOptions({layoutScroll:!0}),Bd.current=e}return Bd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),HR={pan:{Feature:oR},drag:{Feature:sR,ProjectionNode:Qk,MeasureLayout:zk}};function c0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Le.postRender(()=>s(t,sl(t)))}class WR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=tA(t,(n,r)=>(c0(this.node,r,"Start"),i=>c0(this.node,i,"End"))))}unmount(){}}class qR extends wi{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=il(Va(this.node.current,"focus",()=>this.onFocus()),Va(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function u0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Le.postRender(()=>s(t,sl(t)))}class GR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=sA(t,(n,r)=>(u0(this.node,r,"Start"),(i,{success:s})=>u0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Op=new WeakMap,$d=new WeakMap,YR=e=>{const t=Op.get(e.target);t&&t(e)},QR=e=>{e.forEach(YR)};function KR({root:e,...t}){const n=e||document;$d.has(n)||$d.set(n,{});const r=$d.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(QR,{root:e,...t})),r[i]}function XR(e,t,n){const r=KR(t);return Op.set(e,n),r.observe(e),()=>{Op.delete(e),r.unobserve(e)}}const ZR={some:0,all:1};class JR extends wi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:ZR[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return XR(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eP(t,n))&&this.startObserver()}unmount(){}}function eP({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tP={inView:{Feature:JR},tap:{Feature:GR},focus:{Feature:qR},hover:{Feature:WR}},nP={layout:{ProjectionNode:Qk,MeasureLayout:zk}},Np={current:null},Kk={current:!1};function rP(){if(Kk.current=!0,!!dm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Np.current=e.matches;e.addListener(t),t()}else Np.current=!1}const iP=[...bk,Et,hi],sP=e=>iP.find(wk(e)),oP=new WeakMap;function aP(e,t,n){for(const r in t){const i=t[r],s=n[r];if(At(i))e.addValue(r,i);else if(At(s))e.addValue(r,Ia(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Ia(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const d0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=$m,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=()=>{const m=sr.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Le.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Tu(n),this.isVariantNode=Lb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const y=f[m];l[m]!==void 0&&At(y)&&y.set(l[m],!1)}}mount(t){this.current=t,oP.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((n,r)=>this.bindToMotionValue(r,n)),Kk.current||rP(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Np.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pi(this.notifyUpdate),pi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ls.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.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 mo){const n=mo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<d0.length;r++){const i=d0[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=aP(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){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ia(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(yk(r)||lk(r))?r=parseFloat(r):!sP(r)&&hi.test(n)&&(r=mk(t,n)),this.setBaseTarget(t,At(r)?r.get():r)),At(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Nm(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!At(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new gm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Xk extends lP{constructor(){super(...arguments),this.KeyframeResolver=kk}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;At(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function cP(e){return window.getComputedStyle(e)}class uP extends Xk{constructor(){super(...arguments),this.type="html",this.renderInstance=Yb}readValueFromInstance(t,n){if(ls.has(n))return S5(t,n);{const r=cP(t),i=(Tm(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Lk(t,n)}build(t,n,r){Am(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Dm(t,n,r)}}class dP extends Xk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=et,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Gb(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ls.has(n)){const r=hk(n);return r&&r.default||0}return n=Qb.has(n)?n:_m(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Xb(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Le.postRender(this.updateDimensions)}build(t,n,r){Mm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Kb(t,n,r,i)}mount(t){this.isSVGTag=Om(t.tagName),super.mount(t)}}const fP=(e,t)=>Pm(e)?new dP(t):new uP(t,{allowProjection:e!==g.Fragment}),pP=KA({...D3,...tP,...HR,...nP},fP),Pe=fA(pP);class hP{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const mP=()=>new hP;function gP(){return ku(mP)}var Br=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Br||{});const Zk=g.createContext({}),vP={[J.TooltipDefault]:"Bizimle sohbet edin!",[J.TooltipActive]:"Yeni mesajlar var!",[J.CloseButtonAria]:"Kapat",[J.MessagePlaceholder]:"Mesajınızı yazın",[J.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[J.NewMessagesNotification]:"Yeni mesajlar var!",[J.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[J.ChatCloseWarning]:"Bu işlem geri alınamaz.",[J.ChatSettings]:"Sohbet Ayarları",[J.ChatEndConversation]:"Sohbeti Sonlandır",[J.CancelAction]:"Vazgeç",[J.CloseAction]:"Kapat",[J.QuickActions]:"Hızlı işlemler",[J.GreetingStartChat]:"Sohbete başla",[J.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[J.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[J.RatingHeaderThanks]:"Teşekkürler!",[J.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[J.RatingRateConversation]:"Görüşmeyi puanlayın",[J.RatingComment]:"Yorumunuz (İsteğe bağlı)",[J.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[J.RatingSubmit]:"Değerlendirmeyi Gönder",[J.RatingNewConversation]:"Yeni Görüşme Başlat",[J.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[J.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[J.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[J.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[J.RatingYourScore]:"Puanınız: {score}",[J.PoweredBy]:"Powered by",[J.NotificationSoundOn]:"Bildirim sesi aç",[J.NotificationSoundOff]:"Bildirim sesi kapat"},yP={[k.Background]:"#ffffff",[k.Border]:"#e2e8f0",[k.TooltipText]:"#1e40af",[k.TooltipBackground]:"#dbeafe",[k.TooltipBorder]:"#3b82f6",[k.HeaderBackground]:"#ffffff",[k.HeaderBorder]:"#e2e8f0",[k.HeaderText]:"#1e293b",[k.FooterBackground]:"#f8fafc",[k.FooterBorder]:"#e2e8f0",[k.FooterText]:"#475569",[k.MessageAdminBackground]:"#f1f5f9",[k.MessageAdminText]:"#334155",[k.MessageVisitorBackground]:"#3b82f6",[k.MessageVisitorText]:"#ffffff",[k.MessageAgentBackground]:"#ede9fe",[k.MessageAgentText]:"#5b21b6",[k.GreeterBackground]:"#ffffff",[k.GreeterText]:"#334155",[k.GreeterBorder]:"#e2e8f0",[k.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[k.GreeterTopText]:"#ffffff",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#f8fafc",[k.InputText]:"#1e293b",[k.InputBorder]:"#e2e8f0",[k.CloseButtonBackground]:"#f1f5f9",[k.CloseButtonText]:"#475569",[k.CloseButtonHover]:"#e2e8f0",[k.IconColor]:"#64748b",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#fef2f2",[k.ErrorText]:"#dc2626",[k.ErrorBorder]:"#fca5a5",[k.SuccessBackground]:"#f0fdf4",[k.SuccessText]:"#16a34a",[k.SuccessBorder]:"#86efac",[k.WarningBackground]:"#fffbeb",[k.WarningText]:"#d97706",[k.WarningBorder]:"#fcd34d",[k.LinkColor]:"#2563eb",[k.LinkHoverColor]:"#1d4ed8",[k.DividerColor]:"#e2e8f0",[k.ShadowColor]:"rgba(0, 0, 0, 0.1)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#e2e8f0",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[k.ChatCloseConfirmText]:"#dc2626",[k.RatingHeaderBackground]:"#3b82f6",[k.RatingHeaderText]:"#ffffff",[k.RatingSuccessBackground]:"#ffffff",[k.RatingSuccessText]:"#334155",[k.RatingRateConversationText]:"#1e293b"},xP={[k.Background]:"#0a0a0a",[k.Border]:"#262626",[k.TooltipText]:"#e5e5e5",[k.TooltipBackground]:"#262626",[k.TooltipBorder]:"#404040",[k.HeaderBackground]:"#171717",[k.HeaderBorder]:"#262626",[k.HeaderText]:"#fafafa",[k.FooterBackground]:"#0a0a0a",[k.FooterBorder]:"#262626",[k.FooterText]:"#a3a3a3",[k.MessageAdminBackground]:"#262626",[k.MessageAdminText]:"#e5e5e5",[k.MessageVisitorBackground]:"#171717",[k.MessageVisitorText]:"#e5e5e5",[k.MessageAgentBackground]:"#5b21b6",[k.MessageAgentText]:"#e9d5ff",[k.GreeterBackground]:"#171717",[k.GreeterText]:"#e5e5e5",[k.GreeterBorder]:"#262626",[k.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[k.GreeterTopText]:"#fafafa",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#171717",[k.InputText]:"#e5e5e5",[k.InputBorder]:"#262626",[k.CloseButtonBackground]:"#262626",[k.CloseButtonText]:"#a3a3a3",[k.CloseButtonHover]:"#404040",[k.IconColor]:"#a3a3a3",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#450a0a",[k.ErrorText]:"#fca5a5",[k.ErrorBorder]:"#7f1d1d",[k.SuccessBackground]:"#052e16",[k.SuccessText]:"#86efac",[k.SuccessBorder]:"#14532d",[k.WarningBackground]:"#451a03",[k.WarningText]:"#fcd34d",[k.WarningBorder]:"#78350f",[k.LinkColor]:"#3b82f6",[k.LinkHoverColor]:"#60a5fa",[k.DividerColor]:"#262626",[k.ShadowColor]:"rgba(0, 0, 0, 0.4)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#404040",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[k.ChatCloseConfirmText]:"#fca5a5",[k.RatingHeaderBackground]:"#171717",[k.RatingHeaderText]:"#fafafa",[k.RatingSuccessBackground]:"#171717",[k.RatingSuccessText]:"#e5e5e5",[k.RatingRateConversationText]:"#e5e5e5"},wP={[Br.None]:"0px",[Br.Sm]:"var(--radius-sm)",[Br.Md]:"var(--radius-md)",[Br.Lg]:"var(--radius-lg)",[Br.Xl]:"var(--radius-lg)",[Br.Full]:"calc(infinity * 1px)"},bP=e=>{const t={...vP};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.texts)return t;for(const n in e.appearance.design.texts){const r=n;e.appearance.design.texts[r]&&(t[r]=e.appearance.design.texts[r])}return t};function kP(e,t){const n=e.replace(/^#/,"");if(n.length!==6)return e;const r=Math.max(0,Math.round(Number.parseInt(n.slice(0,2),16)*(1-t))),i=Math.max(0,Math.round(Number.parseInt(n.slice(2,4),16)*(1-t))),s=Math.max(0,Math.round(Number.parseInt(n.slice(4,6),16)*(1-t)));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}const f0="#ffffff";function SP(e){const t=kP(e,.2);return{[k.ButtonBackground]:t,[k.ButtonText]:f0,[k.MessageVisitorBackground]:t,[k.MessageVisitorText]:f0}}const CP=(e,t)=>{var i,s;const r={...t==="dark"?xP:yP};if(t==="dark")return r;if((s=(i=e==null?void 0:e.appearance)==null?void 0:i.design)!=null&&s.colors){const o=e.appearance.design.colors,a=o.main_color;if(a){const l=SP(a);for(const u of Object.keys(l))l[u]&&(r[u]=l[u])}for(const l in o){if(l==="main_color"||l==="secondary_color"||l==="accent_color")continue;const u=l;o[l]&&l in r&&(r[u]=o[l])}}return r},Jk="lc:theme:mode";function _P(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function TP(){try{const e=localStorage.getItem(Jk);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Ne.System}function EP({children:e,widget:t}){const[n,r]=g.useState(TP),[i,s]=g.useState(_P);g.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),x=w=>{s(w.matches?"dark":"light")};return y.addEventListener("change",x),()=>y.removeEventListener("change",x)},[]);const o=n===Ne.System?i:n,a=g.useCallback(y=>{r(y);try{localStorage.setItem(Jk,y)}catch{}},[]),l=CP(t,o),u=bP(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Br.Md,c=y=>l[y],f=y=>u[y],m=()=>wP[d];return p.jsx(Zk.Provider,{value:{colors:l,texts:u,getColor:c,getText:f,getRadius:m,mode:n,resolvedMode:o,setMode:a},children:e})}const je=()=>g.useContext(Zk),cs=()=>je().getText;function Rt({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,style:l,textKey:u=k.ButtonText,bgKey:d=k.ButtonBackground,animations:c={},withoutTheming:f,...m}){const y=je();return p.jsx(Pe.button,{type:t,className:ze("flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-0 font-medium transition-opacity",{"rounded-full":o&&i!=="xs","rounded-lg":!o,"opacity-50 cursor-not-allowed":s,"hover:opacity-90 active:opacity-95":!s},a,Gv[n]&&Gv[n][r],Fj[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!f&&{color:y.getColor(u),backgroundColor:y.getColor(d),...o?{}:{borderRadius:y.getRadius()}},...l},...c,...m,children:e})}function Y(){}Y.Home=function(t){return p.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:p.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};Y.Chat=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});Y.Menu=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});Y.MessageTyping=({className:e="size-5",...t})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});Y.Check=function(t){return p.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:p.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};Y.Website=function(t){return p.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[p.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),p.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),p.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};Y.ArrowDown=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});Y.ArrowDown2=e=>p.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:[p.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:1.5}),p.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),p.jsx("g",{id:"SVGRepo_iconCarrier",children:p.jsx("path",{d:"M903.232 256l56.768 50.432L512 768 64 306.432 120.768 256 512 659.072z",fill:"currentColor"})})]});Y.ArrowLeft=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})});Y.XCircle=({className:e="e-5",...t})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});Y.X=({className:e="e-5",...t})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});Y.PaperAirplane=({className:e="e-5",...t})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});Y.Spin=function(t){return p.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:p.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};Y.ExternalLink=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})});Y.Phone=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"})});Y.Mail=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})});Y.Star=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})});Y.Plus=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})});Y.History=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});Y.Eye=e=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:[p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});Y.Lock=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})});Y.User=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})});Y.Emoji=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.182 15.182a4.5 4.5 0 0 1-6.364 0M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Z"})});Y.Paperclip=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})});Y.Sparkles=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})});Y.Sun=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75v-2.25m-4.773 4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})});Y.Moon=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})});Y.Monitor=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})});Y.Volume2=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});Y.VolumeX=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75 19.5 12m0 0 2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6 4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});Y.Bot=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})});function Dp(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var rt=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e.AIAgentMode="lc:agent:mode",e.AIAgent="lc:agent:data",e.AIAgentSessionId="lc:agent:session",e.HumanNeedRequested="lc:agent:human_need",e))(rt||{});const Ln=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},Ko=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},da=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),Hm(e)},eS=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},Il=(e,t,n,r,i)=>{const s=`${e}:`;t&&(n||i)?(localStorage.setItem(`${s}lc:agent:mode`,"true"),localStorage.setItem(`${s}lc:agent:data`,JSON.stringify(t)),r&&localStorage.setItem(`${s}lc:agent:session`,r),i!==void 0&&(i?localStorage.setItem(`${s}lc:agent:human_need`,"true"):localStorage.removeItem(`${s}lc:agent:human_need`))):Hm(e)},mr=e=>{const t=`${e}:`,n=localStorage.getItem(`${t}lc:agent:mode`)==="true",r=localStorage.getItem(`${t}lc:agent:data`),i=localStorage.getItem(`${t}lc:agent:session`),s=localStorage.getItem(`${t}lc:agent:human_need`)==="true";let o=null;if(r)try{o=JSON.parse(r)}catch{o=null}return{isAgentMode:n,agent:o,sessionId:i,humanNeedRequested:s}},Hm=e=>{const t=`${e}:`;localStorage.removeItem(`${t}lc:agent:mode`),localStorage.removeItem(`${t}lc:agent:data`),localStorage.removeItem(`${t}lc:agent:session`),localStorage.removeItem(`${t}lc:agent:human_need`)},mi=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=Dp(),localStorage.setItem(t,n)),n},jP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},p0=e=>{let t;const n=new Set,r=(d,c)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const m=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(jP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,i,l);return l},AP=e=>e?p0(e):p0;var tS={exports:{}},nS={},rS={exports:{}},iS={};/**
70
+ `),()=>{document.head.removeChild(m)}},[t]),f.jsx(Bj,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const zj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=bu(Vj),c=v.useId();let d=!0,u=v.useMemo(()=>(d=!1,{id:c,initial:t,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;r&&r()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,r]);return s&&d&&(u={...u}),v.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx($j,{isPresent:n,anchorX:a,children:e})),f.jsx(ku.Provider,{value:u,children:e})};function Vj(){return new Map}function Tb(e=!0){const t=v.useContext(ku);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=v.useId();v.useEffect(()=>{if(e)return i(s)},[e]);const o=v.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ml=e=>e.key||"";function Gv(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const lr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Tb(o),d=v.useMemo(()=>Gv(e),[e]),u=o&&!l?[]:d.map(Ml),p=v.useRef(!0),m=v.useRef(d),y=bu(()=>new Map),[x,w]=v.useState(d),[h,g]=v.useState(d);_b(()=>{p.current=!1,m.current=d;for(let _=0;_<h.length;_++){const E=Ml(h[_]);u.includes(E)?y.delete(E):y.get(E)!==!0&&y.set(E,!1)}},[h,u.length,u.join("-")]);const b=[];if(d!==x){let _=[...d];for(let E=0;E<h.length;E++){const S=h[E],A=Ml(S);u.includes(A)||(_.splice(E,0,S),b.push(S))}return s==="wait"&&b.length&&(_=b),g(Gv(_)),w(d),null}const{forceRender:T}=v.useContext(cm);return f.jsx(f.Fragment,{children:h.map(_=>{const E=Ml(_),S=o&&!l?!1:d===h||u.includes(E),A=()=>{if(y.has(E))y.set(E,!0);else return;let B=!0;y.forEach(L=>{L||(B=!1)}),B&&(T==null||T(),g(m.current),o&&(c==null||c()),r&&r())};return f.jsx(zj,{isPresent:S,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:S?void 0:A,anchorX:a,children:_},E)})})};function fm(e,t){e.indexOf(t)===-1&&e.push(t)}function pm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let hp=()=>{};const mp={skipAnimations:!1,useManualTiming:!1};function hm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Sn=e=>e,Na=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class mm{constructor(){this.subscriptions=[]}add(t){return fm(this.subscriptions,t),()=>pm(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rr=e=>e*1e3,ir=e=>e/1e3;function Eb(e,t){return t?e*(1e3/t):0}const Uj=hm(()=>window.ScrollTimeline!==void 0);class Hj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Uj()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].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 n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Wj extends Hj{then(t,n){return this.finished.finally(t).then(()=>{})}}const Yv={value:null,addProjectionMetrics:null},gm=e=>Array.isArray(e)&&typeof e[0]=="number",qj={};function Gj(e,t){const n=hm(e);return()=>qj[t]??n()}const Da=Gj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),jb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Yo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,gp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Yo([0,.65,.55,1]),circOut:Yo([.55,0,1,.45]),backIn:Yo([.31,.01,.66,-.59]),backOut:Yo([.33,1.53,.69,.99])};function Ab(e,t){if(e)return typeof e=="function"&&Da()?jb(e,t):gm(e)?Yo(e):Array.isArray(e)?e.map(n=>Ab(n,t)||gp.easeOut):gp[e]}function Yj(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const u=Ab(a,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function vm(e){return typeof e=="function"&&"applyToOptions"in e}function ym(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const $c=2e4;function xm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<$c;)t+=n,r=e.next(t);return t>=$c?1/0:t}function Qj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(xm(r),$c);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:ir(i)}}function Rb(e){return!!(typeof e=="function"&&Da()||!e||typeof e=="string"&&(e in gp||Da())||gm(e)||Array.isArray(e)&&e.every(Rb))}function Qv(e,t){e.timeline=t,e.onfinish=null}const Ol=["read","resolveKeyframes","update","preRender","render","postRender"];function Kj(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(u){o.has(u)&&(d.schedule(u),e()),l++,u(a)}const d={schedule:(u,p=!1,m=!1)=>{const x=m&&i?n:r;return p&&o.add(u),x.has(u)||x.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&Yv.value&&Yv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const Xj=40;function Pb(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ol.reduce((h,g)=>(h[g]=Kj(s,t?g:void 0),h),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=o,m=()=>{const h=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(h-i.timestamp,Xj),1),i.timestamp=h,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:Ol.reduce((h,g)=>{const b=o[g];return h[g]=(T,_=!1,E=!1)=>(n||y(),b.schedule(T,_,E)),h},{}),cancel:h=>{for(let g=0;g<Ol.length;g++)o[Ol[g]].cancel(h)},state:i,steps:o}}const{schedule:wm,cancel:z6}=Pb(queueMicrotask,!1),{schedule:Le,cancel:pi,state:wt,steps:Ed}=Pb(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0);let nc;function Zj(){nc=void 0}const sr={now:()=>(nc===void 0&&sr.set(wt.isProcessing||mp.useManualTiming?wt.timestamp:performance.now()),nc),set:e=>{nc=e,queueMicrotask(Zj)}},Rn={x:!1,y:!1};function Mb(){return Rn.x||Rn.y}function Jj(e){return e==="x"||e==="y"?Rn[e]?null:(Rn[e]=!0,()=>{Rn[e]=!1}):Rn.x||Rn.y?null:(Rn.x=Rn.y=!0,()=>{Rn.x=Rn.y=!1})}function eA(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Ob(e,t){const n=eA(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Kv(e){return!(e.pointerType==="touch"||Mb())}function tA(e,t,n={}){const[r,i,s]=Ob(e,n),o=a=>{if(!Kv(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{Kv(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Nb=(e,t)=>t?e===t?!0:Nb(e,t.parentElement):!1,bm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,nA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function rA(e){return nA.has(e.tagName)||e.tabIndex!==-1}const Qo=new WeakSet;function Xv(e){return t=>{t.key==="Enter"&&e(t)}}function jd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const iA=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Xv(()=>{if(Qo.has(n))return;jd(n,"down");const i=Xv(()=>{jd(n,"up")}),s=()=>jd(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Zv(e){return bm(e)&&!Mb()}function sA(e,t,n={}){const[r,i,s]=Ob(e,n),o=a=>{const l=a.currentTarget;if(!Zv(a)||Qo.has(l))return;Qo.add(l);const c=t(l,a),d=(m,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!Zv(m)||!Qo.has(l))&&(Qo.delete(l),typeof c=="function"&&c(m,{success:y}))},u=m=>{d(m,l===window||l===document||n.useGlobalTarget||Nb(l,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>iA(c,i)),!rA(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const Jv=30,oA=e=>!isNaN(parseFloat(e));class aA{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=sr.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=oA(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new mm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Le.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Jv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Jv);return Eb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ia(e,t){return new aA(e,t)}const Db=v.createContext({strict:!1}),ey={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"]},mo={};for(const e in ey)mo[e]={isEnabled:t=>ey[e].some(n=>!!t[n])};function lA(e){for(const t in e)mo[t]={...mo[t],...e[t]}}const cA=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 zc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||cA.has(e)}let Ib=e=>!zc(e);function uA(e){e&&(Ib=t=>t.startsWith("on")?!zc(t):e(t))}try{uA(require("@emotion/is-prop-valid").default)}catch{}function dA(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Ib(i)||n===!0&&zc(i)||!t&&!zc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function fA(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Su=v.createContext({});function Cu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function La(e){return typeof e=="string"||Array.isArray(e)}const km=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Sm=["initial",...km];function _u(e){return Cu(e.animate)||Sm.some(t=>La(e[t]))}function Lb(e){return!!(_u(e)||e.variants)}function pA(e,t){if(_u(e)){const{initial:n,animate:r}=e;return{initial:n===!1||La(n)?n:void 0,animate:La(r)?r:void 0}}return e.inherit!==!1?t:{}}function hA(e){const{initial:t,animate:n}=pA(e,v.useContext(Su));return v.useMemo(()=>({initial:t,animate:n}),[ty(t),ty(n)])}function ty(e){return Array.isArray(e)?e.join(" "):e}const mA=Symbol.for("motionComponentSymbol");function Ns(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gA(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ns(n)&&(n.current=r))},[t])}const Cm=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vA="framerAppearId",Fb="data-"+Cm(vA),Bb=v.createContext({});function yA(e,t,n,r,i){var x,w;const{visualElement:s}=v.useContext(Su),o=v.useContext(Db),a=v.useContext(ku),l=v.useContext(dm).reducedMotion,c=v.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=v.useContext(Bb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&xA(c.current,n,i,u);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const m=n[Fb],y=v.useRef(!!m&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,m))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,m)));return _b(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),wm.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)==null||h.call(window,m)}),y.current=!1))}),d}function xA(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:$b(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ns(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function $b(e){if(e)return e.options.allowProjection!==!1?e.projection:$b(e.parent)}function wA({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&lA(e);function s(a,l){let c;const d={...v.useContext(dm),...a,layoutId:bA(a)},{isStatic:u}=d,p=hA(a),m=r(a,u);if(!u&&um){kA();const y=SA(d);c=y.MeasureLayout,p.visualElement=yA(i,m,d,t,y.ProjectionNode)}return f.jsxs(Su.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,gA(m,p.visualElement,l),m,u,p.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=v.forwardRef(s);return o[mA]=i,o}function bA({layoutId:e}){const t=v.useContext(cm).id;return t&&e!==void 0?t+"-"+e:e}function kA(e,t){v.useContext(Db).strict}function SA(e){const{drag:t,layout:n}=mo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const zb=e=>t=>typeof t=="string"&&t.startsWith(e),_m=zb("--"),CA=zb("var(--"),Tm=e=>CA(e)?_A.test(e.split("/*")[0].trim()):!1,_A=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Fa={};function TA(e){for(const t in e)Fa[t]=e[t],_m(t)&&(Fa[t].isCSSVariable=!0)}const To=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ls=new Set(To);function Vb(e,{layout:t,layoutId:n}){return ls.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Fa[e]||e==="opacity")}const At=e=>!!(e&&e.getVelocity),Ub=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ar=(e,t,n)=>n>t?t:n<e?e:n,Eo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ba={...Eo,transform:e=>Ar(0,1,e)},Nl={...Eo,default:1},nl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Lr=nl("deg"),or=nl("%"),me=nl("px"),EA=nl("vh"),jA=nl("vw"),ny={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},AA={borderWidth:me,borderTopWidth:me,borderRightWidth:me,borderBottomWidth:me,borderLeftWidth:me,borderRadius:me,radius:me,borderTopLeftRadius:me,borderTopRightRadius:me,borderBottomRightRadius:me,borderBottomLeftRadius:me,width:me,maxWidth:me,height:me,maxHeight:me,top:me,right:me,bottom:me,left:me,padding:me,paddingTop:me,paddingRight:me,paddingBottom:me,paddingLeft:me,margin:me,marginTop:me,marginRight:me,marginBottom:me,marginLeft:me,backgroundPositionX:me,backgroundPositionY:me},RA={rotate:Lr,rotateX:Lr,rotateY:Lr,rotateZ:Lr,scale:Nl,scaleX:Nl,scaleY:Nl,scaleZ:Nl,skew:Lr,skewX:Lr,skewY:Lr,distance:me,translateX:me,translateY:me,translateZ:me,x:me,y:me,z:me,perspective:me,transformPerspective:me,opacity:Ba,originX:ny,originY:ny,originZ:me},ry={...Eo,transform:Math.round},Em={...AA,...RA,zIndex:ry,size:me,fillOpacity:Ba,strokeOpacity:Ba,numOctaves:ry},PA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},MA=To.length;function OA(e,t,n){let r="",i=!0;for(let s=0;s<MA;s++){const o=To[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Ub(a,Em[o]);if(!l){i=!1;const d=PA[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function jm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(ls.has(l)){o=!0;continue}else if(_m(l)){i[l]=c;continue}else{const d=Ub(c,Em[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=OA(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${c} ${d}`}}const Am=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hb(e,t,n){for(const r in t)!At(t[r])&&!Vb(r,n)&&(e[r]=t[r])}function NA({transformTemplate:e},t){return v.useMemo(()=>{const n=Am();return jm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function DA(e,t){const n=e.style||{},r={};return Hb(r,n,e),Object.assign(r,NA(e,t)),r}function IA(e,t){const n={},r=DA(e,t);return e.drag&&e.dragListener!==!1&&(n.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)&&(n.tabIndex=0),n.style=r,n}const LA=["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 Rm(e){return typeof e!="string"||e.includes("-")?!1:!!(LA.indexOf(e)>-1||/[A-Z]/u.test(e))}const FA={offset:"stroke-dashoffset",array:"stroke-dasharray"},BA={offset:"strokeDashoffset",array:"strokeDasharray"};function $A(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?FA:BA;e[s.offset]=me.transform(-r);const o=me.transform(t),a=me.transform(n);e[s.array]=`${o} ${a}`}function iy(e,t,n){return typeof e=="string"?e:me.transform(t+n*e)}function zA(e,t,n){const r=iy(t,e.x,e.width),i=iy(n,e.y,e.height);return`${r} ${i}`}function Pm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(jm(e,c,u),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:y}=e;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=zA(y,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&$A(p,o,a,l,!1)}const Wb=()=>({...Am(),attrs:{}}),Mm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function VA(e,t,n,r){const i=v.useMemo(()=>{const s=Wb();return Pm(s,t,Mm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Hb(s,e.style,e),i.style={...s,...i.style}}return i}function UA(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Rm(n)?VA:IA)(r,s,o,n),c=dA(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=v.useMemo(()=>At(u)?u.get():u,[u]);return v.createElement(n,{...d,children:p})}}function sy(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Om(e,t,n,r){if(typeof t=="function"){const[i,s]=sy(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=sy(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const vp=e=>Array.isArray(e),HA=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),WA=e=>vp(e)?e[e.length-1]||0:e;function rc(e){const t=At(e)?e.get():e;return HA(t)?t.toValue():t}function qA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:GA(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const qb=e=>(t,n)=>{const r=v.useContext(Su),i=v.useContext(ku),s=()=>qA(e,t,r,i);return n?s():bu(s)};function GA(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=rc(s[p]);let{initial:o,animate:a}=e;const l=_u(e),c=Lb(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const u=d?a:o;if(u&&typeof u!="boolean"&&!Cu(u)){const p=Array.isArray(u)?u:[u];for(let m=0;m<p.length;m++){const y=Om(e,p[m]);if(y){const{transitionEnd:x,transition:w,...h}=y;for(const g in h){let b=h[g];if(Array.isArray(b)){const T=d?b.length-1:0;b=b[T]}b!==null&&(i[g]=b)}for(const g in x)i[g]=x[g]}}}return i}function Nm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(At(r[o])||t.style&&At(t.style[o])||Vb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const YA={useVisualState:qb({scrapeMotionValuesFromProps:Nm,createRenderState:Am})};function Gb(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function Yb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Qb=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 Kb(e,t,n,r){Yb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Qb.has(i)?i:Cm(i),t.attrs[i])}function Xb(e,t,n){const r=Nm(e,t,n);for(const i in e)if(At(e[i])||At(t[i])){const s=To.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const oy=["x","y","width","height","cx","cy","r"],QA={useVisualState:qb({scrapeMotionValuesFromProps:Xb,createRenderState:Wb,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ls.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<oy.length;a++){const l=oy[a];e[l]!==t[l]&&(o=!0)}o&&Le.read(()=>{Gb(n,r),Le.render(()=>{Pm(r,i,Mm(n.tagName),e.transformTemplate),Kb(n,r)})})}})};function KA(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Rm(r)?QA:YA,preloadedFeatures:e,useRender:UA(i),createVisualElement:t,Component:r};return wA(o)}}function $a(e,t,n){const r=e.getProps();return Om(r,t,n!==void 0?n:r.custom,e)}const Zb=new Set(["width","height","top","left","right","bottom",...To]);function XA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ia(n))}function ZA(e,t){const n=$a(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=WA(s[o]);XA(e,o,a)}}function JA(e){return!!(At(e)&&e.add)}function yp(e,t){const n=e.getValue("willChange");if(JA(n))return n.add(t);if(!n&&mp.WillChange){const r=new mp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Jb(e){return e.props[Fb]}const ek=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,e5=1e-7,t5=12;function n5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=ek(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>e5&&++a<t5);return o}function rl(e,t,n,r){if(e===t&&n===r)return Sn;const i=s=>n5(s,0,1,e,n);return s=>s===0||s===1?s:ek(i(s),t,r)}const tk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,nk=e=>t=>1-e(1-t),rk=rl(.33,1.53,.69,.99),Dm=nk(rk),ik=tk(Dm),sk=e=>(e*=2)<1?.5*Dm(e):.5*(2-Math.pow(2,-10*(e-1))),Im=e=>1-Math.sin(Math.acos(e)),ok=nk(Im),ak=tk(Im),lk=e=>/^0[^.\s]+$/u.test(e);function r5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||lk(e):!0}const aa=e=>Math.round(e*1e5)/1e5,Lm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function i5(e){return e==null}const s5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fm=(e,t)=>n=>!!(typeof n=="string"&&s5.test(n)&&n.startsWith(e)||t&&!i5(n)&&Object.prototype.hasOwnProperty.call(n,t)),ck=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Lm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},o5=e=>Ar(0,255,e),Ad={...Eo,transform:e=>Math.round(o5(e))},Ni={test:Fm("rgb","red"),parse:ck("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Ad.transform(e)+", "+Ad.transform(t)+", "+Ad.transform(n)+", "+aa(Ba.transform(r))+")"};function a5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const xp={test:Fm("#"),parse:a5,transform:Ni.transform},Ds={test:Fm("hsl","hue"),parse:ck("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(aa(t))+", "+or.transform(aa(n))+", "+aa(Ba.transform(r))+")"},Et={test:e=>Ni.test(e)||xp.test(e)||Ds.test(e),parse:e=>Ni.test(e)?Ni.parse(e):Ds.test(e)?Ds.parse(e):xp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ni.transform(e):Ds.transform(e)},l5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function c5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Lm))==null?void 0:t.length)||0)+(((n=e.match(l5))==null?void 0:n.length)||0)>0}const uk="number",dk="color",u5="var",d5="var(",ay="${}",f5=/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 za(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(f5,l=>(Et.test(l)?(r.color.push(s),i.push(dk),n.push(Et.parse(l))):l.startsWith(d5)?(r.var.push(s),i.push(u5),n.push(l)):(r.number.push(s),i.push(uk),n.push(parseFloat(l))),++s,ay)).split(ay);return{values:n,split:a,indexes:r,types:i}}function fk(e){return za(e).values}function pk(e){const{split:t,types:n}=za(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===uk?s+=aa(i[o]):a===dk?s+=Et.transform(i[o]):s+=i[o]}return s}}const p5=e=>typeof e=="number"?0:e;function h5(e){const t=fk(e);return pk(e)(t.map(p5))}const hi={test:c5,parse:fk,createTransformer:pk,getAnimatableNone:h5},m5=new Set(["brightness","contrast","saturate","opacity"]);function g5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Lm)||[];if(!r)return e;const i=n.replace(r,"");let s=m5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const v5=/\b([a-z-]*)\(.*?\)/gu,wp={...hi,getAnimatableNone:e=>{const t=e.match(v5);return t?t.map(g5).join(" "):e}},y5={...Em,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:wp,WebkitFilter:wp},hk=e=>y5[e];function mk(e,t){let n=hk(e);return n!==wp&&(n=hi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const x5=new Set(["auto","none","0"]);function w5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!x5.has(s)&&za(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=mk(n,i)}const Di=e=>e*180/Math.PI,bp=e=>{const t=Di(Math.atan2(e[1],e[0]));return kp(t)},b5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bp,rotateZ:bp,skewX:e=>Di(Math.atan(e[1])),skewY:e=>Di(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kp=e=>(e=e%360,e<0&&(e+=360),e),ly=bp,cy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),uy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),k5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:cy,scaleY:uy,scale:e=>(cy(e)+uy(e))/2,rotateX:e=>kp(Di(Math.atan2(e[6],e[5]))),rotateY:e=>kp(Di(Math.atan2(-e[2],e[0]))),rotateZ:ly,rotate:ly,skewX:e=>Di(Math.atan(e[4])),skewY:e=>Di(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function dy(e){return e.includes("scale")?1:0}function Sp(e,t){if(!e||e==="none")return dy(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=k5,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=b5,i=a}if(!i)return dy(t);const s=r[t],o=i[1].split(",").map(C5);return typeof s=="function"?s(o):o[s]}const S5=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Sp(n,t)};function C5(e){return parseFloat(e.trim())}const fy=e=>e===Eo||e===me,_5=new Set(["x","y","z"]),T5=To.filter(e=>!_5.has(e));function E5(e){const t=[];return T5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const go={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),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:(e,{transform:t})=>Sp(t,"x"),y:(e,{transform:t})=>Sp(t,"y")};go.translateX=go.x;go.translateY=go.y;const Gi=new Set;let Cp=!1,_p=!1;function gk(){if(_p){const e=Array.from(Gi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=E5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}_p=!1,Cp=!1,Gi.forEach(e=>e.complete()),Gi.clear()}function vk(){Gi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(_p=!0)})}function j5(){vk(),gk()}class Bm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gi.add(this),Cp||(Cp=!0,Le.read(vk),Le.resolveKeyframes(gk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const yk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),A5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function R5(e){const t=A5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function xk(e,t,n=1){const[r,i]=R5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return yk(o)?parseFloat(o):o}return Tm(i)?xk(i,t,n+1):i}const wk=e=>t=>t.test(e),P5={test:e=>e==="auto",parse:e=>e},bk=[Eo,me,or,Lr,jA,EA,P5],py=e=>bk.find(wk(e));class kk extends Bm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Tm(c))){const d=xk(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Zb.has(r)||t.length!==2)return;const[i,s]=t,o=py(i),a=py(s);if(o!==a)if(fy(o)&&fy(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)r5(t[i])&&r.push(i);r.length&&w5(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=go[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=go[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const hy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hi.test(e)||e==="0")&&!e.startsWith("url("));function M5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function O5(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=hy(i,t),a=hy(s,t);return!o||!a?!1:M5(e)||(n==="spring"||vm(n))&&r}const N5=e=>e!==null;function Tu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(N5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const D5=40;class Sk{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=sr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>D5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&j5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=sr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!O5(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Tu(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const qe=(e,t,n)=>e+(t-e)*n;function Rd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function I5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Rd(l,a,e+1/3),s=Rd(l,a,e),o=Rd(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Vc(e,t){return n=>n>0?t:e}const Pd=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},L5=[xp,Ni,Ds],F5=e=>L5.find(t=>t.test(e));function my(e){const t=F5(e);if(!t)return!1;let n=t.parse(e);return t===Ds&&(n=I5(n)),n}const gy=(e,t)=>{const n=my(e),r=my(t);if(!n||!r)return Vc(e,t);const i={...n};return s=>(i.red=Pd(n.red,r.red,s),i.green=Pd(n.green,r.green,s),i.blue=Pd(n.blue,r.blue,s),i.alpha=qe(n.alpha,r.alpha,s),Ni.transform(i))},B5=(e,t)=>n=>t(e(n)),il=(...e)=>e.reduce(B5),Tp=new Set(["none","hidden"]);function $5(e,t){return Tp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function z5(e,t){return n=>qe(e,t,n)}function $m(e){return typeof e=="number"?z5:typeof e=="string"?Tm(e)?Vc:Et.test(e)?gy:H5:Array.isArray(e)?Ck:typeof e=="object"?Et.test(e)?gy:V5:Vc}function Ck(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>$m(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function V5(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=$m(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function U5(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const H5=(e,t)=>{const n=hi.createTransformer(t),r=za(e),i=za(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Tp.has(e)&&!i.values.length||Tp.has(t)&&!r.values.length?$5(e,t):il(Ck(U5(r,i),i.values),n):Vc(e,t)};function _k(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?qe(e,t,n):$m(e)(e,t)}const W5=5;function Tk(e,t,n){const r=Math.max(t-W5,0);return Eb(n-e(r),t-r)}const Ke={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},Md=.001;function q5({duration:e=Ke.duration,bounce:t=Ke.bounce,velocity:n=Ke.velocity,mass:r=Ke.mass}){let i,s,o=1-t;o=Ar(Ke.minDamping,Ke.maxDamping,o),e=Ar(Ke.minDuration,Ke.maxDuration,ir(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,m=Ep(c,o),y=Math.exp(-u);return Md-p/m*y},s=c=>{const u=c*o*e,p=u*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-u),x=Ep(Math.pow(c,2),o);return(-i(c)+Md>0?-1:1)*((p-m)*y)/x}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Md+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=Y5(i,s,a);if(e=rr(e),isNaN(l))return{stiffness:Ke.stiffness,damping:Ke.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const G5=12;function Y5(e,t,n){let r=n;for(let i=1;i<G5;i++)r=r-e(r)/t(r);return r}function Ep(e,t){return e*Math.sqrt(1-t*t)}const Q5=["duration","bounce"],K5=["stiffness","damping","mass"];function vy(e,t){return t.some(n=>e[n]!==void 0)}function X5(e){let t={velocity:Ke.velocity,stiffness:Ke.stiffness,damping:Ke.damping,mass:Ke.mass,isResolvedFromDuration:!1,...e};if(!vy(e,K5)&&vy(e,Q5))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Ar(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Ke.mass,stiffness:i,damping:s}}else{const n=q5(e);t={...t,...n,mass:Ke.mass},t.isResolvedFromDuration=!0}return t}function Uc(e=Ke.visualDuration,t=Ke.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:p,isResolvedFromDuration:m}=X5({...n,velocity:-ir(n.velocity||0)}),y=p||0,x=c/(2*Math.sqrt(l*d)),w=o-s,h=ir(Math.sqrt(l/d)),g=Math.abs(w)<5;r||(r=g?Ke.restSpeed.granular:Ke.restSpeed.default),i||(i=g?Ke.restDelta.granular:Ke.restDelta.default);let b;if(x<1){const _=Ep(h,x);b=E=>{const S=Math.exp(-x*h*E);return o-S*((y+x*h*w)/_*Math.sin(_*E)+w*Math.cos(_*E))}}else if(x===1)b=_=>o-Math.exp(-h*_)*(w+(y+h*w)*_);else{const _=h*Math.sqrt(x*x-1);b=E=>{const S=Math.exp(-x*h*E),A=Math.min(_*E,300);return o-S*((y+x*h*w)*Math.sinh(A)+_*w*Math.cosh(A))/_}}const T={calculatedDuration:m&&u||null,next:_=>{const E=b(_);if(m)a.done=_>=u;else{let S=0;x<1&&(S=_===0?rr(y):Tk(b,_,E));const A=Math.abs(S)<=r,B=Math.abs(o-E)<=i;a.done=A&&B}return a.value=a.done?o:E,a},toString:()=>{const _=Math.min(xm(T),$c),E=jb(S=>T.next(_*S).value,_,30);return _+"ms "+E},toTransition:()=>{}};return T}Uc.applyToOptions=e=>{const t=Qj(e,100,Uc);return e.ease=Da()?t.ease:"easeOut",e.duration=rr(t.duration),e.type="keyframes",e};function yy({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],p={done:!1,value:u},m=A=>a!==void 0&&A<a||l!==void 0&&A>l,y=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let x=n*t;const w=u+x,h=o===void 0?w:o(w);h!==w&&(x=h-u);const g=A=>-x*Math.exp(-A/r),b=A=>h+g(A),T=A=>{const B=g(A),L=b(A);p.done=Math.abs(B)<=c,p.value=p.done?h:L};let _,E;const S=A=>{m(p.value)&&(_=A,E=Uc({keyframes:[p.value,y(p.value)],velocity:Tk(b,A,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return S(0),{calculatedDuration:null,next:A=>{let B=!1;return!E&&_===void 0&&(B=!0,T(A),S(A)),_!==void 0&&A>=_?E.next(A-_):(!B&&T(A),p)}}}const Z5=rl(.42,0,1,1),J5=rl(0,0,.58,1),Ek=rl(.42,0,.58,1),e3=e=>Array.isArray(e)&&typeof e[0]!="number",xy={linear:Sn,easeIn:Z5,easeInOut:Ek,easeOut:J5,circIn:Im,circInOut:ak,circOut:ok,backIn:Dm,backInOut:ik,backOut:rk,anticipate:sk},wy=e=>{if(gm(e)){hp(e.length===4);const[t,n,r,i]=e;return rl(t,n,r,i)}else if(typeof e=="string")return hp(xy[e]!==void 0),xy[e];return e};function t3(e,t,n){const r=[],i=n||_k,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Sn:t;a=il(l,a)}r.push(a)}return r}function n3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(hp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=t3(t,r,i),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let u=0;if(l>1)for(;u<e.length-2&&!(d<e[u+1]);u++);const p=Na(e[u],e[u+1],d);return a[u](p)};return n?d=>c(Ar(e[0],e[s-1],d)):c}function r3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Na(0,t,r);e.push(qe(n,1,i))}}function i3(e){const t=[0];return r3(t,e.length-1),t}function s3(e,t){return e.map(n=>n*t)}function o3(e,t){return e.map(()=>t||Ek).splice(0,e.length-1)}function Hc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=e3(r)?r.map(wy):wy(r),s={done:!1,value:t[0]},o=s3(n&&n.length===t.length?n:i3(t),e),a=n3(o,t,{ease:Array.isArray(i)?i:o3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const a3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Le.update(t,!0),stop:()=>pi(t),now:()=>wt.isProcessing?wt.timestamp:sr.now()}},l3={decay:yy,inertia:yy,tween:Hc,keyframes:Hc,spring:Uc},c3=e=>e/100;class zm extends Sk{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();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Bm,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=vm(n)?n:l3[n]||Hc;let l,c;a!==Hc&&typeof t[0]!="number"&&(l=il(c3,_k(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=xm(d));const{calculatedDuration:u}=d,p=u+i,m=p*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,resolvedDuration:p,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:u}=r;if(this.startTime===null)return s.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:x,onUpdate:w}=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)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const h=this.currentTime-p*(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 b=this.currentTime,T=s;if(m){const A=Math.min(this.currentTime,d)/u;let B=Math.floor(A),L=A%1;!L&&A>=1&&(L=1),L===1&&B--,B=Math.min(B,m+1),!!(B%2)&&(y==="reverse"?(L=1-L,x&&(L-=x/u)):y==="mirror"&&(T=o)),b=Ar(0,1,L)*u}const _=g?{done:!1,value:l[0]}:T.next(b);a&&(_.value=a(_.value));let{done:E}=_;!g&&c!==null&&(E=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return S&&i!==void 0&&(_.value=Tu(l,this.options,i)),w&&w(_.value),S&&this.finish(),_}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=rr(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){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=a3,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{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)}get finished(){return this.currentFinishedPromise}}const u3=new Set(["opacity","clipPath","filter","transform"]),d3=hm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Wc=10,f3=2e4;function p3(e){return vm(e.type)||e.type==="spring"||!Rb(e.ease)}function h3(e,t){const n=new zm({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<f3;)r=n.sample(s),i.push(r.value),s+=Wc;return{times:void 0,keyframes:i,duration:s-Wc,ease:"linear"}}const jk={anticipate:sk,backInOut:ik,circInOut:ak};function m3(e){return e in jk}class by extends Sk{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new kk(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&Da()&&m3(s)&&(s=jk[s]),p3(this.options)){const{onComplete:u,onUpdate:p,motionValue:m,element:y,...x}=this.options,w=h3(t,x);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,i=w.times,s=w.ease,o="keyframes"}const d=Yj(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Qv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Tu(t,this.options,n)),u&&u(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=rr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;Qv(r,t)}return Sn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:d,onComplete:u,element:p,...m}=this.options,y=new zm({...m,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),x=rr(this.time);c.setWithVelocity(y.sample(x-Wc).value,y.sample(x).value,Wc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return d3()&&r&&u3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const g3={type:"spring",stiffness:500,damping:25,restSpeed:10},v3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),y3={type:"keyframes",duration:.8},x3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},w3=(e,{keyframes:t})=>t.length>2?y3:ls.has(e)?e.startsWith("scale")?v3(t[1]):g3:x3;function b3({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Vm=(e,t,n,r={},i,s)=>o=>{const a=ym(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-rr(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};b3(a)||(d={...d,...w3(e,d)}),d.duration&&(d.duration=rr(d.duration)),d.repeatDelay&&(d.repeatDelay=rr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),d.allowFlatten=!a.type&&!a.ease,u&&!s&&t.get()!==void 0){const p=Tu(d.keyframes,a);if(p!==void 0)return Le.update(()=>{d.onUpdate(p),d.onComplete()}),new Wj([])}return!s&&by.supports(d)?new by(d):new zm(d)};function k3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ak(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const u=e.getValue(d,e.latestValues[d]??null),p=a[d];if(p===void 0||c&&k3(c,d))continue;const m={delay:n,...ym(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const w=Jb(e);if(w){const h=window.MotionHandoffAnimation(w,d,Le);h!==null&&(m.startTime=h,y=!0)}}yp(e,d),u.start(Vm(d,u,p,e.shouldReduceMotion&&Zb.has(d)?{type:!1}:m,e,y));const x=u.animation;x&&l.push(x)}return o&&Promise.all(l).then(()=>{Le.update(()=>{o&&ZA(e,o)})}),l}function jp(e,t,n={}){var l;const r=$a(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Ak(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return S3(e,t,d+c,u,p,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,d]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function S3(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(C3).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(jp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function C3(e,t){return e.sortNodePosition(t)}function _3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>jp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=jp(e,t,n);else{const i=typeof t=="function"?$a(e,t,n.custom):t;r=Promise.all(Ak(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Rk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const T3=Sm.length;function Pk(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Pk(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<T3;n++){const r=Sm[n],i=e.props[r];(La(i)||i===!1)&&(t[r]=i)}return t}const E3=[...km].reverse(),j3=km.length;function A3(e){return t=>Promise.all(t.map(({animation:n,options:r})=>_3(e,n,r)))}function R3(e){let t=A3(e),n=ky(),r=!0;const i=l=>(c,d)=>{var p;const u=$a(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:m,transitionEnd:y,...x}=u;c={...c,...x,...y}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=Pk(e.parent)||{},u=[],p=new Set;let m={},y=1/0;for(let w=0;w<j3;w++){const h=E3[w],g=n[h],b=c[h]!==void 0?c[h]:d[h],T=La(b),_=h===l?g.isActive:null;_===!1&&(y=w);let E=b===d[h]&&b!==c[h]&&T;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),g.protectedKeys={...m},!g.isActive&&_===null||!b&&!g.prevProp||Cu(b)||typeof b=="boolean")continue;const S=P3(g.prevProp,b);let A=S||h===l&&g.isActive&&!E&&T||w>y&&T,B=!1;const L=Array.isArray(b)?b:[b];let N=L.reduce(i(h),{});_===!1&&(N={});const{prevResolvedValues:ee={}}=g,Z={...ee,...N},V=H=>{A=!0,p.has(H)&&(B=!0,p.delete(H)),g.needsAnimating[H]=!0;const C=e.getValue(H);C&&(C.liveStyle=!1)};for(const H in Z){const C=N[H],P=ee[H];if(m.hasOwnProperty(H))continue;let F=!1;vp(C)&&vp(P)?F=!Rk(C,P):F=C!==P,F?C!=null?V(H):p.add(H):C!==void 0&&p.has(H)?V(H):g.protectedKeys[H]=!0}g.prevProp=b,g.prevResolvedValues=N,g.isActive&&(m={...m,...N}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(E&&S)||B)&&u.push(...L.map(H=>({animation:H,options:{type:h}})))}if(p.size){const w={};if(typeof c.initial!="boolean"){const h=$a(e,Array.isArray(c.initial)?c.initial[0]:c.initial);h&&h.transition&&(w.transition=h.transition)}p.forEach(h=>{const g=e.getBaseTarget(h),b=e.getValue(h);b&&(b.liveStyle=!0),w[h]=g??null}),u.push({animation:w})}let x=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=ky(),r=!0}}}function P3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Rk(t,e):!1}function Ci(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ky(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}class wi{constructor(t){this.isMounted=!1,this.node=t}update(){}}class M3 extends wi{constructor(t){super(t),t.animationState||(t.animationState=R3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Cu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let O3=0;class N3 extends wi{constructor(){super(...arguments),this.id=O3++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const D3={animation:{Feature:M3},exit:{Feature:N3}};function Va(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function sl(e){return{point:{x:e.pageX,y:e.pageY}}}const I3=e=>t=>bm(t)&&e(t,sl(t));function la(e,t,n,r){return Va(e,t,I3(n),r)}function Mk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function L3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function F3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ok=1e-4,B3=1-Ok,$3=1+Ok,Nk=.01,z3=0-Nk,V3=0+Nk;function Dt(e){return e.max-e.min}function U3(e,t,n){return Math.abs(e-t)<=n}function Sy(e,t,n,r=.5){e.origin=r,e.originPoint=qe(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=B3&&e.scale<=$3||isNaN(e.scale))&&(e.scale=1),(e.translate>=z3&&e.translate<=V3||isNaN(e.translate))&&(e.translate=0)}function ca(e,t,n,r){Sy(e.x,t.x,n.x,r?r.originX:void 0),Sy(e.y,t.y,n.y,r?r.originY:void 0)}function Cy(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function H3(e,t,n){Cy(e.x,t.x,n.x),Cy(e.y,t.y,n.y)}function _y(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function ua(e,t,n){_y(e.x,t.x,n.x),_y(e.y,t.y,n.y)}const Ty=()=>({translate:0,scale:1,origin:0,originPoint:0}),Is=()=>({x:Ty(),y:Ty()}),Ey=()=>({min:0,max:0}),et=()=>({x:Ey(),y:Ey()});function hn(e){return[e("x"),e("y")]}function Od(e){return e===void 0||e===1}function Ap({scale:e,scaleX:t,scaleY:n}){return!Od(e)||!Od(t)||!Od(n)}function ji(e){return Ap(e)||Dk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dk(e){return jy(e.x)||jy(e.y)}function jy(e){return e&&e!=="0%"}function qc(e,t,n){const r=e-n,i=t*r;return n+i}function Ay(e,t,n,r,i){return i!==void 0&&(e=qc(e,i,r)),qc(e,n,r)+t}function Rp(e,t=0,n=1,r,i){e.min=Ay(e.min,t,n,r,i),e.max=Ay(e.max,t,n,r,i)}function Ik(e,{x:t,y:n}){Rp(e.x,t.translate,t.scale,t.originPoint),Rp(e.y,n.translate,n.scale,n.originPoint)}const Ry=.999999999999,Py=1.0000000000001;function W3(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Fs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ik(e,o)),r&&ji(s.latestValues)&&Fs(e,s.latestValues))}t.x<Py&&t.x>Ry&&(t.x=1),t.y<Py&&t.y>Ry&&(t.y=1)}function Ls(e,t){e.min=e.min+t,e.max=e.max+t}function My(e,t,n,r,i=.5){const s=qe(e.min,e.max,i);Rp(e,t,n,s,r)}function Fs(e,t){My(e.x,t.x,t.scaleX,t.scale,t.originX),My(e.y,t.y,t.scaleY,t.scale,t.originY)}function Lk(e,t){return Mk(F3(e.getBoundingClientRect(),t))}function q3(e,t,n){const r=Lk(e,n),{scroll:i}=t;return i&&(Ls(r.x,i.offset.x),Ls(r.y,i.offset.y)),r}const Fk=({current:e})=>e?e.ownerDocument.defaultView:null,Oy=(e,t)=>Math.abs(e-t);function G3(e,t){const n=Oy(e.x,t.x),r=Oy(e.y,t.y);return Math.sqrt(n**2+r**2)}class Bk{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Dd(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=G3(u.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=u,{timestamp:x}=wt;this.history.push({...y,timestamp:x});const{onStart:w,onMove:h}=this.handlers;p||(w&&w(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Nd(p,this.transformPagePoint),Le.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Dd(u.type==="pointercancel"?this.lastMoveEventInfo:Nd(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(u,w),y&&y(u,w)},!bm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=sl(t),a=Nd(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=wt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Dd(a,this.history)),this.removeListeners=il(la(this.contextWindow,"pointermove",this.handlePointerMove),la(this.contextWindow,"pointerup",this.handlePointerUp),la(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pi(this.updatePoint)}}function Nd(e,t){return t?{point:t(e.point)}:e}function Ny(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Dd({point:e},t){return{point:e,delta:Ny(e,$k(t)),offset:Ny(e,Y3(t)),velocity:Q3(t,.1)}}function Y3(e){return e[0]}function $k(e){return e[e.length-1]}function Q3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=$k(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>rr(t)));)n--;if(!r)return{x:0,y:0};const s=ir(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function K3(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?qe(n,e,r.max):Math.min(e,n)),e}function Dy(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function X3(e,{top:t,left:n,bottom:r,right:i}){return{x:Dy(e.x,n,i),y:Dy(e.y,t,r)}}function Iy(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Z3(e,t){return{x:Iy(e.x,t.x),y:Iy(e.y,t.y)}}function J3(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=Na(t.min,t.max-r,e.min):r>i&&(n=Na(e.min,e.max-i,t.min)),Ar(0,1,n)}function eR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Pp=.35;function tR(e=Pp){return e===!1?e=0:e===!0&&(e=Pp),{x:Ly(e,"left","right"),y:Ly(e,"top","bottom")}}function Ly(e,t,n){return{min:Fy(e,t),max:Fy(e,n)}}function Fy(e,t){return typeof e=="number"?e:e[t]||0}const nR=new WeakMap;class rR{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=et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(sl(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Jj(p),!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),hn(w=>{let h=this.getAxisMotionValue(w).get()||0;if(or.test(h)){const{projection:g}=this.visualElement;if(g&&g.layout){const b=g.layout.layoutBox[w];b&&(h=Dt(b)*(parseFloat(h)/100))}}this.originPoint[w]=h}),y&&Le.postRender(()=>y(d,u)),yp(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=u;if(m&&this.currentDirection===null){this.currentDirection=iR(w),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,w),this.updateAxis("y",u.point,w),this.visualElement.render(),x&&x(d,u)},a=(d,u)=>this.stop(d,u),l=()=>hn(d=>{var u;return this.getAnimationState(d)==="paused"&&((u=this.getAxisMotionValue(d).animation)==null?void 0:u.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Bk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Fk(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Le.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Dl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=K3(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ns(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=X3(r.layoutBox,t):this.constraints=!1,this.elastic=tR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&hn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=eR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ns(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=q3(r,i.root,this.visualElement.getTransformPagePoint());let o=Z3(i.layout.layoutBox,s);if(n){const a=n(L3(o));this.hasMutatedConstraints=!!a,a&&(o=Mk(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=hn(d=>{if(!Dl(d,n,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const p=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return yp(this.visualElement,t),r.start(Vm(t,r,0,n,this.visualElement,!1))}stopAnimation(){hn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){hn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){hn(n=>{const{drag:r}=this.getProps();if(!Dl(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-qe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ns(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};hn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=J3({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),hn(o=>{if(!Dl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(qe(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;nR.set(this.visualElement,this);const t=this.visualElement.current,n=la(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ns(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Le.read(r);const o=Va(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(hn(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Pp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Dl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function iR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class sR extends wi{constructor(t){super(t),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new rR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const By=e=>(t,n)=>{e&&Le.postRender(()=>e(t,n))};class oR extends wi{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(t){this.session=new Bk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Fk(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:By(t),onStart:By(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Le.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=la(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ic={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function $y(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $o={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(me.test(e))e=parseFloat(e);else return e;const n=$y(e,t.target.x),r=$y(e,t.target.y);return`${n}% ${r}%`}},aR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hi.parse(e);if(i.length>5)return r;const s=hi.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=qe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class lR extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;TA(cR),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ic.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Le.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),wm.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function zk(e){const[t,n]=Tb(),r=v.useContext(cm);return f.jsx(lR,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(Bb),isPresent:t,safeToRemove:n})}const cR={borderRadius:{...$o,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$o,borderTopRightRadius:$o,borderBottomLeftRadius:$o,borderBottomRightRadius:$o,boxShadow:aR};function uR(e,t,n){const r=At(e)?e:Ia(e);return r.start(Vm("",r,t,n)),r.animation}function dR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const fR=(e,t)=>e.depth-t.depth;class pR{constructor(){this.children=[],this.isDirty=!1}add(t){fm(this.children,t),this.isDirty=!0}remove(t){pm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(fR),this.isDirty=!1,this.children.forEach(t)}}function hR(e,t){const n=sr.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(pi(r),e(s-t))};return Le.read(r,!0),()=>pi(r)}const Vk=["TopLeft","TopRight","BottomLeft","BottomRight"],mR=Vk.length,zy=e=>typeof e=="string"?parseFloat(e):e,Vy=e=>typeof e=="number"||me.test(e);function gR(e,t,n,r,i,s){i?(e.opacity=qe(0,n.opacity??1,vR(r)),e.opacityExit=qe(t.opacity??1,0,yR(r))):s&&(e.opacity=qe(t.opacity??1,n.opacity??1,r));for(let o=0;o<mR;o++){const a=`border${Vk[o]}Radius`;let l=Uy(t,a),c=Uy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Vy(l)===Vy(c)?(e[a]=Math.max(qe(zy(l),zy(c),r),0),(or.test(c)||or.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=qe(t.rotate||0,n.rotate||0,r))}function Uy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const vR=Uk(0,.5,ok),yR=Uk(.5,.95,Sn);function Uk(e,t,n){return r=>r<e?0:r>t?1:n(Na(e,t,r))}function Hy(e,t){e.min=t.min,e.max=t.max}function fn(e,t){Hy(e.x,t.x),Hy(e.y,t.y)}function Wy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function qy(e,t,n,r,i){return e-=t,e=qc(e,1/n,r),i!==void 0&&(e=qc(e,1/i,r)),e}function xR(e,t=0,n=1,r=.5,i,s=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=qe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=qe(s.min,s.max,r);e===s&&(a-=t),e.min=qy(e.min,t,n,a,i),e.max=qy(e.max,t,n,a,i)}function Gy(e,t,[n,r,i],s,o){xR(e,t[n],t[r],t[i],t.scale,s,o)}const wR=["x","scaleX","originX"],bR=["y","scaleY","originY"];function Yy(e,t,n,r){Gy(e.x,t,wR,n?n.x:void 0,r?r.x:void 0),Gy(e.y,t,bR,n?n.y:void 0,r?r.y:void 0)}function Qy(e){return e.translate===0&&e.scale===1}function Hk(e){return Qy(e.x)&&Qy(e.y)}function Ky(e,t){return e.min===t.min&&e.max===t.max}function kR(e,t){return Ky(e.x,t.x)&&Ky(e.y,t.y)}function Xy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Wk(e,t){return Xy(e.x,t.x)&&Xy(e.y,t.y)}function Zy(e){return Dt(e.x)/Dt(e.y)}function Jy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class SR{constructor(){this.members=[]}add(t){fm(this.members,t),t.scheduleRender()}remove(t){if(pm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(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);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.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 CR(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:u,rotateY:p,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),u&&(r+=`rotateX(${u}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Id=["","X","Y","Z"],_R={visibility:"hidden"},e0=1e3;let TR=0;function Ld(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Jb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Le,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qk(r)}function Gk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=TR++,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,this.nodes.forEach(AR),this.nodes.forEach(NR),this.nodes.forEach(DR),this.nodes.forEach(RR)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new pR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new mm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=dR(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let u;const p=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=hR(p,250),ic.hasAnimatedSinceResize&&(ic.hasAnimatedSinceResize=!1,this.nodes.forEach(n0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||$R,{onLayoutAnimationStart:w,onLayoutAnimationComplete:h}=d.getProps(),g=!this.targetLayout||!Wk(this.targetLayout,y),b=!p&&m;if(this.options.layoutRoot||this.resumeFrom||b||p&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,b);const T={...ym(x,"layout"),onPlay:w,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else p||n0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pi(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(IR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(t0);return}this.isUpdating||this.nodes.forEach(MR),this.isUpdating=!1,this.nodes.forEach(OR),this.nodes.forEach(ER),this.nodes.forEach(jR),this.clearAllSnapshots();const a=sr.now();wt.delta=Ar(0,1e3/60,a-wt.timestamp),wt.timestamp=a,wt.isProcessing=!0,Ed.update.process(wt),Ed.preRender.process(wt),Ed.render.process(wt),wt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(PR),this.sharedNodes.forEach(LR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Hk(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||ji(this.latestValues)||d)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),zR(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return et();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(VR))){const{scroll:d}=this.root;d&&(Ls(a.x,d.offset.x),Ls(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=et();if(fn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:u,options:p}=d;d!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&fn(a,o),Ls(a.x,u.offset.x),Ls(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=et();fn(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Fs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ji(d.latestValues)&&Fs(l,d.latestValues)}return ji(this.latestValues)&&Fs(l,this.latestValues),l}removeTransform(o){const a=et();fn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ji(c.latestValues))continue;Ap(c.latestValues)&&c.updateSnapshot();const d=et(),u=c.measurePageBox();fn(d,u),Yy(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return ji(this.latestValues)&&Yy(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=wt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),ua(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=et(),this.targetWithTransforms=et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),H3(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):fn(this.target,this.layout.layoutBox),Ik(this.target,this.targetDelta)):fn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),ua(this.relativeTargetOrigin,this.target,m.target),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Ap(this.parent.latestValues)||Dk(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 y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===wt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;fn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;W3(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=et());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Wy(this.prevProjectionDelta.x,this.projectionDelta.x),Wy(this.prevProjectionDelta.y,this.projectionDelta.y)),ca(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!Jy(this.projectionDelta.x,this.prevProjectionDelta.x)||!Jy(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Is(),this.projectionDelta=Is(),this.projectionDeltaWithTransform=Is()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Is();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=et(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,x=m!==y,w=this.getStack(),h=!w||w.members.length<=1,g=!!(x&&!h&&this.options.crossfade===!0&&!this.path.some(BR));this.animationProgress=0;let b;this.mixTargetDelta=T=>{const _=T/1e3;r0(u.x,o.x,_),r0(u.y,o.y,_),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ua(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),FR(this.relativeTarget,this.relativeTargetOrigin,p,_),b&&kR(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=et()),fn(b,this.relativeTarget)),x&&(this.animationValues=d,gR(d,c,this.latestValues,_,g,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Le.update(()=>{ic.hasAnimatedSinceResize=!0,this.currentAnimation=uR(0,e0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(e0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Yk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||et();const u=Dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=Dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}fn(a,l),Fs(a,d),ca(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new SR),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Ld("z",o,c,this.animationValues);for(let d=0;d<Id.length;d++)Ld(`rotate${Id[d]}`,o,c,this.animationValues),Ld(`skew${Id[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return _R;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=rc(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=rc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ji(this.latestValues)&&(m.transform=l?l({},""):"none",this.hasProjected=!1),m}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=CR(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:u,y:p}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in Fa){if(d[m]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:w}=Fa[m],h=a.transform==="none"?d[m]:y(d[m],c);if(x){const g=x.length;for(let b=0;b<g;b++)a[x[b]]=h}else w?this.options.visualElement.renderState.vars[m]=h:a[m]=h}return this.options.layoutId&&(a.pointerEvents=c===this?rc(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(t0),this.root.sharedNodes.clear()}}}function ER(e){e.updateLayout()}function jR(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?hn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],m=Dt(p);p.min=r[u].min,p.max=p.min+m}):Yk(s,t.layoutBox,r)&&hn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],m=Dt(r[u]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+m)});const a=Is();ca(a,r,t.layoutBox);const l=Is();o?ca(l,e.applyTransform(i,!0),t.measuredBox):ca(l,r,t.layoutBox);const c=!Hk(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:m}=u;if(p&&m){const y=et();ua(y,t.layoutBox,p.layoutBox);const x=et();ua(x,r,m.layoutBox),Wk(y,x)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function AR(e){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 RR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function PR(e){e.clearSnapshot()}function t0(e){e.clearMeasurements()}function MR(e){e.isLayoutDirty=!1}function OR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function n0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function NR(e){e.resolveTargetDelta()}function DR(e){e.calcProjection()}function IR(e){e.resetSkewAndRotation()}function LR(e){e.removeLeadSnapshot()}function r0(e,t,n){e.translate=qe(t.translate,0,n),e.scale=qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function i0(e,t,n,r){e.min=qe(t.min,n.min,r),e.max=qe(t.max,n.max,r)}function FR(e,t,n,r){i0(e.x,t.x,n.x,r),i0(e.y,t.y,n.y,r)}function BR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const $R={duration:.45,ease:[.4,0,.1,1]},s0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),o0=s0("applewebkit/")&&!s0("chrome/")?Math.round:Sn;function a0(e){e.min=o0(e.min),e.max=o0(e.max)}function zR(e){a0(e.x),a0(e.y)}function Yk(e,t,n){return e==="position"||e==="preserve-aspect"&&!U3(Zy(t),Zy(n),.2)}function VR(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const UR=Gk({attachResizeListener:(e,t)=>Va(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Fd={current:void 0},Qk=Gk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Fd.current){const e=new UR({});e.mount(window),e.setOptions({layoutScroll:!0}),Fd.current=e}return Fd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),HR={pan:{Feature:oR},drag:{Feature:sR,ProjectionNode:Qk,MeasureLayout:zk}};function l0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Le.postRender(()=>s(t,sl(t)))}class WR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=tA(t,(n,r)=>(l0(this.node,r,"Start"),i=>l0(this.node,i,"End"))))}unmount(){}}class qR extends wi{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=il(Va(this.node.current,"focus",()=>this.onFocus()),Va(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function c0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Le.postRender(()=>s(t,sl(t)))}class GR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=sA(t,(n,r)=>(c0(this.node,r,"Start"),(i,{success:s})=>c0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Mp=new WeakMap,Bd=new WeakMap,YR=e=>{const t=Mp.get(e.target);t&&t(e)},QR=e=>{e.forEach(YR)};function KR({root:e,...t}){const n=e||document;Bd.has(n)||Bd.set(n,{});const r=Bd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(QR,{root:e,...t})),r[i]}function XR(e,t,n){const r=KR(t);return Mp.set(e,n),r.observe(e),()=>{Mp.delete(e),r.unobserve(e)}}const ZR={some:0,all:1};class JR extends wi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:ZR[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),p=c?d:u;p&&p(l)};return XR(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eP(t,n))&&this.startObserver()}unmount(){}}function eP({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tP={inView:{Feature:JR},tap:{Feature:GR},focus:{Feature:qR},hover:{Feature:WR}},nP={layout:{ProjectionNode:Qk,MeasureLayout:zk}},Op={current:null},Kk={current:!1};function rP(){if(Kk.current=!0,!!um)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Op.current=e.matches;e.addListener(t),t()}else Op.current=!1}const iP=[...bk,Et,hi],sP=e=>iP.find(wk(e)),oP=new WeakMap;function aP(e,t,n){for(const r in t){const i=t[r],s=n[r];if(At(i))e.addValue(r,i);else if(At(s))e.addValue(r,Ia(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Ia(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const u0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Bm,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=()=>{const m=sr.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Le.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=_u(n),this.isVariantNode=Lb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const y=p[m];l[m]!==void 0&&At(y)&&y.set(l[m],!1)}}mount(t){this.current=t,oP.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((n,r)=>this.bindToMotionValue(r,n)),Kk.current||rP(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Op.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pi(this.notifyUpdate),pi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ls.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.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 mo){const n=mo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<u0.length;r++){const i=u0[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=aP(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){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ia(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(yk(r)||lk(r))?r=parseFloat(r):!sP(r)&&hi.test(n)&&(r=mk(t,n)),this.setBaseTarget(t,At(r)?r.get():r)),At(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Om(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!At(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new mm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Xk extends lP{constructor(){super(...arguments),this.KeyframeResolver=kk}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;At(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function cP(e){return window.getComputedStyle(e)}class uP extends Xk{constructor(){super(...arguments),this.type="html",this.renderInstance=Yb}readValueFromInstance(t,n){if(ls.has(n))return S5(t,n);{const r=cP(t),i=(_m(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Lk(t,n)}build(t,n,r){jm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Nm(t,n,r)}}class dP extends Xk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=et,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Gb(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ls.has(n)){const r=hk(n);return r&&r.default||0}return n=Qb.has(n)?n:Cm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Xb(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Le.postRender(this.updateDimensions)}build(t,n,r){Pm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Kb(t,n,r,i)}mount(t){this.isSVGTag=Mm(t.tagName),super.mount(t)}}const fP=(e,t)=>Rm(e)?new dP(t):new uP(t,{allowProjection:e!==v.Fragment}),pP=KA({...D3,...tP,...HR,...nP},fP),Pe=fA(pP);class hP{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const mP=()=>new hP;function gP(){return bu(mP)}var $r=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))($r||{});const Zk=v.createContext({}),vP={[J.TooltipDefault]:"Bizimle sohbet edin!",[J.TooltipActive]:"Yeni mesajlar var!",[J.CloseButtonAria]:"Kapat",[J.MessagePlaceholder]:"Mesajınızı yazın",[J.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[J.NewMessagesNotification]:"Yeni mesajlar var!",[J.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[J.ChatCloseWarning]:"Bu işlem geri alınamaz.",[J.ChatSettings]:"Sohbet Ayarları",[J.ChatEndConversation]:"Sohbeti Sonlandır",[J.CancelAction]:"Vazgeç",[J.CloseAction]:"Kapat",[J.QuickActions]:"Hızlı işlemler",[J.GreetingStartChat]:"Sohbete başla",[J.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[J.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[J.RatingHeaderThanks]:"Teşekkürler!",[J.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[J.RatingRateConversation]:"Görüşmeyi puanlayın",[J.RatingComment]:"Yorumunuz (İsteğe bağlı)",[J.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[J.RatingSubmit]:"Değerlendirmeyi Gönder",[J.RatingNewConversation]:"Yeni Görüşme Başlat",[J.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[J.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[J.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[J.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[J.RatingYourScore]:"Puanınız: {score}",[J.PoweredBy]:"Powered by",[J.NotificationSoundOn]:"Bildirim sesi aç",[J.NotificationSoundOff]:"Bildirim sesi kapat"},yP={[k.Background]:"#ffffff",[k.Border]:"#e2e8f0",[k.TooltipText]:"#1e40af",[k.TooltipBackground]:"#dbeafe",[k.TooltipBorder]:"#3b82f6",[k.HeaderBackground]:"#ffffff",[k.HeaderBorder]:"#e2e8f0",[k.HeaderText]:"#1e293b",[k.FooterBackground]:"#f8fafc",[k.FooterBorder]:"#e2e8f0",[k.FooterText]:"#475569",[k.MessageAdminBackground]:"#f1f5f9",[k.MessageAdminText]:"#334155",[k.MessageVisitorBackground]:"#3b82f6",[k.MessageVisitorText]:"#ffffff",[k.MessageAgentBackground]:"#ede9fe",[k.MessageAgentText]:"#5b21b6",[k.GreeterBackground]:"#ffffff",[k.GreeterText]:"#334155",[k.GreeterBorder]:"#e2e8f0",[k.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[k.GreeterTopText]:"#ffffff",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#f8fafc",[k.InputText]:"#1e293b",[k.InputBorder]:"#e2e8f0",[k.CloseButtonBackground]:"#f1f5f9",[k.CloseButtonText]:"#475569",[k.CloseButtonHover]:"#e2e8f0",[k.IconColor]:"#64748b",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#fef2f2",[k.ErrorText]:"#dc2626",[k.ErrorBorder]:"#fca5a5",[k.SuccessBackground]:"#f0fdf4",[k.SuccessText]:"#16a34a",[k.SuccessBorder]:"#86efac",[k.WarningBackground]:"#fffbeb",[k.WarningText]:"#d97706",[k.WarningBorder]:"#fcd34d",[k.LinkColor]:"#2563eb",[k.LinkHoverColor]:"#1d4ed8",[k.DividerColor]:"#e2e8f0",[k.ShadowColor]:"rgba(0, 0, 0, 0.1)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#e2e8f0",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[k.ChatCloseConfirmText]:"#dc2626",[k.RatingHeaderBackground]:"#3b82f6",[k.RatingHeaderText]:"#ffffff",[k.RatingSuccessBackground]:"#ffffff",[k.RatingSuccessText]:"#334155",[k.RatingRateConversationText]:"#1e293b"},xP={[k.Background]:"#0a0a0a",[k.Border]:"#262626",[k.TooltipText]:"#e5e5e5",[k.TooltipBackground]:"#262626",[k.TooltipBorder]:"#404040",[k.HeaderBackground]:"#171717",[k.HeaderBorder]:"#262626",[k.HeaderText]:"#fafafa",[k.FooterBackground]:"#0a0a0a",[k.FooterBorder]:"#262626",[k.FooterText]:"#a3a3a3",[k.MessageAdminBackground]:"#262626",[k.MessageAdminText]:"#e5e5e5",[k.MessageVisitorBackground]:"#171717",[k.MessageVisitorText]:"#e5e5e5",[k.MessageAgentBackground]:"#5b21b6",[k.MessageAgentText]:"#e9d5ff",[k.GreeterBackground]:"#171717",[k.GreeterText]:"#e5e5e5",[k.GreeterBorder]:"#262626",[k.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[k.GreeterTopText]:"#fafafa",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#171717",[k.InputText]:"#e5e5e5",[k.InputBorder]:"#262626",[k.CloseButtonBackground]:"#262626",[k.CloseButtonText]:"#a3a3a3",[k.CloseButtonHover]:"#404040",[k.IconColor]:"#a3a3a3",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#450a0a",[k.ErrorText]:"#fca5a5",[k.ErrorBorder]:"#7f1d1d",[k.SuccessBackground]:"#052e16",[k.SuccessText]:"#86efac",[k.SuccessBorder]:"#14532d",[k.WarningBackground]:"#451a03",[k.WarningText]:"#fcd34d",[k.WarningBorder]:"#78350f",[k.LinkColor]:"#3b82f6",[k.LinkHoverColor]:"#60a5fa",[k.DividerColor]:"#262626",[k.ShadowColor]:"rgba(0, 0, 0, 0.4)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#404040",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[k.ChatCloseConfirmText]:"#fca5a5",[k.RatingHeaderBackground]:"#171717",[k.RatingHeaderText]:"#fafafa",[k.RatingSuccessBackground]:"#171717",[k.RatingSuccessText]:"#e5e5e5",[k.RatingRateConversationText]:"#e5e5e5"},wP={[$r.None]:"0px",[$r.Sm]:"var(--radius-sm)",[$r.Md]:"var(--radius-md)",[$r.Lg]:"var(--radius-lg)",[$r.Xl]:"var(--radius-lg)",[$r.Full]:"calc(infinity * 1px)"},bP=e=>{const t={...vP};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.texts)return t;for(const n in e.appearance.design.texts){const r=n;e.appearance.design.texts[r]&&(t[r]=e.appearance.design.texts[r])}return t};function kP(e,t){const n=e.replace(/^#/,"");if(n.length!==6)return e;const r=Math.max(0,Math.round(Number.parseInt(n.slice(0,2),16)*(1-t))),i=Math.max(0,Math.round(Number.parseInt(n.slice(2,4),16)*(1-t))),s=Math.max(0,Math.round(Number.parseInt(n.slice(4,6),16)*(1-t)));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}const d0="#ffffff";function SP(e){const t=kP(e,.2);return{[k.ButtonBackground]:t,[k.ButtonText]:d0,[k.MessageVisitorBackground]:t,[k.MessageVisitorText]:d0}}const CP=(e,t)=>{var i,s;const r={...t==="dark"?xP:yP};if(t==="dark")return r;if((s=(i=e==null?void 0:e.appearance)==null?void 0:i.design)!=null&&s.colors){const o=e.appearance.design.colors,a=o.main_color;if(a){const l=SP(a);for(const c of Object.keys(l))l[c]&&(r[c]=l[c])}for(const l in o){if(l==="main_color"||l==="secondary_color"||l==="accent_color")continue;const c=l;o[l]&&l in r&&(r[c]=o[l])}}return r},Jk="lc:theme:mode";function _P(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function TP(){try{const e=localStorage.getItem(Jk);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Ne.System}function EP({children:e,widget:t}){const[n,r]=v.useState(TP),[i,s]=v.useState(_P);v.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),x=w=>{s(w.matches?"dark":"light")};return y.addEventListener("change",x),()=>y.removeEventListener("change",x)},[]);const o=n===Ne.System?i:n,a=v.useCallback(y=>{r(y);try{localStorage.setItem(Jk,y)}catch{}},[]),l=CP(t,o),c=bP(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:$r.Md,u=y=>l[y],p=y=>c[y],m=()=>wP[d];return f.jsx(Zk.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:m,mode:n,resolvedMode:o,setMode:a},children:e})}const je=()=>v.useContext(Zk),cs=()=>je().getText;function Rt({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,style:l,textKey:c=k.ButtonText,bgKey:d=k.ButtonBackground,animations:u={},withoutTheming:p,...m}){const y=je();return f.jsx(Pe.button,{type:t,className:ze("flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-0 font-medium transition-opacity",{"rounded-full":o&&i!=="xs","rounded-lg":!o,"opacity-50 cursor-not-allowed":s,"hover:opacity-90 active:opacity-95":!s},a,qv[n]&&qv[n][r],Fj[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!p&&{color:y.getColor(c),backgroundColor:y.getColor(d),...o?{}:{borderRadius:y.getRadius()}},...l},...u,...m,children:e})}function Y(){}Y.Home=function(t){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};Y.Chat=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});Y.Menu=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});Y.MessageTyping=({className:e="size-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});Y.Check=function(t){return f.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};Y.Website=function(t){return f.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),f.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};Y.ArrowDown=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});Y.ArrowDown2=e=>f.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:[f.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_iconCarrier",children:f.jsx("path",{d:"M903.232 256l56.768 50.432L512 768 64 306.432 120.768 256 512 659.072z",fill:"currentColor"})})]});Y.ArrowLeft=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})});Y.XCircle=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});Y.X=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});Y.PaperAirplane=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});Y.Spin=function(t){return f.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};Y.ExternalLink=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})});Y.Phone=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"})});Y.Mail=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})});Y.Star=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})});Y.Plus=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})});Y.History=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});Y.Eye=e=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});Y.Lock=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})});Y.User=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})});Y.Emoji=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.182 15.182a4.5 4.5 0 0 1-6.364 0M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Z"})});Y.Paperclip=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})});Y.Sparkles=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})});Y.Sun=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75v-2.25m-4.773 4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})});Y.Moon=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})});Y.Monitor=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})});Y.Volume2=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});Y.VolumeX=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75 19.5 12m0 0 2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6 4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});Y.Bot=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})});function Np(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var rt=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e.AIAgentMode="lc:agent:mode",e.AIAgent="lc:agent:data",e.AIAgentSessionId="lc:agent:session",e.HumanNeedRequested="lc:agent:human_need",e))(rt||{});const Ln=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},Ko=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},da=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),Um(e)},eS=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},Il=(e,t,n,r,i)=>{const s=`${e}:`;t&&(n||i)?(localStorage.setItem(`${s}lc:agent:mode`,"true"),localStorage.setItem(`${s}lc:agent:data`,JSON.stringify(t)),r&&localStorage.setItem(`${s}lc:agent:session`,r),i!==void 0&&(i?localStorage.setItem(`${s}lc:agent:human_need`,"true"):localStorage.removeItem(`${s}lc:agent:human_need`))):Um(e)},gr=e=>{const t=`${e}:`,n=localStorage.getItem(`${t}lc:agent:mode`)==="true",r=localStorage.getItem(`${t}lc:agent:data`),i=localStorage.getItem(`${t}lc:agent:session`),s=localStorage.getItem(`${t}lc:agent:human_need`)==="true";let o=null;if(r)try{o=JSON.parse(r)}catch{o=null}return{isAgentMode:n,agent:o,sessionId:i,humanNeedRequested:s}},Um=e=>{const t=`${e}:`;localStorage.removeItem(`${t}lc:agent:mode`),localStorage.removeItem(`${t}lc:agent:data`),localStorage.removeItem(`${t}lc:agent:session`),localStorage.removeItem(`${t}lc:agent:human_need`)},mi=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=Np(),localStorage.setItem(t,n)),n},jP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},f0=e=>{let t;const n=new Set,r=(d,u)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const m=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(jP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,l);return l},AP=e=>e?f0(e):f0;var tS={exports:{}},nS={},rS={exports:{}},iS={};/**
71
71
  * @license React
72
72
  * use-sync-external-store-shim.production.min.js
73
73
  *
@@ -75,7 +75,7 @@ Error generating stack: `+s.message+`
75
75
  *
76
76
  * This source code is licensed under the MIT license found in the
77
77
  * LICENSE file in the root directory of this source tree.
78
- */var vo=g;function RP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var PP=typeof Object.is=="function"?Object.is:RP,MP=vo.useState,OP=vo.useEffect,NP=vo.useLayoutEffect,DP=vo.useDebugValue;function IP(e,t){var n=t(),r=MP({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return NP(function(){i.value=n,i.getSnapshot=t,zd(i)&&s({inst:i})},[e,n,t]),OP(function(){return zd(i)&&s({inst:i}),e(function(){zd(i)&&s({inst:i})})},[e]),DP(n),n}function zd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!PP(e,n)}catch{return!0}}function LP(e,t){return t()}var FP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?LP:IP;iS.useSyncExternalStore=vo.useSyncExternalStore!==void 0?vo.useSyncExternalStore:FP;rS.exports=iS;var BP=rS.exports;/**
78
+ */var vo=v;function RP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var PP=typeof Object.is=="function"?Object.is:RP,MP=vo.useState,OP=vo.useEffect,NP=vo.useLayoutEffect,DP=vo.useDebugValue;function IP(e,t){var n=t(),r=MP({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return NP(function(){i.value=n,i.getSnapshot=t,$d(i)&&s({inst:i})},[e,n,t]),OP(function(){return $d(i)&&s({inst:i}),e(function(){$d(i)&&s({inst:i})})},[e]),DP(n),n}function $d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!PP(e,n)}catch{return!0}}function LP(e,t){return t()}var FP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?LP:IP;iS.useSyncExternalStore=vo.useSyncExternalStore!==void 0?vo.useSyncExternalStore:FP;rS.exports=iS;var BP=rS.exports;/**
79
79
  * @license React
80
80
  * use-sync-external-store-shim/with-selector.production.min.js
81
81
  *
@@ -83,23 +83,23 @@ Error generating stack: `+s.message+`
83
83
  *
84
84
  * This source code is licensed under the MIT license found in the
85
85
  * LICENSE file in the root directory of this source tree.
86
- */var ju=g,$P=BP;function zP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var VP=typeof Object.is=="function"?Object.is:zP,UP=$P.useSyncExternalStore,HP=ju.useRef,WP=ju.useEffect,qP=ju.useMemo,GP=ju.useDebugValue;nS.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=HP(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=qP(function(){function l(m){if(!u){if(u=!0,d=m,m=r(m),i!==void 0&&o.hasValue){var y=o.value;if(i(y,m))return c=y}return c=m}if(y=c,VP(d,m))return y;var x=r(m);return i!==void 0&&i(y,x)?y:(d=m,c=x)}var u=!1,d,c,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var a=UP(e,s[0],s[1]);return WP(function(){o.hasValue=!0,o.value=a},[a]),GP(a),a};tS.exports=nS;var YP=tS.exports;const QP=Ar(YP),sS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:KP}=X,{useSyncExternalStoreWithSelector:XP}=QP;let h0=!1;const ZP=e=>e;function JP(e,t=ZP,n){(sS?"production":void 0)!=="production"&&n&&!h0&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),h0=!0);const r=XP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return KP(r),r}const m0=e=>{(sS?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?AP(e):e,n=(r,i)=>JP(t,r,i);return Object.assign(n,t),n},eM=e=>e?m0(e):m0,ie=eM(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",defaultValues:{},soundPath:void 0,isTooltipVisible:!0,onTooltipClose:void 0,anyAdmin:!0,showActionButtons:!1,setIsTooltipVisible:t=>e({isTooltipVisible:t}),setOnTooltipClose:t=>e({onTooltipClose:t}),setOpen:t=>{e({open:t})},setAnyAdmin:t=>e({anyAdmin:t}),setWidget:t=>e({widget:t}),setDefaultValues:t=>e({defaultValues:t}),setIsHaveChat:t=>{var n;if(e({isHaveChat:t}),localStorage.setItem("lc:widget:isHaveChat",t.toString()),!t){e({showActionButtons:!1});const r=(n=ie.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setSoundPath:t=>{e({soundPath:t})},onOpen:void 0,onClose:void 0,setOnOpen:t=>e({onOpen:t}),setOnClose:t=>e({onClose:t}),setIsInputFocused:t=>e({isInputFocused:t}),historyChat:null,setHistoryChat:t=>e({historyChat:t}),historyMessages:null,setHistoryMessages:t=>e({historyMessages:t}),showHistoryOnRegistration:!1,setShowHistoryOnRegistration:t=>e({showHistoryOnRegistration:t}),aiAgent:null,setAIAgent:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Il(r,t,n.isAIAgentMode,n.aiAgentSessionId,n.humanNeedRequested),{aiAgent:t}}),isAIAgentMode:!1,setIsAIAgentMode:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Il(r,n.aiAgent,t,n.aiAgentSessionId,n.humanNeedRequested),{isAIAgentMode:t}}),aiAgentSessionId:null,setAIAgentSessionId:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Il(r,n.aiAgent,n.isAIAgentMode,t,n.humanNeedRequested),{aiAgentSessionId:t}}),humanNeedRequested:!1,setHumanNeedRequested:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;if(r){const s=`${r}:`;t?localStorage.setItem(`${s}${rt.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${rt.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&Il(r,n.aiAgent,n.isAIAgentMode,n.aiAgentSessionId,t)}return{humanNeedRequested:t}}),aiAgentMessages:[],setAIAgentMessages:t=>e(n=>({aiAgentMessages:typeof t=="function"?t(n.aiAgentMessages):t})),addAIAgentMessage:t=>e(n=>({aiAgentMessages:[...n.aiAgentMessages,t]})),clearAIAgentState:()=>e(t=>{var r;const n=(r=t.widget)==null?void 0:r.link_id;return n&&Hm(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1}}),connectingToOperator:!1,setConnectingToOperator:t=>e({connectingToOperator:t}),showOperatorForm:!1,setShowOperatorForm:t=>e({showOperatorForm:t}),setShowActionButtons:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&localStorage.setItem(`${r}:showActionButtons`,t.toString()),{showActionButtons:t}})})),tM=e=>({accessToken:localStorage.getItem(`${e}:${rt.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${rt.CustomerRefreshToken}`)||""}),ol=()=>{const{widget:e}=ie();return e?tM(e.link_id):null},Yi=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}};function Ip(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const Wm=()=>om({mutationFn:e=>Pr(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history,device_id:e.device_id,is_agent_mode:e.is_agent_mode,widget_version:"2026.01.05-1"})})}),nM=(e,t)=>Pr(`clients/${e}/chats`,{headers:t}),sc=(e,t)=>Pr(`clients/${e}/chats`,{method:"DELETE",headers:t}),rM=(e,t,n)=>Pr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{...n,"X-Device-Id":Ko(rt.DeviceId,"")||""}}),iM=()=>{const e=ol();return om({mutationFn:t=>rM(t.rating,t.comment,Yi(e))})},sM=e=>{const t=ol();return om({mutationFn:n=>Pr(`clients/${e}/chats/files`,{method:"POST",headers:Yi(t),body:AT({files:n},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function oM(e){return e&&typeof e=="object"&&"file_urls"in e}const aM=e=>{const t=`${Jw}/visitors/identify`,n=JSON.stringify(e);try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,credentials:"include"}).catch(()=>{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}})}catch{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}}},lM=(e,t)=>hb({queryKey:["visitors","history",e,t],queryFn:()=>Pr(`visitors/history?widget_id=${e}&device_id=${t}`),enabled:!!e&&!!t}),cM=(e,t,n)=>Pr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`);async function uM(e){const[t,n]=await Pr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function us(e){this._maxSize=e,this.clear()}us.prototype.clear=function(){this._size=0,this._values=Object.create(null)};us.prototype.get=function(e){return this._values[e]};us.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var dM=/[^.^\]^[]+|(?=\[\]|\.\.)/g,oS=/^\d+$/,fM=/^\d/,pM=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,hM=/^\s*(['"]?)(.*?)(\1)\s*$/,qm=512,g0=new us(qm),v0=new us(qm),y0=new us(qm),Qi={Cache:us,split:Lp,normalizePath:Vd,setter:function(e){var t=Vd(e);return v0.get(e)||v0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Vd(e);return y0.get(e)||y0.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Gm(n)||oS.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){mM(Array.isArray(e)?e:Lp(e),t,n)}};function Vd(e){return g0.get(e)||g0.set(e,Lp(e).map(function(t){return t.replace(hM,"$2")}))}function Lp(e){return e.match(dM)||[""]}function mM(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(yM(i)&&(i='"'+i+'"'),a=Gm(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Gm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function gM(e){return e.match(fM)&&!e.match(oS)}function vM(e){return pM.test(e)}function yM(e){return!Gm(e)&&(gM(e)||vM(e))}const xM=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Au=e=>e.match(xM)||[],Ru=e=>e[0].toUpperCase()+e.slice(1),Ym=(e,t)=>Au(e).join(t).toLowerCase(),aS=e=>Au(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),wM=e=>Ru(aS(e)),bM=e=>Ym(e,"_"),kM=e=>Ym(e,"-"),SM=e=>Ru(Ym(e," ")),CM=e=>Au(e).map(Ru).join(" ");var Ud={words:Au,upperFirst:Ru,camelCase:aS,pascalCase:wM,snakeCase:bM,kebabCase:kM,sentenceCase:SM,titleCase:CM},Qm={exports:{}};Qm.exports=function(e){return lS(_M(e),e)};Qm.exports.array=lS;function lS(e,t){var n=e.length,r=new Array(n),i={},s=n,o=TM(t),a=EM(e);for(t.forEach(function(u){if(!a.has(u[0])||!a.has(u[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(u,d,c){if(c.has(u)){var f;try{f=", node was:"+JSON.stringify(u)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!a.has(u))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(u));if(!i[d]){i[d]=!0;var m=o.get(u)||new Set;if(m=Array.from(m),d=m.length){c.add(u);do{var y=m[--d];l(y,a.get(y),c)}while(d);c.delete(u)}r[--n]=u}}}function _M(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function TM(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function EM(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var jM=Qm.exports;const AM=Ar(jM),RM=Object.prototype.toString,PM=Error.prototype.toString,MM=RegExp.prototype.toString,OM=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",NM=/^Symbol\((.*)\)(.*)$/;function DM(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function x0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return DM(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return OM.call(e).replace(NM,"Symbol($1)");const r=RM.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+PM.call(e)+"]":r==="RegExp"?MM.call(e):null}function li(e,t){let n=x0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=x0(this[r],t);return s!==null?s:i},2)}function cS(e){return e==null?[]:[].concat(e)}let uS,dS,fS,IM=/\$\{\s*(\w+)\s*\}/g;uS=Symbol.toStringTag;class w0{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[uS]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],cS(t).forEach(s=>{if(Wt.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}dS=Symbol.hasInstance;fS=Symbol.toStringTag;class Wt extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(IM,(i,s)=>li(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new w0(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[fS]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Wt)}static[dS](t){return w0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Yn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${li(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${li(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${li(n,!0)}\``+i}},$t={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},LM={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Fp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},FM={isValue:"${path} field must be ${value}"},oc={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},BM={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},$M={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${li(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${li(n,!0)}\``}return Wt.formatError(Yn.notType,e)}};Object.assign(Object.create(null),{mixed:Yn,string:$t,number:LM,date:Fp,object:oc,array:BM,boolean:FM,tuple:$M});const Km=e=>e&&e.__isYupSchema__;class Gc{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Gc(t,(a,l)=>{var u;let d=o(...a)?i:s;return(u=d==null?void 0:d(l))!=null?u:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Km(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Ll={context:"$",value:"."};class ds{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ll.context,this.isValue=this.key[0]===Ll.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Ll.context:this.isValue?Ll.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Qi.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ds.prototype.__isYupRef=!0;const Ii=e=>e==null;function bs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:u,test:d,params:c,message:f,skipAbsent:m}=e;let{parent:y,context:x,abortEarly:w=o.spec.abortEarly,disableStackTrace:h=o.spec.disableStackTrace}=i;function v(N){return ds.isRef(N)?N.getValue(n,y,x):N}function b(N={}){const ee=Object.assign({value:n,originalValue:s,label:o.spec.label,path:N.path||r,spec:o.spec,disableStackTrace:N.disableStackTrace||h},c,N.params);for(const V of Object.keys(ee))ee[V]=v(ee[V]);const Z=new Wt(Wt.formatError(N.message||f,ee),n,ee.path,N.type||u,ee.disableStackTrace);return Z.params=ee,Z}const T=w?a:l;let C={path:r,parent:y,type:u,from:i.from,createError:b,resolve:v,options:i,originalValue:s,schema:o};const E=N=>{Wt.isError(N)?T(N):N?l(null):T(b())},S=N=>{Wt.isError(N)?T(N):a(N)};if(m&&Ii(n))return E(!0);let B;try{var L;if(B=d.call(C,n,C),typeof((L=B)==null?void 0:L.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(B).then(E,S)}}catch(N){S(N);return}E(B)}return t.OPTIONS=e,t}function zM(e,t,n,r=n){let i,s,o;return t?(Qi.forEach(t,(a,l,u)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let c=e.type==="tuple",f=u?parseInt(d,10):0;if(e.innerType||c){if(c&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=c?e.spec.types[f]:e.innerType}if(!u){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Yc extends Set{describe(){const t=[];for(const n of this.values())t.push(ds.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Yc(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Bs(e,t=new Map){if(Km(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Bs(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Bs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Bs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Bs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class lr{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Yc,this._blacklist=new Yc,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Yn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Bs(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&Ii(s))return s;let o=li(t),a=li(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
86
+ */var Eu=v,$P=BP;function zP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var VP=typeof Object.is=="function"?Object.is:zP,UP=$P.useSyncExternalStore,HP=Eu.useRef,WP=Eu.useEffect,qP=Eu.useMemo,GP=Eu.useDebugValue;nS.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=HP(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=qP(function(){function l(m){if(!c){if(c=!0,d=m,m=r(m),i!==void 0&&o.hasValue){var y=o.value;if(i(y,m))return u=y}return u=m}if(y=u,VP(d,m))return y;var x=r(m);return i!==void 0&&i(y,x)?y:(d=m,u=x)}var c=!1,d,u,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var a=UP(e,s[0],s[1]);return WP(function(){o.hasValue=!0,o.value=a},[a]),GP(a),a};tS.exports=nS;var YP=tS.exports;const QP=Rr(YP),sS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:KP}=X,{useSyncExternalStoreWithSelector:XP}=QP;let p0=!1;const ZP=e=>e;function JP(e,t=ZP,n){(sS?"production":void 0)!=="production"&&n&&!p0&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),p0=!0);const r=XP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return KP(r),r}const h0=e=>{(sS?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?AP(e):e,n=(r,i)=>JP(t,r,i);return Object.assign(n,t),n},eM=e=>e?h0(e):h0,ie=eM(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",defaultValues:{},soundPath:void 0,isTooltipVisible:!0,onTooltipClose:void 0,anyAdmin:!0,showActionButtons:!1,setIsTooltipVisible:t=>e({isTooltipVisible:t}),setOnTooltipClose:t=>e({onTooltipClose:t}),setOpen:t=>{e({open:t})},setAnyAdmin:t=>e({anyAdmin:t}),setWidget:t=>e({widget:t}),setDefaultValues:t=>e({defaultValues:t}),setIsHaveChat:t=>{var n;if(e({isHaveChat:t}),localStorage.setItem("lc:widget:isHaveChat",t.toString()),!t){e({showActionButtons:!1});const r=(n=ie.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setSoundPath:t=>{e({soundPath:t})},onOpen:void 0,onClose:void 0,setOnOpen:t=>e({onOpen:t}),setOnClose:t=>e({onClose:t}),setIsInputFocused:t=>e({isInputFocused:t}),historyChat:null,setHistoryChat:t=>e({historyChat:t}),historyMessages:null,setHistoryMessages:t=>e({historyMessages:t}),showHistoryOnRegistration:!1,setShowHistoryOnRegistration:t=>e({showHistoryOnRegistration:t}),aiAgent:null,setAIAgent:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Il(r,t,n.isAIAgentMode,n.aiAgentSessionId,n.humanNeedRequested),{aiAgent:t}}),isAIAgentMode:!1,setIsAIAgentMode:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Il(r,n.aiAgent,t,n.aiAgentSessionId,n.humanNeedRequested),{isAIAgentMode:t}}),aiAgentSessionId:null,setAIAgentSessionId:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Il(r,n.aiAgent,n.isAIAgentMode,t,n.humanNeedRequested),{aiAgentSessionId:t}}),humanNeedRequested:!1,setHumanNeedRequested:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;if(r){const s=`${r}:`;t?localStorage.setItem(`${s}${rt.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${rt.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&Il(r,n.aiAgent,n.isAIAgentMode,n.aiAgentSessionId,t)}return{humanNeedRequested:t}}),aiAgentMessages:[],setAIAgentMessages:t=>e(n=>({aiAgentMessages:typeof t=="function"?t(n.aiAgentMessages):t})),addAIAgentMessage:t=>e(n=>({aiAgentMessages:[...n.aiAgentMessages,t]})),clearAIAgentState:()=>e(t=>{var r;const n=(r=t.widget)==null?void 0:r.link_id;return n&&Um(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1}}),connectingToOperator:!1,setConnectingToOperator:t=>e({connectingToOperator:t}),showOperatorForm:!1,setShowOperatorForm:t=>e({showOperatorForm:t}),setShowActionButtons:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&localStorage.setItem(`${r}:showActionButtons`,t.toString()),{showActionButtons:t}})})),tM=e=>({accessToken:localStorage.getItem(`${e}:${rt.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${rt.CustomerRefreshToken}`)||""}),ol=()=>{const{widget:e}=ie();return e?tM(e.link_id):null},Yi=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}};function Dp(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const Hm=()=>sm({mutationFn:e=>Mr(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history,device_id:e.device_id,is_agent_mode:e.is_agent_mode,widget_version:"2026.01.05-1"})})}),nM=(e,t)=>Mr(`clients/${e}/chats`,{headers:t}),sc=(e,t)=>Mr(`clients/${e}/chats`,{method:"DELETE",headers:t}),rM=(e,t,n)=>Mr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{...n,"X-Device-Id":Ko(rt.DeviceId,"")||""}}),iM=()=>{const e=ol();return sm({mutationFn:t=>rM(t.rating,t.comment,Yi(e))})},sM=e=>{const t=ol();return sm({mutationFn:n=>Mr(`clients/${e}/chats/files`,{method:"POST",headers:Yi(t),body:AT({files:n},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function oM(e){return e&&typeof e=="object"&&"file_urls"in e}const aM=e=>{const t=`${Jw}/visitors/identify`,n=JSON.stringify(e);try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,credentials:"include"}).catch(()=>{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}})}catch{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}}},lM=(e,t)=>hb({queryKey:["visitors","history",e,t],queryFn:()=>Mr(`visitors/history?widget_id=${e}&device_id=${t}`),enabled:!!e&&!!t}),cM=(e,t,n)=>Mr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`);async function uM(e){const[t,n]=await Mr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function us(e){this._maxSize=e,this.clear()}us.prototype.clear=function(){this._size=0,this._values=Object.create(null)};us.prototype.get=function(e){return this._values[e]};us.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var dM=/[^.^\]^[]+|(?=\[\]|\.\.)/g,oS=/^\d+$/,fM=/^\d/,pM=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,hM=/^\s*(['"]?)(.*?)(\1)\s*$/,Wm=512,m0=new us(Wm),g0=new us(Wm),v0=new us(Wm),Qi={Cache:us,split:Ip,normalizePath:zd,setter:function(e){var t=zd(e);return g0.get(e)||g0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=zd(e);return v0.get(e)||v0.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(qm(n)||oS.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){mM(Array.isArray(e)?e:Ip(e),t,n)}};function zd(e){return m0.get(e)||m0.set(e,Ip(e).map(function(t){return t.replace(hM,"$2")}))}function Ip(e){return e.match(dM)||[""]}function mM(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(yM(i)&&(i='"'+i+'"'),a=qm(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function qm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function gM(e){return e.match(fM)&&!e.match(oS)}function vM(e){return pM.test(e)}function yM(e){return!qm(e)&&(gM(e)||vM(e))}const xM=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,ju=e=>e.match(xM)||[],Au=e=>e[0].toUpperCase()+e.slice(1),Gm=(e,t)=>ju(e).join(t).toLowerCase(),aS=e=>ju(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),wM=e=>Au(aS(e)),bM=e=>Gm(e,"_"),kM=e=>Gm(e,"-"),SM=e=>Au(Gm(e," ")),CM=e=>ju(e).map(Au).join(" ");var Vd={words:ju,upperFirst:Au,camelCase:aS,pascalCase:wM,snakeCase:bM,kebabCase:kM,sentenceCase:SM,titleCase:CM},Ym={exports:{}};Ym.exports=function(e){return lS(_M(e),e)};Ym.exports.array=lS;function lS(e,t){var n=e.length,r=new Array(n),i={},s=n,o=TM(t),a=EM(e);for(t.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(c,d,u){if(u.has(c)){var p;try{p=", node was:"+JSON.stringify(c)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[d]){i[d]=!0;var m=o.get(c)||new Set;if(m=Array.from(m),d=m.length){u.add(c);do{var y=m[--d];l(y,a.get(y),u)}while(d);u.delete(c)}r[--n]=c}}}function _M(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function TM(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function EM(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var jM=Ym.exports;const AM=Rr(jM),RM=Object.prototype.toString,PM=Error.prototype.toString,MM=RegExp.prototype.toString,OM=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",NM=/^Symbol\((.*)\)(.*)$/;function DM(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function y0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return DM(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return OM.call(e).replace(NM,"Symbol($1)");const r=RM.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+PM.call(e)+"]":r==="RegExp"?MM.call(e):null}function ci(e,t){let n=y0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=y0(this[r],t);return s!==null?s:i},2)}function cS(e){return e==null?[]:[].concat(e)}let uS,dS,fS,IM=/\$\{\s*(\w+)\s*\}/g;uS=Symbol.toStringTag;class x0{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[uS]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],cS(t).forEach(s=>{if(Wt.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}dS=Symbol.hasInstance;fS=Symbol.toStringTag;class Wt extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(IM,(i,s)=>ci(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new x0(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[fS]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Wt)}static[dS](t){return x0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Yn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${ci(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ci(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${ci(n,!0)}\``+i}},$t={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},LM={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Lp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},FM={isValue:"${path} field must be ${value}"},oc={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},BM={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},$M={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``}return Wt.formatError(Yn.notType,e)}};Object.assign(Object.create(null),{mixed:Yn,string:$t,number:LM,date:Lp,object:oc,array:BM,boolean:FM,tuple:$M});const Qm=e=>e&&e.__isYupSchema__;class Gc{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Gc(t,(a,l)=>{var c;let d=o(...a)?i:s;return(c=d==null?void 0:d(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Qm(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Ll={context:"$",value:"."};class ds{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Ll.context,this.isValue=this.key[0]===Ll.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Ll.context:this.isValue?Ll.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Qi.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ds.prototype.__isYupRef=!0;const Ii=e=>e==null;function bs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:c,test:d,params:u,message:p,skipAbsent:m}=e;let{parent:y,context:x,abortEarly:w=o.spec.abortEarly,disableStackTrace:h=o.spec.disableStackTrace}=i;function g(N){return ds.isRef(N)?N.getValue(n,y,x):N}function b(N={}){const ee=Object.assign({value:n,originalValue:s,label:o.spec.label,path:N.path||r,spec:o.spec,disableStackTrace:N.disableStackTrace||h},u,N.params);for(const V of Object.keys(ee))ee[V]=g(ee[V]);const Z=new Wt(Wt.formatError(N.message||p,ee),n,ee.path,N.type||c,ee.disableStackTrace);return Z.params=ee,Z}const T=w?a:l;let _={path:r,parent:y,type:c,from:i.from,createError:b,resolve:g,options:i,originalValue:s,schema:o};const E=N=>{Wt.isError(N)?T(N):N?l(null):T(b())},S=N=>{Wt.isError(N)?T(N):a(N)};if(m&&Ii(n))return E(!0);let B;try{var L;if(B=d.call(_,n,_),typeof((L=B)==null?void 0:L.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(B).then(E,S)}}catch(N){S(N);return}E(B)}return t.OPTIONS=e,t}function zM(e,t,n,r=n){let i,s,o;return t?(Qi.forEach(t,(a,l,c)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let u=e.type==="tuple",p=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=u?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Yc extends Set{describe(){const t=[];for(const n of this.values())t.push(ds.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Yc(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Bs(e,t=new Map){if(Qm(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Bs(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Bs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Bs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Bs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class cr{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Yc,this._blacklist=new Yc,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Yn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Bs(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&Ii(s))return s;let o=ci(t),a=ci(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
87
87
 
88
88
  attempted value: ${o}
89
- `+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let d of Object.values(this.internalTests))d&&u.push(d);this.runTests({path:s,value:l,originalValue:o,options:n,tests:u},r,d=>{if(d.length)return i(d,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:u}=t,d=x=>{i||(i=!0,n(x,o))},c=x=>{i||(i=!0,r(x,o))},f=s.length,m=[];if(!f)return c([]);let y={value:o,originalValue:a,path:l,options:u,schema:this};for(let x=0;x<s.length;x++){const w=s[x];w(y,d,function(v){v&&(Array.isArray(v)?m.push(...v):m.push(v)),--f<=0&&c(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let u=r[a];const d=Object.assign({},o,{strict:!0,parent:r,value:u,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(c,f,m)=>this.resolve(d)._validate(u,d,f,m)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,u)=>{Wt.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new Wt(l,u,void 0,void 0,s)):o(u)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw Wt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Wt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Wt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Wt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=bs({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=bs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Yn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Yn.notNull){return this.nullability(!1,t)}required(t=Yn.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Yn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=bs(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=cS(t).map(s=>new ds(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Gc(i,n):Gc.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=bs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Yn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=bs({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=Yn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=bs({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,d)=>d.findIndex(c=>c.name===l.name)===u)}}}lr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])lr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=zM(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])lr.prototype[e]=lr.prototype.oneOf;for(const e of["not","nope"])lr.prototype[e]=lr.prototype.notOneOf;const VM=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function UM(e){const t=Bp(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Bp(e){var t,n;const r=VM.exec(e);return r?{year:pr(r[1]),month:pr(r[2],1)-1,day:pr(r[3],1),hour:pr(r[4]),minute:pr(r[5]),second:pr(r[6]),millisecond:r[7]?pr(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:pr(r[10]),minuteOffset:pr(r[11])}:null}function pr(e,t=0){return Number(e)||t}let HM=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,WM=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,qM=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,GM="^\\d{4}-\\d{2}-\\d{2}",YM="\\d{2}:\\d{2}:\\d{2}",QM="(([+-]\\d{2}(:?\\d{2})?)|Z)",KM=new RegExp(`${GM}T${YM}(\\.\\d+)?${QM}$`),XM=e=>Ii(e)||e===e.trim(),ZM={}.toString();function Qc(){return new pS}class pS extends lr{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===ZM?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Yn.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=$t.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=$t.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=$t.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||$t.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=$t.email){return this.matches(HM,{name:"email",message:t,excludeEmptyString:!0})}url(t=$t.url){return this.matches(WM,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$t.uuid){return this.matches(qM,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(KM,{name:"datetime",message:n||$t.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||$t.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=Bp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||$t.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=Bp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$t.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:XM})}lowercase(t=$t.lowercase){return this.transform(n=>Ii(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toLowerCase()})}uppercase(t=$t.uppercase){return this.transform(n=>Ii(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toUpperCase()})}}Qc.prototype=pS.prototype;let JM=new Date(""),eO=e=>Object.prototype.toString.call(e)==="[object Date]";class Pu extends lr{constructor(){super({type:"date",check(t){return eO(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=UM(t),isNaN(t)?Pu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ds.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Fp.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Fp.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Pu.INVALID_DATE=JM;Pu.prototype;function tO(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Qi.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),ds.isRef(a)&&a.isSibling?s(a.path,o):Km(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return AM.array(Array.from(r),n).reverse()}function b0(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function hS(e){return(t,n)=>b0(e,t)-b0(e,n)}const nO=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function ac(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=ac(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=ac(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(ac)}):"optional"in e?e.optional():e}const rO=(e,t)=>{const n=[...Qi.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Qi.getter(Qi.join(n),!0)(e);return!!(i&&r in i)};let k0=e=>Object.prototype.toString.call(e)==="[object Object]";function S0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const iO=hS([]);function Xm(e){return new mS(e)}class mS extends lr{constructor(t){super({type:"object",check(n){return k0(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=iO,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(c=>!this._nodes.includes(c))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const c of a){let f=s[c],m=c in i;if(f){let y,x=i[c];u.path=(n.path?`${n.path}.`:"")+c,f=f.resolve({value:x,context:n.context,parent:l});let w=f instanceof lr?f.spec:void 0,h=w==null?void 0:w.strict;if(w!=null&&w.strip){d=d||c in i;continue}y=!n.__validating||!h?f.cast(i[c],u):i[c],y!==void 0&&(l[c]=y)}else m&&!o&&(l[c]=i[c]);(m!==c in l||l[c]!==i[c])&&(d=!0)}return d?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,u)=>{if(!a||!k0(u)){i(l,u);return}o=o||u;let d=[];for(let c of this._nodes){let f=this.fields[c];!f||ds.isRef(f)||d.push(f.asNestedTest({options:n,key:c,parent:u,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:u,originalValue:o,options:n},r,c=>{i(c.sort(this._sortErrors).concat(l),u)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=tO(t,n),r._sortErrors=hS(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return ac(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=Qi.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return rO(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(nO)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||oc.exact,test(n){if(n==null)return!0;const r=S0(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=oc.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=S0(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=oc.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Ud.camelCase)}snakeCase(){return this.transformKeys(Ud.snakeCase)}constantCase(){return this.transformKeys(t=>Ud.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}Xm.prototype=mS.prototype;var sO=function(t){return oO(t)&&!aO(t)};function oO(e){return!!e&&typeof e=="object"}function aO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||uO(e)}var lO=typeof Symbol=="function"&&Symbol.for,cO=lO?Symbol.for("react.element"):60103;function uO(e){return e.$$typeof===cO}function dO(e){return Array.isArray(e)?[]:{}}function Kc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ua(dO(e),e,t):e}function fO(e,t,n){return e.concat(t).map(function(r){return Kc(r,n)})}function pO(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Kc(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Kc(t[i],n):r[i]=Ua(e[i],t[i],n)}),r}function Ua(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||fO,n.isMergeableObject=n.isMergeableObject||sO;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):pO(e,t,n):Kc(t,n)}Ua.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Ua(r,i,n)},{})};var $p=Ua,gS=typeof global=="object"&&global&&global.Object===Object&&global,hO=typeof self=="object"&&self&&self.Object===Object&&self,ur=gS||hO||Function("return this")(),gi=ur.Symbol,vS=Object.prototype,mO=vS.hasOwnProperty,gO=vS.toString,zo=gi?gi.toStringTag:void 0;function vO(e){var t=mO.call(e,zo),n=e[zo];try{e[zo]=void 0;var r=!0}catch{}var i=gO.call(e);return r&&(t?e[zo]=n:delete e[zo]),i}var yO=Object.prototype,xO=yO.toString;function wO(e){return xO.call(e)}var bO="[object Null]",kO="[object Undefined]",C0=gi?gi.toStringTag:void 0;function fs(e){return e==null?e===void 0?kO:bO:C0&&C0 in Object(e)?vO(e):wO(e)}function yS(e,t){return function(n){return e(t(n))}}var Zm=yS(Object.getPrototypeOf,Object);function ps(e){return e!=null&&typeof e=="object"}var SO="[object Object]",CO=Function.prototype,_O=Object.prototype,xS=CO.toString,TO=_O.hasOwnProperty,EO=xS.call(Object);function _0(e){if(!ps(e)||fs(e)!=SO)return!1;var t=Zm(e);if(t===null)return!0;var n=TO.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&xS.call(n)==EO}function jO(){this.__data__=[],this.size=0}function wS(e,t){return e===t||e!==e&&t!==t}function Mu(e,t){for(var n=e.length;n--;)if(wS(e[n][0],t))return n;return-1}var AO=Array.prototype,RO=AO.splice;function PO(e){var t=this.__data__,n=Mu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():RO.call(t,n,1),--this.size,!0}function MO(e){var t=this.__data__,n=Mu(t,e);return n<0?void 0:t[n][1]}function OO(e){return Mu(this.__data__,e)>-1}function NO(e,t){var n=this.__data__,r=Mu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Mr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mr.prototype.clear=jO;Mr.prototype.delete=PO;Mr.prototype.get=MO;Mr.prototype.has=OO;Mr.prototype.set=NO;function DO(){this.__data__=new Mr,this.size=0}function IO(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function LO(e){return this.__data__.get(e)}function FO(e){return this.__data__.has(e)}function al(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var BO="[object AsyncFunction]",$O="[object Function]",zO="[object GeneratorFunction]",VO="[object Proxy]";function bS(e){if(!al(e))return!1;var t=fs(e);return t==$O||t==zO||t==BO||t==VO}var Hd=ur["__core-js_shared__"],T0=function(){var e=/[^.]+$/.exec(Hd&&Hd.keys&&Hd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function UO(e){return!!T0&&T0 in e}var HO=Function.prototype,WO=HO.toString;function hs(e){if(e!=null){try{return WO.call(e)}catch{}try{return e+""}catch{}}return""}var qO=/[\\^$.*+?()[\]{}|]/g,GO=/^\[object .+?Constructor\]$/,YO=Function.prototype,QO=Object.prototype,KO=YO.toString,XO=QO.hasOwnProperty,ZO=RegExp("^"+KO.call(XO).replace(qO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function JO(e){if(!al(e)||UO(e))return!1;var t=bS(e)?ZO:GO;return t.test(hs(e))}function eN(e,t){return e==null?void 0:e[t]}function ms(e,t){var n=eN(e,t);return JO(n)?n:void 0}var Ha=ms(ur,"Map"),Wa=ms(Object,"create");function tN(){this.__data__=Wa?Wa(null):{},this.size=0}function nN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var rN="__lodash_hash_undefined__",iN=Object.prototype,sN=iN.hasOwnProperty;function oN(e){var t=this.__data__;if(Wa){var n=t[e];return n===rN?void 0:n}return sN.call(t,e)?t[e]:void 0}var aN=Object.prototype,lN=aN.hasOwnProperty;function cN(e){var t=this.__data__;return Wa?t[e]!==void 0:lN.call(t,e)}var uN="__lodash_hash_undefined__";function dN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wa&&t===void 0?uN:t,this}function is(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}is.prototype.clear=tN;is.prototype.delete=nN;is.prototype.get=oN;is.prototype.has=cN;is.prototype.set=dN;function fN(){this.size=0,this.__data__={hash:new is,map:new(Ha||Mr),string:new is}}function pN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ou(e,t){var n=e.__data__;return pN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function hN(e){var t=Ou(this,e).delete(e);return this.size-=t?1:0,t}function mN(e){return Ou(this,e).get(e)}function gN(e){return Ou(this,e).has(e)}function vN(e,t){var n=Ou(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bi.prototype.clear=fN;bi.prototype.delete=hN;bi.prototype.get=mN;bi.prototype.has=gN;bi.prototype.set=vN;var yN=200;function xN(e,t){var n=this.__data__;if(n instanceof Mr){var r=n.__data__;if(!Ha||r.length<yN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bi(r)}return n.set(e,t),this.size=n.size,this}function jo(e){var t=this.__data__=new Mr(e);this.size=t.size}jo.prototype.clear=DO;jo.prototype.delete=IO;jo.prototype.get=LO;jo.prototype.has=FO;jo.prototype.set=xN;function wN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var E0=function(){try{var e=ms(Object,"defineProperty");return e({},"",{}),e}catch{}}();function kS(e,t,n){t=="__proto__"&&E0?E0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var bN=Object.prototype,kN=bN.hasOwnProperty;function SS(e,t,n){var r=e[t];(!(kN.call(e,t)&&wS(r,n))||n===void 0&&!(t in e))&&kS(e,t,n)}function Nu(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?kS(n,a,l):SS(n,a,l)}return n}function SN(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var CN="[object Arguments]";function j0(e){return ps(e)&&fs(e)==CN}var CS=Object.prototype,_N=CS.hasOwnProperty,TN=CS.propertyIsEnumerable,EN=j0(function(){return arguments}())?j0:function(e){return ps(e)&&_N.call(e,"callee")&&!TN.call(e,"callee")},ll=Array.isArray;function jN(){return!1}var _S=typeof nn=="object"&&nn&&!nn.nodeType&&nn,A0=_S&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,AN=A0&&A0.exports===_S,R0=AN?ur.Buffer:void 0,RN=R0?R0.isBuffer:void 0,TS=RN||jN,PN=9007199254740991,MN=/^(?:0|[1-9]\d*)$/;function ON(e,t){var n=typeof e;return t=t??PN,!!t&&(n=="number"||n!="symbol"&&MN.test(e))&&e>-1&&e%1==0&&e<t}var NN=9007199254740991;function ES(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=NN}var DN="[object Arguments]",IN="[object Array]",LN="[object Boolean]",FN="[object Date]",BN="[object Error]",$N="[object Function]",zN="[object Map]",VN="[object Number]",UN="[object Object]",HN="[object RegExp]",WN="[object Set]",qN="[object String]",GN="[object WeakMap]",YN="[object ArrayBuffer]",QN="[object DataView]",KN="[object Float32Array]",XN="[object Float64Array]",ZN="[object Int8Array]",JN="[object Int16Array]",e4="[object Int32Array]",t4="[object Uint8Array]",n4="[object Uint8ClampedArray]",r4="[object Uint16Array]",i4="[object Uint32Array]",Be={};Be[KN]=Be[XN]=Be[ZN]=Be[JN]=Be[e4]=Be[t4]=Be[n4]=Be[r4]=Be[i4]=!0;Be[DN]=Be[IN]=Be[YN]=Be[LN]=Be[QN]=Be[FN]=Be[BN]=Be[$N]=Be[zN]=Be[VN]=Be[UN]=Be[HN]=Be[WN]=Be[qN]=Be[GN]=!1;function s4(e){return ps(e)&&ES(e.length)&&!!Be[fs(e)]}function Jm(e){return function(t){return e(t)}}var jS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,fa=jS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,o4=fa&&fa.exports===jS,Wd=o4&&gS.process,yo=function(){try{var e=fa&&fa.require&&fa.require("util").types;return e||Wd&&Wd.binding&&Wd.binding("util")}catch{}}(),P0=yo&&yo.isTypedArray,a4=P0?Jm(P0):s4,l4=Object.prototype,c4=l4.hasOwnProperty;function AS(e,t){var n=ll(e),r=!n&&EN(e),i=!n&&!r&&TS(e),s=!n&&!r&&!i&&a4(e),o=n||r||i||s,a=o?SN(e.length,String):[],l=a.length;for(var u in e)(t||c4.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ON(u,l)))&&a.push(u);return a}var u4=Object.prototype;function eg(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||u4;return e===n}var d4=yS(Object.keys,Object),f4=Object.prototype,p4=f4.hasOwnProperty;function h4(e){if(!eg(e))return d4(e);var t=[];for(var n in Object(e))p4.call(e,n)&&n!="constructor"&&t.push(n);return t}function RS(e){return e!=null&&ES(e.length)&&!bS(e)}function tg(e){return RS(e)?AS(e):h4(e)}function m4(e,t){return e&&Nu(t,tg(t),e)}function g4(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var v4=Object.prototype,y4=v4.hasOwnProperty;function x4(e){if(!al(e))return g4(e);var t=eg(e),n=[];for(var r in e)r=="constructor"&&(t||!y4.call(e,r))||n.push(r);return n}function ng(e){return RS(e)?AS(e,!0):x4(e)}function w4(e,t){return e&&Nu(t,ng(t),e)}var PS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,M0=PS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,b4=M0&&M0.exports===PS,O0=b4?ur.Buffer:void 0,N0=O0?O0.allocUnsafe:void 0;function k4(e,t){if(t)return e.slice();var n=e.length,r=N0?N0(n):new e.constructor(n);return e.copy(r),r}function MS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function S4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function OS(){return[]}var C4=Object.prototype,_4=C4.propertyIsEnumerable,D0=Object.getOwnPropertySymbols,rg=D0?function(e){return e==null?[]:(e=Object(e),S4(D0(e),function(t){return _4.call(e,t)}))}:OS;function T4(e,t){return Nu(e,rg(e),t)}function NS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var E4=Object.getOwnPropertySymbols,DS=E4?function(e){for(var t=[];e;)NS(t,rg(e)),e=Zm(e);return t}:OS;function j4(e,t){return Nu(e,DS(e),t)}function IS(e,t,n){var r=t(e);return ll(e)?r:NS(r,n(e))}function A4(e){return IS(e,tg,rg)}function R4(e){return IS(e,ng,DS)}var zp=ms(ur,"DataView"),Vp=ms(ur,"Promise"),Up=ms(ur,"Set"),Hp=ms(ur,"WeakMap"),I0="[object Map]",P4="[object Object]",L0="[object Promise]",F0="[object Set]",B0="[object WeakMap]",$0="[object DataView]",M4=hs(zp),O4=hs(Ha),N4=hs(Vp),D4=hs(Up),I4=hs(Hp),yr=fs;(zp&&yr(new zp(new ArrayBuffer(1)))!=$0||Ha&&yr(new Ha)!=I0||Vp&&yr(Vp.resolve())!=L0||Up&&yr(new Up)!=F0||Hp&&yr(new Hp)!=B0)&&(yr=function(e){var t=fs(e),n=t==P4?e.constructor:void 0,r=n?hs(n):"";if(r)switch(r){case M4:return $0;case O4:return I0;case N4:return L0;case D4:return F0;case I4:return B0}return t});var L4=Object.prototype,F4=L4.hasOwnProperty;function B4(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&F4.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var z0=ur.Uint8Array;function ig(e){var t=new e.constructor(e.byteLength);return new z0(t).set(new z0(e)),t}function $4(e,t){var n=t?ig(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var z4=/\w*$/;function V4(e){var t=new e.constructor(e.source,z4.exec(e));return t.lastIndex=e.lastIndex,t}var V0=gi?gi.prototype:void 0,U0=V0?V0.valueOf:void 0;function U4(e){return U0?Object(U0.call(e)):{}}function H4(e,t){var n=t?ig(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var W4="[object Boolean]",q4="[object Date]",G4="[object Map]",Y4="[object Number]",Q4="[object RegExp]",K4="[object Set]",X4="[object String]",Z4="[object Symbol]",J4="[object ArrayBuffer]",eD="[object DataView]",tD="[object Float32Array]",nD="[object Float64Array]",rD="[object Int8Array]",iD="[object Int16Array]",sD="[object Int32Array]",oD="[object Uint8Array]",aD="[object Uint8ClampedArray]",lD="[object Uint16Array]",cD="[object Uint32Array]";function uD(e,t,n){var r=e.constructor;switch(t){case J4:return ig(e);case W4:case q4:return new r(+e);case eD:return $4(e,n);case tD:case nD:case rD:case iD:case sD:case oD:case aD:case lD:case cD:return H4(e,n);case G4:return new r;case Y4:case X4:return new r(e);case Q4:return V4(e);case K4:return new r;case Z4:return U4(e)}}var H0=Object.create,dD=function(){function e(){}return function(t){if(!al(t))return{};if(H0)return H0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function fD(e){return typeof e.constructor=="function"&&!eg(e)?dD(Zm(e)):{}}var pD="[object Map]";function hD(e){return ps(e)&&yr(e)==pD}var W0=yo&&yo.isMap,mD=W0?Jm(W0):hD,gD="[object Set]";function vD(e){return ps(e)&&yr(e)==gD}var q0=yo&&yo.isSet,yD=q0?Jm(q0):vD,xD=1,wD=2,bD=4,LS="[object Arguments]",kD="[object Array]",SD="[object Boolean]",CD="[object Date]",_D="[object Error]",FS="[object Function]",TD="[object GeneratorFunction]",ED="[object Map]",jD="[object Number]",BS="[object Object]",AD="[object RegExp]",RD="[object Set]",PD="[object String]",MD="[object Symbol]",OD="[object WeakMap]",ND="[object ArrayBuffer]",DD="[object DataView]",ID="[object Float32Array]",LD="[object Float64Array]",FD="[object Int8Array]",BD="[object Int16Array]",$D="[object Int32Array]",zD="[object Uint8Array]",VD="[object Uint8ClampedArray]",UD="[object Uint16Array]",HD="[object Uint32Array]",De={};De[LS]=De[kD]=De[ND]=De[DD]=De[SD]=De[CD]=De[ID]=De[LD]=De[FD]=De[BD]=De[$D]=De[ED]=De[jD]=De[BS]=De[AD]=De[RD]=De[PD]=De[MD]=De[zD]=De[VD]=De[UD]=De[HD]=!0;De[_D]=De[FS]=De[OD]=!1;function pa(e,t,n,r,i,s){var o,a=t&xD,l=t&wD,u=t&bD;if(o!==void 0)return o;if(!al(e))return e;var d=ll(e);if(d){if(o=B4(e),!a)return MS(e,o)}else{var c=yr(e),f=c==FS||c==TD;if(TS(e))return k4(e,a);if(c==BS||c==LS||f&&!i){if(o=l||f?{}:fD(e),!a)return l?j4(e,w4(o,e)):T4(e,m4(o,e))}else{if(!De[c])return i?e:{};o=uD(e,c,a)}}s||(s=new jo);var m=s.get(e);if(m)return m;s.set(e,o),yD(e)?e.forEach(function(w){o.add(pa(w,t,n,w,e,s))}):mD(e)&&e.forEach(function(w,h){o.set(h,pa(w,t,n,h,e,s))});var y=u?l?R4:A4:l?ng:tg,x=d?void 0:y(e);return wN(x||e,function(w,h){x&&(h=w,w=e[h]),SS(o,h,pa(w,t,n,h,e,s))}),o}var WD=1,qD=4;function Fl(e){return pa(e,WD|qD)}var G0=Array.isArray,Y0=Object.keys,GD=Object.prototype.hasOwnProperty,YD=typeof Element<"u";function Wp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=G0(e),r=G0(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!Wp(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=e instanceof Date,l=t instanceof Date;if(a!=l)return!1;if(a&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var c=Y0(e);if(s=c.length,s!==Y0(t).length)return!1;for(i=s;i--!==0;)if(!GD.call(t,c[i]))return!1;if(YD&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=c[i],!(o==="_owner"&&e.$$typeof)&&!Wp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var QD=function(t,n){try{return Wp(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Ai=Ar(QD);var KD=4;function Q0(e){return pa(e,KD)}function $S(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var XD="[object Symbol]";function sg(e){return typeof e=="symbol"||ps(e)&&fs(e)==XD}var ZD="Expected a function";function og(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ZD);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(og.Cache||bi),n}og.Cache=bi;var JD=500;function eI(e){var t=og(e,function(r){return n.size===JD&&n.clear(),r}),n=t.cache;return t}var tI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nI=/\\(\\)?/g,rI=eI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tI,function(n,r,i,s){t.push(i?s.replace(nI,"$1"):r||n)}),t}),iI=1/0;function sI(e){if(typeof e=="string"||sg(e))return e;var t=e+"";return t=="0"&&1/e==-iI?"-0":t}var oI=1/0,K0=gi?gi.prototype:void 0,X0=K0?K0.toString:void 0;function zS(e){if(typeof e=="string")return e;if(ll(e))return $S(e,zS)+"";if(sg(e))return X0?X0.call(e):"";var t=e+"";return t=="0"&&1/e==-oI?"-0":t}function aI(e){return e==null?"":zS(e)}function VS(e){return ll(e)?$S(e,sI):sg(e)?[e]:MS(rI(aI(e)))}var US={exports:{}},Me={};/** @license React v16.13.1
89
+ `+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let d of Object.values(this.internalTests))d&&c.push(d);this.runTests({path:s,value:l,originalValue:o,options:n,tests:c},r,d=>{if(d.length)return i(d,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:c}=t,d=x=>{i||(i=!0,n(x,o))},u=x=>{i||(i=!0,r(x,o))},p=s.length,m=[];if(!p)return u([]);let y={value:o,originalValue:a,path:l,options:c,schema:this};for(let x=0;x<s.length;x++){const w=s[x];w(y,d,function(g){g&&(Array.isArray(g)?m.push(...g):m.push(g)),--p<=0&&u(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let c=r[a];const d=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(u,p,m)=>this.resolve(d)._validate(c,d,p,m)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,c)=>{Wt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Wt(l,c,void 0,void 0,s)):o(c)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw Wt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Wt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Wt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Wt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=bs({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=bs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Yn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Yn.notNull){return this.nullability(!1,t)}required(t=Yn.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Yn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=bs(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=cS(t).map(s=>new ds(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Gc(i,n):Gc.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=bs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Yn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=bs({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=Yn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=bs({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,d)=>d.findIndex(u=>u.name===l.name)===c)}}}cr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])cr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=zM(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])cr.prototype[e]=cr.prototype.oneOf;for(const e of["not","nope"])cr.prototype[e]=cr.prototype.notOneOf;const VM=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function UM(e){const t=Fp(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Fp(e){var t,n;const r=VM.exec(e);return r?{year:hr(r[1]),month:hr(r[2],1)-1,day:hr(r[3],1),hour:hr(r[4]),minute:hr(r[5]),second:hr(r[6]),millisecond:r[7]?hr(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:hr(r[10]),minuteOffset:hr(r[11])}:null}function hr(e,t=0){return Number(e)||t}let HM=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,WM=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,qM=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,GM="^\\d{4}-\\d{2}-\\d{2}",YM="\\d{2}:\\d{2}:\\d{2}",QM="(([+-]\\d{2}(:?\\d{2})?)|Z)",KM=new RegExp(`${GM}T${YM}(\\.\\d+)?${QM}$`),XM=e=>Ii(e)||e===e.trim(),ZM={}.toString();function Qc(){return new pS}class pS extends cr{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===ZM?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Yn.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=$t.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=$t.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=$t.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||$t.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=$t.email){return this.matches(HM,{name:"email",message:t,excludeEmptyString:!0})}url(t=$t.url){return this.matches(WM,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$t.uuid){return this.matches(qM,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(KM,{name:"datetime",message:n||$t.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||$t.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=Fp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||$t.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=Fp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$t.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:XM})}lowercase(t=$t.lowercase){return this.transform(n=>Ii(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toLowerCase()})}uppercase(t=$t.uppercase){return this.transform(n=>Ii(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toUpperCase()})}}Qc.prototype=pS.prototype;let JM=new Date(""),eO=e=>Object.prototype.toString.call(e)==="[object Date]";class Ru extends cr{constructor(){super({type:"date",check(t){return eO(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=UM(t),isNaN(t)?Ru.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ds.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Lp.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Lp.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Ru.INVALID_DATE=JM;Ru.prototype;function tO(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Qi.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),ds.isRef(a)&&a.isSibling?s(a.path,o):Qm(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return AM.array(Array.from(r),n).reverse()}function w0(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function hS(e){return(t,n)=>w0(e,t)-w0(e,n)}const nO=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function ac(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=ac(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=ac(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(ac)}):"optional"in e?e.optional():e}const rO=(e,t)=>{const n=[...Qi.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Qi.getter(Qi.join(n),!0)(e);return!!(i&&r in i)};let b0=e=>Object.prototype.toString.call(e)==="[object Object]";function k0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const iO=hS([]);function Km(e){return new mS(e)}class mS extends cr{constructor(t){super({type:"object",check(n){return b0(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=iO,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const u of a){let p=s[u],m=u in i;if(p){let y,x=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:x,context:n.context,parent:l});let w=p instanceof cr?p.spec:void 0,h=w==null?void 0:w.strict;if(w!=null&&w.strip){d=d||u in i;continue}y=!n.__validating||!h?p.cast(i[u],c):i[u],y!==void 0&&(l[u]=y)}else m&&!o&&(l[u]=i[u]);(m!==u in l||l[u]!==i[u])&&(d=!0)}return d?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,c)=>{if(!a||!b0(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||ds.isRef(p)||d.push(p.asNestedTest({options:n,key:u,parent:c,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:c,originalValue:o,options:n},r,u=>{i(u.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=tO(t,n),r._sortErrors=hS(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return ac(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=Qi.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return rO(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(nO)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||oc.exact,test(n){if(n==null)return!0;const r=k0(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=oc.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=k0(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=oc.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Vd.camelCase)}snakeCase(){return this.transformKeys(Vd.snakeCase)}constantCase(){return this.transformKeys(t=>Vd.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}Km.prototype=mS.prototype;var sO=function(t){return oO(t)&&!aO(t)};function oO(e){return!!e&&typeof e=="object"}function aO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||uO(e)}var lO=typeof Symbol=="function"&&Symbol.for,cO=lO?Symbol.for("react.element"):60103;function uO(e){return e.$$typeof===cO}function dO(e){return Array.isArray(e)?[]:{}}function Kc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ua(dO(e),e,t):e}function fO(e,t,n){return e.concat(t).map(function(r){return Kc(r,n)})}function pO(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Kc(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Kc(t[i],n):r[i]=Ua(e[i],t[i],n)}),r}function Ua(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||fO,n.isMergeableObject=n.isMergeableObject||sO;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):pO(e,t,n):Kc(t,n)}Ua.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Ua(r,i,n)},{})};var Bp=Ua,gS=typeof global=="object"&&global&&global.Object===Object&&global,hO=typeof self=="object"&&self&&self.Object===Object&&self,dr=gS||hO||Function("return this")(),gi=dr.Symbol,vS=Object.prototype,mO=vS.hasOwnProperty,gO=vS.toString,zo=gi?gi.toStringTag:void 0;function vO(e){var t=mO.call(e,zo),n=e[zo];try{e[zo]=void 0;var r=!0}catch{}var i=gO.call(e);return r&&(t?e[zo]=n:delete e[zo]),i}var yO=Object.prototype,xO=yO.toString;function wO(e){return xO.call(e)}var bO="[object Null]",kO="[object Undefined]",S0=gi?gi.toStringTag:void 0;function fs(e){return e==null?e===void 0?kO:bO:S0&&S0 in Object(e)?vO(e):wO(e)}function yS(e,t){return function(n){return e(t(n))}}var Xm=yS(Object.getPrototypeOf,Object);function ps(e){return e!=null&&typeof e=="object"}var SO="[object Object]",CO=Function.prototype,_O=Object.prototype,xS=CO.toString,TO=_O.hasOwnProperty,EO=xS.call(Object);function C0(e){if(!ps(e)||fs(e)!=SO)return!1;var t=Xm(e);if(t===null)return!0;var n=TO.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&xS.call(n)==EO}function jO(){this.__data__=[],this.size=0}function wS(e,t){return e===t||e!==e&&t!==t}function Pu(e,t){for(var n=e.length;n--;)if(wS(e[n][0],t))return n;return-1}var AO=Array.prototype,RO=AO.splice;function PO(e){var t=this.__data__,n=Pu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():RO.call(t,n,1),--this.size,!0}function MO(e){var t=this.__data__,n=Pu(t,e);return n<0?void 0:t[n][1]}function OO(e){return Pu(this.__data__,e)>-1}function NO(e,t){var n=this.__data__,r=Pu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=jO;Or.prototype.delete=PO;Or.prototype.get=MO;Or.prototype.has=OO;Or.prototype.set=NO;function DO(){this.__data__=new Or,this.size=0}function IO(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function LO(e){return this.__data__.get(e)}function FO(e){return this.__data__.has(e)}function al(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var BO="[object AsyncFunction]",$O="[object Function]",zO="[object GeneratorFunction]",VO="[object Proxy]";function bS(e){if(!al(e))return!1;var t=fs(e);return t==$O||t==zO||t==BO||t==VO}var Ud=dr["__core-js_shared__"],_0=function(){var e=/[^.]+$/.exec(Ud&&Ud.keys&&Ud.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function UO(e){return!!_0&&_0 in e}var HO=Function.prototype,WO=HO.toString;function hs(e){if(e!=null){try{return WO.call(e)}catch{}try{return e+""}catch{}}return""}var qO=/[\\^$.*+?()[\]{}|]/g,GO=/^\[object .+?Constructor\]$/,YO=Function.prototype,QO=Object.prototype,KO=YO.toString,XO=QO.hasOwnProperty,ZO=RegExp("^"+KO.call(XO).replace(qO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function JO(e){if(!al(e)||UO(e))return!1;var t=bS(e)?ZO:GO;return t.test(hs(e))}function eN(e,t){return e==null?void 0:e[t]}function ms(e,t){var n=eN(e,t);return JO(n)?n:void 0}var Ha=ms(dr,"Map"),Wa=ms(Object,"create");function tN(){this.__data__=Wa?Wa(null):{},this.size=0}function nN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var rN="__lodash_hash_undefined__",iN=Object.prototype,sN=iN.hasOwnProperty;function oN(e){var t=this.__data__;if(Wa){var n=t[e];return n===rN?void 0:n}return sN.call(t,e)?t[e]:void 0}var aN=Object.prototype,lN=aN.hasOwnProperty;function cN(e){var t=this.__data__;return Wa?t[e]!==void 0:lN.call(t,e)}var uN="__lodash_hash_undefined__";function dN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wa&&t===void 0?uN:t,this}function is(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}is.prototype.clear=tN;is.prototype.delete=nN;is.prototype.get=oN;is.prototype.has=cN;is.prototype.set=dN;function fN(){this.size=0,this.__data__={hash:new is,map:new(Ha||Or),string:new is}}function pN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Mu(e,t){var n=e.__data__;return pN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function hN(e){var t=Mu(this,e).delete(e);return this.size-=t?1:0,t}function mN(e){return Mu(this,e).get(e)}function gN(e){return Mu(this,e).has(e)}function vN(e,t){var n=Mu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bi.prototype.clear=fN;bi.prototype.delete=hN;bi.prototype.get=mN;bi.prototype.has=gN;bi.prototype.set=vN;var yN=200;function xN(e,t){var n=this.__data__;if(n instanceof Or){var r=n.__data__;if(!Ha||r.length<yN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bi(r)}return n.set(e,t),this.size=n.size,this}function jo(e){var t=this.__data__=new Or(e);this.size=t.size}jo.prototype.clear=DO;jo.prototype.delete=IO;jo.prototype.get=LO;jo.prototype.has=FO;jo.prototype.set=xN;function wN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var T0=function(){try{var e=ms(Object,"defineProperty");return e({},"",{}),e}catch{}}();function kS(e,t,n){t=="__proto__"&&T0?T0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var bN=Object.prototype,kN=bN.hasOwnProperty;function SS(e,t,n){var r=e[t];(!(kN.call(e,t)&&wS(r,n))||n===void 0&&!(t in e))&&kS(e,t,n)}function Ou(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?kS(n,a,l):SS(n,a,l)}return n}function SN(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var CN="[object Arguments]";function E0(e){return ps(e)&&fs(e)==CN}var CS=Object.prototype,_N=CS.hasOwnProperty,TN=CS.propertyIsEnumerable,EN=E0(function(){return arguments}())?E0:function(e){return ps(e)&&_N.call(e,"callee")&&!TN.call(e,"callee")},ll=Array.isArray;function jN(){return!1}var _S=typeof nn=="object"&&nn&&!nn.nodeType&&nn,j0=_S&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,AN=j0&&j0.exports===_S,A0=AN?dr.Buffer:void 0,RN=A0?A0.isBuffer:void 0,TS=RN||jN,PN=9007199254740991,MN=/^(?:0|[1-9]\d*)$/;function ON(e,t){var n=typeof e;return t=t??PN,!!t&&(n=="number"||n!="symbol"&&MN.test(e))&&e>-1&&e%1==0&&e<t}var NN=9007199254740991;function ES(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=NN}var DN="[object Arguments]",IN="[object Array]",LN="[object Boolean]",FN="[object Date]",BN="[object Error]",$N="[object Function]",zN="[object Map]",VN="[object Number]",UN="[object Object]",HN="[object RegExp]",WN="[object Set]",qN="[object String]",GN="[object WeakMap]",YN="[object ArrayBuffer]",QN="[object DataView]",KN="[object Float32Array]",XN="[object Float64Array]",ZN="[object Int8Array]",JN="[object Int16Array]",e4="[object Int32Array]",t4="[object Uint8Array]",n4="[object Uint8ClampedArray]",r4="[object Uint16Array]",i4="[object Uint32Array]",Be={};Be[KN]=Be[XN]=Be[ZN]=Be[JN]=Be[e4]=Be[t4]=Be[n4]=Be[r4]=Be[i4]=!0;Be[DN]=Be[IN]=Be[YN]=Be[LN]=Be[QN]=Be[FN]=Be[BN]=Be[$N]=Be[zN]=Be[VN]=Be[UN]=Be[HN]=Be[WN]=Be[qN]=Be[GN]=!1;function s4(e){return ps(e)&&ES(e.length)&&!!Be[fs(e)]}function Zm(e){return function(t){return e(t)}}var jS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,fa=jS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,o4=fa&&fa.exports===jS,Hd=o4&&gS.process,yo=function(){try{var e=fa&&fa.require&&fa.require("util").types;return e||Hd&&Hd.binding&&Hd.binding("util")}catch{}}(),R0=yo&&yo.isTypedArray,a4=R0?Zm(R0):s4,l4=Object.prototype,c4=l4.hasOwnProperty;function AS(e,t){var n=ll(e),r=!n&&EN(e),i=!n&&!r&&TS(e),s=!n&&!r&&!i&&a4(e),o=n||r||i||s,a=o?SN(e.length,String):[],l=a.length;for(var c in e)(t||c4.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ON(c,l)))&&a.push(c);return a}var u4=Object.prototype;function Jm(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||u4;return e===n}var d4=yS(Object.keys,Object),f4=Object.prototype,p4=f4.hasOwnProperty;function h4(e){if(!Jm(e))return d4(e);var t=[];for(var n in Object(e))p4.call(e,n)&&n!="constructor"&&t.push(n);return t}function RS(e){return e!=null&&ES(e.length)&&!bS(e)}function eg(e){return RS(e)?AS(e):h4(e)}function m4(e,t){return e&&Ou(t,eg(t),e)}function g4(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var v4=Object.prototype,y4=v4.hasOwnProperty;function x4(e){if(!al(e))return g4(e);var t=Jm(e),n=[];for(var r in e)r=="constructor"&&(t||!y4.call(e,r))||n.push(r);return n}function tg(e){return RS(e)?AS(e,!0):x4(e)}function w4(e,t){return e&&Ou(t,tg(t),e)}var PS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,P0=PS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,b4=P0&&P0.exports===PS,M0=b4?dr.Buffer:void 0,O0=M0?M0.allocUnsafe:void 0;function k4(e,t){if(t)return e.slice();var n=e.length,r=O0?O0(n):new e.constructor(n);return e.copy(r),r}function MS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function S4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function OS(){return[]}var C4=Object.prototype,_4=C4.propertyIsEnumerable,N0=Object.getOwnPropertySymbols,ng=N0?function(e){return e==null?[]:(e=Object(e),S4(N0(e),function(t){return _4.call(e,t)}))}:OS;function T4(e,t){return Ou(e,ng(e),t)}function NS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var E4=Object.getOwnPropertySymbols,DS=E4?function(e){for(var t=[];e;)NS(t,ng(e)),e=Xm(e);return t}:OS;function j4(e,t){return Ou(e,DS(e),t)}function IS(e,t,n){var r=t(e);return ll(e)?r:NS(r,n(e))}function A4(e){return IS(e,eg,ng)}function R4(e){return IS(e,tg,DS)}var $p=ms(dr,"DataView"),zp=ms(dr,"Promise"),Vp=ms(dr,"Set"),Up=ms(dr,"WeakMap"),D0="[object Map]",P4="[object Object]",I0="[object Promise]",L0="[object Set]",F0="[object WeakMap]",B0="[object DataView]",M4=hs($p),O4=hs(Ha),N4=hs(zp),D4=hs(Vp),I4=hs(Up),xr=fs;($p&&xr(new $p(new ArrayBuffer(1)))!=B0||Ha&&xr(new Ha)!=D0||zp&&xr(zp.resolve())!=I0||Vp&&xr(new Vp)!=L0||Up&&xr(new Up)!=F0)&&(xr=function(e){var t=fs(e),n=t==P4?e.constructor:void 0,r=n?hs(n):"";if(r)switch(r){case M4:return B0;case O4:return D0;case N4:return I0;case D4:return L0;case I4:return F0}return t});var L4=Object.prototype,F4=L4.hasOwnProperty;function B4(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&F4.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var $0=dr.Uint8Array;function rg(e){var t=new e.constructor(e.byteLength);return new $0(t).set(new $0(e)),t}function $4(e,t){var n=t?rg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var z4=/\w*$/;function V4(e){var t=new e.constructor(e.source,z4.exec(e));return t.lastIndex=e.lastIndex,t}var z0=gi?gi.prototype:void 0,V0=z0?z0.valueOf:void 0;function U4(e){return V0?Object(V0.call(e)):{}}function H4(e,t){var n=t?rg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var W4="[object Boolean]",q4="[object Date]",G4="[object Map]",Y4="[object Number]",Q4="[object RegExp]",K4="[object Set]",X4="[object String]",Z4="[object Symbol]",J4="[object ArrayBuffer]",eD="[object DataView]",tD="[object Float32Array]",nD="[object Float64Array]",rD="[object Int8Array]",iD="[object Int16Array]",sD="[object Int32Array]",oD="[object Uint8Array]",aD="[object Uint8ClampedArray]",lD="[object Uint16Array]",cD="[object Uint32Array]";function uD(e,t,n){var r=e.constructor;switch(t){case J4:return rg(e);case W4:case q4:return new r(+e);case eD:return $4(e,n);case tD:case nD:case rD:case iD:case sD:case oD:case aD:case lD:case cD:return H4(e,n);case G4:return new r;case Y4:case X4:return new r(e);case Q4:return V4(e);case K4:return new r;case Z4:return U4(e)}}var U0=Object.create,dD=function(){function e(){}return function(t){if(!al(t))return{};if(U0)return U0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function fD(e){return typeof e.constructor=="function"&&!Jm(e)?dD(Xm(e)):{}}var pD="[object Map]";function hD(e){return ps(e)&&xr(e)==pD}var H0=yo&&yo.isMap,mD=H0?Zm(H0):hD,gD="[object Set]";function vD(e){return ps(e)&&xr(e)==gD}var W0=yo&&yo.isSet,yD=W0?Zm(W0):vD,xD=1,wD=2,bD=4,LS="[object Arguments]",kD="[object Array]",SD="[object Boolean]",CD="[object Date]",_D="[object Error]",FS="[object Function]",TD="[object GeneratorFunction]",ED="[object Map]",jD="[object Number]",BS="[object Object]",AD="[object RegExp]",RD="[object Set]",PD="[object String]",MD="[object Symbol]",OD="[object WeakMap]",ND="[object ArrayBuffer]",DD="[object DataView]",ID="[object Float32Array]",LD="[object Float64Array]",FD="[object Int8Array]",BD="[object Int16Array]",$D="[object Int32Array]",zD="[object Uint8Array]",VD="[object Uint8ClampedArray]",UD="[object Uint16Array]",HD="[object Uint32Array]",De={};De[LS]=De[kD]=De[ND]=De[DD]=De[SD]=De[CD]=De[ID]=De[LD]=De[FD]=De[BD]=De[$D]=De[ED]=De[jD]=De[BS]=De[AD]=De[RD]=De[PD]=De[MD]=De[zD]=De[VD]=De[UD]=De[HD]=!0;De[_D]=De[FS]=De[OD]=!1;function pa(e,t,n,r,i,s){var o,a=t&xD,l=t&wD,c=t&bD;if(o!==void 0)return o;if(!al(e))return e;var d=ll(e);if(d){if(o=B4(e),!a)return MS(e,o)}else{var u=xr(e),p=u==FS||u==TD;if(TS(e))return k4(e,a);if(u==BS||u==LS||p&&!i){if(o=l||p?{}:fD(e),!a)return l?j4(e,w4(o,e)):T4(e,m4(o,e))}else{if(!De[u])return i?e:{};o=uD(e,u,a)}}s||(s=new jo);var m=s.get(e);if(m)return m;s.set(e,o),yD(e)?e.forEach(function(w){o.add(pa(w,t,n,w,e,s))}):mD(e)&&e.forEach(function(w,h){o.set(h,pa(w,t,n,h,e,s))});var y=c?l?R4:A4:l?tg:eg,x=d?void 0:y(e);return wN(x||e,function(w,h){x&&(h=w,w=e[h]),SS(o,h,pa(w,t,n,h,e,s))}),o}var WD=1,qD=4;function Fl(e){return pa(e,WD|qD)}var q0=Array.isArray,G0=Object.keys,GD=Object.prototype.hasOwnProperty,YD=typeof Element<"u";function Hp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=q0(e),r=q0(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!Hp(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=e instanceof Date,l=t instanceof Date;if(a!=l)return!1;if(a&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,d=t instanceof RegExp;if(c!=d)return!1;if(c&&d)return e.toString()==t.toString();var u=G0(e);if(s=u.length,s!==G0(t).length)return!1;for(i=s;i--!==0;)if(!GD.call(t,u[i]))return!1;if(YD&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!Hp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var QD=function(t,n){try{return Hp(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Ai=Rr(QD);var KD=4;function Y0(e){return pa(e,KD)}function $S(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var XD="[object Symbol]";function ig(e){return typeof e=="symbol"||ps(e)&&fs(e)==XD}var ZD="Expected a function";function sg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ZD);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(sg.Cache||bi),n}sg.Cache=bi;var JD=500;function eI(e){var t=sg(e,function(r){return n.size===JD&&n.clear(),r}),n=t.cache;return t}var tI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nI=/\\(\\)?/g,rI=eI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(tI,function(n,r,i,s){t.push(i?s.replace(nI,"$1"):r||n)}),t}),iI=1/0;function sI(e){if(typeof e=="string"||ig(e))return e;var t=e+"";return t=="0"&&1/e==-iI?"-0":t}var oI=1/0,Q0=gi?gi.prototype:void 0,K0=Q0?Q0.toString:void 0;function zS(e){if(typeof e=="string")return e;if(ll(e))return $S(e,zS)+"";if(ig(e))return K0?K0.call(e):"";var t=e+"";return t=="0"&&1/e==-oI?"-0":t}function aI(e){return e==null?"":zS(e)}function VS(e){return ll(e)?$S(e,sI):ig(e)?[e]:MS(rI(aI(e)))}var US={exports:{}},Me={};/** @license React v16.13.1
90
90
  * react-is.production.min.js
91
91
  *
92
92
  * Copyright (c) Facebook, Inc. and its affiliates.
93
93
  *
94
94
  * This source code is licensed under the MIT license found in the
95
95
  * LICENSE file in the root directory of this source tree.
96
- */var gt=typeof Symbol=="function"&&Symbol.for,ag=gt?Symbol.for("react.element"):60103,lg=gt?Symbol.for("react.portal"):60106,Du=gt?Symbol.for("react.fragment"):60107,Iu=gt?Symbol.for("react.strict_mode"):60108,Lu=gt?Symbol.for("react.profiler"):60114,Fu=gt?Symbol.for("react.provider"):60109,Bu=gt?Symbol.for("react.context"):60110,cg=gt?Symbol.for("react.async_mode"):60111,$u=gt?Symbol.for("react.concurrent_mode"):60111,zu=gt?Symbol.for("react.forward_ref"):60112,Vu=gt?Symbol.for("react.suspense"):60113,lI=gt?Symbol.for("react.suspense_list"):60120,Uu=gt?Symbol.for("react.memo"):60115,Hu=gt?Symbol.for("react.lazy"):60116,cI=gt?Symbol.for("react.block"):60121,uI=gt?Symbol.for("react.fundamental"):60117,dI=gt?Symbol.for("react.responder"):60118,fI=gt?Symbol.for("react.scope"):60119;function cn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ag:switch(e=e.type,e){case cg:case $u:case Du:case Lu:case Iu:case Vu:return e;default:switch(e=e&&e.$$typeof,e){case Bu:case zu:case Hu:case Uu:case Fu:return e;default:return t}}case lg:return t}}}function HS(e){return cn(e)===$u}Me.AsyncMode=cg;Me.ConcurrentMode=$u;Me.ContextConsumer=Bu;Me.ContextProvider=Fu;Me.Element=ag;Me.ForwardRef=zu;Me.Fragment=Du;Me.Lazy=Hu;Me.Memo=Uu;Me.Portal=lg;Me.Profiler=Lu;Me.StrictMode=Iu;Me.Suspense=Vu;Me.isAsyncMode=function(e){return HS(e)||cn(e)===cg};Me.isConcurrentMode=HS;Me.isContextConsumer=function(e){return cn(e)===Bu};Me.isContextProvider=function(e){return cn(e)===Fu};Me.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ag};Me.isForwardRef=function(e){return cn(e)===zu};Me.isFragment=function(e){return cn(e)===Du};Me.isLazy=function(e){return cn(e)===Hu};Me.isMemo=function(e){return cn(e)===Uu};Me.isPortal=function(e){return cn(e)===lg};Me.isProfiler=function(e){return cn(e)===Lu};Me.isStrictMode=function(e){return cn(e)===Iu};Me.isSuspense=function(e){return cn(e)===Vu};Me.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Du||e===$u||e===Lu||e===Iu||e===Vu||e===lI||typeof e=="object"&&e!==null&&(e.$$typeof===Hu||e.$$typeof===Uu||e.$$typeof===Fu||e.$$typeof===Bu||e.$$typeof===zu||e.$$typeof===uI||e.$$typeof===dI||e.$$typeof===fI||e.$$typeof===cI)};Me.typeOf=cn;US.exports=Me;var pI=US.exports,WS=pI,hI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},qS={};qS[WS.ForwardRef]=hI;qS[WS.Memo]=mI;function ft(){return ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}function GS(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Wu=g.createContext(void 0);Wu.displayName="FormikContext";Wu.Provider;Wu.Consumer;function gI(){var e=g.useContext(Wu);return e}var An=function(t){return typeof t=="function"},qu=function(t){return t!==null&&typeof t=="object"},vI=function(t){return String(Math.floor(Number(t)))===t},qd=function(t){return Object.prototype.toString.call(t)==="[object String]"},Gd=function(t){return qu(t)&&An(t.then)};function Zt(e,t,n,r){r===void 0&&(r=0);for(var i=VS(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function Ki(e,t,n){for(var r=Q0(e),i=r,s=0,o=VS(t);s<o.length-1;s++){var a=o[s],l=Zt(e,o.slice(0,s+1));if(l&&(qu(l)||Array.isArray(l)))i=i[a]=Q0(l);else{var u=o[s+1];i=i[a]=vI(u)&&Number(u)>=0?[]:{}}}return(s===0?e:i)[o[s]]===n?e:(n===void 0?delete i[o[s]]:i[o[s]]=n,s===0&&n===void 0&&delete r[o[s]],r)}function YS(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(e);i<s.length;i++){var o=s[i],a=e[o];qu(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},YS(a,t,n,r[o])):r[o]=t}return r}function yI(e,t){switch(t.type){case"SET_VALUES":return ft({},e,{values:t.payload});case"SET_TOUCHED":return ft({},e,{touched:t.payload});case"SET_ERRORS":return Ai(e.errors,t.payload)?e:ft({},e,{errors:t.payload});case"SET_STATUS":return ft({},e,{status:t.payload});case"SET_ISSUBMITTING":return ft({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ft({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ft({},e,{values:Ki(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ft({},e,{touched:Ki(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ft({},e,{errors:Ki(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ft({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ft({},e,{touched:YS(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ft({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ft({},e,{isSubmitting:!1});default:return e}}var _i={},Bl={};function xI(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,s=e.validateOnMount,o=s===void 0?!1:s,a=e.isInitialValid,l=e.enableReinitialize,u=l===void 0?!1:l,d=e.onSubmit,c=GS(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),f=ft({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},c),m=g.useRef(f.initialValues),y=g.useRef(f.initialErrors||_i),x=g.useRef(f.initialTouched||Bl),w=g.useRef(f.initialStatus),h=g.useRef(!1),v=g.useRef({});g.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var b=g.useState(0),T=b[1],C=g.useRef({values:Fl(f.initialValues),errors:Fl(f.initialErrors)||_i,touched:Fl(f.initialTouched)||Bl,status:Fl(f.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),E=C.current,S=g.useCallback(function(R){var K=C.current;C.current=yI(K,R),K!==C.current&&T(function(M){return M+1})},[]),A=g.useCallback(function(R,K){return new Promise(function(M,U){var ae=f.validate(R,K);ae==null?M(_i):Gd(ae)?ae.then(function(fe){M(fe||_i)},function(fe){U(fe)}):M(ae)})},[f.validate]),B=g.useCallback(function(R,K){var M=f.validationSchema,U=An(M)?M(K):M,ae=K&&U.validateAt?U.validateAt(K,R):bI(R,U);return new Promise(function(fe,ke){ae.then(function(){fe(_i)},function(at){at.name==="ValidationError"?fe(wI(at)):ke(at)})})},[f.validationSchema]),L=g.useCallback(function(R,K){return new Promise(function(M){return M(v.current[R].validate(K))})},[]),N=g.useCallback(function(R){var K=Object.keys(v.current).filter(function(U){return An(v.current[U].validate)}),M=K.length>0?K.map(function(U){return L(U,Zt(R,U))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(M).then(function(U){return U.reduce(function(ae,fe,ke){return fe==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||fe&&(ae=Ki(ae,K[ke],fe)),ae},{})})},[L]),ee=g.useCallback(function(R){return Promise.all([N(R),f.validationSchema?B(R):{},f.validate?A(R):{}]).then(function(K){var M=K[0],U=K[1],ae=K[2],fe=$p.all([M,U,ae],{arrayMerge:kI});return fe})},[f.validate,f.validationSchema,N,A,B]),Z=pn(function(R){return R===void 0&&(R=E.values),S({type:"SET_ISVALIDATING",payload:!0}),ee(R).then(function(K){return h.current&&(S({type:"SET_ISVALIDATING",payload:!1}),S({type:"SET_ERRORS",payload:K})),K})});g.useEffect(function(){o&&h.current===!0&&Ai(m.current,f.initialValues)&&Z(m.current)},[o,Z]);var V=g.useCallback(function(R){var K=R&&R.values?R.values:m.current,M=R&&R.errors?R.errors:y.current?y.current:f.initialErrors||{},U=R&&R.touched?R.touched:x.current?x.current:f.initialTouched||{},ae=R&&R.status?R.status:w.current?w.current:f.initialStatus;m.current=K,y.current=M,x.current=U,w.current=ae;var fe=function(){S({type:"RESET_FORM",payload:{isSubmitting:!!R&&!!R.isSubmitting,errors:M,touched:U,status:ae,values:K,isValidating:!!R&&!!R.isValidating,submitCount:R&&R.submitCount&&typeof R.submitCount=="number"?R.submitCount:0}})};if(f.onReset){var ke=f.onReset(E.values,de);Gd(ke)?ke.then(fe):fe()}else fe()},[f.initialErrors,f.initialStatus,f.initialTouched,f.onReset]);g.useEffect(function(){h.current===!0&&!Ai(m.current,f.initialValues)&&u&&(m.current=f.initialValues,V(),o&&Z(m.current))},[u,f.initialValues,V,o,Z]),g.useEffect(function(){u&&h.current===!0&&!Ai(y.current,f.initialErrors)&&(y.current=f.initialErrors||_i,S({type:"SET_ERRORS",payload:f.initialErrors||_i}))},[u,f.initialErrors]),g.useEffect(function(){u&&h.current===!0&&!Ai(x.current,f.initialTouched)&&(x.current=f.initialTouched||Bl,S({type:"SET_TOUCHED",payload:f.initialTouched||Bl}))},[u,f.initialTouched]),g.useEffect(function(){u&&h.current===!0&&!Ai(w.current,f.initialStatus)&&(w.current=f.initialStatus,S({type:"SET_STATUS",payload:f.initialStatus}))},[u,f.initialStatus,f.initialTouched]);var O=pn(function(R){if(v.current[R]&&An(v.current[R].validate)){var K=Zt(E.values,R),M=v.current[R].validate(K);return Gd(M)?(S({type:"SET_ISVALIDATING",payload:!0}),M.then(function(U){return U}).then(function(U){S({type:"SET_FIELD_ERROR",payload:{field:R,value:U}}),S({type:"SET_ISVALIDATING",payload:!1})})):(S({type:"SET_FIELD_ERROR",payload:{field:R,value:M}}),Promise.resolve(M))}else if(f.validationSchema)return S({type:"SET_ISVALIDATING",payload:!0}),B(E.values,R).then(function(U){return U}).then(function(U){S({type:"SET_FIELD_ERROR",payload:{field:R,value:Zt(U,R)}}),S({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),I=g.useCallback(function(R,K){var M=K.validate;v.current[R]={validate:M}},[]),H=g.useCallback(function(R){delete v.current[R]},[]),_=pn(function(R,K){S({type:"SET_TOUCHED",payload:R});var M=K===void 0?i:K;return M?Z(E.values):Promise.resolve()}),P=g.useCallback(function(R){S({type:"SET_ERRORS",payload:R})},[]),F=pn(function(R,K){var M=An(R)?R(E.values):R;S({type:"SET_VALUES",payload:M});var U=K===void 0?n:K;return U?Z(M):Promise.resolve()}),$=g.useCallback(function(R,K){S({type:"SET_FIELD_ERROR",payload:{field:R,value:K}})},[]),W=pn(function(R,K,M){S({type:"SET_FIELD_VALUE",payload:{field:R,value:K}});var U=M===void 0?n:M;return U?Z(Ki(E.values,R,K)):Promise.resolve()}),Q=g.useCallback(function(R,K){var M=K,U=R,ae;if(!qd(R)){R.persist&&R.persist();var fe=R.target?R.target:R.currentTarget,ke=fe.type,at=fe.name,vt=fe.id,Vn=fe.value,un=fe.checked,ys=fe.outerHTML,fr=fe.options,Or=fe.multiple;M=K||at||vt,U=/number|range/.test(ke)?(ae=parseFloat(Vn),isNaN(ae)?"":ae):/checkbox/.test(ke)?CI(Zt(E.values,M),un,Vn):fr&&Or?SI(fr):Vn}M&&W(M,U)},[W,E.values]),se=pn(function(R){if(qd(R))return function(K){return Q(K,R)};Q(R)}),he=pn(function(R,K,M){K===void 0&&(K=!0),S({type:"SET_FIELD_TOUCHED",payload:{field:R,value:K}});var U=M===void 0?i:M;return U?Z(E.values):Promise.resolve()}),ue=g.useCallback(function(R,K){R.persist&&R.persist();var M=R.target,U=M.name,ae=M.id,fe=M.outerHTML,ke=K||U||ae;he(ke,!0)},[he]),q=pn(function(R){if(qd(R))return function(K){return ue(K,R)};ue(R)}),oe=g.useCallback(function(R){An(R)?S({type:"SET_FORMIK_STATE",payload:R}):S({type:"SET_FORMIK_STATE",payload:function(){return R}})},[]),z=g.useCallback(function(R){S({type:"SET_STATUS",payload:R})},[]),ne=g.useCallback(function(R){S({type:"SET_ISSUBMITTING",payload:R})},[]),D=pn(function(){return S({type:"SUBMIT_ATTEMPT"}),Z().then(function(R){var K=R instanceof Error,M=!K&&Object.keys(R).length===0;if(M){var U;try{if(U=Ce(),U===void 0)return}catch(ae){throw ae}return Promise.resolve(U).then(function(ae){return h.current&&S({type:"SUBMIT_SUCCESS"}),ae}).catch(function(ae){if(h.current)throw S({type:"SUBMIT_FAILURE"}),ae})}else if(h.current&&(S({type:"SUBMIT_FAILURE"}),K))throw R})}),te=pn(function(R){R&&R.preventDefault&&An(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&An(R.stopPropagation)&&R.stopPropagation(),D().catch(function(K){console.warn("Warning: An unhandled error was caught from submitForm()",K)})}),de={resetForm:V,validateForm:Z,validateField:O,setErrors:P,setFieldError:$,setFieldTouched:he,setFieldValue:W,setStatus:z,setSubmitting:ne,setTouched:_,setValues:F,setFormikState:oe,submitForm:D},Ce=pn(function(){return d(E.values,de)}),ge=pn(function(R){R&&R.preventDefault&&An(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&An(R.stopPropagation)&&R.stopPropagation(),V()}),Ze=g.useCallback(function(R){return{value:Zt(E.values,R),error:Zt(E.errors,R),touched:!!Zt(E.touched,R),initialValue:Zt(m.current,R),initialTouched:!!Zt(x.current,R),initialError:Zt(y.current,R)}},[E.errors,E.touched,E.values]),ot=g.useCallback(function(R){return{setValue:function(M,U){return W(R,M,U)},setTouched:function(M,U){return he(R,M,U)},setError:function(M){return $(R,M)}}},[W,he,$]),Bt=g.useCallback(function(R){var K=qu(R),M=K?R.name:R,U=Zt(E.values,M),ae={name:M,value:U,onChange:se,onBlur:q};if(K){var fe=R.type,ke=R.value,at=R.as,vt=R.multiple;fe==="checkbox"?ke===void 0?ae.checked=!!U:(ae.checked=!!(Array.isArray(U)&&~U.indexOf(ke)),ae.value=ke):fe==="radio"?(ae.checked=U===ke,ae.value=ke):at==="select"&&vt&&(ae.value=ae.value||[],ae.multiple=!0)}return ae},[q,se,E.values]),re=g.useMemo(function(){return!Ai(m.current,E.values)},[m.current,E.values]),be=g.useMemo(function(){return typeof a<"u"?re?E.errors&&Object.keys(E.errors).length===0:a!==!1&&An(a)?a(f):a:E.errors&&Object.keys(E.errors).length===0},[a,re,E.errors,f]),Je=ft({},E,{initialValues:m.current,initialErrors:y.current,initialTouched:x.current,initialStatus:w.current,handleBlur:q,handleChange:se,handleReset:ge,handleSubmit:te,resetForm:V,setErrors:P,setFormikState:oe,setFieldTouched:he,setFieldValue:W,setFieldError:$,setStatus:z,setSubmitting:ne,setTouched:_,setValues:F,submitForm:D,validateForm:Z,validateField:O,isValid:be,dirty:re,unregisterField:H,registerField:I,getFieldProps:Bt,getFieldMeta:Ze,getFieldHelpers:ot,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return Je}function wI(e){var t={};if(e.inner){if(e.inner.length===0)return Ki(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var s;if(n){if(r>=i.length)break;s=i[r++]}else{if(r=i.next(),r.done)break;s=r.value}var o=s;Zt(t,o.path)||(t=Ki(t,o.path,o.message))}}return t}function bI(e,t,n,r){n===void 0&&(n=!1);var i=qp(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function qp(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||_0(i)?qp(i):i!==""?i:void 0}):_0(e[r])?t[r]=qp(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function kI(e,t,n){var r=e.slice();return t.forEach(function(s,o){if(typeof r[o]>"u"){var a=n.clone!==!1,l=a&&n.isMergeableObject(s);r[o]=l?$p(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[o]=$p(e[o],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function SI(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function CI(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var _I=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?g.useLayoutEffect:g.useEffect;function pn(e){var t=g.useRef(e);return _I(function(){t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var TI=g.forwardRef(function(e,t){var n=e.action,r=GS(e,["action"]),i=n??"#",s=gI(),o=s.handleReset,a=s.handleSubmit;return g.createElement("form",ft({onSubmit:a,ref:t,onReset:o,action:i},r))});TI.displayName="Form";const QS=({init:e,schema:t,action:n})=>xI({initialValues:e,validationSchema:t,validateOnBlur:!1,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:r=>{n(r)}});function EI(e,t,n){let r=n;r||(r=Object.keys(e));for(let i of r){if(Array.isArray(e[i])&&Array.isArray(t[i])){if(e[i].length!==t[i].length)return!1;for(let s=0;s<e[i].length;s++)if(e[i][s]!==t[i][s])return!1;continue}if(e[i]!==t[i])return!1}return!0}function ug({id:e,text:t,className:n,required:r}){const i=je();return t?p.jsxs("label",{htmlFor:e,className:ze("mb-1 block text-sm font-medium",n),style:{color:i.getColor(k.InputText)},children:[t,r&&p.jsx("span",{className:"ml-1",style:{color:i.getColor(k.ErrorText)},children:"*"})]}):null}const Yd={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function jI({id:e,label:t,suffix:n,prefix:r,size:i="md",type:s="text",noMargin:o=!1,required:a=!1,error:l,ariaDescribedBy:u,className:d,ariaInvalid:c,ariaLabel:f,autoFocus:m,...y}){const x=je(),w=x.getRadius(),h=l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),v=x.getColor(k.LinkColor);return p.jsxs("div",{className:ze({"mb-2":!o},d),style:{"--focus-ring":v},children:[p.jsx(ug,{id:e,text:t,required:a}),p.jsxs("div",{className:"flex items-center",children:[r&&p.jsx("span",{className:ze("inline-block border border-solid border-r-0 rounded-l-md",Yd[i]),style:{borderColor:l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),backgroundColor:x.getColor(k.InputBackground),borderRadius:w},children:r}),p.jsx("input",{id:e,className:ze("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",Yd[i],{"rounded-l-none":!!r,"rounded-r-none":!!n}),type:s,required:a,"aria-describedby":u,"aria-invalid":c,"aria-label":f,style:{fontSize:"16px",color:l?x.getColor(k.ErrorText):x.getColor(k.InputText),backgroundColor:x.getColor(k.InputBackground),borderColor:h,borderRadius:w,"--tw-ring-color":v},...y}),n&&p.jsx("span",{className:ze("inline-block border border-solid border-l-0 rounded-r-md",Yd[i]),style:{borderColor:l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),backgroundColor:x.getColor(k.InputBackground),borderRadius:w},children:n})]}),!!l&&p.jsx("p",{className:"mt-1 text-xs",style:{color:x.getColor(k.ErrorText)},children:l})]})}const Z0=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},KS=g.createContext({}),AI=()=>`${window.location.pathname}_$$_${document.title}`,RI=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},PI=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function MI({children:e}){const[t,n]=g.useState("/"),[r,i]=g.useState(PI());function s(){i([]),localStorage.removeItem("p-history")}const o=a=>{n(a),i(l=>[...new Set([...l,a])]),localStorage.setItem("page",a),localStorage.setItem("p-history",JSON.stringify(r))};return p.jsx(KS.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function Gu(){return g.useContext(KS)}const ha=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};function OI({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){return p.jsxs("div",{className:r||"",children:[e&&p.jsx(ug,{id:t,required:o,text:e}),p.jsx("select",{id:t,"aria-placeholder":i,value:n,"aria-label":e,className:"light forelect transition-colors duration-200 border border-solid text-gray-900 text-sm rounded-md focus:ring-emerald-500 focus-visible:ring-0 focus-visible:shadow-none outline focus-visible:outline-none focus-visible:ber-emerald-500 focus:border-emerald-500 block w-full px-2 py-2 placeholder-fuchsia-600 caret-emer-500",onChange:l.onChange,required:o,...l,children:s}),!!a&&p.jsx("p",{className:"1 texm text-r500",children:a})]})}const J0={ring:{label:"",input:"relative before:content[''] before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-y-2/4 before:-translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10"},hover:{label:"hover:bg-secondary transition-colors duration-200 px-2 py-1 rounded-md",input:""}},NI={blue:"checked:border-blue-500 checked:bg-blue-500 checked:before:bg-blue-500",indigo:"checked:border-indigo-500 checked:bg-indigo-500 checked:before:bg-indigo-500",green:"checked:border-green-500 checked:bg-green-500 checked:before:bg-green-500",red:"checked:border-red-500 checked:bg-red-500 checked:before:bg-red-500",orange:"checked:border-orange-500 checked:bg-orange-500 checked:before:bg-orange-500"},DI={sm:"h-4 w-4 lg:h-3 lg:w-3",md:"h-6 w-6 lg:h-5 lg:w-5",lg:"h-8 w-8 lg:h-7 lg:w-7"},II={sm:"h-3 w-3 lg:h-2.5 lg:w-2.5",md:"h-5 w-5 lg:h-4 lg:w-4",lg:"h-7 w-7 lg:h-6 lg:w-6"};function LI({children:e,name:t,required:n,value:r,checked:i,onChange:s,onBlur:o,red:a,id:l=t,size:u="md",effect:d="ring",reversed:c=!1,variant:f="blue",error:m,...y}){return p.jsxs("div",{children:[p.jsxs("div",{className:`flex items-center justify-between ${c?"flex-row-reverse":""} ${J0[d].label}`,children:[p.jsxs("label",{className:"disable-highlight relative mr-3 flex cursor-pointer items-center rounded-full",htmlFor:l,children:[p.jsx("input",{id:l,name:t,type:"checkbox",className:`border-gray-200 peer cursor-pointer appearance-none rounded-md border border-solid bg-white transition-all ${NI[f]} ${DI[u]} ${J0[d].input}`,required:n,checked:i,value:r,onChange:x=>s==null?void 0:s(x.target.checked),onBlur:x=>o==null?void 0:o(x.target.checked),...y}),p.jsx("div",{className:"pointer-events-none absolute left-2/4 top-2/4 translate-x-2/4 translate-y-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",children:p.jsx(Y.Check,{className:II[u]})})]}),p.jsx("label",{className:"disable-highlight mt-px flex grow cursor-pointer select-none items-center justify-between font-light text-gray-800",htmlFor:l,children:e})]}),a&&p.jsx("small",{className:"text-xs text-red-500",children:a}),m&&p.jsx("small",{className:"text-xs text-red-500",children:m})]})}function FI({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){return p.jsxs("label",{htmlFor:e,className:ze("relative flex cursor-pointer items-center rounded-md focus:outline-none",{"opacity-60 cursor-not-allowed":s},o),children:[p.jsx("input",{type:"radio",id:e,name:n,value:e,checked:t,defaultChecked:t,onChange:a=>{r&&r(a.target.checked)},className:"peer h-4 w-4 cursor-pointer appearance-none rounded-full border-2 border-slate-300 transition-all checked:border-[5px] checked:border-indigo-600 focus:ring-0 focus:ring-offset-0",disabled:s}),p.jsx("span",{className:"ml-2 text-sm font-medium text-slate-700",children:i})]})}function BI({id:e,label:t,children:n,required:r,className:i,error:s}){return p.jsxs("fieldset",{id:e,className:i,children:[t&&p.jsxs("legend",{className:"mb-1 block text-sm font-medium text-slate-700",children:[t," ",r&&p.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),p.jsx("div",{className:"flex flex-col gap-1.5 mt-0.5",children:n}),s&&p.jsx("p",{className:"text-red-500 text-sm",children:s})]})}const ex=Object.assign(FI,{Group:BI});function Yu({id:e,label:t,suffix:n,prefix:r,className:i,noMargin:s,rows:o=3,type:a="text",required:l=!1,error:u,ariaInvalid:d,inputRef:c,autoFocus:f=!0,style:m,borderless:y=!1,...x}){const w=je();return p.jsxs("div",{className:ze({"mb-2":!s},i),children:[t&&p.jsx(ug,{id:e,text:t,required:l}),p.jsx("textarea",{className:ze("resize-none max-h-36 w-full py-2 px-3 block outline-none transition-[border-color,box-shadow] duration-200 rounded-lg",{"border border-solid focus:ring-2 focus:ring-offset-0":!y,"border-none bg-transparent":y}),id:e,rows:o,"aria-invalid":d,...x,ref:c,autoFocus:f,style:{...m,fontSize:"14px",color:u?w.getColor(k.ErrorText):w.getColor(k.InputText),...!y&&{backgroundColor:w.getColor(k.InputBackground),borderColor:u?w.getColor(k.ErrorBorder):w.getColor(k.InputBorder),borderRadius:w.getRadius(),"--tw-ring-color":w.getColor(k.LinkColor)}}}),!!u&&p.jsx("p",{className:"mt-1 text-xs",style:{color:w.getColor(k.ErrorText)},children:u})]})}function $I({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var A,B,L,N,ee,Z,V,O,I,H;const l=je(),{defaultValues:u,widget:d,setIsHaveChat:c}=ie(),[f,m]=g.useState(!1),y=Gu(),x=Wm(),w=!!u&&"username"in u,h=(B=(A=r==null?void 0:r.body)==null?void 0:A.inputs)==null?void 0:B.reduce((_,P)=>{let F=P.remember?ha(P.name):u==null?void 0:u[P.name];return P.options&&F&&!P.options.includes(F)&&(F=void 0),P.name==="username"&&w&&(F=u.username),_[P.name]=F||"",_},{}),v=(N=(L=r==null?void 0:r.body)==null?void 0:L.inputs)==null?void 0:N.reduce((_,P)=>(_[P.name]="",_),{}),b=Xm((Z=(ee=r==null?void 0:r.body)==null?void 0:ee.inputs)==null?void 0:Z.reduce((_,P)=>(_[P.name]=P.required?Qc().required(`${P.label} alanı zorunludur`):Qc(),_),{})),T=QS({init:{...h},schema:b,action:async _=>{var P,F;if(!(f||a)){m(!0);try{w&&(_.username=u.username),u!=null&&u.secret_data&&(_.secret_data=u.secret_data);for(const Q in _)typeof _[Q]=="string"&&(_[Q]=_[Q].trim());if(o){for(const Q of((P=r==null?void 0:r.body)==null?void 0:P.inputs)||[])Q.remember&&Z0(Q.name,_[Q.name]);o(_);return}const[$,W]=await x.mutateAsync({inputs:_,history:y.history,client_id:t,widget_id:n,device_id:mi((d==null?void 0:d.link_id)||""),is_agent_mode:i});if($n(W)){Ip($)&&(Ln(rt.CustomerToken,$.customer_token,(d==null?void 0:d.link_id)||""),Ln(rt.CustomerRefreshToken,$.customer_refresh_token,(d==null?void 0:d.link_id)||""),Ln(rt.DeviceId,$.device_id,(d==null?void 0:d.link_id)||"")),y.clearHistory();for(const Q of((F=r==null?void 0:r.body)==null?void 0:F.inputs)||[])Q.remember&&Z0(Q.name,_[Q.name]);c(!0),i?s==null||s():e==null||e();return}ho($,{form:T})}catch($){console.error("Chat creation error:",$)}finally{m(!1)}}}}),E=(((O=(V=r==null?void 0:r.body)==null?void 0:V.inputs)==null?void 0:O.length)||0)>0?!EI(v||{},(T==null?void 0:T.values)||{}):!0,S=l.getColor(k.GreeterBackground);return p.jsx("section",{className:"h-full overflow-y-auto p-5",style:{backgroundColor:S},children:p.jsxs("form",{autoComplete:"off",className:"grid grid-cols-1 gap-2",onSubmit:_=>{_.preventDefault(),T.handleSubmit()},children:[(H=(I=r==null?void 0:r.body)==null?void 0:I.inputs)==null?void 0:H.map(_=>{var P,F;if(["text","email","phone"].includes(_.type))return p.jsx(jI,{id:_.name,name:_.name,type:_.type,label:_.label,value:T.values[_.name],onChange:T.handleChange,onBlur:T.handleBlur,disabled:_.name==="username"&&w,readOnly:_.name==="username"&&w,autoComplete:"off",placeholder:_.placeholder,error:T.errors[_.name],ariaInvalid:T.errors.name?!0:void 0,required:_.required,noMargin:!0},_.name);if(_.type==="select")return p.jsx(OI,{id:_.name,name:_.name,value:T.values[_.name],onChange:T.handleChange,label:_.label,error:T.errors[_.name],required:_.required,children:(P=_.options)==null?void 0:P.map($=>p.jsx("option",{value:$,children:$},$))},_.name);if(_.type==="checkbox")return p.jsx(LI,{id:_.name,name:_.name,value:T.values[_.name],checked:T.values[_.name]==="true",onChange:T.handleChange,required:_.required,error:T.errors[_.name],children:_.label},_.name);if(_.type==="radio")return p.jsx(ex.Group,{id:_.name,label:_.label,required:_.required,error:T.errors[_.name],children:(F=_.options)==null?void 0:F.map($=>p.jsx(ex,{onChange:W=>{W?T.setFieldValue(_.name,$):T.setFieldValue(_.name,"")},id:$,name:_.name,value:$===T.values[_.name],children:$},$))},_.name);if(_.type==="textarea")return p.jsx(Yu,{id:_.name,name:_.name,value:T.values[_.name],onChange:T.handleChange,placeholder:_.placeholder,error:T.errors[_.name],required:_.required,label:_.label},_.name)}),p.jsx(Rt,{textKey:k.GreeterButtonText,bgKey:k.GreeterButtonBackground,type:"submit",size:"lg",disabled:!E||f||a,className:"transition-all duration-300 hover:opacity-90 transform hover:translate-y-[-1px] shadow-sm",children:f||a?p.jsxs("div",{className:"flex items-center justify-center",children:[p.jsx("span",{className:"mr-2",children:o?"Bağlanıyor":"Yükleniyor"}),p.jsx("span",{className:"animate-pulse",children:"..."})]}):o?"Canlı Desteğe Bağlan":"Sohbet Oluştur"})]})})}var qt=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(qt||{}),mn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e))(mn||{}),ye=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(ye||{});const gs=e=>{const t=BE(),n=(r,i)=>{var o;const s=((o=P6.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,u])=>a.replace(`:${l}`,u),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};var zI={exports:{}},Qd={exports:{}},tx;function XS(){return tx||(tx=1,function(e,t){(function(n,r){e.exports=r()})(ah,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",u="day",d="week",c="month",f="quarter",m="year",y="date",x="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(V){var O=["th","st","nd","rd"],I=V%100;return"["+V+(O[(I-20)%10]||O[I]||O[0])+"]"}},b=function(V,O,I){var H=String(V);return!H||H.length>=O?V:""+Array(O+1-H.length).join(I)+V},T={s:b,z:function(V){var O=-V.utcOffset(),I=Math.abs(O),H=Math.floor(I/60),_=I%60;return(O<=0?"+":"-")+b(H,2,"0")+":"+b(_,2,"0")},m:function V(O,I){if(O.date()<I.date())return-V(I,O);var H=12*(I.year()-O.year())+(I.month()-O.month()),_=O.clone().add(H,c),P=I-_<0,F=O.clone().add(H+(P?-1:1),c);return+(-(H+(I-_)/(P?_-F:F-_))||0)},a:function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},p:function(V){return{M:c,y:m,w:d,d:u,D:y,h:l,m:a,s:o,ms:s,Q:f}[V]||String(V||"").toLowerCase().replace(/s$/,"")},u:function(V){return V===void 0}},C="en",E={};E[C]=v;var S="$isDayjsObject",A=function(V){return V instanceof ee||!(!V||!V[S])},B=function V(O,I,H){var _;if(!O)return C;if(typeof O=="string"){var P=O.toLowerCase();E[P]&&(_=P),I&&(E[P]=I,_=P);var F=O.split("-");if(!_&&F.length>1)return V(F[0])}else{var $=O.name;E[$]=O,_=$}return!H&&_&&(C=_),_||!H&&C},L=function(V,O){if(A(V))return V.clone();var I=typeof O=="object"?O:{};return I.date=V,I.args=arguments,new ee(I)},N=T;N.l=B,N.i=A,N.w=function(V,O){return L(V,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var ee=function(){function V(I){this.$L=B(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[S]=!0}var O=V.prototype;return O.parse=function(I){this.$d=function(H){var _=H.date,P=H.utc;if(_===null)return new Date(NaN);if(N.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var F=_.match(w);if(F){var $=F[2]-1||0,W=(F[7]||"0").substring(0,3);return P?new Date(Date.UTC(F[1],$,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)):new Date(F[1],$,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)}}return new Date(_)}(I),this.init()},O.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},O.$utils=function(){return N},O.isValid=function(){return this.$d.toString()!==x},O.isSame=function(I,H){var _=L(I);return this.startOf(H)<=_&&_<=this.endOf(H)},O.isAfter=function(I,H){return L(I)<this.startOf(H)},O.isBefore=function(I,H){return this.endOf(H)<L(I)},O.$g=function(I,H,_){return N.u(I)?this[H]:this.set(_,I)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(I,H){var _=this,P=!!N.u(H)||H,F=N.p(I),$=function(z,ne){var D=N.w(_.$u?Date.UTC(_.$y,ne,z):new Date(_.$y,ne,z),_);return P?D:D.endOf(u)},W=function(z,ne){return N.w(_.toDate()[z].apply(_.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(ne)),_)},Q=this.$W,se=this.$M,he=this.$D,ue="set"+(this.$u?"UTC":"");switch(F){case m:return P?$(1,0):$(31,11);case c:return P?$(1,se):$(0,se+1);case d:var q=this.$locale().weekStart||0,oe=(Q<q?Q+7:Q)-q;return $(P?he-oe:he+(6-oe),se);case u:case y:return W(ue+"Hours",0);case l:return W(ue+"Minutes",1);case a:return W(ue+"Seconds",2);case o:return W(ue+"Milliseconds",3);default:return this.clone()}},O.endOf=function(I){return this.startOf(I,!1)},O.$set=function(I,H){var _,P=N.p(I),F="set"+(this.$u?"UTC":""),$=(_={},_[u]=F+"Date",_[y]=F+"Date",_[c]=F+"Month",_[m]=F+"FullYear",_[l]=F+"Hours",_[a]=F+"Minutes",_[o]=F+"Seconds",_[s]=F+"Milliseconds",_)[P],W=P===u?this.$D+(H-this.$W):H;if(P===c||P===m){var Q=this.clone().set(y,1);Q.$d[$](W),Q.init(),this.$d=Q.set(y,Math.min(this.$D,Q.daysInMonth())).$d}else $&&this.$d[$](W);return this.init(),this},O.set=function(I,H){return this.clone().$set(I,H)},O.get=function(I){return this[N.p(I)]()},O.add=function(I,H){var _,P=this;I=Number(I);var F=N.p(H),$=function(se){var he=L(P);return N.w(he.date(he.date()+Math.round(se*I)),P)};if(F===c)return this.set(c,this.$M+I);if(F===m)return this.set(m,this.$y+I);if(F===u)return $(1);if(F===d)return $(7);var W=(_={},_[a]=r,_[l]=i,_[o]=n,_)[F]||1,Q=this.$d.getTime()+I*W;return N.w(Q,this)},O.subtract=function(I,H){return this.add(-1*I,H)},O.format=function(I){var H=this,_=this.$locale();if(!this.isValid())return _.invalidDate||x;var P=I||"YYYY-MM-DDTHH:mm:ssZ",F=N.z(this),$=this.$H,W=this.$m,Q=this.$M,se=_.weekdays,he=_.months,ue=_.meridiem,q=function(ne,D,te,de){return ne&&(ne[D]||ne(H,P))||te[D].slice(0,de)},oe=function(ne){return N.s($%12||12,ne,"0")},z=ue||function(ne,D,te){var de=ne<12?"AM":"PM";return te?de.toLowerCase():de};return P.replace(h,function(ne,D){return D||function(te){switch(te){case"YY":return String(H.$y).slice(-2);case"YYYY":return N.s(H.$y,4,"0");case"M":return Q+1;case"MM":return N.s(Q+1,2,"0");case"MMM":return q(_.monthsShort,Q,he,3);case"MMMM":return q(he,Q);case"D":return H.$D;case"DD":return N.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return q(_.weekdaysMin,H.$W,se,2);case"ddd":return q(_.weekdaysShort,H.$W,se,3);case"dddd":return se[H.$W];case"H":return String($);case"HH":return N.s($,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return z($,W,!0);case"A":return z($,W,!1);case"m":return String(W);case"mm":return N.s(W,2,"0");case"s":return String(H.$s);case"ss":return N.s(H.$s,2,"0");case"SSS":return N.s(H.$ms,3,"0");case"Z":return F}return null}(ne)||F.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(I,H,_){var P,F=this,$=N.p(H),W=L(I),Q=(W.utcOffset()-this.utcOffset())*r,se=this-W,he=function(){return N.m(F,W)};switch($){case m:P=he()/12;break;case c:P=he();break;case f:P=he()/3;break;case d:P=(se-Q)/6048e5;break;case u:P=(se-Q)/864e5;break;case l:P=se/i;break;case a:P=se/r;break;case o:P=se/n;break;default:P=se}return _?P:N.a(P)},O.daysInMonth=function(){return this.endOf(c).$D},O.$locale=function(){return E[this.$L]},O.locale=function(I,H){if(!I)return this.$L;var _=this.clone(),P=B(I,H,!0);return P&&(_.$L=P),_},O.clone=function(){return N.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},V}(),Z=ee.prototype;return L.prototype=Z,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",u],["$M",c],["$y",m],["$D",y]].forEach(function(V){Z[V[1]]=function(O){return this.$g(O,V[0],V[1])}}),L.extend=function(V,O){return V.$i||(V(O,ee,L),V.$i=!0),L},L.locale=B,L.isDayjs=A,L.unix=function(V){return L(1e3*V)},L.en=E[C],L.Ls=E,L.p={},L})}(Qd)),Qd.exports}(function(e,t){(function(n,r){e.exports=r(XS())})(ah,function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var i=r(n),s={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(o){return o+"."}};return i.default.locale(s,null,!0),s})})(zI);var ZS={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ah,function(){return function(n,r,i){n=n||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(u,d,c,f){return s.fromToBase(u,d,c,f)}i.en.relativeTime=o,s.fromToBase=function(u,d,c,f,m){for(var y,x,w,h=c.$locale().relativeTime||o,v=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],b=v.length,T=0;T<b;T+=1){var C=v[T];C.d&&(y=f?i(u).diff(c,C.d,!0):c.diff(u,C.d,!0));var E=(n.rounding||Math.round)(Math.abs(y));if(w=y>0,E<=C.r||!C.r){E<=1&&T>0&&(C=v[T-1]);var S=h[C.l];m&&(E=m(""+E)),x=typeof S=="string"?S.replace("%d",E):S(E,d,C.l,w);break}}if(d)return x;var A=w?h.future:h.past;return typeof A=="function"?A(x):A.replace("%s",x)},s.to=function(u,d){return a(u,d,this,!0)},s.from=function(u,d){return a(u,d,this)};var l=function(u){return u.$u?i.utc():i()};s.toNow=function(u){return this.to(l(this),u)},s.fromNow=function(u){return this.from(l(this),u)}}})})(ZS);var VI=ZS.exports;const UI=Ar(VI);var HI=XS();const Kd=Ar(HI),WI=(e="tr")=>(Kd.extend(UI),Kd.locale(e),Kd);function qI({onShowForm:e,onHasHistory:t}){const n=ie(v=>v.widget),r=ie(v=>v.setHistoryChat),i=ie(v=>v.setHistoryMessages),s=je(),o=gs(),[a,l]=g.useState(null),u=WI(),d=g.useRef(!1),c=n!=null&&n.link_id?mi(n.link_id):null,{data:f,isLoading:m}=lM((n==null?void 0:n.link_id)||"",c||"");if(g.useEffect(()=>{if(!m&&f){const[v,b]=f,T=$n(b)&&Array.isArray(v)&&v.length>0;if(T&&!d.current){const C=v[0];if(C.status===qt.Open||C.status===qt.Pending){console.log("ChatHistoryList: Auto-joining active chat",C._id),d.current=!0,r(C),i(null),o.push("chat");return}}t&&t(T),T||e&&e()}},[m,f,e,t,o,r,i]),!(n!=null&&n.link_id))return null;if(m)return p.jsx("div",{className:"p-4 text-center text-xs opacity-50",children:"Yükleniyor..."});if(!f)return null;const[y,x]=f;if(!$n(x)||!Array.isArray(y)||y.length===0)return null;const w=v=>u(v).fromNow(),h=v=>v.who_joined_details&&Array.isArray(v.who_joined_details)&&v.who_joined_details.length>0&&v.who_joined_details[0].name||"Atanmamış";return p.jsx("div",{className:"flex flex-col h-full",children:p.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:y.map(v=>p.jsxs("button",{type:"button",className:"w-full flex justify-between items-center gap-2 p-5 text-left transition-colors",style:{color:s.getColor(k.InputText),backgroundColor:a===v._id?s.getColor(k.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(v._id),onMouseLeave:()=>l(null),onClick:()=>{r(v),i(null),o.push("chat")},children:[p.jsx("span",{className:"font-medium text-xs truncate flex-1 min-w-0",children:h(v)}),p.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(k.FooterText)},children:w(v.created_at)})]},v._id))})})}const Xd=[Ne.Light,Ne.Dark,Ne.System];function GI(e){switch(e){case Ne.Light:return Y.Sun;case Ne.Dark:return Y.Moon;case Ne.System:return Y.Monitor;default:return Y.Monitor}}function YI(){const e=je(),{mode:t,setMode:n}=e,r=()=>{const s=Xd.indexOf(t),o=Xd[(s+1)%Xd.length];n(o)},i=GI(t);return p.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:e.getColor(k.HeaderText)},title:t===Ne.Light?"Açık tema":t===Ne.Dark?"Koyu tema":"Sistem",children:p.jsx(i,{className:"size-5"})})}const cr=Object.create(null);cr.open="0";cr.close="1";cr.ping="2";cr.pong="3";cr.message="4";cr.upgrade="5";cr.noop="6";const lc=Object.create(null);Object.keys(cr).forEach(e=>{lc[cr[e]]=e});const Gp={type:"error",data:"parser error"},JS=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",eC=typeof ArrayBuffer=="function",tC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,dg=({type:e,data:t},n,r)=>JS&&t instanceof Blob?n?r(t):nx(t,r):eC&&(t instanceof ArrayBuffer||tC(t))?n?r(t):nx(new Blob([t]),r):r(cr[e]+(t||"")),nx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function rx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Zd;function QI(e,t){if(JS&&e.data instanceof Blob)return e.data.arrayBuffer().then(rx).then(t);if(eC&&(e.data instanceof ArrayBuffer||tC(e.data)))return t(rx(e.data));dg(e,!1,n=>{Zd||(Zd=new TextEncoder),t(Zd.encode(n))})}const ix="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ix.length;e++)Xo[ix.charCodeAt(e)]=e;const KI=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)s=Xo[e.charCodeAt(r)],o=Xo[e.charCodeAt(r+1)],a=Xo[e.charCodeAt(r+2)],l=Xo[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return u},XI=typeof ArrayBuffer=="function",fg=(e,t)=>{if(typeof e!="string")return{type:"message",data:nC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ZI(e.substring(1),t)}:lc[n]?e.length>1?{type:lc[n],data:e.substring(1)}:{type:lc[n]}:Gp},ZI=(e,t)=>{if(XI){const n=KI(e);return nC(n,t)}else return{base64:!0,data:e}},nC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},rC="",JI=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{dg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(rC))})})},eL=(e,t)=>{const n=e.split(rC),r=[];for(let i=0;i<n.length;i++){const s=fg(n[i],t);if(r.push(s),s.type==="error")break}return r};function tL(){return new TransformStream({transform(e,t){QI(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Jd;function $l(e){return e.reduce((t,n)=>t+n.length,0)}function zl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function nL(e,t){Jd||(Jd=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if($l(n)<1)break;const l=zl(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if($l(n)<2)break;const l=zl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if($l(n)<8)break;const l=zl(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Gp);break}i=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if($l(n)<i)break;const l=zl(n,i);a.enqueue(fg(s?l:Jd.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Gp);break}}}})}const iC=4;function st(e){if(e)return rL(e)}function rL(e){for(var t in st.prototype)e[t]=st.prototype[t];return e}st.prototype.on=st.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};st.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};st.prototype.off=st.prototype.removeListener=st.prototype.removeAllListeners=st.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};st.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};st.prototype.emitReserved=st.prototype.emit;st.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};st.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Qu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iL="arraybuffer";function sC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const sL=wn.setTimeout,oL=wn.clearTimeout;function Ku(e,t){t.useNativeTimers?(e.setTimeoutFn=sL.bind(wn),e.clearTimeoutFn=oL.bind(wn)):(e.setTimeoutFn=wn.setTimeout.bind(wn),e.clearTimeoutFn=wn.clearTimeout.bind(wn))}const aL=1.33;function lL(e){return typeof e=="string"?cL(e):Math.ceil((e.byteLength||e.size)*aL)}function cL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function oC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function dL(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class fL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class pg extends st{constructor(t){super(),this.writable=!1,Ku(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new fL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=fg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=uL(t);return n.length?"?"+n:""}}class pL extends pg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};eL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,JI(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=oC()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let aC=!1;try{aC=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hL=aC;function mL(){}class gL extends pL{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ar extends st{constructor(t,n,r){super(),this.createRequest=t,Ku(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=sC(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ar.requestsCount++,ar.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=mL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ar.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ar.requestsCount=0;ar.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",sx);else if(typeof addEventListener=="function"){const e="onpagehide"in wn?"pagehide":"unload";addEventListener(e,sx,!1)}}function sx(){for(let e in ar.requests)ar.requests.hasOwnProperty(e)&&ar.requests[e].abort()}const vL=function(){const e=lC({xdomain:!1});return e&&e.responseType!==null}();class yL extends gL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=vL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ar(lC,this.uri(),t)}}function lC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hL))return new XMLHttpRequest}catch{}if(!t)try{return new wn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const cC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xL extends pg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=cC?{}:sC(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;dg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Qu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=oC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ef=wn.WebSocket||wn.MozWebSocket;class wL extends xL{createSocket(t,n,r){return cC?new ef(t,n,r):n?new ef(t,n):new ef(t)}doWrite(t,n){this.ws.send(n)}}class bL extends pg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=nL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=tL();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Qu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const kL={websocket:wL,webtransport:bL,polling:yL},SL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,CL=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Yp(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=SL.exec(e||""),s={},o=14;for(;o--;)s[CL[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=_L(s,s.path),s.queryKey=TL(s,s.query),s}function _L(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function TL(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Qp=typeof addEventListener=="function"&&typeof removeEventListener=="function",cc=[];Qp&&addEventListener("offline",()=>{cc.forEach(e=>e())},!1);class ci extends st{constructor(t,n){if(super(),this.binaryType=iL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Yp(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Yp(n.host).host);Ku(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=dL(this.opts.query)),Qp&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},cc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=iC,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ci.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ci.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=lL(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Qu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ci.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Qp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=cc.indexOf(this._offlineEventListener);r!==-1&&cc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ci.protocol=iC;class EL extends ci{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ci.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ci.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=c=>{const f=new Error("probe error: "+c);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function a(){o("transport closed")}function l(){o("socket closed")}function u(c){n&&c.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let jL=class extends EL{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>kL[i]).filter(i=>!!i)),super(t,r)}};function AL(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Yp(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const RL=typeof ArrayBuffer=="function",PL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,uC=Object.prototype.toString,ML=typeof Blob=="function"||typeof Blob<"u"&&uC.call(Blob)==="[object BlobConstructor]",OL=typeof File=="function"||typeof File<"u"&&uC.call(File)==="[object FileConstructor]";function hg(e){return RL&&(e instanceof ArrayBuffer||PL(e))||ML&&e instanceof Blob||OL&&e instanceof File}function uc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(uc(e[n]))return!0;return!1}if(hg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return uc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&uc(e[n]))return!0;return!1}function NL(e){const t=[],n=e.data,r=e;return r.data=Kp(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Kp(e,t){if(!e)return e;if(hg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Kp(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Kp(e[r],t));return n}return e}function DL(e,t){return e.data=Xp(e.data,t),delete e.attachments,e}function Xp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Xp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Xp(e[n],t));return e}const IL=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],LL=5;var Te;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Te||(Te={}));class FL{constructor(t){this.replacer=t}encode(t){return(t.type===Te.EVENT||t.type===Te.ACK)&&uc(t)?this.encodeAsBinary({type:t.type===Te.EVENT?Te.BINARY_EVENT:Te.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Te.BINARY_EVENT||t.type===Te.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NL(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function ox(e){return Object.prototype.toString.call(e)==="[object Object]"}class mg extends st{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Te.BINARY_EVENT;r||n.type===Te.BINARY_ACK?(n.type=r?Te.EVENT:Te.ACK,this.reconstructor=new BL(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(hg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Te[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Te.BINARY_EVENT||r.type===Te.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(mg.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Te.CONNECT:return ox(n);case Te.DISCONNECT:return n===void 0;case Te.CONNECT_ERROR:return typeof n=="string"||ox(n);case Te.EVENT:case Te.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&IL.indexOf(n[0])===-1);case Te.ACK:case Te.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BL{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=DL(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const $L=Object.freeze(Object.defineProperty({__proto__:null,Decoder:mg,Encoder:FL,get PacketType(){return Te},protocol:LL},Symbol.toStringTag,{value:"Module"}));function Nn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const zL=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class dC extends st{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Nn(t,"open",this.onopen.bind(this)),Nn(t,"packet",this.onpacket.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(zL.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Te.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,c=n.pop();this._registerAckCallback(d,c),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Te.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Te.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Te.EVENT:case Te.BINARY_EVENT:this.onevent(t);break;case Te.ACK:case Te.BINARY_ACK:this.onack(t);break;case Te.DISCONNECT:this.ondisconnect();break;case Te.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Te.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Te.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ao(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ao.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Ao.prototype.reset=function(){this.attempts=0};Ao.prototype.setMin=function(e){this.ms=e};Ao.prototype.setMax=function(e){this.max=e};Ao.prototype.setJitter=function(e){this.jitter=e};class Zp extends st{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ku(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ao({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||$L;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new jL(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Nn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Nn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nn(t,"ping",this.onping.bind(this)),Nn(t,"data",this.ondata.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this)),Nn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Qu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new dC(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Vo={};function dc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=AL(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Vo[i]&&s in Vo[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Zp(r,t):(Vo[i]||(Vo[i]=new Zp(r,t)),l=Vo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(dc,{Manager:Zp,Socket:dC,io:dc,connect:dc});const fC=g.createContext(null),dr=()=>{const e=g.useContext(fC);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},VL=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=ie(),i=g.useRef(null),s=g.useRef(!1),o=g.useRef(!1),a=g.useRef(null),[l,u]=g.useState(!1),[d,c]=g.useState(!1),f=g.useCallback(C=>{var E;console.log("WS: cleanupSocket called",{reason:C,hasSocket:!!i.current,isConnected:(E=i.current)==null?void 0:E.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",C||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),u(!1),c(!1),o.current=!1,s.current=!1,a.current=null},[]),m=g.useCallback((C,E,S)=>{if(a.current===C&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!E&&!S){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const A=Ko(rt.CustomerToken,C)||ha("customer_token"),B=Ko(rt.CustomerRefreshToken,C)||ha("customer_refresh_token");if(!A||!B){if(console.log("WS: Connect skipped - missing required tokens"),E){console.log("WS: Clearing stale isHaveChat flag due to missing tokens"),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}return}if(i.current&&!i.current.connected&&(console.log("WS: Cleaning up disconnected/failed socket before new connection"),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),i.current&&i.current.connected){console.log("WS: Already connected, skipping new connection");return}console.log("WS: Attempting to connect...",{linkId:C,tokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,refreshTokenPrefix:`${B==null?void 0:B.substring(0,20)}...`,deviceId:Ko(rt.DeviceId,C)}),o.current=!0,a.current=C;const L=dc(_T,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:A,device_id:Ko(rt.DeviceId,C)||ha("device_id"),customer_refresh_token:B}});i.current=L,L.on("error",N=>{console.error("WS: Websocket error",N),o.current=!1}),L.on("connect_error",N=>{console.error("WS: Connect error",N),o.current=!1,u(!1),c(!1),i.current===L&&(i.current=null,a.current=null);const ee=(N==null?void 0:N.message)||String(N);if(ee.toLowerCase().includes("unauthorized")||ee.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),C&&eS(C),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}}),L.on("disconnect",N=>{var Z;console.log("WS: Disconnected",N),u(!1),c(!1),o.current=!1,s.current=!1,i.current===L&&(i.current=null,a.current=null);const ee=ie.getState();N==="io server disconnect"&&((Z=ee.widget)!=null&&Z.link_id)&&(ee.isHaveChat||ee.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{m(ee.widget.link_id,ee.isHaveChat,ee.isAIAgentMode)},500))}),L.on("connect",()=>{console.log("WS: Connected successfully"),u(!0),o.current=!1}),L.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,c(!0)})},[]);g.useEffect(()=>{const C=t==null?void 0:t.link_id;return C&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),m(C,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),f("no active chat flags")),()=>{}},[t==null?void 0:t.link_id,n,r,m,f]),g.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),f("provider unmount")},[f]),g.useEffect(()=>{const C=()=>{console.log("WS: Page unloading, disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)},E=()=>{console.log("WS: Page hidden (pagehide), disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)};return window.addEventListener("beforeunload",C),window.addEventListener("pagehide",E),()=>{window.removeEventListener("beforeunload",C),window.removeEventListener("pagehide",E)}},[]);const y=g.useCallback(()=>{const C=t==null?void 0:t.link_id;C?m(C,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,m]),x=g.useCallback(()=>{console.log("WS: Reconnecting..."),f("manual reconnect");const C=t==null?void 0:t.link_id;C&&setTimeout(()=>{m(C,n,r)},100)},[t==null?void 0:t.link_id,n,r,m,f]),w=g.useCallback(()=>{console.log("WS: Manual disconnect"),f("manual disconnect")},[f]),h=g.useCallback((C,E)=>{var S;(S=i.current)==null||S.on(C,E)},[]),v=g.useCallback((C,E)=>{var S;(S=i.current)==null||S.off(C,E)},[]),b=g.useCallback((C,E,S)=>{i.current&&i.current.connected?i.current.emit(C,E,S):console.warn(`WS: Cannot emit event '${C}', socket not connected.`)},[]),T=g.useMemo(()=>({connectionReady:d,connected:l,connect:y,reconnect:x,disconnect:w,on:h,off:v,emit:b}),[l,d,y,x,w,h,v,b]);return p.jsx(fC.Provider,{value:T,children:e})},Xc=(e,t,n)=>{const r=typeof window<"u"?window:void 0;g.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},Ro=()=>{let e=!1,t=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true",t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)),e||t},UL=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},Xu=()=>g.useMemo(()=>typeof window>"u"||new URLSearchParams(window.location.search).get("fullscreen")==="true"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent),[]);var Ve=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e.MessageRead="message:read",e.AgentRequestHuman="agent:request:human",e.AgentMessageCreate="agent:message:create",e.ChatUpdateInputs="chat:update:inputs",e))(Ve||{}),ve=(e=>(e.Connect="connect",e.Disconnect="disconnect",e.ConnectionReady="connection:ready",e.MessageAgentCreate="message:agent:create",e.MessageUserCreate="message:user:create",e.MessageCustomerCreate="message:customer:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e.ChatUserShowButton="chat:user:show-button",e.ChatUserLeave="chat:user:leave",e.ChatUserJoin="chat:user:join",e.AgentMessageChunk="agent:message:chunk",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(ve||{});function HL(){const e=Gu(),t=g.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return Xc("popstate",t),null}function WL(){const e=dr(),t=Gu(),n=g.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(Ve.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return Xc("popstate",n),g.useEffect(()=>{if(!e)return;const r=RI(),i=AI();r!==i&&(e.emit(Ve.PageChange,{page:i}),t.setPage(i))},[e]),null}function qL(){return HL(),null}const ax=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function GL(){var he,ue,q,oe;const e=je(),t=ie(z=>z.widget),n=ie(z=>z.setOpen),r=ie(z=>z.setAIAgent),i=ie(z=>z.setIsAIAgentMode),s=ie(z=>z.setIsHaveChat),o=ie(z=>z.isHaveChat),a=ie(z=>z.humanNeedRequested),l=ie(z=>z.setHumanNeedRequested),u=ie(z=>z.aiAgent),d=ie(z=>z.setShowActionButtons),[c,f]=g.useState(!1),[m,y]=g.useState(!1),[x,w]=g.useState(!1),h=gs(),v=Ro(),b=Xu(),[T,C]=g.useState(!0),[E,S]=g.useState(!1),A=Gu(),B=Wm(),L=dr(),[N,ee]=g.useState(null),Z=g.useRef(!1),V=g.useRef(!1),O=ol(),I=g.useCallback(async()=>{var ne,D,te;if(!t)return;ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().clearAIAgentState(),d(!1);const z=(((te=(D=(ne=t.appearance)==null?void 0:ne.body)==null?void 0:D.inputs)==null?void 0:te.length)||0)>0;if(N){if(m)return;y(!0);try{const[de,Ce]=await B.mutateAsync({inputs:{username:"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`},history:A.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id),is_agent_mode:!0});$n(Ce)&&Ip(de)?(Ln(rt.CustomerToken,de.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,de.customer_refresh_token,t.link_id),Ln(rt.DeviceId,de.device_id,t.link_id),A.clearHistory(),s(!0),r(N),i(!0),h.push("chat")):(ho(de),z&&C(!1))}catch(de){console.error("Error creating chat for AI agent:",de),z&&C(!1)}finally{y(!1)}return}if(!z){if(m)return;y(!0);try{const[de,Ce]=await B.mutateAsync({inputs:{},history:A.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id)});$n(Ce)&&Ip(de)?(Ln(rt.CustomerToken,de.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,de.customer_refresh_token,t.link_id),Ln(rt.DeviceId,de.device_id,t.link_id),A.clearHistory(),s(!0),h.push("chat")):ho(de)}catch(de){console.error("Error creating chat:",de)}finally{y(!1)}return}C(!1)},[t,N,m,B,A,s,r,i,h]),H=g.useCallback(()=>{var ne,D,te;C(!1),!((((te=(D=(ne=t==null?void 0:t.appearance)==null?void 0:ne.body)==null?void 0:D.inputs)==null?void 0:te.length)||0)>0)&&!N&&!a&&I()},[t,N,a,I]),_=g.useCallback(z=>{S(z)},[]);if(!t)return null;const P=()=>{n(!1)};g.useEffect(()=>{var D,te,de;if(!t||Z.current)return;Z.current=!0;const z=mr(t.link_id);if(z.isAgentMode&&z.agent&&(O!=null&&O.accessToken)){if(r(z.agent),i(!0),z.sessionId&&ie.getState().setAIAgentSessionId(z.sessionId),z.humanNeedRequested){if(ie.getState().setHumanNeedRequested(!0),!((((de=(te=(D=t.appearance)==null?void 0:D.body)==null?void 0:te.inputs)==null?void 0:de.length)||0)>0)){h.push("chat");return}return}ee(z.agent),h.push("chat");return}(async()=>{try{const[Ce,ge]=await uM(t.link_id);ge===200&&Ce&&Ce.is_active&&ee(Ce)}catch(Ce){console.error("Failed to check AI agent:",Ce)}})()},[t,O==null?void 0:O.accessToken,O==null?void 0:O.refreshToken,h,r,i]),g.useEffect(()=>{if(c||!t||!O||!O.accessToken){V.current=!1;return}if(V.current||a)return;if(o){h.push("chat");return}const z=mr(t.link_id);z.isAgentMode&&z.agent&&!z.humanNeedRequested||(V.current=!0,nM(t.client_id,Yi(O)).then(([ne,D])=>{if($n(D))a||h.push("chat");else if(D===403){const te=mr(t.link_id);if(te.isAgentMode&&te.agent){if(te.humanNeedRequested){r(te.agent),i(!1),te.sessionId&&ie.getState().setAIAgentSessionId(te.sessionId),ie.getState().setHumanNeedRequested(!0);return}r(te.agent),i(!0),te.sessionId&&ie.getState().setAIAgentSessionId(te.sessionId),h.push("chat")}else da(t.link_id||""),f(!0)}else D===404?(da(t.link_id||""),f(!0)):D===401?(eS(t.link_id||""),f(!0)):h.push("chat")}).catch(()=>h.push("chat")))},[c,h,r,i,t,O==null?void 0:O.accessToken,O==null?void 0:O.refreshToken,o,a]);const F=ax(((ue=(he=t.appearance)==null?void 0:he.head)==null?void 0:ue.elements)||[],"text"),$=ax(((oe=(q=t.appearance)==null?void 0:q.head)==null?void 0:oe.elements)||[],"title"),W=()=>{if(a&&t){let z=u;if(!z){const ne=mr(t.link_id);ne.agent&&(z=ne.agent,r(ne.agent),ee(ne.agent))}if(z){i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat");return}}C(!0)},Q=()=>{N&&(r(N),i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},se=g.useCallback(z=>{if(!L||x)return;w(!0);const ne=()=>{L.emit(Ve.AgentRequestHuman,{},D=>{w(!1),D!=null&&D.success&&(ie.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),ie.getState().clearAIAgentState(),h.push("chat"))})};z&&Object.keys(z).length>0?L.emit(Ve.ChatUpdateInputs,{inputs:z},D=>{D!=null&&D.success?ne():w(!1)}):ne()},[L,x,i,l,h]);return g.useEffect(()=>{var z,ne,D;if(a){if(!u&&t){const te=mr(t.link_id);te.agent&&(r(te.agent),ee(te.agent))}(u||mr((t==null?void 0:t.link_id)||"").agent)&&((((D=(ne=(z=t==null?void 0:t.appearance)==null?void 0:z.body)==null?void 0:ne.inputs)==null?void 0:D.length)||0)>0?C(!1):se())}},[a,u,t,se,r]),p.jsxs("div",{className:"h-full w-full flex flex-col relative overflow-hidden",children:[p.jsxs("header",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0 border-b overflow-visible min-h-[52px]",style:{backgroundColor:e.getColor(k.HeaderBackground),color:e.getColor(k.HeaderText),borderColor:e.getColor(k.HeaderBorder),...v?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[p.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!T&&(E||a&&(u||t&&mr(t.link_id).agent))&&p.jsx("button",{type:"button",onClick:W,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:p.jsx(Y.ArrowLeft,{className:"w-5 h-5"})}),p.jsxs("div",{className:"flex-1 min-w-0",children:[p.jsx("div",{className:"text-sm font-semibold truncate",children:T?"Geçmiş sohbetler":$||"Müşteri Hizmetleri"}),!T&&F&&p.jsx("div",{className:"text-xs opacity-90 truncate",children:F})]})]}),p.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[p.jsx(YI,{}),b&&p.jsx("button",{type:"button",onClick:P,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:p.jsx(Y.X,{className:"w-5 h-5"})})]})]}),p.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(k.Background)},children:T?p.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:p.jsx(qI,{onShowForm:H,onHasHistory:_})}):p.jsx("div",{className:"flex-1 overflow-y-auto",children:p.jsx($I,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!N&&!a,onAIAgentStart:Q,onOk:()=>{a&&u||(ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},onOperatorConnect:a&&(u||mr(t.link_id).agent)?se:void 0,isConnectingToOperator:x})})}),T&&E&&p.jsx("div",{className:"px-4 py-3 flex-shrink-0",style:{borderTopColor:e.getColor(k.DividerColor),backgroundColor:e.getColor(k.Background)},children:p.jsxs(Rt,{onClick:I,size:"md",className:"w-full flex items-center justify-center gap-2",children:[p.jsx(Y.Plus,{className:"size-4"}),p.jsx("span",{children:"Yeni Sohbet Başlat"})]})})]})}function YL(){return p.jsxs(p.Fragment,{children:[p.jsx(GL,{}),p.jsx(qL,{})]})}const QL=[{path:"/",component:YL,name:"registration"}];function tt({className:e="",style:t}){const n=je();return p.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(k.MessageAdminBackground),opacity:.6,...t}})}function KL(){const e=je();return p.jsxs("section",{className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto",children:[p.jsx("div",{className:"flex w-full items-center justify-start",children:p.jsx(tt,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),p.jsx("div",{className:"flex w-full items-center justify-end",children:p.jsx(tt,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),p.jsx("div",{className:"flex w-full items-center justify-start",children:p.jsx(tt,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),p.jsx("div",{className:"flex w-full items-center justify-end",children:p.jsx(tt,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),p.jsx("div",{className:"flex w-full items-center justify-start",children:p.jsx(tt,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function XL(){const e=je();return p.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(k.FooterBackground),borderRadius:e.getRadius()},children:[p.jsx("div",{className:"grow",children:p.jsx(tt,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})}),p.jsx(tt,{className:"h-12 w-12 rounded-full"})]})}function ZL(){const e=je();return p.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(k.HeaderBackground),borderBottom:`1px solid ${e.getColor(k.HeaderBorder)}`},children:[p.jsx(tt,{className:"h-5 w-36"}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(tt,{className:"h-5 w-5 rounded"}),p.jsx(tt,{className:"h-5 w-5 rounded"})]})]})}function JL(){const e=je();return p.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(k.GreeterBackground)},children:p.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[p.jsxs("div",{children:[p.jsx(tt,{className:"h-4 w-20 mb-1"}),p.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),p.jsxs("div",{children:[p.jsx(tt,{className:"h-4 w-24 mb-1"}),p.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),p.jsxs("div",{children:[p.jsx(tt,{className:"h-4 w-16 mb-1"}),p.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),p.jsx(tt,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.GreeterButtonBackground),opacity:.5}})]})})}function eF(){const e=je();return p.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(k.GreeterTopBackground)},children:[p.jsx(tt,{className:"h-7 w-40"}),p.jsx(tt,{className:"h-4 w-56"})]})}function pC(){const e=je();return p.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(k.Background)},children:[p.jsx(ZL,{}),p.jsx(KL,{}),p.jsx(XL,{}),p.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(k.FooterBorder)}`,backgroundColor:e.getColor(k.FooterBackground)},children:[p.jsx(tt,{className:"h-3 w-20"}),p.jsx(tt,{className:"h-3.5 w-3.5 rounded"})]})]})}function Jp(){const e=je(),t=typeof window<"u"&&window.innerWidth<768;return p.jsxs("div",{className:`h-full w-full relative overflow-hidden ${t?"":"rounded-xl"}`,style:{backgroundColor:e.getColor(k.GreeterBackground)},children:[p.jsx(eF,{}),p.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:p.jsx(JL,{})})]})}const tF="/notify.mp3",gg="lc:notification_sound_muted",hC=()=>{try{return sessionStorage.getItem(gg)==="1"}catch{return!1}},mC=e=>{try{sessionStorage.setItem(gg,e?"1":"0")}catch{}},nF=async e=>{try{if(sessionStorage.getItem(gg)==="1")return}catch{}await new Audio(e||tF).play()},tf=[Ne.Light,Ne.Dark,Ne.System];function rF(e){switch(e){case Ne.Light:return Y.Sun;case Ne.Dark:return Y.Moon;case Ne.System:return Y.Monitor;default:return Y.Monitor}}function iF({onChatClose:e}){const[t,n]=g.useState(!1),[r,i]=g.useState(!1),[s,o]=g.useState(null),[a,l]=g.useState(()=>hC()),u=g.useRef(null),d=g.useRef(null),c=je(),f=cs(),m=dr(),{setShowActionButtons:y}=ie(),{mode:x,setMode:w}=c,h=()=>{m==null||m.emit(Ve.ChatClose,{}),y(!1),e()},v=()=>{const C=tf.indexOf(x),E=tf[(C+1)%tf.length];w(E)},b=()=>{const C=!a;mC(C),l(C)};g.useLayoutEffect(()=>{var C;o(r?((C=u.current)==null?void 0:C.getBoundingClientRect())??null:null)},[r]),g.useEffect(()=>{if(!r)return;const C=E=>{var S,A;(S=d.current)!=null&&S.contains(E.target)||(A=u.current)!=null&&A.contains(E.target)||i(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[r]);const T=r&&s&&yu.createPortal(p.jsxs(Pe.div,{ref:d,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"fixed z-[9999] py-1 min-w-[160px] rounded-lg shadow-lg",style:{top:s.bottom+6,right:typeof window<"u"?window.innerWidth-s.right:s.right,left:"auto",backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[p.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[p.jsx(Y.XCircle,{className:"size-4 flex-shrink-0"}),f(J.ChatEndConversation)]}),p.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:b,children:[a?p.jsx(Y.VolumeX,{className:"size-4 flex-shrink-0"}):p.jsx(Y.Volume2,{className:"size-4 flex-shrink-0"}),f(a?J.NotificationSoundOn:J.NotificationSoundOff)]}),p.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),p.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:v,children:[(()=>{const C=rF(x);return p.jsx(C,{className:"size-4 flex-shrink-0"})})(),x===Ne.Light?"Açık tema":x===Ne.Dark?"Koyu tema":"Sistem"]})]}),document.body);return p.jsxs(p.Fragment,{children:[p.jsx(fi,{children:t&&p.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:p.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[p.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:f(J.ChatCloseConfirm)}),p.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:f(J.ChatCloseWarning)}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:f(J.CancelAction)}),p.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:h,children:f(J.CloseAction)})]})]})})}),p.jsxs("div",{className:"relative flex-shrink-0",children:[p.jsx("button",{ref:u,type:"button",onClick:()=>i(C=>!C),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:f(J.ChatSettings),"aria-expanded":r,children:p.jsx(Y.Menu,{className:"size-5"})}),r&&T]})]})}function lx({text:e}){const n=je().getColor(k.LinkColor),i=(s=>{const o=/(https?:\/\/(?:[-\w.])+(?:\:[0-9]+)?(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?|(?:www\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?)/gi,a=s.split(/(<[^>]*>)/g);let l="",u=!1;for(let d=0;d<a.length;d++){const c=a[d];if(c.startsWith("<")&&c.endsWith(">"))if(c.match(/^<a\s/i)){if(c.includes("style="))l+=c;else{const f=c.replace(/^(<a\s[^>]*)(>)$/i,`$1 style="color: ${n}; text-decoration: underline;"$2`);l+=f}u=!0}else c.match(/^<\/a>/i)?(l+=c,u=!1):l+=c;else if(!u&&c.trim()){const f=c.replace(o,m=>{const y=m.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(y)?y:`https://${y}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${y}</a>`});l+=f}else l+=c}return l})(e);return p.jsx("span",{className:"linkified !text-sm",dangerouslySetInnerHTML:{__html:i}})}const cx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function gC({files:e,className:t,onDelete:n,hideName:r}){const i=Ro(),[s,o]=g.useState(new Map);g.useEffect(()=>{const y=new Map;for(let x=0;x<e.length;x++){const w=e[x];if(w instanceof File){const h=URL.createObjectURL(w);y.set(x,h)}}return o(y),()=>{for(const x of y.values())URL.revokeObjectURL(x)}},[e]);const a=y=>{var w;return((w=(y instanceof File?y.name:y).split(".").pop())==null?void 0:w.toLowerCase())||""},l=y=>y instanceof File?y.name:y.split("/").pop()||y,u=y=>{const[x,w]=y.split(".");return x.length>10?`${x.slice(0,10)}...${w}`:y},d=y=>{const x=["jpg","jpeg","png","gif","bmp","webp","svg"],w=a(y);return x.includes(w)},c=(y,x)=>{if(y instanceof File){const w=s.get(x);w&&window.open(w,"_blank")}else window.open(y,"_blank")},f=(y,x)=>{y.stopPropagation(),n==null||n(x)},m=(y,x)=>y instanceof File?s.get(x)||"":y;return p.jsx("div",{className:ze("flex gap-2 w-full overflow-x-auto",t),children:e.map((y,x)=>{const w=l(y),h=a(y),v=d(y),b=m(y,x);return p.jsxs("div",{onClick:()=>c(y,x),className:"min-w-20 max-w-20 cursor-pointer group/item border border-gray-200 rounded-lg p-1.5 hover:shadow-md transition-all duration-200 hover:border-gray-300 bg-white relative",children:[n&&p.jsx("button",{onClick:T=>f(T,x),className:ze("absolute top-1 right-1 w-5 h-5 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-opacity duration-200 z-10",{"opacity-0 group-hover/item:opacity-100":!i}),children:p.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),v?p.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:p.jsx("img",{src:b,alt:w,className:"w-16 h-16 min-h-16 min-w-16 object-cover group-hover/item:scale-105 transition-transform duration-200"})}):p.jsx("div",{className:"min-w-16 aspect-square w-full mb-0.5 flex items-center justify-center bg-gray-50 rounded group-hover/item:bg-gray-100 transition-colors duration-200",children:p.jsxs("div",{className:"text-center",children:[p.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 bg-blue-100 rounded flex items-center justify-center",children:p.jsx("svg",{className:"w-3 h-3 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:p.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}),p.jsx("div",{className:ze("text-[10px] font-medium text-gray-600 uppercase",{[cx]:r}),children:h||"file"})]})}),p.jsx("div",{className:ze("max-w-16 text-[10px] text-gray-700 font-medium truncate text-ellipsis overflow-hidden",{[cx]:r}),title:w,children:u(w)})]},x)})})}const sF={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},oF={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function aF({buttons:e,className:t=""}){const n=je();if(!e||e.length===0)return null;const r=s=>{s.startsWith("http://")||s.startsWith("https://")?window.open(s,"_blank","noopener,noreferrer"):s.startsWith("tel:")||s.startsWith("mailto:")?window.location.href=s:console.log("Custom action:",s)},i=s=>s.startsWith("http://")||s.startsWith("https://")?p.jsx(Y.ExternalLink,{className:"size-4"}):s.startsWith("tel:")?p.jsx(Y.Phone,{className:"size-4"}):s.startsWith("mailto:")?p.jsx(Y.Mail,{className:"size-4"}):null;return p.jsx(Pe.div,{className:ze(t,"mt-2"),initial:"hidden",animate:"visible",variants:sF,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:p.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${n.getColor(k.Background)}f0`},children:p.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((s,o)=>p.jsxs(Pe.button,{variants:oF,transition:{duration:.25,ease:"easeOut"},whileHover:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:{scale:.98,transition:{duration:.1}},onClick:()=>r(s.url),className:"group inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 relative overflow-hidden cursor-pointer",style:{backgroundColor:n.getColor(k.GreeterBackground),color:n.getColor(k.GreeterText),borderRadius:n.getRadius(),border:`1px solid ${n.getColor(k.DividerColor)}`,boxShadow:`0 1px 3px ${n.getColor(k.ShadowColor)}30`},onMouseEnter:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.ButtonBackground),a.currentTarget.style.color=n.getColor(k.ButtonText),a.currentTarget.style.borderColor=n.getColor(k.ButtonBackground),a.currentTarget.style.boxShadow=`0 4px 12px ${n.getColor(k.ShadowColor)}40`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.GreeterBackground),a.currentTarget.style.color=n.getColor(k.GreeterText),a.currentTarget.style.borderColor=n.getColor(k.DividerColor),a.currentTarget.style.boxShadow=`0 1px 3px ${n.getColor(k.ShadowColor)}30`},children:[p.jsxs("span",{className:"flex items-center gap-2",children:[i(s.url),p.jsx("span",{className:"font-medium",children:s.label})]}),p.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(45deg, transparent 30%, ${n.getColor(k.ButtonText)}10 50%, transparent 70%)`,borderRadius:n.getRadius()}})]},`${s.label}-${o}`))})})})}const ux=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",dx=["Düşünüyorum...","Araştırıyorum...","Cevapları karşılaştırıyorum...","En iyi cevabı hazırlıyorum...","Bilgileri derliyorum..."];function vC({messages:e,isTyping:t,chat:n,streamingContent:r}){var v,b,T,C;const i=g.useRef(null),s=g.useRef(null),[o,a]=g.useState(!0),l=g.useRef(!0),{widget:u}=ie(),d=je(),c=g.useRef(!0),[f,m]=g.useState(0);g.useEffect(()=>{e.length>0&&c.current&&requestAnimationFrame(()=>{c.current=!1})},[e]),g.useEffect(()=>{if(!t||r===void 0||r)return;const E=setInterval(()=>{m(S=>(S+1)%dx.length)},2500);return()=>clearInterval(E)},[t,r]);const y=()=>{const E=s.current;E&&(E.scrollTop=E.scrollHeight)},x=()=>{if(s.current){const{scrollTop:E,scrollHeight:S,clientHeight:A}=s.current,B=S-E<=A+10;l.current=B,a(B)}};g.useEffect(()=>{(l.current||t)&&y()},[e,t,r]);const w=E=>c.current?{initial:!1,animate:{}}:E===ye.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:E===ye.User||E===ye.Agent?{initial:{opacity:0,x:-30},animate:{opacity:1,x:0}}:{initial:{opacity:0,y:10},animate:{opacity:1,y:0}},h=E=>E===ye.Customer?"18px 18px 4px 18px":E===ye.User||E===ye.Agent?"18px 18px 18px 4px":d.getRadius();return p.jsxs("section",{onScroll:x,ref:s,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden",children:[((b=(v=u==null?void 0:u.appearance)==null?void 0:v.design)==null?void 0:b.greeting_message)&&p.jsx("div",{className:"flex w-full items-center justify-start",children:p.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap border-0 px-3 py-2 !text-sm",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(C=(T=u==null?void 0:u.appearance)==null?void 0:T.design)==null?void 0:C.greeting_message})}),p.jsx(fi,{children:Array.isArray(e)&&e.filter(S=>{var A;return S!=null&&(!!S.content||(((A=S.files)==null?void 0:A.length)??0)>0)&&S.content!==`
97
- `}).map((S,A)=>{var L;const B=w(S.sender_type);return p.jsxs(Pe.div,{initial:B.initial,animate:B.animate,transition:{duration:.25,ease:"easeOut"},className:ze("flex flex-col w-full min-w-0 justify-center break-words",{"items-end":S.sender_type===ye.Customer||S.activity_type===mn.ChatCreated,"items-start":S.sender_type===ye.User||S.sender_type===ye.Agent,"items-center":S.sender_type===ye.System||S.sender_type===ye.Activity}),children:[S.sender_type===ye.System&&p.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words overflow-hidden px-3 py-1.5 text-sm",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText),borderRadius:d.getRadius()},children:S.content}),([ye.Customer,ye.User,ye.Agent].includes(S.sender_type)||S.activity_type===mn.ChatCreated)&&p.jsxs("div",{className:ze("max-w-[80%] border-0 px-3 py-2",{"whitespace-pre-wrap !text-sm":S.sender_type===ye.Customer||S.activity_type===mn.ChatCreated||S.sender_type===ye.Agent&&!((L=S.content)!=null&&L.includes('id="chaty"'))}),style:{backgroundColor:S.sender_type===ye.User||S.sender_type===ye.Agent?d.getColor(k.MessageAdminBackground):d.getColor(k.MessageVisitorBackground),color:S.sender_type===ye.User||S.sender_type===ye.Agent?d.getColor(k.MessageAdminText):d.getColor(k.MessageVisitorText),borderRadius:h(S.sender_type)},children:[S.files&&S.files.length>0&&p.jsx(gC,{files:S.files,className:"mb-1",hideName:!0}),S.sender_type===ye.User||S.sender_type===ye.Agent?p.jsx(lx,{text:S.content}):S.content,S.created_at&&p.jsx("div",{className:"text-[0.5rem] text-right opacity-70 mt-1",style:{color:S.sender_type===ye.User||S.sender_type===ye.Agent?d.getColor(k.MessageAdminText):d.getColor(k.MessageVisitorText)},children:ux(S.created_at)})]}),([ye.Customer,ye.User,ye.Agent].includes(S.sender_type)||S.activity_type===mn.ChatCreated)&&S.buttons&&S.buttons.length>0&&p.jsx("div",{className:ze("w-full",{"flex justify-end":S.sender_type===ye.Customer||S.activity_type===mn.ChatCreated,"flex justify-start":S.sender_type===ye.User||S.sender_type===ye.Agent}),children:p.jsx("div",{className:"max-w-[80%]",children:p.jsx(aF,{buttons:S.buttons})})}),S.sender_type===ye.Activity&&S.activity_type!==mn.ChatCreated&&p.jsx("div",{className:"max-w-full border-0 rounded-full px-3 py-1 text-xs shadow-none break-words overflow-hidden",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText)},children:S.activity_type===mn.AdminLeave?`${S.content.split("_")[2]} odadan ayrıldı`:S.activity_type===mn.AdminJoin?`${S.content.split("_")[2]} odaya katıldı`:S.activity_type===mn.AdminToggleUpload?S.content.includes("is_customer_uploadable:true")?"Dosya gönderim izni açıldı":"Dosya gönderim izni kapatıldı":S.content}),ye.System===S.sender_type&&p.jsx("div",{className:"text-xs",style:{color:d.getColor(k.MessageAdminText)},children:S.created_at&&ux(S.created_at)})]},S.id||A)})}),t&&p.jsx(Pe.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.2},className:"flex w-full items-center justify-start mt-1",children:r!==void 0?p.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap min-w-[4rem]",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:r?p.jsx(lx,{text:r}):p.jsxs("div",{className:"flex items-center gap-2 py-1",children:[p.jsx(Y.Sparkles,{className:"size-4 flex-shrink-0 sparkle-pulse",style:{color:d.getColor(k.MessageAdminText)}}),p.jsx(fi,{mode:"wait",children:p.jsx(Pe.span,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"text-sm",style:{color:d.getColor(k.MessageAdminText)},children:dx[f]},f)})]})}):p.jsx("div",{className:"flex items-center rounded-full px-4 py-2",style:{backgroundColor:d.getColor(k.MessageAdminBackground)},children:p.jsxs("div",{className:"flex space-x-1",children:[p.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:d.getColor(k.MessageAdminText),animationDelay:"0ms"}}),p.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:d.getColor(k.MessageAdminText),animationDelay:"150ms"}}),p.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:d.getColor(k.MessageAdminText),animationDelay:"300ms"}})]})})}),!o&&p.jsx("div",{className:"absolute bottom-28 right-4",children:p.jsx(Rt,{type:"button",variant:"primary",kind:"solid",rounded:!0,className:"size-10 flex items-center justify-center p-0! shadow-md z-10",onClick:()=>{var E,S;(S=s.current)==null||S.scrollTo({top:(E=s.current)==null?void 0:E.scrollHeight,behavior:"smooth"})},children:p.jsx(Y.ArrowDown,{className:"size-4"})})}),p.jsx("div",{ref:i})]})}/**
96
+ */var gt=typeof Symbol=="function"&&Symbol.for,og=gt?Symbol.for("react.element"):60103,ag=gt?Symbol.for("react.portal"):60106,Nu=gt?Symbol.for("react.fragment"):60107,Du=gt?Symbol.for("react.strict_mode"):60108,Iu=gt?Symbol.for("react.profiler"):60114,Lu=gt?Symbol.for("react.provider"):60109,Fu=gt?Symbol.for("react.context"):60110,lg=gt?Symbol.for("react.async_mode"):60111,Bu=gt?Symbol.for("react.concurrent_mode"):60111,$u=gt?Symbol.for("react.forward_ref"):60112,zu=gt?Symbol.for("react.suspense"):60113,lI=gt?Symbol.for("react.suspense_list"):60120,Vu=gt?Symbol.for("react.memo"):60115,Uu=gt?Symbol.for("react.lazy"):60116,cI=gt?Symbol.for("react.block"):60121,uI=gt?Symbol.for("react.fundamental"):60117,dI=gt?Symbol.for("react.responder"):60118,fI=gt?Symbol.for("react.scope"):60119;function cn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case og:switch(e=e.type,e){case lg:case Bu:case Nu:case Iu:case Du:case zu:return e;default:switch(e=e&&e.$$typeof,e){case Fu:case $u:case Uu:case Vu:case Lu:return e;default:return t}}case ag:return t}}}function HS(e){return cn(e)===Bu}Me.AsyncMode=lg;Me.ConcurrentMode=Bu;Me.ContextConsumer=Fu;Me.ContextProvider=Lu;Me.Element=og;Me.ForwardRef=$u;Me.Fragment=Nu;Me.Lazy=Uu;Me.Memo=Vu;Me.Portal=ag;Me.Profiler=Iu;Me.StrictMode=Du;Me.Suspense=zu;Me.isAsyncMode=function(e){return HS(e)||cn(e)===lg};Me.isConcurrentMode=HS;Me.isContextConsumer=function(e){return cn(e)===Fu};Me.isContextProvider=function(e){return cn(e)===Lu};Me.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===og};Me.isForwardRef=function(e){return cn(e)===$u};Me.isFragment=function(e){return cn(e)===Nu};Me.isLazy=function(e){return cn(e)===Uu};Me.isMemo=function(e){return cn(e)===Vu};Me.isPortal=function(e){return cn(e)===ag};Me.isProfiler=function(e){return cn(e)===Iu};Me.isStrictMode=function(e){return cn(e)===Du};Me.isSuspense=function(e){return cn(e)===zu};Me.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Nu||e===Bu||e===Iu||e===Du||e===zu||e===lI||typeof e=="object"&&e!==null&&(e.$$typeof===Uu||e.$$typeof===Vu||e.$$typeof===Lu||e.$$typeof===Fu||e.$$typeof===$u||e.$$typeof===uI||e.$$typeof===dI||e.$$typeof===fI||e.$$typeof===cI)};Me.typeOf=cn;US.exports=Me;var pI=US.exports,WS=pI,hI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},mI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},qS={};qS[WS.ForwardRef]=hI;qS[WS.Memo]=mI;function ft(){return ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}function GS(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Hu=v.createContext(void 0);Hu.displayName="FormikContext";Hu.Provider;Hu.Consumer;function gI(){var e=v.useContext(Hu);return e}var An=function(t){return typeof t=="function"},Wu=function(t){return t!==null&&typeof t=="object"},vI=function(t){return String(Math.floor(Number(t)))===t},Wd=function(t){return Object.prototype.toString.call(t)==="[object String]"},qd=function(t){return Wu(t)&&An(t.then)};function Zt(e,t,n,r){r===void 0&&(r=0);for(var i=VS(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function Ki(e,t,n){for(var r=Y0(e),i=r,s=0,o=VS(t);s<o.length-1;s++){var a=o[s],l=Zt(e,o.slice(0,s+1));if(l&&(Wu(l)||Array.isArray(l)))i=i[a]=Y0(l);else{var c=o[s+1];i=i[a]=vI(c)&&Number(c)>=0?[]:{}}}return(s===0?e:i)[o[s]]===n?e:(n===void 0?delete i[o[s]]:i[o[s]]=n,s===0&&n===void 0&&delete r[o[s]],r)}function YS(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(e);i<s.length;i++){var o=s[i],a=e[o];Wu(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},YS(a,t,n,r[o])):r[o]=t}return r}function yI(e,t){switch(t.type){case"SET_VALUES":return ft({},e,{values:t.payload});case"SET_TOUCHED":return ft({},e,{touched:t.payload});case"SET_ERRORS":return Ai(e.errors,t.payload)?e:ft({},e,{errors:t.payload});case"SET_STATUS":return ft({},e,{status:t.payload});case"SET_ISSUBMITTING":return ft({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ft({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ft({},e,{values:Ki(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ft({},e,{touched:Ki(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ft({},e,{errors:Ki(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ft({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ft({},e,{touched:YS(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ft({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ft({},e,{isSubmitting:!1});default:return e}}var _i={},Bl={};function xI(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,s=e.validateOnMount,o=s===void 0?!1:s,a=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,d=e.onSubmit,u=GS(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=ft({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),m=v.useRef(p.initialValues),y=v.useRef(p.initialErrors||_i),x=v.useRef(p.initialTouched||Bl),w=v.useRef(p.initialStatus),h=v.useRef(!1),g=v.useRef({});v.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var b=v.useState(0),T=b[1],_=v.useRef({values:Fl(p.initialValues),errors:Fl(p.initialErrors)||_i,touched:Fl(p.initialTouched)||Bl,status:Fl(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),E=_.current,S=v.useCallback(function(R){var K=_.current;_.current=yI(K,R),K!==_.current&&T(function(M){return M+1})},[]),A=v.useCallback(function(R,K){return new Promise(function(M,U){var ae=p.validate(R,K);ae==null?M(_i):qd(ae)?ae.then(function(fe){M(fe||_i)},function(fe){U(fe)}):M(ae)})},[p.validate]),B=v.useCallback(function(R,K){var M=p.validationSchema,U=An(M)?M(K):M,ae=K&&U.validateAt?U.validateAt(K,R):bI(R,U);return new Promise(function(fe,ke){ae.then(function(){fe(_i)},function(at){at.name==="ValidationError"?fe(wI(at)):ke(at)})})},[p.validationSchema]),L=v.useCallback(function(R,K){return new Promise(function(M){return M(g.current[R].validate(K))})},[]),N=v.useCallback(function(R){var K=Object.keys(g.current).filter(function(U){return An(g.current[U].validate)}),M=K.length>0?K.map(function(U){return L(U,Zt(R,U))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(M).then(function(U){return U.reduce(function(ae,fe,ke){return fe==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||fe&&(ae=Ki(ae,K[ke],fe)),ae},{})})},[L]),ee=v.useCallback(function(R){return Promise.all([N(R),p.validationSchema?B(R):{},p.validate?A(R):{}]).then(function(K){var M=K[0],U=K[1],ae=K[2],fe=Bp.all([M,U,ae],{arrayMerge:kI});return fe})},[p.validate,p.validationSchema,N,A,B]),Z=pn(function(R){return R===void 0&&(R=E.values),S({type:"SET_ISVALIDATING",payload:!0}),ee(R).then(function(K){return h.current&&(S({type:"SET_ISVALIDATING",payload:!1}),S({type:"SET_ERRORS",payload:K})),K})});v.useEffect(function(){o&&h.current===!0&&Ai(m.current,p.initialValues)&&Z(m.current)},[o,Z]);var V=v.useCallback(function(R){var K=R&&R.values?R.values:m.current,M=R&&R.errors?R.errors:y.current?y.current:p.initialErrors||{},U=R&&R.touched?R.touched:x.current?x.current:p.initialTouched||{},ae=R&&R.status?R.status:w.current?w.current:p.initialStatus;m.current=K,y.current=M,x.current=U,w.current=ae;var fe=function(){S({type:"RESET_FORM",payload:{isSubmitting:!!R&&!!R.isSubmitting,errors:M,touched:U,status:ae,values:K,isValidating:!!R&&!!R.isValidating,submitCount:R&&R.submitCount&&typeof R.submitCount=="number"?R.submitCount:0}})};if(p.onReset){var ke=p.onReset(E.values,de);qd(ke)?ke.then(fe):fe()}else fe()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);v.useEffect(function(){h.current===!0&&!Ai(m.current,p.initialValues)&&c&&(m.current=p.initialValues,V(),o&&Z(m.current))},[c,p.initialValues,V,o,Z]),v.useEffect(function(){c&&h.current===!0&&!Ai(y.current,p.initialErrors)&&(y.current=p.initialErrors||_i,S({type:"SET_ERRORS",payload:p.initialErrors||_i}))},[c,p.initialErrors]),v.useEffect(function(){c&&h.current===!0&&!Ai(x.current,p.initialTouched)&&(x.current=p.initialTouched||Bl,S({type:"SET_TOUCHED",payload:p.initialTouched||Bl}))},[c,p.initialTouched]),v.useEffect(function(){c&&h.current===!0&&!Ai(w.current,p.initialStatus)&&(w.current=p.initialStatus,S({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var O=pn(function(R){if(g.current[R]&&An(g.current[R].validate)){var K=Zt(E.values,R),M=g.current[R].validate(K);return qd(M)?(S({type:"SET_ISVALIDATING",payload:!0}),M.then(function(U){return U}).then(function(U){S({type:"SET_FIELD_ERROR",payload:{field:R,value:U}}),S({type:"SET_ISVALIDATING",payload:!1})})):(S({type:"SET_FIELD_ERROR",payload:{field:R,value:M}}),Promise.resolve(M))}else if(p.validationSchema)return S({type:"SET_ISVALIDATING",payload:!0}),B(E.values,R).then(function(U){return U}).then(function(U){S({type:"SET_FIELD_ERROR",payload:{field:R,value:Zt(U,R)}}),S({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),I=v.useCallback(function(R,K){var M=K.validate;g.current[R]={validate:M}},[]),H=v.useCallback(function(R){delete g.current[R]},[]),C=pn(function(R,K){S({type:"SET_TOUCHED",payload:R});var M=K===void 0?i:K;return M?Z(E.values):Promise.resolve()}),P=v.useCallback(function(R){S({type:"SET_ERRORS",payload:R})},[]),F=pn(function(R,K){var M=An(R)?R(E.values):R;S({type:"SET_VALUES",payload:M});var U=K===void 0?n:K;return U?Z(M):Promise.resolve()}),$=v.useCallback(function(R,K){S({type:"SET_FIELD_ERROR",payload:{field:R,value:K}})},[]),W=pn(function(R,K,M){S({type:"SET_FIELD_VALUE",payload:{field:R,value:K}});var U=M===void 0?n:M;return U?Z(Ki(E.values,R,K)):Promise.resolve()}),Q=v.useCallback(function(R,K){var M=K,U=R,ae;if(!Wd(R)){R.persist&&R.persist();var fe=R.target?R.target:R.currentTarget,ke=fe.type,at=fe.name,vt=fe.id,Vn=fe.value,un=fe.checked,ys=fe.outerHTML,pr=fe.options,Nr=fe.multiple;M=K||at||vt,U=/number|range/.test(ke)?(ae=parseFloat(Vn),isNaN(ae)?"":ae):/checkbox/.test(ke)?CI(Zt(E.values,M),un,Vn):pr&&Nr?SI(pr):Vn}M&&W(M,U)},[W,E.values]),se=pn(function(R){if(Wd(R))return function(K){return Q(K,R)};Q(R)}),he=pn(function(R,K,M){K===void 0&&(K=!0),S({type:"SET_FIELD_TOUCHED",payload:{field:R,value:K}});var U=M===void 0?i:M;return U?Z(E.values):Promise.resolve()}),ue=v.useCallback(function(R,K){R.persist&&R.persist();var M=R.target,U=M.name,ae=M.id,fe=M.outerHTML,ke=K||U||ae;he(ke,!0)},[he]),q=pn(function(R){if(Wd(R))return function(K){return ue(K,R)};ue(R)}),oe=v.useCallback(function(R){An(R)?S({type:"SET_FORMIK_STATE",payload:R}):S({type:"SET_FORMIK_STATE",payload:function(){return R}})},[]),z=v.useCallback(function(R){S({type:"SET_STATUS",payload:R})},[]),ne=v.useCallback(function(R){S({type:"SET_ISSUBMITTING",payload:R})},[]),D=pn(function(){return S({type:"SUBMIT_ATTEMPT"}),Z().then(function(R){var K=R instanceof Error,M=!K&&Object.keys(R).length===0;if(M){var U;try{if(U=Ce(),U===void 0)return}catch(ae){throw ae}return Promise.resolve(U).then(function(ae){return h.current&&S({type:"SUBMIT_SUCCESS"}),ae}).catch(function(ae){if(h.current)throw S({type:"SUBMIT_FAILURE"}),ae})}else if(h.current&&(S({type:"SUBMIT_FAILURE"}),K))throw R})}),te=pn(function(R){R&&R.preventDefault&&An(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&An(R.stopPropagation)&&R.stopPropagation(),D().catch(function(K){console.warn("Warning: An unhandled error was caught from submitForm()",K)})}),de={resetForm:V,validateForm:Z,validateField:O,setErrors:P,setFieldError:$,setFieldTouched:he,setFieldValue:W,setStatus:z,setSubmitting:ne,setTouched:C,setValues:F,setFormikState:oe,submitForm:D},Ce=pn(function(){return d(E.values,de)}),ge=pn(function(R){R&&R.preventDefault&&An(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&An(R.stopPropagation)&&R.stopPropagation(),V()}),Ze=v.useCallback(function(R){return{value:Zt(E.values,R),error:Zt(E.errors,R),touched:!!Zt(E.touched,R),initialValue:Zt(m.current,R),initialTouched:!!Zt(x.current,R),initialError:Zt(y.current,R)}},[E.errors,E.touched,E.values]),ot=v.useCallback(function(R){return{setValue:function(M,U){return W(R,M,U)},setTouched:function(M,U){return he(R,M,U)},setError:function(M){return $(R,M)}}},[W,he,$]),Bt=v.useCallback(function(R){var K=Wu(R),M=K?R.name:R,U=Zt(E.values,M),ae={name:M,value:U,onChange:se,onBlur:q};if(K){var fe=R.type,ke=R.value,at=R.as,vt=R.multiple;fe==="checkbox"?ke===void 0?ae.checked=!!U:(ae.checked=!!(Array.isArray(U)&&~U.indexOf(ke)),ae.value=ke):fe==="radio"?(ae.checked=U===ke,ae.value=ke):at==="select"&&vt&&(ae.value=ae.value||[],ae.multiple=!0)}return ae},[q,se,E.values]),re=v.useMemo(function(){return!Ai(m.current,E.values)},[m.current,E.values]),be=v.useMemo(function(){return typeof a<"u"?re?E.errors&&Object.keys(E.errors).length===0:a!==!1&&An(a)?a(p):a:E.errors&&Object.keys(E.errors).length===0},[a,re,E.errors,p]),Je=ft({},E,{initialValues:m.current,initialErrors:y.current,initialTouched:x.current,initialStatus:w.current,handleBlur:q,handleChange:se,handleReset:ge,handleSubmit:te,resetForm:V,setErrors:P,setFormikState:oe,setFieldTouched:he,setFieldValue:W,setFieldError:$,setStatus:z,setSubmitting:ne,setTouched:C,setValues:F,submitForm:D,validateForm:Z,validateField:O,isValid:be,dirty:re,unregisterField:H,registerField:I,getFieldProps:Bt,getFieldMeta:Ze,getFieldHelpers:ot,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return Je}function wI(e){var t={};if(e.inner){if(e.inner.length===0)return Ki(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var s;if(n){if(r>=i.length)break;s=i[r++]}else{if(r=i.next(),r.done)break;s=r.value}var o=s;Zt(t,o.path)||(t=Ki(t,o.path,o.message))}}return t}function bI(e,t,n,r){n===void 0&&(n=!1);var i=Wp(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function Wp(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||C0(i)?Wp(i):i!==""?i:void 0}):C0(e[r])?t[r]=Wp(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function kI(e,t,n){var r=e.slice();return t.forEach(function(s,o){if(typeof r[o]>"u"){var a=n.clone!==!1,l=a&&n.isMergeableObject(s);r[o]=l?Bp(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[o]=Bp(e[o],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function SI(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function CI(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var _I=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function pn(e){var t=v.useRef(e);return _I(function(){t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var TI=v.forwardRef(function(e,t){var n=e.action,r=GS(e,["action"]),i=n??"#",s=gI(),o=s.handleReset,a=s.handleSubmit;return v.createElement("form",ft({onSubmit:a,ref:t,onReset:o,action:i},r))});TI.displayName="Form";const QS=({init:e,schema:t,action:n})=>xI({initialValues:e,validationSchema:t,validateOnBlur:!1,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:r=>{n(r)}});function EI(e,t,n){let r=n;r||(r=Object.keys(e));for(let i of r){if(Array.isArray(e[i])&&Array.isArray(t[i])){if(e[i].length!==t[i].length)return!1;for(let s=0;s<e[i].length;s++)if(e[i][s]!==t[i][s])return!1;continue}if(e[i]!==t[i])return!1}return!0}function cg({id:e,text:t,className:n,required:r}){const i=je();return t?f.jsxs("label",{htmlFor:e,className:ze("mb-1 block text-sm font-medium",n),style:{color:i.getColor(k.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(k.ErrorText)},children:"*"})]}):null}const Gd={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function jI({id:e,label:t,suffix:n,prefix:r,size:i="md",type:s="text",noMargin:o=!1,required:a=!1,error:l,ariaDescribedBy:c,className:d,ariaInvalid:u,ariaLabel:p,autoFocus:m,...y}){const x=je(),w=x.getRadius(),h=l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),g=x.getColor(k.LinkColor);return f.jsxs("div",{className:ze({"mb-2":!o},d),style:{"--focus-ring":g},children:[f.jsx(cg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:ze("inline-block border border-solid border-r-0 rounded-l-md",Gd[i]),style:{borderColor:l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),backgroundColor:x.getColor(k.InputBackground),borderRadius:w},children:r}),f.jsx("input",{id:e,className:ze("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",Gd[i],{"rounded-l-none":!!r,"rounded-r-none":!!n}),type:s,required:a,"aria-describedby":c,"aria-invalid":u,"aria-label":p,style:{fontSize:"16px",color:l?x.getColor(k.ErrorText):x.getColor(k.InputText),backgroundColor:x.getColor(k.InputBackground),borderColor:h,borderRadius:w,"--tw-ring-color":g},...y}),n&&f.jsx("span",{className:ze("inline-block border border-solid border-l-0 rounded-r-md",Gd[i]),style:{borderColor:l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),backgroundColor:x.getColor(k.InputBackground),borderRadius:w},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:x.getColor(k.ErrorText)},children:l})]})}const X0=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},KS=v.createContext({}),AI=()=>`${window.location.pathname}_$$_${document.title}`,RI=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},PI=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function MI({children:e}){const[t,n]=v.useState("/"),[r,i]=v.useState(PI());function s(){i([]),localStorage.removeItem("p-history")}const o=a=>{n(a),i(l=>[...new Set([...l,a])]),localStorage.setItem("page",a),localStorage.setItem("p-history",JSON.stringify(r))};return f.jsx(KS.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function qu(){return v.useContext(KS)}const ha=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};function OI({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){return f.jsxs("div",{className:r||"",children:[e&&f.jsx(cg,{id:t,required:o,text:e}),f.jsx("select",{id:t,"aria-placeholder":i,value:n,"aria-label":e,className:"light forelect transition-colors duration-200 border border-solid text-gray-900 text-sm rounded-md focus:ring-emerald-500 focus-visible:ring-0 focus-visible:shadow-none outline focus-visible:outline-none focus-visible:ber-emerald-500 focus:border-emerald-500 block w-full px-2 py-2 placeholder-fuchsia-600 caret-emer-500",onChange:l.onChange,required:o,...l,children:s}),!!a&&f.jsx("p",{className:"1 texm text-r500",children:a})]})}const Z0={ring:{label:"",input:"relative before:content[''] before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-y-2/4 before:-translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10"},hover:{label:"hover:bg-secondary transition-colors duration-200 px-2 py-1 rounded-md",input:""}},NI={blue:"checked:border-blue-500 checked:bg-blue-500 checked:before:bg-blue-500",indigo:"checked:border-indigo-500 checked:bg-indigo-500 checked:before:bg-indigo-500",green:"checked:border-green-500 checked:bg-green-500 checked:before:bg-green-500",red:"checked:border-red-500 checked:bg-red-500 checked:before:bg-red-500",orange:"checked:border-orange-500 checked:bg-orange-500 checked:before:bg-orange-500"},DI={sm:"h-4 w-4 lg:h-3 lg:w-3",md:"h-6 w-6 lg:h-5 lg:w-5",lg:"h-8 w-8 lg:h-7 lg:w-7"},II={sm:"h-3 w-3 lg:h-2.5 lg:w-2.5",md:"h-5 w-5 lg:h-4 lg:w-4",lg:"h-7 w-7 lg:h-6 lg:w-6"};function LI({children:e,name:t,required:n,value:r,checked:i,onChange:s,onBlur:o,red:a,id:l=t,size:c="md",effect:d="ring",reversed:u=!1,variant:p="blue",error:m,...y}){return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between ${u?"flex-row-reverse":""} ${Z0[d].label}`,children:[f.jsxs("label",{className:"disable-highlight relative mr-3 flex cursor-pointer items-center rounded-full",htmlFor:l,children:[f.jsx("input",{id:l,name:t,type:"checkbox",className:`border-gray-200 peer cursor-pointer appearance-none rounded-md border border-solid bg-white transition-all ${NI[p]} ${DI[c]} ${Z0[d].input}`,required:n,checked:i,value:r,onChange:x=>s==null?void 0:s(x.target.checked),onBlur:x=>o==null?void 0:o(x.target.checked),...y}),f.jsx("div",{className:"pointer-events-none absolute left-2/4 top-2/4 translate-x-2/4 translate-y-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",children:f.jsx(Y.Check,{className:II[c]})})]}),f.jsx("label",{className:"disable-highlight mt-px flex grow cursor-pointer select-none items-center justify-between font-light text-gray-800",htmlFor:l,children:e})]}),a&&f.jsx("small",{className:"text-xs text-red-500",children:a}),m&&f.jsx("small",{className:"text-xs text-red-500",children:m})]})}function FI({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){return f.jsxs("label",{htmlFor:e,className:ze("relative flex cursor-pointer items-center rounded-md focus:outline-none",{"opacity-60 cursor-not-allowed":s},o),children:[f.jsx("input",{type:"radio",id:e,name:n,value:e,checked:t,defaultChecked:t,onChange:a=>{r&&r(a.target.checked)},className:"peer h-4 w-4 cursor-pointer appearance-none rounded-full border-2 border-slate-300 transition-all checked:border-[5px] checked:border-indigo-600 focus:ring-0 focus:ring-offset-0",disabled:s}),f.jsx("span",{className:"ml-2 text-sm font-medium text-slate-700",children:i})]})}function BI({id:e,label:t,children:n,required:r,className:i,error:s}){return f.jsxs("fieldset",{id:e,className:i,children:[t&&f.jsxs("legend",{className:"mb-1 block text-sm font-medium text-slate-700",children:[t," ",r&&f.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),f.jsx("div",{className:"flex flex-col gap-1.5 mt-0.5",children:n}),s&&f.jsx("p",{className:"text-red-500 text-sm",children:s})]})}const J0=Object.assign(FI,{Group:BI});function Gu({id:e,label:t,suffix:n,prefix:r,className:i,noMargin:s,rows:o=3,type:a="text",required:l=!1,error:c,ariaInvalid:d,inputRef:u,autoFocus:p=!0,style:m,borderless:y=!1,...x}){const w=je();return f.jsxs("div",{className:ze({"mb-2":!s},i),children:[t&&f.jsx(cg,{id:e,text:t,required:l}),f.jsx("textarea",{className:ze("resize-none max-h-36 w-full py-2 px-3 block outline-none transition-[border-color,box-shadow] duration-200 rounded-lg",{"border border-solid focus:ring-2 focus:ring-offset-0":!y,"border-none bg-transparent":y}),id:e,rows:o,"aria-invalid":d,...x,ref:u,autoFocus:p,style:{...m,fontSize:"14px",color:c?w.getColor(k.ErrorText):w.getColor(k.InputText),...!y&&{backgroundColor:w.getColor(k.InputBackground),borderColor:c?w.getColor(k.ErrorBorder):w.getColor(k.InputBorder),borderRadius:w.getRadius(),"--tw-ring-color":w.getColor(k.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:w.getColor(k.ErrorText)},children:c})]})}function $I({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var A,B,L,N,ee,Z,V,O,I,H;const l=je(),{defaultValues:c,widget:d,setIsHaveChat:u}=ie(),[p,m]=v.useState(!1),y=qu(),x=Hm(),w=!!c&&"username"in c,h=(B=(A=r==null?void 0:r.body)==null?void 0:A.inputs)==null?void 0:B.reduce((C,P)=>{let F=P.remember?ha(P.name):c==null?void 0:c[P.name];return P.options&&F&&!P.options.includes(F)&&(F=void 0),P.name==="username"&&w&&(F=c.username),C[P.name]=F||"",C},{}),g=(N=(L=r==null?void 0:r.body)==null?void 0:L.inputs)==null?void 0:N.reduce((C,P)=>(C[P.name]="",C),{}),b=Km((Z=(ee=r==null?void 0:r.body)==null?void 0:ee.inputs)==null?void 0:Z.reduce((C,P)=>(C[P.name]=P.required?Qc().required(`${P.label} alanı zorunludur`):Qc(),C),{})),T=QS({init:{...h},schema:b,action:async C=>{var P,F;if(!(p||a)){m(!0);try{w&&(C.username=c.username),c!=null&&c.secret_data&&(C.secret_data=c.secret_data);for(const Q in C)typeof C[Q]=="string"&&(C[Q]=C[Q].trim());if(o){for(const Q of((P=r==null?void 0:r.body)==null?void 0:P.inputs)||[])Q.remember&&X0(Q.name,C[Q.name]);o(C);return}const[$,W]=await x.mutateAsync({inputs:C,history:y.history,client_id:t,widget_id:n,device_id:mi((d==null?void 0:d.link_id)||""),is_agent_mode:i});if($n(W)){Dp($)&&(Ln(rt.CustomerToken,$.customer_token,(d==null?void 0:d.link_id)||""),Ln(rt.CustomerRefreshToken,$.customer_refresh_token,(d==null?void 0:d.link_id)||""),Ln(rt.DeviceId,$.device_id,(d==null?void 0:d.link_id)||"")),y.clearHistory();for(const Q of((F=r==null?void 0:r.body)==null?void 0:F.inputs)||[])Q.remember&&X0(Q.name,C[Q.name]);u(!0),i?s==null||s():e==null||e();return}ho($,{form:T})}catch($){console.error("Chat creation error:",$)}finally{m(!1)}}}}),E=(((O=(V=r==null?void 0:r.body)==null?void 0:V.inputs)==null?void 0:O.length)||0)>0?!EI(g||{},(T==null?void 0:T.values)||{}):!0,S=l.getColor(k.GreeterBackground);return f.jsx("section",{className:"h-full overflow-y-auto p-5",style:{backgroundColor:S},children:f.jsxs("form",{autoComplete:"off",className:"grid grid-cols-1 gap-2",onSubmit:C=>{C.preventDefault(),T.handleSubmit()},children:[(H=(I=r==null?void 0:r.body)==null?void 0:I.inputs)==null?void 0:H.map(C=>{var P,F;if(["text","email","phone"].includes(C.type))return f.jsx(jI,{id:C.name,name:C.name,type:C.type,label:C.label,value:T.values[C.name],onChange:T.handleChange,onBlur:T.handleBlur,disabled:C.name==="username"&&w,readOnly:C.name==="username"&&w,autoComplete:"off",placeholder:C.placeholder,error:T.errors[C.name],ariaInvalid:T.errors.name?!0:void 0,required:C.required,noMargin:!0},C.name);if(C.type==="select")return f.jsx(OI,{id:C.name,name:C.name,value:T.values[C.name],onChange:T.handleChange,label:C.label,error:T.errors[C.name],required:C.required,children:(P=C.options)==null?void 0:P.map($=>f.jsx("option",{value:$,children:$},$))},C.name);if(C.type==="checkbox")return f.jsx(LI,{id:C.name,name:C.name,value:T.values[C.name],checked:T.values[C.name]==="true",onChange:T.handleChange,required:C.required,error:T.errors[C.name],children:C.label},C.name);if(C.type==="radio")return f.jsx(J0.Group,{id:C.name,label:C.label,required:C.required,error:T.errors[C.name],children:(F=C.options)==null?void 0:F.map($=>f.jsx(J0,{onChange:W=>{W?T.setFieldValue(C.name,$):T.setFieldValue(C.name,"")},id:$,name:C.name,value:$===T.values[C.name],children:$},$))},C.name);if(C.type==="textarea")return f.jsx(Gu,{id:C.name,name:C.name,value:T.values[C.name],onChange:T.handleChange,placeholder:C.placeholder,error:T.errors[C.name],required:C.required,label:C.label},C.name)}),f.jsx(Rt,{textKey:k.GreeterButtonText,bgKey:k.GreeterButtonBackground,type:"submit",size:"lg",disabled:!E||p||a,className:"transition-all duration-300 hover:opacity-90 transform hover:translate-y-[-1px] shadow-sm",children:p||a?f.jsxs("div",{className:"flex items-center justify-center",children:[f.jsx("span",{className:"mr-2",children:o?"Bağlanıyor":"Yükleniyor"}),f.jsx("span",{className:"animate-pulse",children:"..."})]}):o?"Canlı Desteğe Bağlan":"Sohbet Oluştur"})]})})}var qt=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(qt||{}),mn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e))(mn||{}),ye=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(ye||{});const gs=e=>{const t=BE(),n=(r,i)=>{var o;const s=((o=P6.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,c])=>a.replace(`:${l}`,c),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};var zI={exports:{}},Yd={exports:{}},ex;function XS(){return ex||(ex=1,function(e,t){(function(n,r){e.exports=r()})(oh,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",d="week",u="month",p="quarter",m="year",y="date",x="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(V){var O=["th","st","nd","rd"],I=V%100;return"["+V+(O[(I-20)%10]||O[I]||O[0])+"]"}},b=function(V,O,I){var H=String(V);return!H||H.length>=O?V:""+Array(O+1-H.length).join(I)+V},T={s:b,z:function(V){var O=-V.utcOffset(),I=Math.abs(O),H=Math.floor(I/60),C=I%60;return(O<=0?"+":"-")+b(H,2,"0")+":"+b(C,2,"0")},m:function V(O,I){if(O.date()<I.date())return-V(I,O);var H=12*(I.year()-O.year())+(I.month()-O.month()),C=O.clone().add(H,u),P=I-C<0,F=O.clone().add(H+(P?-1:1),u);return+(-(H+(I-C)/(P?C-F:F-C))||0)},a:function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},p:function(V){return{M:u,y:m,w:d,d:c,D:y,h:l,m:a,s:o,ms:s,Q:p}[V]||String(V||"").toLowerCase().replace(/s$/,"")},u:function(V){return V===void 0}},_="en",E={};E[_]=g;var S="$isDayjsObject",A=function(V){return V instanceof ee||!(!V||!V[S])},B=function V(O,I,H){var C;if(!O)return _;if(typeof O=="string"){var P=O.toLowerCase();E[P]&&(C=P),I&&(E[P]=I,C=P);var F=O.split("-");if(!C&&F.length>1)return V(F[0])}else{var $=O.name;E[$]=O,C=$}return!H&&C&&(_=C),C||!H&&_},L=function(V,O){if(A(V))return V.clone();var I=typeof O=="object"?O:{};return I.date=V,I.args=arguments,new ee(I)},N=T;N.l=B,N.i=A,N.w=function(V,O){return L(V,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var ee=function(){function V(I){this.$L=B(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[S]=!0}var O=V.prototype;return O.parse=function(I){this.$d=function(H){var C=H.date,P=H.utc;if(C===null)return new Date(NaN);if(N.u(C))return new Date;if(C instanceof Date)return new Date(C);if(typeof C=="string"&&!/Z$/i.test(C)){var F=C.match(w);if(F){var $=F[2]-1||0,W=(F[7]||"0").substring(0,3);return P?new Date(Date.UTC(F[1],$,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)):new Date(F[1],$,F[3]||1,F[4]||0,F[5]||0,F[6]||0,W)}}return new Date(C)}(I),this.init()},O.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},O.$utils=function(){return N},O.isValid=function(){return this.$d.toString()!==x},O.isSame=function(I,H){var C=L(I);return this.startOf(H)<=C&&C<=this.endOf(H)},O.isAfter=function(I,H){return L(I)<this.startOf(H)},O.isBefore=function(I,H){return this.endOf(H)<L(I)},O.$g=function(I,H,C){return N.u(I)?this[H]:this.set(C,I)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(I,H){var C=this,P=!!N.u(H)||H,F=N.p(I),$=function(z,ne){var D=N.w(C.$u?Date.UTC(C.$y,ne,z):new Date(C.$y,ne,z),C);return P?D:D.endOf(c)},W=function(z,ne){return N.w(C.toDate()[z].apply(C.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(ne)),C)},Q=this.$W,se=this.$M,he=this.$D,ue="set"+(this.$u?"UTC":"");switch(F){case m:return P?$(1,0):$(31,11);case u:return P?$(1,se):$(0,se+1);case d:var q=this.$locale().weekStart||0,oe=(Q<q?Q+7:Q)-q;return $(P?he-oe:he+(6-oe),se);case c:case y:return W(ue+"Hours",0);case l:return W(ue+"Minutes",1);case a:return W(ue+"Seconds",2);case o:return W(ue+"Milliseconds",3);default:return this.clone()}},O.endOf=function(I){return this.startOf(I,!1)},O.$set=function(I,H){var C,P=N.p(I),F="set"+(this.$u?"UTC":""),$=(C={},C[c]=F+"Date",C[y]=F+"Date",C[u]=F+"Month",C[m]=F+"FullYear",C[l]=F+"Hours",C[a]=F+"Minutes",C[o]=F+"Seconds",C[s]=F+"Milliseconds",C)[P],W=P===c?this.$D+(H-this.$W):H;if(P===u||P===m){var Q=this.clone().set(y,1);Q.$d[$](W),Q.init(),this.$d=Q.set(y,Math.min(this.$D,Q.daysInMonth())).$d}else $&&this.$d[$](W);return this.init(),this},O.set=function(I,H){return this.clone().$set(I,H)},O.get=function(I){return this[N.p(I)]()},O.add=function(I,H){var C,P=this;I=Number(I);var F=N.p(H),$=function(se){var he=L(P);return N.w(he.date(he.date()+Math.round(se*I)),P)};if(F===u)return this.set(u,this.$M+I);if(F===m)return this.set(m,this.$y+I);if(F===c)return $(1);if(F===d)return $(7);var W=(C={},C[a]=r,C[l]=i,C[o]=n,C)[F]||1,Q=this.$d.getTime()+I*W;return N.w(Q,this)},O.subtract=function(I,H){return this.add(-1*I,H)},O.format=function(I){var H=this,C=this.$locale();if(!this.isValid())return C.invalidDate||x;var P=I||"YYYY-MM-DDTHH:mm:ssZ",F=N.z(this),$=this.$H,W=this.$m,Q=this.$M,se=C.weekdays,he=C.months,ue=C.meridiem,q=function(ne,D,te,de){return ne&&(ne[D]||ne(H,P))||te[D].slice(0,de)},oe=function(ne){return N.s($%12||12,ne,"0")},z=ue||function(ne,D,te){var de=ne<12?"AM":"PM";return te?de.toLowerCase():de};return P.replace(h,function(ne,D){return D||function(te){switch(te){case"YY":return String(H.$y).slice(-2);case"YYYY":return N.s(H.$y,4,"0");case"M":return Q+1;case"MM":return N.s(Q+1,2,"0");case"MMM":return q(C.monthsShort,Q,he,3);case"MMMM":return q(he,Q);case"D":return H.$D;case"DD":return N.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return q(C.weekdaysMin,H.$W,se,2);case"ddd":return q(C.weekdaysShort,H.$W,se,3);case"dddd":return se[H.$W];case"H":return String($);case"HH":return N.s($,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return z($,W,!0);case"A":return z($,W,!1);case"m":return String(W);case"mm":return N.s(W,2,"0");case"s":return String(H.$s);case"ss":return N.s(H.$s,2,"0");case"SSS":return N.s(H.$ms,3,"0");case"Z":return F}return null}(ne)||F.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(I,H,C){var P,F=this,$=N.p(H),W=L(I),Q=(W.utcOffset()-this.utcOffset())*r,se=this-W,he=function(){return N.m(F,W)};switch($){case m:P=he()/12;break;case u:P=he();break;case p:P=he()/3;break;case d:P=(se-Q)/6048e5;break;case c:P=(se-Q)/864e5;break;case l:P=se/i;break;case a:P=se/r;break;case o:P=se/n;break;default:P=se}return C?P:N.a(P)},O.daysInMonth=function(){return this.endOf(u).$D},O.$locale=function(){return E[this.$L]},O.locale=function(I,H){if(!I)return this.$L;var C=this.clone(),P=B(I,H,!0);return P&&(C.$L=P),C},O.clone=function(){return N.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},V}(),Z=ee.prototype;return L.prototype=Z,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",m],["$D",y]].forEach(function(V){Z[V[1]]=function(O){return this.$g(O,V[0],V[1])}}),L.extend=function(V,O){return V.$i||(V(O,ee,L),V.$i=!0),L},L.locale=B,L.isDayjs=A,L.unix=function(V){return L(1e3*V)},L.en=E[_],L.Ls=E,L.p={},L})}(Yd)),Yd.exports}(function(e,t){(function(n,r){e.exports=r(XS())})(oh,function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var i=r(n),s={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(o){return o+"."}};return i.default.locale(s,null,!0),s})})(zI);var ZS={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(oh,function(){return function(n,r,i){n=n||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,d,u,p){return s.fromToBase(c,d,u,p)}i.en.relativeTime=o,s.fromToBase=function(c,d,u,p,m){for(var y,x,w,h=u.$locale().relativeTime||o,g=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],b=g.length,T=0;T<b;T+=1){var _=g[T];_.d&&(y=p?i(c).diff(u,_.d,!0):u.diff(c,_.d,!0));var E=(n.rounding||Math.round)(Math.abs(y));if(w=y>0,E<=_.r||!_.r){E<=1&&T>0&&(_=g[T-1]);var S=h[_.l];m&&(E=m(""+E)),x=typeof S=="string"?S.replace("%d",E):S(E,d,_.l,w);break}}if(d)return x;var A=w?h.future:h.past;return typeof A=="function"?A(x):A.replace("%s",x)},s.to=function(c,d){return a(c,d,this,!0)},s.from=function(c,d){return a(c,d,this)};var l=function(c){return c.$u?i.utc():i()};s.toNow=function(c){return this.to(l(this),c)},s.fromNow=function(c){return this.from(l(this),c)}}})})(ZS);var VI=ZS.exports;const UI=Rr(VI);var HI=XS();const Qd=Rr(HI),WI=(e="tr")=>(Qd.extend(UI),Qd.locale(e),Qd);function qI({onShowForm:e,onHasHistory:t}){const n=ie(g=>g.widget),r=ie(g=>g.setHistoryChat),i=ie(g=>g.setHistoryMessages),s=je(),o=gs(),[a,l]=v.useState(null),c=WI(),d=v.useRef(!1),u=n!=null&&n.link_id?mi(n.link_id):null,{data:p,isLoading:m}=lM((n==null?void 0:n.link_id)||"",u||"");if(v.useEffect(()=>{if(!m&&p){const[g,b]=p,T=$n(b)&&Array.isArray(g)&&g.length>0;if(T&&!d.current){const _=g[0];if(_.status===qt.Open||_.status===qt.Pending){console.log("ChatHistoryList: Auto-joining active chat",_._id),d.current=!0,r(_),i(null),o.push("chat");return}}t&&t(T),T||e&&e()}},[m,p,e,t,o,r,i]),!(n!=null&&n.link_id))return null;if(m)return f.jsx("div",{className:"p-4 text-center text-xs opacity-50",children:"Yükleniyor..."});if(!p)return null;const[y,x]=p;if(!$n(x)||!Array.isArray(y)||y.length===0)return null;const w=g=>c(g).fromNow(),h=g=>g.who_joined_details&&Array.isArray(g.who_joined_details)&&g.who_joined_details.length>0&&g.who_joined_details[0].name||"Atanmamış";return f.jsx("div",{className:"flex flex-col h-full",children:f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:y.map(g=>f.jsxs("button",{type:"button",className:"w-full flex justify-between items-center gap-2 p-5 text-left transition-colors",style:{color:s.getColor(k.InputText),backgroundColor:a===g._id?s.getColor(k.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(g._id),onMouseLeave:()=>l(null),onClick:()=>{r(g),i(null),o.push("chat")},children:[f.jsx("span",{className:"font-medium text-xs truncate flex-1 min-w-0",children:h(g)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(k.FooterText)},children:w(g.created_at)})]},g._id))})})}const Kd=[Ne.Light,Ne.Dark,Ne.System];function GI(e){switch(e){case Ne.Light:return Y.Sun;case Ne.Dark:return Y.Moon;case Ne.System:return Y.Monitor;default:return Y.Monitor}}function YI(){const e=je(),{mode:t,setMode:n}=e,r=()=>{const s=Kd.indexOf(t),o=Kd[(s+1)%Kd.length];n(o)},i=GI(t);return f.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:e.getColor(k.HeaderText)},title:t===Ne.Light?"Açık tema":t===Ne.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const ur=Object.create(null);ur.open="0";ur.close="1";ur.ping="2";ur.pong="3";ur.message="4";ur.upgrade="5";ur.noop="6";const lc=Object.create(null);Object.keys(ur).forEach(e=>{lc[ur[e]]=e});const qp={type:"error",data:"parser error"},JS=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",eC=typeof ArrayBuffer=="function",tC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ug=({type:e,data:t},n,r)=>JS&&t instanceof Blob?n?r(t):tx(t,r):eC&&(t instanceof ArrayBuffer||tC(t))?n?r(t):tx(new Blob([t]),r):r(ur[e]+(t||"")),tx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function nx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Xd;function QI(e,t){if(JS&&e.data instanceof Blob)return e.data.arrayBuffer().then(nx).then(t);if(eC&&(e.data instanceof ArrayBuffer||tC(e.data)))return t(nx(e.data));ug(e,!1,n=>{Xd||(Xd=new TextEncoder),t(Xd.encode(n))})}const rx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<rx.length;e++)Xo[rx.charCodeAt(e)]=e;const KI=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=Xo[e.charCodeAt(r)],o=Xo[e.charCodeAt(r+1)],a=Xo[e.charCodeAt(r+2)],l=Xo[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},XI=typeof ArrayBuffer=="function",dg=(e,t)=>{if(typeof e!="string")return{type:"message",data:nC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ZI(e.substring(1),t)}:lc[n]?e.length>1?{type:lc[n],data:e.substring(1)}:{type:lc[n]}:qp},ZI=(e,t)=>{if(XI){const n=KI(e);return nC(n,t)}else return{base64:!0,data:e}},nC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},rC="",JI=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{ug(s,!1,a=>{r[o]=a,++i===n&&t(r.join(rC))})})},eL=(e,t)=>{const n=e.split(rC),r=[];for(let i=0;i<n.length;i++){const s=dg(n[i],t);if(r.push(s),s.type==="error")break}return r};function tL(){return new TransformStream({transform(e,t){QI(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let Zd;function $l(e){return e.reduce((t,n)=>t+n.length,0)}function zl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function nL(e,t){Zd||(Zd=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if($l(n)<1)break;const l=zl(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if($l(n)<2)break;const l=zl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if($l(n)<8)break;const l=zl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(qp);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if($l(n)<i)break;const l=zl(n,i);a.enqueue(dg(s?l:Zd.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(qp);break}}}})}const iC=4;function st(e){if(e)return rL(e)}function rL(e){for(var t in st.prototype)e[t]=st.prototype[t];return e}st.prototype.on=st.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};st.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};st.prototype.off=st.prototype.removeListener=st.prototype.removeAllListeners=st.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};st.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};st.prototype.emitReserved=st.prototype.emit;st.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};st.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Yu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iL="arraybuffer";function sC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const sL=wn.setTimeout,oL=wn.clearTimeout;function Qu(e,t){t.useNativeTimers?(e.setTimeoutFn=sL.bind(wn),e.clearTimeoutFn=oL.bind(wn)):(e.setTimeoutFn=wn.setTimeout.bind(wn),e.clearTimeoutFn=wn.clearTimeout.bind(wn))}const aL=1.33;function lL(e){return typeof e=="string"?cL(e):Math.ceil((e.byteLength||e.size)*aL)}function cL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function oC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function dL(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class fL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class fg extends st{constructor(t){super(),this.writable=!1,Qu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new fL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=dg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=uL(t);return n.length?"?"+n:""}}class pL extends fg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};eL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,JI(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=oC()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let aC=!1;try{aC=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hL=aC;function mL(){}class gL extends pL{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ar extends st{constructor(t,n,r){super(),this.createRequest=t,Qu(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=sC(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ar.requestsCount++,ar.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=mL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ar.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ar.requestsCount=0;ar.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ix);else if(typeof addEventListener=="function"){const e="onpagehide"in wn?"pagehide":"unload";addEventListener(e,ix,!1)}}function ix(){for(let e in ar.requests)ar.requests.hasOwnProperty(e)&&ar.requests[e].abort()}const vL=function(){const e=lC({xdomain:!1});return e&&e.responseType!==null}();class yL extends gL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=vL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ar(lC,this.uri(),t)}}function lC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hL))return new XMLHttpRequest}catch{}if(!t)try{return new wn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const cC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xL extends fg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=cC?{}:sC(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;ug(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Yu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=oC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Jd=wn.WebSocket||wn.MozWebSocket;class wL extends xL{createSocket(t,n,r){return cC?new Jd(t,n,r):n?new Jd(t,n):new Jd(t)}doWrite(t,n){this.ws.send(n)}}class bL extends fg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=nL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=tL();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Yu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const kL={websocket:wL,webtransport:bL,polling:yL},SL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,CL=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Gp(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=SL.exec(e||""),s={},o=14;for(;o--;)s[CL[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=_L(s,s.path),s.queryKey=TL(s,s.query),s}function _L(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function TL(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Yp=typeof addEventListener=="function"&&typeof removeEventListener=="function",cc=[];Yp&&addEventListener("offline",()=>{cc.forEach(e=>e())},!1);class ui extends st{constructor(t,n){if(super(),this.binaryType=iL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Gp(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Gp(n.host).host);Qu(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=dL(this.opts.query)),Yp&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},cc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=iC,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=lL(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Yu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Yp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=cc.indexOf(this._offlineEventListener);r!==-1&&cc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ui.protocol=iC;class EL extends ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ui.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const p=new Error("probe error: "+u);p.transport=n.name,s(),this.emitReserved("upgradeError",p)};function a(){o("transport closed")}function l(){o("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let jL=class extends EL{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>kL[i]).filter(i=>!!i)),super(t,r)}};function AL(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Gp(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const RL=typeof ArrayBuffer=="function",PL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,uC=Object.prototype.toString,ML=typeof Blob=="function"||typeof Blob<"u"&&uC.call(Blob)==="[object BlobConstructor]",OL=typeof File=="function"||typeof File<"u"&&uC.call(File)==="[object FileConstructor]";function pg(e){return RL&&(e instanceof ArrayBuffer||PL(e))||ML&&e instanceof Blob||OL&&e instanceof File}function uc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(uc(e[n]))return!0;return!1}if(pg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return uc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&uc(e[n]))return!0;return!1}function NL(e){const t=[],n=e.data,r=e;return r.data=Qp(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Qp(e,t){if(!e)return e;if(pg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Qp(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Qp(e[r],t));return n}return e}function DL(e,t){return e.data=Kp(e.data,t),delete e.attachments,e}function Kp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Kp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Kp(e[n],t));return e}const IL=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],LL=5;var Te;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Te||(Te={}));class FL{constructor(t){this.replacer=t}encode(t){return(t.type===Te.EVENT||t.type===Te.ACK)&&uc(t)?this.encodeAsBinary({type:t.type===Te.EVENT?Te.BINARY_EVENT:Te.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Te.BINARY_EVENT||t.type===Te.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NL(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function sx(e){return Object.prototype.toString.call(e)==="[object Object]"}class hg extends st{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Te.BINARY_EVENT;r||n.type===Te.BINARY_ACK?(n.type=r?Te.EVENT:Te.ACK,this.reconstructor=new BL(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(pg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Te[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Te.BINARY_EVENT||r.type===Te.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(hg.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Te.CONNECT:return sx(n);case Te.DISCONNECT:return n===void 0;case Te.CONNECT_ERROR:return typeof n=="string"||sx(n);case Te.EVENT:case Te.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&IL.indexOf(n[0])===-1);case Te.ACK:case Te.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BL{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=DL(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const $L=Object.freeze(Object.defineProperty({__proto__:null,Decoder:hg,Encoder:FL,get PacketType(){return Te},protocol:LL},Symbol.toStringTag,{value:"Module"}));function Nn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const zL=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class dC extends st{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Nn(t,"open",this.onopen.bind(this)),Nn(t,"packet",this.onpacket.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(zL.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Te.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Te.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Te.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Te.EVENT:case Te.BINARY_EVENT:this.onevent(t);break;case Te.ACK:case Te.BINARY_ACK:this.onack(t);break;case Te.DISCONNECT:this.ondisconnect();break;case Te.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Te.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Te.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ao(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ao.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Ao.prototype.reset=function(){this.attempts=0};Ao.prototype.setMin=function(e){this.ms=e};Ao.prototype.setMax=function(e){this.max=e};Ao.prototype.setJitter=function(e){this.jitter=e};class Xp extends st{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Qu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ao({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||$L;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new jL(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Nn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Nn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nn(t,"ping",this.onping.bind(this)),Nn(t,"data",this.ondata.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this)),Nn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Yu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new dC(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Vo={};function dc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=AL(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Vo[i]&&s in Vo[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Xp(r,t):(Vo[i]||(Vo[i]=new Xp(r,t)),l=Vo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(dc,{Manager:Xp,Socket:dC,io:dc,connect:dc});const fC=v.createContext(null),fr=()=>{const e=v.useContext(fC);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},VL=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=ie(),i=v.useRef(null),s=v.useRef(!1),o=v.useRef(!1),a=v.useRef(null),[l,c]=v.useState(!1),[d,u]=v.useState(!1),p=v.useCallback(_=>{var E;console.log("WS: cleanupSocket called",{reason:_,hasSocket:!!i.current,isConnected:(E=i.current)==null?void 0:E.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",_||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),c(!1),u(!1),o.current=!1,s.current=!1,a.current=null},[]),m=v.useCallback((_,E,S)=>{if(a.current===_&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!E&&!S){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const A=Ko(rt.CustomerToken,_)||ha("customer_token"),B=Ko(rt.CustomerRefreshToken,_)||ha("customer_refresh_token");if(!A||!B){if(console.log("WS: Connect skipped - missing required tokens"),E){console.log("WS: Clearing stale isHaveChat flag due to missing tokens"),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}return}if(i.current&&!i.current.connected&&(console.log("WS: Cleaning up disconnected/failed socket before new connection"),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),i.current&&i.current.connected){console.log("WS: Already connected, skipping new connection");return}console.log("WS: Attempting to connect...",{linkId:_,tokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,refreshTokenPrefix:`${B==null?void 0:B.substring(0,20)}...`,deviceId:Ko(rt.DeviceId,_)}),o.current=!0,a.current=_;const L=dc(_T,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:A,device_id:Ko(rt.DeviceId,_)||ha("device_id"),customer_refresh_token:B}});i.current=L,L.on("error",N=>{console.error("WS: Websocket error",N),o.current=!1}),L.on("connect_error",N=>{console.error("WS: Connect error",N),o.current=!1,c(!1),u(!1),i.current===L&&(i.current=null,a.current=null);const ee=(N==null?void 0:N.message)||String(N);if(ee.toLowerCase().includes("unauthorized")||ee.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),_&&eS(_),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}}),L.on("disconnect",N=>{var Z;console.log("WS: Disconnected",N),c(!1),u(!1),o.current=!1,s.current=!1,i.current===L&&(i.current=null,a.current=null);const ee=ie.getState();N==="io server disconnect"&&((Z=ee.widget)!=null&&Z.link_id)&&(ee.isHaveChat||ee.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{m(ee.widget.link_id,ee.isHaveChat,ee.isAIAgentMode)},500))}),L.on("connect",()=>{console.log("WS: Connected successfully"),c(!0),o.current=!1}),L.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);v.useEffect(()=>{const _=t==null?void 0:t.link_id;return _&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),m(_,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),p("no active chat flags")),()=>{}},[t==null?void 0:t.link_id,n,r,m,p]),v.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),p("provider unmount")},[p]),v.useEffect(()=>{const _=()=>{console.log("WS: Page unloading, disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)},E=()=>{console.log("WS: Page hidden (pagehide), disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)};return window.addEventListener("beforeunload",_),window.addEventListener("pagehide",E),()=>{window.removeEventListener("beforeunload",_),window.removeEventListener("pagehide",E)}},[]);const y=v.useCallback(()=>{const _=t==null?void 0:t.link_id;_?m(_,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,m]),x=v.useCallback(()=>{console.log("WS: Reconnecting..."),p("manual reconnect");const _=t==null?void 0:t.link_id;_&&setTimeout(()=>{m(_,n,r)},100)},[t==null?void 0:t.link_id,n,r,m,p]),w=v.useCallback(()=>{console.log("WS: Manual disconnect"),p("manual disconnect")},[p]),h=v.useCallback((_,E)=>{var S;(S=i.current)==null||S.on(_,E)},[]),g=v.useCallback((_,E)=>{var S;(S=i.current)==null||S.off(_,E)},[]),b=v.useCallback((_,E,S)=>{i.current&&i.current.connected?i.current.emit(_,E,S):console.warn(`WS: Cannot emit event '${_}', socket not connected.`)},[]),T=v.useMemo(()=>({connectionReady:d,connected:l,connect:y,reconnect:x,disconnect:w,on:h,off:g,emit:b}),[l,d,y,x,w,h,g,b]);return f.jsx(fC.Provider,{value:T,children:e})},Xc=(e,t,n)=>{const r=typeof window<"u"?window:void 0;v.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},Ro=()=>{let e=!1,t=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true",t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)),e||t},UL=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},Ku=()=>v.useMemo(()=>typeof window>"u"||new URLSearchParams(window.location.search).get("fullscreen")==="true"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent),[]);var Ve=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e.MessageRead="message:read",e.AgentRequestHuman="agent:request:human",e.AgentMessageCreate="agent:message:create",e.ChatUpdateInputs="chat:update:inputs",e))(Ve||{}),ve=(e=>(e.Connect="connect",e.Disconnect="disconnect",e.ConnectionReady="connection:ready",e.MessageAgentCreate="message:agent:create",e.MessageUserCreate="message:user:create",e.MessageCustomerCreate="message:customer:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e.ChatUserShowButton="chat:user:show-button",e.ChatUserLeave="chat:user:leave",e.ChatUserJoin="chat:user:join",e.AgentMessageChunk="agent:message:chunk",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(ve||{});function HL(){const e=qu(),t=v.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return Xc("popstate",t),null}function WL(){const e=fr(),t=qu(),n=v.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(Ve.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return Xc("popstate",n),v.useEffect(()=>{if(!e)return;const r=RI(),i=AI();r!==i&&(e.emit(Ve.PageChange,{page:i}),t.setPage(i))},[e]),null}function qL(){return HL(),null}const ox=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function GL(){var he,ue,q,oe;const e=je(),t=ie(z=>z.widget),n=ie(z=>z.setOpen),r=ie(z=>z.setAIAgent),i=ie(z=>z.setIsAIAgentMode),s=ie(z=>z.setIsHaveChat),o=ie(z=>z.isHaveChat),a=ie(z=>z.humanNeedRequested),l=ie(z=>z.setHumanNeedRequested),c=ie(z=>z.aiAgent),d=ie(z=>z.setShowActionButtons),[u,p]=v.useState(!1),[m,y]=v.useState(!1),[x,w]=v.useState(!1),h=gs(),g=Ro(),b=Ku(),[T,_]=v.useState(!0),[E,S]=v.useState(!1),A=qu(),B=Hm(),L=fr(),[N,ee]=v.useState(null),Z=v.useRef(!1),V=v.useRef(!1),O=ol(),I=v.useCallback(async()=>{var ne,D,te;if(!t)return;ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().clearAIAgentState(),d(!1);const z=(((te=(D=(ne=t.appearance)==null?void 0:ne.body)==null?void 0:D.inputs)==null?void 0:te.length)||0)>0;if(N){if(m)return;y(!0);try{const[de,Ce]=await B.mutateAsync({inputs:{username:"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`},history:A.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id),is_agent_mode:!0});$n(Ce)&&Dp(de)?(Ln(rt.CustomerToken,de.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,de.customer_refresh_token,t.link_id),Ln(rt.DeviceId,de.device_id,t.link_id),A.clearHistory(),s(!0),r(N),i(!0),h.push("chat")):(ho(de),z&&_(!1))}catch(de){console.error("Error creating chat for AI agent:",de),z&&_(!1)}finally{y(!1)}return}if(!z){if(m)return;y(!0);try{const[de,Ce]=await B.mutateAsync({inputs:{},history:A.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id)});$n(Ce)&&Dp(de)?(Ln(rt.CustomerToken,de.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,de.customer_refresh_token,t.link_id),Ln(rt.DeviceId,de.device_id,t.link_id),A.clearHistory(),s(!0),h.push("chat")):ho(de)}catch(de){console.error("Error creating chat:",de)}finally{y(!1)}return}_(!1)},[t,N,m,B,A,s,r,i,h]),H=v.useCallback(()=>{var ne,D,te;_(!1),!((((te=(D=(ne=t==null?void 0:t.appearance)==null?void 0:ne.body)==null?void 0:D.inputs)==null?void 0:te.length)||0)>0)&&!N&&!a&&I()},[t,N,a,I]),C=v.useCallback(z=>{S(z)},[]);if(!t)return null;const P=()=>{n(!1)};v.useEffect(()=>{var D,te,de;if(!t||Z.current)return;Z.current=!0;const z=gr(t.link_id);if(z.isAgentMode&&z.agent&&(O!=null&&O.accessToken)){if(r(z.agent),i(!0),z.sessionId&&ie.getState().setAIAgentSessionId(z.sessionId),z.humanNeedRequested){if(ie.getState().setHumanNeedRequested(!0),!((((de=(te=(D=t.appearance)==null?void 0:D.body)==null?void 0:te.inputs)==null?void 0:de.length)||0)>0)){h.push("chat");return}return}ee(z.agent),h.push("chat");return}(async()=>{try{const[Ce,ge]=await uM(t.link_id);ge===200&&Ce&&Ce.is_active&&ee(Ce)}catch(Ce){console.error("Failed to check AI agent:",Ce)}})()},[t,O==null?void 0:O.accessToken,O==null?void 0:O.refreshToken,h,r,i]),v.useEffect(()=>{if(u||!t||!O||!O.accessToken){V.current=!1;return}if(V.current||a)return;if(o){h.push("chat");return}const z=gr(t.link_id);z.isAgentMode&&z.agent&&!z.humanNeedRequested||(V.current=!0,nM(t.client_id,Yi(O)).then(([ne,D])=>{if($n(D))a||h.push("chat");else if(D===403){const te=gr(t.link_id);if(te.isAgentMode&&te.agent){if(te.humanNeedRequested){r(te.agent),i(!1),te.sessionId&&ie.getState().setAIAgentSessionId(te.sessionId),ie.getState().setHumanNeedRequested(!0);return}r(te.agent),i(!0),te.sessionId&&ie.getState().setAIAgentSessionId(te.sessionId),h.push("chat")}else da(t.link_id||""),p(!0)}else D===404?(da(t.link_id||""),p(!0)):D===401?(eS(t.link_id||""),p(!0)):h.push("chat")}).catch(()=>h.push("chat")))},[u,h,r,i,t,O==null?void 0:O.accessToken,O==null?void 0:O.refreshToken,o,a]);const F=ox(((ue=(he=t.appearance)==null?void 0:he.head)==null?void 0:ue.elements)||[],"text"),$=ox(((oe=(q=t.appearance)==null?void 0:q.head)==null?void 0:oe.elements)||[],"title"),W=()=>{if(a&&t){let z=c;if(!z){const ne=gr(t.link_id);ne.agent&&(z=ne.agent,r(ne.agent),ee(ne.agent))}if(z){i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat");return}}_(!0)},Q=()=>{N&&(r(N),i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},se=v.useCallback(z=>{if(!L||x)return;w(!0);const ne=()=>{L.emit(Ve.AgentRequestHuman,{},D=>{w(!1),D!=null&&D.success&&(ie.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),ie.getState().clearAIAgentState(),h.push("chat"))})};z&&Object.keys(z).length>0?L.emit(Ve.ChatUpdateInputs,{inputs:z},D=>{D!=null&&D.success?ne():w(!1)}):ne()},[L,x,i,l,h]);return v.useEffect(()=>{var z,ne,D;if(a){if(!c&&t){const te=gr(t.link_id);te.agent&&(r(te.agent),ee(te.agent))}(c||gr((t==null?void 0:t.link_id)||"").agent)&&((((D=(ne=(z=t==null?void 0:t.appearance)==null?void 0:z.body)==null?void 0:ne.inputs)==null?void 0:D.length)||0)>0?_(!1):se())}},[a,c,t,se,r]),f.jsxs("div",{className:"h-full w-full flex flex-col relative overflow-hidden",children:[f.jsxs("header",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0 border-b overflow-visible min-h-[52px]",style:{backgroundColor:e.getColor(k.HeaderBackground),color:e.getColor(k.HeaderText),borderColor:e.getColor(k.HeaderBorder),...g?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!T&&(E||a&&(c||t&&gr(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:W,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(Y.ArrowLeft,{className:"w-5 h-5"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-sm font-semibold truncate",children:T?"Geçmiş sohbetler":$||"Müşteri Hizmetleri"}),!T&&F&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:F})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(YI,{}),b&&f.jsx("button",{type:"button",onClick:P,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(Y.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(k.Background)},children:T?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(qI,{onShowForm:H,onHasHistory:C})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx($I,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!N&&!a,onAIAgentStart:Q,onOk:()=>{a&&c||(ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},onOperatorConnect:a&&(c||gr(t.link_id).agent)?se:void 0,isConnectingToOperator:x})})}),T&&E&&f.jsx("div",{className:"px-4 py-3 flex-shrink-0",style:{borderTopColor:e.getColor(k.DividerColor),backgroundColor:e.getColor(k.Background)},children:f.jsxs(Rt,{onClick:I,size:"md",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(Y.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]})})]})}function YL(){return f.jsxs(f.Fragment,{children:[f.jsx(GL,{}),f.jsx(qL,{})]})}const QL=[{path:"/",component:YL,name:"registration"}];function tt({className:e="",style:t}){const n=je();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(k.MessageAdminBackground),opacity:.6,...t}})}function KL(){const e=je();return f.jsxs("section",{className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto",children:[f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function XL(){const e=je();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(k.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(tt,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})}),f.jsx(tt,{className:"h-12 w-12 rounded-full"})]})}function ZL(){const e=je();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(k.HeaderBackground),borderBottom:`1px solid ${e.getColor(k.HeaderBorder)}`},children:[f.jsx(tt,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(tt,{className:"h-5 w-5 rounded"}),f.jsx(tt,{className:"h-5 w-5 rounded"})]})]})}function JL(){const e=je();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(k.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-20 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-24 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-16 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsx(tt,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.GreeterButtonBackground),opacity:.5}})]})})}function eF(){const e=je();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(k.GreeterTopBackground)},children:[f.jsx(tt,{className:"h-7 w-40"}),f.jsx(tt,{className:"h-4 w-56"})]})}function pC(){const e=je();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(k.Background)},children:[f.jsx(ZL,{}),f.jsx(KL,{}),f.jsx(XL,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(k.FooterBorder)}`,backgroundColor:e.getColor(k.FooterBackground)},children:[f.jsx(tt,{className:"h-3 w-20"}),f.jsx(tt,{className:"h-3.5 w-3.5 rounded"})]})]})}function Zp(){const e=je(),t=typeof window<"u"&&window.innerWidth<768;return f.jsxs("div",{className:`h-full w-full relative overflow-hidden ${t?"":"rounded-xl"}`,style:{backgroundColor:e.getColor(k.GreeterBackground)},children:[f.jsx(eF,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(JL,{})})]})}const tF="/notify.mp3",mg="lc:notification_sound_muted",hC=()=>{try{return sessionStorage.getItem(mg)==="1"}catch{return!1}},mC=e=>{try{sessionStorage.setItem(mg,e?"1":"0")}catch{}},nF=async e=>{try{if(sessionStorage.getItem(mg)==="1")return}catch{}await new Audio(e||tF).play()},ef=[Ne.Light,Ne.Dark,Ne.System];function rF(e){switch(e){case Ne.Light:return Y.Sun;case Ne.Dark:return Y.Moon;case Ne.System:return Y.Monitor;default:return Y.Monitor}}function iF({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>hC()),a=v.useRef(null),l=v.useRef(null),c=je(),d=cs(),u=fr(),{setShowActionButtons:p}=ie(),{mode:m,setMode:y}=c,x=()=>{u==null||u.emit(Ve.ChatClose,{}),p(!1),e()},w=()=>{const b=ef.indexOf(m),T=ef[(b+1)%ef.length];y(T)},h=()=>{const b=!s;mC(b),o(b)};v.useEffect(()=>{if(!r)return;const b=T=>{var _,E;(_=l.current)!=null&&_.contains(T.target)||(E=a.current)!=null&&E.contains(T.target)||i(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[r]);const g=r&&f.jsxs(Pe.div,{ref:l,onMouseDown:b=>b.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(Y.XCircle,{className:"size-4 flex-shrink-0"}),d(J.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:h,children:[s?f.jsx(Y.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(Y.Volume2,{className:"size-4 flex-shrink-0"}),d(s?J.NotificationSoundOn:J.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:w,children:[(()=>{const b=rF(m);return f.jsx(b,{className:"size-4 flex-shrink-0"})})(),m===Ne.Light?"Açık tema":m===Ne.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(lr,{children:t&&f.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:f.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:d(J.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:d(J.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(J.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:x,children:d(J.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(b=>!b),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:d(J.ChatSettings),"aria-expanded":r,children:f.jsx(Y.Menu,{className:"size-5"})}),f.jsx(lr,{children:g})]})]})}function ax({text:e}){const n=je().getColor(k.LinkColor),i=(s=>{const o=/(https?:\/\/(?:[-\w.])+(?:\:[0-9]+)?(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?|(?:www\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?)/gi,a=s.split(/(<[^>]*>)/g);let l="",c=!1;for(let d=0;d<a.length;d++){const u=a[d];if(u.startsWith("<")&&u.endsWith(">"))if(u.match(/^<a\s/i)){if(u.includes("style="))l+=u;else{const p=u.replace(/^(<a\s[^>]*)(>)$/i,`$1 style="color: ${n}; text-decoration: underline;"$2`);l+=p}c=!0}else u.match(/^<\/a>/i)?(l+=u,c=!1):l+=u;else if(!c&&u.trim()){const p=u.replace(o,m=>{const y=m.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(y)?y:`https://${y}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${y}</a>`});l+=p}else l+=u}return l})(e);return f.jsx("span",{className:"linkified !text-sm",dangerouslySetInnerHTML:{__html:i}})}const lx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function gC({files:e,className:t,onDelete:n,hideName:r}){const i=Ro(),[s,o]=v.useState(new Map);v.useEffect(()=>{const y=new Map;for(let x=0;x<e.length;x++){const w=e[x];if(w instanceof File){const h=URL.createObjectURL(w);y.set(x,h)}}return o(y),()=>{for(const x of y.values())URL.revokeObjectURL(x)}},[e]);const a=y=>{var w;return((w=(y instanceof File?y.name:y).split(".").pop())==null?void 0:w.toLowerCase())||""},l=y=>y instanceof File?y.name:y.split("/").pop()||y,c=y=>{const[x,w]=y.split(".");return x.length>10?`${x.slice(0,10)}...${w}`:y},d=y=>{const x=["jpg","jpeg","png","gif","bmp","webp","svg"],w=a(y);return x.includes(w)},u=(y,x)=>{if(y instanceof File){const w=s.get(x);w&&window.open(w,"_blank")}else window.open(y,"_blank")},p=(y,x)=>{y.stopPropagation(),n==null||n(x)},m=(y,x)=>y instanceof File?s.get(x)||"":y;return f.jsx("div",{className:ze("flex gap-2 w-full overflow-x-auto",t),children:e.map((y,x)=>{const w=l(y),h=a(y),g=d(y),b=m(y,x);return f.jsxs("div",{onClick:()=>u(y,x),className:"min-w-20 max-w-20 cursor-pointer group/item border border-gray-200 rounded-lg p-1.5 hover:shadow-md transition-all duration-200 hover:border-gray-300 bg-white relative",children:[n&&f.jsx("button",{onClick:T=>p(T,x),className:ze("absolute top-1 right-1 w-5 h-5 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-opacity duration-200 z-10",{"opacity-0 group-hover/item:opacity-100":!i}),children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),g?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:b,alt:w,className:"w-16 h-16 min-h-16 min-w-16 object-cover group-hover/item:scale-105 transition-transform duration-200"})}):f.jsx("div",{className:"min-w-16 aspect-square w-full mb-0.5 flex items-center justify-center bg-gray-50 rounded group-hover/item:bg-gray-100 transition-colors duration-200",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 bg-blue-100 rounded flex items-center justify-center",children:f.jsx("svg",{className:"w-3 h-3 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}),f.jsx("div",{className:ze("text-[10px] font-medium text-gray-600 uppercase",{[lx]:r}),children:h||"file"})]})}),f.jsx("div",{className:ze("max-w-16 text-[10px] text-gray-700 font-medium truncate text-ellipsis overflow-hidden",{[lx]:r}),title:w,children:c(w)})]},x)})})}const sF={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},oF={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function aF({buttons:e,className:t=""}){const n=je();if(!e||e.length===0)return null;const r=s=>{s.startsWith("http://")||s.startsWith("https://")?window.open(s,"_blank","noopener,noreferrer"):s.startsWith("tel:")||s.startsWith("mailto:")?window.location.href=s:console.log("Custom action:",s)},i=s=>s.startsWith("http://")||s.startsWith("https://")?f.jsx(Y.ExternalLink,{className:"size-4"}):s.startsWith("tel:")?f.jsx(Y.Phone,{className:"size-4"}):s.startsWith("mailto:")?f.jsx(Y.Mail,{className:"size-4"}):null;return f.jsx(Pe.div,{className:ze(t,"mt-2"),initial:"hidden",animate:"visible",variants:sF,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${n.getColor(k.Background)}f0`},children:f.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((s,o)=>f.jsxs(Pe.button,{variants:oF,transition:{duration:.25,ease:"easeOut"},whileHover:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:{scale:.98,transition:{duration:.1}},onClick:()=>r(s.url),className:"group inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 relative overflow-hidden cursor-pointer",style:{backgroundColor:n.getColor(k.GreeterBackground),color:n.getColor(k.GreeterText),borderRadius:n.getRadius(),border:`1px solid ${n.getColor(k.DividerColor)}`,boxShadow:`0 1px 3px ${n.getColor(k.ShadowColor)}30`},onMouseEnter:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.ButtonBackground),a.currentTarget.style.color=n.getColor(k.ButtonText),a.currentTarget.style.borderColor=n.getColor(k.ButtonBackground),a.currentTarget.style.boxShadow=`0 4px 12px ${n.getColor(k.ShadowColor)}40`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.GreeterBackground),a.currentTarget.style.color=n.getColor(k.GreeterText),a.currentTarget.style.borderColor=n.getColor(k.DividerColor),a.currentTarget.style.boxShadow=`0 1px 3px ${n.getColor(k.ShadowColor)}30`},children:[f.jsxs("span",{className:"flex items-center gap-2",children:[i(s.url),f.jsx("span",{className:"font-medium",children:s.label})]}),f.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(45deg, transparent 30%, ${n.getColor(k.ButtonText)}10 50%, transparent 70%)`,borderRadius:n.getRadius()}})]},`${s.label}-${o}`))})})})}const cx=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",ux=["Düşünüyorum...","Araştırıyorum...","Cevapları karşılaştırıyorum...","En iyi cevabı hazırlıyorum...","Bilgileri derliyorum..."];function vC({messages:e,isTyping:t,chat:n,streamingContent:r}){var g,b,T,_;const i=v.useRef(null),s=v.useRef(null),[o,a]=v.useState(!0),l=v.useRef(!0),{widget:c}=ie(),d=je(),u=v.useRef(!0),[p,m]=v.useState(0);v.useEffect(()=>{e.length>0&&u.current&&requestAnimationFrame(()=>{u.current=!1})},[e]),v.useEffect(()=>{if(!t||r===void 0||r)return;const E=setInterval(()=>{m(S=>(S+1)%ux.length)},2500);return()=>clearInterval(E)},[t,r]);const y=()=>{const E=s.current;E&&(E.scrollTop=E.scrollHeight)},x=()=>{if(s.current){const{scrollTop:E,scrollHeight:S,clientHeight:A}=s.current,B=S-E<=A+10;l.current=B,a(B)}};v.useEffect(()=>{(l.current||t)&&y()},[e,t,r]);const w=E=>u.current?{initial:!1,animate:{}}:E===ye.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:E===ye.User||E===ye.Agent?{initial:{opacity:0,x:-30},animate:{opacity:1,x:0}}:{initial:{opacity:0,y:10},animate:{opacity:1,y:0}},h=E=>E===ye.Customer?"18px 18px 4px 18px":E===ye.User||E===ye.Agent?"18px 18px 18px 4px":d.getRadius();return f.jsxs("section",{onScroll:x,ref:s,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden",children:[((b=(g=c==null?void 0:c.appearance)==null?void 0:g.design)==null?void 0:b.greeting_message)&&f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap border-0 px-3 py-2 !text-sm",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(_=(T=c==null?void 0:c.appearance)==null?void 0:T.design)==null?void 0:_.greeting_message})}),f.jsx(lr,{children:Array.isArray(e)&&e.filter(S=>{var A;return S!=null&&(!!S.content||(((A=S.files)==null?void 0:A.length)??0)>0)&&S.content!==`
97
+ `}).map((S,A)=>{var L;const B=w(S.sender_type);return f.jsxs(Pe.div,{initial:B.initial,animate:B.animate,transition:{duration:.25,ease:"easeOut"},className:ze("flex flex-col w-full min-w-0 justify-center break-words",{"items-end":S.sender_type===ye.Customer||S.activity_type===mn.ChatCreated,"items-start":S.sender_type===ye.User||S.sender_type===ye.Agent,"items-center":S.sender_type===ye.System||S.sender_type===ye.Activity}),children:[S.sender_type===ye.System&&f.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words overflow-hidden px-3 py-1.5 text-sm",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText),borderRadius:d.getRadius()},children:S.content}),([ye.Customer,ye.User,ye.Agent].includes(S.sender_type)||S.activity_type===mn.ChatCreated)&&f.jsxs("div",{className:ze("max-w-[80%] border-0 px-3 py-2",{"whitespace-pre-wrap !text-sm":S.sender_type===ye.Customer||S.activity_type===mn.ChatCreated||S.sender_type===ye.Agent&&!((L=S.content)!=null&&L.includes('id="chaty"'))}),style:{backgroundColor:S.sender_type===ye.User||S.sender_type===ye.Agent?d.getColor(k.MessageAdminBackground):d.getColor(k.MessageVisitorBackground),color:S.sender_type===ye.User||S.sender_type===ye.Agent?d.getColor(k.MessageAdminText):d.getColor(k.MessageVisitorText),borderRadius:h(S.sender_type)},children:[S.files&&S.files.length>0&&f.jsx(gC,{files:S.files,className:"mb-1",hideName:!0}),S.sender_type===ye.User||S.sender_type===ye.Agent?f.jsx(ax,{text:S.content}):S.content,S.created_at&&f.jsx("div",{className:"text-[0.5rem] text-right opacity-70 mt-1",style:{color:S.sender_type===ye.User||S.sender_type===ye.Agent?d.getColor(k.MessageAdminText):d.getColor(k.MessageVisitorText)},children:cx(S.created_at)})]}),([ye.Customer,ye.User,ye.Agent].includes(S.sender_type)||S.activity_type===mn.ChatCreated)&&S.buttons&&S.buttons.length>0&&f.jsx("div",{className:ze("w-full",{"flex justify-end":S.sender_type===ye.Customer||S.activity_type===mn.ChatCreated,"flex justify-start":S.sender_type===ye.User||S.sender_type===ye.Agent}),children:f.jsx("div",{className:"max-w-[80%]",children:f.jsx(aF,{buttons:S.buttons})})}),S.sender_type===ye.Activity&&S.activity_type!==mn.ChatCreated&&f.jsx("div",{className:"max-w-full border-0 rounded-full px-3 py-1 text-xs shadow-none break-words overflow-hidden",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText)},children:S.activity_type===mn.AdminLeave?`${S.content.split("_")[2]} odadan ayrıldı`:S.activity_type===mn.AdminJoin?`${S.content.split("_")[2]} odaya katıldı`:S.activity_type===mn.AdminToggleUpload?S.content.includes("is_customer_uploadable:true")?"Dosya gönderim izni açıldı":"Dosya gönderim izni kapatıldı":S.content}),ye.System===S.sender_type&&f.jsx("div",{className:"text-xs",style:{color:d.getColor(k.MessageAdminText)},children:S.created_at&&cx(S.created_at)})]},S.id||A)})}),t&&f.jsx(Pe.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.2},className:"flex w-full items-center justify-start mt-1",children:r!==void 0?f.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap min-w-[4rem]",style:{backgroundColor:d.getColor(k.MessageAdminBackground),color:d.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:r?f.jsx(ax,{text:r}):f.jsxs("div",{className:"flex items-center gap-2 py-1",children:[f.jsx(Y.Sparkles,{className:"size-4 flex-shrink-0 sparkle-pulse",style:{color:d.getColor(k.MessageAdminText)}}),f.jsx(lr,{mode:"wait",children:f.jsx(Pe.span,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"text-sm",style:{color:d.getColor(k.MessageAdminText)},children:ux[p]},p)})]})}):f.jsx("div",{className:"flex items-center rounded-full px-4 py-2",style:{backgroundColor:d.getColor(k.MessageAdminBackground)},children:f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:d.getColor(k.MessageAdminText),animationDelay:"0ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:d.getColor(k.MessageAdminText),animationDelay:"150ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:d.getColor(k.MessageAdminText),animationDelay:"300ms"}})]})})}),!o&&f.jsx("div",{className:"absolute bottom-28 right-4",children:f.jsx(Rt,{type:"button",variant:"primary",kind:"solid",rounded:!0,className:"size-10 flex items-center justify-center p-0! shadow-md z-10",onClick:()=>{var E,S;(S=s.current)==null||S.scrollTo({top:(E=s.current)==null?void 0:E.scrollHeight,behavior:"smooth"})},children:f.jsx(Y.ArrowDown,{className:"size-4"})})}),f.jsx("div",{ref:i})]})}/**
98
98
  * @license lucide-react v0.511.0 - ISC
99
99
  *
100
100
  * This source code is licensed under the ISC license.
101
101
  * See the LICENSE file in the root directory of this source tree.
102
- */const lF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),fx=e=>{const t=cF(e);return t.charAt(0).toUpperCase()+t.slice(1)},yC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),uF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
102
+ */const lF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),cF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),dx=e=>{const t=cF(e);return t.charAt(0).toUpperCase()+t.slice(1)},yC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),uF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
103
103
  * @license lucide-react v0.511.0 - ISC
104
104
  *
105
105
  * This source code is licensed under the ISC license.
@@ -109,12 +109,12 @@ attempted value: ${o}
109
109
  *
110
110
  * This source code is licensed under the ISC license.
111
111
  * See the LICENSE file in the root directory of this source tree.
112
- */const fF=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>g.createElement("svg",{ref:l,...dF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yC("lucide",i),...!s&&!uF(a)&&{"aria-hidden":"true"},...a},[...o.map(([u,d])=>g.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
112
+ */const fF=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>v.createElement("svg",{ref:l,...dF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yC("lucide",i),...!s&&!uF(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,d])=>v.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
113
113
  * @license lucide-react v0.511.0 - ISC
114
114
  *
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
- */const xC=(e,t)=>{const n=g.forwardRef(({className:r,...i},s)=>g.createElement(fF,{ref:s,iconNode:t,className:yC(`lucide-${lF(fx(e))}`,`lucide-${e}`,r),...i}));return n.displayName=fx(e),n};/**
117
+ */const xC=(e,t)=>{const n=v.forwardRef(({className:r,...i},s)=>v.createElement(fF,{ref:s,iconNode:t,className:yC(`lucide-${lF(dx(e))}`,`lucide-${e}`,r),...i}));return n.displayName=dx(e),n};/**
118
118
  * @license lucide-react v0.511.0 - ISC
119
119
  *
120
120
  * This source code is licensed under the ISC license.
@@ -124,8 +124,8 @@ attempted value: ${o}
124
124
  *
125
125
  * This source code is licensed under the ISC license.
126
126
  * See the LICENSE file in the root directory of this source tree.
127
- */const mF=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],gF=xC("paperclip",mF);var wC={exports:{}},vF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",yF=vF,xF=yF;function bC(){}function kC(){}kC.resetWarningCache=bC;var wF=function(){function e(r,i,s,o,a,l){if(l!==xF){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:kC,resetWarningCache:bC};return n.PropTypes=n,n};wC.exports=wF();var bF=wC.exports;const Oe=Ar(bF);function vs(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{u(r.next(d))}catch(c){o(c)}}function l(d){try{u(r.throw(d))}catch(c){o(c)}}function u(d){d.done?s(d.value):i(d.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}const kF=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function xo(e,t,n){const r=SF(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&px(r,"path",s),px(r,"relativePath",s),r}function SF(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=kF.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function px(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const CF=[".DS_Store","Thumbs.db"];function _F(e){return vs(this,void 0,void 0,function*(){return Zc(e)&&TF(e.dataTransfer)?RF(e.dataTransfer,e.type):EF(e)?jF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?AF(e):[]})}function TF(e){return Zc(e)}function EF(e){return Zc(e)&&Zc(e.target)}function Zc(e){return typeof e=="object"&&e!==null}function jF(e){return eh(e.target.files).map(t=>xo(t))}function AF(e){return vs(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>xo(n))})}function RF(e,t){return vs(this,void 0,void 0,function*(){if(e.items){const n=eh(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(PF));return hx(SC(r))}return hx(eh(e.files).map(n=>xo(n)))})}function hx(e){return e.filter(t=>CF.indexOf(t.name)===-1)}function eh(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function PF(e){if(typeof e.webkitGetAsEntry!="function")return mx(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?CC(t):mx(e,t)}function SC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?SC(n):[n]],[])}function mx(e,t){return vs(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,xo(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return xo(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function MF(e){return vs(this,void 0,void 0,function*(){return e.isDirectory?CC(e):OF(e)})}function CC(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>vs(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(MF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function OF(e){return vs(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=xo(r,e.fullPath);t(i)},r=>{n(r)})})})}var nf=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function gx(e){return IF(e)||DF(e)||TC(e)||NF()}function NF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
128
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IF(e){if(Array.isArray(e))return th(e)}function vx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vx(Object(n),!0).forEach(function(r){_C(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qa(e,t){return BF(e)||FF(e,t)||TC(e,t)||LF()}function LF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
129
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TC(e,t){if(e){if(typeof e=="string")return th(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return th(e,t)}}function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function BF(e){if(Array.isArray(e))return e}var $F=typeof nf=="function"?nf:nf.default,zF="file-invalid-type",VF="file-too-large",UF="file-too-small",HF="too-many-files",WF=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:zF,message:"File type must be ".concat(r)}},xx=function(t){return{code:VF,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},wx=function(t){return{code:UF,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},qF={code:HF,message:"Too many files"};function EC(e,t){var n=e.type==="application/x-moz-file"||$F(e,t);return[n,n?null:WF(t)]}function jC(e,t,n){if(Ri(e.size))if(Ri(t)&&Ri(n)){if(e.size>n)return[!1,xx(n)];if(e.size<t)return[!1,wx(t)]}else{if(Ri(t)&&e.size<t)return[!1,wx(t)];if(Ri(n)&&e.size>n)return[!1,xx(n)]}return[!0,null]}function Ri(e){return e!=null}function GF(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,o=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&o>=1&&t.length>o?!1:t.every(function(l){var u=EC(l,n),d=qa(u,1),c=d[0],f=jC(l,r,i),m=qa(f,1),y=m[0],x=a?a(l):null;return c&&y&&!x})}function Jc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Vl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function bx(e){e.preventDefault()}function YF(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function QF(e){return e.indexOf("Edge/")!==-1}function KF(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return YF(e)||QF(e)}function qn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return t.some(function(a){return!Jc(r)&&a&&a.apply(void 0,[r].concat(s)),Jc(r)})}}function XF(){return"showOpenFilePicker"in window}function ZF(e){if(Ri(e)){var t=Object.entries(e).filter(function(n){var r=qa(n,2),i=r[0],s=r[1],o=!0;return AC(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(RC))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=qa(r,2),s=i[0],o=i[1];return yx(yx({},n),{},_C({},s,o))},{});return[{description:"Files",accept:t}]}return e}function JF(e){if(Ri(e))return Object.entries(e).reduce(function(t,n){var r=qa(n,2),i=r[0],s=r[1];return[].concat(gx(t),[i],gx(s))},[]).filter(function(t){return AC(t)||RC(t)}).join(",")}function e6(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function t6(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function AC(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function RC(e){return/^.*\.[\w]+$/.test(e)}var n6=["children"],r6=["open"],i6=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],s6=["refKey","onChange","onClick"];function o6(e){return c6(e)||l6(e)||PC(e)||a6()}function a6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
130
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c6(e){if(Array.isArray(e))return nh(e)}function rf(e,t){return f6(e)||d6(e,t)||PC(e,t)||u6()}function u6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
131
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PC(e,t){if(e){if(typeof e=="string")return nh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nh(e,t)}}function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d6(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function f6(e){if(Array.isArray(e))return e}function kx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kx(Object(n),!0).forEach(function(r){rh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eu(e,t){if(e==null)return{};var n=p6(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function p6(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var cl=g.forwardRef(function(e,t){var n=e.children,r=eu(e,n6),i=h6(r),s=i.open,o=eu(i,r6);return g.useImperativeHandle(t,function(){return{open:s}},[s]),X.createElement(g.Fragment,null,n(He(He({},o),{},{open:s})))});cl.displayName="Dropzone";var MC={disabled:!1,getFilesFromEvent:_F,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};cl.defaultProps=MC;cl.propTypes={children:Oe.func,accept:Oe.objectOf(Oe.arrayOf(Oe.string)),multiple:Oe.bool,preventDropOnDocument:Oe.bool,noClick:Oe.bool,noKeyboard:Oe.bool,noDrag:Oe.bool,noDragEventsBubbling:Oe.bool,minSize:Oe.number,maxSize:Oe.number,maxFiles:Oe.number,disabled:Oe.bool,getFilesFromEvent:Oe.func,onFileDialogCancel:Oe.func,onFileDialogOpen:Oe.func,useFsAccessApi:Oe.bool,autoFocus:Oe.bool,onDragEnter:Oe.func,onDragLeave:Oe.func,onDragOver:Oe.func,onDrop:Oe.func,onDropAccepted:Oe.func,onDropRejected:Oe.func,onError:Oe.func,validator:Oe.func};var ih={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function h6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=He(He({},MC),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,c=t.onDragOver,f=t.onDrop,m=t.onDropAccepted,y=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,h=t.useFsAccessApi,v=t.autoFocus,b=t.preventDropOnDocument,T=t.noClick,C=t.noKeyboard,E=t.noDrag,S=t.noDragEventsBubbling,A=t.onError,B=t.validator,L=g.useMemo(function(){return JF(n)},[n]),N=g.useMemo(function(){return ZF(n)},[n]),ee=g.useMemo(function(){return typeof w=="function"?w:Sx},[w]),Z=g.useMemo(function(){return typeof x=="function"?x:Sx},[x]),V=g.useRef(null),O=g.useRef(null),I=g.useReducer(m6,ih),H=rf(I,2),_=H[0],P=H[1],F=_.isFocused,$=_.isFileDialogActive,W=g.useRef(typeof window<"u"&&window.isSecureContext&&h&&XF()),Q=function(){!W.current&&$&&setTimeout(function(){if(O.current){var U=O.current.files;U.length||(P({type:"closeDialog"}),Z())}},300)};g.useEffect(function(){return window.addEventListener("focus",Q,!1),function(){window.removeEventListener("focus",Q,!1)}},[O,$,Z,W]);var se=g.useRef([]),he=function(U){V.current&&V.current.contains(U.target)||(U.preventDefault(),se.current=[])};g.useEffect(function(){return b&&(document.addEventListener("dragover",bx,!1),document.addEventListener("drop",he,!1)),function(){b&&(document.removeEventListener("dragover",bx),document.removeEventListener("drop",he))}},[V,b]),g.useEffect(function(){return!r&&v&&V.current&&V.current.focus(),function(){}},[V,v,r]);var ue=g.useCallback(function(M){A?A(M):console.error(M)},[A]),q=g.useCallback(function(M){M.preventDefault(),M.persist(),be(M),se.current=[].concat(o6(se.current),[M.target]),Vl(M)&&Promise.resolve(i(M)).then(function(U){if(!(Jc(M)&&!S)){var ae=U.length,fe=ae>0&&GF({files:U,accept:L,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:B}),ke=ae>0&&!fe;P({isDragAccept:fe,isDragReject:ke,isDragActive:!0,type:"setDraggedFiles"}),u&&u(M)}}).catch(function(U){return ue(U)})},[i,u,ue,S,L,o,s,a,l,B]),oe=g.useCallback(function(M){M.preventDefault(),M.persist(),be(M);var U=Vl(M);if(U&&M.dataTransfer)try{M.dataTransfer.dropEffect="copy"}catch{}return U&&c&&c(M),!1},[c,S]),z=g.useCallback(function(M){M.preventDefault(),M.persist(),be(M);var U=se.current.filter(function(fe){return V.current&&V.current.contains(fe)}),ae=U.indexOf(M.target);ae!==-1&&U.splice(ae,1),se.current=U,!(U.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Vl(M)&&d&&d(M))},[V,d,S]),ne=g.useCallback(function(M,U){var ae=[],fe=[];M.forEach(function(ke){var at=EC(ke,L),vt=rf(at,2),Vn=vt[0],un=vt[1],ys=jC(ke,o,s),fr=rf(ys,2),Or=fr[0],xs=fr[1],Po=B?B(ke):null;if(Vn&&Or&&!Po)ae.push(ke);else{var ki=[un,xs];Po&&(ki=ki.concat(Po)),fe.push({file:ke,errors:ki.filter(function(Un){return Un})})}}),(!a&&ae.length>1||a&&l>=1&&ae.length>l)&&(ae.forEach(function(ke){fe.push({file:ke,errors:[qF]})}),ae.splice(0)),P({acceptedFiles:ae,fileRejections:fe,isDragReject:fe.length>0,type:"setFiles"}),f&&f(ae,fe,U),fe.length>0&&y&&y(fe,U),ae.length>0&&m&&m(ae,U)},[P,a,L,o,s,l,f,m,y,B]),D=g.useCallback(function(M){M.preventDefault(),M.persist(),be(M),se.current=[],Vl(M)&&Promise.resolve(i(M)).then(function(U){Jc(M)&&!S||ne(U,M)}).catch(function(U){return ue(U)}),P({type:"reset"})},[i,ne,ue,S]),te=g.useCallback(function(){if(W.current){P({type:"openDialog"}),ee();var M={multiple:a,types:N};window.showOpenFilePicker(M).then(function(U){return i(U)}).then(function(U){ne(U,null),P({type:"closeDialog"})}).catch(function(U){e6(U)?(Z(U),P({type:"closeDialog"})):t6(U)?(W.current=!1,O.current?(O.current.value=null,O.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ue(U)});return}O.current&&(P({type:"openDialog"}),ee(),O.current.value=null,O.current.click())},[P,ee,Z,h,ne,ue,N,a]),de=g.useCallback(function(M){!V.current||!V.current.isEqualNode(M.target)||(M.key===" "||M.key==="Enter"||M.keyCode===32||M.keyCode===13)&&(M.preventDefault(),te())},[V,te]),Ce=g.useCallback(function(){P({type:"focus"})},[]),ge=g.useCallback(function(){P({type:"blur"})},[]),Ze=g.useCallback(function(){T||(KF()?setTimeout(te,0):te())},[T,te]),ot=function(U){return r?null:U},Bt=function(U){return C?null:ot(U)},re=function(U){return E?null:ot(U)},be=function(U){S&&U.stopPropagation()},Je=g.useMemo(function(){return function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=M.refKey,ae=U===void 0?"ref":U,fe=M.role,ke=M.onKeyDown,at=M.onFocus,vt=M.onBlur,Vn=M.onClick,un=M.onDragEnter,ys=M.onDragOver,fr=M.onDragLeave,Or=M.onDrop,xs=eu(M,i6);return He(He(rh({onKeyDown:Bt(qn(ke,de)),onFocus:Bt(qn(at,Ce)),onBlur:Bt(qn(vt,ge)),onClick:ot(qn(Vn,Ze)),onDragEnter:re(qn(un,q)),onDragOver:re(qn(ys,oe)),onDragLeave:re(qn(fr,z)),onDrop:re(qn(Or,D)),role:typeof fe=="string"&&fe!==""?fe:"presentation"},ae,V),!r&&!C?{tabIndex:0}:{}),xs)}},[V,de,Ce,ge,Ze,q,oe,z,D,C,E,r]),R=g.useCallback(function(M){M.stopPropagation()},[]),K=g.useMemo(function(){return function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=M.refKey,ae=U===void 0?"ref":U,fe=M.onChange,ke=M.onClick,at=eu(M,s6),vt=rh({accept:L,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ot(qn(fe,D)),onClick:ot(qn(ke,R)),tabIndex:-1},ae,O);return He(He({},vt),at)}},[O,n,a,D,r]);return He(He({},_),{},{isFocused:F&&!r,getRootProps:Je,getInputProps:K,rootRef:V,inputRef:O,open:ot(te)})}function m6(e,t){switch(t.type){case"focus":return He(He({},e),{},{isFocused:!0});case"blur":return He(He({},e),{},{isFocused:!1});case"openDialog":return He(He({},ih),{},{isFileDialogActive:!0});case"closeDialog":return He(He({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return He(He({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return He(He({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return He({},ih);default:return e}}function Sx(){}const OC=5*1024*1024,wo={"text/plain":[".txt"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"],"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],"image/svg+xml":[".svg"]},Cx=Object.values(wo).flat();function g6(e){var r;if(e.size>OC)return{isValid:!1,error:`Dosya boyutu 5MB'dan büyük olamaz. Seçilen dosya: ${(e.size/1024/1024).toFixed(2)}MB`};const t=`.${(r=e.name.split(".").pop())==null?void 0:r.toLowerCase()}`;return Object.keys(wo).includes(e.type)||Cx.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Cx.join(", ")}`}}function tu(e){for(const t of e){const n=g6(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function NC({onDrop:e}){const t=n=>{const r=tu(n);if(!r.isValid){alert(r.error);return}e(n)};return p.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:p.jsx(cl,{onDrop:t,accept:Object.keys(wo).reduce((n,r)=>(n[r]=wo[r],n),{}),maxSize:OC,children:({getRootProps:n,getInputProps:r})=>p.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[p.jsx("input",{...r()}),p.jsx("div",{className:"mb-3",children:p.jsx(hF,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),p.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",p.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}NC.Button=({onDrop:e})=>{const t=je(),n=r=>{const i=tu(r);if(!i.isValid){er({description:i.error,variant:"error"});return}e(r)};return p.jsx(cl,{onDrop:n,accept:Object.keys(wo).reduce((r,i)=>(r[i]=wo[i],r),{}),children:({getRootProps:r,getInputProps:i})=>p.jsxs("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-center dz-message needsclick cursor-pointer",...r(),children:[p.jsx("input",{...i()}),p.jsx(gF,{style:{color:t.getColor(k.IconColor)},className:"size-5"})]})})};const _x=[{name:"Yüzler",icon:"😊",emojis:["😀","😃","😄","😁","😆","😅","🤣","😂","🙂","😊","😇","🥰","😍","🤩","😘","😗","😚","😙","🥲","😋","😛","😜","🤪","😝","🤑","🤗","🤭","🤫","🤔","🫡","🤐","🤨","😐","😑","😶","🫥","😏","😒","🙄","😬","😮‍💨","🤥","😌","😔","😪","🤤","😴","😷","🤒","🤕","🤢","🤮","🥴","😵","🤯","🥳","🥸","😎","🤓","🧐","😕","🫤","😟","🙁","😮","😯","😲","😳","🥺","🥹","😦","😧","😨","😰","😥","😢","😭","😱","😖","😣","😞","😓","😩","😫","🥱","😤","😡","😠"]},{name:"El",icon:"👋",emojis:["👋","🤚","🖐️","✋","🖖","🫱","🫲","🫳","🫴","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","🫵","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🤝","🙏","💪","🦾"]},{name:"Kalp",icon:"❤️",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❤️‍🔥","❤️‍🩹","❣️","💕","💞","💓","💗","💖","💘","💝","💟","♥️","💋","🫂"]},{name:"Hayvan",icon:"🐱",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻‍❄️","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🐤","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🪱","🐛","🦋","🐌","🐞","🐜","🪰","🐢","🐍","🦎","🐙"]},{name:"Yiyecek",icon:"🍕",emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🫐","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🫛","🥦","🥬","🌶️","🫑","🍕","🍔","🍟","🌭","🍿","🧀","🥚","🍳","🥞","🧇","🥓","🍖","🍗","🌮","🌯","🥗","☕","🍵","🧃","🥤","🍺","🍷","🥂","🍰"]},{name:"Aktivite",icon:"⚽",emojis:["⚽","🏀","🏈","⚾","🥎","🎾","🏐","🏉","🥏","🎱","🏓","🏸","🥅","⛳","🎯","🏹","🎣","🤿","🥊","🥋","🎿","⛷️","🏂","🪂","🏋️","🤸","🎮","🕹️","🎲","🧩","🎭","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🎷","🎺"]},{name:"Nesne",icon:"💡",emojis:["⌚","📱","💻","⌨️","🖥️","🖨️","🖱️","💾","💿","📷","📹","🎥","📞","📟","📠","📺","🔋","🔌","💡","🔦","🕯️","🧯","💰","💳","💎","🔧","🔨","🪛","🔩","⚙️","🔑","🗝️","📦","📫","📝","✏️","🖊️","📎","📌","✂️"]}];function DC({onSelect:e,isOpen:t,onClose:n}){const r=je(),[i,s]=g.useState(0),o=g.useRef(null),a=g.useRef(null);return g.useEffect(()=>{if(!t)return;const l=u=>{o.current&&!o.current.contains(u.target)&&n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,n]),g.useEffect(()=>{a.current&&(a.current.scrollTop=0)},[i]),p.jsx(fi,{children:t&&p.jsxs(Pe.div,{ref:o,onMouseDown:l=>l.stopPropagation(),initial:{opacity:0,y:8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.95},transition:{duration:.15},className:"absolute bottom-full left-0 mb-2 z-50 overflow-hidden",style:{width:"280px",backgroundColor:r.getColor(k.Background),border:`1px solid ${r.getColor(k.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(k.ShadowColor)}`},children:[p.jsx("div",{className:"flex items-center gap-0.5 px-1.5 py-1.5 overflow-x-auto",style:{borderBottom:`1px solid ${r.getColor(k.DividerColor)}`},children:_x.map((l,u)=>p.jsx("button",{type:"button",onClick:()=>s(u),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base transition-colors",style:{backgroundColor:u===i?r.getColor(k.InputBackground):"transparent"},title:l.name,children:l.icon},l.name))}),p.jsx("div",{ref:a,className:"grid grid-cols-8 gap-0.5 p-1.5 overflow-y-auto",style:{maxHeight:"200px"},children:_x[i].emojis.map((l,u)=>p.jsx("button",{type:"button",onClick:()=>{e(l),n()},className:"w-8 h-8 flex items-center justify-center rounded-md text-lg hover:scale-110 transition-transform",style:{backgroundColor:"transparent"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.getColor(k.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${u}`))})]})})}function v6({onNewMessage:e,client_id:t,is_uploadable:n,messages:r,onEvaluateChat:i,onNewChat:s,onSendMessage:o,isHistoryMode:a=!1,historyChat:l}){const u=g.useRef(null),d=dr(),c=sM(t),f=je(),m=cs(),{setIsInputFocused:y,showActionButtons:x,setShowActionButtons:w}=ie(),[h,v]=g.useState(""),[b,T]=g.useState("3rem"),[C,E]=g.useState(!1),[S,A]=g.useState([]),[B,L]=g.useState(0),[N,ee]=g.useState(!1),[Z,V]=g.useState(0),[O,I]=g.useState(null),[H,_]=g.useState(!1),P=()=>{if(!a||!l||l.status!==qt.Closed||!l.closed_at)return!1;const q=new Date(l.closed_at);return(new Date().getTime()-q.getTime())/(1e3*60*60)>2},F=a&&(l==null?void 0:l.status)===qt.Closed&&P();g.useEffect(()=>{if(r.length>0){const q=r[r.length-1];q.id!==O&&(I(q.id),q.sender_type===ye.User&&(L(0),ee(!1)))}},[r,O]),g.useEffect(()=>{let q;return N&&Z>0&&(q=window.setTimeout(()=>{V(oe=>oe<=1?(ee(!1),L(0),0):oe-1)},1e3)),()=>clearTimeout(q)},[N,Z]),g.useEffect(()=>{const q=u.current;if(q){const oe=()=>y(!0),z=()=>y(!1);return q.addEventListener("focus",oe),q.addEventListener("blur",z),()=>{q.removeEventListener("focus",oe),q.removeEventListener("blur",z)}}},[y]),g.useEffect(()=>{const q=()=>{w(!0)},oe=()=>{w(!1)};return d==null||d.on(ve.ChatUserShowButton,q),d==null||d.on(ve.MessageUserCreate,oe),()=>{d==null||d.off(ve.ChatUserShowButton,q),d==null||d.off(ve.MessageUserCreate,oe)}},[d,w]),g.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&w(!1)},[r,w]),Xc("lc:rate-limit",q=>{const oe=q.detail&&q.detail.seconds||3;ee(!0),V(oe),L(0)}),Xc("paste",q=>{const oe=q.clipboardData.items,z=[];for(const ne of oe){const D=ne.getAsFile();D&&z.push(D)}if(z.length>0&&!n){er({description:m(J.FileUploadDisabled),variant:"error"});return}if(z.length>0){const ne=tu(z);if(!ne.isValid){er({description:ne.error,variant:"error"});return}A([...S,...z])}});const $=async()=>{if(!h.trim()&&(!n||S.length===0))return;if(B>5&&!N){ee(!0),V(3);return}if(N||C)return;const q=h,oe=[...S];v(""),A([]),u.current&&(u.current.style.height="3rem",T("3rem")),E(!0);let z;if(n&&oe.length>0){const[ne,D]=await c.mutateAsync(oe);if(!$n(D)){Lj(ne,D),E(!1),v(q),A(oe);return}oM(ne)&&(z=ne.file_urls)}if(o){o(q,z),E(!1);return}d==null||d.emit(Ve.MessageCreate,{content:q,files:z},ne=>{e(ne),E(!1),L(D=>D+1),w(!1)})},W=q=>{d==null||d.emit(Ve.MessageTyping,{content:q})},Q=()=>{d==null||d.emit(Ve.ChatClose,{}),w(!1),i==null||i()},se=()=>{d==null||d.emit(Ve.ChatClose,{}),w(!1),s==null||s()},he=g.useCallback(q=>{const oe=u.current;if(oe){const z=oe.selectionStart,ne=oe.selectionEnd,D=h.substring(0,z)+q+h.substring(ne);D.length<=2e3&&(v(D),W(D),setTimeout(()=>{oe.selectionStart=oe.selectionEnd=z+q.length,oe.focus()},0))}else{const z=h+q;z.length<=2e3&&(v(z),W(z))}},[h]),ue=a&&(l==null?void 0:l.status)===qt.Closed;return F?null:p.jsxs(p.Fragment,{children:[ue&&p.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[p.jsxs("div",{className:"p-3 rounded-lg flex items-center gap-2",style:{backgroundColor:f.getColor(k.InputBackground),borderColor:f.getColor(k.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:f.getRadius()},children:[p.jsx(Y.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:f.getColor(k.FooterText)}}),p.jsx("span",{className:"text-sm",style:{color:f.getColor(k.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),p.jsxs(Rt,{onClick:()=>{s==null||s()},className:"w-full py-3 rounded-lg font-medium flex items-center justify-center gap-2 transition-all",style:{backgroundColor:f.getColor(k.ButtonBackground),color:f.getColor(k.ButtonText),borderRadius:f.getRadius()},children:[p.jsx(Y.Plus,{className:"w-5 h-5"}),p.jsx("span",{children:"Yeni Bir Sohbet Başlat"})]})]}),N&&p.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 rounded-lg z-[100] p-2 flex items-center justify-center",style:{backgroundColor:f.getColor(k.ErrorBackground),borderColor:f.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:f.getRadius()},children:[p.jsx(Y.XCircle,{className:"size-4 mr-2",style:{color:f.getColor(k.ErrorText)}}),p.jsx("span",{className:"text-sm font-medium",style:{color:f.getColor(k.ErrorText)},children:m(J.RateLimitMessage).replace("{seconds}",Z.toString())})]}),x&&p.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex flex-col gap-2",children:[p.jsxs(Rt,{className:"w-full flex items-center justify-center gap-2",size:"md",onClick:Q,children:[p.jsx(Y.Star,{className:"size-4"}),p.jsx("span",{children:"Sohbeti Değerlendir"})]}),p.jsxs(Rt,{size:"md",className:"w-full flex items-center justify-center gap-2",onClick:se,children:[p.jsx(Y.Plus,{className:"size-4"}),p.jsx("span",{children:"Yeni Sohbet Oluştur"})]})]}),(!a||a&&(l==null?void 0:l.status)!==qt.Closed&&(l==null?void 0:l.status)!==qt.Deleted)&&p.jsxs("form",{className:"flex flex-col relative",onSubmit:q=>{q.preventDefault(),$()},children:[p.jsx("div",{className:"mx-4 border-t",style:{borderColor:f.getColor(k.DividerColor)}}),n&&S&&S.length>0&&p.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:p.jsx(gC,{files:S,onDelete:q=>{A(S.filter((oe,z)=>z!==q))}})}),p.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[p.jsxs("div",{className:"flex-1 min-w-0 relative",children:[p.jsx(Yu,{id:"message",inputRef:u,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:N,style:{height:b,maxHeight:"6rem",opacity:N?.5:1,cursor:N?"not-allowed":"text",boxShadow:"none"},placeholder:N?m(J.RateLimitMessage).replace("{seconds}",Z.toString()):m(J.MessagePlaceholder),value:h,maxLength:2e3,onChange:q=>{if(N)return;const oe=q.target.value;if(oe.length<=2e3&&(v(oe),W(oe)),oe.length>0&&q.currentTarget.scrollHeight>q.currentTarget.clientHeight){const z=`${q.currentTarget.scrollHeight}px`;q.currentTarget.style.height=z,T(z)}else q.currentTarget.style.height="3rem",T("3rem")},onKeyDown:q=>{if(N){q.preventDefault();return}q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),$())}}),h.length>=500&&p.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:h.length>=2e3?f.getColor(k.ErrorText):f.getColor(k.FooterText),fontWeight:h.length>=2e3?"600":"normal"},children:2e3-h.length})]}),p.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:p.jsx(Pe.div,{whileTap:{scale:.9},children:p.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",disabled:C||!h.trim()&&S.length===0||N,style:{opacity:1,color:h.trim()||S.length>0?f.getColor(k.ButtonBackground):f.getColor(k.FooterText)},children:C?p.jsx(Y.Spin,{className:"size-4 animate-spin"}):N?p.jsx("span",{className:"text-[10px] font-bold",children:Z}):p.jsx(Y.PaperAirplane,{className:"size-5 -rotate-12"})})})})]}),p.jsx(DC,{isOpen:H,onClose:()=>_(!1),onSelect:he}),p.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{type:"button",onClick:()=>_(!H),className:"p-1.5 rounded-md transition-colors",style:{color:f.getColor(k.IconColor)},children:p.jsx(Y.Emoji,{className:"size-5"})}),n&&p.jsx(NC.Button,{onDrop:q=>{if(q.length){const oe=tu(q);if(!oe.isValid){er({description:oe.error,variant:"error"});return}A([...S,...q])}}})]}),p.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] flex items-center gap-1 transition-opacity hover:opacity-80",style:{color:f.getColor(k.FooterText)},children:[p.jsx("span",{children:m(J.PoweredBy)}),p.jsx("span",{className:"font-semibold",children:"Chatier"})]})]})]})]})}const Tx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function sh({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=g.useMemo(()=>{const o=e.charCodeAt(0)||0,a=Tx[o%Tx.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return p.jsxs(Pe.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center",children:[p.jsx("div",{className:"min-w-max",children:p.jsxs("span",{children:[t&&p.jsx("img",{className:"size-10 rounded-full border border-white/20 shadow-sm",src:t,"aria-label":e}),!t&&p.jsx("div",{className:"size-10 rounded-full flex items-center justify-center font-semibold text-white shadow-sm",style:{background:s},children:e.charAt(0).toUpperCase()})]})}),p.jsxs("div",{className:"flex flex-col",children:[p.jsx("span",{className:ze("line-clamp-1 font-medium",n),style:r?{color:r}:void 0,children:e}),i&&p.jsx("span",{className:"text-xs opacity-75 line-clamp-1",style:r?{color:r}:void 0,children:i})]})]})}function y6({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s,onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:u=!1,spamWarningMessage:d,onDismissSpamWarning:c}){const{widget:f,setOpen:m,open:y,isHaveChat:x,isInputFocused:w}=ie(),h=ie(Z=>Z.historyChat),v=je(),b=Ro(),T=Xu(),C=dr(),E=gs(),S=g.useRef(new Set),A=g.useRef(!1),B=()=>{m(!1)},L=g.useCallback(()=>{if(!C||!y||!x||!Array.isArray(r))return;const Z=r.filter(V=>V.sender_type===ye.User&&!S.current.has(V.id)).map(V=>V.id);Z.length!==0&&C.emit(Ve.MessageRead,{message_ids:Z},V=>{if(V&&V.success===!0)for(const O of Z)S.current.add(O)})},[C,r,y,x]);g.useEffect(()=>{y&&(A.current=!0),y&&x&&(w||A.current)&&(L(),A.current=!1)},[y,x,w,L]);const N=()=>{var V,O,I,H;return((H=(I=(O=(V=f==null?void 0:f.appearance)==null?void 0:V.head)==null?void 0:O.elements)==null?void 0:I.find(_=>_.type==="title"))==null?void 0:H.content)||"Müşteri Hizmetleri"},ee=()=>{var O,I,H,_,P,F;if(u&&h)return"Geçmiş sohbet";if(e!=null&&e.agent_name)return e.agent_name;const Z=(I=(O=f==null?void 0:f.appearance)==null?void 0:O.design)==null?void 0:I.greeting_header;return Z||((F=(P=(_=(H=f==null?void 0:f.appearance)==null?void 0:H.head)==null?void 0:_.elements)==null?void 0:P.find($=>$.type==="text"))==null?void 0:F.content)||"Bizimle Sohbet Edin"};return p.jsxs(p.Fragment,{children:[p.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:v.getColor(k.HeaderBackground),color:v.getColor(k.HeaderText),borderColor:v.getColor(k.HeaderBorder),...b?{}:{borderTopLeftRadius:v.getRadius(),borderTopRightRadius:v.getRadius()}},children:[p.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[u&&p.jsx("button",{type:"button",onClick:()=>{ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!0),E.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:p.jsx(Y.ArrowLeft,{className:"w-5 h-5"})}),(()=>{if(u&&(h!=null&&h.who_joined_details)&&h.who_joined_details.length>0){const Z=h.who_joined_details[0];return p.jsx(sh,{name:Z.name,avatar:Z.avatar||void 0,textColor:v.getColor(k.HeaderText)})}return!u&&(e!=null&&e.agent_name)?p.jsx(sh,{name:e.agent_name,avatar:e.agent_avatar,textColor:v.getColor(k.HeaderText)}):p.jsx("div",{className:"flex-1 min-w-0",children:u?p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"font-medium truncate",children:N()}),p.jsx("div",{className:"text-sm opacity-90 truncate",children:ee()})]}):p.jsx("div",{className:"font-medium truncate",children:ee()})})})()]}),p.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!u||u&&(e==null?void 0:e.status)!==qt.Closed)&&p.jsx(iF,{onChatClose:s}),T&&p.jsx("button",{type:"button",onClick:B,className:"p-1 hover:opacity-80 transition-opacity",children:p.jsx(Y.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),p.jsx(vC,{messages:r,isTyping:t||n.length>0,chat:e}),p.jsx(fi,{children:d&&p.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:v.getColor(k.ErrorBackground),borderColor:v.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:v.getRadius()},children:[p.jsx(Y.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:v.getColor(k.ErrorText)}}),p.jsx("span",{className:"text-sm",style:{color:v.getColor(k.ErrorText)},children:d}),p.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:c,style:{color:v.getColor(k.ErrorText)},children:p.jsx(Y.X,{className:"size-4"})})]})}),p.jsx(v6,{client_id:(f==null?void 0:f.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:Z=>{i(Z)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:u,historyChat:u?ie.getState().historyChat:void 0})]})}function x6({rating:e,onChange:t}){const n=je();return p.jsx("div",{className:"flex items-center justify-center gap-0.5 my-2",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return p.jsxs(Pe.div,{className:"relative w-8 h-8 cursor-pointer",whileHover:{scale:1.15},whileTap:{scale:.95},transition:{duration:.15},children:[p.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarInactiveColor),fill:n.getColor(k.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),s&&p.jsx("div",{className:"absolute top-0 left-0 w-4 h-8 overflow-hidden",children:p.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),i&&p.jsx("svg",{className:"w-8 h-8 absolute top-0 left-0",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),p.jsxs("div",{className:"absolute inset-0 flex",children:[p.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),p.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function w6({onOk:e}){const t=je(),n=cs(),r=Xu(),[i,s]=g.useState(0),[o,a]=g.useState(!1),[l,u]=g.useState(10),d=iM(),[c,f]=g.useState(!1);g.useEffect(()=>{if(o){const w=setInterval(()=>{u(h=>h<=1?(clearInterval(w),e(!0),0):h-1)},1e3);return()=>clearInterval(w)}},[o]);const m=Xm({comment:Qc()}),y=QS({init:{comment:""},schema:m,action:async w=>{const[h,v]=await d.mutateAsync({rating:i,comment:w.comment});if($n(v)){a(!0);return}ho(h,{form:y})}}),x=()=>{e(!0)};return p.jsxs(Pe.div,{className:"flex flex-col h-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[p.jsxs("header",{className:"min-h-[48px] flex-shrink-0 overflow-visible flex justify-between items-center z-10 px-4 py-2.5 border-b",style:{borderColor:t.getColor(k.HeaderBorder),color:t.getColor(k.HeaderText)},children:[p.jsx("div",{className:"font-medium text-xs",children:n(o?J.RatingHeaderThanks:J.RatingHeaderEvaluate)}),r&&p.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1.5 rounded-md hover:opacity-70 transition-opacity",style:{color:t.getColor(k.HeaderText)},children:p.jsx(Y.X,{className:"size-4"})})]}),p.jsx("div",{className:"flex-1 p-4 overflow-y-auto flex flex-col",children:o?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[p.jsx("div",{className:"mb-3",style:{color:t.getColor(k.SuccessText)},children:p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),p.jsx("h2",{className:"text-lg font-semibold mb-1.5",style:{color:t.getColor(k.HeaderText)},children:n(J.RatingThankYouTitle)}),p.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(k.FooterText)},children:n(J.RatingThankYouDescription)}),p.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(k.FooterText)},children:n(J.RatingCountdown).replace("{seconds}",l.toString())}),p.jsx(Rt,{onClick:x,size:"md",className:"w-full max-w-xs",children:n(J.RatingNewConversation)})]}):p.jsxs("div",{className:"flex flex-col",children:[p.jsx("div",{className:"text-center mb-4",children:p.jsx("p",{className:"text-sm",style:{color:t.getColor(k.FooterText)},children:n(J.RatingDescription)})}),p.jsxs("div",{className:"mb-4",children:[p.jsx("h3",{className:"text-center font-medium mb-1.5 text-base",style:{color:t.getColor(k.RatingRateConversationText)},children:n(J.RatingRateConversation)}),p.jsx(x6,{rating:i,onChange:w=>{s(w),w>=1&&f(!1)}}),i>0&&p.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.FooterText)},children:n(J.RatingYourScore).replace("{score}",Number.isInteger(i)?i.toString():i.toFixed(1))}),i>0&&i<1||c?p.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.ErrorText)},children:n(J.RatingMinimumError)}):null]}),p.jsxs("form",{onSubmit:y.handleSubmit,className:"space-y-4",children:[p.jsxs("div",{children:[p.jsx("label",{htmlFor:"comment",className:"block text-xs font-medium mb-1",style:{color:t.getColor(k.InputText)},children:n(J.RatingComment)}),p.jsx(Yu,{id:"comment",onChange:y.handleChange,onBlur:y.handleBlur,value:y.values.comment,placeholder:n(J.RatingCommentPlaceholder),className:"rounded-lg",error:y.errors.comment})]}),p.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[p.jsx(Rt,{type:"submit",size:"md",onClick:w=>{i<1&&(w.preventDefault(),w.stopPropagation(),f(!0))},className:"w-full",children:n(J.RatingSubmit)}),p.jsx(Rt,{onClick:x,size:"md",variant:"secondary",kind:"subtle",className:"w-full",bgKey:k.GreeterBackground,textKey:k.GreeterText,children:n(J.RatingNewConversation)})]})]})]})}),p.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:"py-1.5 px-3 text-xs text-center flex items-center justify-center gap-1 transition-colors",style:{color:t.getColor(k.FooterText),borderTop:`1px solid ${t.getColor(k.FooterBorder)}`,backgroundColor:t.getColor(k.FooterBackground)},children:[p.jsx("span",{children:n(J.PoweredBy)}),p.jsx("span",{className:"font-medium",children:"Chatier"})]})]})}function b6({onSendMessage:e,disabled:t}){const n=g.useRef(null),r=je(),i=cs(),{setIsInputFocused:s}=ie(),[o,a]=g.useState(""),[l,u]=g.useState("3rem"),[d,c]=g.useState(!1),f=g.useRef(t);g.useEffect(()=>{f.current&&!t&&setTimeout(()=>{var x;(x=n.current)==null||x.focus()},100),f.current=t},[t]);const m=()=>{if(!o.trim()||t)return;const x=o;a(""),n.current&&(n.current.style.height="3rem",u("3rem")),e(x)},y=g.useCallback(x=>{const w=n.current;if(w){const h=w.selectionStart,v=w.selectionEnd,b=o.substring(0,h)+x+o.substring(v);b.length<=2e3&&(a(b),setTimeout(()=>{w.selectionStart=w.selectionEnd=h+x.length,w.focus()},0))}else{const h=o+x;h.length<=2e3&&a(h)}},[o]);return p.jsxs("form",{className:"flex flex-col relative",onSubmit:x=>{x.preventDefault(),m()},children:[p.jsx("div",{className:"mx-4 border-t",style:{borderColor:r.getColor(k.DividerColor)}}),p.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[p.jsxs("div",{className:"flex-1 min-w-0 relative",children:[p.jsx(Yu,{id:"ai-message",inputRef:n,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:t,style:{height:l,maxHeight:"6rem",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},placeholder:i(J.MessagePlaceholder),value:o,maxLength:2e3,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:x=>{if(t)return;const w=x.target.value;if(w.length<=2e3&&a(w),w.length>0&&x.currentTarget.scrollHeight>x.currentTarget.clientHeight){const h=`${x.currentTarget.scrollHeight}px`;x.currentTarget.style.height=h,u(h)}else x.currentTarget.style.height="3rem",u("3rem")},onKeyDown:x=>{if(t){x.preventDefault();return}x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),m())}}),o.length>=500&&p.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:o.length>=2e3?r.getColor(k.ErrorText):r.getColor(k.FooterText),fontWeight:o.length>=2e3?"600":"normal"},children:2e3-o.length})]}),p.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:p.jsx(Pe.div,{whileTap:{scale:.9},children:p.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",withoutTheming:!0,disabled:t||!o.trim(),style:{opacity:1,backgroundColor:"transparent",color:o.trim()?r.getColor(k.ButtonBackground):r.getColor(k.FooterText)},children:t?p.jsx(Y.Spin,{className:"size-4 animate-spin"}):p.jsx(Y.PaperAirplane,{className:"size-5 -rotate-12"})})})})]}),p.jsx(DC,{isOpen:d,onClose:()=>c(!1),onSelect:y}),p.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[p.jsx("div",{className:"flex items-center gap-1",children:p.jsx("button",{type:"button",onClick:()=>c(!d),className:"p-1.5 rounded-md transition-colors",style:{color:r.getColor(k.IconColor)},children:p.jsx(Y.Emoji,{className:"size-5"})})}),p.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] flex items-center gap-1 transition-opacity hover:opacity-80",style:{color:r.getColor(k.FooterText)},children:[p.jsx("span",{children:i(J.PoweredBy)}),p.jsx("span",{className:"font-semibold",children:"Chatier"})]})]})]})}const sf=[Ne.Light,Ne.Dark,Ne.System];function k6(e){switch(e){case Ne.Light:return Y.Sun;case Ne.Dark:return Y.Moon;case Ne.System:return Y.Monitor;default:return Y.Monitor}}function S6({onChatClose:e}){const[t,n]=g.useState(!1),[r,i]=g.useState(!1),[s,o]=g.useState(null),[a,l]=g.useState(()=>hC()),u=g.useRef(null),d=g.useRef(null),c=je(),f=cs(),{mode:m,setMode:y}=c,x=()=>e(),w=()=>{const b=sf.indexOf(m),T=sf[(b+1)%sf.length];y(T)},h=()=>{const b=!a;mC(b),l(b)};g.useLayoutEffect(()=>{var b;o(r?((b=u.current)==null?void 0:b.getBoundingClientRect())??null:null)},[r]),g.useEffect(()=>{if(!r)return;const b=T=>{var C,E;(C=d.current)!=null&&C.contains(T.target)||(E=u.current)!=null&&E.contains(T.target)||i(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[r]);const v=r&&s&&yu.createPortal(p.jsxs(Pe.div,{ref:d,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"fixed z-[9999] py-1 min-w-[160px] rounded-lg shadow-lg",style:{top:s.bottom+6,right:typeof window<"u"?window.innerWidth-s.right:s.right,left:"auto",backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[p.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[p.jsx(Y.XCircle,{className:"size-4 flex-shrink-0"}),f(J.ChatEndConversation)]}),p.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:h,children:[a?p.jsx(Y.VolumeX,{className:"size-4 flex-shrink-0"}):p.jsx(Y.Volume2,{className:"size-4 flex-shrink-0"}),f(a?J.NotificationSoundOn:J.NotificationSoundOff)]}),p.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),p.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:w,children:[(()=>{const b=k6(m);return p.jsx(b,{className:"size-4 flex-shrink-0"})})(),m===Ne.Light?"Açık tema":m===Ne.Dark?"Koyu tema":"Sistem"]})]}),document.body);return p.jsxs(p.Fragment,{children:[p.jsx(fi,{children:t&&p.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:p.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[p.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:f(J.ChatCloseConfirm)}),p.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:f(J.ChatCloseWarning)}),p.jsxs("div",{className:"flex justify-end gap-2",children:[p.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:f(J.CancelAction)}),p.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:x,children:f(J.CloseAction)})]})]})})}),p.jsxs("div",{className:"relative flex-shrink-0",children:[p.jsx("button",{ref:u,type:"button",onClick:()=>i(b=>!b),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:f(J.ChatSettings),"aria-expanded":r,children:p.jsx(Y.Menu,{className:"size-5"})}),r&&v]})]})}function C6({onOperatorConnected:e,onChatClose:t}){var se,he,ue;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:u,humanNeedRequested:d,setHumanNeedRequested:c,setIsAIAgentMode:f}=ie(),m=je(),y=Ro(),x=Xu(),w=dr(),h=gs(),[v,b]=g.useState(!1),[T,C]=g.useState(!1),[E,S]=g.useState(!1),[A,B]=g.useState(""),[L,N]=g.useState(!1),[ee,Z]=g.useState(0),[V,O]=g.useState(null),I=()=>{r(!1)},H=()=>{c(!1),t()},_=(((ue=(he=(se=n==null?void 0:n.appearance)==null?void 0:se.body)==null?void 0:he.inputs)==null?void 0:ue.length)||0)>0,P=g.useRef(!1),F=g.useRef(!1);g.useEffect(()=>{if(!i||P.current)return;if(s.length>0){P.current=!0;return}if(!w||!w.connected){const z=setInterval(()=>{w&&w.connected&&(clearInterval(z),q())},100),ne=setTimeout(()=>{clearInterval(z),P.current||oe()},3e3);return()=>{clearInterval(z),clearTimeout(ne)}}q();function q(){P.current||!w||(P.current=!0,w.emit(Ve.MessageList,{},z=>{Array.isArray(z)&&z.length>0?a(z):oe()}))}function oe(){if(!i)return;const z={id:Dp(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:ye.User};o(z)}},[w,i,s.length,a,o]),g.useEffect(()=>{if(ee>0){const q=requestAnimationFrame(()=>Z(0));return()=>cancelAnimationFrame(q)}},[ee]),g.useEffect(()=>{if(!w)return;const q=({token:D})=>{B(te=>te+D)},oe=D=>{D!=null&&D.human_need&&c(!0)},z=D=>{D.repeat_count===3&&O(D.message)},ne=()=>{t()};return w.on(ve.AgentMessageChunk,q),w.on(ve.AgentMessageFinalMetadata,oe),w.on(ve.AgentSpamWarning,z),w.on(ve.AgentSpamBanned,ne),()=>{w.off(ve.AgentMessageChunk,q),w.off(ve.AgentMessageFinalMetadata,oe),w.off(ve.AgentSpamWarning,z),w.off(ve.AgentSpamBanned,ne)}},[w,c,t]);const $=g.useCallback(q=>{if(!n||!i||!w||T||F.current)return;F.current=!0;const oe=`temp-${Date.now()}`,z={id:oe,content:q,created_at:new Date,files:[],sender_type:ye.Customer};o(z),B(""),N(!0),b(!0),C(!0);const ne=l||mi(n.link_id);w.emit(Ve.AgentMessageCreate,{question:q,agent_id:i.id,session_id:ne},D=>{if(F.current=!1,N(!1),B(""),b(!1),C(!1),!D){const te={id:Dp(),content:"Üzgünüm, bir hata oluştu. Lütfen tekrar deneyin veya canlı destek personelimıze bağlanın.",created_at:new Date,files:[],sender_type:ye.System};a(de=>de.filter(Ce=>Ce.id!==oe).concat([te])),c(!0);return}D.session_id&&u(D.session_id),o(D.agent_message),D.human_need&&c(!0)})},[n,i,T,w,l,o,a,u,c]),W=g.useCallback(q=>{if(!w||E)return;S(!0);const oe=()=>{w.emit(Ve.AgentRequestHuman,{},z=>{S(!1),z!=null&&z.success?(ie.getState().setIsHaveChat(!0),f(!1),c(!1),ie.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};q&&Object.keys(q).length>0?w.emit(Ve.ChatUpdateInputs,{inputs:q},z=>{z!=null&&z.success?oe():(console.error("Failed to update chat inputs"),S(!1))}):oe()},[w,E,f,c,e]),Q=()=>{_?h.push("registration"):W()};return i?p.jsxs(p.Fragment,{children:[p.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:m.getColor(k.HeaderBackground),color:m.getColor(k.HeaderText),borderColor:m.getColor(k.HeaderBorder),...y?{}:{borderTopLeftRadius:m.getRadius(),borderTopRightRadius:m.getRadius()}},children:[p.jsx("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:p.jsx(sh,{name:i.name,avatar:i.avatar,textColor:m.getColor(k.HeaderText),subtitle:"AI Asistan"})}),p.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[p.jsx(S6,{onChatClose:H}),x&&p.jsx("button",{type:"button",onClick:I,className:"p-1 hover:opacity-80 transition-opacity",children:p.jsx(Y.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),p.jsx(vC,{messages:s,isTyping:v,streamingContent:L?A:void 0,skipAnimationForLastN:ee}),p.jsx(fi,{children:V&&p.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:m.getColor(k.ErrorBackground),borderColor:m.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:m.getRadius()},children:[p.jsx(Y.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:m.getColor(k.ErrorText)}}),p.jsx("span",{className:"text-sm",style:{color:m.getColor(k.ErrorText)},children:V}),p.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>O(null),style:{color:m.getColor(k.ErrorText)},children:p.jsx(Y.X,{className:"size-4"})})]})}),p.jsx(fi,{children:d&&p.jsx(Pe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"px-4 py-3",style:{backgroundColor:m.getColor(k.Background)},children:p.jsx(Pe.div,{className:"relative w-full overflow-hidden",style:{borderRadius:m.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:p.jsx(Rt,{onClick:Q,disabled:E,size:"lg",className:"w-full flex items-center justify-center gap-2",children:E?p.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):p.jsxs(p.Fragment,{children:[p.jsx(Y.User,{className:"w-5 h-5"}),p.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})})}),p.jsx(b6,{onSendMessage:$,disabled:T})]}):null}function _6({children:e}){const{widget:t}=ie();return t?p.jsx("section",{className:"h-full w-full relative",children:e}):null}function T6({children:e}){const t=dr(),n=gs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=ie(),[o,a]=g.useState(!0),[l,u]=g.useState(!1),d=g.useRef(!1);return g.useEffect(()=>{if(r){a(!1);return}if(!t){a(!1);return}const c=()=>{a(!1),u(!1),d.current=!0},f=()=>{i&&s||(u(!0),n.push("registration"))};return t.on(ve.Connect,c),t.on(ve.Disconnect,f),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(ve.Connect,c),t.off(ve.Disconnect,f)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),p.jsx(Jp,{})):d.current&&!t.connected?p.jsx(Jp,{}):o||!t.connected?p.jsx(pC,{}):e}function E6(){const{widget:e,setOpen:t,setIsHaveChat:n,historyChat:r,setHistoryChat:i,historyMessages:s,setHistoryMessages:o,aiAgent:a,isAIAgentMode:l,clearAIAgentState:u}=ie(),d=je(),c=dr(),{connected:f,connectionReady:m}=c,y=ol(),x=gs(),w=Ro(),[h,v]=g.useState(null),[b,T]=g.useState([]),[C,E]=g.useState(!1),[S,A]=g.useState([]),[B,L]=g.useState([]),[N,ee]=g.useState(!1),Z=Wm(),V=g.useRef(!1),O=g.useRef(null),I=g.useRef(!1),[H,_]=g.useState(!1),[P,F]=g.useState(null);g.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:f,connectionReady:m,hasChat:!!h,chatViewEmitted:V.current})},[f,m,h]),g.useEffect(()=>{if(h||r||l){_(!1);return}const D=setTimeout(()=>{!h&&!r&&!l&&(console.warn("WS: Connection timeout reached in ChatDetailView"),_(!0))},1e4);return()=>clearTimeout(D)},[h,r,l]),g.useEffect(()=>{if(!r||!e)return;if(v({status:r.status,is_customer_uploadable:!1}),s){T(s);return}const D=mi(e.link_id);cM(r._id,e.link_id,D).then(([te,de])=>{if($n(de)&&Array.isArray(te)){const Ce=te.map(ge=>({id:ge._id,content:ge.content,created_at:ge.created_at,files:ge.files,sender_type:ge.sender_type,activity_type:ge.activity_type,answers:ge.answers,reply_id:ge.reply_id,buttons:ge.buttons}));T(Ce),o(Ce)}}).catch(te=>{console.error("Failed to load history messages",te)})},[r,e,s,o]),g.useEffect(()=>{if(!e||l||r)return;const D=mr(e.link_id);D.isAgentMode&&D.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),ie.getState().setAIAgent(D.agent),ie.getState().setIsAIAgentMode(!0),D.sessionId&&ie.getState().setAIAgentSessionId(D.sessionId),D.humanNeedRequested&&ie.getState().setHumanNeedRequested(!0))},[e,l,r]);const $=async(D,te)=>{var Bt;if(!e)return;if(!r){const re=`temp-${Date.now()}`,be={id:re,content:D,created_at:new Date,files:te||[],sender_type:ye.Customer,answers:[],reply_id:void 0,buttons:[]};T(Je=>[...Je,be]),c==null||c.emit(Ve.MessageCreate,{content:D,files:te},Je=>{const R=Array.isArray(Je)?Je[0]:Je;if(R&&R.isError){T(M=>M.filter(U=>U.id!==re));const K=(R==null?void 0:R.error)||(R==null?void 0:R.message);(!K||!/too\s+many/i.test(K))&&ho(R),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}T(K=>K.map(M=>M.id===re?R:M))});return}const de={},Ce=e.appearance;if((Bt=Ce==null?void 0:Ce.body)!=null&&Bt.inputs){for(const re of Ce.body.inputs)if(re.required||re.remember){const be=ha(re.name);be&&(de[re.name]=be)}}const ge=ie.getState().defaultValues;if(ge){ge.username&&(de.username=ge.username),ge.secret_data&&(de.secret_data=ge.secret_data);for(const re in ge)de[re]||(de[re]=ge[re])}const[Ze,ot]=await Z.mutateAsync({inputs:de,history:[],client_id:e.client_id,widget_id:e.link_id,device_id:mi(e.link_id)});if($n(ot)){i(null),n(!0),Ze&&typeof Ze=="object"&&"customer_token"in Ze&&(Ln(rt.CustomerToken,Ze.customer_token,e.link_id),Ln(rt.CustomerRefreshToken,Ze.customer_refresh_token,e.link_id));let re=0;const be=20,Je=`temp-${Date.now()}`,R={id:Je,content:D,created_at:new Date,files:te||[],sender_type:ye.Customer,answers:[],reply_id:void 0,buttons:[]};T(M=>[...M,R]);const K=setInterval(()=>{re+=1,c!=null&&c.connected?(c.emit(Ve.MessageCreate,{content:D,files:te},M=>{const U=Array.isArray(M)?M[0]:M;if(U&&U.isError){T(fe=>fe.filter(ke=>ke.id!==Je));const ae=(U==null?void 0:U.error)||(U==null?void 0:U.message);(!ae||!/too\s+many/i.test(ae))&&ho(U),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}T(ae=>ae.map(fe=>fe.id===Je?U:fe))}),clearInterval(K)):re>=be&&clearInterval(K)},200)}},W=D=>{!D&&!w&&t(!1),ee(!0),da((e==null?void 0:e.link_id)||""),n(!1),v(null),T([]),A([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),u(),sc(e.client_id,Yi(y)).then(()=>{c==null||c.disconnect(),x.push("registration")})},Q=()=>{h?(localStorage.setItem("showActionButtons","false"),v({...h,status:qt.Closed})):W(!1)};g.useEffect(()=>{if(c&&!(l&&a)){if(r){V.current=!1,I.current=!1;return}if(!f||!m){f||(I.current=!1,V.current=!1,O.current=null);return}I.current=!0,!(!e||V.current)&&(V.current=!0,console.log("ChatView: Emitting chat:view request"),c.emit(Ve.ChatView,{},D=>{if(console.log("ChatView: Received response",{chatReceived:D!==null,chatStatus:D==null?void 0:D.status,hasAgentName:!!(D!=null&&D.agent_name),hasError:D&&"error"in D}),ie.getState().historyChat){V.current=!1;return}if(D===null||D&&"error"in D||!(D!=null&&D.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:D}),t(!1),n(!1),sc(e.client_id,Yi(y)),T([]),A([]),i(null),ie.getState().setHistoryMessages(null),u(),da((e==null?void 0:e.link_id)||""),c.disconnect(),x.push("registration"),V.current=!1;return}console.log("ChatView: Setting chat state",{status:D.status}),v(D),n(!0)}))}},[r,c,e,f,m,y,x,t,n,i,l,a,u]);const se=()=>{Q()},he=()=>{W(!0)},[ue,q]=g.useState(!1),oe=g.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),V.current=!1,O.current=null,I.current=!1;const D=ie.getState().aiAgentMessages;D.length>0&&T(D),q(!0)},[]);g.useEffect(()=>{if(ue){if(!c||!f||!m){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:f,connectionReady:m});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),V.current){q(!1);return}V.current=!0,c.emit(Ve.ChatView,{},D=>{console.log("handleOperatorConnected: ChatView result",D),D&&!("error"in D)&&D.status?(v(D),n(!0),c.emit(Ve.MessageList,{},de=>{console.log("handleOperatorConnected: MessageList result",de),Array.isArray(de)&&T(de)})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",D),n(!1)),q(!1)})}},[ue,c,f,m,n]);const z=()=>{u(),w||t(!1),ee(!0),da((e==null?void 0:e.link_id)||""),n(!1),v(null),T([]),A([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),sc(e.client_id,Yi(y)).then(()=>{c==null||c.disconnect(),x.push("registration")})},ne=g.useCallback(D=>{h&&![qt.Closed,qt.Deleted].includes(h.status)&&T(te=>{const de=te.filter(ge=>{var Ze;return!((Ze=ge.id)!=null&&Ze.startsWith("temp-")&&ge.content===D.content)});return de.some(ge=>ge.id===D.id)?de:[...de,D]})},[h]);return g.useEffect(()=>{if(!c)return;const D=re=>{const be={content:re.content,created_at:re.created_at,files:re.files,id:re._id,sender_type:re.sender_type,answers:re.answers,reply_id:re.reply_id,buttons:re.buttons};if(S.length>0){A(Je=>[...Je,be]);return}re.is_shortcut?A([be]):ne(be),E(!1)},te=re=>{const be={content:re.content,created_at:re.created_at,files:re.files,id:re._id,sender_type:re.sender_type,activity_type:re.activity_type,answers:re.answers,reply_id:re.reply_id,buttons:re.buttons};ne(be)},de=re=>{!re||!re.name?v(be=>be?{...be,agent_name:void 0,agent_avatar:void 0}:null):((!(h!=null&&h.agent_name)||!(h!=null&&h.agent_avatar)||h.agent_name===re.name)&&v({...h,agent_name:re.name,agent_avatar:re.avatar,is_customer_uploadable:(h==null?void 0:h.is_customer_uploadable)??!1,status:(h==null?void 0:h.status)??qt.Open}),L(be=>be.includes(re.name)?be:[...be,re.name]))},Ce=()=>{E(!0)},ge=()=>{Q()},Ze=({is_customer_uploadable:re})=>{v(h?{...h,is_customer_uploadable:re}:null)},ot=re=>{if(L(be=>be.filter(Je=>Je!==re.name)),!re.hasOtherAdmins)v(h?{...h,agent_name:void 0,agent_avatar:void 0}:null);else{const be=B.filter(Je=>Je!==re.name);be.length>0&&v(h?{...h,agent_name:be[0],agent_avatar:void 0}:null)}},Bt=re=>{L(be=>be.includes(re.name)?be:[...be,re.name]),h!=null&&h.agent_name||v(h?{...h,agent_name:re.name,agent_avatar:void 0}:null)};return c.on(ve.MessageAgentCreate,D),c.on(ve.MessageUserCreate,te),c.on(ve.MessageCustomerCreate,te),c.on(ve.ChatUserAssignee,de),c.on(ve.MessageAgentTyping,Ce),c.on(ve.ChatUserClose,ge),c.on(ve.ChatToggleUpload,Ze),c.on(ve.ChatUserLeave,ot),c.on(ve.ChatUserJoin,Bt),()=>{c.off(ve.MessageAgentCreate,D),c.off(ve.MessageUserCreate,te),c.off(ve.MessageCustomerCreate,te),c.off(ve.ChatUserAssignee,de),c.off(ve.MessageAgentTyping,Ce),c.off(ve.ChatUserClose,ge),c.off(ve.ChatToggleUpload,Ze),c.off(ve.ChatUserLeave,ot),c.off(ve.ChatUserJoin,Bt)}},[ne,B]),g.useEffect(()=>{if(!c)return;const D=de=>{de.repeat_count===3&&F(de.message)},te=()=>{c.emit(Ve.ChatClose,{}),ie.getState().setShowActionButtons(!1),Q()};return c.on(ve.AgentSpamWarning,D),c.on(ve.AgentSpamBanned,te),()=>{c.off(ve.AgentSpamWarning,D),c.off(ve.AgentSpamBanned,te)}},[c,Q]),g.useEffect(()=>{if(!c||!h||r){O.current=null;return}const D=`${h.status}-${h.agent_name||"no-agent"}`;O.current!==D&&(O.current=D,c.emit(Ve.MessageList,{},te=>{if(!Array.isArray(te)){console.warn("MessageList response is not an array:",te),O.current=null;return}T(te);const de=new Map;for(const ge of te)ge.sender_type===ye.Activity&&(ge.activity_type===mn.AdminJoin&&ge.sender_name?de.set(ge.sender_name,!0):ge.activity_type===mn.AdminLeave&&ge.sender_name&&de.set(ge.sender_name,!1));const Ce=Array.from(de.entries()).filter(([ge,Ze])=>Ze).map(([ge])=>ge);L(Ce)}))},[c,h,r]),g.useEffect(()=>{const D=setTimeout(()=>{E(!1)},2e3);return()=>clearTimeout(D)},[C]),g.useEffect(()=>{if(!e||S.length===0)return;let D=0;e.writing_timeout&&(D=[...S[0].content].length/e.writing_timeout,D<0&&(D=0));const te=setTimeout(()=>{ne(S[0]),A(S.slice(1))},D*1e3);return()=>clearTimeout(te)},[S,e]),N?p.jsx(Jp,{}):l&&a&&!r?p.jsxs(p.Fragment,{children:[p.jsx("div",{id:"chat-alert-portal"}),p.jsx("div",{className:`h-full w-full ${w?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:w?"100%":"",minHeight:w?"var(--app-height, 100dvh)":"",maxHeight:w?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(k.Background)},children:p.jsx(C6,{onOperatorConnected:oe,onChatClose:z})})]}):p.jsxs(p.Fragment,{children:[p.jsx("div",{id:"chat-alert-portal"}),p.jsx("div",{className:`h-full w-full ${w?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:w?"100%":"",minHeight:w?"var(--app-height, 100dvh)":"",maxHeight:w?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(k.Background)},children:h?h.status===qt.Closed&&!r?p.jsx(w6,{onOk:W}):p.jsx(y6,{chat:h,isTyping:C,messages:b,shortcutMessages:S,onNewMessage:ne,onChatClose:Q,onEvaluateChat:se,onNewChat:he,onSendMessage:$,isHistoryMode:!!r,spamWarningMessage:P,onDismissSpamWarning:()=>F(null)}):H?p.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[p.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:d.getColor(k.InputBorder)},children:p.jsx(Y.XCircle,{className:"w-6 h-6 opacity-50"})}),p.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Bağlantı Kurulamadı"}),p.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Sunucuyla bağlantı sağlanırken bir sorun oluştu. Lütfen tekrar deneyin."}),p.jsx("button",{type:"button",onClick:()=>W(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:d.getColor(k.ButtonBackground),color:d.getColor(k.ButtonText),borderRadius:d.getRadius()},children:"Tekrar Dene"})]}):p.jsx(pC,{})})]})}function j6(){return WL(),null}function A6(){return p.jsxs(T6,{children:[p.jsx(_6,{children:p.jsx(E6,{})}),p.jsx(j6,{})]})}const R6=[{path:"/chat",component:A6,name:"chat"}],IC=[...R6],LC=[...QL],P6=[...IC,...LC];function oh({text:e}){var u,d,c,f;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=ie(),o=je(),a=cs(),l=()=>{i(!1),s&&s()};return r?p.jsxs(Pe.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:ze("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(k.TooltipBackground),color:o.getColor(k.TooltipText)},children:[p.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(J.CloseButtonAria),children:p.jsx(Y.X,{className:"size-3"})}),p.jsx(Pe.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(k.TooltipText)},children:e||(n?(d=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:d.tooltip_message_active:(f=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:f.tooltip_message)||a(n?J.TooltipActive:J.TooltipDefault)}),p.jsx("div",{className:"absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5",style:{backgroundColor:o.getColor(k.TooltipBackground)}})]},"widget-tooltip"):null}function Ex({fallback:e,fallbackOpen:t}){const[n]=g.useState(window.document.title),r=dr(),{isHaveChat:i,open:s,soundPath:o}=ie(),[a,l]=g.useState(!0),[u,d]=g.useState(0),[c,f]=g.useState(null),m=cs(),y=()=>{nF(o)},x=(w,h)=>{if(c&&clearInterval(c),w||!i||h===0||Number.isNaN(h)){window.document.title=n,f(null);return}const v=setInterval(()=>{if(w||!i||h===0||Number.isNaN(h)){window.document.title=n,clearInterval(v),f(null);return}const b=`${h} ${m(J.NewMessagesNotification)} - ${n}`;window.document.title!==b?window.document.title=b:window.document.title=n},1e3);return f(v),()=>{clearInterval(v),f(null)}};return g.useEffect(()=>x(s&&a,u),[u,s,a]),g.useEffect(()=>{const w=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",w,!1),()=>{document.removeEventListener("visibilitychange",w)}},[]),g.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const w=()=>{!i||s&&a||(d(h=>h+1),y())};return r.on(ve.MessageAgentCreate,w),r.on(ve.ChatUserAssignee,y),()=>{r.off(ve.MessageAgentCreate,w),r.off(ve.ChatUserAssignee,y)}},[r,i,s,a]),s?null:i&&u>0?p.jsx(oh,{text:m(J.NewMessagesNotification)}):!i&&t?e:null}function M6({children:e,border:t}){var H,_,P,F;const n=dr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:u,humanNeedRequested:d}=ie(),[c]=g.useState(!0),f=gs(),m=ol(),y=cm(),x=je(),{resolvedMode:w}=x,h=Ro(),v=UL(),[b,T]=g.useState({x:0,y:0}),C=gP(),E=g.useRef(null),S=g.useRef(null),[A,B]=g.useState(!1),[L,N]=g.useState(!1);g.useEffect(()=>((()=>{B("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{B(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{B(!0)})}),[]),g.useEffect(()=>{o&&y.pathname==="/"&&m&&m.accessToken&&!d&&f.push("chat")},[o,y.pathname,m,f,d]),g.useEffect(()=>{r?requestAnimationFrame(()=>{N(!0)}):N(!1)},[r]);const ee=$=>{if(!E.current||!S.current)return $;const W=E.current.getBoundingClientRect(),Q={width:window.innerWidth,height:window.innerHeight},se={top:20,right:20,bottom:40,left:20};let he=$.x,ue=$.y;return W.right+he-b.x>Q.width-se.right&&(he=Q.width-se.right-W.width-(W.left-b.x)),W.left+he-b.x<se.left&&(he=se.left-(W.left-b.x)),W.bottom+ue-b.y>Q.height-se.bottom&&(ue=Q.height-se.bottom-W.height-(W.top-b.y)),W.top+ue-b.y<se.top&&(ue=se.top-(W.top-b.y)),{x:he,y:ue}},Z=()=>{i(!0),n&&(n.emit(Ve.WidgetOpen,{}),l&&l())},V=()=>{i(!1),n&&(n.emit(Ve.WidgetClose,{}),u&&u())},O=()=>{i(!1),s(!1),sc(a.client_id,Yi(m)),f.push("registration")};g.useEffect(()=>{if(h&&(o||v)&&Z(),!(!n||!a))return n.on(ve.Banned,O),()=>{n.off(ve.Banned,O)}},[]);function I($){A&&C.start($)}return p.jsxs("section",{className:"relative w-full h-full",ref:S,"data-theme":w,children:[r&&p.jsx("div",{className:ze("fixed z-300 overflow-hidden transition-all duration-300 ease-out",{"":t&&!h,"bottom-24 right-8 rounded-xl":!h,"!bottom-0 !right-0":h,"opacity-100 scale-100 translate-y-0":L,"opacity-0 scale-95 translate-y-2":!L}),style:{width:h?"100%":((_=(H=a==null?void 0:a.appearance)==null?void 0:H.design)==null?void 0:_.width)||"21rem",height:h?"var(--app-height, 100dvh)":((F=(P=a==null?void 0:a.appearance)==null?void 0:P.design)==null?void 0:F.height)||"30rem",left:h?"0":"",right:h?"0px !important":"",maxHeight:h?"var(--app-height, 100dvh)":"",boxShadow:h?"":`0 10px 25px -5px ${x.getColor(k.ShadowColor)}, 0 8px 10px -6px ${x.getColor(k.ShadowColor)}`,backgroundColor:x.getColor(k.Background)},children:e}),!A&&p.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[p.jsx(Ex,{fallback:p.jsx(oh,{}),fallbackOpen:c}),!r&&p.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:Z,children:[p.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:x.getColor(k.ButtonBackground)}}),p.jsx(Y.Chat,{className:"size-6"})]},"desktop-open-button"),r&&!h&&p.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:V,children:p.jsx(Y.ArrowDown2,{className:"size-6"})},"desktop-close-button")]}),A&&p.jsxs(Pe.div,{ref:E,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:b.x,y:b.y},drag:A,dragControls:C,dragMomentum:!1,dragElastic:0,onDragEnd:($,W)=>{const Q={x:b.x+W.offset.x,y:b.y+W.offset.y},se=ee(Q);T(se)},children:[p.jsx(Ex,{fallback:p.jsx(oh,{}),fallbackOpen:c}),!r&&p.jsx("div",{className:"cursor-move",onPointerDown:I,children:p.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:Z,children:[p.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:x.getColor(k.ButtonBackground)}}),p.jsx(Y.Chat,{className:"size-6"})]})},"chat-button"),r&&!h&&p.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:V,children:p.jsx(Y.ArrowDown2,{className:"size-6"})},"desktop-close-button")]})]})}function O6(e){const{widget:t}=ie();return p.jsx(EP,{widget:t,children:p.jsx(M6,{...e})})}function N6(){const{isHaveChat:e,isAIAgentMode:t}=ie();return p.jsx(nj,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:p.jsx(O6,{border:!0,children:p.jsxs(ij,{children:[IC.map((n,r)=>p.jsx(fp,{path:n.path,element:p.jsx(n.component,{})},r)),LC.map((n,r)=>p.jsx(fp,{path:n.path,element:p.jsx(n.component,{})},r))]})})})}const D6=g.forwardRef((e,t)=>{const n=localStorage.getItem("lc:device:id"),{data:r,isLoading:i,error:s}=aE(e.link_id,n||void 0),{widget:o,setWidget:a,setSoundPath:l,setDefaultValues:u,setOpen:d,setOnTooltipClose:c,setIsTooltipVisible:f,setOnOpen:m,setOnClose:y,onOpen:x,onClose:w}=ie();return g.useImperativeHandle(t,()=>({open:()=>{d(!0),x&&x()},close:()=>{d(!1),w&&w()}})),g.useEffect(()=>{r&&cE(r)&&a(r),e.soundPath&&l(e.soundPath),e.defaultValues&&u(e.defaultValues),e.onTooltipClose&&c(e.onTooltipClose),e.showTooltip===!1&&f(!1),e.onOpen&&m(e.onOpen),e.onClose&&y(e.onClose)},[r,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),i?p.jsx("div",{children:"Loading..."}):s||!r||!o?null:p.jsx(MI,{children:p.jsx(VL,{children:p.jsx(N6,{})})})}),I6=new HT;let jx=null;function L6(e){if(!e.container)return;const t=X.createRef();return jx=Xw(e.container),jx.render(p.jsxs(QT,{client:I6,children:[p.jsx(D6,{...e,ref:t}),p.jsx(Mj,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()},identify:n=>{if(!e.link_id)return;const r=mi(e.link_id);aM({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=L6});export default F6();
127
+ */const mF=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],gF=xC("paperclip",mF);var wC={exports:{}},vF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",yF=vF,xF=yF;function bC(){}function kC(){}kC.resetWarningCache=bC;var wF=function(){function e(r,i,s,o,a,l){if(l!==xF){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:kC,resetWarningCache:bC};return n.PropTypes=n,n};wC.exports=wF();var bF=wC.exports;const Oe=Rr(bF);function vs(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{c(r.next(d))}catch(u){o(u)}}function l(d){try{c(r.throw(d))}catch(u){o(u)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}const kF=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function xo(e,t,n){const r=SF(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&fx(r,"path",s),fx(r,"relativePath",s),r}function SF(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=kF.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function fx(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const CF=[".DS_Store","Thumbs.db"];function _F(e){return vs(this,void 0,void 0,function*(){return Zc(e)&&TF(e.dataTransfer)?RF(e.dataTransfer,e.type):EF(e)?jF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?AF(e):[]})}function TF(e){return Zc(e)}function EF(e){return Zc(e)&&Zc(e.target)}function Zc(e){return typeof e=="object"&&e!==null}function jF(e){return Jp(e.target.files).map(t=>xo(t))}function AF(e){return vs(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>xo(n))})}function RF(e,t){return vs(this,void 0,void 0,function*(){if(e.items){const n=Jp(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(PF));return px(SC(r))}return px(Jp(e.files).map(n=>xo(n)))})}function px(e){return e.filter(t=>CF.indexOf(t.name)===-1)}function Jp(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function PF(e){if(typeof e.webkitGetAsEntry!="function")return hx(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?CC(t):hx(e,t)}function SC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?SC(n):[n]],[])}function hx(e,t){return vs(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,xo(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return xo(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function MF(e){return vs(this,void 0,void 0,function*(){return e.isDirectory?CC(e):OF(e)})}function CC(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>vs(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(MF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function OF(e){return vs(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=xo(r,e.fullPath);t(i)},r=>{n(r)})})})}var tf=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function mx(e){return IF(e)||DF(e)||TC(e)||NF()}function NF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
128
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IF(e){if(Array.isArray(e))return eh(e)}function gx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gx(Object(n),!0).forEach(function(r){_C(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qa(e,t){return BF(e)||FF(e,t)||TC(e,t)||LF()}function LF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
129
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TC(e,t){if(e){if(typeof e=="string")return eh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eh(e,t)}}function eh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function BF(e){if(Array.isArray(e))return e}var $F=typeof tf=="function"?tf:tf.default,zF="file-invalid-type",VF="file-too-large",UF="file-too-small",HF="too-many-files",WF=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:zF,message:"File type must be ".concat(r)}},yx=function(t){return{code:VF,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},xx=function(t){return{code:UF,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},qF={code:HF,message:"Too many files"};function EC(e,t){var n=e.type==="application/x-moz-file"||$F(e,t);return[n,n?null:WF(t)]}function jC(e,t,n){if(Ri(e.size))if(Ri(t)&&Ri(n)){if(e.size>n)return[!1,yx(n)];if(e.size<t)return[!1,xx(t)]}else{if(Ri(t)&&e.size<t)return[!1,xx(t)];if(Ri(n)&&e.size>n)return[!1,yx(n)]}return[!0,null]}function Ri(e){return e!=null}function GF(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,o=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&o>=1&&t.length>o?!1:t.every(function(l){var c=EC(l,n),d=qa(c,1),u=d[0],p=jC(l,r,i),m=qa(p,1),y=m[0],x=a?a(l):null;return u&&y&&!x})}function Jc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Vl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function wx(e){e.preventDefault()}function YF(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function QF(e){return e.indexOf("Edge/")!==-1}function KF(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return YF(e)||QF(e)}function qn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return t.some(function(a){return!Jc(r)&&a&&a.apply(void 0,[r].concat(s)),Jc(r)})}}function XF(){return"showOpenFilePicker"in window}function ZF(e){if(Ri(e)){var t=Object.entries(e).filter(function(n){var r=qa(n,2),i=r[0],s=r[1],o=!0;return AC(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(RC))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=qa(r,2),s=i[0],o=i[1];return vx(vx({},n),{},_C({},s,o))},{});return[{description:"Files",accept:t}]}return e}function JF(e){if(Ri(e))return Object.entries(e).reduce(function(t,n){var r=qa(n,2),i=r[0],s=r[1];return[].concat(mx(t),[i],mx(s))},[]).filter(function(t){return AC(t)||RC(t)}).join(",")}function e6(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function t6(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function AC(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function RC(e){return/^.*\.[\w]+$/.test(e)}var n6=["children"],r6=["open"],i6=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],s6=["refKey","onChange","onClick"];function o6(e){return c6(e)||l6(e)||PC(e)||a6()}function a6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
130
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c6(e){if(Array.isArray(e))return th(e)}function nf(e,t){return f6(e)||d6(e,t)||PC(e,t)||u6()}function u6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
131
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PC(e,t){if(e){if(typeof e=="string")return th(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return th(e,t)}}function th(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d6(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function f6(e){if(Array.isArray(e))return e}function bx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bx(Object(n),!0).forEach(function(r){nh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eu(e,t){if(e==null)return{};var n=p6(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function p6(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var cl=v.forwardRef(function(e,t){var n=e.children,r=eu(e,n6),i=h6(r),s=i.open,o=eu(i,r6);return v.useImperativeHandle(t,function(){return{open:s}},[s]),X.createElement(v.Fragment,null,n(He(He({},o),{},{open:s})))});cl.displayName="Dropzone";var MC={disabled:!1,getFilesFromEvent:_F,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};cl.defaultProps=MC;cl.propTypes={children:Oe.func,accept:Oe.objectOf(Oe.arrayOf(Oe.string)),multiple:Oe.bool,preventDropOnDocument:Oe.bool,noClick:Oe.bool,noKeyboard:Oe.bool,noDrag:Oe.bool,noDragEventsBubbling:Oe.bool,minSize:Oe.number,maxSize:Oe.number,maxFiles:Oe.number,disabled:Oe.bool,getFilesFromEvent:Oe.func,onFileDialogCancel:Oe.func,onFileDialogOpen:Oe.func,useFsAccessApi:Oe.bool,autoFocus:Oe.bool,onDragEnter:Oe.func,onDragLeave:Oe.func,onDragOver:Oe.func,onDrop:Oe.func,onDropAccepted:Oe.func,onDropRejected:Oe.func,onError:Oe.func,validator:Oe.func};var rh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function h6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=He(He({},MC),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,u=t.onDragOver,p=t.onDrop,m=t.onDropAccepted,y=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,h=t.useFsAccessApi,g=t.autoFocus,b=t.preventDropOnDocument,T=t.noClick,_=t.noKeyboard,E=t.noDrag,S=t.noDragEventsBubbling,A=t.onError,B=t.validator,L=v.useMemo(function(){return JF(n)},[n]),N=v.useMemo(function(){return ZF(n)},[n]),ee=v.useMemo(function(){return typeof w=="function"?w:kx},[w]),Z=v.useMemo(function(){return typeof x=="function"?x:kx},[x]),V=v.useRef(null),O=v.useRef(null),I=v.useReducer(m6,rh),H=nf(I,2),C=H[0],P=H[1],F=C.isFocused,$=C.isFileDialogActive,W=v.useRef(typeof window<"u"&&window.isSecureContext&&h&&XF()),Q=function(){!W.current&&$&&setTimeout(function(){if(O.current){var U=O.current.files;U.length||(P({type:"closeDialog"}),Z())}},300)};v.useEffect(function(){return window.addEventListener("focus",Q,!1),function(){window.removeEventListener("focus",Q,!1)}},[O,$,Z,W]);var se=v.useRef([]),he=function(U){V.current&&V.current.contains(U.target)||(U.preventDefault(),se.current=[])};v.useEffect(function(){return b&&(document.addEventListener("dragover",wx,!1),document.addEventListener("drop",he,!1)),function(){b&&(document.removeEventListener("dragover",wx),document.removeEventListener("drop",he))}},[V,b]),v.useEffect(function(){return!r&&g&&V.current&&V.current.focus(),function(){}},[V,g,r]);var ue=v.useCallback(function(M){A?A(M):console.error(M)},[A]),q=v.useCallback(function(M){M.preventDefault(),M.persist(),be(M),se.current=[].concat(o6(se.current),[M.target]),Vl(M)&&Promise.resolve(i(M)).then(function(U){if(!(Jc(M)&&!S)){var ae=U.length,fe=ae>0&&GF({files:U,accept:L,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:B}),ke=ae>0&&!fe;P({isDragAccept:fe,isDragReject:ke,isDragActive:!0,type:"setDraggedFiles"}),c&&c(M)}}).catch(function(U){return ue(U)})},[i,c,ue,S,L,o,s,a,l,B]),oe=v.useCallback(function(M){M.preventDefault(),M.persist(),be(M);var U=Vl(M);if(U&&M.dataTransfer)try{M.dataTransfer.dropEffect="copy"}catch{}return U&&u&&u(M),!1},[u,S]),z=v.useCallback(function(M){M.preventDefault(),M.persist(),be(M);var U=se.current.filter(function(fe){return V.current&&V.current.contains(fe)}),ae=U.indexOf(M.target);ae!==-1&&U.splice(ae,1),se.current=U,!(U.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Vl(M)&&d&&d(M))},[V,d,S]),ne=v.useCallback(function(M,U){var ae=[],fe=[];M.forEach(function(ke){var at=EC(ke,L),vt=nf(at,2),Vn=vt[0],un=vt[1],ys=jC(ke,o,s),pr=nf(ys,2),Nr=pr[0],xs=pr[1],Po=B?B(ke):null;if(Vn&&Nr&&!Po)ae.push(ke);else{var ki=[un,xs];Po&&(ki=ki.concat(Po)),fe.push({file:ke,errors:ki.filter(function(Un){return Un})})}}),(!a&&ae.length>1||a&&l>=1&&ae.length>l)&&(ae.forEach(function(ke){fe.push({file:ke,errors:[qF]})}),ae.splice(0)),P({acceptedFiles:ae,fileRejections:fe,isDragReject:fe.length>0,type:"setFiles"}),p&&p(ae,fe,U),fe.length>0&&y&&y(fe,U),ae.length>0&&m&&m(ae,U)},[P,a,L,o,s,l,p,m,y,B]),D=v.useCallback(function(M){M.preventDefault(),M.persist(),be(M),se.current=[],Vl(M)&&Promise.resolve(i(M)).then(function(U){Jc(M)&&!S||ne(U,M)}).catch(function(U){return ue(U)}),P({type:"reset"})},[i,ne,ue,S]),te=v.useCallback(function(){if(W.current){P({type:"openDialog"}),ee();var M={multiple:a,types:N};window.showOpenFilePicker(M).then(function(U){return i(U)}).then(function(U){ne(U,null),P({type:"closeDialog"})}).catch(function(U){e6(U)?(Z(U),P({type:"closeDialog"})):t6(U)?(W.current=!1,O.current?(O.current.value=null,O.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ue(U)});return}O.current&&(P({type:"openDialog"}),ee(),O.current.value=null,O.current.click())},[P,ee,Z,h,ne,ue,N,a]),de=v.useCallback(function(M){!V.current||!V.current.isEqualNode(M.target)||(M.key===" "||M.key==="Enter"||M.keyCode===32||M.keyCode===13)&&(M.preventDefault(),te())},[V,te]),Ce=v.useCallback(function(){P({type:"focus"})},[]),ge=v.useCallback(function(){P({type:"blur"})},[]),Ze=v.useCallback(function(){T||(KF()?setTimeout(te,0):te())},[T,te]),ot=function(U){return r?null:U},Bt=function(U){return _?null:ot(U)},re=function(U){return E?null:ot(U)},be=function(U){S&&U.stopPropagation()},Je=v.useMemo(function(){return function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=M.refKey,ae=U===void 0?"ref":U,fe=M.role,ke=M.onKeyDown,at=M.onFocus,vt=M.onBlur,Vn=M.onClick,un=M.onDragEnter,ys=M.onDragOver,pr=M.onDragLeave,Nr=M.onDrop,xs=eu(M,i6);return He(He(nh({onKeyDown:Bt(qn(ke,de)),onFocus:Bt(qn(at,Ce)),onBlur:Bt(qn(vt,ge)),onClick:ot(qn(Vn,Ze)),onDragEnter:re(qn(un,q)),onDragOver:re(qn(ys,oe)),onDragLeave:re(qn(pr,z)),onDrop:re(qn(Nr,D)),role:typeof fe=="string"&&fe!==""?fe:"presentation"},ae,V),!r&&!_?{tabIndex:0}:{}),xs)}},[V,de,Ce,ge,Ze,q,oe,z,D,_,E,r]),R=v.useCallback(function(M){M.stopPropagation()},[]),K=v.useMemo(function(){return function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},U=M.refKey,ae=U===void 0?"ref":U,fe=M.onChange,ke=M.onClick,at=eu(M,s6),vt=nh({accept:L,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ot(qn(fe,D)),onClick:ot(qn(ke,R)),tabIndex:-1},ae,O);return He(He({},vt),at)}},[O,n,a,D,r]);return He(He({},C),{},{isFocused:F&&!r,getRootProps:Je,getInputProps:K,rootRef:V,inputRef:O,open:ot(te)})}function m6(e,t){switch(t.type){case"focus":return He(He({},e),{},{isFocused:!0});case"blur":return He(He({},e),{},{isFocused:!1});case"openDialog":return He(He({},rh),{},{isFileDialogActive:!0});case"closeDialog":return He(He({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return He(He({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return He(He({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return He({},rh);default:return e}}function kx(){}const OC=5*1024*1024,wo={"text/plain":[".txt"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"],"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],"image/svg+xml":[".svg"]},Sx=Object.values(wo).flat();function g6(e){var r;if(e.size>OC)return{isValid:!1,error:`Dosya boyutu 5MB'dan büyük olamaz. Seçilen dosya: ${(e.size/1024/1024).toFixed(2)}MB`};const t=`.${(r=e.name.split(".").pop())==null?void 0:r.toLowerCase()}`;return Object.keys(wo).includes(e.type)||Sx.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Sx.join(", ")}`}}function tu(e){for(const t of e){const n=g6(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function NC({onDrop:e}){const t=n=>{const r=tu(n);if(!r.isValid){alert(r.error);return}e(n)};return f.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:f.jsx(cl,{onDrop:t,accept:Object.keys(wo).reduce((n,r)=>(n[r]=wo[r],n),{}),maxSize:OC,children:({getRootProps:n,getInputProps:r})=>f.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[f.jsx("input",{...r()}),f.jsx("div",{className:"mb-3",children:f.jsx(hF,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),f.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",f.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}NC.Button=({onDrop:e})=>{const t=je(),n=r=>{const i=tu(r);if(!i.isValid){er({description:i.error,variant:"error"});return}e(r)};return f.jsx(cl,{onDrop:n,accept:Object.keys(wo).reduce((r,i)=>(r[i]=wo[i],r),{}),children:({getRootProps:r,getInputProps:i})=>f.jsxs("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-center dz-message needsclick cursor-pointer",...r(),children:[f.jsx("input",{...i()}),f.jsx(gF,{style:{color:t.getColor(k.IconColor)},className:"size-5"})]})})};const Cx=[{name:"Yüzler",icon:"😊",emojis:["😀","😃","😄","😁","😆","😅","🤣","😂","🙂","😊","😇","🥰","😍","🤩","😘","😗","😚","😙","🥲","😋","😛","😜","🤪","😝","🤑","🤗","🤭","🤫","🤔","🫡","🤐","🤨","😐","😑","😶","🫥","😏","😒","🙄","😬","😮‍💨","🤥","😌","😔","😪","🤤","😴","😷","🤒","🤕","🤢","🤮","🥴","😵","🤯","🥳","🥸","😎","🤓","🧐","😕","🫤","😟","🙁","😮","😯","😲","😳","🥺","🥹","😦","😧","😨","😰","😥","😢","😭","😱","😖","😣","😞","😓","😩","😫","🥱","😤","😡","😠"]},{name:"El",icon:"👋",emojis:["👋","🤚","🖐️","✋","🖖","🫱","🫲","🫳","🫴","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","🫵","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🤝","🙏","💪","🦾"]},{name:"Kalp",icon:"❤️",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❤️‍🔥","❤️‍🩹","❣️","💕","💞","💓","💗","💖","💘","💝","💟","♥️","💋","🫂"]},{name:"Hayvan",icon:"🐱",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻‍❄️","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🐤","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🪱","🐛","🦋","🐌","🐞","🐜","🪰","🐢","🐍","🦎","🐙"]},{name:"Yiyecek",icon:"🍕",emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🫐","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🫛","🥦","🥬","🌶️","🫑","🍕","🍔","🍟","🌭","🍿","🧀","🥚","🍳","🥞","🧇","🥓","🍖","🍗","🌮","🌯","🥗","☕","🍵","🧃","🥤","🍺","🍷","🥂","🍰"]},{name:"Aktivite",icon:"⚽",emojis:["⚽","🏀","🏈","⚾","🥎","🎾","🏐","🏉","🥏","🎱","🏓","🏸","🥅","⛳","🎯","🏹","🎣","🤿","🥊","🥋","🎿","⛷️","🏂","🪂","🏋️","🤸","🎮","🕹️","🎲","🧩","🎭","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🎷","🎺"]},{name:"Nesne",icon:"💡",emojis:["⌚","📱","💻","⌨️","🖥️","🖨️","🖱️","💾","💿","📷","📹","🎥","📞","📟","📠","📺","🔋","🔌","💡","🔦","🕯️","🧯","💰","💳","💎","🔧","🔨","🪛","🔩","⚙️","🔑","🗝️","📦","📫","📝","✏️","🖊️","📎","📌","✂️"]}];function DC({onSelect:e,isOpen:t,onClose:n}){const r=je(),[i,s]=v.useState(0),o=v.useRef(null),a=v.useRef(null);return v.useEffect(()=>{if(!t)return;const l=c=>{o.current&&!o.current.contains(c.target)&&n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,n]),v.useEffect(()=>{a.current&&(a.current.scrollTop=0)},[i]),f.jsx(lr,{children:t&&f.jsxs(Pe.div,{ref:o,onMouseDown:l=>l.stopPropagation(),initial:{opacity:0,y:8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.95},transition:{duration:.15},className:"absolute bottom-full left-0 mb-2 z-50 overflow-hidden",style:{width:"280px",backgroundColor:r.getColor(k.Background),border:`1px solid ${r.getColor(k.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(k.ShadowColor)}`},children:[f.jsx("div",{className:"flex items-center gap-0.5 px-1.5 py-1.5 overflow-x-auto",style:{borderBottom:`1px solid ${r.getColor(k.DividerColor)}`},children:Cx.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>s(c),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base transition-colors",style:{backgroundColor:c===i?r.getColor(k.InputBackground):"transparent"},title:l.name,children:l.icon},l.name))}),f.jsx("div",{ref:a,className:"grid grid-cols-8 gap-0.5 p-1.5 overflow-y-auto",style:{maxHeight:"200px"},children:Cx[i].emojis.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>{e(l),n()},className:"w-8 h-8 flex items-center justify-center rounded-md text-lg hover:scale-110 transition-transform",style:{backgroundColor:"transparent"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.getColor(k.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}function v6({onNewMessage:e,client_id:t,is_uploadable:n,messages:r,onEvaluateChat:i,onNewChat:s,onSendMessage:o,isHistoryMode:a=!1,historyChat:l}){const c=v.useRef(null),d=fr(),u=sM(t),p=je(),m=cs(),{setIsInputFocused:y,showActionButtons:x,setShowActionButtons:w}=ie(),[h,g]=v.useState(""),[b,T]=v.useState("3rem"),[_,E]=v.useState(!1),[S,A]=v.useState([]),[B,L]=v.useState(0),[N,ee]=v.useState(!1),[Z,V]=v.useState(0),[O,I]=v.useState(null),[H,C]=v.useState(!1),P=()=>{if(!a||!l||l.status!==qt.Closed||!l.closed_at)return!1;const q=new Date(l.closed_at);return(new Date().getTime()-q.getTime())/(1e3*60*60)>2},F=a&&(l==null?void 0:l.status)===qt.Closed&&P();v.useEffect(()=>{if(r.length>0){const q=r[r.length-1];q.id!==O&&(I(q.id),q.sender_type===ye.User&&(L(0),ee(!1)))}},[r,O]),v.useEffect(()=>{let q;return N&&Z>0&&(q=window.setTimeout(()=>{V(oe=>oe<=1?(ee(!1),L(0),0):oe-1)},1e3)),()=>clearTimeout(q)},[N,Z]),v.useEffect(()=>{const q=c.current;if(q){const oe=()=>y(!0),z=()=>y(!1);return q.addEventListener("focus",oe),q.addEventListener("blur",z),()=>{q.removeEventListener("focus",oe),q.removeEventListener("blur",z)}}},[y]),v.useEffect(()=>{const q=()=>{w(!0)},oe=()=>{w(!1)};return d==null||d.on(ve.ChatUserShowButton,q),d==null||d.on(ve.MessageUserCreate,oe),()=>{d==null||d.off(ve.ChatUserShowButton,q),d==null||d.off(ve.MessageUserCreate,oe)}},[d,w]),v.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&w(!1)},[r,w]),Xc("lc:rate-limit",q=>{const oe=q.detail&&q.detail.seconds||3;ee(!0),V(oe),L(0)}),Xc("paste",q=>{const oe=q.clipboardData.items,z=[];for(const ne of oe){const D=ne.getAsFile();D&&z.push(D)}if(z.length>0&&!n){er({description:m(J.FileUploadDisabled),variant:"error"});return}if(z.length>0){const ne=tu(z);if(!ne.isValid){er({description:ne.error,variant:"error"});return}A([...S,...z])}});const $=async()=>{if(!h.trim()&&(!n||S.length===0))return;if(B>5&&!N){ee(!0),V(3);return}if(N||_)return;const q=h,oe=[...S];g(""),A([]),c.current&&(c.current.style.height="3rem",T("3rem")),E(!0);let z;if(n&&oe.length>0){const[ne,D]=await u.mutateAsync(oe);if(!$n(D)){Lj(ne,D),E(!1),g(q),A(oe);return}oM(ne)&&(z=ne.file_urls)}if(o){o(q,z),E(!1);return}d==null||d.emit(Ve.MessageCreate,{content:q,files:z},ne=>{e(ne),E(!1),L(D=>D+1),w(!1)})},W=q=>{d==null||d.emit(Ve.MessageTyping,{content:q})},Q=()=>{d==null||d.emit(Ve.ChatClose,{}),w(!1),i==null||i()},se=()=>{d==null||d.emit(Ve.ChatClose,{}),w(!1),s==null||s()},he=v.useCallback(q=>{const oe=c.current;if(oe){const z=oe.selectionStart,ne=oe.selectionEnd,D=h.substring(0,z)+q+h.substring(ne);D.length<=2e3&&(g(D),W(D),setTimeout(()=>{oe.selectionStart=oe.selectionEnd=z+q.length,oe.focus()},0))}else{const z=h+q;z.length<=2e3&&(g(z),W(z))}},[h]),ue=a&&(l==null?void 0:l.status)===qt.Closed;return F?null:f.jsxs(f.Fragment,{children:[ue&&f.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[f.jsxs("div",{className:"p-3 rounded-lg flex items-center gap-2",style:{backgroundColor:p.getColor(k.InputBackground),borderColor:p.getColor(k.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(Y.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(k.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(k.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(Rt,{onClick:()=>{s==null||s()},className:"w-full py-3 rounded-lg font-medium flex items-center justify-center gap-2 transition-all",style:{backgroundColor:p.getColor(k.ButtonBackground),color:p.getColor(k.ButtonText),borderRadius:p.getRadius()},children:[f.jsx(Y.Plus,{className:"w-5 h-5"}),f.jsx("span",{children:"Yeni Bir Sohbet Başlat"})]})]}),N&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 rounded-lg z-[100] p-2 flex items-center justify-center",style:{backgroundColor:p.getColor(k.ErrorBackground),borderColor:p.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(Y.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(k.ErrorText)},children:m(J.RateLimitMessage).replace("{seconds}",Z.toString())})]}),x&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex flex-col gap-2",children:[f.jsxs(Rt,{className:"w-full flex items-center justify-center gap-2",size:"md",onClick:Q,children:[f.jsx(Y.Star,{className:"size-4"}),f.jsx("span",{children:"Sohbeti Değerlendir"})]}),f.jsxs(Rt,{size:"md",className:"w-full flex items-center justify-center gap-2",onClick:se,children:[f.jsx(Y.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Oluştur"})]})]}),(!a||a&&(l==null?void 0:l.status)!==qt.Closed&&(l==null?void 0:l.status)!==qt.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:q=>{q.preventDefault(),$()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(k.DividerColor)}}),n&&S&&S.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(gC,{files:S,onDelete:q=>{A(S.filter((oe,z)=>z!==q))}})}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Gu,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:N,style:{height:b,maxHeight:"6rem",opacity:N?.5:1,cursor:N?"not-allowed":"text",boxShadow:"none"},placeholder:N?m(J.RateLimitMessage).replace("{seconds}",Z.toString()):m(J.MessagePlaceholder),value:h,maxLength:2e3,onChange:q=>{if(N)return;const oe=q.target.value;if(oe.length<=2e3&&(g(oe),W(oe)),oe.length>0&&q.currentTarget.scrollHeight>q.currentTarget.clientHeight){const z=`${q.currentTarget.scrollHeight}px`;q.currentTarget.style.height=z,T(z)}else q.currentTarget.style.height="3rem",T("3rem")},onKeyDown:q=>{if(N){q.preventDefault();return}q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),$())}}),h.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:h.length>=2e3?p.getColor(k.ErrorText):p.getColor(k.FooterText),fontWeight:h.length>=2e3?"600":"normal"},children:2e3-h.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Pe.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",disabled:_||!h.trim()&&S.length===0||N,style:{opacity:1,color:h.trim()||S.length>0?p.getColor(k.ButtonBackground):p.getColor(k.FooterText)},children:_?f.jsx(Y.Spin,{className:"size-4 animate-spin"}):N?f.jsx("span",{className:"text-[10px] font-bold",children:Z}):f.jsx(Y.PaperAirplane,{className:"size-5 -rotate-12"})})})})]}),f.jsx(DC,{isOpen:H,onClose:()=>C(!1),onSelect:he}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",onClick:()=>C(!H),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(k.IconColor)},children:f.jsx(Y.Emoji,{className:"size-5"})}),n&&f.jsx(NC.Button,{onDrop:q=>{if(q.length){const oe=tu(q);if(!oe.isValid){er({description:oe.error,variant:"error"});return}A([...S,...q])}}})]}),f.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] flex items-center gap-1 transition-opacity hover:opacity-80",style:{color:p.getColor(k.FooterText)},children:[f.jsx("span",{children:m(J.PoweredBy)}),f.jsx("span",{className:"font-semibold",children:"Chatier"})]})]})]})]})}const _x=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function ih({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=v.useMemo(()=>{const o=e.charCodeAt(0)||0,a=_x[o%_x.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(Pe.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center",children:[f.jsx("div",{className:"min-w-max",children:f.jsxs("span",{children:[t&&f.jsx("img",{className:"size-10 rounded-full border border-white/20 shadow-sm",src:t,"aria-label":e}),!t&&f.jsx("div",{className:"size-10 rounded-full flex items-center justify-center font-semibold text-white shadow-sm",style:{background:s},children:e.charAt(0).toUpperCase()})]})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:ze("line-clamp-1 font-medium",n),style:r?{color:r}:void 0,children:e}),i&&f.jsx("span",{className:"text-xs opacity-75 line-clamp-1",style:r?{color:r}:void 0,children:i})]})]})}function y6({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s,onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c=!1,spamWarningMessage:d,onDismissSpamWarning:u}){const{widget:p,setOpen:m,open:y,isHaveChat:x,isInputFocused:w}=ie(),h=ie(Z=>Z.historyChat),g=je(),b=Ro(),T=Ku(),_=fr(),E=gs(),S=v.useRef(new Set),A=v.useRef(!1),B=()=>{m(!1)},L=v.useCallback(()=>{if(!_||!y||!x||!Array.isArray(r))return;const Z=r.filter(V=>V.sender_type===ye.User&&!S.current.has(V.id)).map(V=>V.id);Z.length!==0&&_.emit(Ve.MessageRead,{message_ids:Z},V=>{if(V&&V.success===!0)for(const O of Z)S.current.add(O)})},[_,r,y,x]);v.useEffect(()=>{y&&(A.current=!0),y&&x&&(w||A.current)&&(L(),A.current=!1)},[y,x,w,L]);const N=()=>{var V,O,I,H;return((H=(I=(O=(V=p==null?void 0:p.appearance)==null?void 0:V.head)==null?void 0:O.elements)==null?void 0:I.find(C=>C.type==="title"))==null?void 0:H.content)||"Müşteri Hizmetleri"},ee=()=>{var O,I,H,C,P,F;if(c&&h)return"Geçmiş sohbet";if(e!=null&&e.agent_name)return e.agent_name;const Z=(I=(O=p==null?void 0:p.appearance)==null?void 0:O.design)==null?void 0:I.greeting_header;return Z||((F=(P=(C=(H=p==null?void 0:p.appearance)==null?void 0:H.head)==null?void 0:C.elements)==null?void 0:P.find($=>$.type==="text"))==null?void 0:F.content)||"Bizimle Sohbet Edin"};return f.jsxs(f.Fragment,{children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:g.getColor(k.HeaderBackground),color:g.getColor(k.HeaderText),borderColor:g.getColor(k.HeaderBorder),...b?{}:{borderTopLeftRadius:g.getRadius(),borderTopRightRadius:g.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&f.jsx("button",{type:"button",onClick:()=>{ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!0),E.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(Y.ArrowLeft,{className:"w-5 h-5"})}),(()=>{if(c&&(h!=null&&h.who_joined_details)&&h.who_joined_details.length>0){const Z=h.who_joined_details[0];return f.jsx(ih,{name:Z.name,avatar:Z.avatar||void 0,textColor:g.getColor(k.HeaderText)})}return!c&&(e!=null&&e.agent_name)?f.jsx(ih,{name:e.agent_name,avatar:e.agent_avatar,textColor:g.getColor(k.HeaderText)}):f.jsx("div",{className:"flex-1 min-w-0",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"font-medium truncate",children:N()}),f.jsx("div",{className:"text-sm opacity-90 truncate",children:ee()})]}):f.jsx("div",{className:"font-medium truncate",children:ee()})})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==qt.Closed)&&f.jsx(iF,{onChatClose:s}),T&&f.jsx("button",{type:"button",onClick:B,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(Y.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(vC,{messages:r,isTyping:t||n.length>0,chat:e}),f.jsx(lr,{children:d&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:g.getColor(k.ErrorBackground),borderColor:g.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:g.getRadius()},children:[f.jsx(Y.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:g.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:g.getColor(k.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:g.getColor(k.ErrorText)},children:f.jsx(Y.X,{className:"size-4"})})]})}),f.jsx(v6,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:Z=>{i(Z)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?ie.getState().historyChat:void 0})]})}function x6({rating:e,onChange:t}){const n=je();return f.jsx("div",{className:"flex items-center justify-center gap-0.5 my-2",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return f.jsxs(Pe.div,{className:"relative w-8 h-8 cursor-pointer",whileHover:{scale:1.15},whileTap:{scale:.95},transition:{duration:.15},children:[f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarInactiveColor),fill:n.getColor(k.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),s&&f.jsx("div",{className:"absolute top-0 left-0 w-4 h-8 overflow-hidden",children:f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),i&&f.jsx("svg",{className:"w-8 h-8 absolute top-0 left-0",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),f.jsxs("div",{className:"absolute inset-0 flex",children:[f.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),f.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function w6({onOk:e}){const t=je(),n=cs(),r=Ku(),[i,s]=v.useState(0),[o,a]=v.useState(!1),[l,c]=v.useState(10),d=iM(),[u,p]=v.useState(!1);v.useEffect(()=>{if(o){const w=setInterval(()=>{c(h=>h<=1?(clearInterval(w),e(!0),0):h-1)},1e3);return()=>clearInterval(w)}},[o]);const m=Km({comment:Qc()}),y=QS({init:{comment:""},schema:m,action:async w=>{const[h,g]=await d.mutateAsync({rating:i,comment:w.comment});if($n(g)){a(!0);return}ho(h,{form:y})}}),x=()=>{e(!0)};return f.jsxs(Pe.div,{className:"flex flex-col h-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[f.jsxs("header",{className:"min-h-[48px] flex-shrink-0 overflow-visible flex justify-between items-center z-10 px-4 py-2.5 border-b",style:{borderColor:t.getColor(k.HeaderBorder),color:t.getColor(k.HeaderText)},children:[f.jsx("div",{className:"font-medium text-xs",children:n(o?J.RatingHeaderThanks:J.RatingHeaderEvaluate)}),r&&f.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1.5 rounded-md hover:opacity-70 transition-opacity",style:{color:t.getColor(k.HeaderText)},children:f.jsx(Y.X,{className:"size-4"})})]}),f.jsx("div",{className:"flex-1 p-4 overflow-y-auto flex flex-col",children:o?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[f.jsx("div",{className:"mb-3",style:{color:t.getColor(k.SuccessText)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),f.jsx("h2",{className:"text-lg font-semibold mb-1.5",style:{color:t.getColor(k.HeaderText)},children:n(J.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(k.FooterText)},children:n(J.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(k.FooterText)},children:n(J.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(Rt,{onClick:x,size:"md",className:"w-full max-w-xs",children:n(J.RatingNewConversation)})]}):f.jsxs("div",{className:"flex flex-col",children:[f.jsx("div",{className:"text-center mb-4",children:f.jsx("p",{className:"text-sm",style:{color:t.getColor(k.FooterText)},children:n(J.RatingDescription)})}),f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-center font-medium mb-1.5 text-base",style:{color:t.getColor(k.RatingRateConversationText)},children:n(J.RatingRateConversation)}),f.jsx(x6,{rating:i,onChange:w=>{s(w),w>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.FooterText)},children:n(J.RatingYourScore).replace("{score}",Number.isInteger(i)?i.toString():i.toFixed(1))}),i>0&&i<1||u?f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.ErrorText)},children:n(J.RatingMinimumError)}):null]}),f.jsxs("form",{onSubmit:y.handleSubmit,className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"comment",className:"block text-xs font-medium mb-1",style:{color:t.getColor(k.InputText)},children:n(J.RatingComment)}),f.jsx(Gu,{id:"comment",onChange:y.handleChange,onBlur:y.handleBlur,value:y.values.comment,placeholder:n(J.RatingCommentPlaceholder),className:"rounded-lg",error:y.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(Rt,{type:"submit",size:"md",onClick:w=>{i<1&&(w.preventDefault(),w.stopPropagation(),p(!0))},className:"w-full",children:n(J.RatingSubmit)}),f.jsx(Rt,{onClick:x,size:"md",variant:"secondary",kind:"subtle",className:"w-full",bgKey:k.GreeterBackground,textKey:k.GreeterText,children:n(J.RatingNewConversation)})]})]})]})}),f.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:"py-1.5 px-3 text-xs text-center flex items-center justify-center gap-1 transition-colors",style:{color:t.getColor(k.FooterText),borderTop:`1px solid ${t.getColor(k.FooterBorder)}`,backgroundColor:t.getColor(k.FooterBackground)},children:[f.jsx("span",{children:n(J.PoweredBy)}),f.jsx("span",{className:"font-medium",children:"Chatier"})]})]})}function b6({onSendMessage:e,disabled:t}){const n=v.useRef(null),r=je(),i=cs(),{setIsInputFocused:s}=ie(),[o,a]=v.useState(""),[l,c]=v.useState("3rem"),[d,u]=v.useState(!1),p=v.useRef(t);v.useEffect(()=>{p.current&&!t&&setTimeout(()=>{var x;(x=n.current)==null||x.focus()},100),p.current=t},[t]);const m=()=>{if(!o.trim()||t)return;const x=o;a(""),n.current&&(n.current.style.height="3rem",c("3rem")),e(x)},y=v.useCallback(x=>{const w=n.current;if(w){const h=w.selectionStart,g=w.selectionEnd,b=o.substring(0,h)+x+o.substring(g);b.length<=2e3&&(a(b),setTimeout(()=>{w.selectionStart=w.selectionEnd=h+x.length,w.focus()},0))}else{const h=o+x;h.length<=2e3&&a(h)}},[o]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:x=>{x.preventDefault(),m()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:r.getColor(k.DividerColor)}}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Gu,{id:"ai-message",inputRef:n,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:t,style:{height:l,maxHeight:"6rem",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},placeholder:i(J.MessagePlaceholder),value:o,maxLength:2e3,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:x=>{if(t)return;const w=x.target.value;if(w.length<=2e3&&a(w),w.length>0&&x.currentTarget.scrollHeight>x.currentTarget.clientHeight){const h=`${x.currentTarget.scrollHeight}px`;x.currentTarget.style.height=h,c(h)}else x.currentTarget.style.height="3rem",c("3rem")},onKeyDown:x=>{if(t){x.preventDefault();return}x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),m())}}),o.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:o.length>=2e3?r.getColor(k.ErrorText):r.getColor(k.FooterText),fontWeight:o.length>=2e3?"600":"normal"},children:2e3-o.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Pe.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",withoutTheming:!0,disabled:t||!o.trim(),style:{opacity:1,backgroundColor:"transparent",color:o.trim()?r.getColor(k.ButtonBackground):r.getColor(k.FooterText)},children:t?f.jsx(Y.Spin,{className:"size-4 animate-spin"}):f.jsx(Y.PaperAirplane,{className:"size-5 -rotate-12"})})})})]}),f.jsx(DC,{isOpen:d,onClose:()=>u(!1),onSelect:y}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-1",children:f.jsx("button",{type:"button",onClick:()=>u(!d),className:"p-1.5 rounded-md transition-colors",style:{color:r.getColor(k.IconColor)},children:f.jsx(Y.Emoji,{className:"size-5"})})}),f.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] flex items-center gap-1 transition-opacity hover:opacity-80",style:{color:r.getColor(k.FooterText)},children:[f.jsx("span",{children:i(J.PoweredBy)}),f.jsx("span",{className:"font-semibold",children:"Chatier"})]})]})]})}const rf=[Ne.Light,Ne.Dark,Ne.System];function k6(e){switch(e){case Ne.Light:return Y.Sun;case Ne.Dark:return Y.Moon;case Ne.System:return Y.Monitor;default:return Y.Monitor}}function S6({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>hC()),a=v.useRef(null),l=v.useRef(null),c=je(),d=cs(),{mode:u,setMode:p}=c,m=()=>e(),y=()=>{const h=rf.indexOf(u),g=rf[(h+1)%rf.length];p(g)},x=()=>{const h=!s;mC(h),o(h)};v.useEffect(()=>{if(!r)return;const h=g=>{var b,T;(b=l.current)!=null&&b.contains(g.target)||(T=a.current)!=null&&T.contains(g.target)||i(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]);const w=r&&f.jsxs(Pe.div,{ref:l,onMouseDown:h=>h.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(Y.XCircle,{className:"size-4 flex-shrink-0"}),d(J.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:x,children:[s?f.jsx(Y.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(Y.Volume2,{className:"size-4 flex-shrink-0"}),d(s?J.NotificationSoundOn:J.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:y,children:[(()=>{const h=k6(u);return f.jsx(h,{className:"size-4 flex-shrink-0"})})(),u===Ne.Light?"Açık tema":u===Ne.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(lr,{children:t&&f.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:f.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:d(J.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:d(J.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(J.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:m,children:d(J.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(h=>!h),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:d(J.ChatSettings),"aria-expanded":r,children:f.jsx(Y.Menu,{className:"size-5"})}),f.jsx(lr,{children:w})]})]})}function C6({onOperatorConnected:e,onChatClose:t}){var se,he,ue;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:c,humanNeedRequested:d,setHumanNeedRequested:u,setIsAIAgentMode:p}=ie(),m=je(),y=Ro(),x=Ku(),w=fr(),h=gs(),[g,b]=v.useState(!1),[T,_]=v.useState(!1),[E,S]=v.useState(!1),[A,B]=v.useState(""),[L,N]=v.useState(!1),[ee,Z]=v.useState(0),[V,O]=v.useState(null),I=()=>{r(!1)},H=()=>{u(!1),t()},C=(((ue=(he=(se=n==null?void 0:n.appearance)==null?void 0:se.body)==null?void 0:he.inputs)==null?void 0:ue.length)||0)>0,P=v.useRef(!1),F=v.useRef(!1);v.useEffect(()=>{if(!i||P.current)return;if(s.length>0){P.current=!0;return}if(!w||!w.connected){const z=setInterval(()=>{w&&w.connected&&(clearInterval(z),q())},100),ne=setTimeout(()=>{clearInterval(z),P.current||oe()},3e3);return()=>{clearInterval(z),clearTimeout(ne)}}q();function q(){P.current||!w||(P.current=!0,w.emit(Ve.MessageList,{},z=>{Array.isArray(z)&&z.length>0?a(z):oe()}))}function oe(){if(!i)return;const z={id:Np(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:ye.User};o(z)}},[w,i,s.length,a,o]),v.useEffect(()=>{if(ee>0){const q=requestAnimationFrame(()=>Z(0));return()=>cancelAnimationFrame(q)}},[ee]),v.useEffect(()=>{if(!w)return;const q=({token:D})=>{B(te=>te+D)},oe=D=>{D!=null&&D.human_need&&u(!0)},z=D=>{D.repeat_count===3&&O(D.message)},ne=()=>{t()};return w.on(ve.AgentMessageChunk,q),w.on(ve.AgentMessageFinalMetadata,oe),w.on(ve.AgentSpamWarning,z),w.on(ve.AgentSpamBanned,ne),()=>{w.off(ve.AgentMessageChunk,q),w.off(ve.AgentMessageFinalMetadata,oe),w.off(ve.AgentSpamWarning,z),w.off(ve.AgentSpamBanned,ne)}},[w,u,t]);const $=v.useCallback(q=>{if(!n||!i||!w||T||F.current)return;F.current=!0;const oe=`temp-${Date.now()}`,z={id:oe,content:q,created_at:new Date,files:[],sender_type:ye.Customer};o(z),B(""),N(!0),b(!0),_(!0);const ne=l||mi(n.link_id);w.emit(Ve.AgentMessageCreate,{question:q,agent_id:i.id,session_id:ne},D=>{if(F.current=!1,N(!1),B(""),b(!1),_(!1),!D){const te={id:Np(),content:"Üzgünüm, bir hata oluştu. Lütfen tekrar deneyin veya canlı destek personelimıze bağlanın.",created_at:new Date,files:[],sender_type:ye.System};a(de=>de.filter(Ce=>Ce.id!==oe).concat([te])),u(!0);return}D.session_id&&c(D.session_id),o(D.agent_message),D.human_need&&u(!0)})},[n,i,T,w,l,o,a,c,u]),W=v.useCallback(q=>{if(!w||E)return;S(!0);const oe=()=>{w.emit(Ve.AgentRequestHuman,{},z=>{S(!1),z!=null&&z.success?(ie.getState().setIsHaveChat(!0),p(!1),u(!1),ie.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};q&&Object.keys(q).length>0?w.emit(Ve.ChatUpdateInputs,{inputs:q},z=>{z!=null&&z.success?oe():(console.error("Failed to update chat inputs"),S(!1))}):oe()},[w,E,p,u,e]),Q=()=>{C?h.push("registration"):W()};return i?f.jsxs(f.Fragment,{children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:m.getColor(k.HeaderBackground),color:m.getColor(k.HeaderText),borderColor:m.getColor(k.HeaderBorder),...y?{}:{borderTopLeftRadius:m.getRadius(),borderTopRightRadius:m.getRadius()}},children:[f.jsx("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:f.jsx(ih,{name:i.name,avatar:i.avatar,textColor:m.getColor(k.HeaderText),subtitle:"AI Asistan"})}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(S6,{onChatClose:H}),x&&f.jsx("button",{type:"button",onClick:I,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(Y.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(vC,{messages:s,isTyping:g,streamingContent:L?A:void 0,skipAnimationForLastN:ee}),f.jsx(lr,{children:V&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:m.getColor(k.ErrorBackground),borderColor:m.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:m.getRadius()},children:[f.jsx(Y.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:m.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:m.getColor(k.ErrorText)},children:V}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>O(null),style:{color:m.getColor(k.ErrorText)},children:f.jsx(Y.X,{className:"size-4"})})]})}),f.jsx(lr,{children:d&&f.jsx(Pe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},className:"px-4 py-3",style:{backgroundColor:m.getColor(k.Background)},children:f.jsx(Pe.div,{className:"relative w-full overflow-hidden",style:{borderRadius:m.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(Rt,{onClick:Q,disabled:E,size:"lg",className:"w-full flex items-center justify-center gap-2",children:E?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(Y.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})})}),f.jsx(b6,{onSendMessage:$,disabled:T})]}):null}function _6({children:e}){const{widget:t}=ie();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function T6({children:e}){const t=fr(),n=gs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=ie(),[o,a]=v.useState(!0),[l,c]=v.useState(!1),d=v.useRef(!1);return v.useEffect(()=>{if(r){a(!1);return}if(!t){a(!1);return}const u=()=>{a(!1),c(!1),d.current=!0},p=()=>{i&&s||(c(!0),n.push("registration"))};return t.on(ve.Connect,u),t.on(ve.Disconnect,p),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(ve.Connect,u),t.off(ve.Disconnect,p)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),f.jsx(Zp,{})):d.current&&!t.connected?f.jsx(Zp,{}):o||!t.connected?f.jsx(pC,{}):e}function E6(){const{widget:e,setOpen:t,setIsHaveChat:n,historyChat:r,setHistoryChat:i,historyMessages:s,setHistoryMessages:o,aiAgent:a,isAIAgentMode:l,clearAIAgentState:c}=ie(),d=je(),u=fr(),{connected:p,connectionReady:m}=u,y=ol(),x=gs(),w=Ro(),[h,g]=v.useState(null),[b,T]=v.useState([]),[_,E]=v.useState(!1),[S,A]=v.useState([]),[B,L]=v.useState([]),[N,ee]=v.useState(!1),Z=Hm(),V=v.useRef(!1),O=v.useRef(null),I=v.useRef(!1),[H,C]=v.useState(!1),[P,F]=v.useState(null);v.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:p,connectionReady:m,hasChat:!!h,chatViewEmitted:V.current})},[p,m,h]),v.useEffect(()=>{if(h||r||l){C(!1);return}const D=setTimeout(()=>{!h&&!r&&!l&&(console.warn("WS: Connection timeout reached in ChatDetailView"),C(!0))},1e4);return()=>clearTimeout(D)},[h,r,l]),v.useEffect(()=>{if(!r||!e)return;if(g({status:r.status,is_customer_uploadable:!1}),s){T(s);return}const D=mi(e.link_id);cM(r._id,e.link_id,D).then(([te,de])=>{if($n(de)&&Array.isArray(te)){const Ce=te.map(ge=>({id:ge._id,content:ge.content,created_at:ge.created_at,files:ge.files,sender_type:ge.sender_type,activity_type:ge.activity_type,answers:ge.answers,reply_id:ge.reply_id,buttons:ge.buttons}));T(Ce),o(Ce)}}).catch(te=>{console.error("Failed to load history messages",te)})},[r,e,s,o]),v.useEffect(()=>{if(!e||l||r)return;const D=gr(e.link_id);D.isAgentMode&&D.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),ie.getState().setAIAgent(D.agent),ie.getState().setIsAIAgentMode(!0),D.sessionId&&ie.getState().setAIAgentSessionId(D.sessionId),D.humanNeedRequested&&ie.getState().setHumanNeedRequested(!0))},[e,l,r]);const $=async(D,te)=>{var Bt;if(!e)return;if(!r){const re=`temp-${Date.now()}`,be={id:re,content:D,created_at:new Date,files:te||[],sender_type:ye.Customer,answers:[],reply_id:void 0,buttons:[]};T(Je=>[...Je,be]),u==null||u.emit(Ve.MessageCreate,{content:D,files:te},Je=>{const R=Array.isArray(Je)?Je[0]:Je;if(R&&R.isError){T(M=>M.filter(U=>U.id!==re));const K=(R==null?void 0:R.error)||(R==null?void 0:R.message);(!K||!/too\s+many/i.test(K))&&ho(R),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}T(K=>K.map(M=>M.id===re?R:M))});return}const de={},Ce=e.appearance;if((Bt=Ce==null?void 0:Ce.body)!=null&&Bt.inputs){for(const re of Ce.body.inputs)if(re.required||re.remember){const be=ha(re.name);be&&(de[re.name]=be)}}const ge=ie.getState().defaultValues;if(ge){ge.username&&(de.username=ge.username),ge.secret_data&&(de.secret_data=ge.secret_data);for(const re in ge)de[re]||(de[re]=ge[re])}const[Ze,ot]=await Z.mutateAsync({inputs:de,history:[],client_id:e.client_id,widget_id:e.link_id,device_id:mi(e.link_id)});if($n(ot)){i(null),n(!0),Ze&&typeof Ze=="object"&&"customer_token"in Ze&&(Ln(rt.CustomerToken,Ze.customer_token,e.link_id),Ln(rt.CustomerRefreshToken,Ze.customer_refresh_token,e.link_id));let re=0;const be=20,Je=`temp-${Date.now()}`,R={id:Je,content:D,created_at:new Date,files:te||[],sender_type:ye.Customer,answers:[],reply_id:void 0,buttons:[]};T(M=>[...M,R]);const K=setInterval(()=>{re+=1,u!=null&&u.connected?(u.emit(Ve.MessageCreate,{content:D,files:te},M=>{const U=Array.isArray(M)?M[0]:M;if(U&&U.isError){T(fe=>fe.filter(ke=>ke.id!==Je));const ae=(U==null?void 0:U.error)||(U==null?void 0:U.message);(!ae||!/too\s+many/i.test(ae))&&ho(U),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}T(ae=>ae.map(fe=>fe.id===Je?U:fe))}),clearInterval(K)):re>=be&&clearInterval(K)},200)}},W=D=>{!D&&!w&&t(!1),ee(!0),da((e==null?void 0:e.link_id)||""),n(!1),g(null),T([]),A([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),c(),sc(e.client_id,Yi(y)).then(()=>{u==null||u.disconnect(),x.push("registration")})},Q=()=>{h?(localStorage.setItem("showActionButtons","false"),g({...h,status:qt.Closed})):W(!1)};v.useEffect(()=>{if(u&&!(l&&a)){if(r){V.current=!1,I.current=!1;return}if(!p||!m){p||(I.current=!1,V.current=!1,O.current=null);return}I.current=!0,!(!e||V.current)&&(V.current=!0,console.log("ChatView: Emitting chat:view request"),u.emit(Ve.ChatView,{},D=>{if(console.log("ChatView: Received response",{chatReceived:D!==null,chatStatus:D==null?void 0:D.status,hasAgentName:!!(D!=null&&D.agent_name),hasError:D&&"error"in D}),ie.getState().historyChat){V.current=!1;return}if(D===null||D&&"error"in D||!(D!=null&&D.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:D}),t(!1),n(!1),sc(e.client_id,Yi(y)),T([]),A([]),i(null),ie.getState().setHistoryMessages(null),c(),da((e==null?void 0:e.link_id)||""),u.disconnect(),x.push("registration"),V.current=!1;return}console.log("ChatView: Setting chat state",{status:D.status}),g(D),n(!0)}))}},[r,u,e,p,m,y,x,t,n,i,l,a,c]);const se=()=>{Q()},he=()=>{W(!0)},[ue,q]=v.useState(!1),oe=v.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),V.current=!1,O.current=null,I.current=!1;const D=ie.getState().aiAgentMessages;D.length>0&&T(D),q(!0)},[]);v.useEffect(()=>{if(ue){if(!u||!p||!m){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:p,connectionReady:m});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),V.current){q(!1);return}V.current=!0,u.emit(Ve.ChatView,{},D=>{console.log("handleOperatorConnected: ChatView result",D),D&&!("error"in D)&&D.status?(g(D),n(!0),u.emit(Ve.MessageList,{},de=>{console.log("handleOperatorConnected: MessageList result",de),Array.isArray(de)&&T(de)})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",D),n(!1)),q(!1)})}},[ue,u,p,m,n]);const z=()=>{c(),w||t(!1),ee(!0),da((e==null?void 0:e.link_id)||""),n(!1),g(null),T([]),A([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),sc(e.client_id,Yi(y)).then(()=>{u==null||u.disconnect(),x.push("registration")})},ne=v.useCallback(D=>{h&&![qt.Closed,qt.Deleted].includes(h.status)&&T(te=>{const de=te.filter(ge=>{var Ze;return!((Ze=ge.id)!=null&&Ze.startsWith("temp-")&&ge.content===D.content)});return de.some(ge=>ge.id===D.id)?de:[...de,D]})},[h]);return v.useEffect(()=>{if(!u)return;const D=re=>{const be={content:re.content,created_at:re.created_at,files:re.files,id:re._id,sender_type:re.sender_type,answers:re.answers,reply_id:re.reply_id,buttons:re.buttons};if(S.length>0){A(Je=>[...Je,be]);return}re.is_shortcut?A([be]):ne(be),E(!1)},te=re=>{const be={content:re.content,created_at:re.created_at,files:re.files,id:re._id,sender_type:re.sender_type,activity_type:re.activity_type,answers:re.answers,reply_id:re.reply_id,buttons:re.buttons};ne(be)},de=re=>{!re||!re.name?g(be=>be?{...be,agent_name:void 0,agent_avatar:void 0}:null):((!(h!=null&&h.agent_name)||!(h!=null&&h.agent_avatar)||h.agent_name===re.name)&&g({...h,agent_name:re.name,agent_avatar:re.avatar,is_customer_uploadable:(h==null?void 0:h.is_customer_uploadable)??!1,status:(h==null?void 0:h.status)??qt.Open}),L(be=>be.includes(re.name)?be:[...be,re.name]))},Ce=()=>{E(!0)},ge=()=>{Q()},Ze=({is_customer_uploadable:re})=>{g(h?{...h,is_customer_uploadable:re}:null)},ot=re=>{if(L(be=>be.filter(Je=>Je!==re.name)),!re.hasOtherAdmins)g(h?{...h,agent_name:void 0,agent_avatar:void 0}:null);else{const be=B.filter(Je=>Je!==re.name);be.length>0&&g(h?{...h,agent_name:be[0],agent_avatar:void 0}:null)}},Bt=re=>{L(be=>be.includes(re.name)?be:[...be,re.name]),h!=null&&h.agent_name||g(h?{...h,agent_name:re.name,agent_avatar:void 0}:null)};return u.on(ve.MessageAgentCreate,D),u.on(ve.MessageUserCreate,te),u.on(ve.MessageCustomerCreate,te),u.on(ve.ChatUserAssignee,de),u.on(ve.MessageAgentTyping,Ce),u.on(ve.ChatUserClose,ge),u.on(ve.ChatToggleUpload,Ze),u.on(ve.ChatUserLeave,ot),u.on(ve.ChatUserJoin,Bt),()=>{u.off(ve.MessageAgentCreate,D),u.off(ve.MessageUserCreate,te),u.off(ve.MessageCustomerCreate,te),u.off(ve.ChatUserAssignee,de),u.off(ve.MessageAgentTyping,Ce),u.off(ve.ChatUserClose,ge),u.off(ve.ChatToggleUpload,Ze),u.off(ve.ChatUserLeave,ot),u.off(ve.ChatUserJoin,Bt)}},[ne,B]),v.useEffect(()=>{if(!u)return;const D=de=>{de.repeat_count===3&&F(de.message)},te=()=>{u.emit(Ve.ChatClose,{}),ie.getState().setShowActionButtons(!1),Q()};return u.on(ve.AgentSpamWarning,D),u.on(ve.AgentSpamBanned,te),()=>{u.off(ve.AgentSpamWarning,D),u.off(ve.AgentSpamBanned,te)}},[u,Q]),v.useEffect(()=>{if(!u||!h||r){O.current=null;return}const D=`${h.status}-${h.agent_name||"no-agent"}`;O.current!==D&&(O.current=D,u.emit(Ve.MessageList,{},te=>{if(!Array.isArray(te)){console.warn("MessageList response is not an array:",te),O.current=null;return}T(te);const de=new Map;for(const ge of te)ge.sender_type===ye.Activity&&(ge.activity_type===mn.AdminJoin&&ge.sender_name?de.set(ge.sender_name,!0):ge.activity_type===mn.AdminLeave&&ge.sender_name&&de.set(ge.sender_name,!1));const Ce=Array.from(de.entries()).filter(([ge,Ze])=>Ze).map(([ge])=>ge);L(Ce)}))},[u,h,r]),v.useEffect(()=>{const D=setTimeout(()=>{E(!1)},2e3);return()=>clearTimeout(D)},[_]),v.useEffect(()=>{if(!e||S.length===0)return;let D=0;e.writing_timeout&&(D=[...S[0].content].length/e.writing_timeout,D<0&&(D=0));const te=setTimeout(()=>{ne(S[0]),A(S.slice(1))},D*1e3);return()=>clearTimeout(te)},[S,e]),N?f.jsx(Zp,{}):l&&a&&!r?f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${w?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:w?"100%":"",minHeight:w?"var(--app-height, 100dvh)":"",maxHeight:w?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(k.Background)},children:f.jsx(C6,{onOperatorConnected:oe,onChatClose:z})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${w?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:w?"100%":"",minHeight:w?"var(--app-height, 100dvh)":"",maxHeight:w?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(k.Background)},children:h?h.status===qt.Closed&&!r?f.jsx(w6,{onOk:W}):f.jsx(y6,{chat:h,isTyping:_,messages:b,shortcutMessages:S,onNewMessage:ne,onChatClose:Q,onEvaluateChat:se,onNewChat:he,onSendMessage:$,isHistoryMode:!!r,spamWarningMessage:P,onDismissSpamWarning:()=>F(null)}):H?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[f.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:d.getColor(k.InputBorder)},children:f.jsx(Y.XCircle,{className:"w-6 h-6 opacity-50"})}),f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Bağlantı Kurulamadı"}),f.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Sunucuyla bağlantı sağlanırken bir sorun oluştu. Lütfen tekrar deneyin."}),f.jsx("button",{type:"button",onClick:()=>W(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:d.getColor(k.ButtonBackground),color:d.getColor(k.ButtonText),borderRadius:d.getRadius()},children:"Tekrar Dene"})]}):f.jsx(pC,{})})]})}function j6(){return WL(),null}function A6(){return f.jsxs(T6,{children:[f.jsx(_6,{children:f.jsx(E6,{})}),f.jsx(j6,{})]})}const R6=[{path:"/chat",component:A6,name:"chat"}],IC=[...R6],LC=[...QL],P6=[...IC,...LC];function sh({text:e}){var c,d,u,p;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=ie(),o=je(),a=cs(),l=()=>{i(!1),s&&s()};return r?f.jsxs(Pe.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:ze("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(k.TooltipBackground),color:o.getColor(k.TooltipText)},children:[f.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(J.CloseButtonAria),children:f.jsx(Y.X,{className:"size-3"})}),f.jsx(Pe.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(k.TooltipText)},children:e||(n?(d=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:d.tooltip_message_active:(p=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:p.tooltip_message)||a(n?J.TooltipActive:J.TooltipDefault)}),f.jsx("div",{className:"absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5",style:{backgroundColor:o.getColor(k.TooltipBackground)}})]},"widget-tooltip"):null}function Tx({fallback:e,fallbackOpen:t}){const[n]=v.useState(window.document.title),r=fr(),{isHaveChat:i,open:s,soundPath:o}=ie(),[a,l]=v.useState(!0),[c,d]=v.useState(0),[u,p]=v.useState(null),m=cs(),y=()=>{nF(o)},x=(w,h)=>{if(u&&clearInterval(u),w||!i||h===0||Number.isNaN(h)){window.document.title=n,p(null);return}const g=setInterval(()=>{if(w||!i||h===0||Number.isNaN(h)){window.document.title=n,clearInterval(g),p(null);return}const b=`${h} ${m(J.NewMessagesNotification)} - ${n}`;window.document.title!==b?window.document.title=b:window.document.title=n},1e3);return p(g),()=>{clearInterval(g),p(null)}};return v.useEffect(()=>x(s&&a,c),[c,s,a]),v.useEffect(()=>{const w=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",w,!1),()=>{document.removeEventListener("visibilitychange",w)}},[]),v.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const w=()=>{!i||s&&a||(d(h=>h+1),y())};return r.on(ve.MessageAgentCreate,w),r.on(ve.ChatUserAssignee,y),()=>{r.off(ve.MessageAgentCreate,w),r.off(ve.ChatUserAssignee,y)}},[r,i,s,a]),s?null:i&&c>0?f.jsx(sh,{text:m(J.NewMessagesNotification)}):!i&&t?e:null}function M6({children:e,border:t}){var H,C,P,F;const n=fr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d}=ie(),[u]=v.useState(!0),p=gs(),m=ol(),y=lm(),x=je(),{resolvedMode:w}=x,h=Ro(),g=UL(),[b,T]=v.useState({x:0,y:0}),_=gP(),E=v.useRef(null),S=v.useRef(null),[A,B]=v.useState(!1),[L,N]=v.useState(!1);v.useEffect(()=>((()=>{B("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{B(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{B(!0)})}),[]),v.useEffect(()=>{o&&y.pathname==="/"&&m&&m.accessToken&&!d&&p.push("chat")},[o,y.pathname,m,p,d]),v.useEffect(()=>{r?requestAnimationFrame(()=>{N(!0)}):N(!1)},[r]);const ee=$=>{if(!E.current||!S.current)return $;const W=E.current.getBoundingClientRect(),Q={width:window.innerWidth,height:window.innerHeight},se={top:20,right:20,bottom:40,left:20};let he=$.x,ue=$.y;return W.right+he-b.x>Q.width-se.right&&(he=Q.width-se.right-W.width-(W.left-b.x)),W.left+he-b.x<se.left&&(he=se.left-(W.left-b.x)),W.bottom+ue-b.y>Q.height-se.bottom&&(ue=Q.height-se.bottom-W.height-(W.top-b.y)),W.top+ue-b.y<se.top&&(ue=se.top-(W.top-b.y)),{x:he,y:ue}},Z=()=>{i(!0),n&&(n.emit(Ve.WidgetOpen,{}),l&&l())},V=()=>{i(!1),n&&(n.emit(Ve.WidgetClose,{}),c&&c())},O=()=>{i(!1),s(!1),sc(a.client_id,Yi(m)),p.push("registration")};v.useEffect(()=>{if(h&&(o||g)&&Z(),!(!n||!a))return n.on(ve.Banned,O),()=>{n.off(ve.Banned,O)}},[]);function I($){A&&_.start($)}return f.jsxs("section",{className:"relative w-full h-full",ref:S,"data-theme":w,children:[r&&f.jsx("div",{className:ze("fixed z-300 overflow-hidden transition-all duration-300 ease-out",{"":t&&!h,"bottom-24 right-8 rounded-xl":!h,"!bottom-0 !right-0":h,"opacity-100 scale-100 translate-y-0":L,"opacity-0 scale-95 translate-y-2":!L}),style:{width:h?"100%":((C=(H=a==null?void 0:a.appearance)==null?void 0:H.design)==null?void 0:C.width)||"21rem",height:h?"var(--app-height, 100dvh)":((F=(P=a==null?void 0:a.appearance)==null?void 0:P.design)==null?void 0:F.height)||"30rem",left:h?"0":"",right:h?"0px !important":"",maxHeight:h?"var(--app-height, 100dvh)":"",boxShadow:h?"":`0 10px 25px -5px ${x.getColor(k.ShadowColor)}, 0 8px 10px -6px ${x.getColor(k.ShadowColor)}`,backgroundColor:x.getColor(k.Background)},children:e}),!A&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(Tx,{fallback:f.jsx(sh,{}),fallbackOpen:u}),!r&&f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:Z,children:[f.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:x.getColor(k.ButtonBackground)}}),f.jsx(Y.Chat,{className:"size-6"})]},"desktop-open-button"),r&&!h&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:V,children:f.jsx(Y.ArrowDown2,{className:"size-6"})},"desktop-close-button")]}),A&&f.jsxs(Pe.div,{ref:E,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:b.x,y:b.y},drag:A,dragControls:_,dragMomentum:!1,dragElastic:0,onDragEnd:($,W)=>{const Q={x:b.x+W.offset.x,y:b.y+W.offset.y},se=ee(Q);T(se)},children:[f.jsx(Tx,{fallback:f.jsx(sh,{}),fallbackOpen:u}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:I,children:f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:Z,children:[f.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:x.getColor(k.ButtonBackground)}}),f.jsx(Y.Chat,{className:"size-6"})]})},"chat-button"),r&&!h&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:V,children:f.jsx(Y.ArrowDown2,{className:"size-6"})},"desktop-close-button")]})]})}function O6(e){const{widget:t}=ie();return f.jsx(EP,{widget:t,children:f.jsx(M6,{...e})})}function N6(){const{isHaveChat:e,isAIAgentMode:t}=ie();return f.jsx(nj,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(O6,{border:!0,children:f.jsxs(ij,{children:[IC.map((n,r)=>f.jsx(dp,{path:n.path,element:f.jsx(n.component,{})},r)),LC.map((n,r)=>f.jsx(dp,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const D6=v.forwardRef((e,t)=>{const n=localStorage.getItem("lc:device:id"),{data:r,isLoading:i,error:s}=aE(e.link_id,n||void 0),{widget:o,setWidget:a,setSoundPath:l,setDefaultValues:c,setOpen:d,setOnTooltipClose:u,setIsTooltipVisible:p,setOnOpen:m,setOnClose:y,onOpen:x,onClose:w}=ie();return v.useImperativeHandle(t,()=>({open:()=>{d(!0),x&&x()},close:()=>{d(!1),w&&w()}})),v.useEffect(()=>{r&&cE(r)&&a(r),e.soundPath&&l(e.soundPath),e.defaultValues&&c(e.defaultValues),e.onTooltipClose&&u(e.onTooltipClose),e.showTooltip===!1&&p(!1),e.onOpen&&m(e.onOpen),e.onClose&&y(e.onClose)},[r,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),i?f.jsx("div",{children:"Loading..."}):s||!r||!o?null:f.jsx(MI,{children:f.jsx(VL,{children:f.jsx(N6,{})})})}),I6=new HT;let Ex=null;function L6(e){if(!e.container)return;const t=X.createRef();return Ex=Xw(e.container),Ex.render(f.jsxs(QT,{client:I6,children:[f.jsx(D6,{...e,ref:t}),f.jsx(Mj,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()},identify:n=>{if(!e.link_id)return;const r=mi(e.link_id);aM({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=L6});export default F6();