1var Dm=e=>{throw TypeError(e)};var Ou=(e,t,n)=>t.has(e)||Dm("Cannot "+n);var S=(e,t,n)=>(Ou(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?Dm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(Ou(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),le=(e,t,n)=>(Ou(e,t,"access private method"),n);var to=(e,t,n,r)=>({set _(s){G(e,t,s,n)},get _(){return S(e,t,r)}});function c1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Tl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rg={exports:{}},Ol={},Ag={exports:{}},de={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Fa=Symbol.for("react.element"),d1=Symbol.for("react.portal"),f1=Symbol.for("react.fragment"),m1=Symbol.for("react.strict_mode"),h1=Symbol.for("react.profiler"),p1=Symbol.for("react.provider"),g1=Symbol.for("react.context"),x1=Symbol.for("react.forward_ref"),y1=Symbol.for("react.suspense"),v1=Symbol.for("react.memo"),b1=Symbol.for("react.lazy"),zm=Symbol.iterator;function w1(e){return e===null||typeof e!="object"?null:(e=zm&&e[zm]||e["@@iterator"],typeof e=="function"?e:null)}var Tg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Og=Object.assign,_g={};function bi(e,t,n){this.props=e,this.context=t,this.refs=_g,this.updater=n||Tg}bi.prototype.isReactComponent={};bi.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")};bi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Mg(){}Mg.prototype=bi.prototype;function af(e,t,n){this.props=e,this.context=t,this.refs=_g,this.updater=n||Tg}var of=af.prototype=new Mg;of.constructor=af;Og(of,bi.prototype);of.isPureReactComponent=!0;var Im=Array.isArray,Lg=Object.prototype.hasOwnProperty,lf={current:null},Dg={key:!0,ref:!0,__self:!0,__source:!0};function zg(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Lg.call(t,r)&&!Dg.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];s.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Fa,type:e,key:i,ref:o,props:s,_owner:lf.current}}function N1(e,t){return{$$typeof:Fa,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function uf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Fa}function j1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fm=/\/+/g;function _u(e,t){return typeof e=="object"&&e!==null&&e.key!=null?j1(""+e.key):t.toString(36)}
vendor: 4,788 bytes, lines 9-17
9function Eo(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Fa:case d1:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+_u(o,0):r,Im(s)?(n="",e!=null&&(n=e.replace(Fm,"$&/")+"/"),Eo(s,t,n,"",function(c){return c})):s!=null&&(uf(s)&&(s=N1(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Fm,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Im(e))for(var l=0;l<e.length;l++){i=e[l];var u=r+_u(i,l);o+=Eo(i,t,n,u,s)}else if(u=w1(e),typeof u=="function")for(e=u.call(e),l=0;!(i=e.next()).done;)i=i.value,u=r+_u(i,l++),o+=Eo(i,t,n,u,s);else if(i==="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 no(e,t,n){if(e==null)return e;var r=[],s=0;return Eo(e,r,"","",function(i){return t.call(n,i,s++)}),r}function S1(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 gt={current:null},Po={transition:null},C1={ReactCurrentDispatcher:gt,ReactCurrentBatchConfig:Po,ReactCurrentOwner:lf};function Ig(){throw Error("act(...) is not supported in production builds of React.")}de.Children={map:no,forEach:function(e,t,n){no(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return no(e,function(){t++}),t},toArray:function(e){return no(e,function(t){return t})||[]},only:function(e){if(!uf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};de.Component=bi;de.Fragment=f1;de.Profiler=h1;de.PureComponent=af;de.StrictMode=m1;de.Suspense=y1;de.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C1;de.act=Ig;de.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=Og({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=lf.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)Lg.call(t,u)&&!Dg.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Fa,type:e.type,key:s,ref:i,props:r,_owner:o}};de.createContext=function(e){return e={$$typeof:g1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:p1,_context:e},e.Consumer=e};de.createElement=zg;de.createFactory=function(e){var t=zg.bind(null,e);return t.type=e,t};de.createRef=function(){return{current:null}};de.forwardRef=function(e){return{$$typeof:x1,render:e}};de.isValidElement=uf;de.lazy=function(e){return{$$typeof:b1,_payload:{_status:-1,_result:e},_init:S1}};de.memo=function(e,t){return{$$typeof:v1,type:e,compare:t===void 0?null:t}};de.startTransition=function(e){var t=Po.transition;Po.transition={};try{e()}finally{Po.transition=t}};de.unstable_act=Ig;de.useCallback=function(e,t){return gt.current.useCallback(e,t)};de.useContext=function(e){return gt.current.useContext(e)};de.useDebugValue=function(){};de.useDeferredValue=function(e){return gt.current.useDeferredValue(e)};de.useEffect=function(e,t){return gt.current.useEffect(e,t)};de.useId=function(){return gt.current.useId()};de.useImperativeHandle=function(e,t,n){return gt.current.useImperativeHandle(e,t,n)};de.useInsertionEffect=function(e,t){return gt.current.useInsertionEffect(e,t)};de.useLayoutEffect=function(e,t){return gt.current.useLayoutEffect(e,t)};de.useMemo=function(e,t){return gt.current.useMemo(e,t)};de.useReducer=function(e,t,n){return gt.current.useReducer(e,t,n)};de.useRef=function(e){return gt.current.useRef(e)};de.useState=function(e){return gt.current.useState(e)};de.useSyncExternalStore=function(e,t,n){return gt.current.useSyncExternalStore(e,t,n)};de.useTransition=function(){return gt.current.useTransition()};de.version="18.3.1";Ag.exports=de;var b=Ag.exports;const se=Tl(b),k1=c1({__proto__:null,default:se},[b]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var E1=b,P1=Symbol.for("react.element"),R1=Symbol.for("react.fragment"),A1=Object.prototype.hasOwnProperty,T1=E1.__SECRET_INT
vendor: 8,843 bytes, lines 17-33
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,O1={key:!0,ref:!0,__self:!0,__source:!0};function Fg(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)A1.call(t,r)&&!O1.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:P1,type:e,key:i,ref:o,props:s,_owner:T1.current}}Ol.Fragment=R1;Ol.jsx=Fg;Ol.jsxs=Fg;Rg.exports=Ol;var a=Rg.exports,Ug={exports:{}},zt={},$g={exports:{}},Bg={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(e){function t(_,H){var M=_.length;_.push(H);e:for(;0<M;){var I=M-1>>>1,B=_[I];if(0<s(B,H))_[I]=H,_[M]=B,M=I;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var H=_[0],M=_.pop();if(M!==H){_[0]=M;e:for(var I=0,B=_.length,oe=B>>>1;I<oe;){var ue=2*(I+1)-1,Be=_[ue],Oe=ue+1,$t=_[Oe];if(0>s(Be,M))Oe<B&&0>s($t,Be)?(_[I]=$t,_[Oe]=M,I=Oe):(_[I]=Be,_[ue]=M,I=ue);else if(Oe<B&&0>s($t,M))_[I]=$t,_[Oe]=M,I=Oe;else break e}}return H}function s(_,H){var M=_.sortIndex-H.sortIndex;return M!==0?M:_.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var u=[],c=[],f=1,d=null,m=3,g=!1,y=!1,v=!1,N=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(_){for(var H=n(c);H!==null;){if(H.callback===null)r(c);else if(H.startTime<=_)r(c),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(c)}}function w(_){if(v=!1,p(_),!y)if(n(u)!==null)y=!0,ae(C);else{var H=n(c);H!==null&&$(w,H.startTime-_)}}function C(_,H){y=!1,v&&(v=!1,x(O),O=-1),g=!0;var M=m;try{for(p(H),d=n(u);d!==null&&(!(d.expirationTime>H)||_&&!Z());){var I=d.callback;if(typeof I=="function"){d.callback=null,m=d.priorityLevel;var B=I(d.expirationTime<=H);H=e.unstable_now(),typeof B=="function"?d.callback=B:d===n(u)&&r(u),p(H)}else r(u);d=n(u)}if(d!==null)var oe=!0;else{var ue=n(c);ue!==null&&$(w,ue.startTime-H),oe=!1}return oe}finally{d=null,m=M,g=!1}}var E=!1,A=null,O=-1,L=5,D=-1;function Z(){return!(e.unstable_now()-D<L)}function Y(){if(A!==null){var _=e.unstable_now();D=_;var H=!0;try{H=A(!0,_)}finally{H?z():(E=!1,A=null)}}else E=!1}var z;if(typeof h=="function")z=function(){h(Y)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,Q=K.port2;K.port1.onmessage=Y,z=function(){Q.postMessage(null)}}else z=function(){N(Y,0)};function ae(_){A=_,E||(E=!0,z())}function $(_,H){O=N(function(){_(e.unstable_now())},H)}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||g||(y=!0,ae(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"):L=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(_){switch(m){case 1:case 2:case 3:var H=3;break;default:H=m}var M=m;m=H;try{return _()}finally{m=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,H){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var M=m;m=_;try{return H()}finally{m=M}},e.unstable_scheduleCallback=function(_,H,M){var I=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?I+M:I):M=I,_){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=M+B,_={id:f++,callback:H,priorityLevel:_,startTime:M,expirationTime:B,sortIndex:-1},M>I?(_.sortIndex=M,t(c,_),n(u)===null&&_===n(c)&&(v?(x(O),O=-1):v=!0,$(w,M-I))):(_.sortIndex=B,t(u,_),y||g||(y=!0,ae(C))),_},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(_){var H=m;return function(){var M=m;m=H;try{return _.apply(this,arguments)}finally{m=M}}}})(Bg);$g.exports=Bg;var _1=$g.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var M1=b,Dt=_1;function U(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 Vg=new Set,fa={};function xs(e,t){oi(e,t),oi(e+"Capture",t)}function oi(e,t){for(fa[e]=t,e=0;e<t.length;e++)Vg.add(t[e])}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nc=Object.prototype.hasOwnProperty,L1=/^[: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]*$/,Um={},$m={};function D1(e){return Nc.call($m,e)?!0:Nc.call(Um,e)?!1:L1.test(e)?$m[e]=!0:(Um[e]=!0,!1)}function z1(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 I1(e,t,n,r){if(t===null||typeof t>"u"||z1(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 xt(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tt[e]=new xt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tt[t]=new xt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tt[e]=new xt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tt[e]=new xt(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){tt[e]=new xt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tt[e]=new xt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tt[e]=new xt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tt[e]=new xt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tt[e]=new xt(e,5,!1,e.toLowerCase(),null,!1,!1)});var cf=/[\-:]([a-z])/g;function df(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
33-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(cf,df);tt[t]=new xt(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(cf,df);tt[t]=new xt(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(cf,df);tt[t]=new xt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tt[e]=new xt(e,1,!1,e.toLowerCase(),null,!1,!1)});tt.xlinkHref=new xt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tt[e]=new xt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ff(e,t,n,r){var s=tt.hasOwnProperty(t)?tt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(I1(t,n,s,r)&&(n=null),r||s===null?D1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Gn=M1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ro=Symbol.for("react.element"),Es=Symbol.for("react.portal"),Ps=Symbol.for("react.fragment"),mf=Symbol.for("react.strict_mode"),jc=Symbol.for("react.profiler"),qg=Symbol.for("react.provider"),Hg=Symbol.for("react.context"),hf=Symbol.for("react.forward_ref"),Sc=Symbol.for("react.suspense"),Cc=Symbol.for("react.suspense_list"),pf=Symbol.for("react.memo"),tr=Symbol.for("react.lazy"),Wg=Symbol.for("react.offscreen"),Bm=Symbol.iterator;function Mi(e){return e===null||typeof e!="object"?null:(e=Bm&&e[Bm]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Object.assign,Mu;function Hi(e){if(Mu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Mu=t&&t[1]||""}return` 34`+Mu+e}var Lu=!1;function Du(e,t){if(!e||Lu)return"";Lu=!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 s=c.stack.split(` 35`),i=r.stack.split(` 36`),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var u=` 37`+s[o].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=o&&0<=l);break}}}finally{Lu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hi(e):""}function F1(e){switch(e.tag){case 5:return Hi(e.type);case 16:return Hi("Lazy");case 13:return Hi("Suspense");case 19:return Hi("SuspenseList");case 0:case 2:case 15:return e=Du(e.type,!1),e;case 11:return e=Du(e.type.render,!1),e;case 1:return e=Du(e.type,!0),e;default:return""}}function kc(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 Ps:return"Fragment";case Es:return"Portal";case jc:return"Profiler";case mf:return"StrictMode";case Sc:return"Suspense";case Cc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Hg:return(e.displayName||"Context")+".Consumer";case qg:return(e._context.displayName||"Context")+".Provider";case hf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pf:return t=e.displayName||null,t!==null?t:kc(e.type)||"Memo";case tr:t=e._payload,e=e._init;try{return kc(e(t))}catch{}}return null}function U1(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 kc(t);case 8:return t===mf?"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 Tr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $1(e){var t=Qg(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 s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.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 so(e){e._valueTracker||(e._valueTracker=$1(e))}function Kg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Qg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ho(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 Ec(e,t){var n=t.checked;return Te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Tr(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 Gg(e,t){t=t.checked,t!=null&&ff(e,"checked",t,!1)}function Pc(e,t){Gg(e,t);var n=Tr(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")?Rc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Rc(e,t.type,Tr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qm(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 Rc(e,t,n){(t!=="number"||Ho(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wi=Array.isArray;function Fs(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Tr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ac(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(U(91));return Te({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Hm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(U(92));if(Wi(n)){if(1<n.length)throw Error(U(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Tr(n)}}function Yg(e,t){var n=Tr(t.value),r=Tr(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 Wm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Xg(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 Tc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Xg
vendor: 10,599 bytes, line 37
37(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var io,Jg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(io=io||document.createElement("div"),io.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=io.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ma(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ji={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},B1=["Webkit","ms","Moz","O"];Object.keys(Ji).forEach(function(e){B1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ji[t]=Ji[e]})});function Zg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ji.hasOwnProperty(e)&&Ji[e]?(""+t).trim():t+"px"}function ex(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Zg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var V1=Te({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 Oc(e,t){if(t){if(V1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(U(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(U(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(U(61))}if(t.style!=null&&typeof t.style!="object")throw Error(U(62))}}function _c(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 Mc=null;function gf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lc=null,Us=null,$s=null;function Qm(e){if(e=Ba(e)){if(typeof Lc!="function")throw Error(U(280));var t=e.stateNode;t&&(t=zl(t),Lc(e.stateNode,e.type,t))}}function tx(e){Us?$s?$s.push(e):$s=[e]:Us=e}function nx(){if(Us){var e=Us,t=$s;if($s=Us=null,Qm(e),t)for(e=0;e<t.length;e++)Qm(t[e])}}function rx(e,t){return e(t)}function sx(){}var zu=!1;function ix(e,t,n){if(zu)return e(t,n);zu=!0;try{return rx(e,t,n)}finally{zu=!1,(Us!==null||$s!==null)&&(sx(),nx())}}function ha(e,t){var n=e.stateNode;if(n===null)return null;var r=zl(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(U(231,t,typeof n));return n}var Dc=!1;if(qn)try{var Li={};Object.defineProperty(Li,"passive",{get:function(){Dc=!0}}),window.addEventListener("test",Li,Li),window.removeEventListener("test",Li,Li)}catch{Dc=!1}function q1(e,t,n,r,s,i,o,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var Zi=!1,Wo=null,Qo=!1,zc=null,H1={onError:function(e){Zi=!0,Wo=e}};function W1(e,t,n,r,s,i,o,l,u){Zi=!1,Wo=null,q1.apply(H1,arguments)}function Q1(e,t,n,r,s,i,o,l,u){if(W1.apply(this,arguments),Zi){if(Zi){var c=Wo;Zi=!1,Wo=null}else throw Error(U(198));Qo||(Qo=!0,zc=c)}}function ys(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 ax(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 Km(e){if(ys(e)!==e)throw Error(U(188))}function K1(e){var t=e.alternate;if(!t){if(t=ys(e),t===null)throw Error(U(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Km(s),e;if(i===r)return Km(s),t;i=i.sibling}throw Error(U(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o)throw Error(U(189))}}if(n.alternate!==r)throw Error(U(190))}if(n.tag!==3)throw Error(U(188));return n.stateNode.current===n?e:t}function ox(e){return e=K1(e),e!==null?lx(e):null}function lx(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lx(e);if(t!==null)return t;e=e.sibling}return null}var ux=Dt.unstable_scheduleCallback,Gm=Dt.unstable_cancelCallback,G1=Dt.unstable_shouldYield,Y1=Dt.unstable_requestPaint,ze=Dt.unstable_now,X1=Dt.unstable_getCurrentPriorityLevel,xf=Dt.unstable_ImmediatePriority,cx=Dt.unstable_UserBlockingPriority,Ko=Dt.unstable_NormalPriority,J1=Dt.unstable_LowPriority,dx=Dt.unstable_IdlePriority,_l=null,Pn=null;function Z1(e){if(Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(_l,e,void 0,(e.current.flags&128)===128)}catch{}}var cn=Math.clz32?Math.clz32:nb,eb=Math.log,tb=Math.LN2;function nb(e){return e>>>=0,e===0?32:31-(eb(e)/tb|0)|0}var ao=64,oo=4194304;function Qi(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 Go(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~s;l!==0?r=Qi(l):(i&=o,i!==0&&(r=Qi(i)))}else o=n&~s,o!==0?r=Qi(o):i!==0&&(r=Qi(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&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-cn(t),s=1<<n,r|=e[n],t&=~s;return r}function rb(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 sb(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-cn(i),l=1<<o,u=s[o];u===-1?(!(l&n)||l&r)&&(s[o]=rb(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}function Ic(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function fx(){var e=ao;return ao<<=1,!(ao&4194240)&&(ao=64),e}function Iu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ua(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-cn(t),e[t]=n}function ib(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 s=31-cn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function yf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-cn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var be=0;function mx(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var hx,vf,px,gx,xx,Fc=!1,lo=[],Nr=null,jr=null,Sr=null,pa=new Map,ga=new Map,ir=[],ab="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 Ym(e,t){switch(e){case"focusin":case"focusout":Nr=null;break;case"dragenter":case"dragleave":jr=null;break;case"mouseover":case"mouseout":Sr=null;break;case"pointerover":case"pointerout":pa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ga.delete(t.pointerId)}}function Di(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ba(t),t!==null&&vf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ob(e,t,n,r,s){switch(t){case"focusin":return Nr=Di(Nr,e,t,n,r,s),!0;case"dragenter":return jr=Di(jr,e,t,n,r,s),!0;case"mouseover":return Sr=Di(Sr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return pa.set(i,Di(pa.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,ga.set(i,Di(ga.get(i)||null,e,t,n,r,s)),!0}return!1}function yx(e){var t=qr(e.target);if(t!==null){var n=ys(t);if(n!==null){if(t=n.tag,t===13){if(t=ax(n),t!==null){e.blockedOn=t,xx(e.priority,function(){px(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 Ro(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Uc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mc=r,n.target.dispatchEvent(r),Mc=null}else return t=Ba(n),t!==null&&vf(t),e.blockedOn=n,!1;t.shift()}return!0}function Xm(e,t,n){Ro(e)&&n.delete(t)}function lb(){Fc=!1,Nr!==null&&Ro(Nr)&&(Nr=null),jr!==null&&Ro(jr)&&(jr=null),Sr!==null&&Ro(Sr)&&(Sr=null),pa.forEac
vendor: 11,841 bytes, line 37
37h(Xm),ga.forEach(Xm)}function zi(e,t){e.blockedOn===t&&(e.blockedOn=null,Fc||(Fc=!0,Dt.unstable_scheduleCallback(Dt.unstable_NormalPriority,lb)))}function xa(e){function t(s){return zi(s,e)}if(0<lo.length){zi(lo[0],e);for(var n=1;n<lo.length;n++){var r=lo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Nr!==null&&zi(Nr,e),jr!==null&&zi(jr,e),Sr!==null&&zi(Sr,e),pa.forEach(t),ga.forEach(t),n=0;n<ir.length;n++)r=ir[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ir.length&&(n=ir[0],n.blockedOn===null);)yx(n),n.blockedOn===null&&ir.shift()}var Bs=Gn.ReactCurrentBatchConfig,Yo=!0;function ub(e,t,n,r){var s=be,i=Bs.transition;Bs.transition=null;try{be=1,bf(e,t,n,r)}finally{be=s,Bs.transition=i}}function cb(e,t,n,r){var s=be,i=Bs.transition;Bs.transition=null;try{be=4,bf(e,t,n,r)}finally{be=s,Bs.transition=i}}function bf(e,t,n,r){if(Yo){var s=Uc(e,t,n,r);if(s===null)Ku(e,t,r,Xo,n),Ym(e,r);else if(ob(s,e,t,n,r))r.stopPropagation();else if(Ym(e,r),t&4&&-1<ab.indexOf(e)){for(;s!==null;){var i=Ba(s);if(i!==null&&hx(i),i=Uc(e,t,n,r),i===null&&Ku(e,t,r,Xo,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Ku(e,t,r,null,n)}}var Xo=null;function Uc(e,t,n,r){if(Xo=null,e=gf(r),e=qr(e),e!==null)if(t=ys(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ax(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 Xo=e,null}function vx(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(X1()){case xf:return 1;case cx:return 4;case Ko:case J1:return 16;case dx:return 536870912;default:return 16}default:return 16}}var yr=null,wf=null,Ao=null;function bx(){if(Ao)return Ao;var e,t=wf,n=t.length,r,s="value"in yr?yr.value:yr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return Ao=s.slice(e,1<r?1-r:void 0)}function To(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 uo(){return!0}function Jm(){return!1}function It(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?uo:Jm,this.isPropagationStopped=Jm,this}return Te(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=uo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=uo)},persist:function(){},isPersistent:uo}),t}var wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nf=It(wi),$a=Te({},wi,{view:0,detail:0}),db=It($a),Fu,Uu,Ii,Ml=Te({},$a,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jf,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!==Ii&&(Ii&&e.type==="mousemove"?(Fu=e.screenX-Ii.screenX,Uu=e.screenY-Ii.screenY):Uu=Fu=0,Ii=e),Fu)},movementY:function(e){return"movementY"in e?e.movementY:Uu}}),Zm=It(Ml),fb=Te({},Ml,{dataTransfer:0}),mb=It(fb),hb=Te({},$a,{relatedTarget:0}),$u=It(hb),pb=Te({},wi,{animationName:0,elapsedTime:0,pseudoElement:0}),gb=It(pb),xb=Te({},wi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yb=It(xb),vb=Te({},wi,{data:0}),eh=It(vb),bb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wb={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"},Nb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nb[e])?!!t[e]:!1}function jf(){return jb}var Sb=Te({},$a,{key:function(e){if(e.key){var t=bb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=To(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jf,charCode:function(e){return e.type==="keypress"?To(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?To(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cb=It(Sb),kb=Te({},Ml,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),th=It(kb),Eb=Te({},$a,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jf}),Pb=It(Eb),Rb=Te({},wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ab=It(Rb),Tb=Te({},Ml,{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}),Ob=It(Tb),_b=[9,13,27,32],Sf=qn&&"CompositionEvent"in window,ea=null;qn&&"documentMode"in document&&(ea=document.documentMode);var Mb=qn&&"TextEvent"in window&&!ea,wx=qn&&(!Sf||ea&&8<ea&&11>=ea),nh=" ",rh=!1;function Nx(e,t){switch(e){case"keyup":return _b.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jx(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rs=!1;function Lb(e,t){switch(e){case"compositionend":return jx(t);case"keypress":return t.which!==32?null:(rh=!0,nh);case"textInput":return e=t.data,e===nh&&rh?null:e;default:return null}}function Db(e,t){if(Rs)return e==="compositionend"||!Sf&&Nx(e,t)?(e=bx(),Ao=wf=yr=null,Rs=!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 wx&&t.locale!=="ko"?null:t.data;default:return null}}var zb={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 sh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zb[e.type]:t==="textarea"}function Sx(e,t,n,r){tx(r),t=Jo(t,"onChange"),0<t.length&&(n=new Nf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ta=null,ya=null;function Ib(e){Lx(e,0)}function Ll(e){var t=Os(e);if(Kg(t))return e}function Fb(e,t){if(e==="change")return t}var Cx=!1;if(qn){var Bu;if(qn){var Vu="oninput"in document;if(!Vu){var ih=document.createElement("div");ih.setAttribute("oninput","return;"),Vu=typeof ih.oninput=="function"}Bu=Vu}else Bu=!1;Cx=Bu&&(!document.documentMode||9<document.documentMode)}function ah(){ta&&(ta.detachEvent("onpropertychange",kx),ya=ta=null)}function kx(e){if(e.propertyName==="value"&&Ll(ya)){var t=[];Sx(t,ya,e,gf(e)),ix(Ib,t)}}function Ub(e,t,n){e==="focusin"?(ah(),ta=t,ya=n,ta.attachEvent("onpropertychange",kx)):e==="focusout"&&ah()}function $b(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ll(ya)}function Bb(e,t){if(e==="click")return Ll(t)}function Vb(e,t){if(e==="input"||e==="change")return Ll(t)}function qb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mn=typeof Object.is=="function"?Object.is:qb;function va(e,t){if(mn(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 s=n[r];if(!Nc.call(t,s)||!mn(e[s],t[s]))return!1}return!0}function oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lh(e,t){var n=oh(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=oh(n)}}function Ex(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ex(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Px(){for(var e=window,t=Ho();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ho(e.document)}return t}function Cf(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 Hb(e){var t=Px(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ex(n.ownerDocument.documentElement,n)){if(r!==null&&Cf(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=lh(n,i);var o=lh(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>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 Wb=qn&&"documentMode"in document&&11>=document.documentMode,As=null,$c=null,na=null,Bc=!1;function uh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bc||As==null||As!==Ho(r)||(r=As,"selectionStart"in r&&Cf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,352 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),na&&va(na,r)||(na=r,r=Jo($c,"onSelect"),0<r.length&&(t=new Nf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=As)))}function co(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ts={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionend:co("Transition","TransitionEnd")},qu={},Rx={};qn&&(Rx=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 Dl(e){if(qu[e])return qu[e];if(!Ts[e])return e;var t=Ts[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rx)return qu[e]=t[n];return e}var Ax=Dl("animationend"),Tx=Dl("animationiteration"),Ox=Dl("animationstart"),_x=Dl("transitionend"),Mx=new Map,ch="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 Lr(e,t){Mx.set(e,t),xs(t,[e])}for(var Hu=0;Hu<ch.length;Hu++){var Wu=ch[Hu],Qb=Wu.toLowerCase(),Kb=Wu[0].toUpperCase()+Wu.slice(1);Lr(Qb,"on"+Kb)}Lr(Ax,"onAnimationEnd");Lr(Tx,"onAnimationIteration");Lr(Ox,"onAnimationStart");Lr("dblclick","onDoubleClick");Lr("focusin","onFocus");Lr("focusout","onBlur");Lr(_x,"onTransitionEnd");oi("onMouseEnter",["mouseout","mouseover"]);oi("onMouseLeave",["mouseout","mouseover"]);oi("onPointerEnter",["pointerout","pointerover"]);oi("onPointerLeave",["pointerout","pointerover"]);xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xs("onBeforeInput",["compositionend","keypress","textInput","paste"]);xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ki="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Gb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ki));function dh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Q1(r,t,void 0,e),e.currentTarget=null}function Lx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==i&&s.isPropagationStopped())break e;dh(s,l,c),i=u}else for(o=0;o<r.length;o++){if(l=r[o],u=l.instance,c=l.currentTarget,l=l.listener,u!==i&&s.isPropagationStopped())break e;dh(s,l,c),i=u}}}if(Qo)throw e=zc,Qo=!1,zc=null,e}function Se(e,t){var n=t[Qc];n===void 0&&(n=t[Qc]=new Set);var r=e+"__bubble";n.has(r)||(Dx(t,e,2,!1),n.add(r))}function Qu(e,t,n){var r=0;t&&(r|=4),Dx(n,e,r,t)}var fo="_reactListening"+Math.random().toString(36).slice(2);function ba(e){if(!e[fo]){e[fo]=!0,Vg.forEach(function(n){n!=="selectionchange"&&(Gb.has(n)||Qu(n,!1,e),Qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fo]||(t[fo]=!0,Qu("selectionchange",!1,t))}}function Dx(e,t,n,r){switch(vx(t)){case 1:var s=ub;break;case 4:s=cb;break;default:s=bf}n=s.bind(null,t,n,e),s=void 0,!Dc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}
vendor: 4,454 bytes, line 37
37function Ku(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===s||u.nodeType===8&&u.parentNode===s))return;o=o.return}for(;l!==null;){if(o=qr(l),o===null)return;if(u=o.tag,u===5||u===6){r=i=o;continue e}l=l.parentNode}}r=r.return}ix(function(){var c=i,f=gf(n),d=[];e:{var m=Mx.get(e);if(m!==void 0){var g=Nf,y=e;switch(e){case"keypress":if(To(n)===0)break e;case"keydown":case"keyup":g=Cb;break;case"focusin":y="focus",g=$u;break;case"focusout":y="blur",g=$u;break;case"beforeblur":case"afterblur":g=$u;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":g=Zm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=mb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Pb;break;case Ax:case Tx:case Ox:g=gb;break;case _x:g=Ab;break;case"scroll":g=db;break;case"wheel":g=Ob;break;case"copy":case"cut":case"paste":g=yb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=th}var v=(t&4)!==0,N=!v&&e==="scroll",x=v?m!==null?m+"Capture":null:m;v=[];for(var h=c,p;h!==null;){p=h;var w=p.stateNode;if(p.tag===5&&w!==null&&(p=w,x!==null&&(w=ha(h,x),w!=null&&v.push(wa(h,w,p)))),N)break;h=h.return}0<v.length&&(m=new g(m,y,null,n,f),d.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",m&&n!==Mc&&(y=n.relatedTarget||n.fromElement)&&(qr(y)||y[Hn]))break e;if((g||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=c,y=y?qr(y):null,y!==null&&(N=ys(y),y!==N||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=c),g!==y)){if(v=Zm,w="onMouseLeave",x="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(v=th,w="onPointerLeave",x="onPointerEnter",h="pointer"),N=g==null?m:Os(g),p=y==null?m:Os(y),m=new v(w,h+"leave",g,n,f),m.target=N,m.relatedTarget=p,w=null,qr(f)===c&&(v=new v(x,h+"enter",y,n,f),v.target=p,v.relatedTarget=N,w=v),N=w,g&&y)t:{for(v=g,x=y,h=0,p=v;p;p=Ns(p))h++;for(p=0,w=x;w;w=Ns(w))p++;for(;0<h-p;)v=Ns(v),h--;for(;0<p-h;)x=Ns(x),p--;for(;h--;){if(v===x||x!==null&&v===x.alternate)break t;v=Ns(v),x=Ns(x)}v=null}else v=null;g!==null&&fh(d,m,g,v,!1),y!==null&&N!==null&&fh(d,N,y,v,!0)}}e:{if(m=c?Os(c):window,g=m.nodeName&&m.nodeName.toLowerCase(),g==="select"||g==="input"&&m.type==="file")var C=Fb;else if(sh(m))if(Cx)C=Vb;else{C=$b;var E=Ub}else(g=m.nodeName)&&g.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(C=Bb);if(C&&(C=C(e,c))){Sx(d,C,n,f);break e}E&&E(e,m,c),e==="focusout"&&(E=m._wrapperState)&&E.controlled&&m.type==="number"&&Rc(m,"number",m.value)}switch(E=c?Os(c):window,e){case"focusin":(sh(E)||E.contentEditable==="true")&&(As=E,$c=c,na=null);break;case"focusout":na=$c=As=null;break;case"mousedown":Bc=!0;break;case"contextmenu":case"mouseup":case"dragend":Bc=!1,uh(d,n,f);break;case"selectionchange":if(Wb)break;case"keydown":case"keyup":uh(d,n,f)}var A;if(Sf)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Rs?Nx(e,n)&&(O="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(wx&&n.locale!=="ko"&&(Rs||O!=="onCompositionStart"?O==="onCompositionEnd"&&Rs&&(A=bx()):(yr=f,wf="value"in yr?yr.value:yr.textContent,Rs=!0)),E=Jo(c,O),0<E.length&&(O=new eh(O,e,null,n,f),d.push({event:O,listeners:E}),A?O.data=A:(A=jx(n),A!==null&&(O.data=A)))),(A=Mb?Lb(e,n):Db(e,n))&&(c=Jo(c,"onBeforeInput"),0<c.length&&(f=new eh("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:c}),f.data=A))}Lx(d,t)})}function wa(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jo(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=ha(e,n),i!=null&&r.unshift(wa(e,i,s)),i=ha(e,t),i!=null&&r.push(wa(e,i,s))),e=e.return}return r}function Ns(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}
vendor: 4,594 bytes, lines 37-38
37function fh(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&c!==null&&(l=c,s?(u=ha(n,i),u!=null&&o.unshift(wa(n,u,l))):s||(u=ha(n,i),u!=null&&o.push(wa(n,u,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Yb=/\r\n?/g,Xb=/\u0000|\uFFFD/g;function mh(e){return(typeof e=="string"?e:""+e).replace(Yb,` 38`).replace(Xb,"")}function mo(e,t,n){if(t=mh(t),mh(e)!==t&&n)throw Error(U(425))}function Zo(){}var Vc=null,qc=null;function Hc(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 Wc=typeof setTimeout=="function"?setTimeout:void 0,Jb=typeof clearTimeout=="function"?clearTimeout:void 0,hh=typeof Promise=="function"?Promise:void 0,Zb=typeof queueMicrotask=="function"?queueMicrotask:typeof hh<"u"?function(e){return hh.resolve(null).then(e).catch(ew)}:Wc;function ew(e){setTimeout(function(){throw e})}function Gu(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),xa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);xa(t)}function Cr(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 ph(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 Ni=Math.random().toString(36).slice(2),Cn="__reactFiber$"+Ni,Na="__reactProps$"+Ni,Hn="__reactContainer$"+Ni,Qc="__reactEvents$"+Ni,tw="__reactListeners$"+Ni,nw="__reactHandles$"+Ni;function qr(e){var t=e[Cn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Hn]||n[Cn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ph(e);e!==null;){if(n=e[Cn])return n;e=ph(e)}return t}e=n,n=e.parentNode}return null}function Ba(e){return e=e[Cn]||e[Hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Os(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(U(33))}function zl(e){return e[Na]||null}var Kc=[],_s=-1;function Dr(e){return{current:e}}function Ce(e){0>_s||(e.current=Kc[_s],Kc[_s]=null,_s--)}function je(e,t){_s++,Kc[_s]=e.current,e.current=t}var Or={},ot=Dr(Or),kt=Dr(!1),os=Or;function li(e,t){var n=e.type.contextTypes;if(!n)return Or;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Et(e){return e=e.childContextTypes,e!=null}function el(){Ce(kt),Ce(ot)}function gh(e,t,n){if(ot.current!==Or)throw Error(U(168));je(ot,t),je(kt,n)}function zx(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(U(108,U1(e)||"Unknown",s));return Te({},n,r)}function tl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Or,os=ot.current,je(ot,e),je(kt,kt.current),!0}function xh(e,t,n){var r=e.stateNode;if(!r)throw Error(U(169));n?(e=zx(e,t,os),r.__reactInternalMemoizedMergedChildContext=e,Ce(kt),Ce(ot),je(ot,e)):Ce(kt),je(kt,n)}var zn=null,Il=!1,Yu=!1;function Ix(e){zn===null?zn=[e]:zn.push(e)}function rw(e){Il=!0,Ix(e)}function zr(){if(!Yu&&zn!==null){Yu=!0;var e=0,t=be;try{var n=zn;for(be=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}zn=null,Il=!1}catch(s){throw zn!==null&&(zn=zn.slice(e+1)),ux(xf,zr),s}finally{be=t,Yu=!1}}return null}var Ms=[],Ls=0,nl=null,rl=0,Wt=[],Qt=0,ls=null,Un=1,$n="";function $r(e,t){Ms[Ls++]=rl,Ms[Ls++]=nl,nl=e,rl=t}function Fx(e,t,n){Wt[Qt++]=Un,Wt[Qt++]=$n,Wt[Qt++]=ls,ls=e;var r=Un;e=$n;var s=32-cn(r)-1;r&=~(1<<s),n+=1;var i=32-cn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Un=1<<32-cn(t)+s|n<<s|r,$n=i+e}else Un=1<<i|n<<s|r,$n=e}function kf(e){e.return!==null&&($r(e,1),Fx(e,1,0))}function Ef(e){for(;e===nl;)nl=Ms[--Ls],Ms[Ls]=null,rl=Ms[--Ls],Ms[Ls]=null;for(;e===ls;)ls=Wt[--Qt],Wt[Qt]=null,$n=Wt[--Qt],Wt[Qt]=null,Un=Wt[--Qt],Wt[Qt]=null}var Lt=null,_t=null,Ee=!1,an=null;function Ux(e,t){var n=Kt(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 yh(e,t){switch(e.tag){case 5:var n=e.type;
vendor: 26,837 bytes, lines 38-40
38return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Lt=e,_t=Cr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Lt=e,_t=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ls!==null?{id:Un,overflow:$n}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Lt=e,_t=null,!0):!1;default:return!1}}function Gc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yc(e){if(Ee){var t=_t;if(t){var n=t;if(!yh(e,t)){if(Gc(e))throw Error(U(418));t=Cr(n.nextSibling);var r=Lt;t&&yh(e,t)?Ux(r,n):(e.flags=e.flags&-4097|2,Ee=!1,Lt=e)}}else{if(Gc(e))throw Error(U(418));e.flags=e.flags&-4097|2,Ee=!1,Lt=e}}}function vh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Lt=e}function ho(e){if(e!==Lt)return!1;if(!Ee)return vh(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Hc(e.type,e.memoizedProps)),t&&(t=_t)){if(Gc(e))throw $x(),Error(U(418));for(;t;)Ux(e,t),t=Cr(t.nextSibling)}if(vh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(U(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){_t=Cr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}_t=null}}else _t=Lt?Cr(e.stateNode.nextSibling):null;return!0}function $x(){for(var e=_t;e;)e=Cr(e.nextSibling)}function ui(){_t=Lt=null,Ee=!1}function Pf(e){an===null?an=[e]:an.push(e)}var sw=Gn.ReactCurrentBatchConfig;function Fi(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(U(309));var r=n.stateNode}if(!r)throw Error(U(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(U(284));if(!n._owner)throw Error(U(290,e))}return e}function po(e,t){throw e=Object.prototype.toString.call(t),Error(U(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function bh(e){var t=e._init;return t(e._payload)}function Bx(e){function t(x,h){if(e){var p=x.deletions;p===null?(x.deletions=[h],x.flags|=16):p.push(h)}}function n(x,h){if(!e)return null;for(;h!==null;)t(x,h),h=h.sibling;return null}function r(x,h){for(x=new Map;h!==null;)h.key!==null?x.set(h.key,h):x.set(h.index,h),h=h.sibling;return x}function s(x,h){return x=Rr(x,h),x.index=0,x.sibling=null,x}function i(x,h,p){return x.index=p,e?(p=x.alternate,p!==null?(p=p.index,p<h?(x.flags|=2,h):p):(x.flags|=2,h)):(x.flags|=1048576,h)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,h,p,w){return h===null||h.tag!==6?(h=rc(p,x.mode,w),h.return=x,h):(h=s(h,p),h.return=x,h)}function u(x,h,p,w){var C=p.type;return C===Ps?f(x,h,p.props.children,w,p.key):h!==null&&(h.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===tr&&bh(C)===h.type)?(w=s(h,p.props),w.ref=Fi(x,h,p),w.return=x,w):(w=Io(p.type,p.key,p.props,null,x.mode,w),w.ref=Fi(x,h,p),w.return=x,w)}function c(x,h,p,w){return h===null||h.tag!==4||h.stateNode.containerInfo!==p.containerInfo||h.stateNode.implementation!==p.implementation?(h=sc(p,x.mode,w),h.return=x,h):(h=s(h,p.children||[]),h.return=x,h)}function f(x,h,p,w,C){return h===null||h.tag!==7?(h=is(p,x.mode,w,C),h.return=x,h):(h=s(h,p),h.return=x,h)}function d(x,h,p){if(typeof h=="string"&&h!==""||typeof h=="number")return h=rc(""+h,x.mode,p),h.return=x,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case ro:return p=Io(h.type,h.key,h.props,null,x.mode,p),p.ref=Fi(x,null,h),p.return=x,p;case Es:return h=sc(h,x.mode,p),h.return=x,h;case tr:var w=h._init;return d(x,w(h._payload),p)}if(Wi(h)||Mi(h))return h=is(h,x.mode,p,null),h.return=x,h;po(x,h)}return null}function m(x,h,p,w){var C=h!==null?h.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return C!==null?null:l(x,h,""+p,w);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case ro:return p.key===C?u(x,h,p,w):null;case Es:return p.key===C?c(x,h,p,w):null;case tr:return C=p._init,m(x,h,C(p._payload),w)}if(Wi(p)||Mi(p))return C!==null?null:f(x,h,p,w,null);po(x,p)}return null}function g(x,h,p,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return x=x.get(p)||null,l(h,x,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ro:return x=x.get(w.key===null?p:w.key)||null,u(h,x,w,C);case Es:return x=x.get(w.key===null?p:w.key)||null,c(h,x,w,C);case tr:var E=w._init;return g(x,h,p,E(w._payload),C)}if(Wi(w)||Mi(w))return x=x.get(p)||null,f(h,x,w,C,null);po(h,w)}return null}function y(x,h,p,w){for(var C=null,E=null,A=h,O=h=0,L=null;A!==null&&O<p.length;O++){A.index>O?(L=A,A=null):L=A.sibling;var D=m(x,A,p[O],w);if(D===null){A===null&&(A=L);break}e&&A&&D.alternate===null&&t(x,A),h=i(D,h,O),E===null?C=D:E.sibling=D,E=D,A=L}if(O===p.length)return n(x,A),Ee&&$r(x,O),C;if(A===null){for(;O<p.length;O++)A=d(x,p[O],w),A!==null&&(h=i(A,h,O),E===null?C=A:E.sibling=A,E=A);return Ee&&$r(x,O),C}for(A=r(x,A);O<p.length;O++)L=g(A,x,O,p[O],w),L!==null&&(e&&L.alternate!==null&&A.delete(L.key===null?O:L.key),h=i(L,h,O),E===null?C=L:E.sibling=L,E=L);return e&&A.forEach(function(Z){return t(x,Z)}),Ee&&$r(x,O),C}function v(x,h,p,w){var C=Mi(p);if(typeof C!="function")throw Error(U(150));if(p=C.call(p),p==null)throw Error(U(151));for(var E=C=null,A=h,O=h=0,L=null,D=p.next();A!==null&&!D.done;O++,D=p.next()){A.index>O?(L=A,A=null):L=A.sibling;var Z=m(x,A,D.value,w);if(Z===null){A===null&&(A=L);break}e&&A&&Z.alternate===null&&t(x,A),h=i(Z,h,O),E===null?C=Z:E.sibling=Z,E=Z,A=L}if(D.done)return n(x,A),Ee&&$r(x,O),C;if(A===null){for(;!D.done;O++,D=p.next())D=d(x,D.value,w),D!==null&&(h=i(D,h,O),E===null?C=D:E.sibling=D,E=D);return Ee&&$r(x,O),C}for(A=r(x,A);!D.done;O++,D=p.next())D=g(A,x,O,D.value,w),D!==null&&(e&&D.alternate!==null&&A.delete(D.key===null?O:D.key),h=i(D,h,O),E===null?C=D:E.sibling=D,E=D);return e&&A.forEach(function(Y){return t(x,Y)}),Ee&&$r(x,O),C}function N(x,h,p,w){if(typeof p=="object"&&p!==null&&p.type===Ps&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case ro:e:{for(var C=p.key,E=h;E!==null;){if(E.key===C){if(C=p.type,C===Ps){if(E.tag===7){n(x,E.sibling),h=s(E,p.props.children),h.return=x,x=h;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===tr&&bh(C)===E.type){n(x,E.sibling),h=s(E,p.props),h.ref=Fi(x,E,p),h.return=x,x=h;break e}n(x,E);break}else t(x,E);E=E.sibling}p.type===Ps?(h=is(p.props.children,x.mode,w,p.key),h.return=x,x=h):(w=Io(p.type,p.key,p.props,null,x.mode,w),w.ref=Fi(x,h,p),w.return=x,x=w)}return o(x);case Es:e:{for(E=p.key;h!==null;){if(h.key===E)if(h.tag===4&&h.stateNode.containerInfo===p.containerInfo&&h.stateNode.implementation===p.implementation){n(x,h.sibling),h=s(h,p.children||[]),h.return=x,x=h;break e}else{n(x,h);break}else t(x,h);h=h.sibling}h=sc(p,x.mode,w),h.return=x,x=h}return o(x);case tr:return E=p._init,N(x,h,E(p._payload),w)}if(Wi(p))return y(x,h,p,w);if(Mi(p))return v(x,h,p,w);po(x,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,h!==null&&h.tag===6?(n(x,h.sibling),h=s(h,p),h.return=x,x=h):(n(x,h),h=rc(p,x.mode,w),h.return=x,x=h),o(x)):n(x,h)}return N}var ci=Bx(!0),Vx=Bx(!1),sl=Dr(null),il=null,Ds=null,Rf=null;function Af(){Rf=Ds=il=null}function Tf(e){var t=sl.current;Ce(sl),e._currentValue=t}function Xc(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 Vs(e,t){il=e,Rf=Ds=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ct=!0),e.firstContext=null)}function Yt(e){var t=e._currentValue;if(Rf!==e)if(e={context:e,memoizedValue:t,next:null},Ds===null){if(il===null)throw Error(U(308));Ds=e,il.dependencies={lanes:0,firstContext:e}}else Ds=Ds.next=e;return t}var Hr=null;function Of(e){Hr===null?Hr=[e]:Hr.push(e)}function qx(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Of(t)):(n.next=s.next,s.next=n),t.interleaved=n,Wn(e,r)}function Wn(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 nr=!1;function _f(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hx(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 Bn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function kr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,he&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Wn(e,n)}return s=r.interleaved,s===null?(t.next=t,Of(r)):(t.next=s.next,s.next=t),r.interleaved=t,Wn(e,n)}function Oo(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,yf(e,n)}}function wh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=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};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 al(e,t,n,r){var s=e.updateQueue;nr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var u=l,c=u.next;u.next=null,o===null?i=c:o.next=c,o=u;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==o&&(l===null?f.firstBaseUpdate=c:l.next=c,f.lastBaseUpdate=u))}if(i!==null){var d=s.baseState;o=0,f=c=u=null,l=i;do{var m=l.lane,g=l.eventTime;if((r&m)===m){f!==null&&(f=f.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(m=t,g=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(g,d,m);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,m=typeof y=="function"?y.call(g,d,m):y,m==null)break e;d=Te({},d,m);break e;case 2:nr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[l]:m.push(l))}else g={eventTime:g,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(c=f=g,u=d):f=f.next=g,o|=m;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;m=l,l=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(f===null&&(u=d),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=f,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);cs|=o,e.lanes=o,e.memoizedState=d}}function Nh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(U(191,s));s.call(r)}}}var Va={},Rn=Dr(Va),ja=Dr(Va),Sa=Dr(Va);function Wr(e){if(e===Va)throw Error(U(174));return e}function Mf(e,t){switch(je(Sa,t),je(ja,e),je(Rn,Va),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Tc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Tc(t,e)}Ce(Rn),je(Rn,t)}function di(){Ce(Rn),Ce(ja),Ce(Sa)}function Wx(e){Wr(Sa.current);var t=Wr(Rn.current),n=Tc(t,e.type);t!==n&&(je(ja,e),je(Rn,n))}function Lf(e){ja.current===e&&(Ce(Rn),Ce(ja))}var Pe=Dr(0);function ol(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 Xu=[];function Df(){for(var e=0;e<Xu.length;e++)Xu[e]._workInProgressVersionPrimary=null;Xu.length=0}var _o=Gn.ReactCurrentDispatcher,Ju=Gn.ReactCurrentBatchConfig,us=0,Re=null,Ve=null,Qe=null,ll=!1,ra=!1,Ca=0,iw=0;function nt(){throw Error(U(321))}function zf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mn(e[n],t[n]))return!1;return!0}function If(e,t,n,r,s,i){if(us=i,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_o.current=e===null||e.memoizedState===null?uw:cw,e=n(r,s),ra){i=0;do{if(ra=!1,Ca=0,25<=i)throw Error(U(301));i+=1,Qe=Ve=null,t.updateQueue=null,_o.current=dw,e=n(r,s)}while(ra)}if(_o.current=ul,t=Ve!==null&&Ve.next!==null,us=0,Qe=Ve=Re=null,ll=!1,t)throw Error(U(300));return e}function Ff(){var e=Ca!==0;return Ca=0,e}function wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?Re.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Xt(){if(Ve===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Qe===null?Re.memoizedState:Qe.next;if(t!==null)Qe=t,Ve=e;else{if(e===null)throw Error(U(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Qe===null?Re.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function ka(e,t){return typeof t=="function"?t(e):t}function Zu(e){var t=Xt(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=Ve,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var l=o=null,u=null,c=i;do{var f=c.lane;if((us&f)===f)u!==null&&(u=u.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 d={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=d,o=r):u=u.next=d,Re.lanes|=f,cs|=f}c=c.next}while(c!==null&&c!==i);u===null?o=r:u.next=l,mn(r,t.memoizedState)||(Ct=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Re.lanes|=i,cs|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ec(e){var t=Xt(),n=t.queue;if(n===null)throw Error(U(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);mn(i,t.memoizedState)||(Ct=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Qx(){}function Kx(e,t){var n=Re,r=Xt(),s=t(),i=!mn(r.memoizedState,s);if(i&&(r.memoizedState=s,Ct=!0),r=r.queue,Uf(Xx.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Qe!==null&&Qe.memoizedState.tag&1){if(n.flags|=2048,Ea(9,Yx.bind(null,n,r,s,t),void 0,null),Ke===null)throw Error(U(349));us&30||Gx(n,t,s)}return s}function Gx(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Yx(e,t,n,r){t.value=n,t.getSnapshot=r,Jx(t)&&Zx(e)}function Xx(e,t,n){return n(function(){Jx(t)&&Zx(e)})}function Jx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mn(e,n)}catch{return!0}}function Zx(e){var t=Wn(e,1);t!==null&&dn(t,e,1,-1)}function jh(e){var t=wn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:e},t.queue=e,e=e.dispatch=lw.bind(null,Re,e),[t.memoizedState,e]}function Ea(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Re.updateQueue,t===null?(t={lastEffect:null,stores:null},Re.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 e0(){return Xt().memoizedState}function Mo(e,t,n,r){var s=wn();Re.flags|=e,s.memoizedState=Ea(1|t,n,void 0,r===void 0?null:r)}function Fl(e,t,n,r){var s=Xt();r=r===void 0?null:r;var i=void 0;if(Ve!==null){var o=Ve.memoizedState;if(i=o.destroy,r!==null&&zf(r,o.deps)){s.memoizedState=Ea(t,n,i,r);return}}Re.flags|=e,s.memoizedState=Ea(1|t,n,i,r)}function Sh(e,t){return Mo(8390656,8,e,t)}function Uf(e,t){return Fl(2048,8,e,t)}function t0(e,t){return Fl(4,2,e,t)}function n0(e,t){return Fl(4,4,e,t)}function r0(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 s0(e,t,n){return n=n!=null?n.concat([e]):null,Fl(4,4,r0.bind(null,t,e),n)}function $f(){}function i0(e,t){var n=Xt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function a0(e,t){var n=Xt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function o0(e,t,n){return us&21?(mn(n,t)||(n=fx(),Re.lanes|=n,cs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ct=!0),e.memoizedState=n)}function aw(e,t){var n=be;be=n!==0&&4>n?n:4,e(!0);var r=Ju.transition;Ju.transition={};try{e(!1),t()}finally{be=n,Ju.transition=r}}function l0(){return Xt().memoizedState}function ow(e,t,n){var r=Pr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},u0(e))c0(t,n);else if(n=qx(e,t,n,r),n!==null){var s=pt();dn(n,e,r,s),d0(n,t,r)}}function lw(e,t,n){var r=Pr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(u0(e))c0(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(s.hasEagerState=!0,s.eagerState=l,mn(l,o)){var u=t.interleaved;u===null?(s.next=s,Of(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=qx(e,t,s,r),n!==null&&(s=pt(),dn(n,e,r,s),d0(n,t,r))}}function u0(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function c0(e,t){ra=ll=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function d0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yf(e,n)}}var ul={readContext:Yt,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useInsertionEffect:nt,useLayoutEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useMutableSource:nt,useSyncExternalStore:nt,useId:nt,unstable_isNewReconciler:!1},uw={readContext:Yt,useCallback:function(e,t){return wn().memoizedState=[e,t===void 0?null:t],e},useContext:Yt,useEffect:Sh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Mo(4194308,4,r0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Mo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Mo(4,2,e,t)},useMemo:function(e,t){var n=wn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wn();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=ow.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=wn();return e={current:e},t.memoizedState=e},useState:jh,useDebugValue:$f,useDeferredValue:function(e){return wn().memoizedState=e},useTransition:function(){var e=jh(!1),t=e[0];return e=aw.bind(null,e[1]),wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Re,s=wn();if(Ee){if(n===void 0)throw Error(U(407));n=n()}else{if(n=t(),Ke===null)throw Error(U(349));us&30||Gx(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Sh(Xx.bind(null,r,i,e),[e]),r.flags|=2048,Ea(9,Yx.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=wn(),t=Ke.identifierPrefix;if(Ee){var n=$n,r=Un;n=(r&~(1<<32-cn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ca++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=iw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},cw={readContext:Yt,useCallback:i0,useContext:Yt,useEffect:Uf,useImperativeHandle:s0,useInsertionEffect:t0,useLayoutEffect:n0,useMemo:a0,useReducer:Zu,useRef:e0,useState:function(){return Zu(ka)},useDebugValue:$f,useDeferredValue:function(e){var t=Xt();return o0(t,Ve.memoizedState,e)},useTransition:function(){var e=Zu(ka)[0],t=Xt().memoizedState;return[e,t]},useMutableSource:Qx,useSyncExternalStore:Kx,useId:l0,unstable_isNewReconciler:!1},dw={readContext:Yt,useCallback:i0,useContext:Yt,useEffect:Uf,useImperativeHandle:s0,useInsertionEffect:t0,useLayoutEffect:n0,useMemo:a0,useReducer:ec,useRef:e0,useState:function(){return ec(ka)},useDebugValue:$f,useDeferredValue:function(e){var t=Xt();return Ve===null?t.memoizedState=e:o0(t,Ve.memoizedState,e)},useTransition:function(){var e=ec(ka)[0],t=Xt().memoizedState;return[e,t]},useMutableSource:Qx,useSyncExternalStore:Kx,useId:l0,unstable_isNewReconciler:!1};function tn(e,t){if(e&&e.defaultProps){t=Te({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Jc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Te({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ul={isMounted:function(e){return(e=e._reactInternals)?ys(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=pt(),s=Pr(e),i=Bn(r,s);i.payload=t,n!=null&&(i.callback=n),t=kr(e,i,s),t!==null&&(dn(t,e,s,r),Oo(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=pt(),s=Pr(e),i=Bn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=kr(e,i,s),t!==null&&(dn(t,e,s,r),Oo(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pt(),r=Pr(e),s=Bn(n,r);s.tag=2,t!=null&&(s.callback=t),t=kr(e,s,r),t!==null&&(dn(t,e,r,n),Oo(t,e,r))}};function Ch(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!va(n,r)||!va(s,i):!0}function f0(e,t,n){var r=!1,s=Or,i=t.contextType;return typeof i=="object"&&i!==null?i=Yt(i):(s=Et(t)?os:ot.current,r=t.contextTypes,i=(r=r!=null)?li(e,s):Or),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ul,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function kh(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&&Ul.enqueueReplaceState(t,t.state,null)}function Zc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},_f(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Yt(i):(i=Et(t)?os:ot.current,s.context=li(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Jc(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Ul.enqueueReplaceState(s,s.state,null),al(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function fi(e,t){try{var n="",r=t;do n+=F1(r),r=r.return;while(r);var s=n}catch(i){s=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:e,source:t,stack:s,digest:null}}function tc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ed(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var fw=typeof WeakMap=="function"?WeakMap:Map;function m0(e,t,n){n=Bn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){dl||(dl=!0,cd=r),ed(e,t)},n}function h0(e,t,n){n=Bn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){ed(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ed(e,t),typeof r!="function"&&(Er===null?Er=new Set([this]):Er.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Eh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new fw;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=kw.bind(null,e,t,n),t.then(e,e))}function Ph(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 Rh(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=Bn(-1,1),t.tag=2,kr(n,t,1))),n.lanes|=1),e)}var mw=Gn.ReactCurrentOwner,Ct=!1;function dt(e,t,n,r){t.child=e===null?Vx(t,null,n,r):ci(t,e.child,n,r)}function Ah(e,t,n,r,s){n=n.render;var i=t.ref;return Vs(t,s),r=If(e,t,n,r,i,s),n=Ff(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Qn(e,t,s)):(Ee&&n&&kf(t),t.flags|=1,dt(e,t,r,s),t.child)}function Th(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Gf(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,p0(e,t,i,r,s)):(e=Io(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:va,n(o,r)&&e.ref===t.ref)return Qn(e,t,s)}return t.flags|=1,e=Rr(i,r),e.ref=t.ref,e.return=t,t.child=e}function p0(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(va(i,r)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Ct=!0);else return t.lanes=e.lanes,Qn(e,t,s)}return td(e,t,n,r,s)}function g0(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},je(Is,Tt),Tt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,je(Is,Tt),Tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,je(Is,Tt),Tt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,je(Is,Tt),Tt|=r;return dt(e,t,s,n),t.child}function x0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 8,178 bytes, line 40
40function td(e,t,n,r,s){var i=Et(n)?os:ot.current;return i=li(t,i),Vs(t,s),n=If(e,t,n,r,i,s),r=Ff(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Qn(e,t,s)):(Ee&&r&&kf(t),t.flags|=1,dt(e,t,n,s),t.child)}function Oh(e,t,n,r,s){if(Et(n)){var i=!0;tl(t)}else i=!1;if(Vs(t,s),t.stateNode===null)Lo(e,t),f0(t,n,r),Zc(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var u=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Yt(c):(c=Et(n)?os:ot.current,c=li(t,c));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||u!==c)&&kh(t,o,r,c),nr=!1;var m=t.memoizedState;o.state=m,al(t,r,o,s),u=t.memoizedState,l!==r||m!==u||kt.current||nr?(typeof f=="function"&&(Jc(t,n,f,r),u=t.memoizedState),(l=nr||Ch(t,n,l,r,m,u,c))?(d||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=u),o.props=r,o.state=u,o.context=c,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Hx(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:tn(t.type,l),o.props=c,d=t.pendingProps,m=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Yt(u):(u=Et(n)?os:ot.current,u=li(t,u));var g=n.getDerivedStateFromProps;(f=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||m!==u)&&kh(t,o,r,u),nr=!1,m=t.memoizedState,o.state=m,al(t,r,o,s);var y=t.memoizedState;l!==d||m!==y||kt.current||nr?(typeof g=="function"&&(Jc(t,n,g,r),y=t.memoizedState),(c=nr||Ch(t,n,c,r,m,y,u)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=u,r=c):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return nd(e,t,n,r,i,s)}function nd(e,t,n,r,s,i){x0(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&xh(t,n,!1),Qn(e,t,i);r=t.stateNode,mw.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=ci(t,e.child,null,i),t.child=ci(t,null,l,i)):dt(e,t,l,i),t.memoizedState=r.state,s&&xh(t,n,!0),t.child}function y0(e){var t=e.stateNode;t.pendingContext?gh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gh(e,t.context,!1),Mf(e,t.containerInfo)}function _h(e,t,n,r,s){return ui(),Pf(s),t.flags|=256,dt(e,t,n,r),t.child}var rd={dehydrated:null,treeContext:null,retryLane:0};function sd(e){return{baseLanes:e,cachePool:null,transitions:null}}function v0(e,t,n){var r=t.pendingProps,s=Pe.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),je(Pe,s&1),e===null)return Yc(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,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Vl(o,r,0,null),e=is(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=sd(n),t.memoizedState=rd,e):Bf(t,o));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return hw(e,t,o,r,l,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,l=s.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Rr(s,u),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Rr(l,i):(i=is(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?sd(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=rd,r}return i=e.child,e=i.sibling,r=Rr(i,{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 Bf(e,t){return t=Vl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function go(e,t,n,r){return r!==null&&Pf(r),ci(t,e.child,null,n),e=Bf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hw(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=tc(Error(U(422))),go(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Vl({mode:"visible",children:r.children},s,0,null),i=is(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ci(t,e.child,null,o),t.child.memoizedState=sd(o),t.memoizedState=rd,i);if(!(t.mode&1))return go(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(U(419)),r=tc(i,r,void 0),go(e,t,o,r)}if(l=(o&e.childLanes)!==0,Ct||l){if(r=Ke,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Wn(e,s),dn(r,e,s,-1))}return Kf(),r=tc(Error(U(421))),go(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Ew.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,_t=Cr(s.nextSibling),Lt=t,Ee=!0,an=null,e!==null&&(Wt[Qt++]=Un,Wt[Qt++]=$n,Wt[Qt++]=ls,Un=e.id,$n=e.overflow,ls=t),t=Bf(t,r.children),t.flags|=4096,t)}function Mh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xc(e.return,t,n)}function nc(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function b0(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(dt(e,t,r.children,n),r=Pe.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&&Mh(e,n,t);else if(e.tag===19)Mh(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(je(Pe,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ol(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),nc(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ol(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}nc(t,!0,n,null,i);break;case"together":nc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Lo(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Qn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(U(153));
vendor: 5,099 bytes, line 40
40if(t.child!==null){for(e=t.child,n=Rr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Rr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pw(e,t,n){switch(t.tag){case 3:y0(t),ui();break;case 5:Wx(t);break;case 1:Et(t.type)&&tl(t);break;case 4:Mf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;je(sl,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(je(Pe,Pe.current&1),t.flags|=128,null):n&t.child.childLanes?v0(e,t,n):(je(Pe,Pe.current&1),e=Qn(e,t,n),e!==null?e.sibling:null);je(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return b0(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),je(Pe,Pe.current),r)break;return null;case 22:case 23:return t.lanes=0,g0(e,t,n)}return Qn(e,t,n)}var w0,id,N0,j0;w0=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}};id=function(){};N0=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Wr(Rn.current);var i=null;switch(n){case"input":s=Ec(e,s),r=Ec(e,r),i=[];break;case"select":s=Te({},s,{value:void 0}),r=Te({},r,{value:void 0}),i=[];break;case"textarea":s=Ac(e,s),r=Ac(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zo)}Oc(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(fa.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var u=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(i||(i=[]),i.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(i=i||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(fa.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&Se("scroll",e),i||l===u||(i=[])):(i=i||[]).push(c,u))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};j0=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ui(e,t){if(!Ee)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 rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gw(e,t,n){var r=t.pendingProps;switch(Ef(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(t),null;case 1:return Et(t.type)&&el(),rt(t),null;case 3:return r=t.stateNode,di(),Ce(kt),Ce(ot),Df(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ho(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,an!==null&&(md(an),an=null))),id(e,t),rt(t),null;case 5:Lf(t);var s=Wr(Sa.current);if(n=t.type,e!==null&&t.stateNode!=null)N0(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(U(166));return rt(t),null}if(e=Wr(Rn.current),ho(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Cn]=t,r[Na]=i,e=(t.mode&1)!==0,n){case"dialog":Se("cancel",r),Se("close",r);break;case"iframe":case"object":case"embed":Se("load",r);break;case"video":case"audio":for(s=0;s<Ki.length;s++)Se(Ki[s],r);break;case"source":Se("error",r);break;case"img":case"image":case"link":Se("error",r),Se("load",r);break;case"details":Se("toggle",r);break;case"input":Vm(r,i),Se("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Se("invalid",r);break;case"textarea":Hm(r,i),Se("invalid",r)}Oc(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&mo(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&mo(r.textContent,l,e),s=["children",""+l]):fa.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&Se("scroll",r)}switch(n){case"input":so(r),qm(r,i,!0);break;
vendor: 28,543 bytes, line 40
40case"textarea":so(r),Wm(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Zo)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Xg(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[Cn]=t,e[Na]=r,w0(e,t,!1,!1),t.stateNode=e;e:{switch(o=_c(n,r),n){case"dialog":Se("cancel",e),Se("close",e),s=r;break;case"iframe":case"object":case"embed":Se("load",e),s=r;break;case"video":case"audio":for(s=0;s<Ki.length;s++)Se(Ki[s],e);s=r;break;case"source":Se("error",e),s=r;break;case"img":case"image":case"link":Se("error",e),Se("load",e),s=r;break;case"details":Se("toggle",e),s=r;break;case"input":Vm(e,r),s=Ec(e,r),Se("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Te({},r,{value:void 0}),Se("invalid",e);break;case"textarea":Hm(e,r),s=Ac(e,r),Se("invalid",e);break;default:s=r}Oc(n,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var u=l[i];i==="style"?ex(e,u):i==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Jg(e,u)):i==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ma(e,u):typeof u=="number"&&ma(e,""+u):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(fa.hasOwnProperty(i)?u!=null&&i==="onScroll"&&Se("scroll",e):u!=null&&ff(e,i,u,o))}switch(n){case"input":so(e),qm(e,r,!1);break;case"textarea":so(e),Wm(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Tr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Fs(e,!!r.multiple,i,!1):r.defaultValue!=null&&Fs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Zo)}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 rt(t),null;case 6:if(e&&t.stateNode!=null)j0(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(U(166));if(n=Wr(Sa.current),Wr(Rn.current),ho(t)){if(r=t.stateNode,n=t.memoizedProps,r[Cn]=t,(i=r.nodeValue!==n)&&(e=Lt,e!==null))switch(e.tag){case 3:mo(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&mo(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Cn]=t,t.stateNode=r}return rt(t),null;case 13:if(Ce(Pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&_t!==null&&t.mode&1&&!(t.flags&128))$x(),ui(),t.flags|=98560,i=!1;else if(i=ho(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(U(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(U(317));i[Cn]=t}else ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;rt(t),i=!1}else an!==null&&(md(an),an=null),i=!0;if(!i)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||Pe.current&1?He===0&&(He=3):Kf())),t.updateQueue!==null&&(t.flags|=4),rt(t),null);case 4:return di(),id(e,t),e===null&&ba(t.stateNode.containerInfo),rt(t),null;case 10:return Tf(t.type._context),rt(t),null;case 17:return Et(t.type)&&el(),rt(t),null;case 19:if(Ce(Pe),i=t.memoizedState,i===null)return rt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Ui(i,!1);else{if(He!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ol(e),o!==null){for(t.flags|=128,Ui(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return je(Pe,Pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&ze()>mi&&(t.flags|=128,r=!0,Ui(i,!1),t.lanes=4194304)}else{if(!r)if(e=ol(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ui(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ee)return rt(t),null}else 2*ze()-i.renderingStartTime>mi&&n!==1073741824&&(t.flags|=128,r=!0,Ui(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ze(),t.sibling=null,n=Pe.current,je(Pe,r?n&1|2:n&1),t):(rt(t),null);case 22:case 23:return Qf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Tt&1073741824&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),null;case 24:return null;case 25:return null}throw Error(U(156,t.tag))}function xw(e,t){switch(Ef(t),t.tag){case 1:return Et(t.type)&&el(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return di(),Ce(kt),Ce(ot),Df(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lf(t),null;case 13:if(Ce(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(U(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Pe),null;case 4:return di(),null;case 10:return Tf(t.type._context),null;case 22:case 23:return Qf(),null;case 24:return null;default:return null}}var xo=!1,it=!1,yw=typeof WeakSet=="function"?WeakSet:Set,X=null;function zs(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function ad(e,t,n){try{n()}catch(r){Me(e,t,r)}}var Lh=!1;function vw(e,t){if(Vc=Yo,e=Px(),Cf(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 s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,u=-1,c=0,f=0,d=e,m=null;t:for(;;){for(var g;d!==n||s!==0&&d.nodeType!==3||(l=o+s),d!==i||r!==0&&d.nodeType!==3||(u=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(g=d.firstChild)!==null;)m=d,d=g;for(;;){if(d===e)break t;if(m===n&&++c===s&&(l=o),m===i&&++f===r&&(u=o),(g=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=g}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(qc={focusedElem:e,selectionRange:n},Yo=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;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 v=y.memoizedProps,N=y.memoizedState,x=t.stateNode,h=x.getSnapshotBeforeUpdate(t.elementType===t.type?v:tn(t.type,v),N);x.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(U(163))}}catch(w){Me(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return y=Lh,Lh=!1,y}function sa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&ad(t,n,i)}s=s.next}while(s!==r)}}function $l(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 od(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 S0(e){var t=e.alternate;t!==null&&(e.alternate=null,S0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Cn],delete t[Na],delete t[Qc],delete t[tw],delete t[nw])),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 C0(e){return e.tag===5||e.tag===3||e.tag===4}function Dh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||C0(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 ld(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=Zo));else if(r!==4&&(e=e.child,e!==null))for(ld(e,t,n),e=e.sibling;e!==null;)ld(e,t,n),e=e.sibling}function ud(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(ud(e,t,n),e=e.sibling;e!==null;)ud(e,t,n),e=e.sibling}var Je=null,sn=!1;function Jn(e,t,n){for(n=n.child;n!==null;)k0(e,t,n),n=n.sibling}function k0(e,t,n){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(_l,n)}catch{}switch(n.tag){case 5:it||zs(n,t);case 6:var r=Je,s=sn;Je=null,Jn(e,t,n),Je=r,sn=s,Je!==null&&(sn?(e=Je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Je.removeChild(n.stateNode));break;case 18:Je!==null&&(sn?(e=Je,n=n.stateNode,e.nodeType===8?Gu(e.parentNode,n):e.nodeType===1&&Gu(e,n),xa(e)):Gu(Je,n.stateNode));break;case 4:r=Je,s=sn,Je=n.stateNode.containerInfo,sn=!0,Jn(e,t,n),Je=r,sn=s;break;case 0:case 11:case 14:case 15:if(!it&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&ad(n,t,o),s=s.next}while(s!==r)}Jn(e,t,n);break;case 1:if(!it&&(zs(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Me(n,t,l)}Jn(e,t,n);break;case 21:Jn(e,t,n);break;case 22:n.mode&1?(it=(r=it)||n.memoizedState!==null,Jn(e,t,n),it=r):Jn(e,t,n);break;default:Jn(e,t,n)}}function zh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yw),t.forEach(function(r){var s=Pw.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Jt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Je=l.stateNode,sn=!1;break e;case 3:Je=l.stateNode.containerInfo,sn=!0;break e;case 4:Je=l.stateNode.containerInfo,sn=!0;break e}l=l.return}if(Je===null)throw Error(U(160));k0(i,o,s),Je=null,sn=!1;var u=s.alternate;u!==null&&(u.return=null),s.return=null}catch(c){Me(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)E0(t,e),t=t.sibling}function E0(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Jt(t,e),yn(e),r&4){try{sa(3,e,e.return),$l(3,e)}catch(v){Me(e,e.return,v)}try{sa(5,e,e.return)}catch(v){Me(e,e.return,v)}}break;case 1:Jt(t,e),yn(e),r&512&&n!==null&&zs(n,n.return);break;case 5:if(Jt(t,e),yn(e),r&512&&n!==null&&zs(n,n.return),e.flags&32){var s=e.stateNode;try{ma(s,"")}catch(v){Me(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Gg(s,i),_c(l,o);var c=_c(l,i);for(o=0;o<u.length;o+=2){var f=u[o],d=u[o+1];f==="style"?ex(s,d):f==="dangerouslySetInnerHTML"?Jg(s,d):f==="children"?ma(s,d):ff(s,f,d,c)}switch(l){case"input":Pc(s,i);break;case"textarea":Yg(s,i);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?Fs(s,!!i.multiple,g,!1):m!==!!i.multiple&&(i.defaultValue!=null?Fs(s,!!i.multiple,i.defaultValue,!0):Fs(s,!!i.multiple,i.multiple?[]:"",!1))}s[Na]=i}catch(v){Me(e,e.return,v)}}break;case 6:if(Jt(t,e),yn(e),r&4){if(e.stateNode===null)throw Error(U(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(v){Me(e,e.return,v)}}break;case 3:if(Jt(t,e),yn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{xa(t.containerInfo)}catch(v){Me(e,e.return,v)}break;case 4:Jt(t,e),yn(e);break;case 13:Jt(t,e),yn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Hf=ze())),r&4&&zh(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(it=(c=it)||f,Jt(t,e),it=c):Jt(t,e),yn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(X=e,f=e.child;f!==null;){for(d=X=f;X!==null;){switch(m=X,g=m.child,m.tag){case 0:case 11:case 14:case 15:sa(4,m,m.return);break;case 1:zs(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){Me(r,n,v)}}break;case 5:zs(m,m.return);break;case 22:if(m.memoizedState!==null){Fh(d);continue}}g!==null?(g.return=m,X=g):Fh(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{s=d.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,u=d.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=Zg("display",o))}catch(v){Me(e,e.return,v)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(v){Me(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Jt(t,e),yn(e),r&4&&zh(e);break;case 21:break;default:Jt(t,e),yn(e)}}function yn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(C0(n)){var r=n;break e}n=n.return}throw Error(U(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(ma(s,""),r.flags&=-33);var i=Dh(e);ud(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Dh(e);ld(e,l,o);break;default:throw Error(U(161))}}catch(u){Me(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bw(e,t,n){X=e,P0(e)}function P0(e,t,n){for(var r=(e.mode&1)!==0;X!==null;){var s=X,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||xo;if(!o){var l=s.alternate,u=l!==null&&l.memoizedState!==null||it;l=xo;var c=it;if(xo=o,(it=u)&&!c)for(X=s;X!==null;)o=X,u=o.child,o.tag===22&&o.memoizedState!==null?Uh(s):u!==null?(u.return=o,X=u):Uh(s);for(;i!==null;)X=i,P0(i),i=i.sibling;X=s,xo=l,it=c}Ih(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,X=i):Ih(e)}}function Ih(e){for(;X!==null;){var t=X;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:it||$l(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!it)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:tn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Nh(t,i,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}Nh(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.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 f=c.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&xa(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(U(163))}it||t.flags&512&&od(t)}catch(m){Me(t,t.return,m)}}if(t===e){X=null;break}if(n=t.sibling,n!==null){n.return=t.return,X=n;break}X=t.return}}function Fh(e){for(;X!==null;){var t=X;if(t===e){X=null;break}var n=t.sibling;if(n!==null){n.return=t.return,X=n;break}X=t.return}}function Uh(e){for(;X!==null;){var t=X;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{$l(4,t)}catch(u){Me(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(u){Me(t,s,u)}}var i=t.return;try{od(t)}catch(u){Me(t,i,u)}break;case 5:var o=t.return;try{od(t)}catch(u){Me(t,o,u)}}}catch(u){Me(t,t.return,u)}if(t===e){X=null;break}var l=t.sibling;if(l!==null){l.return=t.return,X=l;break}X=t.return}}var ww=Math.ceil,cl=Gn.ReactCurrentDispatcher,Vf=Gn.ReactCurrentOwner,Gt=Gn.ReactCurrentBatchConfig,he=0,Ke=null,$e=null,et=0,Tt=0,Is=Dr(0),He=0,Pa=null,cs=0,Bl=0,qf=0,ia=null,St=null,Hf=0,mi=1/0,Dn=null,dl=!1,cd=null,Er=null,yo=!1,vr=null,fl=0,aa=0,dd=null,Do=-1,zo=0;function pt(){return he&6?ze():Do!==-1?Do:Do=ze()}function Pr(e){return e.mode&1?he&2&&et!==0?et&-et:sw.transition!==null?(zo===0&&(zo=fx()),zo):(e=be,e!==0||(e=window.event,e=e===void 0?16:vx(e.type)),e):1}function dn(e,t,n,r){if(50<aa)throw aa=0,dd=null,Error(U(185));Ua(e,n,r),(!(he&2)||e!==Ke)&&(e===Ke&&(!(he&2)&&(Bl|=n),He===4&&ar(e,et)),Pt(e,r),n===1&&he===0&&!(t.mode&1)&&(mi=ze()+500,Il&&zr()))}function Pt(e,t){var n=e.callbackNode;sb(e,t);var r=Go(e,e===Ke?et:0);if(r===0)n!==null&&Gm(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Gm(n),t===1)e.tag===0?rw($h.bind(null,e)):Ix($h.bind(null,e)),Zb(function(){!(he&6)&&zr()}),n=null;else{switch(mx(r)){case 1:n=xf;break;case 4:n=cx;break;case 16:n=Ko;break;case 536870912:n=dx;break;default:n=Ko}n=D0(n,R0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function R0(e,t){if(Do=-1,zo=0,he&6)throw Error(U(327));var n=e.callbackNode;if(qs()&&e.callbackNode!==n)return null;var r=Go(e,e===Ke?et:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ml(e,r);else{t=r;var s=he;he|=2;var i=T0();(Ke!==e||et!==t)&&(Dn=null,mi=ze()+500,ss(e,t));do try{Sw();break}catch(l){A0(e,l)}while(!0);Af(),cl.current=i,he=s,$e!==null?t=0:(Ke=null,et=0,t=He)}if(t!==0){if(t===2&&(s=Ic(e),s!==0&&(r=s,t=fd(e,s))),t===1)throw n=Pa,ss(e,0),ar(e,r),Pt(e,ze()),n;if(t===6)ar(e,r);else{if(s=e.current.alternate,!(r&30)&&!Nw(s)&&(t=ml(e,r),t===2&&(i=Ic(e),i!==0&&(r=i,t=fd(e,i))),t===1))throw n=Pa,ss(e,0),ar(e,r),Pt(e,ze()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(U(345));case 2:Br(e,St,Dn);break;case 3:if(ar(e,r),(r&130023424)===r&&(t=Hf+500-ze(),10<t)){if(Go(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){pt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Wc(Br.bind(null,e,St,Dn),t);break}Br(e,St,Dn);break;case 4:if(ar(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-cn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=ze()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ww(r/1960))-r,10<r){e.timeoutHandle=Wc(Br.bind(null,e,St,Dn),r);break}Br(e,St,Dn);break;case 5:Br(e,St,Dn);break;default:throw Error(U(329))}}}return Pt(e,ze()),e.callbackNode===n?R0.bind(null,e):null}function fd(e,t){var n=ia;return e.current.memoizedState.isDehydrated&&(ss(e,t).flags|=256),e=ml(e,t),e!==2&&(t=St,St=n,t!==null&&md(t)),e}function md(e){St===null?St=e:St.push.apply(St,e)}function Nw(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!mn(i(),s))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 ar(e,t){for(t&=~qf,t&=~Bl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-cn(t),r=1<<n;e[n]=-1,t&=~r}}function $h(e){if(he&6)throw Error(U(327));qs();var t=Go(e,0);if(!(t&1))return Pt(e,ze()),null;var n=ml(e,t);if(e.tag!==0&&n===2){var r=Ic(e);r!==0&&(t=r,n=fd(e,r))}if(n===1)throw n=Pa,ss(e,0),ar(e,t),Pt(e,ze()),n;if(n===6)throw Error(U(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Br(e,St,Dn),Pt(e,ze()),null}function Wf(e,t){var n=he;he|=1;try{return e(t)}finally{he=n,he===0&&(mi=ze()+500,Il&&zr())}}function ds(e){vr!==null&&vr.tag===0&&!(he&6)&&qs();var t=he;he|=1;var n=Gt.transition,r=be;try{if(Gt.transition=null,be=1,e)return e()}finally{be=r,Gt.transition=n,he=t,!(he&6)&&zr()}}function Qf(){Tt=Is.current,Ce(Is)}function ss(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Jb(n)),$e!==null)for(n=$e.return;n!==null;){var r=n;switch(Ef(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&el();break;case 3:di(),Ce(kt),Ce(ot),Df();break;case 5:Lf(r);break;case 4:di();break;case 13:Ce(Pe);break;case 19:Ce(Pe);break;case 10:Tf(r.type._context);break;case 22:case 23:Qf()}n=n.return}if(Ke=e,$e=e=Rr(e.current,null),et=Tt=t,He=0,Pa=null,qf=Bl=cs=0,St=ia=null,Hr!==null){for(t=0;t<Hr.length;t++)if(n=Hr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}Hr=null}return e}function A0(e,t){do{var n=$e;try{if(Af(),_o.current=ul,ll){for(var r=Re.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ll=!1}if(us=0,Qe=Ve=Re=null,ra=!1,Ca=0,Vf.current=null,n===null||n.return===null){He=1,Pa=t,$e=null;break}e:{var i=e,o=n.return,l=n,u=t;if(t=et,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var m=f.alternate;m?(f.updateQueue=m.updateQueue,f.memoizedState=m.memoizedState,f.lanes=m.lanes):(f.updateQueue=null,f.memoizedState=null)}var g=Ph(o);if(g!==null){g.flags&=-257,Rh(g,o,l,i,t),g.mode&1&&Eh(i,c,t),t=g,u=c;var y=t.updateQueue;if(y===null){var v=new Set;v.add(u),t.updateQueue=v}else y.add(u);break e}else{if(!(t&1)){Eh(i,c,t),Kf();break e}u=Error(U(426))}}else if(Ee&&l.mode&1){var N=Ph(o);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Rh(N,o,l,i,t),Pf(fi(u,l));break e}}i=u=fi(u,l),He!==4&&(He=2),ia===null?ia=[i]:ia.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=m0(i,u,t);wh(i,x);break e;case 1:l=u;var h=i.type,p=i.stateNode;if(!(i.flags&128)&&(typeof h.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Er===null||!Er.has(p)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=h0(i,l,t);wh(i,w);break e}}i=i.return}while(i!==null)}_0(n)}catch(C){t=C,$e===n&&n!==null&&($e=n=n.return);continue}break}while(!0)}function T0(){var e=cl.current;return cl.current=ul,e===null?ul:e}function Kf(){(He===0||He===3||He===2)&&(He=4),Ke===null||!(cs&268435455)&&!(Bl&268435455)||ar(Ke,et)}function ml(e,t){var n=he;he|=2;var r=T0();(Ke!==e||et!==t)&&(Dn=null,ss(e,t));do try{jw();break}catch(s){A0(e,s)}while(!0);if(Af(),he=n,cl.current=r,$e!==null)throw Error(U(261));return Ke=null,et=0,He}function jw(){for(;$e!==null;)O0($e)}function Sw(){for(;$e!==null&&!G1();)O0($e)}function O0(e){var t=L0(e.alternate,e,Tt);e.memoizedProps=e.pendingProps,t===null?_0(e):$e=t,Vf.current=null}function _0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xw(n,t),n!==null){n.flags&=32767,$e=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{He=6,$e=null;return}}else if(n=gw(n,t,Tt),n!==null){$e=n;return}if(t=t.sibling,t!==null){$e=t;return}$e=t=e}while(t!==null);He===0&&(He=5)}function Br(e,t,n){var r=be,s=Gt.transition;try{Gt.transition=null,be=1,Cw(e,t,n,r)}finally{Gt.transition=s,be=r}return null}function Cw(e,t,n,r){do qs();while(vr!==null);if(he&6)throw Error(U(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(U(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ib(e,i),e===Ke&&($e=Ke=null,et=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||yo||(yo=!0,D0(Ko,function(){return qs(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Gt.transition,Gt.transition=null;var o=be;be=1;var l=he;he|=4,Vf.current=null,vw(e,n),E0(n,e),Hb(qc),Yo=!!Vc,qc=Vc=null,e.current=n,bw(n),Y1(),he=l,be=o,Gt.transition=i}else e.current=n;if(yo&&(yo=!1,vr=e,fl=s),i=e.pendingLanes,i===0&&(Er=null),Z1(n.stateNode),Pt(e,ze()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(dl)throw dl=!1,e=cd,cd=null,e;return fl&1&&e.tag!==0&&qs(),i=e.pendingLanes,i&1?e===dd?aa++:(aa=0,dd=e):aa=0,zr(),null}function qs(){if(vr!==null){var e=mx(fl),t=Gt.transition,n=be;try{if(Gt.transition=null,be=16>e?16:e,vr===null)var r=!1;else{if(e=vr,vr=null,fl=0,he&6)throw Error(U(331));var s=he;for(he|=4,X=e.current;X!==null;){var i=X,o=i.child;if(X.flags&16){var l=i.deletions;if(l!==null){for(var u=0;u<l.length;u++){var c=l[u];for(X=c;X!==null;){var f=X;switch(f.tag){case 0:case 11:case 15:sa(8,f,i)}var d=f.child;if(d!==null)d.return=f,X=d;else for(;X!==null;){f=X;var m=f.sibling,g=f.return;if(S0(f),f===c){X=null;break}if(m!==null){m.return=g,X=m;break}X=g}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var N=v.sibling;v.sibling=null,v=N}while(v!==null)}}X=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,X=o;else e:for(;X!==null;){if(i=X,i.flags&2048)switch(i.tag){case 0:case 11:case 15:sa(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,X=x;break e}X=i.return}}var h=e.current;for(X=h;X!==null;){o=X;var p=o.child;if(o.subtreeFlags&2064&&p!==null)p.return=o,X=p;else e:for(o=h;X!==null;){if(l=X,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:$l(9,l)}}catch(C){Me(l,l.return,C)}if(l===o){X=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,X=w;break e}X=l.return}}if(he=s,zr(),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(_l,e)}catch{}r=!0}return r}finally{be=n,Gt.transition=t}}return!1}function Bh(e,t,n){t=fi(n,t),t=m0(e,t,1),e=kr(e,t,1),t=pt(),e!==null&&(Ua(e,1,t),Pt(e,t))}function Me(e,t,n){if(e.tag===3)Bh(e,e,n);else for(;t!==null;){if(t.tag===3){Bh(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Er===null||!Er.has(r))){e=fi(n,e),e=h0(t,e,1),t=kr(t,e,1),e=pt(),t!==null&&(Ua(t,1,e),Pt(t,e));break}}t=t.return}}function kw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=pt(),e.pingedLanes|=e.suspendedLanes&n,Ke===e&&(et&n)===n&&(He===4||He===3&&(et&130023424)===et&&500>ze()-Hf?ss(e,0):qf|=n),Pt(e,t)}function M0(e,t){t===0&&(e.mode&1?(t=oo,oo<<=1,!(oo&130023424)&&(oo=4194304)):t=1);var n=pt();e=Wn(e,t),e!==null&&(Ua(e,t,n),Pt(e,n))}function Ew(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),M0(e,n)}function Pw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(U(314))}r!==null&&r.delete(t),M0(e,n)}var L0;L0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)Ct=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ct=!1,pw(e,t,n);Ct=!!(e.flags&131072)}else Ct=!1,Ee&&t.flags&1048576&&Fx(t,rl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Lo(e,t),e=t.pendingProps;var s=li(t,ot.current);Vs(t,n),s=If(null,t,r,e,s,n);var i=Ff();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Et(r)?(i=!0,tl(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,_f(t),s.updater=Ul,t.stateNode=s,s._reactInternals=t,Zc(t,r,e,n),t=nd(null,t,r,!0,i,n)):(t.tag=0,Ee&&i&&kf(t),dt(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Lo(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Aw(r),e=tn(r,e),s){case 0:t=td(null,t,r,e,n);break e;case 1:t=Oh(null,t,r,e,n);break e;case 11:t=Ah(null,t,r,e,n);break e;case 14:t=Th(null,t,r,tn(r.type,e),n);break e}throw Error(U(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:tn(r,s),td(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:tn(r,s),Oh(e,t,r,s,n);case 3:e:{if(y0(t),e===null)throw Error(U(387));
vendor: 4,674 bytes, line 40
40r=t.pendingProps,i=t.memoizedState,s=i.element,Hx(e,t),al(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=fi(Error(U(423)),t),t=_h(e,t,r,n,s);break e}else if(r!==s){s=fi(Error(U(424)),t),t=_h(e,t,r,n,s);break e}else for(_t=Cr(t.stateNode.containerInfo.firstChild),Lt=t,Ee=!0,an=null,n=Vx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ui(),r===s){t=Qn(e,t,n);break e}dt(e,t,r,n)}t=t.child}return t;case 5:return Wx(t),e===null&&Yc(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Hc(r,s)?o=null:i!==null&&Hc(r,i)&&(t.flags|=32),x0(e,t),dt(e,t,o,n),t.child;case 6:return e===null&&Yc(t),null;case 13:return v0(e,t,n);case 4:return Mf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ci(t,null,r,n):dt(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:tn(r,s),Ah(e,t,r,s,n);case 7:return dt(e,t,t.pendingProps,n),t.child;case 8:return dt(e,t,t.pendingProps.children,n),t.child;case 12:return dt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,je(sl,r._currentValue),r._currentValue=o,i!==null)if(mn(i.value,o)){if(i.children===s.children&&!kt.current){t=Qn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=Bn(-1,n&-n),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Xc(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(U(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Xc(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}dt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Vs(t,n),s=Yt(s),r=r(s),t.flags|=1,dt(e,t,r,n),t.child;case 14:return r=t.type,s=tn(r,t.pendingProps),s=tn(r.type,s),Th(e,t,r,s,n);case 15:return p0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:tn(r,s),Lo(e,t),t.tag=1,Et(r)?(e=!0,tl(t)):e=!1,Vs(t,n),f0(t,r,s),Zc(t,r,s,n),nd(null,t,r,!0,e,n);case 19:return b0(e,t,n);case 22:return g0(e,t,n)}throw Error(U(156,t.tag))};function D0(e,t){return ux(e,t)}function Rw(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 Kt(e,t,n,r){return new Rw(e,t,n,r)}function Gf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Aw(e){if(typeof e=="function")return Gf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hf)return 11;if(e===pf)return 14}return 2}function Rr(e,t){var n=e.alternate;return n===null?(n=Kt(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 Io(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Gf(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ps:return is(n.children,s,i,t);case mf:o=8,s|=8;break;case jc:return e=Kt(12,n,t,s|2),e.elementType=jc,e.lanes=i,e;case Sc:return e=Kt(13,n,t,s),e.elementType=Sc,e.lanes=i,e;case Cc:return e=Kt(19,n,t,s),e.elementType=Cc,e.lanes=i,e;case Wg:return Vl(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qg:o=10;break e;case Hg:o=9;break e;case hf:o=11;break e;case pf:o=14;break e;case tr:o=16,r=null;break e}throw Error(U(130,e==null?e:typeof e,""))}return t=Kt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function is(e,t,n,r){return e=Kt(7,e,r,t),e.lanes=n,e}function Vl(e,t,n,r){return e=Kt(22,e,r,t),e.elementType=Wg,e.lanes=n,e.stateNode={isHidden:!1},e}
vendor: 5,691 bytes, line 40
40function rc(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function sc(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tw(e,t,n,r,s){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=Iu(0),this.expirationTimes=Iu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Iu(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Yf(e,t,n,r,s,i,o,l,u){return e=new Tw(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_f(i),e}function Ow(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Es,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function z0(e){if(!e)return Or;e=e._reactInternals;e:{if(ys(e)!==e||e.tag!==1)throw Error(U(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Et(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(U(171))}if(e.tag===1){var n=e.type;if(Et(n))return zx(e,n,t)}return t}function I0(e,t,n,r,s,i,o,l,u){return e=Yf(n,r,!0,e,s,i,o,l,u),e.context=z0(null),n=e.current,r=pt(),s=Pr(n),i=Bn(r,s),i.callback=t??null,kr(n,i,s),e.current.lanes=s,Ua(e,s,r),Pt(e,r),e}function ql(e,t,n,r){var s=t.current,i=pt(),o=Pr(s);return n=z0(n),t.context===null?t.context=n:t.pendingContext=n,t=Bn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=kr(s,t,o),e!==null&&(dn(e,s,o,i),Oo(e,s,o)),o}function hl(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 Vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Xf(e,t){Vh(e,t),(e=e.alternate)&&Vh(e,t)}function _w(){return null}var F0=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jf(e){this._internalRoot=e}Hl.prototype.render=Jf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(U(409));ql(e,t,null,null)};Hl.prototype.unmount=Jf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ds(function(){ql(null,e,null,null)}),t[Hn]=null}};function Hl(e){this._internalRoot=e}Hl.prototype.unstable_scheduleHydration=function(e){if(e){var t=gx();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ir.length&&t!==0&&t<ir[n].priority;n++);ir.splice(n,0,e),n===0&&yx(e)}};function Zf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function qh(){}function Mw(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=hl(o);i.call(c)}}var o=I0(t,r,e,0,null,!1,!1,"",qh);return e._reactRootContainer=o,e[Hn]=o.current,ba(e.nodeType===8?e.parentNode:e),ds(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var c=hl(u);l.call(c)}}var u=Yf(e,0,!1,null,null,!1,!1,"",qh);return e._reactRootContainer=u,e[Hn]=u.current,ba(e.nodeType===8?e.parentNode:e),ds(function(){ql(t,u,n,r)}),u}function Ql(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var u=hl(o);l.call(u)}}ql(t,o,e,s)}else o=Mw(n,t,e,s,r);return hl(o)}hx=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qi(t.pendingLanes);n!==0&&(yf(t,n|1),Pt(t,ze()),!(he&6)&&(mi=ze()+500,zr()))}break;case 13:ds(function(){var r=Wn(e,1);if(r!==null){var s=pt();dn(r,e,1,s)}}),Xf(e,1)}};vf=function(e){if(e.tag===13){var t=Wn(e,134217728);if(t!==null){var n=pt();dn(t,e,134217728,n)}Xf(e,134217728)}};px=function(e){if(e.tag===13){var t=Pr(e),n=Wn(e,t);if(n!==null){var r=pt();dn(n,e,t,r)}Xf(e,t)}};gx=function(){return be};xx=function(e,t){var n=be;try{return be=e,t()}finally{be=n}};Lc=function(e,t,n){switch(t){case"input":if(Pc(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 s=zl(r);if(!s)throw Error(U(90));Kg(r),Pc(r,s)}}}break;case"textarea":Yg(e,n);break;case"select":t=n.value,t!=null&&Fs(e,!!n.multiple,t,!1)}};rx=Wf;sx=ds;var Lw={usingClientEntryPoint:!1,Events:[Ba,Os,zl,tx,nx,Wf]},$i={findFiberByHostInstance:qr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Dw={bundleType:$i.bundleType,version:$i.version,rendererPackageName:$i.rendererPackageName,rendererConfig:$i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Gn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ox(e),e===null?null:e.stateNode},findFiberByHostInstance:$i.findFiberByHostInstance||_w,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vo.isDisabled&&vo.supportsFiber)try{_l=vo.inject(Dw),Pn=vo}catch{}}zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lw;zt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zf(t))throw Error(U(200));return Ow(e,t,null,n)};zt.createRoot=function(e,t){if(!Zf(e))throw Error(U(299));var n=!1,r="",s=F0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Yf(e,1,!1,null,null,n,!1,r,s),e[Hn]=t.current,ba(e.nodeType===8?e.parentNode:e),new Jf(t)};zt.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(U(188)):(e=Object.keys(e).join(","),Error(U(268,e)));return e=ox(t),e=e===null?null:e.stateNode,e};zt.flushSync=function(e){return ds(e)};zt.hydrate=function(e,t,n){if(!Wl(t))throw Error(U(200));return Ql(null,e,t,!0,n)};zt.hydrateRoot=function(e,t,n){if(!Zf(e))throw Error(U(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=F0;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=I0(t,null,e,1,n??null,s,!1,i,o),e[Hn]=t.current,ba(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Hl(t)};zt.render=function(e,t,n){if(!Wl(t))throw Error(U(200));return Ql(null,e,t,!1,n)};zt.unmountComponentAtNode=function(e){if(!Wl(e))throw Error(U(40));return e._reactRootContainer?(ds(function(){Ql(null,null,e,!1,function(){e._reactRootContainer=null,e[Hn]=null})}),!0):!1};zt.unstable_batchedUpdates=Wf;zt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wl(n))throw Error(U(200));if(e==null||e._reactInternals===void 0)throw Error(U(38));return Ql(e,t,n,!1,r)};zt.version="18.3.1-next-f1338f8080-20240426";function U0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U0)}catch(e){console.error(e)}}U0(),Ug.exports=zt;var Kl=Ug.exports,$0,Hh=Kl;$0=Hh.createRoot,Hh.hydrateRoot;var ji=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(){}},fs=typeof window>"u"||"Deno"in globalThis;function Ht(){}function zw(e,t){return typeof e=="function"?e(t):e}function hd(e){return typeof e=="number"&&e>=0&&e!==1/0}function B0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hs(e,t){return typeof e=="function"?e(t):e}function on(e,t){return typeof e=="function"?e(t):e}function Wh(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==em(o,t.options))return!1}else if(!Ra(t.queryKey,o))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||i&&!i(t))}function Qh(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ms(t.options.mutationKey)!==ms(i))return!1}else if(!Ra(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function em(e,t){return((t==null?void 0:t.queryKeyHashFn)||ms)(e)}function ms(e){return JSON.stringify(e,(t,n)=>pd(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ra(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ra(e[n],t[n])):!1}function V0(e,t){if(e===t)return e;const n=Kh(e)&&Kh(t);if(n||pd(e)&&pd(t)){const r=n?e:Object.keys(e),s=r.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{};let u=0;for(let c=0;c<o;c++){const f=n?c:i[c];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=V0(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return s===o&&u===s?e:l}return t}function pl(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 Kh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pd(e){if(!Gh(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Gh(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gh(e){return Object.prototype.toString.call(e)==="[object Object]"}function Iw(e){return new Promise(t=>{setTimeout(t,e)})}function gd(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?V0(e,t):t}function Fw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Uw(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var tm=Symbol();function q0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===tm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Yr,lr,Ks,vg,$w=(vg=class extends ji{constructor(){super();te(this,Yr);te(this,lr);te(this,Ks);G(this,Ks,t=>{if(!fs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){S(this,lr)||this.setEventListener(S(this,Ks))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,lr))==null||t.call(this),G(this,lr,void 0))}setEventListener(t){var n;
vendor: 33,832 bytes, line 40
40G(this,Ks,t),(n=S(this,lr))==null||n.call(this),G(this,lr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){S(this,Yr)!==t&&(G(this,Yr,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof S(this,Yr)=="boolean"?S(this,Yr):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Yr=new WeakMap,lr=new WeakMap,Ks=new WeakMap,vg),nm=new $w,Gs,ur,Ys,bg,Bw=(bg=class extends ji{constructor(){super();te(this,Gs,!0);te(this,ur);te(this,Ys);G(this,Ys,t=>{if(!fs&&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(){S(this,ur)||this.setEventListener(S(this,Ys))}onUnsubscribe(){var t;this.hasListeners()||((t=S(this,ur))==null||t.call(this),G(this,ur,void 0))}setEventListener(t){var n;G(this,Ys,t),(n=S(this,ur))==null||n.call(this),G(this,ur,t(this.setOnline.bind(this)))}setOnline(t){S(this,Gs)!==t&&(G(this,Gs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return S(this,Gs)}},Gs=new WeakMap,ur=new WeakMap,Ys=new WeakMap,bg),gl=new Bw;function xd(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function Vw(e){return Math.min(1e3*2**e,3e4)}function H0(e){return(e??"online")==="online"?gl.isOnline():!0}var W0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ic(e){return e instanceof W0}function Q0(e){let t=!1,n=0,r=!1,s;const i=xd(),o=v=>{var N;r||(m(new W0(v)),(N=e.abort)==null||N.call(e))},l=()=>{t=!0},u=()=>{t=!1},c=()=>nm.isFocused()&&(e.networkMode==="always"||gl.isOnline())&&e.canRun(),f=()=>H0(e.networkMode)&&e.canRun(),d=v=>{var N;r||(r=!0,(N=e.onSuccess)==null||N.call(e,v),s==null||s(),i.resolve(v))},m=v=>{var N;r||(r=!0,(N=e.onError)==null||N.call(e,v),s==null||s(),i.reject(v))},g=()=>new Promise(v=>{var N;s=x=>{(r||c())&&v(x)},(N=e.onPause)==null||N.call(e)}).then(()=>{var v;s=void 0,r||(v=e.onContinue)==null||v.call(e)}),y=()=>{if(r)return;let v;const N=n===0?e.initialPromise:void 0;try{v=N??e.fn()}catch(x){v=Promise.reject(x)}Promise.resolve(v).then(d).catch(x=>{var E;if(r)return;const h=e.retry??(fs?0:3),p=e.retryDelay??Vw,w=typeof p=="function"?p(n,x):p,C=h===!0||typeof h=="number"&&n<h||typeof h=="function"&&h(n,x);if(t||!C){m(x);return}n++,(E=e.onFail)==null||E.call(e,n,x),Iw(w).then(()=>c()?void 0:g()).then(()=>{t?m(x):y()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:l,continueRetry:u,canStart:f,start:()=>(f()?y():g().then(y),i)}}var qw=e=>setTimeout(e,0);function Hw(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=qw;const i=l=>{t?e.push(l):s(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||o()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var qe=Hw(),Xr,wg,K0=(wg=class{constructor(){te(this,Xr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hd(this.gcTime)&&G(this,Xr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fs?1/0:5*60*1e3))}clearGcTimeout(){S(this,Xr)&&(clearTimeout(S(this,Xr)),G(this,Xr,void 0))}},Xr=new WeakMap,wg),Xs,Js,qt,Jr,st,La,Zr,nn,Ln,Ng,Ww=(Ng=class extends K0{constructor(t){super();te(this,nn);te(this,Xs);te(this,Js);te(this,qt);te(this,Jr);te(this,st);te(this,La);te(this,Zr);G(this,Zr,!1),G(this,La,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,Jr,t.client),G(this,qt,S(this,Jr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,Xs,Qw(this.options)),this.state=t.state??S(this,Xs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=S(this,st))==null?void 0:t.promise}setOptions(t){this.options={...S(this,La),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,qt).remove(this)}setData(t,n){const r=gd(this.state.data,t,this.options);return le(this,nn,Ln).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){le(this,nn,Ln).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=S(this,st))==null?void 0:r.promise;return(s=S(this,st))==null||s.cancel(t),n?n.then(Ht).catch(Ht):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(S(this,Xs))}isActive(){return this.observers.some(t=>on(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tm||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||!B0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,st))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=S(this,st))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),S(this,qt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(S(this,st)&&(S(this,Zr)?S(this,st).cancel({revert:!0}):S(this,st).cancelRetry()),this.scheduleGc()),S(this,qt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||le(this,nn,Ln).call(this,{type:"invalidate"})}fetch(t,n){var u,c,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(S(this,st))return S(this,st).continueRetry(),S(this,st).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(m=>m.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,s=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(G(this,Zr,!0),r.signal)})},i=()=>{const d=q0(this.options,n),m={client:S(this,Jr),queryKey:this.queryKey,meta:this.meta};return s(m),G(this,Zr,!1),this.options.persister?this.options.persister(d,m,this):d(m)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:S(this,Jr),state:this.state,fetchFn:i};s(o),(u=this.options.behavior)==null||u.onFetch(o,this),G(this,Js,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&le(this,nn,Ln).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const l=d=>{var m,g,y,v;ic(d)&&d.silent||le(this,nn,Ln).call(this,{type:"error",error:d}),ic(d)||((g=(m=S(this,qt).config).onError)==null||g.call(m,d,this),(v=(y=S(this,qt).config).onSettled)==null||v.call(y,this.state.data,d,this)),this.scheduleGc()};return G(this,st,Q0({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var m,g,y,v;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(N){l(N);return}(g=(m=S(this,qt).config).onSuccess)==null||g.call(m,d,this),(v=(y=S(this,qt).config).onSettled)==null||v.call(y,d,this.state.error,this),this.scheduleGc()},onError:l,onFail:(d,m)=>{le(this,nn,Ln).call(this,{type:"failed",failureCount:d,error:m})},onPause:()=>{le(this,nn,Ln).call(this,{type:"pause"})},onContinue:()=>{le(this,nn,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),S(this,st).start()}},Xs=new WeakMap,Js=new WeakMap,qt=new WeakMap,Jr=new WeakMap,st=new WeakMap,La=new WeakMap,Zr=new WeakMap,nn=new WeakSet,Ln=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,...G0(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 s=t.error;return ic(s)&&s.revert&&S(this,Js)?{...S(this,Js),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),qe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),S(this,qt).notify({query:this,type:"updated",action:t})})},Ng);function G0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Qw(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 Nn,jg,Kw=(jg=class extends ji{constructor(t={}){super();te(this,Nn);this.config=t,G(this,Nn,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??em(s,n);let o=this.get(i);return o||(o=new Ww({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){S(this,Nn).has(t.queryHash)||(S(this,Nn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=S(this,Nn).get(t.queryHash);n&&(t.destroy(),n===t&&S(this,Nn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return S(this,Nn).get(t)}getAll(){return[...S(this,Nn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Wh(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Wh(t,r)):n}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Nn=new WeakMap,jg),jn,lt,es,Sn,er,Sg,Gw=(Sg=class extends K0{constructor(t){super();te(this,Sn);te(this,jn);te(this,lt);te(this,es);this.mutationId=t.mutationId,G(this,lt,t.mutationCache),G(this,jn,[]),this.state=t.state||Y0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){S(this,jn).includes(t)||(S(this,jn).push(t),this.clearGcTimeout(),S(this,lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,jn,S(this,jn).filter(n=>n!==t)),this.scheduleGc(),S(this,lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){S(this,jn).length||(this.state.status==="pending"?this.scheduleGc():S(this,lt).remove(this))}continue(){var t;return((t=S(this,es))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,u,c,f,d,m,g,y,v,N,x,h,p,w,C,E,A,O;const n=()=>{le(this,Sn,er).call(this,{type:"continue"})};G(this,es,Q0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(L,D)=>{le(this,Sn,er).call(this,{type:"failed",failureCount:L,error:D})},onPause:()=>{le(this,Sn,er).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,lt).canRun(this)}));const r=this.state.status==="pending",s=!S(this,es).canStart();try{if(r)n();else{le(this,Sn,er).call(this,{type:"pending",variables:t,isPaused:s}),await((o=(i=S(this,lt).config).onMutate)==null?void 0:o.call(i,t,this));const D=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t));D!==this.state.context&&le(this,Sn,er).call(this,{type:"pending",context:D,variables:t,isPaused:s})}const L=await S(this,es).start();return await((f=(c=S(this,lt).config).onSuccess)==null?void 0:f.call(c,L,t,this.state.context,this)),await((m=(d=this.options).onSuccess)==null?void 0:m.call(d,L,t,this.state.context)),await((y=(g=S(this,lt).config).onSettled)==null?void 0:y.call(g,L,null,this.state.variables,this.state.context,this)),await((N=(v=this.options).onSettled)==null?void 0:N.call(v,L,null,t,this.state.context)),le(this,Sn,er).call(this,{type:"success",data:L}),L}catch(L){try{throw await((h=(x=S(this,lt).config).onError)==null?void 0:h.call(x,L,t,this.state.context,this)),await((w=(p=this.options).onError)==null?void 0:w.call(p,L,t,this.state.context)),await((E=(C=S(this,lt).config).onSettled)==null?void 0:E.call(C,void 0,L,this.state.variables,this.state.context,this)),await((O=(A=this.options).onSettled)==null?void 0:O.call(A,void 0,L,t,this.state.context)),L}finally{le(this,Sn,er).call(this,{type:"error",error:L})}}finally{S(this,lt).runNext(this)}}},jn=new WeakMap,lt=new WeakMap,es=new WeakMap,Sn=new WeakSet,er=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),qe.batch(()=>{S(this,jn).forEach(r=>{r.onMutationUpdate(t)}),S(this,lt).notify({mutation:this,type:"updated",action:t})})},Sg);function Y0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var In,rn,Da,Cg,Yw=(Cg=class extends ji{constructor(t={}){super();te(this,In);te(this,rn);te(this,Da);this.config=t,G(this,In,new Set),G(this,rn,new Map),G(this,Da,0)}build(t,n,r){const s=new Gw({mutationCache:this,mutationId:++to(this,Da)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){S(this,In).add(t);const n=bo(t);if(typeof n=="string"){const r=S(this,rn).get(n);r?r.push(t):S(this,rn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(S(this,In).delete(t)){const n=bo(t);if(typeof n=="string"){const r=S(this,rn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&S(this,rn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=bo(t);if(typeof n=="string"){const r=S(this,rn).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=bo(t);if(typeof n=="string"){const s=(r=S(this,rn).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){qe.batch(()=>{S(this,In).forEach(t=>{this.notify({type:"removed",mutation:t})}),S(this,In).clear(),S(this,rn).clear()})}getAll(){return Array.from(S(this,In))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Qh(n,r))}findAll(t={}){return this.getAll().filter(n=>Qh(t,n))}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return qe.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ht))))}},In=new WeakMap,rn=new WeakMap,Da=new WeakMap,Cg);function bo(e){var t;return(t=e.options.scope)==null?void 0:t.id}function xl(e){return{onFetch:(t,n)=>{var f,d,m,g,y;const r=t.options,s=(m=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:m.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let v=!1;const N=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},x=q0(t.options,t.fetchOptions),h=async(p,w,C)=>{if(v)return Promise.reject();if(w==null&&p.pages.length)return Promise.resolve(p);const E={client:t.client,queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};N(E);const A=await x(E),{maxPages:O}=t.options,L=C?Uw:Fw;return{pages:L(p.pages,A,O),pageParams:L(p.pageParams,w,O)}};if(s&&i.length){const p=s==="backward",w=p?X0:yd,C={pages:i,pageParams:o},E=w(r,C);l=await h(C,E,p)}else{const p=e??i.length;do{const w=u===0?o[0]??r.initialPageParam:yd(r,l);if(u>0&&w==null)break;l=await h(l,w),u++}while(u<p)}return l};t.options.persister?t.fetchFn=()=>{var v,N;return(N=(v=t.options).persister)==null?void 0:N.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function yd(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 X0(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}function Xw(e,t){return t?yd(e,t)!=null:!1}function Jw(e,t){return!t||!e.getPreviousPageParam?!1:X0(e,t)!=null}var _e,cr,dr,Zs,ei,fr,ti,ni,kg,Zw=(kg=class{constructor(e={}){te(this,_e);te(this,cr);te(this,dr);te(this,Zs);te(this,ei);te(this,fr);te(this,ti);te(this,ni);G(this,_e,e.queryCache||new Kw),G(this,cr,e.mutationCache||new Yw),G(this,dr,e.defaultOptions||{}),G(this,Zs,new Map),G(this,ei,new Map),G(this,fr,0)}mount(){to(this,fr)._++,S(this,fr)===1&&(G(this,ti,nm.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,_e).onFocus())})),G(this,ni,gl.subscribe(async e=>{e&&(await this.resumePausedMutations(),S(this,_e).onOnline())})))}unmount(){var e,t;to(this,fr)._--,S(this,fr)===0&&((e=S(this,ti))==null||e.call(this),G(this,ti,void 0),(t=S(this,ni))==null||t.call(this),G(this,ni,void 0))}isFetching(e){return S(this,_e).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return S(this,cr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,_e).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=S(this,_e).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Hs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return S(this,_e).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=S(this,_e).get(r.queryHash),i=s==null?void 0:s.state.data,o=zw(t,i);if(o!==void 0)return S(this,_e).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return qe.batch(()=>S(this,_e).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=S(this,_e).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=S(this,_e);qe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=S(this,_e);return qe.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=qe.batch(()=>S(this,_e).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Ht).catch(Ht)}invalidateQueries(e,t={}){return qe.batch(()=>(S(this,_e).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=qe.batch(()=>S(this,_e).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ht)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ht)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=S(this,_e).build(this,t);return n.isStaleByTime(Hs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ht).catch(Ht)}fetchInfiniteQuery(e){return e.behavior=xl(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ht).catch(Ht)}ensureInfiniteQueryData(e){return e.behavior=xl(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return gl.isOnline()?S(this,cr).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,_e)}getMutationCache(){return S(this,cr)}getDefaultOptions(){return S(this,dr)}setDefaultOptions(e){G(this,dr,e)}setQueryDefaults(e,t){S(this,Zs).set(ms(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...S(this,Zs).values()],n={};return t.forEach(r=>{Ra(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){S(this,ei).set(ms(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...S(this,ei).values()],n={};return t.forEach(r=>{Ra(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...S(this,dr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=em(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.queryFn===tm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...S(this,dr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){S(this,_e).clear(),S(this,cr).clear()}},_e=new WeakMap,cr=new WeakMap,dr=new WeakMap,Zs=new WeakMap,ei=new WeakMap,fr=new WeakMap,ti=new WeakMap,ni=new WeakMap,kg),wt,fe,za,ut,ts,ri,mr,hr,Ia,si,ii,ns,rs,pr,ai,ge,Gi,vd,bd,wd,Nd,jd,Sd,Cd,Z0,Eg,J0=(Eg=class extends ji{constructor(t,n){super();te(this,ge);te(this,wt);te(this,fe);te(this,za);te(this,ut);te(this,ts);te(this,ri);te(this,mr);te(this,hr);te(this,Ia);te(this,si);te(this,ii);te(this,ns);te(this,rs);te(this,pr);te(this,ai,new Set);this.options=n,G(this,wt,t),G(this,hr,null),G(this,mr,xd()),this.options.experimental_prefetchInRender||S(this,mr).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&&(S(this,fe).addObserver(this),Yh(S(this,fe),this.options)?le(this,ge,Gi).call(this):this.updateResult(),le(this,ge,Nd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kd(S(this,fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kd(S(this,fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,le(this,ge,jd).call(this),le(this,ge,Sd).call(this),S(this,fe).removeObserver(this)}setOptions(t){const n=this.options,r=S(this,fe);if(this.options=S(this,wt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof on(this.options.enabled,S(this,fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");le(this,ge,Cd).call(this),S(this,fe).setOptions(this.options),n._defaulted&&!pl(this.options,n)&&S(this,wt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,fe),observer:this});const s=this.hasListeners();s&&Xh(S(this,fe),r,this.options,n)&&le(this,ge,Gi).call(this),this.updateResult(),s&&(S(this,fe)!==r||on(this.options.enabled,S(this,fe))!==on(n.enabled,S(this,fe))||Hs(this.options.staleTime,S(this,fe))!==Hs(n.staleTime,S(this,fe)))&&le(this,ge,vd).call(this);const i=le(this,ge,bd).call(this);s&&(S(this,fe)!==r||on(this.options.enabled,S(this,fe))!==on(n.enabled,S(this,fe))||i!==S(this,pr))&&le(this,ge,wd).call(this,i)}getOptimisticResult(t){const n=S(this,wt).getQueryCache().build(S(this,wt),t),r=this.createResult(n,t);return t2(this,r)&&(G(this,ut,r),G(this,ri,this.options),G(this,ts,S(this,fe).state)),r}getCurrentResult(){return S(this,ut)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){S(this,ai).add(t)}getCurrentQuery(){return S(this,fe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=S(this,wt).defaultQueryOptions(t),r=S(this,wt).getQueryCache().build(S(this,wt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return le(this,ge,Gi).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,ut)))}createResult(t,n){var L;const r=S(this,fe),s=this.options,i=S(this,ut),o=S(this,ts),l=S(this,ri),c=t!==r?t.state:S(this,za),{state:f}=t;let d={...f},m=!1,g;if(n._optimisticResults){const D=this.hasListeners(),Z=!D&&Yh(t,n),Y=D&&Xh(t,r,n,s);(Z||Y)&&(d={...d,...G0(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:y,errorUpdatedAt:v,status:N}=d;g=d.data;let x=!1;if(n.placeholderData!==void 0&&g===void 0&&N==="pending"){let D;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(D=i.data,x=!0):D=typeof n.placeholderData=="function"?n.placeholderData((L=S(this,ii))==null?void 0:L.state.data,S(this,ii)):n.placeholderData,D!==void 0&&(N="success",g=gd(i==null?void 0:i.data,D,n),m=!0)}if(n.select&&g!==void 0&&!x)if(i&&g===(o==null?void 0:o.data)&&n.select===S(this,Ia))g=S(this,si);else try{G(this,Ia,n.select),g=n.select(g),g=gd(i==null?void 0:i.data,g,n),G(this,si,g),G(this,hr,null)}catch(D){G(this,hr,D)}S(this,hr)&&(y=S(this,hr),g=S(this,si),v=Date.now(),N="error");const h=d.fetchStatus==="fetching",p=N==="pending",w=N==="error",C=p&&h,E=g!==void 0,O={status:N,fetchStatus:d.fetchStatus,isPending:p,isSuccess:N==="success",isError:w,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:d.dataUpdatedAt,error:y,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:h,isRefetching:h&&!p,isLoadingError:w&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:w&&E,isStale:rm(t,n),refetch:this.refetch,promise:S(this,mr)};if(this.options.experimental_prefetchInRender){const D=z=>{O.status==="error"?z.reject(O.error):O.data!==void 0&&z.resolve(O.data)},Z=()=>{const z=G(this,mr,O.promise=xd());D(z)},Y=S(this,mr);switch(Y.status){case"pending":t.queryHash===r.queryHash&&D(Y);break;case"fulfilled":(O.status==="error"||O.data!==Y.value)&&Z();break;case"rejected":(O.status!=="error"||O.error!==Y.reason)&&Z();break}}return O}updateResult(){const t=S(this,ut),n=this.createResult(S(this,fe),this.options);if(G(this,ts,S(this,fe).state),G(this,ri,this.options),S(this,ts).data!==void 0&&G(this,ii,S(this,fe)),pl(n,t))return;G(this,ut,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!S(this,ai).size)return!0;const o=new Set(i??S(this,ai));return this.options.throwOnError&&o.add("error"),Object.keys(S(this,ut)).some(l=>{const u=l;return S(this,ut)[u]!==t[u]&&o.has(u)})};le(this,ge,Z0).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&le(this,ge,Nd).call(this)}},wt=new WeakMap,fe=new WeakMap,za=new WeakMap,ut=new WeakMap,ts=new WeakMap,ri=new WeakMap,mr=new WeakMap,hr=new WeakMap,Ia=new WeakMap,si=new WeakMap,ii=new WeakMap,ns=new WeakMap,rs=new WeakMap,pr=new WeakMap,ai=new WeakMap,ge=new WeakSet,Gi=function(t){le(this,ge,Cd).call(this);let n=S(this,fe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ht)),n},vd=function(){le(this,ge,jd).call(this);const t=Hs(this.options.staleTime,S(this,fe));if(fs||S(this,ut).isStale||!hd(t))return;const r=B0(S(this,ut).dataUpdatedAt,t)+1;G(this,ns,setTimeout(()=>{S(this,ut).isStale||this.updateResult()},r))},bd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,fe)):this.options.refetchInterval)??!1},wd=function(t){le(this,ge,Sd).call(this),G(this,pr,t),!(fs||on(this.options.enabled,S(this,fe))===!1||!hd(S(this,pr))||S(this,pr)===0)&&G(this,rs,setInterval(()=>{(this.options.refetchIntervalInBackground||nm.isFocused())&&le(this,ge,Gi).call(this)},S(this,pr)))},Nd=function(){le(this,ge,vd).call(this),le(this,ge,wd).call(this,le(this,ge,bd).call(this))},jd=function(){S(this,ns)&&(clearTimeout(S(this,ns)),G(this,ns,void 0))},Sd=function(){S(this,rs)&&(clearInterval(S(this,rs)),G(this,rs,void 0))},Cd=function(){const t=S(this,wt).getQueryCache().build(S(this,wt),this.options);if(t===S(this,fe))return;const n=S(this,fe);G(this,fe,t),G(this,za,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Z0=function(t){qe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(S(this,ut))}),S(this,wt).getQueryCache().notify({query:S(this,fe),type:"observerResultsUpdated"})})},Eg);function e2(e,t){return on(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Yh(e,t){return e2(e,t)||e.state.data!==void 0&&kd(e,t,t.refetchOnMount)}function kd(e,t,n){if(on(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&rm(e,t)}return!1}function Xh(e,t,n,r){return(e!==t||on(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&rm(e,n)}function rm(e,t){return on(t.enabled,e)!==!1&&e.isStaleByTime(Hs(t.staleTime,e))}function t2(e,t){return!pl(e.getCurrentResult(),t)}var n2=class extends J0{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:xl()})}getOptimisticResult(e){return e.behavior=xl(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var y,v;const{state:n}=e,r=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:o,isRefetchError:l}=r,u=(v=(y=n.fetchMeta)==null?void 0:y.fetchMore)==null?void 0:v.direction,c=o&&u==="forward",f=s&&u==="forward",d=o&&u==="backward",m=s&&u==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Xw(t,n.data),hasPreviousPage:Jw(t,n.data),isFetchNextPageError:c,isFetchingNextPage:f,isFetchPreviousPageError:d,isFetchingPreviousPage:m,isRefetchError:l&&!c&&!d,isRefetching:i&&!f&&!m}}},gr,xr,Nt,Fn,Vn,Fo,Ed,Pg,r2=(Pg=class extends ji{constructor(n,r){super();te(this,Vn);te(this,gr);te(this,xr);te(this,Nt);te(this,Fn);G(this,gr,n),this.setOptions(r),this.bindMethods(),le(this,Vn,Fo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=S(this,gr).defaultMutationOptions(n),pl(this.options,r)||S(this,gr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:S(this,Nt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ms(r.mutationKey)!==ms(this.options.mutationKey)?this.reset():((s=S(this,Nt))==null?void 0:s.state.status)==="pending"&&S(this,Nt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=S(this,Nt))==null||n.removeObserver(this)}onMutationUpdate(n){le(this,Vn,Fo).call(this),le(this,Vn,Ed).call(this,n)}getCurrentResult(){return S(this,xr)}reset(){var n;(n=S(this,Nt))==null||n.removeObserver(this),G(this,Nt,void 0),le(this,Vn,Fo).call(this),le(this,Vn,Ed).call(this)}mutate(n,r){var s;return G(this,Fn,r),(s=S(this,Nt))==null||s.removeObserver(this),G(this,Nt,S(this,gr).getMutationCache().build(S(this,gr),this.options)),S(this,Nt).addObserver(this),S(this,Nt).execute(n)}},gr=new WeakMap,xr=new WeakMap,Nt=new WeakMap,Fn=new WeakMap,Vn=new WeakSet,Fo=function(){var r;const n=((r=S(this,Nt))==null?void 0:r.state)??Y0();G(this,xr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ed=function(n){qe.batch(()=>{var r,s,i,o,l,u,c,f;if(S(this,Fn)&&this.hasListeners()){const d=S(this,xr).variables,m=S(this,xr).context;(n==null?void 0:n.type)==="success"?((s=(r=S(this,Fn)).onSuccess)==null||s.call(r,n.data,d,m),(o=(i=S(this,Fn)).onSettled)==null||o.call(i,n.data,null,d,m)):(n==null?void 0:n.type)==="error"&&((u=(l=S(this,Fn)).onError)==null||u.call(l,n.error,d,m),(f=(c=S(this,Fn)).onSettled)==null||f.call(c,void 0,n.error,d,m))}
40this.listeners.forEach(d=>{d(S(this,xr))})})},Pg),ey=b.createContext(void 0),xe=e=>{const t=b.useContext(ey);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},s2=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(ey.Provider,{value:e,children:t})),ty=b.createContext(!1),i2=()=>b.useContext(ty);ty.Provider;function a2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o2=b.createContext(a2()),l2=()=>b.useContext(o2);function ny(e,t){return typeof e=="function"?e(...t):!!e}function Pd(){}var u2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},c2=e=>{b.useEffect(()=>{e.clearReset()},[e])},d2=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||ny(n,[e.error,r])),f2=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},m2=(e,t)=>e.isLoading&&e.isFetching&&!t,h2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Jh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ry(e,t,n){var d,m,g,y,v;const r=xe(),s=i2(),i=l2(),o=r.defaultQueryOptions(e);(m=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||m.call(d,o),o._optimisticResults=s?"isRestoring":"optimistic",f2(o),u2(o,i),c2(i);const l=!r.getQueryCache().get(o.queryHash),[u]=b.useState(()=>new t(r,o)),c=u.getOptimisticResult(o),f=!s&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(N=>{const x=f?u.subscribe(qe.batchCalls(N)):Pd;return u.updateResult(),x},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),b.useEffect(()=>{u.setOptions(o)},[o,u]),h2(o,c))throw Jh(o,u,i);if(d2({result:c,errorResetBoundary:i,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((y=(g=r.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||y.call(g,o,c),o.experimental_prefetchInRender&&!fs&&m2(c,s)){const N=l?Jh(o,u,i):(v=r.getQueryCache().get(o.queryHash))==null?void 0:v.promise;N==null||N.catch(Pd).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?c:u.trackResult(c)}function Tn(e,t){return ry(e,J0)}function ye(e,t){const n=xe(),[r]=b.useState(()=>new r2(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const s=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(qe.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=b.useCallback((o,l)=>{r.mutate(o,l).catch(Pd)},[r]);if(s.error&&ny(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function p2(e,t){return ry(e,n2)}const sy=new Zw({defaultOptions:{queries:{staleTime:1e3*60,gcTime:1e3*60*5,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:!0}}});/** 41 * @remix-run/router v1.23.0 42 * 43 * Copyright (c) Remix Software Inc. 44 * 45 * This source code is licensed under the MIT license found in the 46 * LICENSE.md file in the root directory of this source tree. 47 * 48 * @license MIT 49 */function Aa(){return Aa=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},Aa.apply(this,arguments)}var br;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(br||(br={}));const Zh="popstate";function g2(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:l}=r.location;return Rd("",{pathname:i,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:yl(s)}return y2(t,n,null,e)}function Ae(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function iy(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function x2(){return Math.random().toString(36).substr(2,8)}function ep(e,t){return{usr:e.state,key:e.key,idx:t}}function Rd(e,t,n,r){return n===void 0&&(n=null),Aa({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Si(t):t,{state:n,key:t&&t.key||r||x2()})}function yl(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 Si(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}function y2(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,l=br.Pop,u=null,c=f();c==null&&(c=0,o.replaceState(Aa({},o.state,{idx:c}),""));function f(){return(o.state||{idx:null}).idx}function d(){l=br.Pop;let N=f(),x=N==null?null:N-c;c=N,u&&u({action:l,location:v.location,delta:x})}function m(N,x){l=br.Push;let h=Rd(v.location,N,x);c=f()+1;let p=ep(h,c),w=v.createHref(h);try{o.pushState(p,"",w)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(w)}i&&u&&u({action:l,location:v.location,delta:1})}function g(N,x){l=br.Replace;let h=Rd(v.location,N,x);c=f();let p=ep(h,c),w=v.createHref(h);o.replaceState(p,"",w),i&&u&&u({action:l,location:v.location,delta:0})}function y(N){let x=s.location.origin!=="null"?s.location.origin:s.location.href,h=typeof N=="string"?N:yl(N);return h=h.replace(/ $/,"%20"),Ae(x,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,x)}let v={get action(){return l},get location(){return e(s,o)},listen(N){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Zh,d),u=N,()=>{s.removeEventListener(Zh,d),u=null}},createHref(N){return t(s,N)},createURL:y,encodeLocation(N){let x=y(N);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:m,replace:g,go(N){return o.go(N)}};return v}var tp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tp||(tp={}));function v2(e,t,n){return n===void 0&&(n="/"),b2(e,t,n,!1)}function b2(e,t,n,r){let s=typeof t=="string"?Si(t):t,i=hi(s.pathname||"/",n);if(i==null)return null;let o=ay(e);w2(o);let l=null;for(let u=0;l==null&&u<o.length;++u){let c=O2(i);l=A2(o[u],c,r)}return l}function ay(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,l)=>{let u={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};u.relativePath.startsWith("/")&&(Ae(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not val
49id. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Ar([r,u.relativePath]),f=n.concat(u);i.children&&i.children.length>0&&(Ae(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),ay(i.children,t,f,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:P2(c,i.index),routesMeta:f})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,o);else for(let u of oy(i.path))s(i,o,u)}),t}function oy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=oy(r.join("/")),l=[];return l.push(...o.map(u=>u===""?i:[i,u].join("/"))),s&&l.push(...o),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function w2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:R2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const N2=/^:[\w-]+$/,j2=3,S2=2,C2=1,k2=10,E2=-2,np=e=>e==="*";function P2(e,t){let n=e.split("/"),r=n.length;return n.some(np)&&(r+=E2),t&&(r+=S2),n.filter(s=>!np(s)).reduce((s,i)=>s+(N2.test(i)?j2:i===""?C2:k2),r)}function R2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function A2(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let l=0;l<r.length;++l){let u=r[l],c=l===r.length-1,f=i==="/"?t:t.slice(i.length)||"/",d=vl({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},f),m=u.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=vl({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},f)),!d)return null;
vendor: 9,319 bytes, lines 49-58
49Object.assign(s,d.params),o.push({params:s,pathname:Ar([i,d.pathname]),pathnameBase:D2(Ar([i,d.pathnameBase])),route:m}),d.pathnameBase!=="/"&&(i=Ar([i,d.pathnameBase]))}return o}function vl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=T2(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((c,f,d)=>{let{paramName:m,isOptional:g}=f;if(m==="*"){let v=l[d]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const y=l[d];return g&&!y?c[m]=void 0:c[m]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function T2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),iy(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function O2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return iy(!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 hi(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 _2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Si(e):e;return{pathname:n?n.startsWith("/")?n:M2(n,t):t,search:z2(r),hash:I2(s)}}function M2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function ac(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 L2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function sm(e,t){let n=L2(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function im(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Si(e):(s=Aa({},e),Ae(!s.pathname||!s.pathname.includes("?"),ac("?","pathname","search",s)),Ae(!s.pathname||!s.pathname.includes("#"),ac("#","pathname","hash",s)),Ae(!s.search||!s.search.includes("#"),ac("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),d-=1;s.pathname=m.join("/")}l=d>=0?t[d]:"/"}let u=_2(s,l),c=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}const Ar=e=>e.join("/").replace(/\/\/+/g,"/"),D2=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),z2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,I2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function F2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ly=["post","put","patch","delete"];new Set(ly);const U2=["get",...ly];new Set(U2);/** 50 * React Router v6.30.0 51 * 52 * Copyright (c) Remix Software Inc. 53 * 54 * This source code is licensed under the MIT license found in the 55 * LICENSE.md file in the root directory of this source tree. 56 * 57 * @license MIT 58 */function Ta(){return Ta=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},Ta.apply(this,arguments)}const Gl=b.createContext(null),uy=b.createContext(null),Yn=b.createContext(null),Yl=b.createContext(null),Xn=b.createContext({outlet:null,matches:[],isDataRoute:!1}),cy=b.createContext(null);function $2(e,t){let{relative:n}=t===void 0?{}:t;Ci()||Ae(!1);let{basename:r,navigator:s}=b.useContext(Yn),{hash:i,pathname:o,search:l}=Jl(e,{relative:n}),u=o;return r!=="/"&&(u=o==="/"?r:Ar([r,o])),s.createHref({pathname:u,search:l,hash:i})}function Ci(){return b.useContext(Yl)!=null}function hn(){return Ci()||Ae(!1),b.useContext(Yl).location}function dy(e){b.useContext(Yn).static||b.useLayoutEffect(e)}function yt(){let{isDataRoute:e}=b.useContext(Xn);return e?eN():B2()}function B2(){Ci()||Ae(!1);let e=b.useContext(Gl),{basename:t,future:n,navigator:r}=b.useContext(Yn),{matches:s}=b.useContext(Xn),{pathname:i}=hn(),o=JSON.stringify(sm(s,n.v7_relativeSplatPath)),l=b.useRef(!1);return dy(()=>{l.current=!0}),b.useCallback(function(c,f){if(f===void 0&&(f={}),!l.current)return;if(typeof c=="number"){r.go(c);return}let d=im(c,JSON.parse(o),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Ar([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,o,i,e])}function Xl(){let{matches:e}=b.useContext(Xn),t=e[e.length-1];return t?t.params:{}}function Jl(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(Yn),{matches:s}=b.useContext(Xn),{pathname:i}=hn(),o=JSON.stringify(sm(s,r.v7_relativeSplatPath));return b.useMemo(()=>im(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function V2(e,t){return q2(e,t)}function q2(e,t,n,r){Ci()||Ae(!1);let{navigator:s,static:i}=b.useContext(Yn),{matches:o}=b.useContext(Xn),l=o[o.length-1],u=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let f=hn(),d;if(t){var m;let x=typeof t=="string"?Si(t):t;c==="/"||(m=x.pathname)!=null&&m.startsWith(c)||Ae(!1),d=x}else d=f;let g=d.pathname||"/",y=g;if(c!=="/"){let x=c.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(x.length).join("/")}let v=!i&&n&&n.matches&&n.matches.length>0?n.matches:v2(e,{pathname:y}),N=G2(v&&v.map(x=>Object.assign({},x,{params:Object.assign({},u,x.params),pathname:Ar([c,s.encodeLocation?s.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Ar([c,s.encodeLocation?s.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),o,n,r);return t&&N?b.createElement(Yl.Provider,{value:{location:Ta({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:br.Pop}},N):N}function H2(){let e=Z2(),t=F2(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,null)}const W2=b.createElement(H2,null);class Q2 extends b.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?b.createElement(Xn.Provider,{value:this.props.routeContext},b.createElement(cy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function K2(e){let{routeContext:t,match:n,children:r}=e,s=b.useContext(Gl);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Xn.Provider,{value:t},r)}function G2(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let f=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);f>=0||Ae(!1),o=o.slice(0,Math.min(o.length,f+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<o.length;f++){let d=o[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=f),d.route.id){let{loaderData:m,errors:g}=n,y=d.route.loader&&m[d.route.id]===void 0&&(!g||g[d.route.id]===void 0);if(d.route.lazy||y){u=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((f,d,m)=>{let g,y=!1,v=null,N=null;n&&(g=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||W2,u&&(c<0&&m===0?(y=!0,N=null):c===m&&(y=!0,N=d.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,m+1)),h=()=>{let p;return g?p=v:y?p=N:d.route.Component?p=b.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=f,b.createElement(K2,{match:d,routeC
58ontext:{outlet:f,matches:x,isDataRoute:n!=null},children:p})};return n&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?b.createElement(Q2,{location:n.location,revalidation:n.revalidation,component:v,error:g,children:h(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):h()},null)}var fy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(fy||{}),bl=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}(bl||{});function Y2(e){let t=b.useContext(Gl);return t||Ae(!1),t}function X2(e){let t=b.useContext(uy);return t||Ae(!1),t}function J2(e){let t=b.useContext(Xn);return t||Ae(!1),t}function my(e){let t=J2(),n=t.matches[t.matches.length-1];return n.route.id||Ae(!1),n.route.id}function Z2(){var e;let t=b.useContext(cy),n=X2(bl.UseRouteError),r=my(bl.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function eN(){let{router:e}=Y2(fy.UseNavigateStable),t=my(bl.UseNavigateStable),n=b.useRef(!1);return dy(()=>{n.current=!0}),b.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ta({fromRouteId:t},i)))},[e,t])}function tN(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Oa(e){let{to:t,replace:n,state:r,relative:s}=e;Ci()||Ae(!1);let{future:i,static:o}=b.useContext(Yn),{matches:l}=b.useContext(Xn),{pathname:u}=hn(),c=yt(),f=im(t,sm(l,i.v7_relativeSplatPath),u,s==="path"),d=JSON.stringify(f);return b.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:s}),[c,d,s,n,r]),null}function We(e){Ae(!1)}function nN(e){let{basename:t="/",children:n=null,location:r,navigationType:s=br.Pop,navigator:i,static:o=!1,future:l}=e;Ci()&&Ae(!1);let u=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:u,navigator:i,static:o,future:Ta({v7_relativeSplatPath:!1},l)}),[u,l,i,o]);typeof r=="string"&&(r=Si(r));let{pathname:f="/",search:d="",hash:m="",state:g=null,key:y="default"}=r,v=b.useMemo(()=>{let N=hi(f,u);return N==null?null:{location:{pathname:N,search:d,hash:m,state:g,key:y},navigationType:s}},[u,f,d,m,g,y,s]);return v==null?null:b.createElement(Yn.Provider,{value:c},b.createElement(Yl.Provider,{children:n,value:v}))}function Ad(e){let{children:t,location:n}=e;return V2(Td(t),n)}new Promise(()=>{});function Td(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let i=[...t,s];if(r.type===b.Fragment){n.push.apply(n,Td(r.props.children,i));return}r.type!==We&&Ae(!1),!r.props.index||!r.props.children||Ae(!1);let o={id:r.props.id||i.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=Td(r.props.children,i)),n.push(o)}),n}/** 59 * React Router DOM v6.30.0 60 * 61 * Copyright (c) Remix Software Inc. 62 * 63 * This source code is licensed under the MIT license found in the 64 * LICENSE.md file in the root directory of this source tree. 65 * 66 * @license MIT 67 */function wl(){return wl=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},wl.apply(this,arguments)}function hy(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function rN(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sN(e,t){return e.button===0&&(!t||t==="_self")&&!rN(e)}function Od(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function iN(e,t){let n=Od(e);return t&&t.forEach((r,s)=>
67{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const aN=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],oN=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],lN="6";try{window.__reactRouterVersion=lN}catch{}const uN=b.createContext({isTransitioning:!1}),cN="startTransition",rp=k1[cN];function dN(e){let{basename:t,children:n,future:r,window:s}=e,i=b.useRef();i.current==null&&(i.current=g2({window:s,v5Compat:!0}));let o=i.current,[l,u]=b.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},f=b.useCallback(d=>{c&&rp?rp(()=>u(d)):u(d)},[u,c]);return b.useLayoutEffect(()=>o.listen(f),[o,f]),b.useEffect(()=>tN(r),[r]),b.createElement(nN,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const fN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hN=b.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:l,target:u,to:c,preventScrollReset:f,viewTransition:d}=t,m=hy(t,aN),{basename:g}=b.useContext(Yn),y,v=!1;if(typeof c=="string"&&mN.test(c)&&(y=c,fN))try{let p=new URL(window.location.href),w=c.startsWith("//")?new URL(p.protocol+c):new URL(c),C=hi(w.pathname,g);w.origin===p.origin&&C!=null?c=C+w.search+w.hash:v=!0}catch{}let N=$2(c,{relative:s}),x=gN(c,{replace:o,state:l,target:u,preventScrollReset:f,relative:s,viewTransition:d});function h(p){r&&r(p),p.defaultPrevented||x(p)}return b.createElement("a",wl({},m,{href:y||N,onClick:v||i?r:h,ref:n,target:u}))}),Vt=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:l,to:u,viewTransition:c,children:f}=t,d=hy(t,oN),m=Jl(u,{relative:d.relative}),g=hn(),y=b.useContext(uy),{navigator:v,basename:N}=b.useContext(Yn),x=y!=null&&xN(m)&&c===!0,h=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,p=g.pathname,w=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;s||(p=p.toLowerCase(),w=w?w.toLowerCase():null,h=h.toLowerCase()),w&&N&&(w=hi(w,N)||w);const C=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let E=p===h||!o&&p.startsWith(h)&&p.charAt(C)==="/",A=w!=null&&(w===h||!o&&w.startsWith(h)&&w.charAt(h.length)==="/"),O={isActive:E,isPending:A,isTransitioning:x},L=E?r:void 0,D;typeof i=="function"?D=i(O):D=[i,E?"active":null,A?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let Z=typeof l=="function"?l(O):l;return b.createElement(hN,wl({},d,{"aria-current":L,className:D,ref:n,style:Z,to:u,viewTransition:c}),typeof f=="function"?f(O):f)});var _d;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_d||(_d={}));var sp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(sp||(sp={}));function pN(e){let t=b.useContext(Gl);return t||Ae(!1),t}function gN(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,u=yt(),c=hn(),f=Jl(e,{relative:o});return b.useCallback(d=>{if(sN(d,n)){d.preventDefault();let m=r!==void 0?r:yl(c)===yl(f);u(e,{replace:m,state:s,preventScrollReset:i,relative:o,viewTransition:l})}},[c,u,f,r,s,n,e,i,o,l])}function py(e){let t=b.useRef(Od(e)),n=b.useRef(!1),r=hn(),s=b.useMemo(()=>iN(r.search,n.current?null:t.current),[r.search]),i=yt(),o=b.useCallback((l,u)=>{const c=Od(typeof l=="function"?l(s):l);n.current=!0,i("?"+c,u)},[i,s]);return[s,o]}function xN(e,t){t===void 0&&(t={});let n=b.useContext(uN);n==null&&Ae(!1);let{basename:r}=pN(_d.useViewTransitionState),s=Jl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=hi(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=hi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return vl(s.pathname,o)!=null||vl(s.pathname,i)!=null}let yN={data:""},vN=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||yN,bN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,wN=/\/\*[^]*?\*\/| +/g,ip=/\n+/g,or=(e,t)=>
vendor: 2,426 bytes, line 67
67{let n="",r="",s="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+o+";":r+=i[1]=="f"?or(o,i):i+"{"+or(o,i[1]=="k"?"":t)+"}":typeof o=="object"?r+=or(o,t?t.replace(/([^,])+/g,l=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,l):l?l+" "+u:u)):i):o!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=or.p?or.p(i,o):i+":"+o+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Mn={},gy=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+gy(e[n]);return t}return e},NN=(e,t,n,r,s)=>{let i=gy(e),o=Mn[i]||(Mn[i]=(u=>{let c=0,f=11;for(;c<u.length;)f=101*f+u.charCodeAt(c++)>>>0;return"go"+f})(i));if(!Mn[o]){let u=i!==e?e:(c=>{let f,d,m=[{}];for(;f=bN.exec(c.replace(wN,""));)f[4]?m.shift():f[3]?(d=f[3].replace(ip," ").trim(),m.unshift(m[0][d]=m[0][d]||{})):m[0][f[1]]=f[2].replace(ip," ").trim();return m[0]})(e);Mn[o]=or(s?{["@keyframes "+o]:u}:u,n?"":"."+o)}let l=n&&Mn.g?Mn.g:null;return n&&(Mn.g=Mn[o]),((u,c,f,d)=>{d?c.data=c.data.replace(d,u):c.data.indexOf(u)===-1&&(c.data=f?u+c.data:c.data+u)})(Mn[o],t,r,l),o},jN=(e,t,n)=>e.reduce((r,s,i)=>{let o=t[i];if(o&&o.call){let l=o(n),u=l&&l.props&&l.props.className||/^go/.test(l)&&l;o=u?"."+u:l&&typeof l=="object"?l.props?"":or(l,""):l===!1?"":l}return r+s+(o??"")},"");function Zl(e){let t=this||{},n=e.call?e(t.p):e;return NN(n.unshift?n.raw?jN(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,vN(t.target),t.g,t.o,t.k)}let xy,Md,Ld;Zl.bind({g:1});let Kn=Zl.bind({k:1});function SN(e,t,n,r){or.p=t,xy=e,Md=n,Ld=r}function Ir(e,t){let n=this||{};return function(){let r=arguments;function s(i,o){let l=Object.assign({},i),u=l.className||s.className;n.p=Object.assign({theme:Md&&Md()},l),n.o=/ *go\d+/.test(u),l.className=Zl.apply(n,r)+(u?" "+u:"");let c=e;return e[0]&&(c=l.as||e,delete l.as),Ld&&c[0]&&Ld(l),xy(c,l)}return s}}var CN=e=>typeof e=="function",Nl=(e,t)=>CN(e)?e(t):e,kN=(()=>{let e=0;return()=>(++e).toString()})(),yy=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),EN=20,vy=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,EN)};case 1:return{...e,toasts:e.toasts.map(i=>i.id===t.toast.id?{...i,...t.toast}:i)};case 2:let{toast:n}=t;return vy(e,{type:e.toasts.find(i=>i.id===n.id)?1:0,toast:n});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(i=>
67i.id===r||r===void 0?{...i,dismissed:!0,visible:!1}:i)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(i=>i.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(i=>({...i,pauseDuration:i.pauseDuration+s}))}}},Uo=[],Qr={toasts:[],pausedAt:void 0},vs=e=>{Qr=vy(Qr,e),Uo.forEach(t=>{t(Qr)})},PN={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},RN=(e={})=>{let[t,n]=b.useState(Qr),r=b.useRef(Qr);b.useEffect(()=>(r.current!==Qr&&n(Qr),Uo.push(n),()=>{let i=Uo.indexOf(n);i>-1&&Uo.splice(i,1)}),[]);let s=t.toasts.map(i=>{var o,l,u;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((o=e[i.type])==null?void 0:o.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((l=e[i.type])==null?void 0:l.duration)||(e==null?void 0:e.duration)||PN[i.type],style:{...e.style,...(u=e[i.type])==null?void 0:u.style,...i.style}}});return{...t,toasts:s}},AN=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||kN()}),qa=e=>(t,n)=>{let r=AN(t,e,n);return vs({type:2,toast:r}),r.id},ft=(e,t)=>qa("blank")(e,t);ft.error=qa("error");ft.success=qa("success");ft.loading=qa("loading");ft.custom=qa("custom");ft.dismiss=e=>{vs({type:3,toastId:e})};ft.remove=e=>vs({type:4,toastId:e});ft.promise=(e,t,n)=>{let r=ft.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?Nl(t.success,s):void 0;return i?ft.success(i,{id:r,...n,...n==null?void 0:n.success}):ft.dismiss(r),s}).catch(s=>{let i=t.error?Nl(t.error,s):void 0;i?ft.error(i,{id:r,...n,...n==null?void 0:n.error}):ft.dismiss(r)}),e};var TN=(e,t)=>{vs({type:1,toast:{id:e,height:t}})},ON=()=>{vs({type:5,time:Date.now()})},oa=new Map,_N=1e3,MN=(e,t=_N)=>{if(oa.has(e))return;let n=setTimeout(()=>{oa.delete(e),vs({type:4,toastId:e})},t);oa.set(e,n)},LN=e=>{let{toasts:t,pausedAt:n}=RN(e);b.useEffect(()=>{if(n)return;let i=Date.now(),o=t.map(l=>{if(l.duration===1/0)return;let u=(l.duration||0)+l.pauseDuration-(i-l.createdAt);if(u<0){l.visible&&ft.dismiss(l.id);return}return setTimeout(()=>ft.dismiss(l.id),u)});return()=>{o.forEach(l=>l&&clearTimeout(l))}},[t,n]);let r=b.useCallback(()=>{n&&vs({type:6,time:Date.now()})},[n]),s=b.useCallback((i,o)=>{let{reverseOrder:l=!1,gutter:u=8,defaultPosition:c}=o||{},f=t.filter(g=>(g.position||c)===(i.position||c)&&g.height),d=f.findIndex(g=>g.id===i.id),m=f.filter((g,y)=>y<d&&g.visible).length;return f.filter(g=>g.visible).slice(...l?[m+1]:[0,m]).reduce((g,y)=>g+(y.height||0)+u,0)},[t]);return b.useEffect(()=>{t.forEach(i=>{if(i.dismissed)MN(i.id,i.removeDelay);else{let o=oa.get(i.id);o&&(clearTimeout(o),oa.delete(i.id))}})},[t]),{toasts:t,handlers:{updateHeight:TN,startPause:ON,endPause:r,calculateOffset:s}}},DN=Kn` 68from { 69 transform: scale(0) rotate(45deg); 70 opacity: 0; 71} 72to { 73 transform: scale(1) rotate(45deg); 74 opacity: 1; 75}`,zN=Kn` 76from { 77 transform: scale(0); 78 opacity: 0; 79} 80to { 81 transform: scale(1); 82 opacity: 1; 83}`,IN=Kn` 84from { 85 transform: scale(0) rotate(90deg); 86 opacity: 0; 87} 88to { 89 transform: scale(1) rotate(90deg); 90 opacity: 1; 91}`,FN=Ir("div")` 92 width: 20px; 93 opacity: 0; 94 height: 20px; 95 border-radius: 10px; 96 background: ${e=>e.primary||"#ff4b4b"}; 97 position: relative; 98 transform: rotate(45deg); 99 100 animation: ${DN} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 101 forwards; 102 animation-delay: 100ms; 103 104 &:after, 105 &:before { 106 content: ''; 107 animation: ${zN} 0.15s ease-out forwards; 108 animation-delay: 150ms; 109 position: absolute; 110 border-radius: 3px; 111 opacity: 0; 112 background: ${e=>e.secondary||"#fff"}; 113 bottom: 9px; 114 left: 4px; 115 height: 2px; 116 width: 12px; 117 } 118 119 &:before { 120 animation: ${IN} 0.15s ease-out forwards; 121 animation-delay: 180ms; 122 transform: rotate(90deg); 123 } 124`,UN=Kn` 125 from { 126 transform: rotate(0deg); 127 } 128 to { 129 transform: rotate(360deg); 130 } 131`,$N=Ir("div")` 132 width: 12px; 133 height: 12px; 134 box-sizing: border-box; 135 border: 2px solid; 136 border-radius: 100%; 137 border-color: ${e=>e.secondary||"#e0e0e0"}; 138 border-right-color: ${e=>e.primary||"#616161"}; 139 animation: ${UN} 1s linear infinite; 140`,BN=Kn` 141from { 142 transform: scale(0) rotate(45deg); 143 opacity: 0; 144} 145to { 146 transform: scale(1) rotate(45deg); 147 opacity: 1; 148}`,VN=Kn` 1490% { 150 height: 0; 151 width: 0; 152 opacity: 0; 153} 15440% { 155 height: 0; 156 width: 6px; 157 opacity: 1; 158} 159100% { 160 opacity: 1; 161 height: 10px; 162}`,qN=Ir("div")`
163 width: 20px; 164 opacity: 0; 165 height: 20px; 166 border-radius: 10px; 167 background: ${e=>e.primary||"#61d345"}; 168 position: relative; 169 transform: rotate(45deg); 170 171 animation: ${BN} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) 172 forwards; 173 animation-delay: 100ms; 174 &:after { 175 content: ''; 176 box-sizing: border-box; 177 animation: ${VN} 0.2s ease-out forwards; 178 opacity: 0; 179 animation-delay: 200ms; 180 position: absolute; 181 border-right: 2px solid; 182 border-bottom: 2px solid; 183 border-color: ${e=>e.secondary||"#fff"}; 184 bottom: 6px; 185 left: 6px; 186 height: 10px; 187 width: 6px; 188 } 189`,HN=Ir("div")` 190 position: absolute; 191`,WN=Ir("div")` 192 position: relative; 193 display: flex; 194 justify-content: center; 195 align-items: center; 196 min-width: 20px; 197 min-height: 20px; 198`,QN=Kn` 199from { 200 transform: scale(0.6); 201 opacity: 0.4; 202} 203to { 204 transform: scale(1); 205 opacity: 1; 206}`,KN=Ir("div")` 207 position: relative; 208 transform: scale(0.6); 209 opacity: 0.4; 210 min-width: 20px; 211 animation: ${QN} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) 212 forwards; 213`,GN=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?b.createElement(KN,null,t):t:n==="blank"?null:b.createElement(WN,null,b.createElement($N,{...r}),n!=="loading"&&b.createElement(HN,null,n==="error"?b.createElement(FN,{...r}):b.createElement(qN,{...r})))},YN=e=>` 2140% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 215100% {transform: translate3d(0,0,0) scale(1); opacity:1;} 216`,XN=e=>` 2170% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 218100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} 219`,JN="0%{opacity:0;} 100%{opacity:1;}",ZN="0%{opacity:1;} 100%{opacity:0;}",ej=Ir("div")` 220 display: flex; 221 align-items: center; 222 background: #fff; 223 color: #363636; 224 line-height: 1.3; 225 will-change: transform; 226 box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); 227 max-width: 350px; 228 pointer-events: auto; 229 padding: 8px 10px; 230 border-radius: 8px; 231`,tj=Ir("div")` 232 display: flex; 233 justify-content: center; 234 margin: 4px 10px; 235 color: inherit; 236 flex: 1 1 auto; 237 white-space: pre-line; 238`,nj=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=yy()?[JN,ZN]:[YN(n),XN(n)];return{animation:t?`${Kn(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Kn(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},rj=b.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?nj(e.position||t||"top-center",e.visible):{opacity:0},i=b.createElement(GN,{toast:e}),o=b.createElement(tj,{...e.ariaProps},Nl(e.message,e));return b.createElement(ej,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:o}):b.createElement(b.Fragment,null,i,o))});SN(b.createElement);var sj=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let i=b.useCallback(o=>{if(o){let l=()=>{let u=o.getBoundingClientRect().height;r(e,u)};l(),new MutationObserver(l).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return b.createElement("div",{ref:i,className:t,style:n},s)},ij=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:yy()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},aj=Zl` 239 z-index: 9999; 240 > * { 241 pointer-events: auto; 242 } 243`,wo=16,oj=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,containerStyle:i,containerClassName:o})=>{let{toasts:l,handlers:u}=LN(n);return b.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:wo,left:wo,right:wo,bottom:wo,pointerEvents:"none",...i},className:o,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(c=>{let f=c.position||t,d=u.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),m=ij(f,d);return b.createElement(sj,{id:c.id,key:c.id,onHeightUpdate:u.updateHeight,className:c.visible?aj:"",style:m},c.type==="custom"?Nl(c.message,c):s?s(c):b.createElement(rj,{toast:c,position:f}))}))},me=ft;/** 244 * @license lucide-react v0.344.0 - ISC 245 * 246 * This source code is licensed under the ISC license. 247 * See the LICENSE file in the root directory of this source tree. 248 */var lj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 249 * @license lucide-react v0.344.0 - ISC 250 * 251 * This source code is licensed under the ISC license. 252 * See the LICENSE file in the root directory of this source tree. 253 */const uj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),J=(e,t)=>
vendor: 5,683 bytes, lines 253-337
253{const n=b.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:u,...c},f)=>b.createElement("svg",{ref:f,...lj,width:s,height:s,stroke:r,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${uj(e)}`,l].join(" "),...c},[...t.map(([d,m])=>b.createElement(d,m)),...Array.isArray(u)?u:[u]]));return n.displayName=`${e}`,n};/** 254 * @license lucide-react v0.344.0 - ISC 255 * 256 * This source code is licensed under the ISC license. 257 * See the LICENSE file in the root directory of this source tree. 258 */const cj=J("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 259 * @license lucide-react v0.344.0 - ISC 260 * 261 * This source code is licensed under the ISC license. 262 * See the LICENSE file in the root directory of this source tree. 263 */const eu=J("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 264 * @license lucide-react v0.344.0 - ISC 265 * 266 * This source code is licensed under the ISC license. 267 * See the LICENSE file in the root directory of this source tree. 268 */const dj=J("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 269 * @license lucide-react v0.344.0 - ISC 270 * 271 * This source code is licensed under the ISC license. 272 * See the LICENSE file in the root directory of this source tree. 273 */const la=J("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 274 * @license lucide-react v0.344.0 - ISC 275 * 276 * This source code is licensed under the ISC license. 277 * See the LICENSE file in the root directory of this source tree. 278 */const Dd=J("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 279 * @license lucide-react v0.344.0 - ISC 280 * 281 * This source code is licensed under the ISC license. 282 * See the LICENSE file in the root directory of this source tree. 283 */const fj=J("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 284 * @license lucide-react v0.344.0 - ISC 285 * 286 * This source code is licensed under the ISC license. 287 * See the LICENSE file in the root directory of this source tree. 288 */const by=J("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 289 * @license lucide-react v0.344.0 - ISC 290 * 291 * This source code is licensed under the ISC license. 292 * See the LICENSE file in the root directory of this source tree. 293 */const ap=J("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 294 * @license lucide-react v0.344.0 - ISC 295 * 296 * This source code is licensed under the ISC license. 297 * See the LICENSE file in the root directory of this source tree. 298 */const mj=J("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 299 * @license lucide-react v0.344.0 - ISC 300 * 301 * This source code is licensed under the ISC license. 302 * See the LICENSE file in the root directory of this source tree. 303 */const hj=J("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 304 * @license lucide-react v0.344.0 - ISC 305 * 306 * This source code is licensed under the ISC license. 307 * See the LICENSE file in the root directory of this source tree. 308 */const Ze=J("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 309 * @license lucide-react v0.344.0 - ISC 310 * 311 * This source code is licensed under the ISC license. 312 * See the LICENSE file in the root directory of this source tree. 313 */const wy=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 314 * @license lucide-react v0.344.0 - ISC 315 * 316 * This source code is licensed under the ISC license. 317 * See the LICENSE file in the root directory of this source tree. 318 */const pj=J("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 319 * @license lucide-react v0.344.0 - ISC 320 * 321 * This source code is licensed under the ISC license. 322 * See the LICENSE file in the root directory of this source tree. 323 */const Ny=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 324 * @license lucide-react v0.344.0 - ISC 325 * 326 * This source code is licensed under the ISC license. 327 * See the LICENSE file in the root directory of this source tree. 328 */const gj=J("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/** 329 * @license lucide-react v0.344.0 - ISC 330 * 331 * This source code is licensed under the ISC license. 332 * See the LICENSE file in the root directory of this source tree. 333 */const tu=J("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 334 * @license lucide-react v0.344.0 - ISC 335 * 336 * This source code is licensed under the ISC license. 337 * See the LICENSE file in the root directory of this source tree.
338 */const jy=J("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 339 * @license lucide-react v0.344.0 - ISC 340 * 341 * This source code is licensed under the ISC license. 342 * See the LICENSE file in the root directory of this source tree. 343 */const zd=J("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 344 * @license lucide-react v0.344.0 - ISC 345 * 346 * This source code is licensed under the ISC license. 347 * See the LICENSE file in the root directory of this source tree. 348 */const xj=J("Crown",[["path",{d:"m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14",key:"zkxr6b"}]]);/** 349 * @license lucide-react v0.344.0 - ISC 350 * 351 * This source code is licensed under the ISC license. 352 * See the LICENSE file in the root directory of this source tree. 353 */const yj=J("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 354 * @license lucide-react v0.344.0 - ISC 355 * 356 * This source code is licensed under the ISC license. 357 * See the LICENSE file in the root directory of this source tree. 358 */const vj=J("Euro",[["path",{d:"M4 10h12",key:"1y6xl8"}],["path",{d:"M4 14h9",key:"1loblj"}],["path",{d:"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2",key:"1j6lzo"}]]);/** 359 * @license lucide-react v0.344.0 - ISC 360 * 361 * This source code is licensed under the ISC license. 362 * See the LICENSE file in the root directory of this source tree. 363 */const nu=J("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 364 * @license lucide-react v0.344.0 - ISC 365 * 366 * This source code is licensed under the ISC license. 367 * See the LICENSE file in the root directory of this source tree. 368 */const Sy=J("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** 369 * @license lucide-react v0.344.0 - ISC 370 * 371 * This source code is licensed under the ISC license. 372 * See the LICENSE file in the root directory of this source tree. 373 */const op=J("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/** 374 * @license lucide-react v0.344.0 - ISC 375 * 376 * This source code is licensed under the ISC license. 377 * See the LICENSE file in the root directory of this source tree. 378 */const bj=J("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/** 379 * @license lucide-react v0.344.0 - ISC 380 * 381 * This source code is licensed under the ISC license. 382 * See the LICENSE file in the root directory of this source tree. 383 */const lp=J("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 384 * @license lucide-react v0.344.0 - ISC 385 * 386 * This source code is licensed under the ISC license. 387 * See the LICENSE file in the root directory of this source tree. 388 */const wj=J("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** 389 * @license lucide-react v0.344.0 - ISC 390 * 391 * This source code is licensed under the ISC license. 392 * See the LICENSE file in the root directory of this source tree. 393 */const Nj=J("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** 394 * @license lucide-react v0.344.0 - ISC 395 * 396 * This source code is licensed under the ISC license. 397 * See the LICENSE file in the root directory of this source tree. 398 */const jj=J("ListFilter",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 399 * @license lucide-react v0.344.0 - ISC 400 * 401 * This source code is licensed under the ISC license. 402 * See the LICENSE file in the root directory of this source tree. 403 */const Cy=J("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** 404 * @license lucide-react v0.344.0 - ISC 405 * 406 * This source code is licensed under the ISC license. 407 * See the LICENSE file in the root directory of this source tree. 408 */const pe=J("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 409 * @license lucide-react v0.344.0 - ISC 410 * 411 * This source code is licensed under the ISC license. 412 * See the LICENSE file in the root directory of this source tree. 413 */const ky=J("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 414 * @license lucide-react v0.344.0 - ISC 415 * 416 * This source code is licensed under the ISC license. 417 * See the LICENSE file in the root directory of this source tree. 418 */const Ey=J("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 419 * @license lucide-react v0.344.0 - ISC 420 * 421 * This source code is licensed under the ISC license. 422 * See the LICENSE file in the root directory of this source tree. 423 */const Py=J("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 424 * @license lucide-react v0.344.0 - ISC 425 * 426 * This source code is licensed under the ISC license. 427 * See the LICENSE file in the root directory of this source tree. 428 */const Sj=J("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** 429 * @license lucide-react v0.344.0 - ISC 430 * 431 * This source code is licensed under the ISC license. 432 * See the LICENSE file in the root directory of this source tree. 433 */const Ry=J("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/** 434 * @license lucide-react v0.344.0 - ISC 435 * 436 * This source code is licensed under the ISC license. 437 * See the LICENSE file in the root directory of this source tree. 438 */const Mt=J("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 439 * @license lucide-react v0.344.0 - ISC 440 * 441 * This source code is licensed under the ISC license. 442 * See the LICENSE file in the root directory of this source tree. 443 */const up=J("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/** 444 * @license lucide-react v0.344.0 - ISC 445 * 446 * This source code is licensed under the ISC license. 447 * See the LICENSE file in the root directory of this source tree. 448 */const Cj=J("PhoneForwarded",[["polyline",{points:"18 2 22 6 18 10",key:"6vjanh"}],["line",{x1:"14",x2:"22",y1:"6",y2:"6",key:"1jsywh"}],["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 449 * @license lucide-react v0.344.0 - ISC 450 * 451 * This source code is licensed under the ISC license. 452 * See the LICENSE file in the root directory of this source tree. 453 */const cp=J("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m
453-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]);/** 454 * @license lucide-react v0.344.0 - ISC 455 * 456 * This source code is licensed under the ISC license. 457 * See the LICENSE file in the root directory of this source tree. 458 */const kj=J("PhoneOutgoing",[["polyline",{points:"22 8 22 2 16 2",key:"1g204g"}],["line",{x1:"16",x2:"22",y1:"8",y2:"2",key:"1ggias"}],["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 459 * @license lucide-react v0.344.0 - ISC 460 * 461 * This source code is licensed under the ISC license. 462 * See the LICENSE file in the root directory of this source tree. 463 */const _r=J("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 464 * @license lucide-react v0.344.0 - ISC 465 * 466 * This source code is licensed under the ISC license. 467 * See the LICENSE file in the root directory of this source tree. 468 */const Ay=J("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** 469 * @license lucide-react v0.344.0 - ISC 470 * 471 * This source code is licensed under the ISC license. 472 * See the LICENSE file in the root directory of this source tree. 473 */const An=J("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 474 * @license lucide-react v0.344.0 - ISC 475 * 476 * This source code is licensed under the ISC license. 477 * See the LICENSE file in the root directory of this source tree. 478 */const Ej=J("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 479 * @license lucide-react v0.344.0 - ISC 480 * 481 * This source code is licensed under the ISC license. 482 * See the LICENSE file in the root directory of this source tree. 483 */const am=J("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 484 * @license lucide-react v0.344.0 - ISC 485 * 486 * This source code is licensed under the ISC license. 487 * See the LICENSE file in the root directory of this source tree. 488 */const Ty=J("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 489 * @license lucide-react v0.344.0 - ISC 490 * 491 * This source code is licensed under the ISC license. 492 * See the LICENSE file in the root directory of this source tree. 493 */const Pj=J("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** 494 * @license lucide-react v0.344.0 - ISC 495 * 496 * This source code is licensed under the ISC license. 497 * See the LICENSE file in the root directory of this source tree. 498 */const Rj=J("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** 499 * @license lucide-react v0.344.0 - ISC 500 * 501 * This source code is licensed under the ISC license. 502 * See the LICENSE file in the root directory of this source tree. 503 */const dp=J("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 504 * @license lucide-react v0.344.0 - ISC 505 * 506 * This source code is licensed under the ISC license. 507 * See the LICENSE file in the root directory of this source tree. 508 */const Aj=J("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
508y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** 509 * @license lucide-react v0.344.0 - ISC 510 * 511 * This source code is licensed under the ISC license. 512 * See the LICENSE file in the root directory of this source tree. 513 */const Tj=J("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 514 * @license lucide-react v0.344.0 - ISC 515 * 516 * This source code is licensed under the ISC license. 517 * See the LICENSE file in the root directory of this source tree. 518 */const Oj=J("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 519 * @license lucide-react v0.344.0 - ISC 520 * 521 * This source code is licensed under the ISC license. 522 * See the LICENSE file in the root directory of this source tree. 523 */const _j=J("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/** 524 * @license lucide-react v0.344.0 - ISC 525 * 526 * This source code is licensed under the ISC license. 527 * See the LICENSE file in the root directory of this source tree. 528 */const Mj=J("StarOff",[["path",{d:"M8.34 8.34 2 9.27l5 4.87L5.82 21 12 17.77 18.18 21l-.59-3.43",ke
528y:"16m0ql"}],["path",{d:"M18.42 12.76 22 9.27l-6.91-1L12 2l-1.44 2.91",key:"1vt8nq"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** 529 * @license lucide-react v0.344.0 - ISC 530 * 531 * This source code is licensed under the ISC license. 532 * See the LICENSE file in the root directory of this source tree. 533 */const fp=J("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** 534 * @license lucide-react v0.344.0 - ISC 535 * 536 * This source code is licensed under the ISC license. 537 * See the LICENSE file in the root directory of this source tree. 538 */const Oy=J("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 539 * @license lucide-react v0.344.0 - ISC 540 * 541 * This source code is licensed under the ISC license. 542 * See the LICENSE file in the root directory of this source tree. 543 */const Ge=J("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 544 * @license lucide-react v0.344.0 - ISC 545 * 546 * This source code is licensed under the ISC license. 547 * See the LICENSE file in the root directory of this source tree. 548 */const Id=J("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 549 * @license lucide-react v0.344.0 - ISC 550 * 551 * This source code is licensed under the ISC license. 552 * See the LICENSE file in the root directory of this source tree. 553 */const Lj=J("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/** 554 * @license lucide-react v0.344.0 - ISC 555 * 556 * This source code is licensed under the ISC license. 557 * See the LICENSE file in the root directory of this source tree. 558 */const Dj=J("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 559 * @license lucide-react v0.344.0 - ISC 560 * 561 * This source code is licensed under the ISC license. 562 * See the LICENSE file in the root directory of this source tree. 563 */const De=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function _y(e,t){return function(){return e.apply(t,arguments)}}const{toString:zj}=Object.prototype,{getPrototypeOf:om}=Object,{iterator:ru,toStringTag:My}=Symbol,su=(e=>t=>{const n=zj.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),pn=e=>(e=e.toLowerCase(),t=>su(t)===e),iu=e=>t=>typeof t===e,{isArray:ki}=Array,_a=iu("undefined");function Ij(e){return e!==null&&!_a(e)&&e.constructor!==null&&!_a(e.constructor)&&Rt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ly=pn("ArrayBuffer");function Fj(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ly(e.buffer),t}const Uj=iu("string"),Rt=iu("function"),Dy=iu("number"),au=e=>e!==null&&typeof e=="object",$j=e=>e===!0||e===!1,$o=e=>{if(su(e)!=="object")return!1;const t=om(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(My in e)&&!(ru in e)},Bj=pn("Date"),Vj=pn("File"),qj=pn("Blob"),Hj=pn("FileList"),Wj=e=>au(e)&&Rt(e.pipe),Qj=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Rt(e.append)&&((t=su(e))==="formdata"||t==="object"&&Rt(e.toString)&&e.toString()==="[object FormData]"))},Kj=pn("URLSearchParams"),[Gj,Yj,Xj,Jj]=["ReadableStream","Request","Response","Headers"].map(pn),Zj=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ha(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;
563if(typeof e!="object"&&(e=[e]),ki(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let l;for(r=0;r<o;r++)l=i[r],t.call(null,e[l],l,e)}}function zy(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Kr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Iy=e=>!_a(e)&&e!==Kr;function Fd(){const{caseless:e}=Iy(this)&&this||{},t={},n=(r,s)=>{const i=e&&zy(t,s)||s;$o(t[i])&&$o(r)?t[i]=Fd(t[i],r):$o(r)?t[i]=Fd({},r):ki(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Ha(arguments[r],n);return t}const eS=(e,t,n,{allOwnKeys:r}={})=>(Ha(t,(s,i)=>{n&&Rt(s)?e[i]=_y(s,n):e[i]=s},{allOwnKeys:r}),e),tS=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nS=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},rS=(e,t,n,r)=>{let s,i,o;const l={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&om(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},sS=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},iS=e=>{if(!e)return null;if(ki(e))return e;let t=e.length;if(!Dy(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},aS=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&om(Uint8Array)),oS=(e,t)=>{const r=(e&&e[ru]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},lS=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},uS=pn("HTMLFormElement"),cS=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),mp=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dS=pn("RegExp"),Fy=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ha(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},fS=e=>{Fy(e,(t,n)=>{if(Rt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Rt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},mS=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ki(e)?r(e):r(String(e).split(t)),n},hS=()=>{},pS=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function gS(e){return!!(e&&Rt(e.append)&&e[My]==="FormData"&&e[ru])}const xS=e=>{const t=new Array(10),n=(r,s)=>{if(au(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=ki(r)?[]:{};return Ha(r,(o,l)=>{const u=n(o,s+1);!_a(u)&&(i[l]=u)}),t[s]=void 0,i}}return r};return n(e,0)},yS=pn("AsyncFunction"),vS=e=>e&&(au(e)||Rt(e))&&Rt(e.then)&&Rt(e.catch),Uy=((e,t)=>e?setImmediate:t?((n,r)=>(Kr.addEventListener("message",({source:s,data:i})=>{s===Kr&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Kr.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Rt(Kr.postMessage)),bS=typeof queueMicrotask<"u"?queueMicrotask.bind(Kr):typeof process<"u"&&process.nextTick||Uy,wS=e=>e!=null&&Rt(e[ru]),T={isArray:ki,isArrayBuffer:Ly,isBuffer:Ij,isFormData:Qj,isArrayBufferView:Fj,isString:Uj,isNumber:Dy,isBoolean:$j,isObject:au,isPlainObject:$o,isReadableStream:Gj,isRequest:Yj,isResponse:Xj,isHeaders:Jj,isUndefined:_a,isDate:Bj,isFile:Vj,isBlob:qj,isRegExp:dS,isFunction:Rt,isStream:Wj,isURLSearchParams:Kj,isTypedArray:aS,isFileList:Hj,forEach:Ha,merge:Fd,extend:eS,trim:Zj,stripBOM:tS,inherits:nS,toFlatObject:rS,kindOf:su,kindOfTest:pn,endsWith:sS,toArray:iS,forEachEntry:oS,matchAll:lS,isHTMLForm:uS,hasOwnProperty:mp,hasOwnProp:mp,reduceDescriptors:Fy,freezeMethods:fS,toObjectSet:mS,toCamelCase:cS,noop:hS,toFiniteNumber:pS,findKey:zy,global:Kr,isContextDefined:Iy,isSpecCompliantForm:gS,toJSONObject:xS,isAsyncFn:yS,isThenable:vS,setImmediate:Uy,asap:bS,isIterable:wS};function ie(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}T.inherits(ie,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}});const $y=ie.prototype,By={};
vendor: 10,458 bytes, lines 563-565
563["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{By[e]={value:e}});Object.defineProperties(ie,By);Object.defineProperty($y,"isAxiosError",{value:!0});ie.from=(e,t,n,r,s,i)=>{const o=Object.create($y);return T.toFlatObject(e,o,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),ie.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const NS=null;function Ud(e){return T.isPlainObject(e)||T.isArray(e)}function Vy(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function hp(e,t,n){return e?e.concat(t).map(function(s,i){return s=Vy(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function jS(e){return T.isArray(e)&&!e.some(Ud)}const SS=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function ou(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,N){return!T.isUndefined(N[v])});const r=n.metaTokens,s=n.visitor||f,i=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(s))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(T.isDate(y))return y.toISOString();if(T.isBoolean(y))return y.toString();if(!u&&T.isBlob(y))throw new ie("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(y)||T.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function f(y,v,N){let x=y;if(y&&!N&&typeof y=="object"){if(T.endsWith(v,"{}"))v=r?v:v.slice(0,-2),y=JSON.stringify(y);else if(T.isArray(y)&&jS(y)||(T.isFileList(y)||T.endsWith(v,"[]"))&&(x=T.toArray(y)))return v=Vy(v),x.forEach(function(p,w){!(T.isUndefined(p)||p===null)&&t.append(o===!0?hp([v],w,i):o===null?v:v+"[]",c(p))}),!1}return Ud(y)?!0:(t.append(hp(N,v,i),c(y)),!1)}const d=[],m=Object.assign(SS,{defaultVisitor:f,convertValue:c,isVisitable:Ud});function g(y,v){if(!T.isUndefined(y)){if(d.indexOf(y)!==-1)throw Error("Circular reference detected in "+v.join("."));d.push(y),T.forEach(y,function(x,h){(!(T.isUndefined(x)||x===null)&&s.call(t,x,T.isString(h)?h.trim():h,v,m))===!0&&g(x,v?v.concat(h):[h])}),d.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return g(e),t}function pp(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function lm(e,t){this._pairs=[],e&&ou(e,this,t)}const qy=lm.prototype;qy.append=function(t,n){this._pairs.push([t,n])};qy.toString=function(t){const n=t?function(r){return t.call(this,r,pp)}:pp;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function CS(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Hy(e,t,n){if(!t)return e;const r=n&&n.encode||CS;T.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=T.isURLSearchParams(t)?t.toString():new lm(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class gp{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Wy={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kS=typeof URLSearchParams<"u"?URLSearchParams:lm,ES=typeof FormData<"u"?FormData:null,PS=typeof Blob<"u"?Blob:null,RS={isBrowser:!0,classes:{URLSearchParams:kS,FormData:ES,Blob:PS},protocols:["http","https","file","blob","url","data"]},um=typeof window<"u"&&typeof document<"u",$d=typeof navigator=="object"&&navigator||void 0,AS=um&&(!$d||["ReactNative","NativeScript","NS"].indexOf($d.product)<0),TS=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OS=um&&window.location.href||"http://localhost",_S=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:um,hasStandardBrowserEnv:AS,hasStandardBrowserWebWorkerEnv:TS,navigator:$d,origin:OS},Symbol.toStringTag,{value:"Module"})),at={..._S,...RS};function MS(e,t){return ou(e,new at.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return at.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function LS(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function DS(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function Qy(e){function t(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),u=i>=n.length;return o=!o&&T.isArray(s)?s.length:o,u?(T.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!l):((!s[o]||!T.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&T.isArray(s[o])&&(s[o]=DS(s[o])),!l)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,s)=>{t(LS(r),s,n,0)}),n}return null}function zS(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Wa={transitional:Wy,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=T.isObject(t);if(i&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return s?JSON.stringify(Qy(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return MS(t,this.formSerializer).toString();if((l=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ou(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),zS(t)):t}],transformResponse:[function(t){const n=this.transitional||Wa.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(l){if(o)throw l.name==="SyntaxError"?ie.from(l,ie.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:at.classes.FormData,Blob:at.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{Wa.headers[e]={}});const IS=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),FS=e=>{const t={};let n,r,s;return e&&e.split(` 564`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&IS[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},xp=Symbol("internals");function Bi(e){return e&&String(e).trim().toLowerCase()}function Bo(e){return e===!1||e==null?e:T.isArray(e)?e.map(Bo):String(e)}function US(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const $S=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function oc(e,t,n,r,s){if(T.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function BS(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function VS(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let At=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(l,u,c){const f=Bi(u);if(!f)throw new Error("header name must be a non-empty string");const d=T.findKey(s,f);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||u]=Bo(l))}const o=(l,u)=>T.forEach(l,(c,f)=>i(c,f,u));if(T.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(T.isString(t)&&(t=t.trim())&&!$S(t))o(FS(t),n);else if(T.isObject(t)&&T.isIterable(t)){let l={},u,c;for(const f of t){if(!T.isArray(f))throw TypeError("Object iterator must return a key-value pair");l[c=f[0]]=(u=l[c])?T.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}o(l,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Bi(t),t){const r=T.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return US(s);if(T.isFunction(n))return n.call(this,s,r);if(T.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Bi(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||oc(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=Bi(o),o){const l=T.findKey(r,o);l&&(!n||oc(r,r[l],l,n))&&(delete r[l],s=!0)}}return T.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||oc(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return T.forEach(this,(s,i)=>{const o=T.findKey(r,i);if(o){n[o]=Bo(s),delete n[i];return}const l=t?BS(i):String(i).trim();l!==i&&delete n[i],n[l]=Bo(s),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` 565`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);
565return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[xp]=this[xp]={accessors:{}}).accessors,s=this.prototype;function i(o){const l=Bi(o);r[l]||(VS(s,o),r[l]=!0)}return T.isArray(t)?t.forEach(i):i(t),this}};At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(At.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});T.freezeMethods(At);function lc(e,t){const n=this||Wa,r=t||n,s=At.from(r.headers);let i=r.data;return T.forEach(e,function(l){i=l.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ky(e){return!!(e&&e.__CANCEL__)}function Ei(e,t,n){ie.call(this,e??"canceled",ie.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Ei,ie,{__CANCEL__:!0});function Gy(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ie("Request failed with status code "+n.status,[ie.ERR_BAD_REQUEST,ie.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function qS(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function HS(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=r[i];o||(o=c),n[s]=u,r[s]=c;let d=i,m=0;for(;d!==s;)m+=n[d++],d=d%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const g=f&&c-f;return g?Math.round(m*1e3/g):void 0}}function WS(e,t){let n=0,r=1e3/t,s,i;const o=(c,f=Date.now())=>{n=f,s=null,i&&(clearTimeout(i),i=null),e.apply(null,c)};return[(...c)=>{const f=Date.now(),d=f-n;d>=r?o(c,f):(s=c,i||(i=setTimeout(()=>{i=null,o(s)},r-d)))},()=>s&&o(s)]}const jl=(e,t,n=3)=>{let r=0;const s=HS(50,250);return WS(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,u=o-r,c=s(u),f=o<=l;r=o;const d={loaded:o,total:l,progress:l?o/l:void 0,bytes:u,rate:c||void 0,estimated:c&&l&&f?(l-o)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},n)},yp=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},vp=e=>(...t)=>T.asap(()=>e(...t)),QS=at.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,at.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(at.origin),at.navigator&&/(msie|trident)/i.test(at.navigator.userAgent)):()=>!0,KS=at.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),T.isString(r)&&o.push("path="+r),T.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function GS(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function YS(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Yy(e,t,n){let r=!GS(t);return e&&(r||n==!1)?YS(e,t):t}const bp=e=>e instanceof At?{...e}:e;function hs(e,t){t=t||{};const n={};function r(c,f,d,m){return T.isPlainObject(c)&&T.isPlainObject(f)?T.merge.call({caseless:m},c,f):T.isPlainObject(f)?T.merge({},f):T.isArray(f)?f.slice():f}function s(c,f,d,m){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c,d,m)}else return r(c,f,d,m)}function i(c,f){if(!T.isUndefined(f))return r(void 0,f)}function o(c,f){if(T.isUndefined(f)){if(!T.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function l(c,f,d){if(d in t)return r(c,f);if(d in e)return r(void 0,c)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(c,f,d)=>s(bp(c),bp(f),d,!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(f){const d=u[f]||s,m=d(e[f],t[f],f);T.isUndefined(m)&&d!==l||(n[f]=m)}),n}const Xy=e=>{const t=hs({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:l}=t;t.headers=o=At.from(o),t.url=Hy(Yy(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(T.isFormData(n)){if(at.hasStandardBrowserEnv||at.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((u=o.getContentType())!==!1){const[c,...f]=u?u.split(";").map(d=>
565d.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...f].join("; "))}}if(at.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&QS(t.url))){const c=s&&i&&KS.read(i);c&&o.set(s,c)}return t},XS=typeof XMLHttpRequest<"u",JS=XS&&function(e){return new Promise(function(n,r){const s=Xy(e);let i=s.data;const o=At.from(s.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:c}=s,f,d,m,g,y;function v(){g&&g(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let N=new XMLHttpRequest;N.open(s.method.toUpperCase(),s.url,!0),N.timeout=s.timeout;function x(){if(!N)return;const p=At.from("getAllResponseHeaders"in N&&N.getAllResponseHeaders()),C={data:!l||l==="text"||l==="json"?N.responseText:N.response,status:N.status,statusText:N.statusText,headers:p,config:e,request:N};Gy(function(A){n(A),v()},function(A){r(A),v()},C),N=null}"onloadend"in N?N.onloadend=x:N.onreadystatechange=function(){!N||N.readyState!==4||N.status===0&&!(N.responseURL&&N.responseURL.indexOf("file:")===0)||setTimeout(x)},N.onabort=function(){N&&(r(new ie("Request aborted",ie.ECONNABORTED,e,N)),N=null)},N.onerror=function(){r(new ie("Network Error",ie.ERR_NETWORK,e,N)),N=null},N.ontimeout=function(){let w=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const C=s.transitional||Wy;s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),r(new ie(w,C.clarifyTimeoutError?ie.ETIMEDOUT:ie.ECONNABORTED,e,N)),N=null},i===void 0&&o.setContentType(null),"setRequestHeader"in N&&T.forEach(o.toJSON(),function(w,C){N.setRequestHeader(C,w)}),T.isUndefined(s.withCredentials)||(N.withCredentials=!!s.withCredentials),l&&l!=="json"&&(N.responseType=s.responseType),c&&([m,y]=jl(c,!0),N.addEventListener("progress",m)),u&&N.upload&&([d,g]=jl(u),N.upload.addEventListener("progress",d),N.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(f=p=>{N&&(r(!p||p.type?new Ei(null,e,N):p),N.abort(),N=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const h=qS(s.url);if(h&&at.protocols.indexOf(h)===-1){r(new ie("Unsupported protocol "+h+":",ie.ERR_BAD_REQUEST,e));return}N.send(i||null)})},ZS=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(c){if(!s){s=!0,l();const f=c instanceof Error?c:this.reason;r.abort(f instanceof ie?f:new Ei(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,i(new ie(`timeout ${t} of ms exceeded`,ie.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>T.asap(l),u}},eC=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},tC=async function*(e,t){for await(const n of nC(e))yield*eC(n,t)},nC=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},wp=(e,t,n,r)=>{const s=tC(e,t);let i=0,o,l=u=>{o||(o=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await s.next();if(c){l(),u.close();return}let d=f.byteLength;if(n){let m=i+=d;n(m)}u.enqueue(new Uint8Array(f))}catch(c){throw l(c),c}},cancel(u){return l(u),s.return()}},{highWaterMark:2})},lu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Jy=lu&&typeof ReadableStream=="function",rC=lu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Zy=(e,...t)=>{try{return!!e(...t)}catch{return!1}},sC=Jy&&Zy(()=>{let e=!1;const t=new Request(at.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Np=64*1024,Bd=Jy&&Zy(()=>
565T.isReadableStream(new Response("").body)),Sl={stream:Bd&&(e=>e.body)};lu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Sl[t]&&(Sl[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ie(`Response type '${t}' is not supported`,ie.ERR_NOT_SUPPORT,r)})})})(new Response);const iC=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(at.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await rC(e)).byteLength},aC=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??iC(t)},oC=lu&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:l,onUploadProgress:u,responseType:c,headers:f,withCredentials:d="same-origin",fetchOptions:m}=Xy(e);c=c?(c+"").toLowerCase():"text";let g=ZS([s,i&&i.toAbortSignal()],o),y;const v=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let N;try{if(u&&sC&&n!=="get"&&n!=="head"&&(N=await aC(f,r))!==0){let C=new Request(t,{method:"POST",body:r,duplex:"half"}),E;if(T.isFormData(r)&&(E=C.headers.get("content-type"))&&f.setContentType(E),C.body){const[A,O]=yp(N,jl(vp(u)));r=wp(C.body,Np,A,O)}}T.isString(d)||(d=d?"include":"omit");const x="credentials"in Request.prototype;y=new Request(t,{...m,signal:g,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:x?d:void 0});let h=await fetch(y,m);const p=Bd&&(c==="stream"||c==="response");if(Bd&&(l||p&&v)){const C={};["status","statusText","headers"].forEach(L=>{C[L]=h[L]});const E=T.toFiniteNumber(h.headers.get("content-length")),[A,O]=l&&yp(E,jl(vp(l),!0))||[];h=new Response(wp(h.body,Np,A,()=>{O&&O(),v&&v()}),C)}c=c||"text";let w=await Sl[T.findKey(Sl,c)||"text"](h,e);return!p&&v&&v(),await new Promise((C,E)=>{Gy(C,E,{data:w,headers:At.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:y})})}catch(x){throw v&&v(),x&&x.name==="TypeError"&&/Load failed|fetch/i.test(x.message)?Object.assign(new ie("Network Error",ie.ERR_NETWORK,e,y),{cause:x.cause||x}):ie.from(x,x&&x.code,e,y)}}),Vd={http:NS,xhr:JS,fetch:oC};T.forEach(Vd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const jp=e=>`- ${e}`,lC=e=>T.isFunction(e)||e===null||e===!1,ev={getAdapter:e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!lC(n)&&(r=Vd[(o=String(n)).toLowerCase()],r===void 0))throw new ie(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since : 566`+i.map(jp).join(` 567`):" "+jp(i[0]):"as no adapter specified";throw new ie("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:Vd};function uc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ei(null,e)}function Sp(e){return uc(e),e.headers=At.from(e.headers),e.data=lc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ev.getAdapter(e.adapter||Wa.adapter)(e).then(function(r){return uc(e),r.data=lc.call(e,e.transformResponse,r),r.headers=At.from(r.headers),r},function(r){return Ky(r)||(uc(e),r&&r.response&&(r.response.data=lc.call(e,e.transformResponse,r.response),r.response.headers=At.from(r.response.headers))),Promise.reject(r)})}const tv="1.10.0",uu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{uu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Cp={};uu.transitional=function(t,n,r){function s(i,o){return"[Axios v"+tv+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,l)=>{if(t===!1)throw new ie(s(o," has been removed"+(n?" in "+n:"")),ie.ERR_DEPRECATED);return n&&!Cp[o]&&(Cp[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,l):!0}};uu.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function uC(e,t,n){if(typeof e!="object")throw new ie("options must be an object",ie.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const l=e[i],u=l===void 0||o(l,i,e);
vendor: 3,945 bytes, lines 567-568
567if(u!==!0)throw new ie("option "+i+" must be "+u,ie.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ie("Unknown option "+i,ie.ERR_BAD_OPTION)}}const Vo={assertOptions:uC,validators:uu},vn=Vo.validators;let as=class{constructor(t){this.defaults=t||{},this.interceptors={request:new gp,response:new gp}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` 568`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hs(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Vo.assertOptions(r,{silentJSONParsing:vn.transitional(vn.boolean),forcedJSONParsing:vn.transitional(vn.boolean),clarifyTimeoutError:vn.transitional(vn.boolean)},!1),s!=null&&(T.isFunction(s)?n.paramsSerializer={serialize:s}:Vo.assertOptions(s,{encode:vn.function,serialize:vn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Vo.assertOptions(n,{baseUrl:vn.spelling("baseURL"),withXsrfToken:vn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&T.merge(i.common,i[n.method]);i&&T.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=At.concat(o,i);const l=[];let u=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(u=u&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let f,d=0,m;if(!u){const y=[Sp.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,c),m=y.length,f=Promise.resolve(n);d<m;)f=f.then(y[d++],y[d++]);return f}m=l.length;let g=n;for(d=0;d<m;){const y=l[d++],v=l[d++];try{g=y(g)}catch(N){v.call(this,N);break}}try{f=Sp.call(this,g)}catch(y){return Promise.reject(y)}for(d=0,m=c.length;d<m;)f=f.then(c[d++],c[d++]);return f}getUri(t){t=hs(this.defaults,t);const n=Yy(t.baseURL,t.url,t.allowAbsoluteUrls);return Hy(n,t.params,t.paramsSerializer)}};T.forEach(["delete","get","head","options"],function(t){as.prototype[t]=function(n,r){return this.request(hs(r||{},{method:t,url:n,data:(r||{}).data}))}});T.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,l){return this.request(hs(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}as.prototype[t]=n(),as.prototype[t+"Form"]=n(!0)});let cC=class nv{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(l=>{r.subscribe(l),i=l}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,l){r.reason||(r.reason=new Ei(i,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nv(function(s){t=s}),cancel:t}}};function dC(e){return function(n){return e.apply(null,n)}}function fC(e){return T.isObject(e)&&e.isAxiosError===!0}const qd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
568alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};
568Object.entries(qd).forEach(([e,t])=>{qd[t]=e});function rv(e){const t=new as(e),n=_y(as.prototype.request,t);return T.extend(n,as.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return rv(hs(e,s))},n}const Le=rv(Wa);Le.Axios=as;Le.CanceledError=Ei;Le.CancelToken=cC;Le.isCancel=Ky;Le.VERSION=tv;Le.toFormData=ou;Le.AxiosError=ie;Le.Cancel=Le.CanceledError;Le.all=function(t){return Promise.all(t)};Le.spread=dC;Le.isAxiosError=fC;Le.mergeConfig=hs;Le.AxiosHeaders=At;Le.formToJSON=e=>Qy(T.isHTMLForm(e)?new FormData(e):e);Le.getAdapter=ev.getAdapter;Le.HttpStatusCode=qd;Le.default=Le;const{Axios:e3,AxiosError:t3,CanceledError:n3,isCancel:r3,CancelToken:s3,VERSION:i3,all:a3,Cancel:o3,isAxiosError:cm,spread:l3,toFormData:u3,AxiosHeaders:c3,HttpStatusCode:d3,formToJSON:f3,getAdapter:m3,mergeConfig:h3}=Le,sv="https://api.production.freesegreteria.it/v2",ne=Le.create({baseURL:sv,headers:{"Content-Type":"application/json","x-build-number":"150","x-platform":"WEB"}}),Yi=e=>{e?ne.defaults.headers.common.Authorization=`Bearer ${e}`:delete ne.defaults.headers.common.Authorization};let qo=null;const mC=e=>{qo=e};ne.interceptors.response.use(e=>e,e=>{var t,n;if(((t=e.response)==null?void 0:t.status)===401&&(qo==null||qo()),(n=e.response)!=null&&n.data&&typeof e.response.data=="object"&&"localizedMessage"in e.response.data){const r=e.response.data;r.localizedMessage&&(me.error(r.localizedMessage,{duration:1e4,position:"bottom-center"}),e.message=r.localizedMessage)}return Promise.reject(e)});const hC={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_API_BASE_URL:"https://api.production.freesegreteria.it/v2",VITE_CURRENT_ENV:"production"},kp=e=>{let t;const n=new Set,r=(f,d)=>{const m=typeof f=="function"?f(t):f;if(!Object.is(m,t)){const g=t;t=d??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(y=>y(t,g))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>c,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(hC?"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,s,u);return u},pC=e=>e?kp(e):kp;var iv={exports:{}},av={},ov={exports:{}},lv={};/** 569 * @license React 570 * use-sync-external-store-shim.production.js 571 * 572 * Copyright (c) Meta Platforms, Inc. and affiliates. 573 * 574 * This source code is licensed under the MIT license found in the 575 * LICENSE file in the root directory of this source tree. 576 */var pi=b;function gC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xC=typeof Object.is=="function"?Object.is:gC,yC=pi.useState,vC=pi.useEffect,bC=pi.useLayoutEffect,wC=pi.useDebugValue;function NC(e,t){var n=t(),r=yC({inst:{value:n,getSnapshot:t}}),s=r[0].inst,i=r[1];return bC(function(){s.value=n,s.getSnapshot=t,cc(s)&&i({inst:s})},[e,n,t]),vC(function(){return cc(s)&&i({inst:s}),e(function(){cc(s)&&i({inst:s})})},[e]),wC(n),n}function cc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xC(e,n)}catch{return!0}}function jC(e,t){return t()}var SC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?jC:NC;lv.useSyncExternalStore=pi.useSyncExternalStore!==void 0?pi.useSyncExternalStore:SC;ov.exports=lv;var CC=ov.exports;/** 577 * @license React 578 * use-sync-external-store-shim/with-selector.production.js 579 * 580 * Copyright (c) Meta Platforms, Inc. and affiliates. 581 * 582 * This source code is licensed under the MIT license found in the 583 * LICENSE file in the root directory of this source tree. 584 */var cu=b,kC=CC;function EC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var PC=typeof Object.is=="function"?Object.is:EC,RC=kC.useSyncExternalStore,AC=cu.useRef,TC=cu.useEffect,OC=cu.useMemo,_C=cu.useDebugValue;av.useSyncExternalStoreWithSelector=function(e,t,n,r,s){var i=AC(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=OC(function(){function u(g){if(!c){if(c=!0,f=g,g=r(g),s!==void 0&&o.hasValue){var y=o.value;if(s(y,g))return d=y}return d=g}if(y=d,PC(f,g))return y;var v=r(g);return s!==void 0&&s(y,v)?(f=g,y):(f=g,d=v)}var c=!1,f,d,m=n===void 0?null:n;return[function(){return u(t())},m===null?void 0:function(){return u(m())}]},[t,n,r,s]);var l=RC(e,i[0],i[1]);return TC(function(){o.hasValue=!0,o.value=l},[l]),_C(l),l};iv.exports=av;var MC=iv.exports;const LC=Tl(MC),uv={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_API_BASE_URL:"https://api.production.freesegreteria.it/v2",VITE_CURRENT_ENV:"production"},{useDebugValue:DC}
584=se,{useSyncExternalStoreWithSelector:zC}=LC;let Ep=!1;const IC=e=>e;function FC(e,t=IC,n){(uv?"production":void 0)!=="production"&&n&&!Ep&&(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"),Ep=!0);const r=zC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return DC(r),r}const Pp=e=>{(uv?"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"?pC(e):e,n=(r,s)=>FC(t,r,s);return Object.assign(n,t),n},UC=e=>e?Pp(e):Pp,dm="auth-sessions",Rp="auth-storage",ks=e=>{try{localStorage.setItem(dm,JSON.stringify(e))}catch(t){console.error("Failed to save auth sessions:",t)}},$C=()=>{try{const e=localStorage.getItem(dm);if(e)return JSON.parse(e)}catch(e){console.error("Failed to load auth sessions:",e)}return null},Ws="__migrating__",BC=()=>{try{const e=localStorage.getItem(Rp);if(!e)return null;const t=JSON.parse(e);if(!t.token)return null;const n={activeUuid:Ws,sessions:{[Ws]:{token:t.token,uuid:Ws,name:void 0}}};return ks(n),localStorage.removeItem(Rp),n}catch(e){return console.error("Failed to migrate legacy auth data:",e),null}},VC=()=>{const e=$C()??BC();if(e&&e.activeUuid&&e.sessions[e.activeUuid]){const t=e.sessions[e.activeUuid];return Yi(t.token),{isAuthenticated:!0,activeUuid:t.uuid,activeSession:t,sessions:e.sessions}}return{isAuthenticated:!1,activeUuid:void 0,activeSession:null,sessions:{}}},re=UC((e,t)=>({...VC(),login:(n,r)=>{Yi(n);const s={token:n,uuid:r.uuid,name:r.name},i={...t().sessions,[r.uuid]:s};ks({activeUuid:r.uuid,sessions:i}),e({isAuthenticated:!0,activeUuid:r.uuid,activeSession:s,sessions:i})},logout:()=>{const{activeSession:n,sessions:r}=t();if(!n)return;sy.removeQueries({predicate:o=>o.queryKey[0]===n.uuid});const s={...r};delete s[n.uuid];const i=Object.keys(s);if(i.length>0){const o=i[0],l=s[o];Yi(l.token),ks({activeUuid:o,sessions:s}),e({isAuthenticated:!0,activeUuid:o,activeSession:l,sessions:s})}else Yi(null),localStorage.removeItem(dm),e({isAuthenticated:!1,activeUuid:void 0,activeSession:null,sessions:{}})},switchAccount:n=>{const{sessions:r}=t(),s=r[n];s&&(Yi(s.token),ks({activeUuid:n,sessions:r}),e({activeUuid:n,activeSession:s}))},getToken:()=>{var n;return((n=t().activeSession)==null?void 0:n.token)??null},updateSessionName:n=>{const{activeSession:r,sessions:s}=t();if(!r)return;const i={...r,name:n},o={...s,[r.uuid]:i};ks({activeUuid:r.uuid,sessions:o}),e({activeSession:i,sessions:o})},completeMigration:(n,r)=>{const{sessions:s,activeSession:i}=t(),o=s[Ws];if(!o)return;const l={token:o.token,uuid:n,name:r},u={...s,[n]:l};delete u[Ws],ks({activeUuid:n,sessions:u});const c=(i==null?void 0:i.uuid)===Ws;e({sessions:u,...c?{activeUuid:n,activeSession:l}:{}})}}));mC(()=>re.getState().logout());const qC=async()=>(await ne.get("/profile")).data,Qa=()=>{const{isAuthenticated:e,activeUuid:t,completeMigration:n}=re(),r=Tn({queryKey:[t,"profile"],queryFn:qC,enabled:e,refetchOnMount:!0,refetchOnWindowFocus:!0});return b.useEffect(()=>{r.data&&t==="__migrating__"&&n(r.data.uuid,r.data.name)},[r.data,t,n]),r},Ap=()=>{var g;const{activeUuid:e,sessions:t,switchAccount:n,logout:r}=re(),[s,i]=b.useState(!1),o=b.useRef(null),l=yt(),u=Object.values(t),c=(g=t[e??""])==null?void 0:g.name;b.useEffect(()=>{const y=v=>{o.current&&!o.current.contains(v.target)&&i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[]);const f=y=>{y!==e&&(n(y),i(!1),l("/"))},d=()=>{i(!1),l("/login?addAccount=true")},m=()=>{i(!1),r(),l("/login")};return a.jsxs("div",{className:"relative",ref:o,children:[a.jsxs("button",{onClick:()=>i(!s),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-sm text-white/80 hover:text-white hover:bg-white/10 transition-colors",children:[a.jsx("div",{className:"w-6 h-6 rounded-full bg-yellow-400 flex items-center justify-center text-xs font-bold text-midnight-blue",children:(c??"?")[0].toUpperCase()}),a.jsx("span",{className:"hidden md:inline max-w-[100px] truncate",children:c??"Account"}),a.jsx(wy,{size:14,className:`transition-transform ${s?"rotate-180":""}`})]}),s&&a.jsxs("div",{className:"absolute right-0 top-full mt-1 w-64 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50",children:[a.jsx("div",{className:"px-3 py-2 text-xs font-medium text-gray-400 uppercase tracking-wide",children:"Account"}),u.map(y=>a.jsxs("button",{onClick:()=>f(y.uuid),className:"w-full flex items-center gap-3 px-3 py-2.5 hover:bg-gray-50 transition-colors text-left",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-yellow-400 flex items-center justify-center text-sm font-bold text-midnight-blue flex-shrink-0",children:(y.name??"?")[0].toUpperCase()}),a.jsx("span",{className:"text-sm text-midnight-blue truncate flex-1",children:y.name??"Senza nome"}),y.uuid===e&&a.jsx(Ze,{size:16,className:"text-green-500 flex-shrink-0"})]},y.uuid)),a.jsx("div",{className:"border-t border-gray-100 my-1"}),a.jsxs("button",{onClick:d,className:"w-full flex items-center gap-3 px-3 py-2.5 hover:bg-gray-50 transition-colors text-left",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-100 flex items-center justify-center flex-shrink-0",children:a.jsx(An,{size:16,className:"text-gray-500"})}),a.jsx("span",{className:"text-sm text-midnight-blue",children:"Aggiungi account"})]}),a.jsx("div",{className:"border-t border-gray-100 my-1"}),a.jsxs("button",{onClick:m,className:"w-full flex items-center gap-3 px-3 py-2.5 hover:bg-red-50 transition-colors text-left",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-red-50 flex items-center justify-center flex-shrink-0",children:a.jsx(ky,{size:16,className:"text-red-500"})}),a.jsx("span",{className:"text-sm text-red-600",children:"Esci"})]})]})]})},HC=()=>{const{data:e}=Qa();return a.jsx("div",{children:a.jsx("nav",{className:"bg-midnight-blue shadow-sm",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex justify-between h-16",children:[a.jsx("div",{className:"flex items-center",children:a.jsxs(Vt,{to:"/",className:"flex-shrink-0 flex items-center hover:opacity-80 transition-opacity",children:[a.jsx("img",{src:"/assets/images/logo.png",alt:"AppSegreteria Logo",className:"h-8 w-8"}),a.jsxs("span",{className:"ml-2 text-lg font-bold text-white",children:[a.jsx("span",{className:"text-yellow-400",children:"App"}),"Segreteria"]})]})}),a.jsx("div",{className:"flex items-center",children:a.jsxs("div",{className:"hidden sm:ml-6 sm:flex sm:items-center sm:space-x-2",children:[a.jsxs(Vt,{to:"/",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,end:!0,children:[a.jsx(_r,{size:18}),a.jsx("span",{children:"Chiamate"})]}),(e==null?void 0:e.enableBookingAgent)&&a.jsxs(Vt,{to:"/booking",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,children:[a.jsx(ap,{size:18}),a.jsx("span",{children:"Prenotazioni"})]}),a.jsxs(Vt,{to:"/configuration",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,children:[a.jsx(dp,{size:18}),a.jsx("span",{children:"Configurazione"})]}),a.jsxs(Vt,{to:"/profile",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,children:[a.jsx(Id,{size:18}),a.jsx("span",{children:"Profilo"})]}),a.jsx(Ap,{})]})}),a.jsx("div",{className:"flex items-center sm:hidden",children:a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsx(Vt,{to:"/",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,end:!0,children:a.jsx(_r,{size:18})}),(e==null?void 0:e.enableBookingAgent)&&a.jsx(Vt,{to:"/booking",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,children:a.jsx(ap,{size:18})}),a.jsx(Vt,{to:"/configuration",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,children:a.jsx(dp,{size:18})}),a.jsx(Vt,{to:"/profile",className:({isActive:t})=>`nav-link ${t?"nav-link-active":"text-white/80 hover:text-white hover:bg-white/10"}`,children:a.jsx(Id,{size:18})}),a.jsx(Ap,{})]})})]})})})})},WC=()=>{const e=xe(),{activeUuid:t,updateSessionName:n}=re();return ye({mutationFn:async r=>(await ne.put("/profile",r)).data,onSuccess:r=>{e.setQueryData([t,"profile"],r),n(r.name)}})},QC=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async()=>(await ne.put("/profile",{legalUpdateAcknowledged:!0})).data,onSuccess:n=>e.setQueryData([t,"profile"],n)})},KC=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({secretName:n,value:r})=>(await ne.put(`/profile/secrets/${encodeURIComponent(n)}`,{value:r})).data,onSuccess:()=>e.invalidateQueries({queryKey:[t,"profile"]})})};function fm(e,t){var n,r;return cm(e)&&((r=(n=e.response)==null?void 0:n.data)!=null&&r.localizedMessage)?e.response.data.localizedMessage:t}function GC(e){var r,s,i;if(!cm(e)||((s=(r=e.response)==null?void 0:r.data)==null?void 0:s.code)!=="INSTRUCTIONS_CONFLICT")return null;const{localizedMessage:t,suggestions:n}=e.response.data;return!t||!((i=n==null?void 0:n.instructions)!=null&&i.value)||!n.instructions.actionLabel?null:{explanation:t,suggestedInstructions:n.instructions.value,actionLabel:n.instructions.actionLabel}}const YC="https://segreteria.app/terms.html";function XC(){const{data:e}=Qa(),t=QC(),n=e==null?void 0:e.legalUpdateNotice;if(!n)return null;const r=t.error?fm(t.error,"Non è stato possibile salvare la conferma. Riprova."):void 0;return a.jsx("section",{"aria-labelledby":"legal-update-title",className:"border-b border-yellow-200 bg-yellow-50 text-midnight-blue",children:a.jsxs("div",{className:"mx-auto flex max-w-7xl flex-col gap-4 px-4 py-4 sm:px-6 lg:flex-row lg:items-center lg:justify-between lg:px-8",children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("div",{className:"mt-0.5 inline-flex shrink-0 rounded-xl bg-yellow-400/25 p-2.5 text-yellow-700",children:a.jsx(Tj,{size:22,"aria-hidden":"true"})}),a.jsxs("div",{children:[a.jsx("h2",{id:"legal-update-title",className:"text-sm font-semibold",children:"Termini e Privacy aggiornati"}),a.jsx("p",{className:"mt-1 text-sm leading-relaxed text-misty-blue",children:n}),r&&a.jsx("p",{role:"alert",className:"mt-2 text-sm text-red-600",children:r})]})]}),a.jsxs("div",{className:"flex shrink-0 flex-col gap-2 sm:flex-row sm:items-center",children:[a.jsxs("a",{href:YC,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 rounded-lg border border-yellow-500 px-4 py-2.5 text-sm font-semibold text-midnight-blue transition-colors hover:bg-yellow-100",children:["Maggiori informazioni",a.jsx(nu,{size:16,"aria-hidden":"true"})]}),a.jsxs("button",{type:"button",onClick:()=>t.mutate(),disabled:t.isPending,className:"inline-flex items-center justify-center gap-2 rounded-lg bg-yellow-400 px-4 py-2.5 text-sm font-semibold text-midnight-blue transition-colors hover:bg-yellow-300 disabled:cursor-not-allowed disabled:opacity-60",children:[t.isPending&&a.jsx(pe,{size:16,className:"animate-spin","aria-hidden":"true"}),t.isPending?"Salvataggioâ¦":"Ho preso visione"]})]})]})})}const Tp="<b>",Op="</b>";function JC(e){const t=[],n=e.toLowerCase();let r=0;for(;r<e.length;){const s=n.indexOf(Tp,r);if(s===-1){t.push({text:e.slice(r),bold:!1});break}s>r&&t.push({text:e.slice(r,s),bold:!1});const i=s+Tp.length,o=n.indexOf(Op,i);if(o===-1){t.push({text:e.slice(i),bold:!0});break}t.push({text:e.slice(i,o),bold:!0}),r=o+Op.length}return t}function ZC({text:e,strongClassName:t}){const n=JC(e);return a.jsx(a.Fragment,{children:n.map((r,s)=>r.bold?a.jsx("strong",{className:t,children:r.text},s):a.jsx(b.Fragment,{children:r.text},s))})}function _p({cta:e,isSecondary:t=!1,tone:n}){const r=yt(),s=hn(),i=b.useCallback(()=>{switch(e.type){case"OPEN_URL":window.open(e.url,"_blank","noopener,noreferrer");return;case"OPEN_PAYWALL":r("/paywall",{state:{backgroundLocation:s}});return;case"CONTACT_SUPPORT":window.location.href="mailto:[email protected]";return;case"SETUP_DIVERSIONS":r("/configuration");return;case"WATCH_ADV":return}},[e,s,r]);if(e.type==="WATCH_ADV")return null;if(t){const l=n==="soft-red"?"px-2 py-2 text-xs font-semibold uppercase tracking-normal text-red-700 transition-colors hover:text-red-900":"px-2 py-2 text-xs font-semibold uppercase tracking-normal text-white/85 hover:text-white transition-colors";return a.jsx("button",{type:"button",onClick:i,className:l,children:e.text})}const o=n==="soft-red"?"inline-flex w-full items-center justify-center gap-2 rounded-lg border border-red-600 bg-red-600 px-4 py-2.5 text-sm font-semibold uppercase tracking-normal text-white transition-colors hover:border-red-700 hover:bg-red-700 sm:w-auto":"inline-flex w-full sm:w-auto items-center justify-center gap-2 rounded-lg border-2 border-white/80 px-5 py-3 text-sm font-semibold uppercase tracking-normal text-white hover:bg-white/10 transition-colors";return a.jsxs("button",{type:"button",onClick:i,className:o,children:[a.jsx("span",{children:e.text}),e.type==="OPEN_URL"&&a.jsx(nu,{size:16})]})}function ek(){var d,m;const{data:e}=Qa(),t=e==null?void 0:e.topBanner;if(!t)return null;const n=((d=t.primaryCta)==null?void 0:d.type)==="WATCH_ADV"?void 0:t.primaryCta,r=((m=t.secondaryCta)==null?void 0:m.type)==="WATCH_ADV"?void 0:t.secondaryCta,s=t.color==="red",i=s?"soft-red":"dark",o=s?"border-b border-red-100 bg-red-50 text-red-900":"bg-midnight-blue text-white shadow-sm",l=s?"text-xs font-semibold uppercase tracking-normal text-red-700":"text-xs font-semibold uppercase tracking-normal text-white/80",u=s?"mt-1 whitespace-pre-line text-sm text-red-800 sm:text-base":"mt-1 whitespace-pre-line text-sm sm:text-base text-white/95",c=s?"font-semibold text-red-950":"font-semibold text-white",f=s?"py-3 sm:py-4":"py-5";return a.jsx("section",{className:o,children:a.jsx("div",{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 ${f}`,children:a.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:l,children:t.title}),a.jsx("p",{className:u,children:a.jsx(ZC,{text:t.text,strongClassName:c})})]}),(n||r)&&a.jsxs("div",{className:"flex w-full flex-col items-stretch gap-2 sm:w-auto
584sm:min-w-56 sm:items-center",children:[n&&a.jsx(_p,{cta:n,tone:i}),r&&a.jsx(_p,{cta:r,isSecondary:!0,tone:i})]})]})})})}const tk=({children:e})=>a.jsxs("div",{className:"h-dvh bg-off-white flex flex-col overflow-hidden",children:[a.jsx(HC,{}),a.jsx(XC,{}),a.jsx(ek,{}),a.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto p-3 sm:p-4 md:p-6 max-w-5xl mx-auto w-full",children:e})]});function gn(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function ps(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const cv=6048e5,nk=864e5;let rk={};function du(){return rk}function gs(e,t){var l,u,c,f;const n=du(),r=(t==null?void 0:t.weekStartsOn)??((u=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.weekStartsOn)??0,s=gn(e),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Cl(e){return gs(e,{weekStartsOn:1})}function dv(e){const t=gn(e),n=t.getFullYear(),r=ps(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Cl(r),i=ps(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Cl(i);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Mp(e){const t=gn(e);return t.setHours(0,0,0,0),t}function Lp(e){const t=gn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function sk(e,t){const n=Mp(e),r=Mp(t),s=+n-Lp(n),i=+r-Lp(r);return Math.round((s-i)/nk)}function ik(e){const t=dv(e),n=ps(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Cl(n)}function ak(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ok(e){if(!ak(e)&&typeof e!="number")return!1;const t=gn(e);return!isNaN(Number(t))}function lk(e){const t=gn(e),n=ps(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const uk={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ck=(e,t,n)=>{let r;const s=uk[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Qs(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const dk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},mk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hk={date:Qs({formats:dk,defaultWidth:"full"}),time:Qs({formats:fk,defaultWidth:"full"}),dateTime:Qs({formats:mk,defaultWidth:"full"})},pk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gk=(e,t,n,r)=>pk[e];function kn(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;s=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const xk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vk={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bk={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
584ay","Saturday"]},wk={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Nk={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},jk=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Sk={ordinalNumber:jk,era:kn({values:xk,defaultWidth:"wide"}),quarter:kn({values:yk,defaultWidth:"wide",argumentCallback:e=>e-1}),month:kn({values:vk,defaultWidth:"wide"}),day:kn({values:bk,defaultWidth:"wide"}),dayPeriod:kn({values:wk,defaultWidth:"wide",formattingValues:Nk,defaultFormattingWidth:"wide"})};function En(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?kk(l,d=>d.test(o)):Ck(l,d=>d.test(o));let c;c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const f=t.slice(o.length);return{value:c,rest:f}}}function Ck(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function kk(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function fv(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(s.length);return{value:o,rest:l}}}const Ek=/^(\d+)(th|st|nd|rd)?/i,Pk=/\d+/i,Rk={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ak={any:[/^b/i,/^(a|c)/i]},Tk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ok={any:[/1/i,/2/i,/3/i,/4/i]},_k={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Mk={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Lk={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Dk={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},zk={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ik={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Fk={ordinalNumber:fv({matchPattern:Ek,parsePattern:Pk,valueCallback:e=>parseInt(e,10)}),era:En({matchPatterns:Rk,defaultMatchWidth:"wide",parsePatterns:Ak,defaultParseWidth:"any"}),quarter:En({matchPatterns:Tk,defaultMatchWidth:"wide",parsePatterns:Ok,defaultParseWidth:"any",valueCallback:e=>e+1}),month:En({matchPatterns:_k,defaultMatchWidth:"wide",parsePatterns:Mk,defaultParseWidth:"any"}),day:En({matchPatterns:Lk,defaultMatchWidth:"wide",parsePatterns:Dk,defaultParseWidth:"any"}),dayPeriod:En({matchPatterns:zk,defaultMatchWidth:"any",parsePatterns:Ik,defaultParseWidth:"any"})},Uk={code:"en-US",formatDistance:ck,formatLong:hk,formatRelative:gk,localize:Sk,match:Fk,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $k(e){const t=gn(e);return sk(t,lk(t))+1}function Bk(e){const t=gn(e),n=+Cl(t)-+ik(t);return Math.round(n/cv)+1}function mv(e,t){var f,d,m,g;const n=gn(e),r=n.getFullYear(),s=du(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(f=t==null?void 0:t.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(m=s.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=ps(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=gs(o,t),u=ps(e,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const c=gs(u,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Vk(e,t){var l,u,c,f;const n=du(),r=(t==null?void 0:t.firstWeekContainsDate)??((u=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(c=n.locale)==null?void 0:c.options)==null?void 0:f.firstWeekContainsDate)??1,s=mv
vendor: 5,685 bytes, line 584
584(e,t),i=ps(e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),gs(i,t)}function qk(e,t){const n=gn(e),r=+gs(n,t)-+Vk(n,t);return Math.round(r/cv)+1}function ve(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Zn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ve(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ve(n+1,2)},d(e,t){return ve(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ve(e.getHours()%12||12,t.length)},H(e,t){return ve(e.getHours(),t.length)},m(e,t){return ve(e.getMinutes(),t.length)},s(e,t){return ve(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return ve(s,t.length)}},js={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dp={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Zn.y(e,t)},Y:function(e,t,n,r){const s=mv(e,r),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return ve(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):ve(i,t.length)},R:function(e,t){const n=dv(e);return ve(n,t.length)},u:function(e,t){const n=e.getFullYear();return ve(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ve(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ve(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Zn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ve(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=qk(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ve(s,t.length)},I:function(e,t,n){const r=Bk(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ve(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Zn.d(e,t)},D:function(e,t,n){const r=$k(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ve(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return ve(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return ve(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return ve(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=js.noon:r===0?s=js.midnight:s=r/12>
584=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=js.evening:r>=12?s=js.afternoon:r>=4?s=js.morning:s=js.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Zn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Zn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ve(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ve(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Zn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Zn.s(e,t)},S:function(e,t){return Zn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Ip(r);case"XXXX":case"XX":return Vr(r);case"XXXXX":case"XXX":default:return Vr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Ip(r);case"xxxx":case"xx":return Vr(r);case"xxxxx":case"xxx":default:return Vr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+zp(r,":");case"OOOO":default:return"GMT"+Vr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+zp(r,":");case"zzzz":default:return"GMT"+Vr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return ve(r,t.length)},T:function(e,t,n){const r=e.getTime();return ve(r,t.length)}};function zp(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+t+ve(i,2)}function Ip(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):Vr(e,t)}function Vr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=ve(Math.trunc(r/60),2),i=ve(r%60,2);return n+s+t+i}const Fp=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},hv=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Hk=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Fp(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Fp(r,t)).replace("{{time}}",hv(s,t))},Wk={p:hv,P:Hk},Qk=/^D+$/,Kk=/^Y+$/,Gk=["D","DD","YY","YYYY"];function Yk(e){return Qk.test(e)}function Xk(e){return Kk.test(e)}function Jk(e,t,n){const r=Zk(e,t,n);if(console.warn(r),Gk.includes(e))throw new RangeError(r)}function Zk(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const eE=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,tE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,nE=/^'([^]*?)'?$/,rE=/''/g,sE=/[a-zA-Z]/;function fn(e,t,n){var f,d,m,g,y,v,N,x;const r=du(),s=(n==null?void 0:n.locale)??r.locale??Uk,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(m=r.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((v=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((x=(N=r.locale)==null?void 0:N.options)==null?void 0:x.weekStartsOn)??0,l=gn(e);if(!ok(l))throw new RangeError("Invalid time value");let u=t.match(tE).map(h=>{const p=h[0];if(p==="p"||p==="P"){const w=Wk[p];return w(h,s.formatLong)}return h}).join("").match(eE).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const p=h[0];if(p==="'")return{isToken:!1,value:iE(h)};if(Dp[p])return{isToken:!0,value:h};
584if(p.match(sE))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:h}});s.localize.preprocessor&&(u=s.localize.preprocessor(l,u));const c={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return u.map(h=>{if(!h.isToken)return h.value;const p=h.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Xk(p)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Yk(p))&&Jk(p,t,String(e));const w=Dp[p[0]];return w(l,p,s.localize,c)}).join("")}function iE(e){const t=e.match(nE);return t?t[1].replace(rE,"'"):e}function Up(e,t,n){const r=gs(e,n),s=gs(t,n);return+r==+s}const aE={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},oE=(e,t,n)=>{let r;const s=aE[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"tra "+r:r+" fa":r},lE={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},uE={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},cE={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},dE={date:Qs({formats:lE,defaultWidth:"full"}),time:Qs({formats:uE,defaultWidth:"full"}),dateTime:Qs({formats:cE,defaultWidth:"full"})},mm=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function fE(e){switch(e){case 0:return"'domenica scorsa alle' p";default:return"'"+mm[e]+" scorso alle' p"}}function $p(e){return"'"+mm[e]+" alle' p"}function mE(e){switch(e){case 0:return"'domenica prossima alle' p";default:return"'"+mm[e]+" prossimo alle' p"}}const hE={lastWeek:(e,t,n)=>{const r=e.getDay();return Up(e,t,n)?$p(r):fE(r)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(e,t,n)=>{const r=e.getDay();return Up(e,t,n)?$p(r):mE(r)},other:"P"},pE=(e,t,n,r)=>{const s=hE[e];return typeof s=="function"?s(t,n,r):s},gE={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},xE={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},yE={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},vE={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},bE={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},wE={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},NE=(e,t)=>{const n=Number(e);return String(n)},jE={ordinalNumber:NE,era:kn({values:gE,defaultWidth:"wide"}),quarter:kn({values:xE,defaultWidth:"wide",argumentCallback:e=>e-1}),month:kn({values:yE,defaultWidth:"wide"}),day:kn({values:vE,defaultWidth:"wide"}),dayPeriod:kn({values:bE,defaultWidth:"wide",formattingValues:wE,defaultFormattingWidth:"wide"})},SE=/^(\d+)(º)?/i,CE=/\d+/i,kE={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},EE={any:[/^a/i,/^(d|e)/i]},PE={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},RE={any:[/1/i,/2/i,/3/i,/4/i]},AE={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|
584set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},TE={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},OE={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},_E={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},ME={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},LE={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},DE={ordinalNumber:fv({matchPattern:SE,parsePattern:CE,valueCallback:e=>parseInt(e,10)}),era:En({matchPatterns:kE,defaultMatchWidth:"wide",parsePatterns:EE,defaultParseWidth:"any"}),quarter:En({matchPatterns:PE,defaultMatchWidth:"wide",parsePatterns:RE,defaultParseWidth:"any",valueCallback:e=>e+1}),month:En({matchPatterns:AE,defaultMatchWidth:"wide",parsePatterns:TE,defaultParseWidth:"any"}),day:En({matchPatterns:OE,defaultMatchWidth:"wide",parsePatterns:_E,defaultParseWidth:"any"}),dayPeriod:En({matchPatterns:ME,defaultMatchWidth:"any",parsePatterns:LE,defaultParseWidth:"any"})},Mr={code:"it",formatDistance:oE,formatLong:dE,formatRelative:pE,localize:jE,match:DE,options:{weekStartsOn:1,firstWeekContainsDate:4}},zE={primary:{ribbon:"bg-blue-700 text-white",dot:"bg-blue-500",chipSelected:"border-blue-300 bg-blue-50"},danger:{ribbon:"bg-red-600 text-white",dot:"bg-red-500",chipSelected:"border-red-300 bg-red-50"},warning:{ribbon:"bg-amber-500 text-black",dot:"bg-amber-500",chipSelected:"border-amber-300 bg-amber-50"},success:{ribbon:"bg-emerald-700 text-white",dot:"bg-emerald-500",chipSelected:"border-emerald-300 bg-emerald-50"},neutral:{ribbon:"bg-slate-500 text-white",dot:"bg-slate-400",chipSelected:"border-slate-300 bg-slate-50"},orange:{ribbon:"bg-orange-600 text-white",dot:"bg-orange-500",chipSelected:"border-orange-300 bg-orange-50"},purple:{ribbon:"bg-purple-700 text-white",dot:"bg-purple-500",chipSelected:"border-purple-300 bg-purple-50"},pink:{ribbon:"bg-pink-600 text-white",dot:"bg-pink-500",chipSelected:"border-pink-300 bg-pink-50"},cyan:{ribbon:"bg-cyan-700 text-white",dot:"bg-cyan-500",chipSelected:"border-cyan-300 bg-cyan-50"},indigo:{ribbon:"bg-indigo-700 text-white",dot:"bg-indigo-500",chipSelected:"border-indigo-300 bg-indigo-50"},teal:{ribbon:"bg-teal-700 text-white",dot:"bg-teal-500",chipSelected:"border-teal-300 bg-teal-50"},lime:{ribbon:"bg-lime-600 text-white",dot:"bg-lime-500",chipSelected:"border-lime-300 bg-lime-50"}};function Ka(e){return zE[e??"neutral"]}const pv=({labels:e,labelColors:t,className:n="",maxVisible:r})=>{if(!e||e.length===0)return null;const s=r?e.slice(0,r):e,i=r?e.length-r:0;return a.jsxs("div",{className:`flex flex-wrap items-center justify-start gap-1.5 ${n}`,children:[s.map((o,l)=>a.jsx("div",{className:"relative inline-flex items-center",title:o,children:a.jsx("div",{className:`inline-flex items-center pl-3 pr-2 py-1 text-xs font-semibold ${Ka(t[o]).ribbon} shadow-sm`,style:{clipPath:"polygon(0 50%, 8px 0, 100% 0, 100% 100%, 8px 100%)"},children:o})},`${o}-${l}`)),i>0&&a.jsx("div",{className:"relative inline-flex items-center",children:a.jsxs("div",{className:"inline-flex items-center pl-3 pr-2 py-1 text-xs font-semibold bg-gray-500 text-white shadow-sm",style:{clipPath:"polygon(0 50%, 8px 0, 100% 0, 100% 100%, 8px 100%)"},children:["+",i]})})]})};function hm(e,t){const{isAuthenticated:n,activeUuid:r}=re();return Tn({queryKey:[r,"labels",e],queryFn:async({signal:s})=>(await ne.get("/labels",{params:{phoneUuid:e},signal:s})).data,enabled:n&&((t==null?void 0:t.enabled)??!0),staleTime:5*60*1e3,gcTime:24*60*60*1e3})}function IE(e){return"callUuids"in e?e.callUuids:[e.callUuid]}function FE(e){return"callUuids"in e?e.callUuids:[e.callUuid]}const UE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>{const r=IE(n);return(r.length>1?await ne.delete(`/call-lost?eventIds=${r.join(",")}`):await ne.delete(`/call-lost/${r[0]}`)).data},onSuccess:()=>
584{e.invalidateQueries({queryKey:[t,"calls-lost"]})}})},$E=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>{const r=FE(n);return(r.length>1?await ne.patch("/call-lost",{eventIds:r,isNew:n.isNew}):await ne.patch(`/call-lost/${r[0]}`,{isNew:n.isNew})).data},onSuccess:()=>{e.invalidateQueries({queryKey:[t,"calls-lost"]})}})},BE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,filter:r}={})=>{const s=new URLSearchParams;return n&&s.append("phoneUuid",n),r&&s.append("filter",r),(await ne.patch(`/call-lost${s.toString()?"?"+s.toString():""}`,{isNew:!1})).data},onSuccess:()=>{e.invalidateQueries({queryKey:[t,"calls-lost"]})}})},VE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,filter:r}={})=>{const s=new URLSearchParams;return n&&s.append("phoneUuid",n),r&&s.append("filter",r),(await ne.delete(`/call-lost${s.toString()?"?"+s.toString():""}`)).data},onSuccess:()=>{e.invalidateQueries({queryKey:[t,"calls-lost"]})}})};function pm(e,t){var n,r;(!cm(e)||!((r=(n=e.response)==null?void 0:n.data)!=null&&r.localizedMessage))&&me.error(t)}const qE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,callUuids:r})=>{await ne.post("/call-lost/undelete",{eventIds:r},{params:{phoneUuid:n}})},onError:n=>pm(n,"Impossibile recuperare le chiamate. Riprova."),onSettled:()=>e.invalidateQueries({queryKey:[t,"calls-lost"]})})},HE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({callUuid:n,labels:r})=>(await ne.patch(`/call-lost/${n}`,{labels:r})).data,onError:n=>pm(n,"Impossibile aggiornare le etichette. Riprova."),onSettled:()=>e.invalidateQueries({queryKey:[t,"calls-lost"]})})},WE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n})=>{await ne.post("/call-lost/empty-trash",{},{params:{phoneUuid:n}})},onError:n=>pm(n,"Impossibile svuotare il cestino. Riprova."),onSettled:()=>e.invalidateQueries({queryKey:[t,"calls-lost"]})})},dc=4,QE=({calls:e,labelColors:t,filterLabel:n,filter:r,isFiltered:s,isError:i,onRetry:o,onResetFilters:l,selectedCall:u,onCallSelect:c,onMarkAsUnread:f,onDelete:d,onUndelete:m,isUndeletePending:g,recoveringCallUuids:y,onLoadMore:v,isLoading:N,hasMore:x})=>{var ae;const h=b.useRef(null),[p,w]=b.useState(null),[C,E]=b.useState(!1),A=hm(p==null?void 0:p.call.phoneUuid,{enabled:!!p}),O=HE(),L=b.useMemo(()=>e.reduce(($,_)=>{const H=fn(new Date(_.createdAt),"yyyy-MM-dd");return $[H]||($[H]=[]),$[H].push(_),$},{}),[e]),D=b.useMemo(()=>Object.keys(L).sort(($,_)=>new Date(_).getTime()-new Date($).getTime()),[L]),Z=b.useCallback($=>{$[0].isIntersecting&&x&&!N&&v()},[x,N,v]);b.useEffect(()=>{const $=new IntersectionObserver(Z,{root:null,rootMargin:"20px",threshold:.1});return h.current&&$.observe(h.current),()=>$.disconnect()},[Z]);const Y=$=>{var _;return $.groupedCallIds.length>1?`${$.groupedCallIds.length} chiamate consecutive`:((_=$.transcription)==null?void 0:_.status)==="SUCCESS"?$.transcription.text.slice(0,100)+($.transcription.text.length>100?"...":""):$.audioUrl?"Messaggio vocale":$.isAgentHandled?"Gestita da agente AI":"Chiamata senza messaggio"},z=$=>{var M;const _=((M=$.transcription)==null?void 0:M.status)==="SUCCESS",H=!!$.audioUrl;return{text:Y($),hasTranscription:_,hasAudio:H,showSpeakerIcon:H}},K=($,_)=>{$.preventDefault(),$.currentTarget.getBoundingClientRect(),E(!1),w({x:$.clientX,y:$.clientY,call:_})},Q=($,_)=>{const H=$.labels??[],M=H.includes(_);if(!M&&H.length>=dc)return;const I=M?H.filter(B=>B!==_):[...H,_];O.mutate({callUuid:$.uuid,labels:I})};return b.useEffect(()=>{const $=()=>{w(null),E(!1)};return document.addEventListener("click",$),()=>document.removeEventListener("click",$)},[]),b.useEffect(()=>{w(null),E(!1)},[r,e]),e.length===0&&!N&&!x&&!i?a.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-8 h-full",children:[a.jsx("div",{className:"mb-4 rounded-2xl bg-midnight-blue/5 p-4",children:r==="TRASH"?a.jsx(Ge,{size:28,className:"text-misty-blue"}):s?a.jsx(jj,{size:28,className:"text-misty-blue"}):a.jsx(_r,{size:28,className:"text-misty-blue"})}),a.jsx("h3",{className:"mb-2 text-lg font-semibold text-midnight-blue",children:r==="TRASH"?"Il cestino è vuoto":r==="UNREAD"?"Tutto letto":s?"Nessuna chiamata trovata":"Ancora nessuna chiamata"}),a.jsx("p",{className:"max-w-sm text-sm leading-relaxed text-misty-blue",children:r==="TRASH"?"Qui trovi le chiamate eliminate. Puoi recuperarle prima che vengano cancellate definitivamente.":n?`Non ci sono chiamate per â${n}â nei telefoni selezionati.`:s?"Non ci sono chiamate per questo telefono.":"Le nuove chiamate appariranno qui, insieme ai messaggi e alle etichette."}),s&&a.jsx("button",{type:"button",onClick:l,className:"mt-4 rounded-lg bg-yellow-400 px-4 py-2 text-sm font-semibold text-midnight-blue hover:bg-yellow-300",children:r==="TRASH"?"Rimuovi filtro":"Mostra tutte le chiamate"})]}):a.jsxs("div",{className:"divide-y divide-gray-100",children:[D.map($=>a.jsxs("div",{className:"py-4",children:[a.jsx("h2",{className:"text-sm font-medium text-misty-blue px-4 mb-2",children:fn(new Date($),"EEEE d MMMM yyyy",{locale:Mr})}),a.jsx("div",{children:L[$].map(_=>a.jsx("button",{onClick:()=>c(_),onContextMenu:H=>K(H,_),className:`w-full text-left px-4 py-3 hover:bg-midnight-blue/5 transition-colors ${(u==null?void 0:u.uuid)===_.uuid?"bg-yellow-50":""}`,children:a.jsxs("div",{className:"flex items-start",children:[a.jsx("div",{className:"w-6 flex-shrink-0 pt-2",children:y!=null&&y.includes(_.uuid)?a.jsx(pe,{size:14,"aria-label":"Recupero in corso",className:"animate-spin text-misty-blue"}):_.isNew&&a.jsx("span",{className:"block w-2 h-2 rounded-full bg-yellow-400"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[a.jsxs("div",{className:"flex min-w-0 items-baseline gap-1",children:[a.jsx("p",{className:"truncate font-medium text-midnight-blue",children:_.caller==="anonymous"?"Anonimo":_.caller}),_.groupedCallIds.length>1&&a.jsxs("span",{className:"flex-shrink-0 text-sm font-medium text-misty-blue",children:["(",_.groupedCallIds.length,")"]})]}),a.jsx("span",{className:"text-xs text-misty-blue flex-shrink-0 ml-2",children:fn(new Date(_.createdAt),"HH:mm")}
584)]}),a.jsxs("p",{className:"text-sm text-misty-blue truncate mt-1",children:[_.calledPhoneName||"Telefono"," ⢠",_.called]}),a.jsxs("div",{className:"flex items-start gap-1.5 mt-1",children:[z(_).showSpeakerIcon&&a.jsx("span",{className:"text-sm flex-shrink-0 mt-0.5",children:"ð"}),a.jsx("p",{className:`text-sm truncate flex-1 ${z(_).hasTranscription?"text-midnight-blue font-medium":"text-misty-blue/75"}`,children:z(_).text})]}),_.labels&&_.labels.length>0&&a.jsx("div",{className:"mt-2",children:a.jsx(pv,{labels:_.labels,labelColors:t,maxVisible:2})})]})]})},_.uuid))})]},$)),i&&a.jsxs("div",{role:"alert",className:"p-6 text-center text-sm text-misty-blue",children:[a.jsx("p",{children:"Non è stato possibile caricare le chiamate."}),a.jsx("button",{type:"button",onClick:o,className:"mt-3 rounded-lg bg-yellow-400 px-4 py-2 font-semibold text-midnight-blue",children:"Riprova"})]}),(x||N)&&a.jsx("div",{ref:h,className:"flex justify-center py-4",children:N&&a.jsxs("span",{role:"status",className:"inline-flex items-center gap-2 text-sm text-misty-blue",children:[a.jsx(pe,{size:18,className:"animate-spin"})," Caricamento chiamateâ¦"]})}),p&&a.jsxs("div",{className:"fixed bg-white rounded-lg shadow-lg py-1 z-50",style:{left:`${p.x}px`,top:`${p.y}px`},children:[a.jsxs("button",{onClick:$=>{$.stopPropagation(),f(p.call),w(null)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-midnight-blue hover:bg-midnight-blue/5 transition-colors",children:[a.jsx(Sy,{size:16}),a.jsx("span",{children:p.call.groupedCallIds.length>1?"Segna gruppo da leggere":"Segna da leggere"})]}),a.jsxs("button",{type:"button",onClick:$=>{$.stopPropagation(),E(_=>!_)},className:"w-full flex items-center justify-between gap-2 px-4 py-2 text-sm text-midnight-blue hover:bg-midnight-blue/5 transition-colors",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Oy,{size:16}),a.jsx("span",{children:"Etichetta"})]}),a.jsx(Ny,{size:14,className:`text-misty-blue transition-transform ${C?"rotate-90":""}`})]}),C&&a.jsxs("div",{className:"max-h-56 min-w-[200px] overflow-y-auto border-t border-gray-100 py-1",onClick:$=>$.stopPropagation(),children:[A.isPending&&a.jsxs("span",{className:"flex items-center gap-2 px-4 py-2 text-xs text-misty-blue",children:[a.jsx(pe,{size:12,className:"animate-spin"})," Caricamentoâ¦"]}),A.isError&&a.jsx("span",{className:"block px-4 py-2 text-xs text-red-600",children:"Etichette non disponibili."}),A.isSuccess&&A.data.length===0&&a.jsx("span",{className:"block px-4 py-2 text-xs text-misty-blue",children:"Nessuna etichetta creata."}),(ae=A.data)==null?void 0:ae.map($=>{var M;const _=(p.call.labels??[]).includes($.name),H=!_&&(((M=p.call.labels)==null?void 0:M.length)??0)>=dc;return a.jsxs("button",{type:"button",disabled:H||O.isPending,title:H?`Massimo ${dc} etichette per chiamata`:void 0,onClick:I=>{I.stopPropagation(),Q(p.call,$.name)},className:"flex w-full items-center gap-2 px-4 py-2 text-sm text-midnight-blue transition-colors hover:bg-midnight-blue/5 disabled:cursor-not-allowed disabled:opacity-40",children:[a.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${Ka($.color).dot}`,"aria-hidden":"true"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:$.name}),_&&a.jsx(Ze,{size:14,className:"shrink-0 text-green-600"})]},$.uuid)})]}),r==="TRASH"||p.call.isDeleted?a.jsxs("button",{type:"button",disabled:g,onClick:$=>{$.stopPropagation(),m(p.call),w(null)},className:"flex w-full items-center gap-2 px-4 py-2 text-sm text-midnight-blue transition-colors hover:bg-midnight-blue/5 disabled:cursor-not-allowed disabled:opacity-50",children:[a.jsx(Ty,{size:16}),a.jsx("span",{children:p.call.groupedCallIds.length>1?"Recupera gruppo":"Recupera"})]}):a.jsx(a.Fragment,{children:a.jsxs("button",{onClick:$=>{$.stopPropagation(),d(p.call),w(null)},className:"w-full flex items-center gap-2 px-4 py-2 text-sm text-red-600 hover:bg-red-50 transition-colors",children:[a.jsx(Ge,{size:16}),a.jsx("span",{children:p.call.groupedCallIds.length>1?"Elimina gruppo":"Elimina"})]})})]})]})},KE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>(await ne.post("/labels",n)).data,onSuccess:()=>e.invalidateQueries({queryKey:[t,"labels"]})})},GE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({uuid:n,...r})=>(await ne.put(`/labels/${n}`,r)).data,onSuccess:()=>e.invalidateQueries({queryKey:[t,"labels"]})})},YE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>{await ne.delete(`/labels/${n}`)},onSuccess:()=>
584{e.invalidateQueries({queryKey:[t,"labels"]}),e.invalidateQueries({queryKey:[t,"calls-lost"]})}})},XE=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>{await ne.put("/labels/order",{labelUuids:n})},onSuccess:()=>e.invalidateQueries({queryKey:[t,"labels"]})})},JE=["primary","cyan","indigo","purple","pink","danger","orange","warning","lime","success","teal","neutral"],Bp={primary:"Blu",danger:"Rosso",warning:"Giallo",success:"Verde",neutral:"Grigio",orange:"Arancione",purple:"Viola",pink:"Rosa",cyan:"Ciano",indigo:"Indaco",teal:"Verde acqua",lime:"Verde lime"};function ZE({value:e,onChange:t}){return a.jsx("div",{role:"radiogroup","aria-label":"Colore etichetta",className:"flex flex-wrap gap-2.5",children:JE.map(n=>{const r=n===e;return a.jsx("button",{type:"button",role:"radio","aria-checked":r,"aria-label":Bp[n],title:Bp[n],onClick:()=>t(n),className:`h-8 w-8 shrink-0 rounded-full ${Ka(n).dot} ring-2 ring-offset-2 transition-shadow ${r?"ring-midnight-blue":"ring-transparent hover:ring-gray-200"}`},n)})})}const Vp=32,e4=10,qp=512;function t4({label:e,onClose:t}){const n=!!e,r=b.useRef(null),[s,i]=b.useState((e==null?void 0:e.name)??""),[o,l]=b.useState((e==null?void 0:e.color)??"primary"),[u,c]=b.useState((e==null?void 0:e.autoLabel)??!1),[f,d]=b.useState(e!=null&&e.autoLabel?e.instructions:""),[m,g]=b.useState(!1),y=KE(),v=GE(),N=YE(),x=y.isPending||v.isPending,h=y.error??v.error??N.error,p=GC(h),w=!p&&h?fm(h,"Non è stato possibile completare lâoperazione. Riprova."):null;b.useEffect(()=>{const D=r.current;return D==null||D.showModal(),()=>D==null?void 0:D.close()},[]),b.useEffect(()=>{if(!m)return;const D=setTimeout(()=>g(!1),5e3);return()=>clearTimeout(D)},[m]);const C=s.trim(),E=f.trim(),A=C.length>0&&C.length<=Vp&&(!u||E.length>=e4&&E.length<=qp),O=D=>{D.preventDefault(),A&&(e?v.mutate({uuid:e.uuid,validFor:e.validFor,color:o,autoLabel:u,instructions:u?E:void 0},{onSuccess:()=>{me.success("Etichetta aggiornata"),t()}}):y.mutate({name:C,validFor:"ALL_PHONES",color:o,autoLabel:u,instructions:u?E:void 0},{onSuccess:()=>{me.success("Etichetta creata"),t()}}))},L=()=>
584{if(e){if(!m){g(!0);return}N.mutate(e.uuid,{onSuccess:()=>{me.success("Etichetta eliminata"),t()}})}};return a.jsx("dialog",{ref:r,"aria-labelledby":"label-form-title",onCancel:D=>{D.preventDefault(),!x&&!N.isPending&&t()},className:"w-[calc(100%_-_2rem)] max-w-md rounded-2xl bg-white p-6 shadow-xl backdrop:bg-black/40",children:a.jsxs("form",{onSubmit:O,className:"flex flex-col gap-5",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"inline-flex shrink-0 rounded-full bg-yellow-50 p-3 text-yellow-600",children:a.jsx(Oy,{size:22})}),a.jsxs("div",{children:[a.jsx("h2",{id:"label-form-title",className:"text-xl font-semibold text-midnight-blue",children:n?"Modifica etichetta":"Nuova etichetta"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Scegli un nome e un colore per riconoscere le chiamate a colpo dâocchio."})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"label-name",className:"mb-1.5 block text-xs font-semibold uppercase tracking-wide text-misty-blue",children:"Nome"}),a.jsx("input",{id:"label-name",type:"text",value:s,onChange:D=>i(D.target.value),disabled:n,maxLength:Vp,autoFocus:!n,placeholder:"Es. Appuntamenti",className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-midnight-blue focus:border-yellow-400 focus:outline-none focus:ring-1 focus:ring-yellow-400 disabled:bg-gray-50 disabled:text-misty-blue"}),n&&a.jsx("p",{className:"mt-1 text-xs text-misty-blue",children:"Il nome non è modificabile."})]}),a.jsxs("div",{children:[a.jsx("span",{className:"mb-1.5 block text-xs font-semibold uppercase tracking-wide text-misty-blue",children:"Colore"}),a.jsx(ZE,{value:o,onChange:l})]}),a.jsxs("div",{className:"rounded-xl border border-blue-100 bg-blue-50/60 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-midnight-blue",children:"Applica in automatico"}),a.jsx("p",{className:"mt-0.5 text-xs text-misty-blue",children:u?"La segreteria legge cosa ha detto chi chiama e assegna questa etichetta quando corrisponde alla descrizione.":"Descrivi quando usarla e la segreteria la assegnerà da sola alle chiamate giuste."})]}),a.jsx("button",{type:"button",role:"switch","aria-checked":u,"aria-label":"Applica in automatico",onClick:()=>c(D=>!D),className:"inline-flex shrink-0",children:a.jsx("span",{className:`relative inline-flex h-5 w-9 flex-shrink-0 rounded-full transition-colors ${u?"bg-yellow-400":"bg-gray-300"}`,children:a.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-white shadow transition-transform ${u?"translate-x-4":"translate-x-0.5"}`})})})]}),u&&a.jsxs("div",{className:"mt-3",children:[a.jsx("label",{htmlFor:"label-instructions",className:"mb-1.5 block text-xs font-semibold uppercase tracking-wide text-misty-blue",children:"Quando applicarla"}),a.jsx("textarea",{id:"label-instructions",value:f,onChange:D=>d(D.target.value),maxLength:qp,rows:3,placeholder:C?`Es. quando la chiamata riguarda: ${C}`:"Es. quando chi chiama vuole fissare, spostare o disdire un appuntamento",className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-midnight-blue focus:border-yellow-400 focus:outline-none focus:ring-1 focus:ring-yellow-400"}),a.jsx("p",{className:"mt-1 text-xs text-misty-blue",children:"Scrivila come la spiegheresti a un collega. Minimo 10 caratteri."})]})]}),p&&a.jsxs("div",{role:"alert",className:"rounded-xl border border-red-200 bg-red-50 p-3",children:[a.jsx("p",{className:"text-sm text-red-700",children:p.explanation}),a.jsxs("div",{className:"mt-2.5 rounded-lg border border-red-100 bg-white p-3",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-red-400",children:"Prova con questa:"}),a.jsxs("p",{className:"mt-1 text-sm italic leading-relaxed text-midnight-blue",children:["â",p.suggestedInstructions,"â"]}),a.jsxs("button",{type:"button",onClick:()=>d(p.suggestedInstructions),className:"mt-2.5 inline-flex items-center gap-1.5 rounded-lg border border-red-300 bg-red-50 px-3 py-1.5 text-xs font-semibold text-red-700 transition-colors hover:bg-red-100",children:[a.jsx(Ze,{size:14,"aria-hidden":"true"}),a.jsx("span",{children:p.actionLabel})]})]})]}),w&&a.jsx("p",{role:"alert",className:"text-sm text-red-600",children:w}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-1",children:[n?a.jsxs("button",{type:"button",onClick:L,disabled:N.isPending,className:`inline-flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${m?"bg-red-600 text-white hover:bg-red-700":"text-red-600 hover:bg-red-50"}`,children:[N.isPending?a.jsx(pe,{size:16,className:"animate-spin"}):a.jsx(Ge,{size:16}),a.jsx("span",{children:m?"Conferma eliminazione":"Elimina etichetta"})]}):a.jsx("span",{}),a.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:t,disabled:x,className:"rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-midnight-blue hover:bg-gray-50 disabled:opacity-50",children:"Annulla"}),a.jsxs("button",{type:"submit",disabled:!A||x,className:"inline-flex items-center gap-2 rounded-lg bg-yellow-400 px-4 py-2 text-sm font-semibold text-midnight-blue hover:bg-yellow-300 disabled:cursor-not-allowed disabled:opacity-50",children:[x&&a.jsx(pe,{size:16,className:"animate-spin"}),a.jsx("span",{children:x?"Salvataggioâ¦":"Salva etichetta"})]})]})]})]})})}function n4({onClose:e}
584){const t=b.useRef(null),n=hm(),r=XE(),[s,i]=b.useState(null);b.useEffect(()=>{const d=t.current;return d==null||d.showModal(),()=>d==null?void 0:d.close()},[]),b.useEffect(()=>{s===null&&n.data&&i(n.data.map(d=>d.uuid))},[s,n.data]);const o=b.useMemo(()=>new Map((n.data??[]).map(d=>[d.uuid,d])),[n.data]),l=(s??[]).flatMap(d=>{const m=o.get(d);return m?[m]:[]}),u=(d,m)=>{i(g=>{if(!g)return g;const y=d+m;if(y<0||y>=g.length)return g;const v=[...g];return[v[d],v[y]]=[v[y],v[d]],v})},c=r.error?fm(r.error,"Non è stato possibile salvare lâordine. Riprova."):null,f=()=>{s&&r.mutate(s,{onSuccess:()=>{me.success("Ordine salvato"),e()}})};return a.jsxs("dialog",{ref:t,"aria-labelledby":"label-reorder-title",onCancel:d=>{d.preventDefault(),r.isPending||e()},className:"w-[calc(100%_-_2rem)] max-w-md rounded-2xl bg-white p-6 shadow-xl backdrop:bg-black/40",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"inline-flex shrink-0 rounded-full bg-yellow-50 p-3 text-yellow-600",children:a.jsx(Cy,{size:22})}),a.jsxs("div",{children:[a.jsx("h2",{id:"label-reorder-title",className:"text-xl font-semibold text-midnight-blue",children:"Riordina etichette"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Usa le frecce per spostare unâetichetta."})]})]}),a.jsxs("div",{className:"mt-5 max-h-80 space-y-2 overflow-y-auto",children:[n.isPending&&a.jsx("div",{className:"flex justify-center py-6",children:a.jsx(pe,{size:20,className:"animate-spin text-misty-blue"})}),n.isError&&a.jsx("p",{className:"py-6 text-center text-sm text-red-600",children:"Non è stato possibile caricare le etichette."}),n.isSuccess&&l.length===0&&a.jsx("p",{className:"py-6 text-center text-sm text-misty-blue",children:"Non ci sono etichette da riordinare."}),l.map((d,m)=>a.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gray-100 px-3 py-2",children:[a.jsx("span",{className:`h-2.5 w-2.5 shrink-0 rounded-full ${Ka(d.color).dot}`,"aria-hidden":"true"}),a.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-midnight-blue",children:d.name}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[a.jsx("button",{type:"button",onClick:()=>u(m,-1),disabled:m===0,className:"rounded p-1 text-misty-blue hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-30","aria-label":`Sposta ${d.name} su`,children:a.jsx(fj,{size:16})}),a.jsx("button",{type:"button",onClick:()=>u(m,1),disabled:m===l.length-1,className:"rounded p-1 text-misty-blue hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-30","aria-label":`Sposta ${d.name} giù`,children:a.jsx(dj,{size:16})})]})]},d.uuid))]}),c&&a.jsx("p",{role:"alert",className:"mt-4 text-sm text-red-600",children:c}),a.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[a.jsx("button",{type:"button",onClick:e,disabled:r.isPending,className:"rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-midnight-blue hover:bg-gray-50 disabled:opacity-50",children:"Annulla"}),a.jsxs("button",{type:"button",onClick:f,disabled:r.isPending||l.length<2,className:"inline-flex items-center gap-2 rounded-lg bg-yellow-400 px-4 py-2 text-sm font-semibold text-midnight-blue hover:bg-yellow-300 disabled:cursor-not-allowed disabled:opacity-50",children:[r.isPending&&a.jsx(pe,{size:16,className:"animate-spin"}),a.jsx("span",{children:r.isPending?"Salvataggioâ¦":"Salva ordine"})]})]})]})}function r4({filters:e,labels:t,labelColors:n,selectedFilter:r,onSelect:s,isPending:i,isError:o,onRetry:l}){const[u,c]=b.useState(null),[f,d]=b.useState(null),[m,g]=b.useState(!1);b.useEffect(()=>{const v=()=>c(null);return document.addEventListener("click",v),()=>document.removeEventListener("click",v)},[]),b.useEffect(()=>{c(null)},[e]);const y=(v,N)=>{const x=t.find(h=>h.name===N);x&&(v.preventDefault(),c({x:v.clientX,y:v.clientY,label:x}))};return a.jsxs("div",{children:[a.jsxs("div",{role:"group","aria-label":"Filtra chiamate",className:"flex items-center gap-2 overflow-x-auto",children:[[{filter:void 0,label:"Tutte"},...e].map(({filter:v,label:N})=>{const x=v===r,h=v==null?void 0:v.startsWith("LABEL:"),p=h?Ka(n[N]):void 0;return a.jsxs(b.Fragment,{children:[v==="TRASH"&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",onClick:()=>d("new"),className:"inline-flex h-8 shrink-0 items-center gap-1 whitespace-nowrap rounded-full border border-dashed border-midnight-blue/50 px-3 text-[13px] font-medium text-midnight-blue transition-colors hover:border-midnight-blue hover:bg-midnight-blue/5",children:[a.jsx(An,{size:14,"aria-hidden":"true"}),a.jsx("span",{children:"Nuova"})]}),a.jsx("span",{role:"separator","aria-orientation":"vertical",className:"h-5 w-px shrink-0 bg-gray-200"})]}),a.jsxs("button",{type:"button","aria-pressed":x,title:N,onClick:()=>s(x?void 0:v),onContextMenu:w=>{h&&y(w,N)},className:p?`inline-flex h-8 max-w-[70vw] shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-3 text-[11px] font-semibold uppercase tracking-[0.04em] transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-yellow-400 ${x?`${p.chipSelected} text-midnight-blue`:"border-gray-200 bg-white text-misty-blue hover:border-gray-300"}`:`inline-flex h-8 max-w-[70vw] shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-4 text-[13px] transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-yellow-400 ${x?"border-[#B0CFFF] bg-[#F2F8FF] font-semibold text-[#3366FF]":"border-gray-200 bg-white font-medium text-misty-blue hover:border-gray-300 hover:text-midnight-blue"}`,children:[v==="TRASH"&&a.jsx(Ge,{size:14,"aria-hidden":"true"}),p&&a.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${p.dot}`,"aria-hidden":"true"}),a.jsx("span",{className:"min-w-0 truncate",children:N})]})]},v??"all")}),i&&a.jsxs("span",{role:"status",className:"inline-flex items-center gap-2 px-2 text-xs text-misty-blue",children:[a.jsx(pe,{size:12,className:"animate-spin"})," Caricamento filtriâ¦"]})]}),o&&a.jsxs("div",{role:"status",className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-red-700",children:[a.jsx("span",{children:"Non è stato possibile aggiornare i filtri."}),a.jsx("button",{type:"button",onClick:l,className:"font-semibold underline",children:"Riprova"})]}),u&&a.jsxs("div",{className:"fixed z-50 rounded-lg bg-white py-1 shadow-lg",style:{left:`${u.x}px`,top:`${u.y}px`},onClick:v=>v.stopPropagation(),children:[a.jsxs("button",{type:"button",onClick:()=>{d(u.label),c(null)},className:"flex w-full items-center gap-2 px-4 py-2 text-sm text-midnight-blue transition-colors hover:bg-midnight-blue/5",children:[a.jsx(Mt,{size:16}),a.jsx("span",{children:"Modifica etichetta"})]}),a.jsxs("button",{type:"button",onClick:()=>{g(!0),c(null)},className:"flex w-full items-center gap-2 px-4 py-2 text-sm text-midnight-blue transition-colors hover:bg-midnight-blue/5",children:[a.jsx(Cy,{size:16}),a.jsx("span",{children:"Riordina etichette"})]})]}),f&&a.jsx(t4,{label:f==="new"?void 0:f,onClose:()=>d(null)}),m&&a.jsx(n4,{onClose:()=>g(!1)})]})}function s4({phoneLabel:e,isPending:t,isError:n,onConfirm:r,onClose:s}){const i=b.useRef(null);return b.useEffect(()=>{const o=i.current;return o==null||o.showModal(),()=>o==null?void 0:o.close()},[]),a.jsxs("dialog",{ref:i,"aria-labelledby":"empty-trash-title","aria-describedby":"empty-trash-description",onCancel:o=>{o.preventDefault(),t||s()},className:"w-[calc(100%_-_2rem)] max-w-md rounded-2xl bg-white p-6 shadow-xl backdrop:bg-black/40",children:[a.jsx("div",{className:"mb-4 inline-flex rounded-full bg-red-50 p-3 text-red-600",children:a.jsx(Ge,{size:24})}),a.jsx("h2",{id:"empty-trash-title",className:"text-xl font-semibold text-midnight-blue",children:"Svuota cestino"}),a.jsxs("p",{id:"empty-trash-description",className:"mt-3 text-sm leading-relaxed text-misty-blue",children:["Vuoi eliminare definitivamente tutte le chiamate nel cestino",e?a.jsxs(a.Fragment,{children:[" di ",a.jsx("strong",{className:"text-midnight-blue",children:e})]}):a.jsxs(a.Fragment,{children:[" di ",a.jsx("strong",{className:"text-midnight-blue",children:"tutti i numeri a cui hai accesso"})]}),"? Non potrai recuperarle."]}),n&&a.jsx("p",{role:"alert",className:"mt-3 text-sm text-red-600",children:"Non è stato possibile svuotare il cestino. Puoi riprovare."}),a.jsxs("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:[a.jsx("button",{type:"button",autoFocus:!0,onClick:s,disabled:t,className:"rounded-lg border border-gray-200 px-4 py-2 text-sm font-medium text-midnight-blue hover:bg-gray-50 disabled:opacity-50",children:"Annulla"}),a.jsxs("button",{type:"button",onClick:r,disabled:t,className:"inline-flex items-center gap-2 rounded-lg bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:[t&&a.jsx(pe,{size:16,className:"animate-spin"}),t?"Svuotamentoâ¦":"Svuota cestino"]})]})]})}const i4=async()=>(await ne.get("/phones")).data,Fr=()=>{const{isAuthenticated:e,activeUuid:t}=re();return Tn({queryKey:[t,"phones"],queryFn:i4,enabled:e})};function a4(e){const t=hm(e),n=b.useMemo(()=>[{filter:"UNREAD",label:"Da leggere"},...(t.data??[]).map(s=>({filter:`LABEL:${s.name}`,label:s.name})),{filter:"TRASH",label:"Cestino"}],[t.data]),r=b.useMemo(()=>Object.fromEntries((t.data??[]).map(s=>[s.name,s.color])),[t.data]);return{...t,data:n,labelColors:r,labels:t.data??[]}}const gv=({selectedPhoneId:e,onPhoneSelect:t,showAllPhonesOption:n=!0,children:r})=>{const{data:s=[]}=Fr();return b.useEffect(()=>{!n&&e===null&&s.length>0&&t(s[0].uuid)},[n,e,s,t]),a.jsxs("div",{className:"max-w-full overflow-hidden bg-white shadow-sm rounded-lg",children:[a.jsxs("div",{className:"flex gap-2 overflow-x-auto py-2 px-2",children:[n&&a.jsxs("button",{onClick:()=>t(null),className:`flex shrink-0 items-center gap-2 px-3 sm:px-4 py-2 rounded-lg whitespace-nowrap transition-colors ${e===null?"bg-yellow-400 text-midnight-blue":"text-misty-blue hover:text-midnight-blue hover:bg-off-white"}`,children:[a.jsx(_r,{size:18}),a.jsx("span",{className:"font-medium",children:"Tutti i telefoni"})]}),s.map(i=>a.jsxs("button",{onClick:()=>t(i.uuid),className:`flex min-w-0 max-w-[85vw] shrink-0 items-center gap-2 px-3 sm:px-4 py-2 rounded-lg whitespace-nowrap transition-colors sm:max-w-none ${e===i.uuid?"bg-yellow-400 text-midnight-blue":"text-misty-blue hover:text-midnight-blue hover:bg-off-white"}`,children:[a.jsx("span",{className:"min-w-0 truncate font-medium",children:i.name||"Telefono"}),a.jsx("span",{className:"shrink-0 text-sm opacity-75",children:i.phoneNumber})]},i.uuid))]}),r&&a.jsx("div",{className:"border-t border-gray-100 px-3 py-2.5 sm:px-5 sm:py-3",children:r})]})};var Ga={},o4=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},xv={},Ft={};let gm;const l4=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Ft.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};Ft.getSymbolTotalCodewords=function(t){return l4[t]};Ft.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};Ft.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');gm=t};Ft.isKanjiModeEnabled=function(){return typeof gm<"u"};Ft.toSJIS=function(t){return gm(t)};var fu={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};
584function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}})(fu);function yv(){this.buffer=[],this.length=0}yv.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var u4=yv;function Ya(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Ya.prototype.set=function(e,t,n,r){const s=e*this.size+t;this.data[s]=n,r&&(this.reservedBit[s]=!0)};Ya.prototype.get=function(e,t){return this.data[e*this.size+t]};Ya.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Ya.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var c4=Ya,vv={};(function(e){const t=Ft.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=t(r),o=i===145?26:Math.ceil((i-13)/(2*s-2))*2,l=[i-7];for(let u=1;u<s-1;u++)l[u]=l[u-1]-o;return l.push(6),l.reverse()},e.getPositions=function(r){const s=[],i=e.getRowColCoords(r),o=i.length;for(let l=0;l<o;l++)for(let u=0;u<o;u++)l===0&&u===0||l===0&&u===o-1||l===o-1&&u===0||s.push([i[l],i[u]]);return s}})(vv);var bv={};const d4=Ft.getSymbolSize,Hp=7;bv.getPositions=function(t){const n=d4(t);return[[0,0],[n-Hp,0],[0,n-Hp]]};var wv={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const i=s.size;let o=0,l=0,u=0,c=null,f=null;for(let d=0;d<i;d++){l=u=0,c=f=null;for(let m=0;m<i;m++){let g=s.get(d,m);g===c?l++:(l>=5&&(o+=t.N1+(l-5)),c=g,l=1),g=s.get(m,d),g===f?u++:(u>=5&&(o+=t.N1+(u-5)),f=g,u=1)}l>=5&&(o+=t.N1+(l-5)),u>=5&&(o+=t.N1+(u-5))}return o},e.getPenaltyN2=function(s){const i=s.size;let o=0;for(let l=0;l<i-1;l++)for(let u=0;u<i-1;u++){const c=s.get(l,u)+s.get(l,u+1)+s.get(l+1,u)+s.get(l+1,u+1);(c===4||c===0)&&o++}return o*t.N2},e.getPenaltyN3=function(s){const i=s.size;let o=0,l=0,u=0;for(let c=0;c<i;c++){l=u=0;for(let f=0;f<i;f++)l=l<<1&2047|s.get(c,f),f>=10&&(l===1488||l===93)&&o++,u=u<<1&2047|s.get(f,c),f>=10&&(u===1488||u===93)&&o++}return o*t.N3},e.getPenaltyN4=function(s){let i=0;const o=s.data.length;for(let u=0;u<o;u++)i+=s.data[u];return Math.abs(Math.ceil(i*100/o/5)-10)*t.N4};function n(r,s,i){switch(r){case e.Patterns.PATTERN000:return(s+i)%2===0;case e.Patterns.PATTERN001:return s%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(s+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return s*i%2+s*i%3===0;case e.Patterns.PATTERN110:return(s*i%2+s*i%3)%2===0;case e.Patterns.PATTERN111:return(s*i%3+(s+i)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(s,i){const o=i.size;for(let l=0;l<o;l++)for(let u=0;u<o;u++)i.isReserved(u,l)||i.xor(u,l,n(s,u,l))},e.getBestMask=function(s,i){const o=Object.keys(e.Patterns).length;let l=0,u=1/0;for(let c=0;c<o;c++){i(c),e.applyMask(c,s);const f=e.getPenaltyN1(s)+e.getPenaltyN2(s)+e.getPenaltyN3(s)+e.getPenaltyN4(s);e.applyMask(c,s),f<u&&(u=f,l=c)}return l}})(wv);var mu={};const wr=fu,No=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],jo=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,
584192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];mu.getBlocksCount=function(t,n){switch(n){case wr.L:return No[(t-1)*4+0];case wr.M:return No[(t-1)*4+1];case wr.Q:return No[(t-1)*4+2];case wr.H:return No[(t-1)*4+3];default:return}};mu.getTotalCodewordsCount=function(t,n){switch(n){case wr.L:return jo[(t-1)*4+0];case wr.M:return jo[(t-1)*4+1];case wr.Q:return jo[(t-1)*4+2];case wr.H:return jo[(t-1)*4+3];default:return}};var Nv={},hu={};const ua=new Uint8Array(512),kl=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)ua[n]=t,kl[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)ua[n]=ua[n-255]})();hu.log=function(t){if(t<1)throw new Error("log("+t+")");return kl[t]};hu.exp=function(t){return ua[t]};hu.mul=function(t,n){return t===0||n===0?0:ua[kl[t]+kl[n]]};(function(e){const t=hu;e.mul=function(r,s){const i=new Uint8Array(r.length+s.length-1);for(let o=0;o<r.length;o++)for(let l=0;l<s.length;l++)i[o+l]^=t.mul(r[o],s[l]);return i},e.mod=function(r,s){let i=new Uint8Array(r);for(;i.length-s.length>=0;){const o=i[0];for(let u=0;u<s.length;u++)i[u]^=t.mul(s[u],o);let l=0;for(;l<i.length&&i[l]===0;)l++;i=i.slice(l)}return i},e.generateECPolynomial=function(r){let s=new Uint8Array([1]);for(let i=0;i<r;i++)s=e.mul(s,new Uint8Array([1,t.exp(i)]));return s}})(Nv);const jv=Nv;function xm(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}xm.prototype.initialize=function(t){this.degree=t,this.genPoly=jv.generateECPolynomial(this.degree)};xm.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(t.length+this.degree);n.set(t);const r=jv.mod(n,this.genPoly),s=this.degree-r.length;if(s>0){const i=new Uint8Array(this.degree);return i.set(r,s),i}return r};var f4=xm,Sv={},Ur={},ym={};ym.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var On={};const Cv="[0-9]+",m4="[A-Z $%*+\\-./:]+";let Ma="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ma=Ma.replace(/u/g,"\\u");const h4="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ma+`)(?:.|[\r 585]))+`;On.KANJI=new RegExp(Ma,"g");On.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");On.BYTE=new RegExp(h4,"g");On.NUMERIC=new RegExp(Cv,"g");On.ALPHANUMERIC=new RegExp(m4,"g");const p4=new RegExp("^"+Ma+"$"),g4=new RegExp("^"+Cv+"$"),x4=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");On.testKanji=function(t){return p4.test(t)};On.testNumeric=function(t){return g4.test(t)};On.testAlphanumeric=function(t){return x4.test(t)};(function(e){const t=ym,n=On;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,o){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?i.ccBits[0]:o<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(i,o){if(e.isValid(i))return i;try{return r(i)}catch{return o}}})(Ur);(function(e){const t=Ft,n=mu,r=fu,s=Ur,i=ym,o=7973,l=t.getBCHDigit
585(o);function u(m,g,y){for(let v=1;v<=40;v++)if(g<=e.getCapacity(v,y,m))return v}function c(m,g){return s.getCharCountIndicator(m,g)+4}function f(m,g){let y=0;return m.forEach(function(v){const N=c(v.mode,g);y+=N+v.getBitsLength()}),y}function d(m,g){for(let y=1;y<=40;y++)if(f(m,y)<=e.getCapacity(y,g,s.MIXED))return y}e.from=function(g,y){return i.isValid(g)?parseInt(g,10):y},e.getCapacity=function(g,y,v){if(!i.isValid(g))throw new Error("Invalid QR Code version");typeof v>"u"&&(v=s.BYTE);const N=t.getSymbolTotalCodewords(g),x=n.getTotalCodewordsCount(g,y),h=(N-x)*8;if(v===s.MIXED)return h;const p=h-c(v,g);switch(v){case s.NUMERIC:return Math.floor(p/10*3);case s.ALPHANUMERIC:return Math.floor(p/11*2);case s.KANJI:return Math.floor(p/13);case s.BYTE:default:return Math.floor(p/8)}},e.getBestVersionForData=function(g,y){let v;const N=r.from(y,r.M);if(Array.isArray(g)){if(g.length>1)return d(g,N);if(g.length===0)return 1;v=g[0]}else v=g;return u(v.mode,v.getLength(),N)},e.getEncodedBits=function(g){if(!i.isValid(g)||g<7)throw new Error("Invalid QR Code version");let y=g<<12;for(;t.getBCHDigit(y)-l>=0;)y^=o<<t.getBCHDigit(y)-l;return g<<12|y}})(Sv);var kv={};const Hd=Ft,Ev=1335,y4=21522,Wp=Hd.getBCHDigit(Ev);kv.getEncodedBits=function(t,n){const r=t.bit<<3|n;let s=r<<10;for(;Hd.getBCHDigit(s)-Wp>=0;)s^=Ev<<Hd.getBCHDigit(s)-Wp;return(r<<10|s)^y4};var Pv={};const v4=Ur;function gi(e){this.mode=v4.NUMERIC,this.data=e.toString()}gi.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};gi.prototype.getLength=function(){return this.data.length};gi.prototype.getBitsLength=function(){return gi.getBitsLength(this.data.length)};gi.prototype.write=function(t){let n,r,s;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),s=parseInt(r,10),t.put(s,10);const i=this.data.length-n;i>0&&(r=this.data.substr(n),s=parseInt(r,10),t.put(s,i*3+1))};var b4=gi;const w4=Ur,fc=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function xi(e){this.mode=w4.ALPHANUMERIC,this.data=e}xi.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};xi.prototype.getLength=function(){return this.data.length};xi.prototype.getBitsLength=function(){return xi.getBitsLength(this.data.length)};xi.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=fc.indexOf(this.data[n])*45;r+=fc.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(fc.indexOf(this.data[n]),6)};var N4=xi;const j4=Ur;function yi(e){this.mode=j4.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}yi.getBitsLength=function(t){return t*8};yi.prototype.getLength=function(){return this.data.length};yi.prototype.getBitsLength=function(){return yi.getBitsLength(this.data.length)};yi.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var S4=yi;const C4=Ur,k4=Ft;function vi(e){this.mode=C4.KANJI,this.data=e}vi.getBitsLength=function(t){return t*13};vi.prototype.getLength=function(){return this.data.length};vi.prototype.getBitsLength=function(){return vi.getBitsLength(this.data.length)};vi.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=k4.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` 586Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var E4=vi,Rv={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,r,s){var i={},o={};o[r]=0;var l=t.PriorityQueue.make();l.push(r,0);for(var u,c,f,d,m,g,y,v,N;!l.empty();){u=l.pop(),c=u.value,d=u.cost,m=n[c]||{};for(f in m)m.hasOwnProperty(f)&&(g=m[f],y=d+g,v=o[f],N=typeof o[f]>"u",(N||v>y)&&(o[f]=y,l.push(f,y),i[f]=c))}if(typeof s<"u"&&typeof o[s]>"u"){var x=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(x)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],i=r;i;)s.push(i),n[i],i=n[i];return s.reverse(),s},find_path:function(n,r,s){var i=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Rv);var P4=Rv.exports;(function(e){const t=Ur,n=b4,r=N4,s=S4,i=E4,o=On,l=Ft,u=P4;function c(x){return unescape(encodeURIComponent(x)).length}function f(x,h,p){const w=[];let C;for(;(C=x.exec(p))!==null;)w.push({data:C[0],index:C.index,mode:h,length:C[0].length});return w}
vendor: 8,957 bytes, lines 586-591
586function d(x){const h=f(o.NUMERIC,t.NUMERIC,x),p=f(o.ALPHANUMERIC,t.ALPHANUMERIC,x);let w,C;return l.isKanjiModeEnabled()?(w=f(o.BYTE,t.BYTE,x),C=f(o.KANJI,t.KANJI,x)):(w=f(o.BYTE_KANJI,t.BYTE,x),C=[]),h.concat(p,w,C).sort(function(A,O){return A.index-O.index}).map(function(A){return{data:A.data,mode:A.mode,length:A.length}})}function m(x,h){switch(h){case t.NUMERIC:return n.getBitsLength(x);case t.ALPHANUMERIC:return r.getBitsLength(x);case t.KANJI:return i.getBitsLength(x);case t.BYTE:return s.getBitsLength(x)}}function g(x){return x.reduce(function(h,p){const w=h.length-1>=0?h[h.length-1]:null;return w&&w.mode===p.mode?(h[h.length-1].data+=p.data,h):(h.push(p),h)},[])}function y(x){const h=[];for(let p=0;p<x.length;p++){const w=x[p];switch(w.mode){case t.NUMERIC:h.push([w,{data:w.data,mode:t.ALPHANUMERIC,length:w.length},{data:w.data,mode:t.BYTE,length:w.length}]);break;case t.ALPHANUMERIC:h.push([w,{data:w.data,mode:t.BYTE,length:w.length}]);break;case t.KANJI:h.push([w,{data:w.data,mode:t.BYTE,length:c(w.data)}]);break;case t.BYTE:h.push([{data:w.data,mode:t.BYTE,length:c(w.data)}])}}return h}function v(x,h){const p={},w={start:{}};let C=["start"];for(let E=0;E<x.length;E++){const A=x[E],O=[];for(let L=0;L<A.length;L++){const D=A[L],Z=""+E+L;O.push(Z),p[Z]={node:D,lastCount:0},w[Z]={};for(let Y=0;Y<C.length;Y++){const z=C[Y];p[z]&&p[z].node.mode===D.mode?(w[z][Z]=m(p[z].lastCount+D.length,D.mode)-m(p[z].lastCount,D.mode),p[z].lastCount+=D.length):(p[z]&&(p[z].lastCount=D.length),w[z][Z]=m(D.length,D.mode)+4+t.getCharCountIndicator(D.mode,h))}}C=O}for(let E=0;E<C.length;E++)w[C[E]].end=0;return{map:w,table:p}}function N(x,h){let p;const w=t.getBestModeForData(x);if(p=t.from(h,w),p!==t.BYTE&&p.bit<w.bit)throw new Error('"'+x+'" cannot be encoded with mode '+t.toString(p)+`. 587 Suggested mode is: `+t.toString(w));switch(p===t.KANJI&&!l.isKanjiModeEnabled()&&(p=t.BYTE),p){case t.NUMERIC:return new n(x);case t.ALPHANUMERIC:return new r(x);case t.KANJI:return new i(x);case t.BYTE:return new s(x)}}e.fromArray=function(h){return h.reduce(function(p,w){return typeof w=="string"?p.push(N(w,null)):w.data&&p.push(N(w.data,w.mode)),p},[])},e.fromString=function(h,p){const w=d(h,l.isKanjiModeEnabled()),C=y(w),E=v(C,p),A=u.find_path(E.map,"start","end"),O=[];for(let L=1;L<A.length-1;L++)O.push(E.table[A[L]].node);return e.fromArray(g(O))},e.rawSplit=function(h){return e.fromArray(d(h,l.isKanjiModeEnabled()))}})(Pv);const pu=Ft,mc=fu,R4=u4,A4=c4,T4=vv,O4=bv,Wd=wv,Qd=mu,_4=f4,El=Sv,M4=kv,L4=Ur,hc=Pv;function D4(e,t){const n=e.size,r=O4.getPositions(t);for(let s=0;s<r.length;s++){const i=r[s][0],o=r[s][1];for(let l=-1;l<=7;l++)if(!(i+l<=-1||n<=i+l))for(let u=-1;u<=7;u++)o+u<=-1||n<=o+u||(l>=0&&l<=6&&(u===0||u===6)||u>=0&&u<=6&&(l===0||l===6)||l>=2&&l<=4&&u>=2&&u<=4?e.set(i+l,o+u,!0,!0):e.set(i+l,o+u,!1,!0))}}function z4(e){const t=e.size;for(let n=8;n<t-8;n++){const r=n%2===0;e.set(n,6,r,!0),e.set(6,n,r,!0)}}function I4(e,t){const n=T4.getPositions(t);for(let r=0;r<n.length;r++){const s=n[r][0],i=n[r][1];for(let o=-2;o<=2;o++)for(let l=-2;l<=2;l++)o===-2||o===2||l===-2||l===2||o===0&&l===0?e.set(s+o,i+l,!0,!0):e.set(s+o,i+l,!1,!0)}}function F4(e,t){const n=e.size,r=El.getEncodedBits(t);let s,i,o;for(let l=0;l<18;l++)s=Math.floor(l/3),i=l%3+n-8-3,o=(r>>l&1)===1,e.set(s,i,o,!0),e.set(i,s,o,!0)}function pc(e,t,n){const r=e.size,s=M4.getEncodedBits(t,n);let i,o;for(i=0;i<15;i++)o=(s>>i&1)===1,i<6?e.set(i,8,o,!0):i<8?e.set(i+1,8,o,!0):e.set(r-15+i,8,o,!0),i<8?e.set(8,r-i-1,o,!0):i<9?e.set(8,15-i-1+1,o,!0):e.set(8,15-i-1,o,!0);e.set(r-8,8,1,!0)}function U4(e,t){const n=e.size;let r=-1,s=n-1,i=7,o=0;for(let l=n-1;l>0;l-=2)for(l===6&&l--;;){for(let u=0;u<2;u++)if(!e.isReserved(s,l-u)){let c=!1;o<t.length&&(c=(t[o]>>>i&1)===1),e.set(s,l-u,c),i--,i===-1&&(o++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function $4(e,t,n){const r=new R4;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),L4.getCharCountIndicator(u.mode,e)),u.write(r)});const s=pu.getSymbolTotalCodewords(e),i=Qd.getTotalCodewordsCount(e,t),o=(s-i)*8;for(r.getLengthInBits()+4<=o&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const l=(o-r.getLengthInBits())/8;for(let u=0;u<l;u++)r.put(u%2?17:236,8);return B4(r,e,t)}function B4(e,t,n){const r=pu.getSymbolTotalCodewords(t),s=Qd.getTotalCodewordsCount(t,n),i=r-s,o=Qd.getBlocksCount(t,n),l=r%o,u=o-l,c=Math.floor(r/o),f=Math.floor(i/o),d=f+1,m=c-f,g=new _4(m);let y=0;const v=new Array(o),N=new Array(o);let x=0;const h=new Uint8Array(e.buffer);for(let A=0;A<o;A++){const O=A<u?f:d;v[A]=h.slice(y,y+O),N[A]=g.encode(v[A]),y+=O,x=Math.max(x,O)}const p=new Uint8Array(r);let w=0,C,E;for(C=0;C<x;C++)for(E=0;E<o;E++)C<v[E].length&&(p[w++]=v[E][C]);for(C=0;C<m;C++)for(E=0;E<o;E++)p[w++]=N[E][C];return p}function V4(e,t,n,r){let s;if(Array.isArray(e))s=hc.fromArray(e);else if(typeof e=="string"){let c=t;if(!c){const f=hc.rawSplit(e);c=El.getBestVersionForData(f,n)}s=hc.fromString(e,c||40)}else throw new Error("Invalid data");const i=El.getBestVersionForData(s,n);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=i;else if(t<i)throw new Error(` 588The chosen QR Code version cannot contain this amount of data. 589Minimum version required to store current data is: `+i+`. 590`);const o=$4(t,n,s),l=pu.getSymbolSize(t),u=new A4(l);return D4(u,t),z4(u),I4(u,t),pc(u,n,0),t>=7&&F4(u,t),U4(u,o),isNaN(r)&&(r=Wd.getBestMask(u,pc.bind(null,u,n))),Wd.applyMask(r,u),pc(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:s}}xv.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=mc.M,s,i;return typeof n<"u"&&(r=mc.from(n.errorCorrectionLevel,mc.M),s=El.from(n.version),i=Wd.from(n.maskPattern),n.toSJISFunc&&pu.setToSJISFunction(n.toSJISFunc)),V4(t,s,r,i)};var Av={},vm={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:i,scale:i?4:o,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const i=e.getScale(r,s);return Math.floor((r+s.margin*2)*i)},e.qrToImageData=function(r,s,i){const o=s.modules.size,l=s.modules.data,u=e.getScale(o,i),c=Math.floor((o+i.margin*2)*u),f=i.margin*u,d=[i.color.light,i.color.dark];for(let m=0;m<c;m++)for(let g=0;g<c;g++){let y=(m*c+g)*4,v=i.color.light;if(m>=f&&g>=f&&m<c-f&&g<c-f){const N=Math.floor((m-f)/u),x=Math.floor((g-f)/u);v=d[l[N*o+x]?1:0]}r[y++]=v.r,r[y++]=v.g,r[y++]=v.b,r[y]=v.a}}})(vm);(function(e){const t=vm;function n(s,i,o){s.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=o,i.width=o,i.style.height=o+"px",i.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,o,l){let u=l,c=o;typeof u>"u"&&(!o||!o.getContext)&&(u=o,o=void 0),o||(c=r()),u=t.getOptions(u);const f=t.getImageWidth(i.modules.size,u),d=c.getContext("2d"),m=d.createImageData(f,f);return t.qrToImageData(m.data,i,u),n(d,c,f),d.putImageData(m,0,0),c},e.renderToDataURL=function(i,o,l){let u=l;typeof u>"u"&&(!o||!o.getContext)&&(u=o,o=void 0),u||(u={});const c=e.render(i,o,u),f=u.type||"image/png",d=u.rendererOpts||{};return c.toDataURL(f,d.quality)}})(Av);var Tv={};const q4=vm;function Qp(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function gc(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function H4(e,t,n){let r="",s=0,i=!1,o=0;for(let l=0;l<e.length;l++){const u=Math.floor(l%t),c=Math.floor(l/t);!u&&!i&&(i=!0),e[l]?(o++,l>0&&u>0&&e[l-1]||(r+=i?gc("M",u+n,.5+c+n):gc("m",s,0),s=0,i=!1),u+1<t&&e[l+1]||(r+=gc("h",o),o=0)):s++}return r}Tv.render=function(t,n,r){const s=q4.getOptions(n),i=t.modules.size,o=t.modules.data,l=i+s.margin*2,u=s.color.light.a?"<path "+Qp(s.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",c="<path "+Qp(s.color.dark,"stroke")+' d="'+H4(o,i,s.margin)+'"/>',f='viewBox="0 0 '+l+" "+l+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+f+' shape-rendering="crispEdges">'+u+c+`</svg> 591`;return typeof r=="function"&&r(null,m),m};const W4=o4,Kd=xv,Ov=Av,Q4=Tv;
591function bm(e,t,n,r,s){const i=[].slice.call(arguments,1),o=i.length,l=typeof i[o-1]=="function";if(!l&&!W4())throw new Error("Callback required as last argument");if(l){if(o<2)throw new Error("Too few arguments provided");o===2?(s=n,n=t,t=r=void 0):o===3&&(t.getContext&&typeof s>"u"?(s=r,r=void 0):(s=r,r=n,n=t,t=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(n=t,t=r=void 0):o===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,c){try{const f=Kd.create(n,r);u(e(f,t,r))}catch(f){c(f)}})}try{const u=Kd.create(n,r);s(null,e(u,t,r))}catch(u){s(u)}}Ga.create=Kd.create;Ga.toCanvas=bm.bind(null,Ov.render);Ga.toDataURL=bm.bind(null,Ov.renderToDataURL);Ga.toString=bm.bind(null,function(e,t,n){return Q4.render(e,n)});const K4=({isOpen:e,onClose:t,phoneNumber:n})=>{const r=b.useRef(null);return b.useEffect(()=>{if(e&&r.current){const s=`tel:${n}`;Ga.toCanvas(r.current,s,{width:200,margin:2,color:{dark:"#0E1A39",light:"#F7F9FC"}})}},[e,n]),b.useEffect(()=>{const s=i=>{i.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",s),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",s),document.body.style.overflow="unset"}},[e,t]),e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),a.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4 animate-in fade-in zoom-in duration-200",children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-100",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"bg-yellow-400 rounded-full p-2",children:a.jsx(_r,{size:20,className:"text-midnight-blue"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Richiama numero"}),a.jsx("p",{className:"text-sm text-misty-blue",children:n})]})]}),a.jsx("button",{onClick:t,className:"p-2 rounded-lg hover:bg-gray-100 transition-colors",children:a.jsx(De,{size:20,className:"text-misty-blue"})})]}),a.jsxs("div",{className:"p-6 text-center space-y-6",children:[a.jsx("div",{className:"bg-off-white rounded-2xl p-6 inline-block",children:a.jsx("canvas",{ref:r,className:"block mx-auto"})}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("h4",{className:"text-lg font-medium text-midnight-blue",children:"Inquadra con il telefono"}),a.jsxs("p",{className:"text-sm text-misty-blue leading-relaxed",children:["Inquadra questo QR code con la fotocamera del tuo telefono per avviare automaticamente la chiamata a"," ",a.jsx("span",{className:"font-medium text-midnight-blue",children:n})]})]}),a.jsx("div",{className:"bg-yellow-50 rounded-lg p-4",children:a.jsxs("p",{className:"text-xs text-yellow-800",children:["ð¡ ",a.jsx("strong",{children:"Suggerimento:"})," La maggior parte degli smartphone riconosce automaticamente i QR code tramite la fotocamera o l'app dedicata"]})})]}),a.jsx("div",{className:"flex justify-center p-6 pt-0",children:a.jsx("button",{onClick:t,className:"btn btn-secondary px-6",children:"Chiudi"})})]})]}):null},G4=3e4,Y4=12e4;function X4(){const e=hn(),[t,n]=b.useState(!document.hidden);return b.useEffect(()=>{const r=()=>n(!document.hidden);return document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[]),t&&e.pathname==="/"}const J4=async({cursor:e,phoneUuid:t,filter:n,signal:r})=>{const s=new URLSearchParams;return t&&s.append("phoneUuid",t),n&&s.append("filter",n),e&&s.append("cursor",e),(await ne.get(`/call-lost?withEvents=true${s.toString()?"&"+s.toString():""}`,{signal:r})).data},_v=(e={})=>{const{isAuthenticated:t,activeUuid:n}=re(),{phoneUuid:r,filter:s}=e,i=X4(),o=p2({queryKey:[n,"calls-lost",r,s],queryFn:({pageParam:l,signal:u})=>J4({cursor:l,phoneUuid:r,filter:s,signal:u}),getNextPageParam:l=>l.cursor,enabled:t,initialPageParam:void 0,refetchInterval:i?G4:Y4,refetchOnWindowFocus:!0,refetchIntervalInBackground:!1});return{...o,lastUpdate:o.dataUpdatedAt?new Date(o.dataUpdatedAt):new Date}},Mv=b.createContext(void 0),Z4=e=>{const t=e.toLowerCase().split("?")[0];return t.endsWith(".mp3")?"audio/mpeg":t.endsWith(".ogg")?"audio/ogg":t.endsWith(".m4a")?"audio/mp4":t.endsWith(".aac")?"audio/aac":"audio/wav"},eP=({children:e})=>{const[t,n]=b.useState(null),r=b.useRef(null),s=b.useRef(null),i=()=>{s.current&&(URL.revokeObjectURL(s.current),s.current=null)},o=b.useCallback(()=>
591{if(!r.current){const d=document.createElement("audio");d.preload="auto",d.playsInline=!0,d.setAttribute("webkit-playsinline","true"),r.current=d,d.onended=()=>{n(null)},d.onerror=()=>{console.warn("Audio playback error"),n(null)},d.onpause=()=>{n(null)}}return r.current},[]),l=b.useCallback(()=>{const d=r.current;d&&(d.pause(),d.currentTime=0,i()),n(null)},[]),u=b.useCallback(async d=>{var g;if(!d)return!1;const m=o();i(),m.pause(),m.currentTime=0,n(d),m.src=d,m.load();try{return await m.play(),!0}catch(y){if(y instanceof DOMException&&y.name==="NotSupportedError")try{const v=await fetch(d,{cache:"no-store"});if(!v.ok)throw new Error(`Audio fetch failed: ${v.status}`);const N=await v.blob();if(!N||N.size===0)throw new Error("Fetched audio is empty");const x=(g=N.type)!=null&&g.startsWith("audio/")?N.type:Z4(d),h=new Blob([await N.arrayBuffer()],{type:x}),p=URL.createObjectURL(h);return s.current=p,m.pause(),m.currentTime=0,m.src=p,m.load(),await m.play(),n(d),!0}catch(v){console.warn("Audio fallback playback failed:",v)}return console.warn("Audio playback failed:",y),n(null),!1}},[o]),c=b.useCallback(d=>{d?u(d):l()},[u,l]),f=b.useCallback(d=>t===d,[t]);return b.useEffect(()=>()=>{r.current&&(r.current.pause(),r.current.src=""),i()},[]),a.jsx(Mv.Provider,{value:{currentPlayingUrl:t,setCurrentPlayingUrl:c,isCurrentlyPlaying:f,playAudio:u,stopAudio:l,getAudioElement:o},children:e})},Lv=()=>{const e=b.useContext(Mv);if(e===void 0)throw new Error("useAudioContext must be used within an AudioProvider");return e},wm=({url:e,className:t=""})=>{const[n,r]=b.useState(0),[s,i]=b.useState(0),[o,l]=b.useState(!1),[u,c]=b.useState(!1),f=b.useRef(null),d=b.useRef(0),{setCurrentPlayingUrl:m,isCurrentlyPlaying:g,currentPlayingUrl:y,getAudioElement:v}=Lv(),N=g(e);b.useEffect(()=>{if(!N){cancelAnimationFrame(d.current);return}const L=()=>{const D=v();isFinite(D.duration)&&D.duration>0&&(i(D.duration),o||r(D.currentTime/D.duration*100)),d.current=requestAnimationFrame(L)};return d.current=requestAnimationFrame(L),()=>cancelAnimationFrame(d.current)},[N,o,v]),b.useEffect(()=>{y&&y!==e&&(r(0),i(0))},[y,e]);const x=()=>{m(N?null:e)},h=b.useCallback(L=>{if(f.current){const D=f.current.getBoundingClientRect(),Z=L-D.left,Y=Math.max(0,Math.min(1,Z/D.width));r(Y*100);const z=v();isFinite(z.duration)&&(z.currentTime=Y*z.duration)}},[v]),p=L=>{L.preventDefault(),l(!0),c(N),N&&m(null),h(L.clientX)},w=b.useCallback(L=>{o&&(L.preventDefault(),h(L.clientX))},[o,h]),C=b.useCallback(()=>{o&&(l(!1),u&&m(e))},[o,u,e,m]);b.useEffect(()=>(o&&(document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),document.addEventListener("mouseleave",C)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),document.removeEventListener("mouseleave",C)}),[o,w,C]);const E=L=>{if(!isFinite(L)||L<0)return"--:--";const D=Math.floor(L/60),Z=Math.floor(L%60);return`${D}:${Z.toString().padStart(2,"0")}`},A=isFinite(s)&&s>0?n/100*s:0,O=isFinite(s)&&s>0;return a.jsxs("div",{className:`flex items-center gap-4 ${t}`,children:[a.jsx("div",{className:"flex-shrink-0",children:a.jsx("button",{onClick:x,className:"btn-icon bg-yellow-400 text-midnight-blue hover:bg-yellow-500","aria-label":N?"Pause":"Play",children:N?a.jsx(Ry,{size:16}):a.jsx(Ay,{size:16})})}),a.jsxs("div",{className:"flex-1 py-1.5",children:[a.jsx("div",{ref:f,className:"relative bg-midnight-blue/5 rounded-full h-1.5 cursor-pointer select-none",onMouseDown:p,children:a.jsx("div",{className:`bg-yellow-400 h-1.5 rounded-full ${o?"":"transition-all duration-75 ease-linear"}`,style:{width:`${n}%`,transform:"translateZ(0)"}})}),O&&a.jsxs("div",{className:"mt-1.5 text-xs text-misty-blue",children:[E(A)," / ",E(s)]})]})]})},Dv=e=>e>100?"100+":String(e),tP=({title:e,index:t,totalAgentEvents:n,conversation:r,recordedConversationUrl:s})=>{var c;const[i,o]=b.useState(!0),l=n>1?`${e} #${t+1}`:e,u=(c=r[0])==null?void 0:c.createdAt;return a.jsxs("div",{className:"border-l-3 border-yellow-400 pl-3",children:[a.jsxs("button",{type:"button",onClick:()=>o(f=>!f),className:"flex items-center gap-2 w-full text-left",children:[i?a.jsx(wy,{size:14,className:"text-midnight-blue/60 shrink-0"}):a.jsx(Ny,{size:14,className:"text-midnight-blue/60 shrink-0"}),a.jsx(by,{size:14,className:"text-midnight-blue/60 shrink-0"}),a.jsx("h4",{className:"text-sm font-medium text-midnight-blue",children:l}),u&&a.jsx("span",{className:"text-xs text-misty-blue ml-auto",children:fn(new Date(u),"HH:mm",{locale:Mr})})]}),i&&a.jsxs("div",{className:"mt-3 space-y-3",children:[s&&a.jsx(wm,{url:s,className:"max-w-md"}),r.length===0?a.jsx("p",{className:"text-xs text-misty-blue italic",children:"Nessuna conversazione registrata"}):a.jsx("div",{className:"space-y-2",children:r.map((f,d)=>a.jsx("div",{className:`flex ${f.role==="USER"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] rounded-lg px-3 py-2 ${f.role==="USER"?"bg-midnight-blue text-white":"bg-white border border-midnight-blue/10 text-midnight-blue"}`,children:[a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:f.text}),a.jsx("p",{className:`text-[10px] mt-1 ${f.role==="USER"?"text-white/60":"text-misty-blue"}`,children:fn(new Date(f.createdAt),"HH:mm:ss",{locale:Mr})})]})},d))})]})]})},nP=100;function Kp(e){return!e.audioUrl&&!e.answeredBy&&!e.transcription&&!e.isAgentHandled&&!e.isNotificationHidden}function rP(e,t){if(e.labels.length!==t.labels.length)return!1;const n=[...e.labels].sort(),r=[...t.labels].sort();return n.every((s,i)=>s===r[i])}function sP(e,t){return Kp(e)&&Kp(t)&&e.caller===t.caller&&e.called===t.called&&e.phoneUuid===t.phoneUuid&&e.calledPhoneName===t.calledPhoneName&&e.isCallerSpam===t.isCallerSpam&&e.isDeleted===t.isDeleted&&rP(e,t)}function iP(e){const t=[];for(const n of e){const r=t[t.length-1];if(r&&r.groupedCallIds.length<nP&&sP(r,n)){t[t.length-1]={...r,isNew:r.isNew||n.isNew,groupedCallIds:[...r.groupedCallIds,n.uuid]};continue}t.push({...n,groupedCallIds:[n.uuid]})}return t}const Gd="DO_NOT_GROUP_CONSECUTIVE_CALLS";function aP(){try{return localStorage.getItem(Gd)!=="true"}catch{return!0}}function rr(e){return e.groupedCallIds.length>0?e.groupedCallIds:[e.uuid]}function Gp(e,t){const n=rr(e);return n.length>1?{callUuids:n,isNew:t}:{callUuid:e.uuid,isNew:t}}function oP(e){const t=rr(e);return t.length>1?{callUuids:t}:{callUuid:e.uuid}}const lP=()=>{const{activeUuid:e}=re();return a.jsx(uP,{},e)},uP=()=>{var k,P,q,V;const[e,t]=b.useState(),[n,r]=b.useState(null),[s,i]=b.useState(null),[o,l]=b.useState([]),[u,c]=b.useState(aP),[f,d]=b.useState(!1),[m,g]=b.useState(!1),[y,v]=b.useState(""),N=b.useRef(null),[x,h]=b.useState(null),{data:p=[]}=Fr(),w=e==="TRASH",{data:C,fetchNextPage:E,hasNextPage:A,isFetchingNextPage:O,refetch:L,isRefetching:D,isPending:Z,isError:Y,isFetchNextPageError:z,lastUpdate:K}=_v({phoneUuid:n||void 0,filter:e}),Q=a4(n||void 0),ae=(k=Q.data)==null?void 0:k.find(R=>R.filter===e),$=!!n||!!e,_=R=>{t(R),i(null),_n(!1)},H=R=>{R!==n&&(r(R),i(null),_n(!1))};b.useEffect(()=>{e&&Q.isSuccess&&!Q.data.some(R=>R.filter===e)&&(t(void 0),i(null))},[e,Q.isSuccess,Q.data]);const M=$E(),I=UE(),B=BE(),oe=VE(),ue=qE(),Be=WE(),Oe=ue.isPending||Be.isPending,[$t,_n]=b.useState(!1);b.useEffect(()=>{if(!$t)return;const R=setTimeout(()=>_n(!1),5e3);return()=>clearTimeout(R)},[$t]),b.useEffect(()=>{_n(!1)},[n,e]),b.useEffect(()=>{try{u?localStorage.removeItem(Gd):localStorage.setItem(Gd,"true")}catch{}},[u]),b.useEffect(()=>{N.current&&N.current.scrollTo({top:0,behavior:"smooth"})},[n,e]);const Pu=R=>{M.mutate(Gp(R,!1),{onSuccess:()=>i(F=>(F==null?void 0:F.uuid)===R.uuid?{...F,isNew:!1}:F)})},bs=R=>{M.mutate(Gp(R,!0),{onSuccess:()=>i(F=>(F==null?void 0:F.uuid)===R.uuid?null:F)})},Pi=R=>{w||R.isDeleted||I.mutate(oP(R),{onSuccess:()=>i(F=>F!=null&&F.groupedCallIds.some(ee=>R.groupedCallIds.includes(ee))?null:F)})},Ri=()=>{w||B.mutate({phoneUuid:n||void 0,filter:e},{onSuccess:()=>{i(R=>R?{...R,isNew:!1}:null),me.success("Chiamate segnate come lette")}})},Ai=async()=>
591{if(!w){if(!$t){_n(!0);return}try{await oe.mutateAsync({phoneUuid:n||void 0,filter:e}),me.success("Chiamate eliminate"),i(null),_n(!1)}catch{}}},Ja=R=>{if(Oe)return;const F=rr(R);ue.mutate({phoneUuid:R.phoneUuid,callUuids:F},{onSuccess:()=>{i(ee=>ee&&rr(ee).some(ce=>F.includes(ce))?null:ee),me.success(F.length>1?"Chiamate recuperate":"Chiamata recuperata")}})},Za=()=>{!x||Oe||Be.mutate({phoneUuid:x.uuid},{onSuccess:()=>{i(R=>!x.uuid||(R==null?void 0:R.phoneUuid)===x.uuid?null:R),h(null),me.success("Cestino svuotato")}})},Ru=R=>{i(R),l(Bt.filter(F=>rr(R).includes(F.uuid))),R.isNew&&Pu(R)},Bt=b.useMemo(()=>(C==null?void 0:C.pages.flatMap(R=>R.data))||[],[C]),ws=b.useMemo(()=>u?iP(Bt):Bt.map(R=>({...R,groupedCallIds:[R.uuid]})),[Bt,u]),Ti=((P=C==null?void 0:C.pages[0])==null?void 0:P.unreadCount)||0;b.useEffect(()=>{if(!s)return;const R=rr(s),F=ws.find(ee=>rr(ee).some(ce=>R.includes(ce)));if(!F){e!=="UNREAD"&&i(null);return}F!==s&&i(F)},[ws,s,e]);const Oi=b.useMemo(()=>{if(!s)return[];const R=new Map([...o,...Bt].map(F=>[F.uuid,F]));return rr(s).map(F=>R.get(F)??(s.uuid===F?s:void 0)).filter(F=>!!F)},[Bt,s,o]),_i=Oi.length>1,eo=R=>{v(R),g(!0)},j=R=>{window.open(`https://wa.me/${R.replace(/\D/g,"")}`,"_blank")};return a.jsxs("div",{className:"flex h-full min-h-0 flex-col gap-3 md:gap-4",children:[a.jsxs("div",{className:`${s?"hidden md:flex":"flex"} flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[a.jsx("h1",{className:"text-2xl font-bold text-midnight-blue",children:"Chiamate"}),Ti>0&&a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-sm font-medium bg-yellow-100 text-yellow-800",children:[Dv(Ti)," da leggere in totale"]})]}),a.jsxs("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto sm:gap-4",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-1 text-sm text-misty-blue",children:[a.jsx(gj,{size:14}),a.jsx("span",{className:"truncate",children:C?`Aggiornato alle ${K.toLocaleTimeString("it-IT")}`:"In attesa di aggiornamento"})]}),a.jsxs("button",{onClick:()=>{L(),Q.refetch()},disabled:D||Q.isFetching,className:"inline-flex items-center gap-1 text-sm font-medium text-midnight-blue/75 hover:text-midnight-blue disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[a.jsx(am,{size:14,className:`${D?"animate-spin":""} shrink-0`}),a.jsx("span",{children:"Aggiorna"})]}),!w&&a.jsxs("div",{className:"inline-flex items-center gap-1",children:[a.jsxs("button",{type:"button",role:"switch","aria-checked":u,onClick:()=>c(R=>!R),className:"inline-flex items-center gap-2 text-sm font-medium text-midnight-blue/75 hover:text-midnight-blue transition-colors",children:[a.jsx("span",{className:`relative inline-flex h-5 w-9 flex-shrink-0 rounded-full transition-colors ${u?"bg-yellow-400":"bg-gray-300"}`,children:a.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-white shadow transition-transform ${u?"translate-x-4":"translate-x-0.5"}`})}),a.jsx("span",{children:"Raggruppa"})]}),a.jsxs("div",{className:"relative inline-flex",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[a.jsx("button",{type:"button","aria-label":"Informazioni sul raggruppamento","aria-expanded":f,onClick:()=>d(!0),onFocus:()=>d(!0),onBlur:()=>d(!1),className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-misty-blue transition-colors hover:bg-midnight-blue/5 hover:text-midnight-blue focus:outline-none focus:ring-2 focus:ring-yellow-400/60",children:a.jsx(lp,{size:14})}),f&&a.jsx("div",{role:"tooltip",className:"absolute right-0 top-full z-20 mt-2 w-64 rounded-lg border border-gray-200 bg-white px-3 py-2 text-left text-xs font-medium leading-5 text-midnight-blue shadow-lg",children:"Le chiamate consecutive della stessa persona vengono raggruppate."})]})]}),!w&&Bt.length>0&&Ti>0&&a.jsxs("button",{onClick:Ri,disabled:B.isPending||oe.isPending,className:"group flex items-center gap-2 text-sm font-medium text-midnight-blue/75 hover:text-midnight-blue disabled:cursor-not-allowed disabled:opacity-50 transition-colors",children:[a.jsx(hj,{size:18,className:"text-yellow-500 group-hover:text-yellow-600 transition-colors"}),a.jsx("span",{className:"hidden sm:inline",children:$?"Segna filtrate come lette":"Segna tutte come lette"}),a.jsx("span",{className:"sm:hidden",children:"Segna lette"})]}),!w&&Bt.length>0&&a.jsxs("button",{onClick:Ai,disabled:oe.isPending||B.isPending,className:`flex items-center gap-2 text-sm font-medium rounded-md px-2 py-1 transition-colors disabled:opacity-50 ${$t?"bg-red-600 text-white hover:bg-red-700":"text-red-500/90 hover:text-red-600 hover:bg-red-50"}`,children:[oe.isPending?a.jsx(pe,{size:18,className:"animate-spin"}):a.jsx(Ge,{size:18}),a.jsx("span",{children:$t?"Conferma eliminazione":$?"Elimina filtrate":"Elimina tutte"})]}),w&&a.jsxs("button",{type:"button",onClick:()=>{const R=p.find(F=>F.uuid===n);n&&!R||(Be.reset(),h(R?{uuid:R.uuid,label:R.name?`${R.name} (${R.phoneNumber})`:R.phoneNumber}:{}))},disabled:!!n&&!p.some(R=>R.uuid===n)||Bt.length===0||Z||D||O||Y||Oe,className:"inline-flex items-center gap-2 rounded-md px-2 py-1 text-sm font-medium text-red-600 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-50",children:[Be.isPending?a.jsx(pe,{size:18,className:"animate-spin"}):a.jsx(Ge,{size:18}),a.jsx("span",{children:"Svuota cestino"})]})]})]}),a.jsxs("div",{className:s?"hidden md:block":"block",children:[a.jsx(gv,{selectedPhoneId:n,onPhoneSelect:H,showAllPhonesOption:!0,children:a.jsx(r4,{filters:Q.data??[],labels:Q.labels,labelColors:Q.labelColors,selectedFilter:e,onSelect:_,isPending:Q.isPending,isError:Q.isError,onRetry:()=>{Q.refetch()}})}),w&&a.jsxs("div",{className:"mt-2 space-y-1 px-1 text-xs text-misty-blue",children:[a.jsxs("p",{className:"flex items-start gap-1.5",children:[a.jsx(lp,{size:14,className:"mt-0.5 shrink-0"}),"Le chiamate restano nel cestino per 30 giorni, poi vengono eliminate automaticamente."]}),!n&&a.jsx("p",{children:"Seleziona un telefono per svuotare il cestino."})]})]}),a.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 md:flex-row md:gap-6",children:[a.jsx("div",{className:`${s?"hidden md:block":"block"} min-h-0 w-full flex-shrink-0 bg-white rounded-lg shadow-sm overflow-hidden md:w-[400px]`,children:a.jsx("div",{className:"h-full flex flex-col",children:a.jsx("div",{ref:N,className:"min-h-0 flex-1 overflow-y-auto",children:a.jsx(QE,{calls:ws,labelColors:Q.labelColors,filterLabel:ae==null?void 0:ae.label,filter:e,isFiltered:$,isError:Y,onRetry:()=>{z?E():L()},onResetFilters:()=>{w||r(null),_()},selectedCall:s,onCallSelect:Ru,onMarkAsUnread:bs,onDelete:Pi,onUndelete:Ja,isUndeletePending:Oe,recoveringCallUuids:ue.isPending?(q=ue.variables)==null?void 0:q.callUuids:void 0,onLoadMore:()=>{A&&!O&&!Y&&E()},isLoading:Z||O,hasMore:!!A})})})}),a.jsx("div",{className:`${s?"block":"hidden md:block"} min-h-0 flex-1 bg-white rounded-lg shadow-sm overflow-hidden md:min-w-0`,children:s?a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a.jsxs("div",{className:"flex-shrink-0 border-b border-gray-100 p-4 md:p-6",children:[a.jsxs("button",{onClick:()=>i(null),className:"mb-4 inline-flex items-center gap-2 text-sm font-medium text-misty-blue transition-colors hover:text-midnight-blue md:hidden",children:[a.jsx(la,{size:18}),a.jsx("span",{children:"Chiamate"})]}),a.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"text-sm font-medium text-misty-blue",children:s.calledPhoneName||"Telefono"}),a.jsx("span",{className:"text-xs text-misty-blue opacity-75",children:s.called})]}),a.jsx("h2",{className:"break-words text-xl font-semibold text-midnight-blue",children:s.caller==="anonymous"?"Anonimo":s.caller}),a.jsx("p",{className:"text-sm text-misty-blue mt-1",children:fn(new Date(s.createdAt),"EEEE d MMMM yyyy, HH:mm",{locale:Mr})}),_i&&a.jsxs("div",{className:"mt-3 max-w-md rounded-lg bg-midnight-blue/5 px-3 py-2",children:[a.jsxs("p",{className:"text-xs font-medium text-midnight-blue",children:[Oi.length," chiamate consecutive"]}),a.jsx("div",{className:"mt-2 space-y-1",children:Oi.map(R=>a.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-misty-blue",children:[a.jsx("span",{children:fn(new Date(R.createdAt),"EEEE d MMMM yyyy",{locale:Mr})}),a.jsx("span",{className:"flex-shrink-0",children:fn(new Date(R.createdAt),"HH:mm")}
591)]},R.uuid))})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2 sm:justify-end",children:s.caller!=="anonymous"&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>eo(s.caller),className:"btn-primary-action bg-midnight-blue",title:"Richiama",children:[a.jsx(kj,{size:16}),a.jsx("span",{children:"Richiama"})]}),a.jsxs("button",{onClick:()=>j(s.caller),className:"btn-primary-action bg-midnight-blue",title:"WhatsApp",children:[a.jsx(Py,{size:16}),a.jsx("span",{children:"WhatsApp"})]})]})})]}),s.labels&&s.labels.length>0&&a.jsx("div",{className:"mt-4",children:a.jsx(pv,{labels:s.labels,labelColors:Q.labelColors})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4 md:p-6",children:a.jsxs("div",{className:"space-y-6",children:[s.transcription&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-misty-blue mb-3",children:"Trascrizione"}),a.jsx("div",{className:"bg-midnight-blue/5 rounded-lg px-4 py-3",children:s.transcription.status==="SUCCESS"?a.jsx("p",{className:"whitespace-pre-wrap break-words text-sm text-gray-600 leading-relaxed",children:s.transcription.text}):s.transcription.status==="PENDING"?a.jsx("p",{className:"text-sm text-misty-blue",children:"Trascrizione in corso..."}):a.jsx("p",{className:"text-sm text-red-500",children:"Errore durante la trascrizione"})})]}),s.audioUrl?a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-misty-blue mb-3",children:"Messaggio vocale"}),a.jsx(wm,{url:s.audioUrl,className:"max-w-full md:max-w-md"})]}):!s.isAgentHandled&&a.jsxs("div",{className:"flex flex-col items-center justify-center text-center",children:[a.jsx("div",{className:"bg-midnight-blue/5 rounded-full p-6 mb-4",children:a.jsx(cp,{className:"h-12 w-12 text-misty-blue"})}),a.jsx("h3",{className:"text-xl font-semibold text-midnight-blue mb-2",children:"Nessun messaggio vocale"}),a.jsx("p",{className:"text-misty-blue max-w-sm",children:"Il chiamante non ha lasciato alcun messaggio vocale"})]}),s.events&&s.events.length>0&&(()=>{const R=s.events.filter(ee=>ee.type==="AGENT").length;let F=0;return a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-misty-blue mb-3",children:"Eventi della chiamata"}),a.jsx("div",{className:"bg-midnight-blue/5 rounded-lg px-4 py-3 space-y-3",children:s.events.map((ee,ce)=>{if(ee.type==="AGENT"){const Xe=F++;return a.jsx(tP,{title:ee.title,index:Xe,totalAgentEvents:R,conversation:ee.conversation,recordedConversationUrl:ee.recordedConversationUrl},ce)}return a.jsxs("div",{className:"border-l-3 border-midnight-blue/20 pl-3",children:[a.jsx("h4",{className:"text-sm font-medium text-midnight-blue",children:ee.title}),ee.description&&a.jsx("p",{className:"text-sm text-gray-600 mt-1 leading-relaxed",children:ee.description})]},ce)})})]})})()]})}),a.jsx("div",{className:"flex-shrink-0 border-t border-gray-100 p-4",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[a.jsxs("button",{onClick:()=>bs(s),className:"btn-secondary-action",children:[a.jsx(Sy,{size:16}),a.jsx("span",{children:_i?"Segna gruppo da leggere":"Segna da leggere"})]}),w||s.isDeleted?a.jsxs("button",{type:"button",onClick:()=>Ja(s),disabled:Oe,className:"btn-secondary-action disabled:cursor-not-allowed disabled:opacity-50",children:[ue.isPending&&((V=ue.variables)!=null&&V.callUuids.includes(s.uuid))?a.jsx(pe,{size:16,className:"animate-spin"}):a.jsx(Ty,{size:16}),a.jsx("span",{children:_i?"Recupera gruppo":"Recupera"})]}):a.jsx(a.Fragment,{children:a.jsxs("button",{onClick:()=>Pi(s),className:"btn-secondary-action text-red-500",children:[a.jsx(Ge,{size:16}),a.jsx("span",{children:_i?"Elimina gruppo":"Elimina"})]})})]})})]}):a.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center px-6",children:[a.jsx("div",{className:"bg-midnight-blue/5 rounded-full p-6 mb-4",children:a.jsx(cp,{className:"h-12 w-12 text-misty-blue"})}),a.jsx("h3",{className:"text-xl font-semibold text-midnight-blue mb-2",children:"Nessuna chiamata selezionata"}),a.jsx("p",{className:"text-misty-blue max-w-sm",children:"Seleziona una chiamata dalla lista per visualizzare i dettagli e ascoltare il messaggio vocale se presente"})]})})]}),x&&a.jsx(s4,{phoneLabel:x.label,isPending:Be.isPending,isError:Be.isError,onConfirm:Za,onClose:()=>h(null)}),a.jsx(K4,{isOpen:m,onClose:()=>g(!1),phoneNumber:y})]})},Yp=({rule:e,isActive:t,onEdit:n,onDelete:r,onToggleDisabled:s,isTogglingDisabled:i})=>{const o=f=>`${String(f[0]).padStart(2,"0")}
591:${String(f[1]).padStart(2,"0")}`,l=f=>["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"][f],u=!e.isDefaultRule,c=u&&e.disabled;return a.jsx("div",{className:`rounded-lg shadow-sm p-6 transition-all ${c?"bg-gray-50 opacity-70":"bg-white"} ${t&&!c?"ring-2 ring-yellow-400":""}`,children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h3",{className:"font-semibold text-midnight-blue",children:u?e.name:"Messaggio Base"}),c&&a.jsx("span",{className:"text-xs text-misty-blue",children:"Disattivata"})]}),t&&!c&&a.jsx("span",{className:"inline-flex items-center px-2 py-1 mt-2 rounded-md text-xs font-medium bg-yellow-100 text-yellow-800",children:"Attivo ora"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[s&&u&&a.jsx("button",{type:"button",onClick:()=>s(!c),disabled:i,title:c?"Riattiva regola":"Disattiva regola",className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${c?"bg-gray-300":"bg-yellow-400"}`,children:i?a.jsx(pe,{size:10,className:"animate-spin absolute left-1/2 -translate-x-1/2 text-midnight-blue"}):a.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow-sm transition-transform ${c?"translate-x-0.5":"translate-x-[18px]"}`})}),n&&a.jsx("button",{onClick:n,className:"btn-icon text-misty-blue hover:text-midnight-blue hover:bg-midnight-blue/5",title:"Modifica",children:a.jsx(Mt,{size:16})}),r&&u&&a.jsx("button",{onClick:r,className:"btn-icon text-misty-blue hover:text-red-600 hover:bg-red-50",title:"Elimina",children:a.jsx(Ge,{size:16})})]})]}),a.jsx(wm,{url:e.audioPlayUrl}),e.type==="TTS_ANNOUNCE"&&e.text&&a.jsx("div",{className:"bg-midnight-blue/5 rounded-lg px-4 py-3",children:a.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:e.text})}),u&&e.intervals.length>0&&a.jsxs("div",{className:"mt-4 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-midnight-blue",children:[a.jsx(tu,{size:16,className:"text-yellow-500"}),a.jsx("span",{children:"Orari di attivazione"})]}),a.jsx("div",{className:"space-y-2.5",children:e.days.map(f=>a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsx("span",{className:"font-medium text-midnight-blue min-w-[5.5rem]",children:l(f)}),a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.intervals.map((d,m)=>a.jsxs("span",{className:"inline-flex items-center px-3 py-1 bg-midnight-blue/5 rounded-full text-midnight-blue font-medium",children:[o(d.startTime)," - ",o(d.endTime)]},m))})]},f))})]})]})})},cP=async e=>(await ne.get(`/voicemail-config/${e}`)).data,zv=e=>{const{isAuthenticated:t,activeUuid:n}=re();return Tn({queryKey:[n,"voicemail-config",e],queryFn:()=>cP(e),enabled:t&&!!e,refetchOnMount:!0,refetchOnWindowFocus:!0})},dP=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,recordAfterBeep:r})=>(await ne.patch(`/voicemail-config/${n}`,{recordAfterBeep:r})).data,onSuccess:n=>{e.setQueryData([t,"voicemail-config",n.phoneUuid],n)}})},Iv=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,ruleUuid:r,body:s})=>(await ne.put(`/voicemail-config/${n}/rule/${r}`,s)).data,onSuccess:n=>{e.setQueryData([t,"voicemail-config",n.phoneUuid],n)}})},fP=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,body:r})=>(await ne.post(`/voicemail-config/${n}/custom-rule`,r)).data,onSuccess:n=>{e.setQueryData([t,"voicemail-config",n.phoneUuid],n)}})},mP=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,ruleUuid:r})=>(await ne.delete(`/voicemail-config/${n}/rule/${r}`)).data,onSuccess:n=>{e.setQueryData([t,"voicemail-config",n.phoneUuid],n)}})},hP=()=>ye({mutationFn:async e=>(await ne.post("/voicemail-config/tts-demo",e)).data}),Xp=()=>{const{phoneUuid:e}=Xl(),{data:t,isLoading:n}=zv(e||""),{data:r=[]}=Fr(),{getToken:s}=re(),i=yt(),o=r.find(p=>p.uuid===e),l=!!(o!=null&&o.carrierId),[u,c]=b.useState(null),[f,d]=b.useState(null),m=Iv(),g=mP(),y=dP(),v=p=>{i(p?`/configuration/${p}`:"/configuration")},N=async p=>{if(e){c(p);try{await g.mutateAsync({phoneUuid:e,ruleUuid:p}),me.success("Regola eliminata")}finally{c(null)}}},x=async(p,w)=>{if(e){d(p.uuid);try{const C=p.type==="TTS_ANNOUNCE"?{type:"TTS_ANNOUNCE",text:p.text,voiceName:p.voiceName}:{type:"FILE_ANNOUNCE",fileKey:p.fileKey},E={isDefaultRule:!1,name:p.name,days:p.days,intervals:p.intervals,recordAfterBeep:p.recordAfterBeep,disabled:w,...C};await m.mutateAsync({phoneUuid:e,ruleUuid:p.uuid,body:E})}finally{d(null)}}},h=async()=>{!t||!e||await y.mutateAsync({phoneUuid:e,recordAfterBeep:!t.recordAfterBeep})};return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center gap-2",children:a.jsx("h1",{className:"text-2xl font-bold text-midnight-blue",children:"Configurazione"})}),a.jsx(gv,{selectedPhoneId:e??null,onPhoneSelect:v,showAllPhonesOption:!1}),e&&t&&a.jsxs("div",{className:"space-y-6",children:[l&&a.jsx("div",{className:"rounded-lg border border-blue-100 bg-white p-5 shadow-sm",children:a.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-blue-50 text-blue-700",children:a.jsx(Cj,{size:20})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold text-midnight-blue",children:"Deviazione chiamate"}),a.jsx("p",{className:"mt-1 text-sm leading-6 text-misty-blue",children:"Codici per attivare o disattivare AppSegreteria."})]})]}),a.jsx("button",{type:"button",onClick:()=>i(`/configuration/${e}/diversions`),className:"inline-flex items-center justify-center gap-2 rounded-lg bg-midnight-blue px-4 py-2.5 text-sm font-semibold text-white hover:bg-midnight-blue/90 transition-colors",children:"Gestisci deviazione"})]})}),t.customDialplanManagementUrl?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Configurazione Avanzata"}),a.jsxs("a",{href:`${t.customDialplanManagementUrl}&token=${s()||""}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-lg transition-colors duration-200",children:[a.jsx(nu,{className:"h-3.5 w-3.5"}),"Apri in nuova pagina"]})]}),a.jsx("iframe",{src:`${t.customDialplanManagementUrl}&token=${s()||""}`,className:"w-full border-0",style:{height:"calc(100vh - 280px)",minHeight:"400px"},title:"Configurazione Avanzata Dialplan"})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-white rounded-lg shadow-sm px-6 py-4 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-midnight-blue",children:"Registrazione dopo il beep"}),a.jsx("p",{className:"text-xs text-misty-blue mt-0.5",children:"Consenti ai chiamanti di lasciare un messaggio vocale"})]}),a.jsx("button",{type:"button",onClick:h,disabled:y.isPending,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${t.recordAfterBeep?"bg-yellow-400":"bg-gray-300"}`,children:y.isPending?a.jsx(pe,{size:14,className:"animate-spin absolute left-1/2 -translate-x-1/2 text-midnight-blue"}
591):a.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform ${t.recordAfterBeep?"translate-x-6":"translate-x-1"}`})})]}),a.jsx("div",{className:"space-y-2",children:a.jsx(Yp,{rule:t.defaultRule,isActive:t.currentActiveRule.uuid===t.defaultRule.uuid,onEdit:()=>i(`/configuration/${e}/rule/default/edit`)})}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Messaggi programmati con orari"}),t.customRules.map(p=>a.jsxs("div",{className:"relative",children:[u===p.uuid&&a.jsx("div",{className:"absolute inset-0 bg-white/70 rounded-lg flex items-center justify-center z-10",children:a.jsx(pe,{size:24,className:"animate-spin text-midnight-blue"})}),a.jsx(Yp,{rule:p,isActive:t.currentActiveRule.uuid===p.uuid,onEdit:()=>i(`/configuration/${e}/rule/${p.uuid}/edit`),onDelete:()=>N(p.uuid),onToggleDisabled:w=>x(p,w),isTogglingDisabled:f===p.uuid})]},p.uuid)),a.jsxs("div",{className:"flex flex-col items-center gap-3",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2.5 bg-yellow-50 rounded-lg text-xs text-yellow-800",children:[a.jsx(Nj,{className:"h-4 w-4 flex-shrink-0 text-yellow-500"}),a.jsx("p",{children:"Imposta messaggi di risposta alternativi in base al giorno e all'ora della chiamata"})]}),a.jsxs("button",{onClick:()=>i(`/configuration/${e}/rule/new`),className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-yellow-700 bg-yellow-50 hover:bg-yellow-100 rounded-lg transition-colors",children:[a.jsx(An,{size:16}),"Aggiungi regola"]})]})]})]})]}),e&&n&&a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-midnight-blue"})})]})},pP=[{name:"noAnswer",title:"Se non rispondi",description:"AppSegreteria risponde dopo che il telefono ha squillato per un po' e nessuno ha risposto.",recommended:!0},{name:"busy",title:"Se occupato o rifiuti la chiamata",description:"AppSegreteria risponde quando sei gia in un'altra chiamata o rifiuti la telefonata.",recommended:!0},{name:"notReachable",title:"Se spento o non raggiungibile",description:"AppSegreteria risponde quando il telefono e spento, fuori copertura, non raggiungibile o modalità Aereo.",recommended:!0},{name:"unconditional",title:"Sempre, tutte le chiamate",description:"Il telefono smetterà di squillare: tutte le chiamate saranno risposte da AppSegreteria."}];function Yd({code:e,label:t,tone:n}){const[r,s]=b.useState(!1),i=async()=>{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1800)},o=n==="activate"?"border-green-200 bg-green-50 text-green-800":n==="danger"?"border-red-200 bg-red-50 text-red-800":"border-gray-200 bg-gray-50 text-midnight-blue";return a.jsx("div",{className:`rounded-lg border ${o} p-3`,children:a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-normal opacity-80",children:t}),a.jsx("p",{className:"mt-1 select-all break-all font-mono text-lg font-semibold",children:e})]}),a.jsx("button",{type:"button",onClick:i,className:"inline-flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-white/80 hover:bg-white transition-colors","aria-label":`Copia codice ${t.toLowerCase()}`,children:r?a.jsx(Ze,{size:18}):a.jsx(jy,{size:18})})]})})}function gP({definition:e,diversion:t}){return a.jsxs("section",{className:"rounded-lg border border-gray-100 bg-white p-5 shadow-sm",children:[a.jsx("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-lg font-semibold text-midnight-blue",children:e.title}),e.recommended&&a.jsx("span",{className:"rounded-full bg-yellow-100 px-2 py-0.5 text-xs font-semibold text-yellow-800",children:"Consigliato"})]}),a.jsx("p",{className:"mt-1 text-sm leading-6 text-misty-blue",children:e.description})]})}),a.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[a.jsx(Yd,{code:t.switchOn,label:"Chiama per attivare",tone:"activate"}),a.jsx(Yd,{code:t.switchOff,label:"Chiama per disattivare",tone:"disable"})]})]})}function xP(){const{phoneUuid:e}=Xl(),t=yt(),{data:n,isLoading:r}=Fr(),[s,i]=b.useState(!1),o=n==null?void 0:n.find(d=>d.uuid===e),l=b.useMemo(()=>{var d;return(d=o==null?void 0:o.carrier)!=null&&d.isSupported?pP.flatMap(m=>{var y;const g=(y=o.carrier)!=null&&y.isSupported?o.carrier.diversions[m.name]:void 0;return g?[{definition:m,diversion:g}]:[]}):[]},[o]);if(r)return a.jsx("div",{className:"flex min-h-[400px] items-center justify-center",children:a.jsx(pe,{className:"h-8 w-8 animate-spin text-midnight-blue"})});if(!o)return a.jsxs("div",{className:"mx-auto max-w-2xl rounded-lg bg-white p-6 shadow-sm",children:[a.jsx("h1",{className:"text-xl font-semibold text-midnight-blue",children:"Numero non trovato"}),a.jsx("p",{className:"mt-2 text-sm text-misty-blue",children:"Non riesco a trovare il numero selezionato."}),a.jsxs("button",{type:"button",onClick:()=>t("/configuration"),className:"mt-4 inline-flex items-center gap-2 rounded-lg bg-midnight-blue px-4 py-2 text-sm font-semibold text-white",children:[a.jsx(la,{size:16}),"Torna alla configurazione"]})]});const u=o.carrier,c=o.name?`${o.name} (${o.phoneNumber})`:o.phoneNumber;return!!(u!=null&&u.notes)&&!s?a.jsxs("div",{className:"mx-auto max-w-2xl space-y-6",children:[a.jsxs("button",{type:"button",onClick:()=>t(`/configuration/${o.uuid}`),className:"inline-flex items-center gap-2 text-sm font-medium text-misty-blue hover:text-midnight-blue transition-colors",children:[a.jsx(la,{size:16}),"Configurazione"]}),a.jsx("header",{className:"space-y-2",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"rounded-full bg-yellow-400 p-3",children:a.jsx(up,{className:"h-6 w-6 text-midnight-blue"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-midnight-blue",children:"Prima di continuare"}),a.jsx("p",{className:"text-sm text-misty-blue",children:c})]})]})}),a.jsxs("section",{className:"rounded-lg border border-yellow-200 bg-yellow-50 p-5 shadow-sm",children:[a.jsxs("h2",{className:"text-sm font-semibold uppercase tracking-normal text-yellow-900",children:["Note operatore ",u.name]}),a.jsx("p",{className:"mt-3 whitespace-pre-line text-sm leading-6 text-yellow-950",children:u.notes}),a.jsx("button",{type:"button",onClick:()=>i(!0),className:"mt-5 inline-flex w-full items-center justify-center rounded-lg bg-midnight-blue px-4 py-2.5 text-sm font-semibold text-white hover:bg-midnight-blue/90 transition-colors sm:w-auto",children:"Ho capito, proseguiamo"})]})]}):a.jsxs("div",{className:"mx-auto max-w-3xl space-y-6",children:[a.jsxs("button",{type:"button",onClick:()=>t(`/configuration/${o.uuid}`),className:"inline-flex items-center gap-2 text-sm font-medium text-misty-blue hover:text-midnight-blue transition-colors",children:[a.jsx(la,{size:16}),"Configurazione"]}),a.jsxs("header",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"rounded-full bg-yellow-400 p-3",children:a.jsx(up,{className:"h-6 w-6 text-midnight-blue"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-midnight-blue",children:"Deviazione chiamate"}),a.jsx("p",{className:"text-sm text-misty-blue",children:c})]})]}),a.jsx("p",{className:"max-w-2xl text-sm leading-6 text-misty-blue",children:"Chiama questi codici dal numero indicato, come una normale telefonata. Servono ad attivare o disattivare l'inoltro ad AppSegreteria. Puoi attivare più inoltri contemporaneamente."})]}),!(u!=null&&u.isSupported)||l.length===0?a.jsx("section",{className:"rounded-lg border border-red-100 bg-white p-6 shadow-sm",children:a.jsxs("div",{className:"flex gap-3",children:[a.jsx(Aj,{className:"mt-0.5 h-5 w-5 flex-shrink-0 text-red-600"}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold text-midnight-blue",children:"Istruzioni non disponibili"}),a.jsx("p",{className:"mt-1 text-sm leading-6 text-misty-blue",children:"Non abbiamo codici affidabili per questo operatore. C
591ontatta il tuo operatore e chiedi come configurare la deviazione verso AppSegreteria."})]})]})}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-sm font-semibold text-midnight-blue",children:["Codici per operatore: ",u.name]}),l.map(({definition:d,diversion:m})=>a.jsx(gP,{definition:d,diversion:m},d.name))]}),(u==null?void 0:u.isSupported)&&u.diversions.disableAll&&a.jsxs("section",{className:"rounded-lg border border-red-100 bg-white p-5 shadow-sm",children:[a.jsx("h2",{className:"text-lg font-semibold text-midnight-blue",children:"Riparti da zero"}),a.jsx("p",{className:"mt-1 text-sm leading-6 text-misty-blue",children:"Se qualcosa non torna, puoi disattivare tutte le deviazioni e poi riattivare solo quella che ti serve."}),a.jsx("div",{className:"mt-4",children:a.jsx(Yd,{code:u.diversions.disableAll,label:"Disattiva tutte le deviazioni",tone:"danger"})})]}),a.jsxs("section",{className:"rounded-lg bg-white p-5 shadow-sm",children:[a.jsx("h2",{className:"font-semibold text-midnight-blue",children:"Se il codice non funziona"}),a.jsxs("ul",{className:"mt-3 space-y-2 text-sm leading-6 text-misty-blue",children:[a.jsx("li",{children:"Controlla di chiamarlo dalla SIM corretta."}),a.jsx("li",{children:"Assicurati di avere segnale e credito sufficiente."}),a.jsx("li",{children:"Se sei all'estero, la deviazione potrebbe non essere disponibile."}),a.jsx("li",{children:"Se compare âCodice MMI non validoâ, disattiva tutte le deviazioni e riprova."})]})]})]})}var Xa=e=>e.type==="checkbox",Gr=e=>e instanceof Date,jt=e=>e==null;const Fv=e=>typeof e=="object";var Ie=e=>!jt(e)&&!Array.isArray(e)&&Fv(e)&&!Gr(e),Uv=e=>Ie(e)&&e.target?Xa(e.target)?e.target.checked:e.target.value:e,$v=(e,t)=>t.split(".").some((n,r,s)=>!isNaN(Number(n))&&e.has(s.slice(0,r).join("."))),yP=e=>{const t=e.constructor&&e.constructor.prototype;return Ie(t)&&t.hasOwnProperty("isPrototypeOf")},Nm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Fe(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Nm&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Ie(e)&&yP(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Fe(e[s]));return r}var gu=e=>/^\w*$/.test(e),ke=e=>e===void 0,jm=e=>Array.isArray(e)?e.filter(Boolean):[],Sm=e=>jm(e.replace(/["|']|\]/g,"").split(/\.|\[/)),W=(e,t,n)=>{if(!t||!Ie(e))return n;const r=(gu(t)?[t]:Sm(t)).reduce((s,i)=>jt(s)?s:s[i],e);return ke(r)||r===e?ke(e[t])?n:e[t]:r},Ot=e=>typeof e=="boolean",mt=e=>typeof e=="function",Ne=(e,t,n)=>{let r=-1;const s=gu(t)?[t]:Sm(t),i=s.length,o=i-1;for(;++r<i;){const l=s[r];let u=n;if(r!==o){const c=e[l];u=Ie(c)||Array.isArray(c)?c:isNaN(+s[r+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=u,e=e[l]}};const sr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ln={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},en={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},xc="form",Bv="root",Vv=se.createContext(null);Vv.displayName="HookFormControlContext";const Cm=()=>se.useContext(Vv);var qv=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==ln.all&&(t._proxyFormState[o]=!r||ln.all),n&&(n[o]=!0),e[o]}});return s};const km=typeof window<"u"?se.useLayoutEffect:se.useEffect;function vP(e){const t=Cm(),{control:n=t,disabled:r,name:s,exact:i}=e||{},[o,l]=se.useState(n._formState),u=se.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return km(()=>n._subscribe({name:s,formState:u.current,exact:i,callback:c=>{!r&&l({...n._formState,...c})}}),[s,r,i]),se.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),se.useMemo(()=>qv(o,n,u.current,!1),[o,n])}var ht=e=>
591typeof e=="string",Xd=(e,t,n,r,s)=>ht(e)?(r&&t.watch.add(e),W(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),W(n,i))):(r&&(t.watchAll=!0),n),Jd=e=>jt(e)||!Fv(e);function un(e,t,n=new WeakSet){if(Jd(e)||Jd(t))return Object.is(e,t);if(Gr(e)&&Gr(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of r){const o=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const l=t[i];if(Gr(o)&&Gr(l)||(Ie(o)||Array.isArray(o))&&(Ie(l)||Array.isArray(l))?!un(o,l,n):!Object.is(o,l))return!1}}return!0}function bP(e){const t=Cm(),{control:n=t,name:r,defaultValue:s,disabled:i,exact:o,compute:l}=e||{},u=se.useRef(s),c=se.useRef(l),f=se.useRef(void 0),d=se.useRef(n),m=se.useRef(r);c.current=l;const[g,y]=se.useState(()=>{const w=n._getWatch(r,u.current);return c.current?c.current(w):w}),v=se.useCallback(w=>{const C=Xd(r,n._names,w||n._formValues,!1,u.current);return c.current?c.current(C):C},[n._formValues,n._names,r]),N=se.useCallback(w=>{if(!i){const C=Xd(r,n._names,w||n._formValues,!1,u.current);if(c.current){const E=c.current(C);un(E,f.current)||(y(E),f.current=E)}else y(C)}},[n._formValues,n._names,i,r]);km(()=>((d.current!==n||!un(m.current,r))&&(d.current=n,m.current=r,N()),n._subscribe({name:r,formState:{values:!0},exact:o,callback:w=>{N(w.values)}})),[n,o,r,N]),se.useEffect(()=>n._removeUnmounted());const x=d.current!==n,h=m.current,p=se.useMemo(()=>{if(i)return null;const w=!x&&!un(h,r);return x||w?v():null},[i,x,r,h,v]);return p!==null?p:g}function wP(e){const t=Cm(),{name:n,disabled:r,control:s=t,shouldUnregister:i,defaultValue:o,exact:l=!0}=e,u=$v(s._names.array,n),c=se.useMemo(()=>W(s._formValues,n,W(s._defaultValues,n,o)),[s,n,o]),f=bP({control:s,name:n,defaultValue:c,exact:l}),d=vP({control:s,name:n,exact:l}),m=se.useRef(e),g=se.useRef(void 0),y=se.useRef(s.register(n,{...e.rules,value:f,...Ot(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const v=se.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!W(d.errors,n)},isDirty:{enumerable:!0,get:()=>!!W(d.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!W(d.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!W(d.validatingFields,n)},error:{enumerable:!0,get:()=>W(d.errors,n)}}),[d,n]),N=se.useCallback(w=>y.current.onChange({target:{value:Uv(w),name:n},type:sr.CHANGE}),[n]),x=se.useCallback(()=>y.current.onBlur({target:{value:W(s._formValues,n),name:n},type:sr.BLUR}),[n,s._formValues]),h=se.useCallback(w=>{const C=W(s._fields,n);C&&C._f&&w&&(C._f.ref={focus:()=>mt(w.focus)&&w.focus(),select:()=>mt(w.select)&&w.select(),setCustomValidity:E=>mt(w.setCustomValidity)&&w.setCustomValidity(E),reportValidity:()=>mt(w.reportValidity)&&w.reportValidity()})},[s._fields,n]),p=se.useMemo(()=>({name:n,value:f,...Ot(r)||d.disabled?{disabled:d.disabled||r}:{},onChange:N,onBlur:x,ref:h}),[n,r,d.disabled,N,x,h,f]);return se.useEffect(()=>{const w=s._options.shouldUnregister||i,C=g.current;C&&C!==n&&!u&&s.unregister(C),s.register(n,{...m.current.rules,...Ot(m.current.disabled)?{disabled:m.current.disabled}:{}});const E=(A,O)=>{const L=W(s._fields,A);L&&L._f&&(L._f.mount=O)};if(E(n,!0),w){const A=Fe(W(s._options.defaultValues,n,m.current.defaultValue));Ne(s._defaultValues,n,A),ke(W(s._formValues,n))&&Ne(s._formValues,n,A)}return!u&&s.register(n),g.current=n,()=>{(u?w&&!s._state.action:w)?s.unregister(n):E(n,!1)}},[n,s,u,i]),se.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),se.useMemo(()=>({field:p,formState:d,fieldState:v}),[p,d,v])}const Vi=e=>e.render(wP(e)),NP=se.createContext(null);NP.displayName="HookFormContext";var jP=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},ca=e=>Array.isArray(e)?e:[e],Jp=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function Hv(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],i=t[r];if(s&&Ie(s)&&i){const o=Hv(s,i);Ie(o)&&(n[r]=o)}else e[r]&&(n[r]=i)}return n}var ct=e=>Ie(e)&&!Object.keys(e).length,Em=e=>e.type==="file",Pl=e=>{if(!Nm)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Wv=e=>e.type==="select-multiple",Pm=e=>e.type==="radio",SP=e=>Pm(e)||Xa(e),yc=e=>Pl(e)&&e.isConnected;function CP(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=ke(e)?r++:e[t[r++]];return e}function kP(e){for(const t in e)if(e.hasOwnProperty(t)&&!ke(e[t]))return!1;return!0}function Ue(e,t){const n=Array.isArray(t)?t:gu(t)?[t]:Sm(t),r=n.length===1?e:CP(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(Ie(r)&&ct(r)||Array.isArray(r)&&kP(r))&&Ue(e,n.slice(0,-1)),e}var EP=e=>{for(const t in e)if(mt(e[t]))return!0;return!1};function Qv(e){return Array.isArray(e)||Ie(e)&&!EP(e)}function Zd(e,t={}){for(const n in e){const r=e[n];Qv(r)?(t[n]=Array.isArray(r)?[]:{},Zd(r,t[n])):ke(r)||(t[n]=!0)}return t}function Xi(e,t,n){n||(n=Zd(t));for(const r in e){const s=e[r];if(Qv(s))ke(t)||Jd(n[r])?n[r]=Zd(s,Array.isArray(s)?[]:{}):Xi(s,jt(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!un(s,i)}}return n}const Zp={value:!1,isValid:!1},eg={value:!0,isValid:!0};var Kv=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ke(e[0].attributes.value)?ke(e[0].value)||e[0].value===""?eg:{value:e[0].value,isValid:!0}:eg:Zp}return Zp},Gv=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ke(e)?e:t?e===""?NaN:e&&+e:n&&ht(e)?new Date(e):r?r(e):e;const tg={isValid:!1,value:null};var Yv=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,tg):tg;function ng(e){const t=e.ref;return Em(t)?t.files:Pm(t)?Yv(e.refs).value:Wv(t)?[...t.selectedOptions].map(({value:n})=>n):Xa(t)?Kv(e.refs).value:Gv(ke(t.value)?e.ref.value:t.value,e)}var PP=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,RP=(e,t,n,r)=>{const s={};for(const i of e){const o=W(t,i);o&&Ne(s,i,o._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Rl=e=>e instanceof RegExp,qi=e=>ke(e)?e:Rl(e)?e.source:Ie(e)?Rl(e.value)?e.value.source:e.value:e,rg=e=>({isOnSubmit:!e||e===ln.onSubmit,isOnBlur:e===ln.onBlur,isOnChange:e===ln.onChange,isOnAll:e===ln.all,isOnTouch:e===ln.onTouched});const sg="AsyncFunction";var AP=e=>!!e&&!!e.validate&&!!(mt(e.validate)&&e.validate.constructor.name===sg||Ie(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===sg)),TP=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),ig=(e,t,n
vendor: 4,343 bytes, line 591
591)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const da=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=W(e,s);if(i){const{_f:o,...l}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(da(l,t))break}else if(Ie(l)&&da(l,t))break}}};function ag(e,t,n){const r=W(e,n);if(r||gu(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),o=W(t,i),l=W(e,i);if(o&&!Array.isArray(o)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};s.pop()}return{name:n}}var OP=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return ct(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!r||ln.all))},_P=(e,t,n)=>!e||!t||e===t||ca(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),MP=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,LP=(e,t)=>!jm(W(e,t)).length&&Ue(e,t),DP=(e,t,n)=>{const r=ca(W(e,n));return Ne(r,Bv,t[n]),Ne(e,n,r),e};function og(e,t,n="validate"){if(ht(e)||Array.isArray(e)&&e.every(ht)||Ot(e)&&!e)return{type:n,message:ht(e)?e:"",ref:t}}var Ss=e=>Ie(e)&&!Rl(e)?e:{value:e,message:""},lg=async(e,t,n,r,s,i)=>{const{ref:o,refs:l,required:u,maxLength:c,minLength:f,min:d,max:m,pattern:g,validate:y,name:v,valueAsNumber:N,mount:x}=e._f,h=W(n,v);if(!x||t.has(v))return{};const p=l?l[0]:o,w=Y=>{s&&p.reportValidity&&(p.setCustomValidity(Ot(Y)?"":Y||""),p.reportValidity())},C={},E=Pm(o),A=Xa(o),O=E||A,L=(N||Em(o))&&ke(o.value)&&ke(h)||Pl(o)&&o.value===""||h===""||Array.isArray(h)&&!h.length,D=jP.bind(null,v,r,C),Z=(Y,z,K,Q=en.maxLength,ae=en.minLength)=>{const $=Y?z:K;C[v]={type:Y?Q:ae,message:$,ref:o,...D(Y?Q:ae,$)}};if(i?!Array.isArray(h)||!h.length:u&&(!O&&(L||jt(h))||Ot(h)&&!h||A&&!Kv(l).isValid||E&&!Yv(l).isValid)){const{value:Y,message:z}=ht(u)?{value:!!u,message:u}:Ss(u);if(Y&&(C[v]={type:en.required,message:z,ref:p,...D(en.required,z)},!r))return w(z),C}if(!L&&(!jt(d)||!jt(m))){let Y,z;const K=Ss(m),Q=Ss(d);if(!jt(h)&&!isNaN(h)){const ae=o.valueAsNumber||h&&+h;jt(K.value)||(Y=ae>K.value),jt(Q.value)||(z=ae<Q.value)}else{const ae=o.valueAsDate||new Date(h),$=M=>new Date(new Date().toDateString()+" "+M),_=o.type=="time",H=o.type=="week";ht(K.value)&&h&&(Y=_?$(h)>$(K.value):H?h>K.value:ae>new Date(K.value)),ht(Q.value)&&h&&(z=_?$(h)<$(Q.value):H?h<Q.value:ae<new Date(Q.value))}if((Y||z)&&(Z(!!Y,K.message,Q.message,en.max,en.min),!r))return w(C[v].message),C}if((c||f)&&!L&&(ht(h)||i&&Array.isArray(h))){const Y=Ss(c),z=Ss(f),K=!jt(Y.value)&&h.length>+Y.value,Q=!jt(z.value)&&h.length<+z.value;if((K||Q)&&(Z(K,Y.message,z.message),!r))return w(C[v].message),C}if(g&&!L&&ht(h)){const{value:Y,message:z}=Ss(g);if(Rl(Y)&&!h.match(Y)&&(C[v]={type:en.pattern,message:z,ref:o,...D(en.pattern,z)},!r))return w(z),C}if(y){if(mt(y)){const Y=await y(h,n),z=og(Y,p);if(z&&(C[v]={...z,...D(en.validate,z.message)},!r))return w(z.message),C}else if(Ie(y)){let Y={};for(const z in y){if(!ct(Y)&&!r)break;const K=og(await y[z](h,n),p,z);K&&(Y={...K,...D(z,K.message)},w(K.message),r&&(C[v]=Y))}if(!ct(Y)&&(C[v]={ref:p,...Y},!r))return C}}return w(!0),C};const zP={mode:ln.onSubmit,reValidateMode:ln.onChange,shouldFocusError:!0};function IP(e={}){let t={...zP,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:mt(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Ie(t.defaultValues)||Ie(t.values)?Fe(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Fe(s),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},u,c=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...f};let m={...d};const g={array:Jp(),state:Jp()},y=t.criteriaMode===ln.all,v=j=>k=>{clearTimeout(c),c=setTimeout(j,k)},N=async j=>{if(!o.keepIsValid&&!t.disabled&&(d.isValid||m.isValid||j)){let k;t.resolver?(k=ct((await L()).errors),x()):k=await Y({fields:r,onlyCheckValid:!0,eventType:sr.VALID}),k!==n.isValid&&g.state.next({isValid:k})}},x=(j,k)=>
591{!t.disabled&&(d.isValidating||d.validatingFields||m.isValidating||m.validatingFields)&&((j||Array.from(l.mount)).forEach(P=>{P&&(k?Ne(n.validatingFields,P,k):Ue(n.validatingFields,P))}),g.state.next({validatingFields:n.validatingFields,isValidating:!ct(n.validatingFields)}))},h=j=>{const k=Xi(s,i),P=PP(j);Ne(n.dirtyFields,P,W(k,P))},p=(j,k=[],P,q,V=!0,R=!0)=>{if(q&&P&&!t.disabled){if(o.action=!0,R&&Array.isArray(W(r,j))){const F=P(W(r,j),q.argA,q.argB);V&&Ne(r,j,F)}if(R&&Array.isArray(W(n.errors,j))){const F=P(W(n.errors,j),q.argA,q.argB);V&&Ne(n.errors,j,F),LP(n.errors,j)}if((d.touchedFields||m.touchedFields)&&R&&Array.isArray(W(n.touchedFields,j))){const F=P(W(n.touchedFields,j),q.argA,q.argB);V&&Ne(n.touchedFields,j,F)}(d.dirtyFields||m.dirtyFields)&&h(j),g.state.next({name:j,isDirty:K(j,k),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ne(i,j,k)},w=(j,k)=>{Ne(n.errors,j,k),g.state.next({errors:n.errors})},C=j=>{n.errors=j,g.state.next({errors:n.errors,isValid:!1})},E=(j,k,P,q)=>{const V=W(r,j);if(V){const R=W(i,j,ke(P)?W(s,j):P);ke(R)||q&&q.defaultChecked||k?Ne(i,j,k?R:ng(V._f)):$(j,R),o.mount&&!o.action&&N()}},A=(j,k,P,q,V)=>{let R=!1,F=!1;const ee={name:j};if(!t.disabled){if(!P||q){(d.isDirty||m.isDirty)&&(F=n.isDirty,n.isDirty=ee.isDirty=K(),R=F!==ee.isDirty);const ce=un(W(s,j),k);F=!!W(n.dirtyFields,j),ce?Ue(n.dirtyFields,j):Ne(n.dirtyFields,j,!0),ee.dirtyFields=n.dirtyFields,R=R||(d.dirtyFields||m.dirtyFields)&&F!==!ce}if(P){const ce=W(n.touchedFields,j);ce||(Ne(n.touchedFields,j,P),ee.touchedFields=n.touchedFields,R=R||(d.touchedFields||m.touchedFields)&&ce!==P)}R&&V&&g.state.next(ee)}return R?ee:{}},O=(j,k,P,q)=>{const V=W(n.errors,j),R=(d.isValid||m.isValid)&&Ot(k)&&n.isValid!==k;if(t.delayError&&P?(u=v(()=>w(j,P)),u(t.delayError)):(clearTimeout(c),u=null,P?Ne(n.errors,j,P):Ue(n.errors,j)),(P?!un(V,P):V)||!ct(q)||R){const F={...q,...R&&Ot(k)?{isValid:k}:{},errors:n.errors,name:j};n={...n,...F},g.state.next(F)}},L=async j=>(x(j,!0),await t.resolver(i,t.context,RP(j||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),D=async j=>{const{errors:k}=await L(j);if(x(j),j)for(const P of j){const q=W(k,P);q?Ne(n.errors,P,q):Ue(n.errors,P)}else n.errors=k;return k},Z=async({name:j,eventType:k})=>{if(e.validate){const P=await e.validate({formValues:i,formState:n,name:j,eventType:k});if(Ie(P))for(const q in P)P[q]&&Oe(`${xc}.${q}`,{message:ht(P.message)?P.message:"",type:en.validate});else ht(P)||!P?Oe(xc,{message:P||"",type:en.validate}):Be(xc);return P}return!0},Y=async({fields:j,onlyCheckValid:k,name:P,eventType:q,context:V={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(V.runRootValidation=!0,!await Z({name:P,eventType:q})&&(V.valid=!1,k)))return V.valid;for(const R in j){const F=j[R];if(F){const{_f:ee,...ce}=F;if(ee){const Xe=l.array.has(ee.name),xn=F._f&&AP(F._f);xn&&d.validatingFields&&x([ee.name],!0);const vt=await lg(F,l.disabled,i,y,t.shouldUseNativeValidation&&!k,Xe);if(xn&&d.validatingFields&&x([ee.name]),vt[ee.name]&&(V.valid=!1,k)||(!k&&(W(vt,ee.name)?Xe?DP(n.errors,vt,ee.name):Ne(n.errors,ee.name,vt[ee.name]):Ue(n.errors,ee.name)),e.shouldUseNativeValidation&&vt[ee.name]))break}!ct(ce)&&await Y({context:V,onlyCheckValid:k,fields:ce,name:R,eventType:q})}}return V.valid},z=()=>{for(const j of l.unMount){const k=W(r,j);k&&(k._f.refs?k._f.refs.every(P=>!yc(P)):!yc(k._f.ref))&&bs(j)}l.unMount=new Set},K=(j,k)=>!t.disabled&&(j&&k&&Ne(i,j,k),!un(oe(),s)),Q=(j,k,P)=>Xd(j,l,{...o.mount?i:ke(k)?s:ht(j)?{[j]:k}:k},P,k),ae=j=>jm(W(o.mount?i:s,j,t.shouldUnregister?W(s,j,[]):[])),$=(j,k,P={})=>{const q=W(r,j);let V=k;if(q){const R=q._f;R&&(!R.disabled&&Ne(i,j,Gv(k,R)),V=Pl(R.ref)&&jt(k)?"":k,Wv(R.ref)?[...R.ref.options].forEach(F=>F.selected=V.includes(F.value)):R.refs?Xa(R.ref)?R.refs.forEach(F=>{(!F.defaultChecked||!F.disabled)&&(Array.isArray(V)?F.checked=!!V.find(ee=>ee===F.value):F.checked=V===F.value||!!V)}):R.refs.forEach(F=>F.checked=F.value===V):Em(R.ref)?R.ref.value="":(R.ref.value=V,R.ref.type||g.state.next({name:j,values:Fe(i)})))}(P.shouldDirty||P.shouldTouch)&&A(j,V,P.shouldTouch,P.shouldDirty,!0),P.shouldValidate&&B(j)},_=(j,k,P)=>
591{for(const q in k){if(!k.hasOwnProperty(q))return;const V=k[q],R=j+"."+q,F=W(r,R);(l.array.has(j)||Ie(V)||F&&!F._f)&&!Gr(V)?_(R,V,P):$(R,V,P)}},H=(j,k,P={})=>{const q=W(r,j),V=l.array.has(j),R=Fe(k);Ne(i,j,R),V?(g.array.next({name:j,values:Fe(i)}),(d.isDirty||d.dirtyFields||m.isDirty||m.dirtyFields)&&P.shouldDirty&&(h(j),g.state.next({name:j,dirtyFields:n.dirtyFields,isDirty:K(j,R)}))):q&&!q._f&&!jt(R)?_(j,R,P):$(j,R,P),ig(j,l)?g.state.next({...n,name:j,values:Fe(i)}):g.state.next({name:o.mount?j:void 0,values:Fe(i)})},M=async j=>{o.mount=!0;const k=j.target;let P=k.name,q=!0;const V=W(r,P),R=ce=>{q=Number.isNaN(ce)||Gr(ce)&&isNaN(ce.getTime())||un(ce,W(i,P,ce))},F=rg(t.mode),ee=rg(t.reValidateMode);if(V){let ce,Xe;const xn=k.type?ng(V._f):Uv(j),vt=j.type===sr.BLUR||j.type===sr.FOCUS_OUT,o1=!TP(V._f)&&!e.validate&&!t.resolver&&!W(n.errors,P)&&!V._f.deps||MP(vt,W(n.touchedFields,P),n.isSubmitted,ee,F),Au=ig(P,l,vt);Ne(i,P,xn),vt?(!k||!k.readOnly)&&(V._f.onBlur&&V._f.onBlur(j),u&&u(0)):V._f.onChange&&V._f.onChange(j);const Tu=A(P,xn,vt),l1=!ct(Tu)||Au;if(!vt&&g.state.next({name:P,type:j.type,values:Fe(i)}),o1)return(d.isValid||m.isValid)&&(t.mode==="onBlur"?vt&&N():vt||N()),l1&&g.state.next({name:P,...Au?{}:Tu});if(!t.resolver&&e.validate&&await Z({name:P,eventType:j.type}),!vt&&Au&&g.state.next({...n}),t.resolver){const{errors:Mm}=await L([P]);if(x([P]),R(xn),q){const u1=ag(n.errors,r,P),Lm=ag(Mm,r,u1.name||P);ce=Lm.error,P=Lm.name,Xe=ct(Mm)}}else x([P],!0),ce=(await lg(V,l.disabled,i,y,t.shouldUseNativeValidation))[P],x([P]),R(xn),q&&(ce?Xe=!1:(d.isValid||m.isValid)&&(Xe=await Y({fields:r,onlyCheckValid:!0,name:P,eventType:j.type})));q&&(V._f.deps&&(!Array.isArray(V._f.deps)||V._f.deps.length>0)&&B(V._f.deps),O(P,Xe,ce,Tu))}},I=(j,k)=>{if(W(n.errors,k)&&j.focus)return j.focus(),1},B=async(j,k={})=>{let P,q;const V=ca(j);if(t.resolver){const R=await D(ke(j)?j:V);P=ct(R),q=j?!V.some(F=>W(R,F)):P}else j?(q=(await Promise.all(V.map(async R=>{const F=W(r,R);return await Y({fields:F&&F._f?{[R]:F}:F,eventType:sr.TRIGGER})}))).every(Boolean),!(!q&&!n.isValid)&&N()):q=P=await Y({fields:r,name:j,eventType:sr.TRIGGER});return g.state.next({...!ht(j)||(d.isValid||m.isValid)&&P!==n.isValid?{}:{name:j},...t.resolver||!j?{isValid:P}:{},errors:n.errors}),k.shouldFocus&&!q&&da(r,I,j?V:l.mount),q},oe=(j,k)=>{let P={...o.mount?i:s};return k&&(P=Hv(k.dirtyFields?n.dirtyFields:n.touchedFields,P)),ke(j)?P:ht(j)?W(P,j):j.map(q=>W(P,q))},ue=(j,k)=>({invalid:!!W((k||n).errors,j),isDirty:!!W((k||n).dirtyFields,j),error:W((k||n).errors,j),isValidating:!!W(n.validatingFields,j),isTouched:!!W((k||n).touchedFields,j)}),Be=j=>{const k=j?ca(j):void 0;k==null||k.forEach(P=>Ue(n.errors,P)),k?k.forEach(P=>{g.state.next({name:P,errors:n.errors})}):g.state.next({errors:{}})},Oe=(j,k,P)=>{const q=(W(r,j,{_f:{}})._f||{}).ref,V=W(n.errors,j)||{},{ref:R,message:F,type:ee,...ce}=V;Ne(n.errors,j,{...ce,...k,ref:q}),g.state.next({name:j,errors:n.errors,isValid:!1}),P&&P.shouldFocus&&q&&q.focus&&q.focus()},$t=(j,k)=>mt(j)?g.state.subscribe({next:P=>"values"in P&&j(Q(void 0,k),P)}):Q(j,k,!0),_n=j=>g.state.subscribe({next:k=>{_P(j.name,k.name,j.exact)&&OP(k,j.formState||d,Oi,j.reRenderRoot)&&j.callback({values:{...i},...n,...k,defaultValues:s})}}).unsubscribe,Pu=j=>(o.mount=!0,m={...m,...j.formState},_n({...j,formState:{...f,...j.formState}})),bs=(j,k={})=>{for(const P of j?ca(j):l.mount)l.mount.delete(P),l.array.delete(P),k.keepValue||(Ue(r,P),Ue(i,P)),!k.keepError&&Ue(n.errors,P),!k.keepDirty&&Ue(n.dirtyFields,P),!k.keepTouched&&Ue(n.touchedFields,P),!k.keepIsValidating&&Ue(n.validatingFields,P),!t.shouldUnregister&&!k.keepDefaultValue&&Ue(s,P);g.state.next({values:Fe(i)}),g.state.next({...n,...k.keepDirty?{isDirty:K()}:{}}),!k.keepIsValid&&N()},Pi=({disabled:j,name:k})=>{if(Ot(j)&&o.mount||j||l.disabled.has(k)){const V=l.disabled.has(k)!==!!j;j?l.disabled.add(k):l.disabled.delete(k),V&&o.mount&&!o.action&&N()}},Ri=(j,k={})=>{let P=W(r,j);const q=Ot(k.disabled)||Ot(t.disabled),V=!l.registerName.has(j)&&P&&!P._f.mount;return Ne(r,j,{...P||{},_f:{...P&&P._f?P._f:{ref:{name:j}},name:j,mount:!0,...k}}),l.mount.add(j),P&&!V?Pi({disabled:Ot(k.disabled)?k.disabled:t.disabled,name:j}):E(j,!0,k.value),{...q?{disabled:k.disabled||t.disabled}:{},...t.progressive?{required:!!k.required,min:qi(k.min),max:qi(k.max),minLength:qi(k.minLength),maxLength:qi(k.maxLength),pattern:qi(k.pattern)}:{},name:j,onChange:M,onBlur:M,ref:R=>{if(R){l.registerName.add(j),Ri(j,k),l.registerName.delete(j),P=W(r,j);const F=ke(R.value)&&R.querySelectorAll&&R.querySelectorAll("input,select,textarea")[0]||R,ee=SP(F),ce=P._f.refs||[];if(ee?ce.find(Xe=>Xe===F):F===P._f.ref)return;Ne(r,j,{_f:{...P._f,...ee?{refs:[...ce.filter(yc),F,...Array.isArray(W(s,j))?[{}]:[]],ref:{type:F.type,name:j}}:{ref:F}}}),E(j,!1,void 0,F)}else P=W(r,j,{}),P._f&&(P._f.mount=!1),(t.shouldUnregister||k.shouldUnregister)&&!($v(l.array,j)&&o.action)&&l.unMount.add(j)}}},Ai=()=>t.shouldFocusError&&da(r,I,l.mount),Ja=j=>{Ot(j)&&(g.state.next({disabled:j}),da(r,(k,P)=>{const q=W(r,P);q&&(k.disabled=q._f.disabled||j,Array.isArray(q._f.refs)&&q._f.refs.forEac
vendor: 4,331 bytes, line 591
591h(V=>{V.disabled=q._f.disabled||j}))},0,!1))},Za=(j,k)=>async P=>{let q;P&&(P.preventDefault&&P.preventDefault(),P.persist&&P.persist());let V=Fe(i);if(g.state.next({isSubmitting:!0}),t.resolver){const{errors:R,values:F}=await L();x(),n.errors=R,V=Fe(F)}else await Y({fields:r,eventType:sr.SUBMIT});if(l.disabled.size)for(const R of l.disabled)Ue(V,R);if(Ue(n.errors,Bv),ct(n.errors)){g.state.next({errors:{}});try{await j(V,P)}catch(R){q=R}}else k&&await k({...n.errors},P),Ai(),setTimeout(Ai);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ct(n.errors)&&!q,submitCount:n.submitCount+1,errors:n.errors}),q)throw q},Ru=(j,k={})=>{W(r,j)&&(ke(k.defaultValue)?H(j,Fe(W(s,j))):(H(j,k.defaultValue),Ne(s,j,Fe(k.defaultValue))),k.keepTouched||Ue(n.touchedFields,j),k.keepDirty||(Ue(n.dirtyFields,j),n.isDirty=k.defaultValue?K(j,Fe(W(s,j))):K()),k.keepError||(Ue(n.errors,j),d.isValid&&N()),g.state.next({...n}))},Bt=(j,k={})=>{const P=j?Fe(j):s,q=Fe(P),V=ct(j),R=V?s:q;if(k.keepDefaultValues||(s=P),!k.keepValues){if(k.keepDirtyValues){const F=new Set([...l.mount,...Object.keys(Xi(s,i))]);for(const ee of Array.from(F)){const ce=W(n.dirtyFields,ee),Xe=W(i,ee),xn=W(R,ee);ce&&!ke(Xe)?Ne(R,ee,Xe):!ce&&!ke(xn)&&H(ee,xn)}}else{if(Nm&&ke(j))for(const F of l.mount){const ee=W(r,F);if(ee&&ee._f){const ce=Array.isArray(ee._f.refs)?ee._f.refs[0]:ee._f.ref;if(Pl(ce)){const Xe=ce.closest("form");if(Xe){Xe.reset();break}}}}if(k.keepFieldsRef)for(const F of l.mount)H(F,W(R,F));else r={}}i=t.shouldUnregister?k.keepDefaultValues?Fe(s):{}:Fe(R),g.array.next({values:{...R}}),g.state.next({values:{...R}})}l={mount:k.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!k.keepIsValid||!!k.keepDirtyValues||!t.shouldUnregister&&!ct(R),o.watch=!!t.shouldUnregister,o.keepIsValid=!!k.keepIsValid,o.action=!1,k.keepErrors||(n.errors={}),g.state.next({submitCount:k.keepSubmitCount?n.submitCount:0,isDirty:V?!1:k.keepDirty?n.isDirty:!!(k.keepDefaultValues&&!un(j,s)),isSubmitted:k.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:V?{}:k.keepDirtyValues?k.keepDefaultValues&&i?Xi(s,i):n.dirtyFields:k.keepDefaultValues&&j?Xi(s,j):k.keepDirty?n.dirtyFields:{},touchedFields:k.keepTouched?n.touchedFields:{},errors:k.keepErrors?n.errors:{},isSubmitSuccessful:k.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},ws=(j,k)=>Bt(mt(j)?j(i):j,{...t.resetOptions,...k}),Ti=(j,k={})=>{const P=W(r,j),q=P&&P._f;if(q){const V=q.refs?q.refs[0]:q.ref;V.focus&&setTimeout(()=>{V.focus(),k.shouldSelect&&mt(V.select)&&V.select()})}},Oi=j=>{n={...n,...j}},eo={control:{register:Ri,unregister:bs,getFieldState:ue,handleSubmit:Za,setError:Oe,_subscribe:_n,_runSchema:L,_updateIsValidating:x,_focusError:Ai,_getWatch:Q,_getDirty:K,_setValid:N,_setFieldArray:p,_setDisabledField:Pi,_setErrors:C,_getFieldArray:ae,_reset:Bt,_resetDefaultValues:()=>mt(t.defaultValues)&&t.defaultValues().then(j=>{ws(j,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:z,_disableForm:Ja,_subjects:g,_proxyFormState:d,get _fields(){return r},get _formValues(){return i},get _state(){return o},set _state(j){o=j},get _defaultValues(){return s},get _names(){return l},set _names(j){l=j},get _formState(){return n},get _options(){return t},set _options(j){t={...t,...j}}},subscribe:Pu,trigger:B,register:Ri,handleSubmit:Za,watch:$t,setValue:H,getValues:oe,reset:ws,resetField:Ru,clearErrors:Be,unregister:bs,setError:Oe,setFocus:Ti,getFieldState:ue};return{...eo,formControl:eo}}function FP(e={}){const t=se.useRef(void 0),n=se.useRef(void 0),[r,s]=se.useState({isDirty:!1,isValidating:!1,isLoading:mt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:mt(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!mt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:o,...l}=IP(e);t.current={...l,formState:r}}const i=t.current.control;return i._options=e,km(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}
591),reRenderRoot:!0});return s(l=>({...l,isReady:!0})),i._formState.isReady=!0,o},[i]),se.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),se.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),se.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),se.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),se.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==r.isDirty&&i._subjects.state.next({isDirty:o})}},[i,r.isDirty]),se.useEffect(()=>{var o;e.values&&!un(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((o=i._options.resetOptions)===null||o===void 0)&&o.keepIsValid||i._setValid(),n.current=e.values,s(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),se.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=se.useMemo(()=>qv(r,i),[i,r]),t.current}const UP=[{value:1,label:"Lunedì",short:"Lun"},{value:2,label:"Martedì",short:"Mar"},{value:3,label:"Mercoledì",short:"Mer"},{value:4,label:"Giovedì",short:"Gio"},{value:5,label:"Venerdì",short:"Ven"},{value:6,label:"Sabato",short:"Sab"},{value:0,label:"Domenica",short:"Dom"}];function $P(e,t){var o;const n=(e==null?void 0:e.type)==="FILE_ANNOUNCE"?"FILE_ANNOUNCE":"TTS_ANNOUNCE",r=e&&"text"in e&&e.text?e.text:"",s=e&&"voiceName"in e&&e.voiceName?e.voiceName:"ISABELLA";if(t)return{tab:n,text:r,voiceName:s,name:"",days:[],intervals:[{startTime:[9,0],endTime:[18,0]}],recordAfterBeep:!0,disabled:!1};const i=e;return{tab:n,text:r,voiceName:s,name:(i==null?void 0:i.name)??"",days:(i==null?void 0:i.days)??[],intervals:(o=i==null?void 0:i.intervals)!=null&&o.length?i.intervals:[{startTime:[9,0],endTime:[18,0]}],recordAfterBeep:(i==null?void 0:i.recordAfterBeep)??!0,disabled:(i==null?void 0:i.disabled)??!1}}const BP=({rule:e,isDefault:t,globalRecordAfterBeep:n,onSave:r,onCancel:s})=>{const{playAudio:i,stopAudio:o,isCurrentlyPlaying:l}=Lv(),u=hP(),[c,f]=b.useState(null),[d,m]=b.useState(""),[g,y]=b.useState("ISABELLA"),[v,N]=b.useState(!1),x=c?l(c):!1,{control:h,handleSubmit:p,watch:w,setValue:C,formState:{errors:E}}=FP({defaultValues:$P(e,t)}),A=w("tab"),O=w("text"),L=w("voiceName"),D=w("days"),Z=w("intervals");b.useEffect(()=>{(O!==d||L!==g)&&f(null)},[O,L,d,g]);const Y=()=>{if(c&&O===d&&L===g){x?o():i(c);return}u.mutate({text:O,voiceName:L},{onSuccess:I=>{I.audioPlayUrl&&(f(I.audioPlayUrl),m(O),y(L),i(I.audioPlayUrl))}})},z=async I=>{N(!0);try{await r(I)}finally{N(!1)}},K=I=>{const B=D;B.includes(I)?C("days",B.filter(oe=>oe!==I),{shouldValidate:!0}):C("days",[...B,I],{shouldValidate:!0})},Q=()=>{C("intervals",[...Z,{startTime:[9,0],endTime:[18,0]}])},ae=I=>{C("intervals",Z.filter((B,oe)=>oe!==I))},$=(I,B,oe)=>{const[ue,Be]=oe.split(":").map(Number),Oe=[...Z];Oe[I]={...Oe[I],[B]:[ue,Be]},C("intervals",Oe)},_=I=>`${String(I[0]).padStart(2,"0")}:${String(I[1]).padStart(2,"0")}`,M=t?"Modifica Messaggio Base":!e?"Nuova Regola Personalizzata":`Modifica "${e.name}"`;return a.jsxs("form",{onSubmit:p(z),className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{type:"button",onClick:s,className:"btn-icon text-misty-blue hover:text-midnight-blue hover:bg-midnight-blue/5",children:a.jsx(la,{size:20})}),a.jsx("h2",{className:"text-lg font-semibold text-midnight-blue",children:M})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 space-y-6",children:[!t&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1.5",children:"Nome regola"}),a.jsx(Vi,{name:"name",control:h,render:({field:I})=>a.jsx("input",{...I,type:"text",className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-yellow-200 focus:border-yellow-500",placeholder:"Es: Pausa pranzo, Weekend... (opzionale)"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-2",children:"Tipo di messaggio"}),a.jsxs("div",{className:"flex rounded-lg border border-gray-200 overflow-hidden",children:[a.jsx("button",{type:"button",onClick:()=>C("tab","TTS_ANNOUNCE"),className:`flex-1 px-4 py-2.5 text-sm font-medium transition-colors ${A==="TTS_ANNOUNCE"?"bg-yellow-400 text-midnight-blue":"bg-white text-misty-blue hover:bg-gray-50"}`,children:"Scrivi testo"}),a.jsx("button",{type:"button",onClick:()=>C("tab","FILE_ANNOUNCE"),className:`flex-1 px-4 py-2.5 text-sm font-medium transition-colors ${A==="FILE_ANNOUNCE"?"bg-yellow-400 text-midnight-blue":"bg-white text-misty-blue hover:bg-gray-50"}`,children:"Carica audio"})]})]}),A==="TTS_ANNOUNCE"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1.5",children:"Testo del messaggio"}),a.jsx(Vi,{name:"text",control:h,rules:{required:A==="TTS_ANNOUNCE"?"Inserisci il testo del messaggio":!1,minLength:{value:5,message:"Il testo deve essere di almeno 5 caratteri"},maxLength:{value:1024,message:"Il testo è troppo lungo (max 1024 caratteri)"}},render:({field:I})=>a.jsx("textarea",{...I,rows:4,className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-yellow-200 focus:border-yellow-500 resize-none",placeholder:"Scrivi il messaggio che verrà letto al chiamante..."})}),E.text&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:E.text.message}),a.jsxs("button",{type:"button",onClick:Y,disabled:u.isPending||!O||O.length<5,className:`mt-2 inline-flex items-center gap-1.5 text-sm font-medium transition-colors ${u.isPending?"text-misty-blue cursor-default":"text-yellow-600 hover:text-yellow-700 cursor-pointer"}`,children:[u.isPending?a.jsx(pe,{size:14,className:"animate-spin"}):x?a.jsx(Ry,{size:14}):a.jsx(Ay,{size:14}),u.isPending?"Generazione in corso...":x?"In riproduzione... clicca per fermare":"Ascolta anteprima"]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1.5",children:"Voce"}),a.jsx(Vi,{name:"voiceName",control:h,render:({field:I})=>a.jsxs("select",{...I,className:"w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-yellow-200 focus:border-yellow-500 bg-white",children:[a.jsx("option",{value:"ISABELLA",children:"Isabella (femminile)"}),a.jsx("option",{value:"DIEGO",children:"Diego (maschile)"})]})})]})]}),A==="FILE_ANNOUNCE"&&a.jsx("div",{className:"rounded-lg border-2 border-dashed border-gray-300 p-8 text-center",children:a.jsx("p",{className:"text-sm text-misty-blue",children:"Il caricamento di file audio sarà disponibile a breve."})}),!t&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-2",children:"Giorni di attivazione"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:UP.map(I=>{const B=D.includes(I.value);return a.jsx("button",{type:"button",onClick:()=>
591K(I.value),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${B?"bg-yellow-400 text-midnight-blue":"bg-midnight-blue/5 text-misty-blue hover:bg-midnight-blue/10"}`,children:I.short},I.value)})}),E.days&&a.jsx("p",{className:"mt-1 text-xs text-red-600",children:E.days.message})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-2",children:"Intervalli orari"}),a.jsx("div",{className:"space-y-2",children:Z.map((I,B)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"time",value:_(I.startTime),onChange:oe=>$(B,"startTime",oe.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-yellow-200 focus:border-yellow-500"}),a.jsx("span",{className:"text-misty-blue text-sm",children:"-"}),a.jsx("input",{type:"time",value:_(I.endTime),onChange:oe=>$(B,"endTime",oe.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-yellow-200 focus:border-yellow-500"}),Z.length>1&&a.jsx("button",{type:"button",onClick:()=>ae(B),className:"btn-icon text-red-400 hover:text-red-600 hover:bg-red-50",children:a.jsx(Ge,{size:16})})]},B))}),a.jsxs("button",{type:"button",onClick:Q,className:"mt-2 inline-flex items-center gap-1.5 text-sm font-medium text-yellow-600 hover:text-yellow-700",children:[a.jsx(An,{size:14}),"Aggiungi intervallo"]})]}),n&&a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[a.jsx(Vi,{name:"recordAfterBeep",control:h,render:({field:I})=>a.jsx("input",{type:"checkbox",checked:I.value,onChange:I.onChange,className:"h-4 w-4 rounded border-gray-300 text-yellow-500 focus:ring-yellow-400"})}),a.jsx("span",{className:"text-sm text-midnight-blue",children:"Consenti registrazione dopo il beep"})]}),!!e&&a.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[a.jsx(Vi,{name:"disabled",control:h,render:({field:I})=>a.jsx("input",{type:"checkbox",checked:I.value,onChange:I.onChange,className:"h-4 w-4 rounded border-gray-300 text-yellow-500 focus:ring-yellow-400"})}),a.jsx("span",{className:"text-sm text-midnight-blue",children:"Disattiva questa regola. La regola verrà ignorata."})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("button",{type:"submit",disabled:v||A==="FILE_ANNOUNCE",className:"btn btn-primary flex items-center gap-2",children:[v&&a.jsx(pe,{size:16,className:"animate-spin"}),"Salva"]}),a.jsx("button",{type:"button",onClick:s,className:"btn bg-gray-100 text-misty-blue hover:bg-gray-200",children:"Annulla"})]})]})},ug=()=>{const{phoneUuid:e,ruleUuid:t}=Xl(),n=yt(),{data:r,isLoading:s}=zv(e||""),i=Iv(),o=fP(),l=!t,u=t==="default",c=r?u?r.defaultRule:l?void 0:r.customRules.find(m=>m.uuid===t):void 0,f=!l&&!u&&!c&&!s&&!!r;b.useEffect(()=>{f&&n(`/configuration/${e}`,{replace:!0})},[f,n,e]);const d=async m=>{if(!r||!e||m.tab==="FILE_ANNOUNCE")return;const g={type:"TTS_ANNOUNCE",text:m.text,voiceName:m.voiceName};if(u){const y={isDefaultRule:!0,...g};await i.mutateAsync({phoneUuid:e,ruleUuid:e,body:y}),me.success("Messaggio base aggiornato")}else if(l){const y={name:m.name,days:m.days,intervals:m.intervals,...g};await o.mutateAsync({phoneUuid:e,body:y}),me.success("Regola creata")}else if(t){const y={isDefaultRule:!1,name:m.name,days:m.days,intervals:m.intervals,recordAfterBeep:m.recordAfterBeep,disabled:m.disabled,...g};await i.mutateAsync({phoneUuid:e,ruleUuid:t,body:y}),me.success("Regola aggiornata")}n(`/configuration/${e}`)};return s||!r||f?a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-midnight-blue"})}):a.jsx(BP,{rule:c,isDefault:u,globalRecordAfterBeep:r.recordAfterBeep,onSave:d,onCancel:()=>n("/configuration")})},VP=async e=>(await ne.get(`/dialplan/${e}`)).data,qP=()=>async e=>VP(e),HP=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>(await ne.post("/fleet/phones",n)).data,onSuccess:n=>{e.setQueryData([t,"phones"],r=>{const s={uuid:n.uuid,phoneNumber:n.phoneNumber,name:n.phoneName};return r?[...r,s]:[s]}
591),e.invalidateQueries({queryKey:[t,"phones"]})}})},WP=()=>{const[e,t]=b.useState(!1);return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>t(!0),className:"w-full bg-white rounded-lg shadow-sm p-5 border-2 border-dashed border-gray-300 hover:border-midnight-blue hover:bg-midnight-blue/5 transition-colors group text-left",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"bg-midnight-blue/10 group-hover:bg-midnight-blue/20 rounded-full p-3 transition-colors flex-shrink-0",children:a.jsx(Lj,{className:"h-5 w-5 text-midnight-blue"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"font-medium text-midnight-blue",children:"Aggiungi numero gestito"}),a.jsx("div",{className:"text-sm text-misty-blue",children:"Registra un nuovo numero sotto il tuo account"})]}),a.jsx(An,{className:"h-5 w-5 text-misty-blue flex-shrink-0"})]})}),a.jsx(QP,{isOpen:e,onClose:()=>t(!1)})]})},QP=({isOpen:e,onClose:t})=>{const{data:n}=Fr(),r=n??[],s=HP(),i=qP(),[o,l]=b.useState(""),[u,c]=b.useState(""),[f,d]=b.useState(""),[m,g]=b.useState(!1),y=()=>{l(""),c(""),d(""),g(!1)},v=()=>{m||(y(),t())},N=async x=>{if(x.preventDefault(),!!o.trim()){g(!0);try{let h;if(f)try{h=await i(f)}catch{me.error("Impossibile scaricare la configurazione da clonare"),g(!1);return}await s.mutateAsync({phoneNumber:o.trim(),phoneName:u.trim()||void 0,dialplan:h}),me.success("Numero aggiunto"),y(),t()}catch{}finally{g(!1)}}};return e?Kl.createPortal(a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:v}),a.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-100",children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Aggiungi numero gestito"}),a.jsx("button",{onClick:v,disabled:m,className:"p-2 rounded-lg hover:bg-gray-100 transition-colors disabled:opacity-50",children:a.jsx(De,{size:20,className:"text-misty-blue"})})]}),a.jsxs("form",{onSubmit:N,className:"p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1",children:"Numero di telefono"}),a.jsx("input",{type:"tel",value:o,onChange:x=>l(x.target.value),placeholder:"+39 333 1234567",disabled:m,required:!0,maxLength:16,autoFocus:!0,className:"w-full px-3 py-2 border border-gray-200 rounded-lg outline-none focus:border-yellow-400 disabled:bg-gray-50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1",children:"Nome (opzionale)"}),a.jsx("input",{type:"text",value:u,onChange:x=>c(x.target.value),placeholder:"Es. Studio Rossi",disabled:m,maxLength:255,className:"w-full px-3 py-2 border border-gray-200 rounded-lg outline-none focus:border-yellow-400 disabled:bg-gray-50"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1",children:"Importa configurazione da (opzionale)"}),a.jsxs("select",{value:f,onChange:x=>d(x.target.value),disabled:m||r.length===0,className:"w-full px-3 py-2 border border-gray-200 rounded-lg outline-none focus:border-yellow-400 disabled:bg-gray-50",children:[a.jsx("option",{value:"",children:"Nessuna configurazione iniziale"}),r.map(x=>a.jsxs("option",{value:x.uuid,children:[x.phoneNumber,x.name?` â ${x.name}`:""]},x.uuid))]})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-100",children:[a.jsx("button",{type:"button",onClick:v,disabled:m,className:"btn btn-secondary",children:"Annulla"}),a.jsxs("button",{type:"submit",disabled:m||!o.trim(),className:"inline-flex items-center gap-2 bg-yellow-400 hover:bg-yellow-500 disabled:opacity-50 text-midnight-blue font-medium rounded-lg px-4 py-2 transition-colors",children:[m&&a.jsx(pe,{size:16,className:"animate-spin"}),"Aggiungi"]})]})]})]})]}),document.body):null},Al=e=>[e,"fleet-voip-clients"],KP=e=>{const{isAuthenticated:t,activeUuid:n}=re();
591return Tn({queryKey:Al(n),queryFn:async()=>(await ne.get("/fleet/voip-clients")).data.voipClients,enabled:t&&e})},GP=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>(await ne.post("/fleet/voip-clients",n)).data,onSuccess:()=>{e.invalidateQueries({queryKey:Al(t)})}})},YP=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>{await ne.delete(`/fleet/voip-clients/${encodeURIComponent(n)}`)},onSuccess:(n,r)=>{e.setQueryData(Al(t),s=>s==null?void 0:s.filter(i=>i.sipUsername!==r)),e.invalidateQueries({queryKey:Al(t)})}})},XP=5e3,JP=()=>{const{data:e,isLoading:t}=KP(!0),n=YP(),[r,s]=b.useState(null),[i,o]=b.useState(!1),[l,u]=b.useState(null);b.useEffect(()=>{if(!r)return;const f=setTimeout(()=>s(null),XP);return()=>clearTimeout(f)},[r]);const c=async f=>{if(r!==f){s(f);return}try{await n.mutateAsync(f),me.success("Client VoIP eliminato"),s(null)}catch{}};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(op,{className:"h-5 w-5 text-midnight-blue"}),a.jsx("h3",{className:"font-medium text-midnight-blue",children:"I miei client VoIP"})]}),t?a.jsx("div",{className:"flex items-center justify-center py-6",children:a.jsx(pe,{className:"h-5 w-5 text-midnight-blue animate-spin"})}):e&&e.length>0?a.jsx("div",{className:"max-h-80 overflow-y-auto divide-y divide-gray-100 border border-gray-100 rounded-lg",children:e.map(f=>a.jsx(ZP,{client:f,isPendingDelete:r===f.sipUsername,isDeleting:n.isPending&&n.variables===f.sipUsername,onDelete:()=>c(f.sipUsername)},f.sipUsername))}):a.jsx("p",{className:"text-sm text-misty-blue",children:"Nessun client VoIP collegato."})]}),a.jsx("button",{onClick:()=>o(!0),className:"w-full bg-white rounded-lg shadow-sm p-5 border-2 border-dashed border-gray-300 hover:border-midnight-blue hover:bg-midnight-blue/5 transition-colors group text-left",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"bg-midnight-blue/10 group-hover:bg-midnight-blue/20 rounded-full p-3 transition-colors flex-shrink-0",children:a.jsx(op,{className:"h-5 w-5 text-midnight-blue"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"font-medium text-midnight-blue",children:"Aggiungi client VoIP gestito"}),a.jsx("div",{className:"text-sm text-misty-blue",children:"Crea credenziali Softphone"})]}),a.jsx(An,{className:"h-5 w-5 text-misty-blue flex-shrink-0"})]})}),a.jsx(e5,{isOpen:i,onClose:()=>o(!1),onCreated:f=>{o(!1),u(f)}}),a.jsx(t5,{creds:l,onClose:()=>u(null)})]})},ZP=({client:e,isPendingDelete:t,isDeleting:n,onDelete:r})=>a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 gap-3",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"font-medium text-midnight-blue truncate",children:e.displayName}),a.jsxs("div",{className:"text-xs text-misty-blue truncate",children:[a.jsx("span",{className:"font-medium",children:"Dominio:"})," ",e.domain]}),a.jsxs("div",{className:"text-xs text-misty-blue truncate",children:[a.jsx("span",{className:"font-medium",children:"Username:"})," ",e.sipUsername]})]}),a.jsxs("button",{onClick:r,disabled:n,className:`flex items-center gap-1 text-xs font-medium rounded-md px-3 py-1.5 transition-colors flex-shrink-0 ${t?"bg-red-600 text-white hover:bg-red-700":"text-gray-400 hover:text-red-600 hover:bg-red-50"} disabled:opacity-50`,title:t?"Conferma eliminazione":"Elimina client VoIP",children:[n?a.jsx(pe,{size:14,className:"animate-spin"}):a.jsx(Ge,{size:14}),t&&a.jsx("span",{children:"Conferma"})]})]}),e5=({isOpen:e,onClose:t,onCreated:n})=>{const{data:r}=Fr(),s=r??[],i=GP(),[o,l]=b.useState(""),[u,c]=b.useState(""),[f,d]=b.useState(!1),[m,g]=b.useState(!1),y=()=>{l(""),c(""),d(!1),g(!1)},v=p=>{if(l(p),!f){const w=s.find(C=>C.uuid===p);c((w==null?void 0:w.name)??(w==null?void 0:w.phoneNumber)??"")}},N=p=>{c(p),d(!0)},x=()=>{m||(y(),t())},h=async p=>{if(p.preventDefault(),!(!o||!u.trim())){g(!0);try{const w=await i.mutateAsync({phoneUuid:o,displayName:u.trim()});y(),n(w)}catch{}finally{g(!1)}}};return e?Kl.createPortal(a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:x}),a.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-100",children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Aggiungi client VoIP gestito"}),a.jsx("button",{onClick:x,disabled:m,className:"p-2 rounded-lg hover:bg-gray-100 transition-colors disabled:opacity-50",children:a.jsx(De,{size:20,className:"text-misty-blue"})})]}),a.jsxs("form",{onSubmit:h,className:"p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1",children:"Numero collegato"}),a.jsxs("select",{value:o,onChange:p=>v(p.target.value),disabled:m||s.length===0,required:!0,className:"w-full px-3 py-2 border border-gray-200 rounded-lg outline-none focus:border-yellow-400 disabled:bg-gray-50",children:[a.jsx("option",{value:"",children:"Seleziona un numero"}),s.map(p=>a.jsxs("option",{value:p.uuid,children:[p.phoneNumber,p.name?` â ${p.name}`:""]},p.uuid))]}),s.length===0&&a.jsx("p",{className:"text-xs text-misty-blue mt-1",children:"Aggiungi prima un numero gestito per poter creare un client VoIP."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-midnight-blue mb-1",children:"Nome client"}),a.jsx("input",{type:"text",value:u,onChange:p=>N(p.target.value),placeholder:"Es. iPhone Mario",disabled:m,required:!0,maxLength:255,className:"w-full px-3 py-2 border border-gray-200 rounded-lg outline-none focus:border-yellow-400 disabled:bg-gray-50"})]}),a.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-100",children:[a.jsx("button",{type:"button",onClick:x,disabled:m,className:"btn btn-secondary",children:"Annulla"}),a.jsxs("button",{type:"submit",disabled:m||!o||!u.trim(),className:"inline-flex items-center gap-2 bg-yellow-400 hover:bg-yellow-500 disabled:opacity-50 text-midnight-blue font-medium rounded-lg px-4 py-2 transition-colors",children:[m&&a.jsx(pe,{size:16,className:"animate-spin"}),"Crea"]})]})]})]})]}),document.body):null},t5=({creds:e,onClose:t})=>e?Kl.createPortal(a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),a.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4",children:[a.jsxs("div",{className:"p-6 border-b border-gray-100",children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Credenziali VoIP"}),a.jsxs("div",{className:"mt-3 flex items-start gap-2 bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:[a.jsx(eu,{size:18,className:"text-yellow-700 flex-shrink-0 mt-0.5"}),a.jsx("p",{className:"text-sm text-yellow-900",children:"Questa è l'unica volta che vedrai la password. Salvala in un posto sicuro: non potrà più essere recuperata."})]})]}),a.jsxs("div",{className:"p-6 space-y-3",children:[a.jsx(vc,{label:"Dominio",value:e.domain}),a.jsx(vc,{label:"Username",value:e.sipUsername}),a.jsx(vc,{label:"Password",value:e.userFacingPassword,mono:!0})]}),a.jsx("div",{className:"flex justify-end gap-2 p-6 pt-0",children:a.jsx("button",{type:"button",onClick:t,className:"inline-flex items-center gap-2 bg-yellow-400 hover:bg-yellow-500 text-midnight-blue font-medium rounded-lg px-4 py-2 transition-colors",children:"Ho salvato le credenziali"})})]})]}),document.body):null,vc=({label:e,value:t,mono:n})=>{const[r,s]=b.useState(!1),i=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch{me.error("Impossibile copiare negli appunti")}};return a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-misty-blue mb-1",children:e}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"text",readOnly:!0,value:t,className:`flex-1 px-3 py-2 border border-gray-200 rounded-lg bg-gray-50 outline-none ${n?"font-mono text-sm":""}`,onFocus:o=>o.currentTarget.select()}),a.jsx("button",{type:"button",onClick:i,className:"p-2 rounded-lg hover:bg-gray-100 text-misty-blue hover:text-midnight-blue transition-colors",title:"Copia",children:r?a.jsx(Ze,{size:16,className:"text-green-600"}):a.jsx(jy,{size:16})})]})]})},n5=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>{await ne.delete(`/phones/${n}`)},onSuccess:(n,r)=>{e.setQueryData([t,"phones"],s=>s&&s.filter(i=>
591i.uuid!==r)),e.invalidateQueries({queryKey:[t,"phones"]}),e.invalidateQueries({queryKey:[t,"fleet-voip-clients"]})}})},r5=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async({phoneUuid:n,name:r})=>{await ne.patch(`/phones/${n}`,{name:r})},onSuccess:(n,{phoneUuid:r,name:s})=>{e.setQueryData([t,"phones"],i=>i&&i.map(o=>o.uuid===r?{...o,name:s||void 0}:o)),e.invalidateQueries({queryKey:[t,"phones"]})}})},s5=5e3,i5=()=>{const{data:e,isLoading:t}=Fr(),n=n5(),r=r5(),[s,i]=b.useState(null),[o,l]=b.useState(null),[u,c]=b.useState("");b.useEffect(()=>{if(!s)return;const y=setTimeout(()=>i(null),s5);return()=>clearTimeout(y)},[s]);const f=async y=>{if(s!==y){i(y);return}try{await n.mutateAsync(y),me.success("Numero eliminato"),i(null)}catch{}},d=(y,v)=>{l(y),c(v??""),i(null)},m=()=>{l(null),c("")},g=async(y,v)=>{const N=u.trim();if(N===(v??"")){m();return}try{await r.mutateAsync({phoneUuid:y,name:N}),me.success("Nome aggiornato"),m()}catch{}};return a.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(_r,{className:"h-5 w-5 text-midnight-blue"}),a.jsx("h3",{className:"font-medium text-midnight-blue",children:"I miei numeri"})]}),t?a.jsx("div",{className:"flex items-center justify-center py-6",children:a.jsx(pe,{className:"h-5 w-5 text-midnight-blue animate-spin"})}):e&&e.length>0?a.jsx("div",{className:"max-h-80 overflow-y-auto divide-y divide-gray-100 border border-gray-100 rounded-lg",children:e.map(y=>{var p;const v=o===y.uuid,N=r.isPending&&((p=r.variables)==null?void 0:p.phoneUuid)===y.uuid,x=s===y.uuid,h=n.isPending&&n.variables===y.uuid;return a.jsxs("div",{className:`flex items-center justify-between px-4 py-3 gap-3 ${y.isEnabled?"":"bg-red-50/60"}`,children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx("span",{className:`font-medium truncate ${y.isEnabled?"text-midnight-blue":"text-midnight-blue/60"}`,children:y.phoneNumber}),!y.isEnabled&&a.jsx("span",{className:"inline-flex items-center text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-red-100 text-red-700 border border-red-200 flex-shrink-0",children:"Disabilitato"}),!y.canLogin&&a.jsx("span",{className:"inline-flex items-center text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-red-50 text-red-700 border border-red-200 flex-shrink-0",children:"Login disabilitato"})]}),!y.isEnabled&&a.jsx("p",{className:"mt-1 text-xs text-red-700",children:"Numero non attivo perché non incluso nell' abbonamento corrente."}),v?a.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[a.jsx("input",{type:"text",value:u,onChange:w=>c(w.target.value),onKeyDown:w=>{w.key==="Enter"&&g(y.uuid,y.name),w.key==="Escape"&&m()},maxLength:255,autoFocus:!0,disabled:N,placeholder:"Nome",className:"text-xs border-b border-yellow-400 outline-none bg-transparent flex-1 min-w-0 disabled:opacity-50"}),a.jsx("button",{onClick:()=>g(y.uuid,y.name),disabled:N,className:"p-0.5 text-green-600 hover:text-green-700 disabled:opacity-50",title:"Salva",children:N?a.jsx(pe,{size:14,className:"animate-spin"}):a.jsx(Ze,{size:14})}),a.jsx("button",{onClick:m,disabled:N,className:"p-0.5 text-gray-400 hover:text-gray-600 disabled:opacity-50",title:"Annulla",children:a.jsx(De,{size:14})})]}):a.jsxs("button",{onClick:()=>d(y.uuid,y.name),className:"flex items-center gap-1 text-xs text-misty-blue hover:text-midnight-blue transition-colors mt-0.5 truncate max-w-full",title:"Rinomina",children:[a.jsx("span",{className:"truncate",children:y.name||"Aggiungi nome"}),a.jsx(Mt,{size:11,className:"flex-shrink-0 opacity-60"})]})]}),!v&&a.jsxs("button",{onClick:()=>f(y.uuid),disabled:h,className:`flex items-center gap-1 text-xs font-medium rounded-md px-3 py-1.5 transition-colors flex-shrink-0 ${x?"bg-red-600 text-white hover:bg-red-700":"text-gray-400 hover:text-red-600 hover:bg-red-50"} disabled:opacity-50`,title:x?"Conferma eliminazione":"Elimina numero",children:[h?a.jsx(pe,{size:14,className:"animate-spin"}):a.jsx(Ge,{size:14}),x&&a.jsx("span",{children:"Conferma"})]})]},y.uuid)})}):a.jsx("p",{className:"text-sm text-misty-blue",children:"Nessun numero collegato."})]})},a5={GEMINI_LIVE_API_KEY:{title:"Gemini Live API key",description:"Usa la tua chiave Google Gemini Live per le chiamate gestite dallâassistente vocale."}},o5=({secrets:e})=>a.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 space-y-5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"rounded-full bg-yellow-100 p-2",children:a.jsx(wj,{className:"h-5 w-5 text-midnight-blue"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold text-midnight-blue",children:"Credenziali personalizzate"}),a.jsx("p",{className:"text-sm text-misty-blue",children:"Le credenziali vengono salvate cifrate e non saranno più visualizzabili."})]})]}),e.map(t=>a.jsx(l5,{secret:t},t.secretName))]}),l5=({secret:e})=>{const[t,n]=b.useState(""),r=KC(),s=a5[e.secretName],i=r.isPending,o=async()=>{const l=t.trim();if(l)try{await r.mutateAsync({secretName:e.secretName,value:l}),n(""),me.success(e.configured?"Credenziale sostituita":"Credenziale salvata")}catch{return}};return a.jsxs("div",{className:"space-y-3 border-t border-gray-100 pt-5 first:border-0 first:pt-0",children:[a.jsx("div",{className:"flex items-start justify-between gap-3",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h3",{className:"font-medium text-midnight-blue",children:s.title}),a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${e.configured?"bg-green-50 text-green-700":"bg-gray-100 text-gray-600"}`,children:e.configured?"Configurata":"Non configurata"})]}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:s.description})]})}),a.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[a.jsx("input",{type:"password",value:t,onChange:l=>n(l.target.value),onKeyDown:l=>{l.key==="Enter"&&o()},autoComplete:"new-password",placeholder:e.configured?"Inserisci una nuova chiave per sostituirla":"Inserisci la API key",disabled:i,className:"min-w-0 flex-1 rounded-lg border border-gray-200 px-3 py-2.5 text-sm outline-none transition-colors focus:border-yellow-400 focus:ring-2 focus:ring-yellow-100"}),a.jsxs("button",{type:"button",onClick:()=>void o(),disabled:i||!t.trim(),className:"inline-flex items-center justify-center gap-2 rounded-lg bg-midnight-blue px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-midnight-blue/90 disabled:cursor-not-allowed disabled:opacity-50",children:[r.isPending?a.jsx(pe,{className:"h-4 w-4 animate-spin"}):a.jsx(Pj,{className:"h-4 w-4"}),"Salva"]})]})]})},u5=()=>{var x;const{data:e,isLoading:t}=Qa(),n=re(h=>h.logout),r=yt(),s=hn(),i=WC(),[o,l]=b.useState(!1),[u,c]=b.useState("");b.useEffect(()=>{e!=null&&e.name&&c(e.name)},[e==null?void 0:e.name]);const f=()=>{n(),r("/login")},d=async()=>{const h=u.trim();if(!h||h===(e==null?void 0:e.name)){l(!1);return}try{await i.mutateAsync({name:h}),l(!1),me.success("Nome aggiornato")}catch{}},m=()=>{c((e==null?void 0:e.name)??""),l(!1)},g=()=>{r("/paywall",{state:{backgroundLocation:s}})};if(t)return a.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:a.jsx(pe,{className:"h-8 w-8 text-midnight-blue animate-spin"})});if(!e)return null;const y=()=>{var h;
591switch((h=e.subscription)==null?void 0:h.status){case"AUTO_RENEWAL":return"bg-green-50 text-green-700";case"CANCELLED":return"bg-orange-50 text-orange-700";case"GRACE_PERIOD":return"bg-yellow-50 text-yellow-700";case"RETRY_PERIOD":return"bg-red-50 text-red-700";default:return"bg-gray-50 text-gray-700"}},v=()=>{var h;switch((h=e.subscription)==null?void 0:h.status){case"AUTO_RENEWAL":return"Rinnovo automatico";case"CANCELLED":return"Cancellato";case"GRACE_PERIOD":return"Periodo di grazia";case"RETRY_PERIOD":return"In attesa di pagamento";default:return"Stato sconosciuto"}},N=()=>{var h;return((h=e.subscription)==null?void 0:h.status)==="AUTO_RENEWAL"?"Prossimo rinnovo":"Scadenza abbonamento"};return a.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"bg-yellow-400 rounded-full p-3",children:a.jsx(Id,{className:"h-6 w-6 text-midnight-blue"})}),a.jsxs("div",{children:[o?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"text",value:u,onChange:h=>c(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d(),h.key==="Escape"&&m()},maxLength:50,autoFocus:!0,className:"text-2xl font-bold text-midnight-blue border-b-2 border-yellow-400 outline-none bg-transparent"}),a.jsx("button",{onClick:d,disabled:i.isPending,className:"p-1 text-green-600 hover:text-green-700 transition-colors",children:i.isPending?a.jsx(pe,{size:18,className:"animate-spin"}):a.jsx(Ze,{size:18})}),a.jsx("button",{onClick:m,disabled:i.isPending,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:a.jsx(De,{size:18})})]}):a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h1",{className:"text-2xl font-bold text-midnight-blue",children:e.name||"Utente"}),a.jsx("button",{onClick:()=>l(!0),className:"p-1 text-gray-400 hover:text-midnight-blue transition-colors",title:"Modifica nome",children:a.jsx(Mt,{size:16})})]}),a.jsx("p",{className:"text-misty-blue",children:e.email})]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-gray-100",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(mj,{className:"h-5 w-5 text-midnight-blue"}),a.jsxs("span",{className:"text-sm text-misty-blue",children:["Iscritto dal ",fn(new Date(e.createdAt),"d MMMM yyyy",{locale:Mr})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(xj,{className:"h-5 w-5 text-yellow-500"}),a.jsx("span",{className:"font-medium text-midnight-blue",children:((x=e.subscription)==null?void 0:x.plan)??"Free"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-yellow-200 bg-yellow-50 p-4 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(zd,{className:"h-5 w-5 text-midnight-blue"}),a.jsx("h3",{className:"font-medium text-midnight-blue",children:"Il mio abbonamento"})]}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Gestisci piano, upgrade e opzioni disponibili."})]}),a.jsx("button",{type:"button",onClick:g,className:"inline-flex items-center justify-center gap-2 rounded-lg bg-midnight-blue px-4 py-2.5 text-sm font-semibold text-white hover:bg-midnight-blue/90 transition-colors",children:"Gestisci abbonamento"})]}),e.subscription&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium text-midnight-blue",children:"Abbonamento"}),a.jsx("p",{className:"text-sm text-misty-blue mt-1",children:e.subscription.priceHumanFriendly})]}),a.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${y()}`,children:v()})]}),a.jsxs("div",{className:"bg-midnight-blue/5 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-misty-blue",children:N()}),a.jsx("span",{className:"font-medium text-midnight-blue",children:fn(new Date(e.subscription.currentPeriodExpiresAt),"d MMMM yyyy",{locale:Mr})})]}),e.dailyCallsRemaining!==void 0&&a.jsxs("div",{className:"flex items-center justify-between mt-2",children:[a.jsx("span",{className:"text-sm text-misty-blue",children:"Chiamate rimanenti oggi"}),a.jsx("span",{className:"font-medium text-midnight-blue",children:e.dailyCallsRemaining})]})]}),e.subscription.managementUrl&&a.jsx("div",{className:"flex flex-col gap-2",children:e.subscription.managementUrl.includes("stripe-portal")&&a.jsxs("a",{href:`https://tp.mysegreteria.app/?appUserUuid=${e.uuid}&href=${encodeURIComponent(e.subscription.managementUrl)}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm font-medium text-midnight-blue hover:text-midnight-blue/80 transition-colors",children:["Modifica profilo di fatturazione",a.jsx(nu,{className:"h-4 w-4"})]})})]})]}),a.jsx("div",{className:"pt-4 border-t border-gray-100",children:a.jsxs("button",{onClick:f,className:"flex items-center gap-2 text-sm font-medium text-red-600 hover:text-red-700 transition-colors",children:[a.jsx(ky,{className:"h-4 w-4"}),"Esci"]})})]}),e.customizableSecrets&&e.customizableSecrets.length>0&&a.jsx(o5,{secrets:e.customizableSecrets}),a.jsx(i5,{}),e.enableFleetPhones&&a.jsx(WP,{}),e.enableFleetVoipClients&&a.jsx(JP,{})]})},c5=async()=>(await ne.get("/agents")).data,d5=()=>{const{isAuthenticated:e,activeUuid:t}=re();return Tn({queryKey:[t,"agents"],queryFn:c5,enabled:e,refetchInterval:3e4})},f5=()=>{const e=xe(),{activeUuid:t}=re();return ye({mutationFn:async n=>(await ne.post("/agents",n)).data,onSuccess:()=>
591{e.invalidateQueries({queryKey:[t,"agents"]})}})},m5=e=>{const{isAuthenticated:t,activeUuid:n}=re();return Tn({queryKey:[n,"agent-stats",e],queryFn:async()=>(await ne.get(`/agents/${e}/stats`)).data,enabled:t&&!!e,refetchInterval:6e4})},h5=e=>{const t=xe(),{activeUuid:n}=re();return ye({mutationFn:async()=>(await ne.post(`/agents/${e}/refresh`)).data,onSuccess:()=>{t.invalidateQueries({queryKey:[n,"agents"]})}})},Xv=e=>{const t=xe(),{activeUuid:n}=re();return ye({mutationFn:async r=>(await ne.patch(`/agents/${e}`,r)).data,onSuccess:()=>{t.invalidateQueries({queryKey:[n,"agents"]})}})},p5=e=>{const{isAuthenticated:t,activeUuid:n}=re();return Tn({queryKey:[n,"conversations",e],queryFn:async()=>(await ne.get(`/agents/${e}/conversations`)).data,enabled:t&&!!e})},g5=(e,t,n=!1)=>{const{isAuthenticated:r,activeUuid:s}=re();return Tn({queryKey:[s,"conversation",e,t,n],queryFn:async()=>{const i=n?"?debug=true":"",o=await ne.get(`/agents/${e}/conversations/${encodeURIComponent(t)}${i}`);return Array.isArray(o.data)?{messages:o.data,bookings:[]}:o.data},enabled:r&&!!e&&!!t})},x5=e=>{const t=xe(),{activeUuid:n}=re();return ye({mutationFn:async({phone:r,text:s})=>(await ne.post(`/agents/${e}/conversations/test?phone=${encodeURIComponent(r)}`,{text:s},{timeout:12e4})).data,onSuccess:(r,s)=>{t.invalidateQueries({queryKey:[n,"conversations",e]}),t.invalidateQueries({queryKey:[n,"conversation",e,s.phone]})}})},y5=e=>{const t=xe(),{activeUuid:n}=re();return ye({mutationFn:async r=>{await ne.delete(`/agents/${e}/conversations/${encodeURIComponent(r)}`)},onSuccess:()=>{t.invalidateQueries({queryKey:[n,"conversations",e]})}})},v5=({text:e,className:t})=>{const n=e.split(` 592`);return a.jsx("span",{className:t,children:n.map((r,s)=>a.jsxs(se.Fragment,{children:[s>0&&a.jsx("br",{}),b5(r)]},s))})};function b5(e){const t=[],n=/\*\*(.+?)\*\*|\*(.+?)\*/g;let r=0,s;for(;(s=n.exec(e))!==null;)s.index>r&&t.push(e.slice(r,s.index)),t.push(a.jsx("strong",{children:s[1]??s[2]},s.index)),r=n.lastIndex;return r<e.length&&t.push(e.slice(r)),t}const w5=()=>{const{data:e,isLoading:t}=d5(),n=e==null?void 0:e[0];return t?a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-midnight-blue"})}):n?a.jsx(j5,{agent:n}):a.jsx(N5,{})},N5=()=>{const{data:e}=Fr(),t=f5(),[n,r]=b.useState(""),[s,i]=b.useState(""),o=l=>{l.preventDefault(),!(!n.trim()||!s)&&t.mutate({type:"BOOKING_AGENT",treatwellShopId:n.trim(),phoneUuid:s},{onSuccess:()=>me.success("Agente creato"),onError:()=>me.error("Errore nella creazione dell'agente")})};return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-2xl font-bold text-midnight-blue",children:"Prenotazioni"}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-8 max-w-lg",children:[a.jsx("h2",{className:"text-lg font-semibold text-midnight-blue mb-4",children:"Aggiungi nuovo agente"}),a.jsxs("form",{onSubmit:o,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"ID negozio Treatwell"}),a.jsx("input",{type:"text",value:n,onChange:l=>r(l.target.value),className:"w-full text-sm border border-gray-200 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20",placeholder:"es. 12345"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Numero di telefono"}),a.jsxs("select",{value:s,onChange:l=>i(l.target.value),className:"w-full text-sm border border-gray-200 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20",children:[a.jsx("option",{value:"",children:"Seleziona un numero"}),e==null?void 0:e.map(l=>a.jsx("option",{value:l.uuid,children:l.name?`${l.name} (${l.phoneNumber})`:l.phoneNumber},l.uuid))]})]}),a.jsxs("button",{type:"submit",disabled:t.isPending||!n.trim()||!s,className:"flex items-center gap-2 px-4 py-2 bg-midnight-blue text-white rounded-md hover:bg-midnight-blue/90 disabled:opacity-50 text-sm",children:[a.jsx(An,{size:16}),t.isPending?"Creazione...":"Crea agente"]})]})]})]})},bc=({isActive:e})=>`pb-3 text-sm font-medium border-b-2 transition-colors ${e?"border-midnight-blue text-midnight-blue":"border-transparent text-misty-blue hover:text-midnight-blue hover:border-gray-300"}`,j5=({agent:e})=>{const t=yt(),n=!e.enabled||e.enabled&&!e.isWithinActiveHours||(e.definition.faq??[]).some(r=>!r.answer);return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h1",{className:"text-2xl font-bold text-midnight-blue",children:"Prenotazioni"}),n&&a.jsxs("div",{className:"space-y-2",children:[!e.enabled&&a.jsx("div",{onClick:()=>t("/booking/configuration"),className:"bg-red-500 text-white text-sm font-medium px-4 py-2 rounded-lg cursor-pointer hover:bg-red-600 transition-colors",children:"L'assistente è disattivato. Vai alla Configurazione per attivarlo."}),e.enabled&&!e.isWithinActiveHours&&a.jsx("div",{onClick:()=>t("/booking/configuration"),className:"bg-yellow-500 text-white text-sm font-medium px-4 py-2 rounded-lg cursor-pointer hover:bg-yellow-600 transition-colors",children:"L'Assistente AI è fuori dall'orario di attività configurato e non risponderà ai messaggi."}),(e.definition.faq??[]).some(r=>!r.answer)&&a.jsx("div",{onClick:()=>t("/booking/configuration"),className:"bg-orange-500 text-white text-sm font-medium px-4 py-2 rounded-lg cursor-pointer hover:bg-orange-600 transition-colors",children:"L'Assistente AI ha bisogno del tuo aiuto per rispondere ad alcune domande."})]}),a.jsx("div",{className:"max-w-full overflow-hidden border-b border-gray-200",children:a.jsxs("nav",{className:"flex gap-6 overflow-x-auto",children:[a.jsx(Vt,{to:"/booking/overview",className:bc,children:"Panoramica"}),a.jsx(Vt,{to:"/booking/conversations",className:bc,children:"Conversazioni"}),a.jsx(Vt,{to:"/booking/configuration",className:bc,children:"Configurazione"})]})}),a.jsxs(Ad,{children:[a.jsx(We,{index:!0,element:a.jsx(Oa,{to:"/booking/overview",replace:!0})}),a.jsx(We,{path:"overview",element:a.jsx(S5,{agent:e})}),a.jsx(We,{path:"appointments",element:a.jsx(Oa,{to:"/booking/overview",replace:!0})}),a.jsx(We,{path:"conversations",element:a.jsx(R5,{agent:e})}),a.jsx(We,{path:"conversations/:phone",element:a.jsx(P5,{agent:e})}),a.jsx(We,{path:"configuration",element:a.jsx(F5,{agent:e})})]})]})},S5=({agent:e})=>{const{data:t,isLoading:n,isError:r}=m5(e.uuid);if(n)return a.jsx("div",{className:"flex items-center justify-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-midnight-blue"})});if(r)return a.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm font-medium text-red-700",children:[a.jsx(eu,{size:16}),"Statistiche non disponibili."]});const s=new Date,i=new Date(s.getTime()-30*24*60*60*1e3),o=new Date(s.getTime()-60*24*60*60*1e3),l=t??{windowDays:30,currentPeriodStart:i.toISOString(),currentPeriodEnd:s.toISOString(),previousPeriodStart:o.toISOString(),previousPeriodEnd:i.toISOString(),conversationWindowHours:72,assistedConversationsLast72Hours:0,bookingsFromBot:0,previousBookingsFromBot:0,confirmedBookingsFromBot:0,pendingBookingsFromBot:0,upcomingBookingsFromBot:0,uniqueCustomersFromBot:0,previousUniqueCustomersFromBot:0,estimatedRevenueInCents:0,previousEstimatedRevenueInCents:0}
592;return a.jsxs("section",{className:"space-y-3",children:[a.jsxs("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("p",{className:"text-sm font-medium text-midnight-blue",children:["Ultimi ",l.windowDays," giorni: ",cg(l.currentPeriodStart,l.currentPeriodEnd)]}),a.jsxs("p",{className:"text-xs text-misty-blue",children:["Confronto con ",cg(l.previousPeriodStart,l.previousPeriodEnd)]})]}),a.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[a.jsx(So,{icon:Ey,label:"Chat seguite nelle ultime 72h",value:Cs(l.assistedConversationsLast72Hours),description:"Chat WhatsApp in cui l'assistente ha risposto almeno una volta.",detail:`Aggiornate con le conversazioni delle ultime ${l.conversationWindowHours} ore`,tone:"blue"}),a.jsx(So,{icon:Ze,label:"Prenotazioni prese",value:Cs(l.bookingsFromBot),changePercent:wc(l.bookingsFromBot,l.previousBookingsFromBot),description:"Prenotazioni raccolte dall'assistente su WhatsApp. Sono incluse quelle confermate e quelle ancora da confermare.",detail:`${Cs(l.confirmedBookingsFromBot)} confermate · ${Cs(l.pendingBookingsFromBot)} da confermare · ${Cs(l.upcomingBookingsFromBot)} future`,tone:"green"}),a.jsx(So,{icon:vj,label:"Valore delle prenotazioni",value:k5(l.estimatedRevenueInCents),changePercent:wc(l.estimatedRevenueInCents,l.previousEstimatedRevenueInCents),description:"Totale stimato dei servizi prenotati dall'assistente. Le prenotazioni rifiutate non sono incluse.",detail:"Calcolato con i prezzi dei servizi",tone:"amber"}),a.jsx(So,{icon:Dj,label:"Clienti che hanno prenotato",value:Cs(l.uniqueCustomersFromBot),changePercent:wc(l.uniqueCustomersFromBot,l.previousUniqueCustomersFromBot),description:"Clienti diversi che hanno lasciato almeno una prenotazione all'assistente.",detail:"Senza contare doppioni",tone:"slate"})]})]})},C5={blue:{icon:"text-blue-700",background:"bg-blue-50"},green:{icon:"text-green-700",background:"bg-green-50"},amber:{icon:"text-amber-700",background:"bg-amber-50"},slate:{icon:"text-slate-700",background:"bg-slate-50"}},So=({icon:e,label:t,value:n,changePercent:r,description:s,detail:i,tone:o})=>{const l=C5[o],u=r===void 0?"":r>0?"bg-green-50 text-green-700":r<0?"bg-red-50 text-red-700":"bg-gray-100 text-gray-600";return a.jsxs("div",{className:"min-h-[190px] rounded-lg border border-gray-200 bg-white p-5 md:p-6",children:[a.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4",children:[a.jsx("p",{className:"text-sm font-semibold text-midnight-blue",children:t}),a.jsx("span",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-md ${l.background}`,children:a.jsx(e,{size:20,className:l.icon})})]}),a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsx("div",{className:"text-3xl font-semibold text-midnight-blue md:text-4xl",children:n}),r!==void 0&&a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-semibold ${u}`,children:E5(r)})]}),a.jsx("p",{className:"mt-3 text-sm leading-5 text-gray-600",children:s}),a.jsx("p",{className:"mt-3 text-xs font-medium text-misty-blue",children:i})]})};function Cs(e){return new Intl.NumberFormat("it-IT").format(e)}function k5(e){return new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR",maximumFractionDigits:0}).format(e/100)}function wc(e,t){return t===0?e===0?0:100:Math.round((e-t)/t*100)}function E5(e){return e>0?`+${e}%`:`${e}%`}function cg(e,t){const n=new Intl.DateTimeFormat("it-IT",{day:"numeric",month:"short"});return`${n.format(new Date(e))} - ${n.format(new Date(t))}`}const P5=({agent:e})=>{const{phone:t}=Xl(),n=yt();return t?a.jsx(T5,{agent:e,interlocutorPhone:decodeURIComponent(t),onBack:()=>n("/booking/conversations")}):a.jsx(Oa,{to:"/booking/conversations",replace:!0})},R5=({agent:e})=>{const{data:t,isLoading:n}=p5(e.uuid),r=yt();return a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs text-misty-blue",children:"AppSegreteria ricorda le conversazioni attive nelle ultime 72h."}),n&&a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-midnight-blue"})}),!n&&(!t||t.length===0)&&a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-8 text-center text-misty-blue",children:"Nessuna conversazione attiva."}),t&&t.length>0&&a.jsx("div",{className:"overflow-hidden bg-white rounded-lg border border-gray-200 divide-y divide-gray-100",children:t.map(s=>a.jsx(A5,{agentUuid:e.uuid,interlocutorPhone:s.interlocutorPhone,lastMessage:s.lastMessage,lastMessageAt:s.lastMessageAt,onClick:()=>r(`/booking/conversations/${encodeURIComponent(s.interlocutorPhone)}`)},s.interlocutorPhone))})]})},A5=({agentUuid:e,interlocutorPhone:t,lastMessage:n,lastMessageAt:r,onClick:s})=>{const i=y5(e),o=u=>{u.stopPropagation(),confirm("Eliminare questa conversazione?")&&i.mutate(t,{onSuccess:()=>me.success("Conversazione eliminata"),onError:()=>me.error("Errore nell'eliminazione")})},l=M5(r);return a.jsxs("div",{onClick:s,className:"group flex cursor-pointer items-center justify-between gap-3 px-3 py-3 transition-colors hover:bg-gray-50 sm:px-4",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[a.jsx("div",{className:"flex-shrink-0 w-9 h-9 bg-midnight-blue/10 rounded-full flex items-center justify-center",children:a.jsx(Ey,{size:16,className:"text-midnight-blue"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx("span",{className:"truncate text-sm font-medium text-midnight-blue",children:t}),t.startsWith("+555")&&a.jsx("span",{className:"shrink-0 text-[10px] px-1.5 py-0.5 bg-yellow-100 text-yellow-700 rounded-full font-medium",children:"prova"})]}),n&&a.jsx("p",{className:"truncate text-xs text-misty-blue",children:n})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[a.jsx("span",{className:"text-xs text-misty-blue",children:l}),a.jsx("button",{onClick:o,disabled:i.isPending,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors sm:opacity-0 sm:group-hover:opacity-100",title:"Elimina conversazione",children:a.jsx(Ge,{size:14})})]})]})},T5=({agent:e,interlocutorPhone:t,onBack:n})=>{const[r]=py(),s=r.has("debug"),{data:i,isLoading:o}=g5(e.uuid,t,s),l=i==null?void 0:i.messages.filter(u=>!!(u.role==="USER"||u.role==="ASSISTANT"&&u.text||u.role==="OPERATOR"&&u.text||s&&u.text));return a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{onClick:n,className:"flex items-center gap-1 text-sm text-misty-blue hover:text-midnight-blue transition-colors",children:[a.jsx(pj,{size:16}),"Torna alle conversazioni"]}),s&&a.jsx("span",{className:"text-[10px] font-mono bg-amber-100 text-amber-700 px-1.5 py-0.5 rounded",children:"DEBUG"})]}),!o&&a.jsx(O5,{bookings:(i==null?void 0:i.bookings)??[]}),a.jsxs("div",{className:"flex h-[calc(100dvh-20rem)] min-h-[300px] flex-col overflow-hidden rounded-lg border border-gray-200 bg-white md:h-auto md:max-h-[520px]",children:[a.jsx("div",{className:"border-b border-gray-100 px-4 py-3",children:a.jsx("h3",{className:"truncate text-sm font-medium text-midnight-blue",children:t})}),o&&a.jsx("div",{className:"flex flex-1 items-center justify-center py-8",children:a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-midnight-blue"})}),!o&&l&&a.jsx("div",{className:"flex-1 space-y-2 overflow-y-auto p-4",children:l.map((u,c)=>{var m;if(s&&(u.role==="SYSTEM"||u.role==="TOOL"||u.role==="CONTEXT"))return a.jsx("div",{className:"flex justify-center",children:a.jsxs("div",{className:"max-w-[90%] rounded-lg px-3 py-2 text-xs font-mono bg-amber-50 text-amber-800 border border-amber-200 whitespace-pre-wrap break-all",children:[a.jsxs("span",{className:"font-semibold text-amber-600",children:["[",u.role,"]"]})," ",u.text,a.jsx("p",{className:"text-[10px] mt-1 text-amber-400",children:new Date(u.createdAt).toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]})},c);const f=u.role==="USER",d=u.role==="OPERATOR";return a.jsx("div",{className:`flex ${f?"justify-start":"justify-end"}`,children:a.jsxs("div",{className:`max-w-[88%] break-words rounded-lg px-3 py-2 text-sm sm:max-w-[75%] ${f?"bg-gray-100 text-gray-800":d?"bg-emerald-600 text-white":"bg-midnight-blue text-white"}`,children:[d&&a.jsx("p",{className:"text-[10px] font-semibold text-emerald-100 mb-1",children:"Operatore"}),(m=u.attachments)==null?void 0:m.map((g,y)=>g.expired?a.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-gray-200/60 text-gray-500 px-3 py-2 mb-2 text-xs",children:[a.jsx(bj,{size:16}),a.jsx("span",{children:"Immagine scaduta"})]},y):a.jsx("img",{src:g.url,alt:"Allegato",className:"rounded-md max-w-full max-h-48 object-contain mb-2"},y)),u.text&&a.jsx(v5,{text:u.text,className:"whitespace-pre-wrap"}),a.jsx("p",{className:`text-[10px] mt-1 ${f?"text-gray-400":"text-white/60"}`,children:new Date(u.createdAt).toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"})})]})},c)})})]})]})},dg=({booking:e})=>a.jsxs("div",{className:"flex flex-col gap-1 px-4 py-2 text-xs sm:flex-row sm:items-center sm:gap-3",children:[a.jsx("span",{className:"shrink-0 font-medium text-midnight-blue sm:w-32",children:L5(e.startDate)}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1 text-gray-600",children:[a.jsx("span",{className:"min-w-0 max-w-full truncate font-medium text-gray-800 sm:max-w-40",children:e.customerName||"Cliente"}),a.jsx("span",{className:"shrink-0 text-misty-blue",children:e.customerPhone}),a.jsx("span",{className:"min-w-0 max-w-full truncate sm:max-w-64",children:e.services.length>0?e.services.join(", "):"Servizi non indicati"}),a.jsx("span",{className:"shrink-0 font-medium text-gray-800",children:D5(e.quotedAmountInCents)})]}),a.jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold ${I5(e.status)}`,children:z5(e.status)})]}),O5=({bookings:e})=>{const t=Date.now(),n=e.filter(s=>new Date(s.startDate).getTime()>=t).sort((s,i)=>new Date(s.startDate).getTime()-new Date(i.startDate).getTime()),r=e.filter(s=>new Date(s.startDate).getTime()<t).sort((s,i)=>new Date(i.startDate).getTime()-new Date(s.startDate).getTime());return a.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-gray-100 px-4 py-2.5",children:[a.jsx("h3",{className:"text-sm font-medium text-midnight-blue",children:"Appuntamenti cliente"}),a.jsx("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-xs font-medium text-misty-blue",children:e.length})]}),e.length===0?a.jsx("p",{className:"px-4 py-3 text-xs text-misty-blue",children:"Nessun appuntamento collegato a questa conversazione."}):a.jsxs("div",{className:"max-h-40 divide-y divide-gray-100 overflow-y-auto",children:[n.map(s=>a.jsx(dg,{booking:s},s.uuid)),n.length>0&&r.length>0&&a.jsx("div",{className:"bg-gray-50 px-4 py-1 text-[10px] font-semibold uppercase tracking-wide text-misty-blue",children:"Passati"}),r.map(s=>a.jsx(dg,{booking:s},s.uuid))]})]})},_5=({faq:e,agentUuid:t})=>{const n=Xv(t),[r,s]=b.useState(null),[i,o]=b.useState(""),l=e.filter(m=>!m.answer),u=e.filter(m=>m.answer),c=(m,g)=>{s(m),o(g??"")},f=m=>{const g=[...e];g[m]={...g[m],answer:i.trim()||void 0},n.mutate({faq:g},{onSuccess:()=>s(null),onError:()=>me.error("Errore nel salvataggio")})},d=m=>{const g=e.filter((y,v)=>v!==m);n.mutate({faq:g})};return a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("h3",{className:"text-sm font-medium text-midnight-blue mb-1",children:["Domande dell'agente",l.length>0&&a.jsxs("span",{className:"ml-2 text-xs font-medium text-orange-600 bg-orange-100 px-1.5 py-0.5 rounded-full",children:[l.length," da rispondere"]})]}),a.jsx("p",{className:"text-xs text-misty-blue mb-3",children:e.length===0?"Compariranno automaticamente quando l'agente riceve domande a cui non sa rispondere. Rispondi per insegnargli.":"L'agente ti chiede aiuto su queste domande. Rispondi per insegnargli a rispondere la prossima volta."}),a.jsxs("div",{className:"space-y-2",children:[l.map(m=>{const g=e.indexOf(m),y=r===g;return a.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-3 group",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-midnight-blue",children:m.question}),a.jsxs("p",{className:"text-[11px] text-misty-blue mt-0.5",children:[new Date(m.askedAt).toLocaleDateString("it-IT"),m.relatedServices&&m.relatedServices.length>0&&a.jsxs(a.Fragment,{children:[" · ",m.relatedServices.join(", ")
592]})]})]}),!y&&a.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[a.jsx("button",{onClick:()=>c(g),className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Rispondi",children:a.jsx(Mt,{size:14})}),a.jsx("button",{onClick:()=>d(g),className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Elimina",children:a.jsx(Ge,{size:14})})]})]}),y&&a.jsxs("div",{className:"mt-2 space-y-2",children:[a.jsx("textarea",{value:i,onChange:v=>o(v.target.value),className:"w-full text-sm text-gray-700 bg-white rounded-md p-2 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y",rows:2,placeholder:"Scrivi la risposta...",disabled:n.isPending}),a.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[a.jsx("button",{onClick:()=>s(null),disabled:n.isPending,className:"px-3 py-1.5 text-sm text-gray-600 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors",children:"Annulla"}),a.jsx("button",{onClick:()=>f(g),disabled:n.isPending||!i.trim(),className:"px-3 py-1.5 text-sm text-white bg-green-600 hover:bg-green-700 rounded-md transition-colors disabled:opacity-50",children:"Salva risposta"})]})]})]},g)}),u.length>0&&l.length>0&&a.jsx("div",{className:"border-t border-gray-200 my-2"}),u.map(m=>{const g=e.indexOf(m),y=r===g;return a.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3 group",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-midnight-blue",children:m.question}),!y&&a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:m.answer})]}),!y&&a.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[a.jsx("button",{onClick:()=>c(g,m.answer),className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Modifica risposta",children:a.jsx(Mt,{size:14})}),a.jsx("button",{onClick:()=>d(g),className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Elimina",children:a.jsx(Ge,{size:14})})]})]}),y&&a.jsxs("div",{className:"mt-2 space-y-2",children:[a.jsx("textarea",{value:i,onChange:v=>o(v.target.value),className:"w-full text-sm text-gray-700 bg-white rounded-md p-2 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y",rows:2,disabled:n.isPending}),a.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[a.jsx("button",{onClick:()=>s(null),disabled:n.isPending,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Annulla",children:a.jsx(De,{size:14})}),a.jsx("button",{onClick:()=>f(g),disabled:n.isPending,className:"p-1.5 text-green-600 hover:text-green-700 rounded-md hover:bg-green-50 transition-colors",title:"Salva",children:a.jsx(Ze,{size:14})})]})]})]},g)})]})]})};function M5(e){const t=Date.now(),n=new Date(e).getTime(),r=t-n,s=Math.floor(r/6e4);if(s<1)return"ora";if(s<60)return`${s}min fa`;const i=Math.floor(s/60);return i<24?`${i}h fa`:`${Math.floor(i/24)}g fa`}function L5(e){return new Intl.DateTimeFormat("it-IT",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}function D5(e){return new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR",minimumFractionDigits:2,maximumFractionDigits:2}).format(e/100)}function z5(e){return e==="CONFIRMED"?"CONFERMATO":e==="PENDING_CONFIRMATION"?"ATTESA CONFERMA":"CANCELLATO"}function I5(e){return e==="CONFIRMED"?"bg-emerald-100 text-emerald-700":e==="PENDING_CONFIRMATION"?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"}const F5=({agent:e})=>{var _,H;const t=Xv(e.uuid),n=h5(e.uuid),r=e.definition,[s,i]=b.useState(!1),[o,l]=b.useState(""),[u,c]=b.useState(null),[f,d]=b.useState({name:"",description:"",onSelect:"",onEstimate:""}),[m,g]=b.useState(!1),[y,v]=b.useState(!1),[N,x]=b.useState([]),[h,p]=b.useState(!1),[w,C]=b.useState([]),[E,A]=b.useState(null),[O,L]=b.useState([]),D=()=>{n.mutate(void 0,{onSuccess:M=>A(M),onError:()=>me.error("Errore nella sincronizzazione con Treatwell")})},Z=()=>{i(!0),l(r.knowledgeBase)},Y=()=>{t.mutate({knowledgeBase:o.trim()},{onSuccess:()=>i(!1),onError:()=>me.error("Errore nel salvataggio")})},z=M=>{c(M.serviceId),d({name:M.name,description:M.description,onSelect:M.onSelect??"",onEstimate:M.onEstimate??""})},K=M=>{const I=r.serviceCatalog.map(B=>B.serviceId===M.serviceId?{...B,name:f.name,description:f.description,onSelect:f.onSelect||void 0,onEstimate:f.onEstimate||void 0}:B);t.mutate({serviceCatalog:I},{onSuccess:()=>c(null),onError:()=>me.error("Errore nel salvataggio")})},Q=M=>{const I=r.serviceCatalog.map(B=>B.serviceId===M.serviceId?{...B,highlighted:!B.highlighted}:B);t.mutate({serviceCatalog:I})},ae=M=>{const I=r.serviceCatalog.map(B=>B.serviceId===M.serviceId?{...B,disabled:B.disabled===!0?void 0:!0}:B);t.mutate({serviceCatalog:I})},$=()=>{t.mutate({enabled:!e.enabled})};return a.jsxs("section",{children:[a.jsx("h2",{className:"text-lg font-semibold text-midnight-blue mb-3",children:"Configurazione"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsxs("button",{onClick:()=>g(!0),className:"flex items-center gap-2 px-4 py-2.5 bg-gradient-to-r from-indigo-500 to-purple-500 text-white rounded-lg hover:from-indigo-600 hover:to-purple-600 text-sm font-medium shadow-sm transition-all",children:[a.jsx(by,{size:18}),"Fai una conversazione di prova"]}),a.jsxs("button",{onClick:D,disabled:n.isPending,className:"flex items-center gap-2 px-4 py-2.5 bg-white border border-gray-300 text-midnight-blue rounded-lg hover:bg-gray-50 text-sm font-medium shadow-sm transition-all disabled:opacity-50",children:[a.jsx(am,{size:18,className:n.isPending?"animate-spin":""}),n.isPending?"Sincronizzazione...":"Sincronizza con Treatwell"]})]}),a.jsx(B5,{activeHours:r.activeHours,enabled:e.enabled,isPending:t.isPending,initialResponseDelaySeconds:r.initialResponseDelaySeconds,operatorHandoffCooldownSeconds:r.operatorHandoffCooldownSeconds,onSave:M=>t.mutate({activeHours:M}),onToggleEnabled:$,onSaveDelays:M=>t.mutate(M)}),a.jsx(_5,{faq:r.faq??[],agentUuid:e.uuid}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h3",{className:"text-sm font-medium text-midnight-blue",children:"Descrizione attività "}),s?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>i(!1),disabled:t.isPending,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Annulla",children:a.jsx(De,{size:14})}),a.jsx("button",{onClick:Y,disabled:t.isPending,className:"p-1.5 text-green-600 hover:text-green-700 rounded-md hover:bg-green-50 transition-colors",title:"Salva",children:a.jsx(Ze,{size:14})})]}):a.jsx("button",{onClick:Z,className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Modifica",children:a.jsx(Mt,{size:14})})]}),s?a.jsx("textarea",{value:o,onChange:M=>l(M.target.value),className:"w-full text-sm text-gray-700 bg-gray-50 rounded-md p-3 font-sans border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y min-h-[120px]",rows:6,disabled:t.isPending}):a.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-700 bg-gray-50 rounded-md p-3 font-sans",children:r.knowledgeBase})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h3",{className:"text-sm font-medium text-midnight-blue",children:"Regole Generali"}),y?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>v(!1),disabled:t.isPending,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Annulla",children:a.jsx(De,{size:14})}),a.jsx("button",{onClick:()=>{const M=N.filter(I=>I.trim());t.mutate({rules:M},{onSuccess:I=>{L(I.rejectedRules),v(!1),I.rejectedRules.length>0&&me.error(`${I.rejectedRules.length} regola/e rifiutata/e dalla revisione automatica`)},onError:()=>me.error("Errore nel salvataggio")})},disabled:t.isPending,className:"p-1.5 text-green-600 hover:text-green-700 rounded-md hover:bg-green-50 transition-colors disabled:opacity-60",title:"Salva",children:t.isPending?a.jsx(pe,{size:14,className:"animate-spin"}):a.jsx(Ze,{size:14})})]}):a.jsx("button",{onClick:()=>{v(!0),x([...r.rules??[],""])},className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Modifica",children:a.jsx(Mt,{size:14})})]}),a.jsx("p",{className:"text-xs text-misty-blue mb-3",children:"Regole sempre valide per l'agente. Per regole specifiche a un servizio, usa il campo dedicato nel catalogo."}),O.length>0&&a.jsxs("div",{className:"mb-3 bg-amber-50 border border-amber-200 rounded-md p-3 space-y-2",children:[a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx(eu,{size:16,className:"text-amber-600 mt-0.5 shrink-0"}),a.jsx("h4",{className:"text-sm font-medium text-amber-900",children:"Regole rifiutate dalla revisione automatica"})]}),a.jsx("button",{onClick:()=>L([]),className:"p-1 text-amber-700 hover:text-amber-900 rounded-md hover:bg-amber-100 transition-colors shrink-0",title:"Chiudi",children:a.jsx(De,{size:14})})]}),a.jsx("div",{className:"space-y-2",children:O.map((M,I)=>a.jsxs("div",{className:"bg-white border border-amber-200 rounded-md p-2.5 text-xs space-y-1.5",children:[a.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:a.jsx("span",{className:"inline-block px-2 py-0.5 bg-amber-100 text-amber-800 rounded text-[10px] font-medium uppercase tracking-wide",children:$5(M.violationType)})}),a.jsxs("div",{className:"text-gray-700",children:[a.jsx("span",{className:"font-medium",children:"Regola:"})," â",M.originalText,"â"]}),a.jsxs("div",{className:"text-gray-700",children:[a.jsx("span",{className:"font-medium",children:"Motivo:"})," ",M.explanation]}),a.jsxs("div",{className:"text-gray-700",children:[a.jsx("span",{className:"font-medium",children:"Suggerimento:"})," ",M.suggestedFix]})]},I))})]}),y?a.jsxs("div",{className:"space-y-2",children:[N.map((M,I)=>a.jsxs("div",{className:"flex gap-2 items-start",children:[a.jsxs("span",{className:"text-xs text-misty-blue mt-2 min-w-[20px] text-right",children:[I+1,"."]}
592),a.jsx("textarea",{value:M,onChange:B=>x(oe=>oe.map((ue,Be)=>Be===I?B.target.value:ue)),className:"flex-1 text-sm text-gray-700 bg-gray-50 rounded-md px-2 py-1.5 font-sans border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y",rows:2,disabled:t.isPending,placeholder:"Scrivi una regola..."}),a.jsx("button",{onClick:()=>x(B=>B.filter((oe,ue)=>ue!==I)),className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors mt-0.5",title:"Rimuovi regola",children:a.jsx(De,{size:14})})]},I)),a.jsx("button",{onClick:()=>x(M=>[...M,""]),className:"text-xs text-midnight-blue hover:text-midnight-blue/80 font-medium px-2 py-1.5 rounded-md hover:bg-gray-50 transition-colors",children:"+ Aggiungi regola"})]}):(_=r.rules)!=null&&_.length?a.jsx("div",{className:"space-y-2",children:r.rules.map((M,I)=>a.jsxs("div",{className:"flex gap-2 items-start text-sm text-gray-700 bg-gray-50 rounded-md px-3 py-2 border border-gray-100",children:[a.jsxs("span",{className:"text-misty-blue font-medium",children:[I+1,"."]}),a.jsx("span",{children:M})]},I))}):a.jsx("p",{className:"text-sm text-misty-blue italic",children:"Nessuna regola configurata"})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h3",{className:"text-sm font-medium text-midnight-blue",children:"Regole Consulenza Foto"}),h?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>p(!1),disabled:t.isPending,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Annulla",children:a.jsx(De,{size:14})}),a.jsx("button",{onClick:()=>{const M=w.filter(I=>I.trim());t.mutate({photoRules:M},{onSuccess:()=>p(!1),onError:()=>me.error("Errore nel salvataggio")})},disabled:t.isPending,className:"p-1.5 text-green-600 hover:text-green-700 rounded-md hover:bg-green-50 transition-colors disabled:opacity-60",title:"Salva",children:t.isPending?a.jsx(pe,{size:14,className:"animate-spin"}):a.jsx(Ze,{size:14})})]}):a.jsx("button",{onClick:()=>{p(!0),C([...r.photoRules??[],""])},className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Modifica",children:a.jsx(Mt,{size:14})})]}),a.jsx("p",{className:"text-xs text-misty-blue mb-3",children:"Indicazioni usate dall'agente quando il cliente invia una foto per una consulenza."}),h?a.jsxs("div",{className:"space-y-2",children:[w.map((M,I)=>a.jsxs("div",{className:"flex gap-2 items-start",children:[a.jsxs("span",{className:"text-xs text-misty-blue mt-2 min-w-[20px] text-right",children:[I+1,"."]}),a.jsx("textarea",{value:M,onChange:B=>C(oe=>oe.map((ue,Be)=>Be===I?B.target.value:ue)),className:"flex-1 text-sm text-gray-700 bg-gray-50 rounded-md px-2 py-1.5 font-sans border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y",rows:2,disabled:t.isPending,placeholder:"Scrivi una regola per le foto..."}),a.jsx("button",{onClick:()=>C(B=>B.filter((oe,ue)=>ue!==I)),className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors mt-0.5",title:"Rimuovi regola",children:a.jsx(De,{size:14})})]},I)),a.jsx("button",{onClick:()=>C(M=>[...M,""]),className:"text-xs text-midnight-blue hover:text-midnight-blue/80 font-medium px-2 py-1.5 rounded-md hover:bg-gray-50 transition-colors",children:"+ Aggiungi regola"})]}):(H=r.photoRules)!=null&&H.length?a.jsx("div",{className:"space-y-2",children:r.photoRules.map((M,I)=>a.jsxs("div",{className:"flex gap-2 items-start text-sm text-gray-700 bg-gray-50 rounded-md px-3 py-2 border border-gray-100",children:[a.jsxs("span",{className:"text-misty-blue font-medium",children:[I+1,"."]}),a.jsx("span",{children:M})]},I))}):a.jsx("p",{className:"text-sm text-misty-blue italic",children:"Nessuna regola configurata"})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("h3",{className:"text-sm font-medium text-midnight-blue mb-3",children:["Catalogo servizi",a.jsxs("span",{className:"ml-2 text-xs font-normal text-misty-blue",children:["(",r.serviceCatalog.length,")"]})]}),a.jsx("div",{className:"divide-y divide-gray-100",children:r.serviceCatalog.map(M=>{const I=u===M.serviceId,B=M.disabled===!0;return a.jsx("div",{className:`py-3 first:pt-0 last:pb-0 group ${B?"bg-gray-50/80 -mx-4 px-4 opacity-70":""}`,children:a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsx("div",{className:"min-w-0 flex-1",children:I?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium text-misty-blue mb-1",children:"Nome"}),a.jsx("input",{type:"text",value:f.name,onChange:oe=>d(ue=>({...ue,name:oe.target.value})),className:"w-full text-sm font-medium text-midnight-blue bg-gray-50 rounded-md px-2 py-1 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium text-misty-blue mb-1",children:"Descrizione del servizio"}),a.jsx("textarea",{value:f.description,onChange:oe=>d(ue=>({...ue,description:oe.target.value})),className:"w-full text-sm text-gray-600 bg-gray-50 rounded-md px-2 py-1 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y",rows:2})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium text-misty-blue mb-1",children:"Istruzioni per l'agente"}),a.jsx("p",{className:"text-[10px] text-gray-400 mb-1",children:"Indicazioni su come proporre il servizio: domande da fare, upsell, restrizioni, note sul prezzo"}),a.jsx("textarea",{value:f.onSelect,onChange:oe=>d(ue=>({...ue,onSelect:oe.target.value})),className:"w-full text-sm text-gray-600 bg-gray-50 rounded-md px-2 py-1 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y",rows:2,placeholder:"Es. Chiedi se vuole aggiungere barba o peeling cutaneo"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium text-misty-blue mb-1",children:"Prima di confermare"}),a.jsx("p",{className:"text-[10px] text-gray-400 mb-1",children:"Istruzioni che l'agente segue dopo la verifica delle disponibilità , prima che il cliente confermi"}),a.jsx("textarea",{value:f.onEstimate,onChange:oe=>d(ue=>({...ue,onEstimate:oe.target.value})),className:"w-full text-sm text-gray-600 bg-gray-50 rounded-md px-2 py-1 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 resize-y",rows:2,placeholder:"Es. Il costo include colore (42EUR) + piega (28EUR). Proponi trattamento o maschera."})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:`text-sm font-medium ${B?"text-gray-500 line-through decoration-gray-400":"text-midnight-blue"}`,children:M.name}),M.highlighted&&a.jsx(fp,{size:12,className:B?"text-gray-400 fill-gray-400":"text-yellow-500 fill-yellow-500"}),B&&a.jsx("span",{className:"text-[10px] font-medium text-gray-500 bg-gray-200 rounded px-1.5 py-0.5",children:"Disabilitato"})]}),a.jsxs("div",{className:`flex items-center gap-2 mt-0.5 text-[11px] ${B?"text-gray-400":"text-misty-blue"}`,children:[M.priceInCents>0&&a.jsxs("span",{children:[(M.priceInCents/100).toFixed(2).replace(".",","),"â¬"]}),M.durationMinutes>0&&a.jsxs("span",{children:[M.durationMinutes," min"]}),M.employeeNames.length>0&&a.jsx("span",{children:M.employeeNames.join(", ")})]}),M.description&&a.jsx("p",{className:`text-xs mt-0.5 line-clamp-2 ${B?"text-gray-400":"text-misty-blue"}`,children:M.description}),M.onSelect&&a.jsxs("div",{className:"mt-1.5 text-[11px] text-blue-700 bg-blue-50 border border-blue-100 rounded-md px-2 py-1.5",children:[a.jsx("span",{className:"font-medium",children:"Istruzioni agente:"})," ",M.onSelect]}),M.onEstimate&&a.jsxs("div",{className:"mt-1.5 text-[11px] text-amber-700 bg-amber-50 border border-amber-100 rounded-md px-2 py-1.5",children:[a.jsx("span",{className:"font-medium",children:"Prima di confermare:"})," ",M.onEstimate]})]})}),a.jsx("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:I?a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>c(null),disabled:t.isPending,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",children:a.jsx(De,{size:14})}),a.jsx("button",{onClick:()=>K(M),disabled:t.isPending,className:"p-1.5 text-green-600 hover:text-green-700 rounded-md hover:bg-green-50 transition-colors",children:a.jsx(Ze,{size:14})})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>Q(M),className:"p-1.5 text-misty-blue hover:text-yellow-500 rounded-md hover:bg-gray-100 transition-colors",title:M.highlighted?"Rimuovi evidenza":"Evidenzia",children:M.highlighted?a.jsx(Mj,{size:14}):a.jsx(fp,{size:14})}),a.jsx("button",{onClick:()=>ae(M),disabled:t.isPending,className:`p-1.5 rounded-md hover:bg-gray-100 transition-colors disabled:opacity-50 ${B?"text-green-600 hover:text-green-700":"text-misty-blue hover:text-red-500"}`,title:B?"Riabilita servizio":"Disabilita servizio",children:B?a.jsx(Ze,{size:14}):a.jsx(Ej,{size:14})}),a.jsx("button",{onClick:()=>z(M),className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Modifica",children:a.jsx(Mt,{size:14})})]})})]})},M.serviceId)})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsx("h3",{className:"text-sm font-medium text-midnight-blue mb-1",children:"Orari di apertura salone"}),a.jsx("p",{className:"text-xs text-misty-blue mb-3",children:"Usati per dare informazioni ai clienti."}),a.jsx("div",{className:"flex flex-wrap gap-2",children:[1,2,3,4,5,6,0].map(M=>{const I=["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],B=r.openingHours.find(ue=>ue.dayOfWeek===M),oe=(B==null?void 0:B.open)??!1;return a.jsxs("div",{className:`flex flex-col items-center rounded-lg px-3 py-2 min-w-[72px] border ${oe?"bg-green-50 border-green-200":"bg-gray-50 border-gray-200"}`,children:[a.jsx("span",{className:`text-xs font-semibold ${oe?"text-green-700":"text-gray-400"}`,children:I[M]}),oe&&(B!=null&&B.from)&&(B!=null&&B.to)?a.jsxs("span",{className:"text-[11px] text-green-600 mt-0.5 flex items-center gap-1",children:[a.jsx(tu,{size:10}),B.from,"-",B.to]}):a.jsx("span",{className:"text-[11px] text-gray-400 mt-0.5",children:"Chiuso"})]},M)})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("h3",{className:"text-sm font-medium text-midnight-blue mb-3",children:["Team",a.jsxs("span",{className:"ml-2 text-xs font-normal text-misty-blue",children:["(",r.employees.length,")"]})]}),a.jsx("div",{className:"flex flex-wrap gap-2",children:r.employees.map(M=>a.jsxs("div",{className:"flex items-center gap-2 bg-gray-50 rounded-lg px-3 py-2 border border-gray-200",children:[a.jsx("span",{className:"text-sm font-medium text-midnight-blue",children:M.name}),M.title&&a.jsxs("span",{className:"text-xs text-misty-blue",children:["(",M.title,")"]})]},M.employeeId))})]})]}),m&&a.jsx(V5,{agent:e,onClose:()=>g(!1)}),E&&a.jsx(U5,{recap:E,onClose:()=>A(null)})]})},U5=({recap:e,onClose:t})=>{const n=e.services.added.length>0||e.services.removed.length>0||e.services.updated.length>0||e.services.ignored.length>0||e.employees.added.length>0||e.employees.removed.length>0||e.openingHours.changed;return a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",onClick:t,children:a.jsxs("div",{className:"bg-white rounded-xl shadow-xl max-w-lg w-full max-h-[80vh] overflow-y-auto",onClick:r=>r.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-gray-200",children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Sincronizzazione completata"}),a.jsx("button",{onClick:t,className:"p-1 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100",children:a.jsx(De,{size:18})})]}),a.jsxs("div",{className:"px-5 py-4 space-y-4",children:[a.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3",children:a.jsx("p",{className:"text-sm text-amber-800",children:"Le conversazioni in corso potrebbero mostrare informazioni non aggiornate fino al prossimo messaggio del cliente."})}),!n&&a.jsx("p",{className:"text-sm text-misty-blue text-center py-4",children:"Nessuna modifica rilevata. Tutto aggiornato."}),e.services.added.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-green-700 mb-1",children:"Nuovi servizi"}),a.jsx("ul",{className:"space-y-1",children:e.services.added.map(r=>a.jsxs("li",{className:"flex items-center gap-2 text-sm text-gray-700 bg-green-50 rounded-md px-3 py-1.5",children:[a.jsx(An,{size:14,className:"text-green-600 flex-shrink-0"}),r.name]},r.serviceId))})]}),e.services.removed.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-red-700 mb-1",children:"Servizi rimossi"}),a.jsx("ul",{className:"space-y-1",children:e.services.removed.map(r=>a.jsxs("li",{className:"flex items-center gap-2 text-sm text-gray-700 bg-red-50 rounded-md px-3 py-1.5",children:[a.jsx(Ge,{size:14,className:"text-red-500 flex-shrink-0"}),r.name]},r.serviceId))})]}),e.services.updated.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-amber-700 mb-1",children:"Servizi aggiornati"}),a.jsx("ul",{className:"space-y-1",children:e.services.updated.map(r=>a.jsxs("li",{className:"flex items-center gap-2 text-sm text-gray-700 bg-amber-50 rounded-md px-3 py-1.5",children:[a.jsx(Mt,{size:14,className:"text-amber-600 flex-shrink-0"}),r.name," ",a.jsxs("span",{className:"text-xs text-misty-blue",children:["(",r.changes.join(", "),")"]})]},r.serviceId))})]}),e.services.ignored.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-1",children:"Nome diverso su Treatwell"}),a.jsx("ul",{className:"space-y-1",children:e.services.ignored.map(r=>a.jsxs("li",{className:"flex items-start gap-2 text-sm text-gray-600 bg-gray-50 rounded-md px-3 py-1.5",children:[a.jsx(eu,{size:14,className:"text-gray-400 flex-shrink-0 mt-0.5"}),a.jsxs("span",{children:[a.jsx("strong",{children:r.localName})," ",a.jsxs("span",{className:"text-xs text-misty-blue",children:["â Treatwell: ",r.remoteName]})]})]},r.serviceId))})]}),(e.employees.added.length>0||e.employees.removed.length>0)&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-midnight-blue mb-1",children:"Team"}),a.jsxs("ul",{className:"space-y-1",children:[e.employees.added.map(r=>a.jsxs("li",{className:"flex items-center gap-2 text-sm text-gray-700 bg-green-50 rounded-md px-3 py-1.5",children:[a.jsx(An,{size:14,className:"text-green-600 flex-shrink-0"}),r.name]},r.employeeId)),e.employees.removed.map(r=>a.jsxs("li",{className:"flex items-center gap-2 text-sm text-gray-700 bg-red-50 rounded-md px-3 py-1.5",children:[a.jsx(Ge,{size:14,className:"text-red-500 flex-shrink-0"}),r.name]},r.employeeId))]})]}),e.openingHours.changed&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-700 bg-blue-50 rounded-md px-3 py-2",children:[a.jsx(tu,{size:14,className:"flex-shrink-0"}),"Orari di apertura aggiornati"]})]}),a.jsx("div",{className:"px-5 py-3 border-t border-gray-200 flex justify-end",children:a.jsx("button",{onClick:t,className:"px-4 py-2 bg-midnight-blue text-white rounded-md hover:bg-midnight-blue/90 text-sm font-medium",children:"Chiudi"})})]})})},fg={0:"Dom",1:"Lun",2:"Mar",3:"Mer",4:"Gio",5:"Ven",6:"Sab"},Co=[1,2,3,4,5,6,0],$5=e=>{switch(e){case"CONTRADICTS_CATALOG":return"Contraddice il catalogo";case"UNAVAILABLE_CAPABILITY":return"Non fattibile dall'agente";case"CONTRADICTS_RULE":return"In conflitto con un'altra regola"}},B5=({activeHours:e,enabled:t,isPending:n,initialResponseDelaySeconds:r,operatorHandoffCooldownSeconds:s,onSave:i,onToggleEnabled:o,onSaveDelays:l})=>{const[u,c]=b.useState(!1),[f,d]=b.useState(e),[m,g]=b.useState(!1),[y,v]=b.useState(""),[N,x]=b.useState(""),h=()=>{d(e.length>0?e:[{startTime:[0,0],endTime:[23,59],days:[1,2,3,4,5,6,0]}]),c(!0)},p=()=>{i(f.fil
592ter(z=>z.days.length>0)),c(!1)},w=(z,K)=>{d(Q=>Q.map((ae,$)=>$===z?{...ae,...K}:ae))},C=(z,K)=>{d(Q=>Q.map((ae,$)=>{if($!==z)return ae;const _=ae.days.includes(K)?ae.days.filter(H=>H!==K):[...ae.days,K];return{...ae,days:_}}))},E=()=>{d(z=>[...z,{startTime:[9,0],endTime:[18,0],days:[1,2,3,4,5]}])},A=z=>{d(K=>K.filter((Q,ae)=>ae!==z))},O=(z,K)=>`${String(z).padStart(2,"0")}:${String(K).padStart(2,"0")}`,L=z=>Co.filter(K=>z.includes(K)),D=z=>{if(z.length===7)return"Tutti i giorni";const K=L(z);return K.length===5&&[1,2,3,4,5].every(Q=>z.includes(Q))?"Lun-Ven":K.length===2&&[6,0].every(Q=>z.includes(Q))?"Sab-Dom":K.map(Q=>fg[Q]).join(", ")},Z=z=>[...z].sort((K,Q)=>{const ae=L(K.days)[0]??0,$=L(Q.days)[0]??0;return Co.indexOf(ae)-Co.indexOf($)}),Y=({h:z,m:K,onChangeH:Q,onChangeM:ae})=>a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("select",{value:z,onChange:$=>Q(Number($.target.value)),disabled:n,className:"text-sm border border-gray-200 rounded-md px-2 py-1 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20",children:Array.from({length:24},($,_)=>a.jsx("option",{value:_,children:String(_).padStart(2,"0")},_))}),a.jsx("span",{className:"text-sm text-gray-400",children:":"}),a.jsx("select",{value:K,onChange:$=>ae(Number($.target.value)),disabled:n,className:"text-sm border border-gray-200 rounded-md px-2 py-1 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20",children:Array.from({length:60},($,_)=>a.jsx("option",{value:_,children:String(_).padStart(2,"0")},_))})]});return a.jsxs("div",{className:`bg-white rounded-lg border p-4 ${t?"border-gray-200":"border-red-200"}`,children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h3",{className:"text-sm font-medium text-midnight-blue",children:"Abilita Assistent AI"}),a.jsx("button",{onClick:o,disabled:n,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${t?"bg-green-500":"bg-gray-300"}`,children:a.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${t?"translate-x-6":"translate-x-1"}`})})]}),!t&&a.jsx("p",{className:"text-xs text-red-600 mb-3",children:"L'agente è disattivato e non risponderà ai messaggi."}),a.jsxs("div",{className:t?"":"opacity-50 pointer-events-none",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-xs font-medium text-misty-blue uppercase tracking-wide",children:"Orari di attività "}),u?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>c(!1),disabled:n,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Annulla",children:a.jsx(De,{size:14})}),a.jsx("button",{onClick:p,disabled:n,className:"p-1.5 text-green-600 hover:text-green-700 rounded-md hover:bg-green-50 transition-colors",title:"Salva",children:a.jsx(Ze,{size:14})})]}):a.jsx("button",{onClick:h,className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Modifica",children:a.jsx(Mt,{size:14})})]}),u?a.jsxs("div",{className:"space-y-3",children:[f.map((z,K)=>a.jsxs("div",{className:"border border-gray-100 rounded-md p-3 space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-misty-blue block mb-1",children:"Dalle"}),a.jsx(Y,{h:z.startTime[0],m:z.startTime[1],onChangeH:Q=>w(K,{startTime:[Q,z.startTime[1]]}),onChangeM:Q=>w(K,{startTime:[z.startTime[0],Q]})})]}),a.jsx("span",{className:"text-gray-400 mt-4",children:"â"}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-misty-blue block mb-1",children:"Alle"}),a.jsx(Y,{h:z.endTime[0],m:z.endTime[1],onChangeH:Q=>w(K,{endTime:[Q,z.endTime[1]]}),onChangeM:Q=>w(K,{endTime:[z.endTime[0],Q]})})]})]}),f.length>1&&a.jsx("button",{onClick:()=>A(K),disabled:n,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Rimuovi",children:a.jsx(Ge,{size:14})})]}),a.jsx("div",{className:"flex items-center gap-1",children:Co.map(Q=>a.jsx("button",{onClick:()=>C(K,Q),disabled:n,className:`text-xs px-2 py-1 rounded-md border transition-colors ${z.days.includes(Q)?"bg-midnight-blue text-white border-midnight-blue":"bg-white text-misty-blue border-gray-200 hover:border-midnight-blue/40"}`,children:fg[Q]},Q))})]},K)),a.jsxs("button",{onClick:E,disabled:n,className:"flex items-center gap-1 text-xs text-midnight-blue hover:text-midnight-blue/80 transition-colors",children:[a.jsx(An,{size:12}
592)," Aggiungi fascia oraria"]})]}):a.jsx("div",{className:"space-y-1.5",children:Z(e).map((z,K)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[a.jsx(tu,{size:14,className:"text-misty-blue flex-shrink-0"}),a.jsxs("span",{children:[D(z.days),": ",O(z.startTime[0],z.startTime[1])," â ",O(z.endTime[0],z.endTime[1])]})]},K))}),a.jsx("p",{className:"text-xs text-misty-blue mt-2",children:"L'agente risponde solo in questi orari."}),a.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-xs font-medium text-misty-blue uppercase tracking-wide",children:"Tempi di risposta"}),m?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{onClick:()=>g(!1),disabled:n,className:"p-1.5 text-misty-blue hover:text-red-500 rounded-md hover:bg-gray-100 transition-colors",title:"Annulla",children:a.jsx(De,{size:14})}),a.jsx("button",{onClick:()=>{const z={},K=parseInt(y),Q=parseInt(N);!isNaN(K)&&K>=0&&(z.initialResponseDelaySeconds=K),!isNaN(Q)&&Q>=0&&(z.operatorHandoffCooldownSeconds=Q),l(z),g(!1)},disabled:n,className:"p-1.5 text-green-600 hover:text-green-700 rounded-md hover:bg-green-50 transition-colors",title:"Salva",children:a.jsx(Ze,{size:14})})]}):a.jsx("button",{onClick:()=>{v((r==null?void 0:r.toString())??""),x((s==null?void 0:s.toString())??""),g(!0)},className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",title:"Modifica",children:a.jsx(Mt,{size:14})})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium text-misty-blue mb-0.5",children:"Attesa prima risposta"}),a.jsx("p",{className:"text-[10px] text-gray-400 mb-1",children:"Secondi di attesa prima di rispondere per la prima volta, per dare tempo agli operatori di intervenire."}),m?a.jsx("input",{type:"number",min:0,value:y,onChange:z=>v(z.target.value),className:"w-28 text-sm text-gray-700 bg-gray-50 rounded-md px-2 py-1 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20",disabled:n,placeholder:"es. 120"}):a.jsx("span",{className:"text-sm text-gray-700",children:r!==void 0?`${r} sec`:a.jsx("span",{className:"italic text-misty-blue",children:"Non impostato"})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium text-misty-blue mb-0.5",children:"Pausa se risponde un operatore"}),a.jsx("p",{className:"text-[10px] text-gray-400 mb-1",children:"Se un operatore risponde, l'assistente aspetta questi secondi prima di tornare a rispondere."}),m?a.jsx("input",{type:"number",min:0,value:N,onChange:z=>x(z.target.value),className:"w-28 text-sm text-gray-700 bg-gray-50 rounded-md px-2 py-1 border border-gray-200 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20",disabled:n,placeholder:"es. 300"}):a.jsx("span",{className:"text-sm text-gray-700",children:s!==void 0?`${s} sec`:a.jsx("span",{className:"italic text-misty-blue",children:"Non impostato"})})]})]})]})]})]})},V5=({agent:e,onClose:t})=>{const[n]=b.useState(()=>`+555${Math.floor(1e6+Math.random()*9e6)}`),[r,s]=b.useState([]),[i,o]=b.useState(""),l=x5(e.uuid),u=b.useRef(null);b.useEffect(()=>{var d;(d=u.current)==null||d.scrollIntoView({behavior:"smooth"})},[r]);const c=()=>{const d=i.trim();d&&(s(m=>[...m,{role:"user",text:d}]),o(""),l.mutate({phone:n,text:d},{onSuccess:m=>{const g=m.responses.map(y=>({role:"assistant",text:y}));s(y=>[...y,...g])},onError:()=>{me.error("Errore nella risposta dell'agente")}}))},f=d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),c())};return a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:a.jsxs("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-lg flex flex-col",style:{maxHeight:"80vh"},children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-midnight-blue",children:"Conversazione di prova"}),a.jsx("p",{className:"text-xs text-misty-blue",children:n})]}),a.jsx("button",{onClick:t,className:"p-1.5 text-misty-blue hover:text-midnight-blue rounded-md hover:bg-gray-100 transition-colors",children:a.jsx(De,{size:18})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-2 min-h-[300px]",children:[r.length===0&&a.jsx("p",{className:"text-sm text-misty-blue text-center py-8",children:"Scrivi un messaggio per testare l'agente"}),r.map((d,m)=>a.jsx("div",{className:`flex ${d.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[75%] rounded-lg px-3 py-2 text-sm ${d.role==="user"?"bg-midnight-blue text-white":"bg-gray-100 text-gray-800"}`,children:a.jsx("p",{className:"whitespace-pre-wrap",children:d.text})})},m)),l.isPending&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-gray-100 rounded-lg px-3 py-2",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})}),a.jsx("div",{ref:u})]}),a.jsx("div",{className:"border-t border-gray-200 p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"text",value:i,onChange:d=>o(d.target.value),onKeyDown:f,disabled:l.isPending,placeholder:l.isPending?"In attesa di risposta...":"Scrivi un messaggio...",className:"flex-1 text-sm border border-gray-200 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-midnight-blue/20 disabled:bg-gray-50 disabled:text-gray-400"}),a.jsx("button",{onClick:c,disabled:l.isPending||!i.trim(),className:"p-2 bg-midnight-blue text-white rounded-md hover:bg-midnight-blue/90 disabled:opacity-50 transition-colors",children:a.jsx(Rj,{size:16})})]})})]})})}
592,q5=({value:e,onChange:t,error:n,onSubmit:r})=>{const[s,i]=b.useState(!1),o=b.useRef(null),l=f=>{let d=f;return d.startsWith("+39")||(d="+39"+d),"+39 "+d.slice(3).replace(/\D/g,"")},u=f=>{const d=l(f.target.value);t(d)},c=f=>{f.key==="Enter"&&r&&(f.preventDefault(),r())};return b.useEffect(()=>{if(s&&o.current){const f=o.current.value.length;o.current.setSelectionRange(f,f)}},[s,e]),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"relative",children:a.jsx("input",{ref:o,type:"tel",value:e,onChange:u,onKeyDown:c,onFocus:()=>i(!0),onBlur:()=>i(!1),placeholder:"+39 02 1234567",className:`w-full px-4 py-2 bg-white border rounded-lg outline-none transition-all duration-200 ${n?"border-red-300 focus:border-red-500 focus:ring-red-200":"border-gray-300 focus:border-yellow-500 focus:ring-yellow-200"} focus:ring-4`})}),n&&a.jsx("p",{className:"text-sm text-red-600",children:n})]})},H5=({value:e,onChange:t,error:n,onSubmit:r})=>{const s=o=>{const l=o.target.value.replace(/\D/g,"");l.length<=6&&t(l)},i=o=>{o.key==="Enter"&&r&&(o.preventDefault(),r())};return a.jsxs("div",{className:"space-y-2",children:[a.jsx("input",{type:"text",inputMode:"numeric",maxLength:6,value:e,onChange:s,onKeyDown:i,placeholder:"Inserisci il codice a 6 cifre",className:`w-full h-12 text-center text-xl font-semibold border rounded-lg outline-none transition-all duration-200 ${n?"border-red-300 focus:border-red-500 focus:ring-red-200":"border-gray-300 focus:border-yellow-500 focus:ring-yellow-200"} focus:ring-4`}),n&&a.jsx("p",{className:"text-sm text-red-600 text-center",children:n})]})},W5=({isOpen:e,options:t,isSubmitting:n=!1,onSelect:r,onClose:s})=>(b.useEffect(()=>{const i=o=>{o.key==="Escape"&&!n&&s()};return e&&(document.addEventListener("keydown",i),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",i),document.body.style.overflow="unset"}},[e,n,s]),e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:n?void 0:s}),a.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full mx-4 animate-in fade-in zoom-in duration-200",children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-100",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"bg-yellow-400 rounded-full p-2",children:a.jsx(_r,{size:20,className:"text-midnight-blue"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Come vuoi ricevere il codice?"}),a.jsx("p",{className:"text-sm text-misty-blue",children:"Scegli un metodo per ricevere il codice di verifica"})]})]}),a.jsx("button",{onClick:s,disabled:n,className:"p-2 rounded-lg hover:bg-gray-100 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(De,{size:20,className:"text-misty-blue"})})]}),a.jsx("div",{className:"p-6 space-y-3",children:t.length===0?a.jsx("p",{className:"text-sm text-misty-blue text-center py-4",children:"Al momento non è disponibile un metodo per inviare il codice di verifica."}):t.map(i=>a.jsxs("button",{onClick:()=>r(i),disabled:n,className:"w-full flex items-center gap-3 px-4 py-3 bg-off-white border border-gray-200 rounded-lg hover:border-yellow-500 hover:bg-yellow-50 transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx("div",{className:"flex-shrink-0 bg-white rounded-full p-2 border border-gray-200",children:i.method==="CALL"?a.jsx(_r,{size:18,className:"text-midnight-blue"}):a.jsx(Py,{size:18,className:"text-midnight-blue"})}),a.jsxs("div",{className:"flex-grow",children:[a.jsx("p",{className:"text-sm font-medium text-midnight-blue",children:i.label}),a.jsx("p",{className:"text-xs text-misty-blue",children:i.method==="CALL"?"Riceverai una chiamata":"Riceverai un SMS"})]})]},i.optionId))}),a.jsx("div",{className:"flex justify-end gap-3 p-6 pt-0",children:a.jsx("button",{onClick:s,disabled:n,className:"btn btn-secondary px-6 disabled:opacity-50 disabled:cursor-not-allowed",children:"Annulla"})})]})]}):null);var Jv={exports:{}},Q5="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",K5=Q5,G5=K5;function Zv(){}function e1(){}e1.resetWarningCache=Zv;var Y5=function(){function e(r,s,i,o,l,u){if(u!==G5){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
592:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:e1,resetWarningCache:Zv};return n.PropTypes=n,n};Jv.exports=Y5();var X5=Jv.exports;const bt=Tl(X5);var J5=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function ef(){return ef=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},ef.apply(this,arguments)}function Z5(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function ko(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,tf(e,t)}function tf(e,t){return tf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},tf(e,t)}var xu=function(e){eR(t,e);function t(){var r;return r=e.call(this)||this,r.handleExpired=r.handleExpired.bind(ko(r)),r.handleErrored=r.handleErrored.bind(ko(r)),r.handleChange=r.handleChange.bind(ko(r)),r.handleRecaptchaRef=r.handleRecaptchaRef.bind(ko(r)),r}var n=t.prototype;return n.getCaptchaFunction=function(s){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[s]:this.props.grecaptcha[s]:null},n.getValue=function(){var s=this.getCaptchaFunction("getResponse");return s&&this._widgetId!==void 0?s(this._widgetId):null},n.getWidgetId=function(){return this.props.grecaptcha&&this._widgetId!==void 0?this._widgetId:null},n.execute=function(){var s=this.getCaptchaFunction("execute");if(s&&this._widgetId!==void 0)return s(this._widgetId);this._executeRequested=!0},n.executeAsync=function(){var s=this;return new Promise(function(i,o){s.executionResolve=i,s.executionReject=o,s.execute()})},n.reset=function(){var s=this.getCaptchaFunction("reset");s&&this._widgetId!==void 0&&s(this._widgetId)},n.forceReset=function(){var s=this.getCaptchaFunction("reset");s&&s()},n.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},n.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},n.handleChange=function(s){this.props.onChange&&this.props.onChange(s),this.executionResolve&&(this.executionResolve(s),delete this.executionReject,delete this.executionResolve)},n.explicitRender=function(){var s=this.getCaptchaFunction("render");if(s&&this._widgetId===void 0){var i=document.createElement("div");this._widgetId=s(i,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(i)}this._executeRequested&&this.props.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute())},n.componentDidMount=function(){this.explicitRender()},n.componentDidUpdate=function(){this.explicitRender()},n.handleRecaptchaRef=function(s){this.captcha=s},n.render=function(){var s=this.props;s.sitekey,s.onChange,s.theme,s.type,s.tabindex,s.onExpired,s.onErrored,s.size,s.stoken,s.grecaptcha,s.badge,s.hl,s.isolated;var i=Z5(s,J5);return b.createElement("div",ef({},i,{ref:this.handleRecaptchaRef}))},t}(b.Component);xu.displayName="ReCAPTCHA";xu.propTypes={sitekey:bt.string.isRequired,onChange:bt.func,grecaptcha:bt.object,theme:bt.oneOf(["dark","light"]),type:bt.oneOf(["image","audio"]),tabindex:bt.number,onExpired:bt.func,onErrored:bt.func,size:bt.oneOf(["compact","normal","invisible"]),stoken:bt.string,hl:bt.string,badge:bt.oneOf(["bottomright","bottomleft","inline"]),isolated:bt.bool};xu.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var t1={exports:{}},we={};/** @license React v16.13.1 593 * react-is.production.min.js 594 * 595 * Copyright (c) Facebook, Inc. and its affiliates. 596 * 597 * This source code is licensed under the MIT license found in the 598 * LICENSE file in the root directory of this source tree. 599 */var Ye=typeof Symbol=="function"&&Symbol.for,Rm=Ye?Symbol.for("react.element"):60103,Am=Ye?Symbol.for("react.portal"):60106,yu=Ye?Symbol.for("react.fragment"):60107,vu=Ye?Symbol.for("react.strict_mode"):60108,bu=Ye?Symbol.for("react.profiler"):60114,
599wu=Ye?Symbol.for("react.provider"):60109,Nu=Ye?Symbol.for("react.context"):60110,Tm=Ye?Symbol.for("react.async_mode"):60111,ju=Ye?Symbol.for("react.concurrent_mode"):60111,Su=Ye?Symbol.for("react.forward_ref"):60112,Cu=Ye?Symbol.for("react.suspense"):60113,tR=Ye?Symbol.for("react.suspense_list"):60120,ku=Ye?Symbol.for("react.memo"):60115,Eu=Ye?Symbol.for("react.lazy"):60116,nR=Ye?Symbol.for("react.block"):60121,rR=Ye?Symbol.for("react.fundamental"):60117,sR=Ye?Symbol.for("react.responder"):60118,iR=Ye?Symbol.for("react.scope"):60119;function Ut(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Rm:switch(e=e.type,e){case Tm:case ju:case yu:case bu:case vu:case Cu:return e;default:switch(e=e&&e.$$typeof,e){case Nu:case Su:case Eu:case ku:case wu:return e;default:return t}}case Am:return t}}}function n1(e){return Ut(e)===ju}we.AsyncMode=Tm;we.ConcurrentMode=ju;we.ContextConsumer=Nu;we.ContextProvider=wu;we.Element=Rm;we.ForwardRef=Su;we.Fragment=yu;we.Lazy=Eu;we.Memo=ku;we.Portal=Am;we.Profiler=bu;we.StrictMode=vu;we.Suspense=Cu;we.isAsyncMode=function(e){return n1(e)||Ut(e)===Tm};we.isConcurrentMode=n1;we.isContextConsumer=function(e){return Ut(e)===Nu};we.isContextProvider=function(e){return Ut(e)===wu};we.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rm};we.isForwardRef=function(e){return Ut(e)===Su};we.isFragment=function(e){return Ut(e)===yu};we.isLazy=function(e){return Ut(e)===Eu};we.isMemo=function(e){return Ut(e)===ku};we.isPortal=function(e){return Ut(e)===Am};we.isProfiler=function(e){return Ut(e)===bu};we.isStrictMode=function(e){return Ut(e)===vu};we.isSuspense=function(e){return Ut(e)===Cu};we.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===yu||e===ju||e===bu||e===vu||e===Cu||e===tR||typeof e=="object"&&e!==null&&(e.$$typeof===Eu||e.$$typeof===ku||e.$$typeof===wu||e.$$typeof===Nu||e.$$typeof===Su||e.$$typeof===rR||e.$$typeof===sR||e.$$typeof===iR||e.$$typeof===nR)};we.typeOf=Ut;t1.exports=we;var aR=t1.exports,Om=aR,oR={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},lR={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},uR={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r1={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},_m={};_m[Om.ForwardRef]=uR;_m[Om.Memo]=r1;function mg(e){return Om.isMemo(e)?r1:_m[e.$$typeof]||oR}var cR=Object.defineProperty,dR=Object.getOwnPropertyNames,hg=Object.getOwnPropertySymbols,fR=Object.getOwnPropertyDescriptor,mR=Object.getPrototypeOf,pg=Object.prototype;function s1(e,t,n){if(typeof t!="string"){if(pg){var r=mR(t);r&&r!==pg&&s1(e,r,n)}var s=dR(t);hg&&(s=s.concat(hg(t)));for(var i=mg(e),o=mg(t),l=0;l<s.length;++l){var u=s[l];if(!lR[u]&&!(n&&n[u])&&!(o&&o[u])&&!(i&&i[u])){var c=fR(t,u);try{cR(e,u,c)}catch{}}}}return e}var hR=s1;const pR=Tl(hR);function nf(){return nf=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},nf.apply(this,arguments)}function gR(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function xR(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Zt={},yR=0;function vR(e,t){return t=t||{},function(r){var s=r.displayName||r.name||"Component",i=function(l){xR(u,l);function u(f,d){var m;return m=l.call(this,f,d)||this,m.state={},m.__scriptURL="",m}var c=u.prototype;return c.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+yR++),this.__scriptLoaderID},c.setupScriptURL=function(){return this.__scriptURL=typeof e=="function"?e():e,this.__scriptURL},c.asyncScriptLoaderHandleLoad=function(d){var m=this;this.setState(d,function(){return m.props.asyncScriptOnLoad&&m.props.asyncScriptOnLoad(m.state)})},c.asyncScriptLoaderTriggerOnScriptLoaded=function(){var d=Zt[this.__scriptURL];if(!d||!d.loaded)throw new Error("Script is not loaded.");for(var m in d.observers)d.observers[m](d);delete window[t.callbackName]},c.componentDidMount=function(){var d=this,m=this.setupScriptURL(),g=this.asyncScriptLoaderGetScriptLoaderID(),y=t,v=y.globalName,N=y.callbackName,x=y.scriptId;if(v&&typeof window[v]<"u"&&(Zt[m]={loaded:!0,observers:{}}),Zt[m]){var h=Zt[m];
599if(h&&(h.loaded||h.errored)){this.asyncScriptLoaderHandleLoad(h);return}h.observers[g]=function(A){return d.asyncScriptLoaderHandleLoad(A)};return}var p={};p[g]=function(A){return d.asyncScriptLoaderHandleLoad(A)},Zt[m]={loaded:!1,observers:p};var w=document.createElement("script");w.src=m,w.async=!0;for(var C in t.attributes)w.setAttribute(C,t.attributes[C]);x&&(w.id=x);var E=function(O){if(Zt[m]){var L=Zt[m],D=L.observers;for(var Z in D)O(D[Z])&&delete D[Z]}};N&&typeof window<"u"&&(window[N]=function(){return d.asyncScriptLoaderTriggerOnScriptLoaded()}),w.onload=function(){var A=Zt[m];A&&(A.loaded=!0,E(function(O){return N?!1:(O(A),!0)}))},w.onerror=function(){var A=Zt[m];A&&(A.errored=!0,E(function(O){return O(A),!0}))},document.body.appendChild(w)},c.componentWillUnmount=function(){var d=this.__scriptURL;if(t.removeOnUnmount===!0)for(var m=document.getElementsByTagName("script"),g=0;g<m.length;g+=1)m[g].src.indexOf(d)>-1&&m[g].parentNode&&m[g].parentNode.removeChild(m[g]);var y=Zt[d];y&&(delete y.observers[this.asyncScriptLoaderGetScriptLoaderID()],t.removeOnUnmount===!0&&delete Zt[d])},c.render=function(){var d=t.globalName,m=this.props;m.asyncScriptOnLoad;var g=m.forwardedRef,y=gR(m,["asyncScriptOnLoad","forwardedRef"]);return d&&typeof window<"u"&&(y[d]=typeof window[d]<"u"?window[d]:void 0),y.ref=g,b.createElement(r,y)},u}(b.Component),o=b.forwardRef(function(l,u){return b.createElement(i,nf({},l,{forwardedRef:u}))});return o.displayName="AsyncScriptLoader("+s+")",o.propTypes={asyncScriptOnLoad:bt.func},pR(o,r)}}var rf="onloadcallback",bR="grecaptcha";function sf(){return typeof window<"u"&&window.recaptchaOptions||{}}function wR(){var e=sf(),t=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+t+"/recaptcha/enterprise.js?onload="+rf+"&render=explicit":"https://"+t+"/recaptcha/api.js?onload="+rf+"&render=explicit"}const NR=vR(wR,{callbackName:rf,globalName:bR,attributes:sf().nonce?{nonce:sf().nonce}:{}})(xu),jR={publicSiteKey:"6LeKttcnAAAAALKTpWHPL86s8xB9APRLoqprlzlF",baseUrl:"https://web.segreteria.app"},i1=b.createContext(void 0),SR=({children:e})=>{const t=b.useRef(null),n=b.useCallback(async()=>{if(!t.current)throw new Error("ReCAPTCHA not initialized");try{const s=await t.current.executeAsync();return t.current.reset(),s}catch(s){return console.error("ReCAPTCHA execution failed:",s),null}},[]),r=b.useCallback(()=>{t.current&&t.current.reset()},[]);return a.jsxs(i1.Provider,{value:{executeRecaptcha:n,reset:r},children:[a.jsx(NR,{ref:t,size:"invisible",sitekey:jR.publicSiteKey}),e]})},CR=()=>{const e=b.useContext(i1);if(e===void 0)throw new Error("useRecaptchaContext must be used within a RecaptchaProvider");return e},kR=()=>CR();function ER(e){const t=e.trim().replace(/[\s().-]/g,"");return t.startsWith("0")||t.startsWith("+390")}const PR=()=>{const{executeRecaptcha:e}=kR(),[t,n]=b.useState(!1),[r,s]=b.useState(null),[i,o]=b.useState({isOpen:!1,options:[]}),l=b.useRef(null),u=b.useCallback(async m=>{const{oneTimeToken:g,...y}=m,v={};if(g)v["x-one-time-token"]=g;else{const N=await e();if(!N)throw new Error("ReCAPTCHA verification failed");v["x-recaptcha-token"]=N}await ne.post("/authentication/send-verification-code",y,{headers:v})},[e]),c=b.useCallback(async m=>{n(!0),s(null);try{if(ER(m)){const g=await e();if(!g)throw new Error("ReCAPTCHA verification failed");const{data:y}=await ne.post("/authentication/verification-options",{phoneNumber:m},{headers:{"x-recaptcha-token":g}});return l.current={phoneNumber:m,oneTimeToken:y.token},o({isOpen:!0,options:y.methods}),{sent:!1}}return await u({phoneNumber:m,method:"SMS"}),{sent:!0}}catch(g){throw s(g),g}finally{n(!1)}},[e,u]),f=b.useCallback(async m=>{const g=l.current;if(g){n(!0),s(null);try{await u({phoneNumber:g.phoneNumber,method:m.method,optionId:m.optionId,oneTimeToken:g.oneTimeToken}),l.current=null,o({isOpen:!1,options:[]})}catch(y){throw s(y),y}finally{n(!1)}}},[u]),d=b.useCallback(()=>{l.current=null,o({isOpen:!1,options:[]})},[]);return{sendCode:c,selectOption:f,cancelOptions:d,optionsModal:i,isPending:t,error:r}},RR=()=>{const e=yt(),t=re(n=>n.login);return ye({mutationFn:async n=>(await ne.post("/authentication/login",{isWebLogin:!0,phoneNumber:n.phoneNumber,verificationCode:n.verificationCode})).data,onSuccess:n=>{t(n.loginToken,n.profile),e("/")}})},AR="/assets/img-appstore-B9y1MG39.png",TR="/assets/img-googleplay-Da9rULI8.png",OR=()=>{const{isAuthenticated:e,login:t}=re(),[n]=py(),r=yt(),s=n.get("addAccount")==="true",i=n.get("token"),[o,l]=b.useState("PHONE"),[u,c]=b.useState(""),[f,d]=b.useState(""),[m,g]=b.useState(!1),[y,v]=b.useState(!0),N=PR(),x=RR(),h=x.error,p=x.reset;if(b.useEffect(()=>{if(!i)return;let L=!1;return(async()=>{try{const{data:Z}=await Le.get(`${sv}/profile`,{headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json","x-build-number":"150"}});if(L)return;t(i,{uuid:Z.uuid,name:Z.name}),r("/",{replace:!0})}catch{L||r("/login",{replace:!0})}})(),()=>{L=!0}},[t,r,i]),b.useEffect(()=>{const L=()=>{g(window.innerWidth<640)};
599return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[]),b.useEffect(()=>{let L;return h&&(L=window.setTimeout(()=>{d(""),p()},3e3)),()=>window.clearTimeout(L)},[p,h]),i)return a.jsx("div",{className:"min-h-screen bg-off-white flex flex-col items-center justify-center p-4",children:a.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg bg-white p-8 shadow-sm",children:[a.jsx(pe,{className:"h-8 w-8 animate-spin text-midnight-blue"}),a.jsx("p",{className:"text-sm font-medium text-midnight-blue",children:"Accesso in corso..."})]})});if(e&&!s)return a.jsx(Oa,{to:"/",replace:!0});const w=async()=>{try{const{sent:L}=await N.sendCode(u);L&&l("CODE")}catch{}},C=async L=>{try{await N.selectOption(L),l("CODE")}catch{}},E=async()=>{try{await x.mutateAsync({verificationCode:f,phoneNumber:u})}catch{}},A=()=>{l("PHONE"),d(""),x.reset()},O=()=>{var L;return a.jsxs("div",{className:"min-h-screen bg-off-white flex flex-col items-center justify-center p-4",children:[a.jsxs("div",{className:"w-full max-w-md
599space-y-8",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx("img",{src:"/assets/images/logo.png",alt:"AppSegreteria Logo",className:"w-16 h-16"})}),a.jsx("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-midnight-blue",children:"AppSegreteria Web"}),a.jsx("p",{className:"mt-2 text-sm text-misty-blue",children:o==="PHONE"?"Gestisci le chiamate dal computer.":"Inserisci il codice di verifica che hai ricevuto"})]}),a.jsx("div",{className:"bg-white shadow-sm rounded-lg p-8",children:o==="PHONE"?a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"rounded-lg bg-yellow-50 p-4 text-left",children:a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-yellow-400 text-midnight-blue",children:a.jsx(Oj,{size:18})}),a.jsxs("div",{className:"min-w-0 space-y-1.5",children:[a.jsx("h3",{className:"text-sm font-semibold text-midnight-blue",children:"Non sei ancora registrato?"}),a.jsx("p",{className:"text-sm leading-relaxed text-midnight-blue/75",children:"Parti dall'app mobile, poi accedi qui da web."}),a.jsxs("a",{href:"https://segreteria.app",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-midnight-blue underline decoration-yellow-500 decoration-2 underline-offset-4 transition-colors hover:text-yellow-700",children:[a.jsx(yj,{size:16}),"Scarica l'app"]})]})]})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:"Accedi"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Inserisci il numero già registrato per ricevere il codice."})]}),a.jsx(q5,{value:u,onChange:c,error:(L=N.error)==null?void 0:L.message,onSubmit:w}),a.jsx("button",{onClick:w,disabled:N.isPending||u.length<13,className:"w-full btn btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:N.isPending?a.jsx("div",{className:"flex items-center justify-center",children:a.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-midnight-blue"})}):"Ricevi codice di verifica"})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsx(H5,{value:f,onChange:d,error:h==null?void 0:h.message,onSubmit:E}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("button",{onClick:E,disabled:x.isPending||f.length!==6,className:"w-full btn btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:x.isPending?a.jsx("div",{className:"flex items-center justify-center",children:a.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-midnight-blue"})}):"Verifica codice"}),a.jsx("button",{onClick:A,className:"w-full text-sm text-misty-blue hover:text-midnight-blue transition-colors",children:"Torna indietro"})]})]})}),a.jsx("div",{className:"space-y-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-midnight-blue",children:[a.jsx(Sj,{size:16}),a.jsx("span",{children:"Versione web ottimizzata per PC"})]})})]}),a.jsx(W5,{isOpen:N.optionsModal.isOpen,options:N.optionsModal.options,isSubmitting:N.isPending,onSelect:C,onClose:N.cancelOptions})]})};return m&&y?a.jsxs(a.Fragment,{children:[O(),a.jsxs("div",{className:"fixed inset-x-3 bottom-3 z-50 rounded-xl border border-gray-200 bg-white p-4 shadow-lg",children:[a.jsx("button",{onClick:()=>v(!1),className:"absolute right-3 top-3 rounded-full p-1 text-misty-blue transition-colors hover:bg-gray-100 hover:text-midnight-blue","aria-label":"Chiudi avviso",children:a.jsx(De,{size:18})}),a.jsxs("div",{className:"pr-8",children:[a.jsx("h2",{className:"text-base font-semibold text-midnight-blue",children:"Da telefono è meglio l'app"}),a.jsx("p",{className:"mt-1 text-sm leading-relaxed text-misty-blue",children:"Per ottenere il massimo da AppSegreteria, scarica la nostra app."})]}),a.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[a.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://apple.co/2CAd10G",className:"transition-transform hover:scale-105",children:a.jsx("img",{src:AR,alt:"Scarica da App Store",className:"h-11"})}),a.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://play.google.com/store/apps/details?id=it.freesegreteria.app&referrer=utm_source%3Dwebapp%26utm_medium%3Dmobile_notice&hl=IT-it",className:"transition-transform hover:scale-105",children:a.jsx("img",{src:TR,alt:"Scarica da Google Play",className:"h-11"})}),a.jsx("button",{onClick:()=>v(!1),className:"text-sm font-medium text-misty-blue underline underline-offset-4 transition-colors hover:text-midnight-blue",children:"Continua sul web"})]})]})]}):O()},a1={monthly:"Mensile",yearly:"Annuale"},_R={monthly_basic_0:.99,monthly_premium_0:6.99,monthly_premium_1:6.99};function gg({modal:e=!1}){const t=yt(),{data:n,isLoading:r}=Qa(),[s,i]=b.useState(),o=()=>
599{if(e||window.history.length>1){t(-1);return}t("/",{replace:!0})},l=n==null?void 0:n.subscription,u=n?FR(n.paywall.offers):[],c=u.find(g=>g.isCurrentPlan),f=(l==null?void 0:l.provider)==="REVENUECAT"&&(c!=null&&c.purchaseUrl)?c:void 0,d=u.filter(g=>!g.isCurrentPlan),m=c?`${c.offer.label} · ${a1[c.cycle]}`:l==null?void 0:l.plan;return a.jsxs("div",{role:e?"dialog":void 0,"aria-modal":e?"true":void 0,className:"fixed inset-0 z-[100] flex min-h-screen bg-off-white text-midnight-blue",children:[a.jsxs("div",{className:"flex min-h-screen w-full flex-col",children:[a.jsxs("header",{className:"flex h-16 items-center justify-between border-b border-gray-200 bg-white px-4 sm:px-6",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-normal text-misty-blue",children:"Abbonamento"}),a.jsx("h1",{className:"text-lg font-semibold text-midnight-blue",children:"Scegli il tuo piano"})]}),a.jsx("button",{type:"button",onClick:o,className:"inline-flex h-10 w-10 items-center justify-center rounded-lg text-misty-blue hover:bg-gray-100 hover:text-midnight-blue transition-colors","aria-label":"Chiudi paywall",children:a.jsx(De,{size:22})})]}),a.jsx("main",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-6 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"mx-auto grid w-full max-w-5xl gap-6 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.1fr)]",children:[a.jsx("section",{className:"space-y-4",children:r?a.jsx(MR,{}):n?a.jsx(DR,{currentPlanTitle:m,subscription:l,dailyCallsRemaining:n.dailyCallsRemaining,appUserUuid:n.uuid,switchToWebBillingOption:f,onSwitchToWebBilling:()=>{f&&i(f)}}):a.jsx(LR,{})}),a.jsxs("section",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-semibold text-midnight-blue",children:"Piani disponibili"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Confronta le opzioni disponibili per questo account."})]}),r?a.jsxs("div",{className:"grid gap-3",children:[a.jsx(xg,{}),a.jsx(xg,{})]}):d.length>0?a.jsx("div",{className:"grid gap-3",children:d.map(g=>a.jsx(zR,{option:g,trialAvailable:(n==null?void 0:n.isEligibleForTrial)===!0,onChoose:()=>{if((l==null?void 0:l.provider)==="REVENUECAT"&&l.managementUrl){i(g);return}g.purchaseUrl&&window.location.assign(g.purchaseUrl)},disabled:!g.purchaseUrl&&!((l==null?void 0:l.provider)==="REVENUECAT"&&l.managementUrl),preferred:g.offer.id===(n==null?void 0:n.paywall.defaultOfferId)&&g.cycle===n.paywall.defaultCycle},`${g.offer.id}-${g.cycle}`))}):a.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[a.jsx("p",{className:"font-medium text-midnight-blue",children:"Nessun cambio disponibile"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Il piano attuale è già la migliore opzione disponibile per il tuo account."})]})]})]})})]}),(l==null?void 0:l.provider)==="REVENUECAT"&&l.managementUrl&&a.jsx(IR,{option:s,managementUrl:l.managementUrl,onClose:()=>i(void 0)})]})}function MR(){return a.jsx("div",{className:"flex min-h-56 items-center justify-center rounded-lg border border-gray-200 bg-white p-6 shadow-sm",children:a.jsx(pe,{className:"h-7 w-7 animate-spin text-midnight-blue"})})}function LR(){return a.jsx("div",{className:"rounded-lg border border-gray-200 bg-white p-6 shadow-sm",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-600",children:a.jsx(cj,{size:20})}),a.jsxs("div",{children:[a.jsx("h2",{className:"font-semibold text-midnight-blue",children:"Abbonamento non disponibile"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Non siamo riusciti a caricare i dati del tuo abbonamento."})]})]})})}function DR({currentPlanTitle:e,subscription:t,dailyCallsRemaining:n,appUserUuid:r,switchToWebBillingOption:s,onSwitchToWebBilling:i}){const o=t?UR(t):void 0;return a.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm sm:p-6",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-yellow-400 text-midnight-blue",children:a.jsx(zd,{size:22})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-sm font-semibold uppercase tracking-normal text-misty-blue",children:"Piano attuale"}),a.jsx("h2",{className:"mt-1 text-2xl font-semibold text-midnight-blue",children:t?e??"Il tuo abbonamento":"Nessun abbonamento attivo"}),a.jsx("p",{className:"mt-2 text-sm text-misty-blue",children:t?t.priceHumanFriendly:"Puoi attivare un piano per sbloccare le funzionalità a pagamento."})]})]}),t&&o&&a.jsxs("div",{className:"mt-5 rounded-lg border border-gray-200 bg-off-white p-4",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsx("span",{className:"text-sm text-misty-blue",children:o.label}),a.jsx("span",{className:`rounded-full px-3 py-1 text-sm font-semibold ${o.className}`,children:o.badge})]}),o.detail&&a.jsx("p",{className:"mt-2 text-sm font-medium text-midnight-blue",children:o.detail}),n!==void 0&&a.jsxs("div",{className:"mt-3 flex items-center justify-between gap-4 border-t border-gray-200 pt-3",children:[a.jsx("span",{className:"text-sm text-misty-blue",children:"Chiamate rimanenti oggi"}),a.jsx("span",{className:"text-sm font-semibold text-midnight-blue",children:n})]})]}),(t==null?void 0:t.managementUrl)&&a.jsxs("div",{className:"mt-5 flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[a.jsxs("a",{href:t.managementUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 rounded-lg border border-gray-200 px-4 py-2.5 text-sm font-semibold text-midnight-blue transition-colors hover:bg-gray-50",children:[a.jsx(am,{size:16}),"Gestisci abbonamento"]}),s&&a.jsxs("button",{type:"button",onClick:i,className:"inline-flex items-center justify-center gap-2 rounded-lg border border-gray-200 px-4 py-2.5 text-sm font-semibold text-midnight-blue transition-colors hover:bg-gray-50",children:[a.jsx(zd,{size:16}),"Passa alla fatturazione elettronica"]}),t.provider==="STRIPE"&&t.managementUrl.includes("stripe-portal")&&a.jsx("a",{href:`https://tp.mysegreteria.app/?appUserUuid=${r}&href=${encodeURIComponent(t.managementUrl)}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 rounded-lg border border-gray-200 px-4 py-2.5 text-sm font-semibold text-midnight-blue transition-colors hover:bg-gray-50",children:"Fatturazione"})]})]})}function zR({option:e,trialAvailable:t,preferred:n,onChoose:r,disabled:s}
599){const i=$R(e),o=e.offer.subtitle.split(",").map(l=>l.trim()).filter(Boolean);return a.jsx("button",{type:"button",onClick:r,disabled:s,className:"group rounded-lg border border-gray-200 bg-white p-5 text-left shadow-sm transition-colors hover:border-midnight-blue/30 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60 disabled:hover:border-gray-200 disabled:hover:bg-white",children:a.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h3",{className:"text-lg font-semibold text-midnight-blue",children:e.offer.label}),a.jsx("span",{className:"rounded-full bg-midnight-blue/5 px-2.5 py-1 text-xs font-semibold text-midnight-blue",children:a1[e.cycle]}),n&&a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-yellow-400 px-2.5 py-1 text-xs font-semibold text-midnight-blue",children:[a.jsx(_j,{size:13}),"Consigliato"]})]}),a.jsx("div",{className:"mt-3 space-y-2",children:o.map(l=>a.jsxs("div",{className:"flex gap-2 text-sm text-misty-blue",children:[a.jsx(Ze,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-600"}),a.jsx("span",{children:l})]},l))}),t&&a.jsx("p",{className:"mt-3 text-sm font-medium text-green-700",children:"Prova gratuita disponibile"})]}),a.jsxs("div",{className:"flex shrink-0 flex-row items-center justify-between gap-4 sm:flex-col sm:items-end",children:[a.jsxs("div",{className:"text-left sm:text-right",children:[a.jsx("p",{className:"text-2xl font-semibold text-midnight-blue",children:i.primary}),i.secondary&&a.jsx("p",{className:"text-sm text-misty-blue",children:i.secondary}),a.jsx("p",{className:"mt-1 text-xs font-semibold uppercase tracking-normal text-green-700",children:"IVA inclusa"})]}),a.jsxs("span",{className:"inline-flex items-center gap-1 rounded-lg bg-midnight-blue px-4 py-2 text-sm font-semibold text-white",children:[s?"NON DISPONIBILE":"SCEGLI",!s&&a.jsx(Dd,{size:16,className:"transition-transform group-hover:translate-x-0.5"})]})]})]})})}function IR({option:e,managementUrl:t,onClose:n}){return e?a.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"store-switch-title",className:"fixed inset-0 z-[120] flex items-center justify-center bg-midnight-blue/50 px-4 py-6",children:a.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-white p-5 shadow-xl sm:p-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold uppercase tracking-normal text-misty-blue",children:"Cambio piano"}),a.jsx("h2",{id:"store-switch-title",className:"mt-1 text-xl font-semibold text-midnight-blue",children:"Prima disattiva il rinnovo sullo store"})]}),a.jsx("button",{type:"button",onClick:n,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-misty-blue transition-colors hover:bg-gray-100 hover:text-midnight-blue","aria-label":"Chiudi avviso cambio piano",children:a.jsx(De,{size:20})})]}),a.jsx("p",{className:"mt-4 text-sm leading-6 text-misty-blue",children:"Il piano attuale è attivo tramite Apple o Google. Per passare al pagamento web con dati di fatturazione devi prima disattivare il rinnovo automatico dallo store. Il servizio resta attivo senza interruzioni fino alla scadenza già pagata."}),a.jsxs("div",{className:"mt-5 space-y-3",children:[a.jsxs("div",{className:"rounded-lg border border-gray-200 bg-off-white p-4",children:[a.jsx("p",{className:"text-sm font-semibold text-midnight-blue",children:"1. Disattiva il rinnovo"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Apri la gestione abbonamento dello store e disattiva il piano attualmente attivo."})]}),a.jsxs("div",{className:"rounded-lg border border-gray-200 bg-off-white p-4",children:[a.jsx("p",{className:"text-sm font-semibold text-midnight-blue",children:"2. Riattiva dal link web"}),a.jsx("p",{className:"mt-1 text-sm text-misty-blue",children:"Dopo la disattivazione potrai riattivare il piano dal link web inserendo i dati di fatturazione."})]})]}),a.jsxs("div",{className:"mt-6 flex flex-col gap-2 sm:flex-row sm:justify-end",children:[a.jsx("button",{type:"button",onClick:n,className:"inline-flex items-center justify-center rounded-lg border border-gray-200 px-4 py-2.5 text-sm font-semibold text-midnight-blue transition-colors hover:bg-gray-50",children:"Ho capito"}),a.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 rounded-lg border border-gray-200 px-4 py-2.5 text-sm font-semibold text-midnight-blue transition-colors hover:bg-gray-50",children:["Apri lo store",a.jsx(Dd,{size:16})]}),e.purchaseUrl&&a.jsxs("a",{href:e.purchaseUrl,className:"inline-flex items-center justify-center gap-2 rounded-lg bg-midnight-blue px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-midnight-blue/90",children:["Riattiva dal link web",a.jsx(Dd,{size:16})]})]})]})}):null}function xg(){return a.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-5 shadow-sm",children:[a.jsx("div",{className:"h-5 w-40 rounded bg-gray-100"}),a.jsx("div",{className:"mt-4 h-4 w-full rounded bg-gray-100"}),a.jsx("div",{className:"mt-2 h-4 w-3/4 rounded bg-gray-100"}),a.jsx("div",{className:"mt-5 h-10 w-32 rounded bg-gray-100"})]})}function FR(e){return e.flatMap(t=>{const n=[];return t.yearly&&n.push({offer:t,cycle:"yearly",productId:t.yearly.productId,isCurrentPlan:t.yearly.isCurrentPlan,purchaseUrl:t.yearly.purchaseUrl,amountInCents:t.yearly.amountInCents}),t.monthly&&n.push({offer:t,cycle:"monthly",productId:t.monthly.productId,isCurrentPlan:t.monthly.isCurrentPlan,purchaseUrl:t.monthly.purchaseUrl,amountInCents:t.monthly.amountInCents}),n})}function UR(e){const t=fn(new Date(e.currentPeriodExpiresAt),"d MMMM yyyy",{locale:Mr});switch(e.status){case"AUTO_RENEWAL":return{label:"Prossimo rinnovo",detail
599:t,badge:"Attivo",className:"bg-green-50 text-green-700"};case"CANCELLED":return{label:"Accesso fino al",detail:t,badge:"In cancellazione",className:"bg-orange-50 text-orange-700"};case"GRACE_PERIOD":return{label:"Aggiorna entro il",detail:t,badge:"Pagamento da aggiornare",className:"bg-yellow-50 text-yellow-700"};case"RETRY_PERIOD":return{label:"Pagamento fallito",detail:"Aggiorna il metodo di pagamento",badge:"Scaduto",className:"bg-red-50 text-red-700"}}}function $R(e){const t=e.productId.split(":")[0],n=e.amountInCents!==void 0?e.amountInCents/100:BR(t);if(n===void 0)return{primary:e.cycle==="yearly"?"Annuale":"Mensile",secondary:"Prezzo disponibile al checkout"};const r=e.cycle==="yearly"?"anno":"mese",s=`${yg(n)}/${r}`;return e.cycle==="yearly"?{primary:s,secondary:`${yg(n/12)}/mese`}:{primary:s}}function BR(e){if(e.startsWith("segre_")){const[,t]=e.split("_"),n=Number.parseInt(t,10);return Number.isFinite(n)?n/100:void 0}return _R[e]}function yg(e){return`${e.toLocaleString("it-IT",{style:"currency",currency:"EUR",minimumFractionDigits:e%1===0?0:2})}`}const VR=({children:e})=>re(n=>n.isAuthenticated)?a.jsx(a.Fragment,{children:e}):a.jsx(Oa,{to:"/login",replace:!0}),qR=()=>{var n;const{data:e}=_v(),t=((n=e==null?void 0:e.pages[0])==null?void 0:n.unreadCount)||0;return b.useEffect(()=>{const r="AppSegreteria";return t>0?document.title=`(${Dv(t)} da leggere) ${r}`:document.title=r,()=>{document.title=r}},[t]),{unreadCount:t}},HR=async()=>{try{const e=await fetch(`/version.json?t=${Date.now()}`,{cache:"no-store"});if(!e.ok)return null;const t=await e.json();return typeof t!="object"||t===null||typeof t.buildId!="string"?null:t}catch{return null}},WR=()=>{const e=b.useRef(null),{data:t}=Tn({queryKey:["app-version"],queryFn:HR,refetchInterval:6e4,staleTime:0,retry:!1});b.useEffect(()=>{if(t!=null&&t.buildId){if(e.current===null){e.current=t.buildId;return}t.buildId!==e.current&&window.location.reload()}},[t])},QR=({children:e})=>(qR(),a.jsx(a.Fragment,{children:e})),bn=({children:e,withLayout:t=!0})=>a.jsx(VR,{children:a.jsx(QR,{children:t?a.jsx(tk,{children:e}):e})});function KR(){const e=hn(),t=e.state,n=t==null?void 0:t.backgroundLocation;return a.jsxs(a.Fragment,{children:[a.jsxs(Ad,{location:n??e,children:[a.jsx(We,{path:"/login",element:a.jsx(OR,{})}),a.jsx(We,{path:"/",element:a.jsx(bn,{children:a.jsx(lP,{})})}),a.jsx(We,{path:"/configuration",element:a.jsx(bn,{children:a.jsx(Xp,{})})}),a.jsx(We,{path:"/configuration/:phoneUuid",element:a.jsx(bn,{children:a.jsx(Xp,{})})}),a.jsx(We,{path:"/configuration/:phoneUuid/diversions",element:a.jsx(bn,{children:a.jsx(xP,{})})}),a.jsx(We,{path:"/configuration/:phoneUuid/rule/:ruleUuid/edit",element:a.jsx(bn,{children:a.jsx(ug,{})})}),a.jsx(We,{path:"/configuration/:phoneUuid/rule/new",element:a.jsx(bn,{children:a.jsx(ug,{})})}),a.jsx(We,{path:"/booking/*",element:a.jsx(bn,{children:a.jsx(w5,{})})}),a.jsx(We,{path:"/profile",element:a.jsx(bn,{children:a.jsx(u5,{})})}),a.jsx(We,{path:"/paywall",element:a.jsx(bn,{withLayout:!1,children:a.jsx(gg,{})})})]}),n&&a.jsx(Ad,{children:a.jsx(We,{path:"/paywall",element:a.jsx(bn,{withLayout:!1,children:a.jsx(gg,{modal:!0})})})})]})}function GR(){return WR(),a.jsx(SR,{children:a.jsxs(eP,{children:[a.jsx(dN,{children:a.jsx(KR,{})}),a.jsx(oj,{position:"top-right",toastOptions:{duration:4e3,style:{background:"#ffffff",color:"#1e293b",border:"1px solid #e2e8f0",borderRadius:"8px",fontSize:"14px"},success:{iconTheme:{primary:"#10b981",secondary:"#ffffff"}},error:{iconTheme:{primary:"#ef4444",secondary:"#ffffff"}}}})]})})}$0(document.getElementById("root")).render(a.jsx(b.StrictMode,{children:a.jsx(s2,{client:sy,children:a.jsx(GR,{})})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.