(function(de,oe){typeof exports=="object"&&typeof module<"u"?module.exports=oe():typeof define=="function"&&define.amd?define(oe):(de=typeof globalThis<"u"?globalThis:de||self,de.ReactProductSlider=oe())})(this,function(){"use strict";var _m=Object.defineProperty;var lf=de=>{throw TypeError(de)};var Em=(de,oe,je)=>oe in de?_m(de,oe,{enumerable:!0,configurable:!0,writable:!0,value:je}):de[oe]=je;var Xt=(de,oe,je)=>Em(de,typeof oe!="symbol"?oe+"":oe,je),mu=(de,oe,je)=>oe.has(de)||lf("Cannot "+je);var m=(de,oe,je)=>(mu(de,oe,"read from private field"),je?je.call(de):oe.get(de)),ne=(de,oe,je)=>oe.has(de)?lf("Cannot add the same private member more than once"):oe instanceof WeakSet?oe.add(de):oe.set(de,je),$=(de,oe,je,re)=>(mu(de,oe,"write to private field"),re?re.call(de,je):oe.set(de,je),je),ce=(de,oe,je)=>(mu(de,oe,"access private method"),je);var bl=(de,oe,je,re)=>({set _(Ii){$(de,oe,Ii,je)},get _(){return m(de,oe,re)}});var zn,on,rr,ta,ir,un,lr,na,Fn,ra,sr,or,kt,Ke,Kr,Ln,Ot,sn,ia,Qt,la,$t,Je,In,Bt,On,sa,pt,Gr,oa,De,an,cn,ur,ar,dn,cr,dr,ua,lt,ue,Yr,be,Mn,fr,Ht,Xr,hr,pr,An,Un,fn,mr,ye,Li,yu,vu,gu,wu,Su,ku,Cu,sf,aa,Ss;var de={exports:{}},oe={},je={exports:{}},re={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ii;function of(){if(Ii)return re;Ii=1;var o=Symbol.for("react.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),k=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),z=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),R=Symbol.iterator;function j(y){return y===null||typeof y!="object"?null:(y=R&&y[R]||y["@@iterator"],typeof y=="function"?y:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},W=Object.assign,V={};function G(y,E,ie){this.props=y,this.context=E,this.refs=V,this.updater=ie||L}G.prototype.isReactComponent={},G.prototype.setState=function(y,E){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,E,"setState")},G.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function K(){}K.prototype=G.prototype;function Z(y,E,ie){this.props=y,this.context=E,this.refs=V,this.updater=ie||L}var b=Z.prototype=new K;b.constructor=Z,W(b,G.prototype),b.isPureReactComponent=!0;var H=Array.isArray,te=Object.prototype.hasOwnProperty,ae={current:null},ve={key:!0,ref:!0,__self:!0,__source:!0};function J(y,E,ie){var le,he={},pe=null,Se=null;if(E!=null)for(le in E.ref!==void 0&&(Se=E.ref),E.key!==void 0&&(pe=""+E.key),E)te.call(E,le)&&!ve.hasOwnProperty(le)&&(he[le]=E[le]);var ge=arguments.length-2;if(ge===1)he.children=ie;else if(1>>1,E=O[y];if(0>>1;yh(he,I))peh(Se,he)?(O[y]=Se,O[pe]=I,y=pe):(O[y]=he,O[le]=I,y=le);else if(peh(Se,I))O[y]=Se,O[pe]=I,y=pe;else break e}}return Y}function h(O,Y){var I=O.sortIndex-Y.sortIndex;return I!==0?I:O.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var S=performance;o.unstable_now=function(){return S.now()}}else{var k=Date,N=k.now();o.unstable_now=function(){return k.now()-N}}var T=[],z=[],U=1,R=null,j=3,L=!1,W=!1,V=!1,G=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(O){for(var Y=u(z);Y!==null;){if(Y.callback===null)c(z);else if(Y.startTime<=O)c(z),Y.sortIndex=Y.expirationTime,l(T,Y);else break;Y=u(z)}}function H(O){if(V=!1,b(O),!W)if(u(T)!==null)W=!0,tt(te);else{var Y=u(z);Y!==null&&Ee(H,Y.startTime-O)}}function te(O,Y){W=!1,V&&(V=!1,K(J),J=-1),L=!0;var I=j;try{for(b(Y),R=u(T);R!==null&&(!(R.expirationTime>Y)||O&&!qt());){var y=R.callback;if(typeof y=="function"){R.callback=null,j=R.priorityLevel;var E=y(R.expirationTime<=Y);Y=o.unstable_now(),typeof E=="function"?R.callback=E:R===u(T)&&c(T),b(Y)}else c(T);R=u(T)}if(R!==null)var ie=!0;else{var le=u(z);le!==null&&Ee(H,le.startTime-Y),ie=!1}return ie}finally{R=null,j=I,L=!1}}var ae=!1,ve=null,J=-1,Ne=5,st=-1;function qt(){return!(o.unstable_now()-stO||125y?(O.sortIndex=I,l(z,O),u(T)===null&&O===u(z)&&(V?(K(J),J=-1):V=!0,Ee(H,I-y))):(O.sortIndex=E,l(T,O),W||L||(W=!0,tt(te))),O},o.unstable_shouldYield=qt,o.unstable_wrapCallback=function(O){var Y=j;return function(){var I=j;j=Y;try{return O.apply(this,arguments)}finally{j=I}}}}(ns)),ns}var xu;function cf(){return xu||(xu=1,ts.exports=af()),ts.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Nu;function df(){if(Nu)return it;Nu=1;var o=se,l=cf();function u(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),T=Object.prototype.hasOwnProperty,z=/^[: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]*$/,U={},R={};function j(e){return T.call(R,e)?!0:T.call(U,e)?!1:z.test(e)?R[e]=!0:(U[e]=!0,!1)}function L(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function W(e,t,n,r){if(t===null||typeof t>"u"||L(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function V(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){G[e]=new V(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];G[t]=new V(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){G[e]=new V(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){G[e]=new V(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){G[e]=new V(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){G[e]=new V(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){G[e]=new V(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){G[e]=new V(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){G[e]=new V(e,5,!1,e.toLowerCase(),null,!1,!1)});var K=/[\-:]([a-z])/g;function Z(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(K,Z);G[t]=new V(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(K,Z);G[t]=new V(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(K,Z);G[t]=new V(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){G[e]=new V(e,1,!1,e.toLowerCase(),null,!1,!1)}),G.xlinkHref=new V("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){G[e]=new V(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=G.hasOwnProperty(t)?G[t]:null;(i!==null?i.type!==0:r||!(2d||i[a]!==s[d]){var f=` `+i[a].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=a&&0<=d);break}}}finally{ie=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?E(e):""}function he(e){switch(e.tag){case 5:return E(e.type);case 16:return E("Lazy");case 13:return E("Suspense");case 19:return E("SuspenseList");case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return""}}function pe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ve:return"Fragment";case ae:return"Portal";case Ne:return"Profiler";case J:return"StrictMode";case et:return"Suspense";case He:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qt:return(e.displayName||"Context")+".Consumer";case st:return(e._context.displayName||"Context")+".Provider";case Be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ct:return t=e.displayName||null,t!==null?t:pe(e.type)||"Memo";case tt:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}function Se(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(t);case 8:return t===J?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mt(e){var t=Pe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hi(e){e._valueTracker||(e._valueTracker=mt(e))}function ca(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pe(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ks(e,t){var n=t.checked;return I({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function da(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ge(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fa(e,t){t=t.checked,t!=null&&b(e,"checked",t,!1)}function Cs(e,t){fa(e,t);var n=ge(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_s(e,t.type,n):t.hasOwnProperty("defaultValue")&&_s(e,t.type,ge(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ha(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function _s(e,t,n){(t!=="number"||Vi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qr=Array.isArray;function yr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Wi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Nh=["Webkit","ms","Moz","O"];Object.keys(Jr).forEach(function(e){Nh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jr[t]=Jr[e]})});function wa(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jr.hasOwnProperty(e)&&Jr[e]?(""+t).trim():t+"px"}function Sa(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=wa(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Th=I({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xs(e,t){if(t){if(Th[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(u(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(u(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(u(61))}if(t.style!=null&&typeof t.style!="object")throw Error(u(62))}}function Ns(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ts=null;function Rs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var js=null,vr=null,gr=null;function ka(e){if(e=Si(e)){if(typeof js!="function")throw Error(u(280));var t=e.stateNode;t&&(t=pl(t),js(e.stateNode,e.type,t))}}function Ca(e){vr?gr?gr.push(e):gr=[e]:vr=e}function _a(){if(vr){var e=vr,t=gr;if(gr=vr=null,ka(e),t)for(e=0;e>>=0,e===0?32:31-(Uh(e)/Qh|0)|0}var qi=64,Zi=4194304;function ni(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ji(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var d=a&~i;d!==0?r=ni(d):(s&=a,s!==0&&(r=ni(s)))}else a=n&~i,a!==0?r=ni(a):s!==0&&(r=ni(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ri(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function Vh(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=di),Za=" ",Ja=!1;function ba(e,t){switch(e){case"keyup":return gp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ec(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kr=!1;function Sp(e,t){switch(e){case"compositionend":return ec(t);case"keypress":return t.which!==32?null:(Ja=!0,Za);case"textInput":return e=t.data,e===Za&&Ja?null:e;default:return null}}function kp(e,t){if(kr)return e==="compositionend"||!Ys&&ba(e,t)?(e=Wa(),rl=Bs=vn=null,kr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=oc(n)}}function ac(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ac(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cc(){for(var e=window,t=Vi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vi(e.document)}return t}function Zs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function jp(e){var t=cc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ac(n.ownerDocument.documentElement,n)){if(r!==null&&Zs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=uc(n,s);var a=uc(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Cr=null,Js=null,mi=null,bs=!1;function dc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bs||Cr==null||Cr!==Vi(r)||(r=Cr,"selectionStart"in r&&Zs(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),mi&&pi(mi,r)||(mi=r,r=dl(Js,"onSelect"),0Nr||(e.current=fo[Nr],fo[Nr]=null,Nr--)}function ke(e,t){Nr++,fo[Nr]=e.current,e.current=t}var kn={},Ge=Sn(kn),ot=Sn(!1),Hn=kn;function Tr(e,t){var n=e.type.contextTypes;if(!n)return kn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ut(e){return e=e.childContextTypes,e!=null}function ml(){_e(ot),_e(Ge)}function xc(e,t,n){if(Ge.current!==kn)throw Error(u(168));ke(Ge,t),ke(ot,n)}function Nc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(u(108,Se(e)||"Unknown",i));return I({},n,r)}function yl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kn,Hn=Ge.current,ke(Ge,e),ke(ot,ot.current),!0}function Tc(e,t,n){var r=e.stateNode;if(!r)throw Error(u(169));n?(e=Nc(e,t,Hn),r.__reactInternalMemoizedMergedChildContext=e,_e(ot),_e(Ge),ke(Ge,e)):_e(ot),ke(ot,n)}var Jt=null,vl=!1,ho=!1;function Rc(e){Jt===null?Jt=[e]:Jt.push(e)}function Bp(e){vl=!0,Rc(e)}function Cn(){if(!ho&&Jt!==null){ho=!0;var e=0,t=we;try{var n=Jt;for(we=1;e>=a,i-=a,bt=1<<32-zt(t)+i|n<ee?(Qe=q,q=null):Qe=q.sibling;var me=_(v,q,g[ee],D);if(me===null){q===null&&(q=Qe);break}e&&q&&me.alternate===null&&t(v,q),p=s(me,p,ee),X===null?B=me:X.sibling=me,X=me,q=Qe}if(ee===g.length)return n(v,q),xe&&Wn(v,ee),B;if(q===null){for(;eeee?(Qe=q,q=null):Qe=q.sibling;var Dn=_(v,q,me.value,D);if(Dn===null){q===null&&(q=Qe);break}e&&q&&Dn.alternate===null&&t(v,q),p=s(Dn,p,ee),X===null?B=Dn:X.sibling=Dn,X=Dn,q=Qe}if(me.done)return n(v,q),xe&&Wn(v,ee),B;if(q===null){for(;!me.done;ee++,me=g.next())me=x(v,me.value,D),me!==null&&(p=s(me,p,ee),X===null?B=me:X.sibling=me,X=me);return xe&&Wn(v,ee),B}for(q=r(v,q);!me.done;ee++,me=g.next())me=F(q,v,ee,me.value,D),me!==null&&(e&&me.alternate!==null&&q.delete(me.key===null?ee:me.key),p=s(me,p,ee),X===null?B=me:X.sibling=me,X=me);return e&&q.forEach(function(Cm){return t(v,Cm)}),xe&&Wn(v,ee),B}function Fe(v,p,g,D){if(typeof g=="object"&&g!==null&&g.type===ve&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case te:e:{for(var B=g.key,X=p;X!==null;){if(X.key===B){if(B=g.type,B===ve){if(X.tag===7){n(v,X.sibling),p=i(X,g.props.children),p.return=v,v=p;break e}}else if(X.elementType===B||typeof B=="object"&&B!==null&&B.$$typeof===tt&&Lc(B)===X.type){n(v,X.sibling),p=i(X,g.props),p.ref=ki(v,X,g),p.return=v,v=p;break e}n(v,X);break}else t(v,X);X=X.sibling}g.type===ve?(p=bn(g.props.children,v.mode,D,g.key),p.return=v,v=p):(D=Wl(g.type,g.key,g.props,null,v.mode,D),D.ref=ki(v,p,g),D.return=v,v=D)}return a(v);case ae:e:{for(X=g.key;p!==null;){if(p.key===X)if(p.tag===4&&p.stateNode.containerInfo===g.containerInfo&&p.stateNode.implementation===g.implementation){n(v,p.sibling),p=i(p,g.children||[]),p.return=v,v=p;break e}else{n(v,p);break}else t(v,p);p=p.sibling}p=cu(g,v.mode,D),p.return=v,v=p}return a(v);case tt:return X=g._init,Fe(v,p,X(g._payload),D)}if(qr(g))return A(v,p,g,D);if(Y(g))return Q(v,p,g,D);kl(v,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,p!==null&&p.tag===6?(n(v,p.sibling),p=i(p,g),p.return=v,v=p):(n(v,p),p=au(g,v.mode,D),p.return=v,v=p),a(v)):n(v,p)}return Fe}var Or=Ic(!0),Mc=Ic(!1),Cl=Sn(null),_l=null,zr=null,wo=null;function So(){wo=zr=_l=null}function ko(e){var t=Cl.current;_e(Cl),e._currentValue=t}function Co(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Fr(e,t){_l=e,wo=zr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(at=!0),e.firstContext=null)}function Pt(e){var t=e._currentValue;if(wo!==e)if(e={context:e,memoizedValue:t,next:null},zr===null){if(_l===null)throw Error(u(308));zr=e,_l.dependencies={lanes:0,firstContext:e}}else zr=zr.next=e;return t}var Kn=null;function _o(e){Kn===null?Kn=[e]:Kn.push(e)}function Ac(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,_o(t)):(n.next=i.next,i.next=n),t.interleaved=n,tn(e,r)}function tn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _n=!1;function Eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function nn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function En(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,fe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,tn(e,n)}return i=r.interleaved,i===null?(t.next=t,_o(r)):(t.next=i.next,i.next=t),r.interleaved=t,tn(e,n)}function El(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ms(e,n)}}function Qc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Pl(e,t,n,r){var i=e.updateQueue;_n=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,d=i.shared.pending;if(d!==null){i.shared.pending=null;var f=d,w=f.next;f.next=null,a===null?s=w:a.next=w,a=f;var P=e.alternate;P!==null&&(P=P.updateQueue,d=P.lastBaseUpdate,d!==a&&(d===null?P.firstBaseUpdate=w:d.next=w,P.lastBaseUpdate=f))}if(s!==null){var x=i.baseState;a=0,P=w=f=null,d=s;do{var _=d.lane,F=d.eventTime;if((r&_)===_){P!==null&&(P=P.next={eventTime:F,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var A=e,Q=d;switch(_=t,F=n,Q.tag){case 1:if(A=Q.payload,typeof A=="function"){x=A.call(F,x,_);break e}x=A;break e;case 3:A.flags=A.flags&-65537|128;case 0:if(A=Q.payload,_=typeof A=="function"?A.call(F,x,_):A,_==null)break e;x=I({},x,_);break e;case 2:_n=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,_=i.effects,_===null?i.effects=[d]:_.push(d))}else F={eventTime:F,lane:_,tag:d.tag,payload:d.payload,callback:d.callback,next:null},P===null?(w=P=F,f=x):P=P.next=F,a|=_;if(d=d.next,d===null){if(d=i.shared.pending,d===null)break;_=d,d=_.next,_.next=null,i.lastBaseUpdate=_,i.shared.pending=null}}while(!0);if(P===null&&(f=x),i.baseState=f,i.firstBaseUpdate=w,i.lastBaseUpdate=P,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Xn|=a,e.lanes=a,e.memoizedState=x}}function $c(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ro.transition;Ro.transition={};try{e(!1),t()}finally{we=n,Ro.transition=r}}function sd(){return xt().memoizedState}function Kp(e,t,n){var r=Tn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},od(e))ud(t,n);else if(n=Ac(e,t,n,r),n!==null){var i=rt();Ut(n,e,r,i),ad(n,t,r)}}function Gp(e,t,n){var r=Tn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(od(e))ud(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,d=s(a,n);if(i.hasEagerState=!0,i.eagerState=d,Ft(d,a)){var f=t.interleaved;f===null?(i.next=i,_o(t)):(i.next=f.next,f.next=i),t.interleaved=i;return}}catch{}finally{}n=Ac(e,t,i,r),n!==null&&(i=rt(),Ut(n,e,r,i),ad(n,t,r))}}function od(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function ud(e,t){Pi=Tl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ad(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ms(e,n)}}var Dl={readContext:Pt,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},Yp={readContext:Pt,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:Jc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rl(4194308,4,td.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rl(4,2,e,t)},useMemo:function(e,t){var n=Gt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Kp.bind(null,Re,e),[r.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:qc,useDebugValue:Io,useDeferredValue:function(e){return Gt().memoizedState=e},useTransition:function(){var e=qc(!1),t=e[0];return e=Wp.bind(null,e[1]),Gt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Re,i=Gt();if(xe){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Ue===null)throw Error(u(349));Yn&30||Wc(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Jc(Gc.bind(null,r,s,e),[e]),r.flags|=2048,Ti(9,Kc.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Gt(),t=Ue.identifierPrefix;if(xe){var n=en,r=bt;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Wt]=t,e[wi]=r,Rd(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ns(n,r),n){case"dialog":Ce("cancel",e),Ce("close",e),i=r;break;case"iframe":case"object":case"embed":Ce("load",e),i=r;break;case"video":case"audio":for(i=0;iUr&&(t.flags|=128,r=!0,Ri(s,!1),t.lanes=4194304)}else{if(!r)if(e=xl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ri(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!xe)return Xe(t),null}else 2*ze()-s.renderingStartTime>Ur&&n!==1073741824&&(t.flags|=128,r=!0,Ri(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ze(),t.sibling=null,n=Te.current,ke(Te,r?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return su(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?wt&1073741824&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(u(156,t.tag))}function nm(e,t){switch(mo(t),t.tag){case 1:return ut(t.type)&&ml(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lr(),_e(ot),_e(Ge),To(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xo(t),null;case 13:if(_e(Te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Dr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _e(Te),null;case 4:return Lr(),null;case 10:return ko(t.type._context),null;case 22:case 23:return su(),null;case 24:return null;default:return null}}var Ll=!1,qe=!1,rm=typeof WeakSet=="function"?WeakSet:Set,M=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Oe(e,t,r)}else n.current=null}function Yo(e,t,n){try{n()}catch(r){Oe(e,t,r)}}var Od=!1;function im(e,t){if(lo=tl,e=cc(),Zs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,d=-1,f=-1,w=0,P=0,x=e,_=null;t:for(;;){for(var F;x!==n||i!==0&&x.nodeType!==3||(d=a+i),x!==s||r!==0&&x.nodeType!==3||(f=a+r),x.nodeType===3&&(a+=x.nodeValue.length),(F=x.firstChild)!==null;)_=x,x=F;for(;;){if(x===e)break t;if(_===n&&++w===i&&(d=a),_===s&&++P===r&&(f=a),(F=x.nextSibling)!==null)break;x=_,_=x.parentNode}x=F}n=d===-1||f===-1?null:{start:d,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(so={focusedElem:e,selectionRange:n},tl=!1,M=t;M!==null;)if(t=M,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,M=e;else for(;M!==null;){t=M;try{var A=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(A!==null){var Q=A.memoizedProps,Fe=A.memoizedState,v=t.stateNode,p=v.getSnapshotBeforeUpdate(t.elementType===t.type?Q:It(t.type,Q),Fe);v.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(D){Oe(t,t.return,D)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return A=Od,Od=!1,A}function ji(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Yo(t,n,s)}i=i.next}while(i!==r)}}function Il(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Xo(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function zd(e){var t=e.alternate;t!==null&&(e.alternate=null,zd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[wi],delete t[co],delete t[Qp],delete t[$p])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Fd(e){return e.tag===5||e.tag===3||e.tag===4}function Ld(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=hl));else if(r!==4&&(e=e.child,e!==null))for(qo(e,t,n),e=e.sibling;e!==null;)qo(e,t,n),e=e.sibling}function Zo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Zo(e,t,n),e=e.sibling;e!==null;)Zo(e,t,n),e=e.sibling}var Ve=null,Mt=!1;function Pn(e,t,n){for(n=n.child;n!==null;)Id(e,t,n),n=n.sibling}function Id(e,t,n){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Xi,n)}catch{}switch(n.tag){case 5:qe||Mr(n,t);case 6:var r=Ve,i=Mt;Ve=null,Pn(e,t,n),Ve=r,Mt=i,Ve!==null&&(Mt?(e=Ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ve.removeChild(n.stateNode));break;case 18:Ve!==null&&(Mt?(e=Ve,n=n.stateNode,e.nodeType===8?ao(e.parentNode,n):e.nodeType===1&&ao(e,n),ui(e)):ao(Ve,n.stateNode));break;case 4:r=Ve,i=Mt,Ve=n.stateNode.containerInfo,Mt=!0,Pn(e,t,n),Ve=r,Mt=i;break;case 0:case 11:case 14:case 15:if(!qe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Yo(n,t,a),i=i.next}while(i!==r)}Pn(e,t,n);break;case 1:if(!qe&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){Oe(n,t,d)}Pn(e,t,n);break;case 21:Pn(e,t,n);break;case 22:n.mode&1?(qe=(r=qe)||n.memoizedState!==null,Pn(e,t,n),qe=r):Pn(e,t,n);break;default:Pn(e,t,n)}}function Md(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new rm),t.forEach(function(r){var i=hm.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function At(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~s}if(r=i,r=ze()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sm(r/1960))-r,10e?16:e,Nn===null)var r=!1;else{if(e=Nn,Nn=null,$l=0,fe&6)throw Error(u(331));var i=fe;for(fe|=4,M=e.current;M!==null;){var s=M,a=s.child;if(M.flags&16){var d=s.deletions;if(d!==null){for(var f=0;fze()-eu?Zn(e,0):bo|=n),dt(e,t)}function qd(e,t){t===0&&(e.mode&1?(t=Zi,Zi<<=1,!(Zi&130023424)&&(Zi=4194304)):t=1);var n=rt();e=tn(e,t),e!==null&&(ri(e,t,n),dt(e,n))}function fm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qd(e,n)}function hm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(u(314))}r!==null&&r.delete(t),qd(e,n)}var Zd;Zd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)at=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return at=!1,em(e,t,n);at=!!(e.flags&131072)}else at=!1,xe&&t.flags&1048576&&jc(t,wl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fl(e,t),e=t.pendingProps;var i=Tr(t,Ge.current);Fr(t,n),i=Do(null,t,r,e,i,n);var s=Oo();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ut(r)?(s=!0,yl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Eo(t),i.updater=Ol,t.stateNode=i,i._reactInternals=t,Ao(t,r,e,n),t=Bo(null,t,r,!0,s,n)):(t.tag=0,xe&&s&&po(t),nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=mm(r),e=It(r,e),i){case 0:t=$o(null,t,r,e,n);break e;case 1:t=_d(null,t,r,e,n);break e;case 11:t=gd(null,t,r,e,n);break e;case 14:t=wd(null,t,r,It(r.type,e),n);break e}throw Error(u(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),$o(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),_d(e,t,r,i,n);case 3:e:{if(Ed(t),e===null)throw Error(u(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Uc(e,t),Pl(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Ir(Error(u(423)),t),t=Pd(e,t,r,n,i);break e}else if(r!==i){i=Ir(Error(u(424)),t),t=Pd(e,t,r,n,i);break e}else for(gt=wn(t.stateNode.containerInfo.firstChild),vt=t,xe=!0,Lt=null,n=Mc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dr(),r===i){t=rn(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return Bc(t),e===null&&vo(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,oo(r,i)?a=null:s!==null&&oo(r,s)&&(t.flags|=32),Cd(e,t),nt(e,t,a,n),t.child;case 6:return e===null&&vo(t),null;case 13:return xd(e,t,n);case 4:return Po(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Or(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),gd(e,t,r,i,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,ke(Cl,r._currentValue),r._currentValue=a,s!==null)if(Ft(s.value,a)){if(s.children===i.children&&!ot.current){t=rn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var d=s.dependencies;if(d!==null){a=s.child;for(var f=d.firstContext;f!==null;){if(f.context===r){if(s.tag===1){f=nn(-1,n&-n),f.tag=2;var w=s.updateQueue;if(w!==null){w=w.shared;var P=w.pending;P===null?f.next=f:(f.next=P.next,P.next=f),w.pending=f}}s.lanes|=n,f=s.alternate,f!==null&&(f.lanes|=n),Co(s.return,n,t),d.lanes|=n;break}f=f.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(u(341));a.lanes|=n,d=a.alternate,d!==null&&(d.lanes|=n),Co(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Fr(t,n),i=Pt(i),r=r(i),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,i=It(r,t.pendingProps),i=It(r.type,i),wd(e,t,r,i,n);case 15:return Sd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:It(r,i),Fl(e,t),t.tag=1,ut(r)?(e=!0,yl(t)):e=!1,Fr(t,n),dd(t,r,i),Ao(t,r,i,n),Bo(null,t,r,!0,e,n);case 19:return Td(e,t,n);case 22:return kd(e,t,n)}throw Error(u(156,t.tag))};function Jd(e,t){return Da(e,t)}function pm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(e,t,n,r){return new pm(e,t,n,r)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function mm(e){if(typeof e=="function")return uu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Be)return 11;if(e===Ct)return 14}return 2}function jn(e,t){var n=e.alternate;return n===null?(n=Tt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wl(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")uu(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ve:return bn(n.children,i,s,t);case J:a=8,i|=8;break;case Ne:return e=Tt(12,n,t,i|2),e.elementType=Ne,e.lanes=s,e;case et:return e=Tt(13,n,t,i),e.elementType=et,e.lanes=s,e;case He:return e=Tt(19,n,t,i),e.elementType=He,e.lanes=s,e;case Ee:return Kl(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case st:a=10;break e;case qt:a=9;break e;case Be:a=11;break e;case Ct:a=14;break e;case tt:a=16,r=null;break e}throw Error(u(130,e==null?e:typeof e,""))}return t=Tt(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function bn(e,t,n,r){return e=Tt(7,e,r,t),e.lanes=n,e}function Kl(e,t,n,r){return e=Tt(22,e,r,t),e.elementType=Ee,e.lanes=n,e.stateNode={isHidden:!1},e}function au(e,t,n){return e=Tt(6,e,null,t),e.lanes=n,e}function cu(e,t,n){return t=Tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ym(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Is(0),this.expirationTimes=Is(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Is(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function du(e,t,n,r,i,s,a,d,f){return e=new ym(e,t,n,d,f),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Tt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Eo(s),e}function vm(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Tu)}catch(o){console.error(o)}}Tu(),Eu.exports=df();var ff=Eu.exports,Ru=ff;es.createRoot=Ru.createRoot,es.hydrateRoot=Ru.hydrateRoot;var $r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(o){return this.listeners.add(o),this.onSubscribe(),()=>{this.listeners.delete(o),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},er=typeof window>"u"||"Deno"in globalThis;function St(){}function hf(o,l){return typeof o=="function"?o(l):o}function rs(o){return typeof o=="number"&&o>=0&&o!==1/0}function ju(o,l){return Math.max(o+(l||0)-Date.now(),0)}function tr(o,l){return typeof o=="function"?o(l):o}function Rt(o,l){return typeof o=="function"?o(l):o}function Du(o,l){const{type:u="all",exact:c,fetchStatus:h,predicate:S,queryKey:k,stale:N}=o;if(k){if(c){if(l.queryHash!==is(k,l.options))return!1}else if(!Hr(l.queryKey,k))return!1}if(u!=="all"){const T=l.isActive();if(u==="active"&&!T||u==="inactive"&&T)return!1}return!(typeof N=="boolean"&&l.isStale()!==N||h&&h!==l.state.fetchStatus||S&&!S(l))}function Ou(o,l){const{exact:u,status:c,predicate:h,mutationKey:S}=o;if(S){if(!l.options.mutationKey)return!1;if(u){if(Br(l.options.mutationKey)!==Br(S))return!1}else if(!Hr(l.options.mutationKey,S))return!1}return!(c&&l.state.status!==c||h&&!h(l))}function is(o,l){return((l==null?void 0:l.queryKeyHashFn)||Br)(o)}function Br(o){return JSON.stringify(o,(l,u)=>ss(u)?Object.keys(u).sort().reduce((c,h)=>(c[h]=u[h],c),{}):u)}function Hr(o,l){return o===l?!0:typeof o!=typeof l?!1:o&&l&&typeof o=="object"&&typeof l=="object"?!Object.keys(l).some(u=>!Hr(o[u],l[u])):!1}function zu(o,l){if(o===l)return o;const u=Fu(o)&&Fu(l);if(u||ss(o)&&ss(l)){const c=u?o:Object.keys(o),h=c.length,S=u?l:Object.keys(l),k=S.length,N=u?[]:{};let T=0;for(let z=0;z{setTimeout(l,o)})}function os(o,l,u){return typeof u.structuralSharing=="function"?u.structuralSharing(o,l):u.structuralSharing!==!1?zu(o,l):l}function mf(o,l,u=0){const c=[...o,l];return u&&c.length>u?c.slice(1):c}function yf(o,l,u=0){const c=[l,...o];return u&&c.length>u?c.slice(0,-1):c}var Iu=Symbol();function Mu(o,l){return!o.queryFn&&(l!=null&&l.initialPromise)?()=>l.initialPromise:!o.queryFn||o.queryFn===Iu?()=>Promise.reject(new Error(`Missing queryFn: '${o.queryHash}'`)):o.queryFn}var vf=(ta=class extends $r{constructor(){super();ne(this,zn);ne(this,on);ne(this,rr);$(this,rr,l=>{if(!er&&window.addEventListener){const u=()=>l();return window.addEventListener("visibilitychange",u,!1),()=>{window.removeEventListener("visibilitychange",u)}}})}onSubscribe(){m(this,on)||this.setEventListener(m(this,rr))}onUnsubscribe(){var l;this.hasListeners()||((l=m(this,on))==null||l.call(this),$(this,on,void 0))}setEventListener(l){var u;$(this,rr,l),(u=m(this,on))==null||u.call(this),$(this,on,l(c=>{typeof c=="boolean"?this.setFocused(c):this.onFocus()}))}setFocused(l){m(this,zn)!==l&&($(this,zn,l),this.onFocus())}onFocus(){const l=this.isFocused();this.listeners.forEach(u=>{u(l)})}isFocused(){var l;return typeof m(this,zn)=="boolean"?m(this,zn):((l=globalThis.document)==null?void 0:l.visibilityState)!=="hidden"}},zn=new WeakMap,on=new WeakMap,rr=new WeakMap,ta),us=new vf,gf=(na=class extends $r{constructor(){super();ne(this,ir,!0);ne(this,un);ne(this,lr);$(this,lr,l=>{if(!er&&window.addEventListener){const u=()=>l(!0),c=()=>l(!1);return window.addEventListener("online",u,!1),window.addEventListener("offline",c,!1),()=>{window.removeEventListener("online",u),window.removeEventListener("offline",c)}}})}onSubscribe(){m(this,un)||this.setEventListener(m(this,lr))}onUnsubscribe(){var l;this.hasListeners()||((l=m(this,un))==null||l.call(this),$(this,un,void 0))}setEventListener(l){var u;$(this,lr,l),(u=m(this,un))==null||u.call(this),$(this,un,l(this.setOnline.bind(this)))}setOnline(l){m(this,ir)!==l&&($(this,ir,l),this.listeners.forEach(c=>{c(l)}))}isOnline(){return m(this,ir)}},ir=new WeakMap,un=new WeakMap,lr=new WeakMap,na),Mi=new gf;function wf(o){return Math.min(1e3*2**o,3e4)}function Au(o){return(o??"online")==="online"?Mi.isOnline():!0}var Uu=class{constructor(o){this.revert=o==null?void 0:o.revert,this.silent=o==null?void 0:o.silent}};function as(o){return o instanceof Uu}function Qu(o){let l=!1,u=0,c=!1,h,S,k;const N=new Promise((K,Z)=>{S=K,k=Z}),T=K=>{var Z;c||(W(new Uu(K)),(Z=o.abort)==null||Z.call(o))},z=()=>{l=!0},U=()=>{l=!1},R=()=>us.isFocused()&&(o.networkMode==="always"||Mi.isOnline())&&o.canRun(),j=()=>Au(o.networkMode)&&o.canRun(),L=K=>{var Z;c||(c=!0,(Z=o.onSuccess)==null||Z.call(o,K),h==null||h(),S(K))},W=K=>{var Z;c||(c=!0,(Z=o.onError)==null||Z.call(o,K),h==null||h(),k(K))},V=()=>new Promise(K=>{var Z;h=b=>{(c||R())&&K(b)},(Z=o.onPause)==null||Z.call(o)}).then(()=>{var K;h=void 0,c||(K=o.onContinue)==null||K.call(o)}),G=()=>{if(c)return;let K;const Z=u===0?o.initialPromise:void 0;try{K=Z??o.fn()}catch(b){K=Promise.reject(b)}Promise.resolve(K).then(L).catch(b=>{var J;if(c)return;const H=o.retry??(er?0:3),te=o.retryDelay??wf,ae=typeof te=="function"?te(u,b):te,ve=H===!0||typeof H=="number"&&uR()?void 0:V()).then(()=>{l?W(b):G()})})};return{promise:N,cancel:T,continue:()=>(h==null||h(),N),cancelRetry:z,continueRetry:U,canStart:j,start:()=>(j()?G():V().then(G),N)}}function Sf(){let o=[],l=0,u=j=>{j()},c=j=>{j()},h=j=>setTimeout(j,0);const S=j=>{h=j},k=j=>{let L;l++;try{L=j()}finally{l--,l||z()}return L},N=j=>{l?o.push(j):h(()=>{u(j)})},T=j=>(...L)=>{N(()=>{j(...L)})},z=()=>{const j=o;o=[],j.length&&h(()=>{c(()=>{j.forEach(L=>{u(L)})})})};return{batch:k,batchCalls:T,schedule:N,setNotifyFunction:j=>{u=j},setBatchNotifyFunction:j=>{c=j},setScheduler:S}}var $e=Sf(),$u=(ra=class{constructor(){ne(this,Fn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rs(this.gcTime)&&$(this,Fn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(o){this.gcTime=Math.max(this.gcTime||0,o??(er?1/0:5*60*1e3))}clearGcTimeout(){m(this,Fn)&&(clearTimeout(m(this,Fn)),$(this,Fn,void 0))}},Fn=new WeakMap,ra),kf=(ia=class extends $u{constructor(l){super();ne(this,Ot);ne(this,sr);ne(this,or);ne(this,kt);ne(this,Ke);ne(this,Kr);ne(this,Ln);$(this,Ln,!1),$(this,Kr,l.defaultOptions),this.setOptions(l.options),this.observers=[],$(this,kt,l.cache),this.queryKey=l.queryKey,this.queryHash=l.queryHash,$(this,sr,l.state||Cf(this.options)),this.state=m(this,sr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var l;return(l=m(this,Ke))==null?void 0:l.promise}setOptions(l){this.options={...m(this,Kr),...l},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&m(this,kt).remove(this)}setData(l,u){const c=os(this.state.data,l,this.options);return ce(this,Ot,sn).call(this,{data:c,type:"success",dataUpdatedAt:u==null?void 0:u.updatedAt,manual:u==null?void 0:u.manual}),c}setState(l,u){ce(this,Ot,sn).call(this,{type:"setState",state:l,setStateOptions:u})}cancel(l){var c,h;const u=(c=m(this,Ke))==null?void 0:c.promise;return(h=m(this,Ke))==null||h.cancel(l),u?u.then(St).catch(St):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(m(this,sr))}isActive(){return this.observers.some(l=>Rt(l.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(l=>l.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(l=0){return this.state.isInvalidated||this.state.data===void 0||!ju(this.state.dataUpdatedAt,l)}onFocus(){var u;const l=this.observers.find(c=>c.shouldFetchOnWindowFocus());l==null||l.refetch({cancelRefetch:!1}),(u=m(this,Ke))==null||u.continue()}onOnline(){var u;const l=this.observers.find(c=>c.shouldFetchOnReconnect());l==null||l.refetch({cancelRefetch:!1}),(u=m(this,Ke))==null||u.continue()}addObserver(l){this.observers.includes(l)||(this.observers.push(l),this.clearGcTimeout(),m(this,kt).notify({type:"observerAdded",query:this,observer:l}))}removeObserver(l){this.observers.includes(l)&&(this.observers=this.observers.filter(u=>u!==l),this.observers.length||(m(this,Ke)&&(m(this,Ln)?m(this,Ke).cancel({revert:!0}):m(this,Ke).cancelRetry()),this.scheduleGc()),m(this,kt).notify({type:"observerRemoved",query:this,observer:l}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,Ot,sn).call(this,{type:"invalidate"})}fetch(l,u){var T,z,U;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(u!=null&&u.cancelRefetch))this.cancel({silent:!0});else if(m(this,Ke))return m(this,Ke).continueRetry(),m(this,Ke).promise}if(l&&this.setOptions(l),!this.options.queryFn){const R=this.observers.find(j=>j.options.queryFn);R&&this.setOptions(R.options)}const c=new AbortController,h=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>($(this,Ln,!0),c.signal)})},S=()=>{const R=Mu(this.options,u),j={queryKey:this.queryKey,meta:this.meta};return h(j),$(this,Ln,!1),this.options.persister?this.options.persister(R,j,this):R(j)},k={fetchOptions:u,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:S};h(k),(T=this.options.behavior)==null||T.onFetch(k,this),$(this,or,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((z=k.fetchOptions)==null?void 0:z.meta))&&ce(this,Ot,sn).call(this,{type:"fetch",meta:(U=k.fetchOptions)==null?void 0:U.meta});const N=R=>{var j,L,W,V;as(R)&&R.silent||ce(this,Ot,sn).call(this,{type:"error",error:R}),as(R)||((L=(j=m(this,kt).config).onError)==null||L.call(j,R,this),(V=(W=m(this,kt).config).onSettled)==null||V.call(W,this.state.data,R,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return $(this,Ke,Qu({initialPromise:u==null?void 0:u.initialPromise,fn:k.fetchFn,abort:c.abort.bind(c),onSuccess:R=>{var j,L,W,V;if(R===void 0){N(new Error(`${this.queryHash} data is undefined`));return}this.setData(R),(L=(j=m(this,kt).config).onSuccess)==null||L.call(j,R,this),(V=(W=m(this,kt).config).onSettled)==null||V.call(W,R,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:N,onFail:(R,j)=>{ce(this,Ot,sn).call(this,{type:"failed",failureCount:R,error:j})},onPause:()=>{ce(this,Ot,sn).call(this,{type:"pause"})},onContinue:()=>{ce(this,Ot,sn).call(this,{type:"continue"})},retry:k.options.retry,retryDelay:k.options.retryDelay,networkMode:k.options.networkMode,canRun:()=>!0})),m(this,Ke).start()}},sr=new WeakMap,or=new WeakMap,kt=new WeakMap,Ke=new WeakMap,Kr=new WeakMap,Ln=new WeakMap,Ot=new WeakSet,sn=function(l){const u=c=>{switch(l.type){case"failed":return{...c,fetchFailureCount:l.failureCount,fetchFailureReason:l.error};case"pause":return{...c,fetchStatus:"paused"};case"continue":return{...c,fetchStatus:"fetching"};case"fetch":return{...c,...Bu(c.data,this.options),fetchMeta:l.meta??null};case"success":return{...c,data:l.data,dataUpdateCount:c.dataUpdateCount+1,dataUpdatedAt:l.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!l.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const h=l.error;return as(h)&&h.revert&&m(this,or)?{...m(this,or),fetchStatus:"idle"}:{...c,error:h,errorUpdateCount:c.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:c.fetchFailureCount+1,fetchFailureReason:h,fetchStatus:"idle",status:"error"};case"invalidate":return{...c,isInvalidated:!0};case"setState":return{...c,...l.state}}};this.state=u(this.state),$e.batch(()=>{this.observers.forEach(c=>{c.onQueryUpdate()}),m(this,kt).notify({query:this,type:"updated",action:l})})},ia);function Bu(o,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Au(l.networkMode)?"fetching":"paused",...o===void 0&&{error:null,status:"pending"}}}function Cf(o){const l=typeof o.initialData=="function"?o.initialData():o.initialData,u=l!==void 0,c=u?typeof o.initialDataUpdatedAt=="function"?o.initialDataUpdatedAt():o.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:u?c??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:u?"success":"pending",fetchStatus:"idle"}}var _f=(la=class extends $r{constructor(l={}){super();ne(this,Qt);this.config=l,$(this,Qt,new Map)}build(l,u,c){const h=u.queryKey,S=u.queryHash??is(h,u);let k=this.get(S);return k||(k=new kf({cache:this,queryKey:h,queryHash:S,options:l.defaultQueryOptions(u),state:c,defaultOptions:l.getQueryDefaults(h)}),this.add(k)),k}add(l){m(this,Qt).has(l.queryHash)||(m(this,Qt).set(l.queryHash,l),this.notify({type:"added",query:l}))}remove(l){const u=m(this,Qt).get(l.queryHash);u&&(l.destroy(),u===l&&m(this,Qt).delete(l.queryHash),this.notify({type:"removed",query:l}))}clear(){$e.batch(()=>{this.getAll().forEach(l=>{this.remove(l)})})}get(l){return m(this,Qt).get(l)}getAll(){return[...m(this,Qt).values()]}find(l){const u={exact:!0,...l};return this.getAll().find(c=>Du(u,c))}findAll(l={}){const u=this.getAll();return Object.keys(l).length>0?u.filter(c=>Du(l,c)):u}notify(l){$e.batch(()=>{this.listeners.forEach(u=>{u(l)})})}onFocus(){$e.batch(()=>{this.getAll().forEach(l=>{l.onFocus()})})}onOnline(){$e.batch(()=>{this.getAll().forEach(l=>{l.onOnline()})})}},Qt=new WeakMap,la),Ef=(sa=class extends $u{constructor(l){super();ne(this,Bt);ne(this,$t);ne(this,Je);ne(this,In);this.mutationId=l.mutationId,$(this,Je,l.mutationCache),$(this,$t,[]),this.state=l.state||Pf(),this.setOptions(l.options),this.scheduleGc()}setOptions(l){this.options=l,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(l){m(this,$t).includes(l)||(m(this,$t).push(l),this.clearGcTimeout(),m(this,Je).notify({type:"observerAdded",mutation:this,observer:l}))}removeObserver(l){$(this,$t,m(this,$t).filter(u=>u!==l)),this.scheduleGc(),m(this,Je).notify({type:"observerRemoved",mutation:this,observer:l})}optionalRemove(){m(this,$t).length||(this.state.status==="pending"?this.scheduleGc():m(this,Je).remove(this))}continue(){var l;return((l=m(this,In))==null?void 0:l.continue())??this.execute(this.state.variables)}async execute(l){var h,S,k,N,T,z,U,R,j,L,W,V,G,K,Z,b,H,te,ae,ve;$(this,In,Qu({fn:()=>this.options.mutationFn?this.options.mutationFn(l):Promise.reject(new Error("No mutationFn found")),onFail:(J,Ne)=>{ce(this,Bt,On).call(this,{type:"failed",failureCount:J,error:Ne})},onPause:()=>{ce(this,Bt,On).call(this,{type:"pause"})},onContinue:()=>{ce(this,Bt,On).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>m(this,Je).canRun(this)}));const u=this.state.status==="pending",c=!m(this,In).canStart();try{if(!u){ce(this,Bt,On).call(this,{type:"pending",variables:l,isPaused:c}),await((S=(h=m(this,Je).config).onMutate)==null?void 0:S.call(h,l,this));const Ne=await((N=(k=this.options).onMutate)==null?void 0:N.call(k,l));Ne!==this.state.context&&ce(this,Bt,On).call(this,{type:"pending",context:Ne,variables:l,isPaused:c})}const J=await m(this,In).start();return await((z=(T=m(this,Je).config).onSuccess)==null?void 0:z.call(T,J,l,this.state.context,this)),await((R=(U=this.options).onSuccess)==null?void 0:R.call(U,J,l,this.state.context)),await((L=(j=m(this,Je).config).onSettled)==null?void 0:L.call(j,J,null,this.state.variables,this.state.context,this)),await((V=(W=this.options).onSettled)==null?void 0:V.call(W,J,null,l,this.state.context)),ce(this,Bt,On).call(this,{type:"success",data:J}),J}catch(J){try{throw await((K=(G=m(this,Je).config).onError)==null?void 0:K.call(G,J,l,this.state.context,this)),await((b=(Z=this.options).onError)==null?void 0:b.call(Z,J,l,this.state.context)),await((te=(H=m(this,Je).config).onSettled)==null?void 0:te.call(H,void 0,J,this.state.variables,this.state.context,this)),await((ve=(ae=this.options).onSettled)==null?void 0:ve.call(ae,void 0,J,l,this.state.context)),J}finally{ce(this,Bt,On).call(this,{type:"error",error:J})}}finally{m(this,Je).runNext(this)}}},$t=new WeakMap,Je=new WeakMap,In=new WeakMap,Bt=new WeakSet,On=function(l){const u=c=>{switch(l.type){case"failed":return{...c,failureCount:l.failureCount,failureReason:l.error};case"pause":return{...c,isPaused:!0};case"continue":return{...c,isPaused:!1};case"pending":return{...c,context:l.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:l.isPaused,status:"pending",variables:l.variables,submittedAt:Date.now()};case"success":return{...c,data:l.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...c,data:void 0,error:l.error,failureCount:c.failureCount+1,failureReason:l.error,isPaused:!1,status:"error"}}};this.state=u(this.state),$e.batch(()=>{m(this,$t).forEach(c=>{c.onMutationUpdate(l)}),m(this,Je).notify({mutation:this,type:"updated",action:l})})},sa);function Pf(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xf=(oa=class extends $r{constructor(l={}){super();ne(this,pt);ne(this,Gr);this.config=l,$(this,pt,new Map),$(this,Gr,Date.now())}build(l,u,c){const h=new Ef({mutationCache:this,mutationId:++bl(this,Gr)._,options:l.defaultMutationOptions(u),state:c});return this.add(h),h}add(l){const u=Ai(l),c=m(this,pt).get(u)??[];c.push(l),m(this,pt).set(u,c),this.notify({type:"added",mutation:l})}remove(l){var c;const u=Ai(l);if(m(this,pt).has(u)){const h=(c=m(this,pt).get(u))==null?void 0:c.filter(S=>S!==l);h&&(h.length===0?m(this,pt).delete(u):m(this,pt).set(u,h))}this.notify({type:"removed",mutation:l})}canRun(l){var c;const u=(c=m(this,pt).get(Ai(l)))==null?void 0:c.find(h=>h.state.status==="pending");return!u||u===l}runNext(l){var c;const u=(c=m(this,pt).get(Ai(l)))==null?void 0:c.find(h=>h!==l&&h.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}clear(){$e.batch(()=>{this.getAll().forEach(l=>{this.remove(l)})})}getAll(){return[...m(this,pt).values()].flat()}find(l){const u={exact:!0,...l};return this.getAll().find(c=>Ou(u,c))}findAll(l={}){return this.getAll().filter(u=>Ou(l,u))}notify(l){$e.batch(()=>{this.listeners.forEach(u=>{u(l)})})}resumePausedMutations(){const l=this.getAll().filter(u=>u.state.isPaused);return $e.batch(()=>Promise.all(l.map(u=>u.continue().catch(St))))}},pt=new WeakMap,Gr=new WeakMap,oa);function Ai(o){var l;return((l=o.options.scope)==null?void 0:l.id)??String(o.mutationId)}function Nf(o){return{onFetch:(l,u)=>{const c=async()=>{var W,V,G,K,Z;const h=l.options,S=(G=(V=(W=l.fetchOptions)==null?void 0:W.meta)==null?void 0:V.fetchMore)==null?void 0:G.direction,k=((K=l.state.data)==null?void 0:K.pages)||[],N=((Z=l.state.data)==null?void 0:Z.pageParams)||[],T={pages:[],pageParams:[]};let z=!1;const U=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(l.signal.aborted?z=!0:l.signal.addEventListener("abort",()=>{z=!0}),l.signal)})},R=Mu(l.options,l.fetchOptions),j=async(b,H,te)=>{if(z)return Promise.reject();if(H==null&&b.pages.length)return Promise.resolve(b);const ae={queryKey:l.queryKey,pageParam:H,direction:te?"backward":"forward",meta:l.options.meta};U(ae);const ve=await R(ae),{maxPages:J}=l.options,Ne=te?yf:mf;return{pages:Ne(b.pages,ve,J),pageParams:Ne(b.pageParams,H,J)}};let L;if(S&&k.length){const b=S==="backward",H=b?Tf:Hu,te={pages:k,pageParams:N},ae=H(h,te);L=await j(te,ae,b)}else{L=await j(T,N[0]??h.initialPageParam);const b=o??k.length;for(let H=1;H{var h,S;return(S=(h=l.options).persister)==null?void 0:S.call(h,c,{queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},u)}:l.fetchFn=c}}}function Hu(o,{pages:l,pageParams:u}){const c=l.length-1;return l.length>0?o.getNextPageParam(l[c],l,u[c],u):void 0}function Tf(o,{pages:l,pageParams:u}){var c;return l.length>0?(c=o.getPreviousPageParam)==null?void 0:c.call(o,l[0],l,u[0],u):void 0}var Rf=(ua=class{constructor(o={}){ne(this,De);ne(this,an);ne(this,cn);ne(this,ur);ne(this,ar);ne(this,dn);ne(this,cr);ne(this,dr);$(this,De,o.queryCache||new _f),$(this,an,o.mutationCache||new xf),$(this,cn,o.defaultOptions||{}),$(this,ur,new Map),$(this,ar,new Map),$(this,dn,0)}mount(){bl(this,dn)._++,m(this,dn)===1&&($(this,cr,us.subscribe(async o=>{o&&(await this.resumePausedMutations(),m(this,De).onFocus())})),$(this,dr,Mi.subscribe(async o=>{o&&(await this.resumePausedMutations(),m(this,De).onOnline())})))}unmount(){var o,l;bl(this,dn)._--,m(this,dn)===0&&((o=m(this,cr))==null||o.call(this),$(this,cr,void 0),(l=m(this,dr))==null||l.call(this),$(this,dr,void 0))}isFetching(o){return m(this,De).findAll({...o,fetchStatus:"fetching"}).length}isMutating(o){return m(this,an).findAll({...o,status:"pending"}).length}getQueryData(o){var u;const l=this.defaultQueryOptions({queryKey:o});return(u=m(this,De).get(l.queryHash))==null?void 0:u.state.data}ensureQueryData(o){const l=this.getQueryData(o.queryKey);if(l===void 0)return this.fetchQuery(o);{const u=this.defaultQueryOptions(o),c=m(this,De).build(this,u);return o.revalidateIfStale&&c.isStaleByTime(tr(u.staleTime,c))&&this.prefetchQuery(u),Promise.resolve(l)}}getQueriesData(o){return m(this,De).findAll(o).map(({queryKey:l,state:u})=>{const c=u.data;return[l,c]})}setQueryData(o,l,u){const c=this.defaultQueryOptions({queryKey:o}),h=m(this,De).get(c.queryHash),S=h==null?void 0:h.state.data,k=hf(l,S);if(k!==void 0)return m(this,De).build(this,c).setData(k,{...u,manual:!0})}setQueriesData(o,l,u){return $e.batch(()=>m(this,De).findAll(o).map(({queryKey:c})=>[c,this.setQueryData(c,l,u)]))}getQueryState(o){var u;const l=this.defaultQueryOptions({queryKey:o});return(u=m(this,De).get(l.queryHash))==null?void 0:u.state}removeQueries(o){const l=m(this,De);$e.batch(()=>{l.findAll(o).forEach(u=>{l.remove(u)})})}resetQueries(o,l){const u=m(this,De),c={type:"active",...o};return $e.batch(()=>(u.findAll(o).forEach(h=>{h.reset()}),this.refetchQueries(c,l)))}cancelQueries(o={},l={}){const u={revert:!0,...l},c=$e.batch(()=>m(this,De).findAll(o).map(h=>h.cancel(u)));return Promise.all(c).then(St).catch(St)}invalidateQueries(o={},l={}){return $e.batch(()=>{if(m(this,De).findAll(o).forEach(c=>{c.invalidate()}),o.refetchType==="none")return Promise.resolve();const u={...o,type:o.refetchType??o.type??"active"};return this.refetchQueries(u,l)})}refetchQueries(o={},l){const u={...l,cancelRefetch:(l==null?void 0:l.cancelRefetch)??!0},c=$e.batch(()=>m(this,De).findAll(o).filter(h=>!h.isDisabled()).map(h=>{let S=h.fetch(void 0,u);return u.throwOnError||(S=S.catch(St)),h.state.fetchStatus==="paused"?Promise.resolve():S}));return Promise.all(c).then(St)}fetchQuery(o){const l=this.defaultQueryOptions(o);l.retry===void 0&&(l.retry=!1);const u=m(this,De).build(this,l);return u.isStaleByTime(tr(l.staleTime,u))?u.fetch(l):Promise.resolve(u.state.data)}prefetchQuery(o){return this.fetchQuery(o).then(St).catch(St)}fetchInfiniteQuery(o){return o.behavior=Nf(o.pages),this.fetchQuery(o)}prefetchInfiniteQuery(o){return this.fetchInfiniteQuery(o).then(St).catch(St)}resumePausedMutations(){return Mi.isOnline()?m(this,an).resumePausedMutations():Promise.resolve()}getQueryCache(){return m(this,De)}getMutationCache(){return m(this,an)}getDefaultOptions(){return m(this,cn)}setDefaultOptions(o){$(this,cn,o)}setQueryDefaults(o,l){m(this,ur).set(Br(o),{queryKey:o,defaultOptions:l})}getQueryDefaults(o){const l=[...m(this,ur).values()];let u={};return l.forEach(c=>{Hr(o,c.queryKey)&&(u={...u,...c.defaultOptions})}),u}setMutationDefaults(o,l){m(this,ar).set(Br(o),{mutationKey:o,defaultOptions:l})}getMutationDefaults(o){const l=[...m(this,ar).values()];let u={};return l.forEach(c=>{Hr(o,c.mutationKey)&&(u={...u,...c.defaultOptions})}),u}defaultQueryOptions(o){if(o._defaulted)return o;const l={...m(this,cn).queries,...this.getQueryDefaults(o.queryKey),...o,_defaulted:!0};return l.queryHash||(l.queryHash=is(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.enabled!==!0&&l.queryFn===Iu&&(l.enabled=!1),l}defaultMutationOptions(o){return o!=null&&o._defaulted?o:{...m(this,cn).mutations,...(o==null?void 0:o.mutationKey)&&this.getMutationDefaults(o.mutationKey),...o,_defaulted:!0}}clear(){m(this,De).clear(),m(this,an).clear()}},De=new WeakMap,an=new WeakMap,cn=new WeakMap,ur=new WeakMap,ar=new WeakMap,dn=new WeakMap,cr=new WeakMap,dr=new WeakMap,ua),jf=(aa=class extends $r{constructor(l,u){super();ne(this,ye);ne(this,lt);ne(this,ue);ne(this,Yr);ne(this,be);ne(this,Mn);ne(this,fr);ne(this,Ht);ne(this,Xr);ne(this,hr);ne(this,pr);ne(this,An);ne(this,Un);ne(this,fn);ne(this,mr,new Set);this.options=u,$(this,lt,l),$(this,Ht,null),this.bindMethods(),this.setOptions(u)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(m(this,ue).addObserver(this),Vu(m(this,ue),this.options)?ce(this,ye,Li).call(this):this.updateResult(),ce(this,ye,wu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cs(m(this,ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cs(m(this,ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,ye,Su).call(this),ce(this,ye,ku).call(this),m(this,ue).removeObserver(this)}setOptions(l,u){const c=this.options,h=m(this,ue);if(this.options=m(this,lt).defaultQueryOptions(l),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Rt(this.options.enabled,m(this,ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,ye,Cu).call(this),m(this,ue).setOptions(this.options),c._defaulted&&!ls(this.options,c)&&m(this,lt).getQueryCache().notify({type:"observerOptionsUpdated",query:m(this,ue),observer:this});const S=this.hasListeners();S&&Wu(m(this,ue),h,this.options,c)&&ce(this,ye,Li).call(this),this.updateResult(u),S&&(m(this,ue)!==h||Rt(this.options.enabled,m(this,ue))!==Rt(c.enabled,m(this,ue))||tr(this.options.staleTime,m(this,ue))!==tr(c.staleTime,m(this,ue)))&&ce(this,ye,yu).call(this);const k=ce(this,ye,vu).call(this);S&&(m(this,ue)!==h||Rt(this.options.enabled,m(this,ue))!==Rt(c.enabled,m(this,ue))||k!==m(this,fn))&&ce(this,ye,gu).call(this,k)}getOptimisticResult(l){const u=m(this,lt).getQueryCache().build(m(this,lt),l),c=this.createResult(u,l);return Of(this,c)&&($(this,be,c),$(this,fr,this.options),$(this,Mn,m(this,ue).state)),c}getCurrentResult(){return m(this,be)}trackResult(l,u){const c={};return Object.keys(l).forEach(h=>{Object.defineProperty(c,h,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(h),u==null||u(h),l[h])})}),c}trackProp(l){m(this,mr).add(l)}getCurrentQuery(){return m(this,ue)}refetch({...l}={}){return this.fetch({...l})}fetchOptimistic(l){const u=m(this,lt).defaultQueryOptions(l),c=m(this,lt).getQueryCache().build(m(this,lt),u);return c.isFetchingOptimistic=!0,c.fetch().then(()=>this.createResult(c,u))}fetch(l){return ce(this,ye,Li).call(this,{...l,cancelRefetch:l.cancelRefetch??!0}).then(()=>(this.updateResult(),m(this,be)))}createResult(l,u){var ve;const c=m(this,ue),h=this.options,S=m(this,be),k=m(this,Mn),N=m(this,fr),z=l!==c?l.state:m(this,Yr),{state:U}=l;let R={...U},j=!1,L;if(u._optimisticResults){const J=this.hasListeners(),Ne=!J&&Vu(l,u),st=J&&Wu(l,c,u,h);(Ne||st)&&(R={...R,...Bu(U.data,l.options)}),u._optimisticResults==="isRestoring"&&(R.fetchStatus="idle")}let{error:W,errorUpdatedAt:V,status:G}=R;if(u.select&&R.data!==void 0)if(S&&R.data===(k==null?void 0:k.data)&&u.select===m(this,Xr))L=m(this,hr);else try{$(this,Xr,u.select),L=u.select(R.data),L=os(S==null?void 0:S.data,L,u),$(this,hr,L),$(this,Ht,null)}catch(J){$(this,Ht,J)}else L=R.data;if(u.placeholderData!==void 0&&L===void 0&&G==="pending"){let J;if(S!=null&&S.isPlaceholderData&&u.placeholderData===(N==null?void 0:N.placeholderData))J=S.data;else if(J=typeof u.placeholderData=="function"?u.placeholderData((ve=m(this,pr))==null?void 0:ve.state.data,m(this,pr)):u.placeholderData,u.select&&J!==void 0)try{J=u.select(J),$(this,Ht,null)}catch(Ne){$(this,Ht,Ne)}J!==void 0&&(G="success",L=os(S==null?void 0:S.data,J,u),j=!0)}m(this,Ht)&&(W=m(this,Ht),L=m(this,hr),V=Date.now(),G="error");const K=R.fetchStatus==="fetching",Z=G==="pending",b=G==="error",H=Z&&K,te=L!==void 0;return{status:G,fetchStatus:R.fetchStatus,isPending:Z,isSuccess:G==="success",isError:b,isInitialLoading:H,isLoading:H,data:L,dataUpdatedAt:R.dataUpdatedAt,error:W,errorUpdatedAt:V,failureCount:R.fetchFailureCount,failureReason:R.fetchFailureReason,errorUpdateCount:R.errorUpdateCount,isFetched:R.dataUpdateCount>0||R.errorUpdateCount>0,isFetchedAfterMount:R.dataUpdateCount>z.dataUpdateCount||R.errorUpdateCount>z.errorUpdateCount,isFetching:K,isRefetching:K&&!Z,isLoadingError:b&&!te,isPaused:R.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:b&&te,isStale:ds(l,u),refetch:this.refetch}}updateResult(l){const u=m(this,be),c=this.createResult(m(this,ue),this.options);if($(this,Mn,m(this,ue).state),$(this,fr,this.options),m(this,Mn).data!==void 0&&$(this,pr,m(this,ue)),ls(c,u))return;$(this,be,c);const h={},S=()=>{if(!u)return!0;const{notifyOnChangeProps:k}=this.options,N=typeof k=="function"?k():k;if(N==="all"||!N&&!m(this,mr).size)return!0;const T=new Set(N??m(this,mr));return this.options.throwOnError&&T.add("error"),Object.keys(m(this,be)).some(z=>{const U=z;return m(this,be)[U]!==u[U]&&T.has(U)})};(l==null?void 0:l.listeners)!==!1&&S()&&(h.listeners=!0),ce(this,ye,sf).call(this,{...h,...l})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,ye,wu).call(this)}},lt=new WeakMap,ue=new WeakMap,Yr=new WeakMap,be=new WeakMap,Mn=new WeakMap,fr=new WeakMap,Ht=new WeakMap,Xr=new WeakMap,hr=new WeakMap,pr=new WeakMap,An=new WeakMap,Un=new WeakMap,fn=new WeakMap,mr=new WeakMap,ye=new WeakSet,Li=function(l){ce(this,ye,Cu).call(this);let u=m(this,ue).fetch(this.options,l);return l!=null&&l.throwOnError||(u=u.catch(St)),u},yu=function(){ce(this,ye,Su).call(this);const l=tr(this.options.staleTime,m(this,ue));if(er||m(this,be).isStale||!rs(l))return;const c=ju(m(this,be).dataUpdatedAt,l)+1;$(this,An,setTimeout(()=>{m(this,be).isStale||this.updateResult()},c))},vu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(m(this,ue)):this.options.refetchInterval)??!1},gu=function(l){ce(this,ye,ku).call(this),$(this,fn,l),!(er||Rt(this.options.enabled,m(this,ue))===!1||!rs(m(this,fn))||m(this,fn)===0)&&$(this,Un,setInterval(()=>{(this.options.refetchIntervalInBackground||us.isFocused())&&ce(this,ye,Li).call(this)},m(this,fn)))},wu=function(){ce(this,ye,yu).call(this),ce(this,ye,gu).call(this,ce(this,ye,vu).call(this))},Su=function(){m(this,An)&&(clearTimeout(m(this,An)),$(this,An,void 0))},ku=function(){m(this,Un)&&(clearInterval(m(this,Un)),$(this,Un,void 0))},Cu=function(){const l=m(this,lt).getQueryCache().build(m(this,lt),this.options);if(l===m(this,ue))return;const u=m(this,ue);$(this,ue,l),$(this,Yr,l.state),this.hasListeners()&&(u==null||u.removeObserver(this),l.addObserver(this))},sf=function(l){$e.batch(()=>{l.listeners&&this.listeners.forEach(u=>{u(m(this,be))}),m(this,lt).getQueryCache().notify({query:m(this,ue),type:"observerResultsUpdated"})})},aa);function Df(o,l){return Rt(l.enabled,o)!==!1&&o.state.data===void 0&&!(o.state.status==="error"&&l.retryOnMount===!1)}function Vu(o,l){return Df(o,l)||o.state.data!==void 0&&cs(o,l,l.refetchOnMount)}function cs(o,l,u){if(Rt(l.enabled,o)!==!1){const c=typeof u=="function"?u(o):u;return c==="always"||c!==!1&&ds(o,l)}return!1}function Wu(o,l,u,c){return(o!==l||Rt(c.enabled,o)===!1)&&(!u.suspense||o.state.status!=="error")&&ds(o,u)}function ds(o,l){return Rt(l.enabled,o)!==!1&&o.isStaleByTime(tr(l.staleTime,o))}function Of(o,l){return!ls(o.getCurrentResult(),l)}var Ku=se.createContext(void 0),zf=o=>{const l=se.useContext(Ku);if(o)return o;if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},Ff=({client:o,children:l})=>(se.useEffect(()=>(o.mount(),()=>{o.unmount()}),[o]),C.jsx(Ku.Provider,{value:o,children:l})),Gu=se.createContext(!1),Lf=()=>se.useContext(Gu);Gu.Provider;function If(){let o=!1;return{clearReset:()=>{o=!1},reset:()=>{o=!0},isReset:()=>o}}var Mf=se.createContext(If()),Af=()=>se.useContext(Mf);function Uf(o,l){return typeof o=="function"?o(...l):!!o}var Qf=(o,l)=>{(o.suspense||o.throwOnError)&&(l.isReset()||(o.retryOnMount=!1))},$f=o=>{se.useEffect(()=>{o.clearReset()},[o])},Bf=({result:o,errorResetBoundary:l,throwOnError:u,query:c})=>o.isError&&!l.isReset()&&!o.isFetching&&c&&Uf(u,[o.error,c]),Hf=o=>{o.suspense&&typeof o.staleTime!="number"&&(o.staleTime=1e3)},Vf=(o,l)=>(o==null?void 0:o.suspense)&&l.isPending,Wf=(o,l,u)=>l.fetchOptimistic(o).catch(()=>{u.clearReset()});function Kf(o,l,u){var z,U,R,j;const c=zf(u),h=Lf(),S=Af(),k=c.defaultQueryOptions(o);(U=(z=c.getDefaultOptions().queries)==null?void 0:z._experimental_beforeQuery)==null||U.call(z,k),k._optimisticResults=h?"isRestoring":"optimistic",Hf(k),Qf(k,S),$f(S);const[N]=se.useState(()=>new l(c,k)),T=N.getOptimisticResult(k);if(se.useSyncExternalStore(se.useCallback(L=>{const W=h?()=>{}:N.subscribe($e.batchCalls(L));return N.updateResult(),W},[N,h]),()=>N.getCurrentResult(),()=>N.getCurrentResult()),se.useEffect(()=>{N.setOptions(k,{listeners:!1})},[k,N]),Vf(k,T))throw Wf(k,N,S);if(Bf({result:T,errorResetBoundary:S,throwOnError:k.throwOnError,query:c.getQueryCache().get(k.queryHash)}))throw T.error;return(j=(R=c.getDefaultOptions().queries)==null?void 0:R._experimental_afterQuery)==null||j.call(R,k,T),k.notifyOnChangeProps?T:N.trackResult(T)}function Gf(o,l){return Kf(o,jf,l)}const jt={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"},ft={wrap:"_wrap_wc4dm_1",image:"_image_wc4dm_17",title:"_title_wc4dm_32",content:"_content_wc4dm_49",price:"_price_wc4dm_65",rental:"_rental_wc4dm_73",unit:"_unit_wc4dm_80"},Yf={image:"_image_ox479_1"},Xf="https://cdn1.idek.cz/img/2711ac4e3e85e0ac6233b02388095dbb.webp",Yu=({src:o,alt:l,resolutionList:u})=>{o??(o=Xf);const c=[...u],h=c.shift();return C.jsxs("picture",{className:"r-image",children:[c.map(({width:S,height:k,maxWidth:N},T)=>C.jsx("source",{media:N?`(max-width: ${N}px)`:void 0,srcSet:o.replace(".webp",`_ew${S}_eh${k}.webp`),type:"image/webp",width:S,height:k},T)),C.jsx("img",{className:Yf.image,src:o.replace(".webp",`_ew${h==null?void 0:h.width}_eh${h==null?void 0:h.height}.webp`),width:h==null?void 0:h.width,height:h==null?void 0:h.height,alt:l})]})},nr={labels:"_labels_bytsx_1",recommended:"_recommended_bytsx_12",isRecent:"_isRecent_bytsx_13",isFeatured:"_isFeatured_bytsx_14",isWhileStockLast:"_isWhileStockLast_bytsx_15",generousSeason:"_generousSeason_bytsx_35"},qf={cz:{stocksLast:"Do vyprodání zásob",recommended:"Doporučujeme",isRecent:"Novinka",isFeatured:"Akce"},sk:{stocksLast:"Do vypredania zásob",recommended:"Odporúčame",isRecent:"Novinka",isFeatured:"Akcia"}};/*! js-cookie v3.0.5 | MIT */function Ui(o){for(var l=1;l"u")){k=Ui({},l,k),typeof k.expires=="number"&&(k.expires=new Date(Date.now()+k.expires*864e5)),k.expires&&(k.expires=k.expires.toUTCString()),h=encodeURIComponent(h).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var N="";for(var T in k)k[T]&&(N+="; "+T,k[T]!==!0&&(N+="="+k[T].split(";")[0]));return document.cookie=h+"="+o.write(S,h)+N}}function c(h){if(!(typeof document>"u"||arguments.length&&!h)){for(var S=document.cookie?document.cookie.split("; "):[],k={},N=0;Nasync function(u,c={}){const h=th(o,u,c.search);c=nh(c);const S=await fetch(h.toString(),c);return new Jf(S)};function bf(){const o=hs.get("dek_eshop_token");if(!o)throw new Error("DEK Eshop token was not found.");return new Headers({Authorization:"Bearer "+o})}function eh(){const o=hs.get("dek_config");if(!o)throw new Error("DEK Config was not found.");const l=atob(o);return JSON.parse(l)}function th(o=void 0,l,u=void 0){const c=eh(),h=o?c.api.hasOwnProperty(o)?c.api[o]:o:c.api.base,S=new URL(h+l);return u&&(S.search=u.toString()),S}function nh(o){const l={...o},u=new Headers(l.headers);return l.headers=bf(),u.forEach((c,h)=>{var S;(S=l.headers)==null||S.set(h,c)}),l}function rh(o){if(!o.ok&&o.status>=500)throw new ms(o);if(!o.ok&&o.status>=400&&o.status<500)throw new ps(o);return o}const Qn=class Qn{};Xt(Qn,"add",({message:l,type:u})=>{dispatchEvent(new CustomEvent("ES_ADD_MESSAGE_FLASH",{detail:{message:l,type:u}}))}),Xt(Qn,"addByError",l=>{const u=l;console.error(u),u instanceof ps||u instanceof ms?(u instanceof ps&&Qn.add({message:`Nastala neočekávaná klientská chyba. (${u.status})`,type:"error"}),u instanceof ms&&Qn.add({message:`Nastala neočekávaná serverová chyba. (${u.status})`,type:"error"})):Qn.add({message:"Nastala neočekávaná chyba.",type:"error"})});let Vr=Qn;class Wr{static getConfig(){if(!this.config){const l=hs.get("dek_config");if(l===void 0)throw new Error("Config not found");try{const u=atob(l);this.config=JSON.parse(u)}catch(u){throw console.error(u),Vr.add({type:"error",message:"Nepodařilo se načíst konfiguraci."}),new Error("Config is not valid")}}return this.config}static getShopId(){const l=this.getConfig().shopId;return l==="dek"?"dek_cz":l}static getLang(){switch(this.getShopId()){case"dek_cz":case"argos_cz":return"cz";case"dek_sk":return"sk";default:return"cz"}}static getSearchCompany(){switch(this.getShopId()){case"dek_cz":return"cz";case"dek_sk":return"sk";case"argos_cz":return"argos";default:return"cz"}}static getEmail(){return this.getConfig().email}static getBranchCode(){return this.getConfig().branchCode}static getBranchTitle(){return this.getConfig().branchTitle}static getApiBase(){return this.getConfig().api.base}static getApiSearch(){return this.getConfig().api.search}static isDev(){return this.getConfig().isDev}}Xt(Wr,"config");const ih=({product:o})=>{const l=Wr.getLang(),u=qf[l],c=()=>{switch(!0){case o.availability.isWhileStockLast:return C.jsx("div",{className:nr.isWhileStockLast,children:u.stocksLast});case o.detail.isFeatured:return C.jsx("div",{className:nr.isFeatured,children:u.isFeatured});case o.detail.isRecommended:return C.jsx("div",{className:nr.recommended,children:u.recommended});case o.detail.isRecent:return C.jsx("div",{className:nr.isRecent,children:u.isRecent});case!0:return null}};return C.jsxs("div",{className:`r-product-label ${nr.labels}`,children:[c(),o.detail.seasonPointsText&&C.jsxs("div",{className:nr.generousSeason,children:[C.jsx("img",{src:"https://cdn1.idek.cz/file/plus-white-a6e119fe.svg",width:22,height:22}),C.jsx("div",{children:o.detail.seasonPointsText})]})]})},qu={icons:"_icons_4p8mm_1"},lh={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"}},Zu=({product:o})=>{const l=Wr.getLang(),u=lh[l];if(o.type==="eshop")return C.jsxs("div",{className:`r-product-icon ${qu.icons}`,children:[o.detail.hasVariant&&C.jsx("img",{title:u.hasVariants,alt:u.hasVariants,src:"https://cdn1.idek.cz/img/a32ef0de7bf6d55e5b00748dfe951840_rw24.png",width:24,height:24}),o.detail.hasGift&&C.jsx("img",{alt:u.hasGift,title:u.hasGift,src:"https://cdn1.idek.cz/img/13ac7588db7f1b49cbce256f5abd255f_rw24.png",width:24,height:24}),o.detail.hasPpl&&C.jsx("img",{title:u.hasPpl,alt:u.hasPpl,src:"https://cdn1.idek.cz/img/8c6599f32f6f4d9cbc8d20951dba4952_rw24.jpg",width:24,height:24})]});if(o.type==="rental")return C.jsx("div",{className:`r-product-icon ${qu.icons}`})};class Qi{static async getProductEshopByCode(l,u){if(Array.isArray(l)||(l=[l]),l.length===0)return[];const c=Xu(),h=[];h.push(...l.map(k=>["codes",k])),h.push(...u.map(k=>["parts",k]));const S=new URLSearchParams(h);try{return await(await c("/product/get-products-eshop-by-codes",{search:S})).toJson()}catch(k){Vr.addByError(k)}return[]}static async getProductRentalByCode(l,u){if(Array.isArray(l)||(l=[l]),l.length===0)return[];const c=Xu(),h=[];h.push(...l.map(k=>["codes",k])),h.push(...u.map(k=>["parts",k]));const S=new URLSearchParams(h);try{return await(await c("/product/get-products-rental-by-codes",{search:S})).toJson()}catch(k){Vr.addByError(k)}return[]}}const sh=(o,l,u=!0)=>{const c=o.split("|");if(c.length!==3&&c.length!==4)return console.warn(`Daný text "${o}" nemá správný formát`),u?`${l} ${o}`:o;let h,S,k,N;c.length===3?([S,k,N]=c.map(z=>z.trim()),h=N):[h,S,k,N]=c.map(z=>z.trim());let T=N;return l===0&&(T=h),l===1&&(T=S),l>=2&&l<=4&&(T=k),u?`${l} ${T}`:T};class ht{static formatPrice(l,u){const c=new Intl.NumberFormat("cs-CZ",{style:"currency",currency:u}).format(l);return u==="EUR"?c.replace("€","EUR"):c.toString()}static formatUnit(l){return l.replace("m2","m²").replace("m3","m³")}static formatQuantity(l){return(Number(l)===l&&l%1!==0?l.toFixed(2):l).toLocaleString().replace(".",",")}static calculateQuantityUnitEshopToSales(l,u){const c=u.isPackagePrimary?l*1e6*(u.unitsInPackage*1e6)/1e12:l;return{unitPrimary:l,unitSecondary:u.isPackagePrimary?c:l,unitSales:c,unitPackage:u.isPackagePrimary?l:c}}static calculateQuantityUnitEshop(l,u){return ht.calculateQuantityUnitEshopToSales(l,u)}static calculateQuantityUnitEshopToPrimary(l,u){const c=u.isPackagePrimary?l*1e12/(u.unitsInPackage*1e6)/1e6:l;return{unitPrimary:c,unitSecondary:u.isPackagePrimary?l:c,unitSales:l,unitPackage:u.isPackagePrimary?c:l}}static calculateQuantityPriceEshop(l,u){const c=Math.round(u.priceNoVatPrimary*l*100)/100,h=Math.round(c*u.vat/100*100)/100,S=Math.round((c+h)*100)/100;return{priceNoVatPrimary:c,priceVatPrimary:S}}static getAvailabilityStatusByBranchCode(l,u,c){switch(l.availabilityBranchCode){case"P00":case"P01":case"P05":case"P06":return{showButton:!0,color:"green",buttonText:c,buttonColor:"green"};case"P02":case"P07":case"P08":case"P10":return{showButton:!1,color:"red"};case"P04":return{showButton:!0,color:"red",buttonText:u,buttonColor:"blue"};case"P03":return{showButton:!0,color:"blue",buttonText:u,buttonColor:"blue"};case"P09":return{showButton:!1,color:"gray"};default:return{showButton:!0,color:"blue",buttonText:u,buttonColor:"blue"}}}static addToCartEshop(l,u,c,h){window.dispatchEvent(new CustomEvent("ES_ADD_TO_CART_ESHOP",{detail:{code:l,quantitySales:u,unitSales:c,eventInvoker:h}}))}static addToCartRental(l){const{unionCode:u,quantity:c,date:h,hasGuarantee:S,typeOfRental:k,eventInvoker:N}=l;window.dispatchEvent(new CustomEvent("ES_ADD_TO_CART_RENTAL",{detail:{unionCode:u,quantity:c,quantitySales:c,dateFrom:h.from,dateTo:h.to,withGuarantee:S,typeOfRental:k,eventInvoker:N}}))}static async getProductEshopByCode(l,u){return Qi.getProductEshopByCode(l,u)}static async getProductRentalByCode(l,u){return Qi.getProductRentalByCode(l,u)}static calculateSeasonPoints(l,u){if(l.season===null||l.season===void 0)return 0;const c=l.season;if(c.rewardFor==="Quantity")return Math.floor(u/c.requiredQuantity)*c.rewardPoints;if(c.rewardFor==="Price"){const h=l.price.priceNoVatSales*u;return Math.floor(h/c.requiredQuantity)*c.rewardPoints}return 0}static getNumberOfDaysByTypeOfRental(l,u){if(u==="HalfDay")return"4 hodiny";const c=Math.ceil((l.to.getTime()-l.from.getTime())/864e5),h=S=>sh(Wr.getLang()==="sk"?"deň | dni | dní":"den | dny | dní",S);return h(u==="FullDay"?c:c+1)}}const ys={cz:{toCart:"Do košíku",demand:"Poptat",labelAddToCart:(o,l)=>C.jsxs(C.Fragment,{children:["do košíku přidáte"," ",C.jsxs("strong",{children:[ht.formatQuantity(o)," ",ht.formatUnit(l)]})]}),addToCart:"Přidat",addedToCart:"Přidáno",unit:o=>`za ${o}`,withDPH:"s DPH"},sk:{toCart:"Do košíka",demand:"Poptať",labelAddToCart:(o,l)=>C.jsxs(C.Fragment,{children:["do košíka pridáte"," ",C.jsxs("strong",{children:[ht.formatQuantity(o)," ",ht.formatUnit(l)]})]}),addToCart:"Pridať",addedToCart:"Pridané",unit:o=>`za ${o}`,withDPH:"s DPH"}},Ze={container:"_container_uou1y_1",inputs:"_inputs_uou1y_11",quantity:"_quantity_uou1y_17",button:"_button_uou1y_25",row:"_row_uou1y_28",compact:"_compact_uou1y_33",price:"_price_uou1y_40",addToCart:"_addToCart_uou1y_52",loading:"_loading_uou1y_65",spin:"_spin_uou1y_1",input:"_input_uou1y_11",alreadyInCart:"_alreadyInCart_uou1y_94",slide:"_slide_uou1y_108"},oh={event:"recobox",recobox_pagetype:"modal_cart",recobox_boxName:"mohlo_by_se_vam_hodit"},Ju=o=>{window.dataLayer??(window.dataLayer=[]),window.dataLayer.push({...oh,recobox_action:"add_to_cart",recobox_product_id:o})};let uh=(Ss=class{},Xt(Ss,"getFormSize",l=>l?`dek-form-width--${l}`:""),Ss);const vs=({onChange:o,children:l,disabled:u,size:c,state:h,type:S,onChangeLazy:k,onBlur:N,...T})=>{const z=se.useId(),U=W=>{if(!o)return;const{value:V}=W.target;if(S==="number"){o(Number(V)||Number.NaN,W);return}o(V,W)},R=W=>{if(k){const{value:V}=W.target;if(S==="number"){k(Number(V)||Number.NaN,W);return}k(V,W)}N==null||N(W)},j=uh.getFormSize(c),L=[j];return h&&L.push(h.level),C.jsxs(C.Fragment,{children:[l&&C.jsx("label",{htmlFor:z,children:l}),C.jsx("input",{id:z,role:"textbox",disabled:u,className:L.join(" "),onChange:U,onBlur:R,type:S,...T}),h&&!u&&h.message&&C.jsx("div",{className:`input-${h.level} ${j}`,children:h.message})]})},ah=o=>{const{type:l}=o;if(l==="compact")return C.jsx(dh,{...o});if(l==="slide")return C.jsx(fh,{...o});if(l==="long")return C.jsx(ch,{...o})},ch=({lang:o,product:l})=>{const{availability:u,code:c,price:h,unit:S}=l,{addToCartEshop:k,calculateQuantityPriceEshop:N,calculateQuantityUnitEshopToSales:T,formatPrice:z,formatUnit:U,getAvailabilityStatusByBranchCode:R}=ht,j=ys[o],L=se.useRef(null),[W,V]=se.useState({unitPrimary:S.minimumCountUnitPrimary,unitSecondary:S.unitsInPackage,unitSales:S.minimumCountUnitSales}),[G,K]=se.useState({priceVatPrimary:h.priceVatPrimary}),Z=te=>{te=te{var te;k(c,W.unitSales,S.unitSales,"long"),(te=L.current)==null||te.blur()},H=R(u,j.demand,j.toCart);return H.showButton?C.jsxs("div",{className:`r-add-to-cart-eshop-long ${Ze.container}`,children:[C.jsxs("div",{className:Ze.inputs,children:[C.jsxs("div",{className:Ze.quantity,children:[C.jsx(vs,{onChange:Z,type:"number",min:"1",value:W.unitPrimary,autoComplete:"off"}),C.jsx("label",{children:U(S.unitPrimary)})]}),C.jsx("button",{type:"button",ref:L,role:"button",className:`dek-button-${H.buttonColor} ${Ze.button}`,onClick:b,children:H.buttonText})]}),S.isPackagePrimary&&C.jsx("div",{className:Ze.row,children:j.labelAddToCart(W.unitSecondary,S.unitSecondary)}),C.jsxs("div",{className:Ze.row,children:[C.jsx("strong",{children:z(G.priceVatPrimary,h.currencyCode)})," ","celkem s DPH"]})]}):C.jsx("div",{className:`r-add-to-cart-eshop-long ${Ze.container}`})},dh=({lang:o,product:l})=>{const{code:u,unit:c}=l,{addToCartEshop:h,calculateQuantityPriceEshop:S,calculateQuantityUnitEshopToSales:k,formatPrice:N}=ht,T=ys[o],[z,U]=se.useState({unitPrimary:c.minimumCountUnitPrimary,unitSecondary:c.unitsInPackage,unitSales:c.minimumCountUnitSales}),[R,j]=se.useState(!1),[L,W]=se.useState(!1),[V,G]=se.useState(l.price.priceVatPrimary),K=H=>{H=H{W(!0),window.addEventListener("ES_ADD_TO_CART_ESHOP_AFTER",b),h(u,z.unitSales,c.unitSales,"compact")},b=H=>{l.code===H.detail.code&&(W(!1),j(H.detail.isSuccess),H.detail.isSuccess&&Ju(u),window.removeEventListener("ES_ADD_TO_CART_ESHOP_AFTER",b))};return C.jsxs("div",{className:`r-add-to-cart-eshop-compact ${Ze.compact}`,children:[C.jsxs("div",{className:Ze.price,children:[C.jsx("strong",{children:N(V,l.price.currencyCode)}),C.jsxs("div",{children:[T.unit(l.unit.unitPrimary)," ",T.withDPH]})]}),C.jsx("div",{className:Ze.addToCart,children:R?C.jsxs("div",{className:Ze.alreadyInCart,children:[C.jsx("img",{src:"https://cdn1.idek.cz/file/check-7c33cfe0.svg",width:16,height:16}),C.jsx("span",{children:T.addedToCart})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:Ze.input,children:[C.jsx(vs,{type:"number",min:1,defaultValue:z.unitPrimary,onChange:K,disabled:L}),l.unit.unitPrimary]}),C.jsxs("button",{type:"button",role:"button",className:"dek-button-green",onClick:Z,disabled:L,children:[L&&C.jsx("span",{className:Ze.loading}),T.addToCart]})]})})]})},fh=({lang:o,product:l})=>{const u=ys[o],c=()=>{const h=l.unit.isPackagePrimary?l.unit.minimumCountUnitSales:l.unit.minimumCountUnitPrimary;ht.addToCartEshop(l.code,h,l.unit.unitSales,"slide")};return C.jsx("div",{className:`r-add-to-cart-eshop-slide ${Ze.slide}`,children:C.jsx("button",{type:"button",role:"button",onClick:c,className:`dek-button-green dek-button-small ${Ze.button}`,children:u.toCart})})},gs={cz:{toDetail:"Detail zapůjčení",unit:o=>`za ${o}`,withDPH:"s DPH",addToCart:"Přidat",addedToCart:"Přidáno"},sk:{toDetail:"Detail zapožičania",unit:o=>`za ${o}`,withDPH:"s DPH",addToCart:"Pridať",addedToCart:"Pridané"}},Dt={container:"_container_1t3c4_1",topDivider:"_topDivider_1t3c4_4",button:"_button_1t3c4_9",compact:"_compact_1t3c4_16",price:"_price_1t3c4_23",addToCart:"_addToCart_1t3c4_35",loading:"_loading_1t3c4_48",spin:"_spin_1t3c4_1",input:"_input_1t3c4_68",alreadyInCart:"_alreadyInCart_1t3c4_77"},hh=(o,l)=>`/produkty/detail/${o}${l?`-${l}`:""}`,ws=(o,l)=>`/pujcovna/detail/${o.replace("|","/")}${l?`-${l}`:""}`,ph=o=>{const{type:l}=o;if(l==="compact")return C.jsx(vh,{...o});if(l==="long")return C.jsx(yh,{...o});if(l==="slide")return C.jsx(mh,{...o})},mh=({product:o,lang:l})=>{const u=gs[l];return C.jsx("div",{className:`r-add-to-cart-rental-slide ${Dt.container}`,children:C.jsx("a",{role:"button",className:`dek-button dek-button-green dek-button-small ${Dt.button}`,href:ws(o.code,o.detail.slug),children:u.toDetail})})},yh=({product:o,lang:l})=>{const u=gs[l];return C.jsx("div",{className:`r-add-to-cart-rental-long ${Dt.container} ${Dt.topDivider}`,children:C.jsx("a",{role:"button",className:`dek-button dek-button-green ${Dt.button}`,href:ws(o.code,o.detail.slug),children:u.toDetail})})},vh=({product:o,lang:l,date:u,hasGuarantee:c,typeOfRental:h})=>{const{formatPrice:S}=ht,k=gs[l],[N,T]=se.useState(1),[z,U]=se.useState(o.detail.priceVatOrigin),[R,j]=se.useState(!1),[L,W]=se.useState(!1),V=Z=>{T(Z),U(Z*o.detail.priceVatOrigin)},G=()=>{W(!0),window.addEventListener("ES_ADD_TO_CART_RENTAL_AFTER",K),ht.addToCartRental({unionCode:o.code,quantity:N,date:u,hasGuarantee:c,typeOfRental:h,eventInvoker:"compact"})},K=Z=>{o.code===Z.detail.unionCode&&(W(!1),j(Z.detail.isSuccess),Z.detail.isSuccess&&Ju(o.code),window.removeEventListener("ES_ADD_TO_CART_RENTAL_AFTER",K))};return C.jsxs("div",{className:`r-add-to-cart-rental-compact ${Dt.compact}`,children:[C.jsxs("div",{className:Dt.price,children:[C.jsx("strong",{children:S(z,o.detail.currencyCode)}),C.jsxs("div",{children:[k.unit(o.detail.unitPrice)," ",k.withDPH]})]}),C.jsx("div",{className:Dt.addToCart,children:R?C.jsxs("div",{className:Dt.alreadyInCart,children:[C.jsx("img",{src:"https://cdn1.idek.cz/file/check-7c33cfe0.svg",width:16,height:16}),C.jsx("span",{children:k.addedToCart})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:Dt.input,children:[C.jsx(vs,{type:"number",min:1,defaultValue:N,onChange:V,disabled:L}),o.detail.unitQuantity]}),C.jsxs("button",{type:"button",role:"button",className:"dek-button-green",onClick:G,disabled:L,children:[L&&C.jsx("span",{className:Dt.loading}),k.addToCart]})]})})]})},gh=({product:o,showAddToCartButton:l,lang:u})=>{const c=[{width:225,height:135},{width:320,height:192,maxWidth:680},{width:225,height:135,maxWidth:490},{width:170,height:170,maxWidth:370}];if(o.type==="eshop")return C.jsx(wh,{product:o,lang:u,resolutionList:c,showAddToCartButton:l});if(o.type==="rental")return C.jsx(Sh,{product:o,lang:u,resolutionList:c,showAddToCartButton:l})},wh=({product:o,lang:l,resolutionList:u,showAddToCartButton:c})=>{const h=hh(o.code,o.detail.slug),S=ht.formatPrice(o.price.priceVatPrimary,o.price.currencyCode).split(",");return C.jsxs("div",{className:`r-product-preview-slide ${ft.wrap}`,children:[C.jsxs("a",{href:h,className:ft.image,children:[C.jsx(ih,{product:o}),C.jsx(Zu,{product:o}),C.jsx(Yu,{src:o.detail.image,alt:o.detail.title,resolutionList:u})]}),C.jsxs("div",{className:ft.content,children:[C.jsxs("a",{href:h,children:[C.jsx("span",{className:ft.title,children:o.detail.title}),C.jsxs("div",{children:[C.jsxs("div",{className:ft.price,children:[S[0],C.jsxs("span",{children:[",",S[1]]})]}),C.jsxs("div",{className:ft.unit,children:["cena za"," ",o.unit.unitPrimary," ","s DPH"]})]})]}),c&&C.jsx(ah,{lang:l,product:o,type:"slide"})]})]})},Sh=({product:o,lang:l,resolutionList:u,showAddToCartButton:c})=>{const h=ws(o.code,o.detail.slug),S=ht.formatPrice(o.detail.priceNoVatOrigin,o.detail.currencyCode).split(",");return C.jsxs("div",{className:`r-product-preview-slide ${ft.wrap} ${ft.rental}`,children:[C.jsxs("a",{href:h,className:ft.image,children:[C.jsx(Zu,{product:o}),C.jsx(Yu,{src:o.detail.image,alt:o.detail.title,resolutionList:u})]}),C.jsxs("div",{className:ft.content,children:[C.jsxs("a",{href:h,children:[C.jsx("span",{className:ft.title,children:o.detail.title}),C.jsxs("div",{children:[C.jsxs("div",{className:ft.price,children:[S[0],C.jsxs("span",{children:[",",S[1]]})]}),C.jsxs("div",{className:ft.unit,children:["cena za"," ",o.detail.unitPrice," ","s DPH"]})]})]}),c&&C.jsx(ph,{type:"slide",lang:l,product:o})]})]})};let $i,Bi;const bu=o=>{const l=o.touches[0];$i=l.clientX,Bi=l.clientY},kh=(o,l)=>{var k,N,T,z;if(!$i||!Bi)return;const u=o.touches[0].clientX,c=o.touches[0].clientY,h=$i-u,S=Bi-c;Math.abs(h)>Math.abs(S)?h>0?(k=l.onRight)==null||k.call(l):(N=l.onLeft)==null||N.call(l):S>0?(T=l.onDown)==null||T.call(l):(z=l.onUp)==null||z.call(l),$i=void 0,Bi=void 0},Ch=(o,l)=>{se.useEffect(()=>{if(o==null)return;const u=c=>kh(c,l);return o.addEventListener("touchstart",bu,!1),o.addEventListener("touchmove",u,!1),()=>{o.removeEventListener("touchstart",bu,!1),o.removeEventListener("touchmove",u,!1)}},[o,l])},ea=o=>{const{productList:l,sliderMaxWidth:u,itemsMaxCount:c,hasGrayBackground:h,showAddToCart:S,loadingState:k}=o,N=Wr.getLang(),T=se.useRef(null),z=se.useRef(null),U=se.useRef(null),[R,j]=se.useState(0),[L,W]=se.useState(0),[V,G]=se.useState(!1),[K,Z]=se.useState(0);se.useEffect(()=>{const Be=()=>{if(!T.current||!z.current||!U.current||!l)return;const et=T.current.offsetWidth??0,He=z.current.offsetWidth??0,Ct=et-He,Ee=(u-Ct)/c,O=Math.floor(He/Ee),Y=He/O,I=Y*l.length;j(I),W(He/Math.floor(He/Y)),G(!0),Z(0)};return Be(),window.addEventListener("resize",Be),()=>{window.removeEventListener("resize",Be)}},[u,c,l]);const b=T.current?T.current.offsetWidth:0,H=z.current?z.current.offsetWidth:0,te=b-H,ae=Math.abs(K)+H{ae&&Z(K-H),console.debug("left",K-H)},Ne=()=>{ve&&Z(K+H),console.debug("left",K+H)},st=(te/2+12)*-1,qt=st;return Ch(z.current,{onRight:J,onLeft:Ne}),k?C.jsx("div",{className:`r-slider-product ${jt.wrap} ${h?jt.grayBackground:""}`,style:{maxWidth:u},children:C.jsx("div",{className:jt.viewport,children:C.jsx("div",{className:`${jt.container} loading`,style:{transform:`translateX(${K}px)`,width:u,height:330}})})}):C.jsxs("div",{ref:T,className:`r-slider-product ${jt.wrap} ${h?jt.grayBackground:""}`,style:{maxWidth:u},children:[C.jsxs("div",{className:jt.arrowWrap,children:[ve&&C.jsx("div",{className:jt.arrowPrev,style:{left:qt},onClick:Ne}),ae&&C.jsx("div",{className:jt.arrowNext,style:{right:st},onClick:J})]}),C.jsx("div",{ref:z,className:jt.viewport,children:C.jsx("div",{ref:U,className:jt.container,style:{transform:`translateX(${K}px)`,width:R},children:V&&l.map(Be=>C.jsx("div",{style:{width:L},children:C.jsx(gh,{product:Be,lang:N,showAddToCartButton:S})},Be.code))})})]})},_h=({productCodeList:o,...l})=>{const u=Gf({queryKey:["productList",o],queryFn:async()=>(await Eh(o.map(String))).filter(Boolean)});return C.jsxs("div",{className:"r-a-product-slider",children:[u.isLoading&&C.jsx(ea,{loadingState:!0,...l}),u.isSuccess&&C.jsx(ea,{productList:u.data,...l})]})},Eh=async o=>{const l=o.filter(S=>S.length===10),u=o.filter(S=>S.length===7),c=await Qi.getProductEshopByCode(l,["detail","availability","price","unit"]),h=await Qi.getProductRentalByCode(u,["detail","price"]);return[...c,...h]},Ph=new Rf({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,refetchOnWindowFocus:!1,retry:!1}}});async function xh(o,l){es.createRoot(document.getElementById(o)).render(C.jsx(se.StrictMode,{children:C.jsx(Ff,{client:Ph,children:C.jsx(_h,{...l})})}))}return xh}); //# sourceMappingURL=index.umd.cjs.map