(function(bt,gt){typeof exports=="object"&&typeof module<"u"?module.exports=gt():typeof define=="function"&&define.amd?define(gt):(bt=typeof globalThis<"u"?globalThis:bt||self,bt.ReactProductSliderUserTarget=gt())})(this,function(){"use strict";var J1=Object.defineProperty;var Gy=bt=>{throw TypeError(bt)};var k1=(bt,gt,Ut)=>gt in bt?J1(bt,gt,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):bt[gt]=Ut;var kt=(bt,gt,Ut)=>k1(bt,typeof gt!="symbol"?gt+"":gt,Ut),Pr=(bt,gt,Ut)=>gt.has(bt)||Gy("Cannot "+Ut);var g=(bt,gt,Ut)=>(Pr(bt,gt,"read from private field"),Ut?Ut.call(bt):gt.get(bt)),I=(bt,gt,Ut)=>gt.has(bt)?Gy("Cannot add the same private member more than once"):gt instanceof WeakSet?gt.add(bt):gt.set(bt,Ut),L=(bt,gt,Ut,fl)=>(Pr(bt,gt,"write to private field"),fl?fl.call(bt,Ut):gt.set(bt,Ut),Ut),ht=(bt,gt,Ut)=>(Pr(bt,gt,"access private method"),Ut);var mc=(bt,gt,Ut,fl)=>({set _(vc){L(bt,gt,vc,Ut)},get _(){return g(bt,gt,fl)}});var hl,Na,Zl,Ff,Kl,Ha,Jl,Wf,yl,Pf,kl,$l,Ue,ml,ne,Kn,vl,ke,Ma,If,ta,to,ea,fe,gl,aa,rl,eo,da,$e,Jn,ao,xt,ja,xa,Fl,Wl,wa,Pl,Il,lo,ve,ft,kn,oe,pl,tn,qa,la,$n,en,an,bl,Sl,Qa,ln,Tt,Ju,Ir,tf,ef,af,lf,nf,uf,Xy,no;function bt(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var gt={exports:{}},Ut={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var fl;function vc(){if(fl)return Ut;fl=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function s(r,d,p){var E=null;if(p!==void 0&&(E=""+p),d.key!==void 0&&(E=""+d.key),"key"in d){p={};for(var D in d)D!=="key"&&(p[D]=d[D])}else p=d;return d=p.ref,{$$typeof:c,type:r,key:E,ref:d!==void 0?d:null,props:p}}return Ut.Fragment=u,Ut.jsx=s,Ut.jsxs=s,Ut}var gc={exports:{}},lt={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var cf;function Vy(){if(cf)return lt;cf=1;var c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),E=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),M=Symbol.iterator;function H(m){return m===null||typeof m!="object"?null:(m=M&&m[M]||m["@@iterator"],typeof m=="function"?m:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z=Object.assign,B={};function Q(m,j,P){this.props=m,this.context=j,this.refs=B,this.updater=P||x}Q.prototype.isReactComponent={},Q.prototype.setState=function(m,j){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,j,"setState")},Q.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function K(){}K.prototype=Q.prototype;function k(m,j,P){this.props=m,this.context=j,this.refs=B,this.updater=P||x}var nt=k.prototype=new K;nt.constructor=k,Z(nt,Q.prototype),nt.isPureReactComponent=!0;var tt=Array.isArray,X={H:null,A:null,T:null,S:null},ot=Object.prototype.hasOwnProperty;function At(m,j,P,$,Y,mt){return P=mt.ref,{$$typeof:c,type:m,key:j,ref:P!==void 0?P:null,props:mt}}function pt(m,j){return At(m.type,j,void 0,void 0,void 0,m.props)}function w(m){return typeof m=="object"&&m!==null&&m.$$typeof===c}function ut(m){var j={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(P){return j[P]})}var Bt=/\/+/g;function Yt(m,j){return typeof m=="object"&&m!==null&&m.key!=null?ut(""+m.key):j.toString(36)}function Ne(){}function de(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(Ne,Ne):(m.status="pending",m.then(function(j){m.status==="pending"&&(m.status="fulfilled",m.value=j)},function(j){m.status==="pending"&&(m.status="rejected",m.reason=j)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function ue(m,j,P,$,Y){var mt=typeof m;(mt==="undefined"||mt==="boolean")&&(m=null);var it=!1;if(m===null)it=!0;else switch(mt){case"bigint":case"string":case"number":it=!0;break;case"object":switch(m.$$typeof){case c:case u:it=!0;break;case O:return it=m._init,ue(it(m._payload),j,P,$,Y)}}if(it)return Y=Y(m),it=$===""?"."+Yt(m,0):$,tt(Y)?(P="",it!=null&&(P=it.replace(Bt,"$&/")+"/"),ue(Y,j,P,"",function(Gt){return Gt})):Y!=null&&(w(Y)&&(Y=pt(Y,P+(Y.key==null||m&&m.key===Y.key?"":(""+Y.key).replace(Bt,"$&/")+"/")+it)),j.push(Y)),1;it=0;var he=$===""?".":$+":";if(tt(m))for(var _t=0;_t>>1,m=q[Ot];if(0>>1;Otd($,F))Yd(mt,$)?(q[Ot]=mt,q[Y]=F,Ot=Y):(q[Ot]=$,q[P]=F,Ot=P);else if(Yd(mt,F))q[Ot]=mt,q[Y]=F,Ot=Y;else break t}}return et}function d(q,et){var F=q.sortIndex-et.sortIndex;return F!==0?F:q.id-et.id}if(c.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;c.unstable_now=function(){return p.now()}}else{var E=Date,D=E.now();c.unstable_now=function(){return E.now()-D}}var T=[],y=[],O=1,M=null,H=3,x=!1,Z=!1,B=!1,Q=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function nt(q){for(var et=s(y);et!==null;){if(et.callback===null)r(y);else if(et.startTime<=q)r(y),et.sortIndex=et.expirationTime,u(T,et);else break;et=s(y)}}function tt(q){if(B=!1,nt(q),!Z)if(s(T)!==null)Z=!0,de();else{var et=s(y);et!==null&&ue(tt,et.startTime-q)}}var X=!1,ot=-1,At=5,pt=-1;function w(){return!(c.unstable_now()-ptq&&w());){var Ot=M.callback;if(typeof Ot=="function"){M.callback=null,H=M.priorityLevel;var m=Ot(M.expirationTime<=q);if(q=c.unstable_now(),typeof m=="function"){M.callback=m,nt(q),et=!0;break e}M===s(T)&&r(T),nt(q)}else r(T);M=s(T)}if(M!==null)et=!0;else{var j=s(y);j!==null&&ue(tt,j.startTime-q),et=!1}}break t}finally{M=null,H=F,x=!1}et=void 0}}finally{et?Bt():X=!1}}}var Bt;if(typeof k=="function")Bt=function(){k(ut)};else if(typeof MessageChannel<"u"){var Yt=new MessageChannel,Ne=Yt.port2;Yt.port1.onmessage=ut,Bt=function(){Ne.postMessage(null)}}else Bt=function(){Q(ut,0)};function de(){X||(X=!0,Bt())}function ue(q,et){ot=Q(function(){q(c.unstable_now())},et)}c.unstable_IdlePriority=5,c.unstable_ImmediatePriority=1,c.unstable_LowPriority=4,c.unstable_NormalPriority=3,c.unstable_Profiling=null,c.unstable_UserBlockingPriority=2,c.unstable_cancelCallback=function(q){q.callback=null},c.unstable_continueExecution=function(){Z||x||(Z=!0,de())},c.unstable_forceFrameRate=function(q){0>q||125Ot?(q.sortIndex=F,u(y,q),s(T)===null&&q===s(y)&&(B?(K(ot),ot=-1):B=!0,ue(tt,F-Ot))):(q.sortIndex=m,u(T,q),Z||x||(Z=!0,de())),q},c.unstable_shouldYield=w,c.unstable_wrapCallback=function(q){var et=H;return function(){var F=H;H=et;try{return q.apply(this,arguments)}finally{H=F}}}}(Ec)),Ec}var of;function Jy(){return of||(of=1,Sc.exports=Ky()),Sc.exports}var Tc={exports:{}},le={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var df;function ky(){if(df)return le;df=1;var c=pc();function u(T){var y="https://react.dev/errors/"+T;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),Tc.exports=ky(),Tc.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var yf;function Fy(){if(yf)return Ln;yf=1;var c=Jy(),u=pc(),s=$y();function r(t){var e="https://react.dev/errors/"+t;if(1)":-1n||h[l]!==b[n]){var C=` `+h[l].replace(" at new "," at ");return t.displayName&&C.includes("")&&(C=C.replace("",t.displayName)),C}while(1<=l&&0<=n);break}}}finally{de=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ne(a):""}function q(t){switch(t.tag){case 26:case 27:case 5:return Ne(t.type);case 16:return Ne("Lazy");case 13:return Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return t=ue(t.type,!1),t;case 11:return t=ue(t.type.render,!1),t;case 1:return t=ue(t.type,!0),t;default:return""}}function et(t){try{var e="";do e+=q(t),t=t.return;while(t);return e}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}function F(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function Ot(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function m(t){if(F(t)!==t)throw Error(r(188))}function j(t){var e=t.alternate;if(!e){if(e=F(t),e===null)throw Error(r(188));return e!==t?null:t}for(var a=t,l=e;;){var n=a.return;if(n===null)break;var i=n.alternate;if(i===null){if(l=n.return,l!==null){a=l;continue}break}if(n.child===i.child){for(i=n.child;i;){if(i===a)return m(n),t;if(i===l)return m(n),e;i=i.sibling}throw Error(r(188))}if(a.return!==l.return)a=n,l=i;else{for(var f=!1,o=n.child;o;){if(o===a){f=!0,a=n,l=i;break}if(o===l){f=!0,l=n,a=i;break}o=o.sibling}if(!f){for(o=i.child;o;){if(o===a){f=!0,a=i,l=n;break}if(o===l){f=!0,l=i,a=n;break}o=o.sibling}if(!f)throw Error(r(189))}}if(a.alternate!==l)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?t:e}function P(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=P(t),e!==null)return e;t=t.sibling}return null}var $=Array.isArray,Y=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,mt={pending:!1,data:null,method:null,action:null},it=[],he=-1;function _t(t){return{current:t}}function Gt(t){0>he||(t.current=it[he],it[he]=null,he--)}function Nt(t,e){he++,it[he]=t.current,t.current=e}var na=_t(null),Fn=_t(null),Ba=_t(null),ei=_t(null);function ai(t,e){switch(Nt(Ba,e),Nt(Fn,t),Nt(na,null),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)&&(e=e.namespaceURI)?gy(e):0;break;default:if(t=t===8?e.parentNode:e,e=t.tagName,t=t.namespaceURI)t=gy(t),e=py(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Gt(na),Nt(na,e)}function nn(){Gt(na),Gt(Fn),Gt(Ba)}function Xc(t){t.memoizedState!==null&&Nt(ei,t);var e=na.current,a=py(e,t.type);e!==a&&(Nt(Fn,t),Nt(na,a))}function li(t){Fn.current===t&&(Gt(na),Gt(Fn)),ei.current===t&&(Gt(ei),Gu._currentValue=mt)}var Vc=Object.prototype.hasOwnProperty,Zc=c.unstable_scheduleCallback,Kc=c.unstable_cancelCallback,Om=c.unstable_shouldYield,Dm=c.unstable_requestPaint,ua=c.unstable_now,Rm=c.unstable_getCurrentPriorityLevel,uo=c.unstable_ImmediatePriority,io=c.unstable_UserBlockingPriority,ni=c.unstable_NormalPriority,zm=c.unstable_LowPriority,co=c.unstable_IdlePriority,Cm=c.log,Mm=c.unstable_setDisableYieldValue,Wn=null,Te=null;function Um(t){if(Te&&typeof Te.onCommitFiberRoot=="function")try{Te.onCommitFiberRoot(Wn,t,void 0,(t.current.flags&128)===128)}catch{}}function Ya(t){if(typeof Cm=="function"&&Mm(t),Te&&typeof Te.setStrictMode=="function")try{Te.setStrictMode(Wn,t)}catch{}}var _e=Math.clz32?Math.clz32:jm,Nm=Math.log,Hm=Math.LN2;function jm(t){return t>>>=0,t===0?32:31-(Nm(t)/Hm|0)|0}var ui=128,ii=4194304;function El(t){var e=t&42;if(e!==0)return e;switch(t&-t){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:return 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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ci(t,e){var a=t.pendingLanes;if(a===0)return 0;var l=0,n=t.suspendedLanes,i=t.pingedLanes,f=t.warmLanes;t=t.finishedLanes!==0;var o=a&134217727;return o!==0?(a=o&~n,a!==0?l=El(a):(i&=o,i!==0?l=El(i):t||(f=o&~f,f!==0&&(l=El(f))))):(o=a&~n,o!==0?l=El(o):i!==0?l=El(i):t||(f=a&~f,f!==0&&(l=El(f)))),l===0?0:e!==0&&e!==l&&!(e&n)&&(n=l&-l,f=e&-e,n>=f||n===32&&(f&4194176)!==0)?e:l}function Pn(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function xm(t,e){switch(t){case 1:case 2:case 4:case 8:return e+250;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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function so(){var t=ui;return ui<<=1,!(ui&4194176)&&(ui=128),t}function ro(){var t=ii;return ii<<=1,!(ii&62914560)&&(ii=4194304),t}function Jc(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function In(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function wm(t,e,a,l,n,i){var f=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var o=t.entanglements,h=t.expirationTimes,b=t.hiddenUpdates;for(a=f&~a;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ym=RegExp("^[: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]*$"),po={},bo={};function Lm(t){return Vc.call(bo,t)?!0:Vc.call(po,t)?!1:Ym.test(t)?bo[t]=!0:(po[t]=!0,!1)}function si(t,e,a){if(Lm(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var l=e.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function ri(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function ya(t,e,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+l)}}function He(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function So(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Gm(t){var e=So(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),l=""+t[e];if(!t.hasOwnProperty(e)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var n=a.get,i=a.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(f){l=""+f,i.call(this,f)}}),Object.defineProperty(t,e,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(f){l=""+f},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fi(t){t._valueTracker||(t._valueTracker=Gm(t))}function Eo(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),l="";return t&&(l=So(t)?t.checked?"true":"false":t.value),t=l,t!==a?(e.setValue(t),!0):!1}function oi(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Xm=/[\n"\\]/g;function je(t){return t.replace(Xm,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Fc(t,e,a,l,n,i,f,o){t.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?t.type=f:t.removeAttribute("type"),e!=null?f==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+He(e)):t.value!==""+He(e)&&(t.value=""+He(e)):f!=="submit"&&f!=="reset"||t.removeAttribute("value"),e!=null?Wc(t,f,He(e)):a!=null?Wc(t,f,He(a)):l!=null&&t.removeAttribute("value"),n==null&&i!=null&&(t.defaultChecked=!!i),n!=null&&(t.checked=n&&typeof n!="function"&&typeof n!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.name=""+He(o):t.removeAttribute("name")}function To(t,e,a,l,n,i,f,o){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.type=i),e!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||e!=null))return;a=a!=null?""+He(a):"",e=e!=null?""+He(e):a,o||e===t.value||(t.value=e),t.defaultValue=e}l=l??n,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=o?t.checked:!!l,t.defaultChecked=!!l,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(t.name=f)}function Wc(t,e,a){e==="number"&&oi(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function fn(t,e,a,l){if(t=t.options,e){e={};for(var n=0;n=iu),xo=" ",wo=!1;function qo(t,e){switch(t){case"keyup":return gv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qo(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yn=!1;function bv(t,e){switch(t){case"compositionend":return Qo(e);case"keypress":return e.which!==32?null:(wo=!0,xo);case"textInput":return t=e.data,t===xo&&wo?null:t;default:return null}}function Sv(t,e){if(yn)return t==="compositionend"||!ss&&qo(t,e)?(t=Co(),hi=ls=Ga=null,yn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:a,offset:e-t};t=l}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=Ko(a)}}function ko(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?ko(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function $o(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=oi(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=oi(t.document)}return e}function os(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function zv(t,e){var a=$o(e);e=t.focusedElem;var l=t.selectionRange;if(a!==e&&e&&e.ownerDocument&&ko(e.ownerDocument.documentElement,e)){if(l!==null&&os(e)){if(t=l.start,a=l.end,a===void 0&&(a=t),"selectionStart"in e)e.selectionStart=t,e.selectionEnd=Math.min(a,e.value.length);else if(a=(t=e.ownerDocument||document)&&t.defaultView||window,a.getSelection){a=a.getSelection();var n=e.textContent.length,i=Math.min(l.start,n);l=l.end===void 0?i:Math.min(l.end,n),!a.extend&&i>l&&(n=l,l=i,i=n),n=Jo(e,i);var f=Jo(e,l);n&&f&&(a.rangeCount!==1||a.anchorNode!==n.node||a.anchorOffset!==n.offset||a.focusNode!==f.node||a.focusOffset!==f.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),a.removeAllRanges(),i>l?(a.addRange(t),a.extend(f.node,f.offset)):(t.setEnd(f.node,f.offset),a.addRange(t)))}}for(t=[],a=e;a=a.parentNode;)a.nodeType===1&&t.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof e.focus=="function"&&e.focus(),e=0;e=document.documentMode,mn=null,ds=null,fu=null,hs=!1;function Fo(t,e,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;hs||mn==null||mn!==oi(l)||(l=mn,"selectionStart"in l&&os(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),fu&&ru(fu,l)||(fu=l,l=tc(ds,"onSelect"),0>=f,n-=f,ma=1<<32-_e(e)+n|a<W?(Pt=J,J=null):Pt=J.sibling;var Et=A(S,J,_[W],U);if(Et===null){J===null&&(J=Pt);break}t&&J&&Et.alternate===null&&e(S,J),v=i(Et,v,W),st===null?G=Et:st.sibling=Et,st=Et,J=Pt}if(W===_.length)return a(S,J),St&&zl(S,W),G;if(J===null){for(;W<_.length;W++)J=N(S,_[W],U),J!==null&&(v=i(J,v,W),st===null?G=J:st.sibling=J,st=J);return St&&zl(S,W),G}for(J=l(J);W<_.length;W++)Pt=z(J,S,W,_[W],U),Pt!==null&&(t&&Pt.alternate!==null&&J.delete(Pt.key===null?W:Pt.key),v=i(Pt,v,W),st===null?G=Pt:st.sibling=Pt,st=Pt);return t&&J.forEach(function(sl){return e(S,sl)}),St&&zl(S,W),G}function at(S,v,_,U){if(_==null)throw Error(r(151));for(var G=null,st=null,J=v,W=v=0,Pt=null,Et=_.next();J!==null&&!Et.done;W++,Et=_.next()){J.index>W?(Pt=J,J=null):Pt=J.sibling;var sl=A(S,J,Et.value,U);if(sl===null){J===null&&(J=Pt);break}t&&J&&sl.alternate===null&&e(S,J),v=i(sl,v,W),st===null?G=sl:st.sibling=sl,st=sl,J=Pt}if(Et.done)return a(S,J),St&&zl(S,W),G;if(J===null){for(;!Et.done;W++,Et=_.next())Et=N(S,Et.value,U),Et!==null&&(v=i(Et,v,W),st===null?G=Et:st.sibling=Et,st=Et);return St&&zl(S,W),G}for(J=l(J);!Et.done;W++,Et=_.next())Et=z(J,S,W,Et.value,U),Et!==null&&(t&&Et.alternate!==null&&J.delete(Et.key===null?W:Et.key),v=i(Et,v,W),st===null?G=Et:st.sibling=Et,st=Et);return t&&J.forEach(function(K1){return e(S,K1)}),St&&zl(S,W),G}function Qt(S,v,_,U){if(typeof _=="object"&&_!==null&&_.type===T&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case E:t:{for(var G=_.key;v!==null;){if(v.key===G){if(G=_.type,G===T){if(v.tag===7){a(S,v.sibling),U=n(v,_.props.children),U.return=S,S=U;break t}}else if(v.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===k&&hd(G)===v.type){a(S,v.sibling),U=n(v,_.props),gu(U,_),U.return=S,S=U;break t}a(S,v);break}else e(S,v);v=v.sibling}_.type===T?(U=Bl(_.props.children,S.mode,U,_.key),U.return=S,S=U):(U=Vi(_.type,_.key,_.props,null,S.mode,U),gu(U,_),U.return=S,S=U)}return f(S);case D:t:{for(G=_.key;v!==null;){if(v.key===G)if(v.tag===4&&v.stateNode.containerInfo===_.containerInfo&&v.stateNode.implementation===_.implementation){a(S,v.sibling),U=n(v,_.children||[]),U.return=S,S=U;break t}else{a(S,v);break}else e(S,v);v=v.sibling}U=mr(_,S.mode,U),U.return=S,S=U}return f(S);case k:return G=_._init,_=G(_._payload),Qt(S,v,_,U)}if($(_))return V(S,v,_,U);if(ot(_)){if(G=ot(_),typeof G!="function")throw Error(r(150));return _=G.call(_),at(S,v,_,U)}if(typeof _.then=="function")return Qt(S,v,Oi(_),U);if(_.$$typeof===x)return Qt(S,v,Li(S,_),U);Di(S,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,v!==null&&v.tag===6?(a(S,v.sibling),U=n(v,_),U.return=S,S=U):(a(S,v),U=yr(_,S.mode,U),U.return=S,S=U),f(S)):a(S,v)}return function(S,v,_,U){try{vu=0;var G=Qt(S,v,_,U);return En=null,G}catch(J){if(J===yu)throw J;var st=Ge(29,J,null,S.mode);return st.lanes=U,st.return=S,st}finally{}}}var Ml=yd(!0),md=yd(!1),Tn=_t(null),Ri=_t(0);function vd(t,e){t=Ra,Nt(Ri,t),Nt(Tn,e),Ra=t|e.baseLanes}function Es(){Nt(Ri,Ra),Nt(Tn,Tn.current)}function Ts(){Ra=Ri.current,Gt(Tn),Gt(Ri)}var Be=_t(null),ca=null;function Va(t){var e=t.alternate;Nt(Kt,Kt.current&1),Nt(Be,t),ca===null&&(e===null||Tn.current!==null||e.memoizedState!==null)&&(ca=t)}function gd(t){if(t.tag===22){if(Nt(Kt,Kt.current),Nt(Be,t),ca===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(ca=t)}}else Za()}function Za(){Nt(Kt,Kt.current),Nt(Be,Be.current)}function ga(t){Gt(Be),ca===t&&(ca=null),Gt(Kt)}var Kt=_t(0);function zi(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Hv=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},jv=c.unstable_scheduleCallback,xv=c.unstable_NormalPriority,Jt={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _s(){return{controller:new Hv,data:new Map,refCount:0}}function pu(t){t.refCount--,t.refCount===0&&jv(xv,function(){t.controller.abort()})}var bu=null,As=0,_n=0,An=null;function wv(t,e){if(bu===null){var a=bu=[];As=0,_n=Mr(),An={status:"pending",value:void 0,then:function(l){a.push(l)}}}return As++,e.then(pd,pd),e}function pd(){if(--As===0&&bu!==null){An!==null&&(An.status="fulfilled");var t=bu;bu=null,_n=0,An=null;for(var e=0;ei?i:8;var f=w.T,o={};w.T=o,Ls(t,!1,e,a);try{var h=n(),b=w.S;if(b!==null&&b(o,h),h!==null&&typeof h=="object"&&typeof h.then=="function"){var C=qv(h,l);Tu(t,e,C,ze(t))}else Tu(t,e,l,ze(t))}catch(N){Tu(t,e,{then:function(){},status:"rejected",reason:N},ze())}finally{Y.p=i,w.T=f}}function Gv(){}function Bs(t,e,a,l){if(t.tag!==5)throw Error(r(476));var n=$d(t).queue;kd(t,n,e,mt,a===null?Gv:function(){return Fd(t),a(l)})}function $d(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:mt,baseState:mt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:mt},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Fd(t){var e=$d(t).next.queue;Tu(t,e,{},ze())}function Ys(){return ce(Gu)}function Wd(){return Vt().memoizedState}function Pd(){return Vt().memoizedState}function Xv(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=ze();t=Fa(a);var l=Wa(e,t,a);l!==null&&(me(l,e,a),Ou(l,e,a)),e={cache:_s()},t.payload=e;return}e=e.return}}function Vv(t,e,a){var l=ze();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},qi(t)?th(e,a):(a=vs(t,e,a,l),a!==null&&(me(a,t,l),eh(a,e,l)))}function Id(t,e,a){var l=ze();Tu(t,e,a,l)}function Tu(t,e,a,l){var n={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(qi(t))th(e,n);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var f=e.lastRenderedState,o=i(f,a);if(n.hasEagerState=!0,n.eagerState=o,Ae(o,f))return Si(t,e,n,0),Ct===null&&bi(),!1}catch{}finally{}if(a=vs(t,e,n,l),a!==null)return me(a,t,l),eh(a,e,l),!0}return!1}function Ls(t,e,a,l){if(l={lane:2,revertLane:Mr(),action:l,hasEagerState:!1,eagerState:null,next:null},qi(t)){if(e)throw Error(r(479))}else e=vs(t,a,l,2),e!==null&&me(e,t,2)}function qi(t){var e=t.alternate;return t===ct||e!==null&&e===ct}function th(t,e){On=Mi=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function eh(t,e,a){if(a&4194176){var l=e.lanes;l&=t.pendingLanes,a|=l,e.lanes=a,oo(t,a)}}var sa={readContext:ce,use:Hi,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt};sa.useCacheRefresh=Lt,sa.useMemoCache=Lt,sa.useHostTransitionStatus=Lt,sa.useFormState=Lt,sa.useActionState=Lt,sa.useOptimistic=Lt;var Hl={readContext:ce,use:Hi,useCallback:function(t,e){return be().memoizedState=[t,e===void 0?null:e],t},useContext:ce,useEffect:Yd,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,xi(4194308,4,Xd.bind(null,e,t),a)},useLayoutEffect:function(t,e){return xi(4194308,4,t,e)},useInsertionEffect:function(t,e){xi(4,2,t,e)},useMemo:function(t,e){var a=be();e=e===void 0?null:e;var l=t();if(Nl){Ya(!0);try{t()}finally{Ya(!1)}}return a.memoizedState=[l,e],l},useReducer:function(t,e,a){var l=be();if(a!==void 0){var n=a(e);if(Nl){Ya(!0);try{a(e)}finally{Ya(!1)}}}else n=e;return l.memoizedState=l.baseState=n,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},l.queue=t,t=t.dispatch=Vv.bind(null,ct,t),[l.memoizedState,t]},useRef:function(t){var e=be();return t={current:t},e.memoizedState=t},useState:function(t){t=js(t);var e=t.queue,a=Id.bind(null,ct,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:qs,useDeferredValue:function(t,e){var a=be();return Qs(a,t,e)},useTransition:function(){var t=js(!1);return t=kd.bind(null,ct,t.queue,!0,!1),be().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var l=ct,n=be();if(St){if(a===void 0)throw Error(r(407));a=a()}else{if(a=e(),Ct===null)throw Error(r(349));vt&60||Ad(l,e,a)}n.memoizedState=a;var i={value:a,getSnapshot:e};return n.queue=i,Yd(Dd.bind(null,l,i,t),[t]),l.flags|=2048,Rn(9,Od.bind(null,l,i,a,e),{destroy:void 0},null),a},useId:function(){var t=be(),e=Ct.identifierPrefix;if(St){var a=va,l=ma;a=(l&~(1<<32-_e(l)-1)).toString(32)+a,e=":"+e+"R"+a,a=Ui++,0 title"))),ae(i,l,a),i[ie]=t,$t(i),l=i;break t;case"link":var f=zy("link","href",n).get(l+(a.href||""));if(f){for(var o=0;o<\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof l.is=="string"?n.createElement("select",{is:l.is}):n.createElement("select"),l.multiple?t.multiple=!0:l.size&&(t.size=l.size);break;default:t=typeof l.is=="string"?n.createElement(a,{is:l.is}):n.createElement(a)}}t[ie]=e,t[ge]=l;t:for(n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.tag!==27&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break t;for(;n.sibling===null;){if(n.return===null||n.return===e)break t;n=n.return}n.sibling.return=n.return,n=n.sibling}e.stateNode=t;t:switch(ae(t,a,l),a){case"button":case"input":case"select":case"textarea":t=!!l.autoFocus;break t;case"img":t=!0;break t;default:t=!1}t&&Oa(e)}}return Ht(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==l&&Oa(e);else{if(typeof l!="string"&&e.stateNode===null)throw Error(r(166));if(t=Ba.current,ou(e)){if(t=e.stateNode,a=e.memoizedProps,l=null,n=ye,n!==null)switch(n.tag){case 27:case 5:l=n.memoizedProps}t[ie]=e,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||vy(t.nodeValue,a)),t||Cl(e)}else t=ac(t).createTextNode(l),t[ie]=e,e.stateNode=t}return Ht(e),null;case 13:if(l=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(n=ou(e),l!==null&&l.dehydrated!==null){if(t===null){if(!n)throw Error(r(318));if(n=e.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[ie]=e}else du(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ht(e),n=!1}else We!==null&&(_r(We),We=null),n=!0;if(!n)return e.flags&256?(ga(e),e):(ga(e),null)}if(ga(e),e.flags&128)return e.lanes=a,e;if(a=l!==null,t=t!==null&&t.memoizedState!==null,a){l=e.child,n=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(n=l.alternate.memoizedState.cachePool.pool);var i=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==n&&(l.flags|=2048)}return a!==t&&a&&(e.child.flags|=8192),Zi(e,e.updateQueue),Ht(e),null;case 4:return nn(),t===null&&jr(e.stateNode.containerInfo),Ht(e),null;case 10:return Ea(e.type),Ht(e),null;case 19:if(Gt(Kt),n=e.memoizedState,n===null)return Ht(e),null;if(l=(e.flags&128)!==0,i=n.rendering,i===null)if(l)Nu(n,!1);else{if(qt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(i=zi(t),i!==null){for(e.flags|=128,Nu(n,!1),t=i.updateQueue,e.updateQueue=t,Zi(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)Vh(a,t),a=a.sibling;return Nt(Kt,Kt.current&1|2),e.child}t=t.sibling}n.tail!==null&&ua()>Ki&&(e.flags|=128,l=!0,Nu(n,!1),e.lanes=4194304)}else{if(!l)if(t=zi(i),t!==null){if(e.flags|=128,l=!0,t=t.updateQueue,e.updateQueue=t,Zi(e,t),Nu(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!St)return Ht(e),null}else 2*ua()-n.renderingStartTime>Ki&&a!==536870912&&(e.flags|=128,l=!0,Nu(n,!1),e.lanes=4194304);n.isBackwards?(i.sibling=e.child,e.child=i):(t=n.last,t!==null?t.sibling=i:e.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ua(),e.sibling=null,t=Kt.current,Nt(Kt,l?t&1|2:t&1),e):(Ht(e),null);case 22:case 23:return ga(e),Ts(),l=e.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(e.flags|=8192):l&&(e.flags|=8192),l?a&536870912&&!(e.flags&128)&&(Ht(e),e.subtreeFlags&6&&(e.flags|=8192)):Ht(e),a=e.updateQueue,a!==null&&Zi(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),l!==a&&(e.flags|=2048),t!==null&&Gt(Ul),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Ea(Jt),Ht(e),null;case 25:return null}throw Error(r(156,e.tag))}function Wv(t,e){switch(ps(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ea(Jt),nn(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return li(e),null;case 13:if(ga(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(r(340));du()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Gt(Kt),null;case 4:return nn(),null;case 10:return Ea(e.type),null;case 22:case 23:return ga(e),Ts(),t!==null&&Gt(Ul),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Ea(Jt),null;case 25:return null;default:return null}}function Jh(t,e){switch(ps(e),e.tag){case 3:Ea(Jt),nn();break;case 26:case 27:case 5:li(e);break;case 4:nn();break;case 13:ga(e);break;case 19:Gt(Kt);break;case 10:Ea(e.type);break;case 22:case 23:ga(e),Ts(),t!==null&&Gt(Ul);break;case 24:Ea(Jt)}}var Pv={getCacheForType:function(t){var e=ce(Jt),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a}},Iv=typeof WeakMap=="function"?WeakMap:Map,jt=0,Ct=null,rt=null,vt=0,Mt=0,Re=null,Da=!1,Un=!1,vr=!1,Ra=0,qt=0,al=0,Yl=0,gr=0,Xe=0,Nn=0,Hu=null,ra=null,pr=!1,br=0,Ki=1/0,Ji=null,ll=null,ki=!1,Ll=null,ju=0,Sr=0,Er=null,xu=0,Tr=null;function ze(){if(jt&2&&vt!==0)return vt&-vt;if(w.T!==null){var t=_n;return t!==0?t:Mr()}return yo()}function kh(){Xe===0&&(Xe=!(vt&536870912)||St?so():536870912);var t=Be.current;return t!==null&&(t.flags|=32),Xe}function me(t,e,a){(t===Ct&&Mt===2||t.cancelPendingCommit!==null)&&(Hn(t,0),za(t,vt,Xe,!1)),In(t,a),(!(jt&2)||t!==Ct)&&(t===Ct&&(!(jt&2)&&(Yl|=a),qt===4&&za(t,vt,Xe,!1)),fa(t))}function $h(t,e,a){if(jt&6)throw Error(r(327));var l=!a&&(e&60)===0&&(e&t.expiredLanes)===0||Pn(t,e),n=l?a1(t,e):Dr(t,e,!0),i=l;do{if(n===0){Un&&!l&&za(t,e,0,!1);break}else if(n===6)za(t,e,0,!Da);else{if(a=t.current.alternate,i&&!t1(a)){n=Dr(t,e,!1),i=!1;continue}if(n===2){if(i=e,t.errorRecoveryDisabledLanes&i)var f=0;else f=t.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){e=f;t:{var o=t;n=Hu;var h=o.current.memoizedState.isDehydrated;if(h&&(Hn(o,f).flags|=256),f=Dr(o,f,!1),f!==2){if(vr&&!h){o.errorRecoveryDisabledLanes|=i,Yl|=i,n=4;break t}i=ra,ra=n,i!==null&&_r(i)}n=f}if(i=!1,n!==2)continue}}if(n===1){Hn(t,0),za(t,e,0,!0);break}t:{switch(l=t,n){case 0:case 1:throw Error(r(345));case 4:if((e&4194176)===e){za(l,e,Xe,!Da);break t}break;case 2:ra=null;break;case 3:case 5:break;default:throw Error(r(329))}if(l.finishedWork=a,l.finishedLanes=e,(e&62914560)===e&&(i=br+300-ua(),10a?32:a,w.T=null,Ll===null)var i=!1;else{a=Er,Er=null;var f=Ll,o=ju;if(Ll=null,ju=0,jt&6)throw Error(r(331));var h=jt;if(jt|=4,Gh(f.current),Bh(f,f.current,o,a),jt=h,wu(0,!1),Te&&typeof Te.onPostCommitFiberRoot=="function")try{Te.onPostCommitFiberRoot(Wn,f)}catch{}i=!0}return i}finally{Y.p=n,w.T=l,ny(t,e)}}return!1}function uy(t,e,a){e=we(a,e),e=Vs(t.stateNode,e,2),t=Wa(t,e,2),t!==null&&(In(t,2),fa(t))}function zt(t,e,a){if(t.tag===3)uy(t,t,a);else for(;e!==null;){if(e.tag===3){uy(e,t,a);break}else if(e.tag===1){var l=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ll===null||!ll.has(l))){t=we(a,t),a=sh(2),l=Wa(e,a,2),l!==null&&(rh(a,l,e,t),In(l,2),fa(l));break}}e=e.return}}function Rr(t,e,a){var l=t.pingCache;if(l===null){l=t.pingCache=new Iv;var n=new Set;l.set(e,n)}else n=l.get(e),n===void 0&&(n=new Set,l.set(e,n));n.has(a)||(vr=!0,n.add(a),t=u1.bind(null,t,e,a),e.then(t,t))}function u1(t,e,a){var l=t.pingCache;l!==null&&l.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Ct===t&&(vt&a)===a&&(qt===4||qt===3&&(vt&62914560)===vt&&300>ua()-br?!(jt&2)&&Hn(t,0):gr|=a,Nn===vt&&(Nn=0)),fa(t)}function iy(t,e){e===0&&(e=ro()),t=Xa(t,e),t!==null&&(In(t,e),fa(t))}function i1(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),iy(t,a)}function c1(t,e){var a=0;switch(t.tag){case 13:var l=t.stateNode,n=t.memoizedState;n!==null&&(a=n.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(e),iy(t,a)}function s1(t,e){return Zc(t,e)}var Wi=null,wn=null,zr=!1,Pi=!1,Cr=!1,Gl=0;function fa(t){t!==wn&&t.next===null&&(wn===null?Wi=wn=t:wn=wn.next=t),Pi=!0,zr||(zr=!0,f1(r1))}function wu(t,e){if(!Cr&&Pi){Cr=!0;do for(var a=!1,l=Wi;l!==null;){if(t!==0){var n=l.pendingLanes;if(n===0)var i=0;else{var f=l.suspendedLanes,o=l.pingedLanes;i=(1<<31-_e(42|t)+1)-1,i&=n&~(f&~o),i=i&201326677?i&201326677|1:i?i|2:0}i!==0&&(a=!0,ry(l,i))}else i=vt,i=ci(l,l===Ct?i:0),!(i&3)||Pn(l,i)||(a=!0,ry(l,i));l=l.next}while(a);Cr=!1}}function r1(){Pi=zr=!1;var t=0;Gl!==0&&(p1()&&(t=Gl),Gl=0);for(var e=ua(),a=null,l=Wi;l!==null;){var n=l.next,i=cy(l,e);i===0?(l.next=null,a===null?Wi=n:a.next=n,n===null&&(wn=a)):(a=l,(t!==0||i&3)&&(Pi=!0)),l=n}wu(t)}function cy(t,e){for(var a=t.suspendedLanes,l=t.pingedLanes,n=t.expirationTimes,i=t.pendingLanes&-62914561;0"u"?null:document;function Ay(t,e,a){var l=Qn;if(l&&typeof e=="string"&&e){var n=je(e);n='link[rel="'+t+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),_y.has(n)||(_y.add(n),t={rel:t,crossOrigin:a,href:e},l.querySelector(n)===null&&(e=l.createElement("link"),ae(e,"link",t),$t(e),l.head.appendChild(e)))}}function D1(t){Ca.D(t),Ay("dns-prefetch",t,null)}function R1(t,e){Ca.C(t,e),Ay("preconnect",t,e)}function z1(t,e,a){Ca.L(t,e,a);var l=Qn;if(l&&t&&e){var n='link[rel="preload"][as="'+je(e)+'"]';e==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+je(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+je(a.imageSizes)+'"]')):n+='[href="'+je(t)+'"]';var i=n;switch(e){case"style":i=Bn(t);break;case"script":i=Yn(t)}Ve.has(i)||(t=ut({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ve.set(i,t),l.querySelector(n)!==null||e==="style"&&l.querySelector(Bu(i))||e==="script"&&l.querySelector(Yu(i))||(e=l.createElement("link"),ae(e,"link",t),$t(e),l.head.appendChild(e)))}}function C1(t,e){Ca.m(t,e);var a=Qn;if(a&&t){var l=e&&typeof e.as=="string"?e.as:"script",n='link[rel="modulepreload"][as="'+je(l)+'"][href="'+je(t)+'"]',i=n;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Yn(t)}if(!Ve.has(i)&&(t=ut({rel:"modulepreload",href:t},e),Ve.set(i,t),a.querySelector(n)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Yu(i)))return}l=a.createElement("link"),ae(l,"link",t),$t(l),a.head.appendChild(l)}}}function M1(t,e,a){Ca.S(t,e,a);var l=Qn;if(l&&t){var n=sn(l).hoistableStyles,i=Bn(t);e=e||"default";var f=n.get(i);if(!f){var o={loading:0,preload:null};if(f=l.querySelector(Bu(i)))o.loading=5;else{t=ut({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ve.get(i))&&Xr(t,a);var h=f=l.createElement("link");$t(h),ae(h,"link",t),h._p=new Promise(function(b,C){h.onload=b,h.onerror=C}),h.addEventListener("load",function(){o.loading|=1}),h.addEventListener("error",function(){o.loading|=2}),o.loading|=4,nc(f,e,l)}f={type:"stylesheet",instance:f,count:1,state:o},n.set(i,f)}}}function U1(t,e){Ca.X(t,e);var a=Qn;if(a&&t){var l=sn(a).hoistableScripts,n=Yn(t),i=l.get(n);i||(i=a.querySelector(Yu(n)),i||(t=ut({src:t,async:!0},e),(e=Ve.get(n))&&Vr(t,e),i=a.createElement("script"),$t(i),ae(i,"link",t),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function N1(t,e){Ca.M(t,e);var a=Qn;if(a&&t){var l=sn(a).hoistableScripts,n=Yn(t),i=l.get(n);i||(i=a.querySelector(Yu(n)),i||(t=ut({src:t,async:!0,type:"module"},e),(e=Ve.get(n))&&Vr(t,e),i=a.createElement("script"),$t(i),ae(i,"link",t),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(n,i))}}function Oy(t,e,a,l){var n=(n=Ba.current)?lc(n):null;if(!n)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Bn(a.href),a=sn(n).hoistableStyles,l=a.get(e),l||(l={type:"style",instance:null,count:0,state:null},a.set(e,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Bn(a.href);var i=sn(n).hoistableStyles,f=i.get(t);if(f||(n=n.ownerDocument||n,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(t,f),(i=n.querySelector(Bu(t)))&&!i._p&&(f.instance=i,f.state.loading=5),Ve.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ve.set(t,a),i||H1(n,t,a,f.state))),e&&l===null)throw Error(r(528,""));return f}if(e&&l!==null)throw Error(r(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Yn(a),a=sn(n).hoistableScripts,l=a.get(e),l||(l={type:"script",instance:null,count:0,state:null},a.set(e,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Bn(t){return'href="'+je(t)+'"'}function Bu(t){return'link[rel="stylesheet"]['+t+"]"}function Dy(t){return ut({},t,{"data-precedence":t.precedence,precedence:null})}function H1(t,e,a,l){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?l.loading=1:(e=t.createElement("link"),l.preload=e,e.addEventListener("load",function(){return l.loading|=1}),e.addEventListener("error",function(){return l.loading|=2}),ae(e,"link",a),$t(e),t.head.appendChild(e))}function Yn(t){return'[src="'+je(t)+'"]'}function Yu(t){return"script[async]"+t}function Ry(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var l=t.querySelector('style[data-href~="'+je(a.href)+'"]');if(l)return e.instance=l,$t(l),l;var n=ut({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),$t(l),ae(l,"style",n),nc(l,a.precedence,t),e.instance=l;case"stylesheet":n=Bn(a.href);var i=t.querySelector(Bu(n));if(i)return e.state.loading|=4,e.instance=i,$t(i),i;l=Dy(a),(n=Ve.get(n))&&Xr(l,n),i=(t.ownerDocument||t).createElement("link"),$t(i);var f=i;return f._p=new Promise(function(o,h){f.onload=o,f.onerror=h}),ae(i,"link",l),e.state.loading|=4,nc(i,a.precedence,t),e.instance=i;case"script":return i=Yn(a.src),(n=t.querySelector(Yu(i)))?(e.instance=n,$t(n),n):(l=a,(n=Ve.get(i))&&(l=ut({},a),Vr(l,n)),t=t.ownerDocument||t,n=t.createElement("script"),$t(n),ae(n,"link",l),t.head.appendChild(n),e.instance=n);case"void":return null;default:throw Error(r(443,e.type))}else e.type==="stylesheet"&&!(e.state.loading&4)&&(l=e.instance,e.state.loading|=4,nc(l,a.precedence,t));return e.instance}function nc(t,e,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=l.length?l[l.length-1]:null,i=n,f=0;f title"):null)}function j1(t,e,a){if(a===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function My(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}var Lu=null;function x1(){}function w1(t,e,a){if(Lu===null)throw Error(r(475));var l=Lu;if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var n=Bn(a.href),i=t.querySelector(Bu(n));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=ic.bind(l),t.then(l,l)),e.state.loading|=4,e.instance=i,$t(i);return}i=t.ownerDocument||t,a=Dy(a),(n=Ve.get(n))&&Xr(a,n),i=i.createElement("link"),$t(i);var f=i;f._p=new Promise(function(o,h){f.onload=o,f.onerror=h}),ae(i,"link",a),e.instance=i}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(e,t),(t=e.state.preload)&&!(e.state.loading&3)&&(l.count++,e=ic.bind(l),t.addEventListener("load",e),t.addEventListener("error",e))}}function q1(){if(Lu===null)throw Error(r(475));var t=Lu;return t.stylesheets&&t.count===0&&Zr(t,t.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(c)}catch(u){console.error(u)}}return c(),bc.exports=Fy(),bc.exports}var Py=Wy();const Iy=bt(Py);var Gn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(c){return this.listeners.add(c),this.onSubscribe(),()=>{this.listeners.delete(c),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ol=typeof window>"u"||"Deno"in globalThis;function Ce(){}function t0(c,u){return typeof c=="function"?c(u):c}function _c(c){return typeof c=="number"&&c>=0&&c!==1/0}function vf(c,u){return Math.max(c+(u||0)-Date.now(),0)}function Xl(c,u){return typeof c=="function"?c(u):c}function Ze(c,u){return typeof c=="function"?c(u):c}function gf(c,u){const{type:s="all",exact:r,fetchStatus:d,predicate:p,queryKey:E,stale:D}=c;if(E){if(r){if(u.queryHash!==Ac(E,u.options))return!1}else if(!Vn(u.queryKey,E))return!1}if(s!=="all"){const T=u.isActive();if(s==="active"&&!T||s==="inactive"&&T)return!1}return!(typeof D=="boolean"&&u.isStale()!==D||d&&d!==u.state.fetchStatus||p&&!p(u))}function pf(c,u){const{exact:s,status:r,predicate:d,mutationKey:p}=c;if(p){if(!u.options.mutationKey)return!1;if(s){if(Xn(u.options.mutationKey)!==Xn(p))return!1}else if(!Vn(u.options.mutationKey,p))return!1}return!(r&&u.state.status!==r||d&&!d(u))}function Ac(c,u){return((u==null?void 0:u.queryKeyHashFn)||Xn)(c)}function Xn(c){return JSON.stringify(c,(u,s)=>Dc(s)?Object.keys(s).sort().reduce((r,d)=>(r[d]=s[d],r),{}):s)}function Vn(c,u){return c===u?!0:typeof c!=typeof u?!1:c&&u&&typeof c=="object"&&typeof u=="object"?!Object.keys(u).some(s=>!Vn(c[s],u[s])):!1}function bf(c,u){if(c===u)return c;const s=Sf(c)&&Sf(u);if(s||Dc(c)&&Dc(u)){const r=s?c:Object.keys(c),d=r.length,p=s?u:Object.keys(u),E=p.length,D=s?[]:{};let T=0;for(let y=0;y{setTimeout(u,c)})}function Rc(c,u,s){return typeof s.structuralSharing=="function"?s.structuralSharing(c,u):s.structuralSharing!==!1?bf(c,u):u}function a0(c,u,s=0){const r=[...c,u];return s&&r.length>s?r.slice(1):r}function l0(c,u,s=0){const r=[u,...c];return s&&r.length>s?r.slice(0,-1):r}var zc=Symbol();function Tf(c,u){return!c.queryFn&&(u!=null&&u.initialPromise)?()=>u.initialPromise:!c.queryFn||c.queryFn===zc?()=>Promise.reject(new Error(`Missing queryFn: '${c.queryHash}'`)):c.queryFn}var n0=(Ff=class extends Gn{constructor(){super();I(this,hl);I(this,Na);I(this,Zl);L(this,Zl,u=>{if(!ol&&window.addEventListener){const s=()=>u();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){g(this,Na)||this.setEventListener(g(this,Zl))}onUnsubscribe(){var u;this.hasListeners()||((u=g(this,Na))==null||u.call(this),L(this,Na,void 0))}setEventListener(u){var s;L(this,Zl,u),(s=g(this,Na))==null||s.call(this),L(this,Na,u(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(u){g(this,hl)!==u&&(L(this,hl,u),this.onFocus())}onFocus(){const u=this.isFocused();this.listeners.forEach(s=>{s(u)})}isFocused(){var u;return typeof g(this,hl)=="boolean"?g(this,hl):((u=globalThis.document)==null?void 0:u.visibilityState)!=="hidden"}},hl=new WeakMap,Na=new WeakMap,Zl=new WeakMap,Ff),Cc=new n0,u0=(Wf=class extends Gn{constructor(){super();I(this,Kl,!0);I(this,Ha);I(this,Jl);L(this,Jl,u=>{if(!ol&&window.addEventListener){const s=()=>u(!0),r=()=>u(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",r)}}})}onSubscribe(){g(this,Ha)||this.setEventListener(g(this,Jl))}onUnsubscribe(){var u;this.hasListeners()||((u=g(this,Ha))==null||u.call(this),L(this,Ha,void 0))}setEventListener(u){var s;L(this,Jl,u),(s=g(this,Ha))==null||s.call(this),L(this,Ha,u(this.setOnline.bind(this)))}setOnline(u){g(this,Kl)!==u&&(L(this,Kl,u),this.listeners.forEach(r=>{r(u)}))}isOnline(){return g(this,Kl)}},Kl=new WeakMap,Ha=new WeakMap,Jl=new WeakMap,Wf),ku=new u0;function Mc(){let c,u;const s=new Promise((d,p)=>{c=d,u=p});s.status="pending",s.catch(()=>{});function r(d){Object.assign(s,d),delete s.resolve,delete s.reject}return s.resolve=d=>{r({status:"fulfilled",value:d}),c(d)},s.reject=d=>{r({status:"rejected",reason:d}),u(d)},s}function i0(c){return Math.min(1e3*2**c,3e4)}function _f(c){return(c??"online")==="online"?ku.isOnline():!0}var Af=class extends Error{constructor(c){super("CancelledError"),this.revert=c==null?void 0:c.revert,this.silent=c==null?void 0:c.silent}};function Uc(c){return c instanceof Af}function Of(c){let u=!1,s=0,r=!1,d;const p=Mc(),E=B=>{var Q;r||(H(new Af(B)),(Q=c.abort)==null||Q.call(c))},D=()=>{u=!0},T=()=>{u=!1},y=()=>Cc.isFocused()&&(c.networkMode==="always"||ku.isOnline())&&c.canRun(),O=()=>_f(c.networkMode)&&c.canRun(),M=B=>{var Q;r||(r=!0,(Q=c.onSuccess)==null||Q.call(c,B),d==null||d(),p.resolve(B))},H=B=>{var Q;r||(r=!0,(Q=c.onError)==null||Q.call(c,B),d==null||d(),p.reject(B))},x=()=>new Promise(B=>{var Q;d=K=>{(r||y())&&B(K)},(Q=c.onPause)==null||Q.call(c)}).then(()=>{var B;d=void 0,r||(B=c.onContinue)==null||B.call(c)}),Z=()=>{if(r)return;let B;const Q=s===0?c.initialPromise:void 0;try{B=Q??c.fn()}catch(K){B=Promise.reject(K)}Promise.resolve(B).then(M).catch(K=>{var ot;if(r)return;const k=c.retry??(ol?0:3),nt=c.retryDelay??i0,tt=typeof nt=="function"?nt(s,K):nt,X=k===!0||typeof k=="number"&&sy()?void 0:x()).then(()=>{u?H(K):Z()})})};return{promise:p,cancel:E,continue:()=>(d==null||d(),p),cancelRetry:D,continueRetry:T,canStart:O,start:()=>(O()?Z():x().then(Z),p)}}function c0(){let c=[],u=0,s=D=>{D()},r=D=>{D()},d=D=>setTimeout(D,0);const p=D=>{u?c.push(D):d(()=>{s(D)})},E=()=>{const D=c;c=[],D.length&&d(()=>{r(()=>{D.forEach(T=>{s(T)})})})};return{batch:D=>{let T;u++;try{T=D()}finally{u--,u||E()}return T},batchCalls:D=>(...T)=>{p(()=>{D(...T)})},schedule:p,setNotifyFunction:D=>{s=D},setBatchNotifyFunction:D=>{r=D},setScheduler:D=>{d=D}}}var It=c0(),Df=(Pf=class{constructor(){I(this,yl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_c(this.gcTime)&&L(this,yl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(c){this.gcTime=Math.max(this.gcTime||0,c??(ol?1/0:5*60*1e3))}clearGcTimeout(){g(this,yl)&&(clearTimeout(g(this,yl)),L(this,yl,void 0))}},yl=new WeakMap,Pf),s0=(If=class extends Df{constructor(u){super();I(this,ke);I(this,kl);I(this,$l);I(this,Ue);I(this,ml);I(this,ne);I(this,Kn);I(this,vl);L(this,vl,!1),L(this,Kn,u.defaultOptions),this.setOptions(u.options),this.observers=[],L(this,ml,u.client),L(this,Ue,g(this,ml).getQueryCache()),this.queryKey=u.queryKey,this.queryHash=u.queryHash,L(this,kl,r0(this.options)),this.state=u.state??g(this,kl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var u;return(u=g(this,ne))==null?void 0:u.promise}setOptions(u){this.options={...g(this,Kn),...u},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&g(this,Ue).remove(this)}setData(u,s){const r=Rc(this.state.data,u,this.options);return ht(this,ke,Ma).call(this,{data:r,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),r}setState(u,s){ht(this,ke,Ma).call(this,{type:"setState",state:u,setStateOptions:s})}cancel(u){var r,d;const s=(r=g(this,ne))==null?void 0:r.promise;return(d=g(this,ne))==null||d.cancel(u),s?s.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(g(this,kl))}isActive(){return this.observers.some(u=>Ze(u.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zc||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(u=>u.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(u=0){return this.state.isInvalidated||this.state.data===void 0||!vf(this.state.dataUpdatedAt,u)}onFocus(){var s;const u=this.observers.find(r=>r.shouldFetchOnWindowFocus());u==null||u.refetch({cancelRefetch:!1}),(s=g(this,ne))==null||s.continue()}onOnline(){var s;const u=this.observers.find(r=>r.shouldFetchOnReconnect());u==null||u.refetch({cancelRefetch:!1}),(s=g(this,ne))==null||s.continue()}addObserver(u){this.observers.includes(u)||(this.observers.push(u),this.clearGcTimeout(),g(this,Ue).notify({type:"observerAdded",query:this,observer:u}))}removeObserver(u){this.observers.includes(u)&&(this.observers=this.observers.filter(s=>s!==u),this.observers.length||(g(this,ne)&&(g(this,vl)?g(this,ne).cancel({revert:!0}):g(this,ne).cancelRetry()),this.scheduleGc()),g(this,Ue).notify({type:"observerRemoved",query:this,observer:u}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ht(this,ke,Ma).call(this,{type:"invalidate"})}fetch(u,s){var T,y,O;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(g(this,ne))return g(this,ne).continueRetry(),g(this,ne).promise}if(u&&this.setOptions(u),!this.options.queryFn){const M=this.observers.find(H=>H.options.queryFn);M&&this.setOptions(M.options)}const r=new AbortController,d=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(L(this,vl,!0),r.signal)})},p=()=>{const M=Tf(this.options,s),H={client:g(this,ml),queryKey:this.queryKey,meta:this.meta};return d(H),L(this,vl,!1),this.options.persister?this.options.persister(M,H,this):M(H)},E={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:g(this,ml),state:this.state,fetchFn:p};d(E),(T=this.options.behavior)==null||T.onFetch(E,this),L(this,$l,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=E.fetchOptions)==null?void 0:y.meta))&&ht(this,ke,Ma).call(this,{type:"fetch",meta:(O=E.fetchOptions)==null?void 0:O.meta});const D=M=>{var H,x,Z,B;Uc(M)&&M.silent||ht(this,ke,Ma).call(this,{type:"error",error:M}),Uc(M)||((x=(H=g(this,Ue).config).onError)==null||x.call(H,M,this),(B=(Z=g(this,Ue).config).onSettled)==null||B.call(Z,this.state.data,M,this)),this.scheduleGc()};return L(this,ne,Of({initialPromise:s==null?void 0:s.initialPromise,fn:E.fetchFn,abort:r.abort.bind(r),onSuccess:M=>{var H,x,Z,B;if(M===void 0){D(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(M)}catch(Q){D(Q);return}(x=(H=g(this,Ue).config).onSuccess)==null||x.call(H,M,this),(B=(Z=g(this,Ue).config).onSettled)==null||B.call(Z,M,this.state.error,this),this.scheduleGc()},onError:D,onFail:(M,H)=>{ht(this,ke,Ma).call(this,{type:"failed",failureCount:M,error:H})},onPause:()=>{ht(this,ke,Ma).call(this,{type:"pause"})},onContinue:()=>{ht(this,ke,Ma).call(this,{type:"continue"})},retry:E.options.retry,retryDelay:E.options.retryDelay,networkMode:E.options.networkMode,canRun:()=>!0})),g(this,ne).start()}},kl=new WeakMap,$l=new WeakMap,Ue=new WeakMap,ml=new WeakMap,ne=new WeakMap,Kn=new WeakMap,vl=new WeakMap,ke=new WeakSet,Ma=function(u){const s=r=>{switch(u.type){case"failed":return{...r,fetchFailureCount:u.failureCount,fetchFailureReason:u.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Rf(r.data,this.options),fetchMeta:u.meta??null};case"success":return{...r,data:u.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:u.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!u.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const d=u.error;return Uc(d)&&d.revert&&g(this,$l)?{...g(this,$l),fetchStatus:"idle"}:{...r,error:d,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...u.state}}};this.state=s(this.state),It.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),g(this,Ue).notify({query:this,type:"updated",action:u})})},If);function Rf(c,u){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_f(u.networkMode)?"fetching":"paused",...c===void 0&&{error:null,status:"pending"}}}function r0(c){const u=typeof c.initialData=="function"?c.initialData():c.initialData,s=u!==void 0,r=s?typeof c.initialDataUpdatedAt=="function"?c.initialDataUpdatedAt():c.initialDataUpdatedAt:0;return{data:u,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var f0=(to=class extends Gn{constructor(u={}){super();I(this,ta);this.config=u,L(this,ta,new Map)}build(u,s,r){const d=s.queryKey,p=s.queryHash??Ac(d,s);let E=this.get(p);return E||(E=new s0({client:u,queryKey:d,queryHash:p,options:u.defaultQueryOptions(s),state:r,defaultOptions:u.getQueryDefaults(d)}),this.add(E)),E}add(u){g(this,ta).has(u.queryHash)||(g(this,ta).set(u.queryHash,u),this.notify({type:"added",query:u}))}remove(u){const s=g(this,ta).get(u.queryHash);s&&(u.destroy(),s===u&&g(this,ta).delete(u.queryHash),this.notify({type:"removed",query:u}))}clear(){It.batch(()=>{this.getAll().forEach(u=>{this.remove(u)})})}get(u){return g(this,ta).get(u)}getAll(){return[...g(this,ta).values()]}find(u){const s={exact:!0,...u};return this.getAll().find(r=>gf(s,r))}findAll(u={}){const s=this.getAll();return Object.keys(u).length>0?s.filter(r=>gf(u,r)):s}notify(u){It.batch(()=>{this.listeners.forEach(s=>{s(u)})})}onFocus(){It.batch(()=>{this.getAll().forEach(u=>{u.onFocus()})})}onOnline(){It.batch(()=>{this.getAll().forEach(u=>{u.onOnline()})})}},ta=new WeakMap,to),o0=(eo=class extends Df{constructor(u){super();I(this,aa);I(this,ea);I(this,fe);I(this,gl);this.mutationId=u.mutationId,L(this,fe,u.mutationCache),L(this,ea,[]),this.state=u.state||d0(),this.setOptions(u.options),this.scheduleGc()}setOptions(u){this.options=u,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(u){g(this,ea).includes(u)||(g(this,ea).push(u),this.clearGcTimeout(),g(this,fe).notify({type:"observerAdded",mutation:this,observer:u}))}removeObserver(u){L(this,ea,g(this,ea).filter(s=>s!==u)),this.scheduleGc(),g(this,fe).notify({type:"observerRemoved",mutation:this,observer:u})}optionalRemove(){g(this,ea).length||(this.state.status==="pending"?this.scheduleGc():g(this,fe).remove(this))}continue(){var u;return((u=g(this,gl))==null?void 0:u.continue())??this.execute(this.state.variables)}async execute(u){var d,p,E,D,T,y,O,M,H,x,Z,B,Q,K,k,nt,tt,X,ot,At;L(this,gl,Of({fn:()=>this.options.mutationFn?this.options.mutationFn(u):Promise.reject(new Error("No mutationFn found")),onFail:(pt,w)=>{ht(this,aa,rl).call(this,{type:"failed",failureCount:pt,error:w})},onPause:()=>{ht(this,aa,rl).call(this,{type:"pause"})},onContinue:()=>{ht(this,aa,rl).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>g(this,fe).canRun(this)}));const s=this.state.status==="pending",r=!g(this,gl).canStart();try{if(!s){ht(this,aa,rl).call(this,{type:"pending",variables:u,isPaused:r}),await((p=(d=g(this,fe).config).onMutate)==null?void 0:p.call(d,u,this));const w=await((D=(E=this.options).onMutate)==null?void 0:D.call(E,u));w!==this.state.context&&ht(this,aa,rl).call(this,{type:"pending",context:w,variables:u,isPaused:r})}const pt=await g(this,gl).start();return await((y=(T=g(this,fe).config).onSuccess)==null?void 0:y.call(T,pt,u,this.state.context,this)),await((M=(O=this.options).onSuccess)==null?void 0:M.call(O,pt,u,this.state.context)),await((x=(H=g(this,fe).config).onSettled)==null?void 0:x.call(H,pt,null,this.state.variables,this.state.context,this)),await((B=(Z=this.options).onSettled)==null?void 0:B.call(Z,pt,null,u,this.state.context)),ht(this,aa,rl).call(this,{type:"success",data:pt}),pt}catch(pt){try{throw await((K=(Q=g(this,fe).config).onError)==null?void 0:K.call(Q,pt,u,this.state.context,this)),await((nt=(k=this.options).onError)==null?void 0:nt.call(k,pt,u,this.state.context)),await((X=(tt=g(this,fe).config).onSettled)==null?void 0:X.call(tt,void 0,pt,this.state.variables,this.state.context,this)),await((At=(ot=this.options).onSettled)==null?void 0:At.call(ot,void 0,pt,u,this.state.context)),pt}finally{ht(this,aa,rl).call(this,{type:"error",error:pt})}}finally{g(this,fe).runNext(this)}}},ea=new WeakMap,fe=new WeakMap,gl=new WeakMap,aa=new WeakSet,rl=function(u){const s=r=>{switch(u.type){case"failed":return{...r,failureCount:u.failureCount,failureReason:u.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:u.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:u.isPaused,status:"pending",variables:u.variables,submittedAt:Date.now()};case"success":return{...r,data:u.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:u.error,failureCount:r.failureCount+1,failureReason:u.error,isPaused:!1,status:"error"}}};this.state=s(this.state),It.batch(()=>{g(this,ea).forEach(r=>{r.onMutationUpdate(u)}),g(this,fe).notify({mutation:this,type:"updated",action:u})})},eo);function d0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var h0=(ao=class extends Gn{constructor(u={}){super();I(this,da);I(this,$e);I(this,Jn);this.config=u,L(this,da,new Set),L(this,$e,new Map),L(this,Jn,0)}build(u,s,r){const d=new o0({mutationCache:this,mutationId:++mc(this,Jn)._,options:u.defaultMutationOptions(s),state:r});return this.add(d),d}add(u){g(this,da).add(u);const s=$u(u);if(typeof s=="string"){const r=g(this,$e).get(s);r?r.push(u):g(this,$e).set(s,[u])}this.notify({type:"added",mutation:u})}remove(u){if(g(this,da).delete(u)){const s=$u(u);if(typeof s=="string"){const r=g(this,$e).get(s);if(r)if(r.length>1){const d=r.indexOf(u);d!==-1&&r.splice(d,1)}else r[0]===u&&g(this,$e).delete(s)}}this.notify({type:"removed",mutation:u})}canRun(u){const s=$u(u);if(typeof s=="string"){const r=g(this,$e).get(s),d=r==null?void 0:r.find(p=>p.state.status==="pending");return!d||d===u}else return!0}runNext(u){var r;const s=$u(u);if(typeof s=="string"){const d=(r=g(this,$e).get(s))==null?void 0:r.find(p=>p!==u&&p.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){It.batch(()=>{g(this,da).forEach(u=>{this.notify({type:"removed",mutation:u})}),g(this,da).clear(),g(this,$e).clear()})}getAll(){return Array.from(g(this,da))}find(u){const s={exact:!0,...u};return this.getAll().find(r=>pf(s,r))}findAll(u={}){return this.getAll().filter(s=>pf(u,s))}notify(u){It.batch(()=>{this.listeners.forEach(s=>{s(u)})})}resumePausedMutations(){const u=this.getAll().filter(s=>s.state.isPaused);return It.batch(()=>Promise.all(u.map(s=>s.continue().catch(Ce))))}},da=new WeakMap,$e=new WeakMap,Jn=new WeakMap,ao);function $u(c){var u;return(u=c.options.scope)==null?void 0:u.id}function zf(c){return{onFetch:(u,s)=>{var O,M,H,x,Z;const r=u.options,d=(H=(M=(O=u.fetchOptions)==null?void 0:O.meta)==null?void 0:M.fetchMore)==null?void 0:H.direction,p=((x=u.state.data)==null?void 0:x.pages)||[],E=((Z=u.state.data)==null?void 0:Z.pageParams)||[];let D={pages:[],pageParams:[]},T=0;const y=async()=>{let B=!1;const Q=nt=>{Object.defineProperty(nt,"signal",{enumerable:!0,get:()=>(u.signal.aborted?B=!0:u.signal.addEventListener("abort",()=>{B=!0}),u.signal)})},K=Tf(u.options,u.fetchOptions),k=async(nt,tt,X)=>{if(B)return Promise.reject();if(tt==null&&nt.pages.length)return Promise.resolve(nt);const ot={client:u.client,queryKey:u.queryKey,pageParam:tt,direction:X?"backward":"forward",meta:u.options.meta};Q(ot);const At=await K(ot),{maxPages:pt}=u.options,w=X?l0:a0;return{pages:w(nt.pages,At,pt),pageParams:w(nt.pageParams,tt,pt)}};if(d&&p.length){const nt=d==="backward",tt=nt?y0:Cf,X={pages:p,pageParams:E},ot=tt(r,X);D=await k(X,ot,nt)}else{const nt=c??p.length;do{const tt=T===0?E[0]??r.initialPageParam:Cf(r,D);if(T>0&&tt==null)break;D=await k(D,tt),T++}while(T{var B,Q;return(Q=(B=u.options).persister)==null?void 0:Q.call(B,y,{client:u.client,queryKey:u.queryKey,meta:u.options.meta,signal:u.signal},s)}:u.fetchFn=y}}}function Cf(c,{pages:u,pageParams:s}){const r=u.length-1;return u.length>0?c.getNextPageParam(u[r],u,s[r],s):void 0}function y0(c,{pages:u,pageParams:s}){var r;return u.length>0?(r=c.getPreviousPageParam)==null?void 0:r.call(c,u[0],u,s[0],s):void 0}var m0=(lo=class{constructor(c={}){I(this,xt);I(this,ja);I(this,xa);I(this,Fl);I(this,Wl);I(this,wa);I(this,Pl);I(this,Il);L(this,xt,c.queryCache||new f0),L(this,ja,c.mutationCache||new h0),L(this,xa,c.defaultOptions||{}),L(this,Fl,new Map),L(this,Wl,new Map),L(this,wa,0)}mount(){mc(this,wa)._++,g(this,wa)===1&&(L(this,Pl,Cc.subscribe(async c=>{c&&(await this.resumePausedMutations(),g(this,xt).onFocus())})),L(this,Il,ku.subscribe(async c=>{c&&(await this.resumePausedMutations(),g(this,xt).onOnline())})))}unmount(){var c,u;mc(this,wa)._--,g(this,wa)===0&&((c=g(this,Pl))==null||c.call(this),L(this,Pl,void 0),(u=g(this,Il))==null||u.call(this),L(this,Il,void 0))}isFetching(c){return g(this,xt).findAll({...c,fetchStatus:"fetching"}).length}isMutating(c){return g(this,ja).findAll({...c,status:"pending"}).length}getQueryData(c){var s;const u=this.defaultQueryOptions({queryKey:c});return(s=g(this,xt).get(u.queryHash))==null?void 0:s.state.data}ensureQueryData(c){const u=this.defaultQueryOptions(c),s=g(this,xt).build(this,u),r=s.state.data;return r===void 0?this.fetchQuery(c):(c.revalidateIfStale&&s.isStaleByTime(Xl(u.staleTime,s))&&this.prefetchQuery(u),Promise.resolve(r))}getQueriesData(c){return g(this,xt).findAll(c).map(({queryKey:u,state:s})=>{const r=s.data;return[u,r]})}setQueryData(c,u,s){const r=this.defaultQueryOptions({queryKey:c}),d=g(this,xt).get(r.queryHash),p=d==null?void 0:d.state.data,E=t0(u,p);if(E!==void 0)return g(this,xt).build(this,r).setData(E,{...s,manual:!0})}setQueriesData(c,u,s){return It.batch(()=>g(this,xt).findAll(c).map(({queryKey:r})=>[r,this.setQueryData(r,u,s)]))}getQueryState(c){var s;const u=this.defaultQueryOptions({queryKey:c});return(s=g(this,xt).get(u.queryHash))==null?void 0:s.state}removeQueries(c){const u=g(this,xt);It.batch(()=>{u.findAll(c).forEach(s=>{u.remove(s)})})}resetQueries(c,u){const s=g(this,xt),r={type:"active",...c};return It.batch(()=>(s.findAll(c).forEach(d=>{d.reset()}),this.refetchQueries(r,u)))}cancelQueries(c,u={}){const s={revert:!0,...u},r=It.batch(()=>g(this,xt).findAll(c).map(d=>d.cancel(s)));return Promise.all(r).then(Ce).catch(Ce)}invalidateQueries(c,u={}){return It.batch(()=>{if(g(this,xt).findAll(c).forEach(r=>{r.invalidate()}),(c==null?void 0:c.refetchType)==="none")return Promise.resolve();const s={...c,type:(c==null?void 0:c.refetchType)??(c==null?void 0:c.type)??"active"};return this.refetchQueries(s,u)})}refetchQueries(c,u={}){const s={...u,cancelRefetch:u.cancelRefetch??!0},r=It.batch(()=>g(this,xt).findAll(c).filter(d=>!d.isDisabled()).map(d=>{let p=d.fetch(void 0,s);return s.throwOnError||(p=p.catch(Ce)),d.state.fetchStatus==="paused"?Promise.resolve():p}));return Promise.all(r).then(Ce)}fetchQuery(c){const u=this.defaultQueryOptions(c);u.retry===void 0&&(u.retry=!1);const s=g(this,xt).build(this,u);return s.isStaleByTime(Xl(u.staleTime,s))?s.fetch(u):Promise.resolve(s.state.data)}prefetchQuery(c){return this.fetchQuery(c).then(Ce).catch(Ce)}fetchInfiniteQuery(c){return c.behavior=zf(c.pages),this.fetchQuery(c)}prefetchInfiniteQuery(c){return this.fetchInfiniteQuery(c).then(Ce).catch(Ce)}ensureInfiniteQueryData(c){return c.behavior=zf(c.pages),this.ensureQueryData(c)}resumePausedMutations(){return ku.isOnline()?g(this,ja).resumePausedMutations():Promise.resolve()}getQueryCache(){return g(this,xt)}getMutationCache(){return g(this,ja)}getDefaultOptions(){return g(this,xa)}setDefaultOptions(c){L(this,xa,c)}setQueryDefaults(c,u){g(this,Fl).set(Xn(c),{queryKey:c,defaultOptions:u})}getQueryDefaults(c){const u=[...g(this,Fl).values()],s={};return u.forEach(r=>{Vn(c,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(c,u){g(this,Wl).set(Xn(c),{mutationKey:c,defaultOptions:u})}getMutationDefaults(c){const u=[...g(this,Wl).values()];let s={};return u.forEach(r=>{Vn(c,r.mutationKey)&&(s={...s,...r.defaultOptions})}),s}defaultQueryOptions(c){if(c._defaulted)return c;const u={...g(this,xa).queries,...this.getQueryDefaults(c.queryKey),...c,_defaulted:!0};return u.queryHash||(u.queryHash=Ac(u.queryKey,u)),u.refetchOnReconnect===void 0&&(u.refetchOnReconnect=u.networkMode!=="always"),u.throwOnError===void 0&&(u.throwOnError=!!u.suspense),!u.networkMode&&u.persister&&(u.networkMode="offlineFirst"),u.queryFn===zc&&(u.enabled=!1),u}defaultMutationOptions(c){return c!=null&&c._defaulted?c:{...g(this,xa).mutations,...(c==null?void 0:c.mutationKey)&&this.getMutationDefaults(c.mutationKey),...c,_defaulted:!0}}clear(){g(this,xt).clear(),g(this,ja).clear()}},xt=new WeakMap,ja=new WeakMap,xa=new WeakMap,Fl=new WeakMap,Wl=new WeakMap,wa=new WeakMap,Pl=new WeakMap,Il=new WeakMap,lo),v0=(no=class extends Gn{constructor(u,s){super();I(this,Tt);I(this,ve);I(this,ft);I(this,kn);I(this,oe);I(this,pl);I(this,tn);I(this,qa);I(this,la);I(this,$n);I(this,en);I(this,an);I(this,bl);I(this,Sl);I(this,Qa);I(this,ln,new Set);this.options=s,L(this,ve,u),L(this,la,null),L(this,qa,Mc()),this.options.experimental_prefetchInRender||g(this,qa).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(g(this,ft).addObserver(this),Mf(g(this,ft),this.options)?ht(this,Tt,Ju).call(this):this.updateResult(),ht(this,Tt,af).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nc(g(this,ft),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nc(g(this,ft),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ht(this,Tt,lf).call(this),ht(this,Tt,nf).call(this),g(this,ft).removeObserver(this)}setOptions(u,s){const r=this.options,d=g(this,ft);if(this.options=g(this,ve).defaultQueryOptions(u),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ze(this.options.enabled,g(this,ft))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ht(this,Tt,uf).call(this),g(this,ft).setOptions(this.options),r._defaulted&&!Oc(this.options,r)&&g(this,ve).getQueryCache().notify({type:"observerOptionsUpdated",query:g(this,ft),observer:this});const p=this.hasListeners();p&&Uf(g(this,ft),d,this.options,r)&&ht(this,Tt,Ju).call(this),this.updateResult(s),p&&(g(this,ft)!==d||Ze(this.options.enabled,g(this,ft))!==Ze(r.enabled,g(this,ft))||Xl(this.options.staleTime,g(this,ft))!==Xl(r.staleTime,g(this,ft)))&&ht(this,Tt,Ir).call(this);const E=ht(this,Tt,tf).call(this);p&&(g(this,ft)!==d||Ze(this.options.enabled,g(this,ft))!==Ze(r.enabled,g(this,ft))||E!==g(this,Qa))&&ht(this,Tt,ef).call(this,E)}getOptimisticResult(u){const s=g(this,ve).getQueryCache().build(g(this,ve),u),r=this.createResult(s,u);return p0(this,r)&&(L(this,oe,r),L(this,tn,this.options),L(this,pl,g(this,ft).state)),r}getCurrentResult(){return g(this,oe)}trackResult(u,s){const r={};return Object.keys(u).forEach(d=>{Object.defineProperty(r,d,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(d),s==null||s(d),u[d])})}),r}trackProp(u){g(this,ln).add(u)}getCurrentQuery(){return g(this,ft)}refetch({...u}={}){return this.fetch({...u})}fetchOptimistic(u){const s=g(this,ve).defaultQueryOptions(u),r=g(this,ve).getQueryCache().build(g(this,ve),s);return r.fetch().then(()=>this.createResult(r,s))}fetch(u){return ht(this,Tt,Ju).call(this,{...u,cancelRefetch:u.cancelRefetch??!0}).then(()=>(this.updateResult(),g(this,oe)))}createResult(u,s){var pt;const r=g(this,ft),d=this.options,p=g(this,oe),E=g(this,pl),D=g(this,tn),y=u!==r?u.state:g(this,kn),{state:O}=u;let M={...O},H=!1,x;if(s._optimisticResults){const w=this.hasListeners(),ut=!w&&Mf(u,s),Bt=w&&Uf(u,r,s,d);(ut||Bt)&&(M={...M,...Rf(O.data,u.options)}),s._optimisticResults==="isRestoring"&&(M.fetchStatus="idle")}let{error:Z,errorUpdatedAt:B,status:Q}=M;if(s.select&&M.data!==void 0)if(p&&M.data===(E==null?void 0:E.data)&&s.select===g(this,$n))x=g(this,en);else try{L(this,$n,s.select),x=s.select(M.data),x=Rc(p==null?void 0:p.data,x,s),L(this,en,x),L(this,la,null)}catch(w){L(this,la,w)}else x=M.data;if(s.placeholderData!==void 0&&x===void 0&&Q==="pending"){let w;if(p!=null&&p.isPlaceholderData&&s.placeholderData===(D==null?void 0:D.placeholderData))w=p.data;else if(w=typeof s.placeholderData=="function"?s.placeholderData((pt=g(this,an))==null?void 0:pt.state.data,g(this,an)):s.placeholderData,s.select&&w!==void 0)try{w=s.select(w),L(this,la,null)}catch(ut){L(this,la,ut)}w!==void 0&&(Q="success",x=Rc(p==null?void 0:p.data,w,s),H=!0)}g(this,la)&&(Z=g(this,la),x=g(this,en),B=Date.now(),Q="error");const K=M.fetchStatus==="fetching",k=Q==="pending",nt=Q==="error",tt=k&&K,X=x!==void 0,At={status:Q,fetchStatus:M.fetchStatus,isPending:k,isSuccess:Q==="success",isError:nt,isInitialLoading:tt,isLoading:tt,data:x,dataUpdatedAt:M.dataUpdatedAt,error:Z,errorUpdatedAt:B,failureCount:M.fetchFailureCount,failureReason:M.fetchFailureReason,errorUpdateCount:M.errorUpdateCount,isFetched:M.dataUpdateCount>0||M.errorUpdateCount>0,isFetchedAfterMount:M.dataUpdateCount>y.dataUpdateCount||M.errorUpdateCount>y.errorUpdateCount,isFetching:K,isRefetching:K&&!k,isLoadingError:nt&&!X,isPaused:M.fetchStatus==="paused",isPlaceholderData:H,isRefetchError:nt&&X,isStale:Hc(u,s),refetch:this.refetch,promise:g(this,qa)};if(this.options.experimental_prefetchInRender){const w=Yt=>{At.status==="error"?Yt.reject(At.error):At.data!==void 0&&Yt.resolve(At.data)},ut=()=>{const Yt=L(this,qa,At.promise=Mc());w(Yt)},Bt=g(this,qa);switch(Bt.status){case"pending":u.queryHash===r.queryHash&&w(Bt);break;case"fulfilled":(At.status==="error"||At.data!==Bt.value)&&ut();break;case"rejected":(At.status!=="error"||At.error!==Bt.reason)&&ut();break}}return At}updateResult(u){const s=g(this,oe),r=this.createResult(g(this,ft),this.options);if(L(this,pl,g(this,ft).state),L(this,tn,this.options),g(this,pl).data!==void 0&&L(this,an,g(this,ft)),Oc(r,s))return;L(this,oe,r);const d={},p=()=>{if(!s)return!0;const{notifyOnChangeProps:E}=this.options,D=typeof E=="function"?E():E;if(D==="all"||!D&&!g(this,ln).size)return!0;const T=new Set(D??g(this,ln));return this.options.throwOnError&&T.add("error"),Object.keys(g(this,oe)).some(y=>{const O=y;return g(this,oe)[O]!==s[O]&&T.has(O)})};(u==null?void 0:u.listeners)!==!1&&p()&&(d.listeners=!0),ht(this,Tt,Xy).call(this,{...d,...u})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ht(this,Tt,af).call(this)}},ve=new WeakMap,ft=new WeakMap,kn=new WeakMap,oe=new WeakMap,pl=new WeakMap,tn=new WeakMap,qa=new WeakMap,la=new WeakMap,$n=new WeakMap,en=new WeakMap,an=new WeakMap,bl=new WeakMap,Sl=new WeakMap,Qa=new WeakMap,ln=new WeakMap,Tt=new WeakSet,Ju=function(u){ht(this,Tt,uf).call(this);let s=g(this,ft).fetch(this.options,u);return u!=null&&u.throwOnError||(s=s.catch(Ce)),s},Ir=function(){ht(this,Tt,lf).call(this);const u=Xl(this.options.staleTime,g(this,ft));if(ol||g(this,oe).isStale||!_c(u))return;const r=vf(g(this,oe).dataUpdatedAt,u)+1;L(this,bl,setTimeout(()=>{g(this,oe).isStale||this.updateResult()},r))},tf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(g(this,ft)):this.options.refetchInterval)??!1},ef=function(u){ht(this,Tt,nf).call(this),L(this,Qa,u),!(ol||Ze(this.options.enabled,g(this,ft))===!1||!_c(g(this,Qa))||g(this,Qa)===0)&&L(this,Sl,setInterval(()=>{(this.options.refetchIntervalInBackground||Cc.isFocused())&&ht(this,Tt,Ju).call(this)},g(this,Qa)))},af=function(){ht(this,Tt,Ir).call(this),ht(this,Tt,ef).call(this,ht(this,Tt,tf).call(this))},lf=function(){g(this,bl)&&(clearTimeout(g(this,bl)),L(this,bl,void 0))},nf=function(){g(this,Sl)&&(clearInterval(g(this,Sl)),L(this,Sl,void 0))},uf=function(){const u=g(this,ve).getQueryCache().build(g(this,ve),this.options);if(u===g(this,ft))return;const s=g(this,ft);L(this,ft,u),L(this,kn,u.state),this.hasListeners()&&(s==null||s.removeObserver(this),u.addObserver(this))},Xy=function(u){It.batch(()=>{u.listeners&&this.listeners.forEach(s=>{s(g(this,oe))}),g(this,ve).getQueryCache().notify({query:g(this,ft),type:"observerResultsUpdated"})})},no);function g0(c,u){return Ze(u.enabled,c)!==!1&&c.state.data===void 0&&!(c.state.status==="error"&&u.retryOnMount===!1)}function Mf(c,u){return g0(c,u)||c.state.data!==void 0&&Nc(c,u,u.refetchOnMount)}function Nc(c,u,s){if(Ze(u.enabled,c)!==!1){const r=typeof s=="function"?s(c):s;return r==="always"||r!==!1&&Hc(c,u)}return!1}function Uf(c,u,s,r){return(c!==u||Ze(r.enabled,c)===!1)&&(!s.suspense||c.state.status!=="error")&&Hc(c,s)}function Hc(c,u){return Ze(u.enabled,c)!==!1&&c.isStaleByTime(Xl(u.staleTime,c))}function p0(c,u){return!Oc(c.getCurrentResult(),u)}var Nf=yt.createContext(void 0),b0=c=>{const u=yt.useContext(Nf);if(!u)throw new Error("No QueryClient set, use QueryClientProvider to set one");return u},S0=({client:c,children:u})=>(yt.useEffect(()=>(c.mount(),()=>{c.unmount()}),[c]),R.jsx(Nf.Provider,{value:c,children:u})),Hf=yt.createContext(!1),E0=()=>yt.useContext(Hf);Hf.Provider;function T0(){let c=!1;return{clearReset:()=>{c=!1},reset:()=>{c=!0},isReset:()=>c}}var _0=yt.createContext(T0()),A0=()=>yt.useContext(_0);function O0(c,u){return typeof c=="function"?c(...u):!!c}function jf(){}var D0=(c,u)=>{(c.suspense||c.throwOnError||c.experimental_prefetchInRender)&&(u.isReset()||(c.retryOnMount=!1))},R0=c=>{yt.useEffect(()=>{c.clearReset()},[c])},z0=({result:c,errorResetBoundary:u,throwOnError:s,query:r,suspense:d})=>c.isError&&!u.isReset()&&!c.isFetching&&r&&(d&&c.data===void 0||O0(s,[c.error,r])),C0=c=>{const u=c.staleTime;c.suspense&&(c.staleTime=typeof u=="function"?(...s)=>Math.max(u(...s),1e3):Math.max(u??1e3,1e3),typeof c.gcTime=="number"&&(c.gcTime=Math.max(c.gcTime,1e3)))},M0=(c,u)=>c.isLoading&&c.isFetching&&!u,U0=(c,u)=>(c==null?void 0:c.suspense)&&u.isPending,xf=(c,u,s)=>u.fetchOptimistic(c).catch(()=>{s.clearReset()});function N0(c,u,s){var M,H,x,Z,B;const r=b0(),d=E0(),p=A0(),E=r.defaultQueryOptions(c);(H=(M=r.getDefaultOptions().queries)==null?void 0:M._experimental_beforeQuery)==null||H.call(M,E),E._optimisticResults=d?"isRestoring":"optimistic",C0(E),D0(E,p),R0(p);const D=!r.getQueryCache().get(E.queryHash),[T]=yt.useState(()=>new u(r,E)),y=T.getOptimisticResult(E),O=!d&&c.subscribed!==!1;if(yt.useSyncExternalStore(yt.useCallback(Q=>{const K=O?T.subscribe(It.batchCalls(Q)):jf;return T.updateResult(),K},[T,O]),()=>T.getCurrentResult(),()=>T.getCurrentResult()),yt.useEffect(()=>{T.setOptions(E,{listeners:!1})},[E,T]),U0(E,y))throw xf(E,T,p);if(z0({result:y,errorResetBoundary:p,throwOnError:E.throwOnError,query:r.getQueryCache().get(E.queryHash),suspense:E.suspense}))throw y.error;if((Z=(x=r.getDefaultOptions().queries)==null?void 0:x._experimental_afterQuery)==null||Z.call(x,E,y),E.experimental_prefetchInRender&&!ol&&M0(y,d)){const Q=D?xf(E,T,p):(B=r.getQueryCache().get(E.queryHash))==null?void 0:B.promise;Q==null||Q.catch(jf).finally(()=>{T.updateResult()})}return E.notifyOnChangeProps?y:T.trackResult(y)}function jc(c,u){return N0(c,v0)}var H0=function(){return null};/*! js-cookie v3.0.5 | MIT */function Fu(c){for(var u=1;u"u")){E=Fu({},u,E),typeof E.expires=="number"&&(E.expires=new Date(Date.now()+E.expires*864e5)),E.expires&&(E.expires=E.expires.toUTCString()),d=encodeURIComponent(d).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var D="";for(var T in E)E[T]&&(D+="; "+T,E[T]!==!0&&(D+="="+E[T].split(";")[0]));return document.cookie=d+"="+c.write(p,d)+D}}function r(d){if(!(typeof document>"u"||arguments.length&&!d)){for(var p=document.cookie?document.cookie.split("; "):[],E={},D=0;D{D&&T&&E.append(T,D)}),p.search=E.toString()}return p}catch(p){throw new Error(`Invalid URL configuration: ${p instanceof Error?p.message:"Unknown error"}`)}}function wf(c){const u={...c},s=new Headers(u.headers);try{return u.headers=w0(),s.forEach((r,d)=>{var p;r&&d&&((p=u.headers)==null||p.set(d,r))}),(c.defaultContentType??!0)&&u.headers.set("Content-Type","application/json"),u}catch(r){throw new Error(`Failed to add default headers: ${r instanceof Error?r.message:"Unknown error"}`)}}const Q0="<>: Došlo k chybě při přístupu na <> s parametry <>";class se extends Error{constructor(s,r=418){super(s);kt(this,"status");this.status=r}}class Vl extends se{constructor(u,s,r,d){super(Qf(u.toString(),JSON.stringify(s),r),d),this.name=r}}class B0 extends Vl{constructor(u,s){super(u,s,"CORS chyba [CorsError]",418)}}class Y0 extends Vl{constructor(u,s){super(u,s,"Síťová chyba [NetworkError]",418)}}class L0 extends Vl{constructor(u,s){super(u,s,"Chyba časového limitu [TimeoutError]",408)}}class G0 extends Vl{constructor(u,s){super(u,s,"Není připojení k internetu [OfflineError]",418)}}function qf(c,u,s,r=!0){c instanceof se?r&&Ua(c):c instanceof TypeError&&(c.message.includes("CORS")||c.message.includes("Cross-Origin Resource Sharing")||c.message.includes("Access-Control-Allow-Origin"))?r&&Ua(new B0(u,s)):c instanceof TypeError&&(c.message.includes("NetworkError")||c.message.includes("network error")||c.message.includes("Network request failed"))?r&&Ua(new Y0(u,s)):c instanceof TypeError&&c.message.includes("timeout")?r&&Ua(new L0(u,s)):c instanceof DOMException&&c.name==="AbortError"||(c instanceof TypeError&&!navigator.onLine?r&&Ua(new G0(u,s)):c instanceof TypeError&&c.message.includes("Failed to fetch")?r&&Ua(new Vl(u,s,"Typová chyba (CORS?)",418)):r&&Ua(new Vl(u,s,"Neznámá chyba",418)))}function Qf(c,u,s){return Q0.replace("<>",s).replace("<>",c).replace("<>",u)}function X0(c){if(!c)return"";const s=c.split(` `).find(E=>E.includes("at "));if(!s)return"";const r=s.indexOf("/react/"),d=s.indexOf("/index");return r===-1||d===-1?"[react]: Neznámá app":`[react]: ${s.slice(r+7,d)}`}async function Ua(c){try{const u=X0(c.stack),s={status:c.status,origin:u,message:c.message},r=new URL("/log/save-error","https://api-eshop.delta.dek.cz"),d=new Headers;d.set("Content-Type","application/json");const p=wf({headers:d}),E=await fetch(r,{...p,method:"POST",body:JSON.stringify(s)});E.ok||console.error("Nepodařilo se uložit error log:",E.status,E.statusText)}catch(u){console.error("Nepodařilo se uložit error log:",u)}}class Bf extends Error{constructor(s){super("Chyba klienta");kt(this,"response");kt(this,"status");this.name="ErrorClient",this.response=s,this.status=s.status}}class Yf extends Error{constructor(s){super("Chyba serveru");kt(this,"response");kt(this,"status");this.name="ErrorServer",this.response=s,this.status=s.status}}class V0{constructor(u){kt(this,"response");kt(this,"options");kt(this,"responseHandlerList",{});this.response=u}setResponse(u){return this.response=u,this}setOptions(u){return this.options=u,this}hasResponseHandlers(u,s){return!!this.responseHandlerList[u]||!!this.responseHandlerList[s]}setDefaultResponseHandler(u){this.hasResponseHandlers(200,"2xx")||this.addResponseHandler(200,u)}addResponseHandler(u,s){var r;return(r=this.responseHandlerList)[u]??(r[u]=[]),this.responseHandlerList[u].push(s),this}async runResponseHandlers(){var p,E;if(!this.response)throw new se("Response není nastavena, byla setnutá?");const u=this.response.status,s=`${Math.floor(u/100)}xx`,r=this.hasResponseHandlers(u,s);let d;if(r){(p=this.responseHandlerList)[u]??(p[u]=[]),(E=this.responseHandlerList)[s]??(E[s]=[]);for(const D of this.responseHandlerList[u]){const T=await(D==null?void 0:D(this.response.clone()));d??(d=T)}for(const D of this.responseHandlerList[s]){const T=await(D==null?void 0:D(this.response.clone()));d??(d=T)}}return!r&&u>=400&&await this.handleError(),d}async handleError(u){if(!this.response)throw new se("Response není nastavena, byla setnutá?");(u==null?void 0:u.hideMessage)!==!0&&await this.showMessage(u==null?void 0:u.customMessage),u&&(u.options=u.options??this.options);const s=u!=null&&u.options?Z0(u.options):void 0,r=await this.response.clone().text(),d=Qf(this.response.url,JSON.stringify(s),`Chyba: [${this.response.status}${this.response.statusText?` - ${this.response.statusText}`:""}]`)+(r?` => ${r.slice(0,100)}${r.length>100?"...":""}`:"");throw new se(d,this.response.status)}async showMessage(u){if(!this.response)throw new se("Response není nastavena, byla setnutá?");if(u===!1)return;const s=u??(this.response.status in qc?qc[this.response.status]:`Nastala neočekávaná chyba při požadavku na server: ${this.response.status}`),r=await this.response.clone().text(),d=this.response.status===500||Object.keys(qc).includes(this.response.status.toString())||!!u;if(r===""||d)this.dispatchError(s);else try{await this.parseResponseForError()||this.dispatchError(s)}catch(p){throw this.dispatchError(s),new se("Chyba při ApiHandler.showMessage: "+p.message)}}async parseResponseForError(){if(!this.response)throw new se("Response není nastavena, byla setnutá?");const u=await this.response.clone().json();if(u.some(s=>s.message)){for(const{message:s}of u.filter(r=>r.message))s&&this.dispatchError(s);return!0}else return!1}dispatchError(u){dispatchEvent(new CustomEvent("ES_ADD_MESSAGE_FLASH",{detail:{message:u,type:"error"}}))}}const qc={429:"Překročili jste limit požadavků. Zkuste to znovu později. (429)"};function Z0(c){const u=["password","token","secret","key","credential"],s={...c},r=p=>{const E={};for(const[D,T]of Object.entries(p))u.some(y=>D.toLowerCase().includes(y))?E[D]="***FILTERED***":T&&typeof T=="object"&&!Array.isArray(T)?E[D]=r(T):E[D]=T;return E},d=p=>{try{const E=JSON.parse(p),D=r(E);return JSON.stringify(D)}catch{return p}};if(s.options){const p=s.options;p.body&&(typeof p.body=="string"?p.body=d(p.body):typeof p.body=="object"&&!(p.body instanceof FormData)&&(p.body=r(p.body))),s.options=r(p)}return s.parameters&&(s.parameters=r(s.parameters)),s.path&&(s.path=r(s.path)),s.body&&(typeof s.body=="string"?s.body=d(s.body):typeof s.body=="object"&&!(s.body instanceof FormData)&&(s.body=r(s.body))),s}class Qc{constructor(u){kt(this,"fetchParams");kt(this,"settings",{});kt(this,"responseHandler",new V0);kt(this,"response");this.checkForRequired(u);const s=u.body instanceof FormData?!1:u.defaultContentType??!0;this.fetchParams={baseUrl:u.baseUrl,uri:u.uri,body:u.body,parameters:u.parameters,path:u.path,options:{defaultContentType:s,method:u.method??"GET",signal:u.signal,...u.options}},this.settings={silent:u.silent??!1,responseType:u.responseType??"json"},this.applyPathParameters(),this.applySearchParameters(),this.applyBody()}checkForRequired(u){try{if(!u.uri)throw new se("URI je povinný")}catch(s){throw console.error(s),qf(s,new URL(u.uri,u.baseUrl),u.options??{},!u.silent),s}}applyPathParameters(){if("path"in this.fetchParams&&this.fetchParams.path){Object.entries(this.fetchParams.path).forEach(([s,r])=>{this.fetchParams.uri=this.fetchParams.uri.replace(`{${s}}`,r)});const u=this.fetchParams.uri.match(/\{([^}]+)\}/g);if(u)throw new se(`Nepodařilo se nahradit všechny parametry v URL: ${u.join(", ")}`)}}applySearchParameters(){if("parameters"in this.fetchParams&&this.fetchParams.parameters){const u=r=>typeof r=="string"||typeof r=="number"||typeof r=="boolean",s=new URLSearchParams;for(const[r,d]of Object.entries(this.fetchParams.parameters))if(u(d))s.set(r,d.toString());else if(Array.isArray(d))for(const p of d)u(p)?s.append(r,p.toString()):console.warn(`Neznámý typ parametru: ${r} => ${p}`);else typeof d<"u"&&console.warn(`Neznámý typ parametru: ${r} => ${d}`);this.fetchParams.options.search=s}}applyBody(){"body"in this.fetchParams&&this.fetchParams.body&&(typeof this.fetchParams.body=="string"||this.fetchParams.body instanceof FormData?this.fetchParams.options.body=this.fetchParams.body:this.fetchParams.options.body=JSON.stringify(this.fetchParams.body))}setDefaultResponseHandler(){this.responseHandler.setDefaultResponseHandler(async()=>this.getData())}addResponseHandler(u,s){return this.responseHandler.addResponseHandler(u,s),this}async send(){var r;const u=wf(this.fetchParams.options),s=q0(this.fetchParams.baseUrl,this.fetchParams.uri,u.search);this.setDefaultResponseHandler();try{return this.response=await fetch(s.toString(),u),this.responseHandler.setResponse(this.response),this.responseHandler.setOptions(this.fetchParams.options),await this.responseHandler.runResponseHandlers()}catch(d){console.error(d);const p=this.settings.silent===!0?!1:Array.isArray(this.settings.silent)?!this.settings.silent.includes(((r=this.response)==null?void 0:r.status)??0):!0;throw qf(d,s,u,p),d}}async handleError(u){await this.responseHandler.handleError({...u,options:this.fetchParams})}async getData(u){if(!this.response)throw new se("Response není nastavena, byl volán send()?");if(!this.response.ok&&!u)throw new se(`Response není v pořádku: ${this.response.status}`);try{const s=await this.response.clone().text();if(s==="")return;switch(this.settings.responseType){case"text":return s;case"json":return await this.response.clone().json();case"blob":return await this.response.clone().blob();case"arrayBuffer":return await this.response.clone().arrayBuffer();default:{const r=this.settings.responseType;throw new se(`Neznámý typ response: ${r}`)}}}catch(s){throw new se("Chyba při ApiHandler.getData: "+s.message)}}}const Ee=class Ee{};kt(Ee,"add",({message:u,type:s})=>{dispatchEvent(new CustomEvent("ES_ADD_MESSAGE_FLASH",{detail:{message:u,type:s}}))}),kt(Ee,"addError",u=>Ee.add({message:u,type:"error"})),kt(Ee,"addSuccess",u=>Ee.add({message:u,type:"success"})),kt(Ee,"addWarning",u=>Ee.add({message:u,type:"warning"})),kt(Ee,"addByError",u=>{const s=u;console.error(s),s instanceof Bf||s instanceof Yf?(s instanceof Bf&&Ee.add({message:`Nastala neočekávaná klientská chyba. (${s.status})`,type:"error"}),s instanceof Yf&&Ee.add({message:`Nastala neočekávaná serverová chyba. (${s.status})`,type:"error"})):Ee.add({message:"Nastala neočekávaná chyba.",type:"error"})});let Zn=Ee;class dl{static getConfig(){if(!this.config){const u=wc.get("dek_config");if(u===void 0)throw new Error("Config not found");try{const s=atob(u);this.config=JSON.parse(s)}catch(s){throw console.error(s),Zn.add({type:"error",message:"Nepodařilo se načíst konfiguraci."}),new Error("Config is not valid")}}return this.config}static getApiBase(){return this.getConfig().api.base}static getApiSearch(){return this.getConfig().api.search}static getBaseCdn(){return this.getConfig().cdn.base}static getBranchCode(){return this.getConfig().branchCode}static getBranchTitle(){return this.getConfig().branchTitle}static getDomain(){switch(this.getShopId()){case"argos_cz":return"argos.cz";case"dek_cz":return"dek.cz";case"dek_sk":return"dek.sk";case"stachema_cz":return"stachema.cz";case"stachema_sk":return"stachema.sk"}}static getEmail(){return this.getConfig().email}static getLang(){switch(this.getShopId()){case"argos_cz":case"dek_cz":return"cz";case"dek_sk":return"sk";default:return"cz"}}static getSearchCompany(){return this.getShopId().replace("_","-")}static getShopId(){const u=this.getConfig().shopId;return u==="dek"?"dek_cz":u}static isDev(){return this.getConfig().isDev}}kt(dl,"config"),function(){var c=/\[object (Boolean|Number|String|Function|Array|Date|RegExp|Arguments)\]/;function u(y){return y==null?String(y):(y=c.exec(Object.prototype.toString.call(Object(y))))?y[1].toLowerCase():"object"}function s(y,O){return Object.prototype.hasOwnProperty.call(Object(y),O)}function r(y){if(!y||u(y)!="object"||y.nodeType||y==y.window)return!1;try{if(y.constructor&&!s(y,"constructor")&&!s(y.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}for(var O in y);return O===void 0||s(y,O)}function d(y,O){var M={},H=M;y=y.split(".");for(var x=0;xc===void 0?K0:J0[c],$0=async c=>(await W0(c?`lastVisitedProductsAtSection_${c}`:"lastVisitedProductsAll")).exponea.filter(s=>s!=="None")??[],F0=async c=>{const u=k0(c);if(!u)return[];const s=new Qc({uri:"/product/get-best-seller-product-code-eshop-list",parameters:{analysisId:u}});s.addResponseHandler("4xx",async d=>s.handleError({customMessage:Lf(d.status),hideMessage:!dl.isDev()})).addResponseHandler("5xx",async d=>s.handleError({customMessage:Lf(d.status),hideMessage:!dl.isDev()}));const r=await s.send();return[...new Set(r)]},Lf=c=>`Nastala neočekávaná chyba při načítání produktů pro ReactProductSliderUserTarget. (${c})`,W0=async c=>{const s=Date.now();if(window.dataLayer===void 0)return console.warn("[ReactProductSliderUserTarget]: dataLayer not found"),{event:c,exponea:[]};const r=window.dataLayer.find(p=>p.event===c);if(r!==void 0)return r;let d=!1;return new Promise(p=>{const E=setTimeout(()=>{d=!0,console.warn(`[ReactProductSliderUserTarget]: dataLayer event '${c}' not found`),p({event:c,exponea:[]})},2500);new DataLayerHelper(window.dataLayer,{listener:(D,T)=>{"event"in T&&T.event===c&&(console.debug(`[ReactProductSliderUserTarget]: dataLayer event '${c}' found in ${Date.now()-s}ms`),clearTimeout(E),d&&Ua(new se(`[ReactProductSliderUserTarget]: dataLayer event '${c}' found in ${Date.now()-s}ms`)),p(T))},listenToPast:!0})})},Ke={wrap:"_wrap_ip60s_1",viewport:"_viewport_ip60s_8",grayBackground:"_grayBackground_ip60s_12",container:"_container_ip60s_25",arrowWrap:"_arrowWrap_ip60s_33",arrowNext:"_arrowNext_ip60s_38",arrowPrev:"_arrowPrev_ip60s_39",disabled:"_disabled_ip60s_83"},Se={wrap:"_wrap_1am3e_1",image:"_image_1am3e_17",title:"_title_1am3e_32",content:"_content_1am3e_49",price:"_price_1am3e_65",rental:"_rental_1am3e_73",unit:"_unit_1am3e_80"},P0={image:"_image_ox479_1"},I0="https://cdn1.idek.cz/img/2711ac4e3e85e0ac6233b02388095dbb.webp",Gf=({src:c,alt:u,resolutionList:s})=>{c??(c=I0);const r=[...s],d=r.shift();return R.jsxs("picture",{className:"r-image",children:[r.map(({width:p,height:E,maxWidth:D},T)=>R.jsx("source",{media:D?`(max-width: ${D}px)`:void 0,srcSet:c.replace(".webp",`_ew${p}_eh${E}.webp`),type:"image/webp",width:p,height:E},T)),R.jsx("img",{className:P0.image,src:c.replace(".webp",`_ew${d==null?void 0:d.width}_eh${d==null?void 0:d.height}.webp`),width:d==null?void 0:d.width,height:d==null?void 0:d.height,alt:u})]})},tm=(c,u,s=!0)=>{const r=c.split("|");if(r.length!==3&&r.length!==4)return console.warn(`Daný text "${c}" nemá správný formát`),s?`${u} ${c}`:c;let d,p,E,D;r.length===3?([p,E,D]=r.map(y=>y.trim()),d=D):[d,p,E,D]=r.map(y=>y.trim());let T=D;return u===0&&(T=d),u===1&&(T=p),u>=2&&u<=4&&(T=E),s?`${u} ${T}`:T},em=c=>c.replace(/m2/g,"m²").replace(/m3/g,"m³"),Pu={async getProductEshopByCode(c,u){if(Array.isArray(c)||(c=[c]),c.length===0)return[];try{return await new Qc({uri:"/product/get-products-eshop-by-codes",parameters:{codes:c,parts:u}}).send()??[]}catch(s){Zn.addByError(s)}return[]},async getProductRentalByCode(c,u){if(Array.isArray(c)||(c=[c]),c.length===0)return[];try{return await new Qc({uri:"/product/get-products-rental-by-codes",parameters:{codes:c,parts:u}}).send()??[]}catch(s){Zn.addByError(s)}return[]}},Me={formatPrice(c,u){const s=new Intl.NumberFormat("cs-CZ",{style:"currency",currency:u}).format(c);return u==="EUR"?s.replace("€","EUR"):s.toString()},formatUnit(c){return c.replace("m2","m²").replace("m3","m³")},formatQuantity(c){return(Number(c)===c&&c%1!==0?c.toFixed(2):c).toLocaleString().replace(".",",")},calculateQuantityUnitEshopToSales(c,u){const s=u.isPackagePrimary?c*1e6*(u.unitsInPackage*1e6)/1e12:c;return{unitPrimary:c,unitSecondary:u.isPackagePrimary?s:c,unitSales:s,unitPackage:u.isPackagePrimary?c:s}},calculateQuantityUnitEshop(c,u){return Me.calculateQuantityUnitEshopToSales(c,u)},calculateQuantityUnitEshopToPrimary(c,u){const s=u.isPackagePrimary?c*1e12/(u.unitsInPackage*1e6)/1e6:c;return{unitPrimary:s,unitSecondary:u.isPackagePrimary?c:s,unitSales:c,unitPackage:u.isPackagePrimary?s:c}},calculateQuantityPriceEshop(c,u){const s=Math.round(u.priceNoVatPrimary*c*100)/100,r=Math.round(s*u.vat/100*100)/100,d=Math.round((s+r)*100)/100;return{priceNoVatPrimary:s,priceVatPrimary:d}},getAvailabilityStatusByBranchCode(c,u,s){switch(c.availabilityBranchCode){case"P00":case"P01":case"P05":case"P06":return{showButton:!0,color:"green",buttonText:s,buttonColor:"green"};case"P02":case"P07":case"P08":case"P10":return{showButton:!1,color:"red"};case"P03":return{showButton:!0,color:"blue",buttonText:u,buttonColor:"blue"};case"P04":return{showButton:!0,color:"red",buttonText:u,buttonColor:"blue"};case"P09":return{showButton:!1,color:"gray"};default:return{showButton:!0,color:"blue",buttonText:u,buttonColor:"blue"}}},addToCartEshop(c,u,s,r){window.dispatchEvent(new CustomEvent("ES_ADD_TO_CART_ESHOP",{detail:{code:c,quantitySales:u,unitSales:s,eventInvoker:r}}))},addToCartRental(c){const{date:u,eventInvoker:s,hasGuarantee:r,quantity:d,typeOfRental:p,unionCode:E}=c;window.dispatchEvent(new CustomEvent("ES_ADD_TO_CART_RENTAL",{detail:{unionCode:E,quantity:d,quantitySales:d,dateFrom:u.from,dateTo:u.to,withGuarantee:r,typeOfRental:p,eventInvoker:s}}))},async getProductEshopByCode(c,u){return Pu.getProductEshopByCode(c,u)},async getProductRentalByCode(c,u){return Pu.getProductRentalByCode(c,u)},calculateSeasonPoints(c,u){if(c.season===null||c.season===void 0)return 0;const s=c.season;if(s.rewardFor==="Quantity")return Math.floor(u/s.requiredQuantity)*s.rewardPoints;if(s.rewardFor==="Price"){const r=c.price.priceNoVatSales*u;return Math.floor(r/s.requiredQuantity)*s.rewardPoints}return 0},getNumberOfDaysByTypeOfRental(c,u){if(u==="HalfDay")return"4 hodiny";const s=Math.ceil((c.to.getTime()-c.from.getTime())/864e5),r=d=>tm(dl.getLang()==="sk"?"deň | dni | dní":"den | dny | dní",d);return r(u==="FullDay"?s:s+1)}},Bc={cz:{toCart:"Do košíku",demand:"Poptat",labelAddToCart:(c,u)=>R.jsxs(R.Fragment,{children:["do košíku přidáte"," ",R.jsxs("strong",{children:[Me.formatQuantity(c)," ",Me.formatUnit(u)]})]}),addToCart:"Přidat",addedToCart:"Přidáno",unit:c=>`za ${c}`,withDPH:"s DPH",total:"celkem"},sk:{toCart:"Do košíka",demand:"Na dopyt",labelAddToCart:(c,u)=>R.jsxs(R.Fragment,{children:["do košíka pridáte"," ",R.jsxs("strong",{children:[Me.formatQuantity(c)," ",Me.formatUnit(u)]})]}),addToCart:"Pridať",addedToCart:"Pridané",unit:c=>`za ${c}`,withDPH:"s DPH",total:"celkom"}},re={container:"_container_1nbmo_1",inputs:"_inputs_1nbmo_11",quantity:"_quantity_1nbmo_17",button:"_button_1nbmo_25",row:"_row_1nbmo_28",compact:"_compact_1nbmo_33",price:"_price_1nbmo_40",addToCart:"_addToCart_1nbmo_52",loading:"_loading_1nbmo_65",spin:"_spin_1nbmo_1",input:"_input_1nbmo_11",alreadyInCart:"_alreadyInCart_1nbmo_95",slide:"_slide_1nbmo_109"},am={event:"recobox",recobox_pagetype:"modal_cart",recobox_boxName:"mohlo_by_se_vam_hodit"},Xf=c=>{window.dataLayer??(window.dataLayer=[]),window.dataLayer.push({...am,recobox_action:"add_to_cart",recobox_product_id:c})},lm=({formWidth:c,state:u})=>R.jsx("div",{className:`input-${u.level} ${c||""}`,children:u.message}),Vf={getFormSize:c=>c?`dek-form-width--${c}`:"",formatNumber:(c,u)=>{const s=c.replaceAll(/\D/g,"");s.lengths[r++]||"")},formatPhone:c=>Vf.formatNumber(c,c.replaceAll(/\D/g,"").length===12&&c[0]==="+"?"+### ### ### ###":"### ### ###")},Yc=({onChange:c,children:u,size:s,state:r,type:d,onChangeLazy:p,onBlur:E,className:D,useSizeOnState:T,...y})=>{const O=yt.useId(),{disabled:M,required:H}=y,x=K=>{if(!c)return;const{value:k}=K.target;if(d==="number"){c(Number(k)||Number.NaN,K);return}c(k,K)},Z=K=>{if(p){const{value:k}=K.target;if(d==="number"){p(Number(k)||Number.NaN,K);return}p(k,K)}E==null||E(K)},B=Vf.getFormSize(s),Q=[B];return r&&Q.push(r.level),D&&Q.push(D),R.jsxs(R.Fragment,{children:[u!==void 0&&R.jsxs("label",{htmlFor:O,children:[u,H&&R.jsx("span",{className:"dek-form-required-indicator",children:"*"})]}),R.jsx("input",{id:O,role:"textbox",className:Q.join(" "),onChange:x,onBlur:Z,type:d,...y}),r&&!M&&r.message&&R.jsx(lm,{formWidth:T?B:void 0,state:r})]})},nm=c=>{const{type:u}=c;if(u==="compact")return R.jsx(im,{...c});if(u==="slide")return R.jsx(cm,{...c});if(u==="long")return R.jsx(um,{...c})},um=({lang:c,product:u})=>{const{availability:s,code:r,price:d,unit:p}=u,{addToCartEshop:E,calculateQuantityPriceEshop:D,calculateQuantityUnitEshopToSales:T,formatPrice:y,formatUnit:O,getAvailabilityStatusByBranchCode:M}=Me,H=Bc[c],x=yt.useRef(null),[Z,B]=yt.useState({unitPrimary:p.minimumCountUnitPrimary,unitSecondary:p.unitsInPackage,unitSales:p.minimumCountUnitSales}),[Q,K]=yt.useState({priceVatPrimary:d.priceVatPrimary}),k=X=>{X=X{var X;E(r,Z.unitSales,p.unitSales,"long"),(X=x.current)==null||X.blur()},tt=M(s,H.demand,H.toCart);return tt.showButton?R.jsxs("div",{className:`r-add-to-cart-eshop-long ${re.container}`,children:[R.jsxs("div",{className:re.inputs,children:[R.jsxs("div",{className:re.quantity,children:[R.jsx(Yc,{onChange:k,type:"number",min:"1",value:Z.unitPrimary,autoComplete:"off"}),R.jsx("label",{children:O(p.unitPrimary)})]}),R.jsx("button",{type:"button",ref:x,role:"button",className:`dek-button-${tt.buttonColor} ${re.button}`,onClick:nt,children:tt.buttonText})]}),p.isPackagePrimary&&R.jsx("div",{className:re.row,children:H.labelAddToCart(Z.unitSecondary,p.unitSecondary)}),R.jsxs("div",{className:re.row,children:[R.jsx("strong",{children:y(Q.priceVatPrimary,d.currencyCode)})," ",H.total," ",H.withDPH]})]}):R.jsx("div",{className:`r-add-to-cart-eshop-long ${re.container}`})},im=({lang:c,product:u})=>{const{code:s,unit:r}=u,{addToCartEshop:d,calculateQuantityPriceEshop:p,calculateQuantityUnitEshopToSales:E,formatPrice:D}=Me,T=Bc[c],[y,O]=yt.useState({unitPrimary:r.minimumCountUnitPrimary,unitSecondary:r.unitsInPackage,unitSales:r.minimumCountUnitSales}),[M,H]=yt.useState(!1),[x,Z]=yt.useState(!1),[B,Q]=yt.useState(u.price.priceVatPrimary),K=tt=>{tt=tt{Z(!0),window.addEventListener("ES_ADD_TO_CART_ESHOP_AFTER",nt),d(s,y.unitSales,r.unitSales,"compact")},nt=tt=>{u.code===tt.detail.code&&(Z(!1),H(tt.detail.isSuccess),tt.detail.isSuccess&&Xf(s),window.removeEventListener("ES_ADD_TO_CART_ESHOP_AFTER",nt))};return R.jsxs("div",{className:`r-add-to-cart-eshop-compact ${re.compact}`,children:[R.jsxs("div",{className:re.price,children:[R.jsx("strong",{children:D(B,u.price.currencyCode)}),R.jsxs("div",{children:[T.unit(u.unit.unitPrimary)," ",T.withDPH]})]}),R.jsx("div",{className:re.addToCart,children:M?R.jsxs("div",{className:re.alreadyInCart,children:[R.jsx("img",{src:"https://cdn1.idek.cz/file/check-7c33cfe0.svg",width:16,height:16}),R.jsx("span",{children:T.addedToCart})]}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:re.input,children:[R.jsx(Yc,{type:"number",min:1,defaultValue:y.unitPrimary,onChange:K,disabled:x}),u.unit.unitPrimary]}),R.jsxs("button",{type:"button",role:"button",className:"dek-button-green",onClick:k,disabled:x,children:[x&&R.jsx("span",{className:re.loading}),T.addToCart]})]})})]})},cm=({lang:c,product:u})=>{const s=Bc[c],r=()=>{const d=u.unit.isPackagePrimary?u.unit.minimumCountUnitSales:u.unit.minimumCountUnitPrimary;Me.addToCartEshop(u.code,d,u.unit.unitSales,"slide")};return R.jsx("div",{className:`r-add-to-cart-eshop-slide ${re.slide}`,children:R.jsx("button",{type:"button",role:"button",onClick:r,className:`dek-button-green dek-button-small ${re.button}`,children:s.toCart})})},Lc={cz:{toDetail:"Detail zapůjčení",unit:c=>`za ${c}`,withDPH:"s DPH",addToCart:"Přidat",addedToCart:"Přidáno"},sk:{toDetail:"Detail zapožičania",unit:c=>`za ${c}`,withDPH:"s DPH",addToCart:"Pridať",addedToCart:"Pridané"}},Je={container:"_container_qt28n_1",topDivider:"_topDivider_qt28n_4",button:"_button_qt28n_9",compact:"_compact_qt28n_16",price:"_price_qt28n_23",addToCart:"_addToCart_qt28n_35",loading:"_loading_qt28n_48",spin:"_spin_qt28n_1",input:"_input_qt28n_68",alreadyInCart:"_alreadyInCart_qt28n_78"},sm=(c,u)=>`/produkty/detail/${c}${u?`-${u}`:""}`,Gc=(c,u)=>`/pujcovna/detail/${c.replace("|","/")}${u?`-${u}`:""}`,rm=c=>{const{type:u}=c;if(u==="compact")return R.jsx(dm,{...c});if(u==="long")return R.jsx(om,{...c});if(u==="slide")return R.jsx(fm,{...c})},fm=({product:c,lang:u})=>{const s=Lc[u];return R.jsx("div",{className:`r-add-to-cart-rental-slide ${Je.container}`,children:R.jsx("a",{role:"button",className:`dek-button dek-button-green dek-button-small ${Je.button}`,href:Gc(c.code,c.detail.slug),children:s.toDetail})})},om=({product:c,lang:u})=>{const s=Lc[u];return R.jsx("div",{className:`r-add-to-cart-rental-long ${Je.container} ${Je.topDivider}`,children:R.jsx("a",{role:"button",className:`dek-button dek-button-green ${Je.button}`,href:Gc(c.code,c.detail.slug),children:s.toDetail})})},dm=({product:c,lang:u,date:s,hasGuarantee:r,typeOfRental:d})=>{const{formatPrice:p}=Me,E=Lc[u],[D,T]=yt.useState(1),[y,O]=yt.useState(c.detail.priceVatOrigin),[M,H]=yt.useState(!1),[x,Z]=yt.useState(!1),B=k=>{T(k),O(k*c.detail.priceVatOrigin)},Q=()=>{Z(!0),window.addEventListener("ES_ADD_TO_CART_RENTAL_AFTER",K),Me.addToCartRental({unionCode:c.code,quantity:D,date:s,hasGuarantee:r,typeOfRental:d,eventInvoker:"compact"})},K=k=>{c.code===k.detail.unionCode&&(Z(!1),H(k.detail.isSuccess),k.detail.isSuccess&&Xf(c.code),window.removeEventListener("ES_ADD_TO_CART_RENTAL_AFTER",K))};return R.jsxs("div",{className:`r-add-to-cart-rental-compact ${Je.compact}`,children:[R.jsxs("div",{className:Je.price,children:[R.jsx("strong",{children:p(y,c.detail.currencyCode)}),R.jsxs("div",{children:[E.unit(c.detail.unitPrice)," ",E.withDPH]})]}),R.jsx("div",{className:Je.addToCart,children:M?R.jsxs("div",{className:Je.alreadyInCart,children:[R.jsx("img",{src:"https://cdn1.idek.cz/file/check-7c33cfe0.svg",width:16,height:16}),R.jsx("span",{children:E.addedToCart})]}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:Je.input,children:[R.jsx(Yc,{type:"number",min:1,defaultValue:D,onChange:B,disabled:x}),c.detail.unitQuantity]}),R.jsxs("button",{type:"button",role:"button",className:"dek-button-green",onClick:Q,disabled:x,children:[x&&R.jsx("span",{className:Je.loading}),E.addToCart]})]})})]})},Zf={icons:"_icons_4p8mm_1"},hm={cz:{hasVariants:"Více variant",hasGift:"Dárek k nákupu",hasPpl:"Doprava PPL"},sk:{hasVariants:"Viac variantov",hasGift:"Darček na nákup",hasPpl:"Doprava PPL"}},Kf=({product:c})=>{const u=dl.getLang(),s=hm[u];if(c.type==="eshop")return R.jsxs("div",{className:`r-product-icon ${Zf.icons}`,children:[c.detail.hasVariant&&R.jsx("img",{title:s.hasVariants,alt:s.hasVariants,src:"https://cdn1.idek.cz/img/a32ef0de7bf6d55e5b00748dfe951840_rw24.png",width:24,height:24}),c.detail.hasGift&&R.jsx("img",{alt:s.hasGift,title:s.hasGift,src:"https://cdn1.idek.cz/img/13ac7588db7f1b49cbce256f5abd255f_rw24.png",width:24,height:24}),c.detail.hasPpl&&R.jsx("img",{title:s.hasPpl,alt:s.hasPpl,src:"https://cdn1.idek.cz/img/8c6599f32f6f4d9cbc8d20951dba4952_rw24.jpg",width:24,height:24})]});if(c.type==="rental")return R.jsx("div",{className:`r-product-icon ${Zf.icons}`})},ym={cz:{stocksLast:"Do vyprodání zásob",recommended:"Doporučujeme",isRecent:"Novinka",isFeatured:"Výhodná cena"},sk:{stocksLast:"Do vypredania zásob",recommended:"Odporúčame",isRecent:"Novinka",isFeatured:"Výhodná ponuka"}},oa={labels:"_labels_14jqs_1",recommended:"_recommended_14jqs_12",isRecent:"_isRecent_14jqs_13",isFeatured:"_isFeatured_14jqs_14",isWhileStockLast:"_isWhileStockLast_14jqs_15",title:"_title_14jqs_39",content:"_content_14jqs_43",generousSeason:"_generousSeason_14jqs_50"},Jf=({product:c})=>{const u=dl.getLang(),s=ym[u],r=()=>{if(c.type==="eshop")switch(!0){case c.availability.isWhileStockLast:return R.jsx("div",{className:oa.isWhileStockLast,children:s.stocksLast});case c.detail.isFeatured:return R.jsx("div",{className:oa.isFeatured,children:R.jsx("div",{className:oa.title,children:s.isFeatured})});case c.detail.isRecommended:return R.jsx("div",{className:oa.recommended,children:s.recommended});case c.detail.isRecent:return R.jsx("div",{className:oa.isRecent,children:s.isRecent});case!0:return null}if(c.type==="rental")switch(!0){case c.detail.isFeatured:return R.jsx("div",{className:oa.isFeatured,children:R.jsx("div",{className:oa.title,children:s.isFeatured})});case!0:return null}return null};return R.jsxs("div",{className:`r-product-label ${oa.labels}`,children:[r(),c.type==="eshop"&&c.detail.seasonPointsText&&R.jsxs("div",{className:oa.generousSeason,children:[R.jsx("img",{src:"https://cdn1.idek.cz/file/plus-white-a6e119fe.svg",width:22,height:22}),R.jsx("div",{children:em(c.detail.seasonPointsText)})]})]})},mm=({lang:c,product:u,showAddToCartButton:s})=>{const r=[{width:225,height:135},{width:320,height:192,maxWidth:680},{width:225,height:135,maxWidth:490},{width:170,height:170,maxWidth:370}];if(u.type==="eshop")return R.jsx(vm,{lang:c,product:u,resolutionList:r,showAddToCartButton:s});if(u.type==="rental")return R.jsx(gm,{lang:c,product:u,resolutionList:r,showAddToCartButton:s})},vm=({lang:c,product:u,resolutionList:s,showAddToCartButton:r})=>{const d=sm(u.code,u.detail.slug),p=Me.formatPrice(u.price.priceVatPrimary,u.price.currencyCode).split(",");return R.jsxs("div",{className:`r-product-preview-slide ${Se.wrap}`,"data-product-code":u.code,children:[R.jsxs("a",{className:Se.image,href:d,children:[R.jsx(Jf,{product:u}),R.jsx(Kf,{product:u}),R.jsx(Gf,{src:u.detail.image,alt:u.detail.title,resolutionList:s})]}),R.jsxs("div",{className:Se.content,children:[R.jsxs("a",{href:d,children:[R.jsx("span",{className:Se.title,children:u.detail.title}),R.jsxs("div",{children:[R.jsxs("div",{className:Se.price,children:[p[0],R.jsxs("span",{children:[",",p[1]]})]}),R.jsxs("div",{className:Se.unit,children:["cena za"," ",u.unit.unitPrimary," ","s DPH"]})]})]}),r&&R.jsx(nm,{lang:c,product:u,type:"slide"})]})]})},gm=({lang:c,product:u,resolutionList:s,showAddToCartButton:r})=>{const d=Gc(u.code,u.detail.slug),p=Me.formatPrice(u.detail.priceVatOrigin,u.detail.currencyCode).split(",");return R.jsxs("div",{className:`r-product-preview-slide ${Se.wrap} ${Se.rental}`,"data-product-code":u.code,children:[R.jsxs("a",{className:Se.image,href:d,children:[R.jsx(Jf,{product:u}),R.jsx(Kf,{product:u}),R.jsx(Gf,{src:u.detail.image,alt:u.detail.titleShort??u.detail.title,resolutionList:s})]}),R.jsxs("div",{className:Se.content,children:[R.jsxs("a",{href:d,children:[R.jsx("span",{className:Se.title,children:u.detail.titleShort??u.detail.title}),R.jsxs("div",{children:[R.jsxs("div",{className:Se.price,children:[p[0],R.jsxs("span",{children:[",",p[1]]})]}),R.jsxs("div",{className:Se.unit,children:["cena za"," ",u.detail.unitPrice," ","s DPH"]})]})]}),r&&R.jsx(rm,{lang:c,product:u,type:"slide"})]})]})},pm=(c,u)=>{yt.useEffect(()=>{if(c==null)return;const s=r=>bm(r,u);return c.addEventListener("touchstart",kf,!1),c.addEventListener("touchmove",s,!1),()=>{c.removeEventListener("touchstart",kf,!1),c.removeEventListener("touchmove",s,!1)}},[c,u])};let Iu,ti;const kf=c=>{const u=c.touches[0];Iu=u.clientX,ti=u.clientY},bm=(c,u)=>{var E,D,T,y;if(!Iu||!ti)return;const s=c.touches[0].clientX,r=c.touches[0].clientY,d=Iu-s,p=ti-r;Math.abs(d)>Math.abs(p)?d>0?(E=u.onRight)==null||E.call(u):(D=u.onLeft)==null||D.call(u):p>0?(T=u.onDown)==null||T.call(u):(y=u.onUp)==null||y.call(u),Iu=void 0,ti=void 0},$f=c=>{const{hasGrayBackground:u,itemsMaxCount:s,loadingState:r,productList:d,showAddToCart:p,sliderMaxWidth:E}=c,D=dl.getLang(),T=yt.useRef(null),y=yt.useRef(null),O=yt.useRef(null),[M,H]=yt.useState(0),[x,Z]=yt.useState(0),[B,Q]=yt.useState(!1),[K,k]=yt.useState(0);yt.useEffect(()=>{const Yt=()=>{if(!T.current||!y.current||!O.current||!d)return;const Ne=T.current.offsetWidth??0,de=y.current.offsetWidth??0,ue=Ne-de,et=(E-ue)/s,F=Math.floor(de/et),Ot=de/F,m=Ot*d.length;H(m),Z(de/Math.floor(de/Ot)),Q(!0),k(0)};return Yt(),window.addEventListener("resize",Yt),()=>{window.removeEventListener("resize",Yt)}},[E,s,d]);const nt=T.current?T.current.offsetWidth:0,tt=y.current?y.current.offsetWidth:0,X=nt-tt,ot=Math.abs(K)+tt{ot&&k(K-tt)},w=()=>{At&&k(K+tt)},ut=(X/2+12)*-1,Bt=ut;return pm(y.current,{onRight:pt,onLeft:w}),r?R.jsx("div",{className:`r-slider-product ${Ke.wrap} ${u?Ke.grayBackground:""}`,role:"slider",style:{maxWidth:E},children:R.jsx("div",{className:Ke.viewport,children:R.jsx("div",{className:`${Ke.container} loading`,style:{transform:`translateX(${K}px)`,width:E,height:300}})})}):R.jsxs("div",{className:`r-slider-product ${Ke.wrap} ${u?Ke.grayBackground:""}`,ref:T,role:"slider",style:{maxWidth:E},children:[R.jsxs("div",{className:Ke.arrowWrap,children:[At&&R.jsx("div",{className:Ke.arrowPrev,onClick:w,style:{left:Bt}}),ot&&R.jsx("div",{className:Ke.arrowNext,onClick:pt,style:{right:ut}})]}),R.jsx("div",{className:Ke.viewport,ref:y,children:R.jsx("div",{className:Ke.container,ref:O,style:{transform:`translateX(${K}px)`,width:M},children:B&&d.map(Yt=>R.jsx("div",{style:{width:x},children:R.jsx(mm,{lang:D,product:Yt,showAddToCartButton:p})},Yt.code))})})]})},Sm=({itemsMaxCount:c,sliderMaxWidth:u})=>{let s=!0;return c===void 0&&(console.error("[SliderProduct]: itemsMaxCount is required"),s=!1),u===void 0&&(console.error("[SliderProduct]: sliderMaxWidth is required"),s=!1),s},Em=({hasGrayBackground:c,sectionId:u,...s})=>{const r=Sm({...s}),d=jc({queryKey:["dataLayerProductCodeList",u],queryFn:async()=>$0(u),enabled:r}),p=jc({queryKey:["fillOutProductCodeList",u],queryFn:async()=>F0(u),enabled:r}),E=[];d.isSuccess&&E.push(...d.data),p.isSuccess&&E.push(...p.data);const D=[...new Set(E)].splice(0,14),T=jc({queryKey:["productList",D],queryFn:async()=>Tm(D),enabled:r&&!d.isLoading&&!p.isLoading&&D.length>0}),y=R.jsx("div",{className:"r-a-product-slider-user-target",children:R.jsx($f,{...s,loadingState:!0})});return r?d.isLoading||p.isLoading?y:D.length<=0?null:T.isLoading?y:T.isSuccess?R.jsx("div",{className:"r-a-product-slider-user-target",children:R.jsx($f,{hasGrayBackground:c??!0,productList:T.data,...s})}):null:null},Tm=async c=>{const u=c.filter(p=>p.length===10),s=c.filter(p=>p.length===7),r=await Pu.getProductEshopByCode(u,["detail","availability","price","unit"]),d=await Pu.getProductRentalByCode(s,["detail","price"]);return[...r,...d].filter(Boolean)},_m=new m0({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,retry:!1}}});function Am(c,u){Iy.createRoot(document.querySelector(`#${c}`)).render(R.jsx(yt.StrictMode,{children:R.jsxs(S0,{client:_m,children:[R.jsx(Em,{...u}),R.jsx(H0,{})]})}))}return Am}); //# sourceMappingURL=index.umd.cjs.map