var kC=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var SD=kC((Zn,Yn)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function xs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Uf={exports:{}},sl={},Gf={exports:{}},ft={};/** * @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 cv;function TC(){if(cv)return ft;cv=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),w=Symbol.iterator;function S(_){return _===null||typeof _!="object"?null:(_=w&&_[w]||_["@@iterator"],typeof _=="function"?_:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,N={};function E(_,Q,Se){this.props=_,this.context=Q,this.refs=N,this.updater=Se||C}E.prototype.isReactComponent={},E.prototype.setState=function(_,Q){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,Q,"setState")},E.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function R(){}R.prototype=E.prototype;function I(_,Q,Se){this.props=_,this.context=Q,this.refs=N,this.updater=Se||C}var F=I.prototype=new R;F.constructor=I,j(F,E.prototype),F.isPureReactComponent=!0;var L=Array.isArray,P=Object.prototype.hasOwnProperty,B={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function X(_,Q,Se){var Ve,We={},Je=null,tt=null;if(Q!=null)for(Ve in Q.ref!==void 0&&(tt=Q.ref),Q.key!==void 0&&(Je=""+Q.key),Q)P.call(Q,Ve)&&!W.hasOwnProperty(Ve)&&(We[Ve]=Q[Ve]);var at=arguments.length-2;if(at===1)We.children=Se;else if(1>>1,Se=J[Q];if(0>>1;Qi(Je,_))tti(at,Je)?(J[Q]=at,J[tt]=_,Q=tt):(J[Q]=Je,J[We]=_,Q=We);else if(tti(at,_))J[Q]=at,J[tt]=_,Q=tt;else break e}}return Ee}function i(J,Ee){var _=J.sortIndex-Ee.sortIndex;return _!==0?_:J.id-Ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,p=c.now();t.unstable_now=function(){return c.now()-p}}var h=[],f=[],y=1,w=null,S=3,C=!1,j=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function F(J){for(var Ee=n(f);Ee!==null;){if(Ee.callback===null)o(f);else if(Ee.startTime<=J)o(f),Ee.sortIndex=Ee.expirationTime,e(h,Ee);else break;Ee=n(f)}}function L(J){if(N=!1,F(J),!j)if(n(h)!==null)j=!0,Ae(P);else{var Ee=n(f);Ee!==null&&Me(L,Ee.startTime-J)}}function P(J,Ee){j=!1,N&&(N=!1,R(X),X=-1),C=!0;var _=S;try{for(F(Ee),w=n(h);w!==null&&(!(w.expirationTime>Ee)||J&&!ie());){var Q=w.callback;if(typeof Q=="function"){w.callback=null,S=w.priorityLevel;var Se=Q(w.expirationTime<=Ee);Ee=t.unstable_now(),typeof Se=="function"?w.callback=Se:w===n(h)&&o(h),F(Ee)}else o(h);w=n(h)}if(w!==null)var Ve=!0;else{var We=n(f);We!==null&&Me(L,We.startTime-Ee),Ve=!1}return Ve}finally{w=null,S=_,C=!1}}var B=!1,W=null,X=-1,re=5,ce=-1;function ie(){return!(t.unstable_now()-ceJ||125Q?(J.sortIndex=_,e(f,J),n(h)===null&&J===n(f)&&(N?(R(X),X=-1):N=!0,Me(L,_-Q))):(J.sortIndex=Se,e(h,J),j||C||(j=!0,Ae(P))),J},t.unstable_shouldYield=ie,t.unstable_wrapCallback=function(J){var Ee=S;return function(){var _=S;S=Ee;try{return J.apply(this,arguments)}finally{S=_}}}}(Zf)),Zf}var mv;function IC(){return mv||(mv=1,Kf.exports=RC()),Kf.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 gv;function MC(){if(gv)return Pn;gv=1;var t=zc(),e=IC();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,a=1;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[: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]*$/,y={},w={};function S(r){return h.call(w,r)?!0:h.call(y,r)?!1:f.test(r)?w[r]=!0:(y[r]=!0,!1)}function C(r,s,a,d){if(a!==null&&a.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return d?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function j(r,s,a,d){if(s===null||typeof s>"u"||C(r,s,a,d))return!0;if(d)return!1;if(a!==null)switch(a.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function N(r,s,a,d,m,x,k){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=d,this.attributeNamespace=m,this.mustUseProperty=a,this.propertyName=r,this.type=s,this.sanitizeURL=x,this.removeEmptyString=k}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){E[r]=new N(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];E[s]=new N(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){E[r]=new N(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){E[r]=new N(r,2,!1,r,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(r){E[r]=new N(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){E[r]=new N(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){E[r]=new N(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){E[r]=new N(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){E[r]=new N(r,5,!1,r.toLowerCase(),null,!1,!1)});var R=/[\-:]([a-z])/g;function I(r){return r[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(r){var s=r.replace(R,I);E[s]=new N(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(R,I);E[s]=new N(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(R,I);E[s]=new N(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){E[r]=new N(r,1,!1,r.toLowerCase(),null,!1,!1)}),E.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){E[r]=new N(r,1,!1,r.toLowerCase(),null,!0,!0)});function F(r,s,a,d){var m=E.hasOwnProperty(s)?E[s]:null;(m!==null?m.type!==0:d||!(2D||m[k]!==x[D]){var z=` `+m[k].replace(" at new "," at ");return r.displayName&&z.includes("")&&(z=z.replace("",r.displayName)),z}while(1<=k&&0<=D);break}}}finally{Ve=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?Se(r):""}function Je(r){switch(r.tag){case 5:return Se(r.type);case 16:return Se("Lazy");case 13:return Se("Suspense");case 19:return Se("SuspenseList");case 0:case 2:case 15:return r=We(r.type,!1),r;case 11:return r=We(r.type.render,!1),r;case 1:return r=We(r.type,!0),r;default:return""}}function tt(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case W:return"Fragment";case B:return"Portal";case re:return"Profiler";case X:return"StrictMode";case be:return"Suspense";case De:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case ie:return(r.displayName||"Context")+".Consumer";case ce:return(r._context.displayName||"Context")+".Provider";case Oe:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ae:return s=r.displayName||null,s!==null?s:tt(r.type)||"Memo";case Ae:s=r._payload,r=r._init;try{return tt(r(s))}catch{}}return null}function at(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return tt(s);case 8:return s===X?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function nt(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Ct(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function jn(r){var s=Ct(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),d=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var m=a.get,x=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return m.call(this)},set:function(k){d=""+k,x.call(this,k)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return d},setValue:function(k){d=""+k},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Yt(r){r._valueTracker||(r._valueTracker=jn(r))}function Hn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),d="";return r&&(d=Ct(r)?r.checked?"true":"false":r.value),r=d,r!==a?(s.setValue(r),!0):!1}function en(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function cn(r,s){var a=s.checked;return _({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function xt(r,s){var a=s.defaultValue==null?"":s.defaultValue,d=s.checked!=null?s.checked:s.defaultChecked;a=nt(s.value!=null?s.value:a),r._wrapperState={initialChecked:d,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Nn(r,s){s=s.checked,s!=null&&F(r,"checked",s,!1)}function yn(r,s){Nn(r,s);var a=nt(s.value),d=s.type;if(a!=null)d==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(d==="submit"||d==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Wn(r,s.type,a):s.hasOwnProperty("defaultValue")&&Wn(r,s.type,nt(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Ir(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var d=s.type;if(!(d!=="submit"&&d!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,a||s===r.value||(r.value=s),r.defaultValue=s}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function Wn(r,s,a){(s!=="number"||en(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var tn=Array.isArray;function dn(r,s,a,d){if(r=r.options,s){s={};for(var m=0;m"+s.valueOf().toString()+"",s=Nt.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function vr(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var yr={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},ma=["Webkit","ms","Moz","O"];Object.keys(yr).forEach(function(r){ma.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),yr[s]=yr[r]})});function eo(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||yr.hasOwnProperty(r)&&yr[r]?(""+s).trim():s+"px"}function to(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var d=a.indexOf("--")===0,m=eo(a,s[a],d);a==="float"&&(a="cssFloat"),d?r.setProperty(a,m):r[a]=m}}var Ul=_({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 ni(r,s){if(s){if(Ul[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function ri(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 si=null;function oi(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ii=null,Kr=null,Zr=null;function ga(r){if(r=Wa(r)){if(typeof ii!="function")throw Error(n(280));var s=r.stateNode;s&&(s=gu(s),ii(r.stateNode,r.type,s))}}function bs(r){Kr?Zr?Zr.push(r):Zr=[r]:Kr=r}function va(){if(Kr){var r=Kr,s=Zr;if(Zr=Kr=null,ga(r),s)for(r=0;r>>=0,r===0?32:31-(vd(r)/yd|0)|0}var pi=64,hi=4194304;function oo(r){switch(r&-r){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 r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function mi(r,s){var a=r.pendingLanes;if(a===0)return 0;var d=0,m=r.suspendedLanes,x=r.pingedLanes,k=a&268435455;if(k!==0){var D=k&~m;D!==0?d=oo(D):(x&=k,x!==0&&(d=oo(x)))}else k=a&~m,k!==0?d=oo(k):x!==0&&(d=oo(x));if(d===0)return 0;if(s!==0&&s!==d&&(s&m)===0&&(m=d&-d,x=s&-s,m>=x||m===16&&(x&4194240)!==0))return s;if((d&4)!==0&&(d|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=d;0a;a++)s.push(r);return s}function io(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Vn(s),r[s]=a}function Sd(r,s){var a=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var d=r.eventTimes;for(r=r.expirationTimes;0=vo),_a=" ",yo=!1;function xo(r,s){switch(r){case"keyup":return iu.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pa(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Xr=!1;function jd(r,s){switch(r){case"compositionend":return Pa(s);case"keypress":return s.which!==32?null:(yo=!0,_a);case"textInput":return r=s.data,r===_a&&yo?null:r;default:return null}}function Ed(r,s){if(Xr)return r==="compositionend"||!go&&xo(r,s)?(r=A(),O=T=b=null,Xr=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:a,offset:s-r};r=d}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=fm(a)}}function hm(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?hm(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function mm(){for(var r=window,s=en();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=en(r.document)}return s}function Td(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function Fb(r){var s=mm(),a=r.focusedElem,d=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&hm(a.ownerDocument.documentElement,a)){if(d!==null&&Td(a)){if(s=d.start,r=d.end,r===void 0&&(r=s),"selectionStart"in a)a.selectionStart=s,a.selectionEnd=Math.min(r,a.value.length);else if(r=(s=a.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var m=a.textContent.length,x=Math.min(d.start,m);d=d.end===void 0?x:Math.min(d.end,m),!r.extend&&x>d&&(m=d,d=x,x=m),m=pm(a,x);var k=pm(a,d);m&&k&&(r.rangeCount!==1||r.anchorNode!==m.node||r.anchorOffset!==m.offset||r.focusNode!==k.node||r.focusOffset!==k.offset)&&(s=s.createRange(),s.setStart(m.node,m.offset),r.removeAllRanges(),x>d?(r.addRange(s),r.extend(k.node,k.offset)):(s.setEnd(k.node,k.offset),r.addRange(s)))}}for(s=[],r=a;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a=document.documentMode,Ci=null,Nd=null,$a=null,Od=!1;function gm(r,s,a){var d=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Od||Ci==null||Ci!==en(d)||(d=Ci,"selectionStart"in d&&Td(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),$a&&Aa($a,d)||($a=d,d=pu(Nd,"onSelect"),0Ni||(r.current=Bd[Ni],Bd[Ni]=null,Ni--)}function It(r,s){Ni++,Bd[Ni]=r.current,r.current=s}var Os={},xn=Ns(Os),In=Ns(!1),Co=Os;function Oi(r,s){var a=r.type.contextTypes;if(!a)return Os;var d=r.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===s)return d.__reactInternalMemoizedMaskedChildContext;var m={},x;for(x in a)m[x]=s[x];return d&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=m),m}function Mn(r){return r=r.childContextTypes,r!=null}function vu(){Dt(In),Dt(xn)}function Im(r,s,a){if(xn.current!==Os)throw Error(n(168));It(xn,s),It(In,a)}function Mm(r,s,a){var d=r.stateNode;if(s=s.childContextTypes,typeof d.getChildContext!="function")return a;d=d.getChildContext();for(var m in d)if(!(m in s))throw Error(n(108,at(r)||"Unknown",m));return _({},a,d)}function yu(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Os,Co=xn.current,It(xn,r),It(In,In.current),!0}function Fm(r,s,a){var d=r.stateNode;if(!d)throw Error(n(169));a?(r=Mm(r,s,Co),d.__reactInternalMemoizedMergedChildContext=r,Dt(In),Dt(xn),It(xn,r)):Dt(In),It(In,a)}var es=null,xu=!1,Hd=!1;function Dm(r){es===null?es=[r]:es.push(r)}function Ub(r){xu=!0,Dm(r)}function Rs(){if(!Hd&&es!==null){Hd=!0;var r=0,s=wt;try{var a=es;for(wt=1;r>=k,m-=k,ts=1<<32-Vn(s)+m|a<rt?(an=Ye,Ye=null):an=Ye.sibling;var St=te(V,Ye,U[rt],he);if(St===null){Ye===null&&(Ye=an);break}r&&Ye&&St.alternate===null&&s(V,Ye),H=x(St,H,rt),Ze===null?He=St:Ze.sibling=St,Ze=St,Ye=an}if(rt===U.length)return a(V,Ye),$t&&Eo(V,rt),He;if(Ye===null){for(;rtrt?(an=Ye,Ye=null):an=Ye.sibling;var Ls=te(V,Ye,St.value,he);if(Ls===null){Ye===null&&(Ye=an);break}r&&Ye&&Ls.alternate===null&&s(V,Ye),H=x(Ls,H,rt),Ze===null?He=Ls:Ze.sibling=Ls,Ze=Ls,Ye=an}if(St.done)return a(V,Ye),$t&&Eo(V,rt),He;if(Ye===null){for(;!St.done;rt++,St=U.next())St=oe(V,St.value,he),St!==null&&(H=x(St,H,rt),Ze===null?He=St:Ze.sibling=St,Ze=St);return $t&&Eo(V,rt),He}for(Ye=d(V,Ye);!St.done;rt++,St=U.next())St=Ne(Ye,V,rt,St.value,he),St!==null&&(r&&St.alternate!==null&&Ye.delete(St.key===null?rt:St.key),H=x(St,H,rt),Ze===null?He=St:Ze.sibling=St,Ze=St);return r&&Ye.forEach(function(EC){return s(V,EC)}),$t&&Eo(V,rt),He}function qt(V,H,U,he){if(typeof U=="object"&&U!==null&&U.type===W&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case P:e:{for(var He=U.key,Ze=H;Ze!==null;){if(Ze.key===He){if(He=U.type,He===W){if(Ze.tag===7){a(V,Ze.sibling),H=m(Ze,U.props.children),H.return=V,V=H;break e}}else if(Ze.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===Ae&&Km(He)===Ze.type){a(V,Ze.sibling),H=m(Ze,U.props),H.ref=Va(V,Ze,U),H.return=V,V=H;break e}a(V,Ze);break}else s(V,Ze);Ze=Ze.sibling}U.type===W?(H=Fo(U.props.children,V.mode,he,U.key),H.return=V,V=H):(he=qu(U.type,U.key,U.props,null,V.mode,he),he.ref=Va(V,H,U),he.return=V,V=he)}return k(V);case B:e:{for(Ze=U.key;H!==null;){if(H.key===Ze)if(H.tag===4&&H.stateNode.containerInfo===U.containerInfo&&H.stateNode.implementation===U.implementation){a(V,H.sibling),H=m(H,U.children||[]),H.return=V,V=H;break e}else{a(V,H);break}else s(V,H);H=H.sibling}H=zf(U,V.mode,he),H.return=V,V=H}return k(V);case Ae:return Ze=U._init,qt(V,H,Ze(U._payload),he)}if(tn(U))return _e(V,H,U,he);if(Ee(U))return Be(V,H,U,he);Nu(V,U)}return typeof U=="string"&&U!==""||typeof U=="number"?(U=""+U,H!==null&&H.tag===6?(a(V,H.sibling),H=m(H,U),H.return=V,V=H):(a(V,H),H=Lf(U,V.mode,he),H.return=V,V=H),k(V)):a(V,H)}return qt}var _i=Zm(!0),Ym=Zm(!1),Ua={},Ar=Ns(Ua),Ga=Ns(Ua),qa=Ns(Ua);function To(r){if(r===Ua)throw Error(n(174));return r}function nf(r,s){switch(It(qa,s),It(Ga,r),It(Ar,Ua),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:lt(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=lt(s,r)}Dt(Ar),It(Ar,s)}function Pi(){Dt(Ar),Dt(Ga),Dt(qa)}function Qm(r){To(qa.current);var s=To(Ar.current),a=lt(s,r.type);s!==a&&(It(Ga,r),It(Ar,a))}function rf(r){Ga.current===r&&(Dt(Ar),Dt(Ga))}var zt=Ns(0);function Ou(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var sf=[];function of(){for(var r=0;ra?a:4,r(!0);var d=af.transition;af.transition={};try{r(!1),s()}finally{wt=a,af.transition=d}}function mg(){return or().memoizedState}function Zb(r,s,a){var d=Ps(r);if(a={lane:d,action:a,hasEagerState:!1,eagerState:null,next:null},gg(r))vg(s,a);else if(a=zm(r,s,a,d),a!==null){var m=kn();kr(a,r,d,m),yg(a,s,d)}}function Yb(r,s,a){var d=Ps(r),m={lane:d,action:a,hasEagerState:!1,eagerState:null,next:null};if(gg(r))vg(s,m);else{var x=r.alternate;if(r.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var k=s.lastRenderedState,D=x(k,a);if(m.hasEagerState=!0,m.eagerState=D,Sr(D,k)){var z=s.interleaved;z===null?(m.next=m,Xd(s)):(m.next=z.next,z.next=m),s.interleaved=m;return}}catch{}finally{}a=zm(r,s,m,d),a!==null&&(m=kn(),kr(a,r,d,m),yg(a,s,d))}}function gg(r){var s=r.alternate;return r===Bt||s!==null&&s===Bt}function vg(r,s){Ka=Iu=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function yg(r,s,a){if((a&4194240)!==0){var d=s.lanes;d&=r.pendingLanes,a|=d,s.lanes=a,gi(r,a)}}var Du={readContext:sr,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},Qb={readContext:sr,useCallback:function(r,s){return $r().memoizedState=[r,s===void 0?null:s],r},useContext:sr,useEffect:ag,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,Mu(4194308,4,cg.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Mu(4194308,4,r,s)},useInsertionEffect:function(r,s){return Mu(4,2,r,s)},useMemo:function(r,s){var a=$r();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var d=$r();return s=a!==void 0?a(s):s,d.memoizedState=d.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},d.queue=r,r=r.dispatch=Zb.bind(null,Bt,r),[d.memoizedState,r]},useRef:function(r){var s=$r();return r={current:r},s.memoizedState=r},useState:og,useDebugValue:hf,useDeferredValue:function(r){return $r().memoizedState=r},useTransition:function(){var r=og(!1),s=r[0];return r=Kb.bind(null,r[1]),$r().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var d=Bt,m=$r();if($t){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),on===null)throw Error(n(349));(No&30)!==0||eg(d,s,a)}m.memoizedState=a;var x={value:a,getSnapshot:s};return m.queue=x,ag(ng.bind(null,d,x,r),[r]),d.flags|=2048,Qa(9,tg.bind(null,d,x,a,s),void 0,null),a},useId:function(){var r=$r(),s=on.identifierPrefix;if($t){var a=ns,d=ts;a=(d&~(1<<32-Vn(d)-1)).toString(32)+a,s=":"+s+"R"+a,a=Za++,0<\/script>",r=r.removeChild(r.firstChild)):typeof d.is=="string"?r=k.createElement(a,{is:d.is}):(r=k.createElement(a),a==="select"&&(k=r,d.multiple?k.multiple=!0:d.size&&(k.size=d.size))):r=k.createElementNS(r,a),r[Pr]=s,r[Ha]=d,_g(r,s,!1,!1),s.stateNode=r;e:{switch(k=ri(a,d),a){case"dialog":Ft("cancel",r),Ft("close",r),m=d;break;case"iframe":case"object":case"embed":Ft("load",r),m=d;break;case"video":case"audio":for(m=0;mzi&&(s.flags|=128,d=!0,Xa(x,!1),s.lanes=4194304)}else{if(!d)if(r=Ou(k),r!==null){if(s.flags|=128,d=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),Xa(x,!0),x.tail===null&&x.tailMode==="hidden"&&!k.alternate&&!$t)return Sn(s),null}else 2*Lt()-x.renderingStartTime>zi&&a!==1073741824&&(s.flags|=128,d=!0,Xa(x,!1),s.lanes=4194304);x.isBackwards?(k.sibling=s.child,s.child=k):(a=x.last,a!==null?a.sibling=k:s.child=k,x.last=k)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Lt(),s.sibling=null,a=zt.current,It(zt,d?a&1|2:a&1),s):(Sn(s),null);case 22:case 23:return Pf(),d=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==d&&(s.flags|=8192),d&&(s.mode&1)!==0?(qn&1073741824)!==0&&(Sn(s),s.subtreeFlags&6&&(s.flags|=8192)):Sn(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function oC(r,s){switch(Vd(s),s.tag){case 1:return Mn(s.type)&&vu(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Pi(),Dt(In),Dt(xn),of(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return rf(s),null;case 13:if(Dt(zt),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Mi()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Dt(zt),null;case 4:return Pi(),null;case 10:return Yd(s.type._context),null;case 22:case 23:return Pf(),null;case 24:return null;default:return null}}var Au=!1,bn=!1,iC=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function $i(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(d){Vt(r,s,d)}else a.current=null}function jf(r,s,a){try{a()}catch(d){Vt(r,s,d)}}var $g=!1;function aC(r,s){if(_d=ho,r=mm(),Td(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var d=a.getSelection&&a.getSelection();if(d&&d.rangeCount!==0){a=d.anchorNode;var m=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{a.nodeType,x.nodeType}catch{a=null;break e}var k=0,D=-1,z=-1,q=0,ne=0,oe=r,te=null;t:for(;;){for(var Ne;oe!==a||m!==0&&oe.nodeType!==3||(D=k+m),oe!==x||d!==0&&oe.nodeType!==3||(z=k+d),oe.nodeType===3&&(k+=oe.nodeValue.length),(Ne=oe.firstChild)!==null;)te=oe,oe=Ne;for(;;){if(oe===r)break t;if(te===a&&++q===m&&(D=k),te===x&&++ne===d&&(z=k),(Ne=oe.nextSibling)!==null)break;oe=te,te=oe.parentNode}oe=Ne}a=D===-1||z===-1?null:{start:D,end:z}}else a=null}a=a||{start:0,end:0}}else a=null;for(Pd={focusedElem:r,selectionRange:a},ho=!1,Fe=s;Fe!==null;)if(s=Fe,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Fe=r;else for(;Fe!==null;){s=Fe;try{var _e=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var Be=_e.memoizedProps,qt=_e.memoizedState,V=s.stateNode,H=V.getSnapshotBeforeUpdate(s.elementType===s.type?Be:Cr(s.type,Be),qt);V.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var U=s.stateNode.containerInfo;U.nodeType===1?U.textContent="":U.nodeType===9&&U.documentElement&&U.removeChild(U.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(he){Vt(s,s.return,he)}if(r=s.sibling,r!==null){r.return=s.return,Fe=r;break}Fe=s.return}return _e=$g,$g=!1,_e}function Ja(r,s,a){var d=s.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var m=d=d.next;do{if((m.tag&r)===r){var x=m.destroy;m.destroy=void 0,x!==void 0&&jf(s,a,x)}m=m.next}while(m!==d)}}function $u(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&r)===r){var d=a.create;a.destroy=d()}a=a.next}while(a!==s)}}function Ef(r){var s=r.ref;if(s!==null){var a=r.stateNode;switch(r.tag){case 5:r=a;break;default:r=a}typeof s=="function"?s(r):s.current=r}}function Lg(r){var s=r.alternate;s!==null&&(r.alternate=null,Lg(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[Pr],delete s[Ha],delete s[zd],delete s[Wb],delete s[Vb])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function zg(r){return r.tag===5||r.tag===3||r.tag===4}function Bg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||zg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function kf(r,s,a){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?a.nodeType===8?a.parentNode.insertBefore(r,s):a.insertBefore(r,s):(a.nodeType===8?(s=a.parentNode,s.insertBefore(r,a)):(s=a,s.appendChild(r)),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=mu));else if(d!==4&&(r=r.child,r!==null))for(kf(r,s,a),r=r.sibling;r!==null;)kf(r,s,a),r=r.sibling}function Tf(r,s,a){var d=r.tag;if(d===5||d===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(d!==4&&(r=r.child,r!==null))for(Tf(r,s,a),r=r.sibling;r!==null;)Tf(r,s,a),r=r.sibling}var hn=null,jr=!1;function Fs(r,s,a){for(a=a.child;a!==null;)Hg(r,s,a),a=a.sibling}function Hg(r,s,a){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(fi,a)}catch{}switch(a.tag){case 5:bn||$i(a,s);case 6:var d=hn,m=jr;hn=null,Fs(r,s,a),hn=d,jr=m,hn!==null&&(jr?(r=hn,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):hn.removeChild(a.stateNode));break;case 18:hn!==null&&(jr?(r=hn,a=a.stateNode,r.nodeType===8?Ld(r.parentNode,a):r.nodeType===1&&Ld(r,a),po(r)):Ld(hn,a.stateNode));break;case 4:d=hn,m=jr,hn=a.stateNode.containerInfo,jr=!0,Fs(r,s,a),hn=d,jr=m;break;case 0:case 11:case 14:case 15:if(!bn&&(d=a.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){m=d=d.next;do{var x=m,k=x.destroy;x=x.tag,k!==void 0&&((x&2)!==0||(x&4)!==0)&&jf(a,s,k),m=m.next}while(m!==d)}Fs(r,s,a);break;case 1:if(!bn&&($i(a,s),d=a.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=a.memoizedProps,d.state=a.memoizedState,d.componentWillUnmount()}catch(D){Vt(a,s,D)}Fs(r,s,a);break;case 21:Fs(r,s,a);break;case 22:a.mode&1?(bn=(d=bn)||a.memoizedState!==null,Fs(r,s,a),bn=d):Fs(r,s,a);break;default:Fs(r,s,a)}}function Wg(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new iC),s.forEach(function(d){var m=gC.bind(null,r,d);a.has(d)||(a.add(d),d.then(m,m))})}}function Er(r,s){var a=s.deletions;if(a!==null)for(var d=0;dm&&(m=k),d&=~x}if(d=m,d=Lt()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*uC(d/1960))-d,10r?16:r,_s===null)var d=!1;else{if(r=_s,_s=null,Wu=0,(vt&6)!==0)throw Error(n(331));var m=vt;for(vt|=4,Fe=r.current;Fe!==null;){var x=Fe,k=x.child;if((Fe.flags&16)!==0){var D=x.deletions;if(D!==null){for(var z=0;zLt()-Rf?Io(r,0):Of|=a),_n(r,s)}function nv(r,s){s===0&&((r.mode&1)===0?s=1:(s=hi,hi<<=1,(hi&130023424)===0&&(hi=4194304)));var a=kn();r=rs(r,s),r!==null&&(io(r,s,a),_n(r,a))}function mC(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),nv(r,a)}function gC(r,s){var a=0;switch(r.tag){case 13:var d=r.stateNode,m=r.memoizedState;m!==null&&(a=m.retryLane);break;case 19:d=r.stateNode;break;default:throw Error(n(314))}d!==null&&d.delete(s),nv(r,a)}var rv;rv=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||In.current)Fn=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return Fn=!1,rC(r,s,a);Fn=(r.flags&131072)!==0}else Fn=!1,$t&&(s.flags&1048576)!==0&&_m(s,Su,s.index);switch(s.lanes=0,s.tag){case 2:var d=s.type;Pu(r,s),r=s.pendingProps;var m=Oi(s,xn.current);Di(s,a),m=uf(null,s,d,r,m,a);var x=cf();return s.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,Mn(d)?(x=!0,yu(s)):x=!1,s.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,Jd(s),m.updater=Tu,s.stateNode=m,m._reactInternals=s,tf(s,d,r,a),s=yf(null,s,d,!0,x,a)):(s.tag=0,$t&&x&&Wd(s),En(null,s,m,a),s=s.child),s;case 16:d=s.elementType;e:{switch(Pu(r,s),r=s.pendingProps,m=d._init,d=m(d._payload),s.type=d,m=s.tag=yC(d),r=Cr(d,r),m){case 0:s=vf(null,s,d,r,a);break e;case 1:s=Og(null,s,d,r,a);break e;case 11:s=jg(null,s,d,r,a);break e;case 14:s=Eg(null,s,d,Cr(d.type,r),a);break e}throw Error(n(306,d,""))}return s;case 0:return d=s.type,m=s.pendingProps,m=s.elementType===d?m:Cr(d,m),vf(r,s,d,m,a);case 1:return d=s.type,m=s.pendingProps,m=s.elementType===d?m:Cr(d,m),Og(r,s,d,m,a);case 3:e:{if(Rg(s),r===null)throw Error(n(387));d=s.pendingProps,x=s.memoizedState,m=x.element,Bm(r,s),ku(s,d,null,a);var k=s.memoizedState;if(d=k.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){m=Ai(Error(n(423)),s),s=Ig(r,s,d,a,m);break e}else if(d!==m){m=Ai(Error(n(424)),s),s=Ig(r,s,d,a,m);break e}else for(Gn=Ts(s.stateNode.containerInfo.firstChild),Un=s,$t=!0,br=null,a=Ym(s,null,d,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Mi(),d===m){s=os(r,s,a);break e}En(r,s,d,a)}s=s.child}return s;case 5:return Qm(s),r===null&&Gd(s),d=s.type,m=s.pendingProps,x=r!==null?r.memoizedProps:null,k=m.children,Ad(d,m)?k=null:x!==null&&Ad(d,x)&&(s.flags|=32),Ng(r,s),En(r,s,k,a),s.child;case 6:return r===null&&Gd(s),null;case 13:return Mg(r,s,a);case 4:return nf(s,s.stateNode.containerInfo),d=s.pendingProps,r===null?s.child=_i(s,null,d,a):En(r,s,d,a),s.child;case 11:return d=s.type,m=s.pendingProps,m=s.elementType===d?m:Cr(d,m),jg(r,s,d,m,a);case 7:return En(r,s,s.pendingProps,a),s.child;case 8:return En(r,s,s.pendingProps.children,a),s.child;case 12:return En(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(d=s.type._context,m=s.pendingProps,x=s.memoizedProps,k=m.value,It(Cu,d._currentValue),d._currentValue=k,x!==null)if(Sr(x.value,k)){if(x.children===m.children&&!In.current){s=os(r,s,a);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var D=x.dependencies;if(D!==null){k=x.child;for(var z=D.firstContext;z!==null;){if(z.context===d){if(x.tag===1){z=ss(-1,a&-a),z.tag=2;var q=x.updateQueue;if(q!==null){q=q.shared;var ne=q.pending;ne===null?z.next=z:(z.next=ne.next,ne.next=z),q.pending=z}}x.lanes|=a,z=x.alternate,z!==null&&(z.lanes|=a),Qd(x.return,a,s),D.lanes|=a;break}z=z.next}}else if(x.tag===10)k=x.type===s.type?null:x.child;else if(x.tag===18){if(k=x.return,k===null)throw Error(n(341));k.lanes|=a,D=k.alternate,D!==null&&(D.lanes|=a),Qd(k,a,s),k=x.sibling}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===s){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}En(r,s,m.children,a),s=s.child}return s;case 9:return m=s.type,d=s.pendingProps.children,Di(s,a),m=sr(m),d=d(m),s.flags|=1,En(r,s,d,a),s.child;case 14:return d=s.type,m=Cr(d,s.pendingProps),m=Cr(d.type,m),Eg(r,s,d,m,a);case 15:return kg(r,s,s.type,s.pendingProps,a);case 17:return d=s.type,m=s.pendingProps,m=s.elementType===d?m:Cr(d,m),Pu(r,s),s.tag=1,Mn(d)?(r=!0,yu(s)):r=!1,Di(s,a),Gm(s,d,m),tf(s,d,m,a),yf(null,s,d,!0,r,a);case 19:return Dg(r,s,a);case 22:return Tg(r,s,a)}throw Error(n(156,s.tag))};function sv(r,s){return Zl(r,s)}function vC(r,s,a,d){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(r,s,a,d){return new vC(r,s,a,d)}function $f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function yC(r){if(typeof r=="function")return $f(r)?1:0;if(r!=null){if(r=r.$$typeof,r===Oe)return 11;if(r===ae)return 14}return 2}function $s(r,s){var a=r.alternate;return a===null?(a=ar(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function qu(r,s,a,d,m,x){var k=2;if(d=r,typeof r=="function")$f(r)&&(k=1);else if(typeof r=="string")k=5;else e:switch(r){case W:return Fo(a.children,m,x,s);case X:k=8,m|=8;break;case re:return r=ar(12,a,s,m|2),r.elementType=re,r.lanes=x,r;case be:return r=ar(13,a,s,m),r.elementType=be,r.lanes=x,r;case De:return r=ar(19,a,s,m),r.elementType=De,r.lanes=x,r;case Me:return Ku(a,m,x,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case ce:k=10;break e;case ie:k=9;break e;case Oe:k=11;break e;case ae:k=14;break e;case Ae:k=16,d=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=ar(k,a,s,m),s.elementType=r,s.type=d,s.lanes=x,s}function Fo(r,s,a,d){return r=ar(7,r,d,s),r.lanes=a,r}function Ku(r,s,a,d){return r=ar(22,r,d,s),r.elementType=Me,r.lanes=a,r.stateNode={isHidden:!1},r}function Lf(r,s,a){return r=ar(6,r,null,s),r.lanes=a,r}function zf(r,s,a){return s=ar(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function xC(r,s,a,d,m){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ka(0),this.expirationTimes=ka(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ka(0),this.identifierPrefix=d,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function Bf(r,s,a,d,m,x,k,D,z){return r=new xC(r,s,a,D,z),s===1?(s=1,x===!0&&(s|=8)):s=0,x=ar(3,null,null,s),r.current=x,x.stateNode=r,x.memoizedState={element:d,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Jd(x),r}function wC(r,s,a){var d=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),qf.exports=MC(),qf.exports}var yv;function FC(){if(yv)return tc;yv=1;var t=_x();return tc.createRoot=t.createRoot,tc.hydrateRoot=t.hydrateRoot,tc}var DC=FC();const _C=xs(DC),PC="https://jg-mechanic/",me=async(t,e)=>await new Promise(async(n,o)=>{try{const l=await(await fetch(PC+t,{method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},body:e?JSON.stringify(e):void 0})).json();typeof l=="object"&&l.error&&o({error:!0,reason:l.error}),n(l)}catch(i){o(i)}}),Px=v.createContext(void 0),AC=({children:t})=>{const[e,n]=v.useState({}),[o,i]=v.useState({}),[l,c]=v.useState({});v.useEffect(()=>{const h=({data:f})=>{f.source||(f.type==="hide"?n(y=>({...y,type:!1})):e.type!=="show-tablet"&&f.instructionText?n({type:"show-instruction-text",...f}):f.type?(n({...f}),i(f.config),c(f.locale)):(n(y=>({...y,...f})),f.locale&&c(f.locale)))};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[e]);const p=async()=>{n({...e,type:!1}),await me("close")};return u.jsx(Px.Provider,{value:{event:e,setEvent:n,config:o,locale:l,onCloseModal:p},children:t})},we=()=>{const t=v.useContext(Px);if(!t)throw new Error("Must be used in the AppProvider");return t},Ax=v.createContext(void 0),Gt=()=>{const t=v.useContext(Ax);if(!t)throw new Error("Must be used in the TabletProvider");return t},$C=()=>{const{event:t,locale:e}=we(),{connectedVehicle:n}=Gt(),o=v.useMemo(()=>t.isVehicleElectric||!1,[t]);return u.jsx("div",{children:n?u.jsxs("span",{className:"text-green-400",children:[u.jsx("i",{className:"bi-plug"}),u.jsx("span",{children:e.connectedTo}),u.jsx("span",{className:"ms-1 font-bold font-monospace border-green-600 border-1 rounded p-[2px] px-[4px]",children:n.plate}),u.jsx("span",{children:o&&u.jsx("i",{className:"bi-lightning-charge-fill ms-1"})})]}):u.jsxs("span",{className:"text-orange-400",children:[u.jsx("i",{className:"me-1 bi-exclamation-circle"}),u.jsx("span",{children:e.noVehicleConnected})]})})},LC=({showConnectionStatus:t})=>u.jsxs("div",{className:"flex justify-between p-2 px-4 text-gray-400 text-sm w-[100%] z-[2]",children:[u.jsx("span",{children:u.jsx("i",{className:"bi-reception-4"})}),t&&u.jsx($C,{}),u.jsx("span",{children:u.jsx("i",{className:"bi-battery-half text-xl leading-none"})})]});var Yf={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */var xv;function zC(){return xv||(xv=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o=[],i=0;i1?y-1:0),S=1;S{l.target===t&&(i(),e(l))},n+o)}function ol(...t){return t.filter(e=>e!=null).reduce((e,n)=>{if(typeof n!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return e===null?n:function(...i){e.apply(this,i),n.apply(this,i)}},null)}function Ux(t){t.offsetHeight}const kv=t=>!t||typeof t=="function"?t:e=>{t.current=e};function u1(t,e){const n=kv(t),o=kv(e);return i=>{n&&n(i),o&&o(i)}}function Gr(t,e){return v.useMemo(()=>u1(t,e),[t,e])}function Tc(t){return t&&"setState"in t?$o.findDOMNode(t):t??null}const Gx=mt.forwardRef(({onEnter:t,onEntering:e,onEntered:n,onExit:o,onExiting:i,onExited:l,addEndListener:c,children:p,childRef:h,...f},y)=>{const w=v.useRef(null),S=Gr(w,h),C=B=>{S(Tc(B))},j=B=>W=>{B&&w.current&&B(w.current,W)},N=v.useCallback(j(t),[t]),E=v.useCallback(j(e),[e]),R=v.useCallback(j(n),[n]),I=v.useCallback(j(o),[o]),F=v.useCallback(j(i),[i]),L=v.useCallback(j(l),[l]),P=v.useCallback(j(c),[c]);return u.jsx(ws,{ref:y,...f,onEnter:N,onEntered:R,onEntering:E,onExit:I,onExited:L,onExiting:F,addEndListener:P,nodeRef:w,children:typeof p=="function"?(B,W)=>p(B,{...W,ref:C}):mt.cloneElement(p,{ref:C})})}),c1={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function d1(t,e){const n=`offset${t[0].toUpperCase()}${t.slice(1)}`,o=e[n],i=c1[t];return o+parseInt(ps(e,i[0]),10)+parseInt(ps(e,i[1]),10)}const f1={[Hs]:"collapse",[kc]:"collapsing",[us]:"collapsing",[Vs]:"collapse show"},p1=mt.forwardRef(({onEnter:t,onEntering:e,onEntered:n,onExit:o,onExiting:i,className:l,children:c,dimension:p="height",in:h=!1,timeout:f=300,mountOnEnter:y=!1,unmountOnExit:w=!1,appear:S=!1,getDimensionValue:C=d1,...j},N)=>{const E=typeof p=="function"?p():p,R=v.useMemo(()=>ol(B=>{B.style[E]="0"},t),[E,t]),I=v.useMemo(()=>ol(B=>{const W=`scroll${E[0].toUpperCase()}${E.slice(1)}`;B.style[E]=`${B[W]}px`},e),[E,e]),F=v.useMemo(()=>ol(B=>{B.style[E]=null},n),[E,n]),L=v.useMemo(()=>ol(B=>{B.style[E]=`${C(E,B)}px`,Ux(B)},o),[o,C,E]),P=v.useMemo(()=>ol(B=>{B.style[E]=null},i),[E,i]);return u.jsx(Gx,{ref:N,addEndListener:Vx,...j,"aria-expanded":j.role?h:null,onEnter:R,onEntering:I,onEntered:F,onExit:L,onExiting:P,childRef:c.ref,in:h,timeout:f,mountOnEnter:y,unmountOnExit:w,appear:S,children:(B,W)=>mt.cloneElement(c,{...W,className:Te(l,c.props.className,f1[B],E==="width"&&"collapse-horizontal")})})});function qx(t,e){return Array.isArray(t)?t.includes(e):t===e}const Fl=v.createContext({});Fl.displayName="AccordionContext";const ch=v.forwardRef(({as:t="div",bsPrefix:e,className:n,children:o,eventKey:i,...l},c)=>{const{activeEventKey:p}=v.useContext(Fl);return e=Pe(e,"accordion-collapse"),u.jsx(p1,{ref:c,in:qx(p,i),...l,className:Te(n,e),children:u.jsx(t,{children:v.Children.only(o)})})});ch.displayName="AccordionCollapse";const Hc=v.createContext({eventKey:""});Hc.displayName="AccordionItemContext";const dh=v.forwardRef(({as:t="div",bsPrefix:e,className:n,onEnter:o,onEntering:i,onEntered:l,onExit:c,onExiting:p,onExited:h,...f},y)=>{e=Pe(e,"accordion-body");const{eventKey:w}=v.useContext(Hc);return u.jsx(ch,{eventKey:w,onEnter:o,onEntering:i,onEntered:l,onExit:c,onExiting:p,onExited:h,children:u.jsx(t,{ref:y,...f,className:Te(n,e)})})});dh.displayName="AccordionBody";function h1(t,e){const{activeEventKey:n,onSelect:o,alwaysOpen:i}=v.useContext(Fl);return l=>{let c=t===n?null:t;i&&(Array.isArray(n)?n.includes(t)?c=n.filter(p=>p!==t):c=[...n,t]:c=[t]),o==null||o(c,l),e==null||e(l)}}const fh=v.forwardRef(({as:t="button",bsPrefix:e,className:n,onClick:o,...i},l)=>{e=Pe(e,"accordion-button");const{eventKey:c}=v.useContext(Hc),p=h1(c,o),{activeEventKey:h}=v.useContext(Fl);return t==="button"&&(i.type="button"),u.jsx(t,{ref:l,onClick:p,...i,"aria-expanded":Array.isArray(h)?h.includes(c):c===h,className:Te(n,e,!qx(h,c)&&"collapsed")})});fh.displayName="AccordionButton";const ph=v.forwardRef(({as:t="h2",bsPrefix:e,className:n,children:o,onClick:i,...l},c)=>(e=Pe(e,"accordion-header"),u.jsx(t,{ref:c,...l,className:Te(n,e),children:u.jsx(fh,{onClick:i,children:o})})));ph.displayName="AccordionHeader";const Kx=v.forwardRef(({as:t="div",bsPrefix:e,className:n,eventKey:o,...i},l)=>{e=Pe(e,"accordion-item");const c=v.useMemo(()=>({eventKey:o}),[o]);return u.jsx(Hc.Provider,{value:c,children:u.jsx(t,{ref:l,...i,className:Te(n,e)})})});Kx.displayName="AccordionItem";const Zx=v.forwardRef((t,e)=>{const{as:n="div",activeKey:o,bsPrefix:i,className:l,onSelect:c,flush:p,alwaysOpen:h,...f}=Il(t,{activeKey:"onSelect"}),y=Pe(i,"accordion"),w=v.useMemo(()=>({activeEventKey:o,onSelect:c,alwaysOpen:h}),[o,c,h]);return u.jsx(Fl.Provider,{value:w,children:u.jsx(n,{ref:e,...f,className:Te(l,y,p&&`${y}-flush`)})})});Zx.displayName="Accordion";const Br=Object.assign(Zx,{Button:fh,Collapse:ch,Item:Kx,Header:ph,Body:dh});function m1(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t},[t]),e}function Ht(t){const e=m1(t);return v.useCallback(function(...n){return e.current&&e.current(...n)},[e])}const Wc=t=>v.forwardRef((e,n)=>u.jsx("div",{...e,ref:n,className:Te(e.className,t)})),Yx=Wc("h4");Yx.displayName="DivStyledAsH4";const Qx=v.forwardRef(({className:t,bsPrefix:e,as:n=Yx,...o},i)=>(e=Pe(e,"alert-heading"),u.jsx(n,{ref:i,className:Te(t,e),...o})));Qx.displayName="AlertHeading";function Nc(){return v.useState(null)}function g1(t,e,n,o=!1){const i=Ht(n);v.useEffect(()=>{const l=typeof t=="function"?t():t;return l.addEventListener(e,i,o),()=>l.removeEventListener(e,i,o)},[t])}function hh(){const t=v.useRef(!0),e=v.useRef(()=>t.current);return v.useEffect(()=>(t.current=!0,()=>{t.current=!1}),[]),e.current}function Xx(t){const e=v.useRef(null);return v.useEffect(()=>{e.current=t}),e.current}const v1=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",y1=typeof document<"u",Oc=y1||v1?v.useLayoutEffect:v.useEffect,x1=["as","disabled"];function w1(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}function S1(t){return!t||t.trim()==="#"}function mh({tagName:t,disabled:e,href:n,target:o,rel:i,role:l,onClick:c,tabIndex:p=0,type:h}){t||(n!=null||o!=null||i!=null?t="a":t="button");const f={tagName:t};if(t==="button")return[{type:h||"button",disabled:e},f];const y=S=>{if((e||t==="a"&&S1(n))&&S.preventDefault(),e){S.stopPropagation();return}c==null||c(S)},w=S=>{S.key===" "&&(S.preventDefault(),y(S))};return t==="a"&&(n||(n="#"),e&&(n=void 0)),[{role:l??"button",disabled:void 0,tabIndex:e?void 0:p,href:n,target:t==="a"?o:void 0,"aria-disabled":e||void 0,rel:t==="a"?i:void 0,onClick:y,onKeyDown:w},f]}const gh=v.forwardRef((t,e)=>{let{as:n,disabled:o}=t,i=w1(t,x1);const[l,{tagName:c}]=mh(Object.assign({tagName:n,disabled:o},i));return u.jsx(c,Object.assign({},i,l,{ref:e}))});gh.displayName="Button";const b1=["onKeyDown"];function C1(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}function j1(t){return!t||t.trim()==="#"}const Vc=v.forwardRef((t,e)=>{let{onKeyDown:n}=t,o=C1(t,b1);const[i]=mh(Object.assign({tagName:"a"},o)),l=Ht(c=>{i.onKeyDown(c),n==null||n(c)});return j1(o.href)||o.role==="button"?u.jsx("a",Object.assign({ref:e},o,i,{onKeyDown:l})):u.jsx("a",Object.assign({ref:e},o,{onKeyDown:n}))});Vc.displayName="Anchor";const Jx=v.forwardRef(({className:t,bsPrefix:e,as:n=Vc,...o},i)=>(e=Pe(e,"alert-link"),u.jsx(n,{ref:i,className:Te(t,e),...o})));Jx.displayName="AlertLink";const E1={[us]:"show",[Vs]:"show"},hs=v.forwardRef(({className:t,children:e,transitionClasses:n={},onEnter:o,...i},l)=>{const c={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...i},p=v.useCallback((h,f)=>{Ux(h),o==null||o(h,f)},[o]);return u.jsx(Gx,{ref:l,addEndListener:Vx,...c,onEnter:p,childRef:e.ref,children:(h,f)=>v.cloneElement(e,{...f,className:Te("fade",t,e.props.className,E1[h],n[h])})})});hs.displayName="Fade";const k1={"aria-label":gn.string,onClick:gn.func,variant:gn.oneOf(["white"])},Ko=v.forwardRef(({className:t,variant:e,"aria-label":n="Close",...o},i)=>u.jsx("button",{ref:i,type:"button",className:Te("btn-close",e&&`btn-close-${e}`,t),"aria-label":n,...o}));Ko.displayName="CloseButton";Ko.propTypes=k1;const e0=v.forwardRef((t,e)=>{const{bsPrefix:n,show:o=!0,closeLabel:i="Close alert",closeVariant:l,className:c,children:p,variant:h="primary",onClose:f,dismissible:y,transition:w=hs,...S}=Il(t,{show:"onClose"}),C=Pe(n,"alert"),j=Ht(R=>{f&&f(!1,R)}),N=w===!0?hs:w,E=u.jsxs("div",{role:"alert",...N?void 0:S,ref:e,className:Te(c,C,h&&`${C}-${h}`,y&&`${C}-dismissible`),children:[y&&u.jsx(Ko,{onClick:j,"aria-label":i,variant:l}),p]});return N?u.jsx(N,{unmountOnExit:!0,...S,ref:void 0,in:o,children:E}):o?E:null});e0.displayName="Alert";const Vr=Object.assign(e0,{Link:Jx,Heading:Qx}),Pt=v.forwardRef(({bsPrefix:t,bg:e="primary",pill:n=!1,text:o,className:i,as:l="span",...c},p)=>{const h=Pe(t,"badge");return u.jsx(l,{ref:p,...c,className:Te(i,h,n&&"rounded-pill",o&&`text-${o}`,e&&`bg-${e}`)})});Pt.displayName="Badge";const ve=v.forwardRef(({as:t,bsPrefix:e,variant:n="primary",size:o,active:i=!1,disabled:l=!1,className:c,...p},h)=>{const f=Pe(e,"btn"),[y,{tagName:w}]=mh({tagName:t,disabled:l,...p}),S=w;return u.jsx(S,{...y,...p,ref:h,disabled:l,className:Te(c,f,i&&"active",n&&`${f}-${n}`,o&&`${f}-${o}`,p.href&&l&&"disabled")})});ve.displayName="Button";const t0=v.forwardRef(({bsPrefix:t,size:e,vertical:n=!1,className:o,role:i="group",as:l="div",...c},p)=>{const h=Pe(t,"btn-group");let f=h;return n&&(f=`${h}-vertical`),u.jsx(l,{...c,ref:p,role:i,className:Te(o,f,e&&`${h}-${e}`)})});t0.displayName="ButtonGroup";const vh=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"card-body"),u.jsx(n,{ref:i,className:Te(t,e),...o})));vh.displayName="CardBody";const n0=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"card-footer"),u.jsx(n,{ref:i,className:Te(t,e),...o})));n0.displayName="CardFooter";const yh=v.createContext(null);yh.displayName="CardHeaderContext";const r0=v.forwardRef(({bsPrefix:t,className:e,as:n="div",...o},i)=>{const l=Pe(t,"card-header"),c=v.useMemo(()=>({cardHeaderBsPrefix:l}),[l]);return u.jsx(yh.Provider,{value:c,children:u.jsx(n,{ref:i,...o,className:Te(e,l)})})});r0.displayName="CardHeader";const s0=v.forwardRef(({bsPrefix:t,className:e,variant:n,as:o="img",...i},l)=>{const c=Pe(t,"card-img");return u.jsx(o,{ref:l,className:Te(n?`${c}-${n}`:c,e),...i})});s0.displayName="CardImg";const o0=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"card-img-overlay"),u.jsx(n,{ref:i,className:Te(t,e),...o})));o0.displayName="CardImgOverlay";const i0=v.forwardRef(({className:t,bsPrefix:e,as:n="a",...o},i)=>(e=Pe(e,"card-link"),u.jsx(n,{ref:i,className:Te(t,e),...o})));i0.displayName="CardLink";const T1=Wc("h6"),a0=v.forwardRef(({className:t,bsPrefix:e,as:n=T1,...o},i)=>(e=Pe(e,"card-subtitle"),u.jsx(n,{ref:i,className:Te(t,e),...o})));a0.displayName="CardSubtitle";const l0=v.forwardRef(({className:t,bsPrefix:e,as:n="p",...o},i)=>(e=Pe(e,"card-text"),u.jsx(n,{ref:i,className:Te(t,e),...o})));l0.displayName="CardText";const N1=Wc("h5"),u0=v.forwardRef(({className:t,bsPrefix:e,as:n=N1,...o},i)=>(e=Pe(e,"card-title"),u.jsx(n,{ref:i,className:Te(t,e),...o})));u0.displayName="CardTitle";const c0=v.forwardRef(({bsPrefix:t,className:e,bg:n,text:o,border:i,body:l=!1,children:c,as:p="div",...h},f)=>{const y=Pe(t,"card");return u.jsx(p,{ref:f,...h,className:Te(e,y,n&&`bg-${n}`,o&&`text-${o}`,i&&`border-${i}`),children:l?u.jsx(vh,{children:c}):c})});c0.displayName="Card";const gt=Object.assign(c0,{Img:s0,Title:u0,Subtitle:a0,Body:vh,Link:i0,Text:l0,Header:r0,Footer:n0,ImgOverlay:o0});function O1(t){const e=v.useRef(t);return e.current=t,e}function xh(t){const e=O1(t);v.useEffect(()=>()=>e.current(),[])}const _p=2**31-1;function d0(t,e,n){const o=n-Date.now();t.current=o<=_p?setTimeout(e,o):setTimeout(()=>d0(t,e,n),_p)}function R1(){const t=hh(),e=v.useRef();return xh(()=>clearTimeout(e.current)),v.useMemo(()=>{const n=()=>clearTimeout(e.current);function o(i,l=0){t()&&(n(),l<=_p?e.current=setTimeout(i,l):d0(e,i,Date.now()+l))}return{set:o,clear:n,handleRef:e}},[])}function Pp(t,e){let n=0;return v.Children.map(t,o=>v.isValidElement(o)?e(o,n++):o)}function I1(t,e){let n=0;v.Children.forEach(t,o=>{v.isValidElement(o)&&e(o,n++)})}function M1(t,e){return v.Children.toArray(t).some(n=>v.isValidElement(n)&&n.type===e)}function F1({as:t,bsPrefix:e,className:n,...o}){e=Pe(e,"col");const i=zx(),l=Bx(),c=[],p=[];return i.forEach(h=>{const f=o[h];delete o[h];let y,w,S;typeof f=="object"&&f!=null?{span:y,offset:w,order:S}=f:y=f;const C=h!==l?`-${h}`:"";y&&c.push(y===!0?`${e}${C}`:`${e}${C}-${y}`),S!=null&&p.push(`order${C}-${S}`),w!=null&&p.push(`offset${C}-${w}`)}),[{...o,className:Te(n,...c,...p)},{as:t,bsPrefix:e,spans:c}]}const Us=v.forwardRef((t,e)=>{const[{className:n,...o},{as:i="div",bsPrefix:l,spans:c}]=F1(t);return u.jsx(i,{...o,ref:e,className:Te(n,!c.length&&l)})});Us.displayName="Col";var D1=Function.prototype.bind.call(Function.prototype.call,[].slice);function cs(t,e){return D1(t.querySelectorAll(e))}function f0(t,e,n){const o=v.useRef(t!==void 0),[i,l]=v.useState(e),c=t!==void 0,p=o.current;return o.current=c,!c&&p&&i!==e&&l(e),[c?t:i,v.useCallback((...h)=>{const[f,...y]=h;let w=n==null?void 0:n(f,...y);return l(f),w},[n])]}function p0(){const[,t]=v.useReducer(e=>!e,!1);return t}const Uc=v.createContext(null);var Tv=Object.prototype.hasOwnProperty;function Nv(t,e,n){for(n of t.keys())if(pl(n,e))return n}function pl(t,e){var n,o,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((o=t.length)===e.length)for(;o--&&pl(t[o],e[o]););return o===-1}if(n===Set){if(t.size!==e.size)return!1;for(o of t)if(i=o,i&&typeof i=="object"&&(i=Nv(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(o of t)if(i=o[0],i&&typeof i=="object"&&(i=Nv(e,i),!i)||!pl(o[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((o=t.byteLength)===e.byteLength)for(;o--&&t.getInt8(o)===e.getInt8(o););return o===-1}if(ArrayBuffer.isView(t)){if((o=t.byteLength)===e.byteLength)for(;o--&&t[o]===e[o];);return o===-1}if(!n||typeof t=="object"){o=0;for(n in t)if(Tv.call(t,n)&&++o&&!Tv.call(e,n)||!(n in e)||!pl(t[n],e[n]))return!1;return Object.keys(e).length===o}}return t!==t&&e!==e}function _1(t){const e=hh();return[t[0],v.useCallback(n=>{if(e())return t[1](n)},[e,t[1]])]}var zn="top",mr="bottom",gr="right",Bn="left",wh="auto",Dl=[zn,mr,gr,Bn],Qi="start",Sl="end",P1="clippingParents",h0="viewport",il="popper",A1="reference",Ov=Dl.reduce(function(t,e){return t.concat([e+"-"+Qi,e+"-"+Sl])},[]),m0=[].concat(Dl,[wh]).reduce(function(t,e){return t.concat([e,e+"-"+Qi,e+"-"+Sl])},[]),$1="beforeRead",L1="read",z1="afterRead",B1="beforeMain",H1="main",W1="afterMain",V1="beforeWrite",U1="write",G1="afterWrite",q1=[$1,L1,z1,B1,H1,W1,V1,U1,G1];function Hr(t){return t.split("-")[0]}function Xn(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Uo(t){var e=Xn(t).Element;return t instanceof e||t instanceof Element}function Wr(t){var e=Xn(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Sh(t){if(typeof ShadowRoot>"u")return!1;var e=Xn(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}var Bo=Math.max,Rc=Math.min,Xi=Math.round;function Ap(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function g0(){return!/^((?!chrome|android).)*safari/i.test(Ap())}function Ji(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=t.getBoundingClientRect(),i=1,l=1;e&&Wr(t)&&(i=t.offsetWidth>0&&Xi(o.width)/t.offsetWidth||1,l=t.offsetHeight>0&&Xi(o.height)/t.offsetHeight||1);var c=Uo(t)?Xn(t):window,p=c.visualViewport,h=!g0()&&n,f=(o.left+(h&&p?p.offsetLeft:0))/i,y=(o.top+(h&&p?p.offsetTop:0))/l,w=o.width/i,S=o.height/l;return{width:w,height:S,top:y,right:f+w,bottom:y+S,left:f,x:f,y}}function bh(t){var e=Ji(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function v0(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Sh(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function Zs(t){return t?(t.nodeName||"").toLowerCase():null}function ms(t){return Xn(t).getComputedStyle(t)}function K1(t){return["table","td","th"].indexOf(Zs(t))>=0}function Xs(t){return((Uo(t)?t.ownerDocument:t.document)||window.document).documentElement}function Gc(t){return Zs(t)==="html"?t:t.assignedSlot||t.parentNode||(Sh(t)?t.host:null)||Xs(t)}function Rv(t){return!Wr(t)||ms(t).position==="fixed"?null:t.offsetParent}function Z1(t){var e=/firefox/i.test(Ap()),n=/Trident/i.test(Ap());if(n&&Wr(t)){var o=ms(t);if(o.position==="fixed")return null}var i=Gc(t);for(Sh(i)&&(i=i.host);Wr(i)&&["html","body"].indexOf(Zs(i))<0;){var l=ms(i);if(l.transform!=="none"||l.perspective!=="none"||l.contain==="paint"||["transform","perspective"].indexOf(l.willChange)!==-1||e&&l.willChange==="filter"||e&&l.filter&&l.filter!=="none")return i;i=i.parentNode}return null}function _l(t){for(var e=Xn(t),n=Rv(t);n&&K1(n)&&ms(n).position==="static";)n=Rv(n);return n&&(Zs(n)==="html"||Zs(n)==="body"&&ms(n).position==="static")?e:n||Z1(t)||e}function Ch(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function hl(t,e,n){return Bo(t,Rc(e,n))}function Y1(t,e,n){var o=hl(t,e,n);return o>n?n:o}function y0(){return{top:0,right:0,bottom:0,left:0}}function x0(t){return Object.assign({},y0(),t)}function w0(t,e){return e.reduce(function(n,o){return n[o]=t,n},{})}var Q1=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,x0(typeof e!="number"?e:w0(e,Dl))};function X1(t){var e,n=t.state,o=t.name,i=t.options,l=n.elements.arrow,c=n.modifiersData.popperOffsets,p=Hr(n.placement),h=Ch(p),f=[Bn,gr].indexOf(p)>=0,y=f?"height":"width";if(!(!l||!c)){var w=Q1(i.padding,n),S=bh(l),C=h==="y"?zn:Bn,j=h==="y"?mr:gr,N=n.rects.reference[y]+n.rects.reference[h]-c[h]-n.rects.popper[y],E=c[h]-n.rects.reference[h],R=_l(l),I=R?h==="y"?R.clientHeight||0:R.clientWidth||0:0,F=N/2-E/2,L=w[C],P=I-S[y]-w[j],B=I/2-S[y]/2+F,W=hl(L,B,P),X=h;n.modifiersData[o]=(e={},e[X]=W,e.centerOffset=W-B,e)}}function J1(t){var e=t.state,n=t.options,o=n.element,i=o===void 0?"[data-popper-arrow]":o;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||v0(e.elements.popper,i)&&(e.elements.arrow=i))}const ej={name:"arrow",enabled:!0,phase:"main",fn:X1,effect:J1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ea(t){return t.split("-")[1]}var tj={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nj(t,e){var n=t.x,o=t.y,i=e.devicePixelRatio||1;return{x:Xi(n*i)/i||0,y:Xi(o*i)/i||0}}function Iv(t){var e,n=t.popper,o=t.popperRect,i=t.placement,l=t.variation,c=t.offsets,p=t.position,h=t.gpuAcceleration,f=t.adaptive,y=t.roundOffsets,w=t.isFixed,S=c.x,C=S===void 0?0:S,j=c.y,N=j===void 0?0:j,E=typeof y=="function"?y({x:C,y:N}):{x:C,y:N};C=E.x,N=E.y;var R=c.hasOwnProperty("x"),I=c.hasOwnProperty("y"),F=Bn,L=zn,P=window;if(f){var B=_l(n),W="clientHeight",X="clientWidth";if(B===Xn(n)&&(B=Xs(n),ms(B).position!=="static"&&p==="absolute"&&(W="scrollHeight",X="scrollWidth")),B=B,i===zn||(i===Bn||i===gr)&&l===Sl){L=mr;var re=w&&B===P&&P.visualViewport?P.visualViewport.height:B[W];N-=re-o.height,N*=h?1:-1}if(i===Bn||(i===zn||i===mr)&&l===Sl){F=gr;var ce=w&&B===P&&P.visualViewport?P.visualViewport.width:B[X];C-=ce-o.width,C*=h?1:-1}}var ie=Object.assign({position:p},f&&tj),Oe=y===!0?nj({x:C,y:N},Xn(n)):{x:C,y:N};if(C=Oe.x,N=Oe.y,h){var be;return Object.assign({},ie,(be={},be[L]=I?"0":"",be[F]=R?"0":"",be.transform=(P.devicePixelRatio||1)<=1?"translate("+C+"px, "+N+"px)":"translate3d("+C+"px, "+N+"px, 0)",be))}return Object.assign({},ie,(e={},e[L]=I?N+"px":"",e[F]=R?C+"px":"",e.transform="",e))}function rj(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=o===void 0?!0:o,l=n.adaptive,c=l===void 0?!0:l,p=n.roundOffsets,h=p===void 0?!0:p,f={placement:Hr(e.placement),variation:ea(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Iv(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:c,roundOffsets:h})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Iv(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:h})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const sj={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:rj,data:{}};var rc={passive:!0};function oj(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,l=i===void 0?!0:i,c=o.resize,p=c===void 0?!0:c,h=Xn(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return l&&f.forEach(function(y){y.addEventListener("scroll",n.update,rc)}),p&&h.addEventListener("resize",n.update,rc),function(){l&&f.forEach(function(y){y.removeEventListener("scroll",n.update,rc)}),p&&h.removeEventListener("resize",n.update,rc)}}const ij={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:oj,data:{}};var aj={left:"right",right:"left",bottom:"top",top:"bottom"};function wc(t){return t.replace(/left|right|bottom|top/g,function(e){return aj[e]})}var lj={start:"end",end:"start"};function Mv(t){return t.replace(/start|end/g,function(e){return lj[e]})}function jh(t){var e=Xn(t),n=e.pageXOffset,o=e.pageYOffset;return{scrollLeft:n,scrollTop:o}}function Eh(t){return Ji(Xs(t)).left+jh(t).scrollLeft}function uj(t,e){var n=Xn(t),o=Xs(t),i=n.visualViewport,l=o.clientWidth,c=o.clientHeight,p=0,h=0;if(i){l=i.width,c=i.height;var f=g0();(f||!f&&e==="fixed")&&(p=i.offsetLeft,h=i.offsetTop)}return{width:l,height:c,x:p+Eh(t),y:h}}function cj(t){var e,n=Xs(t),o=jh(t),i=(e=t.ownerDocument)==null?void 0:e.body,l=Bo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),c=Bo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),p=-o.scrollLeft+Eh(t),h=-o.scrollTop;return ms(i||n).direction==="rtl"&&(p+=Bo(n.clientWidth,i?i.clientWidth:0)-l),{width:l,height:c,x:p,y:h}}function kh(t){var e=ms(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function S0(t){return["html","body","#document"].indexOf(Zs(t))>=0?t.ownerDocument.body:Wr(t)&&kh(t)?t:S0(Gc(t))}function ml(t,e){var n;e===void 0&&(e=[]);var o=S0(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),l=Xn(o),c=i?[l].concat(l.visualViewport||[],kh(o)?o:[]):o,p=e.concat(c);return i?p:p.concat(ml(Gc(c)))}function $p(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function dj(t,e){var n=Ji(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Fv(t,e,n){return e===h0?$p(uj(t,n)):Uo(e)?dj(e,n):$p(cj(Xs(t)))}function fj(t){var e=ml(Gc(t)),n=["absolute","fixed"].indexOf(ms(t).position)>=0,o=n&&Wr(t)?_l(t):t;return Uo(o)?e.filter(function(i){return Uo(i)&&v0(i,o)&&Zs(i)!=="body"}):[]}function pj(t,e,n,o){var i=e==="clippingParents"?fj(t):[].concat(e),l=[].concat(i,[n]),c=l[0],p=l.reduce(function(h,f){var y=Fv(t,f,o);return h.top=Bo(y.top,h.top),h.right=Rc(y.right,h.right),h.bottom=Rc(y.bottom,h.bottom),h.left=Bo(y.left,h.left),h},Fv(t,c,o));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function b0(t){var e=t.reference,n=t.element,o=t.placement,i=o?Hr(o):null,l=o?ea(o):null,c=e.x+e.width/2-n.width/2,p=e.y+e.height/2-n.height/2,h;switch(i){case zn:h={x:c,y:e.y-n.height};break;case mr:h={x:c,y:e.y+e.height};break;case gr:h={x:e.x+e.width,y:p};break;case Bn:h={x:e.x-n.width,y:p};break;default:h={x:e.x,y:e.y}}var f=i?Ch(i):null;if(f!=null){var y=f==="y"?"height":"width";switch(l){case Qi:h[f]=h[f]-(e[y]/2-n[y]/2);break;case Sl:h[f]=h[f]+(e[y]/2-n[y]/2);break}}return h}function bl(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=o===void 0?t.placement:o,l=n.strategy,c=l===void 0?t.strategy:l,p=n.boundary,h=p===void 0?P1:p,f=n.rootBoundary,y=f===void 0?h0:f,w=n.elementContext,S=w===void 0?il:w,C=n.altBoundary,j=C===void 0?!1:C,N=n.padding,E=N===void 0?0:N,R=x0(typeof E!="number"?E:w0(E,Dl)),I=S===il?A1:il,F=t.rects.popper,L=t.elements[j?I:S],P=pj(Uo(L)?L:L.contextElement||Xs(t.elements.popper),h,y,c),B=Ji(t.elements.reference),W=b0({reference:B,element:F,placement:i}),X=$p(Object.assign({},F,W)),re=S===il?X:B,ce={top:P.top-re.top+R.top,bottom:re.bottom-P.bottom+R.bottom,left:P.left-re.left+R.left,right:re.right-P.right+R.right},ie=t.modifiersData.offset;if(S===il&&ie){var Oe=ie[i];Object.keys(ce).forEach(function(be){var De=[gr,mr].indexOf(be)>=0?1:-1,ae=[zn,mr].indexOf(be)>=0?"y":"x";ce[be]+=Oe[ae]*De})}return ce}function hj(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=n.boundary,l=n.rootBoundary,c=n.padding,p=n.flipVariations,h=n.allowedAutoPlacements,f=h===void 0?m0:h,y=ea(o),w=y?p?Ov:Ov.filter(function(j){return ea(j)===y}):Dl,S=w.filter(function(j){return f.indexOf(j)>=0});S.length===0&&(S=w);var C=S.reduce(function(j,N){return j[N]=bl(t,{placement:N,boundary:i,rootBoundary:l,padding:c})[Hr(N)],j},{});return Object.keys(C).sort(function(j,N){return C[j]-C[N]})}function mj(t){if(Hr(t)===wh)return[];var e=wc(t);return[Mv(t),e,Mv(e)]}function gj(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var i=n.mainAxis,l=i===void 0?!0:i,c=n.altAxis,p=c===void 0?!0:c,h=n.fallbackPlacements,f=n.padding,y=n.boundary,w=n.rootBoundary,S=n.altBoundary,C=n.flipVariations,j=C===void 0?!0:C,N=n.allowedAutoPlacements,E=e.options.placement,R=Hr(E),I=R===E,F=h||(I||!j?[wc(E)]:mj(E)),L=[E].concat(F).reduce(function(We,Je){return We.concat(Hr(Je)===wh?hj(e,{placement:Je,boundary:y,rootBoundary:w,padding:f,flipVariations:j,allowedAutoPlacements:N}):Je)},[]),P=e.rects.reference,B=e.rects.popper,W=new Map,X=!0,re=L[0],ce=0;ce=0,ae=De?"width":"height",Ae=bl(e,{placement:ie,boundary:y,rootBoundary:w,altBoundary:S,padding:f}),Me=De?be?gr:Bn:be?mr:zn;P[ae]>B[ae]&&(Me=wc(Me));var J=wc(Me),Ee=[];if(l&&Ee.push(Ae[Oe]<=0),p&&Ee.push(Ae[Me]<=0,Ae[J]<=0),Ee.every(function(We){return We})){re=ie,X=!1;break}W.set(ie,Ee)}if(X)for(var _=j?3:1,Q=function(Je){var tt=L.find(function(at){var nt=W.get(at);if(nt)return nt.slice(0,Je).every(function(Ct){return Ct})});if(tt)return re=tt,"break"},Se=_;Se>0;Se--){var Ve=Q(Se);if(Ve==="break")break}e.placement!==re&&(e.modifiersData[o]._skip=!0,e.placement=re,e.reset=!0)}}const vj={name:"flip",enabled:!0,phase:"main",fn:gj,requiresIfExists:["offset"],data:{_skip:!1}};function Dv(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _v(t){return[zn,gr,mr,Bn].some(function(e){return t[e]>=0})}function yj(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,l=e.modifiersData.preventOverflow,c=bl(e,{elementContext:"reference"}),p=bl(e,{altBoundary:!0}),h=Dv(c,o),f=Dv(p,i,l),y=_v(h),w=_v(f);e.modifiersData[n]={referenceClippingOffsets:h,popperEscapeOffsets:f,isReferenceHidden:y,hasPopperEscaped:w},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":y,"data-popper-escaped":w})}const xj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:yj};function wj(t,e,n){var o=Hr(t),i=[Bn,zn].indexOf(o)>=0?-1:1,l=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,c=l[0],p=l[1];return c=c||0,p=(p||0)*i,[Bn,gr].indexOf(o)>=0?{x:p,y:c}:{x:c,y:p}}function Sj(t){var e=t.state,n=t.options,o=t.name,i=n.offset,l=i===void 0?[0,0]:i,c=m0.reduce(function(y,w){return y[w]=wj(w,e.rects,l),y},{}),p=c[e.placement],h=p.x,f=p.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=h,e.modifiersData.popperOffsets.y+=f),e.modifiersData[o]=c}const bj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Sj};function Cj(t){var e=t.state,n=t.name;e.modifiersData[n]=b0({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const jj={name:"popperOffsets",enabled:!0,phase:"read",fn:Cj,data:{}};function Ej(t){return t==="x"?"y":"x"}function kj(t){var e=t.state,n=t.options,o=t.name,i=n.mainAxis,l=i===void 0?!0:i,c=n.altAxis,p=c===void 0?!1:c,h=n.boundary,f=n.rootBoundary,y=n.altBoundary,w=n.padding,S=n.tether,C=S===void 0?!0:S,j=n.tetherOffset,N=j===void 0?0:j,E=bl(e,{boundary:h,rootBoundary:f,padding:w,altBoundary:y}),R=Hr(e.placement),I=ea(e.placement),F=!I,L=Ch(R),P=Ej(L),B=e.modifiersData.popperOffsets,W=e.rects.reference,X=e.rects.popper,re=typeof N=="function"?N(Object.assign({},e.rects,{placement:e.placement})):N,ce=typeof re=="number"?{mainAxis:re,altAxis:re}:Object.assign({mainAxis:0,altAxis:0},re),ie=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Oe={x:0,y:0};if(B){if(l){var be,De=L==="y"?zn:Bn,ae=L==="y"?mr:gr,Ae=L==="y"?"height":"width",Me=B[L],J=Me+E[De],Ee=Me-E[ae],_=C?-X[Ae]/2:0,Q=I===Qi?W[Ae]:X[Ae],Se=I===Qi?-X[Ae]:-W[Ae],Ve=e.elements.arrow,We=C&&Ve?bh(Ve):{width:0,height:0},Je=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:y0(),tt=Je[De],at=Je[ae],nt=hl(0,W[Ae],We[Ae]),Ct=F?W[Ae]/2-_-nt-tt-ce.mainAxis:Q-nt-tt-ce.mainAxis,jn=F?-W[Ae]/2+_+nt+at+ce.mainAxis:Se+nt+at+ce.mainAxis,Yt=e.elements.arrow&&_l(e.elements.arrow),Hn=Yt?L==="y"?Yt.clientTop||0:Yt.clientLeft||0:0,en=(be=ie==null?void 0:ie[L])!=null?be:0,cn=Me+Ct-en-Hn,xt=Me+jn-en,Nn=hl(C?Rc(J,cn):J,Me,C?Bo(Ee,xt):Ee);B[L]=Nn,Oe[L]=Nn-Me}if(p){var yn,Ir=L==="x"?zn:Bn,Wn=L==="x"?mr:gr,tn=B[P],dn=P==="y"?"height":"width",G=tn+E[Ir],Ce=tn-E[Wn],Ie=[zn,Bn].indexOf(R)!==-1,de=(yn=ie==null?void 0:ie[P])!=null?yn:0,Ge=Ie?G:tn-W[dn]-X[dn]-de+ce.altAxis,lt=Ie?tn+W[dn]+X[dn]-de-ce.altAxis:Ce,Nt=C&&Ie?Y1(Ge,tn,lt):hl(C?Ge:G,tn,C?lt:Ce);B[P]=Nt,Oe[P]=Nt-tn}e.modifiersData[o]=Oe}}const Tj={name:"preventOverflow",enabled:!0,phase:"main",fn:kj,requiresIfExists:["offset"]};function Nj(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Oj(t){return t===Xn(t)||!Wr(t)?jh(t):Nj(t)}function Rj(t){var e=t.getBoundingClientRect(),n=Xi(e.width)/t.offsetWidth||1,o=Xi(e.height)/t.offsetHeight||1;return n!==1||o!==1}function Ij(t,e,n){n===void 0&&(n=!1);var o=Wr(e),i=Wr(e)&&Rj(e),l=Xs(e),c=Ji(t,i,n),p={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!n)&&((Zs(e)!=="body"||kh(l))&&(p=Oj(e)),Wr(e)?(h=Ji(e,!0),h.x+=e.clientLeft,h.y+=e.clientTop):l&&(h.x=Eh(l))),{x:c.left+p.scrollLeft-h.x,y:c.top+p.scrollTop-h.y,width:c.width,height:c.height}}function Mj(t){var e=new Map,n=new Set,o=[];t.forEach(function(l){e.set(l.name,l)});function i(l){n.add(l.name);var c=[].concat(l.requires||[],l.requiresIfExists||[]);c.forEach(function(p){if(!n.has(p)){var h=e.get(p);h&&i(h)}}),o.push(l)}return t.forEach(function(l){n.has(l.name)||i(l)}),o}function Fj(t){var e=Mj(t);return q1.reduce(function(n,o){return n.concat(e.filter(function(i){return i.phase===o}))},[])}function Dj(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function _j(t){var e=t.reduce(function(n,o){var i=n[o.name];return n[o.name]=i?Object.assign({},i,o,{options:Object.assign({},i.options,o.options),data:Object.assign({},i.data,o.data)}):o,n},{});return Object.keys(e).map(function(n){return e[n]})}var Pv={placement:"bottom",modifiers:[],strategy:"absolute"};function Av(){for(var t=arguments.length,e=new Array(t),n=0;n=0)&&(n[i]=t[i]);return n}const zj={name:"applyStyles",enabled:!1,phase:"afterWrite",fn:()=>{}},Bj={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:t})=>()=>{const{reference:e,popper:n}=t.elements;if("removeAttribute"in e){const o=(e.getAttribute("aria-describedby")||"").split(",").filter(i=>i.trim()!==n.id);o.length?e.setAttribute("aria-describedby",o.join(",")):e.removeAttribute("aria-describedby")}},fn:({state:t})=>{var e;const{popper:n,reference:o}=t.elements,i=(e=n.getAttribute("role"))==null?void 0:e.toLowerCase();if(n.id&&i==="tooltip"&&"setAttribute"in o){const l=o.getAttribute("aria-describedby");if(l&&l.split(",").indexOf(n.id)!==-1)return;o.setAttribute("aria-describedby",l?`${l},${n.id}`:n.id)}}},Hj=[];function C0(t,e,n={}){let{enabled:o=!0,placement:i="bottom",strategy:l="absolute",modifiers:c=Hj}=n,p=Lj(n,$j);const h=v.useRef(c),f=v.useRef(),y=v.useCallback(()=>{var E;(E=f.current)==null||E.update()},[]),w=v.useCallback(()=>{var E;(E=f.current)==null||E.forceUpdate()},[]),[S,C]=_1(v.useState({placement:i,update:y,forceUpdate:w,attributes:{},styles:{popper:{},arrow:{}}})),j=v.useMemo(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:E})=>{const R={},I={};Object.keys(E.elements).forEach(F=>{R[F]=E.styles[F],I[F]=E.attributes[F]}),C({state:E,styles:R,attributes:I,update:y,forceUpdate:w,placement:E.placement})}}),[y,w,C]),N=v.useMemo(()=>(pl(h.current,c)||(h.current=c),h.current),[c]);return v.useEffect(()=>{!f.current||!o||f.current.setOptions({placement:i,strategy:l,modifiers:[...N,j,zj]})},[l,i,j,o,N]),v.useEffect(()=>{if(!(!o||t==null||e==null))return f.current=Aj(t,e,Object.assign({},p,{placement:i,strategy:l,modifiers:[...N,Bj,j]})),()=>{f.current!=null&&(f.current.destroy(),f.current=void 0,C(E=>Object.assign({},E,{attributes:{},styles:{popper:{}}})))}},[o,t,e]),S}function Cl(t,e){if(t.contains)return t.contains(e);if(t.compareDocumentPosition)return t===e||!!(t.compareDocumentPosition(e)&16)}var tp,$v;function Wj(){if($v)return tp;$v=1;var t=function(){};return tp=t,tp}var Vj=Wj();const Uj=xs(Vj),Lv=()=>{};function Gj(t){return t.button===0}function qj(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}const Sc=t=>t&&("current"in t?t.current:t),zv={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function j0(t,e=Lv,{disabled:n,clickTrigger:o="click"}={}){const i=v.useRef(!1),l=v.useRef(!1),c=v.useCallback(f=>{const y=Sc(t);Uj(!!y,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),i.current=!y||qj(f)||!Gj(f)||!!Cl(y,f.target)||l.current,l.current=!1},[t]),p=Ht(f=>{const y=Sc(t);y&&Cl(y,f.target)&&(l.current=!0)}),h=Ht(f=>{i.current||e(f)});v.useEffect(()=>{var f,y;if(n||t==null)return;const w=sa(Sc(t)),S=w.defaultView||window;let C=(f=S.event)!=null?f:(y=S.parent)==null?void 0:y.event,j=null;zv[o]&&(j=fs(w,zv[o],p,!0));const N=fs(w,o,c,!0),E=fs(w,o,I=>{if(I===C){C=void 0;return}h(I)});let R=[];return"ontouchstart"in w.documentElement&&(R=[].slice.call(w.body.children).map(I=>fs(I,"mousemove",Lv))),()=>{j==null||j(),N(),E(),R.forEach(I=>I())}},[t,n,o,c,p,h])}function Kj(t){const e={};return Array.isArray(t)?(t==null||t.forEach(n=>{e[n.name]=n}),e):t||e}function Zj(t={}){return Array.isArray(t)?t:Object.keys(t).map(e=>(t[e].name=e,t[e]))}function E0({enabled:t,enableEvents:e,placement:n,flip:o,offset:i,fixed:l,containerPadding:c,arrowElement:p,popperConfig:h={}}){var f,y,w,S,C;const j=Kj(h.modifiers);return Object.assign({},h,{placement:n,enabled:t,strategy:l?"fixed":h.strategy,modifiers:Zj(Object.assign({},j,{eventListeners:{enabled:e,options:(f=j.eventListeners)==null?void 0:f.options},preventOverflow:Object.assign({},j.preventOverflow,{options:c?Object.assign({padding:c},(y=j.preventOverflow)==null?void 0:y.options):(w=j.preventOverflow)==null?void 0:w.options}),offset:{options:Object.assign({offset:i},(S=j.offset)==null?void 0:S.options)},arrow:Object.assign({},j.arrow,{enabled:!!p,options:Object.assign({},(C=j.arrow)==null?void 0:C.options,{element:p})}),flip:Object.assign({enabled:!!o},j.flip)}))})}const Yj=["children"];function Qj(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}const Xj=()=>{};function k0(t={}){const e=v.useContext(Uc),[n,o]=Nc(),i=v.useRef(!1),{flip:l,offset:c,rootCloseEvent:p,fixed:h=!1,placement:f,popperConfig:y={},enableEventListeners:w=!0,usePopper:S=!!e}=t,C=(e==null?void 0:e.show)==null?!!t.show:e.show;C&&!i.current&&(i.current=!0);const j=B=>{e==null||e.toggle(!1,B)},{placement:N,setMenu:E,menuElement:R,toggleElement:I}=e||{},F=C0(I,R,E0({placement:f||N||"bottom-start",enabled:S,enableEvents:w??C,offset:c,flip:l,fixed:h,arrowElement:n,popperConfig:y})),L=Object.assign({ref:E||Xj,"aria-labelledby":I==null?void 0:I.id},F.attributes.popper,{style:F.styles.popper}),P={show:C,placement:N,hasShown:i.current,toggle:e==null?void 0:e.toggle,popper:S?F:null,arrowProps:S?Object.assign({ref:o},F.attributes.arrow,{style:F.styles.arrow}):{}};return j0(R,j,{clickTrigger:p,disabled:!C}),[L,P]}const Jj={usePopper:!0};function Th(t){let{children:e}=t,n=Qj(t,Yj);const[o,i]=k0(n);return u.jsx(u.Fragment,{children:e(o,i)})}Th.displayName="DropdownMenu";Th.defaultProps=Jj;const Nh={prefix:String(Math.round(Math.random()*1e10)),current:0},T0=mt.createContext(Nh),eE=mt.createContext(!1);let tE=!!(typeof window<"u"&&window.document&&window.document.createElement),np=new WeakMap;function nE(t=!1){let e=v.useContext(T0),n=v.useRef(null);if(n.current===null&&!t){var o,i;let l=(i=mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(o=i.ReactCurrentOwner)===null||o===void 0?void 0:o.current;if(l){let c=np.get(l);c==null?np.set(l,{id:e.current,state:l.memoizedState}):l.memoizedState!==c.state&&(e.current=c.id,np.delete(l))}n.current=++e.current}return n.current}function rE(t){let e=v.useContext(T0);e===Nh&&!tE&&console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=nE(!!t),o=`react-aria${e.prefix}`;return t||`${o}-${n}`}function sE(t){let e=mt.useId(),[n]=v.useState(lE()),o=n?"react-aria":`react-aria${Nh.prefix}`;return t||`${o}-${e}`}const N0=typeof mt.useId=="function"?sE:rE;function oE(){return!1}function iE(){return!0}function aE(t){return()=>{}}function lE(){return typeof mt.useSyncExternalStore=="function"?mt.useSyncExternalStore(aE,oE,iE):v.useContext(eE)}const O0=t=>{var e;return((e=t.getAttribute("role"))==null?void 0:e.toLowerCase())==="menu"},Bv=()=>{};function R0(){const t=N0(),{show:e=!1,toggle:n=Bv,setToggle:o,menuElement:i}=v.useContext(Uc)||{},l=v.useCallback(p=>{n(!e,p)},[e,n]),c={id:t,ref:o||Bv,onClick:l,"aria-expanded":!!e};return i&&O0(i)&&(c["aria-haspopup"]=!0),[c,{show:e,toggle:n}]}function I0({children:t}){const[e,n]=R0();return u.jsx(u.Fragment,{children:t(e,n)})}I0.displayName="DropdownToggle";const gs=v.createContext(null),Go=(t,e=null)=>t!=null?String(t):e||null,qc=v.createContext(null);qc.displayName="NavContext";const uE="data-rr-ui-",cE="rrUi";function ia(t){return`${uE}${t}`}function dE(t){return`${cE}${t}`}const fE=["eventKey","disabled","onClick","active","as"];function pE(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}function M0({key:t,href:e,active:n,disabled:o,onClick:i}){const l=v.useContext(gs),c=v.useContext(qc),{activeKey:p}=c||{},h=Go(t,e),f=n==null&&t!=null?Go(p)===h:n;return[{onClick:Ht(w=>{o||(i==null||i(w),l&&!w.isPropagationStopped()&&l(h,w))}),"aria-disabled":o||void 0,"aria-selected":f,[ia("dropdown-item")]:""},{isActive:f}]}const F0=v.forwardRef((t,e)=>{let{eventKey:n,disabled:o,onClick:i,active:l,as:c=gh}=t,p=pE(t,fE);const[h]=M0({key:n,href:p.href,disabled:o,onClick:i,active:l});return u.jsx(c,Object.assign({},p,{ref:e},h))});F0.displayName="DropdownItem";const D0=v.createContext(oa?window:void 0);D0.Provider;function Kc(){return v.useContext(D0)}function Hv(){const t=p0(),e=v.useRef(null),n=v.useCallback(o=>{e.current=o,t()},[t]);return[e,n]}function Pl({defaultShow:t,show:e,onSelect:n,onToggle:o,itemSelector:i=`* [${ia("dropdown-item")}]`,focusFirstItemOnShow:l,placement:c="bottom-start",children:p}){const h=Kc(),[f,y]=f0(e,t,o),[w,S]=Hv(),C=w.current,[j,N]=Hv(),E=j.current,R=Xx(f),I=v.useRef(null),F=v.useRef(!1),L=v.useContext(gs),P=v.useCallback((ie,Oe,be=Oe==null?void 0:Oe.type)=>{y(ie,{originalEvent:Oe,source:be})},[y]),B=Ht((ie,Oe)=>{n==null||n(ie,Oe),P(!1,Oe,"select"),Oe.isPropagationStopped()||L==null||L(ie,Oe)}),W=v.useMemo(()=>({toggle:P,placement:c,show:f,menuElement:C,toggleElement:E,setMenu:S,setToggle:N}),[P,c,f,C,E,S,N]);C&&R&&!f&&(F.current=C.contains(C.ownerDocument.activeElement));const X=Ht(()=>{E&&E.focus&&E.focus()}),re=Ht(()=>{const ie=I.current;let Oe=l;if(Oe==null&&(Oe=w.current&&O0(w.current)?"keyboard":!1),Oe===!1||Oe==="keyboard"&&!/^key.+$/.test(ie))return;const be=cs(w.current,i)[0];be&&be.focus&&be.focus()});v.useEffect(()=>{f?re():F.current&&(F.current=!1,X())},[f,F,X,re]),v.useEffect(()=>{I.current=null});const ce=(ie,Oe)=>{if(!w.current)return null;const be=cs(w.current,i);let De=be.indexOf(ie)+Oe;return De=Math.max(0,Math.min(De,be.length)),be[De]};return g1(v.useCallback(()=>h.document,[h]),"keydown",ie=>{var Oe,be;const{key:De}=ie,ae=ie.target,Ae=(Oe=w.current)==null?void 0:Oe.contains(ae),Me=(be=j.current)==null?void 0:be.contains(ae);if(/input|textarea/i.test(ae.tagName)&&(De===" "||De!=="Escape"&&Ae||De==="Escape"&&ae.type==="search")||!Ae&&!Me||De==="Tab"&&(!w.current||!f))return;I.current=ie.type;const Ee={originalEvent:ie,source:ie.type};switch(De){case"ArrowUp":{const _=ce(ae,-1);_&&_.focus&&_.focus(),ie.preventDefault();return}case"ArrowDown":if(ie.preventDefault(),!f)y(!0,Ee);else{const _=ce(ae,1);_&&_.focus&&_.focus()}return;case"Tab":uh(ae.ownerDocument,"keyup",_=>{var Q;(_.key==="Tab"&&!_.target||!((Q=w.current)!=null&&Q.contains(_.target)))&&y(!1,Ee)},{once:!0});break;case"Escape":De==="Escape"&&(ie.preventDefault(),ie.stopPropagation()),y(!1,Ee);break}}),u.jsx(gs.Provider,{value:B,children:u.jsx(Uc.Provider,{value:W,children:p})})}Pl.displayName="Dropdown";Pl.Menu=Th;Pl.Toggle=I0;Pl.Item=F0;const Oh=v.createContext({});Oh.displayName="DropdownContext";const _0=v.forwardRef(({className:t,bsPrefix:e,as:n="hr",role:o="separator",...i},l)=>(e=Pe(e,"dropdown-divider"),u.jsx(n,{ref:l,className:Te(t,e),role:o,...i})));_0.displayName="DropdownDivider";const P0=v.forwardRef(({className:t,bsPrefix:e,as:n="div",role:o="heading",...i},l)=>(e=Pe(e,"dropdown-header"),u.jsx(n,{ref:l,className:Te(t,e),role:o,...i})));P0.displayName="DropdownHeader";const A0=v.forwardRef(({bsPrefix:t,className:e,eventKey:n,disabled:o=!1,onClick:i,active:l,as:c=Vc,...p},h)=>{const f=Pe(t,"dropdown-item"),[y,w]=M0({key:n,href:p.href,disabled:o,onClick:i,active:l});return u.jsx(c,{...p,...y,ref:h,className:Te(e,f,w.isActive&&"active",o&&"disabled")})});A0.displayName="DropdownItem";const $0=v.forwardRef(({className:t,bsPrefix:e,as:n="span",...o},i)=>(e=Pe(e,"dropdown-item-text"),u.jsx(n,{ref:i,className:Te(t,e),...o})));$0.displayName="DropdownItemText";const Zc=v.createContext(null);Zc.displayName="InputGroupContext";const Rh=v.createContext(null);Rh.displayName="NavbarContext";function L0(t,e){return t}function z0(t,e,n){const o=n?"top-end":"top-start",i=n?"top-start":"top-end",l=n?"bottom-end":"bottom-start",c=n?"bottom-start":"bottom-end",p=n?"right-start":"left-start",h=n?"right-end":"left-end",f=n?"left-start":"right-start",y=n?"left-end":"right-end";let w=t?c:l;return e==="up"?w=t?i:o:e==="end"?w=t?y:f:e==="start"?w=t?h:p:e==="down-centered"?w="bottom":e==="up-centered"&&(w="top"),w}const B0=v.forwardRef(({bsPrefix:t,className:e,align:n,rootCloseEvent:o,flip:i=!0,show:l,renderOnMount:c,as:p="div",popperConfig:h,variant:f,...y},w)=>{let S=!1;const C=v.useContext(Rh),j=Pe(t,"dropdown-menu"),{align:N,drop:E,isRTL:R}=v.useContext(Oh);n=n||N;const I=v.useContext(Zc),F=[];if(n)if(typeof n=="object"){const ie=Object.keys(n);if(ie.length){const Oe=ie[0],be=n[Oe];S=be==="start",F.push(`${j}-${Oe}-${be}`)}}else n==="end"&&(S=!0);const L=z0(S,E,R),[P,{hasShown:B,popper:W,show:X,toggle:re}]=k0({flip:i,rootCloseEvent:o,show:l,usePopper:!C&&F.length===0,offset:[0,2],popperConfig:h,placement:L});if(P.ref=Gr(L0(w),P.ref),Oc(()=>{X&&(W==null||W.update())},[X]),!B&&!c&&!I)return null;typeof p!="string"&&(P.show=X,P.close=()=>re==null?void 0:re(!1),P.align=n);let ce=y.style;return W!=null&&W.placement&&(ce={...y.style,...P.style},y["x-placement"]=W.placement),u.jsx(p,{...y,...P,style:ce,...(F.length||C)&&{"data-bs-popper":"static"},className:Te(e,j,X&&"show",S&&`${j}-end`,f&&`${j}-${f}`,...F)})});B0.displayName="DropdownMenu";const H0=v.forwardRef(({bsPrefix:t,split:e,className:n,childBsPrefix:o,as:i=ve,...l},c)=>{const p=Pe(t,"dropdown-toggle"),h=v.useContext(Uc);o!==void 0&&(l.bsPrefix=o);const[f]=R0();return f.ref=Gr(f.ref,L0(c)),u.jsx(i,{className:Te(n,p,e&&`${p}-split`,(h==null?void 0:h.show)&&"show"),...f,...l})});H0.displayName="DropdownToggle";const W0=v.forwardRef((t,e)=>{const{bsPrefix:n,drop:o="down",show:i,className:l,align:c="start",onSelect:p,onToggle:h,focusFirstItemOnShow:f,as:y="div",navbar:w,autoClose:S=!0,...C}=Il(t,{show:"onToggle"}),j=v.useContext(Zc),N=Pe(n,"dropdown"),E=Bc(),R=W=>S===!1?W==="click":S==="inside"?W!=="rootClose":S==="outside"?W!=="select":!0,I=Ht((W,X)=>{X.originalEvent.currentTarget===document&&(X.source!=="keydown"||X.originalEvent.key==="Escape")&&(X.source="rootClose"),R(X.source)&&(h==null||h(W,X))}),L=z0(c==="end",o,E),P=v.useMemo(()=>({align:c,drop:o,isRTL:E}),[c,o,E]),B={down:N,"down-centered":`${N}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return u.jsx(Oh.Provider,{value:P,children:u.jsx(Pl,{placement:L,show:i,onSelect:p,onToggle:I,focusFirstItemOnShow:f,itemSelector:`.${N}-item:not(.disabled):not(:disabled)`,children:j?C.children:u.jsx(y,{...C,ref:e,className:Te(l,i&&"show",B[o])})})})});W0.displayName="Dropdown";const qs=Object.assign(W0,{Toggle:H0,Menu:B0,Item:A0,ItemText:$0,Divider:_0,Header:P0}),hE={type:gn.string,tooltip:gn.bool,as:gn.elementType},Yc=v.forwardRef(({as:t="div",className:e,type:n="valid",tooltip:o=!1,...i},l)=>u.jsx(t,{...i,ref:l,className:Te(e,`${n}-${o?"tooltip":"feedback"}`)}));Yc.displayName="Feedback";Yc.propTypes=hE;const vs=v.createContext({}),Al=v.forwardRef(({id:t,bsPrefix:e,className:n,type:o="checkbox",isValid:i=!1,isInvalid:l=!1,as:c="input",...p},h)=>{const{controlId:f}=v.useContext(vs);return e=Pe(e,"form-check-input"),u.jsx(c,{...p,ref:h,type:o,id:t||f,className:Te(n,e,i&&"is-valid",l&&"is-invalid")})});Al.displayName="FormCheckInput";const Ic=v.forwardRef(({bsPrefix:t,className:e,htmlFor:n,...o},i)=>{const{controlId:l}=v.useContext(vs);return t=Pe(t,"form-check-label"),u.jsx("label",{...o,ref:i,htmlFor:n||l,className:Te(e,t)})});Ic.displayName="FormCheckLabel";const V0=v.forwardRef(({id:t,bsPrefix:e,bsSwitchPrefix:n,inline:o=!1,reverse:i=!1,disabled:l=!1,isValid:c=!1,isInvalid:p=!1,feedbackTooltip:h=!1,feedback:f,feedbackType:y,className:w,style:S,title:C="",type:j="checkbox",label:N,children:E,as:R="input",...I},F)=>{e=Pe(e,"form-check"),n=Pe(n,"form-switch");const{controlId:L}=v.useContext(vs),P=v.useMemo(()=>({controlId:t||L}),[L,t]),B=!E&&N!=null&&N!==!1||M1(E,Ic),W=u.jsx(Al,{...I,type:j==="switch"?"checkbox":j,ref:F,isValid:c,isInvalid:p,disabled:l,as:R});return u.jsx(vs.Provider,{value:P,children:u.jsx("div",{style:S,className:Te(w,B&&e,o&&`${e}-inline`,i&&`${e}-reverse`,j==="switch"&&n),children:E||u.jsxs(u.Fragment,{children:[W,B&&u.jsx(Ic,{title:C,children:N}),f&&u.jsx(Yc,{type:y,tooltip:h,children:f})]})})})});V0.displayName="FormCheck";const Mc=Object.assign(V0,{Input:Al,Label:Ic}),U0=v.forwardRef(({bsPrefix:t,type:e,size:n,htmlSize:o,id:i,className:l,isValid:c=!1,isInvalid:p=!1,plaintext:h,readOnly:f,as:y="input",...w},S)=>{const{controlId:C}=v.useContext(vs);return t=Pe(t,"form-control"),u.jsx(y,{...w,type:e,size:o,ref:S,readOnly:f,id:i||C,className:Te(l,h?`${t}-plaintext`:t,n&&`${t}-${n}`,e==="color"&&`${t}-color`,c&&"is-valid",p&&"is-invalid")})});U0.displayName="FormControl";const mE=Object.assign(U0,{Feedback:Yc}),G0=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"form-floating"),u.jsx(n,{ref:i,className:Te(t,e),...o})));G0.displayName="FormFloating";const Ih=v.forwardRef(({controlId:t,as:e="div",...n},o)=>{const i=v.useMemo(()=>({controlId:t}),[t]);return u.jsx(vs.Provider,{value:i,children:u.jsx(e,{...n,ref:o})})});Ih.displayName="FormGroup";const q0=v.forwardRef(({as:t="label",bsPrefix:e,column:n=!1,visuallyHidden:o=!1,className:i,htmlFor:l,...c},p)=>{const{controlId:h}=v.useContext(vs);e=Pe(e,"form-label");let f="col-form-label";typeof n=="string"&&(f=`${f} ${f}-${n}`);const y=Te(i,e,o&&"visually-hidden",n&&f);return l=l||h,n?u.jsx(Us,{ref:p,as:"label",className:y,htmlFor:l,...c}):u.jsx(t,{ref:p,className:y,htmlFor:l,...c})});q0.displayName="FormLabel";const K0=v.forwardRef(({bsPrefix:t,className:e,id:n,...o},i)=>{const{controlId:l}=v.useContext(vs);return t=Pe(t,"form-range"),u.jsx("input",{...o,type:"range",ref:i,className:Te(e,t),id:n||l})});K0.displayName="FormRange";const Z0=v.forwardRef(({bsPrefix:t,size:e,htmlSize:n,className:o,isValid:i=!1,isInvalid:l=!1,id:c,...p},h)=>{const{controlId:f}=v.useContext(vs);return t=Pe(t,"form-select"),u.jsx("select",{...p,size:n,ref:h,className:Te(o,t,e&&`${t}-${e}`,i&&"is-valid",l&&"is-invalid"),id:c||f})});Z0.displayName="FormSelect";const Y0=v.forwardRef(({bsPrefix:t,className:e,as:n="small",muted:o,...i},l)=>(t=Pe(t,"form-text"),u.jsx(n,{...i,ref:l,className:Te(e,t,o&&"text-muted")})));Y0.displayName="FormText";const Q0=v.forwardRef((t,e)=>u.jsx(Mc,{...t,ref:e,type:"switch"}));Q0.displayName="Switch";const gE=Object.assign(Q0,{Input:Mc.Input,Label:Mc.Label}),X0=v.forwardRef(({bsPrefix:t,className:e,children:n,controlId:o,label:i,...l},c)=>(t=Pe(t,"form-floating"),u.jsxs(Ih,{ref:c,className:Te(e,t),controlId:o,...l,children:[n,u.jsx("label",{htmlFor:o,children:i})]})));X0.displayName="FloatingLabel";const vE={_ref:gn.any,validated:gn.bool,as:gn.elementType},Mh=v.forwardRef(({className:t,validated:e,as:n="form",...o},i)=>u.jsx(n,{...o,ref:i,className:Te(t,e&&"was-validated")}));Mh.displayName="Form";Mh.propTypes=vE;const ue=Object.assign(Mh,{Group:Ih,Control:mE,Floating:G0,Check:Mc,Switch:gE,Label:q0,Text:Y0,Range:K0,Select:Z0,FloatingLabel:X0}),Qc=v.forwardRef(({className:t,bsPrefix:e,as:n="span",...o},i)=>(e=Pe(e,"input-group-text"),u.jsx(n,{ref:i,className:Te(t,e),...o})));Qc.displayName="InputGroupText";const yE=t=>u.jsx(Qc,{children:u.jsx(Al,{type:"checkbox",...t})}),xE=t=>u.jsx(Qc,{children:u.jsx(Al,{type:"radio",...t})}),J0=v.forwardRef(({bsPrefix:t,size:e,hasValidation:n,className:o,as:i="div",...l},c)=>{t=Pe(t,"input-group");const p=v.useMemo(()=>({}),[]);return u.jsx(Zc.Provider,{value:p,children:u.jsx(i,{ref:c,...l,className:Te(o,t,e&&`${t}-${e}`,n&&"has-validation")})})});J0.displayName="InputGroup";const Lp=Object.assign(J0,{Text:Qc,Radio:xE,Checkbox:yE}),aa=v.createContext(null),wE=["as","active","eventKey"];function SE(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}function ew({key:t,onClick:e,active:n,id:o,role:i,disabled:l}){const c=v.useContext(gs),p=v.useContext(qc),h=v.useContext(aa);let f=n;const y={role:i};if(p){!i&&p.role==="tablist"&&(y.role="tab");const w=p.getControllerId(t??null),S=p.getControlledId(t??null);y[ia("event-key")]=t,y.id=w||o,f=n==null&&t!=null?p.activeKey===t:n,(f||!(h!=null&&h.unmountOnExit)&&!(h!=null&&h.mountOnEnter))&&(y["aria-controls"]=S)}return y.role==="tab"&&(y["aria-selected"]=f,f||(y.tabIndex=-1),l&&(y.tabIndex=-1,y["aria-disabled"]=!0)),y.onClick=Ht(w=>{l||(e==null||e(w),t!=null&&c&&!w.isPropagationStopped()&&c(t,w))}),[y,{isActive:f}]}const tw=v.forwardRef((t,e)=>{let{as:n=gh,active:o,eventKey:i}=t,l=SE(t,wE);const[c,p]=ew(Object.assign({key:Go(i,l.href),active:o},l));return c[ia("active")]=p.isActive,u.jsx(n,Object.assign({},l,c,{ref:e}))});tw.displayName="NavItem";const bE=["as","onSelect","activeKey","role","onKeyDown"];function CE(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}const Wv=()=>{},Vv=ia("event-key"),nw=v.forwardRef((t,e)=>{let{as:n="div",onSelect:o,activeKey:i,role:l,onKeyDown:c}=t,p=CE(t,bE);const h=p0(),f=v.useRef(!1),y=v.useContext(gs),w=v.useContext(aa);let S,C;w&&(l=l||"tablist",i=w.activeKey,S=w.getControlledId,C=w.getControllerId);const j=v.useRef(null),N=F=>{const L=j.current;if(!L)return null;const P=cs(L,`[${Vv}]:not([aria-disabled=true])`),B=L.querySelector("[aria-selected=true]");if(!B||B!==document.activeElement)return null;const W=P.indexOf(B);if(W===-1)return null;let X=W+F;return X>=P.length&&(X=0),X<0&&(X=P.length-1),P[X]},E=(F,L)=>{F!=null&&(o==null||o(F,L),y==null||y(F,L))},R=F=>{if(c==null||c(F),!w)return;let L;switch(F.key){case"ArrowLeft":case"ArrowUp":L=N(-1);break;case"ArrowRight":case"ArrowDown":L=N(1);break;default:return}L&&(F.preventDefault(),E(L.dataset[dE("EventKey")]||null,F),f.current=!0,h())};v.useEffect(()=>{if(j.current&&f.current){const F=j.current.querySelector(`[${Vv}][aria-selected=true]`);F==null||F.focus()}f.current=!1});const I=Gr(e,j);return u.jsx(gs.Provider,{value:E,children:u.jsx(qc.Provider,{value:{role:l,activeKey:Go(i),getControlledId:S||Wv,getControllerId:C||Wv},children:u.jsx(n,Object.assign({},p,{onKeyDown:R,ref:I,role:l}))})})});nw.displayName="Nav";const jE=Object.assign(nw,{Item:tw});var sc;function Uv(t){if((!sc&&sc!==0||t)&&oa){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),sc=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return sc}function rp(t){t===void 0&&(t=sa());try{var e=t.activeElement;return!e||!e.nodeName?null:e}catch{return t.body}}function EE(t=document){const e=t.defaultView;return Math.abs(e.innerWidth-t.documentElement.clientWidth)}const Gv=ia("modal-open");class Fh{constructor({ownerDocument:e,handleContainerOverflow:n=!0,isRTL:o=!1}={}){this.handleContainerOverflow=n,this.isRTL=o,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return EE(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const n={overflow:"hidden"},o=this.isRTL?"paddingLeft":"paddingRight",i=this.getElement();e.style={overflow:i.style.overflow,[o]:i.style[o]},e.scrollBarWidth&&(n[o]=`${parseInt(ps(i,o)||"0",10)+e.scrollBarWidth}px`),i.setAttribute(Gv,""),ps(i,n)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){const n=this.getElement();n.removeAttribute(Gv),Object.assign(n.style,e.style)}add(e){let n=this.modals.indexOf(e);return n!==-1||(n=this.modals.length,this.modals.push(e),this.setModalAttributes(e),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(e){const n=this.modals.indexOf(e);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}const sp=(t,e)=>oa?t==null?(e||sa()).body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),t&&("nodeType"in t||t.getBoundingClientRect)?t:null):null;function zp(t,e){const n=Kc(),[o,i]=v.useState(()=>sp(t,n==null?void 0:n.document));if(!o){const l=sp(t);l&&i(l)}return v.useEffect(()=>{},[e,o]),v.useEffect(()=>{const l=sp(t);l!==o&&i(l)},[t,o]),o}function Dh({children:t,in:e,onExited:n,mountOnEnter:o,unmountOnExit:i}){const l=v.useRef(null),c=v.useRef(e),p=Ht(n);v.useEffect(()=>{e?c.current=!0:p(l.current)},[e,p]);const h=Gr(l,t.ref),f=v.cloneElement(t,{ref:h});return e?f:i||!c.current&&o?null:f}function kE({in:t,onTransition:e}){const n=v.useRef(null),o=v.useRef(!0),i=Ht(e);return Oc(()=>{if(!n.current)return;let l=!1;return i({in:t,element:n.current,initial:o.current,isStale:()=>l}),()=>{l=!0}},[t,i]),Oc(()=>(o.current=!1,()=>{o.current=!0}),[]),n}function TE({children:t,in:e,onExited:n,onEntered:o,transition:i}){const[l,c]=v.useState(!e);e&&l&&c(!1);const p=kE({in:!!e,onTransition:f=>{const y=()=>{f.isStale()||(f.in?o==null||o(f.element,f.initial):(c(!0),n==null||n(f.element)))};Promise.resolve(i(f)).then(y,w=>{throw f.in||c(!0),w})}}),h=Gr(p,t.ref);return l&&!e?null:v.cloneElement(t,{ref:h})}function Bp(t,e,n){return t?u.jsx(t,Object.assign({},n)):e?u.jsx(TE,Object.assign({},n,{transition:e})):u.jsx(Dh,Object.assign({},n))}function rw(t){return t.code==="Escape"||t.keyCode===27}const NE=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function OE(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}let op;function RE(t){return op||(op=new Fh({ownerDocument:t==null?void 0:t.document})),op}function IE(t){const e=Kc(),n=t||RE(e),o=v.useRef({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:v.useCallback(i=>{o.current.dialog=i},[]),setBackdropRef:v.useCallback(i=>{o.current.backdrop=i},[])})}const sw=v.forwardRef((t,e)=>{let{show:n=!1,role:o="dialog",className:i,style:l,children:c,backdrop:p=!0,keyboard:h=!0,onBackdropClick:f,onEscapeKeyDown:y,transition:w,runTransition:S,backdropTransition:C,runBackdropTransition:j,autoFocus:N=!0,enforceFocus:E=!0,restoreFocus:R=!0,restoreFocusOptions:I,renderDialog:F,renderBackdrop:L=xt=>u.jsx("div",Object.assign({},xt)),manager:P,container:B,onShow:W,onHide:X=()=>{},onExit:re,onExited:ce,onExiting:ie,onEnter:Oe,onEntering:be,onEntered:De}=t,ae=OE(t,NE);const Ae=Kc(),Me=zp(B),J=IE(P),Ee=hh(),_=Xx(n),[Q,Se]=v.useState(!n),Ve=v.useRef(null);v.useImperativeHandle(e,()=>J,[J]),oa&&!_&&n&&(Ve.current=rp(Ae==null?void 0:Ae.document)),n&&Q&&Se(!1);const We=Ht(()=>{if(J.add(),jn.current=fs(document,"keydown",nt),Ct.current=fs(document,"focus",()=>setTimeout(tt),!0),W&&W(),N){var xt,Nn;const yn=rp((xt=(Nn=J.dialog)==null?void 0:Nn.ownerDocument)!=null?xt:Ae==null?void 0:Ae.document);J.dialog&&yn&&!Cl(J.dialog,yn)&&(Ve.current=yn,J.dialog.focus())}}),Je=Ht(()=>{if(J.remove(),jn.current==null||jn.current(),Ct.current==null||Ct.current(),R){var xt;(xt=Ve.current)==null||xt.focus==null||xt.focus(I),Ve.current=null}});v.useEffect(()=>{!n||!Me||We()},[n,Me,We]),v.useEffect(()=>{Q&&Je()},[Q,Je]),xh(()=>{Je()});const tt=Ht(()=>{if(!E||!Ee()||!J.isTopModal())return;const xt=rp(Ae==null?void 0:Ae.document);J.dialog&&xt&&!Cl(J.dialog,xt)&&J.dialog.focus()}),at=Ht(xt=>{xt.target===xt.currentTarget&&(f==null||f(xt),p===!0&&X())}),nt=Ht(xt=>{h&&rw(xt)&&J.isTopModal()&&(y==null||y(xt),xt.defaultPrevented||X())}),Ct=v.useRef(),jn=v.useRef(),Yt=(...xt)=>{Se(!0),ce==null||ce(...xt)};if(!Me)return null;const Hn=Object.assign({role:o,ref:J.setDialogRef,"aria-modal":o==="dialog"?!0:void 0},ae,{style:l,className:i,tabIndex:-1});let en=F?F(Hn):u.jsx("div",Object.assign({},Hn,{children:v.cloneElement(c,{role:"document"})}));en=Bp(w,S,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:re,onExiting:ie,onExited:Yt,onEnter:Oe,onEntering:be,onEntered:De,children:en});let cn=null;return p&&(cn=L({ref:J.setBackdropRef,onClick:at}),cn=Bp(C,j,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:cn})),u.jsx(u.Fragment,{children:$o.createPortal(u.jsxs(u.Fragment,{children:[cn,en]}),Me)})});sw.displayName="Modal";const ME=Object.assign(sw,{Manager:Fh});function Hp(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function FE(t,e){t.classList?t.classList.add(e):Hp(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function qv(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function DE(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=qv(t.className,e):t.setAttribute("class",qv(t.className&&t.className.baseVal||"",e))}const Wi={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class _E extends Fh{adjustAndStore(e,n,o){const i=n.style[e];n.dataset[e]=i,ps(n,{[e]:`${parseFloat(ps(n,e))+o}px`})}restore(e,n){const o=n.dataset[e];o!==void 0&&(delete n.dataset[e],ps(n,{[e]:o}))}setContainerStyle(e){super.setContainerStyle(e);const n=this.getElement();if(FE(n,"modal-open"),!e.scrollBarWidth)return;const o=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";cs(n,Wi.FIXED_CONTENT).forEach(l=>this.adjustAndStore(o,l,e.scrollBarWidth)),cs(n,Wi.STICKY_CONTENT).forEach(l=>this.adjustAndStore(i,l,-e.scrollBarWidth)),cs(n,Wi.NAVBAR_TOGGLER).forEach(l=>this.adjustAndStore(i,l,e.scrollBarWidth))}removeContainerStyle(e){super.removeContainerStyle(e);const n=this.getElement();DE(n,"modal-open");const o=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";cs(n,Wi.FIXED_CONTENT).forEach(l=>this.restore(o,l)),cs(n,Wi.STICKY_CONTENT).forEach(l=>this.restore(i,l)),cs(n,Wi.NAVBAR_TOGGLER).forEach(l=>this.restore(i,l))}}let ip;function PE(t){return ip||(ip=new _E(t)),ip}const ow=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"modal-body"),u.jsx(n,{ref:i,className:Te(t,e),...o})));ow.displayName="ModalBody";const iw=v.createContext({onHide(){}}),_h=v.forwardRef(({bsPrefix:t,className:e,contentClassName:n,centered:o,size:i,fullscreen:l,children:c,scrollable:p,...h},f)=>{t=Pe(t,"modal");const y=`${t}-dialog`,w=typeof l=="string"?`${t}-fullscreen-${l}`:`${t}-fullscreen`;return u.jsx("div",{...h,ref:f,className:Te(y,e,i&&`${t}-${i}`,o&&`${y}-centered`,p&&`${y}-scrollable`,l&&w),children:u.jsx("div",{className:Te(`${t}-content`,n),children:c})})});_h.displayName="ModalDialog";const aw=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"modal-footer"),u.jsx(n,{ref:i,className:Te(t,e),...o})));aw.displayName="ModalFooter";const AE=v.forwardRef(({closeLabel:t="Close",closeVariant:e,closeButton:n=!1,onHide:o,children:i,...l},c)=>{const p=v.useContext(iw),h=Ht(()=>{p==null||p.onHide(),o==null||o()});return u.jsxs("div",{ref:c,...l,children:[i,n&&u.jsx(Ko,{"aria-label":t,variant:e,onClick:h})]})}),lw=v.forwardRef(({bsPrefix:t,className:e,closeLabel:n="Close",closeButton:o=!1,...i},l)=>(t=Pe(t,"modal-header"),u.jsx(AE,{ref:l,...i,className:Te(e,t),closeLabel:n,closeButton:o})));lw.displayName="ModalHeader";const $E=Wc("h4"),uw=v.forwardRef(({className:t,bsPrefix:e,as:n=$E,...o},i)=>(e=Pe(e,"modal-title"),u.jsx(n,{ref:i,className:Te(t,e),...o})));uw.displayName="ModalTitle";function LE(t){return u.jsx(hs,{...t,timeout:null})}function zE(t){return u.jsx(hs,{...t,timeout:null})}const cw=v.forwardRef(({bsPrefix:t,className:e,style:n,dialogClassName:o,contentClassName:i,children:l,dialogAs:c=_h,"aria-labelledby":p,"aria-describedby":h,"aria-label":f,show:y=!1,animation:w=!0,backdrop:S=!0,keyboard:C=!0,onEscapeKeyDown:j,onShow:N,onHide:E,container:R,autoFocus:I=!0,enforceFocus:F=!0,restoreFocus:L=!0,restoreFocusOptions:P,onEntered:B,onExit:W,onExiting:X,onEnter:re,onEntering:ce,onExited:ie,backdropClassName:Oe,manager:be,...De},ae)=>{const[Ae,Me]=v.useState({}),[J,Ee]=v.useState(!1),_=v.useRef(!1),Q=v.useRef(!1),Se=v.useRef(null),[Ve,We]=Nc(),Je=Gr(ae,We),tt=Ht(E),at=Bc();t=Pe(t,"modal");const nt=v.useMemo(()=>({onHide:tt}),[tt]);function Ct(){return be||PE({isRTL:at})}function jn(de){if(!oa)return;const Ge=Ct().getScrollbarWidth()>0,lt=de.scrollHeight>sa(de).documentElement.clientHeight;Me({paddingRight:Ge&&!lt?Uv():void 0,paddingLeft:!Ge&<?Uv():void 0})}const Yt=Ht(()=>{Ve&&jn(Ve.dialog)});xh(()=>{Dp(window,"resize",Yt),Se.current==null||Se.current()});const Hn=()=>{_.current=!0},en=de=>{_.current&&Ve&&de.target===Ve.dialog&&(Q.current=!0),_.current=!1},cn=()=>{Ee(!0),Se.current=Wx(Ve.dialog,()=>{Ee(!1)})},xt=de=>{de.target===de.currentTarget&&cn()},Nn=de=>{if(S==="static"){xt(de);return}if(Q.current||de.target!==de.currentTarget){Q.current=!1;return}E==null||E()},yn=de=>{C?j==null||j(de):(de.preventDefault(),S==="static"&&cn())},Ir=(de,Ge)=>{de&&jn(de),re==null||re(de,Ge)},Wn=de=>{Se.current==null||Se.current(),W==null||W(de)},tn=(de,Ge)=>{ce==null||ce(de,Ge),uh(window,"resize",Yt)},dn=de=>{de&&(de.style.display=""),ie==null||ie(de),Dp(window,"resize",Yt)},G=v.useCallback(de=>u.jsx("div",{...de,className:Te(`${t}-backdrop`,Oe,!w&&"show")}),[w,Oe,t]),Ce={...n,...Ae};Ce.display="block";const Ie=de=>u.jsx("div",{role:"dialog",...de,style:Ce,className:Te(e,t,J&&`${t}-static`,!w&&"show"),onClick:S?Nn:void 0,onMouseUp:en,"aria-label":f,"aria-labelledby":p,"aria-describedby":h,children:u.jsx(c,{...De,onMouseDown:Hn,className:o,contentClassName:i,children:l})});return u.jsx(iw.Provider,{value:nt,children:u.jsx(ME,{show:y,ref:Je,backdrop:S,container:R,keyboard:!0,autoFocus:I,enforceFocus:F,restoreFocus:L,restoreFocusOptions:P,onEscapeKeyDown:yn,onShow:N,onHide:E,onEnter:Ir,onEntering:tn,onEntered:B,onExit:Wn,onExiting:X,onExited:dn,manager:Ct(),transition:w?LE:void 0,backdropTransition:w?zE:void 0,renderBackdrop:G,renderDialog:Ie})})});cw.displayName="Modal";const ye=Object.assign(cw,{Body:ow,Header:lw,Title:uw,Footer:aw,Dialog:_h,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150});var oc={exports:{}},ic={exports:{}},Kv;function BE(){return Kv||(Kv=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=n;function n(o){function i(c,p,h,f,y,w){var S=f||"<>",C=w||h;if(p[h]==null)return c?new Error("Required "+y+" `"+C+"` was not specified "+("in `"+S+"`.")):null;for(var j=arguments.length,N=Array(j>6?j-6:0),E=6;E(e=Pe(e,"nav-item"),u.jsx(n,{ref:i,className:Te(t,e),...o})));Ph.displayName="NavItem";const Ah=v.forwardRef(({bsPrefix:t,className:e,as:n=Vc,active:o,eventKey:i,disabled:l=!1,...c},p)=>{t=Pe(t,"nav-link");const[h,f]=ew({key:Go(i,c.href),active:o,disabled:l,...c});return u.jsx(n,{...c,...h,ref:p,disabled:l,className:Te(e,t,l&&"disabled",f.isActive&&"active")})});Ah.displayName="NavLink";const dw=v.forwardRef((t,e)=>{const{as:n="div",bsPrefix:o,variant:i,fill:l=!1,justify:c=!1,navbar:p,navbarScroll:h,className:f,activeKey:y,...w}=Il(t,{activeKey:"onSelect"}),S=Pe(o,"nav");let C,j,N=!1;const E=v.useContext(Rh),R=v.useContext(yh);return E?(C=E.bsPrefix,N=p??!0):R&&({cardHeaderBsPrefix:j}=R),u.jsx(jE,{as:n,ref:e,activeKey:y,className:Te(f,{[S]:!N,[`${C}-nav`]:N,[`${C}-nav-scroll`]:N&&h,[`${j}-${i}`]:!!j,[`${S}-${i}`]:!!i,[`${S}-fill`]:l,[`${S}-justified`]:c}),...w})});dw.displayName="Nav";const WE=Object.assign(dw,{Item:Ph,Link:Ah}),VE=()=>{};function UE(t,e,{disabled:n,clickTrigger:o}={}){const i=e||VE;j0(t,i,{disabled:n,clickTrigger:o});const l=Ht(c=>{rw(c)&&i(c)});v.useEffect(()=>{if(n||t==null)return;const c=sa(Sc(t));let p=(c.defaultView||window).event;const h=fs(c,"keyup",f=>{if(f===p){p=void 0;return}l(f)});return()=>{h()}},[t,n,l])}const fw=v.forwardRef((t,e)=>{const{flip:n,offset:o,placement:i,containerPadding:l,popperConfig:c={},transition:p,runTransition:h}=t,[f,y]=Nc(),[w,S]=Nc(),C=Gr(y,e),j=zp(t.container),N=zp(t.target),[E,R]=v.useState(!t.show),I=C0(N,f,E0({placement:i,enableEvents:!!t.show,containerPadding:l||5,flip:n,offset:o,arrowElement:w,popperConfig:c}));t.show&&E&&R(!1);const F=(...ie)=>{R(!0),t.onExited&&t.onExited(...ie)},L=t.show||!E;if(UE(f,t.onHide,{disabled:!t.rootClose||t.rootCloseDisabled,clickTrigger:t.rootCloseEvent}),!L)return null;const{onExit:P,onExiting:B,onEnter:W,onEntering:X,onEntered:re}=t;let ce=t.children(Object.assign({},I.attributes.popper,{style:I.styles.popper,ref:C}),{popper:I,placement:i,show:!!t.show,arrowProps:Object.assign({},I.attributes.arrow,{style:I.styles.arrow,ref:S})});return ce=Bp(p,h,{in:!!t.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:ce,onExit:P,onExiting:B,onExited:F,onEnter:W,onEntering:X,onEntered:re}),j?$o.createPortal(ce,j):null});fw.displayName="Overlay";const pw=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"popover-header"),u.jsx(n,{ref:i,className:Te(t,e),...o})));pw.displayName="PopoverHeader";const $h=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"popover-body"),u.jsx(n,{ref:i,className:Te(t,e),...o})));$h.displayName="PopoverBody";function hw(t,e){let n=t;return t==="left"?n=e?"end":"start":t==="right"&&(n=e?"start":"end"),n}function mw(t="absolute"){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}const GE=v.forwardRef(({bsPrefix:t,placement:e="right",className:n,style:o,children:i,body:l,arrowProps:c,hasDoneInitialMeasure:p,popper:h,show:f,...y},w)=>{const S=Pe(t,"popover"),C=Bc(),[j]=(e==null?void 0:e.split("-"))||[],N=hw(j,C);let E=o;return f&&!p&&(E={...o,...mw(h==null?void 0:h.strategy)}),u.jsxs("div",{ref:w,role:"tooltip",style:E,"x-placement":j,className:Te(n,S,j&&`bs-popover-${N}`),...y,children:[u.jsx("div",{className:"popover-arrow",...c}),l?u.jsx($h,{children:i}):i]})}),qE=Object.assign(GE,{Header:pw,Body:$h,POPPER_OFFSET:[0,8]}),gw=v.forwardRef(({bsPrefix:t,placement:e="right",className:n,style:o,children:i,arrowProps:l,hasDoneInitialMeasure:c,popper:p,show:h,...f},y)=>{t=Pe(t,"tooltip");const w=Bc(),[S]=(e==null?void 0:e.split("-"))||[],C=hw(S,w);let j=o;return h&&!c&&(j={...o,...mw(p==null?void 0:p.strategy)}),u.jsxs("div",{ref:y,style:j,role:"tooltip","x-placement":S,className:Te(n,t,`bs-tooltip-${C}`),...f,children:[u.jsx("div",{className:"tooltip-arrow",...l}),u.jsx("div",{className:`${t}-inner`,children:i})]})});gw.displayName="Tooltip";const la=Object.assign(gw,{TOOLTIP_OFFSET:[0,6]});function KE(t){const e=v.useRef(null),n=Pe(void 0,"popover"),o=Pe(void 0,"tooltip"),i=v.useMemo(()=>({name:"offset",options:{offset:()=>{if(t)return t;if(e.current){if(Hp(e.current,n))return qE.POPPER_OFFSET;if(Hp(e.current,o))return la.TOOLTIP_OFFSET}return[0,0]}}}),[t,n,o]);return[e,[i]]}function ZE(t,e){const{ref:n}=t,{ref:o}=e;t.ref=n.__wrapped||(n.__wrapped=i=>n(Tc(i))),e.ref=o.__wrapped||(o.__wrapped=i=>o(Tc(i)))}const vw=v.forwardRef(({children:t,transition:e=hs,popperConfig:n={},rootClose:o=!1,placement:i="top",show:l=!1,...c},p)=>{const h=v.useRef({}),[f,y]=v.useState(null),[w,S]=KE(c.offset),C=Gr(p,w),j=e===!0?hs:e||void 0,N=Ht(E=>{y(E),n==null||n.onFirstUpdate==null||n.onFirstUpdate(E)});return Oc(()=>{f&&c.target&&(h.current.scheduleUpdate==null||h.current.scheduleUpdate())},[f,c.target]),v.useEffect(()=>{l||y(null)},[l]),u.jsx(fw,{...c,ref:C,popperConfig:{...n,modifiers:S.concat(n.modifiers||[]),onFirstUpdate:N},transition:j,rootClose:o,placement:i,show:l,children:(E,{arrowProps:R,popper:I,show:F})=>{var L,P;ZE(E,R);const B=I==null?void 0:I.placement,W=Object.assign(h.current,{state:I==null?void 0:I.state,scheduleUpdate:I==null?void 0:I.update,placement:B,outOfBoundaries:(I==null||(L=I.state)==null||(P=L.modifiersData.hide)==null?void 0:P.isReferenceHidden)||!1,strategy:n.strategy}),X=!!f;return typeof t=="function"?t({...E,placement:B,show:F,...!e&&F&&{className:"show"},popper:W,arrowProps:R,hasDoneInitialMeasure:X}):v.cloneElement(t,{...E,placement:B,arrowProps:R,popper:W,hasDoneInitialMeasure:X,className:Te(t.props.className,!e&&F&&"show"),style:{...t.props.style,...E.style}})}})});vw.displayName="Overlay";function YE(t){return t&&typeof t=="object"?t:{show:t,hide:t}}function Yv(t,e,n){const[o]=e,i=o.currentTarget,l=o.relatedTarget||o.nativeEvent[n];(!l||l!==i)&&!Cl(i,l)&&t(...e)}gn.oneOf(["click","hover","focus"]);const $l=({trigger:t=["hover","focus"],overlay:e,children:n,popperConfig:o={},show:i,defaultShow:l=!1,onToggle:c,delay:p,placement:h,flip:f=h&&h.indexOf("auto")!==-1,...y})=>{const w=v.useRef(null),S=Gr(w,n.ref),C=R1(),j=v.useRef(""),[N,E]=Lx(i,l,c),R=YE(p),{onFocus:I,onBlur:F,onClick:L}=typeof n!="function"?v.Children.only(n).props:{},P=ae=>{S(Tc(ae))},B=v.useCallback(()=>{if(C.clear(),j.current="show",!R.show){E(!0);return}C.set(()=>{j.current==="show"&&E(!0)},R.show)},[R.show,E,C]),W=v.useCallback(()=>{if(C.clear(),j.current="hide",!R.hide){E(!1);return}C.set(()=>{j.current==="hide"&&E(!1)},R.hide)},[R.hide,E,C]),X=v.useCallback((...ae)=>{B(),I==null||I(...ae)},[B,I]),re=v.useCallback((...ae)=>{W(),F==null||F(...ae)},[W,F]),ce=v.useCallback((...ae)=>{E(!N),L==null||L(...ae)},[L,E,N]),ie=v.useCallback((...ae)=>{Yv(B,ae,"fromElement")},[B]),Oe=v.useCallback((...ae)=>{Yv(W,ae,"toElement")},[W]),be=t==null?[]:[].concat(t),De={ref:P};return be.indexOf("click")!==-1&&(De.onClick=ce),be.indexOf("focus")!==-1&&(De.onFocus=X,De.onBlur=re),be.indexOf("hover")!==-1&&(De.onMouseOver=ie,De.onMouseOut=Oe),u.jsxs(u.Fragment,{children:[typeof n=="function"?n(De):v.cloneElement(n,De),u.jsx(vw,{...y,show:N,onHide:W,flip:f,placement:h,popperConfig:o,target:w.current,children:e})]})},Qv=1e3;function QE(t,e,n){const o=(t-e)/(n-e)*100;return Math.round(o*Qv)/Qv}function Xv({min:t,now:e,max:n,label:o,visuallyHidden:i,striped:l,animated:c,className:p,style:h,variant:f,bsPrefix:y,...w},S){return u.jsx("div",{ref:S,...w,role:"progressbar",className:Te(p,`${y}-bar`,{[`bg-${f}`]:f,[`${y}-bar-animated`]:c,[`${y}-bar-striped`]:c||l}),style:{width:`${QE(e,t,n)}%`,...h},"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,children:i?u.jsx("span",{className:"visually-hidden",children:o}):o})}const jl=v.forwardRef(({isChild:t=!1,...e},n)=>{const o={min:0,max:100,animated:!1,visuallyHidden:!1,striped:!1,...e};if(o.bsPrefix=Pe(o.bsPrefix,"progress"),t)return Xv(o,n);const{min:i,now:l,max:c,label:p,visuallyHidden:h,striped:f,animated:y,bsPrefix:w,variant:S,className:C,children:j,...N}=o;return u.jsx("div",{ref:n,...N,className:Te(C,w),children:j?Pp(j,E=>v.cloneElement(E,{isChild:!0})):Xv({min:i,now:l,max:c,label:p,visuallyHidden:h,striped:f,animated:y,bsPrefix:w,variant:S},n)})});jl.displayName="ProgressBar";const gl=v.forwardRef(({bsPrefix:t,className:e,as:n="div",...o},i)=>{const l=Pe(t,"row"),c=zx(),p=Bx(),h=`${l}-cols`,f=[];return c.forEach(y=>{const w=o[y];delete o[y];let S;w!=null&&typeof w=="object"?{cols:S}=w:S=w;const C=y!==p?`-${y}`:"";S!=null&&f.push(`${h}${C}-${S}`)}),u.jsx(n,{ref:i,...o,className:Te(e,l,...f)})});gl.displayName="Row";const XE=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],JE=["activeKey","getControlledId","getControllerId"],ek=["as"];function Wp(t,e){if(t==null)return{};var n={},o=Object.keys(t),i,l;for(l=0;l=0)&&(n[i]=t[i]);return n}function yw(t){let{active:e,eventKey:n,mountOnEnter:o,transition:i,unmountOnExit:l,role:c="tabpanel",onEnter:p,onEntering:h,onEntered:f,onExit:y,onExiting:w,onExited:S}=t,C=Wp(t,XE);const j=v.useContext(aa);if(!j)return[Object.assign({},C,{role:c}),{eventKey:n,isActive:e,mountOnEnter:o,transition:i,unmountOnExit:l,onEnter:p,onEntering:h,onEntered:f,onExit:y,onExiting:w,onExited:S}];const{activeKey:N,getControlledId:E,getControllerId:R}=j,I=Wp(j,JE),F=Go(n);return[Object.assign({},C,{role:c,id:E(n),"aria-labelledby":R(n)}),{eventKey:n,isActive:e==null&&F!=null?Go(N)===F:e,transition:i||I.transition,mountOnEnter:o??I.mountOnEnter,unmountOnExit:l??I.unmountOnExit,onEnter:p,onEntering:h,onEntered:f,onExit:y,onExiting:w,onExited:S}]}const xw=v.forwardRef((t,e)=>{let{as:n="div"}=t,o=Wp(t,ek);const[i,{isActive:l,onEnter:c,onEntering:p,onEntered:h,onExit:f,onExiting:y,onExited:w,mountOnEnter:S,unmountOnExit:C,transition:j=Dh}]=yw(o);return u.jsx(aa.Provider,{value:null,children:u.jsx(gs.Provider,{value:null,children:u.jsx(j,{in:l,onEnter:c,onEntering:p,onEntered:h,onExit:f,onExiting:y,onExited:w,mountOnEnter:S,unmountOnExit:C,children:u.jsx(n,Object.assign({},i,{ref:e,hidden:!l,"aria-hidden":!l}))})})})});xw.displayName="TabPanel";const Lh=t=>{const{id:e,generateChildId:n,onSelect:o,activeKey:i,defaultActiveKey:l,transition:c,mountOnEnter:p,unmountOnExit:h,children:f}=t,[y,w]=f0(i,l,o),S=N0(e),C=v.useMemo(()=>n||((N,E)=>S?`${S}-${E}-${N}`:null),[S,n]),j=v.useMemo(()=>({onSelect:w,activeKey:y,transition:c,mountOnEnter:p||!1,unmountOnExit:h||!1,getControlledId:N=>C(N,"tabpane"),getControllerId:N=>C(N,"tab")}),[w,y,c,p,h,C]);return u.jsx(aa.Provider,{value:j,children:u.jsx(gs.Provider,{value:w||null,children:f})})};Lh.Panel=xw;function zh(t){return typeof t=="boolean"?t?hs:Dh:t}const ww=({transition:t,...e})=>u.jsx(Lh,{...e,transition:zh(t)});ww.displayName="TabContainer";const Bh=v.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},i)=>(e=Pe(e,"tab-content"),u.jsx(n,{ref:i,className:Te(t,e),...o})));Bh.displayName="TabContent";const Hh=v.forwardRef(({bsPrefix:t,transition:e,...n},o)=>{const[{className:i,as:l="div",...c},{isActive:p,onEnter:h,onEntering:f,onEntered:y,onExit:w,onExiting:S,onExited:C,mountOnEnter:j,unmountOnExit:N,transition:E=hs}]=yw({...n,transition:zh(e)}),R=Pe(t,"tab-pane");return u.jsx(aa.Provider,{value:null,children:u.jsx(gs.Provider,{value:null,children:u.jsx(E,{in:p,onEnter:h,onEntering:f,onEntered:y,onExit:w,onExiting:S,onExited:C,mountOnEnter:j,unmountOnExit:N,children:u.jsx(l,{...c,ref:o,className:Te(i,R,p&&"active")})})})})});Hh.displayName="TabPane";const tk={eventKey:gn.oneOfType([gn.string,gn.number]),title:gn.node.isRequired,disabled:gn.bool,tabClassName:gn.string,tabAttrs:gn.object},Sw=()=>{throw new Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};Sw.propTypes=tk;const nk=Object.assign(Sw,{Container:ww,Content:Bh,Pane:Hh}),ua=v.forwardRef(({bsPrefix:t,className:e,striped:n,bordered:o,borderless:i,hover:l,size:c,variant:p,responsive:h,...f},y)=>{const w=Pe(t,"table"),S=Te(e,w,p&&`${w}-${p}`,c&&`${w}-${c}`,n&&`${w}-${typeof n=="string"?`striped-${n}`:"striped"}`,o&&`${w}-bordered`,i&&`${w}-borderless`,l&&`${w}-hover`),C=u.jsx("table",{...f,className:S,ref:y});if(h){let j=`${w}-responsive`;return typeof h=="string"&&(j=`${j}-${h}`),u.jsx("div",{className:j,children:C})}return C});function rk(t){let e;return I1(t,n=>{e==null&&(e=n.props.eventKey)}),e}function sk(t){const{title:e,eventKey:n,disabled:o,tabClassName:i,tabAttrs:l,id:c}=t.props;return e==null?null:u.jsx(Ph,{as:"li",role:"presentation",children:u.jsx(Ah,{as:"button",type:"button",eventKey:n,disabled:o,id:c,className:i,...l,children:e})})}const bw=t=>{const{id:e,onSelect:n,transition:o,mountOnEnter:i=!1,unmountOnExit:l=!1,variant:c="tabs",children:p,activeKey:h=rk(p),...f}=Il(t,{activeKey:"onSelect"});return u.jsxs(Lh,{id:e,activeKey:h,onSelect:n,transition:zh(o),mountOnEnter:i,unmountOnExit:l,children:[u.jsx(WE,{...f,role:"tablist",as:"ul",variant:c,children:Pp(p,sk)}),u.jsx(Bh,{children:Pp(p,y=>{const w={...y.props};return delete w.title,delete w.disabled,delete w.tabClassName,delete w.tabAttrs,u.jsx(Hh,{...w})})})]})};bw.displayName="Tabs";const ok=({show:t,onClose:e})=>{const{event:n,setEvent:o,locale:i}=we(),{setConnectedVehicle:l}=Gt(),c=v.useMemo(()=>n.vehicleConnections||[],[n]),[p,h]=v.useState(c[0]||!1);v.useEffect(()=>{h(c[0])},[c]);const f=async()=>{const y=await me("connect-vehicle",{vehicle:p});y&&(o(w=>({...w,...y})),l(p),e())};return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:i.connectVehicle})}),u.jsxs(ye.Body,{children:[u.jsx(ue.Select,{className:"mb-3",value:p?JSON.stringify(p):"DEFAULT",onChange:y=>h(JSON.parse(y.target.value)),children:c.length?c.map((y,w)=>u.jsxs("option",{value:JSON.stringify(y),children:[y.label," (",y.plate,")"]},w)):u.jsx("option",{disabled:!0,value:"DEFAULT",children:i.noNearbyVehicles})}),u.jsxs(ve,{variant:"success",onClick:f,disabled:!p,children:[u.jsx("i",{className:"bi-plug me-1"}),u.jsx("span",{children:i.connect})]})]})]})};function ik(t,e,n){v.useEffect(()=>{if(!document)return;const o=document.querySelector('script[src="'.concat(t,'"]'));if(o!=null&&o.dataset.loaded){e==null||e();return}const i=o||document.createElement("script");o||(i.src=t);const l=()=>{i.dataset.loaded="1",e==null||e()};return i.addEventListener("load",l),n&&i.addEventListener("error",n),o||document.head.append(i),()=>{i.removeEventListener("load",l),n&&i.removeEventListener("error",n)}},[])}function ak(t){let{chartVersion:e="current",chartPackages:n=["corechart","controls"],chartLanguage:o="en",mapsApiKey:i}=t;const[l,c]=v.useState(null),[p,h]=v.useState(!1);return ik("https://www.gstatic.com/charts/loader.js",()=>{const f=window==null?void 0:window.google;f&&(f.charts.load(e,{packages:n,language:o,mapsApiKey:i}),f.charts.setOnLoadCallback(()=>{c(f)}))},()=>{h(!0)}),[l,p]}function lk(t){let{onLoad:e,onError:n,...o}=t;const[i,l]=ak(o);return v.useEffect(()=>{i&&e&&e(i)},[i]),v.useEffect(()=>{l&&n&&n()},[l]),null}const Cw={legend_toggle:!1,options:{},legendToggle:!1,getChartWrapper:()=>{},spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{}};let Jv=0;const uk=()=>(Jv+=1,"reactgooglegraph-".concat(Jv)),ck=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],dk=async function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new Promise((o,i)=>{const l="".concat(n.headers?"headers=".concat(n.headers):"headers=0"),c="".concat(n.query?"&tq=".concat(encodeURIComponent(n.query)):""),p="".concat(n.gid?"&gid=".concat(n.gid):""),h="".concat(n.sheet?"&sheet=".concat(n.sheet):""),f="".concat(n.access_token?"&access_token=".concat(n.access_token):""),y="".concat(l).concat(p).concat(h).concat(c).concat(f),w="".concat(e,"/gviz/tq?").concat(y);new t.visualization.Query(w).send(C=>{C.isError()?i("Error in query: ".concat(C.getMessage()," ").concat(C.getDetailedMessage())):o(C.getDataTable())})})},{Provider:fk,Consumer:pk}=v.createContext(Cw),hk=t=>{let{children:e,value:n}=t;return v.createElement(fk,{value:n},e)},jw=t=>{let{render:e}=t;return v.createElement(pk,null,n=>e(n))},mk="#CCCCCC";class gk extends v.Component{componentDidMount(){this.draw(this.props),window.addEventListener("resize",this.onResize),(this.props.legend_toggle||this.props.legendToggle)&&this.listenToLegendToggle()}componentWillUnmount(){const{google:e,googleChartWrapper:n}=this.props;window.removeEventListener("resize",this.onResize),e.visualization.events.removeAllListeners(n),n.getChartType()==="Timeline"&&n.getChart()&&n.getChart().clearChart()}componentDidUpdate(){this.draw(this.props)}render(){return null}constructor(...e){super(...e),this.state={hiddenColumns:[]},this.listenToLegendToggle=()=>{const{google:n,googleChartWrapper:o}=this.props;n.visualization.events.addListener(o,"select",()=>{const l=o.getChart().getSelection(),c=o.getDataTable();if(l.length===0||l[0].row||!c)return;const p=l[0].column,h=this.getColumnID(c,p);this.state.hiddenColumns.includes(h)?this.setState(f=>({...f,hiddenColumns:[...f.hiddenColumns.filter(y=>y!==h)]})):this.setState(f=>({...f,hiddenColumns:[...f.hiddenColumns,h]}))})},this.applyFormatters=(n,o)=>{const{google:i}=this.props;for(let l of o)switch(l.type){case"ArrowFormat":{new i.visualization.ArrowFormat(l.options).format(n,l.column);break}case"BarFormat":{new i.visualization.BarFormat(l.options).format(n,l.column);break}case"ColorFormat":{const c=new i.visualization.ColorFormat(l.options),{ranges:p}=l;for(let h of p)c.addRange(...h);c.format(n,l.column);break}case"DateFormat":{new i.visualization.DateFormat(l.options).format(n,l.column);break}case"NumberFormat":{new i.visualization.NumberFormat(l.options).format(n,l.column);break}case"PatternFormat":{new i.visualization.PatternFormat(l.options).format(n,l.column);break}}},this.getColumnID=(n,o)=>n.getColumnId(o)||n.getColumnLabel(o),this.draw=async n=>{let{data:o,diffdata:i,rows:l,columns:c,options:p,legend_toggle:h,legendToggle:f,chartType:y,formatters:w,spreadSheetUrl:S,spreadSheetQueryParameters:C}=n;const{google:j,googleChartWrapper:N}=this.props;let E,R=null;if(i){const L=j.visualization.arrayToDataTable(i.old),P=j.visualization.arrayToDataTable(i.new);R=j.visualization[y].prototype.computeDiff(L,P)}o!==null?Array.isArray(o)?E=j.visualization.arrayToDataTable(o):E=new j.visualization.DataTable(o):l&&c?E=j.visualization.arrayToDataTable([c,...l]):S?E=await dk(j,S,C):E=j.visualization.arrayToDataTable([]);const I=E.getNumberOfColumns();for(let L=0;L{let{options:o}=n;const{googleChartWrapper:i}=this.props,l=i.getDataTable();if(!l)return;const c=l.getNumberOfColumns();if(this.state.hiddenColumns.length>0===!1)return;const h=Array.from({length:c-1}).map((f,y)=>{const w=this.getColumnID(l,y+1);return this.state.hiddenColumns.includes(w)?mk:o&&o.colors?o.colors[y]:ck[y]});i.setOptions({...o,colors:h}),i.draw()},this.onResize=()=>{const{googleChartWrapper:n}=this.props;n.draw()}}}class vk extends v.Component{componentDidMount(){}componentWillUnmount(){}shouldComponentUpdate(){return!1}render(){const{google:e,googleChartWrapper:n,googleChartDashboard:o}=this.props;return v.createElement(jw,{render:i=>v.createElement(gk,Object.assign({},i,{google:e,googleChartWrapper:n,googleChartDashboard:o}))})}}class yk extends v.Component{shouldComponentUpdate(){return!1}listenToEvents(e){let{chartEvents:n,google:o,googleChartWrapper:i}=e;if(n){o.visualization.events.removeAllListeners(i);for(let c of n){var l=this;const{eventName:p,callback:h}=c;o.visualization.events.addListener(i,p,function(){for(var f=arguments.length,y=new Array(f),w=0;w(this.propsFromContext=e,null)})}constructor(e){super(e),this.propsFromContext=null}}let ey=0;class xk extends v.Component{componentDidMount(){const{options:e,google:n,chartType:o,chartWrapperParams:i,toolbarItems:l,getChartEditor:c,getChartWrapper:p}=this.props,h={chartType:o,options:e,containerId:this.getGraphID(),...i},f=new n.visualization.ChartWrapper(h);f.setOptions(e||{}),p&&p(f,n);const y=new n.visualization.Dashboard(this.dashboard_ref),w=this.addControls(f,y);l&&n.visualization.drawToolbar(this.toolbar_ref.current,l);let S=null;c&&(S=new n.visualization.ChartEditor,c({chartEditor:S,chartWrapper:f,google:n})),this.setState({googleChartEditor:S,googleChartControls:w,googleChartDashboard:y,googleChartWrapper:f,isReady:!0})}componentDidUpdate(){if(!this.state.googleChartWrapper||!this.state.googleChartDashboard||!this.state.googleChartControls)return;const{controls:e}=this.props;if(e)for(let n=0;n{let{controlProp:p}=c;return p.controlPosition!=="bottom"}),this.renderChart(),this.renderControl(c=>{let{controlProp:p}=c;return p.controlPosition==="bottom"}),this.renderToolBar())}constructor(...e){var n;super(...e),n=this,this.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},this.graphID=null,this.dashboard_ref=v.createRef(),this.toolbar_ref=v.createRef(),this.getGraphID=()=>{const{graphID:o,graph_id:i}=this.props;let l;return!o&&!i?this.graphID?l=this.graphID:l=uk():o&&!i?l=o:i&&!o?l=i:l=o,this.graphID=l,this.graphID},this.getControlID=(o,i)=>{ey+=1;let l;return typeof o>"u"?l="googlechart-control-".concat(i,"-").concat(ey):l=o,l},this.addControls=(o,i)=>{const{google:l,controls:c}=this.props,p=c?c.map((f,y)=>{const{controlID:w,controlType:S,options:C,controlWrapperParams:j}=f,N=this.getControlID(w,y);return{controlProp:f,control:new l.visualization.ControlWrapper({containerId:N,controlType:S,options:C,...j})}}):null;if(!p)return null;i.bind(p.map(f=>{let{control:y}=f;return y}),o);for(let f of p){const{control:y,controlProp:w}=f,{controlEvents:S=[]}=w;for(let C of S){var h=this;const{callback:j,eventName:N}=C;l.visualization.events.removeListener(y,N,j),l.visualization.events.addListener(y,N,function(){for(var E=arguments.length,R=new Array(E),I=0;I{const{width:o,height:i,options:l,style:c,className:p,rootProps:h,google:f}=this.props,y={height:i||l&&l.height,width:o||l&&l.width,...c};return v.createElement("div",Object.assign({id:this.getGraphID(),style:y,className:p},h),this.state.isReady&&this.state.googleChartWrapper!==null?v.createElement(v.Fragment,null,v.createElement(vk,{googleChartWrapper:this.state.googleChartWrapper,google:f,googleChartDashboard:this.state.googleChartDashboard}),v.createElement(yk,{googleChartWrapper:this.state.googleChartWrapper,google:f})):null)},this.renderControl=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i=>!0;return n.state.isReady&&n.state.googleChartControls!==null?v.createElement(v.Fragment,null,n.state.googleChartControls.filter(i=>{let{controlProp:l,control:c}=i;return o({control:c,controlProp:l})}).map(i=>{let{control:l,controlProp:c}=i;return v.createElement("div",{key:l.getContainerId(),id:l.getContainerId()})})):null},this.renderToolBar=()=>this.props.toolbarItems?v.createElement("div",{ref:this.toolbar_ref}):null}}class Ew extends v.Component{render(){const{chartLanguage:e,chartPackages:n,chartVersion:o,mapsApiKey:i,loader:l,errorElement:c}=this.props;return v.createElement(hk,{value:this.props},this.state.loadingStatus==="ready"&&this.state.google!==null?v.createElement(xk,Object.assign({},this.props,{google:this.state.google})):this.state.loadingStatus==="errored"&&c?c:l,v.createElement(lk,{chartLanguage:e,chartPackages:n,chartVersion:o,mapsApiKey:i,onLoad:this.onLoad,onError:this.onError}))}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1}isFullyLoaded(e){const{controls:n,toolbarItems:o,getChartEditor:i}=this.props;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!i||e.visualization.ChartEditor)&&(!o||e.visualization.drawToolbar)}constructor(...e){super(...e),this._isMounted=!1,this.state={loadingStatus:"loading",google:null},this.onLoad=n=>{if(this.props.onLoad&&this.props.onLoad(n),this.isFullyLoaded(n))this.onSuccess(n);else{const o=setInterval(()=>{const i=window.google;this._isMounted?i&&this.isFullyLoaded(i)&&(clearInterval(o),this.onSuccess(i)):clearInterval(o)},1e3)}},this.onSuccess=n=>{this.setState({loadingStatus:"ready",google:n})},this.onError=()=>{this.setState({loadingStatus:"errored"})}}}Ew.defaultProps=Cw;var ty;(function(t){t.annotation="annotation",t.annotationText="annotationText",t.certainty="certainty",t.emphasis="emphasis",t.interval="interval",t.scope="scope",t.style="style",t.tooltip="tooltip",t.domain="domain"})(ty||(ty={}));const kw=({vehicleLabel:t,vehiclePlate:e,maxRPM:n,peakTorque:o,peakHP:i,graphImg:l})=>{const{locale:c}=we(),p=h=>{let f=["A+","success","white"];return h<100?f=["D","danger","white"]:h<200?f=["C","warning","dark"]:h<350?f=["B","info","dark"]:h<500&&(f=["A","success","white"]),u.jsx(Pt,{bg:f[1],text:f[2],className:"ms-2",children:f[0]})};return u.jsxs("div",{className:"flex gap-3 w-full",children:[u.jsxs("div",{className:"flex-shrink-0 w-[270px]",children:[u.jsxs("p",{children:[c.vehicle,":"," ",u.jsxs("strong",{children:[t," [",e,"]"]})]}),u.jsxs("p",{children:[c.maxRpm,": ",u.jsx("strong",{children:n})]}),u.jsxs("p",{children:[c.peakTorque,":"," ",u.jsxs("strong",{children:[o.toFixed(1)," ",c.newtonMetersAbbr]}),p(o)]}),u.jsxs("p",{children:[c.peakPower,":"," ",u.jsxs("strong",{children:[i.toFixed(1)," ",c.horsepowerAbbr]}),p(i)]})]}),u.jsx("div",{children:u.jsx("img",{src:l,alt:"Dyno Graph",width:"100%",className:"right-[-20px]"})})]})},wk=({show:t,onHide:e,onSelectPlayer:n})=>{const{locale:o}=we(),[i,l]=v.useState([]),[c,p]=v.useState(!1);v.useEffect(()=>{t&&(async()=>{l(await me("nearby-players"))})()},[t]);const h=f=>{f.preventDefault(),c&&n(c)};return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:o.nearbyPlayers})}),u.jsx(ye.Body,{children:u.jsxs(ue,{onSubmit:h,children:[u.jsx(ue.Group,{className:"mb-3",children:u.jsxs(ue.Select,{value:c||"",onChange:f=>p(parseInt(f.target.value)),children:[u.jsx("option",{value:"",children:o.selectPlayer}),i.map(({id:f,name:y},w)=>u.jsxs("option",{value:f,children:[y," [",f,"]"]},w))]})}),u.jsxs(ve,{variant:"success",type:"submit",disabled:!c,children:[u.jsx("i",{className:"bi-arrow-up-right me-2"}),o.send]})]})})]})},Sk=()=>{const{locale:t}=we(),e=v.useMemo(()=>[{type:"string",label:t.rpm||"RPM"},t.horsepowerAbbr||"HP",t.torque||"Torque"],[t]),{connectedVehicle:n}=Gt(),[o,i]=v.useState(!1),[l,c]=v.useState(!1),[p,h]=v.useState([e,[0,0,0]]),[f,y]=v.useState(!1),[w,S]=v.useState(!1),C=v.useMemo(()=>({hAxis:{title:t.rpm,textStyle:{color:"white"},titleTextStyle:{color:"white"},gridlines:{color:"#444"}},vAxis:{textStyle:{color:"white"},gridlines:{color:"#444"}},chartArea:{top:40,right:0,left:50,bottom:50},legend:{position:"top"},legendTextStyle:{color:"white"},backgroundColor:"#212529",fontName:"inherit"}),[t]),j=I=>{const F=I.maxSpeed*I.fInitialDriveForce*5,L=7e3,P=F*5252/L;return{maxRPM:L,peakHP:F,peakTorque:P}},N=async()=>{i(!0);const I=await me("start-dyno");if(!I)return i(!1),!1;const{maxRPM:F,peakHP:L,peakTorque:P}=j(I);c({maxRPM:F,peakTorque:P,peakHP:L});let B=1e3,W=!1,X=0;const re=setInterval(()=>{if(X>=50){i(!1),clearInterval(re);return}const ce=Math.random()*5,ie=P*(B/F)-ce,Oe=ie*B/5252-ce;h(be=>[...be,[Math.round(B),Math.round(Oe),Math.round(ie)]]),B>=F&&(W=!0),B=W?B:B+(F-1e3)/200,X=W?X+1:X},100)},E=()=>{i(!1),c(!1),h([e,[0,0,0]])},R=I=>{if(!n)return!1;me("dyno-share-with-player",{player:I,results:{...l,graphImg:f,vehicleLabel:n.label,vehiclePlate:n.plate}}),S(!1)};return n?u.jsxs("div",{className:"p-4 h-full flex flex-col",children:[u.jsx("h2",{className:"mb-4",children:t.dyno}),o?u.jsx("div",{className:"px-2 mx-auto w-[80%]",children:u.jsx(Ew,{chartType:"LineChart",width:"100%",height:"350px",data:p,options:C,chartEvents:[{eventName:"ready",callback:({chartWrapper:I})=>{y(I.getChart().getImageURI())}}]})}):l&&f?u.jsx(gt,{children:u.jsxs(gt.Body,{children:[u.jsx(kw,{vehicleLabel:n.label,vehiclePlate:n.plate,...l,graphImg:f}),u.jsxs("div",{className:"mt-4 flex gap-3",children:[u.jsxs(ve,{onClick:()=>S(!0),children:[u.jsx("i",{className:"bi-share me-2"}),t.share]}),u.jsx(wk,{show:w,onHide:()=>S(!1),onSelectPlayer:I=>R(I)}),u.jsxs(ve,{variant:"dark",onClick:E,children:[u.jsx("i",{className:"bi-arrow-clockwise me-2"}),t.restart]})]})]})}):u.jsxs("div",{className:"flex flex-1 flex-col justify-center items-center w-[500px] mx-auto text-center text-muted",children:[u.jsx("p",{children:t.dynoDescription}),u.jsxs(ve,{size:"lg",onClick:N,variant:"success",className:"mt-4",children:[u.jsx("i",{className:"bi-graph-up me-2"}),t.startDyno]})]})]}):null},Xc=({show:t,onHide:e,text:n})=>{const{locale:o}=we();return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsxs("h5",{className:"mb-0",children:[u.jsx("i",{className:"bi-exclamation-triangle-fill me-2"}),o.error]})}),u.jsxs(ye.Body,{children:[u.jsx("p",{children:n}),u.jsx(ve,{onClick:e,children:o.ok})]})]})},Tw=v.createContext(void 0),bk=()=>{const t=v.useContext(Tw);if(!t)throw new Error("Must be used in the ServicingAppContext");return t},Ck=({name:t})=>{var S;const{config:e,setEvent:n,locale:o}=we(),{addInvoiceItem:i}=Gt(),{stats:l,setStats:c}=bk(),[p,h]=v.useState(!1),{itemName:f,itemQuantity:y}=v.useMemo(()=>e.Servicing[t],[e,t]),w=async()=>{if(!await me("has-item",{itemName:f,qty:y}))return h(!0);if(await me("service-vehicle",{name:t,stats:l})){const N={...l,[t]:100};c({...N}),n(E=>({...E,servicingData:N})),i(`${o.service}: ${o[t]}`,0)}};return u.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-b-[#333] last:border-b-0 pb-[12px] last:pb-0",children:[u.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[u.jsx("small",{className:"leading-none",children:o[t]}),u.jsx(jl,{now:l[t],label:`${Math.round(l[t])}%`,variant:l[t]<=25?"danger":l[t]<=75?"warning":"success"})]}),u.jsx($l,{placement:"top",overlay:u.jsxs(la,{id:"tooltip-disabled",children:[o.service,u.jsx("br",{}),"(",y,"x ",o[f]||f,")"]}),children:u.jsx("button",{onClick:w,className:"flex-shrink-0 w-[30px] h-[30px] disabled:opacity-40",disabled:l[t]===100,children:u.jsx("i",{className:"bi-tools text-[20px]"})})}),u.jsx(Xc,{show:p,onHide:()=>h(!1),text:(S=o.itemRequired)==null?void 0:S.replace("%s",`${y}x ${o[f]||f}`)})]})},ac=({top:t,bottom:e,left:n,right:o,items:i})=>u.jsx(gt,{border:"secondary",className:"!absolute w-[180px] p-[10px] text-sm flex flex-col gap-2",style:{top:t,bottom:e,left:n,right:o},children:i.map((l,c)=>u.jsx(Ck,{name:l},c))});class Zo extends Error{}class jk extends Zo{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Ek extends Zo{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class kk extends Zo{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class qi extends Zo{}class Nw extends Zo{constructor(e){super(`Invalid unit ${e}`)}}class $n extends Zo{}class zs extends Zo{constructor(){super("Zone is an abstract class")}}const ke="numeric",Rr="short",Qn="long",Fc={year:ke,month:ke,day:ke},Ow={year:ke,month:Rr,day:ke},Tk={year:ke,month:Rr,day:ke,weekday:Rr},Rw={year:ke,month:Qn,day:ke},Iw={year:ke,month:Qn,day:ke,weekday:Qn},Mw={hour:ke,minute:ke},Fw={hour:ke,minute:ke,second:ke},Dw={hour:ke,minute:ke,second:ke,timeZoneName:Rr},_w={hour:ke,minute:ke,second:ke,timeZoneName:Qn},Pw={hour:ke,minute:ke,hourCycle:"h23"},Aw={hour:ke,minute:ke,second:ke,hourCycle:"h23"},$w={hour:ke,minute:ke,second:ke,hourCycle:"h23",timeZoneName:Rr},Lw={hour:ke,minute:ke,second:ke,hourCycle:"h23",timeZoneName:Qn},zw={year:ke,month:ke,day:ke,hour:ke,minute:ke},Bw={year:ke,month:ke,day:ke,hour:ke,minute:ke,second:ke},Hw={year:ke,month:Rr,day:ke,hour:ke,minute:ke},Ww={year:ke,month:Rr,day:ke,hour:ke,minute:ke,second:ke},Nk={year:ke,month:Rr,day:ke,weekday:Rr,hour:ke,minute:ke},Vw={year:ke,month:Qn,day:ke,hour:ke,minute:ke,timeZoneName:Rr},Uw={year:ke,month:Qn,day:ke,hour:ke,minute:ke,second:ke,timeZoneName:Rr},Gw={year:ke,month:Qn,day:ke,weekday:Qn,hour:ke,minute:ke,timeZoneName:Qn},qw={year:ke,month:Qn,day:ke,weekday:Qn,hour:ke,minute:ke,second:ke,timeZoneName:Qn};class Ll{get type(){throw new zs}get name(){throw new zs}get ianaName(){return this.name}get isUniversal(){throw new zs}offsetName(e,n){throw new zs}formatOffset(e,n){throw new zs}offset(e){throw new zs}equals(e){throw new zs}get isValid(){throw new zs}}let ap=null;class Jc extends Ll{static get instance(){return ap===null&&(ap=new Jc),ap}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:o}){return nS(e,n,o)}formatOffset(e,n){return vl(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let bc={};function Ok(t){return bc[t]||(bc[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),bc[t]}const Rk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Ik(t,e){const n=t.format(e).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,l,c,p,h,f,y]=o;return[c,i,l,p,h,f,y]}function Mk(t,e){const n=t.formatToParts(e),o=[];for(let i=0;i=0?j:1e3+j,(S-C)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ny={};function Fk(t,e={}){const n=JSON.stringify([t,e]);let o=ny[n];return o||(o=new Intl.ListFormat(t,e),ny[n]=o),o}let Vp={};function Up(t,e={}){const n=JSON.stringify([t,e]);let o=Vp[n];return o||(o=new Intl.DateTimeFormat(t,e),Vp[n]=o),o}let Gp={};function Dk(t,e={}){const n=JSON.stringify([t,e]);let o=Gp[n];return o||(o=new Intl.NumberFormat(t,e),Gp[n]=o),o}let qp={};function _k(t,e={}){const{base:n,...o}=e,i=JSON.stringify([t,o]);let l=qp[i];return l||(l=new Intl.RelativeTimeFormat(t,e),qp[i]=l),l}let dl=null;function Pk(){return dl||(dl=new Intl.DateTimeFormat().resolvedOptions().locale,dl)}let ry={};function Ak(t){let e=ry[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,ry[t]=e}return e}function $k(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let o,i;try{o=Up(t).resolvedOptions(),i=t}catch{const h=t.substring(0,n);o=Up(h).resolvedOptions(),i=h}const{numberingSystem:l,calendar:c}=o;return[i,l,c]}}function Lk(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function zk(t){const e=[];for(let n=1;n<=12;n++){const o=ot.utc(2009,n,1);e.push(t(o))}return e}function Bk(t){const e=[];for(let n=1;n<=7;n++){const o=ot.utc(2016,11,13+n);e.push(t(o))}return e}function uc(t,e,n,o){const i=t.listingMode();return i==="error"?null:i==="en"?n(e):o(e)}function Hk(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class Wk{constructor(e,n,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;const{padTo:i,floor:l,...c}=o;if(!n||Object.keys(c).length>0){const p={useGrouping:!1,...o};o.padTo>0&&(p.minimumIntegerDigits=o.padTo),this.inf=Dk(e,p)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):Gh(e,3);return Jt(n,this.padTo)}}}class Vk{constructor(e,n,o){this.opts=o,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const c=-1*(e.offset/60),p=c>=0?`Etc/GMT+${c}`:`Etc/GMT${c}`;e.offset!==0&&ys.create(p).valid?(i=p,this.dt=e):(i="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,i=e.zone.name):(i="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const l={...this.opts};l.timeZone=l.timeZone||i,this.dtf=Up(n,l)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:o}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Uk{constructor(e,n,o){this.opts={style:"long",...o},!n&&eS()&&(this.rtf=_k(e,o))}format(e,n){return this.rtf?this.rtf.format(e,n):dT(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const Gk={firstDay:1,minimalDays:4,weekend:[6,7]};class kt{static fromOpts(e){return kt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,o,i,l=!1){const c=e||Kt.defaultLocale,p=c||(l?"en-US":Pk()),h=n||Kt.defaultNumberingSystem,f=o||Kt.defaultOutputCalendar,y=Kp(i)||Kt.defaultWeekSettings;return new kt(p,h,f,y,c)}static resetCache(){dl=null,Vp={},Gp={},qp={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:o,weekSettings:i}={}){return kt.create(e,n,o,i)}constructor(e,n,o,i,l){const[c,p,h]=$k(e);this.locale=c,this.numberingSystem=n||p||null,this.outputCalendar=o||h||null,this.weekSettings=i,this.intl=Lk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=l,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Hk(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:kt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Kp(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return uc(this,e,oS,()=>{const o=n?{month:e,day:"numeric"}:{month:e},i=n?"format":"standalone";return this.monthsCache[i][e]||(this.monthsCache[i][e]=zk(l=>this.extract(l,o,"month"))),this.monthsCache[i][e]})}weekdays(e,n=!1){return uc(this,e,lS,()=>{const o=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},i=n?"format":"standalone";return this.weekdaysCache[i][e]||(this.weekdaysCache[i][e]=Bk(l=>this.extract(l,o,"weekday"))),this.weekdaysCache[i][e]})}meridiems(){return uc(this,void 0,()=>uS,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ot.utc(2016,11,13,9),ot.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return uc(this,e,cS,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[ot.utc(-40,1,1),ot.utc(2017,1,1)].map(o=>this.extract(o,n,"era"))),this.eraCache[e]})}extract(e,n,o){const i=this.dtFormatter(e,n),l=i.formatToParts(),c=l.find(p=>p.type.toLowerCase()===o);return c?c.value:null}numberFormatter(e={}){return new Wk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new Vk(e,this.intl,n)}relFormatter(e={}){return new Uk(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Fk(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:tS()?Ak(this.locale):Gk}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let lp=null;class Tn extends Ll{static get utcInstance(){return lp===null&&(lp=new Tn(0)),lp}static instance(e){return e===0?Tn.utcInstance:new Tn(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tn(nd(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${vl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${vl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return vl(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class qk extends Ll{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Gs(t,e){if(it(t)||t===null)return e;if(t instanceof Ll)return t;if(Yk(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?Jc.instance:n==="utc"||n==="gmt"?Tn.utcInstance:Tn.parseSpecifier(n)||ys.create(t)}else return Ho(t)?Tn.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new qk(t)}let sy=()=>Date.now(),oy="system",iy=null,ay=null,ly=null,uy=60,cy,dy=null;class Kt{static get now(){return sy}static set now(e){sy=e}static set defaultZone(e){oy=e}static get defaultZone(){return Gs(oy,Jc.instance)}static get defaultLocale(){return iy}static set defaultLocale(e){iy=e}static get defaultNumberingSystem(){return ay}static set defaultNumberingSystem(e){ay=e}static get defaultOutputCalendar(){return ly}static set defaultOutputCalendar(e){ly=e}static get defaultWeekSettings(){return dy}static set defaultWeekSettings(e){dy=Kp(e)}static get twoDigitCutoffYear(){return uy}static set twoDigitCutoffYear(e){uy=e%100}static get throwOnInvalid(){return cy}static set throwOnInvalid(e){cy=e}static resetCaches(){kt.resetCache(),ys.resetCache()}}class Or{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Kw=[0,31,59,90,120,151,181,212,243,273,304,334],Zw=[0,31,60,91,121,152,182,213,244,274,305,335];function fr(t,e){return new Or("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Wh(t,e,n){const o=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&o.setUTCFullYear(o.getUTCFullYear()-1900);const i=o.getUTCDay();return i===0?7:i}function Yw(t,e,n){return n+(zl(t)?Zw:Kw)[e-1]}function Qw(t,e){const n=zl(t)?Zw:Kw,o=n.findIndex(l=>lEl(o,e,n)?(f=o+1,h=1):f=o,{weekYear:f,weekNumber:h,weekday:p,...rd(t)}}function fy(t,e=4,n=1){const{weekYear:o,weekNumber:i,weekday:l}=t,c=Vh(Wh(o,1,e),n),p=Zi(o);let h=i*7+l-c-7+e,f;h<1?(f=o-1,h+=Zi(f)):h>p?(f=o+1,h-=Zi(o)):f=o;const{month:y,day:w}=Qw(f,h);return{year:f,month:y,day:w,...rd(t)}}function up(t){const{year:e,month:n,day:o}=t,i=Yw(e,n,o);return{year:e,ordinal:i,...rd(t)}}function py(t){const{year:e,ordinal:n}=t,{month:o,day:i}=Qw(e,n);return{year:e,month:o,day:i,...rd(t)}}function hy(t,e){if(!it(t.localWeekday)||!it(t.localWeekNumber)||!it(t.localWeekYear)){if(!it(t.weekday)||!it(t.weekNumber)||!it(t.weekYear))throw new qi("Cannot mix locale-based week fields with ISO-based week fields");return it(t.localWeekday)||(t.weekday=t.localWeekday),it(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),it(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Kk(t,e=4,n=1){const o=ed(t.weekYear),i=pr(t.weekNumber,1,El(t.weekYear,e,n)),l=pr(t.weekday,1,7);return o?i?l?!1:fr("weekday",t.weekday):fr("week",t.weekNumber):fr("weekYear",t.weekYear)}function Zk(t){const e=ed(t.year),n=pr(t.ordinal,1,Zi(t.year));return e?n?!1:fr("ordinal",t.ordinal):fr("year",t.year)}function Xw(t){const e=ed(t.year),n=pr(t.month,1,12),o=pr(t.day,1,_c(t.year,t.month));return e?n?o?!1:fr("day",t.day):fr("month",t.month):fr("year",t.year)}function Jw(t){const{hour:e,minute:n,second:o,millisecond:i}=t,l=pr(e,0,23)||e===24&&n===0&&o===0&&i===0,c=pr(n,0,59),p=pr(o,0,59),h=pr(i,0,999);return l?c?p?h?!1:fr("millisecond",i):fr("second",o):fr("minute",n):fr("hour",e)}function it(t){return typeof t>"u"}function Ho(t){return typeof t=="number"}function ed(t){return typeof t=="number"&&t%1===0}function Yk(t){return typeof t=="string"}function Qk(t){return Object.prototype.toString.call(t)==="[object Date]"}function eS(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function tS(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Xk(t){return Array.isArray(t)?t:[t]}function my(t,e,n){if(t.length!==0)return t.reduce((o,i)=>{const l=[e(i),i];return o&&n(o[0],l[0])===o[0]?o:l},null)[1]}function Jk(t,e){return e.reduce((n,o)=>(n[o]=t[o],n),{})}function ta(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Kp(t){if(t==null)return null;if(typeof t!="object")throw new $n("Week settings must be an object");if(!pr(t.firstDay,1,7)||!pr(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!pr(e,1,7)))throw new $n("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function pr(t,e,n){return ed(t)&&t>=e&&t<=n}function eT(t,e){return t-e*Math.floor(t/e)}function Jt(t,e=2){const n=t<0;let o;return n?o="-"+(""+-t).padStart(e,"0"):o=(""+t).padStart(e,"0"),o}function Ws(t){if(!(it(t)||t===null||t===""))return parseInt(t,10)}function Do(t){if(!(it(t)||t===null||t===""))return parseFloat(t)}function Uh(t){if(!(it(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Gh(t,e,n=!1){const o=10**e;return(n?Math.trunc:Math.round)(t*o)/o}function zl(t){return t%4===0&&(t%100!==0||t%400===0)}function Zi(t){return zl(t)?366:365}function _c(t,e){const n=eT(e-1,12)+1,o=t+(e-n)/12;return n===2?zl(o)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function td(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function gy(t,e,n){return-Vh(Wh(t,1,e),n)+e-1}function El(t,e=4,n=1){const o=gy(t,e,n),i=gy(t+1,e,n);return(Zi(t)-o+i)/7}function Zp(t){return t>99?t:t>Kt.twoDigitCutoffYear?1900+t:2e3+t}function nS(t,e,n,o=null){const i=new Date(t),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(l.timeZone=o);const c={timeZoneName:e,...l},p=new Intl.DateTimeFormat(n,c).formatToParts(i).find(h=>h.type.toLowerCase()==="timezonename");return p?p.value:null}function nd(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const o=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-o:o;return n*60+i}function rS(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new $n(`Invalid unit value ${t}`);return e}function Pc(t,e){const n={};for(const o in t)if(ta(t,o)){const i=t[o];if(i==null)continue;n[e(o)]=rS(i)}return n}function vl(t,e){const n=Math.trunc(Math.abs(t/60)),o=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${Jt(n,2)}:${Jt(o,2)}`;case"narrow":return`${i}${n}${o>0?`:${o}`:""}`;case"techie":return`${i}${Jt(n,2)}${Jt(o,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function rd(t){return Jk(t,["hour","minute","second","millisecond"])}const tT=["January","February","March","April","May","June","July","August","September","October","November","December"],sS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nT=["J","F","M","A","M","J","J","A","S","O","N","D"];function oS(t){switch(t){case"narrow":return[...nT];case"short":return[...sS];case"long":return[...tT];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const iS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],aS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],rT=["M","T","W","T","F","S","S"];function lS(t){switch(t){case"narrow":return[...rT];case"short":return[...aS];case"long":return[...iS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const uS=["AM","PM"],sT=["Before Christ","Anno Domini"],oT=["BC","AD"],iT=["B","A"];function cS(t){switch(t){case"narrow":return[...iT];case"short":return[...oT];case"long":return[...sT];default:return null}}function aT(t){return uS[t.hour<12?0:1]}function lT(t,e){return lS(e)[t.weekday-1]}function uT(t,e){return oS(e)[t.month-1]}function cT(t,e){return cS(e)[t.year<0?0:1]}function dT(t,e,n="always",o=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&l){const w=t==="days";switch(e){case 1:return w?"tomorrow":`next ${i[t][0]}`;case-1:return w?"yesterday":`last ${i[t][0]}`;case 0:return w?"today":`this ${i[t][0]}`}}const c=Object.is(e,-0)||e<0,p=Math.abs(e),h=p===1,f=i[t],y=o?h?f[1]:f[2]||f[1]:h?i[t][0]:t;return c?`${p} ${y} ago`:`in ${p} ${y}`}function vy(t,e){let n="";for(const o of t)o.literal?n+=o.val:n+=e(o.val);return n}const fT={D:Fc,DD:Ow,DDD:Rw,DDDD:Iw,t:Mw,tt:Fw,ttt:Dw,tttt:_w,T:Pw,TT:Aw,TTT:$w,TTTT:Lw,f:zw,ff:Hw,fff:Vw,ffff:Gw,F:Bw,FF:Ww,FFF:Uw,FFFF:qw};class Cn{static create(e,n={}){return new Cn(e,n)}static parseFormat(e){let n=null,o="",i=!1;const l=[];for(let c=0;c0&&l.push({literal:i||/^\s+$/.test(o),val:o}),n=null,o="",i=!i):i||p===n?o+=p:(o.length>0&&l.push({literal:/^\s+$/.test(o),val:o}),o=p,n=p)}return o.length>0&&l.push({literal:i||/^\s+$/.test(o),val:o}),l}static macroTokenToFormatOpts(e){return fT[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return Jt(e,n);const o={...this.opts};return n>0&&(o.padTo=n),this.loc.numberFormatter(o).format(e)}formatDateTimeFromString(e,n){const o=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(C,j)=>this.loc.extract(e,C,j),c=C=>e.isOffsetFixed&&e.offset===0&&C.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,C.format):"",p=()=>o?aT(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),h=(C,j)=>o?uT(e,C):l(j?{month:C}:{month:C,day:"numeric"},"month"),f=(C,j)=>o?lT(e,C):l(j?{weekday:C}:{weekday:C,month:"long",day:"numeric"},"weekday"),y=C=>{const j=Cn.macroTokenToFormatOpts(C);return j?this.formatWithSystemDefault(e,j):C},w=C=>o?cT(e,C):l({era:C},"era"),S=C=>{switch(C){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return c({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return c({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return c({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return p();case"d":return i?l({day:"numeric"},"day"):this.num(e.day);case"dd":return i?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return i?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return h("short",!0);case"LLLL":return h("long",!0);case"LLLLL":return h("narrow",!0);case"M":return i?l({month:"numeric"},"month"):this.num(e.month);case"MM":return i?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return h("short",!1);case"MMMM":return h("long",!1);case"MMMMM":return h("narrow",!1);case"y":return i?l({year:"numeric"},"year"):this.num(e.year);case"yy":return i?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return w("short");case"GG":return w("long");case"GGGGG":return w("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return y(C)}};return vy(Cn.parseFormat(n),S)}formatDurationFromString(e,n){const o=h=>{switch(h[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=h=>f=>{const y=o(f);return y?this.num(h.get(y),f.length):f},l=Cn.parseFormat(n),c=l.reduce((h,{literal:f,val:y})=>f?h:h.concat(y),[]),p=e.shiftTo(...c.map(o).filter(h=>h));return vy(l,i(p))}}const dS=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ca(...t){const e=t.reduce((n,o)=>n+o.source,"");return RegExp(`^${e}$`)}function da(...t){return e=>t.reduce(([n,o,i],l)=>{const[c,p,h]=l(e,i);return[{...n,...c},p||o,h]},[{},null,1]).slice(0,2)}function fa(t,...e){if(t==null)return[null,null];for(const[n,o]of e){const i=n.exec(t);if(i)return o(i)}return[null,null]}function fS(...t){return(e,n)=>{const o={};let i;for(i=0;iC!==void 0&&(j||C&&y)?-C:C;return[{years:S(Do(n)),months:S(Do(o)),weeks:S(Do(i)),days:S(Do(l)),hours:S(Do(c)),minutes:S(Do(p)),seconds:S(Do(h),h==="-0"),milliseconds:S(Uh(f),w)}]}const ET={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Zh(t,e,n,o,i,l,c){const p={year:e.length===2?Zp(Ws(e)):Ws(e),month:sS.indexOf(n)+1,day:Ws(o),hour:Ws(i),minute:Ws(l)};return c&&(p.second=Ws(c)),t&&(p.weekday=t.length>3?iS.indexOf(t)+1:aS.indexOf(t)+1),p}const kT=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function TT(t){const[,e,n,o,i,l,c,p,h,f,y,w]=t,S=Zh(e,i,o,n,l,c,p);let C;return h?C=ET[h]:f?C=0:C=nd(y,w),[S,new Tn(C)]}function NT(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const OT=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,RT=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,IT=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function yy(t){const[,e,n,o,i,l,c,p]=t;return[Zh(e,i,o,n,l,c,p),Tn.utcInstance]}function MT(t){const[,e,n,o,i,l,c,p]=t;return[Zh(e,p,n,o,i,l,c),Tn.utcInstance]}const FT=ca(hT,Kh),DT=ca(mT,Kh),_T=ca(gT,Kh),PT=ca(hS),gS=da(ST,pa,Bl,Hl),AT=da(vT,pa,Bl,Hl),$T=da(yT,pa,Bl,Hl),LT=da(pa,Bl,Hl);function zT(t){return fa(t,[FT,gS],[DT,AT],[_T,$T],[PT,LT])}function BT(t){return fa(NT(t),[kT,TT])}function HT(t){return fa(t,[OT,yy],[RT,yy],[IT,MT])}function WT(t){return fa(t,[CT,jT])}const VT=da(pa);function UT(t){return fa(t,[bT,VT])}const GT=ca(xT,wT),qT=ca(mS),KT=da(pa,Bl,Hl);function ZT(t){return fa(t,[GT,gS],[qT,KT])}const xy="Invalid Duration",vS={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},YT={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...vS},lr=146097/400,Vi=146097/4800,QT={years:{quarters:4,months:12,weeks:lr/7,days:lr,hours:lr*24,minutes:lr*24*60,seconds:lr*24*60*60,milliseconds:lr*24*60*60*1e3},quarters:{months:3,weeks:lr/28,days:lr/4,hours:lr*24/4,minutes:lr*24*60/4,seconds:lr*24*60*60/4,milliseconds:lr*24*60*60*1e3/4},months:{weeks:Vi/7,days:Vi,hours:Vi*24,minutes:Vi*24*60,seconds:Vi*24*60*60,milliseconds:Vi*24*60*60*1e3},...vS},Lo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],XT=Lo.slice(0).reverse();function Bs(t,e,n=!1){const o={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new yt(o)}function yS(t,e){let n=e.milliseconds??0;for(const o of XT.slice(1))e[o]&&(n+=e[o]*t[o].milliseconds);return n}function wy(t,e){const n=yS(t,e)<0?-1:1;Lo.reduceRight((o,i)=>{if(it(e[i]))return o;if(o){const l=e[o]*n,c=t[i][o],p=Math.floor(l/c);e[i]+=p*n,e[o]-=p*c*n}return i},null),Lo.reduce((o,i)=>{if(it(e[i]))return o;if(o){const l=e[o]%1;e[o]-=l,e[i]+=l*t[o][i]}return i},null)}function JT(t){const e={};for(const[n,o]of Object.entries(t))o!==0&&(e[n]=o);return e}class yt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let o=n?QT:YT;e.matrix&&(o=e.matrix),this.values=e.values,this.loc=e.loc||kt.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(e,n){return yt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new $n(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new yt({values:Pc(e,yt.normalizeUnit),loc:kt.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(Ho(e))return yt.fromMillis(e);if(yt.isDuration(e))return e;if(typeof e=="object")return yt.fromObject(e);throw new $n(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[o]=WT(e);return o?yt.fromObject(o,n):yt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[o]=UT(e);return o?yt.fromObject(o,n):yt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new $n("need to specify a reason the Duration is invalid");const o=e instanceof Or?e:new Or(e,n);if(Kt.throwOnInvalid)throw new kk(o);return new yt({invalid:o})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new Nw(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const o={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Cn.create(this.loc,o).formatDurationFromString(this,e):xy}toHuman(e={}){if(!this.isValid)return xy;const n=Lo.map(o=>{const i=this.values[o];return it(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:o.slice(0,-1)}).format(i)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Gh(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},ot.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?yS(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=yt.fromDurationLike(e),o={};for(const i of Lo)(ta(n.values,i)||ta(this.values,i))&&(o[i]=n.get(i)+this.get(i));return Bs(this,{values:o},!0)}minus(e){if(!this.isValid)return this;const n=yt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const o of Object.keys(this.values))n[o]=rS(e(this.values[o],o));return Bs(this,{values:n},!0)}get(e){return this[yt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...Pc(e,yt.normalizeUnit)};return Bs(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:o,matrix:i}={}){const c={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:o};return Bs(this,c)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return wy(this.matrix,e),Bs(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=JT(this.normalize().shiftToAll().toObject());return Bs(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(c=>yt.normalizeUnit(c));const n={},o={},i=this.toObject();let l;for(const c of Lo)if(e.indexOf(c)>=0){l=c;let p=0;for(const f in o)p+=this.matrix[f][c]*o[f],o[f]=0;Ho(i[c])&&(p+=i[c]);const h=Math.trunc(p);n[c]=h,o[c]=(p*1e3-h*1e3)/1e3}else Ho(i[c])&&(o[c]=i[c]);for(const c in o)o[c]!==0&&(n[l]+=c===l?o[c]:o[c]/this.matrix[l][c]);return wy(this.matrix,n),Bs(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return Bs(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(o,i){return o===void 0||o===0?i===void 0||i===0:o===i}for(const o of Lo)if(!n(this.values[o],e.values[o]))return!1;return!0}}const Ui="Invalid Interval";function eN(t,e){return!t||!t.isValid?Ut.invalid("missing or invalid start"):!e||!e.isValid?Ut.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?Ut.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(ll).filter(c=>this.contains(c)).sort((c,p)=>c.toMillis()-p.toMillis()),o=[];let{s:i}=this,l=0;for(;i+this.e?this.e:c;o.push(Ut.fromDateTimes(i,p)),i=p,l+=1}return o}splitBy(e){const n=yt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:o}=this,i=1,l;const c=[];for(;oh*i));l=+p>+this.e?this.e:p,c.push(Ut.fromDateTimes(o,l)),o=l,i+=1}return c}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,o=this.e=o?null:Ut.fromDateTimes(n,o)}union(e){if(!this.isValid)return this;const n=this.se.e?this.e:e.e;return Ut.fromDateTimes(n,o)}static merge(e){const[n,o]=e.sort((i,l)=>i.s-l.s).reduce(([i,l],c)=>l?l.overlaps(c)||l.abutsStart(c)?[i,l.union(c)]:[i.concat([l]),c]:[i,c],[[],null]);return o&&n.push(o),n}static xor(e){let n=null,o=0;const i=[],l=e.map(h=>[{time:h.s,type:"s"},{time:h.e,type:"e"}]),c=Array.prototype.concat(...l),p=c.sort((h,f)=>h.time-f.time);for(const h of p)o+=h.type==="s"?1:-1,o===1?n=h.time:(n&&+n!=+h.time&&i.push(Ut.fromDateTimes(n,h.time)),n=null);return Ut.merge(i)}difference(...e){return Ut.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ui}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Fc,n={}){return this.isValid?Cn.create(this.s.loc.clone(n),e).formatInterval(this):Ui}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ui}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ui}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ui}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:Ui}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):yt.invalid(this.invalidReason)}mapEndpoints(e){return Ut.fromDateTimes(e(this.s),e(this.e))}}class cc{static hasDST(e=Kt.defaultZone){const n=ot.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return ys.isValidZone(e)}static normalizeZone(e){return Gs(e,Kt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||kt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||kt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||kt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:o=null,locObj:i=null,outputCalendar:l="gregory"}={}){return(i||kt.create(n,o,l)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:o=null,locObj:i=null,outputCalendar:l="gregory"}={}){return(i||kt.create(n,o,l)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:o=null,locObj:i=null}={}){return(i||kt.create(n,o,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:o=null,locObj:i=null}={}){return(i||kt.create(n,o,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return kt.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return kt.create(n,null,"gregory").eras(e)}static features(){return{relative:eS(),localeWeek:tS()}}}function Sy(t,e){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),o=n(e)-n(t);return Math.floor(yt.fromMillis(o).as("days"))}function tN(t,e,n){const o=[["years",(h,f)=>f.year-h.year],["quarters",(h,f)=>f.quarter-h.quarter+(f.year-h.year)*4],["months",(h,f)=>f.month-h.month+(f.year-h.year)*12],["weeks",(h,f)=>{const y=Sy(h,f);return(y-y%7)/7}],["days",Sy]],i={},l=t;let c,p;for(const[h,f]of o)n.indexOf(h)>=0&&(c=h,i[h]=f(t,e),p=l.plus(i),p>e?(i[h]--,t=l.plus(i),t>e&&(p=t,i[h]--,t=l.plus(i))):t=p);return[t,i,p,c]}function nN(t,e,n,o){let[i,l,c,p]=tN(t,e,n);const h=e-i,f=n.filter(w=>["hours","minutes","seconds","milliseconds"].indexOf(w)>=0);f.length===0&&(c0?yt.fromMillis(h,o).shiftTo(...f).plus(y):y}const Yh={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},by={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},rN=Yh.hanidec.replace(/[\[|\]]/g,"").split("");function sN(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=l&&o<=c&&(e+=o-l)}}return parseInt(e,10)}else return e}function Tr({numberingSystem:t},e=""){return new RegExp(`${Yh[t||"latn"]}${e}`)}const oN="missing Intl.DateTimeFormat.formatToParts support";function bt(t,e=n=>n){return{regex:t,deser:([n])=>e(sN(n))}}const iN=" ",xS=`[ ${iN}]`,wS=new RegExp(xS,"g");function aN(t){return t.replace(/\./g,"\\.?").replace(wS,xS)}function Cy(t){return t.replace(/\./g,"").replace(wS," ").toLowerCase()}function Nr(t,e){return t===null?null:{regex:RegExp(t.map(aN).join("|")),deser:([n])=>t.findIndex(o=>Cy(n)===Cy(o))+e}}function jy(t,e){return{regex:t,deser:([,n,o])=>nd(n,o),groups:e}}function dc(t){return{regex:t,deser:([e])=>e}}function lN(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function uN(t,e){const n=Tr(e),o=Tr(e,"{2}"),i=Tr(e,"{3}"),l=Tr(e,"{4}"),c=Tr(e,"{6}"),p=Tr(e,"{1,2}"),h=Tr(e,"{1,3}"),f=Tr(e,"{1,6}"),y=Tr(e,"{1,9}"),w=Tr(e,"{2,4}"),S=Tr(e,"{4,6}"),C=E=>({regex:RegExp(lN(E.val)),deser:([R])=>R,literal:!0}),N=(E=>{if(t.literal)return C(E);switch(E.val){case"G":return Nr(e.eras("short"),0);case"GG":return Nr(e.eras("long"),0);case"y":return bt(f);case"yy":return bt(w,Zp);case"yyyy":return bt(l);case"yyyyy":return bt(S);case"yyyyyy":return bt(c);case"M":return bt(p);case"MM":return bt(o);case"MMM":return Nr(e.months("short",!0),1);case"MMMM":return Nr(e.months("long",!0),1);case"L":return bt(p);case"LL":return bt(o);case"LLL":return Nr(e.months("short",!1),1);case"LLLL":return Nr(e.months("long",!1),1);case"d":return bt(p);case"dd":return bt(o);case"o":return bt(h);case"ooo":return bt(i);case"HH":return bt(o);case"H":return bt(p);case"hh":return bt(o);case"h":return bt(p);case"mm":return bt(o);case"m":return bt(p);case"q":return bt(p);case"qq":return bt(o);case"s":return bt(p);case"ss":return bt(o);case"S":return bt(h);case"SSS":return bt(i);case"u":return dc(y);case"uu":return dc(p);case"uuu":return bt(n);case"a":return Nr(e.meridiems(),0);case"kkkk":return bt(l);case"kk":return bt(w,Zp);case"W":return bt(p);case"WW":return bt(o);case"E":case"c":return bt(n);case"EEE":return Nr(e.weekdays("short",!1),1);case"EEEE":return Nr(e.weekdays("long",!1),1);case"ccc":return Nr(e.weekdays("short",!0),1);case"cccc":return Nr(e.weekdays("long",!0),1);case"Z":case"ZZ":return jy(new RegExp(`([+-]${p.source})(?::(${o.source}))?`),2);case"ZZZ":return jy(new RegExp(`([+-]${p.source})(${o.source})?`),2);case"z":return dc(/[a-z_+-/]{1,256}?/i);case" ":return dc(/[^\S\n\r]/);default:return C(E)}})(t)||{invalidReason:oN};return N.token=t,N}const cN={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function dN(t,e,n){const{type:o,value:i}=t;if(o==="literal"){const h=/^\s+$/.test(i);return{literal:!h,val:h?" ":i}}const l=e[o];let c=o;o==="hour"&&(e.hour12!=null?c=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?c="hour12":c="hour24":c=n.hour12?"hour12":"hour24");let p=cN[c];if(typeof p=="object"&&(p=p[l]),p)return{literal:!1,val:p}}function fN(t){return[`^${t.map(n=>n.regex).reduce((n,o)=>`${n}(${o.source})`,"")}$`,t]}function pN(t,e,n){const o=t.match(e);if(o){const i={};let l=1;for(const c in n)if(ta(n,c)){const p=n[c],h=p.groups?p.groups+1:1;!p.literal&&p.token&&(i[p.token.val[0]]=p.deser(o.slice(l,l+h))),l+=h}return[o,i]}else return[o,{}]}function hN(t){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,o;return it(t.z)||(n=ys.create(t.z)),it(t.Z)||(n||(n=new Tn(t.Z)),o=t.Z),it(t.q)||(t.M=(t.q-1)*3+1),it(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),it(t.u)||(t.S=Uh(t.u)),[Object.keys(t).reduce((l,c)=>{const p=e(c);return p&&(l[p]=t[c]),l},{}),n,o]}let cp=null;function mN(){return cp||(cp=ot.fromMillis(1555555555555)),cp}function gN(t,e){if(t.literal)return t;const n=Cn.macroTokenToFormatOpts(t.val),o=CS(n,e);return o==null||o.includes(void 0)?t:o}function SS(t,e){return Array.prototype.concat(...t.map(n=>gN(n,e)))}function bS(t,e,n){const o=SS(Cn.parseFormat(n),t),i=o.map(c=>uN(c,t)),l=i.find(c=>c.invalidReason);if(l)return{input:e,tokens:o,invalidReason:l.invalidReason};{const[c,p]=fN(i),h=RegExp(c,"i"),[f,y]=pN(e,h,p),[w,S,C]=y?hN(y):[null,null,void 0];if(ta(y,"a")&&ta(y,"H"))throw new qi("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:o,regex:h,rawMatches:f,matches:y,result:w,zone:S,specificOffset:C}}}function vN(t,e,n){const{result:o,zone:i,specificOffset:l,invalidReason:c}=bS(t,e,n);return[o,i,l,c]}function CS(t,e){if(!t)return null;const o=Cn.create(e,t).dtFormatter(mN()),i=o.formatToParts(),l=o.resolvedOptions();return i.map(c=>dN(c,t,l))}const dp="Invalid DateTime",yN=864e13;function fc(t){return new Or("unsupported zone",`the zone "${t.name}" is not supported`)}function fp(t){return t.weekData===null&&(t.weekData=Dc(t.c)),t.weekData}function pp(t){return t.localWeekData===null&&(t.localWeekData=Dc(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function _o(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new ot({...n,...e,old:n})}function jS(t,e,n){let o=t-e*60*1e3;const i=n.offset(o);if(e===i)return[o,e];o-=(i-e)*60*1e3;const l=n.offset(o);return i===l?[o,i]:[t-Math.min(i,l)*60*1e3,Math.max(i,l)]}function pc(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Cc(t,e,n){return jS(td(t),e,n)}function Ey(t,e){const n=t.o,o=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...t.c,year:o,month:i,day:Math.min(t.c.day,_c(o,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},c=yt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),p=td(l);let[h,f]=jS(p,n,t.zone);return c!==0&&(h+=c,f=t.zone.offset(h)),{ts:h,o:f}}function al(t,e,n,o,i,l){const{setZone:c,zone:p}=n;if(t&&Object.keys(t).length!==0||e){const h=e||p,f=ot.fromObject(t,{...n,zone:h,specificOffset:l});return c?f:f.setZone(p)}else return ot.invalid(new Or("unparsable",`the input "${i}" can't be parsed as ${o}`))}function hc(t,e,n=!0){return t.isValid?Cn.create(kt.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function hp(t,e){const n=t.c.year>9999||t.c.year<0;let o="";return n&&t.c.year>=0&&(o+="+"),o+=Jt(t.c.year,n?6:4),e?(o+="-",o+=Jt(t.c.month),o+="-",o+=Jt(t.c.day)):(o+=Jt(t.c.month),o+=Jt(t.c.day)),o}function ky(t,e,n,o,i,l){let c=Jt(t.c.hour);return e?(c+=":",c+=Jt(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(c+=":")):c+=Jt(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(c+=Jt(t.c.second),(t.c.millisecond!==0||!o)&&(c+=".",c+=Jt(t.c.millisecond,3))),i&&(t.isOffsetFixed&&t.offset===0&&!l?c+="Z":t.o<0?(c+="-",c+=Jt(Math.trunc(-t.o/60)),c+=":",c+=Jt(Math.trunc(-t.o%60))):(c+="+",c+=Jt(Math.trunc(t.o/60)),c+=":",c+=Jt(Math.trunc(t.o%60)))),l&&(c+="["+t.zone.ianaName+"]"),c}const ES={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},xN={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},wN={ordinal:1,hour:0,minute:0,second:0,millisecond:0},kS=["year","month","day","hour","minute","second","millisecond"],SN=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],bN=["year","ordinal","hour","minute","second","millisecond"];function CN(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Nw(t);return e}function Ty(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return CN(t)}}function Ny(t,e){const n=Gs(e.zone,Kt.defaultZone),o=kt.fromObject(e),i=Kt.now();let l,c;if(it(t.year))l=i;else{for(const f of kS)it(t[f])&&(t[f]=ES[f]);const p=Xw(t)||Jw(t);if(p)return ot.invalid(p);const h=n.offset(i);[l,c]=Cc(t,h,n)}return new ot({ts:l,zone:n,loc:o,o:c})}function Oy(t,e,n){const o=it(n.round)?!0:n.round,i=(c,p)=>(c=Gh(c,o||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(c,p)),l=c=>n.calendary?e.hasSame(t,c)?0:e.startOf(c).diff(t.startOf(c),c).get(c):e.diff(t,c).get(c);if(n.unit)return i(l(n.unit),n.unit);for(const c of n.units){const p=l(c);if(Math.abs(p)>=1)return i(p,c)}return i(t>e?-0:0,n.units[n.units.length-1])}function Ry(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class ot{constructor(e){const n=e.zone||Kt.defaultZone;let o=e.invalid||(Number.isNaN(e.ts)?new Or("invalid input"):null)||(n.isValid?null:fc(n));this.ts=it(e.ts)?Kt.now():e.ts;let i=null,l=null;if(!o)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,l]=[e.old.c,e.old.o];else{const p=n.offset(this.ts);i=pc(this.ts,p),o=Number.isNaN(i.year)?new Or("invalid input"):null,i=o?null:i,l=o?null:p}this._zone=n,this.loc=e.loc||kt.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=i,this.o=l,this.isLuxonDateTime=!0}static now(){return new ot({})}static local(){const[e,n]=Ry(arguments),[o,i,l,c,p,h,f]=n;return Ny({year:o,month:i,day:l,hour:c,minute:p,second:h,millisecond:f},e)}static utc(){const[e,n]=Ry(arguments),[o,i,l,c,p,h,f]=n;return e.zone=Tn.utcInstance,Ny({year:o,month:i,day:l,hour:c,minute:p,second:h,millisecond:f},e)}static fromJSDate(e,n={}){const o=Qk(e)?e.valueOf():NaN;if(Number.isNaN(o))return ot.invalid("invalid input");const i=Gs(n.zone,Kt.defaultZone);return i.isValid?new ot({ts:o,zone:i,loc:kt.fromObject(n)}):ot.invalid(fc(i))}static fromMillis(e,n={}){if(Ho(e))return e<-864e13||e>yN?ot.invalid("Timestamp out of range"):new ot({ts:e,zone:Gs(n.zone,Kt.defaultZone),loc:kt.fromObject(n)});throw new $n(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(Ho(e))return new ot({ts:e*1e3,zone:Gs(n.zone,Kt.defaultZone),loc:kt.fromObject(n)});throw new $n("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const o=Gs(n.zone,Kt.defaultZone);if(!o.isValid)return ot.invalid(fc(o));const i=kt.fromObject(n),l=Pc(e,Ty),{minDaysInFirstWeek:c,startOfWeek:p}=hy(l,i),h=Kt.now(),f=it(n.specificOffset)?o.offset(h):n.specificOffset,y=!it(l.ordinal),w=!it(l.year),S=!it(l.month)||!it(l.day),C=w||S,j=l.weekYear||l.weekNumber;if((C||y)&&j)throw new qi("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(S&&y)throw new qi("Can't mix ordinal dates with month/day");const N=j||l.weekday&&!C;let E,R,I=pc(h,f);N?(E=SN,R=xN,I=Dc(I,c,p)):y?(E=bN,R=wN,I=up(I)):(E=kS,R=ES);let F=!1;for(const ce of E){const ie=l[ce];it(ie)?F?l[ce]=R[ce]:l[ce]=I[ce]:F=!0}const L=N?Kk(l,c,p):y?Zk(l):Xw(l),P=L||Jw(l);if(P)return ot.invalid(P);const B=N?fy(l,c,p):y?py(l):l,[W,X]=Cc(B,f,o),re=new ot({ts:W,zone:o,o:X,loc:i});return l.weekday&&C&&e.weekday!==re.weekday?ot.invalid("mismatched weekday",`you can't specify both a weekday of ${l.weekday} and a date of ${re.toISO()}`):re}static fromISO(e,n={}){const[o,i]=zT(e);return al(o,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[o,i]=BT(e);return al(o,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[o,i]=HT(e);return al(o,i,n,"HTTP",n)}static fromFormat(e,n,o={}){if(it(e)||it(n))throw new $n("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:l=null}=o,c=kt.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0}),[p,h,f,y]=vN(c,e,n);return y?ot.invalid(y):al(p,h,o,`format ${n}`,e,f)}static fromString(e,n,o={}){return ot.fromFormat(e,n,o)}static fromSQL(e,n={}){const[o,i]=ZT(e);return al(o,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new $n("need to specify a reason the DateTime is invalid");const o=e instanceof Or?e:new Or(e,n);if(Kt.throwOnInvalid)throw new jk(o);return new ot({invalid:o})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const o=CS(e,kt.fromObject(n));return o?o.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return SS(Cn.parseFormat(e),kt.fromObject(n)).map(i=>i.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?fp(this).weekYear:NaN}get weekNumber(){return this.isValid?fp(this).weekNumber:NaN}get weekday(){return this.isValid?fp(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?pp(this).weekday:NaN}get localWeekNumber(){return this.isValid?pp(this).weekNumber:NaN}get localWeekYear(){return this.isValid?pp(this).weekYear:NaN}get ordinal(){return this.isValid?up(this.c).ordinal:NaN}get monthShort(){return this.isValid?cc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?cc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?cc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?cc.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,o=td(this.c),i=this.zone.offset(o-e),l=this.zone.offset(o+e),c=this.zone.offset(o-i*n),p=this.zone.offset(o-l*n);if(c===p)return[this];const h=o-c*n,f=o-p*n,y=pc(h,c),w=pc(f,p);return y.hour===w.hour&&y.minute===w.minute&&y.second===w.second&&y.millisecond===w.millisecond?[_o(this,{ts:h}),_o(this,{ts:f})]:[this]}get isInLeapYear(){return zl(this.year)}get daysInMonth(){return _c(this.year,this.month)}get daysInYear(){return this.isValid?Zi(this.year):NaN}get weeksInWeekYear(){return this.isValid?El(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?El(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:o,calendar:i}=Cn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:o,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(Tn.instance(e),n)}toLocal(){return this.setZone(Kt.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:o=!1}={}){if(e=Gs(e,Kt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||o){const l=e.offset(this.ts),c=this.toObject();[i]=Cc(c,l,e)}return _o(this,{ts:i,zone:e})}else return ot.invalid(fc(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:o}={}){const i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:o});return _o(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=Pc(e,Ty),{minDaysInFirstWeek:o,startOfWeek:i}=hy(n,this.loc),l=!it(n.weekYear)||!it(n.weekNumber)||!it(n.weekday),c=!it(n.ordinal),p=!it(n.year),h=!it(n.month)||!it(n.day),f=p||h,y=n.weekYear||n.weekNumber;if((f||c)&&y)throw new qi("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new qi("Can't mix ordinal dates with month/day");let w;l?w=fy({...Dc(this.c,o,i),...n},o,i):it(n.ordinal)?(w={...this.toObject(),...n},it(n.day)&&(w.day=Math.min(_c(w.year,w.month),w.day))):w=py({...up(this.c),...n});const[S,C]=Cc(w,this.o,this.zone);return _o(this,{ts:S,o:C})}plus(e){if(!this.isValid)return this;const n=yt.fromDurationLike(e);return _o(this,Ey(this,n))}minus(e){if(!this.isValid)return this;const n=yt.fromDurationLike(e).negate();return _o(this,Ey(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const o={},i=yt.normalizeUnit(e);switch(i){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(i==="weeks")if(n){const l=this.loc.getStartOfWeek(),{weekday:c}=this;cthis.valueOf(),p=c?this:e,h=c?e:this,f=nN(p,h,l,i);return c?f.negate():f}diffNow(e="milliseconds",n={}){return this.diff(ot.now(),e,n)}until(e){return this.isValid?Ut.fromDateTimes(this,e):this}hasSame(e,n,o){if(!this.isValid)return!1;const i=e.valueOf(),l=this.setZone(e.zone,{keepLocalTime:!0});return l.startOf(n,o)<=i&&i<=l.endOf(n,o)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||ot.fromObject({},{zone:this.zone}),o=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(ot.isDateTime))throw new $n("max requires all arguments be DateTimes");return my(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,o={}){const{locale:i=null,numberingSystem:l=null}=o,c=kt.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return bS(c,e,n)}static fromStringExplain(e,n,o={}){return ot.fromFormatExplain(e,n,o)}static get DATE_SHORT(){return Fc}static get DATE_MED(){return Ow}static get DATE_MED_WITH_WEEKDAY(){return Tk}static get DATE_FULL(){return Rw}static get DATE_HUGE(){return Iw}static get TIME_SIMPLE(){return Mw}static get TIME_WITH_SECONDS(){return Fw}static get TIME_WITH_SHORT_OFFSET(){return Dw}static get TIME_WITH_LONG_OFFSET(){return _w}static get TIME_24_SIMPLE(){return Pw}static get TIME_24_WITH_SECONDS(){return Aw}static get TIME_24_WITH_SHORT_OFFSET(){return $w}static get TIME_24_WITH_LONG_OFFSET(){return Lw}static get DATETIME_SHORT(){return zw}static get DATETIME_SHORT_WITH_SECONDS(){return Bw}static get DATETIME_MED(){return Hw}static get DATETIME_MED_WITH_SECONDS(){return Ww}static get DATETIME_MED_WITH_WEEKDAY(){return Nk}static get DATETIME_FULL(){return Vw}static get DATETIME_FULL_WITH_SECONDS(){return Uw}static get DATETIME_HUGE(){return Gw}static get DATETIME_HUGE_WITH_SECONDS(){return qw}}function ll(t){if(ot.isDateTime(t))return t;if(t&&t.valueOf&&Ho(t.valueOf()))return ot.fromJSDate(t);if(t&&typeof t=="object")return ot.fromObject(t);throw new $n(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const Qh=()=>u.jsx("div",{className:"p-5 text-center",children:u.jsx("img",{src:"./loading.gif",width:40})}),jN=({onBack:t})=>{const{locale:e}=we(),[n,o]=v.useState([]),[i,l]=v.useState("km"),[c,p]=v.useState(!0);return v.useEffect(()=>{(async()=>{const f=await me("get-service-history");f&&(o(f.servicingHistory),l(f.mileageUnit==="kilometers"?"km":"mi")),p(!1)})()},[]),u.jsxs("div",{className:"p-4",children:[u.jsxs("button",{className:"mb-2 text-muted",onClick:t,children:[u.jsx("i",{className:"bi-arrow-left"})," ",e.back]}),u.jsx("h2",{className:"mb-4",children:e.serviceHistory}),c?u.jsx(Qh,{}):n.length?n.map((h,f)=>{var y;return u.jsxs(gt,{className:"mb-3",children:[u.jsxs(gt.Header,{className:"flex justify-between items-center text-sm text-muted",children:[u.jsx("div",{children:h.mechanic_label}),u.jsx("div",{children:(y=ot.fromMillis(h.date))==null?void 0:y.toLocaleString()})]}),u.jsx(gt.Body,{children:u.jsxs("div",{children:[e.replaced," ",u.jsx("strong",{children:e[h.serviced_part]})," @ ",i==="mi"?(h.mileage_km*.6214).toFixed(1):h.mileage_km,` ${i}`]})})]},f)}):u.jsxs(Vr,{variant:"info",children:[u.jsx("i",{className:"bi-info-circle me-2"}),e.noServiceHistory]})]})},EN=()=>{const{event:t,locale:e}=we(),{connectedVehicle:n}=Gt(),[o,i]=v.useState(t.servicingData),l=v.useMemo(()=>t.vehicleType||!1,[t]),c=v.useMemo(()=>t.isVehicleElectric||!1,[t]),[p,h]=v.useState(!1);return n?p?u.jsx(jN,{onBack:()=>h(!1)}):u.jsx(Tw.Provider,{value:{stats:o,setStats:i},children:u.jsxs("div",{className:"p-4 h-full flex flex-col",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"mb-2",children:e.servicing}),o&&u.jsxs("button",{className:"link text-primary text-xs font-bold",onClick:()=>h(!0),children:[u.jsx("i",{className:"bi-clock-history me-1"}),e.viewServiceHistory]})]}),o?u.jsxs("div",{className:`h-full relative ${l==="bike"?"bg-[url('/bike-servicing.png')]":"bg-[url('/vehicle-servicing.png')]"} bg-cover`,children:[u.jsxs("div",{className:`absolute top-[135px] ${l==="bike"?"left-[327px] w-[145px]":"left-[300px] w-[160px]"} text-center text-gray-500 h-[100px] flex justify-center items-center flex-col`,children:[u.jsxs("p",{className:"font-bold mb-2",children:[c&&u.jsx("i",{className:"bi-lightning-charge-fill me-2"}),n.label]}),u.jsxs(Pt,{bg:"dark",text:"secondary",children:[u.jsx("i",{className:"bi-speedometer me-1"}),n.mileageUnit=="miles"?`${Math.floor(n.mileage*.621371)} mi`:`${n.mileage} km`]})]}),u.jsx(ac,{top:65,left:0,items:["suspension"]}),u.jsx(ac,{top:-60,right:0,items:c?["evMotor","evBattery","evCoolant"]:["engineOil","clutch","airFilter","sparkPlugs"]}),u.jsx(ac,{bottom:30,left:0,items:["tyres"]}),u.jsx(ac,{bottom:30,right:0,items:["brakePads"]})]}):u.jsxs(Vr,{variant:"warning",className:"mt-2",children:[u.jsx("i",{className:"bi-info-circle me-2"}),e.noServicingData]})]})}):null},kN=()=>{const{locale:t}=we(),{tabletFrame:e,setTabletFrame:n,wallpaper:o,setWallpaper:i}=Gt();return v.useEffect(()=>{(async()=>{await me("save-preferences",{preferences:{tabletFrame:e,wallpaper:o}})})()},[e,o]),u.jsxs("div",{className:"p-4",children:[u.jsx("h2",{className:"mb-4",children:t.settings}),u.jsxs("div",{children:[u.jsxs(ue.Group,{className:"mb-3",children:[u.jsx(ue.Label,{children:t.tabletStyle}),u.jsxs(ue.Select,{value:e,onChange:l=>n(l.target.value),children:[u.jsx("option",{value:"jg-rugged",children:"JG Rugged Pro"}),u.jsx("option",{value:"ifruit-air",children:"iFruit Air"})]})]}),u.jsxs(ue.Group,{children:[u.jsx(ue.Label,{children:t.lockscreenWallpaper}),u.jsx(ue.Control,{type:"text",name:"wallpaper",value:o,onChange:l=>i(l.target.value)})]})]})]})},TS=({id:t,width:e,height:n,fillPercent:o,className:i,fillOverride:l})=>(e=e||20,n=n||40,u.jsxs("svg",{viewBox:"17 11 30 40",xmlns:"http://www.w3.org/2000/svg",style:{width:e,height:n},className:i,children:[u.jsx("defs",{children:u.jsxs("linearGradient",{id:`bottleFillGradient-${t}`,x1:"0%",y1:"100%",x2:"0%",y2:"0%",children:[u.jsx("stop",{offset:l?"100%":`${o}%`,style:{stopColor:l||"white"}}),u.jsx("stop",{offset:l?"100%":`${o}%`,style:{stopColor:l||"#444"}})]})}),u.jsx("path",{d:"m42.6 50.4v-25.7l-6.3-11.1v-1.8h.9v-5.1h-10.4v5.1h.9v1.8l-6.3 11.1v25.8s-.3 6.9 5.4 6.9h5.1.1 5.1c5.7-.1 5.5-7 5.5-7z",fill:`url(#bottleFillGradient-${t})`})]})),Iy=({id:t,filled:e,onRefill:n,onAddNew:o})=>u.jsxs("div",{className:"flex flex-col items-center",children:[u.jsxs("div",{className:`relative w-[120px] h-[240px] flex items-center justify-center ${o||n?"cursor-pointer hover:opacity-70 transition":""}`,onClick:o||n||void 0,children:[u.jsx(TS,{id:t,width:120,height:240,fillPercent:!o&&!n&&e?e:0,className:"absolute",fillOverride:(!e||e<=0)&&!o&&"#513036"}),(o||n)&&u.jsx("i",{className:`bi-${o?"plus-lg":"arrow-repeat"} z-10 text-[40px] mt-5`})]}),u.jsx("div",{className:"text-muted text-xs",children:!o&&(n||!e||e<=0)?"Empty":e?`${Math.round(e)}%`:""})]}),TN=()=>{var C,j,N;const{config:t,event:e,locale:n}=we(),{addInvoiceItem:o}=Gt(),[i,l]=v.useState(((C=e.nitrousData)==null?void 0:C.installedBottles)||0),[c,p]=v.useState(((j=e.nitrousData)==null?void 0:j.filledBottles)||0),h=v.useMemo(()=>{var E;return(E=e.nitrousData)==null?void 0:E.activeBtlCapacity},[e.nitrousData]),[f,y]=v.useState(!1),w=async()=>{if(!await me("has-item",{itemName:"nitrous_install_kit"}))return y(n.nitrous_install_kit||"nitrous_install_kit");if(!await me("install-new-bottle"))return!1;l(I=>I+1),p(I=>I+1),o(n.installNitrous,0)},S=async()=>{if(!await me("has-item",{itemName:"nitrous_bottle"}))return y(n.nitrous_bottle||"nitrous_bottle");if(!await me("refill-bottle"))return!1;p(I=>I+1),o(n.refillNitrous,0)};return u.jsxs("div",{className:"p-4",children:[u.jsx("h2",{className:"mb-4",children:n.nos}),u.jsxs("div",{className:"flex flex-col gap-[35px] items-center",children:[u.jsxs("div",{className:"flex justify-evenly w-full",children:[Array(i).fill("").map((E,R)=>u.jsx(Iy,{id:R,filled:R0&&R===c+1||h<=0&&R===c?S:void 0},R)),iy(!1),text:`You need 1x ${f} to do this!`})]})},NN=({show:t,onClose:e,notes:n})=>{const{locale:o}=we();return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:o.notes}),u.jsx(ye.Body,{children:n})]})},Tt=(t,e)=>{try{return t==null?void 0:t.toLocaleString((e==null?void 0:e.NumberAndDateFormat)||"en-US",{style:"currency",currency:(e==null?void 0:e.Currency)||"USD",maximumFractionDigits:0})}catch{return"InvalidLocale"}},ON=({tune:t,icon:e,name:n,itemName:o,price:i,info:l,blacklist:c,restricted:p,minGameBuild:h,installed:f,setInstalled:y})=>{var X,re;const{config:w,locale:S,event:C}=we(),{mechanicId:j,addInvoiceItem:N}=Gt(),[E,R]=v.useState(!1),[I,F]=v.useState(!1),L=v.useMemo(()=>{var ce;return(ce=w.MechanicLocations[j])==null?void 0:ce.tuning[t].requiresItem},[w,j,t]),P=()=>!(h&&h>C.gameBuild||p&&(p=="electric"&&!C.isVehicleElectric||p=="combustion"&&C.isVehicleElectric)||c&&Array.isArray(c)&&c.includes(C.archetypeName)),B=async()=>{if(!P())return!1;if(L){if(!await me("has-item",{itemName:o}))return F(!0)}else{const ce=await me("get-mechanic-balance",{mechanicId:j});if(i>ce)return F(!0)}y(!0),N(n,i||0)},W=()=>{y(!1)};return u.jsxs("div",{className:`p-3 border-b border-b-[#444] last:border-b-0 flex items-center justify-between ${P()?"":"opacity-40"}`,children:[u.jsxs("div",{className:"flex gap-2 items-center font-semibold",children:[u.jsx("img",{src:`./icons/${e}`,className:"w-[30px] opacity-50"}),u.jsx("span",{children:n})]}),u.jsxs("div",{className:"flex gap-3 items-center",children:[u.jsxs("div",{children:[l&&u.jsx("button",{onClick:()=>R(!0),children:u.jsx("i",{className:"bi-info-circle"})}),u.jsx(NN,{show:E,onClose:()=>R(!1),notes:l})]}),P()?u.jsx("div",{className:"flex-shrink-0",children:f?u.jsxs(ve,{size:"sm",variant:"danger",onClick:W,children:[u.jsx("i",{className:"bi-x-lg me-2"}),u.jsx("span",{children:S.remove})]}):u.jsxs(ve,{size:"sm",variant:"secondary",onClick:B,children:[u.jsx("i",{className:"bi-wrench"}),u.jsx("span",{children:L?u.jsx("span",{className:"ms-2",children:S.install}):u.jsx(Pt,{bg:"white",text:"secondary",className:"ms-2",children:Tt(i,w)})})]})}):u.jsx($l,{placement:"left",overlay:u.jsx(la,{id:"tooltip-disabled",children:h&&h>C.gameBuild?`Requires game build ${h} or higher`:S.tuningNotAvailable}),children:u.jsx("i",{className:"bi-ban"})})]}),u.jsx(Xc,{show:I,onHide:()=>F(!1),text:L?(X=S.itemRequired)==null?void 0:X.replace("%s",`1x ${S[o]||o}`):(re=S.insufficientFunds)==null?void 0:re.replace("%s",Tt(i,w))})]})},RN=()=>{const{event:t,setEvent:e,config:n,locale:o}=we(),[i,l]=v.useState(t.tuningConfig||{}),c=async(h,f,y)=>{const w={...i,[h]:y?f:!1};await me("install-tune",{tune:h,option:f,currentOption:i[h],installed:y,tuningConfig:w})&&(l({...w}),e(C=>({...C,tuningConfig:w})))},p=v.useMemo(()=>{var h,f;return!t.mechanicTuningConfig||!((f=(h=Object.values(t.mechanicTuningConfig))==null?void 0:h.filter(({enabled:y})=>y))!=null&&f.length)},[t.mechanicTuningConfig]);return u.jsxs("div",{className:"p-4",children:[u.jsx("h2",{className:"mb-4",children:"Tuning"}),u.jsx("div",{className:"columns-2 gap-4",children:p?u.jsxs(Vr,{variant:"warning",className:"mt-2",children:[u.jsx("i",{className:"bi-info-circle me-2"}),o.noTuningOptionsAvailable]}):Object.keys(n.Tuning).sort().map(h=>{var f,y,w;return((y=(f=t.mechanicTuningConfig)==null?void 0:f[h])==null?void 0:y.enabled)&&n.Tuning[h]&&u.jsxs(gt,{className:"mb-4 break-inside-avoid will-change-transform",children:[u.jsx(gt.Header,{children:o[h]||h}),u.jsx(gt.Body,{className:"p-0",children:(w=n.Tuning[h])==null?void 0:w.map((S,C)=>v.createElement(ON,{...S,key:C,tune:h,installed:i[h]==C+1,setInstalled:j=>c(h,C+1,j)}))})]},h)})})]})};var mp={exports:{}},fl={exports:{}},IN=fl.exports,My;function MN(){return My||(My=1,function(t,e){(function(n,o){o(e,zc())})(IN,function(n,o){function i(g,b,T,O,A,M,$){try{var Z=g[M]($),K=Z.value}catch(Y){return void T(Y)}Z.done?b(K):Promise.resolve(K).then(O,A)}function l(g){return function(){var b=this,T=arguments;return new Promise(function(O,A){var M=g.apply(b,T);function $(K){i(M,O,A,$,Z,"next",K)}function Z(K){i(M,O,A,$,Z,"throw",K)}$(void 0)})}}function c(){return(c=Object.assign||function(g){for(var b=1;b=0||(A[T]=g[T]);return A}function h(g){var b=function(T,O){if(typeof T!="object"||T===null)return T;var A=T[Symbol.toPrimitive];if(A!==void 0){var M=A.call(T,O);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}(g,"string");return typeof b=="symbol"?b:String(b)}o=o&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var f={init:"init"},y=function(g){var b=g.value;return b===void 0?"":b},w=function(){return o.createElement(o.Fragment,null," ")},S={Cell:y,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function C(){for(var g=arguments.length,b=new Array(g),T=0;T(M=typeof M=="number"?M:1/0)){var $=A;A=M,M=$}return g.filter(function(Z){return b.some(function(K){var Y=Z.values[K];return Y>=A&&Y<=M})})};ga.autoRemove=function(g){return!g||typeof g[0]!="number"&&typeof g[1]!="number"};var bs=Object.freeze({__proto__:null,text:to,exactText:Ul,exactTextCase:ni,includes:ri,includesAll:si,includesSome:oi,includesValue:ii,exact:Kr,equals:Zr,between:ga});f.resetFilters="resetFilters",f.setFilter="setFilter",f.setAllFilters="setAllFilters";var va=function(g){g.stateReducers.push(Gl),g.useInstance.push(ql)};function Gl(g,b,T,O){if(b.type===f.init)return c({filters:[]},g);if(b.type===f.resetFilters)return c({},g,{filters:O.initialState.filters||[]});if(b.type===f.setFilter){var A=b.columnId,M=b.filterValue,$=O.allColumns,Z=O.filterTypes,K=$.find(function(xe){return xe.id===A});if(!K)throw new Error("React-Table: Could not find a column with id: "+A);var Y=J(K.filter,Z||{},bs),fe=g.filters.find(function(xe){return xe.id===A}),se=I(M,fe&&fe.value);return Ee(Y.autoRemove,se,K)?c({},g,{filters:g.filters.filter(function(xe){return xe.id!==A})}):c({},g,fe?{filters:g.filters.map(function(xe){return xe.id===A?{id:A,value:se}:xe})}:{filters:[].concat(g.filters,[{id:A,value:se}])})}if(b.type===f.setAllFilters){var pe=b.filters,ee=O.allColumns,le=O.filterTypes;return c({},g,{filters:I(pe,g.filters).filter(function(xe){var je=ee.find(function($e){return $e.id===xe.id});return!Ee(J(je.filter,le||{},bs).autoRemove,xe.value,je)})})}}function ql(g){var b=g.data,T=g.rows,O=g.flatRows,A=g.rowsById,M=g.allColumns,$=g.filterTypes,Z=g.manualFilters,K=g.defaultCanFilter,Y=K!==void 0&&K,fe=g.disableFilters,se=g.state.filters,pe=g.dispatch,ee=g.autoResetFilters,le=ee===void 0||ee,xe=o.useCallback(function(Re,Xe){pe({type:f.setFilter,columnId:Re,filterValue:Xe})},[pe]),je=o.useCallback(function(Re){pe({type:f.setAllFilters,filters:Re})},[pe]);M.forEach(function(Re){var Xe=Re.id,ut=Re.accessor,qe=Re.defaultCanFilter,Ke=Re.disableFilters;Re.canFilter=ut?De(Ke!==!0&&void 0,fe!==!0&&void 0,!0):De(qe,Y,!1),Re.setFilter=function(et){return xe(Re.id,et)};var pt=se.find(function(et){return et.id===Xe});Re.filterValue=pt&&pt.value});var $e=o.useMemo(function(){if(Z||!se.length)return[T,O,A];var Re=[],Xe={};return[function ut(qe,Ke){Ke===void 0&&(Ke=0);var pt=qe;return(pt=se.reduce(function(et,ht){var dt=ht.id,jt=ht.value,ze=M.find(function(At){return At.id===dt});if(!ze)return et;Ke===0&&(ze.preFilteredRows=et);var ct=J(ze.filter,$||{},bs);return ct?(ze.filteredRows=ct(et,[dt],jt),ze.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+ze.id+"."),et)},qe)).forEach(function(et){Re.push(et),Xe[et.id]=et,et.subRows&&(et.subRows=et.subRows&&et.subRows.length>0?ut(et.subRows,Ke+1):et.subRows)}),pt}(T),Re,Xe]},[Z,se,T,O,A,M,$]),st=$e[0],Le=$e[1],ge=$e[2];o.useMemo(function(){M.filter(function(Re){return!se.find(function(Xe){return Xe.id===Re.id})}).forEach(function(Re){Re.preFilteredRows=st,Re.filteredRows=st})},[st,se,M]);var Qe=F(le);P(function(){Qe()&&pe({type:f.resetFilters})},[pe,Z?null:b]),Object.assign(g,{preFilteredRows:T,preFilteredFlatRows:O,preFilteredRowsById:A,filteredRows:st,filteredFlatRows:Le,filteredRowsById:ge,rows:st,flatRows:Le,rowsById:ge,setFilter:xe,setAllFilters:je})}va.pluginName="useFilters",f.resetGlobalFilter="resetGlobalFilter",f.setGlobalFilter="setGlobalFilter";var ai=function(g){g.stateReducers.push(Kl),g.useInstance.push(no)};function Kl(g,b,T,O){if(b.type===f.resetGlobalFilter)return c({},g,{globalFilter:O.initialState.globalFilter||void 0});if(b.type===f.setGlobalFilter){var A=b.filterValue,M=O.userFilterTypes,$=J(O.globalFilter,M||{},bs),Z=I(A,g.globalFilter);return Ee($.autoRemove,Z)?(g.globalFilter,p(g,["globalFilter"])):c({},g,{globalFilter:Z})}}function no(g){var b=g.data,T=g.rows,O=g.flatRows,A=g.rowsById,M=g.allColumns,$=g.filterTypes,Z=g.globalFilter,K=g.manualGlobalFilter,Y=g.state.globalFilter,fe=g.dispatch,se=g.autoResetGlobalFilter,pe=se===void 0||se,ee=g.disableGlobalFilter,le=o.useCallback(function(ge){fe({type:f.setGlobalFilter,filterValue:ge})},[fe]),xe=o.useMemo(function(){if(K||Y===void 0)return[T,O,A];var ge=[],Qe={},Re=J(Z,$||{},bs);if(!Re)return console.warn("Could not find a valid 'globalFilter' option."),T;M.forEach(function(ut){var qe=ut.disableGlobalFilter;ut.canFilter=De(qe!==!0&&void 0,ee!==!0&&void 0,!0)});var Xe=M.filter(function(ut){return ut.canFilter===!0});return[function ut(qe){return(qe=Re(qe,Xe.map(function(Ke){return Ke.id}),Y)).forEach(function(Ke){ge.push(Ke),Qe[Ke.id]=Ke,Ke.subRows=Ke.subRows&&Ke.subRows.length?ut(Ke.subRows):Ke.subRows}),qe}(T),ge,Qe]},[K,Y,Z,$,M,T,O,A,ee]),je=xe[0],$e=xe[1],st=xe[2],Le=F(pe);P(function(){Le()&&fe({type:f.resetGlobalFilter})},[fe,K?null:b]),Object.assign(g,{preGlobalFilteredRows:T,preGlobalFilteredFlatRows:O,preGlobalFilteredRowsById:A,globalFilteredRows:je,globalFilteredFlatRows:$e,globalFilteredRowsById:st,rows:je,flatRows:$e,rowsById:st,setGlobalFilter:le,disableGlobalFilter:ee})}function li(g,b){return b.reduce(function(T,O){return T+(typeof O=="number"?O:0)},0)}ai.pluginName="useGlobalFilter";var Cs=Object.freeze({__proto__:null,sum:li,min:function(g){var b=g[0]||0;return g.forEach(function(T){typeof T=="number"&&(b=Math.min(b,T))}),b},max:function(g){var b=g[0]||0;return g.forEach(function(T){typeof T=="number"&&(b=Math.max(b,T))}),b},minMax:function(g){var b=g[0]||0,T=g[0]||0;return g.forEach(function(O){typeof O=="number"&&(b=Math.min(b,O),T=Math.max(T,O))}),b+".."+T},average:function(g){return li(0,g)/g.length},median:function(g){if(!g.length)return null;var b=Math.floor(g.length/2),T=[].concat(g).sort(function(O,A){return O-A});return g.length%2!=0?T[b]:(T[b-1]+T[b])/2},unique:function(g){return Array.from(new Set(g).values())},uniqueCount:function(g){return new Set(g).size},count:function(g){return g.length}}),cd=[],ro={};f.resetGroupBy="resetGroupBy",f.setGroupBy="setGroupBy",f.toggleGroupBy="toggleGroupBy";var so=function(g){g.getGroupByToggleProps=[ui],g.stateReducers.push(ya),g.visibleColumnsDeps.push(function(b,T){var O=T.instance;return[].concat(b,[O.state.groupBy])}),g.visibleColumns.push(dd),g.useInstance.push(pd),g.prepareRow.push(Yr)};so.pluginName="useGroupBy";var ui=function(g,b){var T=b.header;return[g,{onClick:T.canGroupBy?function(O){O.persist(),T.toggleGroupBy()}:void 0,style:{cursor:T.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function ya(g,b,T,O){if(b.type===f.init)return c({groupBy:[]},g);if(b.type===f.resetGroupBy)return c({},g,{groupBy:O.initialState.groupBy||[]});if(b.type===f.setGroupBy)return c({},g,{groupBy:b.value});if(b.type===f.toggleGroupBy){var A=b.columnId,M=b.value,$=M!==void 0?M:!g.groupBy.includes(A);return c({},g,$?{groupBy:[].concat(g.groupBy,[A])}:{groupBy:g.groupBy.filter(function(Z){return Z!==A})})}}function dd(g,b){var T=b.instance.state.groupBy,O=T.map(function(M){return g.find(function($){return $.id===M})}).filter(Boolean),A=g.filter(function(M){return!T.includes(M.id)});return(g=[].concat(O,A)).forEach(function(M){M.isGrouped=T.includes(M.id),M.groupedIndex=T.indexOf(M.id)}),g}var fd={};function pd(g){var b=g.data,T=g.rows,O=g.flatRows,A=g.rowsById,M=g.allColumns,$=g.flatHeaders,Z=g.groupByFn,K=Z===void 0?xa:Z,Y=g.manualGroupBy,fe=g.aggregations,se=fe===void 0?fd:fe,pe=g.plugins,ee=g.state.groupBy,le=g.dispatch,xe=g.autoResetGroupBy,je=xe===void 0||xe,$e=g.disableGroupBy,st=g.defaultCanGroupBy,Le=g.getHooks;R(pe,["useColumnOrder","useFilters"],"useGroupBy");var ge=F(g);M.forEach(function(ze){var ct=ze.accessor,At=ze.defaultGroupBy,fn=ze.disableGroupBy;ze.canGroupBy=ct?De(ze.canGroupBy,fn!==!0&&void 0,$e!==!0&&void 0,!0):De(ze.canGroupBy,At,st,!1),ze.canGroupBy&&(ze.toggleGroupBy=function(){return g.toggleGroupBy(ze.id)}),ze.Aggregated=ze.Aggregated||ze.Cell});var Qe=o.useCallback(function(ze,ct){le({type:f.toggleGroupBy,columnId:ze,value:ct})},[le]),Re=o.useCallback(function(ze){le({type:f.setGroupBy,value:ze})},[le]);$.forEach(function(ze){ze.getGroupByToggleProps=j(Le().getGroupByToggleProps,{instance:ge(),header:ze})});var Xe=o.useMemo(function(){if(Y||!ee.length)return[T,O,A,cd,ro,O,A];var ze=ee.filter(function(Qt){return M.find(function(Dr){return Dr.id===Qt})}),ct=[],At={},fn=[],Ue={},Ot=[],Wt={},pn=function Qt(Dr,wr,iu){if(wr===void 0&&(wr=0),wr===ze.length)return Dr.map(function(xi){return c({},xi,{depth:wr})});var go=ze[wr],vo=K(Dr,go);return Object.entries(vo).map(function(xi,au){var _a=xi[0],yo=xi[1],xo=go+":"+_a,Pa=Qt(yo,wr+1,xo=iu?iu+">"+xo:xo),Xr=wr?Ae(yo,"leafRows"):yo,jd=function(Rn,wi,lu){var _r={};return M.forEach(function(Rt){if(ze.includes(Rt.id))_r[Rt.id]=wi[0]?wi[0].values[Rt.id]:null;else{var uu=typeof Rt.aggregate=="function"?Rt.aggregate:se[Rt.aggregate]||Cs[Rt.aggregate];if(uu){var Si=wi.map(function(wo){return wo.values[Rt.id]}),kd=Rn.map(function(wo){var So=wo.values[Rt.id];if(!lu&&Rt.aggregateValue){var bi=typeof Rt.aggregateValue=="function"?Rt.aggregateValue:se[Rt.aggregateValue]||Cs[Rt.aggregateValue];if(!bi)throw console.info({column:Rt}),new Error("React Table: Invalid column.aggregateValue option for column listed above");So=bi(So,wo,Rt)}return So});_r[Rt.id]=uu(kd,Si)}else{if(Rt.aggregate)throw console.info({column:Rt}),new Error("React Table: Invalid column.aggregate option for column listed above");_r[Rt.id]=null}}}),_r}(Xr,yo,wr),Ed={id:xo,isGrouped:!0,groupByID:go,groupByVal:_a,values:jd,subRows:Pa,leafRows:Xr,depth:wr,index:au};return Pa.forEach(function(Rn){ct.push(Rn),At[Rn.id]=Rn,Rn.isGrouped?(fn.push(Rn),Ue[Rn.id]=Rn):(Ot.push(Rn),Wt[Rn.id]=Rn)}),Ed})}(T);return pn.forEach(function(Qt){ct.push(Qt),At[Qt.id]=Qt,Qt.isGrouped?(fn.push(Qt),Ue[Qt.id]=Qt):(Ot.push(Qt),Wt[Qt.id]=Qt)}),[pn,ct,At,fn,Ue,Ot,Wt]},[Y,ee,T,O,A,M,se,K]),ut=Xe[0],qe=Xe[1],Ke=Xe[2],pt=Xe[3],et=Xe[4],ht=Xe[5],dt=Xe[6],jt=F(je);P(function(){jt()&&le({type:f.resetGroupBy})},[le,Y?null:b]),Object.assign(g,{preGroupedRows:T,preGroupedFlatRow:O,preGroupedRowsById:A,groupedRows:ut,groupedFlatRows:qe,groupedRowsById:Ke,onlyGroupedFlatRows:pt,onlyGroupedRowsById:et,nonGroupedFlatRows:ht,nonGroupedRowsById:dt,rows:ut,flatRows:qe,rowsById:Ke,toggleGroupBy:Qe,setGroupBy:Re})}function Yr(g){g.allCells.forEach(function(b){var T;b.isGrouped=b.column.isGrouped&&b.column.id===g.groupByID,b.isPlaceholder=!b.isGrouped&&b.column.isGrouped,b.isAggregated=!b.isGrouped&&!b.isPlaceholder&&((T=g.subRows)==null?void 0:T.length)})}function xa(g,b){return g.reduce(function(T,O,A){var M=""+O.values[b];return T[M]=Array.isArray(T[M])?T[M]:[],T[M].push(O),T},{})}var wa=/([0-9]+)/gm;function Sa(g,b){return g===b?0:g>b?1:-1}function js(g,b,T){return[g.values[T],b.values[T]]}function ba(g){return typeof g=="number"?isNaN(g)||g===1/0||g===-1/0?"":String(g):typeof g=="string"?g:""}var Zl=Object.freeze({__proto__:null,alphanumeric:function(g,b,T){var O=js(g,b,T),A=O[0],M=O[1];for(A=ba(A),M=ba(M),A=A.split(wa).filter(Boolean),M=M.split(wa).filter(Boolean);A.length&&M.length;){var $=A.shift(),Z=M.shift(),K=parseInt($,10),Y=parseInt(Z,10),fe=[K,Y].sort();if(isNaN(fe[0])){if($>Z)return 1;if(Z>$)return-1}else{if(isNaN(fe[1]))return isNaN(K)?-1:1;if(K>Y)return 1;if(Y>K)return-1}}return A.length-M.length},datetime:function(g,b,T){var O=js(g,b,T),A=O[0],M=O[1];return Sa(A=A.getTime(),M=M.getTime())},basic:function(g,b,T){var O=js(g,b,T);return Sa(O[0],O[1])},string:function(g,b,T){var O=js(g,b,T),A=O[0],M=O[1];for(A=A.split("").filter(Boolean),M=M.split("").filter(Boolean);A.length&&M.length;){var $=A.shift(),Z=M.shift(),K=$.toLowerCase(),Y=Z.toLowerCase();if(K>Y)return 1;if(Y>K)return-1;if($>Z)return 1;if(Z>$)return-1}return A.length-M.length},number:function(g,b,T){var O=js(g,b,T),A=O[0],M=O[1],$=/[^0-9.]/gi;return Sa(A=Number(String(A).replace($,"")),M=Number(String(M).replace($,"")))}});f.resetSortBy="resetSortBy",f.setSortBy="setSortBy",f.toggleSortBy="toggleSortBy",f.clearSortBy="clearSortBy",S.sortType="alphanumeric",S.sortDescFirst=!1;var Ca=function(g){g.getSortByToggleProps=[hd],g.stateReducers.push(md),g.useInstance.push(Lt)};Ca.pluginName="useSortBy";var hd=function(g,b){var T=b.instance,O=b.column,A=T.isMultiSortEvent,M=A===void 0?function($){return $.shiftKey}:A;return[g,{onClick:O.canSort?function($){$.persist(),O.toggleSortBy(void 0,!T.disableMultiSort&&M($))}:void 0,style:{cursor:O.canSort?"pointer":void 0},title:O.canSort?"Toggle SortBy":void 0}]};function md(g,b,T,O){if(b.type===f.init)return c({sortBy:[]},g);if(b.type===f.resetSortBy)return c({},g,{sortBy:O.initialState.sortBy||[]});if(b.type===f.clearSortBy)return c({},g,{sortBy:g.sortBy.filter(function(ge){return ge.id!==b.columnId})});if(b.type===f.setSortBy)return c({},g,{sortBy:b.sortBy});if(b.type===f.toggleSortBy){var A,M=b.columnId,$=b.desc,Z=b.multi,K=O.allColumns,Y=O.disableMultiSort,fe=O.disableSortRemove,se=O.disableMultiRemove,pe=O.maxMultiSortColCount,ee=pe===void 0?Number.MAX_SAFE_INTEGER:pe,le=g.sortBy,xe=K.find(function(ge){return ge.id===M}).sortDescFirst,je=le.find(function(ge){return ge.id===M}),$e=le.findIndex(function(ge){return ge.id===M}),st=$!=null,Le=[];return(A=!Y&&Z?je?"toggle":"add":$e!==le.length-1||le.length!==1?"replace":je?"toggle":"replace")!="toggle"||fe||st||Z&&se||!(je&&je.desc&&!xe||!je.desc&&xe)||(A="remove"),A==="replace"?Le=[{id:M,desc:st?$:xe}]:A==="add"?(Le=[].concat(le,[{id:M,desc:st?$:xe}])).splice(0,Le.length-ee):A==="toggle"?Le=le.map(function(ge){return ge.id===M?c({},ge,{desc:st?$:!je.desc}):ge}):A==="remove"&&(Le=le.filter(function(ge){return ge.id!==M})),c({},g,{sortBy:Le})}}function Lt(g){var b=g.data,T=g.rows,O=g.flatRows,A=g.allColumns,M=g.orderByFn,$=M===void 0?Yl:M,Z=g.sortTypes,K=g.manualSortBy,Y=g.defaultCanSort,fe=g.disableSortBy,se=g.flatHeaders,pe=g.state.sortBy,ee=g.dispatch,le=g.plugins,xe=g.getHooks,je=g.autoResetSortBy,$e=je===void 0||je;R(le,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var st=o.useCallback(function(qe){ee({type:f.setSortBy,sortBy:qe})},[ee]),Le=o.useCallback(function(qe,Ke,pt){ee({type:f.toggleSortBy,columnId:qe,desc:Ke,multi:pt})},[ee]),ge=F(g);se.forEach(function(qe){var Ke=qe.accessor,pt=qe.canSort,et=qe.disableSortBy,ht=qe.id,dt=Ke?De(et!==!0&&void 0,fe!==!0&&void 0,!0):De(Y,pt,!1);qe.canSort=dt,qe.canSort&&(qe.toggleSortBy=function(ze,ct){return Le(qe.id,ze,ct)},qe.clearSortBy=function(){ee({type:f.clearSortBy,columnId:qe.id})}),qe.getSortByToggleProps=j(xe().getSortByToggleProps,{instance:ge(),column:qe});var jt=pe.find(function(ze){return ze.id===ht});qe.isSorted=!!jt,qe.sortedIndex=pe.findIndex(function(ze){return ze.id===ht}),qe.isSortedDesc=qe.isSorted?jt.desc:void 0});var Qe=o.useMemo(function(){if(K||!pe.length)return[T,O];var qe=[],Ke=pe.filter(function(pt){return A.find(function(et){return et.id===pt.id})});return[function pt(et){var ht=$(et,Ke.map(function(dt){var jt=A.find(function(At){return At.id===dt.id});if(!jt)throw new Error("React-Table: Could not find a column with id: "+dt.id+" while sorting");var ze=jt.sortType,ct=ae(ze)||(Z||{})[ze]||Zl[ze];if(!ct)throw new Error("React-Table: Could not find a valid sortType of '"+ze+"' for column '"+dt.id+"'.");return function(At,fn){return ct(At,fn,dt.id,dt.desc)}}),Ke.map(function(dt){var jt=A.find(function(ze){return ze.id===dt.id});return jt&&jt.sortInverted?dt.desc:!dt.desc}));return ht.forEach(function(dt){qe.push(dt),dt.subRows&&dt.subRows.length!==0&&(dt.subRows=pt(dt.subRows))}),ht}(T),qe]},[K,pe,T,O,A,$,Z]),Re=Qe[0],Xe=Qe[1],ut=F($e);P(function(){ut()&&ee({type:f.resetSortBy})},[K?null:b]),Object.assign(g,{preSortedRows:T,preSortedFlatRows:O,sortedRows:Re,sortedFlatRows:Xe,rows:Re,flatRows:Xe,setSortBy:st,toggleSortBy:Le})}function Yl(g,b,T){return[].concat(g).sort(function(O,A){for(var M=0;Mg.pageIndex?Z=A===-1?M.length>=g.pageSize:$-1),Z?c({},g,{pageIndex:$}):g}if(b.type===f.setPageSize){var K=b.pageSize,Y=g.pageSize*g.pageIndex;return c({},g,{pageIndex:Math.floor(Y/K),pageSize:K})}}function di(g){var b=g.rows,T=g.autoResetPage,O=T===void 0||T,A=g.manualExpandedKey,M=A===void 0?"expanded":A,$=g.plugins,Z=g.pageCount,K=g.paginateExpandedRows,Y=K===void 0||K,fe=g.expandSubRows,se=fe===void 0||fe,pe=g.state,ee=pe.pageSize,le=pe.pageIndex,xe=pe.expanded,je=pe.globalFilter,$e=pe.filters,st=pe.groupBy,Le=pe.sortBy,ge=g.dispatch,Qe=g.data,Re=g.manualPagination;R($,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var Xe=F(O);P(function(){Xe()&&ge({type:f.resetPage})},[ge,Re?null:Qe,je,$e,st,Le]);var ut=Re?Z:Math.ceil(b.length/ee),qe=o.useMemo(function(){return ut>0?[].concat(new Array(ut)).fill(null).map(function(ct,At){return At}):[]},[ut]),Ke=o.useMemo(function(){var ct;if(Re)ct=b;else{var At=ee*le,fn=At+ee;ct=b.slice(At,fn)}return Y?ct:Me(ct,{manualExpandedKey:M,expanded:xe,expandSubRows:se})},[se,xe,M,Re,le,ee,Y,b]),pt=le>0,et=ut===-1?Ke.length>=ee:le-1&&M.push(A.splice(K,1)[0])};A.length&&O.length;)$();return[].concat(M,A)}function vi(g){var b=g.dispatch;g.setColumnOrder=o.useCallback(function(T){return b({type:f.setColumnOrder,columnOrder:T})},[b])}Oa.pluginName="useColumnOrder",S.canResize=!0,f.columnStartResizing="columnStartResizing",f.columnResizing="columnResizing",f.columnDoneResizing="columnDoneResizing",f.resetResize="resetResize";var xr=function(g){g.getResizerProps=[Mr],g.getHeaderProps.push({style:{position:"relative"}}),g.stateReducers.push(Fr),g.useInstance.push(lo),g.useInstanceBeforeDimensions.push(ao)},Mr=function(g,b){var T=b.instance,O=b.header,A=T.dispatch,M=function($,Z){var K=!1;if($.type==="touchstart"){if($.touches&&$.touches.length>1)return;K=!0}var Y,fe,se=function(Le){var ge=[];return function Qe(Re){Re.columns&&Re.columns.length&&Re.columns.map(Qe),ge.push(Re)}(Le),ge}(Z).map(function(Le){return[Le.id,Le.totalWidth]}),pe=K?Math.round($.touches[0].clientX):$.clientX,ee=function(){window.cancelAnimationFrame(Y),Y=null,A({type:f.columnDoneResizing})},le=function(){window.cancelAnimationFrame(Y),Y=null,A({type:f.columnResizing,clientX:fe})},xe=function(Le){fe=Le,Y||(Y=window.requestAnimationFrame(le))},je={mouse:{moveEvent:"mousemove",moveHandler:function(Le){return xe(Le.clientX)},upEvent:"mouseup",upHandler:function(Le){document.removeEventListener("mousemove",je.mouse.moveHandler),document.removeEventListener("mouseup",je.mouse.upHandler),ee()}},touch:{moveEvent:"touchmove",moveHandler:function(Le){return Le.cancelable&&(Le.preventDefault(),Le.stopPropagation()),xe(Le.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(Le){document.removeEventListener(je.touch.moveEvent,je.touch.moveHandler),document.removeEventListener(je.touch.upEvent,je.touch.moveHandler),ee()}}},$e=K?je.touch:je.mouse,st=!!function(){if(typeof Q=="boolean")return Q;var Le=!1;try{var ge={get passive(){return Le=!0,!1}};window.addEventListener("test",null,ge),window.removeEventListener("test",null,ge)}catch{Le=!1}return Q=Le}()&&{passive:!1};document.addEventListener($e.moveEvent,$e.moveHandler,st),document.addEventListener($e.upEvent,$e.upHandler,st),A({type:f.columnStartResizing,columnId:Z.id,columnWidth:Z.totalWidth,headerIdWidths:se,clientX:pe})};return[g,{onMouseDown:function($){return $.persist()||M($,O)},onTouchStart:function($){return $.persist()||M($,O)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Fr(g,b){if(b.type===f.init)return c({columnResizing:{columnWidths:{}}},g);if(b.type===f.resetResize)return c({},g,{columnResizing:{columnWidths:{}}});if(b.type===f.columnStartResizing){var T=b.clientX,O=b.columnId,A=b.columnWidth,M=b.headerIdWidths;return c({},g,{columnResizing:c({},g.columnResizing,{startX:T,headerIdWidths:M,columnWidth:A,isResizingColumn:O})})}if(b.type===f.columnResizing){var $=b.clientX,Z=g.columnResizing,K=Z.startX,Y=Z.columnWidth,fe=Z.headerIdWidths,se=($-K)/Y,pe={};return(fe===void 0?[]:fe).forEach(function(ee){var le=ee[0],xe=ee[1];pe[le]=Math.max(xe+xe*se,0)}),c({},g,{columnResizing:c({},g.columnResizing,{columnWidths:c({},g.columnResizing.columnWidths,{},pe)})})}return b.type===f.columnDoneResizing?c({},g,{columnResizing:c({},g.columnResizing,{startX:null,isResizingColumn:null})}):void 0}xr.pluginName="useResizeColumns";var ao=function(g){var b=g.flatHeaders,T=g.disableResizing,O=g.getHooks,A=g.state.columnResizing,M=F(g);b.forEach(function($){var Z=De($.disableResizing!==!0&&void 0,T!==!0&&void 0,!0);$.canResize=Z,$.width=A.columnWidths[$.id]||$.originalWidth||$.width,$.isResizing=A.isResizingColumn===$.id,Z&&($.getResizerProps=j(O().getResizerProps,{instance:M(),header:$}))})};function lo(g){var b=g.plugins,T=g.dispatch,O=g.autoResetResize,A=O===void 0||O,M=g.columns;R(b,["useAbsoluteLayout"],"useResizeColumns");var $=F(A);P(function(){$()&&T({type:f.resetResize})},[M]);var Z=o.useCallback(function(){return T({type:f.resetResize})},[T]);Object.assign(g,{resetResizing:Z})}var tr={position:"absolute",top:0},su=function(g){g.getTableBodyProps.push(uo),g.getRowProps.push(uo),g.getHeaderGroupProps.push(uo),g.getFooterGroupProps.push(uo),g.getHeaderProps.push(function(b,T){var O=T.column;return[b,{style:c({},tr,{left:O.totalLeft+"px",width:O.totalWidth+"px"})}]}),g.getCellProps.push(function(b,T){var O=T.cell;return[b,{style:c({},tr,{left:O.column.totalLeft+"px",width:O.column.totalWidth+"px"})}]}),g.getFooterProps.push(function(b,T){var O=T.column;return[b,{style:c({},tr,{left:O.totalLeft+"px",width:O.totalWidth+"px"})}]})};su.pluginName="useAbsoluteLayout";var uo=function(g,b){return[g,{style:{position:"relative",width:b.instance.totalColumnsWidth+"px"}}]},Qr={display:"inline-block",boxSizing:"border-box"},Ia=function(g,b){return[g,{style:{display:"flex",width:b.instance.totalColumnsWidth+"px"}}]},Ma=function(g){g.getRowProps.push(Ia),g.getHeaderGroupProps.push(Ia),g.getFooterGroupProps.push(Ia),g.getHeaderProps.push(function(b,T){var O=T.column;return[b,{style:c({},Qr,{width:O.totalWidth+"px"})}]}),g.getCellProps.push(function(b,T){var O=T.cell;return[b,{style:c({},Qr,{width:O.column.totalWidth+"px"})}]}),g.getFooterProps.push(function(b,T){var O=T.column;return[b,{style:c({},Qr,{width:O.totalWidth+"px"})}]})};function co(g){g.getTableProps.push(ou),g.getRowProps.push(Fa),g.getHeaderGroupProps.push(Fa),g.getFooterGroupProps.push(Fa),g.getHeaderProps.push(fo),g.getCellProps.push(po),g.getFooterProps.push(Es)}Ma.pluginName="useBlockLayout",co.pluginName="useFlexLayout";var ou=function(g,b){return[g,{style:{minWidth:b.instance.totalColumnsMinWidth+"px"}}]},Fa=function(g,b){return[g,{style:{display:"flex",flex:"1 0 auto",minWidth:b.instance.totalColumnsMinWidth+"px"}}]},fo=function(g,b){var T=b.column;return[g,{style:{boxSizing:"border-box",flex:T.totalFlexWidth?T.totalFlexWidth+" 0 auto":void 0,minWidth:T.totalMinWidth+"px",width:T.totalWidth+"px"}}]},po=function(g,b){var T=b.cell;return[g,{style:{boxSizing:"border-box",flex:T.column.totalFlexWidth+" 0 auto",minWidth:T.column.totalMinWidth+"px",width:T.column.totalWidth+"px"}}]},Es=function(g,b){var T=b.column;return[g,{style:{boxSizing:"border-box",flex:T.totalFlexWidth?T.totalFlexWidth+" 0 auto":void 0,minWidth:T.totalMinWidth+"px",width:T.totalWidth+"px"}}]};function ho(g){g.stateReducers.push(yi),g.getTableProps.push(bd),g.getHeaderProps.push(Cd),g.getRowProps.push(Da)}f.columnStartResizing="columnStartResizing",f.columnResizing="columnResizing",f.columnDoneResizing="columnDoneResizing",f.resetResize="resetResize",ho.pluginName="useGridLayout";var bd=function(g,b){var T=b.instance;return[g,{style:{display:"grid",gridTemplateColumns:T.visibleColumns.map(function(O){var A;return T.state.gridLayout.columnWidths[O.id]?T.state.gridLayout.columnWidths[O.id]+"px":(A=T.state.columnResizing)!=null&&A.isResizingColumn?T.state.gridLayout.startWidths[O.id]+"px":typeof O.width=="number"?O.width+"px":O.width}).join(" ")}}]},Cd=function(g,b){var T=b.column;return[g,{id:"header-cell-"+T.id,style:{position:"sticky",gridColumn:"span "+T.totalVisibleHeaderCount}}]},Da=function(g,b){var T=b.row;return T.isExpanded?[g,{style:{gridColumn:"1 / "+(T.cells.length+1)}}]:[g,{}]};function yi(g,b,T,O){if(b.type===f.init)return c({gridLayout:{columnWidths:{}}},g);if(b.type===f.resetResize)return c({},g,{gridLayout:{columnWidths:{}}});if(b.type===f.columnStartResizing){var A=b.columnId,M=b.headerIdWidths,$=mo(A);if($!==void 0){var Z=O.visibleColumns.reduce(function(ge,Qe){var Re;return c({},ge,((Re={})[Qe.id]=mo(Qe.id),Re))},{}),K=O.visibleColumns.reduce(function(ge,Qe){var Re;return c({},ge,((Re={})[Qe.id]=Qe.minWidth,Re))},{}),Y=O.visibleColumns.reduce(function(ge,Qe){var Re;return c({},ge,((Re={})[Qe.id]=Qe.maxWidth,Re))},{}),fe=M.map(function(ge){var Qe=ge[0];return[Qe,mo(Qe)]});return c({},g,{gridLayout:c({},g.gridLayout,{startWidths:Z,minWidths:K,maxWidths:Y,headerIdGridWidths:fe,columnWidth:$})})}return g}if(b.type===f.columnResizing){var se=b.clientX,pe=g.columnResizing.startX,ee=g.gridLayout,le=ee.columnWidth,xe=ee.minWidths,je=ee.maxWidths,$e=ee.headerIdGridWidths,st=(se-pe)/le,Le={};return($e===void 0?[]:$e).forEach(function(ge){var Qe=ge[0],Re=ge[1];Le[Qe]=Math.min(Math.max(xe[Qe],Re+Re*st),je[Qe])}),c({},g,{gridLayout:c({},g.gridLayout,{columnWidths:c({},g.gridLayout.columnWidths,{},Le)})})}return b.type===f.columnDoneResizing?c({},g,{gridLayout:c({},g.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function mo(g){var b,T=(b=document.getElementById("header-cell-"+g))==null?void 0:b.offsetWidth;if(T!==void 0)return T}n._UNSTABLE_usePivotColumns=Xl,n.actions=f,n.defaultColumn=S,n.defaultGroupByFn=xa,n.defaultOrderByFn=Yl,n.defaultRenderer=y,n.emptyRenderer=w,n.ensurePluginOrder=R,n.flexRender=W,n.functionalUpdate=I,n.loopHooks=E,n.makePropGetter=j,n.makeRenderer=B,n.reduceHooks=N,n.safeUseLayoutEffect=L,n.useAbsoluteLayout=su,n.useAsyncDebounce=function(g,b){b===void 0&&(b=0);var T=o.useRef({}),O=F(g),A=F(b);return o.useCallback(function(){var M=l(regeneratorRuntime.mark(function $(){var Z,K,Y,fe=arguments;return regeneratorRuntime.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:for(Z=fe.length,K=new Array(Z),Y=0;Y1?b-1:0),O=1;O{var i;const{config:n,locale:o}=we();return u.jsxs("tr",{children:[u.jsx("td",{children:(i=ot.fromMillis(t.date))==null?void 0:i.toLocaleString()}),u.jsx("td",{children:t.recipient}),u.jsx("td",{children:t.plate}),u.jsx("td",{children:Tt(t.amount_paid,n)}),u.jsx("td",{className:"text-end",children:u.jsxs(ve,{size:"sm",onClick:()=>e(t),children:[u.jsx("i",{className:"bi-eye me-1"}),o.view]})})]})},_N=({data:t,onViewOrder:e,getOrders:n,pageCount:o})=>{const{locale:i}=we(),l=v.useMemo(()=>[{Header:i.date||"",accessor:"created_at"},{Header:i.customer||"",accessor:"recipient"},{Header:i.plate||"",accessor:"vehicle"},{Header:i.paid||"",accessor:"total_cost"},{Header:"",accessor:"actions"}],[i]),{getTableProps:c,getTableBodyProps:p,headerGroups:h,page:f,canPreviousPage:y,canNextPage:w,pageOptions:S,nextPage:C,previousPage:j,setPageSize:N,state:{pageIndex:E,pageSize:R}}=na.useTable({columns:l,data:t,initialState:{pageSize:5},pageCount:o,autoResetPage:!1,autoResetFilters:!1,manualPagination:!0},na.usePagination);return v.useEffect(()=>{n(E,R)},[n,E,R]),u.jsxs("div",{children:[u.jsxs(ua,{hover:!0,className:"bootstrap-table",...c(),children:[u.jsx("thead",{children:h.map(I=>u.jsx("tr",{...I.getHeaderGroupProps(),children:I.headers.map(F=>u.jsx("th",{...F.getHeaderProps(),children:F.render("Header")}))}))}),u.jsx("tbody",{...p(),children:f.length?f.map(I=>u.jsx(DN,{order:I.original,onViewOrder:e},I.original.id)):u.jsx("tr",{children:u.jsx("td",{colSpan:100,align:"center",children:i.noOrders})})})]}),u.jsxs("div",{className:"pagination d-flex justify-content-between",children:[u.jsxs(ve,{variant:"dark",onClick:j,disabled:!y,children:[u.jsx("i",{className:"bi-chevron-left"})," ",i.previous]}),u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsxs("span",{className:"me-3",children:[i.page," ",E+1," ",i.of," ",S.length]}),u.jsx(ue.Select,{size:"sm",value:R,onChange:I=>{N(Number(I.target.value))},style:{width:110},children:[5,10,15,20,30].map(I=>u.jsxs("option",{value:I,children:[i.show," ",I]},I))})]}),u.jsxs(ve,{variant:"dark",onClick:C,disabled:!w,children:[i.next," ",u.jsx("i",{className:"bi-chevron-right"})]})]})]})},NS=v.createContext(void 0),OS=()=>{const t=v.useContext(NS);if(!t)throw new Error("Must be used in the OrderViewContext");return t},PN=({show:t,onClose:e,category:n,categoryItems:o})=>{var j;const{config:i,locale:l}=we(),{order:c,isVehicleConnected:p,installProgress:h,setInstallProgress:f}=OS(),[y,w]=v.useState(!1),{itemName:S}=v.useMemo(()=>i.Mods.ItemsRequired[n],[i,n]),C=async()=>{if(!await me("has-item",{itemName:S,qty:Object.keys(o).length}))return w(!0);e(),await me("orders-install-category",{orderId:c.id,category:n})&&f({...h,[n]:!0})};return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:9999},size:"sm",centered:!0,scrollable:!0,backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:l[n]})}),u.jsx(ye.Body,{className:"max-h-[350px]",children:Object.keys(o).map((N,E)=>u.jsxs("div",{className:"mb-3 last:!mb-0",children:[u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx("div",{className:"font-medium text-white",children:l[N]||N}),u.jsx(Pt,{bg:"secondary",text:"dark",children:Tt(o[N].price,i)})]}),u.jsx("small",{children:o[N].desc})]},E))}),u.jsx(ye.Footer,{children:u.jsx(ve,{className:"w-full",disabled:!p,variant:p?"primary":"secondary",onClick:C,children:p?u.jsxs("span",{children:[u.jsx("i",{className:"bi-tools me-2"}),l.install]}):l.vehicleNotConnected})}),u.jsx(Xc,{show:y,onHide:()=>w(!1),text:(j=l.itemRequired)==null?void 0:j.replace("%s",`${Object.keys(o).length}x ${l[S]||S}`)})]})},AN=({category:t,categoryItems:e})=>{const{locale:n}=we(),{isCategoryAlreadyInstalled:o}=OS(),[i,l]=v.useState(!1);return u.jsxs("div",{className:"mb-3",children:[u.jsxs("div",{className:"flex justify-between gap-2 items-center",children:[u.jsxs("div",{className:"font-medium text-white",children:[n[t]," (",Object.keys(e).length,"x)"]}),u.jsxs(ve,{size:"sm",onClick:()=>l(!0),disabled:o(t),variant:o(t)?"secondary":"primary",children:[u.jsx("i",{className:`${o(t)?"bi-check-lg":"bi-eye"} me-2`}),o(t)?n.installed:n.view]})]}),u.jsx(PN,{show:i,onClose:()=>l(!1),category:t,categoryItems:e})]})},$N=({show:t,onHide:e,onConfirm:n,orderId:o})=>{const{locale:i}=we(),l=async()=>{await me("delete-order",{orderId:o}),n()};return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsxs("h5",{className:"mb-0",children:[u.jsx("i",{className:"bi-exclamation-triangle-fill me-2"}),i.areYouSure]})}),u.jsxs(ye.Body,{children:[u.jsx("p",{children:i.deleteOrderConfirmation}),u.jsx(ve,{onClick:l,variant:"danger",children:i.delete})]})]})},LN=({order:t,onBack:e})=>{const{event:n,config:o,locale:i}=we(),{connectedVehicle:l}=Gt(),[c,p]=v.useState(!1),[h,f]=v.useState(t.installation_progress&&JSON.parse(t.installation_progress||"{}")),y=v.useMemo(()=>JSON.parse(t.cart||"{}"),[t.cart]),w=v.useMemo(()=>{var E,R;return l&&((E=l.plate)==null?void 0:E.trim().toUpperCase())===((R=t.plate)==null?void 0:R.trim().toUpperCase())},[l,t.plate]),S=v.useMemo(()=>!Object.keys(y).filter(E=>!(h!=null&&h[E])).length,[y,h]),C=E=>(h==null?void 0:h[E])||!1,j=()=>!(!o.RequireManagementForOrderDeletion||n.employeeRole!=="mechanic"),N=async()=>{await me("mark-order-fulfilled",{orderId:t.id}),e()};return u.jsx(NS.Provider,{value:{order:t,installProgress:h,setInstallProgress:f,isCategoryAlreadyInstalled:C,isVehicleConnected:w},children:u.jsxs("div",{className:"p-4 flex flex-col items-start h-full overflow-hidden",children:[u.jsxs("div",{className:"flex justify-between w-full items-center",children:[u.jsxs("div",{children:[u.jsxs("button",{className:"mb-2 text-muted",onClick:e,children:[u.jsx("i",{className:"bi-arrow-left"})," ",i.back]}),u.jsxs("h2",{className:"mb-4",children:[i.order," #",t.id]})]}),S?u.jsxs(ve,{variant:"success",onClick:N,children:[u.jsx("i",{className:"bi-check-lg me-2"}),i.markOrderComplete]}):u.jsxs(u.Fragment,{children:[u.jsxs(ve,{variant:"danger",disabled:j(),onClick:()=>p(!0),children:[u.jsx("i",{className:"bi-trash me-2"}),i.deleteOrder]}),u.jsx($N,{show:c,onHide:()=>p(!1),orderId:t.id,onConfirm:()=>e()})]})]}),u.jsxs("div",{className:"flex items-start flex-grow-0 w-full h-[324px] gap-4",children:[u.jsxs(gt,{className:"w-full !h-full",children:[u.jsx(gt.Header,{children:i.partsToInstall}),u.jsx(gt.Body,{className:"overflow-auto",children:Object.keys(y).map((E,R)=>u.jsx(AN,{category:E,categoryItems:y[E]},R))})]}),u.jsxs("div",{className:"w-[40%] h-full flex-shrink-0",children:[u.jsxs(gt,{className:"mb-4",children:[u.jsx(gt.Header,{children:i.status}),u.jsx(gt.Body,{children:w?u.jsxs("span",{className:"!text-green-600",children:[u.jsx("i",{className:"bi-check-circle me-2"}),i.readyToInstall]}):u.jsxs("span",{className:"!text-yellow-600",children:[u.jsx("i",{className:"bi-exclamation-triangle me-2"}),i.vehicleNotConnected]})})]}),u.jsx(gt,{children:u.jsxs(gt.Body,{children:[u.jsxs("div",{className:"mb-[12px]",children:[u.jsx(ue.Label,{className:"small-form-label",children:i.customer}),u.jsx("div",{children:t.recipient})]}),u.jsxs("div",{className:"mb-[12px]",children:[u.jsx(ue.Label,{className:"small-form-label",children:i.plate}),u.jsx("div",{children:t.plate})]}),u.jsxs("div",{children:[u.jsx(ue.Label,{className:"small-form-label",children:i.amountPaid}),u.jsx("div",{className:"flex gap-2",children:Tt(t.amount_paid,o)})]})]})})]})]})]})})},zN=()=>{const{event:t,locale:e}=we(),{setOrdersCount:n}=Gt(),[o,i]=v.useState(t.orders||[]),[l,c]=v.useState(!1),[p,h]=v.useState(0),[f,y]=v.useState(!0),w=v.useCallback(async(S,C)=>{try{const j=await me("get-mechanic-orders",{pageIndex:S,pageSize:C});i(j.orders),h(j.pageCount),n(j.totalOrders)}catch{}y(!1)},[n]);return v.useEffect(()=>{w(0,5)},[w]),l?u.jsx(LN,{order:l,onBack:()=>c(!1)}):u.jsxs("div",{className:"p-4",children:[u.jsx("h2",{className:"mb-4",children:e.orders}),u.jsx("div",{children:f?u.jsx("div",{className:"w-full flex justify-center",children:u.jsx(Qh,{})}):u.jsx(_N,{data:o,onViewOrder:S=>c(S),getOrders:w,pageCount:p})})]})};var BN=function(e){return HN(e)&&!WN(e)};function HN(t){return!!t&&typeof t=="object"}function WN(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||GN(t)}var VN=typeof Symbol=="function"&&Symbol.for,UN=VN?Symbol.for("react.element"):60103;function GN(t){return t.$$typeof===UN}function qN(t){return Array.isArray(t)?[]:{}}function Ac(t,e){return e.clone!==!1&&e.isMergeableObject(t)?kl(qN(t),t,e):t}function KN(t,e,n){return t.concat(e).map(function(o){return Ac(o,n)})}function ZN(t,e,n){var o={};return n.isMergeableObject(t)&&Object.keys(t).forEach(function(i){o[i]=Ac(t[i],n)}),Object.keys(e).forEach(function(i){!n.isMergeableObject(e[i])||!t[i]?o[i]=Ac(e[i],n):o[i]=kl(t[i],e[i],n)}),o}function kl(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||KN,n.isMergeableObject=n.isMergeableObject||BN;var o=Array.isArray(e),i=Array.isArray(t),l=o===i;return l?o?n.arrayMerge(t,e,n):ZN(t,e,n):Ac(e,n)}kl.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(o,i){return kl(o,i,n)},{})};var Yp=kl,RS=typeof global=="object"&&global&&global.Object===Object&&global,YN=typeof self=="object"&&self&&self.Object===Object&&self,qr=RS||YN||Function("return this")(),Ys=qr.Symbol,IS=Object.prototype,QN=IS.hasOwnProperty,XN=IS.toString,ul=Ys?Ys.toStringTag:void 0;function JN(t){var e=QN.call(t,ul),n=t[ul];try{t[ul]=void 0;var o=!0}catch{}var i=XN.call(t);return o&&(e?t[ul]=n:delete t[ul]),i}var eO=Object.prototype,tO=eO.toString;function nO(t){return tO.call(t)}var rO="[object Null]",sO="[object Undefined]",Dy=Ys?Ys.toStringTag:void 0;function Yo(t){return t==null?t===void 0?sO:rO:Dy&&Dy in Object(t)?JN(t):nO(t)}function MS(t,e){return function(n){return t(e(n))}}var Xh=MS(Object.getPrototypeOf,Object);function Qo(t){return t!=null&&typeof t=="object"}var oO="[object Object]",iO=Function.prototype,aO=Object.prototype,FS=iO.toString,lO=aO.hasOwnProperty,uO=FS.call(Object);function _y(t){if(!Qo(t)||Yo(t)!=oO)return!1;var e=Xh(t);if(e===null)return!0;var n=lO.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&FS.call(n)==uO}var gp,Py;function cO(){if(Py)return gp;Py=1;var t=Array.isArray,e=Object.keys,n=Object.prototype.hasOwnProperty,o=typeof Element<"u";function i(l,c){if(l===c)return!0;if(l&&c&&typeof l=="object"&&typeof c=="object"){var p=t(l),h=t(c),f,y,w;if(p&&h){if(y=l.length,y!=c.length)return!1;for(f=y;f--!==0;)if(!i(l[f],c[f]))return!1;return!0}if(p!=h)return!1;var S=l instanceof Date,C=c instanceof Date;if(S!=C)return!1;if(S&&C)return l.getTime()==c.getTime();var j=l instanceof RegExp,N=c instanceof RegExp;if(j!=N)return!1;if(j&&N)return l.toString()==c.toString();var E=e(l);if(y=E.length,y!==e(c).length)return!1;for(f=y;f--!==0;)if(!n.call(c,E[f]))return!1;if(o&&l instanceof Element&&c instanceof Element)return l===c;for(f=y;f--!==0;)if(w=E[f],!(w==="_owner"&&l.$$typeof)&&!i(l[w],c[w]))return!1;return!0}return l!==l&&c!==c}return gp=function(c,p){try{return i(c,p)}catch(h){if(h.message&&h.message.match(/stack|recursion/i)||h.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",h.name,h.message),!1;throw h}},gp}var dO=cO();const Ao=xs(dO);function fO(){this.__data__=[],this.size=0}function DS(t,e){return t===e||t!==t&&e!==e}function sd(t,e){for(var n=t.length;n--;)if(DS(t[n][0],e))return n;return-1}var pO=Array.prototype,hO=pO.splice;function mO(t){var e=this.__data__,n=sd(e,t);if(n<0)return!1;var o=e.length-1;return n==o?e.pop():hO.call(e,n,1),--this.size,!0}function gO(t){var e=this.__data__,n=sd(e,t);return n<0?void 0:e[n][1]}function vO(t){return sd(this.__data__,t)>-1}function yO(t,e){var n=this.__data__,o=sd(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}function Ss(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=yR}var xR="[object Arguments]",wR="[object Array]",SR="[object Boolean]",bR="[object Date]",CR="[object Error]",jR="[object Function]",ER="[object Map]",kR="[object Number]",TR="[object Object]",NR="[object RegExp]",OR="[object Set]",RR="[object String]",IR="[object WeakMap]",MR="[object ArrayBuffer]",FR="[object DataView]",DR="[object Float32Array]",_R="[object Float64Array]",PR="[object Int8Array]",AR="[object Int16Array]",$R="[object Int32Array]",LR="[object Uint8Array]",zR="[object Uint8ClampedArray]",BR="[object Uint16Array]",HR="[object Uint32Array]",_t={};_t[DR]=_t[_R]=_t[PR]=_t[AR]=_t[$R]=_t[LR]=_t[zR]=_t[BR]=_t[HR]=!0;_t[xR]=_t[wR]=_t[MR]=_t[SR]=_t[FR]=_t[bR]=_t[CR]=_t[jR]=_t[ER]=_t[kR]=_t[TR]=_t[NR]=_t[OR]=_t[RR]=_t[IR]=!1;function WR(t){return Qo(t)&&BS(t.length)&&!!_t[Yo(t)]}function Jh(t){return function(e){return t(e)}}var HS=typeof Zn=="object"&&Zn&&!Zn.nodeType&&Zn,yl=HS&&typeof Yn=="object"&&Yn&&!Yn.nodeType&&Yn,VR=yl&&yl.exports===HS,yp=VR&&RS.process,ra=function(){try{var t=yl&&yl.require&&yl.require("util").types;return t||yp&&yp.binding&&yp.binding("util")}catch{}}(),Hy=ra&&ra.isTypedArray,UR=Hy?Jh(Hy):WR,GR=Object.prototype,qR=GR.hasOwnProperty;function WS(t,e){var n=Vl(t),o=!n&&dR(t),i=!n&&!o&&zS(t),l=!n&&!o&&!i&&UR(t),c=n||o||i||l,p=c?aR(t.length,String):[],h=p.length;for(var f in t)(e||qR.call(t,f))&&!(c&&(f=="length"||i&&(f=="offset"||f=="parent")||l&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||vR(f,h)))&&p.push(f);return p}var KR=Object.prototype;function em(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||KR;return t===n}var ZR=MS(Object.keys,Object),YR=Object.prototype,QR=YR.hasOwnProperty;function XR(t){if(!em(t))return ZR(t);var e=[];for(var n in Object(t))QR.call(t,n)&&n!="constructor"&&e.push(n);return e}function VS(t){return t!=null&&BS(t.length)&&!_S(t)}function US(t){return VS(t)?WS(t):XR(t)}function JR(t,e){return t&&id(e,US(e),t)}function e2(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var t2=Object.prototype,n2=t2.hasOwnProperty;function r2(t){if(!Wl(t))return e2(t);var e=em(t),n=[];for(var o in t)o=="constructor"&&(e||!n2.call(t,o))||n.push(o);return n}function s2(t){return VS(t)?WS(t,!0):r2(t)}function o2(t,e){return t&&id(e,s2(e),t)}var GS=typeof Zn=="object"&&Zn&&!Zn.nodeType&&Zn,Wy=GS&&typeof Yn=="object"&&Yn&&!Yn.nodeType&&Yn,i2=Wy&&Wy.exports===GS,Vy=i2?qr.Buffer:void 0,Uy=Vy?Vy.allocUnsafe:void 0;function a2(t,e){var n=t.length,o=Uy?Uy(n):new t.constructor(n);return t.copy(o),o}function qS(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n=0)&&(n[i]=t[i]);return n}var ad=v.createContext(void 0);ad.displayName="FormikContext";var WI=ad.Provider;ad.Consumer;function VI(){var t=v.useContext(ad);return t}var cr=function(e){return typeof e=="function"},ld=function(e){return e!==null&&typeof e=="object"},UI=function(e){return String(Math.floor(Number(e)))===e},Sp=function(e){return Object.prototype.toString.call(e)==="[object String]"},GI=function(e){return v.Children.count(e)===0},bp=function(e){return ld(e)&&cr(e.then)};function Kn(t,e,n,o){o===void 0&&(o=0);for(var i=tb(e);t&&o=0?[]:{}}}return(l===0?t:i)[c[l]]===n?t:(n===void 0?delete i[c[l]]:i[c[l]]=n,l===0&&n===void 0&&delete o[c[l]],o)}function rb(t,e,n,o){n===void 0&&(n=new WeakMap),o===void 0&&(o={});for(var i=0,l=Object.keys(t);i0?Ce.map(function(de){return ce(de,Kn(G,de))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ie).then(function(de){return de.reduce(function(Ge,lt,Nt){return lt==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||lt&&(Ge=Wo(Ge,Ce[Nt],lt)),Ge},{})})},[ce]),Oe=v.useCallback(function(G){return Promise.all([ie(G),S.validationSchema?re(G):{},S.validate?X(G):{}]).then(function(Ce){var Ie=Ce[0],de=Ce[1],Ge=Ce[2],lt=Yp.all([Ie,de,Ge],{arrayMerge:XI});return lt})},[S.validate,S.validationSchema,ie,X,re]),be=ur(function(G){return G===void 0&&(G=B.values),W({type:"SET_ISVALIDATING",payload:!0}),Oe(G).then(function(Ce){return R.current&&(W({type:"SET_ISVALIDATING",payload:!1}),W({type:"SET_ERRORS",payload:Ce})),Ce})});v.useEffect(function(){c&&R.current===!0&&Ao(C.current,S.initialValues)&&be(C.current)},[c,be]);var De=v.useCallback(function(G){var Ce=G&&G.values?G.values:C.current,Ie=G&&G.errors?G.errors:j.current?j.current:S.initialErrors||{},de=G&&G.touched?G.touched:N.current?N.current:S.initialTouched||{},Ge=G&&G.status?G.status:E.current?E.current:S.initialStatus;C.current=Ce,j.current=Ie,N.current=de,E.current=Ge;var lt=function(){W({type:"RESET_FORM",payload:{isSubmitting:!!G&&!!G.isSubmitting,errors:Ie,touched:de,status:Ge,values:Ce,isValidating:!!G&&!!G.isValidating,submitCount:G&&G.submitCount&&typeof G.submitCount=="number"?G.submitCount:0}})};if(S.onReset){var Nt=S.onReset(B.values,en);bp(Nt)?Nt.then(lt):lt()}else lt()},[S.initialErrors,S.initialStatus,S.initialTouched,S.onReset]);v.useEffect(function(){R.current===!0&&!Ao(C.current,S.initialValues)&&f&&(C.current=S.initialValues,De(),c&&be(C.current))},[f,S.initialValues,De,c,be]),v.useEffect(function(){f&&R.current===!0&&!Ao(j.current,S.initialErrors)&&(j.current=S.initialErrors||Po,W({type:"SET_ERRORS",payload:S.initialErrors||Po}))},[f,S.initialErrors]),v.useEffect(function(){f&&R.current===!0&&!Ao(N.current,S.initialTouched)&&(N.current=S.initialTouched||mc,W({type:"SET_TOUCHED",payload:S.initialTouched||mc}))},[f,S.initialTouched]),v.useEffect(function(){f&&R.current===!0&&!Ao(E.current,S.initialStatus)&&(E.current=S.initialStatus,W({type:"SET_STATUS",payload:S.initialStatus}))},[f,S.initialStatus,S.initialTouched]);var ae=ur(function(G){if(I.current[G]&&cr(I.current[G].validate)){var Ce=Kn(B.values,G),Ie=I.current[G].validate(Ce);return bp(Ie)?(W({type:"SET_ISVALIDATING",payload:!0}),Ie.then(function(de){return de}).then(function(de){W({type:"SET_FIELD_ERROR",payload:{field:G,value:de}}),W({type:"SET_ISVALIDATING",payload:!1})})):(W({type:"SET_FIELD_ERROR",payload:{field:G,value:Ie}}),Promise.resolve(Ie))}else if(S.validationSchema)return W({type:"SET_ISVALIDATING",payload:!0}),re(B.values,G).then(function(de){return de}).then(function(de){W({type:"SET_FIELD_ERROR",payload:{field:G,value:Kn(de,G)}}),W({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),Ae=v.useCallback(function(G,Ce){var Ie=Ce.validate;I.current[G]={validate:Ie}},[]),Me=v.useCallback(function(G){delete I.current[G]},[]),J=ur(function(G,Ce){W({type:"SET_TOUCHED",payload:G});var Ie=Ce===void 0?i:Ce;return Ie?be(B.values):Promise.resolve()}),Ee=v.useCallback(function(G){W({type:"SET_ERRORS",payload:G})},[]),_=ur(function(G,Ce){var Ie=cr(G)?G(B.values):G;W({type:"SET_VALUES",payload:Ie});var de=Ce===void 0?n:Ce;return de?be(Ie):Promise.resolve()}),Q=v.useCallback(function(G,Ce){W({type:"SET_FIELD_ERROR",payload:{field:G,value:Ce}})},[]),Se=ur(function(G,Ce,Ie){W({type:"SET_FIELD_VALUE",payload:{field:G,value:Ce}});var de=Ie===void 0?n:Ie;return de?be(Wo(B.values,G,Ce)):Promise.resolve()}),Ve=v.useCallback(function(G,Ce){var Ie=Ce,de=G,Ge;if(!Sp(G)){G.persist&&G.persist();var lt=G.target?G.target:G.currentTarget,Nt=lt.type,On=lt.name,vr=lt.id,yr=lt.value,ma=lt.checked;lt.outerHTML;var eo=lt.options,to=lt.multiple;Ie=Ce||On||vr,de=/number|range/.test(Nt)?(Ge=parseFloat(yr),isNaN(Ge)?"":Ge):/checkbox/.test(Nt)?eM(Kn(B.values,Ie),ma,yr):eo&&to?JI(eo):yr}Ie&&Se(Ie,de)},[Se,B.values]),We=ur(function(G){if(Sp(G))return function(Ce){return Ve(Ce,G)};Ve(G)}),Je=ur(function(G,Ce,Ie){Ce===void 0&&(Ce=!0),W({type:"SET_FIELD_TOUCHED",payload:{field:G,value:Ce}});var de=Ie===void 0?i:Ie;return de?be(B.values):Promise.resolve()}),tt=v.useCallback(function(G,Ce){G.persist&&G.persist();var Ie=G.target,de=Ie.name,Ge=Ie.id;Ie.outerHTML;var lt=Ce||de||Ge;Je(lt,!0)},[Je]),at=ur(function(G){if(Sp(G))return function(Ce){return tt(Ce,G)};tt(G)}),nt=v.useCallback(function(G){cr(G)?W({type:"SET_FORMIK_STATE",payload:G}):W({type:"SET_FORMIK_STATE",payload:function(){return G}})},[]),Ct=v.useCallback(function(G){W({type:"SET_STATUS",payload:G})},[]),jn=v.useCallback(function(G){W({type:"SET_ISSUBMITTING",payload:G})},[]),Yt=ur(function(){return W({type:"SUBMIT_ATTEMPT"}),be().then(function(G){var Ce=G instanceof Error,Ie=!Ce&&Object.keys(G).length===0;if(Ie){var de;try{if(de=cn(),de===void 0)return}catch(Ge){throw Ge}return Promise.resolve(de).then(function(Ge){return R.current&&W({type:"SUBMIT_SUCCESS"}),Ge}).catch(function(Ge){if(R.current)throw W({type:"SUBMIT_FAILURE"}),Ge})}else if(R.current&&(W({type:"SUBMIT_FAILURE"}),Ce))throw G})}),Hn=ur(function(G){G&&G.preventDefault&&cr(G.preventDefault)&&G.preventDefault(),G&&G.stopPropagation&&cr(G.stopPropagation)&&G.stopPropagation(),Yt().catch(function(Ce){console.warn("Warning: An unhandled error was caught from submitForm()",Ce)})}),en={resetForm:De,validateForm:be,validateField:ae,setErrors:Ee,setFieldError:Q,setFieldTouched:Je,setFieldValue:Se,setStatus:Ct,setSubmitting:jn,setTouched:J,setValues:_,setFormikState:nt,submitForm:Yt},cn=ur(function(){return y(B.values,en)}),xt=ur(function(G){G&&G.preventDefault&&cr(G.preventDefault)&&G.preventDefault(),G&&G.stopPropagation&&cr(G.stopPropagation)&&G.stopPropagation(),De()}),Nn=v.useCallback(function(G){return{value:Kn(B.values,G),error:Kn(B.errors,G),touched:!!Kn(B.touched,G),initialValue:Kn(C.current,G),initialTouched:!!Kn(N.current,G),initialError:Kn(j.current,G)}},[B.errors,B.touched,B.values]),yn=v.useCallback(function(G){return{setValue:function(Ie,de){return Se(G,Ie,de)},setTouched:function(Ie,de){return Je(G,Ie,de)},setError:function(Ie){return Q(G,Ie)}}},[Se,Je,Q]),Ir=v.useCallback(function(G){var Ce=ld(G),Ie=Ce?G.name:G,de=Kn(B.values,Ie),Ge={name:Ie,value:de,onChange:We,onBlur:at};if(Ce){var lt=G.type,Nt=G.value,On=G.as,vr=G.multiple;lt==="checkbox"?Nt===void 0?Ge.checked=!!de:(Ge.checked=!!(Array.isArray(de)&&~de.indexOf(Nt)),Ge.value=Nt):lt==="radio"?(Ge.checked=de===Nt,Ge.value=Nt):On==="select"&&vr&&(Ge.value=Ge.value||[],Ge.multiple=!0)}return Ge},[at,We,B.values]),Wn=v.useMemo(function(){return!Ao(C.current,B.values)},[C.current,B.values]),tn=v.useMemo(function(){return typeof p<"u"?Wn?B.errors&&Object.keys(B.errors).length===0:p!==!1&&cr(p)?p(S):p:B.errors&&Object.keys(B.errors).length===0},[p,Wn,B.errors,S]),dn=ln({},B,{initialValues:C.current,initialErrors:j.current,initialTouched:N.current,initialStatus:E.current,handleBlur:at,handleChange:We,handleReset:xt,handleSubmit:Hn,resetForm:De,setErrors:Ee,setFormikState:nt,setFieldTouched:Je,setFieldValue:Se,setFieldError:Q,setStatus:Ct,setSubmitting:jn,setTouched:J,setValues:_,submitForm:Yt,validateForm:be,validateField:ae,isValid:tn,dirty:Wn,unregisterField:Me,registerField:Ae,getFieldProps:Ir,getFieldMeta:Nn,getFieldHelpers:yn,validateOnBlur:i,validateOnChange:n,validateOnMount:c});return dn}function ZI(t){var e=KI(t),n=t.component,o=t.children,i=t.render,l=t.innerRef;return v.useImperativeHandle(l,function(){return e}),v.createElement(WI,{value:e},n?v.createElement(n,e):i?i(e):o?cr(o)?o(e):GI(o)?null:v.Children.only(o):null)}function YI(t){var e={};if(t.inner){if(t.inner.length===0)return Wo(e,t.path,t.message);for(var i=t.inner,n=Array.isArray(i),o=0,i=n?i:i[Symbol.iterator]();;){var l;if(n){if(o>=i.length)break;l=i[o++]}else{if(o=i.next(),o.done)break;l=o.value}var c=l;Kn(e,c.path)||(e=Wo(e,c.path,c.message))}}return e}function QI(t,e,n,o){n===void 0&&(n=!1);var i=th(t);return e[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function th(t){var e=Array.isArray(t)?[]:{};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var o=String(n);Array.isArray(t[o])===!0?e[o]=t[o].map(function(i){return Array.isArray(i)===!0||_y(i)?th(i):i!==""?i:void 0}):_y(t[o])?e[o]=th(t[o]):e[o]=t[o]!==""?t[o]:void 0}return e}function XI(t,e,n){var o=t.slice();return e.forEach(function(l,c){if(typeof o[c]>"u"){var p=n.clone!==!1,h=p&&n.isMergeableObject(l);o[c]=h?Yp(Array.isArray(l)?[]:{},l,n):l}else n.isMergeableObject(l)?o[c]=Yp(t[c],l,n):t.indexOf(l)===-1&&o.push(l)}),o}function JI(t){return Array.from(t).filter(function(e){return e.selected}).map(function(e){return e.value})}function eM(t,e,n){if(typeof t=="boolean")return!!e;var o=[],i=!1,l=-1;if(Array.isArray(t))o=t,l=t.indexOf(n),i=l>=0;else if(!n||n=="true"||n=="false")return!!e;return e&&n&&!i?o.concat(n):i?o.slice(0,l).concat(o.slice(l+1)):o}var tM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function ur(t){var e=v.useRef(t);return tM(function(){e.current=t}),v.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i=this._maxSize&&this.clear(),R in this._values||this._size++,this._values[R]=I};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,o=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,l=/^\s*(['"]?)(.*?)(\1)\s*$/,c=512,p=new t(c),h=new t(c),f=new t(c);Cp={Cache:t,split:w,normalizePath:y,setter:function(R){var I=y(R);return h.get(R)||h.set(R,function(L,P){for(var B=0,W=I.length,X=L;By.match(t)||[],n=y=>y[0].toUpperCase()+y.slice(1),o=(y,w)=>e(y).join(w).toLowerCase(),i=y=>e(y).reduce((w,S)=>`${w}${w?S[0].toUpperCase()+S.slice(1).toLowerCase():S.toLowerCase()}`,"");return jp={words:e,upperFirst:n,camelCase:i,pascalCase:y=>n(i(y)),snakeCase:y=>o(y,"_"),kebabCase:y=>o(y,"-"),sentenceCase:y=>n(o(y," ")),titleCase:y=>e(y).map(n).join(" ")},jp}var Ep=sM(),gc={exports:{}},fx;function oM(){if(fx)return gc.exports;fx=1,gc.exports=function(i){return t(e(i),i)},gc.exports.array=t;function t(i,l){var c=i.length,p=new Array(c),h={},f=c,y=n(l),w=o(i);for(l.forEach(function(C){if(!w.has(C[0])||!w.has(C[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});f--;)h[f]||S(i[f],f,new Set);return p;function S(C,j,N){if(N.has(C)){var E;try{E=", node was:"+JSON.stringify(C)}catch{E=""}throw new Error("Cyclic dependency"+E)}if(!w.has(C))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(C));if(!h[j]){h[j]=!0;var R=y.get(C)||new Set;if(R=Array.from(R),j=R.length){N.add(C);do{var I=R[--j];S(I,w.get(I),N)}while(j);N.delete(C)}p[--c]=C}}}function e(i){for(var l=new Set,c=0,p=i.length;c"",fM=/^Symbol\((.*)\)(.*)$/;function pM(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function px(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return pM(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return dM.call(t).replace(fM,"Symbol($1)");const o=lM.call(t).slice(8,-1);return o==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):o==="Error"||t instanceof Error?"["+uM.call(t)+"]":o==="RegExp"?cM.call(t):null}function Ks(t,e){let n=px(t,e);return n!==null?n:JSON.stringify(t,function(o,i){let l=px(this[o],e);return l!==null?l:i},2)}function sb(t){return t==null?[]:[].concat(t)}let ob,ib,ab,hM=/\$\{\s*(\w+)\s*\}/g;ob=Symbol.toStringTag;class hx{constructor(e,n,o,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[ob]="Error",this.name="ValidationError",this.value=n,this.path=o,this.type=i,this.errors=[],this.inner=[],sb(e).forEach(l=>{if(Ln.isError(l)){this.errors.push(...l.errors);const c=l.inner.length?l.inner:[l];this.inner.push(...c)}else this.errors.push(l)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}ib=Symbol.hasInstance;ab=Symbol.toStringTag;class Ln extends Error{static formatError(e,n){const o=n.label||n.path||"this";return o!==n.path&&(n=Object.assign({},n,{path:o})),typeof e=="string"?e.replace(hM,(i,l)=>Ks(n[l])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,o,i,l){const c=new hx(e,n,o,i);if(l)return c;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[ab]="Error",this.name=c.name,this.message=c.message,this.type=c.type,this.value=c.value,this.path=c.path,this.errors=c.errors,this.inner=c.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ln)}static[ib](e){return hx[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let zr={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:o})=>{const i=o!=null&&o!==n?` (cast from the value \`${Ks(o,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Ks(n,!0)}\``+i:`${t} must match the configured type. The validated value was: \`${Ks(n,!0)}\``+i}},An={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},mM={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},nh={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},gM={isValue:"${path} field must be ${value}"},rh={noUnknown:"${path} field has unspecified keys: ${unknown}"},vM={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},yM={notType:t=>{const{path:e,value:n,spec:o}=t,i=o.types.length;if(Array.isArray(n)){if(n.lengthi)return`${e} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${Ks(n,!0)}\``}return Ln.formatError(zr.notType,t)}};Object.assign(Object.create(null),{mixed:zr,string:An,number:mM,date:nh,object:rh,array:vM,boolean:gM,tuple:yM});const sm=t=>t&&t.__isYupSchema__;class $c{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:o,then:i,otherwise:l}=n,c=typeof o=="function"?o:(...p)=>p.every(h=>h===o);return new $c(e,(p,h)=>{var f;let y=c(...p)?i:l;return(f=y==null?void 0:y(h))!=null?f:h})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let o=this.refs.map(l=>l.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(o,e,n);if(i===void 0||i===e)return e;if(!sm(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const vc={context:"$",value:"."};class ei{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===vc.context,this.isValue=this.key[0]===vc.value,this.isSibling=!this.isContext&&!this.isValue;let o=this.isContext?vc.context:this.isValue?vc.value:"";this.path=this.key.slice(o.length),this.getter=this.path&&Vo.getter(this.path,!0),this.map=n.map}getValue(e,n,o){let i=this.isContext?o:this.isValue?e:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}ei.prototype.__isYupRef=!0;const zo=t=>t==null;function Gi(t){function e({value:n,path:o="",options:i,originalValue:l,schema:c},p,h){const{name:f,test:y,params:w,message:S,skipAbsent:C}=t;let{parent:j,context:N,abortEarly:E=c.spec.abortEarly,disableStackTrace:R=c.spec.disableStackTrace}=i;function I(ie){return ei.isRef(ie)?ie.getValue(n,j,N):ie}function F(ie={}){const Oe=Object.assign({value:n,originalValue:l,label:c.spec.label,path:ie.path||o,spec:c.spec,disableStackTrace:ie.disableStackTrace||R},w,ie.params);for(const De of Object.keys(Oe))Oe[De]=I(Oe[De]);const be=new Ln(Ln.formatError(ie.message||S,Oe),n,Oe.path,ie.type||f,Oe.disableStackTrace);return be.params=Oe,be}const L=E?p:h;let P={path:o,parent:j,type:f,from:i.from,createError:F,resolve:I,options:i,originalValue:l,schema:c};const B=ie=>{Ln.isError(ie)?L(ie):ie?h(null):L(F())},W=ie=>{Ln.isError(ie)?L(ie):p(ie)};if(C&&zo(n))return B(!0);let re;try{var ce;if(re=y.call(P,n,P),typeof((ce=re)==null?void 0:ce.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${P.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(re).then(B,W)}}catch(ie){W(ie);return}B(re)}return e.OPTIONS=t,e}function xM(t,e,n,o=n){let i,l,c;return e?(Vo.forEach(e,(p,h,f)=>{let y=h?p.slice(1,p.length-1):p;t=t.resolve({context:o,parent:i,value:n});let w=t.type==="tuple",S=f?parseInt(y,10):0;if(t.innerType||w){if(w&&!f)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${c}" must contain an index to the tuple element, e.g. "${c}[0]"`);if(n&&S>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${p}, in the path: ${e}. because there is no value at that index. `);i=n,n=n&&n[S],t=w?t.spec.types[S]:t.innerType}if(!f){if(!t.fields||!t.fields[y])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${c} which is a type: "${t.type}")`);i=n,n=n&&n[y],t=t.fields[y]}l=y,c=h?"["+p+"]":"."+p}),{schema:t,parent:i,parentPath:l}):{parent:i,parentPath:e,schema:t}}class Lc extends Set{describe(){const e=[];for(const n of this.values())e.push(ei.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const o of this.values())n.push(e(o));return n}clone(){return new Lc(this.values())}merge(e,n){const o=this.clone();return e.forEach(i=>o.add(i)),n.forEach(i=>o.delete(i)),o}}function Ki(t,e=new Map){if(sm(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let o=0;o{this.typeError(zr.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ki(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let o=e(this);return this._mutate=n,o}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,o=e.clone();const i=Object.assign({},n.spec,o.spec);return o.spec=i,o.internalTests=Object.assign({},n.internalTests,o.internalTests),o._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),o._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),o.tests=n.tests,o.exclusiveTests=n.exclusiveTests,o.withMutation(l=>{e.tests.forEach(c=>{l.test(c.OPTIONS)})}),o.transforms=[...n.transforms,...o.transforms],o}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let o=n.conditions;n=n.clone(),n.conditions=[],n=o.reduce((i,l)=>l.resolve(i,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,o,i,l;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(o=e.abortEarly)!=null?o:this.spec.abortEarly,recursive:(i=e.recursive)!=null?i:this.spec.recursive,disableStackTrace:(l=e.disableStackTrace)!=null?l:this.spec.disableStackTrace})}cast(e,n={}){let o=this.resolve(Object.assign({value:e},n)),i=n.assert==="ignore-optionality",l=o._cast(e,n);if(n.assert!==!1&&!o.isType(l)){if(i&&zo(l))return l;let c=Ks(e),p=Ks(l);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${o.type}". attempted value: ${c} `+(p!==c?`result of cast: ${p}`:""))}return l}_cast(e,n){let o=e===void 0?e:this.transforms.reduce((i,l)=>l.call(this,i,e,this),e);return o===void 0&&(o=this.getDefault(n)),o}_validate(e,n={},o,i){let{path:l,originalValue:c=e,strict:p=this.spec.strict}=n,h=e;p||(h=this._cast(h,Object.assign({assert:!1},n)));let f=[];for(let y of Object.values(this.internalTests))y&&f.push(y);this.runTests({path:l,value:h,originalValue:c,options:n,tests:f},o,y=>{if(y.length)return i(y,h);this.runTests({path:l,value:h,originalValue:c,options:n,tests:this.tests},o,i)})}runTests(e,n,o){let i=!1,{tests:l,value:c,originalValue:p,path:h,options:f}=e,y=N=>{i||(i=!0,n(N,c))},w=N=>{i||(i=!0,o(N,c))},S=l.length,C=[];if(!S)return w([]);let j={value:c,originalValue:p,path:h,options:f,schema:this};for(let N=0;Nthis.resolve(y)._validate(f,y,S,C)}validate(e,n){var o;let i=this.resolve(Object.assign({},n,{value:e})),l=(o=n==null?void 0:n.disableStackTrace)!=null?o:i.spec.disableStackTrace;return new Promise((c,p)=>i._validate(e,n,(h,f)=>{Ln.isError(h)&&(h.value=f),p(h)},(h,f)=>{h.length?p(new Ln(h,f,void 0,void 0,l)):c(f)}))}validateSync(e,n){var o;let i=this.resolve(Object.assign({},n,{value:e})),l,c=(o=n==null?void 0:n.disableStackTrace)!=null?o:i.spec.disableStackTrace;return i._validate(e,Object.assign({},n,{sync:!0}),(p,h)=>{throw Ln.isError(p)&&(p.value=h),p},(p,h)=>{if(p.length)throw new Ln(p,e,void 0,void 0,c);l=h}),l}isValid(e,n){return this.validate(e,n).then(()=>!0,o=>{if(Ln.isError(o))return!1;throw o})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(o){if(Ln.isError(o))return!1;throw o}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):Ki(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const o=this.clone({nullable:e});return o.internalTests.nullable=Gi({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),o}optionality(e,n){const o=this.clone({optional:e});return o.internalTests.optionality=Gi({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),o}optional(){return this.optionality(!0)}defined(e=zr.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=zr.notNull){return this.nullability(!1,e)}required(e=zr.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=zr.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let o=this.clone(),i=Gi(n),l=n.exclusive||n.name&&o.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(o.exclusiveTests[n.name]=!!n.exclusive),o.tests=o.tests.filter(c=>!(c.OPTIONS.name===n.name&&(l||c.OPTIONS.test===i.OPTIONS.test))),o.tests.push(i),o}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let o=this.clone(),i=sb(e).map(l=>new ei(l));return i.forEach(l=>{l.isSibling&&o.deps.push(l.key)}),o.conditions.push(typeof n=="function"?new $c(i,n):$c.fromOptions(i,n)),o}typeError(e){let n=this.clone();return n.internalTests.typeError=Gi({message:e,name:"typeError",skipAbsent:!0,test(o){return this.schema._typeCheck(o)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=zr.oneOf){let o=this.clone();return e.forEach(i=>{o._whitelist.add(i),o._blacklist.delete(i)}),o.internalTests.whiteList=Gi({message:n,name:"oneOf",skipAbsent:!0,test(i){let l=this.schema._whitelist,c=l.resolveAll(this.resolve);return c.includes(i)?!0:this.createError({params:{values:Array.from(l).join(", "),resolved:c}})}}),o}notOneOf(e,n=zr.notOneOf){let o=this.clone();return e.forEach(i=>{o._blacklist.add(i),o._whitelist.delete(i)}),o.internalTests.blacklist=Gi({message:n,name:"notOneOf",test(i){let l=this.schema._blacklist,c=l.resolveAll(this.resolve);return c.includes(i)?this.createError({params:{values:Array.from(l).join(", "),resolved:c}}):!0}}),o}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:o,meta:i,optional:l,nullable:c}=n.spec;return{meta:i,label:o,optional:l,nullable:c,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(h=>({name:h.OPTIONS.name,params:h.OPTIONS.params})).filter((h,f,y)=>y.findIndex(w=>w.name===h.name)===f)}}}Ur.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])Ur.prototype[`${t}At`]=function(e,n,o={}){const{parent:i,parentPath:l,schema:c}=xM(this,e,n,o.context);return c[t](i&&i[l],Object.assign({},o,{parent:i,path:e}))};for(const t of["equals","is"])Ur.prototype[t]=Ur.prototype.oneOf;for(const t of["not","nope"])Ur.prototype[t]=Ur.prototype.notOneOf;const wM=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function SM(t){const e=sh(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function sh(t){var e,n;const o=wM.exec(t);return o?{year:as(o[1]),month:as(o[2],1)-1,day:as(o[3],1),hour:as(o[4]),minute:as(o[5]),second:as(o[6]),millisecond:o[7]?as(o[7].substring(0,3)):0,precision:(e=(n=o[7])==null?void 0:n.length)!=null?e:void 0,z:o[8]||void 0,plusMinus:o[9]||void 0,hourOffset:as(o[10]),minuteOffset:as(o[11])}:null}function as(t,e=0){return Number(t)||e}let bM=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,CM=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,jM=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,EM="^\\d{4}-\\d{2}-\\d{2}",kM="\\d{2}:\\d{2}:\\d{2}",TM="(([+-]\\d{2}(:?\\d{2})?)|Z)",NM=new RegExp(`${EM}T${kM}(\\.\\d+)?${TM}$`),OM=t=>zo(t)||t===t.trim(),RM={}.toString();function lb(){return new ub}class ub extends Ur{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n,o)=>{if(!o.spec.coerce||o.isType(e)||Array.isArray(e))return e;const i=e!=null&&e.toString?e.toString():e;return i===RM?e:i})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||zr.required,name:"required",skipAbsent:!0,test:o=>!!o.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=An.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(o){return o.length===this.resolve(e)}})}min(e,n=An.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o.length>=this.resolve(e)}})}max(e,n=An.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(o){return o.length<=this.resolve(e)}})}matches(e,n){let o=!1,i,l;return n&&(typeof n=="object"?{excludeEmptyString:o=!1,message:i,name:l}=n:i=n),this.test({name:l||"matches",message:i||An.matches,params:{regex:e},skipAbsent:!0,test:c=>c===""&&o||c.search(e)!==-1})}email(e=An.email){return this.matches(bM,{name:"email",message:e,excludeEmptyString:!0})}url(e=An.url){return this.matches(CM,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=An.uuid){return this.matches(jM,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",o,i;return e&&(typeof e=="object"?{message:n="",allowOffset:o=!1,precision:i=void 0}=e:n=e),this.matches(NM,{name:"datetime",message:n||An.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||An.datetime_offset,params:{allowOffset:o},skipAbsent:!0,test:l=>{if(!l||o)return!0;const c=sh(l);return c?!!c.z:!1}}).test({name:"datetime_precision",message:n||An.datetime_precision,params:{precision:i},skipAbsent:!0,test:l=>{if(!l||i==null)return!0;const c=sh(l);return c?c.precision===i:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=An.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:OM})}lowercase(e=An.lowercase){return this.transform(n=>zo(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>zo(n)||n===n.toLowerCase()})}uppercase(e=An.uppercase){return this.transform(n=>zo(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>zo(n)||n===n.toUpperCase()})}}lb.prototype=ub.prototype;let IM=new Date(""),MM=t=>Object.prototype.toString.call(t)==="[object Date]";class om extends Ur{constructor(){super({type:"date",check(e){return MM(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,o)=>!o.spec.coerce||o.isType(e)||e===null?e:(e=SM(e),isNaN(e)?om.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let o;if(ei.isRef(e))o=e;else{let i=this.cast(e);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);o=i}return o}min(e,n=nh.min){let o=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(i){return i>=this.resolve(o)}})}max(e,n=nh.max){let o=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(i){return i<=this.resolve(o)}})}}om.INVALID_DATE=IM;function FM(t,e=[]){let n=[],o=new Set,i=new Set(e.map(([c,p])=>`${c}-${p}`));function l(c,p){let h=Vo.split(c)[0];o.add(h),i.has(`${p}-${h}`)||n.push([p,h])}for(const c of Object.keys(t)){let p=t[c];o.add(c),ei.isRef(p)&&p.isSibling?l(p.path,c):sm(p)&&"deps"in p&&p.deps.forEach(h=>l(h,c))}return aM.array(Array.from(o),n).reverse()}function mx(t,e){let n=1/0;return t.some((o,i)=>{var l;if((l=e.path)!=null&&l.includes(o))return n=i,!0}),n}function cb(t){return(e,n)=>mx(t,e)-mx(t,n)}const DM=(t,e,n)=>{if(typeof t!="string")return t;let o=t;try{o=JSON.parse(t)}catch{}return n.isType(o)?o:t};function Ec(t){if("fields"in t){const e={};for(const[n,o]of Object.entries(t.fields))e[n]=Ec(o);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=Ec(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(Ec)}):"optional"in t?t.optional():t}const _M=(t,e)=>{const n=[...Vo.normalizePath(e)];if(n.length===1)return n[0]in t;let o=n.pop(),i=Vo.getter(Vo.join(n),!0)(t);return!!(i&&o in i)};let gx=t=>Object.prototype.toString.call(t)==="[object Object]";function PM(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(o=>n.indexOf(o)===-1)}const AM=cb([]);function db(t){return new fb(t)}class fb extends Ur{constructor(e){super({type:"object",check(n){return gx(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=AM,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var o;let i=super._cast(e,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let l=this.fields,c=(o=n.stripUnknown)!=null?o:this.spec.noUnknown,p=[].concat(this._nodes,Object.keys(i).filter(w=>!this._nodes.includes(w))),h={},f=Object.assign({},n,{parent:h,__validating:n.__validating||!1}),y=!1;for(const w of p){let S=l[w],C=w in i;if(S){let j,N=i[w];f.path=(n.path?`${n.path}.`:"")+w,S=S.resolve({value:N,context:n.context,parent:h});let E=S instanceof Ur?S.spec:void 0,R=E==null?void 0:E.strict;if(E!=null&&E.strip){y=y||w in i;continue}j=!n.__validating||!R?S.cast(i[w],f):i[w],j!==void 0&&(h[w]=j)}else C&&!c&&(h[w]=i[w]);(C!==w in h||h[w]!==i[w])&&(y=!0)}return y?h:i}_validate(e,n={},o,i){let{from:l=[],originalValue:c=e,recursive:p=this.spec.recursive}=n;n.from=[{schema:this,value:c},...l],n.__validating=!0,n.originalValue=c,super._validate(e,n,o,(h,f)=>{if(!p||!gx(f)){i(h,f);return}c=c||f;let y=[];for(let w of this._nodes){let S=this.fields[w];!S||ei.isRef(S)||y.push(S.asNestedTest({options:n,key:w,parent:f,parentPath:n.path,originalParent:c}))}this.runTests({tests:y,value:f,originalValue:c,options:n},o,w=>{i(w.sort(this._sortErrors).concat(h),f)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),o=n.fields;for(let[i,l]of Object.entries(this.fields)){const c=o[i];o[i]=c===void 0?l:c}return n.withMutation(i=>i.setFields(o,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(o=>{var i;const l=this.fields[o];let c=e;(i=c)!=null&&i.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[o]})),n[o]=l&&"getDefault"in l?l.getDefault(c):void 0}),n}setFields(e,n){let o=this.clone();return o.fields=e,o._nodes=FM(e,n),o._sortErrors=cb(Object.keys(e)),n&&(o._excludedEdges=n),o}shape(e,n=[]){return this.clone().withMutation(o=>{let i=o._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...o._excludedEdges,...n]),o.setFields(Object.assign(o.fields,e),i)})}partial(){const e={};for(const[n,o]of Object.entries(this.fields))e[n]="optional"in o&&o.optional instanceof Function?o.optional():o;return this.setFields(e)}deepPartial(){return Ec(this)}pick(e){const n={};for(const o of e)this.fields[o]&&(n[o]=this.fields[o]);return this.setFields(n,this._excludedEdges.filter(([o,i])=>e.includes(o)&&e.includes(i)))}omit(e){const n=[];for(const o of Object.keys(this.fields))e.includes(o)||n.push(o);return this.pick(n)}from(e,n,o){let i=Vo.getter(e,!0);return this.transform(l=>{if(!l)return l;let c=l;return _M(l,e)&&(c=Object.assign({},l),o||delete c[e],c[n]=i(l)),c})}json(){return this.transform(DM)}noUnknown(e=!0,n=rh.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let o=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const l=PM(this.schema,i);return!e||l.length===0||this.createError({params:{unknown:l.join(", ")}})}});return o.spec.noUnknown=e,o}unknown(e=!0,n=rh.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const o={};for(const i of Object.keys(n))o[e(i)]=n[i];return o})}camelCase(){return this.transformKeys(Ep.camelCase)}snakeCase(){return this.transformKeys(Ep.snakeCase)}constantCase(){return this.transformKeys(e=>Ep.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),o=super.describe(e);o.fields={};for(const[l,c]of Object.entries(n.fields)){var i;let p=e;(i=p)!=null&&i.value&&(p=Object.assign({},p,{parent:p.value,value:p.value[l]})),o.fields[l]=c.describe(p)}return o}}db.prototype=fb.prototype;const $M=()=>{const{event:t,setEvent:e,locale:n}=we(),{mechanicId:o}=Gt(),i=async(l,c)=>{try{await me("update-mechanic-settings",{mechanicId:o,...l}),e({...t,...l}),c.resetForm({values:l})}catch(p){console.error(p)}};return u.jsx("div",{children:u.jsx(ZI,{initialValues:{label:t.label||""},validationSchema:db().shape({label:lb().max(100).required(n.required)}),onSubmit:i,enableReinitialize:!0,children:({values:l,handleChange:c,handleSubmit:p,dirty:h})=>u.jsxs("form",{onSubmit:p,children:[u.jsx(gl,{children:u.jsx(Us,{children:u.jsxs(ue.Group,{className:"mb-3",children:[u.jsx(ue.Label,{children:n.mechanicName}),u.jsx(ue.Control,{id:"label",name:"label",type:"text",value:l.label,onChange:c,placeholder:o||""})]})})}),u.jsx(ve,{type:"submit",disabled:!h,children:n.save})]})})})},LM=({role:t,show:e,onHide:n,onUpdateRole:o})=>{const{locale:i}=we(),[l,c]=v.useState(t),p=[{id:"manager",label:i.managerRole},{id:"mechanic",label:i.mechanicRole}],h=f=>{f.preventDefault(),o({role:l}),n()};return u.jsxs(ye,{show:e,onHide:()=>n(),style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:i.changeRole})}),u.jsx(ye.Body,{children:u.jsxs(ue,{onSubmit:h,children:[u.jsxs(ue.Group,{className:"mb-3",children:[u.jsx(ue.Label,{children:i.role}),u.jsx(ue.Select,{value:l,onChange:f=>c(f.target.value),children:p.map(({id:f,label:y})=>u.jsx("option",{value:f,children:y},f))})]}),u.jsx(ve,{type:"submit",children:i.changeRole})]})})]})},zM=({show:t,onHide:e,onConfirm:n})=>{const{locale:o}=we();return u.jsxs(ye,{show:t,onHide:()=>e(),style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:o.fireEmployee})}),u.jsxs(ye.Body,{children:[u.jsx("p",{className:"mb-3",children:o.areYouSure}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx(ve,{variant:"primary",onClick:()=>{n(),e()},children:o.yes}),u.jsx(ve,{variant:"dark",onClick:()=>e(),children:o.no})]})]})]})},BM=({employee:t,afterFireEmployee:e,afterUpdateEmployee:n})=>{var w;const{locale:o}=we(),{mechanicId:i}=Gt(),[l,c]=v.useState(!1),[p,h]=v.useState(!1),f=async S=>{await me("update-employee-role",{identifier:t.identifier,mechanicId:i,newRole:S.role}),n({...t,...S})},y=async()=>{await me("fire-employee",{identifier:t.identifier,mechanicId:i}),e()};return u.jsxs("tr",{children:[u.jsx("td",{children:t.name}),u.jsxs("td",{children:[u.jsx("span",{children:o[`${t.role}Role`]}),!t.me&&!t.pending&&u.jsxs("span",{children:[u.jsx(ve,{size:"sm",variant:"link",className:"me-2",onClick:()=>c(!0),children:u.jsx("i",{className:"bi-pencil"})}),u.jsx(LM,{role:t.role,show:l,onHide:()=>c(!1),onUpdateRole:f})]})]}),u.jsx("td",{children:t.joined&&((w=ot.fromMillis(t.joined))==null?void 0:w.toLocaleString(o.NumberAndDateFormat))}),u.jsx("td",{className:"text-end",children:t.pending?u.jsx(ve,{size:"sm",disabled:!0,variant:"muted",children:o.pending}):t.me?u.jsx(ve,{size:"sm",disabled:!0,variant:"muted",children:o.you}):u.jsxs("div",{children:[u.jsxs(ve,{size:"sm",variant:"danger",onClick:()=>h(!0),children:[u.jsx("i",{className:"bi-person-x-fill me-1"}),o.fire]}),u.jsx(zM,{show:p,onHide:()=>h(!1),onConfirm:()=>y()})]})})]})},HM=({show:t,onHide:e,afterHireEmployee:n})=>{const{locale:o}=we(),{mechanicId:i}=Gt(),[l,c]=v.useState([]),[p,h]=v.useState(!1),[f,y]=v.useState("manager"),w=v.useMemo(()=>[{id:"manager",label:o.managerRole},{id:"mechanic",label:o.mechanicRole}],[o]),S=async C=>{var j;if(C.preventDefault(),!p)return!1;await me("request-hire-employee",{mechanicId:i,playerId:p,role:f}),n({name:(j=l.find(({id:N})=>N===p))==null?void 0:j.name,role:f,me:!1,pending:!0}),e()};return v.useEffect(()=>{t&&(async()=>{const j=await me("nearby-players");Array.isArray(j)&&c(j)})()},[t]),u.jsxs(ye,{show:t,onHide:()=>e(),style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:o.hireEmployee})}),u.jsx(ye.Body,{children:u.jsxs("form",{onSubmit:S,children:[u.jsxs(ue.Group,{className:"mb-3",children:[u.jsx(ue.Label,{children:o.nearbyPlayers}),u.jsxs(ue.Select,{value:p?p.toString():"",onChange:C=>h(parseInt(C.target.value)),children:[u.jsx("option",{value:"",disabled:!0,children:l.length?o.selectPlayer:o.noPlayersNearby}),l.map(({id:C,name:j})=>u.jsx("option",{value:C,children:j},C))]})]}),u.jsxs(ue.Group,{className:"mb-3",children:[u.jsx(ue.Label,{children:o.role}),u.jsx(ue.Select,{value:f,onChange:C=>y(C.target.value),children:w.map(({id:C,label:j})=>u.jsx("option",{value:C,children:j},C))})]}),u.jsx(ve,{type:"submit",disabled:!p,children:o.hireEmployee})]})})]})},WM=({currentTab:t})=>{const{event:e,locale:n}=we(),{mechanicId:o}=Gt(),[i,l]=v.useState(!1),[c,p]=v.useState(!1),[h,f]=v.useState([]),y=v.useCallback(async()=>{l(!0);try{const j=await me("get-mechanic-employees",{mechanicId:o});f(j)}catch(j){console.error(j)}l(!1)},[o]),w=j=>{f(h.filter(N=>N.identifier!==j))},S=(j,N)=>{f(h.map(E=>E.identifier===j?N:E))},C=j=>{f(N=>[...N,j])};return v.useEffect(()=>{e.employees?f(e.employees||[]):t===n.employees&&y()},[t,n.employees,y,e.employees]),u.jsx("div",{children:i?u.jsx(Qh,{}):u.jsxs("div",{children:[u.jsxs("div",{className:"d-flex justify-content-end mb-3",children:[u.jsxs(ve,{onClick:()=>p(!0),variant:"primary",children:[u.jsx("i",{className:"bi-person-plus-fill me-1"}),u.jsx("span",{children:n.hireEmployee})]}),u.jsx(HM,{show:c,onHide:()=>p(!1),afterHireEmployee:C})]}),u.jsxs(ua,{hover:!0,className:"bootstrap-table",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:n.employeeName}),u.jsx("th",{children:n.role}),u.jsx("th",{children:n.joined}),u.jsx("th",{})]})}),u.jsx("tbody",{children:h.length?h.map(j=>u.jsx(BM,{employee:j,afterFireEmployee:()=>w(j.identifier),afterUpdateEmployee:N=>S(N.identifier,N)},j.identifier)):u.jsx("tr",{children:u.jsx("td",{colSpan:4,align:"center",children:n.noEmployees})})})]})]})})},vx=({type:t,show:e,onHide:n})=>{var N,E,R;const{event:o,setEvent:i,config:l,locale:c}=we(),{mechanicId:p}=Gt(),[h,f]=v.useState("bank"),[y,w]=v.useState(0),[S,C]=v.useState(!1),j=async I=>{I.preventDefault(),C(!0);try{await me("update-mechanic-balance",{mechanicId:p,action:t,source:h,amount:y}),i({...o,playerBalance:{...o.playerBalance,[h]:t==="deposit"?o.playerBalance[h]-(y||0):o.playerBalance[h]+(y||0)}})}catch(F){console.error(F)}n(),C(!1)};return u.jsxs(ye,{show:e,onHide:()=>n(),style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:c[t]})}),u.jsx(ye.Body,{children:u.jsxs(ue,{onSubmit:j,children:[t==="deposit"&&u.jsxs(ue.Group,{className:"mb-3",children:[u.jsx(ue.Label,{children:c.paymentSource}),u.jsxs("div",{children:[u.jsx(ue.Check,{label:u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsx("span",{className:"me-2",children:c.bank}),u.jsx(Pt,{bg:"secondary",children:Tt((N=o.playerBalance)==null?void 0:N.bank,l)})]}),name:"payment-source",type:"radio",id:"payment-source-card",checked:h==="bank",onChange:I=>f(I.target.checked?"bank":"cash")}),u.jsx(ue.Check,{label:u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsx("span",{className:"me-2",children:c.cash}),u.jsx(Pt,{bg:"secondary",children:Tt((E=o.playerBalance)==null?void 0:E.cash,l)})]}),name:"payment-source",type:"radio",id:"payment-source-cash",checked:h==="cash",onChange:I=>f(I.target.checked?"cash":"bank")})]})]}),u.jsxs(ue.Group,{className:"mb-3",children:[u.jsx(ue.Label,{children:c.amount}),u.jsx(Lp,{children:u.jsx(ue.Control,{type:"number",min:1,max:t==="deposit"?(R=o.playerBalance)==null?void 0:R[h]:o.balance,value:y,onChange:I=>w(I.target.value?parseFloat(I.target.value):""),required:!0})})]}),u.jsx(ve,{type:"submit",variant:"primary",disabled:S,children:c[t]})]})})]})},VM=({currentTab:t})=>{var j,N,E;const{event:n,setEvent:o,config:i,locale:l}=we(),{mechanicId:c}=Gt(),[p,h]=v.useState(n.balance||0),[f,y]=v.useState(!1),[w,S]=v.useState(!1),C=v.useCallback(async()=>{const R=await me("get-mechanic-balance",{mechanicId:c});h(R),o(I=>({...I,balance:R}))},[c,o]);return v.useEffect(()=>{t===l.dashboard&&C()},[t,l.dashboard,C,!1]),u.jsxs("div",{children:[u.jsx(gl,{className:"mb-3",children:u.jsx(Us,{children:u.jsx(gt,{border:"primary",children:u.jsxs(gt.Body,{className:"d-flex justify-content-between",children:[u.jsxs("div",{children:[u.jsx("h2",{children:Tt(p,i)}),u.jsx("div",{children:l.accountBalance})]}),!i.UseFrameworkJobs&&n.employeeRole!=="mechanic"&&u.jsxs("div",{className:"d-flex flex-column justify-content-end gap-2",children:[u.jsxs(ve,{size:"sm",onClick:()=>y(!0),children:[u.jsx("i",{className:"bi-box-arrow-left me-2"}),l.withdraw]}),u.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>S(!0),children:[u.jsx("i",{className:"bi-box-arrow-right me-2"}),l.deposit]})]})]})})})}),u.jsxs(gl,{className:"mb-3",children:[u.jsx(Us,{children:u.jsx(gt,{children:u.jsxs(gt.Body,{children:[u.jsx("h3",{children:((j=n.stats)==null?void 0:j.totalOrders)||0}),u.jsx("span",{children:l.totalOrders})]})})}),u.jsx(Us,{children:u.jsx(gt,{children:u.jsxs(gt.Body,{children:[u.jsx("h3",{children:((N=n.stats)==null?void 0:N.totalInvoices)||0}),u.jsx("span",{children:l.totalInvoices})]})})}),!i.UseFrameworkJobs&&u.jsx(Us,{children:u.jsx(gt,{children:u.jsxs(gt.Body,{children:[u.jsx("h3",{children:((E=n.stats)==null?void 0:E.totalEmployees)||0}),u.jsx("span",{children:l.totalEmployees})]})})})]}),i.UseFrameworkJobs&&u.jsx(gl,{children:u.jsx(Us,{children:u.jsxs(Vr,{variant:"primary",className:"p-2 mb-0 px-3",children:[u.jsx("i",{className:"bi-info-circle me-2"})," Set up to use third-party resources for bank account, hiring & roles."]})})}),u.jsx(vx,{type:"withdraw",show:f,onHide:()=>{y(!1),C()}}),u.jsx(vx,{type:"deposit",show:w,onHide:()=>{S(!1),C()}})]})},UM=()=>{const{event:t,locale:e,config:n}=we(),[o,i]=v.useState("Dashboard"),l=v.useMemo(()=>[{icon:"bi-graph-up",name:e.dashboard,Component:VM},!n.UseFrameworkJobs&&t.employeeRole!=="mechanic"&&{icon:"bi-people",name:e.employees,Component:WM},t.employeeRole!=="mechanic"&&{icon:"bi-gear",name:e.settings,Component:$M}],[e,t.employeeRole,n.UseFrameworkJobs]).filter(Boolean);return u.jsxs("div",{className:"p-4 pb-1 h-full flex flex-col",children:[u.jsx("h2",{className:"mb-4",children:e.management}),u.jsx(gt,{className:"h-full flex-1 overflow-auto",children:u.jsx(bw,{id:"justify-tab-example",className:"mb-3 p-3 pb-0 bg-gray-900 rounded-t-md",activeKey:o,onSelect:c=>i(c),justify:!0,children:l.map(({icon:c,name:p,Component:h},f)=>u.jsx(nk,{eventKey:p,title:u.jsxs("div",{children:[u.jsx("i",{className:`me-2 ${c}`}),p]}),children:u.jsx("div",{className:"p-3 pt-0",children:u.jsx(h,{currentTab:o})})},f))})})]})},pb=({show:t,onHide:e,onSend:n})=>{const{locale:o}=we(),[i,l]=v.useState([]),[c,p]=v.useState(!1);v.useEffect(()=>{t&&(async()=>{const w=await me("nearby-players",{includePlayer:!0});Array.isArray(w)&&l(w)})()},[t]);const h=()=>{var y;return(y=i.find(({id:w})=>w===c))==null?void 0:y.name},f=async y=>{if(y.preventDefault(),!c)return!1;n(c,h()||"ERROR_FETCHING_NAME"),e()};return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:o.nearbyPlayers})}),u.jsx(ye.Body,{children:u.jsxs(ue,{onSubmit:f,children:[u.jsx(ue.Group,{className:"mb-3",children:u.jsxs(ue.Select,{value:c||"",onChange:y=>p(parseInt(y.target.value)),children:[u.jsx("option",{value:"",children:o.selectPlayer}),i.map(({id:y,name:w},S)=>u.jsxs("option",{value:y,children:[w," [",y,"]"]},S))]})}),u.jsxs(ve,{variant:"success",type:"submit",disabled:!c,children:[u.jsx("i",{className:"bi-arrow-up-right me-2"}),o.send]})]})})]})},hb=v.createContext(void 0),GM=()=>{const t=v.useContext(hb);if(!t)throw new Error("Must be used in the InvoiceAppContext");return t},yx=({invoice:t})=>{var y;const{config:e,locale:n}=we(),[o,i]=v.useState(!1),{invoices:l,setInvoices:c,setCreatingInvoice:p}=GM(),h=async(w,S)=>{await me("resend-invoice",{player:w,invoiceId:t.id}),c(l.map(C=>C.id===t.id?{...C,recipient:S}:C))},f=async()=>{await me("delete-invoice",{invoiceId:t.id}),c(l.filter(({id:w})=>w!==t.id))};return u.jsxs("tr",{children:[u.jsx("td",{children:t.draft?u.jsx(Pt,{bg:"warning",text:"black",children:n.draft}):u.jsx(Pt,{bg:"danger",children:n.unpaid})}),u.jsx("td",{children:t.date?(y=ot.fromMillis(t.date))==null?void 0:y.toLocaleString():"-"}),u.jsx("td",{children:t.recipient||"-"}),u.jsx("td",{children:Tt(t.total,e)}),u.jsxs("td",{className:"text-end",children:[t.draft&&p?u.jsxs(ve,{size:"sm",variant:"success",onClick:()=>p(!0),children:[u.jsx("i",{className:"bi-pencil me-1"}),n.edit]}):u.jsxs("div",{className:"flex gap-2 justify-end",children:[u.jsxs(ve,{size:"sm",variant:"secondary",onClick:()=>i(!0),children:[u.jsx("i",{className:"bi-arrow-up-right me-1"}),n.resend]}),u.jsx(ve,{size:"sm",variant:"danger",onClick:f,children:u.jsx("i",{className:"bi-trash"})})]}),u.jsx(pb,{show:o,onHide:()=>i(!1),onSend:h})]})]})},qM=({data:t})=>{const{locale:e}=we(),{invoiceItems:n,invoiceTotal:o}=Gt(),i=v.useMemo(()=>[{Header:e.status||"",accessor:"status"},{Header:e.date||"",accessor:"date"},{Header:e.recipient||"",accessor:"recipient"},{Header:e.total||"",accessor:"total_cost"},{Header:"",accessor:"actions"}],[e]),{getTableProps:l,getTableBodyProps:c,headerGroups:p,page:h,canPreviousPage:f,canNextPage:y,pageOptions:w,nextPage:S,previousPage:C,setPageSize:j,state:{pageIndex:N,pageSize:E}}=na.useTable({columns:i,data:t,autoResetPage:!1,autoResetFilters:!1,initialState:{pageSize:5}},na.usePagination);return u.jsxs("div",{children:[u.jsxs(ua,{hover:!0,className:"bootstrap-table",...l(),children:[u.jsx("thead",{children:p.map(R=>u.jsx("tr",{...R.getHeaderGroupProps(),children:R.headers.map(I=>u.jsx("th",{...I.getHeaderProps(),children:I.render("Header")}))}))}),u.jsx("tbody",{...c(),children:!h.length&&!(n!=null&&n.length)?u.jsx("tr",{children:u.jsx("td",{colSpan:100,align:"center",children:e.noInvoices})}):u.jsxs(u.Fragment,{children:[!!(n!=null&&n.length)&&u.jsx(yx,{invoice:{id:0,draft:!0,total:o,data:n}}),h.map(R=>u.jsx(yx,{invoice:R.original},R.original.id))]})})]}),u.jsxs("div",{className:"pagination d-flex justify-content-between",children:[u.jsxs(ve,{variant:"dark",onClick:()=>C(),disabled:!f,children:[u.jsx("i",{className:"bi-chevron-left"})," ",e.previous]}),u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsxs("span",{className:"me-3",children:[e.page," ",N+1," ",e.of," ",w.length]}),u.jsx(ue.Select,{size:"sm",value:E,onChange:R=>{j(Number(R.target.value))},style:{width:110},children:[5,10,15,20,30].map(R=>u.jsxs("option",{value:R,children:[e.show," ",R]},R))})]}),u.jsxs(ve,{variant:"dark",onClick:()=>S(),disabled:!y,children:[e.next," ",u.jsx("i",{className:"bi-chevron-right"})]})]})]})},KM=({title:t,amount:e,onUpdateItem:n,onDeleteItem:o})=>u.jsxs("tr",{children:[u.jsx("td",{children:u.jsx(ue.Control,{type:"text",value:t,onChange:i=>n("title",i.target.value)})}),u.jsx("td",{children:u.jsx(ue.Control,{type:"number",placeholder:"0.00",value:e,onChange:i=>n("amount",parseFloat(i.target.value))})}),u.jsx("td",{children:u.jsx(ve,{variant:"dark",className:"!text-red-500",onClick:o,children:u.jsx("i",{className:"bi-trash"})})})]}),ZM=({onBack:t})=>{const{config:e,locale:n}=we(),{invoiceItems:o,setInvoiceItems:i,invoiceTotal:l}=Gt(),[c,p]=v.useState(!1),[h,f]=v.useState(!1),y=()=>{i([...o,{title:"",amount:0}])},w=(N,E,R)=>{i(o.map((I,F)=>F===N?{...I,[E]:R}:I))},S=N=>{i(o.filter((E,R)=>R!==N))},C=async N=>{f(!0),await me("send-invoice",{player:N,invoiceItems:o,invoiceTotal:l})&&(i([]),t()),f(!1)},j=async()=>{f(!0),await me("save-invoice",{invoiceItems:o,invoiceTotal:l})&&(i([]),t()),f(!1)};return u.jsxs("div",{className:"p-4",children:[u.jsxs("div",{className:"flex justify-between items-start",children:[u.jsxs("div",{children:[u.jsxs("button",{className:"mb-2 text-muted",onClick:t,children:[u.jsx("i",{className:"bi-arrow-left"})," ",n.back]}),u.jsx("h2",{className:"mb-4",children:n.invoices})]}),u.jsxs("div",{className:"flex gap-3 items-center",children:[u.jsxs(ve,{variant:"secondary",onClick:j,disabled:h||l<=0,children:[u.jsx("i",{className:"bi-save me-2"}),n.save]}),u.jsxs(ve,{variant:"success",onClick:()=>p(!0),disabled:h||l<=0,className:"!flex gap-2 items-center",children:[u.jsx("i",{className:"bi-arrow-up-right"}),u.jsx("span",{children:n.sendNow}),u.jsx(Pt,{bg:"white",text:"success",className:"max-w-[150px] truncate",children:Tt(l,e)})]}),u.jsx(pb,{show:c,onHide:()=>p(!1),onSend:C})]})]}),u.jsxs("div",{children:[u.jsxs(ua,{className:"w-full",children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:n.description}),u.jsx("th",{className:"w-[200px]",children:n.amount}),u.jsx("th",{className:"w-[60px]"})]})}),u.jsx("tbody",{children:o.map(({title:N,amount:E},R)=>u.jsx(KM,{title:N,amount:E,onUpdateItem:(I,F)=>w(R,I,F),onDeleteItem:()=>S(R)}))})]}),u.jsx("div",{className:"flex justify-end",children:u.jsxs(ve,{size:"sm",variant:"dark",onClick:y,children:[u.jsx("i",{className:"bi-plus-lg me-2"}),n.addRow]})})]})]})},YM=()=>{const{event:t,locale:e}=we(),{invoiceItems:n,setUnpaidInvoicesCount:o}=Gt(),[i,l]=v.useState(t.unpaidInvoices||[]),[c,p]=v.useState(!1),[h,f]=v.useState(!0),y=v.useCallback(async()=>{f(!0);const w=await me("get-unpaid-invoices");l(w),o(w.length),f(!1)},[o]);return v.useEffect(()=>{!t.orders&&!c&&y()},[t.orders,y,c]),c?u.jsx(ZM,{onBack:()=>p(!1)}):u.jsx(hb.Provider,{value:{invoices:i,setInvoices:l,setCreatingInvoice:p},children:u.jsxs("div",{className:"p-4",children:[u.jsxs("div",{className:"flex justify-between items-start",children:[u.jsx("h2",{className:"mb-4",children:e.invoices}),u.jsxs("div",{className:"flex gap-3",children:[u.jsxs(ve,{variant:"dark",onClick:y,disabled:h,children:[u.jsx("i",{className:"bi-arrow-clockwise me-2"}),e.refresh]}),!(n!=null&&n.length)&&u.jsxs(ve,{variant:"success",onClick:()=>p(!0),children:[u.jsx("i",{className:"bi-plus-lg me-2"}),e.create]})]})]}),u.jsx("div",{children:u.jsx(qM,{data:i})})]})})},oh={servicing:{icon:"bi-tools",iconColour:"from-orange-400 to-orange-600",requiresConnection:!0,requiredVehicles:["car","bike"],Component:EN},dyno:{icon:"bi-graph-up",iconColour:"from-pink-600 to-pink-700",requiresConnection:!0,requiredVehicles:["car","bike"],Component:Sk},tuning:{icon:"bi-speedometer",iconColour:"from-purple-500 to-purple-600",requiresConnection:!0,requiredVehicles:["car","bike"],Component:RN},nos:{icon:"bi-fire",iconColour:"from-red-500 to-red-600",requiresConnection:!0,requiredVehicles:["car","bike"],combustionOnly:!0,Component:TN},orders:{icon:"bi-bag-check-fill",iconColour:"from-green-600 to-green-700",requiresConnection:!1,Component:zN},invoices:{icon:"bi-cash-coin",iconColour:"from-blue-500 to-blue-600",requiresConnection:!1,Component:YM},management:{icon:"bi-briefcase-fill",iconColour:"from-amber-700 to-amber-900",requiresConnection:!1,Component:UM},settings:{icon:"bi-gear-wide-connected",iconColour:"from-gray-400 to-gray-500",requiresConnection:!1,Component:kN}},QM=()=>{const{event:t,locale:e}=we(),{currentApp:n,setCurrentApp:o,connectedVehicle:i,ordersCount:l}=Gt();return n?Object.entries(oh).map(([c,{Component:p}])=>c===n&&u.jsx(p,{},c)):u.jsx("div",{className:"p-10 h-[100%] flex justify-center items-center",children:u.jsx("div",{className:"flex gap-4 flex-wrap justify-center items-center",children:Object.entries(oh).map(([c,{icon:p,iconColour:h,requiredVehicles:f,requiresConnection:y,combustionOnly:w}])=>!i&&y||w&&t.isVehicleElectric||f&&!f.includes(t.vehicleType)?null:u.jsxs("button",{className:"app",onClick:()=>o(c),children:[u.jsx("div",{className:`app-icon bg-gradient-to-b ${h} bg-blend-lighten hover:brightness-[0.8] transition`,style:{textShadow:"0px 10px 10px rgba(0,0,0,0.2)"},children:u.jsx("i",{className:`${p}`})}),u.jsx("div",{className:"app-name",children:e[c]}),c==="orders"&&!!l&&u.jsx("div",{className:"app-unread",children:l})]},c))})})},XM=({show:t,onHide:e,onDiscardInvoice:n})=>{const{locale:o}=we();return u.jsxs(ye,{show:t,onHide:e,style:{zIndex:99999},centered:!0,size:"sm",backdropClassName:"tablet-modal-backdrop",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsxs("h5",{className:"mb-0",children:[u.jsx("i",{className:"bi-exclamation-triangle-fill me-2"}),o.warning]})}),u.jsxs(ye.Body,{children:[u.jsx("p",{children:o.invoiceWillBeLost}),u.jsx("p",{children:o.invoiceCreatedWarning}),u.jsxs("div",{className:"flex justify-between",children:[u.jsx(ve,{onClick:n,variant:"danger",children:o.discardInvoice}),u.jsx(ve,{onClick:e,variant:"dark",children:o.back})]})]})]})},JM=()=>{const{onCloseModal:t,locale:e}=we(),{currentApp:n,setCurrentApp:o,connectedVehicle:i,setConnectedVehicle:l,setMechanicId:c,setShowLogin:p,onDuty:h,setOnDuty:f,invoiceItems:y,setInvoiceItems:w}=Gt(),[S,C]=v.useState(!1),[j,N]=v.useState(!1),E=async()=>{await me("stop-dyno"),await me("disconnect-vehicle"),(!n||oh[n].requiresConnection)&&o(!1),l(!1)},R=async()=>{const L=!h;await me("toggle-on-duty",{toggle:L})&&f(L)},I=async L=>{if(me("stop-dyno"),L&&y&&y.length){N(!0);return}i&&await E(),t(),w([]),c(!1),p(!0)},F=()=>{o(!1),me("stop-dyno")};return u.jsxs("div",{className:"absolute bottom-0 left-0 w-full p-3 px-4 flex justify-between bg-[#212529]/75 backdrop-blur-[25px] backdrop-grayscale-20",children:[u.jsxs(ve,{variant:"dark",className:"!bg-transparent text-muted hover:!text-white !flex items-center",onClick:F,children:[u.jsx("i",{className:"bi-house me-2 text-xl"}),e.home]}),u.jsx(ve,{onClick:R,variant:"dark",className:"!bg-transparent text-muted hover:!text-white !flex items-center",children:h?u.jsxs(u.Fragment,{children:[u.jsx("i",{className:"bi-check-lg me-2 text-xl text-green-600"}),e.onDuty]}):u.jsxs(u.Fragment,{children:[u.jsx("i",{className:"bi-x-lg me-2 text-xl text-red-500"}),e.offDuty]})}),i?u.jsxs(ve,{onClick:E,variant:"dark",className:"!bg-transparent text-muted hover:!text-white !flex items-center",children:[u.jsx("i",{className:"bi-x-lg me-2 text-xl "}),u.jsx("span",{children:e.disconnectVehicle})]}):u.jsxs(u.Fragment,{children:[u.jsxs(ve,{onClick:()=>C(!0),variant:"dark",className:"!bg-transparent text-muted hover:!text-white !flex items-center",children:[u.jsx("i",{className:"bi-plug me-2 text-xl"}),u.jsx("span",{children:e.connectVehicle})]}),u.jsx(ok,{show:S,onClose:()=>C(!1)})]}),u.jsxs(ve,{onClick:()=>I(!0),variant:"dark",className:"!bg-transparent text-muted hover:!text-white !flex items-center",children:[u.jsx("i",{className:"bi-box-arrow-right me-2 text-xl"}),e.logout]}),u.jsx(XM,{show:j,onHide:()=>N(!1),onDiscardInvoice:()=>I(!1)})]})},mb=()=>{const{event:t}=we();return t.instructionText?u.jsxs(gt,{className:"!fixed left-[50%] translate-x-[-50%] bottom-12 p-2 px-3 flex flex-row items-center gap-2 z-[999999]",children:[u.jsx("i",{className:"bi-info-circle"}),u.jsx("div",{className:"flex items-center",dangerouslySetInnerHTML:{__html:t.instructionText.replace(/\[+([^\][]+)]+/g,'$1')}})]}):null},eF=()=>{const{event:t,setEvent:e,locale:n,onCloseModal:o}=we(),{showLogin:i,setShowLogin:l,setMechanicId:c,setOrdersCount:p,setOnDuty:h,wallpaper:f}=Gt(),[y,w]=v.useState(!1),[S,C]=v.useState(t.availableMechanics?Object.keys(t.availableMechanics)[0]:""),[j,N]=v.useState(t.gameTime||{hours:0,mins:0}),E=v.useRef();v.useEffect(()=>(E.current=setInterval(()=>{N(F=>{let L=F.hours,P=F.mins+1;return F.mins==60&&(L+=1,P=0),F.hours==24&&(P=0),{hours:L,mins:P}})},2e3),()=>clearTimeout(E.current)),[j]);const R=async()=>{w(!0);try{const F=await me("tablet-login",{mechanicId:S});F&&(c(S),p(F.ordersCount||0),h(F.onDuty||!1),e(L=>({...L,...F})),l(!1))}catch(F){console.log(F)}w(!1)},I=async()=>{await me("disconnect-vehicle"),o()};return u.jsxs("div",{className:`absolute top-0 ${i?"":"translate-y-[-100%]"} transition ease-in duration-300 bg-gray-800 left-0 z-[1] w-full h-full flex items-center flex-col justify-between gap-[50px] p-20 bg-cover`,style:{backgroundImage:`linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.7)), url(${f})`},children:[u.jsxs("h1",{className:"text-[80px] font-black",style:{textShadow:"0px 7.5px 15px rgba(0,0,0,0.2)"},children:[j.hours.toString().padStart(2,"0"),":",j.mins.toString().padStart(2,"0")]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{className:"text-2xl text-muted hover:!text-white transition",onClick:I,children:u.jsx("i",{className:"bi-box-arrow-left"})}),u.jsxs(ue.Select,{value:S,onChange:F=>C(F.target.value),children:[u.jsx("option",{value:"",disabled:!0,children:n.selectAMechanic}),Object.entries(t.availableMechanics).map(([F,L])=>u.jsx("option",{value:F,children:L},F))]}),u.jsx(ve,{variant:"success",onClick:R,disabled:!S||y,className:"flex-shrink-0",children:n.login})]})]})},xx="https://cfx-nui-jg-mechanic/web/dist/default-wallpaper.jpg",tF=()=>{const{event:t}=we(),e=v.useMemo(()=>t.instructionText,[t]),[n,o]=v.useState("jg-rugged"),[i,l]=v.useState(xx),[c,p]=v.useState(!0),[h,f]=v.useState(!1),[y,w]=v.useState(!1),[S,C]=v.useState(!1),[j,N]=v.useState(0),[E,R]=v.useState(0),[I,F]=v.useState([]),L=v.useMemo(()=>I.reduce((X,re)=>X+=re.amount||0,0),[I]),[P,B]=v.useState(t.connectedVehicle||!1);v.useEffect(()=>{var X,re;B(t.connectedVehicle||!1),o(((X=t.preferences)==null?void 0:X.tabletFrame)||"jg-rugged"),l(((re=t.preferences)==null?void 0:re.wallpaper)||xx)},[t.connectedVehicle,t.preferences]);const W=(X,re)=>{F([...I,{title:X,amount:re}])};return t.type!=="show-tablet"?null:u.jsxs(Ax.Provider,{value:{tabletFrame:n,setTabletFrame:o,wallpaper:i,setWallpaper:l,showLogin:c,setShowLogin:p,mechanicId:y,setMechanicId:w,currentApp:h,setCurrentApp:f,connectedVehicle:P,setConnectedVehicle:B,ordersCount:j,setOrdersCount:N,unpaidInvoicesCount:E,setUnpaidInvoicesCount:R,onDuty:S,setOnDuty:C,invoiceItems:I,setInvoiceItems:F,addInvoiceItem:W,invoiceTotal:L},children:[e&&u.jsx(mb,{}),u.jsx("div",{className:"flex items-center justify-center h-full w-full",children:u.jsx("div",{className:`tablet ${n} transition ease-in duration-300 ${e?"pointer-events-none translate-y-[100vh]":""}`,children:u.jsx("div",{className:"tablet-screen overflow-hidden",children:u.jsxs("div",{className:"flex flex-col h-full justify-between",children:[u.jsx(LC,{showConnectionStatus:!c}),u.jsx(eF,{}),u.jsx("div",{className:"flex-1 overflow-y-auto pb-[70px]",children:u.jsx(QM,{})}),u.jsx(JM,{})]})})})})]})},gb=v.createContext(void 0),Zt=()=>{const t=v.useContext(gb);if(!t)throw new Error("Must be used in the TuningProvider");return t},Qs=v.forwardRef(({icon:t,modIndex:e,title:n,onClick:o,selected:i,installed:l,price:c,isCategory:p,isToggle:h,subItemsCount:f},y)=>{var C;const{config:w,locale:S}=we();return u.jsxs(gt,{ref:y,className:"cursor-pointer mb-3 last:!mb-0 hover:border-[#777] transition",onClick:o,border:i?"primary":void 0,children:[u.jsxs(gt.Body,{className:"flex gap-3 py-3 items-center text-white",children:[u.jsx("img",{src:`./icons/${t}`,className:"w-[40px] h-[40px]"}),u.jsxs("div",{className:"flex flex-col gap-2 items-start overflow-hidden",children:[u.jsx("div",{className:"font-medium leading-tight text-wrap whitespace-normal text-ellipsis overflow-hidden w-full",children:n}),(l||typeof c=="number"&&e>-1)&&u.jsx(Pt,{className:"!text-[10px]",bg:l?"primary":"white",text:l?"white":"dark",children:l?S.owned:Tt(c||0,w)})]})]}),(f||i||h)&&u.jsxs(gt.Footer,{className:`text-xs flex justify-between font-medium ${i?"bg-primary":""}`,children:[p&&f?u.jsx("span",{className:i?"text-white":"",children:(C=S.itemsAvailable)==null?void 0:C.replace("%d",f)}):h?u.jsx("span",{className:i?"text-white":"",children:S.toggleable}):u.jsx("span",{}),i?u.jsxs("span",{className:"text-white",children:[u.jsx("i",{className:"me-1 bi-check-lg"}),S.set]}):p&&u.jsx("span",{children:S.stock})]})]})}),Jn=v.forwardRef(({title:t,goBack:e,onClose:n,className:o,noScroll:i,children:l,freecamActive:c},p)=>{const{config:h}=we();return u.jsxs(ye.Dialog,{className:`modal !block !ml-6 !w-[325px] transition-opacity ${c?"opacity-[0.4]":"opacity-1"}`,scrollable:!i,children:[u.jsxs(ye.Header,{children:[u.jsxs("div",{className:"flex gap-3 items-center",children:[e&&u.jsx("button",{onClick:e,children:u.jsx("i",{className:"bi-chevron-left text-xl"})}),u.jsx("h5",{className:"mb-0",children:t})]}),n&&u.jsx(Ko,{onClick:n})]}),u.jsx(ye.Body,{ref:p,className:o,children:l}),!h.HideWatermark&&u.jsx(ye.Footer,{className:"flex !justify-start",children:u.jsx(Pt,{bg:"secondary",text:"dark",children:"JG Scripts"})})]})}),nF=({category:t,goBack:e})=>{const{modType:n,name:o,mods:i}=t,l=v.useRef(null),{getCosmeticModData:c,updatePreviewProps:p,addToCart:h,removeFromCart:f,freecamActive:y}=Zt(),{icon:w,previewIndex:S,installedIndex:C,propKey:j}=c(n);v.useEffect(()=>{var E;(E=l.current)==null||E.scrollIntoView({block:"center"})},[n]);const N=(E,R,I)=>{p(j,E),me("preview-cosmetic-mod",{propKey:j,modType:n,modIndex:E}),E!==C?(I=E>-1?I:0,h("cosmetics",o,E,I,R)):f("cosmetics",o)};return u.jsx(Jn,{goBack:e,title:o,freecamActive:y,children:i.map(({name:E,modIndex:R,price:I})=>u.jsx(Qs,{modIndex:R,selected:S===R,installed:C===R,ref:S===R?l:void 0,onClick:()=>N(R,E,I),icon:w,title:E,price:I},R))})},rF=()=>{var j;const{locale:t,event:e}=we(),{goToMainMenu:n,getCosmeticModData:o,updatePreviewProps:i,freecamActive:l,addToCart:c,removeFromCart:p}=Zt(),h=v.useRef(null),[f,y]=v.useState(0),[w,S]=v.useState(!1);v.useEffect(()=>{me("switch-camera",{modId:w.modType})},[w.modType]),v.useEffect(()=>{var N;(N=h.current)==null||N.scrollTo(0,f)},[w,f]);const C=N=>{var E;if(N.toggle){const{name:R,price:I,modType:F}=N,{propKey:L,previewIndex:P,installedIndex:B}=o(F),W=!P;i(L,W),me("preview-cosmetic-mod",{propKey:L,modType:F,modIndex:W,toggleMod:!!N.toggle}),W!==B?c("cosmetics",R,W,I):p("cosmetics",R);return}S(N),y(((E=h.current)==null?void 0:E.scrollTop)||0)};return w?u.jsx(nF,{category:w,goBack:()=>{S(!1)}}):u.jsx(Jn,{ref:h,goBack:n,title:t.cosmetics,freecamActive:l,children:(j=e.mods.cosmetics)==null?void 0:j.map((N,E)=>{const{icon:R,previewIndex:I}=o(N.modType);return u.jsx(Qs,{modIndex:E,onClick:()=>C(N),icon:R,title:N.name,selected:N.toggle?I:I>-1,isCategory:!N.toggle,isToggle:N.toggle,price:N.toggle?N.price:!1,subItemsCount:N.toggle?0:N.mods.length},E)})})},vb=({defaultStance:t,enableStance:e,wheelsAdjustIndividually:n,stance:o,goBack:i,price:l,isStancingKit:c,onStanceChange:p,freecamActive:h})=>{const{onCloseModal:f,config:y,locale:w}=we(),[S,C]=v.useState(!!e),[j,N]=v.useState((o==null?void 0:o.height)||0),[E,R]=v.useState((o==null?void 0:o.yRot)||[0,0,0,0]),[I,F]=v.useState((o==null?void 0:o.xOffset)||[0,0,0,0]),[L,P]=v.useState(n);v.useEffect(()=>{me("switch-camera",{modId:"STANCE"})},[]),v.useEffect(()=>{const W={xOffset:I,yRot:E,height:j};me(c?"preview-kit-stance":"preview-stance",{enableStance:S,defaultStance:t,stance:W,wheelsAdjIndv:L}),p&&p({enableStance:S,defaultStance:t,stance:W,wheelsAdjIndv:L})},[t,S,j,I,E,L,c,p]);const B=async()=>{try{await me("save-stancer-kit-data",{enableStance:S,defaultStance:t,stance:{xOffset:I,yRot:E,height:j},wheelsAdjIndv:L}),f()}catch{console.log("Error: you do not appear to be in a vehicle")}};return u.jsx(Jn,{goBack:i,onClose:i?void 0:B,title:w.stance,className:"p-0",freecamActive:h,children:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"p-3",children:[u.jsx("div",{children:u.jsx(ue.Check,{type:"switch",checked:S,onChange:W=>C(W.target.checked),label:u.jsxs("span",{children:[w.enableStancing,l&&u.jsx(Pt,{bg:"secondary",text:"dark",className:"ms-2",children:Tt(l,y)})]})})}),S&&u.jsx("div",{children:u.jsx(ue.Check,{type:"switch",checked:L,onChange:W=>P(W.target.checked),label:w.adjWheelsIndv,className:"mt-1"})})]}),S&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"p-3 border-t-[1px] border-[#495057]",children:u.jsxs(ue.Group,{children:[u.jsx(ue.Label,{children:w.suspensionHeight}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(ue.Range,{min:y.StanceMinSuspensionHeight||-.3,max:y.StanceMaxSuspensionHeight||.3,step:.01,value:j,onChange:W=>N(parseFloat(W.target.value||"0"))}),u.jsxs("span",{className:"text-right w-[37.5px] flex-shrink-0 text-muted font-monospace",children:[Math.round(j*100),"%"]})]})]})}),u.jsx("div",{className:"p-3 border-t-[1px] border-[#495057]",children:u.jsxs(ue.Group,{children:[u.jsx(ue.Label,{children:w.camber}),["front","front","rear","rear"].map((W,X)=>(L||!L&&X%2===0)&&u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("span",{className:"w-[60px] flex-shrink-0 text-muted",children:[w[W]," ",L&&(X%2==0?w.leftAbbr:w.rightAbbr)]}),u.jsx(ue.Range,{min:y.StanceMinCamber||0,max:y.StanceMaxCamber||.5,step:.01,value:E[X],onChange:re=>{const ce=E;ce[X]=parseFloat(re.target.value||"0"),L||(ce[X+([0,2].includes(X)?1:-1)]=parseFloat(re.target.value||"0")),R([...ce])}}),u.jsxs("span",{className:"text-right w-[37.5px] flex-shrink-0 text-muted font-monospace",children:[Math.round(E[X]*100),"%"]})]},X))]})}),u.jsx("div",{className:"p-3 border-t-[1px] border-[#495057]",children:u.jsxs(ue.Group,{children:[u.jsx(ue.Label,{children:w.trackWidth}),["front","front","rear","rear"].map((W,X)=>{var re;return(L||!L&&X%2===0)&&u.jsxs("div",{className:"flex gap-1",children:[u.jsxs("span",{className:"w-[60px] flex-shrink-0 text-muted",children:[w[W]," ",L&&(X%2==0?w.leftAbbr:w.rightAbbr)]}),u.jsx(ue.Range,{min:y.StanceMinTrackWidth||.5,max:y.StanceMaxTrackWidth||1.25,step:.01,value:I[X],onChange:ce=>{const ie=I;ie[X]=parseFloat(ce.target.value||"0"),L||(ie[X+([0,2].includes(X)?1:-1)]=parseFloat(ce.target.value||"0")),F([...ie])}}),u.jsxs("span",{className:"text-right w-[37.5px] flex-shrink-0 text-muted font-monospace",children:[Math.round((I[X]-(((re=t==null?void 0:t.xOffset)==null?void 0:re[X])||0))*100),"%"]})]},X)})]})})]})]})})};var kp,wx;function sF(){return wx||(wx=1,kp=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var o,i,l;if(Array.isArray(e)){if(o=e.length,o!=n.length)return!1;for(i=o;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(l=Object.keys(e),o=l.length,o!==Object.keys(n).length)return!1;for(i=o;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,l[i]))return!1;for(i=o;i--!==0;){var c=l[i];if(!t(e[c],n[c]))return!1}return!0}return e!==e&&n!==n}),kp}var oF=sF();const iF=xs(oF),aF=()=>{const{event:t}=we(),e=v.useMemo(()=>t.mods.stance.price,[t]),{goToMainMenu:n,updatePreviewProps:o,props:i,installedProps:l,addToCart:c,removeFromCart:p,freecamActive:h}=Zt(),f=v.useCallback(y=>{const{enableStance:w,stance:S,wheelsAdjIndv:C}=y;o("enableStance",w),o("stance",S),o("wheelsAdjIndv",C),!iF(S,l.stance)||w!==l.enableStance?c("stance","stance",w?0:-1,w?e:0):p("stance","stance")},[c,p,l,e,o]);return u.jsx(vb,{enableStance:!!i.enableStance,wheelsAdjustIndividually:!!i.wheelsAdjIndv,defaultStance:i.defaultStance,stance:i.stance,goBack:n,price:e,onStanceChange:f,freecamActive:h})};function ti(){return(ti=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}function Ol(t){var e=v.useRef(t),n=v.useRef(function(o){e.current&&e.current(o)});return e.current=t,n.current}var Rl=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t0:E.buttons>0)&&i.current?l(Sx(i.current,E,p.current)):N(!1)},j=function(){return N(!1)};function N(E){var R=h.current,I=ih(i.current),F=E?I.addEventListener:I.removeEventListener;F(R?"touchmove":"mousemove",C),F(R?"touchend":"mouseup",j)}return[function(E){var R=E.nativeEvent,I=i.current;if(I&&(bx(R),!function(L,P){return P&&!xl(L)}(R,h.current)&&I)){if(xl(R)){h.current=!0;var F=R.changedTouches||[];F.length&&(p.current=F[0].identifier)}I.focus(),l(Sx(I,R,p.current)),N(!0)}},function(E){var R=E.which||E.keyCode;R<37||R>40||(E.preventDefault(),c({left:R===39?.05:R===37?-.05:0,top:R===40?.05:R===38?-.05:0}))},N]},[c,l]),y=f[0],w=f[1],S=f[2];return v.useEffect(function(){return S},[S]),mt.createElement("div",ti({},o,{onTouchStart:y,onMouseDown:y,className:"react-colorful__interactive",ref:i,onKeyDown:w,tabIndex:0,role:"slider"}))}),im=function(t){return t.filter(Boolean).join(" ")},xb=function(t){var e=t.color,n=t.left,o=t.top,i=o===void 0?.5:o,l=im(["react-colorful__pointer",t.className]);return mt.createElement("div",{className:l,style:{top:100*i+"%",left:100*n+"%"}},mt.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},vn=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},lF=function(t){return Sb(ah(t))},ah=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?vn(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?vn(parseInt(t.substring(6,8),16)/255,2):1}},uF=function(t){return dF(wb(t))},cF=function(t){var e=t.s,n=t.v,o=t.a,i=(200-e)*n/100;return{h:vn(t.h),s:vn(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:vn(i/2),a:vn(o,2)}},lh=function(t){var e=cF(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},wb=function(t){var e=t.h,n=t.s,o=t.v,i=t.a;e=e/360*6,n/=100,o/=100;var l=Math.floor(e),c=o*(1-n),p=o*(1-(e-l)*n),h=o*(1-(1-e+l)*n),f=l%6;return{r:vn(255*[o,p,c,c,h,o][f]),g:vn(255*[h,o,o,p,c,c][f]),b:vn(255*[c,c,h,o,o,p][f]),a:vn(i,2)}},yc=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},dF=function(t){var e=t.r,n=t.g,o=t.b,i=t.a,l=i<1?yc(vn(255*i)):"";return"#"+yc(e)+yc(n)+yc(o)+l},Sb=function(t){var e=t.r,n=t.g,o=t.b,i=t.a,l=Math.max(e,n,o),c=l-Math.min(e,n,o),p=c?l===e?(n-o)/c:l===n?2+(o-e)/c:4+(e-n)/c:0;return{h:vn(60*(p<0?p+6:p)),s:vn(l?c/l*100:0),v:vn(l/255*100),a:i}},fF=mt.memo(function(t){var e=t.hue,n=t.onChange,o=im(["react-colorful__hue",t.className]);return mt.createElement("div",{className:o},mt.createElement(yb,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Rl(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":vn(e),"aria-valuemax":"360","aria-valuemin":"0"},mt.createElement(xb,{className:"react-colorful__hue-pointer",left:e/360,color:lh({h:e,s:100,v:100,a:1})})))}),pF=mt.memo(function(t){var e=t.hsva,n=t.onChange,o={backgroundColor:lh({h:e.h,s:100,v:100,a:1})};return mt.createElement("div",{className:"react-colorful__saturation",style:o},mt.createElement(yb,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Rl(e.s+100*i.left,0,100),v:Rl(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+vn(e.s)+"%, Brightness "+vn(e.v)+"%"},mt.createElement(xb,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:lh(e)})))}),am=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},hF=function(t,e){return t.toLowerCase()===e.toLowerCase()||am(ah(t),ah(e))};function mF(t,e,n){var o=Ol(n),i=v.useState(function(){return t.toHsva(e)}),l=i[0],c=i[1],p=v.useRef({color:e,hsva:l});v.useEffect(function(){if(!t.equal(e,p.current.color)){var f=t.toHsva(e);p.current={hsva:f,color:e},c(f)}},[e,t]),v.useEffect(function(){var f;am(l,p.current.hsva)||t.equal(f=t.fromHsva(l),p.current.color)||(p.current={hsva:l,color:f},o(f))},[l,t,o]);var h=v.useCallback(function(f){c(function(y){return Object.assign({},y,f)})},[]);return[l,h]}var gF=typeof window<"u"?v.useLayoutEffect:v.useEffect,vF=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Cx=new Map,yF=function(t){gF(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!Cx.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Cx.set(e,n);var o=vF();o&&n.setAttribute("nonce",o),e.head.appendChild(n)}},[])},bb=function(t){var e=t.className,n=t.colorModel,o=t.color,i=o===void 0?n.defaultColor:o,l=t.onChange,c=ud(t,["className","colorModel","color","onChange"]),p=v.useRef(null);yF(p);var h=mF(n,i,l),f=h[0],y=h[1],w=im(["react-colorful",e]);return mt.createElement("div",ti({},c,{ref:p,className:w}),mt.createElement(pF,{hsva:f,onChange:y}),mt.createElement(fF,{hue:f.h,onChange:y,className:"react-colorful__last-control"}))},xF={defaultColor:"000",toHsva:lF,fromHsva:function(t){return uF({h:t.h,s:t.s,v:t.v,a:1})},equal:hF},wF=function(t){return mt.createElement(bb,ti({},t,{colorModel:xF}))},SF={defaultColor:{r:0,g:0,b:0},toHsva:function(t){return Sb({r:t.r,g:t.g,b:t.b,a:1})},fromHsva:function(t){return{r:(e=wb(t)).r,g:e.g,b:e.b};var e},equal:am},lm=function(t){return mt.createElement(bb,ti({},t,{colorModel:SF}))},bF=/^#?([0-9A-F]{3,8})$/i,CF=function(t){var e=t.color,n=e===void 0?"":e,o=t.onChange,i=t.onBlur,l=t.escape,c=t.validate,p=t.format,h=t.process,f=ud(t,["color","onChange","onBlur","escape","validate","format","process"]),y=v.useState(function(){return l(n)}),w=y[0],S=y[1],C=Ol(o),j=Ol(i),N=v.useCallback(function(R){var I=l(R.target.value);S(I),c(I)&&C(h?h(I):I)},[l,h,c,C]),E=v.useCallback(function(R){c(R.target.value)||S(l(n)),j(R)},[n,l,c,j]);return v.useEffect(function(){S(l(n))},[n,l]),mt.createElement("input",ti({},f,{value:p?p(w):w,spellCheck:"false",onChange:N,onBlur:E}))},jx=function(t){return"#"+t},jF=function(t){var e=t.prefixed,n=t.alpha,o=ud(t,["prefixed","alpha"]),i=v.useCallback(function(c){return c.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),l=v.useCallback(function(c){return function(p,h){var f=bF.exec(p),y=f?f[1].length:0;return y===3||y===6||!!h&&y===4||!!h&&y===8}(c,n)},[n]);return mt.createElement(CF,ti({},o,{escape:i,format:e?jx:void 0,process:jx,validate:l}))};const Cb=({value:t=0,onChange:e})=>{const{config:n}=we(),{findColourByIndex:o,findPaintByIndex:i}=Zt(),[l,c]=v.useState(""),p=v.useMemo(()=>Object.keys(n.Mods.GtaColours)||[],[n]),[h,f]=v.useState(i(n.Mods.GtaColours,t)||p[0]),y=v.useMemo(()=>n.Mods.GtaColours[h]||[],[n,h]),w=v.useMemo(()=>o(y,t)||{},[y,t,o]);v.useEffect(()=>{!w.modIndex&&y.length&&e(y[0].modIndex)},[y,e,w]),v.useEffect(()=>{c("")},[h]);const S=v.useMemo(()=>y.filter(({name:C})=>C.toLocaleLowerCase().includes(l.toLocaleLowerCase())),[l,y]);return u.jsxs("div",{children:[u.jsx(ue.Group,{children:u.jsx(ue.Select,{value:h,onChange:C=>f(C.target.value),className:"!rounded-none !rounded-t-md",children:p.map((C,j)=>u.jsx("option",{value:C,children:C},j))})}),u.jsxs(qs,{drop:"down",children:[u.jsxs(qs.Toggle,{bsPrefix:"gta-colour-picker",variant:"dark",className:"mt-[-1px] gta-colour-picker-select border w-full p-2 px-3 !flex gap-3 items-center hover:none !rounded-none !rounded-b-md",children:[u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 border",style:{background:`#${w==null?void 0:w.hex}`}}),u.jsx("span",{className:"whitespace-nowrap truncate",children:w==null?void 0:w.name})]}),u.jsxs(qs.Menu,{className:"w-full !shadow-black/30 shadow-xl",children:[u.jsx("div",{className:"p-3 py-2",children:u.jsx(ue.Control,{type:"search",placeholder:"Search",value:l,onKeyDown:C=>C.stopPropagation(),onKeyUp:C=>C.stopPropagation(),onChange:C=>c(C.target.value)})}),u.jsx("div",{className:"h-[250px] overflow-y-scroll",children:S.map(({modIndex:C,hex:j,name:N})=>u.jsxs(qs.Item,{className:"p-2 px-3 !flex gap-3 items-center overflow-hidden ",onClick:()=>e(C),children:[u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 border",style:{background:`#${j}`}}),u.jsx("span",{className:"whitespace-nowrap truncate",children:N})]},C))})]})]})]})};var EF={grad:.9,turn:360,rad:360/(2*Math.PI)},ls=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},un=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},hr=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},jb=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},Ex=function(t){return{r:hr(t.r,0,255),g:hr(t.g,0,255),b:hr(t.b,0,255),a:hr(t.a)}},Tp=function(t){return{r:un(t.r),g:un(t.g),b:un(t.b),a:un(t.a,3)}},kF=/^#([0-9a-f]{3,8})$/i,xc=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},Eb=function(t){var e=t.r,n=t.g,o=t.b,i=t.a,l=Math.max(e,n,o),c=l-Math.min(e,n,o),p=c?l===e?(n-o)/c:l===n?2+(o-e)/c:4+(e-n)/c:0;return{h:60*(p<0?p+6:p),s:l?c/l*100:0,v:l/255*100,a:i}},kb=function(t){var e=t.h,n=t.s,o=t.v,i=t.a;e=e/360*6,n/=100,o/=100;var l=Math.floor(e),c=o*(1-n),p=o*(1-(e-l)*n),h=o*(1-(1-e+l)*n),f=l%6;return{r:255*[o,p,c,c,h,o][f],g:255*[h,o,o,p,c,c][f],b:255*[c,c,h,o,o,p][f],a:i}},kx=function(t){return{h:jb(t.h),s:hr(t.s,0,100),l:hr(t.l,0,100),a:hr(t.a)}},Tx=function(t){return{h:un(t.h),s:un(t.s),l:un(t.l),a:un(t.a,3)}},Nx=function(t){return kb((n=(e=t).s,{h:e.h,s:(n*=((o=e.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:e.a}));var e,n,o},wl=function(t){return{h:(e=Eb(t)).h,s:(i=(200-(n=e.s))*(o=e.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,n,o,i},TF=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,NF=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,OF=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,RF=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ox={string:[[function(t){var e=kF.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?un(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?un(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=OF.exec(t)||RF.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:Ex({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=TF.exec(t)||NF.exec(t);if(!e)return null;var n,o,i=kx({h:(n=e[1],o=e[2],o===void 0&&(o="deg"),Number(n)*(EF[o]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Nx(i)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,o=t.b,i=t.a,l=i===void 0?1:i;return ls(e)&&ls(n)&&ls(o)?Ex({r:Number(e),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(t){var e=t.h,n=t.s,o=t.l,i=t.a,l=i===void 0?1:i;if(!ls(e)||!ls(n)||!ls(o))return null;var c=kx({h:Number(e),s:Number(n),l:Number(o),a:Number(l)});return Nx(c)},"hsl"],[function(t){var e=t.h,n=t.s,o=t.v,i=t.a,l=i===void 0?1:i;if(!ls(e)||!ls(n)||!ls(o))return null;var c=function(p){return{h:jb(p.h),s:hr(p.s,0,100),v:hr(p.v,0,100),a:hr(p.a)}}({h:Number(e),s:Number(n),v:Number(o),a:Number(l)});return kb(c)},"hsv"]]},Rx=function(t,e){for(var n=0;n=.5},t.prototype.toHex=function(){return e=Tp(this.rgba),n=e.r,o=e.g,i=e.b,c=(l=e.a)<1?xc(un(255*l)):"","#"+xc(n)+xc(o)+xc(i)+c;var e,n,o,i,l,c},t.prototype.toRgb=function(){return Tp(this.rgba)},t.prototype.toRgbString=function(){return e=Tp(this.rgba),n=e.r,o=e.g,i=e.b,(l=e.a)<1?"rgba("+n+", "+o+", "+i+", "+l+")":"rgb("+n+", "+o+", "+i+")";var e,n,o,i,l},t.prototype.toHsl=function(){return Tx(wl(this.rgba))},t.prototype.toHslString=function(){return e=Tx(wl(this.rgba)),n=e.h,o=e.s,i=e.l,(l=e.a)<1?"hsla("+n+", "+o+"%, "+i+"%, "+l+")":"hsl("+n+", "+o+"%, "+i+"%)";var e,n,o,i,l},t.prototype.toHsv=function(){return e=Eb(this.rgba),{h:un(e.h),s:un(e.s),v:un(e.v),a:un(e.a,3)};var e},t.prototype.invert=function(){return dr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),dr(Np(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),dr(Np(this.rgba,-e))},t.prototype.grayscale=function(){return dr(Np(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),dr(Ix(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),dr(Ix(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?dr({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):un(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=wl(this.rgba);return typeof e=="number"?dr({h:e,s:n.s,l:n.l,a:n.a}):un(n.h)},t.prototype.isEqual=function(e){return this.toHex()===dr(e).toHex()},t}(),dr=function(t){return t instanceof Mx?t:new Mx(t)};const MF=({title:t,paintTypeKey:e,colourKey:n,price:o})=>{var W,X;const{config:i,locale:l}=we(),{props:c,addToCart:p,removeFromCart:h,installedProps:f,updatePreviewProps:y,findColourByIndex:w}=Zt(),[S,C]=v.useState(!1),[j,N]=v.useState(c[e]||0),[E,R]=v.useState(typeof c[n]=="number"?c[n]:0),[I,F]=v.useState(typeof c[n]!="number"),[L,P]=v.useState(dr(`rgb(${(typeof c[n]=="number"?[0,0,0]:c[n]).join(", ")})`).toHex()),B=v.useMemo(()=>{const{r:re,g:ce,b:ie}=dr(L).toRgb();return[re,ce,ie]},[L]);return v.useEffect(()=>{c.primarySecondarySync&&n==="color2"&&(N(c[e]||0),R(typeof c[n]=="number"?c[n]:0),F(typeof c[n]!="number"),P(dr(`rgb( ${(typeof c[n]=="number"?[0,0,0]:c[n]).join(",")})`).toHex()))},[c,e,n]),v.useEffect(()=>{S?p("respray",t,0,o):h("respray",t)},[S,t,o,p,h]),v.useEffect(()=>{const ce=!!(typeof f[n]!="number"&&!I||typeof f[n]=="number"&&I||typeof f[n]=="number"&&E!==f[n]||typeof f[n]!="number"&&(f[e]!==j||JSON.stringify(B)!==JSON.stringify(f[n])));C(ce),!(c.primarySecondarySync&&n==="color2")&&(ce||c.primarySecondarySync)&&(y(e,j),y(n,I?B:E),c.primarySecondarySync&&(y("paintType2",j),y("color2",I?B:E)),me("preview-pri-sec-colours",{paintTypeKey:e,paint:j,colourId:E,enableRgb:I,rgbColour:B,primarySecondarySync:!!c.primarySecondarySync}))},[e,j,E,I,n,B,y,f,c.primarySecondarySync]),u.jsxs(Br.Item,{eventKey:t,children:[u.jsxs(Br.Header,{children:[u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 me-2 border",style:{background:I?L:`#${(W=w(i.Mods.GtaColours,E))==null?void 0:W.hex}`}}),u.jsxs("span",{children:[t,o&&u.jsx(Pt,{bg:"secondary",text:"dark",className:"mx-2",children:Tt(o,i)})]})]}),c.primarySecondarySync&&n==="color2"?u.jsx(Br.Body,{children:u.jsx("p",{className:"text-muted",children:l.syncedWithPriColour})}):u.jsxs(Br.Body,{children:[u.jsx(ue.Group,{className:"mb-3",children:u.jsx(ue.Check,{type:"switch",id:`enable-rgb-${t}`,checked:I,onChange:re=>{var ce;F(re.target.checked),j>((ce=i.Mods.RgbPaintFinishes)==null?void 0:ce.length)-1&&N(0)},label:l.enableRgb})}),n==="color1"&&u.jsx(ue.Group,{className:"mb-3",children:u.jsx(ue.Check,{type:"switch",id:`pri-sec-sync-${t}`,checked:!!c.primarySecondarySync,onChange:re=>y("primarySecondarySync",re.target.checked),label:l.syncSecColour})}),I?u.jsxs(ue.Group,{children:[u.jsx(ue.Label,{children:l.paintType}),u.jsx(ue.Select,{value:j,onChange:re=>N(parseInt(re.target.value)),className:"mb-3",children:(X=i.Mods.RgbPaintFinishes)==null?void 0:X.map((re,ce)=>u.jsx("option",{value:ce,children:re},ce))}),u.jsx(wF,{color:L,onChange:P,className:"!w-full mb-3"}),u.jsx(ue.Label,{children:l.hex}),u.jsx(jF,{color:L,onChange:P,prefixed:!0,className:"form-control"})]}):u.jsx(Cb,{value:E,onChange:re=>R(re)})]})]})},FF=({title:t,colourIdKey:e,price:n})=>{var N;const{config:o,locale:i}=we(),{props:l,installedProps:c,addToCart:p,removeFromCart:h,updatePreviewProps:f,findColourByIndex:y}=Zt(),[w,S]=v.useState(!1),[C,j]=v.useState(l[e]||0);return v.useEffect(()=>{w?p("respray",t,0,n):h("respray",t)},[w,t,n,p,h]),v.useEffect(()=>{c[e]!==C||e==="pearlescentColor"&&c.disablePearl!==l.disablePearl?(S(!0),e==="pearlescentColor"&&l.disablePearl?(f("pearlescentColor",12),me("preview-other-colours",{disablePearl:!0,colourIdKey:"pearlescentColor",colourId:12})):(f(e,C),me("preview-other-colours",{disablePearl:l.disablePearl,colourIdKey:e,colourId:C}))):S(!1)},[e,C,f,c,l.disablePearl]),u.jsxs(Br.Item,{eventKey:t,children:[u.jsxs(Br.Header,{children:[e==="pearlescentColor"&&l.disablePearl?u.jsx("i",{className:"bi-ban w-7 h-7 text-[26px] p-[1px] text-red-600 me-2 leading-none"}):u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 me-2 border",style:{background:`#${(N=y(o.Mods.GtaColours,C))==null?void 0:N.hex}`}}),u.jsxs("span",{children:[t,n&&u.jsx(Pt,{bg:"secondary",text:"dark",className:"mx-2",children:Tt(n,o)})]})]}),u.jsxs(Br.Body,{children:[e==="pearlescentColor"&&u.jsx(ue.Group,{className:l.disablePearl?"":"mb-3",children:u.jsx(ue.Check,{type:"switch",id:"disable-pearl",checked:!!l.disablePearl,onChange:E=>f("disablePearl",E.target.checked),label:i.noPearl})}),(e!=="pearlescentColor"||!l.disablePearl)&&u.jsx(Cb,{value:C,onChange:j})]})]})},DF=()=>{const{event:t,locale:e}=we(),{goToMainMenu:n,freecamActive:o}=Zt(),[i,l]=v.useState(""),{colours:c,price:p}=v.useMemo(()=>t.mods.respray||[],[t.mods.respray]);return v.useEffect(()=>{me("switch-camera",{modId:i})},[i]),u.jsx(Jn,{goBack:n,title:e.respray,className:"p-0 py-1",freecamActive:o,noScroll:!0,children:u.jsx(Br,{alwaysOpen:!1,activeKey:i,onSelect:h=>l(h),flush:!0,children:c.map(({name:h,paintTypeKey:f,colourKey:y,colourIdKey:w},S)=>w?u.jsx(FF,{title:h,colourIdKey:w,price:p},S):u.jsx(MF,{title:h,paintTypeKey:f,colourKey:y,price:p},S))})})},Tb=t=>{switch(t){case 0:return{icon:"wheels/sport.svg"};case 1:return{icon:"wheels/muscle.svg"};case 2:return{icon:"wheels/lowrider.svg"};case 3:return{icon:"wheels/suv.svg"};case 4:return{icon:"wheels/offroad.svg"};case 5:return{icon:"wheels/tuner.svg"};case 6:return{icon:"wheels/bike.svg"};case 7:return{icon:"wheels/highend.svg"};case 8:return{icon:"wheels/originals.svg"};case 9:return{icon:"wheels/bespoke.svg"};case 10:return{icon:"wheels/openwheel.svg"};case 11:return{icon:"wheels/street.svg"};case 12:return{icon:"wheels/track.svg"};default:return{icon:"x.svg",propKey:"",previewIndex:-1}}},_F=({wheelType:t,goBack:e})=>{const{modType:n,name:o,mods:i}=t,{props:l,updatePreviewProps:c,installedProps:p,addToCart:h,removeFromCart:f,freecamActive:y}=Zt(),w=v.useRef(null),{icon:S}=Tb(t.modType);v.useEffect(()=>{var j;(j=w.current)==null||j.scrollIntoView({block:"center"})},[n]);const C=(j,N,E)=>{c("wheels",n),c("modFrontWheels",j),me("preview-wheels",{modType:n,modIndex:j}),p.wheels!==n||p.modFrontWheels!==j?(E=j>-1?E:0,h("wheels","wheels",j,E,`${o}, ${N}`)):f("wheels","wheels")};return u.jsx(Jn,{goBack:e,title:o,freecamActive:y,children:i.map(({name:j,modIndex:N,price:E})=>{const R=l.wheels===n&&l.modFrontWheels===N;return u.jsx(Qs,{modIndex:N,selected:R,installed:p.modFrontWheels===-1&&N===-1||p.wheels===n&&p.modFrontWheels===N,ref:R?w:void 0,onClick:()=>C(N,j,E),icon:S,title:j,price:E},N)})})},PF=()=>{const{locale:t,event:e}=we(),{goToMainMenu:n,props:o,freecamActive:i}=Zt(),l=v.useRef(null),c=v.useRef(null),[p,h]=v.useState(-1),[f,y]=v.useState(!1);v.useEffect(()=>{me("switch-camera",{modId:"WHEELS"})},[]),v.useEffect(()=>{var S,C;p===-1?(S=c.current)==null||S.scrollIntoView({block:"center"}):(C=l.current)==null||C.scrollTo(0,p)},[f,p]),v.useEffect(()=>{var S;((S=e.mods.wheels)==null?void 0:S.length)===1?y(e.mods.wheels[0]):y(!1)},[e.mods.wheels]);const w=S=>{var C;y(S),h(((C=l.current)==null?void 0:C.scrollTop)||0)};return f?u.jsx(_F,{wheelType:f,goBack:()=>{var S;((S=e.mods.wheels)==null?void 0:S.length)===1?n():y(!1)}}):u.jsx(Jn,{ref:l,goBack:n,title:t.wheels,freecamActive:i,children:e.mods.wheels.map((S,C)=>{const{icon:j}=Tb(S.modType);return u.jsx(Qs,{modIndex:S,onClick:()=>w(S),icon:j,ref:o.wheels===S.modType?c:void 0,title:S.name,isCategory:!0,selected:o.wheels===S.modType,subItemsCount:S.mods.length},C)})})},AF=({goBack:t})=>{const{locale:e,event:n}=we(),o=v.useMemo(()=>n.mods.neonLights.price,[n]),{props:i,installedProps:l,updatePreviewProps:c,addToCart:p,removeFromCart:h,freecamActive:f}=Zt(),[y,w]=v.useState(i.neonEnabled||[!1,!1,!1,!1]),[S,C]=v.useState(i.neonColor||[255,255,255]);return v.useEffect(()=>{c("neonEnabled",y),c("neonColor",S),me("preview-neons",{enableNeons:y,neonColor:S}),JSON.stringify([y,S])!==JSON.stringify([l.neonEnabled,l.neonColor])?p("neonLights","neonLights",0,o):h("neonLights","neonLights")},[o,c,y,l,S,p,h]),u.jsx(Jn,{goBack:t,title:e.neonLights,freecamActive:f,children:u.jsxs(u.Fragment,{children:[u.jsxs(ue.Group,{children:[u.jsx(ue.Label,{children:e.enableNeons}),["left","right","front","rear"].map((j,N)=>u.jsx(ue.Check,{id:`neon-${N}`,type:"switch",checked:y[N],onChange:E=>{const R=y;R[N]=E.target.checked,w([...R])},label:e[j],className:"mb-1"},N))]}),!!y.filter(Boolean).length&&u.jsx(lm,{color:{r:S[0],g:S[1],b:S[2]},onChange:({r:j,g:N,b:E})=>C([j,N,E]),className:"!w-full mt-3"})]})})},$F=({value:t=0,onChange:e})=>{const{config:n}=we(),{findColourByIndex:o}=Zt(),[i,l]=v.useState(""),c=v.useMemo(()=>n.Mods.XenonColours||[],[n]),p=v.useMemo(()=>o(c,t)||{},[c,t,o]);v.useEffect(()=>{!p.modIndex&&c.length&&e(c[0].modIndex)},[c,e,p]);const h=v.useMemo(()=>c.filter(({name:f})=>f.toLocaleLowerCase().includes(i.toLocaleLowerCase())),[i,c]);return u.jsx("div",{children:u.jsxs(qs,{drop:"down",children:[u.jsxs(qs.Toggle,{bsPrefix:"gta-colour-picker",variant:"dark",className:"mt-3 gta-colour-picker-select border w-full p-2 px-3 !flex gap-3 items-center hover:none",children:[u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 border",style:{background:`#${p==null?void 0:p.hex}`}}),u.jsx("span",{className:"whitespace-nowrap truncate",children:p==null?void 0:p.name})]}),u.jsxs(qs.Menu,{className:"w-full !shadow-black/30 shadow-xl",children:[u.jsx("div",{className:"p-3 py-2",children:u.jsx(ue.Control,{type:"search",placeholder:"Search",value:i,onKeyDown:f=>f.stopPropagation(),onKeyUp:f=>f.stopPropagation(),onChange:f=>l(f.target.value)})}),u.jsx("div",{className:"h-[250px] overflow-y-scroll",children:h.map(({modIndex:f,hex:y,name:w})=>u.jsxs(qs.Item,{className:"p-2 px-3 !flex gap-3 items-center overflow-hidden ",onClick:()=>e(f),children:[u.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 border",style:{background:`#${y}`}}),u.jsx("span",{className:"whitespace-nowrap truncate",children:w})]},f))})]})]})})},LF=({goBack:t})=>{const{locale:e,event:n}=we(),o=v.useMemo(()=>n.mods.headlights.price,[n]),{props:i,installedProps:l,updatePreviewProps:c,addToCart:p,removeFromCart:h,freecamActive:f}=Zt(),[y,w]=v.useState(!!i.modXenon||!1),[S,C]=v.useState(typeof i.xenonColor=="number"?i.xenonColor:0);return v.useEffect(()=>{c("modXenon",y),c("xenonColor",S),me("preview-xenons",{enableXenons:y,xenonColor:S}),JSON.stringify([y,S])!==JSON.stringify([!!l.modXenon,l.xenonColor])?p("headlights","xenonHeadlights",0,o):h("headlights","xenonHeadlights")},[o,y,S,c,p,h,l]),u.jsx(Jn,{goBack:t,title:e.headlights,freecamActive:f,noScroll:!0,children:u.jsxs(u.Fragment,{children:[u.jsx(ue.Check,{type:"switch",checked:y,onChange:j=>w(j.target.checked),label:e.enableXenons}),y&&u.jsx($F,{value:S,onChange:C})]})})},zF=()=>{const{event:t,locale:e}=we(),{goToMainMenu:n,props:o,freecamActive:i}=Zt(),[l,c]=v.useState(!1);return v.useEffect(()=>{l&&me("switch-camera",{modId:l.toUpperCase()})},[l]),l==="neon"?u.jsx(AF,{goBack:()=>c(!1)}):l==="headlights"?u.jsx(LF,{goBack:()=>c(!1)}):u.jsx(Jn,{goBack:n,title:e.lights,freecamActive:i,children:u.jsxs(u.Fragment,{children:[t.mods.neonLights.enabled&&u.jsx(Qs,{modIndex:0,onClick:()=>c("neon"),icon:"neon.svg",title:e.neonLights,isCategory:!0,selected:!!o.neonEnabled.filter(Boolean).length,price:t.mods.neonLights.price}),t.mods.headlights.enabled&&u.jsx(Qs,{modIndex:1,onClick:()=>c("headlights"),icon:"headlight.svg",title:e.headlights,isCategory:!0,selected:o.modXenon||!1,price:t.mods.headlights.price})]})})},BF=()=>{const{locale:t,event:e,config:n}=we(),{props:o,goToMainMenu:i,installedProps:l,updatePreviewProps:c,addToCart:p,removeFromCart:h,freecamActive:f}=Zt(),y=v.useMemo(()=>e.mods.tyreSmoke,[e]),w=v.useMemo(()=>e.mods.bulletproofTyres,[e]),[S,C]=v.useState(!!o.modSmokeEnabled),[j,N]=v.useState(o.tyreSmokeColor||[255,255,255]),[E,R]=v.useState(!!o.bulletProofTyres);return v.useEffect(()=>{me("switch-camera",{modId:"WHEELS"})},[]),v.useEffect(()=>{y&&(c("modSmokeEnabled",S),c("tyreSmokeColor",j),me("preview-tyre-smoke",{enableTyreSmoke:S,tyreSmokeColor:j}),JSON.stringify([S,j])!==JSON.stringify([!!l.modSmokeEnabled,l.tyreSmokeColor])?p("tyreSmoke","customTyreSmoke",0,y.price):h("tyreSmoke","customTyreSmoke"))},[y,S,j,c,p,h,l]),v.useEffect(()=>{w&&(c("bulletProofTyres",E),me("preview-bulletproof-tyres",{enableBulletproofTyres:E}),E!==!!l.bulletProofTyres?p("bulletproofTyres","bulletproofTyres",0,w.price):h("bulletproofTyres","bulletproofTyres"))},[w,E,c,p,h,l]),u.jsx(Jn,{goBack:i,title:t.tyres,freecamActive:f,children:u.jsxs(u.Fragment,{children:[y.enabled&&u.jsxs(u.Fragment,{children:[u.jsx(ue.Check,{type:"switch",checked:S,onChange:I=>C(I.target.checked),label:u.jsxs("div",{children:[t.customTyreSmoke,u.jsx(Pt,{bg:"secondary",text:"dark",className:"ms-2",children:Tt(y.price,n)})]})}),S&&u.jsx(lm,{color:{r:j[0],g:j[1],b:j[2]},onChange:({r:I,g:F,b:L})=>N([I,F,L]),className:"!w-full my-3"})]}),w.enabled&&u.jsx(ue.Check,{type:"switch",checked:E,onChange:I=>R(I.target.checked),label:u.jsxs("div",{children:[t.bulletproofTyres,u.jsx(Pt,{bg:"secondary",text:"dark",className:"ms-2",children:Tt(w.price,n)})]})})]})})},HF=({category:t,goBack:e})=>{const{modType:n,name:o,mods:i}=t,l=v.useRef(null),{updatePreviewProps:c,addToCart:p,removeFromCart:h,getPerfModData:f,freecamActive:y}=Zt(),{icon:w,previewIndex:S,installedIndex:C,propKey:j}=f(n);v.useEffect(()=>{var E;(E=l.current)==null||E.scrollIntoView({block:"center"})},[n]);const N=(E,R,I)=>{c(j,E),me("preview-performance-mod",{propKey:j,modType:n,modIndex:E}),E!==C?(I=E>-1?I:0,p("performance",o,E,I,R)):h("performance",o)};return u.jsx(Jn,{goBack:e,title:o,freecamActive:y,children:i.map(({name:E,modIndex:R,price:I})=>u.jsx(Qs,{modIndex:R,selected:S===R,installed:C===R,ref:C===R?l:void 0,onClick:()=>N(R,E,I),icon:w,title:E,price:I},R))})},WF=()=>{var j;const{locale:t,event:e}=we(),{goToMainMenu:n,getPerfModData:o,freecamActive:i,updatePreviewProps:l,addToCart:c,removeFromCart:p}=Zt(),h=v.useRef(null),[f,y]=v.useState(0),[w,S]=v.useState(!1);v.useEffect(()=>{var N;(N=h.current)==null||N.scrollTo(0,f)},[w,f]);const C=N=>{var E;if(N.toggle){const{name:R,price:I,modType:F}=N,{propKey:L,previewIndex:P,installedIndex:B}=o(F),W=!P;l(L,W),me("preview-performance-mod",{propKey:L,modType:F,modIndex:W,toggleMod:!!N.toggle}),W!==B?c("performance",R,W?0:-1,W?I:0):p("performance",R);return}S(N),y(((E=h.current)==null?void 0:E.scrollTop)||0)};return w?u.jsx(HF,{category:w,goBack:()=>{S(!1)}}):u.jsx(Jn,{ref:h,goBack:n,title:t.performance,freecamActive:i,children:(j=e.mods.performance)==null?void 0:j.map((N,E)=>{const{icon:R,previewIndex:I}=o(N.modType);return u.jsx(Qs,{modIndex:E,onClick:()=>C(N),icon:R,title:N.name,selected:N.toggle?I:I>-1,isCategory:!N.toggle,isToggle:N.toggle,price:N.toggle?N.price:!1,subItemsCount:N.toggle?0:N.mods.length},E)})})},VF=()=>{const{locale:t,event:e,config:n}=we(),{freecamActive:o}=Zt(),i=v.useMemo(()=>e.mods.extras.price,[e]),{goToMainMenu:l,props:c,installedProps:p,updatePreviewProps:h,addToCart:f,removeFromCart:y}=Zt(),[w,S]=v.useState(c.extras||{});return v.useEffect(()=>{h("extras",w),me("preview-extras",{extras:w}),JSON.stringify(w)!==JSON.stringify(p.extras)?f("extras","extras",0,i):y("extras","extras")},[w,p,f,y,h,i]),u.jsx(Jn,{goBack:l,title:t.extras,freecamActive:o,children:u.jsxs("div",{children:[u.jsxs("p",{children:[u.jsxs("span",{children:[t.price,":"]}),u.jsx(Pt,{bg:"secondary",text:"dark",className:"ms-2",children:Tt(i,n)})]}),Object.keys(w).map(C=>u.jsx(ue.Check,{type:"switch",checked:w[C],onChange:j=>S({...w,[C]:j.target.checked}),label:`${t.extra} ${C}`,className:"mb-1 last:!mb-0"},C))]})})},UF=(t,e,n)=>{switch(t){case 11:return{icon:"engine.svg",propKey:"modEngine",previewIndex:e.modEngine,installedIndex:n.modEngine};case 12:return{icon:"brakes.svg",propKey:"modBrakes",previewIndex:e.modBrakes,installedIndex:n.modBrakes};case 13:return{icon:"transmission.svg",propKey:"modTransmission",previewIndex:e.modTransmission,installedIndex:n.modTransmission};case 15:return{icon:"suspension.svg",propKey:"modSuspension",previewIndex:e.modSuspension,installedIndex:n.modSuspension};case 16:return{icon:"armour.svg",propKey:"modArmor",previewIndex:e.modArmor,installedIndex:n.modArmor};case 18:return{icon:"turbo.svg",propKey:"modTurbo",previewIndex:e.modTurbo,installedIndex:n.modTurbo};default:return{icon:"x.svg",propKey:"",previewIndex:-1,installedIndex:-1}}},GF=(t,e,n)=>{switch(t){case 0:return{icon:"spoiler.svg",propKey:"modSpoilers",previewIndex:e.modSpoilers,installedIndex:n.modSpoilers};case 1:return{icon:"bumper.svg",propKey:"modFrontBumper",previewIndex:e.modFrontBumper,installedIndex:n.modFrontBumper};case 2:return{icon:"bumper.svg",propKey:"modRearBumper",previewIndex:e.modRearBumper,installedIndex:n.modRearBumper};case 3:return{icon:"car-side.svg",propKey:"modSideSkirt",previewIndex:e.modSideSkirt,installedIndex:n.modSideSkirt};case 4:return{icon:"exhaust.svg",propKey:"modExhaust",previewIndex:e.modExhaust,installedIndex:n.modExhaust};case 5:return{icon:"cabin.svg",propKey:"modFrame",previewIndex:e.modFrame,installedIndex:n.modFrame};case 6:return{icon:"bumper.svg",propKey:"modGrille",previewIndex:e.modGrille,installedIndex:n.modGrille};case 7:return{icon:"bonnet.svg",propKey:"modHood",previewIndex:e.modHood,installedIndex:n.modHood};case 8:return{icon:"fender.svg",propKey:"modFender",previewIndex:e.modFender,installedIndex:n.modFender};case 9:return{icon:"fender.svg",propKey:"modRightFender",previewIndex:e.modRightFender,installedIndex:n.modRightFender};case 10:return{icon:"roof.svg",propKey:"modRoof",previewIndex:e.modRoof,installedIndex:n.modRoof};case 14:return{icon:"horn.svg",propKey:"modHorns",previewIndex:e.modHorns,installedIndex:n.modHorns};case 19:return{icon:"subwoofer.svg",propKey:"modKit19",previewIndex:e.modKit19,installedIndex:n.modKit19};case 21:return{icon:"hydraulic.svg",propKey:"modKit21",previewIndex:e.modKit21,installedIndex:n.modKit21};case 25:return{icon:"bumper.svg",propKey:"modPlateHolder",previewIndex:e.modPlateHolder,installedIndex:n.modPlateHolder};case 26:return{icon:"bumper.svg",propKey:"modVanityPlate",previewIndex:e.modVanityPlate,installedIndex:n.modVanityPlate};case 27:return{icon:"dashboard.svg",propKey:"modTrimA",previewIndex:e.modTrimA,installedIndex:n.modTrimA};case 28:return{icon:"dashboard.svg",propKey:"modOrnaments",previewIndex:e.modOrnaments,installedIndex:n.modOrnaments};case 29:return{icon:"dashboard.svg",propKey:"modDashboard",previewIndex:e.modDashboard,installedIndex:n.modDashboard};case 30:return{icon:"dashboard.svg",propKey:"modDial",previewIndex:e.modDial,installedIndex:n.modDial};case 31:return{icon:"car-door.svg",propKey:"modDoorSpeaker",previewIndex:e.modDoorSpeaker,installedIndex:n.modDoorSpeaker};case 32:return{icon:"car-seat.svg",propKey:"modSeats",previewIndex:e.modSeats,installedIndex:n.modSeats};case 33:return{icon:"steering.svg",propKey:"modSteeringWheel",previewIndex:e.modSteeringWheel,installedIndex:n.modSteeringWheel};case 34:return{icon:"gear-stick.svg",propKey:"modShifterLeavers",previewIndex:e.modShifterLeavers,installedIndex:n.modShifterLeavers};case 35:return{icon:"sparkling.svg",propKey:"modAPlate",previewIndex:e.modAPlate,installedIndex:n.modAPlate};case 36:return{icon:"car-side.svg",propKey:"modSpeakers",previewIndex:e.modSpeakers,installedIndex:n.modSpeakers};case 37:return{icon:"trunk.svg",propKey:"modTrunk",previewIndex:e.modTrunk,installedIndex:n.modTrunk};case 38:return{icon:"trunk.svg",propKey:"modHydrolic",previewIndex:e.modHydrolic,installedIndex:n.modHydrolic};case 39:return{icon:"engine.svg",propKey:"modEngineBlock",previewIndex:e.modEngineBlock,installedIndex:n.modEngineBlock};case 40:return{icon:"engine.svg",propKey:"modAirFilter",previewIndex:e.modAirFilter,installedIndex:n.modAirFilter};case 41:return{icon:"engine.svg",propKey:"modStruts",previewIndex:e.modStruts,installedIndex:n.modStruts};case 42:return{icon:"headlight.svg",propKey:"modArchCover",previewIndex:e.modArchCover,installedIndex:n.modArchCover};case 43:return{icon:"bonnet.svg",propKey:"modAerials",previewIndex:e.modAerials,installedIndex:n.modAerials};case 44:return{icon:"sparkling.svg",propKey:"modTrimB",previewIndex:e.modTrimB,installedIndex:n.modTrimB};case 45:return{icon:"sparkling.svg",propKey:"modTank",previewIndex:e.modTank,installedIndex:n.modTank};case 46:return{icon:"window.svg",propKey:"modWindows",previewIndex:e.modWindows,installedIndex:n.modWindows};case 47:return{icon:"side-mirror.svg",propKey:"modKit47",previewIndex:e.modKit47,installedIndex:n.modKit47};case 48:return{icon:"sparkling.svg",propKey:"modLivery",previewIndex:e.modLivery,installedIndex:n.modLivery};case 49:return{icon:"sparkling.svg",propKey:"modKit49",previewIndex:e.modKit49,installedIndex:n.modKit49};case"LIVERY":return{icon:"sparkling.svg",propKey:"modLivery",previewIndex:e.modLivery,installedIndex:n.modLivery};case"LIVERY_ROOF":return{icon:"sparkling.svg",propKey:"liveryRoof",previewIndex:e.liveryRoof,installedIndex:n.liveryRoof};case"PLATE_INDEX":return{icon:"license-plate.svg",propKey:"plateIndex",previewIndex:e.plateIndex,installedIndex:n.plateIndex};case"WINDOW_TINT":return{icon:"window.svg",propKey:"windowTint",previewIndex:e.windowTint,installedIndex:n.windowTint};default:return{icon:"x.svg",propKey:"",previewIndex:-1,installedIndex:-1}}},Fx=["bank","cash"],qF=({show:t,onHide:e,onRepair:n,price:o})=>{const{event:i,setEvent:l,config:c,locale:p}=we(),[h,f]=v.useState(Fx[0]),[y,w]=v.useState(!1),[S,C]=v.useState(!1),j=()=>h==="bank"?i.bankBalance>=o:h==="cash"?i.cashBalance>=o:!1,N=async I=>{if(I.preventDefault(),!j())return!1;w(!0),C(!1);try{await me("repair-vehicle",{paymentMethod:h})&&n()}catch{C(p.couldNotCompleteOrderError)}w(!1)},E=async()=>{try{const I=await me("get-player-balances");if(!I)return;l(F=>({...F,bankBalance:I.bank})),l(F=>({...F,cashBalance:I.cash}))}catch{console.error("Could not refresh balances.")}},R=I=>I<=25?"danger":I<=75?"warning":"success";return u.jsxs(ye,{show:t,onHide:e,className:"!z-[99999]",size:"sm",centered:!0,keyboard:!1,backdrop:"static",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:p.repairVehicle})}),u.jsxs(ye.Body,{children:[S&&u.jsx(Vr,{variant:"danger",children:S||"UNKNOWN_ERROR"}),u.jsxs("div",{className:"mb-3 flex flex-col gap-2",children:[u.jsx("small",{className:"text-muted",children:p.bodyHealth}),u.jsx(jl,{now:i.vehicleDamaged[0]/1e3*100,variant:R(i.vehicleDamaged[0]/1e3*100)}),u.jsx("small",{className:"text-muted",children:p.engineHealth}),u.jsx(jl,{now:i.vehicleDamaged[1]/1e3*100,variant:R(i.vehicleDamaged[1]/1e3*100)})]}),u.jsx("small",{className:"text-muted mb-2 block",children:"Payment Method"}),Fx.map((I,F)=>{let L=0;return I==="bank"&&(L=i.bankBalance),I==="cash"&&(L=i.cashBalance),u.jsx(ue.Check,{label:u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsx("span",{className:"me-2",children:p[I]}),u.jsx(Pt,{bg:"secondary",text:"dark",children:Tt(L,c)}),u.jsx(ve,{variant:"dark",onClick:E,size:"sm",className:"ms-2 !py-0 !px-1",children:u.jsx("i",{className:"bi-arrow-clockwise"})})]}),name:"payment-method",type:"radio",id:`payment-method-${I}`,checked:h===I,onChange:()=>f(I)},F)}),u.jsxs("div",{className:"flex justify-between mt-3",children:[u.jsx(ve,{onClick:N,disabled:!j()||y,children:p.repairVehicle}),u.jsx(ve,{variant:"dark",onClick:e,children:p.cancel})]})]})]})},KF=()=>{var C;const{locale:t,event:e,setEvent:n,config:o}=we(),{addToCart:i}=Zt(),[l,c]=v.useState((C=e.vehicleDamaged)==null?void 0:C.every(j=>j===1e3)),[p,h]=v.useState(!1),f=v.useMemo(()=>e.mods.repair.price,[e]),y=v.useMemo(()=>e.mechanicType==="self-service"||e.mechanicType==="owned"&&o.AllowFixingAtOwnedMechanicsIfNoOneOnDuty&&!e.mechanicsOnDuty,[o,e]),w=()=>{c(!0),n(j=>({...j,vehicleDamaged:[1e3,1e3]})),h(!1)},S=()=>{y?h(!0):(i("repair","repair",0,f),w())};return u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:`p-3 border transition rounded flex gap-3 items-center justify-between col-span-2 ${l?"opacity-50":"hover:!border-[#777]"}`,disabled:l,onClick:S,children:[u.jsxs("div",{className:"flex gap-3 items-center",children:[u.jsx("img",{src:"./icons/repair.svg",alt:"Repair",className:"w-[40px] h-[40px] opacity-80"}),u.jsx("span",{className:"text-white text-md font-semibold",children:l?t.vehicleFullHealth:y?t.selfServiceRepairVehicle:t.repairVehicle})]}),!l&&u.jsx("span",{className:"text-sm",children:Tt(f,o)})]}),u.jsx(qF,{show:p,onHide:()=>h(!1),onRepair:w,price:f})]})},ZF=["noPayment","mechanic","bank","cash"],YF=({show:t,onClose:e})=>{const{event:n,setEvent:o,config:i,locale:l}=we(),{onCloseTuningMenu:c,cart:p,cartTotal:h}=Zt(),[f,y]=v.useState("bank"),[w,S]=v.useState(!1),[C,j]=v.useState(!1),[N,E]=v.useState(!1),R=()=>f==="noPayment"?!0:f==="mechanic"?n.mechBalance>=h:f==="bank"?n.bankBalance>=h:f==="cash"?n.cashBalance>=h:!1,I=async L=>{if(L.preventDefault(),!R())return!1;S(!0),j(!1);try{await me("purchase-mods",{cart:p,paymentMethod:f}),n.mechanicType==="owned"?E(!0):c()}catch{j(l.couldNotCompleteOrderError)}S(!1)},F=async()=>{try{const L=await me("get-player-balances");if(!L)return;o(P=>({...P,bankBalance:L.bank})),o(P=>({...P,cashBalance:L.cash}))}catch{console.error("Could not refresh balances.")}};return u.jsxs(ye,{show:t,onHide:e,className:"!z-[99999]",size:"sm",centered:!0,keyboard:!1,backdrop:"static",children:[!N&&u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:l.paymentMethod})}),u.jsx(ye.Body,{children:N?u.jsx(QF,{onClose:()=>c()}):u.jsxs(u.Fragment,{children:[C&&u.jsx(Vr,{variant:"danger",children:C||"UNKNOWN_ERROR"}),ZF.map((L,P)=>{let B=0;if(L==="noPayment"&&(!n.isMechanicEmployee||n.mechanicType!=="owned"))return null;if(L=="mechanic"){if(n.mechBalance===!1)return null;B=n.mechBalance}return L==="bank"&&(B=n.bankBalance),L==="cash"&&(B=n.cashBalance),u.jsx(ue.Check,{label:u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsx("span",{className:"me-2",children:l[L]}),L!=="noPayment"&&u.jsxs(u.Fragment,{children:[u.jsx(Pt,{bg:"secondary",text:"dark",children:Tt(B,i)}),u.jsx($l,{placement:"top",overlay:u.jsx(la,{id:"tooltip",children:l.refresh}),children:u.jsx(ve,{variant:"dark",onClick:F,size:"sm",className:"ms-2 !py-0 !px-1",children:u.jsx("i",{className:"bi-arrow-clockwise"})})})]})]}),name:"payment-method",type:"radio",id:`payment-method-${L}`,checked:f===L,onChange:()=>y(L)},P)}),u.jsxs("div",{className:"flex justify-between mt-3",children:[u.jsx(ve,{onClick:I,disabled:!R()||w,children:n.mechanicType==="owned"?l.placeOrder:l.purchase}),u.jsx(ve,{variant:"dark",onClick:e,children:l.cancel})]})]})})]})},QF=({onClose:t})=>{const{locale:e}=we();return u.jsxs("div",{className:"text-center",children:[u.jsx("i",{className:"bi-check-circle-fill text-[70px] text-green-400"}),u.jsx("h5",{className:"font-bold",children:e.orderHasBeenPlaced}),u.jsx("p",{className:"text-sm text-muted mb-4",children:e.contactMechanicToFulfill}),u.jsx(ve,{onClick:t,variant:"dark",children:e.ok})]})},XF=({show:t,goBack:e})=>{const{event:n,config:o,locale:i}=we(),{cart:l,cartTotal:c}=Zt(),[p,h]=v.useState(!1),[f,y]=v.useState("");return t?u.jsxs(ye,{show:t,className:"modal show my-0",centered:!0,scrollable:!0,backdrop:!1,children:[u.jsx(ye.Header,{className:"p-4",children:u.jsxs("div",{className:"flex gap-3 items-center",children:[u.jsx("button",{onClick:e,children:u.jsx("i",{className:"bi-chevron-left text-xl"})}),n.logo&&u.jsx("img",{src:`/logos/${n.logo}`,className:"m-0 h-[30px] grayscale opacity-[0.6]"}),u.jsx("h5",{className:"mb-0",children:i.cart})]})}),u.jsxs(ye.Body,{className:"p-0 pt-3",children:[u.jsx(Br,{alwaysOpen:!1,activeKey:f,onSelect:w=>y(w),className:"cart-accordion",flush:!0,children:Object.keys(l).map((w,S)=>{var C;return u.jsxs(Br.Item,{eventKey:w,children:[u.jsxs(ph,{children:[i[w]," (",(C=Object.keys(l[w]))==null?void 0:C.length,")"]}),u.jsx(dh,{children:Object.keys(l[w]).map((j,N)=>u.jsxs("div",{className:"mb-3",children:[u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx("div",{className:"font-medium text-white",children:i[j]||j}),u.jsx(Pt,{bg:"secondary",text:"dark",children:Tt(l[w][j].price,o)})]}),l[w][j].desc&&u.jsx("small",{children:l[w][j].desc})]},N))})]},S)})}),u.jsxs("div",{className:"p-4",children:[u.jsxs(ve,{className:"w-full flex gap-2",size:"lg",variant:"primary",disabled:!Object.values(l).length,onClick:()=>h(!0),children:[u.jsx("i",{className:"bi-cart me-2"}),u.jsx("span",{children:n.mechanicType==="owned"?i.placeOrder:i.checkout}),u.jsx(Pt,{bg:"white",text:"primary",className:"ms-2",children:Tt(c,o)})]}),u.jsx(YF,{show:p,onClose:()=>h(!1)})]})]})]}):null},JF=({show:t,onCancel:e,onConfirm:n})=>{const{locale:o}=we();return u.jsxs(ye,{show:t,backdrop:!0,centered:!0,style:{zIndex:9999999},size:"sm",children:[u.jsx(ye.Header,{children:u.jsx("h5",{className:"mb-0",children:o.areYouSure})}),u.jsxs(ye.Body,{children:[u.jsx("p",{children:o.vehicleChangesWillBeLost}),u.jsxs("div",{className:"flex justify-between mt-2",children:[u.jsx(ve,{onClick:n,variant:"danger",children:o.yes}),u.jsx(ve,{onClick:e,variant:"dark",children:o.cancel})]})]})]})},eD=({freecamActive:t,setFreecamActive:e})=>{var c,p,h;const{event:n,locale:o}=we(),[i,l]=v.useState(!1);return v.useEffect(()=>{const f=async({key:w})=>{w==="Shift"&&i&&!t&&(e(!0),await me("move-freecam"))},y=async({key:w})=>{if(w==="Control"&&!t){const S=!i;l(S),await me("toggle-freecam",{enable:S})}w==="Shift"&&i&&t&&(e(!1),await me("stop-moving-freecam"))};return window.addEventListener("keydown",f),window.addEventListener("keyup",y),()=>{window.removeEventListener("keydown",f),window.removeEventListener("keyup",y)}},[t,e,i]),u.jsxs(gt,{className:"!fixed left-[50%] translate-x-[-50%] bottom-7 p-2 px-3 flex flex-row items-center gap-2 z-[999999]",children:[u.jsx("i",{className:"bi-info-circle"}),u.jsx("div",{className:"flex items-center",children:i?t?u.jsx("span",{dangerouslySetInnerHTML:{__html:(h=o.stopMovingFreecamPrompt)==null?void 0:h.replace("%s",n.changeCamBtn||"V").replace(/\[+([^\][]+)]+/g,'$1')}}):u.jsx("span",{dangerouslySetInnerHTML:{__html:(p=o.freecamToggledPrompt)==null?void 0:p.replace(/\[+([^\][]+)]+/g,'$1')}}):u.jsx("span",{dangerouslySetInnerHTML:{__html:(c=o.useFreecamPrompt)==null?void 0:c.replace(/\[+([^\][]+)]+/g,'$1')}})})]})},tD=()=>{var De;const{locale:t,event:e,config:n,onCloseModal:o}=we(),[i,l]=v.useState(!1),[c,p]=v.useState({}),[h,f]=v.useState({}),[y,w]=v.useState(!1),[S,C]=v.useState(!1),[j,N]=v.useState(!1),[E,R]=v.useState({}),I=v.useMemo(()=>Object.values(E).reduce((ae,Ae)=>ae+=Object.values(Ae).reduce((Me,J)=>Me+=J.price,0),0),[E]),F=async()=>{C(!1),await me("switch-camera"),await me("toggle-freecam",{enable:!1})},L=(ae,Ae)=>{const Me=Array.isArray(ae)?ae:Object.values(ae).flat();return Array.isArray(Me)&&Me.find(({modIndex:J})=>J===Ae)||!1},P=(ae,Ae)=>{var Me;return((Me=Object.keys(ae).filter(J=>!!L(ae[J],Ae)))==null?void 0:Me[0])||Object.keys(ae)[0]},B=v.useCallback((ae,Ae)=>{p(Me=>({...Me,[ae]:Ae}))},[]),W=v.useCallback((ae,Ae,Me,J,Ee)=>{R(_=>({..._,[ae]:{..._[ae],[Ae]:{modIndex:Me,price:J,desc:Ee}}}))},[]),X=v.useCallback((ae,Ae)=>{R(Me=>{var J;return(J=Me[ae])==null||delete J[Ae],Me[ae]&&!Object.values(Me[ae]).length&&delete Me[ae],{...Me}})},[]),re=ae=>UF(ae,c,h),ce=ae=>GF(ae,c,h),ie=()=>{if(Object.values(E).length)return w(!0);Oe()},Oe=async()=>{await me("exit-mods"),o(),R({}),N(!1),w(!1)};v.useEffect(()=>{e.type==="show-vehicle-tuning"&&(p(e.props),f(JSON.parse(JSON.stringify(e.props))))},[e]);const be=v.useMemo(()=>{if(e.type!=="show-vehicle-tuning")return{};const{mods:ae}=e;return ae?{performance:ae.performance&&{Component:WF,icon:"perf.svg"},cosmetics:ae.cosmetics&&{Component:rF,icon:"cosmetics.svg"},stance:ae.stance&&{Component:aF,icon:"stance.svg"},respray:ae.respray&&{Component:DF,icon:"respray.svg"},wheels:ae.wheels&&{Component:PF,icon:"wheels/sport.svg"},lights:(ae.headlights||ae.neonLights)&&{Component:zF,icon:"headlight.svg"},tyres:(ae.tyreSmoke||ae.bulletproofTyres)&&{Component:BF,icon:"tyres.svg"},extras:ae.extras&&{Component:VF,icon:"extras.svg"}}:{}},[e]);return e.type!=="show-vehicle-tuning"?null:u.jsxs(gb.Provider,{value:{goToMainMenu:F,freecamActive:i,props:c,updatePreviewProps:B,installedProps:h,getPerfModData:re,getCosmeticModData:ce,findColourByIndex:L,findPaintByIndex:P,addToCart:W,removeFromCart:X,cartTotal:I,cart:E,onCloseTuningMenu:Oe},children:[u.jsx(JF,{show:y,onConfirm:Oe,onCancel:()=>w(!1)}),!S&&u.jsxs(u.Fragment,{children:[u.jsx(XF,{show:j,goBack:()=>N(!1)}),u.jsx(ye,{show:e.type==="show-vehicle-tuning"&&!j,className:"my-0",backdrop:!1,centered:!0,scrollable:!0,children:u.jsxs(ye.Body,{className:"!bg-inherit p-4",children:[u.jsxs("div",{className:"flex justify-between",children:[e.logo?u.jsx("div",{}):u.jsx("h5",{className:"mb-4",children:e.name}),u.jsx(Ko,{onClick:ie})]}),e.logo&&u.jsx("div",{className:"flex justify-center mb-10",children:u.jsx("img",{src:`/logos/${e.logo}`,className:"w-[180px] mx-auto"})}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.mods.repair&&u.jsx(KF,{}),Object.entries(be).map(([ae,Ae])=>Ae&&u.jsxs("button",{className:"p-3 border hover:!border-[#777] transition rounded-lg flex gap-3 items-center",onClick:()=>C(ae),children:[u.jsx("img",{src:`./icons/${Ae.icon}`,alt:ae,className:"w-[40px] h-[40px] opacity-80"}),u.jsx("span",{className:"text-white text-md font-semibold",children:t[ae]})]},ae))]}),u.jsx("div",{className:"flex mt-4 gap-3",children:u.jsxs(ve,{className:"w-full",size:"lg",variant:"primary",disabled:!Object.values(E).length,onClick:()=>N(!0),children:[u.jsx("i",{className:"bi-cart me-2"}),Object.values(E).length?u.jsxs("span",{children:[u.jsx("span",{children:(De=t.itemsSelected)==null?void 0:De.replace("%d",Object.values(E).length)}),u.jsx(Pt,{bg:"white",text:"primary",className:"ms-2",children:Tt(I,n)})]}):t.cartEmpty]})})]})})]}),Object.entries(be).map(([ae,Ae])=>S===ae&&u.jsxs(v.Fragment,{children:[u.jsx(eD,{freecamActive:i,setFreecamActive:l}),u.jsx(Ae.Component,{})]},ae))]})},nD=({show:t,type:e})=>{var I,F,L,P;const{event:n,locale:o}=we(),[i,l]=v.useState(((I=n[e])==null?void 0:I.enabled)||!1),[c,p]=v.useState(((F=n[e])==null?void 0:F.effect)||"solid"),[h,f]=v.useState(((L=n[e])==null?void 0:L.colour)||{r:255,g:0,b:0}),[y,w]=v.useState(((P=n[e])==null?void 0:P.speed)||1),[S,C]=v.useState(!1),[j,N]=v.useState(n.underglowDirections||[!0,!0,!0,!0]),E=v.useMemo(()=>({solid:{label:o.solid,colour:!0,speed:!1,sync:!1},rgb_cycle:{label:o.rgb,colour:!1,speed:!0,sync:!0},flashing:{label:o.flash,colour:!0,speed:!0,sync:!0}}),[o]);v.useEffect(()=>{me("update-light-controller",{[e]:{enabled:i,colour:h,effect:c,speed:y},underglowDirections:j})},[i,e,h,c,y,j]);const R=async()=>{C(!0),await me("sync-light-controller"),C(!1)};return t?u.jsxs("div",{children:[u.jsx(ue.Group,{children:u.jsx(ue.Switch,{checked:i,onChange:B=>l(B.target.checked),label:i?o.on:o.off})}),i&&e==="underglow"&&u.jsx("div",{children:u.jsx(ue.Group,{className:"flex gap-[22px]",children:["L","R","F","B"].map((B,W)=>u.jsx(ue.Switch,{label:B,checked:j[W],onChange:X=>N(re=>(re[W]=X.target.checked,[...re]))},W))})}),u.jsxs(ue.Group,{className:"mt-3",children:[u.jsx(ue.Label,{children:o.effect}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(ue.Select,{value:c,onChange:B=>p(B.target.value),children:Object.keys(E).map(B=>{const{label:W}=E[B];return u.jsx("option",{value:B,children:W},B)})}),E[c].sync&&u.jsx($l,{overlay:u.jsx(la,{id:"tooltip",children:o.syncHeadlightsAndUnderglow}),children:u.jsx(ve,{onClick:R,disabled:S,variant:"outline-secondary",className:"!text-xl p-0 px-2",children:u.jsx("i",{className:"bi-arrow-repeat"})})})]})]}),E[c].speed&&u.jsxs(ue.Group,{className:"mt-3",children:[u.jsx(ue.Label,{children:o.speed}),u.jsx(ue.Range,{min:1,max:4,step:.01,value:y,onChange:B=>w(parseFloat(B.target.value||"0"))})]}),E[c].colour&&u.jsx(lm,{color:h,onChange:B=>f(B),className:"!w-full mt-3"}),e==="xenons"&&u.jsxs(Vr,{variant:"warning",className:"m-0 mt-3",children:[u.jsx("i",{className:"bi-exclamation-triangle me-2"}),o.xenonRgbSyncLimitation]})]}):!1},rD=()=>{const{event:t,locale:e,onCloseModal:n}=we(),[o,i]=v.useState("underglow"),[l,c]=v.useState(!1),[p,h]=v.useState(!1);v.useEffect(()=>{t.type==="show-lighting-controller"&&c((t==null?void 0:t.installed)||!1)},[t]);const f=async()=>{h(!0),await me("install-light-controller"),c(!0),h(!1)},y=async()=>{await me("close-light-controller"),n()};return t.type!=="show-lighting-controller"?null:u.jsx(ye.Dialog,{className:"modal !m-0 !ml-6 !w-[300px] !flex justify-center flex-col",scrollable:!1,children:u.jsxs(ye.Body,{className:"p-0 bg-[url(/lighting-controller.png)] bg-contain bg-no-repeat",children:[u.jsx(Ko,{onClick:y,className:"absolute right-3 top-3"}),u.jsx("div",{className:"p-3 mt-[90px]",children:l?u.jsxs("div",{children:[u.jsx(t0,{className:"w-full mb-3",children:["underglow","xenons"].map(w=>u.jsxs(ve,{variant:o===w?"light":"dark",onClick:()=>i(w),className:`!text-sm ${o===w?"!font-semibold":""}`,children:[u.jsx("i",{className:`${w==="underglow"?"bi-lightning":"bi-lightbulb-fill"} me-1`}),e[w]]},w))}),["underglow","xenons"].map(w=>u.jsx(nD,{show:o===w,type:w},w))]}):u.jsx("div",{className:"p-4 flex justify-center items-center",children:u.jsxs(ve,{onClick:f,variant:"light",disabled:p,className:"!font-semibold",children:[u.jsx("i",{className:"bi-wrench me-2"}),e.installController]})})})]})})},sD=()=>{const{event:t}=we();return t.type!=="show-stancing-menu"?null:u.jsx(vb,{enableStance:t.enableStance,defaultStance:t.defaultStance,wheelsAdjustIndividually:t.wheelsAdjIndv,stance:t.stance,isStancingKit:!0})},oD=()=>{const{event:t,locale:e}=we(),[n,o]=v.useState(!0),i=async()=>await me("carlift-up",{vAttach:n}),l=async()=>await me("carlift-down",{vAttach:n}),c=async()=>await me("carlift-stop",{vAttach:n}),p=async()=>me("hide-carlift-controls");return v.useEffect(()=>{if(t.showCarLift){const h=async f=>{f.key==="Escape"&&await p()};return document.addEventListener("keydown",h,!1),()=>document.removeEventListener("keydown",h,!1)}},[t.showCarLift]),t.showCarLift?u.jsx(ye.Dialog,{className:"!fixed right-0 modal !mt-0 !mr-4 !w-[80px] !flex justify-center flex-col",children:u.jsxs(ye.Body,{className:"flex flex-col gap-3 !p-3 !pt-12",children:[u.jsx(ve,{variant:"default",className:"!font-bold absolute top-0 right-0",onClick:p,children:u.jsx("i",{className:"bi-x-lg !text-sm"})}),u.jsx(ve,{variant:"outline-secondary",className:"!font-bold",onMouseDown:i,onMouseUp:c,children:u.jsx("i",{className:"bi-caret-up-fill text-[25px]"})}),u.jsx(ve,{variant:"outline-secondary",className:"!font-bold",onMouseDown:l,onMouseUp:c,children:u.jsx("i",{className:"bi-caret-down-fill text-[25px]"})}),u.jsx($l,{placement:"left",overlay:u.jsx(la,{id:"tooltip-disabled",children:e.attachVehicle}),children:u.jsxs(ve,{variant:"dark",className:`!border-none relative ${n?"opacity-100":"opacity-50"}`,onClick:()=>o(h=>!h),children:[n&&u.jsx("div",{className:"connected w-[9px] h-[9px] rounded-full bg-green-600 absolute right-1 top-1"}),u.jsx("i",{className:"bi-car-front-fill text-[25px]"})]})})]})}):null},iD=()=>{const{event:t,onCloseModal:e,locale:n}=we();return t.type!=="show-dyno-share-sheet"?null:u.jsxs(ye,{show:!0,onHide:e,size:"lg",backdrop:!1,centered:!0,children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:n.dynoResults})}),u.jsx(ye.Body,{children:u.jsx(kw,{...t.results})})]})},aD=5,lD=()=>{const{event:t,locale:e}=we(),n=v.useRef(),[o,i]=v.useState(!0),[l,c]=v.useState();v.useEffect(()=>{t.nitrousHudData&&(n.current&&clearTimeout(n.current),c(t.nitrousHudData),i(!0))},[t.nitrousHudData]),v.useEffect(()=>(n.current=setTimeout(()=>{i(!1)},aD*1e3),()=>clearTimeout(n.current)),[l]);const p=v.useMemo(()=>l?l.capacity/l.maxCapacity:0,[l]);return!o||!l?null:u.jsx(gt,{className:"nos-hud bg-black",children:u.jsxs(gt.Body,{className:"flex gap-4 items-center py-2 !pl-5",children:[u.jsx("div",{className:"flex gap-2",children:Array(l.installedBottles).fill("").map((h,f)=>u.jsx(TS,{id:f,fillPercent:f+1<=l.filledBottles?100:0},f))}),u.jsxs("div",{className:"w-full flex gap-3 items-center",children:[u.jsx(jl,{now:p*100,className:`w-full ${!l.cooldown&&l.using?"opacity-1":"opacity-0"}`,variant:p<.2?"danger":"white"}),u.jsx("div",{className:"flex-shrink-0 min-w-[35px] h-[45px] items-center flex",children:l.cooldown?e.cooldown:l.empty?e.nosEmpty:l.using?`${Math.round(l.capacity)}s`:e.ready})]})]})})},Dx=["bank","cash"],uD=({show:t,onHide:e,onComplete:n,invoiceTotal:o})=>{const{event:i,setEvent:l,config:c,locale:p}=we(),[h,f]=v.useState(Dx[0]),[y,w]=v.useState(!1),[S,C]=v.useState(!1),[j,N]=v.useState(!1),E=()=>h==="bank"?i.bankBalance>=o:h==="cash"?i.cashBalance>=o:!1,R=async F=>{if(F.preventDefault(),!E())return!1;w(!0),C(!1);try{await me("pay-invoice",{paymentMethod:h})&&N(!0)}catch{C(p.couldNotCompleteOrderError)}w(!1)},I=async()=>{try{const F=await me("get-player-balances");if(!F)return;l(L=>({...L,bankBalance:F.bank})),l(L=>({...L,cashBalance:F.cash}))}catch{console.error("Could not refresh balances.")}};return u.jsxs(ye,{show:t,onHide:e,className:"!z-[99999]",size:"sm",centered:!0,keyboard:!1,backdrop:"static",children:[!j&&u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:"Payment Method"})}),u.jsx(ye.Body,{children:j?u.jsx(cD,{onClose:()=>n()}):u.jsxs(u.Fragment,{children:[S&&u.jsx(Vr,{variant:"danger",children:S||"Unknown error"}),Dx.map((F,L)=>{let P=0;return F==="bank"&&(P=i.bankBalance),F==="cash"&&(P=i.cashBalance),u.jsx(ue.Check,{label:u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsx("span",{className:"me-2",children:F}),u.jsx(Pt,{bg:"secondary",text:"dark",children:Tt(P,c)}),u.jsx(ve,{variant:"dark",onClick:I,size:"sm",className:"ms-2 !py-0 !px-1",children:u.jsx("i",{className:"bi-arrow-clockwise"})})]}),name:"payment-method",type:"radio",id:`payment-method-${F}`,checked:h===F,onChange:()=>f(F)},L)}),u.jsxs("div",{className:"flex justify-between mt-3",children:[u.jsx(ve,{onClick:R,disabled:!E()||y,children:"Pay"}),u.jsx(ve,{variant:"dark",onClick:e,children:"Cancel"})]})]})})]})},cD=({onClose:t})=>u.jsxs("div",{className:"text-center",children:[u.jsx("i",{className:"bi-check-circle-fill text-[70px] text-green-400"}),u.jsx("h5",{className:"font-bold",children:"Invoice Paid"}),u.jsx("p",{className:"text-sm text-muted mb-4",children:"Thank you for your business!"}),u.jsx(ve,{onClick:t,variant:"dark",children:"Close"})]}),dD=()=>{const{event:t,config:e,locale:n,onCloseModal:o}=we(),[i,l]=v.useState(!1),c=(t==null?void 0:t.invoiceItems)||[];return t.type!=="show-invoice"?null:u.jsxs(ye,{show:!0,onHide:o,backdrop:!1,centered:!0,children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:n.invoice})}),u.jsxs(ye.Body,{children:[u.jsxs(ua,{bordered:!0,children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:n.description}),u.jsx("th",{children:n.amount})]})}),u.jsx("tbody",{children:c.map(({title:p,amount:h})=>u.jsxs("tr",{children:[u.jsx("td",{children:p}),u.jsx("td",{children:Tt(h,e)})]}))})]}),u.jsxs("p",{children:[n.total,":"," ",u.jsx("strong",{children:Tt(t.invoiceTotal,e)})]}),u.jsx(ve,{onClick:()=>l(!0),children:n.payInvoice}),u.jsx(uD,{show:i,onHide:()=>l(!1),onComplete:()=>{o(),l(!1)},invoiceTotal:t.invoiceTotal})]})]})},fD=()=>{var p,h,f;const{event:t,onCloseModal:e,locale:n}=we(),[o,i]=v.useState(!1),l=async()=>{i(!0),await me("accept-hire-request",t.data),i(!1),e()},c=async()=>{i(!0),await me("deny-hire-request",{requesterId:t.data.requesterId}),i(!1),e()};return u.jsxs(ye,{show:t.type==="show-confirm-employment",centered:!0,backdrop:!1,children:[u.jsx(ye.Header,{className:"gap-3",children:u.jsx("h5",{className:"mb-0",children:n.employmentRequest})}),u.jsxs(ye.Body,{children:[u.jsx("p",{children:(h=n.jobOfferDescription)==null?void 0:h.replace("%{value}",(p=t.data)==null?void 0:p.mechanicId)}),u.jsxs("p",{className:"mb-0",children:[n.role,": ",n[`${(f=t.data)==null?void 0:f.role}Role`]]})]}),u.jsxs(ye.Footer,{className:"d-flex justify-content-between",children:[u.jsx(ve,{variant:"success",onClick:l,disabled:o,children:n.accept}),u.jsx(ve,{variant:"danger",onClick:c,disabled:o,children:n.denyRequest})]})]})},pD=({show:t,onHide:e,onConfirm:n})=>{const{locale:o}=we();return u.jsxs(ye,{show:t,onHide:()=>e(),style:{zIndex:9999},centered:!0,size:"sm",children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:o.deleteData})}),u.jsxs(ye.Body,{children:[u.jsx("p",{className:"mb-3",children:o.deleteConfirmationDanger}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx(ve,{variant:"primary",onClick:()=>{n(),e()},children:o.yes}),u.jsx(ve,{variant:"dark",onClick:()=>e(),children:o.no})]})]})]})},hD=({show:t,onHide:e,mechanicId:n})=>{const{locale:o}=we(),[i,l]=v.useState(!1),[c,p]=v.useState([]);v.useEffect(()=>{t&&(async()=>{const y=await me("nearby-players",{includePlayer:!0});Array.isArray(y)&&p(y)})()},[t]);const h=async f=>{if(f.preventDefault(),!i)return!1;try{await me("set-mechanic-owner",{mechanicId:n,player:i}),e()}catch(y){console.error(y)}};return u.jsx(ye,{size:"sm",show:t,onHide:()=>e(),style:{zIndex:9999},centered:!0,children:u.jsxs("form",{onSubmit:h,children:[u.jsx(ye.Header,{closeButton:!0,children:u.jsx("h5",{className:"mb-0",children:o.setOwner})}),u.jsxs(ye.Body,{children:[u.jsx(ue.Group,{className:"mb-3",children:u.jsxs(ue.Select,{value:i?i.toString():"",onChange:f=>l(parseInt(f.target.value)),children:[u.jsx("option",{value:"",disabled:!0,children:c.length?o.selectPlayer:o.noPlayersNearby}),c.map(({id:f,name:y})=>u.jsx("option",{value:f,children:y},f))]})}),u.jsx(ve,{type:"submit",variant:"primary",disabled:!i,children:o.setOwner})]})]})})},mD=({mechanic:t})=>{const{config:e,locale:n}=we(),{name:o,type:i,owner_name:l,label:c,active:p,balance:h}=t,[f,y]=v.useState(!1),[w,S]=v.useState(!1),C=async()=>{try{await me("delete-mechanic-data",{mechanicId:o})}catch(j){console.error(j)}};return u.jsxs("tr",{style:p?{}:{color:"#555"},children:[u.jsx("td",{children:o}),u.jsx("td",{children:i}),u.jsx("td",{children:c||o}),u.jsx("td",{children:i==="owned"?l:"-"}),u.jsx("td",{children:i==="owned"?Tt(h,e):"-"}),u.jsx("td",{children:p?u.jsxs("strong",{className:"text-success",children:[u.jsx("i",{className:"bi-check-circle me-1"})," ",n.active]}):u.jsxs("strong",{className:"text-danger",children:[u.jsx("i",{className:"bi-x-circle me-1"})," ",n.removed]})}),u.jsx("td",{className:"text-end",children:p?u.jsx(u.Fragment,{children:i==="owned"&&u.jsxs(u.Fragment,{children:[u.jsxs(ve,{size:"sm",variant:"primary",onClick:()=>y(!0),children:[u.jsx("i",{className:"bi-person me-1"}),n.setOwner]}),u.jsx(hD,{show:f,onHide:()=>y(!1),mechanicId:o})]})}):u.jsxs(u.Fragment,{children:[u.jsxs(ve,{size:"sm",variant:"danger",onClick:()=>S(!0),children:[u.jsx("i",{className:"bi-trash me-1"}),n.deleteData]}),u.jsx(pD,{show:w,onHide:()=>S(!1),onConfirm:C})]})})]})},gD=({data:t,columns:e})=>{const{locale:n,config:o}=we(),{getTableProps:i,getTableBodyProps:l,headerGroups:c,page:p,canPreviousPage:h,canNextPage:f,pageOptions:y,nextPage:w,previousPage:S,setPageSize:C,state:{pageIndex:j,pageSize:N}}=na.useTable({columns:e,data:t,autoResetPage:!1,autoResetFilters:!1},na.usePagination);return u.jsxs("div",{children:[o.UseFrameworkJobs&&u.jsxs(Vr,{variant:"danger",children:[u.jsx("i",{className:"bi-exclamation-triangle me-2"}),'Framework jobs is enabled. Using "Set Owner" in here will have no effect, as job permissions are derived from your framework.']}),u.jsxs(Vr,{variant:"info",children:[u.jsx("i",{className:"bi-info-circle me-2"}),'New mechanics are created in the config file. They will appear here after a script restart! Mechanics removed from the config will show as "Removed", and you can erase all their database data from here.']}),u.jsxs(ua,{hover:!0,className:"bootstrap-table",...i(),children:[u.jsx("thead",{children:c.map(E=>u.jsx("tr",{...E.getHeaderGroupProps(),children:E.headers.map(R=>u.jsx("th",{...R.getHeaderProps(),children:R.render("Header")}))}))}),u.jsx("tbody",{...l(),children:p.length?p.map(E=>u.jsx(mD,{mechanic:E.original},E.original.name)):u.jsx("tr",{children:u.jsx("td",{colSpan:100,align:"center",children:n.noMechanicsFound})})})]}),u.jsxs("div",{className:"pagination d-flex justify-content-between",children:[u.jsx("div",{children:u.jsxs(ve,{variant:"primary",onClick:()=>S(),disabled:!h,children:[u.jsx("i",{className:"bi-arrow-left"})," ",n.previous]})}),u.jsxs("div",{className:"d-flex align-items-center",children:[u.jsxs("span",{className:"me-3",children:[n.page," ",j+1," ",n.of," ",y.length]}),u.jsx(ue.Select,{size:"sm",value:N,onChange:E=>{C(Number(E.target.value))},style:{width:110},children:[10,20,30,40,50].map(E=>u.jsxs("option",{value:E,children:[n.show," ",E]},E))})]}),u.jsx("div",{children:u.jsxs(ve,{variant:"primary",onClick:()=>w(),disabled:!f,children:[n.next," ",u.jsx("i",{className:"bi-arrow-right"})]})})]})]})},vD=()=>{const{config:t,event:e,locale:n,onCloseModal:o}=we(),[i,l]=v.useState(""),[c,p]=v.useState([]),[h,f]=v.useState([]);v.useEffect(()=>{p(e.mechanics||[])},[e.mechanics]),v.useEffect(()=>{f(c.filter(({name:S,label:C})=>{const j=i.toLocaleLowerCase().split(" ").filter(N=>N).map(N=>N.trim());return j.filter(N=>`${S} ${C}`.toLocaleLowerCase().includes(N)).length===j.length}))},[c,i]);const y=v.useMemo(()=>[{Header:n.id,accessor:"name"},{Header:n.type,accessor:"type"},{Header:n.name,accessor:"label"},{Header:n.owner,accessor:"owner"},{Header:n.bankBalance,accessor:"balance"},{Header:n.status,accessor:"status"},{Header:"",accessor:"x"}],[n]),w=h;return u.jsxs(ye,{show:e.type==="show-mechanic-admin",onHide:()=>o(),size:"xl",centered:!0,backdrop:!1,scrollable:!0,children:[u.jsx(ye.Header,{className:"gap-3",closeButton:!0,children:u.jsx(ye.Title,{children:u.jsx("h5",{className:"mb-0",children:n.mechanicAdmin})})}),u.jsxs(ye.Body,{className:"p-0",children:[u.jsx(ue.Group,{className:"d-flex p-3 search-and-filter",children:u.jsxs(Lp,{children:[u.jsx(Lp.Text,{children:u.jsx("i",{className:"bi-search"})}),u.jsx(ue.Control,{type:"search",placeholder:n.search,value:i,onChange:S=>l(S.target.value)})]})}),u.jsx("div",{className:"p-3 pt-0",children:c.length?u.jsx(gD,{columns:y,data:w}):n.noMechanicsFound})]}),u.jsxs(ye.Footer,{className:"d-flex justify-content-between",children:[u.jsxs("div",{className:"text-muted",children:[c.length," ",n.mechanicsCount]}),!t.HideWatermark&&u.jsx(Pt,{bg:"secondary",text:"dark",children:"JG Scripts"})]})]})},yD=()=>{const{event:t}=we();return t.type!=="show-instruction-text"?null:u.jsx(mb,{})},xD=()=>{const{event:t,setEvent:e,locale:n}=we(),[o,i]=v.useState(!1);return v.useEffect(()=>{t.type==="manual-gearbox-keybinds"&&(i(!0),setTimeout(()=>{i(!1),e({})},4e3))},[t.type,e]),o&&u.jsxs(gt,{className:"!fixed left-[50%] transition-opacity translate-x-[-50%] top-[150px] p-3 flex flex-col items-center gap-[10px] z-[999999] !bg-black/90",children:[u.jsx("div",{className:"text-muted",children:n.highRpmWarning}),u.jsxs("div",{className:"flex gap-3 font-bold",children:[u.jsxs("div",{children:[n.upshift," ",u.jsx("kbd",{className:"mx-2 px-2",children:t.upBind})]}),u.jsxs("div",{children:[n.downshift," ",u.jsx("kbd",{className:"mx-2 px-2",children:t.downBind})]})]})]})};function wD(){return u.jsx("div",{className:"jg-container",children:u.jsxs(AC,{children:[!1,u.jsx(tF,{}),u.jsx(tD,{}),u.jsx(rD,{}),u.jsx(sD,{}),u.jsx(oD,{}),u.jsx(iD,{}),u.jsx(lD,{}),u.jsx(dD,{}),u.jsx(fD,{}),u.jsx(vD,{}),u.jsx(yD,{}),u.jsx(xD,{})]})})}_C.createRoot(document.getElementById("root")).render(u.jsx(mt.StrictMode,{children:u.jsx(wD,{})}))});export default SD();