var Hb=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var EL=Hb((pn,hn)=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var jf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Wb(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Mg={exports:{}},pu={},$g={exports:{}},je={};/** * @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 vs=Symbol.for("react.element"),Ub=Symbol.for("react.portal"),Gb=Symbol.for("react.fragment"),qb=Symbol.for("react.strict_mode"),Kb=Symbol.for("react.profiler"),Zb=Symbol.for("react.provider"),Yb=Symbol.for("react.context"),Qb=Symbol.for("react.forward_ref"),Xb=Symbol.for("react.suspense"),Jb=Symbol.for("react.memo"),eE=Symbol.for("react.lazy"),Dm=Symbol.iterator;function tE(e){return e===null||typeof e!="object"?null:(e=Dm&&e[Dm]||e["@@iterator"],typeof e=="function"?e:null)}var Ig={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fg=Object.assign,Dg={};function qo(e,t,n){this.props=e,this.context=t,this.refs=Dg,this.updater=n||Ig}qo.prototype.isReactComponent={};qo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ag(){}Ag.prototype=qo.prototype;function Bf(e,t,n){this.props=e,this.context=t,this.refs=Dg,this.updater=n||Ig}var zf=Bf.prototype=new Ag;zf.constructor=Bf;Fg(zf,qo.prototype);zf.isPureReactComponent=!0;var Am=Array.isArray,Lg=Object.prototype.hasOwnProperty,Vf={current:null},jg={key:!0,ref:!0,__self:!0,__source:!0};function Bg(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Lg.call(t,r)&&!jg.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,_e=U[ke];if(0>>1;kei(ht,ne))ct<_e&&0>i(Ot,ht)?(U[ke]=Ot,U[ct]=ne,ke=ct):(U[ke]=ht,U[rt]=ne,ke=rt);else if(ct<_e&&0>i(Ot,ne))U[ke]=Ot,U[ct]=ne,ke=ct;else break e}}return re}function i(U,re){var ne=U.sortIndex-re.sortIndex;return ne!==0?ne:U.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var u=[],l=[],f=1,h=null,p=3,y=!1,C=!1,x=!1,N=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(U){for(var re=n(l);re!==null;){if(re.callback===null)r(l);else if(re.startTime<=U)r(l),re.sortIndex=re.expirationTime,t(u,re);else break;re=n(l)}}function T(U){if(x=!1,b(U),!C)if(n(u)!==null)C=!0,ge(R);else{var re=n(l);re!==null&&xe(T,re.startTime-U)}}function R(U,re){C=!1,x&&(x=!1,w(A),A=-1),y=!0;var ne=p;try{for(b(re),h=n(u);h!==null&&(!(h.expirationTime>re)||U&&!W());){var ke=h.callback;if(typeof ke=="function"){h.callback=null,p=h.priorityLevel;var _e=ke(h.expirationTime<=re);re=e.unstable_now(),typeof _e=="function"?h.callback=_e:h===n(u)&&r(u),b(re)}else r(u);h=n(u)}if(h!==null)var Je=!0;else{var rt=n(l);rt!==null&&xe(T,rt.startTime-re),Je=!1}return Je}finally{h=null,p=ne,y=!1}}var M=!1,F=null,A=-1,I=5,$=-1;function W(){return!(e.unstable_now()-$U||125ke?(U.sortIndex=ne,t(l,U),n(u)===null&&U===n(l)&&(x?(w(A),A=-1):x=!0,xe(T,ne-ke))):(U.sortIndex=_e,t(u,U),C||y||(C=!0,ge(R))),U},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(U){var re=p;return function(){var ne=p;p=re;try{return U.apply(this,arguments)}finally{p=ne}}}})(Wg);Hg.exports=Wg;var fE=Hg.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 Ug=m,gn=fE;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vd=Object.prototype.hasOwnProperty,pE=/^[: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]*$/,jm={},Bm={};function hE(e){return vd.call(Bm,e)?!0:vd.call(jm,e)?!1:pE.test(e)?Bm[e]=!0:(jm[e]=!0,!1)}function mE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function vE(e,t,n,r){if(t===null||typeof t>"u"||mE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function en(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Lt[e]=new en(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Lt[t]=new en(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Lt[e]=new en(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Lt[e]=new en(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Lt[e]=new en(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Lt[e]=new en(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Lt[e]=new en(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Lt[e]=new en(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Lt[e]=new en(e,5,!1,e.toLowerCase(),null,!1,!1)});var Uf=/[\-:]([a-z])/g;function Gf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Uf,Gf);Lt[t]=new en(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Uf,Gf);Lt[t]=new en(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Uf,Gf);Lt[t]=new en(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Lt[e]=new en(e,1,!1,e.toLowerCase(),null,!1,!1)});Lt.xlinkHref=new en("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Lt[e]=new en(e,1,!1,e.toLowerCase(),null,!0,!0)});function qf(e,t,n,r){var i=Lt.hasOwnProperty(t)?Lt[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var u=` `+i[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=s);break}}}finally{wc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ta(e):""}function yE(e){switch(e.tag){case 5:return Ta(e.type);case 16:return Ta("Lazy");case 13:return Ta("Suspense");case 19:return Ta("SuspenseList");case 0:case 2:case 15:return e=Sc(e.type,!1),e;case 11:return e=Sc(e.type.render,!1),e;case 1:return e=Sc(e.type,!0),e;default:return""}}function Sd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case po:return"Fragment";case fo:return"Portal";case yd:return"Profiler";case Kf:return"StrictMode";case gd:return"Suspense";case wd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Kg:return(e.displayName||"Context")+".Consumer";case qg:return(e._context.displayName||"Context")+".Provider";case Zf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yf:return t=e.displayName||null,t!==null?t:Sd(e.type)||"Memo";case Vr:t=e._payload,e=e._init;try{return Sd(e(t))}catch{}}return null}function gE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Sd(t);case 8:return t===Kf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function li(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wE(e){var t=Yg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zs(e){e._valueTracker||(e._valueTracker=wE(e))}function Qg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Yg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ml(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function xd(e,t){var n=t.checked;return pt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=li(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xg(e,t){t=t.checked,t!=null&&qf(e,"checked",t,!1)}function Cd(e,t){Xg(e,t);var n=li(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?bd(e,t.type,n):t.hasOwnProperty("defaultValue")&&bd(e,t.type,li(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hm(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function bd(e,t,n){(t!=="number"||Ml(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Na=Array.isArray;function To(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Vs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Za(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var $a={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},SE=["Webkit","ms","Moz","O"];Object.keys($a).forEach(function(e){SE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$a[t]=$a[e]})});function n0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||$a.hasOwnProperty(e)&&$a[e]?(""+t).trim():t+"px"}function r0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=n0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var xE=pt({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 Td(e,t){if(t){if(xE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function Nd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Od=null;function Qf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rd=null,No=null,Oo=null;function Gm(e){if(e=ws(e)){if(typeof Rd!="function")throw Error(q(280));var t=e.stateNode;t&&(t=gu(t),Rd(e.stateNode,e.type,t))}}function i0(e){No?Oo?Oo.push(e):Oo=[e]:No=e}function o0(){if(No){var e=No,t=Oo;if(Oo=No=null,Gm(e),t)for(e=0;e>>=0,e===0?32:31-(ME(e)/$E|0)|0}var Hs=64,Ws=4194304;function Oa(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Oa(s):(o&=a,o!==0&&(r=Oa(o)))}else a=n&~i,a!==0?r=Oa(a):o!==0&&(r=Oa(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ys(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yn(t),e[t]=n}function AE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Fa),tv=String.fromCharCode(32),nv=!1;function k0(e,t){switch(e){case"keyup":return dk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ho=!1;function pk(e,t){switch(e){case"compositionend":return T0(t);case"keypress":return t.which!==32?null:(nv=!0,tv);case"textInput":return e=t.data,e===tv&&nv?null:e;default:return null}}function hk(e,t){if(ho)return e==="compositionend"||!op&&k0(e,t)?(e=b0(),vl=np=Yr=null,ho=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=av(n)}}function _0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function P0(){for(var e=window,t=Ml();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ml(e.document)}return t}function ap(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function bk(e){var t=P0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_0(n.ownerDocument.documentElement,n)){if(r!==null&&ap(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=sv(n,o);var a=sv(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,mo=null,Fd=null,Aa=null,Dd=!1;function lv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dd||mo==null||mo!==Ml(r)||(r=mo,"selectionStart"in r&&ap(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Aa&&ts(Aa,r)||(Aa=r,r=jl(Fd,"onSelect"),0go||(e.current=Vd[go],Vd[go]=null,go--)}function nt(e,t){go++,Vd[go]=e.current,e.current=t}var ui={},Ut=hi(ui),on=hi(!1),ji=ui;function Io(e,t){var n=e.type.contextTypes;if(!n)return ui;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function an(e){return e=e.childContextTypes,e!=null}function zl(){st(on),st(Ut)}function mv(e,t,n){if(Ut.current!==ui)throw Error(q(168));nt(Ut,t),nt(on,n)}function B0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(q(108,gE(e)||"Unknown",i));return pt({},n,r)}function Vl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ui,ji=Ut.current,nt(Ut,e),nt(on,on.current),!0}function vv(e,t,n){var r=e.stateNode;if(!r)throw Error(q(169));n?(e=B0(e,t,ji),r.__reactInternalMemoizedMergedChildContext=e,st(on),st(Ut),nt(Ut,e)):st(on),nt(on,n)}var yr=null,wu=!1,Ic=!1;function z0(e){yr===null?yr=[e]:yr.push(e)}function Fk(e){wu=!0,z0(e)}function mi(){if(!Ic&&yr!==null){Ic=!0;var e=0,t=Ze;try{var n=yr;for(Ze=1;e>=a,i-=a,Sr=1<<32-Yn(t)+i|n<A?(I=F,F=null):I=F.sibling;var $=p(w,F,b[A],T);if($===null){F===null&&(F=I);break}e&&F&&$.alternate===null&&t(w,F),E=o($,E,A),M===null?R=$:M.sibling=$,M=$,F=I}if(A===b.length)return n(w,F),ut&&bi(w,A),R;if(F===null){for(;AA?(I=F,F=null):I=F.sibling;var W=p(w,F,$.value,T);if(W===null){F===null&&(F=I);break}e&&F&&W.alternate===null&&t(w,F),E=o(W,E,A),M===null?R=W:M.sibling=W,M=W,F=I}if($.done)return n(w,F),ut&&bi(w,A),R;if(F===null){for(;!$.done;A++,$=b.next())$=h(w,$.value,T),$!==null&&(E=o($,E,A),M===null?R=$:M.sibling=$,M=$);return ut&&bi(w,A),R}for(F=r(w,F);!$.done;A++,$=b.next())$=y(F,w,A,$.value,T),$!==null&&(e&&$.alternate!==null&&F.delete($.key===null?A:$.key),E=o($,E,A),M===null?R=$:M.sibling=$,M=$);return e&&F.forEach(function(Z){return t(w,Z)}),ut&&bi(w,A),R}function N(w,E,b,T){if(typeof b=="object"&&b!==null&&b.type===po&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Bs:e:{for(var R=b.key,M=E;M!==null;){if(M.key===R){if(R=b.type,R===po){if(M.tag===7){n(w,M.sibling),E=i(M,b.props.children),E.return=w,w=E;break e}}else if(M.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Vr&&bv(R)===M.type){n(w,M.sibling),E=i(M,b.props),E.ref=va(w,M,b),E.return=w,w=E;break e}n(w,M);break}else t(w,M);M=M.sibling}b.type===po?(E=$i(b.props.children,w.mode,T,b.key),E.return=w,w=E):(T=El(b.type,b.key,b.props,null,w.mode,T),T.ref=va(w,E,b),T.return=w,w=T)}return a(w);case fo:e:{for(M=b.key;E!==null;){if(E.key===M)if(E.tag===4&&E.stateNode.containerInfo===b.containerInfo&&E.stateNode.implementation===b.implementation){n(w,E.sibling),E=i(E,b.children||[]),E.return=w,w=E;break e}else{n(w,E);break}else t(w,E);E=E.sibling}E=Vc(b,w.mode,T),E.return=w,w=E}return a(w);case Vr:return M=b._init,N(w,E,M(b._payload),T)}if(Na(b))return C(w,E,b,T);if(da(b))return x(w,E,b,T);Qs(w,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,E!==null&&E.tag===6?(n(w,E.sibling),E=i(E,b),E.return=w,w=E):(n(w,E),E=zc(b,w.mode,T),E.return=w,w=E),a(w)):n(w,E)}return N}var Do=Z0(!0),Y0=Z0(!1),Ss={},ar=hi(Ss),os=hi(Ss),as=hi(Ss);function Pi(e){if(e===Ss)throw Error(q(174));return e}function mp(e,t){switch(nt(as,t),nt(os,e),nt(ar,Ss),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:kd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=kd(t,e)}st(ar),nt(ar,t)}function Ao(){st(ar),st(os),st(as)}function Q0(e){Pi(as.current);var t=Pi(ar.current),n=kd(t,e.type);t!==n&&(nt(os,e),nt(ar,n))}function vp(e){os.current===e&&(st(ar),st(os))}var dt=hi(0);function Kl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fc=[];function yp(){for(var e=0;en?n:4,e(!0);var r=Dc.transition;Dc.transition={};try{e(!1),t()}finally{Ze=n,Dc.transition=r}}function pw(){return Dn().memoizedState}function jk(e,t,n){var r=oi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hw(e))mw(t,n);else if(n=U0(e,t,n,r),n!==null){var i=Xt();Qn(n,e,r,i),vw(n,t,r)}}function Bk(e,t,n){var r=oi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hw(e))mw(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Xn(s,a)){var u=t.interleaved;u===null?(i.next=i,pp(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=U0(e,t,i,r),n!==null&&(i=Xt(),Qn(n,e,r,i),vw(n,t,r))}}function hw(e){var t=e.alternate;return e===ft||t!==null&&t===ft}function mw(e,t){La=Zl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jf(e,n)}}var Yl={readContext:Fn,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},zk={readContext:Fn,useCallback:function(e,t){return rr().memoizedState=[e,t===void 0?null:t],e},useContext:Fn,useEffect:kv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Sl(4194308,4,lw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Sl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Sl(4,2,e,t)},useMemo:function(e,t){var n=rr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jk.bind(null,ft,e),[r.memoizedState,e]},useRef:function(e){var t=rr();return e={current:e},t.memoizedState=e},useState:Ev,useDebugValue:Cp,useDeferredValue:function(e){return rr().memoizedState=e},useTransition:function(){var e=Ev(!1),t=e[0];return e=Lk.bind(null,e[1]),rr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ft,i=rr();if(ut){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),Mt===null)throw Error(q(349));zi&30||ew(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,kv(nw.bind(null,r,o,e),[e]),r.flags|=2048,us(9,tw.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=rr(),t=Mt.identifierPrefix;if(ut){var n=xr,r=Sr;n=(r&~(1<<32-Yn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ss++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ir]=t,e[is]=r,kw(e,t,!1,!1),t.stateNode=e;e:{switch(a=Nd(n,r),n){case"dialog":it("cancel",e),it("close",e),i=r;break;case"iframe":case"object":case"embed":it("load",e),i=r;break;case"video":case"audio":for(i=0;ijo&&(t.flags|=128,r=!0,ya(o,!1),t.lanes=4194304)}else{if(!r)if(e=Kl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ya(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!ut)return zt(t),null}else 2*gt()-o.renderingStartTime>jo&&n!==1073741824&&(t.flags|=128,r=!0,ya(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=gt(),t.sibling=null,n=dt.current,nt(dt,r?n&1|2:n&1),t):(zt(t),null);case 22:case 23:return Op(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?cn&1073741824&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function Zk(e,t){switch(lp(t),t.tag){case 1:return an(t.type)&&zl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ao(),st(on),st(Ut),yp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vp(t),null;case 13:if(st(dt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(dt),null;case 4:return Ao(),null;case 10:return fp(t.type._context),null;case 22:case 23:return Op(),null;case 24:return null;default:return null}}var Js=!1,Vt=!1,Yk=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Co(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){yt(e,t,r)}else n.current=null}function ef(e,t,n){try{n()}catch(r){yt(e,t,r)}}var Iv=!1;function Qk(e,t){if(Ad=Al,e=P0(),ap(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,u=-1,l=0,f=0,h=e,p=null;t:for(;;){for(var y;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(u=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)p=h,h=y;for(;;){if(h===e)break t;if(p===n&&++l===i&&(s=a),p===o&&++f===r&&(u=a),(y=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=y}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ld={focusedElem:e,selectionRange:n},Al=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var x=C.memoizedProps,N=C.memoizedState,w=t.stateNode,E=w.getSnapshotBeforeUpdate(t.elementType===t.type?x:Un(t.type,x),N);w.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(T){yt(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return C=Iv,Iv=!1,C}function ja(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&ef(t,n,o)}i=i.next}while(i!==r)}}function Cu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ow(e){var t=e.alternate;t!==null&&(e.alternate=null,Ow(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ir],delete t[is],delete t[zd],delete t[$k],delete t[Ik])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Rw(e){return e.tag===5||e.tag===3||e.tag===4}function Fv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Bl));else if(r!==4&&(e=e.child,e!==null))for(nf(e,t,n),e=e.sibling;e!==null;)nf(e,t,n),e=e.sibling}function rf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(rf(e,t,n),e=e.sibling;e!==null;)rf(e,t,n),e=e.sibling}var Dt=null,Gn=!1;function Lr(e,t,n){for(n=n.child;n!==null;)_w(e,t,n),n=n.sibling}function _w(e,t,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(hu,n)}catch{}switch(n.tag){case 5:Vt||Co(n,t);case 6:var r=Dt,i=Gn;Dt=null,Lr(e,t,n),Dt=r,Gn=i,Dt!==null&&(Gn?(e=Dt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dt.removeChild(n.stateNode));break;case 18:Dt!==null&&(Gn?(e=Dt,n=n.stateNode,e.nodeType===8?$c(e.parentNode,n):e.nodeType===1&&$c(e,n),Ja(e)):$c(Dt,n.stateNode));break;case 4:r=Dt,i=Gn,Dt=n.stateNode.containerInfo,Gn=!0,Lr(e,t,n),Dt=r,Gn=i;break;case 0:case 11:case 14:case 15:if(!Vt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&ef(n,t,a),i=i.next}while(i!==r)}Lr(e,t,n);break;case 1:if(!Vt&&(Co(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){yt(n,t,s)}Lr(e,t,n);break;case 21:Lr(e,t,n);break;case 22:n.mode&1?(Vt=(r=Vt)||n.memoizedState!==null,Lr(e,t,n),Vt=r):Lr(e,t,n);break;default:Lr(e,t,n)}}function Dv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Yk),t.forEach(function(r){var i=aT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function zn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=gt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Jk(r/1960))-r,10e?16:e,Qr===null)var r=!1;else{if(e=Qr,Qr=null,Jl=0,We&6)throw Error(q(331));var i=We;for(We|=4,ce=e.current;ce!==null;){var o=ce,a=o.child;if(ce.flags&16){var s=o.deletions;if(s!==null){for(var u=0;ugt()-Tp?Mi(e,0):kp|=n),sn(e,t)}function Lw(e,t){t===0&&(e.mode&1?(t=Ws,Ws<<=1,!(Ws&130023424)&&(Ws=4194304)):t=1);var n=Xt();e=Nr(e,t),e!==null&&(ys(e,t,n),sn(e,n))}function oT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lw(e,n)}function aT(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(q(314))}r!==null&&r.delete(t),Lw(e,n)}var jw;jw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||on.current)rn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return rn=!1,qk(e,t,n);rn=!!(e.flags&131072)}else rn=!1,ut&&t.flags&1048576&&V0(t,Wl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;xl(e,t),e=t.pendingProps;var i=Io(t,Ut.current);_o(t,n),i=wp(null,t,r,e,i,n);var o=Sp();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,an(r)?(o=!0,Vl(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,hp(t),i.updater=Su,t.stateNode=i,i._reactInternals=t,qd(t,r,e,n),t=Yd(null,t,r,!0,o,n)):(t.tag=0,ut&&o&&sp(t),Yt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(xl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=lT(r),e=Un(r,e),i){case 0:t=Zd(null,t,r,e,n);break e;case 1:t=Pv(null,t,r,e,n);break e;case 11:t=Rv(null,t,r,e,n);break e;case 14:t=_v(null,t,r,Un(r.type,e),n);break e}throw Error(q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Un(r,i),Zd(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Un(r,i),Pv(e,t,r,i,n);case 3:e:{if(Cw(t),e===null)throw Error(q(387));r=t.pendingProps,o=t.memoizedState,i=o.element,G0(e,t),ql(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Lo(Error(q(423)),t),t=Mv(e,t,r,n,i);break e}else if(r!==i){i=Lo(Error(q(424)),t),t=Mv(e,t,r,n,i);break e}else for(fn=ni(t.stateNode.containerInfo.firstChild),mn=t,ut=!0,qn=null,n=Y0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fo(),r===i){t=Or(e,t,n);break e}Yt(e,t,r,n)}t=t.child}return t;case 5:return Q0(t),e===null&&Wd(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,jd(r,i)?a=null:o!==null&&jd(r,o)&&(t.flags|=32),xw(e,t),Yt(e,t,a,n),t.child;case 6:return e===null&&Wd(t),null;case 13:return bw(e,t,n);case 4:return mp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Do(t,null,r,n):Yt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Un(r,i),Rv(e,t,r,i,n);case 7:return Yt(e,t,t.pendingProps,n),t.child;case 8:return Yt(e,t,t.pendingProps.children,n),t.child;case 12:return Yt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,nt(Ul,r._currentValue),r._currentValue=a,o!==null)if(Xn(o.value,a)){if(o.children===i.children&&!on.current){t=Or(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=br(-1,n&-n),u.tag=2;var l=o.updateQueue;if(l!==null){l=l.shared;var f=l.pending;f===null?u.next=u:(u.next=f.next,f.next=u),l.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ud(o.return,n,t),s.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(q(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ud(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Yt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,_o(t,n),i=Fn(i),r=r(i),t.flags|=1,Yt(e,t,r,n),t.child;case 14:return r=t.type,i=Un(r,t.pendingProps),i=Un(r.type,i),_v(e,t,r,i,n);case 15:return ww(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Un(r,i),xl(e,t),t.tag=1,an(r)?(e=!0,Vl(t)):e=!1,_o(t,n),K0(t,r,i),qd(t,r,i,n),Yd(null,t,r,!0,e,n);case 19:return Ew(e,t,n);case 22:return Sw(e,t,n)}throw Error(q(156,t.tag))};function Bw(e,t){return f0(e,t)}function sT(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(e,t,n,r){return new sT(e,t,n,r)}function _p(e){return e=e.prototype,!(!e||!e.isReactComponent)}function lT(e){if(typeof e=="function")return _p(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zf)return 11;if(e===Yf)return 14}return 2}function ai(e,t){var n=e.alternate;return n===null?(n=Pn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function El(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")_p(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case po:return $i(n.children,i,o,t);case Kf:a=8,i|=8;break;case yd:return e=Pn(12,n,t,i|2),e.elementType=yd,e.lanes=o,e;case gd:return e=Pn(13,n,t,i),e.elementType=gd,e.lanes=o,e;case wd:return e=Pn(19,n,t,i),e.elementType=wd,e.lanes=o,e;case Zg:return Eu(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qg:a=10;break e;case Kg:a=9;break e;case Zf:a=11;break e;case Yf:a=14;break e;case Vr:a=16,r=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=Pn(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function $i(e,t,n,r){return e=Pn(7,e,r,t),e.lanes=n,e}function Eu(e,t,n,r){return e=Pn(22,e,r,t),e.elementType=Zg,e.lanes=n,e.stateNode={isHidden:!1},e}function zc(e,t,n){return e=Pn(6,e,null,t),e.lanes=n,e}function Vc(e,t,n){return t=Pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function uT(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Cc(0),this.expirationTimes=Cc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Pp(e,t,n,r,i,o,a,s,u){return e=new uT(e,t,n,s,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},hp(o),e}function cT(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ww)}catch(e){console.error(e)}}Ww(),Vg.exports=Sn;var Uw=Vg.exports;const Eo=fi(Uw);var Wv=Uw;md.createRoot=Wv.createRoot,md.hydrateRoot=Wv.hydrateRoot;var Gw={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i1?f-1:0),p=1;p{o.target===e&&(i(),t(o))},n+r)}function wa(...e){return e.filter(t=>t!=null).reduce((t,n)=>{if(typeof n!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return t===null?n:function(...i){t.apply(this,i),n.apply(this,i)}},null)}function t1(e){e.offsetHeight}var Qv=function(t){return!t||typeof t=="function"?t:function(n){t.current=n}};function DT(e,t){var n=Qv(e),r=Qv(t);return function(i){n&&n(i),r&&r(i)}}function Yi(e,t){return m.useMemo(function(){return DT(e,t)},[e,t])}function AT(e){return e&&"setState"in e?Eo.findDOMNode(e):e??null}const LT=Kn.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,onExited:o,addEndListener:a,children:s,childRef:u,...l},f)=>{const h=m.useRef(null),p=Yi(h,u),y=M=>{p(AT(M))},C=M=>F=>{M&&h.current&&M(h.current,F)},x=m.useCallback(C(e),[e]),N=m.useCallback(C(t),[t]),w=m.useCallback(C(n),[n]),E=m.useCallback(C(r),[r]),b=m.useCallback(C(i),[i]),T=m.useCallback(C(o),[o]),R=m.useCallback(C(a),[a]);return c(MT,{ref:f,...l,onEnter:x,onEntered:w,onEntering:N,onExit:E,onExited:T,onExiting:b,addEndListener:R,nodeRef:h,children:typeof s=="function"?(M,F)=>s(M,{...F,ref:y}):Kn.cloneElement(s,{ref:y})})}),n1=LT,jT={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function r1(e,t){const n=`offset${e[0].toUpperCase()}${e.slice(1)}`,r=t[n],i=jT[e];return r+parseInt(Er(t,i[0]),10)+parseInt(Er(t,i[1]),10)}const BT={[Wr]:"collapse",[nu]:"collapsing",[gr]:"collapsing",[Kr]:"collapse show"},zT={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,getDimensionValue:r1},i1=Kn.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:i,className:o,children:a,dimension:s="height",getDimensionValue:u=r1,...l},f)=>{const h=typeof s=="function"?s():s,p=m.useMemo(()=>wa(w=>{w.style[h]="0"},e),[h,e]),y=m.useMemo(()=>wa(w=>{const E=`scroll${h[0].toUpperCase()}${h.slice(1)}`;w.style[h]=`${w[E]}px`},t),[h,t]),C=m.useMemo(()=>wa(w=>{w.style[h]=null},n),[h,n]),x=m.useMemo(()=>wa(w=>{w.style[h]=`${u(h,w)}px`,t1(w)},r),[r,u,h]),N=m.useMemo(()=>wa(w=>{w.style[h]=null},i),[h,i]);return c(n1,{ref:f,addEndListener:e1,...l,"aria-expanded":l.role?l.in:null,onEnter:p,onEntering:y,onEntered:C,onExit:x,onExiting:N,childRef:a.ref,children:(w,E)=>Kn.cloneElement(a,{...E,className:be(o,a.props.className,BT[w],h==="width"&&"collapse-horizontal")})})});i1.defaultProps=zT;const VT=i1;function o1(e,t){return Array.isArray(e)?e.includes(t):e===t}const a1=m.createContext({});a1.displayName="AccordionContext";const _u=a1,s1=m.forwardRef(({as:e="div",bsPrefix:t,className:n,children:r,eventKey:i,...o},a)=>{const{activeEventKey:s}=m.useContext(_u);return t=$e(t,"accordion-collapse"),c(VT,{ref:a,in:o1(s,i),...o,className:be(n,t),children:c(e,{children:m.Children.only(r)})})});s1.displayName="AccordionCollapse";const l1=s1,u1=m.createContext({eventKey:""});u1.displayName="AccordionItemContext";const Ap=u1,c1=m.forwardRef(({as:e="div",bsPrefix:t,className:n,onEnter:r,onEntering:i,onEntered:o,onExit:a,onExiting:s,onExited:u,...l},f)=>{t=$e(t,"accordion-body");const{eventKey:h}=m.useContext(Ap);return c(l1,{eventKey:h,onEnter:r,onEntering:i,onEntered:o,onExit:a,onExiting:s,onExited:u,children:c(e,{ref:f,...l,className:be(n,t)})})});c1.displayName="AccordionBody";const HT=c1;function WT(e,t){const{activeEventKey:n,onSelect:r,alwaysOpen:i}=m.useContext(_u);return o=>{let a=e===n?null:e;i&&(Array.isArray(n)?n.includes(e)?a=n.filter(s=>s!==e):a=[...n,e]:a=[e]),r==null||r(a,o),t==null||t(o)}}const d1=m.forwardRef(({as:e="button",bsPrefix:t,className:n,onClick:r,...i},o)=>{t=$e(t,"accordion-button");const{eventKey:a}=m.useContext(Ap),s=WT(a,r),{activeEventKey:u}=m.useContext(_u);return e==="button"&&(i.type="button"),c(e,{ref:o,onClick:s,...i,"aria-expanded":Array.isArray(u)?u.includes(a):a===u,className:be(n,t,!o1(u,a)&&"collapsed")})});d1.displayName="AccordionButton";const f1=d1,p1=m.forwardRef(({as:e="h2",bsPrefix:t,className:n,children:r,onClick:i,...o},a)=>(t=$e(t,"accordion-header"),c(e,{ref:a,...o,className:be(n,t),children:c(f1,{onClick:i,children:r})})));p1.displayName="AccordionHeader";const UT=p1,h1=m.forwardRef(({as:e="div",bsPrefix:t,className:n,eventKey:r,...i},o)=>{t=$e(t,"accordion-item");const a=m.useMemo(()=>({eventKey:r}),[r]);return c(Ap.Provider,{value:a,children:c(e,{ref:o,...i,className:be(n,t)})})});h1.displayName="AccordionItem";const GT=h1,m1=m.forwardRef((e,t)=>{const{as:n="div",activeKey:r,bsPrefix:i,className:o,onSelect:a,flush:s,alwaysOpen:u,...l}=xs(e,{activeKey:"onSelect"}),f=$e(i,"accordion"),h=m.useMemo(()=>({activeEventKey:r,onSelect:a,alwaysOpen:u}),[r,a,u]);return c(_u.Provider,{value:h,children:c(n,{ref:t,...l,className:be(o,f,s&&`${f}-flush`)})})});m1.displayName="Accordion";const kl=Object.assign(m1,{Button:f1,Collapse:l1,Item:GT,Header:UT,Body:HT});function qT(e){var t=m.useRef(e);return m.useEffect(function(){t.current=e},[e]),t}function wt(e){var t=qT(e);return m.useCallback(function(){return t.current&&t.current.apply(t,arguments)},[t])}function v1(){return m.useState(null)}function KT(e,t,n,r){r===void 0&&(r=!1);var i=wt(n);m.useEffect(function(){var o=typeof e=="function"?e():e;return o.addEventListener(t,i,r),function(){return o.removeEventListener(t,i,r)}},[e])}function y1(){var e=m.useRef(!0),t=m.useRef(function(){return e.current});return m.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t.current}function g1(e){var t=m.useRef(null);return m.useEffect(function(){t.current=e}),t.current}var ZT=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",YT=typeof document<"u";const hf=YT||ZT?m.useLayoutEffect:m.useEffect,QT=["as","disabled"];function XT(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function JT(e){return!e||e.trim()==="#"}function Lp({tagName:e,disabled:t,href:n,target:r,rel:i,role:o,onClick:a,tabIndex:s=0,type:u}){e||(n!=null||r!=null||i!=null?e="a":e="button");const l={tagName:e};if(e==="button")return[{type:u||"button",disabled:t},l];const f=p=>{if((t||e==="a"&&JT(n))&&p.preventDefault(),t){p.stopPropagation();return}a==null||a(p)},h=p=>{p.key===" "&&(p.preventDefault(),f(p))};return e==="a"&&(n||(n="#"),t&&(n=void 0)),[{role:o??"button",disabled:void 0,tabIndex:t?void 0:s,href:n,target:e==="a"?r:void 0,"aria-disabled":t||void 0,rel:e==="a"?i:void 0,onClick:f,onKeyDown:h},l]}const jp=m.forwardRef((e,t)=>{let{as:n,disabled:r}=e,i=XT(e,QT);const[o,{tagName:a}]=Lp(Object.assign({tagName:n,disabled:r},i));return c(a,Object.assign({},i,o,{ref:t}))});jp.displayName="Button";const eN=["onKeyDown"];function tN(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function nN(e){return!e||e.trim()==="#"}const w1=m.forwardRef((e,t)=>{let{onKeyDown:n}=e,r=tN(e,eN);const[i]=Lp(Object.assign({tagName:"a"},r)),o=wt(a=>{i.onKeyDown(a),n==null||n(a)});return nN(r.href)||r.role==="button"?c("a",Object.assign({ref:t},r,i,{onKeyDown:o})):c("a",Object.assign({ref:t},r,{onKeyDown:n}))});w1.displayName="Anchor";const Pu=w1,rN={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1},iN={[gr]:"show",[Kr]:"show"},Bp=m.forwardRef(({className:e,children:t,transitionClasses:n={},...r},i)=>{const o=m.useCallback((a,s)=>{t1(a),r.onEnter==null||r.onEnter(a,s)},[r]);return c(n1,{ref:i,addEndListener:e1,...r,onEnter:o,childRef:t.ref,children:(a,s)=>m.cloneElement(t,{...s,className:be("fade",e,t.props.className,iN[a],n[a])})})});Bp.defaultProps=rN;Bp.displayName="Fade";const Qo=Bp,oN={"aria-label":De.string,onClick:De.func,variant:De.oneOf(["white"])},aN={"aria-label":"Close"},Mu=m.forwardRef(({className:e,variant:t,...n},r)=>c("button",{ref:r,type:"button",className:be("btn-close",t&&`btn-close-${t}`,e),...n}));Mu.displayName="CloseButton";Mu.propTypes=oN;Mu.defaultProps=aN;const zp=Mu,$u=e=>m.forwardRef((t,n)=>c("div",{...t,ref:n,className:be(t.className,e)}));var sN=/-(.)/g;function lN(e){return e.replace(sN,function(t,n){return n.toUpperCase()})}const uN=e=>e[0].toUpperCase()+lN(e).slice(1);function Nt(e,{displayName:t=uN(e),Component:n,defaultProps:r}={}){const i=m.forwardRef(({className:o,bsPrefix:a,as:s=n||"div",...u},l)=>{const f=$e(a,e);return c(s,{ref:l,className:be(o,f),...u})});return i.defaultProps=r,i.displayName=t,i}const S1=$u("h4");S1.displayName="DivStyledAsH4";const cN=Nt("alert-heading",{Component:S1}),dN=Nt("alert-link",{Component:Pu}),fN={variant:"primary",show:!0,transition:Qo,closeLabel:"Close alert"},Vp=m.forwardRef((e,t)=>{const{bsPrefix:n,show:r,closeLabel:i,closeVariant:o,className:a,children:s,variant:u,onClose:l,dismissible:f,transition:h,...p}=xs(e,{show:"onClose"}),y=$e(n,"alert"),C=wt(w=>{l&&l(!1,w)}),x=h===!0?Qo:h,N=g("div",{role:"alert",...x?void 0:p,ref:t,className:be(a,y,u&&`${y}-${u}`,f&&`${y}-dismissible`),children:[f&&c(zp,{onClick:C,"aria-label":i,variant:o}),s]});return x?c(x,{unmountOnExit:!0,...p,ref:void 0,in:r,children:N}):r?N:null});Vp.displayName="Alert";Vp.defaultProps=fN;const Bo=Object.assign(Vp,{Link:dN,Heading:cN}),pN={bg:"primary",pill:!1},Hp=m.forwardRef(({bsPrefix:e,bg:t,pill:n,text:r,className:i,as:o="span",...a},s)=>{const u=$e(e,"badge");return c(o,{ref:s,...a,className:be(i,u,n&&"rounded-pill",r&&`text-${r}`,t&&`bg-${t}`)})});Hp.displayName="Badge";Hp.defaultProps=pN;const vn=Hp,hN={active:!1,linkProps:{}},Wp=m.forwardRef(({bsPrefix:e,active:t,children:n,className:r,as:i="li",linkAs:o=Pu,linkProps:a,href:s,title:u,target:l,...f},h)=>{const p=$e(e,"breadcrumb-item");return c(i,{ref:h,...f,className:be(p,r,{active:t}),"aria-current":t?"page":void 0,children:t?n:c(o,{...a,href:s,title:u,target:l,children:n})})});Wp.displayName="BreadcrumbItem";Wp.defaultProps=hN;const mN=Wp,vN={label:"breadcrumb",listProps:{}},Up=m.forwardRef(({bsPrefix:e,className:t,listProps:n,children:r,label:i,as:o="nav",...a},s)=>{const u=$e(e,"breadcrumb");return c(o,{"aria-label":i,className:t,ref:s,...a,children:c("ol",{...n,className:be(u,n==null?void 0:n.className),children:r})})});Up.displayName="Breadcrumb";Up.defaultProps=vN;const hr=Object.assign(Up,{Item:mN}),yN={variant:"primary",active:!1,disabled:!1},Gp=m.forwardRef(({as:e,bsPrefix:t,variant:n,size:r,active:i,className:o,...a},s)=>{const u=$e(t,"btn"),[l,{tagName:f}]=Lp({tagName:e,...a});return c(f,{...l,...a,ref:s,className:be(o,u,i&&"active",n&&`${u}-${n}`,r&&`${u}-${r}`,a.href&&a.disabled&&"disabled")})});Gp.displayName="Button";Gp.defaultProps=yN;const ee=Gp,gN={vertical:!1,role:"group"},qp=m.forwardRef(({bsPrefix:e,size:t,vertical:n,className:r,as:i="div",...o},a)=>{const s=$e(e,"btn-group");let u=s;return n&&(u=`${s}-vertical`),c(i,{...o,ref:a,className:be(r,u,t&&`${s}-${t}`)})});qp.displayName="ButtonGroup";qp.defaultProps=gN;const x1=qp,C1=m.forwardRef(({bsPrefix:e,className:t,variant:n,as:r="img",...i},o)=>{const a=$e(e,"card-img");return c(r,{ref:o,className:be(n?`${a}-${n}`:a,t),...i})});C1.displayName="CardImg";const wN=C1,b1=m.createContext(null);b1.displayName="CardHeaderContext";const E1=b1,k1=m.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},i)=>{const o=$e(e,"card-header"),a=m.useMemo(()=>({cardHeaderBsPrefix:o}),[o]);return c(E1.Provider,{value:a,children:c(n,{ref:i,...r,className:be(t,o)})})});k1.displayName="CardHeader";const SN=k1,xN=$u("h5"),CN=$u("h6"),T1=Nt("card-body"),bN=Nt("card-title",{Component:xN}),EN=Nt("card-subtitle",{Component:CN}),kN=Nt("card-link",{Component:"a"}),TN=Nt("card-text",{Component:"p"}),NN=Nt("card-footer"),ON=Nt("card-img-overlay"),RN={body:!1},Kp=m.forwardRef(({bsPrefix:e,className:t,bg:n,text:r,border:i,body:o,children:a,as:s="div",...u},l)=>{const f=$e(e,"card");return c(s,{ref:l,...u,className:be(t,f,n&&`bg-${n}`,r&&`text-${r}`,i&&`border-${i}`),children:o?c(T1,{children:a}):a})});Kp.displayName="Card";Kp.defaultProps=RN;const Ue=Object.assign(Kp,{Img:wN,Title:bN,Subtitle:EN,Body:T1,Link:kN,Text:TN,Header:SN,Footer:NN,ImgOverlay:ON});function _N(e){var t=m.useRef(e);return t.current=e,t}function N1(e){var t=_N(e);m.useEffect(function(){return function(){return t.current()}},[])}function mf(e,t){let n=0;return m.Children.map(e,r=>m.isValidElement(r)?t(r,n++):r)}function PN(e,t){let n=0;m.Children.forEach(e,r=>{m.isValidElement(r)&&t(r,n++)})}function MN(e,t){return m.Children.toArray(e).some(n=>m.isValidElement(n)&&n.type===t)}function $N({as:e,bsPrefix:t,className:n,...r}){t=$e(t,"col");const i=Kw(),o=Zw(),a=[],s=[];return i.forEach(u=>{const l=r[u];delete r[u];let f,h,p;typeof l=="object"&&l!=null?{span:f,offset:h,order:p}=l:f=l;const y=u!==o?`-${u}`:"";f&&a.push(f===!0?`${t}${y}`:`${t}${y}-${f}`),p!=null&&s.push(`order${y}-${p}`),h!=null&&s.push(`offset${y}-${h}`)}),[{...r,className:be(n,...a,...s)},{as:e,bsPrefix:t,spans:a}]}const O1=m.forwardRef((e,t)=>{const[{className:n,...r},{as:i="div",bsPrefix:o,spans:a}]=$N(e);return c(i,{...r,ref:t,className:be(n,!a.length&&o)})});O1.displayName="Col";const Xe=O1;var IN=Function.prototype.bind.call(Function.prototype.call,[].slice);function wr(e,t){return IN(e.querySelectorAll(t))}function R1(){var e=m.useReducer(function(n){return!n},!1),t=e[1];return t}const FN=m.createContext(null),Iu=FN;var Xv=Object.prototype.hasOwnProperty;function Jv(e,t,n){for(n of e.keys())if(Va(n,t))return n}function Va(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Va(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i=="object"&&(i=Jv(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i=="object"&&(i=Jv(t,i),!i)||!Va(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Xv.call(e,n)&&++r&&!Xv.call(t,n)||!(n in t)||!Va(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function DN(e){var t=y1();return[e[0],m.useCallback(function(n){if(t())return e[1](n)},[t,e[1]])]}var ln="top",An="bottom",Ln="right",un="left",Zp="auto",bs=[ln,An,Ln,un],zo="start",ds="end",AN="clippingParents",_1="viewport",Sa="popper",LN="reference",ey=bs.reduce(function(e,t){return e.concat([t+"-"+zo,t+"-"+ds])},[]),P1=[].concat(bs,[Zp]).reduce(function(e,t){return e.concat([t,t+"-"+zo,t+"-"+ds])},[]),jN="beforeRead",BN="read",zN="afterRead",VN="beforeMain",HN="main",WN="afterMain",UN="beforeWrite",GN="write",qN="afterWrite",KN=[jN,BN,zN,VN,HN,WN,UN,GN,qN];function sr(e){return e.split("-")[0]}function jn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Wi(e){var t=jn(e).Element;return e instanceof t||e instanceof Element}function lr(e){var t=jn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Yp(e){if(typeof ShadowRoot>"u")return!1;var t=jn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var Ii=Math.max,ru=Math.min,Vo=Math.round;function vf(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function M1(){return!/^((?!chrome|android).)*safari/i.test(vf())}function Ho(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&lr(e)&&(i=e.offsetWidth>0&&Vo(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Vo(r.height)/e.offsetHeight||1);var a=Wi(e)?jn(e):window,s=a.visualViewport,u=!M1()&&n,l=(r.left+(u&&s?s.offsetLeft:0))/i,f=(r.top+(u&&s?s.offsetTop:0))/o,h=r.width/i,p=r.height/o;return{width:h,height:p,top:f,right:l+h,bottom:f+p,left:l,x:l,y:f}}function Qp(e){var t=Ho(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function $1(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Yp(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ci(e){return e?(e.nodeName||"").toLowerCase():null}function Rr(e){return jn(e).getComputedStyle(e)}function ZN(e){return["table","td","th"].indexOf(ci(e))>=0}function vi(e){return((Wi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Fu(e){return ci(e)==="html"?e:e.assignedSlot||e.parentNode||(Yp(e)?e.host:null)||vi(e)}function ty(e){return!lr(e)||Rr(e).position==="fixed"?null:e.offsetParent}function YN(e){var t=/firefox/i.test(vf()),n=/Trident/i.test(vf());if(n&&lr(e)){var r=Rr(e);if(r.position==="fixed")return null}var i=Fu(e);for(Yp(i)&&(i=i.host);lr(i)&&["html","body"].indexOf(ci(i))<0;){var o=Rr(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Es(e){for(var t=jn(e),n=ty(e);n&&ZN(n)&&Rr(n).position==="static";)n=ty(n);return n&&(ci(n)==="html"||ci(n)==="body"&&Rr(n).position==="static")?t:n||YN(e)||t}function Xp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ha(e,t,n){return Ii(e,ru(t,n))}function QN(e,t,n){var r=Ha(e,t,n);return r>n?n:r}function I1(){return{top:0,right:0,bottom:0,left:0}}function F1(e){return Object.assign({},I1(),e)}function D1(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var XN=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,F1(typeof t!="number"?t:D1(t,bs))};function JN(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=sr(n.placement),u=Xp(s),l=[un,Ln].indexOf(s)>=0,f=l?"height":"width";if(!(!o||!a)){var h=XN(i.padding,n),p=Qp(o),y=u==="y"?ln:un,C=u==="y"?An:Ln,x=n.rects.reference[f]+n.rects.reference[u]-a[u]-n.rects.popper[f],N=a[u]-n.rects.reference[u],w=Es(o),E=w?u==="y"?w.clientHeight||0:w.clientWidth||0:0,b=x/2-N/2,T=h[y],R=E-p[f]-h[C],M=E/2-p[f]/2+b,F=Ha(T,M,R),A=u;n.modifiersData[r]=(t={},t[A]=F,t.centerOffset=F-M,t)}}function eO(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||$1(t.elements.popper,i)&&(t.elements.arrow=i))}const tO={name:"arrow",enabled:!0,phase:"main",fn:JN,effect:eO,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Wo(e){return e.split("-")[1]}var nO={top:"auto",right:"auto",bottom:"auto",left:"auto"};function rO(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Vo(t*i)/i||0,y:Vo(n*i)/i||0}}function ny(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,l=e.adaptive,f=e.roundOffsets,h=e.isFixed,p=a.x,y=p===void 0?0:p,C=a.y,x=C===void 0?0:C,N=typeof f=="function"?f({x:y,y:x}):{x:y,y:x};y=N.x,x=N.y;var w=a.hasOwnProperty("x"),E=a.hasOwnProperty("y"),b=un,T=ln,R=window;if(l){var M=Es(n),F="clientHeight",A="clientWidth";if(M===jn(n)&&(M=vi(n),Rr(M).position!=="static"&&s==="absolute"&&(F="scrollHeight",A="scrollWidth")),M=M,i===ln||(i===un||i===Ln)&&o===ds){T=An;var I=h&&M===R&&R.visualViewport?R.visualViewport.height:M[F];x-=I-r.height,x*=u?1:-1}if(i===un||(i===ln||i===An)&&o===ds){b=Ln;var $=h&&M===R&&R.visualViewport?R.visualViewport.width:M[A];y-=$-r.width,y*=u?1:-1}}var W=Object.assign({position:s},l&&nO),Z=f===!0?rO({x:y,y:x}):{x:y,y:x};if(y=Z.x,x=Z.y,u){var G;return Object.assign({},W,(G={},G[T]=E?"0":"",G[b]=w?"0":"",G.transform=(R.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",G))}return Object.assign({},W,(t={},t[T]=E?x+"px":"",t[b]=w?y+"px":"",t.transform="",t))}function iO(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,u=s===void 0?!0:s,l={placement:sr(t.placement),variation:Wo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ny(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ny(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const oO={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:iO,data:{}};var rl={passive:!0};function aO(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,u=jn(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach(function(f){f.addEventListener("scroll",n.update,rl)}),s&&u.addEventListener("resize",n.update,rl),function(){o&&l.forEach(function(f){f.removeEventListener("scroll",n.update,rl)}),s&&u.removeEventListener("resize",n.update,rl)}}const sO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:aO,data:{}};var lO={left:"right",right:"left",bottom:"top",top:"bottom"};function Tl(e){return e.replace(/left|right|bottom|top/g,function(t){return lO[t]})}var uO={start:"end",end:"start"};function ry(e){return e.replace(/start|end/g,function(t){return uO[t]})}function Jp(e){var t=jn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function eh(e){return Ho(vi(e)).left+Jp(e).scrollLeft}function cO(e,t){var n=jn(e),r=vi(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;var l=M1();(l||!l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s+eh(e),y:u}}function dO(e){var t,n=vi(e),r=Jp(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=Ii(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ii(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+eh(e),u=-r.scrollTop;return Rr(i||n).direction==="rtl"&&(s+=Ii(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}function th(e){var t=Rr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function A1(e){return["html","body","#document"].indexOf(ci(e))>=0?e.ownerDocument.body:lr(e)&&th(e)?e:A1(Fu(e))}function Wa(e,t){var n;t===void 0&&(t=[]);var r=A1(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=jn(r),a=i?[o].concat(o.visualViewport||[],th(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Wa(Fu(a)))}function yf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fO(e,t){var n=Ho(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function iy(e,t,n){return t===_1?yf(cO(e,n)):Wi(t)?fO(t,n):yf(dO(vi(e)))}function pO(e){var t=Wa(Fu(e)),n=["absolute","fixed"].indexOf(Rr(e).position)>=0,r=n&&lr(e)?Es(e):e;return Wi(r)?t.filter(function(i){return Wi(i)&&$1(i,r)&&ci(i)!=="body"}):[]}function hO(e,t,n,r){var i=t==="clippingParents"?pO(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(u,l){var f=iy(e,l,r);return u.top=Ii(f.top,u.top),u.right=ru(f.right,u.right),u.bottom=ru(f.bottom,u.bottom),u.left=Ii(f.left,u.left),u},iy(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function L1(e){var t=e.reference,n=e.element,r=e.placement,i=r?sr(r):null,o=r?Wo(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,u;switch(i){case ln:u={x:a,y:t.y-n.height};break;case An:u={x:a,y:t.y+t.height};break;case Ln:u={x:t.x+t.width,y:s};break;case un:u={x:t.x-n.width,y:s};break;default:u={x:t.x,y:t.y}}var l=i?Xp(i):null;if(l!=null){var f=l==="y"?"height":"width";switch(o){case zo:u[l]=u[l]-(t[f]/2-n[f]/2);break;case ds:u[l]=u[l]+(t[f]/2-n[f]/2);break}}return u}function fs(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,u=s===void 0?AN:s,l=n.rootBoundary,f=l===void 0?_1:l,h=n.elementContext,p=h===void 0?Sa:h,y=n.altBoundary,C=y===void 0?!1:y,x=n.padding,N=x===void 0?0:x,w=F1(typeof N!="number"?N:D1(N,bs)),E=p===Sa?LN:Sa,b=e.rects.popper,T=e.elements[C?E:p],R=hO(Wi(T)?T:T.contextElement||vi(e.elements.popper),u,f,a),M=Ho(e.elements.reference),F=L1({reference:M,element:b,strategy:"absolute",placement:i}),A=yf(Object.assign({},b,F)),I=p===Sa?A:M,$={top:R.top-I.top+w.top,bottom:I.bottom-R.bottom+w.bottom,left:R.left-I.left+w.left,right:I.right-R.right+w.right},W=e.modifiersData.offset;if(p===Sa&&W){var Z=W[i];Object.keys($).forEach(function(G){var te=[Ln,An].indexOf(G)>=0?1:-1,Oe=[ln,An].indexOf(G)>=0?"y":"x";$[G]+=Z[Oe]*te})}return $}function mO(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,l=u===void 0?P1:u,f=Wo(r),h=f?s?ey:ey.filter(function(C){return Wo(C)===f}):bs,p=h.filter(function(C){return l.indexOf(C)>=0});p.length===0&&(p=h);var y=p.reduce(function(C,x){return C[x]=fs(e,{placement:x,boundary:i,rootBoundary:o,padding:a})[sr(x)],C},{});return Object.keys(y).sort(function(C,x){return y[C]-y[x]})}function vO(e){if(sr(e)===Zp)return[];var t=Tl(e);return[ry(e),t,ry(t)]}function yO(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,u=n.fallbackPlacements,l=n.padding,f=n.boundary,h=n.rootBoundary,p=n.altBoundary,y=n.flipVariations,C=y===void 0?!0:y,x=n.allowedAutoPlacements,N=t.options.placement,w=sr(N),E=w===N,b=u||(E||!C?[Tl(N)]:vO(N)),T=[N].concat(b).reduce(function(rt,ht){return rt.concat(sr(ht)===Zp?mO(t,{placement:ht,boundary:f,rootBoundary:h,padding:l,flipVariations:C,allowedAutoPlacements:x}):ht)},[]),R=t.rects.reference,M=t.rects.popper,F=new Map,A=!0,I=T[0],$=0;$=0,Oe=te?"width":"height",ge=fs(t,{placement:W,boundary:f,rootBoundary:h,altBoundary:p,padding:l}),xe=te?G?Ln:un:G?An:ln;R[Oe]>M[Oe]&&(xe=Tl(xe));var U=Tl(xe),re=[];if(o&&re.push(ge[Z]<=0),s&&re.push(ge[xe]<=0,ge[U]<=0),re.every(function(rt){return rt})){I=W,A=!1;break}F.set(W,re)}if(A)for(var ne=C?3:1,ke=function(ht){var ct=T.find(function(Ot){var Rt=F.get(Ot);if(Rt)return Rt.slice(0,ht).every(function(jt){return jt})});if(ct)return I=ct,"break"},_e=ne;_e>0;_e--){var Je=ke(_e);if(Je==="break")break}t.placement!==I&&(t.modifiersData[r]._skip=!0,t.placement=I,t.reset=!0)}}const gO={name:"flip",enabled:!0,phase:"main",fn:yO,requiresIfExists:["offset"],data:{_skip:!1}};function oy(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ay(e){return[ln,Ln,An,un].some(function(t){return e[t]>=0})}function wO(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=fs(t,{elementContext:"reference"}),s=fs(t,{altBoundary:!0}),u=oy(a,r),l=oy(s,i,o),f=ay(u),h=ay(l);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:f,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}const SO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:wO};function xO(e,t,n){var r=sr(e),i=[un,ln].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[un,Ln].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function CO(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=P1.reduce(function(f,h){return f[h]=xO(h,t.rects,o),f},{}),s=a[t.placement],u=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}const bO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:CO};function EO(e){var t=e.state,n=e.name;t.modifiersData[n]=L1({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const kO={name:"popperOffsets",enabled:!0,phase:"read",fn:EO,data:{}};function TO(e){return e==="x"?"y":"x"}function NO(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,u=n.boundary,l=n.rootBoundary,f=n.altBoundary,h=n.padding,p=n.tether,y=p===void 0?!0:p,C=n.tetherOffset,x=C===void 0?0:C,N=fs(t,{boundary:u,rootBoundary:l,padding:h,altBoundary:f}),w=sr(t.placement),E=Wo(t.placement),b=!E,T=Xp(w),R=TO(T),M=t.modifiersData.popperOffsets,F=t.rects.reference,A=t.rects.popper,I=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,$=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),W=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Z={x:0,y:0};if(M){if(o){var G,te=T==="y"?ln:un,Oe=T==="y"?An:Ln,ge=T==="y"?"height":"width",xe=M[T],U=xe+N[te],re=xe-N[Oe],ne=y?-A[ge]/2:0,ke=E===zo?F[ge]:A[ge],_e=E===zo?-A[ge]:-F[ge],Je=t.elements.arrow,rt=y&&Je?Qp(Je):{width:0,height:0},ht=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:I1(),ct=ht[te],Ot=ht[Oe],Rt=Ha(0,F[ge],rt[ge]),jt=b?F[ge]/2-ne-Rt-ct-$.mainAxis:ke-Rt-ct-$.mainAxis,er=b?-F[ge]/2+ne+Rt+Ot+$.mainAxis:_e+Rt+Ot+$.mainAxis,qt=t.elements.arrow&&Es(t.elements.arrow),Bn=qt?T==="y"?qt.clientTop||0:qt.clientLeft||0:0,tn=(G=W==null?void 0:W[T])!=null?G:0,Ge=xe+jt-tn-Bn,gi=xe+er-tn,Dr=Ha(y?ru(U,Ge):U,xe,y?Ii(re,gi):re);M[T]=Dr,Z[T]=Dr-xe}if(s){var tr,wi=T==="x"?ln:un,Si=T==="x"?An:Ln,D=M[R],ae=R==="y"?"height":"width",fe=D+N[wi],he=D-N[Si],Pe=[ln,un].indexOf(w)!==-1,le=(tr=W==null?void 0:W[R])!=null?tr:0,qe=Pe?fe:D-F[ae]-A[ae]-le+$.altAxis,It=Pe?D+F[ae]+A[ae]-le-$.altAxis:he,fr=y&&Pe?QN(qe,D,It):Ha(y?qe:fe,D,y?It:he);M[R]=fr,Z[R]=fr-D}t.modifiersData[r]=Z}}const OO={name:"preventOverflow",enabled:!0,phase:"main",fn:NO,requiresIfExists:["offset"]};function RO(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function _O(e){return e===jn(e)||!lr(e)?Jp(e):RO(e)}function PO(e){var t=e.getBoundingClientRect(),n=Vo(t.width)/e.offsetWidth||1,r=Vo(t.height)/e.offsetHeight||1;return n!==1||r!==1}function MO(e,t,n){n===void 0&&(n=!1);var r=lr(t),i=lr(t)&&PO(t),o=vi(t),a=Ho(e,i,n),s={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((ci(t)!=="body"||th(o))&&(s=_O(t)),lr(t)?(u=Ho(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):o&&(u.x=eh(o))),{x:a.left+s.scrollLeft-u.x,y:a.top+s.scrollTop-u.y,width:a.width,height:a.height}}function $O(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var u=t.get(s);u&&i(u)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function IO(e){var t=$O(e);return KN.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function FO(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function DO(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var sy={placement:"bottom",modifiers:[],strategy:"absolute"};function ly(){for(var e=arguments.length,t=new Array(e),n=0;n=0)&&(n[i]=e[i]);return n}const zO={name:"applyStyles",enabled:!1,phase:"afterWrite",fn:()=>{}},VO={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:e})=>()=>{const{reference:t,popper:n}=e.elements;if("removeAttribute"in t){const r=(t.getAttribute("aria-describedby")||"").split(",").filter(i=>i.trim()!==n.id);r.length?t.setAttribute("aria-describedby",r.join(",")):t.removeAttribute("aria-describedby")}},fn:({state:e})=>{var t;const{popper:n,reference:r}=e.elements,i=(t=n.getAttribute("role"))==null?void 0:t.toLowerCase();if(n.id&&i==="tooltip"&&"setAttribute"in r){const o=r.getAttribute("aria-describedby");if(o&&o.split(",").indexOf(n.id)!==-1)return;r.setAttribute("aria-describedby",o?`${o},${n.id}`:n.id)}}},HO=[];function WO(e,t,n={}){let{enabled:r=!0,placement:i="bottom",strategy:o="absolute",modifiers:a=HO}=n,s=BO(n,jO);const u=m.useRef(a),l=m.useRef(),f=m.useCallback(()=>{var N;(N=l.current)==null||N.update()},[]),h=m.useCallback(()=>{var N;(N=l.current)==null||N.forceUpdate()},[]),[p,y]=DN(m.useState({placement:i,update:f,forceUpdate:h,attributes:{},styles:{popper:{},arrow:{}}})),C=m.useMemo(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:N})=>{const w={},E={};Object.keys(N.elements).forEach(b=>{w[b]=N.styles[b],E[b]=N.attributes[b]}),y({state:N,styles:w,attributes:E,update:f,forceUpdate:h,placement:N.placement})}}),[f,h,y]),x=m.useMemo(()=>(Va(u.current,a)||(u.current=a),u.current),[a]);return m.useEffect(()=>{!l.current||!r||l.current.setOptions({placement:i,strategy:o,modifiers:[...x,C,zO]})},[o,i,C,r,x]),m.useEffect(()=>{if(!(!r||e==null||t==null))return l.current=LO(e,t,Object.assign({},s,{placement:i,strategy:o,modifiers:[...x,VO,C]})),()=>{l.current!=null&&(l.current.destroy(),l.current=void 0,y(N=>Object.assign({},N,{attributes:{},styles:{popper:{}}})))}},[r,e,t]),p}function iu(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}var UO=function(){},GO=UO;const qO=fi(GO),uy=()=>{};function KO(e){return e.button===0}function ZO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}const qc=e=>e&&("current"in e?e.current:e),cy={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function YO(e,t=uy,{disabled:n,clickTrigger:r="click"}={}){const i=m.useRef(!1),o=m.useRef(!1),a=m.useCallback(l=>{const f=qc(e);qO(!!f,"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=!f||ZO(l)||!KO(l)||!!iu(f,l.target)||o.current,o.current=!1},[e]),s=wt(l=>{const f=qc(e);f&&iu(f,l.target)&&(o.current=!0)}),u=wt(l=>{i.current||t(l)});m.useEffect(()=>{if(n||e==null)return;const l=Cs(qc(e));let f=(l.defaultView||window).event,h=null;cy[r]&&(h=Xr(l,cy[r],s,!0));const p=Xr(l,r,a,!0),y=Xr(l,r,x=>{if(x===f){f=void 0;return}u(x)});let C=[];return"ontouchstart"in l.documentElement&&(C=[].slice.call(l.body.children).map(x=>Xr(x,"mousemove",uy))),()=>{h==null||h(),p(),y(),C.forEach(x=>x())}},[e,n,r,a,s,u])}function QO(e){const t={};return Array.isArray(e)?(e==null||e.forEach(n=>{t[n.name]=n}),t):e||t}function XO(e={}){return Array.isArray(e)?e:Object.keys(e).map(t=>(e[t].name=t,e[t]))}function JO({enabled:e,enableEvents:t,placement:n,flip:r,offset:i,fixed:o,containerPadding:a,arrowElement:s,popperConfig:u={}}){var l,f,h,p,y;const C=QO(u.modifiers);return Object.assign({},u,{placement:n,enabled:e,strategy:o?"fixed":u.strategy,modifiers:XO(Object.assign({},C,{eventListeners:{enabled:t,options:(l=C.eventListeners)==null?void 0:l.options},preventOverflow:Object.assign({},C.preventOverflow,{options:a?Object.assign({padding:a},(f=C.preventOverflow)==null?void 0:f.options):(h=C.preventOverflow)==null?void 0:h.options}),offset:{options:Object.assign({offset:i},(p=C.offset)==null?void 0:p.options)},arrow:Object.assign({},C.arrow,{enabled:!!s,options:Object.assign({},(y=C.arrow)==null?void 0:y.options,{element:s})}),flip:Object.assign({enabled:!!r},C.flip)}))})}const eR=["children"];function tR(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}const nR=()=>{};function j1(e={}){const t=m.useContext(Iu),[n,r]=v1(),i=m.useRef(!1),{flip:o,offset:a,rootCloseEvent:s,fixed:u=!1,placement:l,popperConfig:f={},enableEventListeners:h=!0,usePopper:p=!!t}=e,y=(t==null?void 0:t.show)==null?!!e.show:t.show;y&&!i.current&&(i.current=!0);const C=M=>{t==null||t.toggle(!1,M)},{placement:x,setMenu:N,menuElement:w,toggleElement:E}=t||{},b=WO(E,w,JO({placement:l||x||"bottom-start",enabled:p,enableEvents:h??y,offset:a,flip:o,fixed:u,arrowElement:n,popperConfig:f})),T=Object.assign({ref:N||nR,"aria-labelledby":E==null?void 0:E.id},b.attributes.popper,{style:b.styles.popper}),R={show:y,placement:x,hasShown:i.current,toggle:t==null?void 0:t.toggle,popper:p?b:null,arrowProps:p?Object.assign({ref:r},b.attributes.arrow,{style:b.styles.arrow}):{}};return YO(w,C,{clickTrigger:s,disabled:!y}),[T,R]}const rR={usePopper:!0};function nh(e){let{children:t}=e,n=tR(e,eR);const[r,i]=j1(n);return c(Wt,{children:t(r,i)})}nh.displayName="DropdownMenu";nh.defaultProps=rR;const B1={prefix:String(Math.round(Math.random()*1e10)),current:0},z1=Kn.createContext(B1);let iR=!!(typeof window<"u"&&window.document&&window.document.createElement),Kc=new WeakMap;function oR(e=!1){let t=m.useContext(z1),n=m.useRef(null);if(n.current===null&&!e){var r,i;let o=(r=Kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||r===void 0||(i=r.ReactCurrentOwner)===null||i===void 0?void 0:i.current;if(o){let a=Kc.get(o);a==null?Kc.set(o,{id:t.current,state:o.memoizedState}):o.memoizedState!==a.state&&(t.current=a.id,Kc.delete(o))}n.current=++t.current}return n.current}function V1(e){let t=m.useContext(z1);t===B1&&!iR&&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=oR(!!e);return e||`react-aria${t.prefix}-${n}`}const H1=e=>{var t;return((t=e.getAttribute("role"))==null?void 0:t.toLowerCase())==="menu"},dy=()=>{};function W1(){const e=V1(),{show:t=!1,toggle:n=dy,setToggle:r,menuElement:i}=m.useContext(Iu)||{},o=m.useCallback(s=>{n(!t,s)},[t,n]),a={id:e,ref:r||dy,onClick:o,"aria-expanded":!!t};return i&&H1(i)&&(a["aria-haspopup"]=!0),[a,{show:t,toggle:n}]}function U1({children:e}){const[t,n]=W1();return c(Wt,{children:e(t,n)})}U1.displayName="DropdownToggle";const aR=m.createContext(null),Ui=(e,t=null)=>e!=null?String(e):t||null,_r=aR,G1=m.createContext(null);G1.displayName="NavContext";const rh=G1,sR="data-rr-ui-",lR="rrUi";function Xo(e){return`${sR}${e}`}function uR(e){return`${lR}${e}`}const cR=["eventKey","disabled","onClick","active","as"];function dR(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function q1({key:e,href:t,active:n,disabled:r,onClick:i}){const o=m.useContext(_r),a=m.useContext(rh),{activeKey:s}=a||{},u=Ui(e,t),l=n==null&&e!=null?Ui(s)===u:n;return[{onClick:wt(h=>{r||(i==null||i(h),o&&!h.isPropagationStopped()&&o(u,h))}),"aria-disabled":r||void 0,"aria-selected":l,[Xo("dropdown-item")]:""},{isActive:l}]}const K1=m.forwardRef((e,t)=>{let{eventKey:n,disabled:r,onClick:i,active:o,as:a=jp}=e,s=dR(e,cR);const[u]=q1({key:n,href:s.href,disabled:r,onClick:i,active:o});return c(a,Object.assign({},s,{ref:t},u))});K1.displayName="DropdownItem";const Z1=m.createContext(Yo?window:void 0);Z1.Provider;function ih(){return m.useContext(Z1)}function fy(){const e=R1(),t=m.useRef(null),n=m.useCallback(r=>{t.current=r,e()},[e]);return[t,n]}function ks({defaultShow:e,show:t,onSelect:n,onToggle:r,itemSelector:i=`* [${Xo("dropdown-item")}]`,focusFirstItemOnShow:o,placement:a="bottom-start",children:s}){const u=ih(),[l,f]=Fp(t,e,r),[h,p]=fy(),y=h.current,[C,x]=fy(),N=C.current,w=g1(l),E=m.useRef(null),b=m.useRef(!1),T=m.useContext(_r),R=m.useCallback((W,Z,G=Z==null?void 0:Z.type)=>{f(W,{originalEvent:Z,source:G})},[f]),M=wt((W,Z)=>{n==null||n(W,Z),R(!1,Z,"select"),Z.isPropagationStopped()||T==null||T(W,Z)}),F=m.useMemo(()=>({toggle:R,placement:a,show:l,menuElement:y,toggleElement:N,setMenu:p,setToggle:x}),[R,a,l,y,N,p,x]);y&&w&&!l&&(b.current=y.contains(y.ownerDocument.activeElement));const A=wt(()=>{N&&N.focus&&N.focus()}),I=wt(()=>{const W=E.current;let Z=o;if(Z==null&&(Z=h.current&&H1(h.current)?"keyboard":!1),Z===!1||Z==="keyboard"&&!/^key.+$/.test(W))return;const G=wr(h.current,i)[0];G&&G.focus&&G.focus()});m.useEffect(()=>{l?I():b.current&&(b.current=!1,A())},[l,b,A,I]),m.useEffect(()=>{E.current=null});const $=(W,Z)=>{if(!h.current)return null;const G=wr(h.current,i);let te=G.indexOf(W)+Z;return te=Math.max(0,Math.min(te,G.length)),G[te]};return KT(m.useCallback(()=>u.document,[u]),"keydown",W=>{var Z,G;const{key:te}=W,Oe=W.target,ge=(Z=h.current)==null?void 0:Z.contains(Oe),xe=(G=C.current)==null?void 0:G.contains(Oe);if(/input|textarea/i.test(Oe.tagName)&&(te===" "||te!=="Escape"&&ge||te==="Escape"&&Oe.type==="search")||!ge&&!xe||te==="Tab"&&(!h.current||!l))return;E.current=W.type;const re={originalEvent:W,source:W.type};switch(te){case"ArrowUp":{const ne=$(Oe,-1);ne&&ne.focus&&ne.focus(),W.preventDefault();return}case"ArrowDown":if(W.preventDefault(),!l)f(!0,re);else{const ne=$(Oe,1);ne&&ne.focus&&ne.focus()}return;case"Tab":Dp(Oe.ownerDocument,"keyup",ne=>{var ke;(ne.key==="Tab"&&!ne.target||!((ke=h.current)!=null&&ke.contains(ne.target)))&&f(!1,re)},{once:!0});break;case"Escape":te==="Escape"&&(W.preventDefault(),W.stopPropagation()),f(!1,re);break}}),c(_r.Provider,{value:M,children:c(Iu.Provider,{value:F,children:s})})}ks.displayName="Dropdown";ks.Menu=nh;ks.Toggle=U1;ks.Item=K1;const Y1=m.createContext({});Y1.displayName="DropdownContext";const Q1=Y1,X1=m.forwardRef(({bsPrefix:e,className:t,eventKey:n,disabled:r=!1,onClick:i,active:o,as:a=Pu,...s},u)=>{const l=$e(e,"dropdown-item"),[f,h]=q1({key:n,href:s.href,disabled:r,onClick:i,active:o});return c(a,{...s,...f,ref:u,className:be(t,l,h.isActive&&"active",r&&"disabled")})});X1.displayName="DropdownItem";const fR=X1,J1=m.createContext(null);J1.displayName="InputGroupContext";const oh=J1,eS=m.createContext(null);eS.displayName="NavbarContext";const tS=eS;function nS(e,t){return e}const ao=De.oneOf(["start","end"]),pR=De.oneOfType([ao,De.shape({sm:ao}),De.shape({md:ao}),De.shape({lg:ao}),De.shape({xl:ao}),De.shape({xxl:ao}),De.object]),hR={flip:!0};function rS(e,t,n){const r=n?"top-end":"top-start",i=n?"top-start":"top-end",o=n?"bottom-end":"bottom-start",a=n?"bottom-start":"bottom-end",s=n?"right-start":"left-start",u=n?"right-end":"left-end",l=n?"left-start":"right-start",f=n?"left-end":"right-end";let h=e?a:o;return t==="up"?h=e?i:r:t==="end"?h=e?f:l:t==="start"?h=e?u:s:t==="down-centered"?h="bottom":t==="up-centered"&&(h="top"),h}const ah=m.forwardRef(({bsPrefix:e,className:t,align:n,rootCloseEvent:r,flip:i,show:o,renderOnMount:a,as:s="div",popperConfig:u,variant:l,...f},h)=>{let p=!1;const y=m.useContext(tS),C=$e(e,"dropdown-menu"),{align:x,drop:N,isRTL:w}=m.useContext(Q1);n=n||x;const E=m.useContext(oh),b=[];if(n)if(typeof n=="object"){const W=Object.keys(n);if(W.length){const Z=W[0],G=n[Z];p=G==="start",b.push(`${C}-${Z}-${G}`)}}else n==="end"&&(p=!0);const T=rS(p,N,w),[R,{hasShown:M,popper:F,show:A,toggle:I}]=j1({flip:i,rootCloseEvent:r,show:o,usePopper:!y&&b.length===0,offset:[0,2],popperConfig:u,placement:T});if(R.ref=Yi(nS(h),R.ref),hf(()=>{A&&(F==null||F.update())},[A]),!M&&!a&&!E)return null;typeof s!="string"&&(R.show=A,R.close=()=>I==null?void 0:I(!1),R.align=n);let $=f.style;return F!=null&&F.placement&&($={...f.style,...R.style},f["x-placement"]=F.placement),c(s,{...f,...R,style:$,...(b.length||y)&&{"data-bs-popper":"static"},className:be(t,C,A&&"show",p&&`${C}-end`,l&&`${C}-${l}`,...b)})});ah.displayName="DropdownMenu";ah.defaultProps=hR;const iS=ah,oS=m.forwardRef(({bsPrefix:e,split:t,className:n,childBsPrefix:r,as:i=ee,...o},a)=>{const s=$e(e,"dropdown-toggle"),u=m.useContext(Iu);r!==void 0&&(o.bsPrefix=r);const[l]=W1();return l.ref=Yi(l.ref,nS(a)),c(i,{className:be(n,s,t&&`${s}-split`,(u==null?void 0:u.show)&&"show"),...l,...o})});oS.displayName="DropdownToggle";const aS=oS,mR=Nt("dropdown-header",{defaultProps:{role:"heading"}}),vR=Nt("dropdown-divider",{Component:"hr",defaultProps:{role:"separator"}}),yR=Nt("dropdown-item-text",{Component:"span"}),gR={navbar:!1,align:"start",autoClose:!0,drop:"down"},sh=m.forwardRef((e,t)=>{const{bsPrefix:n,drop:r,show:i,className:o,align:a,onSelect:s,onToggle:u,focusFirstItemOnShow:l,as:f="div",navbar:h,autoClose:p,...y}=xs(e,{show:"onToggle"}),C=m.useContext(oh),x=$e(n,"dropdown"),N=Yw(),w=F=>p===!1?F==="click":p==="inside"?F!=="rootClose":p==="outside"?F!=="select":!0,E=wt((F,A)=>{A.originalEvent.currentTarget===document&&(A.source!=="keydown"||A.originalEvent.key==="Escape")&&(A.source="rootClose"),w(A.source)&&(u==null||u(F,A))}),T=rS(a==="end",r,N),R=m.useMemo(()=>({align:a,drop:r,isRTL:N}),[a,r,N]),M={down:x,"down-centered":`${x}-center`,up:"dropup","up-centered":"dropup-center dropup",end:"dropend",start:"dropstart"};return c(Q1.Provider,{value:R,children:c(ks,{placement:T,show:i,onSelect:s,onToggle:E,focusFirstItemOnShow:l,itemSelector:`.${x}-item:not(.disabled):not(:disabled)`,children:C?y.children:c(f,{...y,ref:t,className:be(o,i&&"show",M[r])})})})});sh.displayName="Dropdown";sh.defaultProps=gR;const si=Object.assign(sh,{Toggle:aS,Menu:iS,Item:fR,ItemText:yR,Divider:vR,Header:mR}),wR={id:De.string,href:De.string,onClick:De.func,title:De.node.isRequired,disabled:De.bool,align:pR,menuRole:De.string,renderMenuOnMount:De.bool,rootCloseEvent:De.string,menuVariant:De.oneOf(["dark"]),flip:De.bool,bsPrefix:De.string,variant:De.string,size:De.string},lh=m.forwardRef(({title:e,children:t,bsPrefix:n,rootCloseEvent:r,variant:i,size:o,menuRole:a,renderMenuOnMount:s,disabled:u,href:l,id:f,menuVariant:h,flip:p,...y},C)=>g(si,{ref:C,...y,children:[c(aS,{id:f,href:l,size:o,variant:i,disabled:u,childBsPrefix:n,children:e}),c(iS,{role:a,renderOnMount:s,rootCloseEvent:r,variant:h,flip:p,children:t})]}));lh.displayName="DropdownButton";lh.propTypes=wR;const uh=lh,SR={type:De.string,tooltip:De.bool,as:De.elementType},ch=m.forwardRef(({as:e="div",className:t,type:n="valid",tooltip:r=!1,...i},o)=>c(e,{...i,ref:o,className:be(t,`${n}-${r?"tooltip":"feedback"}`)}));ch.displayName="Feedback";ch.propTypes=SR;const sS=ch,xR=m.createContext({}),Pr=xR,lS=m.forwardRef(({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:i=!1,isInvalid:o=!1,as:a="input",...s},u)=>{const{controlId:l}=m.useContext(Pr);return t=$e(t,"form-check-input"),c(a,{...s,ref:u,type:r,id:e||l,className:be(n,t,i&&"is-valid",o&&"is-invalid")})});lS.displayName="FormCheckInput";const Du=lS,uS=m.forwardRef(({bsPrefix:e,className:t,htmlFor:n,...r},i)=>{const{controlId:o}=m.useContext(Pr);return e=$e(e,"form-check-label"),c("label",{...r,ref:i,htmlFor:n||o,className:be(t,e)})});uS.displayName="FormCheckLabel";const gf=uS,cS=m.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:r=!1,reverse:i=!1,disabled:o=!1,isValid:a=!1,isInvalid:s=!1,feedbackTooltip:u=!1,feedback:l,feedbackType:f,className:h,style:p,title:y="",type:C="checkbox",label:x,children:N,as:w="input",...E},b)=>{t=$e(t,"form-check"),n=$e(n,"form-switch");const{controlId:T}=m.useContext(Pr),R=m.useMemo(()=>({controlId:e||T}),[T,e]),M=!N&&x!=null&&x!==!1||MN(N,gf),F=c(Du,{...E,type:C==="switch"?"checkbox":C,ref:b,isValid:a,isInvalid:s,disabled:o,as:w});return c(Pr.Provider,{value:R,children:c("div",{style:p,className:be(h,M&&t,r&&`${t}-inline`,i&&`${t}-reverse`,C==="switch"&&n),children:N||g(Wt,{children:[F,M&&c(gf,{title:y,children:x}),l&&c(sS,{type:f,tooltip:u,children:l})]})})})});cS.displayName="FormCheck";const ou=Object.assign(cS,{Input:Du,Label:gf}),dS=m.forwardRef(({bsPrefix:e,type:t,size:n,htmlSize:r,id:i,className:o,isValid:a=!1,isInvalid:s=!1,plaintext:u,readOnly:l,as:f="input",...h},p)=>{const{controlId:y}=m.useContext(Pr);e=$e(e,"form-control");let C;return u?C={[`${e}-plaintext`]:!0}:C={[e]:!0,[`${e}-${n}`]:n},c(f,{...h,type:t,size:r,ref:p,readOnly:l,id:i||y,className:be(o,C,a&&"is-valid",s&&"is-invalid",t==="color"&&`${e}-color`)})});dS.displayName="FormControl";const CR=Object.assign(dS,{Feedback:sS}),bR=Nt("form-floating"),fS=m.forwardRef(({controlId:e,as:t="div",...n},r)=>{const i=m.useMemo(()=>({controlId:e}),[e]);return c(Pr.Provider,{value:i,children:c(t,{...n,ref:r})})});fS.displayName="FormGroup";const pS=fS,ER={column:!1,visuallyHidden:!1},dh=m.forwardRef(({as:e="label",bsPrefix:t,column:n,visuallyHidden:r,className:i,htmlFor:o,...a},s)=>{const{controlId:u}=m.useContext(Pr);t=$e(t,"form-label");let l="col-form-label";typeof n=="string"&&(l=`${l} ${l}-${n}`);const f=be(i,t,r&&"visually-hidden",n&&l);return o=o||u,n?c(Xe,{ref:s,as:"label",className:f,htmlFor:o,...a}):c(e,{ref:s,className:f,htmlFor:o,...a})});dh.displayName="FormLabel";dh.defaultProps=ER;const kR=dh,hS=m.forwardRef(({bsPrefix:e,className:t,id:n,...r},i)=>{const{controlId:o}=m.useContext(Pr);return e=$e(e,"form-range"),c("input",{...r,type:"range",ref:i,className:be(t,e),id:n||o})});hS.displayName="FormRange";const TR=hS,mS=m.forwardRef(({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:i=!1,isInvalid:o=!1,id:a,...s},u)=>{const{controlId:l}=m.useContext(Pr);return e=$e(e,"form-select"),c("select",{...s,size:n,ref:u,className:be(r,e,t&&`${e}-${t}`,i&&"is-valid",o&&"is-invalid"),id:a||l})});mS.displayName="FormSelect";const NR=mS,vS=m.forwardRef(({bsPrefix:e,className:t,as:n="small",muted:r,...i},o)=>(e=$e(e,"form-text"),c(n,{...i,ref:o,className:be(t,e,r&&"text-muted")})));vS.displayName="FormText";const OR=vS,yS=m.forwardRef((e,t)=>c(ou,{...e,ref:t,type:"switch"}));yS.displayName="Switch";const RR=Object.assign(yS,{Input:ou.Input,Label:ou.Label}),gS=m.forwardRef(({bsPrefix:e,className:t,children:n,controlId:r,label:i,...o},a)=>(e=$e(e,"form-floating"),g(pS,{ref:a,className:be(t,e),controlId:r,...o,children:[n,c("label",{htmlFor:r,children:i})]})));gS.displayName="FloatingLabel";const _R=gS,PR={_ref:De.any,validated:De.bool,as:De.elementType},fh=m.forwardRef(({className:e,validated:t,as:n="form",...r},i)=>c(n,{...r,ref:i,className:be(e,t&&"was-validated")}));fh.displayName="Form";fh.propTypes=PR;const j=Object.assign(fh,{Group:pS,Control:CR,Floating:bR,Check:ou,Switch:RR,Label:kR,Text:OR,Range:TR,Select:NR,FloatingLabel:_R}),ph=Nt("input-group-text",{Component:"span"}),MR=e=>c(ph,{children:c(Du,{type:"checkbox",...e})}),$R=e=>c(ph,{children:c(Du,{type:"radio",...e})}),wS=m.forwardRef(({bsPrefix:e,size:t,hasValidation:n,className:r,as:i="div",...o},a)=>{e=$e(e,"input-group");const s=m.useMemo(()=>({}),[]);return c(oh.Provider,{value:s,children:c(i,{ref:a,...o,className:be(r,e,t&&`${e}-${t}`,n&&"has-validation")})})});wS.displayName="InputGroup";const Gt=Object.assign(wS,{Text:ph,Radio:$R,Checkbox:MR}),IR=m.createContext(null),Jo=IR,FR=["as","active","eventKey"];function DR(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function SS({key:e,onClick:t,active:n,id:r,role:i,disabled:o}){const a=m.useContext(_r),s=m.useContext(rh),u=m.useContext(Jo);let l=n;const f={role:i};if(s){!i&&s.role==="tablist"&&(f.role="tab");const h=s.getControllerId(e??null),p=s.getControlledId(e??null);f[Xo("event-key")]=e,f.id=h||r,l=n==null&&e!=null?s.activeKey===e:n,(l||!(u!=null&&u.unmountOnExit)&&!(u!=null&&u.mountOnEnter))&&(f["aria-controls"]=p)}return f.role==="tab"&&(f["aria-selected"]=l,l||(f.tabIndex=-1),o&&(f.tabIndex=-1,f["aria-disabled"]=!0)),f.onClick=wt(h=>{o||(t==null||t(h),e!=null&&a&&!h.isPropagationStopped()&&a(e,h))}),[f,{isActive:l}]}const xS=m.forwardRef((e,t)=>{let{as:n=jp,active:r,eventKey:i}=e,o=DR(e,FR);const[a,s]=SS(Object.assign({key:Ui(i,o.href),active:r},o));return a[Xo("active")]=s.isActive,c(n,Object.assign({},o,a,{ref:t}))});xS.displayName="NavItem";const AR=xS,LR=["as","onSelect","activeKey","role","onKeyDown"];function jR(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}const py=()=>{},hy=Xo("event-key"),CS=m.forwardRef((e,t)=>{let{as:n="div",onSelect:r,activeKey:i,role:o,onKeyDown:a}=e,s=jR(e,LR);const u=R1(),l=m.useRef(!1),f=m.useContext(_r),h=m.useContext(Jo);let p,y;h&&(o=o||"tablist",i=h.activeKey,p=h.getControlledId,y=h.getControllerId);const C=m.useRef(null),x=b=>{const T=C.current;if(!T)return null;const R=wr(T,`[${hy}]:not([aria-disabled=true])`),M=T.querySelector("[aria-selected=true]");if(!M||M!==document.activeElement)return null;const F=R.indexOf(M);if(F===-1)return null;let A=F+b;return A>=R.length&&(A=0),A<0&&(A=R.length-1),R[A]},N=(b,T)=>{b!=null&&(r==null||r(b,T),f==null||f(b,T))},w=b=>{if(a==null||a(b),!h)return;let T;switch(b.key){case"ArrowLeft":case"ArrowUp":T=x(-1);break;case"ArrowRight":case"ArrowDown":T=x(1);break;default:return}T&&(b.preventDefault(),N(T.dataset[uR("EventKey")]||null,b),l.current=!0,u())};m.useEffect(()=>{if(C.current&&l.current){const b=C.current.querySelector(`[${hy}][aria-selected=true]`);b==null||b.focus()}l.current=!1});const E=Yi(t,C);return c(_r.Provider,{value:N,children:c(rh.Provider,{value:{role:o,activeKey:Ui(i),getControlledId:p||py,getControllerId:y||py},children:c(n,Object.assign({},s,{onKeyDown:w,ref:E,role:o}))})})});CS.displayName="Nav";const BR=Object.assign(CS,{Item:AR});var il;function my(e){if((!il&&il!==0||e)&&Yo){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),il=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return il}function Zc(e){e===void 0&&(e=Cs());try{var t=e.activeElement;return!t||!t.nodeName?null:t}catch{return e.body}}function zR(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}const vy=Xo("modal-open");class VR{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:r=!1}={}){this.handleContainerOverflow=n,this.isRTL=r,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return zR(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",i=this.getElement();t.style={overflow:i.style.overflow,[r]:i.style[r]},t.scrollBarWidth&&(n[r]=`${parseInt(Er(i,r)||"0",10)+t.scrollBarWidth}px`),i.setAttribute(vy,""),Er(i,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(vy),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const hh=VR,Yc=(e,t)=>Yo?e==null?(t||Cs()).body:(typeof e=="function"&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function HR(e,t){const n=ih(),[r,i]=m.useState(()=>Yc(e,n==null?void 0:n.document));if(!r){const o=Yc(e);o&&i(o)}return m.useEffect(()=>{t&&r&&t(r)},[t,r]),m.useEffect(()=>{const o=Yc(e);o!==r&&i(o)},[e,r]),r}function mh({children:e,in:t,onExited:n,mountOnEnter:r,unmountOnExit:i}){const o=m.useRef(null),a=m.useRef(t),s=wt(n);m.useEffect(()=>{t?a.current=!0:s(o.current)},[t,s]);const u=Yi(o,e.ref),l=m.cloneElement(e,{ref:u});return t?l:i||!a.current&&r?null:l}function WR({in:e,onTransition:t}){const n=m.useRef(null),r=m.useRef(!0),i=wt(t);return hf(()=>{if(!n.current)return;let o=!1;return i({in:e,element:n.current,initial:r.current,isStale:()=>o}),()=>{o=!0}},[e,i]),hf(()=>(r.current=!1,()=>{r.current=!0}),[]),n}function UR({children:e,in:t,onExited:n,onEntered:r,transition:i}){const[o,a]=m.useState(!t);t&&o&&a(!1);const s=WR({in:!!t,onTransition:l=>{const f=()=>{l.isStale()||(l.in?r==null||r(l.element,l.initial):(a(!0),n==null||n(l.element)))};Promise.resolve(i(l)).then(f,h=>{throw l.in||a(!0),h})}}),u=Yi(s,e.ref);return o&&!t?null:m.cloneElement(e,{ref:u})}function yy(e,t,n){return e?c(e,Object.assign({},n)):t?c(UR,Object.assign({},n,{transition:t})):c(mh,Object.assign({},n))}const GR=["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 qR(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}let Qc;function KR(e){return Qc||(Qc=new hh({ownerDocument:e==null?void 0:e.document})),Qc}function ZR(e){const t=ih(),n=e||KR(t),r=m.useRef({dialog:null,backdrop:null});return Object.assign(r.current,{add:()=>n.add(r.current),remove:()=>n.remove(r.current),isTopModal:()=>n.isTopModal(r.current),setDialogRef:m.useCallback(i=>{r.current.dialog=i},[]),setBackdropRef:m.useCallback(i=>{r.current.backdrop=i},[])})}const bS=m.forwardRef((e,t)=>{let{show:n=!1,role:r="dialog",className:i,style:o,children:a,backdrop:s=!0,keyboard:u=!0,onBackdropClick:l,onEscapeKeyDown:f,transition:h,runTransition:p,backdropTransition:y,runBackdropTransition:C,autoFocus:x=!0,enforceFocus:N=!0,restoreFocus:w=!0,restoreFocusOptions:E,renderDialog:b,renderBackdrop:T=Ge=>c("div",Object.assign({},Ge)),manager:R,container:M,onShow:F,onHide:A=()=>{},onExit:I,onExited:$,onExiting:W,onEnter:Z,onEntering:G,onEntered:te}=e,Oe=qR(e,GR);const ge=HR(M),xe=ZR(R),U=y1(),re=g1(n),[ne,ke]=m.useState(!n),_e=m.useRef(null);m.useImperativeHandle(t,()=>xe,[xe]),Yo&&!re&&n&&(_e.current=Zc()),n&&ne&&ke(!1);const Je=wt(()=>{if(xe.add(),jt.current=Xr(document,"keydown",Ot),Rt.current=Xr(document,"focus",()=>setTimeout(ht),!0),F&&F(),x){const Ge=Zc(document);xe.dialog&&Ge&&!iu(xe.dialog,Ge)&&(_e.current=Ge,xe.dialog.focus())}}),rt=wt(()=>{if(xe.remove(),jt.current==null||jt.current(),Rt.current==null||Rt.current(),w){var Ge;(Ge=_e.current)==null||Ge.focus==null||Ge.focus(E),_e.current=null}});m.useEffect(()=>{!n||!ge||Je()},[n,ge,Je]),m.useEffect(()=>{ne&&rt()},[ne,rt]),N1(()=>{rt()});const ht=wt(()=>{if(!N||!U()||!xe.isTopModal())return;const Ge=Zc();xe.dialog&&Ge&&!iu(xe.dialog,Ge)&&xe.dialog.focus()}),ct=wt(Ge=>{Ge.target===Ge.currentTarget&&(l==null||l(Ge),s===!0&&A())}),Ot=wt(Ge=>{u&&Ge.keyCode===27&&xe.isTopModal()&&(f==null||f(Ge),Ge.defaultPrevented||A())}),Rt=m.useRef(),jt=m.useRef(),er=(...Ge)=>{ke(!0),$==null||$(...Ge)};if(!ge)return null;const qt=Object.assign({role:r,ref:xe.setDialogRef,"aria-modal":r==="dialog"?!0:void 0},Oe,{style:o,className:i,tabIndex:-1});let Bn=b?b(qt):c("div",Object.assign({},qt,{children:m.cloneElement(a,{role:"document"})}));Bn=yy(h,p,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:I,onExiting:W,onExited:er,onEnter:Z,onEntering:G,onEntered:te,children:Bn});let tn=null;return s&&(tn=T({ref:xe.setBackdropRef,onClick:ct}),tn=yy(y,C,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:tn})),c(Wt,{children:Eo.createPortal(g(Wt,{children:[tn,Bn]}),ge)})});bS.displayName="Modal";const YR=Object.assign(bS,{Manager:hh});function QR(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function XR(e,t){e.classList?e.classList.add(t):QR(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function gy(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function JR(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=gy(e.className,t):e.setAttribute("class",gy(e.className&&e.className.baseVal||"",t))}const so={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class e_ extends hh{adjustAndStore(t,n,r){const i=n.style[t];n.dataset[t]=i,Er(n,{[t]:`${parseFloat(Er(n,t))+r}px`})}restore(t,n){const r=n.dataset[t];r!==void 0&&(delete n.dataset[t],Er(n,{[t]:r}))}setContainerStyle(t){super.setContainerStyle(t);const n=this.getElement();if(XR(n,"modal-open"),!t.scrollBarWidth)return;const r=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";wr(n,so.FIXED_CONTENT).forEach(o=>this.adjustAndStore(r,o,t.scrollBarWidth)),wr(n,so.STICKY_CONTENT).forEach(o=>this.adjustAndStore(i,o,-t.scrollBarWidth)),wr(n,so.NAVBAR_TOGGLER).forEach(o=>this.adjustAndStore(i,o,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const n=this.getElement();JR(n,"modal-open");const r=this.isRTL?"paddingLeft":"paddingRight",i=this.isRTL?"marginLeft":"marginRight";wr(n,so.FIXED_CONTENT).forEach(o=>this.restore(r,o)),wr(n,so.STICKY_CONTENT).forEach(o=>this.restore(i,o)),wr(n,so.NAVBAR_TOGGLER).forEach(o=>this.restore(i,o))}}let Xc;function t_(e){return Xc||(Xc=new e_(e)),Xc}const n_=Nt("modal-body"),r_=m.createContext({onHide(){}}),ES=r_,kS=m.forwardRef(({bsPrefix:e,className:t,contentClassName:n,centered:r,size:i,fullscreen:o,children:a,scrollable:s,...u},l)=>{e=$e(e,"modal");const f=`${e}-dialog`,h=typeof o=="string"?`${e}-fullscreen-${o}`:`${e}-fullscreen`;return c("div",{...u,ref:l,className:be(f,t,i&&`${e}-${i}`,r&&`${f}-centered`,s&&`${f}-scrollable`,o&&h),children:c("div",{className:be(`${e}-content`,n),children:a})})});kS.displayName="ModalDialog";const TS=kS,i_=Nt("modal-footer"),o_={closeLabel:"Close",closeButton:!1},NS=m.forwardRef(({closeLabel:e,closeVariant:t,closeButton:n,onHide:r,children:i,...o},a)=>{const s=m.useContext(ES),u=wt(()=>{s==null||s.onHide(),r==null||r()});return g("div",{ref:a,...o,children:[i,n&&c(zp,{"aria-label":e,variant:t,onClick:u})]})});NS.defaultProps=o_;const a_=NS,s_={closeLabel:"Close",closeButton:!1},vh=m.forwardRef(({bsPrefix:e,className:t,...n},r)=>(e=$e(e,"modal-header"),c(a_,{ref:r,...n,className:be(t,e)})));vh.displayName="ModalHeader";vh.defaultProps=s_;const l_=vh,u_=$u("h4"),c_=Nt("modal-title",{Component:u_}),d_={show:!1,backdrop:!0,keyboard:!0,autoFocus:!0,enforceFocus:!0,restoreFocus:!0,animation:!0,dialogAs:TS};function f_(e){return c(Qo,{...e,timeout:null})}function p_(e){return c(Qo,{...e,timeout:null})}const yh=m.forwardRef(({bsPrefix:e,className:t,style:n,dialogClassName:r,contentClassName:i,children:o,dialogAs:a,"aria-labelledby":s,"aria-describedby":u,"aria-label":l,show:f,animation:h,backdrop:p,keyboard:y,onEscapeKeyDown:C,onShow:x,onHide:N,container:w,autoFocus:E,enforceFocus:b,restoreFocus:T,restoreFocusOptions:R,onEntered:M,onExit:F,onExiting:A,onEnter:I,onEntering:$,onExited:W,backdropClassName:Z,manager:G,...te},Oe)=>{const[ge,xe]=m.useState({}),[U,re]=m.useState(!1),ne=m.useRef(!1),ke=m.useRef(!1),_e=m.useRef(null),[Je,rt]=v1(),ht=Yi(Oe,rt),ct=wt(N),Ot=Yw();e=$e(e,"modal");const Rt=m.useMemo(()=>({onHide:ct}),[ct]);function jt(){return G||t_({isRTL:Ot})}function er(le){if(!Yo)return;const qe=jt().getScrollbarWidth()>0,It=le.scrollHeight>Cs(le).documentElement.clientHeight;xe({paddingRight:qe&&!It?my():void 0,paddingLeft:!qe&&It?my():void 0})}const qt=wt(()=>{Je&&er(Je.dialog)});N1(()=>{pf(window,"resize",qt),_e.current==null||_e.current()});const Bn=()=>{ne.current=!0},tn=le=>{ne.current&&Je&&le.target===Je.dialog&&(ke.current=!0),ne.current=!1},Ge=()=>{re(!0),_e.current=Jw(Je.dialog,()=>{re(!1)})},gi=le=>{le.target===le.currentTarget&&Ge()},Dr=le=>{if(p==="static"){gi(le);return}if(ke.current||le.target!==le.currentTarget){ke.current=!1;return}N==null||N()},tr=le=>{y?C==null||C(le):(le.preventDefault(),p==="static"&&Ge())},wi=(le,qe)=>{le&&er(le),I==null||I(le,qe)},Si=le=>{_e.current==null||_e.current(),F==null||F(le)},D=(le,qe)=>{$==null||$(le,qe),Dp(window,"resize",qt)},ae=le=>{le&&(le.style.display=""),W==null||W(le),pf(window,"resize",qt)},fe=m.useCallback(le=>c("div",{...le,className:be(`${e}-backdrop`,Z,!h&&"show")}),[h,Z,e]),he={...n,...ge};he.display="block";const Pe=le=>c("div",{role:"dialog",...le,style:he,className:be(t,e,U&&`${e}-static`,!h&&"show"),onClick:p?Dr:void 0,onMouseUp:tn,"aria-label":l,"aria-labelledby":s,"aria-describedby":u,children:c(a,{...te,onMouseDown:Bn,className:r,contentClassName:i,children:o})});return c(ES.Provider,{value:Rt,children:c(YR,{show:f,ref:ht,backdrop:p,container:w,keyboard:!0,autoFocus:E,enforceFocus:b,restoreFocus:T,restoreFocusOptions:R,onEscapeKeyDown:tr,onShow:x,onHide:N,onEnter:wi,onEntering:D,onEntered:M,onExit:Si,onExiting:A,onExited:ae,manager:jt(),transition:h?f_:void 0,backdropTransition:h?p_:void 0,renderBackdrop:fe,renderDialog:Pe})})});yh.displayName="Modal";yh.defaultProps=d_;const z=Object.assign(yh,{Body:n_,Header:l_,Title:c_,Footer:i_,Dialog:TS,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150});var wy={exports:{}},wf={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){function i(a,s,u,l,f,h){var p=l||"<>",y=h||u;if(s[u]==null)return a?new Error("Required "+f+" `"+y+"` was not specified "+("in `"+p+"`.")):null;for(var C=arguments.length,x=Array(C>6?C-6:0),N=6;N{e=$e(e,"nav-link");const[s,u]=SS({key:Ui(i,o.href),active:r,...o});return c(n,{...o,...s,ref:a,className:be(t,e,o.disabled&&"disabled",u.isActive&&"active")})});gh.displayName="NavLink";gh.defaultProps=m_;const RS=gh,v_={justify:!1,fill:!1},wh=m.forwardRef((e,t)=>{const{as:n="div",bsPrefix:r,variant:i,fill:o,justify:a,navbar:s,navbarScroll:u,className:l,activeKey:f,...h}=xs(e,{activeKey:"onSelect"}),p=$e(r,"nav");let y,C,x=!1;const N=m.useContext(tS),w=m.useContext(E1);return N?(y=N.bsPrefix,x=s??!0):w&&({cardHeaderBsPrefix:C}=w),c(BR,{as:n,ref:t,activeKey:f,className:be(l,{[p]:!x,[`${y}-nav`]:x,[`${y}-nav-scroll`]:x&&u,[`${C}-${i}`]:!!C,[`${p}-${i}`]:!!i,[`${p}-fill`]:o,[`${p}-justified`]:a}),...h})});wh.displayName="Nav";wh.defaultProps=v_;const y_=Object.assign(wh,{Item:OS,Link:RS}),Sy=1e3,g_={min:0,max:100,animated:!1,isChild:!1,visuallyHidden:!1,striped:!1};function w_(e,t,n){const r=(e-t)/(n-t)*100;return Math.round(r*Sy)/Sy}function xy({min:e,now:t,max:n,label:r,visuallyHidden:i,striped:o,animated:a,className:s,style:u,variant:l,bsPrefix:f,...h},p){return c("div",{ref:p,...h,role:"progressbar",className:be(s,`${f}-bar`,{[`bg-${l}`]:l,[`${f}-bar-animated`]:a,[`${f}-bar-striped`]:a||o}),style:{width:`${w_(t,e,n)}%`,...u},"aria-valuenow":t,"aria-valuemin":e,"aria-valuemax":n,children:i?c("span",{className:"visually-hidden",children:r}):r})}const Sh=m.forwardRef(({isChild:e,...t},n)=>{if(t.bsPrefix=$e(t.bsPrefix,"progress"),e)return xy(t,n);const{min:r,now:i,max:o,label:a,visuallyHidden:s,striped:u,animated:l,bsPrefix:f,variant:h,className:p,children:y,...C}=t;return c("div",{ref:n,...C,className:be(p,f),children:y?mf(y,x=>m.cloneElement(x,{isChild:!0})):xy({min:r,now:i,max:o,label:a,visuallyHidden:s,striped:u,animated:l,bsPrefix:f,variant:h},n)})});Sh.displayName="ProgressBar";Sh.defaultProps=g_;const xa=Sh,_S=m.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},i)=>{const o=$e(e,"row"),a=Kw(),s=Zw(),u=`${o}-cols`,l=[];return a.forEach(f=>{const h=r[f];delete r[f];let p;h!=null&&typeof h=="object"?{cols:p}=h:p=h;const y=f!==s?`-${f}`:"";p!=null&&l.push(`${u}${y}-${p}`)}),c(n,{ref:i,...r,className:be(t,o,...l)})});_S.displayName="Row";const ur=_S,S_=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],x_=["activeKey","getControlledId","getControllerId"],C_=["as"];function Sf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function PS(e){let{active:t,eventKey:n,mountOnEnter:r,transition:i,unmountOnExit:o,role:a="tabpanel",onEnter:s,onEntering:u,onEntered:l,onExit:f,onExiting:h,onExited:p}=e,y=Sf(e,S_);const C=m.useContext(Jo);if(!C)return[Object.assign({},y,{role:a}),{eventKey:n,isActive:t,mountOnEnter:r,transition:i,unmountOnExit:o,onEnter:s,onEntering:u,onEntered:l,onExit:f,onExiting:h,onExited:p}];const{activeKey:x,getControlledId:N,getControllerId:w}=C,E=Sf(C,x_),b=Ui(n);return[Object.assign({},y,{role:a,id:N(n),"aria-labelledby":w(n)}),{eventKey:n,isActive:t==null&&b!=null?Ui(x)===b:t,transition:i||E.transition,mountOnEnter:r??E.mountOnEnter,unmountOnExit:o??E.unmountOnExit,onEnter:s,onEntering:u,onEntered:l,onExit:f,onExiting:h,onExited:p}]}const MS=m.forwardRef((e,t)=>{let{as:n="div"}=e,r=Sf(e,C_);const[i,{isActive:o,onEnter:a,onEntering:s,onEntered:u,onExit:l,onExiting:f,onExited:h,mountOnEnter:p,unmountOnExit:y,transition:C=mh}]=PS(r);return c(Jo.Provider,{value:null,children:c(_r.Provider,{value:null,children:c(C,{in:o,onEnter:a,onEntering:s,onEntered:u,onExit:l,onExiting:f,onExited:h,mountOnEnter:p,unmountOnExit:y,children:c(n,Object.assign({},i,{ref:t,hidden:!o,"aria-hidden":!o}))})})})});MS.displayName="TabPanel";const $S=e=>{const{id:t,generateChildId:n,onSelect:r,activeKey:i,defaultActiveKey:o,transition:a,mountOnEnter:s,unmountOnExit:u,children:l}=e,[f,h]=Fp(i,o,r),p=V1(t),y=m.useMemo(()=>n||((x,N)=>p?`${p}-${N}-${x}`:null),[p,n]),C=m.useMemo(()=>({onSelect:h,activeKey:f,transition:a,mountOnEnter:s||!1,unmountOnExit:u||!1,getControlledId:x=>y(x,"tabpane"),getControllerId:x=>y(x,"tab")}),[h,f,a,s,u,y]);return c(Jo.Provider,{value:C,children:c(_r.Provider,{value:h||null,children:l})})};$S.Panel=MS;const IS=$S;function xh(e){return typeof e=="boolean"?e?Qo:mh:e}const FS=({transition:e,...t})=>c(IS,{...t,transition:xh(e)});FS.displayName="TabContainer";const b_=FS,DS=Nt("tab-content"),AS=m.forwardRef(({bsPrefix:e,transition:t,...n},r)=>{const[{className:i,as:o="div",...a},{isActive:s,onEnter:u,onEntering:l,onEntered:f,onExit:h,onExiting:p,onExited:y,mountOnEnter:C,unmountOnExit:x,transition:N=Qo}]=PS({...n,transition:xh(t)}),w=$e(e,"tab-pane");return c(Jo.Provider,{value:null,children:c(_r.Provider,{value:null,children:c(N,{in:s,onEnter:u,onEntering:l,onEntered:f,onExit:h,onExiting:p,onExited:y,mountOnEnter:C,unmountOnExit:x,children:c(o,{...a,ref:r,className:be(i,w,s&&"active")})})})})});AS.displayName="TabPane";const LS=AS,E_={eventKey:De.oneOfType([De.string,De.number]),title:De.node.isRequired,disabled:De.bool,tabClassName:De.string,tabAttrs:De.object},jS=()=>{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")};jS.propTypes=E_;const k_=Object.assign(jS,{Container:b_,Content:DS,Pane:LS}),T_=m.forwardRef(({bsPrefix:e,className:t,striped:n,bordered:r,borderless:i,hover:o,size:a,variant:s,responsive:u,...l},f)=>{const h=$e(e,"table"),p=be(t,h,s&&`${h}-${s}`,a&&`${h}-${a}`,n&&`${h}-${typeof n=="string"?`striped-${n}`:"striped"}`,r&&`${h}-bordered`,i&&`${h}-borderless`,o&&`${h}-hover`),y=c("table",{...l,className:p,ref:f});if(u){let C=`${h}-responsive`;return typeof u=="string"&&(C=`${C}-${u}`),c("div",{className:C,children:y})}return y}),ea=T_,N_={variant:"tabs",mountOnEnter:!1,unmountOnExit:!1};function O_(e){let t;return PN(e,n=>{t==null&&(t=n.props.eventKey)}),t}function R_(e){const{title:t,eventKey:n,disabled:r,tabClassName:i,tabAttrs:o,id:a}=e.props;return t==null?null:c(OS,{as:"li",role:"presentation",children:c(RS,{as:"button",type:"button",eventKey:n,disabled:r,id:a,className:i,...o,children:t})})}const Ch=e=>{const{id:t,onSelect:n,transition:r,mountOnEnter:i,unmountOnExit:o,children:a,activeKey:s=O_(a),...u}=xs(e,{activeKey:"onSelect"});return g(IS,{id:t,activeKey:s,onSelect:n,transition:xh(r),mountOnEnter:i,unmountOnExit:o,children:[c(y_,{...u,role:"tablist",as:"ul",children:mf(a,R_)}),c(DS,{children:mf(a,l=>{const f={...l.props};return delete f.title,delete f.disabled,delete f.tabClassName,delete f.tabAttrs,c(LS,{...f})})})]})};Ch.defaultProps=N_;Ch.displayName="Tabs";const __=Ch,P_="https://jg-dealerships/",Ne=async(e,t,n)=>{const r=async(i,o)=>{try{const s=await(await fetch((n||P_)+e,{method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},body:t?JSON.stringify(t):void 0})).json();typeof s=="object"&&s.error&&o({error:!0,reason:s.error}),i(s)}catch(a){o(a)}};return await new Promise(r)},BS=m.createContext({event:!1,setEvent:()=>!1,config:{},locale:{},onCloseModal:()=>!1}),M_=({children:e})=>{const[t,n]=m.useState({}),[r,i]=m.useState({}),[o,a]=m.useState({});m.useEffect(()=>{const u=({data:l})=>{l.source||(l.type==="hide"?n(f=>({...f,type:!1})):(n(l||{}),i(l.config||{}),a(l.locale||{})))};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[]);const s=async()=>{n({...t,type:!1}),await Ne("close")};return c(BS.Provider,{value:{event:t,setEvent:n,config:r,locale:o,onCloseModal:s},children:e})},ye=()=>m.useContext(BS),$_=()=>{const e=async n=>{await Ne(`veh-${n}`)},t=async()=>{await Ne("change-cam-view")};return g(x1,{"aria-label":"Basic example",className:"vehicle-camera-btns",children:[c(ee,{variant:"dark",size:"lg",onClick:()=>e("left"),children:c("i",{className:"bi-arrow-left"})}),c(ee,{variant:"dark",size:"lg",onClick:()=>t(),children:c("i",{className:"bi-camera-reels"})}),c(ee,{variant:"dark",size:"lg",onClick:()=>e("right"),children:c("i",{className:"bi-arrow-right"})})]})},Le=(e,t)=>{try{return e==null?void 0:e.toLocaleString(t==null?void 0:t.NumberAndDateFormat,{style:"currency",currency:t.Currency,maximumFractionDigits:0})}catch{return"InvalidLocale"}},Cy=["personal","society"],Jc=["cash","bank"],I_=({show:e,onHide:t,vehicle:n,activeColor:r,calcFinancePayment:i,toggleFinanceBreakdown:o,onPurchase:a})=>{var Z,G;const{event:s,setEvent:u,config:l,locale:f,onCloseModal:h}=ye(),[p,y]=m.useState(Cy[0]),[C,x]=m.useState(Jc),[N,w]=m.useState(Jc[0]),[E,b]=m.useState(""),[T,R]=m.useState(!1),[M,F]=m.useState(!1);m.useEffect(()=>{var Oe,ge,xe;const te=(xe=(ge=(Oe=s.config)==null?void 0:Oe.DealershipLocations)==null?void 0:ge[s.dealershipId])==null?void 0:xe.paymentOptions;te?(x(te),w(te[0])):w(Jc[0])},[s.config,s.dealershipId]),m.useEffect(()=>{R(!1)},[p]);const A=async te=>{var Oe;if(te.preventDefault(),F(!0),!$())return!1;try{await Ne("purchase-vehicle",{purchaseType:p,society:E,societyType:(Oe=I(E))==null?void 0:Oe.type,paymentMethod:N,finance:!!T,dealership:s.dealershipId,vehicle:n.spawn_code,color:r}),a()}catch(ge){console.log(JSON.stringify(ge))}F(!1),h()},I=te=>{var Oe;return(Oe=s.societies)==null?void 0:Oe.find(({name:ge})=>ge===te)},$=()=>{var Oe,ge;let te=n.price;if(T){if(N!=="bank")return!1;te=n.price*(1+l.FinanceInterest)*l.FinanceDownPayment}return N==="societyFund"?((Oe=I(E))==null?void 0:Oe.balance)>=te:(((ge=s.playerBalances)==null?void 0:ge[N])||0)>=te},W=async()=>{try{const te=await Ne("get-player-balances",s.dealershipId);if(!te)return;u(Oe=>({...Oe,playerBalances:te}))}catch{console.error("Could not refresh balances.")}};return c(z,{show:e,onHide:()=>t(),centered:!0,style:{zIndex:9999},children:g(j,{onSubmit:A,children:[g(z.Header,{className:"d-block",children:[c("div",{children:f.purchaseVehicle}),g(z.Title,{as:"h5",children:[n.brand," ",n.model]})]}),g(z.Body,{children:[s.jgGaragesRunning&&c(x1,{"aria-label":"Purchase Type",className:"vehicle-purchase-modal mb-3",children:Cy.map(te=>c(ee,{variant:p===te?"primary":"dark",onClick:()=>y(te),children:f[`${te}Purchase`]},te))}),p==="society"?g(j.Group,{className:"mb-3",children:[c(j.Label,{children:f.purchaseFor}),g(j.Select,{value:E,onChange:te=>b(te.target.value),required:!0,children:[c("option",{value:"",disabled:!0,children:f.selectSociety}),(Z=s.societies)==null?void 0:Z.map(({name:te,label:Oe},ge)=>c("option",{value:te,children:Oe},ge))]})]}):s.financeEnabled&&g(j.Group,{className:"mb-3",children:[c(j.Label,{children:f.financing}),c(j.Check,{label:f.payInFull,name:"payment-type",type:"radio",id:"payment-infull",checked:!T,onChange:te=>R(!te.target.checked)}),c(j.Check,{label:c("div",{className:"d-flex align-items-center",children:c("span",{className:"me-2",children:(G=f.financeOverPayments)==null?void 0:G.replace("%{value}",l.FinancePayments)})}),name:"payment-type",type:"radio",id:"payment-finance",checked:T,onChange:te=>R(te.target.checked)})]}),(p!=="society"||E)&&g("div",{children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:f.paymentSource}),c("div",{children:C.map((te,Oe)=>{var xe,U;if(te!=="bank"&&T||te==="societyFund"&&(p!=="society"||!E))return null;let ge=0;return te==="societyFund"?ge=(xe=I(E))==null?void 0:xe.balance:s.playerBalances&&(ge=((U=s.playerBalances)==null?void 0:U[te])||0),c(j.Check,{label:g("div",{className:"d-flex align-items-center",children:[c("span",{className:"me-2",children:f[te]||te}),c(vn,{bg:"secondary",text:"dark",children:Le(ge,l)}),c(ee,{variant:"dark",onClick:W,size:"sm",className:"ms-2 p-0 pe-1 ps-1",children:c("i",{className:"bi-arrow-clockwise"})})]}),name:"payment-method",type:"radio",id:`payment-method-${te}`,checked:N===te,onChange:re=>w(te)},Oe)})})]}),T&&g(Bo,{variant:"warning",children:[c("i",{className:"bi-exclamation-triangle-fill me-2"}),f.prePurchaseRepoWarning]})]})]}),c(z.Footer,{className:"d-block",children:T?g(ur,{children:[g(Xe,{className:"p-0",children:[g("p",{className:"mb-1",children:[f.payToday,":"]}),c("h3",{children:Le(n.price*(1+l.FinanceInterest)*l.FinanceDownPayment,l)})]}),g(Xe,{className:"p-0",children:[g("p",{className:"mb-0",children:[`${f.financeThen} ${l.FinancePayments} ${f.paymentsOf} `,c("strong",{className:"text-white",children:Le(i(),l)}),` (${f.every} ${l.FinancePaymentInterval} ${f.hours})`]}),c(ee,{variant:"link",className:"p-0",style:{fontSize:12},onClick:()=>o(),children:f.seeFullBreakdown})]})]}):g("div",{children:[g("p",{className:"text-muted mb-1",children:[f.totalPayable,":"]}),c("h3",{children:Le(n.price,l)})]})}),g(z.Footer,{className:"d-flex justify-content-between",children:[c(ee,{variant:"success",type:"submit",disabled:!$()||M,children:$()?f.purchase:f.notEnoughMoney}),c(ee,{variant:"dark",onClick:()=>t(),children:f.cancel})]})]})})},F_=({show:e,onHide:t,vehiclePrice:n,calcFinancePayment:r})=>{const{config:i,locale:o}=ye();return g(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:o.financeBreakdown})}),g(z.Body,{children:[c("table",{className:"financing-breakdown-table",children:g("tbody",{children:[g("tr",{children:[g("td",{children:[o.initialPayment,":"]}),c("td",{children:c("strong",{children:Le(n*(1+i.FinanceInterest)*i.FinanceDownPayment,i)})})]}),g("tr",{children:[g("td",{children:[o.payments,":"]}),c("td",{children:g("strong",{children:[Le(r(),i)," ",o.every," ",i.FinancePaymentInterval," ",o.hours]})})]}),g("tr",{children:[g("td",{children:[o.length,":"]}),c("td",{children:g("strong",{children:[i.FinancePayments," ",o.payments]})})]}),g("tr",{children:[g("td",{children:[o.interest,":"]}),c("td",{children:g("strong",{children:[i.FinanceInterest*100,"%"]})})]}),g("tr",{children:[g("td",{children:[o.totalPayable,":"]}),c("td",{children:c("strong",{children:Le(n*(1+i.FinanceInterest),i)})})]})]})}),g(Bo,{variant:"warning",className:"mt-3 mb-0",children:[c("i",{className:"bi-exclamation-triangle-fill me-2"}),o.prePurchaseRepoWarning]})]})]})},D_=({vehicle:e,setActiveVehicle:t})=>{const{event:n,config:r,locale:i}=ye(),[o,a]=m.useState(!1),[s,u]=m.useState(!1),[l,f]=m.useState(1),[h,p]=m.useState(0),[y,C]=m.useState(0),[x,N]=m.useState(0),[w,E]=m.useState(0),[b,T]=m.useState(0),[R,M]=m.useState(!1);m.useEffect(()=>{(async()=>{if(r.HideVehicleStats)return;const I=await Ne("get-model-stats",{vehicle:e.spawn_code});p(I==null?void 0:I.brake),C(I==null?void 0:I.handling),N(I==null?void 0:I.topSpeed),E(I==null?void 0:I.power),T(I==null?void 0:I.torque)})()},[e.spawn_code]),m.useEffect(()=>{var I;f((I=r.VehicleColourOptions)!=null&&I[parseInt(n.defaultColor)]?parseInt(n.defaultColor):1)},[n.defaultColor]),m.useEffect(()=>{try{Ne("change-color",{color:l})}catch{}},[l]);const F=async()=>{M(!0),await Ne("test-drive",{dealershipId:n.dealershipId,vehicle:e.spawn_code,color:l}),M(!1)},A=()=>{const I=e.price*(1+r.FinanceInterest);return(I-I*r.FinanceDownPayment)/r.FinancePayments};return g(Wt,{children:[g(z.Dialog,{size:"sm",className:"modal vehicle-info-modal",scrollable:!0,children:[g(z.Header,{className:"vehicle-model-brand-stock",children:[c("span",{className:"text-muted",children:e.brand}),c("h4",{children:e.model}),c(vn,{bg:e.stock>0?"success":"danger",text:"white",pill:!0,children:n.shopType==="owned"&&(e.stock>0?i.inStock:i.outOfStock)})]}),g(z.Body,{children:[!r.HideVehicleStats&&g("div",{className:"vehicle-stats",children:[g("div",{className:"vehicle-stat",children:[c("small",{className:"text-muted",children:i.handling}),c(xa,{variant:"primary",now:y/10*100,label:y==null?void 0:y.toFixed(1)})]}),g("div",{className:"vehicle-stat",children:[c("small",{className:"text-muted",children:i.topSpeed}),c(xa,{variant:"primary",now:x/150*100,label:`${x}${r.SpeedUnit||"mph"}`})]}),g("div",{className:"vehicle-stat",children:[c("small",{className:"text-muted",children:i.power}),c(xa,{variant:"primary",now:w/500*100,label:`${w}HP`})]}),g("div",{className:"vehicle-stat",children:[c("small",{className:"text-muted",children:i.torque}),c(xa,{variant:"primary",now:b/500*100,label:`${b}Nm`})]}),g("div",{className:"vehicle-stat",children:[c("small",{className:"text-muted",children:i.brake}),c(xa,{now:h/1*100,variant:"primary",label:h==null?void 0:h.toFixed(1)})]})]}),g("div",{className:"vehicle-pricing",children:[c("h3",{children:Le(e.price,r)}),n.financeEnabled&&e.price>0&&g("p",{className:"vehicle-financing-text text-muted",children:[g("span",{children:[i.financingAvailable,": "]}),g("strong",{children:[r.FinancePayments," ",i.paymentsOf," ",Le(A(),r),c(ee,{variant:"link",className:"text-decoration-none",size:"sm",onClick:()=>u(!0),children:c("i",{className:"bi-question-circle-fill"})})]})]})]}),c(F_,{show:s,onHide:()=>u(!1),vehiclePrice:e.price,calcFinancePayment:A}),c("hr",{className:"mb-3"}),c("div",{className:"vehicle-colors",children:(r.VehicleColourOptions||[]).map(({hex:I},$)=>c("button",{className:`color ${l==$+1?"active":""}`,onClick:()=>f($+1),style:{backgroundImage:` linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4)), linear-gradient(${I}, ${I}) `}},$))})]}),(n.enablePurchase||n.enableTestDrive)&&g(z.Footer,{className:"d-flex justify-content-between",children:[n.enablePurchase&&c(ee,{variant:"success",onClick:()=>a(!0),disabled:n.shopType==="owned"&&!e.stock,children:n.shopType==="self-service"||e.stock>0?i.purchase:i.outOfStock}),n.enableTestDrive&&c(ee,{variant:"secondary",onClick:F,disabled:R,children:i.testDrive})]})]}),c(I_,{show:o,onHide:()=>a(!1),vehicle:e,activeColor:l,calcFinancePayment:A,toggleFinanceBreakdown:()=>u(!0),onPurchase:()=>t(void 0)})]})},ta=()=>c(vn,{bg:"secondary",text:"dark",children:"JG Scripts"}),A_="/web/dist/assets/loading-f9361a1d.gif",na=()=>c("div",{className:"p-5 text-center",children:c("img",{src:A_,width:40})}),L_=({show:e})=>(ye(),e?c("div",{className:"loading-model",children:c(na,{})}):null),j_=({activeVehicle:e,setActiveVehicle:t})=>{const n=m.useRef(null),{event:r,config:i,locale:o}=ye(),a={[o.sortByName]:(T,R)=>`${T.brand} ${T.model}`.localeCompare(`${R.brand} ${R.model}`),[o.sortByAvailability]:(T,R)=>R.stock-T.stock,[o.sortByCheapest]:(T,R)=>T.price-R.price,[o.sortByMostExpensive]:(T,R)=>R.price-T.price},[s,u]=m.useState(""),[l,f]=m.useState(Object.keys(a)[0]),[h,p]=m.useState(!1),[y,C]=m.useState([]),[x,N]=m.useState([]),[w,E]=m.useState(!1);m.useEffect(()=>{r.defaultVehicle&&u(r.defaultVehicle)},[r.defaultVehicle]),m.useEffect(()=>{(async()=>{if(e){try{E(!0),await Ne("switch-vehicle",{spawnCode:e.spawn_code})}catch{}E(!1)}})()},[e]),m.useEffect(()=>{var T,R;s.length>0?C(r.vehicles):C(h?(T=r.vehicles)==null?void 0:T.filter(M=>h&&M.category===h):[]),(R=n.current)==null||R.scrollTo(0,0)},[s.length>0,h]),m.useEffect(()=>{N(y.filter(({brand:T,model:R,spawn_code:M})=>{const F=s.toLocaleLowerCase().split(" ").filter(A=>A).map(A=>A.trim());return F.filter(A=>`${T} ${R} ${M}`.toLocaleLowerCase().includes(A)).length===F.length}).sort(a[l]))},[y,s,l]);const b=()=>{p(!1)};return g(Wt,{children:[c(L_,{show:w}),g(z.Dialog,{scrollable:!0,size:"sm",className:"modal vehicles-list-modal",children:[g(z.Header,{className:"position-relative d-flex justify-content-center gap-3",children:[h&&!s&&c("button",{className:"showroom-back-btn",onClick:b,children:c("i",{className:"bi-arrow-left"})}),c(z.Title,{as:"h5",children:s.length?o.search:h?i.Categories[h]:o.allCategories}),!!s.length&&g(ee,{size:"sm",className:"ms-auto",variant:"outline-light",onClick:()=>u(""),children:[c("i",{className:"bi-x me-1"})," ",o.clear]})]}),g(z.Body,{className:"showroom-modal-body",ref:n,children:[c("div",{className:"search-and-filter p-3",children:g(Gt,{children:[c(j.Control,{type:"text",placeholder:o.search,value:s,onChange:T=>u(T.target.value)}),c(uh,{variant:"dark",title:c("i",{className:"bi-filter"}),id:"input-group-dropdown-2",align:"end",menuVariant:"dark",children:Object.keys(a).map((T,R)=>c(si.Item,{onClick:()=>f(T),active:l===T,children:T},R))})]})}),!h&&!s?c("div",{className:"p-3",children:r.categories.map(T=>g(Ue,{className:"showroom-category-btn mb-3",bg:"darker",onClick:()=>p(T),children:[c(Ue.Body,{className:"h5 mb-0 text-white",children:i.Categories[T]}),c(Ue.Footer,{children:g("small",{className:"text-muted",children:[r.vehicles.filter(R=>R.category===T).length," ",o.vehiclesCount]})})]},T))}):c("div",{children:x.length?x.map((T,R)=>c(B_,{vehicle:T,setActiveVehicle:t,isActive:(e==null?void 0:e.spawn_code)===T.spawn_code},R)):c("div",{className:"showroom-vehicle",children:o.noVehicles})})]}),!i.HideWatermark&&c(z.Footer,{className:"d-flex justify-content-between text-muted",children:c(ta,{})})]})]})},B_=({vehicle:e,setActiveVehicle:t,isActive:n})=>{const{event:r,locale:i,config:o}=ye(),a=m.useMemo(()=>` url(https://cfx-nui-jg-advancedgarages/vehicle_images/${e.spawn_code}.png), url(https://cfx-nui-jg-dealerships/vehicle_images/${e.spawn_code}.png), url(https://docs.fivem.net/vehicles/${e.spawn_code}.webp) `,[e]);return g("button",{className:`showroom-vehicle ${n?"active":""}`,onClick:()=>t(e),children:[g("div",{className:"showroom-vehicle-name-stock",children:[g("div",{children:[c("small",{className:"text-muted",children:e.brand}),c("p",{children:e.model})]}),c(vn,{bg:e.stock>0?"success":"danger",text:"white",pill:!0,children:r.shopType==="owned"&&(e.stock>0?i.inStock:i.outOfStock)})]}),g("div",{className:"d-flex align-items-end justify-content-between",children:[c("h4",{children:Le(e.price,o)}),c("div",{children:o.ShowVehicleImages&&c("div",{className:"vehicle-image flex-shrink-0",style:{backgroundImage:a}})})]})]})},z_=()=>{const{event:e,onCloseModal:t,locale:n}=ye(),[r,i]=m.useState();m.useEffect(()=>{if(e.defaultVehicle){const a=e.vehicles.find(({spawn_code:s})=>s===e.defaultVehicle);i(a)}},[e.type,e.defaultVehicle]);const o=async()=>{t(),i(void 0),await Ne("exit-showroom")};return e.type!=="showShowroom"?null:g("div",{className:"vehicle-showroom",children:[c("div",{className:"showroom-column",children:g("div",{className:"showroom-column-vehicles-list",children:[g(ee,{size:"lg",variant:"dark",className:"leave-showroom-btn",onClick:o,children:[c("i",{className:"bi-box-arrow-left"}),"   ",n.leaveShowroom]}),c(j_,{activeVehicle:r,setActiveVehicle:i})]})}),c($_,{}),c("div",{className:"showroom-column",children:r?c(D_,{vehicle:r,setActiveVehicle:i}):c("div",{})})]})};class Qi extends Error{}class V_ extends Qi{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class H_ extends Qi{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class W_ extends Qi{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Pa extends Qi{}class zS extends Qi{constructor(t){super(`Invalid unit ${t}`)}}class _n extends Qi{}class jr extends Qi{constructor(){super("Zone is an abstract class")}}const oe="numeric",Jn="short",yn="long",au={year:oe,month:oe,day:oe},VS={year:oe,month:Jn,day:oe},U_={year:oe,month:Jn,day:oe,weekday:Jn},HS={year:oe,month:yn,day:oe},WS={year:oe,month:yn,day:oe,weekday:yn},US={hour:oe,minute:oe},GS={hour:oe,minute:oe,second:oe},qS={hour:oe,minute:oe,second:oe,timeZoneName:Jn},KS={hour:oe,minute:oe,second:oe,timeZoneName:yn},ZS={hour:oe,minute:oe,hourCycle:"h23"},YS={hour:oe,minute:oe,second:oe,hourCycle:"h23"},QS={hour:oe,minute:oe,second:oe,hourCycle:"h23",timeZoneName:Jn},XS={hour:oe,minute:oe,second:oe,hourCycle:"h23",timeZoneName:yn},JS={year:oe,month:oe,day:oe,hour:oe,minute:oe},ex={year:oe,month:oe,day:oe,hour:oe,minute:oe,second:oe},tx={year:oe,month:Jn,day:oe,hour:oe,minute:oe},nx={year:oe,month:Jn,day:oe,hour:oe,minute:oe,second:oe},G_={year:oe,month:Jn,day:oe,weekday:Jn,hour:oe,minute:oe},rx={year:oe,month:yn,day:oe,hour:oe,minute:oe,timeZoneName:Jn},ix={year:oe,month:yn,day:oe,hour:oe,minute:oe,second:oe,timeZoneName:Jn},ox={year:oe,month:yn,day:oe,weekday:yn,hour:oe,minute:oe,timeZoneName:yn},ax={year:oe,month:yn,day:oe,weekday:yn,hour:oe,minute:oe,second:oe,timeZoneName:yn};class Ts{get type(){throw new jr}get name(){throw new jr}get ianaName(){return this.name}get isUniversal(){throw new jr}offsetName(t,n){throw new jr}formatOffset(t,n){throw new jr}offset(t){throw new jr}equals(t){throw new jr}get isValid(){throw new jr}}let ed=null;class Au extends Ts{static get instance(){return ed===null&&(ed=new Au),ed}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return lx(t,n,r)}formatOffset(t,n){return Ga(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Nl={};function q_(e){return Nl[e]||(Nl[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Nl[e]}const K_={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Z_(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,a,s,u,l,f]=r;return[a,i,o,s,u,l,f]}function Y_(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i=0?C:1e3+C,(p-y)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let by={};function Q_(e,t={}){const n=JSON.stringify([e,t]);let r=by[n];return r||(r=new Intl.ListFormat(e,t),by[n]=r),r}let xf={};function Cf(e,t={}){const n=JSON.stringify([e,t]);let r=xf[n];return r||(r=new Intl.DateTimeFormat(e,t),xf[n]=r),r}let bf={};function X_(e,t={}){const n=JSON.stringify([e,t]);let r=bf[n];return r||(r=new Intl.NumberFormat(e,t),bf[n]=r),r}let Ef={};function J_(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=Ef[i];return o||(o=new Intl.RelativeTimeFormat(e,t),Ef[i]=o),o}let Ma=null;function eP(){return Ma||(Ma=new Intl.DateTimeFormat().resolvedOptions().locale,Ma)}function tP(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,i;try{r=Cf(e).resolvedOptions(),i=e}catch{const u=e.substring(0,n);r=Cf(u).resolvedOptions(),i=u}const{numberingSystem:o,calendar:a}=r;return[i,o,a]}}function nP(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function rP(e){const t=[];for(let n=1;n<=12;n++){const r=de.utc(2016,n,1);t.push(e(r))}return t}function iP(e){const t=[];for(let n=1;n<=7;n++){const r=de.utc(2016,11,13+n);t.push(e(r))}return t}function al(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function oP(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class aP{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...a}=r;if(!n||Object.keys(a).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=X_(t,s)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):Eh(t,3);return bt(n,this.padTo)}}}class sP{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const a=-1*(t.offset/60),s=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;t.offset!==0&&Mr.create(s).valid?(i=s,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const o={...this.opts};o.timeZone=o.timeZone||i,this.dtf=Cf(n,o)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class lP{constructor(t,n,r){this.opts={style:"long",...r},!n&&sx()&&(this.rtf=J_(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):kP(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class at{static fromOpts(t){return at.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||Ct.defaultLocale,a=o||(i?"en-US":eP()),s=n||Ct.defaultNumberingSystem,u=r||Ct.defaultOutputCalendar;return new at(a,s,u,o)}static resetCache(){Ma=null,xf={},bf={},Ef={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return at.create(t,n,r)}constructor(t,n,r,i){const[o,a,s]=tP(t);this.locale=o,this.numberingSystem=n||a||null,this.outputCalendar=r||s||null,this.intl=nP(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=oP(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:at.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return al(this,t,r,dx,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=rP(a=>this.extract(a,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return al(this,t,r,hx,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=iP(a=>this.extract(a,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return al(this,void 0,t,()=>mx,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[de.utc(2016,11,13,9),de.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return al(this,t,n,vx,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[de.utc(-40,1,1),de.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),a=o.find(s=>s.type.toLowerCase()===r);return a?a.value:null}numberFormatter(t={}){return new aP(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new sP(t,this.intl,n)}relFormatter(t={}){return new lP(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Q_(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let td=null;class Qt extends Ts{static get utcInstance(){return td===null&&(td=new Qt(0)),td}static instance(t){return t===0?Qt.utcInstance:new Qt(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Qt(ju(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ga(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ga(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Ga(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class uP extends Ts{constructor(t){super(),this.zoneName=t}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 Zr(e,t){if(ze(e)||e===null)return t;if(e instanceof Ts)return e;if(cP(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Au.instance:n==="utc"||n==="gmt"?Qt.utcInstance:Qt.parseSpecifier(n)||Mr.create(e)}else return Fi(e)?Qt.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new uP(e)}let Ey=()=>Date.now(),ky="system",Ty=null,Ny=null,Oy=null,Ry=60,_y;class Ct{static get now(){return Ey}static set now(t){Ey=t}static set defaultZone(t){ky=t}static get defaultZone(){return Zr(ky,Au.instance)}static get defaultLocale(){return Ty}static set defaultLocale(t){Ty=t}static get defaultNumberingSystem(){return Ny}static set defaultNumberingSystem(t){Ny=t}static get defaultOutputCalendar(){return Oy}static set defaultOutputCalendar(t){Oy=t}static get twoDigitCutoffYear(){return Ry}static set twoDigitCutoffYear(t){Ry=t%100}static get throwOnInvalid(){return _y}static set throwOnInvalid(t){_y=t}static resetCaches(){at.resetCache(),Mr.resetCache()}}function ze(e){return typeof e>"u"}function Fi(e){return typeof e=="number"}function Lu(e){return typeof e=="number"&&e%1===0}function cP(e){return typeof e=="string"}function dP(e){return Object.prototype.toString.call(e)==="[object Date]"}function sx(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function fP(e){return Array.isArray(e)?e:[e]}function Py(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function pP(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Uo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Cr(e,t,n){return Lu(e)&&e>=t&&e<=n}function hP(e,t){return e-t*Math.floor(e/t)}function bt(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Ur(e){if(!(ze(e)||e===null||e===""))return parseInt(e,10)}function xi(e){if(!(ze(e)||e===null||e===""))return parseFloat(e)}function bh(e){if(!(ze(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Eh(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Ns(e){return e%4===0&&(e%100!==0||e%400===0)}function Ua(e){return Ns(e)?366:365}function su(e,t){const n=hP(t-1,12)+1,r=e+(t-n)/12;return n===2?Ns(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function kh(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function lu(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function kf(e){return e>99?e:e>Ct.twoDigitCutoffYear?1900+e:2e3+e}function lx(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const a={timeZoneName:t,...o},s=new Intl.DateTimeFormat(n,a).formatToParts(i).find(u=>u.type.toLowerCase()==="timezonename");return s?s.value:null}function ju(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function ux(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new _n(`Invalid unit value ${e}`);return t}function uu(e,t){const n={};for(const r in e)if(Uo(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=ux(i)}return n}function Ga(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${bt(n,2)}:${bt(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${bt(n,2)}${bt(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Bu(e){return pP(e,["hour","minute","second","millisecond"])}const mP=["January","February","March","April","May","June","July","August","September","October","November","December"],cx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vP=["J","F","M","A","M","J","J","A","S","O","N","D"];function dx(e){switch(e){case"narrow":return[...vP];case"short":return[...cx];case"long":return[...mP];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 fx=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],px=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yP=["M","T","W","T","F","S","S"];function hx(e){switch(e){case"narrow":return[...yP];case"short":return[...px];case"long":return[...fx];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const mx=["AM","PM"],gP=["Before Christ","Anno Domini"],wP=["BC","AD"],SP=["B","A"];function vx(e){switch(e){case"narrow":return[...SP];case"short":return[...wP];case"long":return[...gP];default:return null}}function xP(e){return mx[e.hour<12?0:1]}function CP(e,t){return hx(t)[e.weekday-1]}function bP(e,t){return dx(t)[e.month-1]}function EP(e,t){return vx(t)[e.year<0?0:1]}function kP(e,t,n="always",r=!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."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const h=e==="days";switch(t){case 1:return h?"tomorrow":`next ${i[e][0]}`;case-1:return h?"yesterday":`last ${i[e][0]}`;case 0:return h?"today":`this ${i[e][0]}`}}const a=Object.is(t,-0)||t<0,s=Math.abs(t),u=s===1,l=i[e],f=r?u?l[1]:l[2]||l[1]:u?i[e][0]:e;return a?`${s} ${f} ago`:`in ${s} ${f}`}function My(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const TP={D:au,DD:VS,DDD:HS,DDDD:WS,t:US,tt:GS,ttt:qS,tttt:KS,T:ZS,TT:YS,TTT:QS,TTTT:XS,f:JS,ff:tx,fff:rx,ffff:ox,F:ex,FF:nx,FFF:ix,FFFF:ax};class Ht{static create(t,n={}){return new Ht(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let a=0;a0&&o.push({literal:i||/^\s+$/.test(r),val:r}),n=null,r="",i=!i):i||s===n?r+=s:(r.length>0&&o.push({literal:/^\s+$/.test(r),val:r}),r=s,n=s)}return r.length>0&&o.push({literal:i||/^\s+$/.test(r),val:r}),o}static macroTokenToFormatOpts(t){return TP[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}formatInterval(t,n={}){return this.loc.dtFormatter(t.start,{...this.opts,...n}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return bt(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(y,C)=>this.loc.extract(t,y,C),a=y=>t.isOffsetFixed&&t.offset===0&&y.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,y.format):"",s=()=>r?xP(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(y,C)=>r?bP(t,y):o(C?{month:y}:{month:y,day:"numeric"},"month"),l=(y,C)=>r?CP(t,y):o(C?{weekday:y}:{weekday:y,month:"long",day:"numeric"},"weekday"),f=y=>{const C=Ht.macroTokenToFormatOpts(y);return C?this.formatWithSystemDefault(t,C):y},h=y=>r?EP(t,y):o({era:y},"era"),p=y=>{switch(y){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(y)}};return My(Ht.parseFormat(n),p)}formatDurationFromString(t,n){const r=u=>{switch(u[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=u=>l=>{const f=r(l);return f?this.num(u.get(f),l.length):l},o=Ht.parseFormat(n),a=o.reduce((u,{literal:l,val:f})=>l?u:u.concat(f),[]),s=t.shiftTo(...a.map(r).filter(u=>u));return My(o,i(s))}}class Zn{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const yx=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ra(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function ia(...e){return t=>e.reduce(([n,r,i],o)=>{const[a,s,u]=o(t,i);return[{...n,...a},s||r,u]},[{},null,1]).slice(0,2)}function oa(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function gx(...e){return(t,n)=>{const r={};let i;for(i=0;iy!==void 0&&(C||y&&f)?-y:y;return[{years:p(xi(n)),months:p(xi(r)),weeks:p(xi(i)),days:p(xi(o)),hours:p(xi(a)),minutes:p(xi(s)),seconds:p(xi(u),u==="-0"),milliseconds:p(bh(l),h)}]}const jP={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 Oh(e,t,n,r,i,o,a){const s={year:t.length===2?kf(Ur(t)):Ur(t),month:cx.indexOf(n)+1,day:Ur(r),hour:Ur(i),minute:Ur(o)};return a&&(s.second=Ur(a)),e&&(s.weekday=e.length>3?fx.indexOf(e)+1:px.indexOf(e)+1),s}const BP=/^(?:(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 zP(e){const[,t,n,r,i,o,a,s,u,l,f,h]=e,p=Oh(t,i,r,n,o,a,s);let y;return u?y=jP[u]:l?y=0:y=ju(f,h),[p,new Qt(y)]}function VP(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const HP=/^(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$/,WP=/^(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$/,UP=/^(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 $y(e){const[,t,n,r,i,o,a,s]=e;return[Oh(t,i,r,n,o,a,s),Qt.utcInstance]}function GP(e){const[,t,n,r,i,o,a,s]=e;return[Oh(t,s,n,r,i,o,a),Qt.utcInstance]}const qP=ra(OP,Nh),KP=ra(RP,Nh),ZP=ra(_P,Nh),YP=ra(Sx),Cx=ia(FP,aa,Os,Rs),QP=ia(PP,aa,Os,Rs),XP=ia(MP,aa,Os,Rs),JP=ia(aa,Os,Rs);function e2(e){return oa(e,[qP,Cx],[KP,QP],[ZP,XP],[YP,JP])}function t2(e){return oa(VP(e),[BP,zP])}function n2(e){return oa(e,[HP,$y],[WP,$y],[UP,GP])}function r2(e){return oa(e,[AP,LP])}const i2=ia(aa);function o2(e){return oa(e,[DP,i2])}const a2=ra($P,IP),s2=ra(xx),l2=ia(aa,Os,Rs);function u2(e){return oa(e,[a2,Cx],[s2,l2])}const c2="Invalid Duration",bx={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}},d2={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},...bx},En=146097/400,lo=146097/4800,f2={years:{quarters:4,months:12,weeks:En/7,days:En,hours:En*24,minutes:En*24*60,seconds:En*24*60*60,milliseconds:En*24*60*60*1e3},quarters:{months:3,weeks:En/28,days:En/4,hours:En*24/4,minutes:En*24*60/4,seconds:En*24*60*60/4,milliseconds:En*24*60*60*1e3/4},months:{weeks:lo/7,days:lo,hours:lo*24,minutes:lo*24*60,seconds:lo*24*60*60,milliseconds:lo*24*60*60*1e3},...bx},ki=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],p2=ki.slice(0).reverse();function Br(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new He(r)}function h2(e){return e<0?Math.floor(e):Math.ceil(e)}function Ex(e,t,n,r,i){const o=e[i][n],a=t[n]/o,s=Math.sign(a)===Math.sign(r[i]),u=!s&&r[i]!==0&&Math.abs(a)<=1?h2(a):Math.trunc(a);r[i]+=u,t[n]-=u*o}function m2(e,t){p2.reduce((n,r)=>ze(t[r])?n:(n&&Ex(e,t,n,t,r),r),null)}function v2(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class He{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?f2:d2;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||at.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return He.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new _n(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new He({values:uu(t,He.normalizeUnit),loc:at.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Fi(t))return He.fromMillis(t);if(He.isDuration(t))return t;if(typeof t=="object")return He.fromObject(t);throw new _n(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=r2(t);return r?He.fromObject(r,n):He.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=o2(t);return r?He.fromObject(r,n):He.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new _n("need to specify a reason the Duration is invalid");const r=t instanceof Zn?t:new Zn(t,n);if(Ct.throwOnInvalid)throw new W_(r);return new He({invalid:r})}static normalizeUnit(t){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"}[t&&t.toLowerCase()];if(!n)throw new zS(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Ht.create(this.loc,r).formatDurationFromString(this,t):c2}toHuman(t={}){const n=ki.map(r=>{const i=this.values[r];return ze(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Eh(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=He.fromDurationLike(t),r={};for(const i of ki)(Uo(n.values,i)||Uo(this.values,i))&&(r[i]=n.get(i)+this.get(i));return Br(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=He.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=ux(t(this.values[r],r));return Br(this,{values:n},!0)}get(t){return this[He.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...uu(t,He.normalizeUnit)};return Br(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const a={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:i,conversionAccuracy:r};return Br(this,a)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return m2(this.matrix,t),Br(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=v2(this.normalize().shiftToAll().toObject());return Br(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(a=>He.normalizeUnit(a));const n={},r={},i=this.toObject();let o;for(const a of ki)if(t.indexOf(a)>=0){o=a;let s=0;for(const l in r)s+=this.matrix[l][a]*r[l],r[l]=0;Fi(i[a])&&(s+=i[a]);const u=Math.trunc(s);n[a]=u,r[a]=(s*1e3-u*1e3)/1e3;for(const l in i)ki.indexOf(l)>ki.indexOf(a)&&Ex(this.matrix,i,l,n,a)}else Fi(i[a])&&(r[a]=i[a]);for(const a in r)r[a]!==0&&(n[o]+=a===o?r[a]:r[a]/this.matrix[o][a]);return Br(this,{values:n},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Br(this,{values:t},!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(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of ki)if(!n(this.values[r],t.values[r]))return!1;return!0}}const uo="Invalid Interval";function y2(e,t){return!e||!e.isValid?vt.invalid("missing or invalid start"):!t||!t.isValid?vt.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?vt.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Ea).filter(a=>this.contains(a)).sort(),r=[];let{s:i}=this,o=0;for(;i+this.e?this.e:a;r.push(vt.fromDateTimes(i,s)),i=s,o+=1}return r}splitBy(t){const n=He.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const a=[];for(;ru*i));o=+s>+this.e?this.e:s,a.push(vt.fromDateTimes(r,o)),r=o,i+=1}return a}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e=r?null:vt.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.st.e?this.e:t.e;return vt.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],a)=>o?o.overlaps(a)||o.abutsStart(a)?[i,o.union(a)]:[i.concat([o]),a]:[i,a],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...o),s=a.sort((u,l)=>u.time-l.time);for(const u of s)r+=u.type==="s"?1:-1,r===1?n=u.time:(n&&+n!=+u.time&&i.push(vt.fromDateTimes(n,u.time)),n=null);return vt.merge(i)}difference(...t){return vt.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:uo}toLocaleString(t=au,n={}){return this.isValid?Ht.create(this.s.loc.clone(n),t).formatInterval(this):uo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:uo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:uo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:uo}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:uo}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):He.invalid(this.invalidReason)}mapEndpoints(t){return vt.fromDateTimes(t(this.s),t(this.e))}}class sl{static hasDST(t=Ct.defaultZone){const n=de.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Mr.isValidZone(t)}static normalizeZone(t){return Zr(t,Ct.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||at.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||at.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||at.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||at.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return at.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return at.create(n,null,"gregory").eras(t)}static features(){return{relative:sx()}}}function Iy(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(He.fromMillis(r).as("days"))}function g2(e,t,n){const r=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{const f=Iy(u,l);return(f-f%7)/7}],["days",Iy]],i={},o=e;let a,s;for(const[u,l]of r)n.indexOf(u)>=0&&(a=u,i[u]=l(e,t),s=o.plus(i),s>t?(i[u]--,e=o.plus(i)):e=s);return[e,i,s,a]}function w2(e,t,n,r){let[i,o,a,s]=g2(e,t,n);const u=t-i,l=n.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);l.length===0&&(a0?He.fromMillis(u,r).shiftTo(...l).plus(f):f}const Rh={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Fy={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]},S2=Rh.hanidec.replace(/[\[|\]]/g,"").split("");function x2(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=o&&r<=a&&(t+=r-o)}}return parseInt(t,10)}else return t}function Vn({numberingSystem:e},t=""){return new RegExp(`${Rh[e||"latn"]}${t}`)}const C2="missing Intl.DateTimeFormat.formatToParts support";function Ke(e,t=n=>n){return{regex:e,deser:([n])=>t(x2(n))}}const b2=String.fromCharCode(160),kx=`[ ${b2}]`,Tx=new RegExp(kx,"g");function E2(e){return e.replace(/\./g,"\\.?").replace(Tx,kx)}function Dy(e){return e.replace(/\./g,"").replace(Tx," ").toLowerCase()}function Hn(e,t){return e===null?null:{regex:RegExp(e.map(E2).join("|")),deser:([n])=>e.findIndex(r=>Dy(n)===Dy(r))+t}}function Ay(e,t){return{regex:e,deser:([,n,r])=>ju(n,r),groups:t}}function ll(e){return{regex:e,deser:([t])=>t}}function k2(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function T2(e,t){const n=Vn(t),r=Vn(t,"{2}"),i=Vn(t,"{3}"),o=Vn(t,"{4}"),a=Vn(t,"{6}"),s=Vn(t,"{1,2}"),u=Vn(t,"{1,3}"),l=Vn(t,"{1,6}"),f=Vn(t,"{1,9}"),h=Vn(t,"{2,4}"),p=Vn(t,"{4,6}"),y=N=>({regex:RegExp(k2(N.val)),deser:([w])=>w,literal:!0}),x=(N=>{if(e.literal)return y(N);switch(N.val){case"G":return Hn(t.eras("short",!1),0);case"GG":return Hn(t.eras("long",!1),0);case"y":return Ke(l);case"yy":return Ke(h,kf);case"yyyy":return Ke(o);case"yyyyy":return Ke(p);case"yyyyyy":return Ke(a);case"M":return Ke(s);case"MM":return Ke(r);case"MMM":return Hn(t.months("short",!0,!1),1);case"MMMM":return Hn(t.months("long",!0,!1),1);case"L":return Ke(s);case"LL":return Ke(r);case"LLL":return Hn(t.months("short",!1,!1),1);case"LLLL":return Hn(t.months("long",!1,!1),1);case"d":return Ke(s);case"dd":return Ke(r);case"o":return Ke(u);case"ooo":return Ke(i);case"HH":return Ke(r);case"H":return Ke(s);case"hh":return Ke(r);case"h":return Ke(s);case"mm":return Ke(r);case"m":return Ke(s);case"q":return Ke(s);case"qq":return Ke(r);case"s":return Ke(s);case"ss":return Ke(r);case"S":return Ke(u);case"SSS":return Ke(i);case"u":return ll(f);case"uu":return ll(s);case"uuu":return Ke(n);case"a":return Hn(t.meridiems(),0);case"kkkk":return Ke(o);case"kk":return Ke(h,kf);case"W":return Ke(s);case"WW":return Ke(r);case"E":case"c":return Ke(n);case"EEE":return Hn(t.weekdays("short",!1,!1),1);case"EEEE":return Hn(t.weekdays("long",!1,!1),1);case"ccc":return Hn(t.weekdays("short",!0,!1),1);case"cccc":return Hn(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ay(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return Ay(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return ll(/[a-z_+-/]{1,256}?/i);case" ":return ll(/[^\S\n\r]/);default:return y(N)}})(e)||{invalidReason:C2};return x.token=e,x}const N2={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",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function O2(e,t){const{type:n,value:r}=e;if(n==="literal"){const a=/^\s+$/.test(r);return{literal:!a,val:a?" ":r}}const i=t[n];let o=N2[n];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function R2(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function _2(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const a in n)if(Uo(n,a)){const s=n[a],u=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(r.slice(o,o+u))),o+=u}return[r,i]}else return[r,{}]}function P2(e){const t=o=>{switch(o){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,r;return ze(e.z)||(n=Mr.create(e.z)),ze(e.Z)||(n||(n=new Qt(e.Z)),r=e.Z),ze(e.q)||(e.M=(e.q-1)*3+1),ze(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ze(e.u)||(e.S=bh(e.u)),[Object.keys(e).reduce((o,a)=>{const s=t(a);return s&&(o[s]=e[a]),o},{}),n,r]}let nd=null;function M2(){return nd||(nd=de.fromMillis(1555555555555)),nd}function $2(e,t){if(e.literal)return e;const n=Ht.macroTokenToFormatOpts(e.val),r=Rx(n,t);return r==null||r.includes(void 0)?e:r}function Nx(e,t){return Array.prototype.concat(...e.map(n=>$2(n,t)))}function Ox(e,t,n){const r=Nx(Ht.parseFormat(n),e),i=r.map(a=>T2(a,e)),o=i.find(a=>a.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[a,s]=R2(i),u=RegExp(a,"i"),[l,f]=_2(t,u,s),[h,p,y]=f?P2(f):[null,null,void 0];if(Uo(f,"a")&&Uo(f,"H"))throw new Pa("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:u,rawMatches:l,matches:f,result:h,zone:p,specificOffset:y}}}function I2(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:a}=Ox(e,t,n);return[r,i,o,a]}function Rx(e,t){return e?Ht.create(t,e).formatDateTimeParts(M2()).map(i=>O2(i,e)):null}const _x=[0,31,59,90,120,151,181,212,243,273,304,334],Px=[0,31,60,91,121,152,182,213,244,274,305,335];function Mn(e,t){return new Zn("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Mx(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function $x(e,t,n){return n+(Ns(e)?Px:_x)[t-1]}function Ix(e,t){const n=Ns(e)?Px:_x,r=n.findIndex(o=>olu(t)?(s=t+1,a=1):s=t,{weekYear:s,weekNumber:a,weekday:o,...Bu(e)}}function Ly(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=Mx(t,1,4),o=Ua(t);let a=n*7+r-i-3,s;a<1?(s=t-1,a+=Ua(s)):a>o?(s=t+1,a-=Ua(t)):s=t;const{month:u,day:l}=Ix(s,a);return{year:s,month:u,day:l,...Bu(e)}}function rd(e){const{year:t,month:n,day:r}=e,i=$x(t,n,r);return{year:t,ordinal:i,...Bu(e)}}function jy(e){const{year:t,ordinal:n}=e,{month:r,day:i}=Ix(t,n);return{year:t,month:r,day:i,...Bu(e)}}function F2(e){const t=Lu(e.weekYear),n=Cr(e.weekNumber,1,lu(e.weekYear)),r=Cr(e.weekday,1,7);return t?n?r?!1:Mn("weekday",e.weekday):Mn("week",e.week):Mn("weekYear",e.weekYear)}function D2(e){const t=Lu(e.year),n=Cr(e.ordinal,1,Ua(e.year));return t?n?!1:Mn("ordinal",e.ordinal):Mn("year",e.year)}function Fx(e){const t=Lu(e.year),n=Cr(e.month,1,12),r=Cr(e.day,1,su(e.year,e.month));return t?n?r?!1:Mn("day",e.day):Mn("month",e.month):Mn("year",e.year)}function Dx(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=Cr(t,0,23)||t===24&&n===0&&r===0&&i===0,a=Cr(n,0,59),s=Cr(r,0,59),u=Cr(i,0,999);return o?a?s?u?!1:Mn("millisecond",i):Mn("second",r):Mn("minute",n):Mn("hour",t)}const id="Invalid DateTime",By=864e13;function ul(e){return new Zn("unsupported zone",`the zone "${e.name}" is not supported`)}function od(e){return e.weekData===null&&(e.weekData=Tf(e.c)),e.weekData}function Ca(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new de({...n,...t,old:n})}function Ax(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function zy(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ol(e,t,n){return Ax(kh(e),t,n)}function Vy(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,su(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},a=He.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=kh(o);let[u,l]=Ax(s,n,e.zone);return a!==0&&(u+=a,l=e.zone.offset(u)),{ts:u,o:l}}function ba(e,t,n,r,i,o){const{setZone:a,zone:s}=n;if(e&&Object.keys(e).length!==0||t){const u=t||s,l=de.fromObject(e,{...n,zone:u,specificOffset:o});return a?l:l.setZone(s)}else return de.invalid(new Zn("unparsable",`the input "${i}" can't be parsed as ${r}`))}function cl(e,t,n=!0){return e.isValid?Ht.create(at.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function ad(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=bt(e.c.year,n?6:4),t?(r+="-",r+=bt(e.c.month),r+="-",r+=bt(e.c.day)):(r+=bt(e.c.month),r+=bt(e.c.day)),r}function Hy(e,t,n,r,i,o){let a=bt(e.c.hour);return t?(a+=":",a+=bt(e.c.minute),(e.c.second!==0||!n)&&(a+=":")):a+=bt(e.c.minute),(e.c.second!==0||!n)&&(a+=bt(e.c.second),(e.c.millisecond!==0||!r)&&(a+=".",a+=bt(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?a+="Z":e.o<0?(a+="-",a+=bt(Math.trunc(-e.o/60)),a+=":",a+=bt(Math.trunc(-e.o%60))):(a+="+",a+=bt(Math.trunc(e.o/60)),a+=":",a+=bt(Math.trunc(e.o%60)))),o&&(a+="["+e.zone.ianaName+"]"),a}const Lx={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},A2={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},L2={ordinal:1,hour:0,minute:0,second:0,millisecond:0},jx=["year","month","day","hour","minute","second","millisecond"],j2=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],B2=["year","ordinal","hour","minute","second","millisecond"];function Wy(e){const t={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"}[e.toLowerCase()];if(!t)throw new zS(e);return t}function Uy(e,t){const n=Zr(t.zone,Ct.defaultZone),r=at.fromObject(t),i=Ct.now();let o,a;if(ze(e.year))o=i;else{for(const l of jx)ze(e[l])&&(e[l]=Lx[l]);const s=Fx(e)||Dx(e);if(s)return de.invalid(s);const u=n.offset(i);[o,a]=Ol(e,u,n)}return new de({ts:o,zone:n,loc:r,o:a})}function Gy(e,t,n){const r=ze(n.round)?!0:n.round,i=(a,s)=>(a=Eh(a,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(a,s)),o=a=>n.calendary?t.hasSame(e,a)?0:t.startOf(a).diff(e.startOf(a),a).get(a):t.diff(e,a).get(a);if(n.unit)return i(o(n.unit),n.unit);for(const a of n.units){const s=o(a);if(Math.abs(s)>=1)return i(s,a)}return i(e>t?-0:0,n.units[n.units.length-1])}function qy(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class de{constructor(t){const n=t.zone||Ct.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Zn("invalid input"):null)||(n.isValid?null:ul(n));this.ts=ze(t.ts)?Ct.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const s=n.offset(this.ts);i=zy(this.ts,s),r=Number.isNaN(i.year)?new Zn("invalid input"):null,i=r?null:i,o=r?null:s}this._zone=n,this.loc=t.loc||at.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new de({})}static local(){const[t,n]=qy(arguments),[r,i,o,a,s,u,l]=n;return Uy({year:r,month:i,day:o,hour:a,minute:s,second:u,millisecond:l},t)}static utc(){const[t,n]=qy(arguments),[r,i,o,a,s,u,l]=n;return t.zone=Qt.utcInstance,Uy({year:r,month:i,day:o,hour:a,minute:s,second:u,millisecond:l},t)}static fromJSDate(t,n={}){const r=dP(t)?t.valueOf():NaN;if(Number.isNaN(r))return de.invalid("invalid input");const i=Zr(n.zone,Ct.defaultZone);return i.isValid?new de({ts:r,zone:i,loc:at.fromObject(n)}):de.invalid(ul(i))}static fromMillis(t,n={}){if(Fi(t))return t<-By||t>By?de.invalid("Timestamp out of range"):new de({ts:t,zone:Zr(n.zone,Ct.defaultZone),loc:at.fromObject(n)});throw new _n(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Fi(t))return new de({ts:t*1e3,zone:Zr(n.zone,Ct.defaultZone),loc:at.fromObject(n)});throw new _n("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Zr(n.zone,Ct.defaultZone);if(!r.isValid)return de.invalid(ul(r));const i=Ct.now(),o=ze(n.specificOffset)?r.offset(i):n.specificOffset,a=uu(t,Wy),s=!ze(a.ordinal),u=!ze(a.year),l=!ze(a.month)||!ze(a.day),f=u||l,h=a.weekYear||a.weekNumber,p=at.fromObject(n);if((f||s)&&h)throw new Pa("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new Pa("Can't mix ordinal dates with month/day");const y=h||a.weekday&&!f;let C,x,N=zy(i,o);y?(C=j2,x=A2,N=Tf(N)):s?(C=B2,x=L2,N=rd(N)):(C=jx,x=Lx);let w=!1;for(const A of C){const I=a[A];ze(I)?w?a[A]=x[A]:a[A]=N[A]:w=!0}const E=y?F2(a):s?D2(a):Fx(a),b=E||Dx(a);if(b)return de.invalid(b);const T=y?Ly(a):s?jy(a):a,[R,M]=Ol(T,o,r),F=new de({ts:R,zone:r,o:M,loc:p});return a.weekday&&f&&t.weekday!==F.weekday?de.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${F.toISO()}`):F}static fromISO(t,n={}){const[r,i]=e2(t);return ba(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=t2(t);return ba(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=n2(t);return ba(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(ze(t)||ze(n))throw new _n("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,a=at.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[s,u,l,f]=I2(a,t,n);return f?de.invalid(f):ba(s,u,r,`format ${n}`,t,l)}static fromString(t,n,r={}){return de.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=u2(t);return ba(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new _n("need to specify a reason the DateTime is invalid");const r=t instanceof Zn?t:new Zn(t,n);if(Ct.throwOnInvalid)throw new V_(r);return new de({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=Rx(t,at.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(t,n={}){return Nx(Ht.parseFormat(t),at.fromObject(n)).map(i=>i.val).join("")}get(t){return this[t]}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?od(this).weekYear:NaN}get weekNumber(){return this.isValid?od(this).weekNumber:NaN}get weekday(){return this.isValid?od(this).weekday:NaN}get ordinal(){return this.isValid?rd(this.c).ordinal:NaN}get monthShort(){return this.isValid?sl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?sl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?sl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?sl.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}get isInLeapYear(){return Ns(this.year)}get daysInMonth(){return su(this.year,this.month)}get daysInYear(){return this.isValid?Ua(this.year):NaN}get weeksInWeekYear(){return this.isValid?lu(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=Ht.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(Qt.instance(t),n)}toLocal(){return this.setZone(Ct.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Zr(t,Ct.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),a=this.toObject();[i]=Ol(a,o,t)}return Ca(this,{ts:i,zone:t})}else return de.invalid(ul(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Ca(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=uu(t,Wy),r=!ze(n.weekYear)||!ze(n.weekNumber)||!ze(n.weekday),i=!ze(n.ordinal),o=!ze(n.year),a=!ze(n.month)||!ze(n.day),s=o||a,u=n.weekYear||n.weekNumber;if((s||i)&&u)throw new Pa("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&i)throw new Pa("Can't mix ordinal dates with month/day");let l;r?l=Ly({...Tf(this.c),...n}):ze(n.ordinal)?(l={...this.toObject(),...n},ze(n.day)&&(l.day=Math.min(su(l.year,l.month),l.day))):l=jy({...rd(this.c),...n});const[f,h]=Ol(l,this.o,this.zone);return Ca(this,{ts:f,o:h})}plus(t){if(!this.isValid)return this;const n=He.fromDurationLike(t);return Ca(this,Vy(this,n))}minus(t){if(!this.isValid)return this;const n=He.fromDurationLike(t).negate();return Ca(this,Vy(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=He.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?Ht.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):id}toLocaleString(t=au,n={}){return this.isValid?Ht.create(this.loc.clone(n),t).formatDateTime(this):id}toLocaleParts(t={}){return this.isValid?Ht.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const a=t==="extended";let s=ad(this,a);return s+="T",s+=Hy(this,a,n,r,i,o),s}toISODate({format:t="extended"}={}){return this.isValid?ad(this,t==="extended"):null}toISOWeekDate(){return cl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:a="extended"}={}){return this.isValid?(i?"T":"")+Hy(this,a==="extended",n,t,r,o):null}toRFC2822(){return cl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return cl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?ad(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),cl(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():id}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return He.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=fP(n).map(He.normalizeUnit),a=t.valueOf()>this.valueOf(),s=a?this:t,u=a?t:this,l=w2(s,u,o,i);return a?l.negate():l}diffNow(t="milliseconds",n={}){return this.diff(de.now(),t,n)}until(t){return this.isValid?vt.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||de.fromObject({},{zone:this.zone}),r=t.padding?thisn.valueOf(),Math.min)}static max(...t){if(!t.every(de.isDateTime))throw new _n("max requires all arguments be DateTimes");return Py(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,a=at.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return Ox(a,t,n)}static fromStringExplain(t,n,r={}){return de.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return au}static get DATE_MED(){return VS}static get DATE_MED_WITH_WEEKDAY(){return U_}static get DATE_FULL(){return HS}static get DATE_HUGE(){return WS}static get TIME_SIMPLE(){return US}static get TIME_WITH_SECONDS(){return GS}static get TIME_WITH_SHORT_OFFSET(){return qS}static get TIME_WITH_LONG_OFFSET(){return KS}static get TIME_24_SIMPLE(){return ZS}static get TIME_24_WITH_SECONDS(){return YS}static get TIME_24_WITH_SHORT_OFFSET(){return QS}static get TIME_24_WITH_LONG_OFFSET(){return XS}static get DATETIME_SHORT(){return JS}static get DATETIME_SHORT_WITH_SECONDS(){return ex}static get DATETIME_MED(){return tx}static get DATETIME_MED_WITH_SECONDS(){return nx}static get DATETIME_MED_WITH_WEEKDAY(){return G_}static get DATETIME_FULL(){return rx}static get DATETIME_FULL_WITH_SECONDS(){return ix}static get DATETIME_HUGE(){return ox}static get DATETIME_HUGE_WITH_SECONDS(){return ax}}function Ea(e){if(de.isDateTime(e))return e;if(e&&e.valueOf&&Fi(e.valueOf()))return de.fromJSDate(e);if(e&&typeof e=="object")return de.fromObject(e);throw new _n(`Unknown datetime argument: ${e}, of type ${typeof e}`)}de.now().toMillis(),de.now().plus({minutes:1}).toMillis(),de.now().toMillis(),de.now().plus({minutes:1}).toMillis();de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis(),de.now().toMillis();const Ky=({type:e,show:t,onHide:n})=>{var C,x,N;const{event:r,setEvent:i,config:o,locale:a}=ye(),[s,u]=m.useState("bank"),[l,f]=m.useState(0),[h,p]=m.useState(!1),y=async w=>{w.preventDefault(),p(!0);try{await Ne("update-dealership-balance",{dealership:r.dealershipId,action:e,source:s,amount:l}),i({...r,playerBalance:{...r.playerBalance,[s]:e==="deposit"?r.playerBalance[s]-(l||0):r.playerBalance[s]+(l||0)}})}catch{}n(),p(!1)};return g(z,{show:t,size:"sm",onHide:()=>n(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:a[e]})}),c(z.Body,{children:g(j,{onSubmit:y,children:[e==="deposit"&&g(j.Group,{className:"mb-3",children:[c(j.Label,{children:a.paymentSource}),g("div",{children:[c(j.Check,{label:g("div",{className:"d-flex align-items-center",children:[c("span",{className:"me-2",children:a.bank}),c(vn,{bg:"secondary",children:Le((C=r.playerBalance)==null?void 0:C.bank,o)})]}),name:"payment-source",type:"radio",id:"payment-source-card",checked:s==="bank",onChange:w=>u(w.target.checked?"bank":"cash")}),c(j.Check,{label:g("div",{className:"d-flex align-items-center",children:[c("span",{className:"me-2",children:a.cash}),c(vn,{bg:"secondary",children:Le((x=r.playerBalance)==null?void 0:x.cash,o)})]}),name:"payment-source",type:"radio",id:"payment-source-cash",checked:s==="cash",onChange:w=>u(w.target.checked?"cash":"bank")})]})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:a.amount}),c(Gt,{children:c(j.Control,{type:"number",min:1,max:e==="deposit"?(N=r.playerBalance)==null?void 0:N[s]:r.balance,value:l,onChange:w=>f(w.target.value?parseFloat(w.target.value):""),required:!0})})]}),c(ee,{type:"submit",variant:"primary",disabled:h,children:a[e]})]})})]})},z2=({currentTab:e})=>{var p,y,C;const{event:t,setEvent:n,config:r,locale:i}=ye(),[o,a]=m.useState(t.balance||0),[s,u]=m.useState(!1),[l,f]=m.useState(!1);m.useEffect(()=>{e===i.dashboard&&h()},[e]);const h=async()=>{const{balance:x}=await Ne("get-dealership-balance",{dealership:t.dealershipId});a(x),n(N=>({...N,balance:x}))};return g("div",{children:[c(ur,{className:"mb-3",children:c(Xe,{children:c(Ue,{border:"primary",children:c(Ue.Body,{className:"d-flex justify-content-between",children:t.shopType=="owned"?g(Wt,{children:[g("div",{children:[c("h2",{children:Le(o,r)}),c("div",{children:i.accountBalance})]}),t.employeeRole!=="supervisor"&&g("div",{className:"d-flex flex-column justify-content-end gap-2",children:[g(ee,{size:"sm",onClick:()=>u(!0),children:[c("i",{className:"bi-box-arrow-left me-2"}),i.withdraw]}),g(ee,{size:"sm",variant:"secondary",onClick:()=>f(!0),children:[c("i",{className:"bi-box-arrow-right me-2"}),i.deposit]})]})]}):c("h5",{className:"text-primary mb-0",children:"Self-service dealership"})})})})}),g(ur,{children:[c(Xe,{sm:4,children:c(Ue,{children:g(Ue.Body,{children:[c("h3",{children:((p=t.stats)==null?void 0:p.vehiclesCount)||0}),c("span",{children:i.vehicles})]})})}),c(Xe,{sm:4,children:c(Ue,{children:g(Ue.Body,{children:[c("h3",{children:((y=t.stats)==null?void 0:y.totalSales)||0}),c("span",{children:i.totalSales})]})})}),c(Xe,{sm:4,children:c(Ue,{children:g(Ue.Body,{children:[c("h3",{children:((C=t.stats)==null?void 0:C.vehiclesOnDisplay)||0}),c("span",{children:i.vehiclesOnDisplay})]})})})]}),c(ur,{}),c(Ky,{type:"withdraw",show:s,onHide:()=>{u(!1),h()}}),c(Ky,{type:"deposit",show:l,onHide:()=>{f(!1),h()}})]})};var Bx={exports:{}},Nf={exports:{}};(function(e,t){(function(n,r){r(t,m)})(jf,function(n,r){function i(d,v,S,k,_,O,P){try{var L=d[O](P),B=L.value}catch(V){return void S(V)}L.done?v(B):Promise.resolve(B).then(k,_)}function o(d){return function(){var v=this,S=arguments;return new Promise(function(k,_){var O=d.apply(v,S);function P(B){i(O,k,_,P,L,"next",B)}function L(B){i(O,k,_,P,L,"throw",B)}P(void 0)})}}function a(){return(a=Object.assign||function(d){for(var v=1;v=0||(_[S]=d[S]);return _}function u(d){var v=function(S,k){if(typeof S!="object"||S===null)return S;var _=S[Symbol.toPrimitive];if(_!==void 0){var O=_.call(S,k||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(S)}(d,"string");return typeof v=="symbol"?v:String(v)}r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var l={init:"init"},f=function(d){var v=d.value;return v===void 0?"":v},h=function(){return r.createElement(r.Fragment,null," ")},p={Cell:f,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function y(){for(var d=arguments.length,v=new Array(d),S=0;S(O=typeof O=="number"?O:1/0)){var P=_;_=O,O=P}return d.filter(function(L){return v.some(function(B){var V=L.values[B];return V>=_&&V<=O})})};am.autoRemove=function(d){return!d||typeof d[0]!="number"&&typeof d[1]!="number"};var ua=Object.freeze({__proto__:null,text:Qh,exactText:Xh,exactTextCase:Jh,includes:em,includesAll:tm,includesSome:nm,includesValue:rm,exact:im,equals:om,between:am});l.resetFilters="resetFilters",l.setFilter="setFilter",l.setAllFilters="setAllFilters";var sm=function(d){d.stateReducers.push(AC),d.useInstance.push(LC)};function AC(d,v,S,k){if(v.type===l.init)return a({filters:[]},d);if(v.type===l.resetFilters)return a({},d,{filters:k.initialState.filters||[]});if(v.type===l.setFilter){var _=v.columnId,O=v.filterValue,P=k.allColumns,L=k.filterTypes,B=P.find(function(ie){return ie.id===_});if(!B)throw new Error("React-Table: Could not find a column with id: "+_);var V=U(B.filter,L||{},ua),X=d.filters.find(function(ie){return ie.id===_}),K=E(O,X&&X.value);return re(V.autoRemove,K,B)?a({},d,{filters:d.filters.filter(function(ie){return ie.id!==_})}):a({},d,X?{filters:d.filters.map(function(ie){return ie.id===_?{id:_,value:K}:ie})}:{filters:[].concat(d.filters,[{id:_,value:K}])})}if(v.type===l.setAllFilters){var Y=v.filters,H=k.allColumns,Q=k.filterTypes;return a({},d,{filters:E(Y,d.filters).filter(function(ie){var se=H.find(function(me){return me.id===ie.id});return!re(U(se.filter,Q||{},ua).autoRemove,ie.value,se)})})}}function LC(d){var v=d.data,S=d.rows,k=d.flatRows,_=d.rowsById,O=d.allColumns,P=d.filterTypes,L=d.manualFilters,B=d.defaultCanFilter,V=B!==void 0&&B,X=d.disableFilters,K=d.state.filters,Y=d.dispatch,H=d.autoResetFilters,Q=H===void 0||H,ie=r.useCallback(function(ue,Ee){Y({type:l.setFilter,columnId:ue,filterValue:Ee})},[Y]),se=r.useCallback(function(ue){Y({type:l.setAllFilters,filters:ue})},[Y]);O.forEach(function(ue){var Ee=ue.id,Ie=ue.accessor,we=ue.defaultCanFilter,Ce=ue.disableFilters;ue.canFilter=Ie?te(Ce!==!0&&void 0,X!==!0&&void 0,!0):te(we,V,!1),ue.setFilter=function(Te){return ie(ue.id,Te)};var Ve=K.find(function(Te){return Te.id===Ee});ue.filterValue=Ve&&Ve.value});var me=r.useMemo(function(){if(L||!K.length)return[S,k,_];var ue=[],Ee={};return[function Ie(we,Ce){Ce===void 0&&(Ce=0);var Ve=we;return(Ve=K.reduce(function(Te,Be){var Ae=Be.id,Qe=Be.value,ve=O.find(function(mt){return mt.id===Ae});if(!ve)return Te;Ce===0&&(ve.preFilteredRows=Te);var Fe=U(ve.filter,P||{},ua);return Fe?(ve.filteredRows=Fe(Te,[Ae],Qe),ve.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+ve.id+"."),Te)},we)).forEach(function(Te){ue.push(Te),Ee[Te.id]=Te,Te.subRows&&(Te.subRows=Te.subRows&&Te.subRows.length>0?Ie(Te.subRows,Ce+1):Te.subRows)}),Ve}(S),ue,Ee]},[L,K,S,k,_,O,P]),Me=me[0],pe=me[1],J=me[2];r.useMemo(function(){O.filter(function(ue){return!K.find(function(Ee){return Ee.id===ue.id})}).forEach(function(ue){ue.preFilteredRows=Me,ue.filteredRows=Me})},[Me,K,O]);var Re=b(Q);R(function(){Re()&&Y({type:l.resetFilters})},[Y,L?null:v]),Object.assign(d,{preFilteredRows:S,preFilteredFlatRows:k,preFilteredRowsById:_,filteredRows:Me,filteredFlatRows:pe,filteredRowsById:J,rows:Me,flatRows:pe,rowsById:J,setFilter:ie,setAllFilters:se})}sm.pluginName="useFilters",l.resetGlobalFilter="resetGlobalFilter",l.setGlobalFilter="setGlobalFilter";var lm=function(d){d.stateReducers.push(jC),d.useInstance.push(BC)};function jC(d,v,S,k){if(v.type===l.resetGlobalFilter)return a({},d,{globalFilter:k.initialState.globalFilter||void 0});if(v.type===l.setGlobalFilter){var _=v.filterValue,O=k.userFilterTypes,P=U(k.globalFilter,O||{},ua),L=E(_,d.globalFilter);return re(P.autoRemove,L)?(d.globalFilter,s(d,["globalFilter"])):a({},d,{globalFilter:L})}}function BC(d){var v=d.data,S=d.rows,k=d.flatRows,_=d.rowsById,O=d.allColumns,P=d.filterTypes,L=d.globalFilter,B=d.manualGlobalFilter,V=d.state.globalFilter,X=d.dispatch,K=d.autoResetGlobalFilter,Y=K===void 0||K,H=d.disableGlobalFilter,Q=r.useCallback(function(J){X({type:l.setGlobalFilter,filterValue:J})},[X]),ie=r.useMemo(function(){if(B||V===void 0)return[S,k,_];var J=[],Re={},ue=U(L,P||{},ua);if(!ue)return console.warn("Could not find a valid 'globalFilter' option."),S;O.forEach(function(Ie){var we=Ie.disableGlobalFilter;Ie.canFilter=te(we!==!0&&void 0,H!==!0&&void 0,!0)});var Ee=O.filter(function(Ie){return Ie.canFilter===!0});return[function Ie(we){return(we=ue(we,Ee.map(function(Ce){return Ce.id}),V)).forEach(function(Ce){J.push(Ce),Re[Ce.id]=Ce,Ce.subRows=Ce.subRows&&Ce.subRows.length?Ie(Ce.subRows):Ce.subRows}),we}(S),J,Re]},[B,V,L,P,O,S,k,_,H]),se=ie[0],me=ie[1],Me=ie[2],pe=b(Y);R(function(){pe()&&X({type:l.resetGlobalFilter})},[X,B?null:v]),Object.assign(d,{preGlobalFilteredRows:S,preGlobalFilteredFlatRows:k,preGlobalFilteredRowsById:_,globalFilteredRows:se,globalFilteredFlatRows:me,globalFilteredRowsById:Me,rows:se,flatRows:me,rowsById:Me,setGlobalFilter:Q,disableGlobalFilter:H})}function um(d,v){return v.reduce(function(S,k){return S+(typeof k=="number"?k:0)},0)}lm.pluginName="useGlobalFilter";var cm=Object.freeze({__proto__:null,sum:um,min:function(d){var v=d[0]||0;return d.forEach(function(S){typeof S=="number"&&(v=Math.min(v,S))}),v},max:function(d){var v=d[0]||0;return d.forEach(function(S){typeof S=="number"&&(v=Math.max(v,S))}),v},minMax:function(d){var v=d[0]||0,S=d[0]||0;return d.forEach(function(k){typeof k=="number"&&(v=Math.min(v,k),S=Math.max(S,k))}),v+".."+S},average:function(d){return um(0,d)/d.length},median:function(d){if(!d.length)return null;var v=Math.floor(d.length/2),S=[].concat(d).sort(function(k,_){return k-_});return d.length%2!=0?S[v]:(S[v-1]+S[v])/2},unique:function(d){return Array.from(new Set(d).values())},uniqueCount:function(d){return new Set(d).size},count:function(d){return d.length}}),zC=[],VC={};l.resetGroupBy="resetGroupBy",l.setGroupBy="setGroupBy",l.toggleGroupBy="toggleGroupBy";var dm=function(d){d.getGroupByToggleProps=[HC],d.stateReducers.push(WC),d.visibleColumnsDeps.push(function(v,S){var k=S.instance;return[].concat(v,[k.state.groupBy])}),d.visibleColumns.push(UC),d.useInstance.push(qC),d.prepareRow.push(KC)};dm.pluginName="useGroupBy";var HC=function(d,v){var S=v.header;return[d,{onClick:S.canGroupBy?function(k){k.persist(),S.toggleGroupBy()}:void 0,style:{cursor:S.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function WC(d,v,S,k){if(v.type===l.init)return a({groupBy:[]},d);if(v.type===l.resetGroupBy)return a({},d,{groupBy:k.initialState.groupBy||[]});if(v.type===l.setGroupBy)return a({},d,{groupBy:v.value});if(v.type===l.toggleGroupBy){var _=v.columnId,O=v.value,P=O!==void 0?O:!d.groupBy.includes(_);return a({},d,P?{groupBy:[].concat(d.groupBy,[_])}:{groupBy:d.groupBy.filter(function(L){return L!==_})})}}function UC(d,v){var S=v.instance.state.groupBy,k=S.map(function(O){return d.find(function(P){return P.id===O})}).filter(Boolean),_=d.filter(function(O){return!S.includes(O.id)});return(d=[].concat(k,_)).forEach(function(O){O.isGrouped=S.includes(O.id),O.groupedIndex=S.indexOf(O.id)}),d}var GC={};function qC(d){var v=d.data,S=d.rows,k=d.flatRows,_=d.rowsById,O=d.allColumns,P=d.flatHeaders,L=d.groupByFn,B=L===void 0?fm:L,V=d.manualGroupBy,X=d.aggregations,K=X===void 0?GC:X,Y=d.plugins,H=d.state.groupBy,Q=d.dispatch,ie=d.autoResetGroupBy,se=ie===void 0||ie,me=d.disableGroupBy,Me=d.defaultCanGroupBy,pe=d.getHooks;w(Y,["useColumnOrder","useFilters"],"useGroupBy");var J=b(d);O.forEach(function(ve){var Fe=ve.accessor,mt=ve.defaultGroupBy,Kt=ve.disableGroupBy;ve.canGroupBy=Fe?te(ve.canGroupBy,Kt!==!0&&void 0,me!==!0&&void 0,!0):te(ve.canGroupBy,mt,Me,!1),ve.canGroupBy&&(ve.toggleGroupBy=function(){return d.toggleGroupBy(ve.id)}),ve.Aggregated=ve.Aggregated||ve.Cell});var Re=r.useCallback(function(ve,Fe){Q({type:l.toggleGroupBy,columnId:ve,value:Fe})},[Q]),ue=r.useCallback(function(ve){Q({type:l.setGroupBy,value:ve})},[Q]);P.forEach(function(ve){ve.getGroupByToggleProps=C(pe().getGroupByToggleProps,{instance:J(),header:ve})});var Ee=r.useMemo(function(){if(V||!H.length)return[S,k,_,zC,VC,k,_];var ve=H.filter(function(_t){return O.find(function(Ar){return Ar.id===_t})}),Fe=[],mt={},Kt=[],Se={},lt=[],St={},Zt=function _t(Ar,pr,_m){if(pr===void 0&&(pr=0),pr===ve.length)return Ar.map(function(Is){return a({},Is,{depth:pr})});var hc=ve[pr],Db=B(Ar,hc);return Object.entries(Db).map(function(Is,Ab){var Pm=Is[0],Fs=Is[1],Ds=hc+":"+Pm,Mm=_t(Fs,pr+1,Ds=_m?_m+">"+Ds:Ds),$m=pr?ge(Fs,"leafRows"):Fs,Lb=function(bn,mc,Bb){var As={};return O.forEach(function(xt){if(ve.includes(xt.id))As[xt.id]=mc[0]?mc[0].values[xt.id]:null;else{var Im=typeof xt.aggregate=="function"?xt.aggregate:K[xt.aggregate]||cm[xt.aggregate];if(Im){var zb=mc.map(function(Ls){return Ls.values[xt.id]}),Vb=bn.map(function(Ls){var vc=Ls.values[xt.id];if(!Bb&&xt.aggregateValue){var Fm=typeof xt.aggregateValue=="function"?xt.aggregateValue:K[xt.aggregateValue]||cm[xt.aggregateValue];if(!Fm)throw console.info({column:xt}),new Error("React Table: Invalid column.aggregateValue option for column listed above");vc=Fm(vc,Ls,xt)}return vc});As[xt.id]=Im(Vb,zb)}else{if(xt.aggregate)throw console.info({column:xt}),new Error("React Table: Invalid column.aggregate option for column listed above");As[xt.id]=null}}}),As}($m,Fs,pr),jb={id:Ds,isGrouped:!0,groupByID:hc,groupByVal:Pm,values:Lb,subRows:Mm,leafRows:$m,depth:pr,index:Ab};return Mm.forEach(function(bn){Fe.push(bn),mt[bn.id]=bn,bn.isGrouped?(Kt.push(bn),Se[bn.id]=bn):(lt.push(bn),St[bn.id]=bn)}),jb})}(S);return Zt.forEach(function(_t){Fe.push(_t),mt[_t.id]=_t,_t.isGrouped?(Kt.push(_t),Se[_t.id]=_t):(lt.push(_t),St[_t.id]=_t)}),[Zt,Fe,mt,Kt,Se,lt,St]},[V,H,S,k,_,O,K,B]),Ie=Ee[0],we=Ee[1],Ce=Ee[2],Ve=Ee[3],Te=Ee[4],Be=Ee[5],Ae=Ee[6],Qe=b(se);R(function(){Qe()&&Q({type:l.resetGroupBy})},[Q,V?null:v]),Object.assign(d,{preGroupedRows:S,preGroupedFlatRow:k,preGroupedRowsById:_,groupedRows:Ie,groupedFlatRows:we,groupedRowsById:Ce,onlyGroupedFlatRows:Ve,onlyGroupedRowsById:Te,nonGroupedFlatRows:Be,nonGroupedRowsById:Ae,rows:Ie,flatRows:we,rowsById:Ce,toggleGroupBy:Re,setGroupBy:ue})}function KC(d){d.allCells.forEach(function(v){var S;v.isGrouped=v.column.isGrouped&&v.column.id===d.groupByID,v.isPlaceholder=!v.isGrouped&&v.column.isGrouped,v.isAggregated=!v.isGrouped&&!v.isPlaceholder&&((S=d.subRows)==null?void 0:S.length)})}function fm(d,v){return d.reduce(function(S,k,_){var O=""+k.values[v];return S[O]=Array.isArray(S[O])?S[O]:[],S[O].push(k),S},{})}var pm=/([0-9]+)/gm;function lc(d,v){return d===v?0:d>v?1:-1}function ca(d,v,S){return[d.values[S],v.values[S]]}function hm(d){return typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?"":String(d):typeof d=="string"?d:""}var ZC=Object.freeze({__proto__:null,alphanumeric:function(d,v,S){var k=ca(d,v,S),_=k[0],O=k[1];for(_=hm(_),O=hm(O),_=_.split(pm).filter(Boolean),O=O.split(pm).filter(Boolean);_.length&&O.length;){var P=_.shift(),L=O.shift(),B=parseInt(P,10),V=parseInt(L,10),X=[B,V].sort();if(isNaN(X[0])){if(P>L)return 1;if(L>P)return-1}else{if(isNaN(X[1]))return isNaN(B)?-1:1;if(B>V)return 1;if(V>B)return-1}}return _.length-O.length},datetime:function(d,v,S){var k=ca(d,v,S),_=k[0],O=k[1];return lc(_=_.getTime(),O=O.getTime())},basic:function(d,v,S){var k=ca(d,v,S);return lc(k[0],k[1])},string:function(d,v,S){var k=ca(d,v,S),_=k[0],O=k[1];for(_=_.split("").filter(Boolean),O=O.split("").filter(Boolean);_.length&&O.length;){var P=_.shift(),L=O.shift(),B=P.toLowerCase(),V=L.toLowerCase();if(B>V)return 1;if(V>B)return-1;if(P>L)return 1;if(L>P)return-1}return _.length-O.length},number:function(d,v,S){var k=ca(d,v,S),_=k[0],O=k[1],P=/[^0-9.]/gi;return lc(_=Number(String(_).replace(P,"")),O=Number(String(O).replace(P,"")))}});l.resetSortBy="resetSortBy",l.setSortBy="setSortBy",l.toggleSortBy="toggleSortBy",l.clearSortBy="clearSortBy",p.sortType="alphanumeric",p.sortDescFirst=!1;var mm=function(d){d.getSortByToggleProps=[YC],d.stateReducers.push(QC),d.useInstance.push(XC)};mm.pluginName="useSortBy";var YC=function(d,v){var S=v.instance,k=v.column,_=S.isMultiSortEvent,O=_===void 0?function(P){return P.shiftKey}:_;return[d,{onClick:k.canSort?function(P){P.persist(),k.toggleSortBy(void 0,!S.disableMultiSort&&O(P))}:void 0,style:{cursor:k.canSort?"pointer":void 0},title:k.canSort?"Toggle SortBy":void 0}]};function QC(d,v,S,k){if(v.type===l.init)return a({sortBy:[]},d);if(v.type===l.resetSortBy)return a({},d,{sortBy:k.initialState.sortBy||[]});if(v.type===l.clearSortBy)return a({},d,{sortBy:d.sortBy.filter(function(J){return J.id!==v.columnId})});if(v.type===l.setSortBy)return a({},d,{sortBy:v.sortBy});if(v.type===l.toggleSortBy){var _,O=v.columnId,P=v.desc,L=v.multi,B=k.allColumns,V=k.disableMultiSort,X=k.disableSortRemove,K=k.disableMultiRemove,Y=k.maxMultiSortColCount,H=Y===void 0?Number.MAX_SAFE_INTEGER:Y,Q=d.sortBy,ie=B.find(function(J){return J.id===O}).sortDescFirst,se=Q.find(function(J){return J.id===O}),me=Q.findIndex(function(J){return J.id===O}),Me=P!=null,pe=[];return(_=!V&&L?se?"toggle":"add":me!==Q.length-1||Q.length!==1?"replace":se?"toggle":"replace")!="toggle"||X||Me||L&&K||!(se&&se.desc&&!ie||!se.desc&&ie)||(_="remove"),_==="replace"?pe=[{id:O,desc:Me?P:ie}]:_==="add"?(pe=[].concat(Q,[{id:O,desc:Me?P:ie}])).splice(0,pe.length-H):_==="toggle"?pe=Q.map(function(J){return J.id===O?a({},J,{desc:Me?P:!se.desc}):J}):_==="remove"&&(pe=Q.filter(function(J){return J.id!==O})),a({},d,{sortBy:pe})}}function XC(d){var v=d.data,S=d.rows,k=d.flatRows,_=d.allColumns,O=d.orderByFn,P=O===void 0?vm:O,L=d.sortTypes,B=d.manualSortBy,V=d.defaultCanSort,X=d.disableSortBy,K=d.flatHeaders,Y=d.state.sortBy,H=d.dispatch,Q=d.plugins,ie=d.getHooks,se=d.autoResetSortBy,me=se===void 0||se;w(Q,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var Me=r.useCallback(function(we){H({type:l.setSortBy,sortBy:we})},[H]),pe=r.useCallback(function(we,Ce,Ve){H({type:l.toggleSortBy,columnId:we,desc:Ce,multi:Ve})},[H]),J=b(d);K.forEach(function(we){var Ce=we.accessor,Ve=we.canSort,Te=we.disableSortBy,Be=we.id,Ae=Ce?te(Te!==!0&&void 0,X!==!0&&void 0,!0):te(V,Ve,!1);we.canSort=Ae,we.canSort&&(we.toggleSortBy=function(ve,Fe){return pe(we.id,ve,Fe)},we.clearSortBy=function(){H({type:l.clearSortBy,columnId:we.id})}),we.getSortByToggleProps=C(ie().getSortByToggleProps,{instance:J(),column:we});var Qe=Y.find(function(ve){return ve.id===Be});we.isSorted=!!Qe,we.sortedIndex=Y.findIndex(function(ve){return ve.id===Be}),we.isSortedDesc=we.isSorted?Qe.desc:void 0});var Re=r.useMemo(function(){if(B||!Y.length)return[S,k];var we=[],Ce=Y.filter(function(Ve){return _.find(function(Te){return Te.id===Ve.id})});return[function Ve(Te){var Be=P(Te,Ce.map(function(Ae){var Qe=_.find(function(mt){return mt.id===Ae.id});if(!Qe)throw new Error("React-Table: Could not find a column with id: "+Ae.id+" while sorting");var ve=Qe.sortType,Fe=Oe(ve)||(L||{})[ve]||ZC[ve];if(!Fe)throw new Error("React-Table: Could not find a valid sortType of '"+ve+"' for column '"+Ae.id+"'.");return function(mt,Kt){return Fe(mt,Kt,Ae.id,Ae.desc)}}),Ce.map(function(Ae){var Qe=_.find(function(ve){return ve.id===Ae.id});return Qe&&Qe.sortInverted?Ae.desc:!Ae.desc}));return Be.forEach(function(Ae){we.push(Ae),Ae.subRows&&Ae.subRows.length!==0&&(Ae.subRows=Ve(Ae.subRows))}),Be}(S),we]},[B,Y,S,k,_,P,L]),ue=Re[0],Ee=Re[1],Ie=b(me);R(function(){Ie()&&H({type:l.resetSortBy})},[B?null:v]),Object.assign(d,{preSortedRows:S,preSortedFlatRows:k,sortedRows:ue,sortedFlatRows:Ee,rows:ue,flatRows:Ee,setSortBy:Me,toggleSortBy:pe})}function vm(d,v,S){return[].concat(d).sort(function(k,_){for(var O=0;Od.pageIndex?L=_===-1?O.length>=d.pageSize:P<_:P-1),L?a({},d,{pageIndex:P}):d}if(v.type===l.setPageSize){var B=v.pageSize,V=d.pageSize*d.pageIndex;return a({},d,{pageIndex:Math.floor(V/B),pageSize:B})}}function eb(d){var v=d.rows,S=d.autoResetPage,k=S===void 0||S,_=d.manualExpandedKey,O=_===void 0?"expanded":_,P=d.plugins,L=d.pageCount,B=d.paginateExpandedRows,V=B===void 0||B,X=d.expandSubRows,K=X===void 0||X,Y=d.state,H=Y.pageSize,Q=Y.pageIndex,ie=Y.expanded,se=Y.globalFilter,me=Y.filters,Me=Y.groupBy,pe=Y.sortBy,J=d.dispatch,Re=d.data,ue=d.manualPagination;w(P,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var Ee=b(k);R(function(){Ee()&&J({type:l.resetPage})},[J,ue?null:Re,se,me,Me,pe]);var Ie=ue?L:Math.ceil(v.length/H),we=r.useMemo(function(){return Ie>0?[].concat(new Array(Ie)).fill(null).map(function(Fe,mt){return mt}):[]},[Ie]),Ce=r.useMemo(function(){var Fe;if(ue)Fe=v;else{var mt=H*Q,Kt=mt+H;Fe=v.slice(mt,Kt)}return V?Fe:xe(Fe,{manualExpandedKey:O,expanded:ie,expandSubRows:K})},[K,ie,O,ue,Q,H,V,v]),Ve=Q>0,Te=Ie===-1?Ce.length>=H:Q-1&&O.push(_.splice(B,1)[0])};_.length&&k.length;)P();return[].concat(O,_)}function bb(d){var v=d.dispatch;d.setColumnOrder=r.useCallback(function(S){return v({type:l.setColumnOrder,columnOrder:S})},[v])}Em.pluginName="useColumnOrder",p.canResize=!0,l.columnStartResizing="columnStartResizing",l.columnResizing="columnResizing",l.columnDoneResizing="columnDoneResizing",l.resetResize="resetResize";var km=function(d){d.getResizerProps=[Eb],d.getHeaderProps.push({style:{position:"relative"}}),d.stateReducers.push(kb),d.useInstance.push(Nb),d.useInstanceBeforeDimensions.push(Tb)},Eb=function(d,v){var S=v.instance,k=v.header,_=S.dispatch,O=function(P,L){var B=!1;if(P.type==="touchstart"){if(P.touches&&P.touches.length>1)return;B=!0}var V,X,K=function(pe){var J=[];return function Re(ue){ue.columns&&ue.columns.length&&ue.columns.map(Re),J.push(ue)}(pe),J}(L).map(function(pe){return[pe.id,pe.totalWidth]}),Y=B?Math.round(P.touches[0].clientX):P.clientX,H=function(){window.cancelAnimationFrame(V),V=null,_({type:l.columnDoneResizing})},Q=function(){window.cancelAnimationFrame(V),V=null,_({type:l.columnResizing,clientX:X})},ie=function(pe){X=pe,V||(V=window.requestAnimationFrame(Q))},se={mouse:{moveEvent:"mousemove",moveHandler:function(pe){return ie(pe.clientX)},upEvent:"mouseup",upHandler:function(pe){document.removeEventListener("mousemove",se.mouse.moveHandler),document.removeEventListener("mouseup",se.mouse.upHandler),H()}},touch:{moveEvent:"touchmove",moveHandler:function(pe){return pe.cancelable&&(pe.preventDefault(),pe.stopPropagation()),ie(pe.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(pe){document.removeEventListener(se.touch.moveEvent,se.touch.moveHandler),document.removeEventListener(se.touch.upEvent,se.touch.moveHandler),H()}}},me=B?se.touch:se.mouse,Me=!!function(){if(typeof ke=="boolean")return ke;var pe=!1;try{var J={get passive(){return pe=!0,!1}};window.addEventListener("test",null,J),window.removeEventListener("test",null,J)}catch{pe=!1}return ke=pe}()&&{passive:!1};document.addEventListener(me.moveEvent,me.moveHandler,Me),document.addEventListener(me.upEvent,me.upHandler,Me),_({type:l.columnStartResizing,columnId:L.id,columnWidth:L.totalWidth,headerIdWidths:K,clientX:Y})};return[d,{onMouseDown:function(P){return P.persist()||O(P,k)},onTouchStart:function(P){return P.persist()||O(P,k)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function kb(d,v){if(v.type===l.init)return a({columnResizing:{columnWidths:{}}},d);if(v.type===l.resetResize)return a({},d,{columnResizing:{columnWidths:{}}});if(v.type===l.columnStartResizing){var S=v.clientX,k=v.columnId,_=v.columnWidth,O=v.headerIdWidths;return a({},d,{columnResizing:a({},d.columnResizing,{startX:S,headerIdWidths:O,columnWidth:_,isResizingColumn:k})})}if(v.type===l.columnResizing){var P=v.clientX,L=d.columnResizing,B=L.startX,V=L.columnWidth,X=L.headerIdWidths,K=(P-B)/V,Y={};return(X===void 0?[]:X).forEach(function(H){var Q=H[0],ie=H[1];Y[Q]=Math.max(ie+ie*K,0)}),a({},d,{columnResizing:a({},d.columnResizing,{columnWidths:a({},d.columnResizing.columnWidths,{},Y)})})}return v.type===l.columnDoneResizing?a({},d,{columnResizing:a({},d.columnResizing,{startX:null,isResizingColumn:null})}):void 0}km.pluginName="useResizeColumns";var Tb=function(d){var v=d.flatHeaders,S=d.disableResizing,k=d.getHooks,_=d.state.columnResizing,O=b(d);v.forEach(function(P){var L=te(P.disableResizing!==!0&&void 0,S!==!0&&void 0,!0);P.canResize=L,P.width=_.columnWidths[P.id]||P.originalWidth||P.width,P.isResizing=_.isResizingColumn===P.id,L&&(P.getResizerProps=C(k().getResizerProps,{instance:O(),header:P}))})};function Nb(d){var v=d.plugins,S=d.dispatch,k=d.autoResetResize,_=k===void 0||k,O=d.columns;w(v,["useAbsoluteLayout"],"useResizeColumns");var P=b(_);R(function(){P()&&S({type:l.resetResize})},[O]);var L=r.useCallback(function(){return S({type:l.resetResize})},[S]);Object.assign(d,{resetResizing:L})}var uc={position:"absolute",top:0},Tm=function(d){d.getTableBodyProps.push($s),d.getRowProps.push($s),d.getHeaderGroupProps.push($s),d.getFooterGroupProps.push($s),d.getHeaderProps.push(function(v,S){var k=S.column;return[v,{style:a({},uc,{left:k.totalLeft+"px",width:k.totalWidth+"px"})}]}),d.getCellProps.push(function(v,S){var k=S.cell;return[v,{style:a({},uc,{left:k.column.totalLeft+"px",width:k.column.totalWidth+"px"})}]}),d.getFooterProps.push(function(v,S){var k=S.column;return[v,{style:a({},uc,{left:k.totalLeft+"px",width:k.totalWidth+"px"})}]})};Tm.pluginName="useAbsoluteLayout";var $s=function(d,v){return[d,{style:{position:"relative",width:v.instance.totalColumnsWidth+"px"}}]},cc={display:"inline-block",boxSizing:"border-box"},dc=function(d,v){return[d,{style:{display:"flex",width:v.instance.totalColumnsWidth+"px"}}]},Nm=function(d){d.getRowProps.push(dc),d.getHeaderGroupProps.push(dc),d.getFooterGroupProps.push(dc),d.getHeaderProps.push(function(v,S){var k=S.column;return[v,{style:a({},cc,{width:k.totalWidth+"px"})}]}),d.getCellProps.push(function(v,S){var k=S.cell;return[v,{style:a({},cc,{width:k.column.totalWidth+"px"})}]}),d.getFooterProps.push(function(v,S){var k=S.column;return[v,{style:a({},cc,{width:k.totalWidth+"px"})}]})};function Om(d){d.getTableProps.push(Ob),d.getRowProps.push(fc),d.getHeaderGroupProps.push(fc),d.getFooterGroupProps.push(fc),d.getHeaderProps.push(Rb),d.getCellProps.push(_b),d.getFooterProps.push(Pb)}Nm.pluginName="useBlockLayout",Om.pluginName="useFlexLayout";var Ob=function(d,v){return[d,{style:{minWidth:v.instance.totalColumnsMinWidth+"px"}}]},fc=function(d,v){return[d,{style:{display:"flex",flex:"1 0 auto",minWidth:v.instance.totalColumnsMinWidth+"px"}}]},Rb=function(d,v){var S=v.column;return[d,{style:{boxSizing:"border-box",flex:S.totalFlexWidth?S.totalFlexWidth+" 0 auto":void 0,minWidth:S.totalMinWidth+"px",width:S.totalWidth+"px"}}]},_b=function(d,v){var S=v.cell;return[d,{style:{boxSizing:"border-box",flex:S.column.totalFlexWidth+" 0 auto",minWidth:S.column.totalMinWidth+"px",width:S.column.totalWidth+"px"}}]},Pb=function(d,v){var S=v.column;return[d,{style:{boxSizing:"border-box",flex:S.totalFlexWidth?S.totalFlexWidth+" 0 auto":void 0,minWidth:S.totalMinWidth+"px",width:S.totalWidth+"px"}}]};function Rm(d){d.stateReducers.push(Fb),d.getTableProps.push(Mb),d.getHeaderProps.push($b),d.getRowProps.push(Ib)}l.columnStartResizing="columnStartResizing",l.columnResizing="columnResizing",l.columnDoneResizing="columnDoneResizing",l.resetResize="resetResize",Rm.pluginName="useGridLayout";var Mb=function(d,v){var S=v.instance;return[d,{style:{display:"grid",gridTemplateColumns:S.visibleColumns.map(function(k){var _;return S.state.gridLayout.columnWidths[k.id]?S.state.gridLayout.columnWidths[k.id]+"px":(_=S.state.columnResizing)!=null&&_.isResizingColumn?S.state.gridLayout.startWidths[k.id]+"px":typeof k.width=="number"?k.width+"px":k.width}).join(" ")}}]},$b=function(d,v){var S=v.column;return[d,{id:"header-cell-"+S.id,style:{position:"sticky",gridColumn:"span "+S.totalVisibleHeaderCount}}]},Ib=function(d,v){var S=v.row;return S.isExpanded?[d,{style:{gridColumn:"1 / "+(S.cells.length+1)}}]:[d,{}]};function Fb(d,v,S,k){if(v.type===l.init)return a({gridLayout:{columnWidths:{}}},d);if(v.type===l.resetResize)return a({},d,{gridLayout:{columnWidths:{}}});if(v.type===l.columnStartResizing){var _=v.columnId,O=v.headerIdWidths,P=pc(_);if(P!==void 0){var L=k.visibleColumns.reduce(function(J,Re){var ue;return a({},J,((ue={})[Re.id]=pc(Re.id),ue))},{}),B=k.visibleColumns.reduce(function(J,Re){var ue;return a({},J,((ue={})[Re.id]=Re.minWidth,ue))},{}),V=k.visibleColumns.reduce(function(J,Re){var ue;return a({},J,((ue={})[Re.id]=Re.maxWidth,ue))},{}),X=O.map(function(J){var Re=J[0];return[Re,pc(Re)]});return a({},d,{gridLayout:a({},d.gridLayout,{startWidths:L,minWidths:B,maxWidths:V,headerIdGridWidths:X,columnWidth:P})})}return d}if(v.type===l.columnResizing){var K=v.clientX,Y=d.columnResizing.startX,H=d.gridLayout,Q=H.columnWidth,ie=H.minWidths,se=H.maxWidths,me=H.headerIdGridWidths,Me=(K-Y)/Q,pe={};return(me===void 0?[]:me).forEach(function(J){var Re=J[0],ue=J[1];pe[Re]=Math.min(Math.max(ie[Re],ue+ue*Me),se[Re])}),a({},d,{gridLayout:a({},d.gridLayout,{columnWidths:a({},d.gridLayout.columnWidths,{},pe)})})}return v.type===l.columnDoneResizing?a({},d,{gridLayout:a({},d.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function pc(d){var v,S=(v=document.getElementById("header-cell-"+d))==null?void 0:v.offsetWidth;if(S!==void 0)return S}n._UNSTABLE_usePivotColumns=gm,n.actions=l,n.defaultColumn=p,n.defaultGroupByFn=fm,n.defaultOrderByFn=vm,n.defaultRenderer=f,n.emptyRenderer=h,n.ensurePluginOrder=w,n.flexRender=F,n.functionalUpdate=E,n.loopHooks=N,n.makePropGetter=C,n.makeRenderer=M,n.reduceHooks=x,n.safeUseLayoutEffect=T,n.useAbsoluteLayout=Tm,n.useAsyncDebounce=function(d,v){v===void 0&&(v=0);var S=r.useRef({}),k=b(d),_=b(v);return r.useCallback(function(){var O=o(regeneratorRuntime.mark(function P(){var L,B,V,X=arguments;return regeneratorRuntime.wrap(function(K){for(;;)switch(K.prev=K.next){case 0:for(L=X.length,B=new Array(L),V=0;V1?v-1:0),k=1;k{const{event:o,locale:a}=ye(),[s,u]=m.useState(r),l=async f=>{f.preventDefault(),await Ne("update-vehicle-price",{vehicle:n,dealership:o.dealershipId,newPrice:s}),i(s),t()};return g(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:g(z.Title,{as:"h5",children:[a.edit," ",a.price]})}),c(z.Body,{children:g(j,{onSubmit:l,children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:a.price}),c(j.Control,{type:"number",value:s,onChange:f=>u(f.target.value?parseFloat(f.target.value):""),min:0,required:!0})]}),c(ee,{type:"submit",children:a.save})]})})]})},W2=({show:e,onHide:t,spawnCode:n,price:r})=>{const{event:i,config:o,locale:a}=ye(),[s,u]=m.useState(1),l=m.useMemo(()=>r*(s||1),[r,s]),f=async h=>{h.preventDefault(),u(1),t();try{await Ne("order-vehicle",{dealership:i.dealershipId,spawnCode:n,quantity:s})}catch{}};return g(z,{show:e,size:"sm",onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:a.orderVehicle})}),c(z.Body,{children:g(j,{onSubmit:f,children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:a.quantity}),g(Gt,{children:[c(j.Control,{type:"number",value:s,onChange:h=>u(h.target.value?parseInt(h.target.value):""),min:1,required:!0}),c(ee,{variant:"secondary",onClick:()=>u(h=>Math.max(1,(h||2)-1)),children:"-"}),c(ee,{variant:"secondary",onClick:()=>u(h=>(h||0)+1),children:"+"})]})]}),g(j.Group,{className:"mb-4",children:[c(j.Label,{children:a.totalCost}),c("h4",{children:Le(l,o)})]}),c(ee,{type:"submit",disabled:i.balance{const{config:n,locale:r,event:i}=ye(),{brand:o,model:a,spawn_code:s,category:u,stock:l,price:f,list_price:h}=e,[p,y]=m.useState(!1),[C,x]=m.useState(!1),N=(f||1)*(n.DealerPurchasePrice||1);return g("tr",{children:[g("td",{className:"admin-vehicle-row-name",children:[o," ",a]}),c("td",{children:u}),i.shopType=="owned"&&g("td",{children:[c("span",{children:l}),c(vn,{className:"ms-2",bg:l>0?"success":"danger",children:l>0?r.inStock:r.outOfStock})]}),c("td",{children:Le(N,n)}),g("td",{children:[c("span",{children:Le(h||0,n)}),i.employeeRole!=="supervisor"&&!(!n.ManagerCanChangePriceOfVehicles&&i.employeeRole==="manager")&&g("span",{children:[c(ee,{size:"sm",variant:"link",className:"me-2",onClick:()=>y(!0),children:c("i",{className:"bi-pencil"})}),c(H2,{show:p,onHide:()=>y(!1),vehicle:s,price:h||0,onUpdatePrice:w=>t({...e,list_price:w})})]})]}),i.shopType=="owned"&&g("td",{className:"text-end",children:[g(ee,{size:"sm",variant:"primary",onClick:()=>x(!0),children:[c("i",{className:"bi-cart me-1"}),r.placeOrder]}),c(W2,{show:C,onHide:()=>x(!1),spawnCode:s,price:N})]})]})},G2=({data:e,columns:t,setVehicles:n})=>{const{locale:r}=ye(),{getTableProps:i,getTableBodyProps:o,headerGroups:a,prepareRow:s,page:u,canPreviousPage:l,canNextPage:f,pageOptions:h,pageCount:p,gotoPage:y,nextPage:C,previousPage:x,setPageSize:N,state:{pageIndex:w,pageSize:E}}=cr.useTable({columns:t,data:e,autoResetPage:!1,autoResetFilters:!1},cr.usePagination);return g("div",{children:[g(ea,{hover:!0,className:"bootstrap-table",...i(),children:[c("thead",{children:a.map(b=>c("tr",{...b.getHeaderGroupProps(),children:b.headers.map(T=>c("th",{...T.getHeaderProps(),children:T.render("Header")}))}))}),c("tbody",{...o(),children:u.length?u.map((b,T)=>c(U2,{vehicle:b.original,updateVehicle:R=>n(M=>M.map(F=>F.spawn_code===b.original.spawn_code?R:F))},b.original.spawn_code)):c("tr",{children:c("td",{colSpan:100,align:"center",children:r.noVehicles})})})]}),g("div",{className:"pagination d-flex justify-content-between",children:[g(ee,{variant:"primary",onClick:()=>x(),disabled:!l,children:[c("i",{className:"bi-arrow-left"})," ",r.previous]}),g("div",{className:"d-flex align-items-center",children:[g("span",{className:"me-3",children:[r.page," ",w+1," ",r.of," ",h.length]}),c(j.Select,{size:"sm",value:E,onChange:b=>{N(Number(b.target.value))},style:{width:110},children:[10,20,30,40,50].map(b=>g("option",{value:b,children:[r.show," ",b]},b))})]}),g(ee,{variant:"primary",onClick:()=>C(),disabled:!f,children:[r.next," ",c("i",{className:"bi-arrow-right"})]})]})]})},q2=({currentTab:e})=>{const{event:t,config:n,locale:r}=ye(),i={[r.sortByNewest]:(R,M)=>M.id-R.id,[r.sortByName]:(R,M)=>`${R.brand} ${R.model}`.localeCompare(`${M.brand} ${M.model}`),[r.sortByCheapest]:(R,M)=>R.price-M.price,[r.sortByMostExpensive]:(R,M)=>M.price-R.price},[o,a]=m.useState(""),[s,u]=m.useState(Object.keys(i)[0]),[l,f]=m.useState("all"),[h,p]=m.useState([]),[y,C]=m.useState([]),[x,N]=m.useState(!0),w={all:"All Categories",...n.Categories||{}};m.useEffect(()=>{t.vehicles&&p(t.vehicles||[])},[t.vehicles]),m.useEffect(()=>{e===r.vehicles&&E()},[e]);const E=async()=>{try{const R=await Ne("get-dealership-vehicles",{dealershipId:t.dealershipId});p(R)}catch{}N(!1)};m.useEffect(()=>{C(h.filter(({brand:R,model:M})=>{const F=o.toLocaleLowerCase().split(" ").filter(A=>A).map(A=>A.trim());return F.filter(A=>`${R} ${M}`.toLocaleLowerCase().includes(A)).length===F.length}).filter(R=>l==="all"?!0:R.category===l).sort(i[s]))},[h,o,l,s]);const b=m.useMemo(()=>[{Header:r.vehicle,accessor:"vehicle"},{Header:r.category,accessor:"category"},t.shopType=="owned"&&{Header:r.quantity,accessor:"qty"},{Header:r.purchaseCost,accessor:"pcost"},{Header:r.salePrice,accessor:"sprice"},t.shopType=="owned"&&{Header:"",accessor:"x"}],[]).filter(Boolean),T=y;return x?c(na,{}):g("div",{children:[c(j.Group,{className:"d-flex dealership-search-and-filter mb-3",children:g(Gt,{children:[c(Gt.Text,{children:c("i",{className:"bi-search"})}),c(j.Control,{type:"search",placeholder:r.search,value:o,onChange:R=>a(R.target.value)}),c(uh,{variant:"dark",title:c("i",{className:"bi-filter"}),id:"input-group-dropdown-2",align:"end",menuVariant:"dark",children:Object.keys(i).map((R,M)=>c(si.Item,{onClick:()=>u(R),active:s===R,children:R},M))}),c(j.Select,{style:{maxWidth:220},value:l,onChange:R=>f(R.target.value),children:Object.keys(w).map(R=>c("option",{value:R,children:w[R]},R))})]})}),c("div",{className:"pt-0",children:c(G2,{columns:b,data:T,setVehicles:p})})]})},K2=m.forwardRef(({vehicles:e,style:t,className:n,"aria-labelledby":r,selectedVehicle:i,onSelectVehicle:o},a)=>{const{locale:s}=ye(),[u,l]=m.useState(""),[f,h]=m.useState([]);return m.useEffect(()=>{h(e.filter(({brand:p,model:y})=>{const C=u.toLocaleLowerCase().split(" ").filter(x=>x).map(x=>x.trim());return C.filter(x=>`${p||""} ${y||""}`.toLocaleLowerCase().includes(x)).length===C.length}).slice(0,100))},[e,u]),g("div",{ref:a,style:t,className:n,"aria-labelledby":r,children:[c("div",{className:"vehicle-select-search",children:c(j.Control,{autoFocus:!0,placeholder:s.search,onChange:p=>l(p.target.value),value:u})}),c("ul",{className:"list-unstyled",children:f.map(p=>g(si.Item,{eventKey:p.spawn_code,className:"w-full overflow-hidden",onClick:()=>o(p),active:p.spawn_code===(i&&i.spawn_code),children:[p.brand," ",p.model]},p.spawn_code))})]})}),Z2=({vehicles:e,vehicle:t,onChange:n})=>{const{locale:r}=ye();return c("div",{children:g(si,{className:"vehicle-selector-dropdown",children:[c(si.Toggle,{variant:"outline-secondary",className:"d-flex align-items-center overflow-hidden text-muted",style:{width:"100%"},children:t?`${t.brand||""} ${t.model||""}`:r.selectVehicle}),c(si.Menu,{align:"start",as:K2,vehicles:e,selectedVehicle:t,onSelectVehicle:n})]})})},zx=({show:e,onHide:t,currentModel:n,currentColor:r,onSubmit:i})=>{const{event:o,locale:a,config:s}=ye(),[u,l]=m.useState([]),[f,h]=m.useState(!1),[p,y]=m.useState(r||1);m.useEffect(()=>{C()},[]);const C=async()=>{try{const N=await Ne("get-dealership-vehicles",{dealershipId:o.dealershipId});l(N),h(N.find(({spawn_code:w})=>w===n)||!1)}catch{}},x=async()=>{if(!f||!p)return!1;i(f,p),n||h(!1),t()};return g(z,{show:e,onHide:()=>t(),centered:!0,style:{zIndex:9999},children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:a.displayVehicle})}),g(z.Body,{children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:a.vehicle}),c(Z2,{vehicles:u,vehicle:f,onChange:h})]}),g(j.Group,{children:[c(j.Label,{children:a.colour}),c(j.Select,{value:p,onChange:N=>y(parseInt(N.target.value||"1")),children:(s.VehicleColourOptions||[]).map(({label:N},w)=>c("option",{value:w+1,children:N}))})]})]}),c(z.Footer,{children:c(ee,{variant:"primary",type:"submit",disabled:!f||!p,onClick:x,children:a.placeVehicle})})]})},Y2=({displayVehicle:e,setDisplayVehicles:t})=>{const{event:n,locale:r,config:i}=ye(),[o,a]=m.useState(!1),s=async(l,f)=>{try{await Ne("edit-display-vehicle",{id:e.id,dealershipId:n.dealershipId,spawnCode:l.spawn_code,color:f}),t(h=>h.map(p=>p.id===e.id?{...e,brand:l.brand,model:l.model,color:f}:p))}catch{}},u=async()=>{try{await Ne("delete-display-vehicle",{id:e.id,dealershipId:n.dealershipId}),t(l=>l.filter(({id:f})=>f!==e.id))}catch{}};return g(Ue,{border:"secondary",children:[g(Ue.Header,{className:"p-3",children:[e.brand," ",e.model]}),g(Ue.Body,{className:"p-2 d-flex justify-content-between",children:[g(ee,{size:"sm",variant:"dark",onClick:()=>a(!0),children:[c("i",{className:"bi-arrow-left-right me-1"}),r.switchVehicle]}),g(ee,{size:"sm",variant:"outline-danger",onClick:u,children:[c("i",{className:"bi-x me-1"}),r.remove]}),c(zx,{show:o,onHide:()=>a(!1),currentModel:e.vehicle,currentColor:e.color,onSubmit:s})]})]})},Q2=({currentTab:e})=>{const{event:t,onCloseModal:n,locale:r}=ye(),[i,o]=m.useState([]),[a,s]=m.useState(!1),[u,l]=m.useState(!0);m.useEffect(()=>{t.displayVehicles&&o(t.displayVehicles||[])},[t.vehidisplayVehiclescles]),m.useEffect(()=>{e===r.displayVehicles&&f()},[e]);const f=async()=>{try{const y=await Ne("get-dealership-display-vehicles",{dealershipId:t.dealershipId});o(y)}catch{}l(!1)},h=async()=>{await Ne("reset-display-vehicles",{dealershipId:t.dealershipId})},p=async(y,C)=>{await n();try{await Ne("create-display-vehicle",{dealershipId:t.dealershipId,spawnCode:y.spawn_code,color:C})}catch{}};return u?c(na,{}):g("div",{children:[c(zx,{show:a,onHide:()=>s(!1),onSubmit:p}),i.length?g("div",{children:[g("div",{className:"d-flex justify-content-end",children:[g(ee,{variant:"outline-secondary",onClick:()=>h(),className:"me-2",children:[c("i",{className:"bi-arrow-clockwise me-1"}),r.restoreDisplayVehicles]}),g(ee,{variant:"primary",onClick:()=>s(!0),children:[c("i",{className:"bi-plus me-1"}),r.add," ",r.vehicle]})]}),c(ur,{className:"pt-3",children:i.map(y=>c(Xe,{sm:4,className:"mb-3",children:c(Y2,{displayVehicle:y,setDisplayVehicles:o})}))})]}):g("div",{className:"text-center pt-5 pb-5",children:[c("p",{children:r.noDisplayVehicles}),g(ee,{variant:"primary",onClick:()=>s(!0),children:[c("i",{className:"bi-plus me-1"}),r.add," ",r.vehicle]})]})]})},X2=({show:e,onHide:t,onConfirm:n})=>{const{locale:r}=ye();return g(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:r.cancelOrder}),c(z.Body,{children:r.deleteConfirmation}),g(z.Footer,{children:[c(ee,{variant:"primary",onClick:()=>{n(),t()},children:r.yes}),c(ee,{variant:"secondary",onClick:()=>t(),children:r.no})]})]})},J2=({order:e,deleteOrder:t})=>{var w;const{config:n,locale:r,event:i}=ye();let{id:o,order_created:a,brand:s,model:u,quantity:l,time_remaining:f,cost:h}=e;const[p,y]=m.useState(!1),[C,x]=m.useState("");m.useEffect(()=>{const E=()=>{f-=1,f<0?x(r.delivered):Math.round(f/60)===0?x(r.lessThanAMin):x(`${Math.round(f/60)} ${r.mins||"min(s)"}`)};let b;return E(),b=setInterval(()=>E(),5e3),()=>clearInterval(b)},[f]);const N=async()=>{await Ne("cancel-vehicle-order",{orderId:o}),t()};return g("tr",{children:[c("td",{children:(w=de.fromMillis(a))==null?void 0:w.toLocaleString()}),g("td",{className:"admin-vehicle-row-name",children:[s," ",u]}),c("td",{children:l}),c("td",{children:g(vn,{bg:C===r.delivered?"success":"primary",children:[C===r.delivered?c("i",{className:"bi-check-circle me-1"}):c("i",{className:"bi-clock me-1"}),C]})}),c("td",{children:Le(h,n)}),g("td",{className:"text-end",children:[g(ee,{size:"sm",variant:"danger",onClick:()=>y(!0),disabled:C===r.delivered,children:[c("i",{className:"bi-x me-1"}),r.cancelOrder]}),c(X2,{show:p,onHide:()=>y(!1),onConfirm:()=>N()})]})]})},eM=({data:e,columns:t,onDeleteOrder:n})=>{const{locale:r}=ye(),{getTableProps:i,getTableBodyProps:o,headerGroups:a,prepareRow:s,page:u,canPreviousPage:l,canNextPage:f,pageOptions:h,pageCount:p,gotoPage:y,nextPage:C,previousPage:x,setPageSize:N,state:{pageIndex:w,pageSize:E}}=cr.useTable({columns:t,data:e,autoResetPage:!1,autoResetFilters:!1},cr.usePagination);return g("div",{children:[g(ea,{hover:!0,className:"bootstrap-table",...i(),children:[c("thead",{children:a.map(b=>c("tr",{...b.getHeaderGroupProps(),children:b.headers.map(T=>c("th",{...T.getHeaderProps(),children:T.render("Header")}))}))}),c("tbody",{...o(),children:u.length?u.map((b,T)=>c(J2,{order:b.original,deleteOrder:()=>n(b.original.id)},b.original.spawn_code)):c("tr",{children:c("td",{colSpan:100,align:"center",children:r.noOrders})})})]}),g("div",{className:"pagination d-flex justify-content-between",children:[g(ee,{variant:"primary",onClick:()=>x(),disabled:!l,children:[c("i",{className:"bi-arrow-left"})," ",r.previous]}),g("div",{className:"d-flex align-items-center",children:[g("span",{className:"me-3",children:[r.page," ",w+1," ",r.of," ",h.length]}),c(j.Select,{size:"sm",value:E,onChange:b=>{N(Number(b.target.value))},style:{width:110},children:[10,20,30,40,50].map(b=>g("option",{value:b,children:[r.show," ",b]},b))})]}),g(ee,{variant:"primary",onClick:()=>C(),disabled:!f,children:[r.next," ",c("i",{className:"bi-arrow-right"})]})]})]})},tM=({currentTab:e})=>{const{event:t,locale:n}=ye(),[r,i]=m.useState([]),[o,a]=m.useState(!0);m.useEffect(()=>{t.orders&&i(t.orders||[])},[t.orders]),m.useEffect(()=>{e===n.orders&&s()},[e]);const s=async()=>{try{const f=await Ne("get-dealership-orders",{dealershipId:t.dealershipId});i(f)}catch{}a(!1)},u=f=>{i(h=>h.filter(p=>p.id!==f))},l=m.useMemo(()=>[{Header:n.created,accessor:"created_at"},{Header:n.vehicle,accessor:"vehicle"},{Header:n.quantity,accessor:"qty"},{Header:n.delivery,accessor:"delivery"},{Header:n.totalCost,accessor:"total_cost"},{Header:"",accessor:"actions"}],[]);return c("div",{children:o?c(na,{}):c(eM,{data:r,columns:l,onDeleteOrder:u})})},nM=({sale:e})=>{var f;const{config:t}=ye(),{brand:n,model:r,purchase_type:i,paid:o,owed:a,created_at:s,player_name:u,seller_name:l}=e;return g("tr",{children:[c("td",{children:(f=de.fromMillis(s))==null?void 0:f.toLocaleString()}),c("td",{children:u}),c("td",{children:l||"-"}),g("td",{className:"admin-vehicle-row-name",children:[n," ",r]}),c("td",{children:i}),c("td",{children:Le(o,t)}),c("td",{children:Le(a,t)})]})},rM=({data:e,columns:t,getSales:n,pageCount:r})=>{const{locale:i}=ye(),{getTableProps:o,getTableBodyProps:a,headerGroups:s,prepareRow:u,page:l,canPreviousPage:f,canNextPage:h,pageOptions:p,pageCount:y,gotoPage:C,nextPage:x,previousPage:N,setPageSize:w,state:{pageIndex:E,pageSize:b}}=cr.useTable({columns:t,data:e,initialState:{pageIndex:0},pageCount:r,autoResetPage:!1,autoResetFilters:!1,manualPagination:!0},cr.usePagination);return m.useEffect(()=>{n(E,b)},[n,E,b]),g("div",{children:[g(ea,{hover:!0,className:"bootstrap-table",...o(),children:[c("thead",{children:s.map(T=>c("tr",{...T.getHeaderGroupProps(),children:T.headers.map(R=>c("th",{...R.getHeaderProps(),children:R.render("Header")}))}))}),c("tbody",{...a(),children:l.length?l.map((T,R)=>c(nM,{sale:T.original},T.original.spawn_code)):c("tr",{children:c("td",{colSpan:100,align:"center",children:i.noSales})})})]}),g("div",{className:"pagination d-flex justify-content-between",children:[g(ee,{variant:"primary",onClick:N,disabled:E<=0,children:[c("i",{className:"bi-arrow-left"})," ",i.previous]}),g("div",{className:"d-flex align-items-center",children:[g("span",{className:"me-3",children:[i.page," ",E+1," ",i.of," ",y]}),c(j.Select,{size:"sm",value:b,onChange:T=>{w(Number(T.target.value))},style:{width:110},children:[10,20,30,40,50].map(T=>g("option",{value:T,children:[i.show," ",T]},T))})]}),g(ee,{variant:"primary",onClick:x,disabled:!h,children:[i.next," ",c("i",{className:"bi-arrow-right"})]})]})]})},iM=({currentTab:e})=>{const{event:t,locale:n}=ye(),[r,i]=m.useState(0),[o,a]=m.useState([]),[s,u]=m.useState(!0);m.useEffect(()=>{t.sales&&a(t.sales||[]),t.salesPageCount&&i(t.salesPageCount||0)},[t.sales]),m.useEffect(()=>{e===n.sales&&l(0,10)},[e]);const l=m.useCallback(async(h,p)=>{try{const y=await Ne("get-dealership-sales",{dealershipId:t.dealershipId,pageIndex:h,pageSize:p});a(y.sales),i(y.pageCount)}catch{}u(!1)},[]),f=m.useMemo(()=>[{Header:n.created,accessor:"created_at"},{Header:n.customer,accessor:"player_name"},{Header:n.salesRep,accessor:"seller_name"},{Header:n.vehicle,accessor:"vehicle"},{Header:n.purchaseType,accessor:"purchase_type"},{Header:n.paid,accessor:"paid"},{Header:n.owed,accessor:"owed"}],[]);return c("div",{children:s?c(na,{}):c(rM,{data:o,columns:f,getSales:l,pageCount:r})})},oM=({role:e,show:t,onHide:n,onUpdateRole:r})=>{const{locale:i}=ye(),[o,a]=m.useState(e),s=[{id:"manager",label:i.managerRole},{id:"supervisor",label:i.supervisorRole},{id:"sales",label:i.salesRole}],u=l=>{l.preventDefault(),r({role:o}),n()};return g(z,{show:t,onHide:()=>n(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:"Change Role"})}),c(z.Body,{children:g(j,{onSubmit:u,children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:"Role"}),c(j.Select,{value:o,onChange:l=>a(l.target.value),children:s.map(({id:l,label:f})=>c("option",{value:l,children:f},l))})]}),c(ee,{type:"submit",children:"Update Role"})]})})]})},aM=({show:e,onHide:t,onConfirm:n})=>g(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:"Fire Employee"})}),c(z.Body,{children:"Are you sure?"}),g(z.Footer,{children:[c(ee,{variant:"primary",onClick:()=>{n(),t()},children:"Yes"}),c(ee,{variant:"secondary",onClick:()=>t(),children:"No"})]})]}),sM=({employee:e,afterFireEmployee:t,afterUpdateEmployee:n})=>{var h;const{event:r,locale:i}=ye(),[o,a]=m.useState(!1),[s,u]=m.useState(!1),l=async p=>{await Ne("update-employee-role",{identifier:e.identifier,dealershipId:r.dealershipId,newRole:p.role}),n({...e,...p})},f=async()=>{await Ne("fire-employee",{identifier:e.identifier,dealershipId:r.dealershipId}),t()};return g("tr",{children:[c("td",{children:e.name}),g("td",{children:[c("span",{children:i[`${e.role}Role`]}),!e.me&&!e.pending&&g("span",{children:[c(ee,{size:"sm",variant:"link",className:"me-2",onClick:()=>a(!0),children:c("i",{className:"bi-pencil"})}),c(oM,{role:e.role,show:o,onHide:()=>a(!1),onUpdateRole:l})]})]}),c("td",{children:e.joined&&((h=de.fromMillis(e.joined))==null?void 0:h.toLocaleString(i.NumberAndDateFormat))}),c("td",{className:"text-end",children:e.pending?c(ee,{size:"sm",disabled:!0,variant:"muted",children:i.pending}):e.me?c(ee,{size:"sm",disabled:!0,variant:"muted",children:"You"}):g("div",{children:[g(ee,{size:"sm",variant:"danger",onClick:()=>u(!0),children:[c("i",{className:"bi-person-x-fill me-1"}),"Fire"]}),c(aM,{show:s,onHide:()=>u(!1),onConfirm:()=>f()})]})})]})},lM=({show:e,onHide:t,afterHireEmployee:n,nearbyPlayers:r})=>{const{event:i,locale:o}=ye(),[a,s]=m.useState(""),[u,l]=m.useState("manager"),f=[{id:"manager",label:o.managerRole},{id:"supervisor",label:o.supervisorRole},{id:"sales",label:o.salesRole}],h=async p=>{var y;if(p.preventDefault(),!a)return!1;await Ne("request-hire-employee",{dealershipId:i.dealershipId,playerId:parseInt(a),role:u}),n({name:(y=r.find(({id:C})=>C===a))==null?void 0:y.name,role:u,me:!1,pending:!0}),t()};return g(z,{show:e,onHide:()=>t(),style:{zIndex:999999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:"Hire Employee"})}),c(z.Body,{children:g("form",{onSubmit:h,children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:"Nearby players"}),g(j.Select,{value:a,onChange:p=>s(p.target.value),children:[c("option",{value:"",disabled:!0,children:r.length?"Select player":"No players nearby"}),r.map(({id:p,name:y})=>c("option",{value:p,children:y},p))]})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:"Role"}),c(j.Select,{value:u,onChange:p=>l(p.target.value),children:f.map(({id:p,label:y})=>c("option",{value:p,children:y},p))})]}),c(ee,{type:"submit",disabled:!a,children:"Hire Employee"})]})})]})},uM=({currentTab:e})=>{const{event:t,locale:n}=ye(),[r,i]=m.useState(!0),[o,a]=m.useState(!1),[s,u]=m.useState([]),l=t.nearbyPlayers.filter(({identifier:C})=>!s.map(({identifier:x})=>x).includes(C)&&t.ownerId!==C)||[];m.useEffect(()=>{t.employees&&u(t.employees||[])},[t.employees]),m.useEffect(()=>{e===n.employees&&f()},[e]);const f=async()=>{try{const C=await Ne("get-dealership-employees",{dealershipId:t.dealershipId});u(C)}catch{}i(!1)},h=C=>{u(s.filter(x=>x.identifier!==C))},p=(C,x)=>{u(s.map(N=>N.identifier===C?x:N))};return c("div",{children:r?c(na,{}):g("div",{children:[g("div",{className:"d-flex justify-content-end mb-3",children:[g(ee,{onClick:()=>a(!0),variant:"primary",children:[c("i",{className:"bi-person-plus-fill me-1"}),c("span",{children:"Hire Employee"})]}),c(lM,{show:o,onHide:()=>a(!1),afterHireEmployee:C=>{u(x=>[...x,C])},nearbyPlayers:l})]}),g(ea,{hover:!0,className:"bootstrap-table",children:[c("thead",{children:g("tr",{children:[c("th",{children:"Employee Name"}),c("th",{children:"Role"}),c("th",{children:"Joined"}),c("th",{})]})}),c("tbody",{children:s.length?s.map(C=>c(sM,{employee:C,afterFireEmployee:()=>h(C.identifier),afterUpdateEmployee:x=>p(x.identifier,x)},C.identifier)):c("tr",{children:c("td",{colSpan:4,align:"center",children:"No employees"})})})]})]})})};var Zy=Array.isArray,Yy=Object.keys,cM=Object.prototype.hasOwnProperty,dM=typeof Element<"u";function Of(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Zy(e),r=Zy(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!Of(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,u=t instanceof Date;if(s!=u)return!1;if(s&&u)return e.getTime()==t.getTime();var l=e instanceof RegExp,f=t instanceof RegExp;if(l!=f)return!1;if(l&&f)return e.toString()==t.toString();var h=Yy(e);if(o=h.length,o!==Yy(t).length)return!1;for(i=o;i--!==0;)if(!cM.call(t,h[i]))return!1;if(dM&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!Of(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var fM=function(t,n){try{return Of(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Ti=fi(fM);var pM=function(t){return hM(t)&&!mM(t)};function hM(e){return!!e&&typeof e=="object"}function mM(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||gM(e)}var vM=typeof Symbol=="function"&&Symbol.for,yM=vM?Symbol.for("react.element"):60103;function gM(e){return e.$$typeof===yM}function wM(e){return Array.isArray(e)?[]:{}}function cu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?ps(wM(e),e,t):e}function SM(e,t,n){return e.concat(t).map(function(r){return cu(r,n)})}function xM(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=cu(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=cu(t[i],n):r[i]=ps(e[i],t[i],n)}),r}function ps(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||SM,n.isMergeableObject=n.isMergeableObject||pM;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):xM(e,t,n):cu(t,n)}ps.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return ps(r,i,n)},{})};var Rf=ps,CM=typeof global=="object"&&global&&global.Object===Object&&global;const Vx=CM;var bM=typeof self=="object"&&self&&self.Object===Object&&self,EM=Vx||bM||Function("return this")();const dr=EM;var kM=dr.Symbol;const di=kM;var Hx=Object.prototype,TM=Hx.hasOwnProperty,NM=Hx.toString,ka=di?di.toStringTag:void 0;function OM(e){var t=TM.call(e,ka),n=e[ka];try{e[ka]=void 0;var r=!0}catch{}var i=NM.call(e);return r&&(t?e[ka]=n:delete e[ka]),i}var RM=Object.prototype,_M=RM.toString;function PM(e){return _M.call(e)}var MM="[object Null]",$M="[object Undefined]",Qy=di?di.toStringTag:void 0;function Xi(e){return e==null?e===void 0?$M:MM:Qy&&Qy in Object(e)?OM(e):PM(e)}function Wx(e,t){return function(n){return e(t(n))}}var IM=Wx(Object.getPrototypeOf,Object);const _h=IM;function Ji(e){return e!=null&&typeof e=="object"}var FM="[object Object]",DM=Function.prototype,AM=Object.prototype,Ux=DM.toString,LM=AM.hasOwnProperty,jM=Ux.call(Object);function Xy(e){if(!Ji(e)||Xi(e)!=FM)return!1;var t=_h(e);if(t===null)return!0;var n=LM.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ux.call(n)==jM}function BM(){this.__data__=[],this.size=0}function Gx(e,t){return e===t||e!==e&&t!==t}function zu(e,t){for(var n=e.length;n--;)if(Gx(e[n][0],t))return n;return-1}var zM=Array.prototype,VM=zM.splice;function HM(e){var t=this.__data__,n=zu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():VM.call(t,n,1),--this.size,!0}function WM(e){var t=this.__data__,n=zu(t,e);return n<0?void 0:t[n][1]}function UM(e){return zu(this.__data__,e)>-1}function GM(e,t){var n=this.__data__,r=zu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Fr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=J$}var eI="[object Arguments]",tI="[object Array]",nI="[object Boolean]",rI="[object Date]",iI="[object Error]",oI="[object Function]",aI="[object Map]",sI="[object Number]",lI="[object Object]",uI="[object RegExp]",cI="[object Set]",dI="[object String]",fI="[object WeakMap]",pI="[object ArrayBuffer]",hI="[object DataView]",mI="[object Float32Array]",vI="[object Float64Array]",yI="[object Int8Array]",gI="[object Int16Array]",wI="[object Int32Array]",SI="[object Uint8Array]",xI="[object Uint8ClampedArray]",CI="[object Uint16Array]",bI="[object Uint32Array]",ot={};ot[mI]=ot[vI]=ot[yI]=ot[gI]=ot[wI]=ot[SI]=ot[xI]=ot[CI]=ot[bI]=!0;ot[eI]=ot[tI]=ot[pI]=ot[nI]=ot[hI]=ot[rI]=ot[iI]=ot[oI]=ot[aI]=ot[sI]=ot[lI]=ot[uI]=ot[cI]=ot[dI]=ot[fI]=!1;function EI(e){return Ji(e)&&Jx(e.length)&&!!ot[Xi(e)]}function Ph(e){return function(t){return e(t)}}var eC=typeof pn=="object"&&pn&&!pn.nodeType&&pn,qa=eC&&typeof hn=="object"&&hn&&!hn.nodeType&&hn,kI=qa&&qa.exports===eC,ld=kI&&Vx.process,TI=function(){try{var e=qa&&qa.require&&qa.require("util").types;return e||ld&&ld.binding&&ld.binding("util")}catch{}}();const Go=TI;var ig=Go&&Go.isTypedArray,NI=ig?Ph(ig):EI;const OI=NI;var RI=Object.prototype,_I=RI.hasOwnProperty;function tC(e,t){var n=Ps(e),r=!n&&W$(e),i=!n&&!r&&Xx(e),o=!n&&!r&&!i&&OI(e),a=n||r||i||o,s=a?j$(e.length,String):[],u=s.length;for(var l in e)(t||_I.call(e,l))&&!(a&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||X$(l,u)))&&s.push(l);return s}var PI=Object.prototype;function Mh(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||PI;return e===n}var MI=Wx(Object.keys,Object);const $I=MI;var II=Object.prototype,FI=II.hasOwnProperty;function DI(e){if(!Mh(e))return $I(e);var t=[];for(var n in Object(e))FI.call(e,n)&&n!="constructor"&&t.push(n);return t}function nC(e){return e!=null&&Jx(e.length)&&!qx(e)}function $h(e){return nC(e)?tC(e):DI(e)}function AI(e,t){return e&&Hu(t,$h(t),e)}function LI(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var jI=Object.prototype,BI=jI.hasOwnProperty;function zI(e){if(!_s(e))return LI(e);var t=Mh(e),n=[];for(var r in e)r=="constructor"&&(t||!BI.call(e,r))||n.push(r);return n}function Ih(e){return nC(e)?tC(e,!0):zI(e)}function VI(e,t){return e&&Hu(t,Ih(t),e)}var rC=typeof pn=="object"&&pn&&!pn.nodeType&&pn,og=rC&&typeof hn=="object"&&hn&&!hn.nodeType&&hn,HI=og&&og.exports===rC,ag=HI?dr.Buffer:void 0,sg=ag?ag.allocUnsafe:void 0;function WI(e,t){if(t)return e.slice();var n=e.length,r=sg?sg(n):new e.constructor(n);return e.copy(r),r}function iC(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}var Tn=function(t){return typeof t=="function"},ec=function(t){return t!==null&&typeof t=="object"},GD=function(t){return String(Math.floor(Number(t)))===t},ud=function(t){return Object.prototype.toString.call(t)==="[object String]"},qD=function(t){return m.Children.count(t)===0},cd=function(t){return ec(t)&&Tn(t.then)};function Nn(e,t,n,r){r===void 0&&(r=0);for(var i=hC(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function SC(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?ae.map(function(he){return A(he,Nn(D,he))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(fe).then(function(he){return he.reduce(function(Pe,le,qe){return le==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||le&&(Pe=Di(Pe,ae[qe],le)),Pe},{})})},[A]),$=m.useCallback(function(D){return Promise.all([I(D),p.validationSchema?F(D):{},p.validate?M(D):{}]).then(function(ae){var fe=ae[0],he=ae[1],Pe=ae[2],le=Rf.all([fe,he,Pe],{arrayMerge:eA});return le})},[p.validate,p.validationSchema,I,M,F]),W=kn(function(D){return D===void 0&&(D=T.values),R({type:"SET_ISVALIDATING",payload:!0}),$(D).then(function(ae){return w.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:ae})),ae})});m.useEffect(function(){a&&w.current===!0&&Ti(y.current,p.initialValues)&&W(y.current)},[a,W]);var Z=m.useCallback(function(D){var ae=D&&D.values?D.values:y.current,fe=D&&D.errors?D.errors:C.current?C.current:p.initialErrors||{},he=D&&D.touched?D.touched:x.current?x.current:p.initialTouched||{},Pe=D&&D.status?D.status:N.current?N.current:p.initialStatus;y.current=ae,C.current=fe,x.current=he,N.current=Pe;var le=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!D&&!!D.isSubmitting,errors:fe,touched:he,status:Pe,values:ae,isValidating:!!D&&!!D.isValidating,submitCount:D&&D.submitCount&&typeof D.submitCount=="number"?D.submitCount:0}})};if(p.onReset){var qe=p.onReset(T.values,qt);cd(qe)?qe.then(le):le()}else le()},[p.initialErrors,p.initialStatus,p.initialTouched]);m.useEffect(function(){w.current===!0&&!Ti(y.current,p.initialValues)&&(l&&(y.current=p.initialValues,Z()),a&&W(y.current))},[l,p.initialValues,Z,a,W]),m.useEffect(function(){l&&w.current===!0&&!Ti(C.current,p.initialErrors)&&(C.current=p.initialErrors||Ci,R({type:"SET_ERRORS",payload:p.initialErrors||Ci}))},[l,p.initialErrors]),m.useEffect(function(){l&&w.current===!0&&!Ti(x.current,p.initialTouched)&&(x.current=p.initialTouched||dl,R({type:"SET_TOUCHED",payload:p.initialTouched||dl}))},[l,p.initialTouched]),m.useEffect(function(){l&&w.current===!0&&!Ti(N.current,p.initialStatus)&&(N.current=p.initialStatus,R({type:"SET_STATUS",payload:p.initialStatus}))},[l,p.initialStatus,p.initialTouched]);var G=kn(function(D){if(E.current[D]&&Tn(E.current[D].validate)){var ae=Nn(T.values,D),fe=E.current[D].validate(ae);return cd(fe)?(R({type:"SET_ISVALIDATING",payload:!0}),fe.then(function(he){return he}).then(function(he){R({type:"SET_FIELD_ERROR",payload:{field:D,value:he}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:D,value:fe}}),Promise.resolve(fe))}else if(p.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),F(T.values,D).then(function(he){return he}).then(function(he){R({type:"SET_FIELD_ERROR",payload:{field:D,value:he[D]}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),te=m.useCallback(function(D,ae){var fe=ae.validate;E.current[D]={validate:fe}},[]),Oe=m.useCallback(function(D){delete E.current[D]},[]),ge=kn(function(D,ae){R({type:"SET_TOUCHED",payload:D});var fe=ae===void 0?i:ae;return fe?W(T.values):Promise.resolve()}),xe=m.useCallback(function(D){R({type:"SET_ERRORS",payload:D})},[]),U=kn(function(D,ae){var fe=Tn(D)?D(T.values):D;R({type:"SET_VALUES",payload:fe});var he=ae===void 0?n:ae;return he?W(fe):Promise.resolve()}),re=m.useCallback(function(D,ae){R({type:"SET_FIELD_ERROR",payload:{field:D,value:ae}})},[]),ne=kn(function(D,ae,fe){R({type:"SET_FIELD_VALUE",payload:{field:D,value:ae}});var he=fe===void 0?n:fe;return he?W(Di(T.values,D,ae)):Promise.resolve()}),ke=m.useCallback(function(D,ae){var fe=ae,he=D,Pe;if(!ud(D)){D.persist&&D.persist();var le=D.target?D.target:D.currentTarget,qe=le.type,It=le.name,fr=le.id,la=le.value,ac=le.checked,Yh=le.outerHTML,Ms=le.options,sc=le.multiple;fe=ae||It||fr,he=/number|range/.test(qe)?(Pe=parseFloat(la),isNaN(Pe)?"":Pe):/checkbox/.test(qe)?nA(Nn(T.values,fe),ac,la):Ms&&sc?tA(Ms):la}fe&&ne(fe,he)},[ne,T.values]),_e=kn(function(D){if(ud(D))return function(ae){return ke(ae,D)};ke(D)}),Je=kn(function(D,ae,fe){ae===void 0&&(ae=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:D,value:ae}});var he=fe===void 0?i:fe;return he?W(T.values):Promise.resolve()}),rt=m.useCallback(function(D,ae){D.persist&&D.persist();var fe=D.target,he=fe.name,Pe=fe.id,le=fe.outerHTML,qe=ae||he||Pe;Je(qe,!0)},[Je]),ht=kn(function(D){if(ud(D))return function(ae){return rt(ae,D)};rt(D)}),ct=m.useCallback(function(D){Tn(D)?R({type:"SET_FORMIK_STATE",payload:D}):R({type:"SET_FORMIK_STATE",payload:function(){return D}})},[]),Ot=m.useCallback(function(D){R({type:"SET_STATUS",payload:D})},[]),Rt=m.useCallback(function(D){R({type:"SET_ISSUBMITTING",payload:D})},[]),jt=kn(function(){return R({type:"SUBMIT_ATTEMPT"}),W().then(function(D){var ae=D instanceof Error,fe=!ae&&Object.keys(D).length===0;if(fe){var he;try{if(he=Bn(),he===void 0)return}catch(Pe){throw Pe}return Promise.resolve(he).then(function(Pe){return w.current&&R({type:"SUBMIT_SUCCESS"}),Pe}).catch(function(Pe){if(w.current)throw R({type:"SUBMIT_FAILURE"}),Pe})}else if(w.current&&(R({type:"SUBMIT_FAILURE"}),ae))throw D})}),er=kn(function(D){D&&D.preventDefault&&Tn(D.preventDefault)&&D.preventDefault(),D&&D.stopPropagation&&Tn(D.stopPropagation)&&D.stopPropagation(),jt().catch(function(ae){console.warn("Warning: An unhandled error was caught from submitForm()",ae)})}),qt={resetForm:Z,validateForm:W,validateField:G,setErrors:xe,setFieldError:re,setFieldTouched:Je,setFieldValue:ne,setStatus:Ot,setSubmitting:Rt,setTouched:ge,setValues:U,setFormikState:ct,submitForm:jt},Bn=kn(function(){return f(T.values,qt)}),tn=kn(function(D){D&&D.preventDefault&&Tn(D.preventDefault)&&D.preventDefault(),D&&D.stopPropagation&&Tn(D.stopPropagation)&&D.stopPropagation(),Z()}),Ge=m.useCallback(function(D){return{value:Nn(T.values,D),error:Nn(T.errors,D),touched:!!Nn(T.touched,D),initialValue:Nn(y.current,D),initialTouched:!!Nn(x.current,D),initialError:Nn(C.current,D)}},[T.errors,T.touched,T.values]),gi=m.useCallback(function(D){return{setValue:function(fe,he){return ne(D,fe,he)},setTouched:function(fe,he){return Je(D,fe,he)},setError:function(fe){return re(D,fe)}}},[ne,Je,re]),Dr=m.useCallback(function(D){var ae=ec(D),fe=ae?D.name:D,he=Nn(T.values,fe),Pe={name:fe,value:he,onChange:_e,onBlur:ht};if(ae){var le=D.type,qe=D.value,It=D.as,fr=D.multiple;le==="checkbox"?qe===void 0?Pe.checked=!!he:(Pe.checked=!!(Array.isArray(he)&&~he.indexOf(qe)),Pe.value=qe):le==="radio"?(Pe.checked=he===qe,Pe.value=qe):It==="select"&&fr&&(Pe.value=Pe.value||[],Pe.multiple=!0)}return Pe},[ht,_e,T.values]),tr=m.useMemo(function(){return!Ti(y.current,T.values)},[y.current,T.values]),wi=m.useMemo(function(){return typeof s<"u"?tr?T.errors&&Object.keys(T.errors).length===0:s!==!1&&Tn(s)?s(p):s:T.errors&&Object.keys(T.errors).length===0},[s,tr,T.errors,p]),Si=Ft({},T,{initialValues:y.current,initialErrors:C.current,initialTouched:x.current,initialStatus:N.current,handleBlur:ht,handleChange:_e,handleReset:tn,handleSubmit:er,resetForm:Z,setErrors:xe,setFormikState:ct,setFieldTouched:Je,setFieldValue:ne,setFieldError:re,setStatus:Ot,setSubmitting:Rt,setTouched:ge,setValues:U,submitForm:jt,validateForm:W,validateField:G,isValid:wi,dirty:tr,unregisterField:Oe,registerField:te,getFieldProps:Dr,getFieldMeta:Ge,getFieldHelpers:gi,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return Si}function xC(e){var t=QD(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return m.useImperativeHandle(o,function(){return t}),m.createElement(KD,{value:t},n?m.createElement(n,t):i?i(t):r?Tn(r)?r(t):qD(r)?null:m.Children.only(r):null)}function XD(e){var t={};if(e.inner){if(e.inner.length===0)return Di(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Nn(t,a.path)||(t=Di(t,a.path,a.message))}}return t}function JD(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=If(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function If(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||Xy(i)?If(i):i!==""?i:void 0}):Xy(e[r])?t[r]=If(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function eA(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,u=s&&n.isMergeableObject(o);r[a]=u?Rf(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=Rf(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function tA(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function nA(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var rA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?m.useLayoutEffect:m.useEffect;function kn(e){var t=m.useRef(e);return rA(function(){t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var oA=/[^.^\]^[]+|(?=\[\]|\.\.)/g,CC=/^\d+$/,aA=/^\d/,sA=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,lA=/^\s*(['"]?)(.*?)(\1)\s*$/,Hh=512,bg=new no(Hh),Eg=new no(Hh),kg=new no(Hh),Ai={Cache:no,split:Ff,normalizePath:dd,setter:function(e){var t=dd(e);return Eg.get(e)||Eg.set(e,function(r,i){for(var o=0,a=t.length,s=r;oe.match(pA)||[],rc=e=>e[0].toUpperCase()+e.slice(1),Uh=(e,t)=>nc(e).join(t).toLowerCase(),bC=e=>nc(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),hA=e=>rc(bC(e)),mA=e=>Uh(e,"_"),vA=e=>Uh(e,"-"),yA=e=>rc(Uh(e," ")),gA=e=>nc(e).map(rc).join(" ");var fd={words:nc,upperFirst:rc,camelCase:bC,pascalCase:hA,snakeCase:mA,kebabCase:vA,sentenceCase:yA,titleCase:gA},Gh={exports:{}};Gh.exports=function(e){return EC(wA(e),e)};Gh.exports.array=EC;function EC(e,t){var n=e.length,r=new Array(n),i={},o=n,a=SA(t),s=xA(e);for(t.forEach(function(l){if(!s.has(l[0])||!s.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});o--;)i[o]||u(e[o],o,new Set);return r;function u(l,f,h){if(h.has(l)){var p;try{p=", node was:"+JSON.stringify(l)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!i[f]){i[f]=!0;var y=a.get(l)||new Set;if(y=Array.from(y),f=y.length){h.add(l);do{var C=y[--f];u(C,s.get(C),h)}while(f);h.delete(l)}r[--n]=l}}}function wA(e){for(var t=new Set,n=0,r=e.length;n"",OA=/^Symbol\((.*)\)(.*)$/;function RA(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Tg(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return RA(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return NA.call(e).replace(OA,"Symbol($1)");const r=EA.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+kA.call(e)+"]":r==="RegExp"?TA.call(e):null}function Li(e,t){let n=Tg(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let o=Tg(this[r],t);return o!==null?o:i},2)}function kC(e){return e==null?[]:[].concat(e)}let _A=/\$\{\s*(\w+)\s*\}/g;class dn extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(_A,(i,o)=>Li(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],kC(t).forEach(o=>{dn.isError(o)?(this.errors.push(...o.errors),this.inner=this.inner.concat(o.inner.length?o.inner:o)):this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,dn)}}let vr={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${Li(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Li(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${Li(n,!0)}\``+i}},Wn={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",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},zr={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"},Df={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Af={isValue:"${path} field must be ${value}"},Lf={noUnknown:"${path} field has unspecified keys: ${unknown}"},_l={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"};Object.assign(Object.create(null),{mixed:vr,string:Wn,number:zr,date:Df,object:Lf,array:_l,boolean:Af});const ic=e=>e&&e.__isYupSchema__;class du{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:o}=n,a=typeof r=="function"?r:(...s)=>s.every(u=>u===r);return new du(t,(s,u)=>{var l;let f=a(...s)?i:o;return(l=f==null?void 0:f(u))!=null?l:u})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!ic(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const fl={context:"$",value:"."};class ro{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===fl.context,this.isValue=this.key[0]===fl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?fl.context:this.isValue?fl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Ai.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ro.prototype.__isYupRef=!0;const $n=e=>e==null;function co(e){function t({value:n,path:r="",options:i,originalValue:o,schema:a},s,u){const{name:l,test:f,params:h,message:p,skipAbsent:y}=e;let{parent:C,context:x,abortEarly:N=a.spec.abortEarly}=i;function w($){return ro.isRef($)?$.getValue(n,C,x):$}function E($={}){const W=Object.assign({value:n,originalValue:o,label:a.spec.label,path:$.path||r,spec:a.spec},h,$.params);for(const G of Object.keys(W))W[G]=w(W[G]);const Z=new dn(dn.formatError($.message||p,W),n,W.path,$.type||l);return Z.params=W,Z}const b=N?s:u;let T={path:r,parent:C,type:l,from:i.from,createError:E,resolve:w,options:i,originalValue:o,schema:a};const R=$=>{dn.isError($)?b($):$?u(null):b(E())},M=$=>{dn.isError($)?b($):s($)},F=y&&$n(n);if(!i.sync){try{Promise.resolve(F?!0:f.call(T,n,T)).then(R,M)}catch($){M($)}return}let A;try{var I;if(A=F?!0:f.call(T,n,T),typeof((I=A)==null?void 0:I.then)=="function")throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch($){M($);return}R(A)}return t.OPTIONS=e,t}function PA(e,t,n,r=n){let i,o,a;return t?(Ai.forEach(t,(s,u,l)=>{let f=u?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:i,value:n});let h=e.type==="tuple",p=l?parseInt(f,10):0;if(e.innerType||h){if(h&&!l)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${a}" must contain an index to the tuple element, e.g. "${a}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=h?e.spec.types[p]:e.innerType}if(!l){if(!e.fields||!e.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${a} which is a type: "${e.type}")`);i=n,n=n&&n[f],e=e.fields[f]}o=f,a=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:o}):{parent:i,parentPath:t,schema:e}}class fu extends Set{describe(){const t=[];for(const n of this.values())t.push(ro.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new fu(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function ko(e,t=new Map){if(ic(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r{this.typeError(vr.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=ko(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(o=>{t.tests.forEach(a=>{o.test(a.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,o)=>o.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",o=r._cast(t,n);if(n.assert!==!1&&!r.isType(o)){if(i&&$n(o))return o;let a=Li(t),s=Li(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". attempted value: ${a} `+(s!==a?`result of cast: ${s}`:""))}return o}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,o)=>o.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r,i){let{path:o,originalValue:a=t,strict:s=this.spec.strict}=n,u=t;s||(u=this._cast(u,Object.assign({assert:!1},n)));let l=[];for(let f of Object.values(this.internalTests))f&&l.push(f);this.runTests({path:o,value:u,originalValue:a,options:n,tests:l},r,f=>{if(f.length)return i(f,u);this.runTests({path:o,value:u,originalValue:a,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:o,value:a,originalValue:s,path:u,options:l}=t,f=x=>{i||(i=!0,n(x,a))},h=x=>{i||(i=!0,r(x,a))},p=o.length,y=[];if(!p)return h([]);let C={value:a,originalValue:s,path:u,options:l,schema:this};for(let x=0;xthis.resolve(f)._validate(l,f,p,y)}validate(t,n){let r=this.resolve(Object.assign({},n,{value:t}));return new Promise((i,o)=>r._validate(t,n,(a,s)=>{dn.isError(a)&&(a.value=s),o(a)},(a,s)=>{a.length?o(new dn(a,s)):i(s)}))}validateSync(t,n){let r=this.resolve(Object.assign({},n,{value:t})),i;return r._validate(t,Object.assign({},n,{sync:!0}),(o,a)=>{throw dn.isError(o)&&(o.value=a),o},(o,a)=>{if(o.length)throw new dn(o,t);i=a}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(dn.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(dn.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):ko(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=co({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=co({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=vr.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=vr.notNull){return this.nullability(!1,t)}required(t=vr.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=vr.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=co(n),o=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(a=>!(a.OPTIONS.name===n.name&&(o||a.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=kC(t).map(o=>new ro(o));return i.forEach(o=>{o.isSibling&&r.deps.push(o.key)}),r.conditions.push(typeof n=="function"?new du(i,n):du.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=co({message:t,name:"typeError",test(r){return!$n(r)&&!this.schema._typeCheck(r)?this.createError({params:{type:this.schema.type}}):!0}}),n}oneOf(t,n=vr.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=co({message:n,name:"oneOf",skipAbsent:!0,test(i){let o=this.schema._whitelist,a=o.resolveAll(this.resolve);return a.includes(i)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:a}})}}),r}notOneOf(t,n=vr.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=co({message:n,name:"notOneOf",test(i){let o=this.schema._blacklist,a=o.resolveAll(this.resolve);return a.includes(i)?this.createError({params:{values:Array.from(o).join(", "),resolved:a}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:o,nullable:a}=n.spec;return{meta:i,label:r,optional:o,nullable:a,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(u=>({name:u.OPTIONS.name,params:u.OPTIONS.params})).filter((u,l,f)=>f.findIndex(h=>h.name===u.name)===l)}}}wn.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])wn.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:o,schema:a}=PA(this,t,n,r.context);return a[e](i&&i[o],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])wn.prototype[e]=wn.prototype.oneOf;for(const e of["not","nope"])wn.prototype[e]=wn.prototype.notOneOf;function TC(){return new NC}class NC extends wn{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(r.spec.coerce&&!r.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Af.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return $n(n)||n===!0}})}isFalse(t=Af.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return $n(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}TC.prototype=NC.prototype;let MA=/^[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])?)*$/,$A=/^((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,IA=/^(?:[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,FA=e=>$n(e)||e===e.trim(),DA={}.toString();function Oi(){return new OC}class OC extends wn{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===DA?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||vr.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Wn.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Wn.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Wn.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,o;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:o}=n:i=n),this.test({name:o||"matches",message:i||Wn.matches,params:{regex:t},skipAbsent:!0,test:a=>a===""&&r||a.search(t)!==-1})}email(t=Wn.email){return this.matches(MA,{name:"email",message:t,excludeEmptyString:!0})}url(t=Wn.url){return this.matches($A,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Wn.uuid){return this.matches(IA,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Wn.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:FA})}lowercase(t=Wn.lowercase){return this.transform(n=>$n(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>$n(n)||n===n.toLowerCase()})}uppercase(t=Wn.uppercase){return this.transform(n=>$n(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>$n(n)||n===n.toUpperCase()})}}Oi.prototype=OC.prototype;let AA=e=>e!=+e;function qh(){return new RC}class RC extends wn{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!AA(t)}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return r.isType(i)?i:parseFloat(i)})})}min(t,n=zr.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r>=this.resolve(t)}})}max(t,n=zr.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r<=this.resolve(t)}})}lessThan(t,n=zr.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(r){return rthis.resolve(t)}})}positive(t=zr.positive){return this.moreThan(0,t)}negative(t=zr.negative){return this.lessThan(0,t)}integer(t=zr.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>$n(t)?t:t|0)}round(t){var n;let r=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(r.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(i=>$n(i)?i:Math[t](i))}}qh.prototype=RC.prototype;var LA=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function jA(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=LA.exec(e)){for(var o=0,a;a=t[o];++o)i[a]=+i[a]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let BA=new Date(""),zA=e=>Object.prototype.toString.call(e)==="[object Date]";class oc extends wn{constructor(){super({type:"date",check(t){return zA(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)?t:(t=jA(t),isNaN(t)?oc.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ro.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Df.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Df.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}oc.INVALID_DATE=BA;oc.prototype;function VA(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([a,s])=>`${a}-${s}`));function o(a,s){let u=Ai.split(a)[0];r.add(u),i.has(`${s}-${u}`)||n.push([s,u])}for(const a of Object.keys(e)){let s=e[a];r.add(a),ro.isRef(s)&&s.isSibling?o(s.path,a):ic(s)&&"deps"in s&&s.deps.forEach(u=>o(u,a))}return bA.array(Array.from(r),n).reverse()}function Ng(e,t){let n=1/0;return e.some((r,i)=>{var o;if((o=t.path)!=null&&o.includes(r))return n=i,!0}),n}function _C(e){return(t,n)=>Ng(e,t)-Ng(e,n)}const PC=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function Pl(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Pl(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Pl(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Pl)}):"optional"in e?e.optional():e}const HA=(e,t)=>{const n=[...Ai.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Ai.getter(Ai.join(n),!0)(e);return!!(i&&r in i)};let Og=e=>Object.prototype.toString.call(e)==="[object Object]";function WA(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const UA=_C([]);function Kh(e){return new MC(e)}class MC extends wn{constructor(t){super({type:"object",check(n){return Og(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=UA,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let o=this.fields,a=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(h=>!this._nodes.includes(h))),u={},l=Object.assign({},n,{parent:u,__validating:n.__validating||!1}),f=!1;for(const h of s){let p=o[h],y=h in i;if(p){let C,x=i[h];l.path=(n.path?`${n.path}.`:"")+h,p=p.resolve({value:x,context:n.context,parent:u});let N=p instanceof wn?p.spec:void 0,w=N==null?void 0:N.strict;if(N!=null&&N.strip){f=f||h in i;continue}C=!n.__validating||!w?p.cast(i[h],l):i[h],C!==void 0&&(u[h]=C)}else y&&!a&&(u[h]=i[h]);(y!==h in u||u[h]!==i[h])&&(f=!0)}return f?u:i}_validate(t,n={},r,i){let{from:o=[],originalValue:a=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,super._validate(t,n,r,(u,l)=>{if(!s||!Og(l)){i(u,l);return}a=a||l;let f=[];for(let h of this._nodes){let p=this.fields[h];!p||ro.isRef(p)||f.push(p.asNestedTest({options:n,key:h,parent:l,parentPath:n.path,originalParent:a}))}this.runTests({tests:f,value:l,originalValue:a,options:n},r,h=>{i(h.sort(this._sortErrors).concat(u),l)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,o]of Object.entries(this.fields)){const a=r[i];r[i]=a===void 0?o:a}return n.withMutation(i=>i.setFields(r,this._excludedEdges))}_getDefault(){if("default"in this.spec)return super._getDefault();if(!this._nodes.length)return;let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]=r&&"getDefault"in r?r.getDefault():void 0}),t}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=VA(t,n),r._sortErrors=_C(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return Pl(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n)}omit(t){const n=Object.assign({},this.fields);for(const r of t)delete n[r];return this.setFields(n)}from(t,n,r){let i=Ai.getter(t,!0);return this.transform(o=>{if(!o)return o;let a=o;return HA(o,t)&&(a=Object.assign({},o),r||delete a[t],a[n]=i(o)),a})}json(){return this.transform(PC)}noUnknown(t=!0,n=Lf.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const o=WA(this.schema,i);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Lf.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(fd.camelCase)}snakeCase(){return this.transformKeys(fd.snakeCase)}constantCase(){return this.transformKeys(t=>fd.snakeCase(t).toUpperCase())}describe(t){let n=super.describe(t);n.fields={};for(const[i,o]of Object.entries(this.fields)){var r;let a=t;(r=a)!=null&&r.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),n.fields[i]=o.describe(a)}return n}}Kh.prototype=MC.prototype;function $C(e){return new IC(e)}class IC extends wn{constructor(t){super({type:"array",check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const o=r.map((a,s)=>{const u=this.innerType.cast(a,Object.assign({},n,{path:`${n.path||""}[${s}]`}));return u!==a&&(i=!0),u});return i?o:r}_validate(t,n={},r,i){var o;let a=this.innerType,s=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,r,(u,l)=>{var f;if(!s||!a||!this._typeCheck(l)){i(u,l);return}let h=new Array(l.length);for(let y=0;yi(y.concat(u),l))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(PC)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!ic(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Li(t));return n.innerType=t,n}length(t,n=_l.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n){return n=n||_l.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n){return n=n||_l.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,o)=>!t(r,i,o):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(t){let n=super.describe(t);if(this.innerType){var r;let i=t;(r=i)!=null&&r.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),n.innerType=this.innerType.describe(t)}return n}}$C.prototype=IC.prototype;const GA=()=>{const{event:e,setEvent:t,locale:n}=ye(),r=async(i,o)=>{try{await Ne("update-dealership-settings",{dealership:e.dealershipId,...i}),t({...e,...i}),o.resetForm({values:i})}catch{}};return c("div",{children:c(xC,{initialValues:{name:e.name||"",commission:e.commission||10},validationSchema:Kh().shape({name:Oi().max(100),commission:qh().min(0).max(100)}),onSubmit:r,children:({values:i,handleChange:o,handleSubmit:a,dirty:s,setFieldValue:u})=>g("form",{onSubmit:a,children:[g(ur,{children:[c(Xe,{children:g(j.Group,{className:"mb-3",children:[c(j.Label,{children:n.dealershipName}),c(j.Control,{id:"name",type:"text",value:i.name,onChange:o,placeholder:e.dealershipId})]})}),e.shopType==="owned"&&c(Xe,{children:g(j.Group,{className:"mb-3",children:[c(j.Label,{children:n.commission}),g(Gt,{children:[c(j.Control,{id:"commission",type:"number",value:i.commission,onChange:l=>u("commission",l.target.value?parseInt(l.target.value):""),min:0,max:100,step:1}),c(Gt.Text,{children:"%"})]})]})})]}),c(ee,{type:"submit",disabled:!s,children:n.save})]})})})},qA=()=>{const{event:e,onCloseModal:t,locale:n,config:r}=ye(),[i,o]=m.useState("Dashboard"),a=m.useMemo(()=>[{icon:"bi-graph-up",name:n.dashboard,Component:z2},{icon:"bi-car-front",name:n.vehicles,Component:q2},{icon:"bi-ui-checks-grid",name:n.displayVehicles,Component:Q2},e.shopType=="owned"&&{icon:"bi-card-checklist",name:n.orders,Component:tM},{icon:"bi-coin",name:n.sales,Component:iM},e.shopType=="owned"&&e.employeeRole!=="supervisor"&&{icon:"bi-people",name:n.employees,Component:uM},e.employeeRole!=="supervisor"&&{icon:"bi-gear",name:n.settings,Component:GA}],[n]).filter(Boolean),s=async()=>{try{await t(),await Ne("open-admin")}catch{}};return e.type!=="showAdmin"?null:g(z,{show:e.type==="showAdmin",size:"xl",centered:!0,backdrop:!1,scrollable:!0,children:[g(z.Body,{className:"p-0",children:[g("div",{className:"dealership-header p-3 text-muted bg-darker",children:[g("div",{children:[e.fromAdmin&&g(ee,{size:"sm",variant:"outline-secondary",className:"me-3",onClick:s,children:[c("i",{className:"bi-arrow-left me-2"}),`${n.all} ${n.dealerships}`]}),c("strong",{children:e.name||e.dealershipId})]}),g("div",{children:[c("span",{className:"me-3",children:e.fromAdmin||e.employeeRole=="server_admin"?"Server Admin":e.shopType==="owned"&&`${e.playerName} (${n[`${e.employeeRole}Role`]})`}),c(zp,{onClick:()=>t()})]})]}),c(__,{id:"justify-tab-example",className:"mb-3 p-3 pb-0 admin-navbar bg-darker",activeKey:i,onSelect:u=>o(u),justify:!0,children:a.map(({icon:u,name:l,Component:f},h)=>c(k_,{eventKey:l,title:g("div",{children:[c("i",{className:`me-2 ${u}`}),l]}),children:c("div",{className:"p-3 pt-0",children:c(f,{currentTab:i})})},h))})]}),!r.HideWatermark&&c(z.Footer,{children:c(ta,{})})]})},KA=()=>{const{event:e,onCloseModal:t,locale:n}=ye(),[r,i]=m.useState(0);m.useEffect(()=>{let a;return e.type==="testDriveHud"&&(i(e.time),a=setInterval(()=>{i(s=>s-1===0?(o(),0):Math.max(s-1,0))},1e3)),()=>{clearInterval(a)}},[e.type]);const o=async()=>{await Ne("finish-test-drive"),t()};return e.type!=="testDriveHud"?null:c(Ue,{className:"test-drive-hud bg-black",children:g(Ue.Body,{className:"d-flex align-items-center justify-content-between",children:[c("div",{className:"test-drive-notice",children:n.testDriveExit}),g("div",{className:"seconds-remaining",children:[c("h3",{className:"m-0",children:r}),c("small",{className:"m-0 text-center",children:n.seconds})]})]})})},ZA=({show:e,onHide:t,onConfirm:n})=>{const{locale:r}=ye();return g(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:r.deleteData})}),c(z.Body,{children:r.deleteConfirmation}),g(z.Footer,{children:[c(ee,{variant:"primary",onClick:()=>{n(),t()},children:r.yes}),c(ee,{variant:"secondary",onClick:()=>t(),children:r.no})]})]})},YA=({show:e,onHide:t,dealershipId:n})=>{const{event:r,locale:i}=ye(),[o,a]=m.useState(""),s=r.nearbyPlayers||[];return c(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:g("form",{onSubmit:async l=>{if(l.preventDefault(),!o)return!1;try{await Ne("set-dealership-owner",{dealershipId:n,player:o}),t()}catch{}},children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:i.setDealershipOwner})}),c(z.Body,{children:g(j.Group,{children:[c(j.Label,{children:i.nearbyPlayers}),g(j.Select,{value:o,onChange:l=>a(l.target.value),children:[c("option",{value:"",disabled:!0,children:s.length?i.selectPlayer:i.noPlayersNearby}),s.map(({id:l,name:f})=>c("option",{value:l,children:f},l))]})]})}),c(z.Footer,{children:c(ee,{type:"submit",variant:"primary",disabled:!o,children:i.setDealershipOwner})})]})})},QA=({dealer:e})=>{const{config:t,onCloseModal:n,locale:r}=ye(),{name:i,type:o,owner_name:a,label:s,active:u,balance:l}=e,[f,h]=m.useState(!1),[p,y]=m.useState(!1),C=async()=>{try{await n(),await Ne("open-dealership-management",{id:e.name,fromAdmin:!0})}catch{}},x=async()=>{try{await Ne("delete-dealership-data",{dealershipId:e.name})}catch{}};return g("tr",{style:u?{}:{color:"#555"},children:[c("td",{className:"font-monospace",children:i}),c("td",{children:o}),c("td",{children:s||i}),c("td",{children:o==="owned"?a:"-"}),c("td",{children:o==="owned"?Le(l,t):"-"}),c("td",{children:u?g("strong",{className:"text-success d-flex",children:[c("i",{className:"bi-check-circle me-1"})," ",r.active]}):g("strong",{className:"text-danger d-flex",children:[c("i",{className:"bi-x-circle me-1"})," ",r.removed]})}),c("td",{children:c("div",{className:"d-flex justify-content-end",children:u?g(Wt,{children:[o==="owned"&&g(Wt,{children:[g(ee,{size:"sm",variant:"secondary",className:"d-flex",onClick:()=>h(!0),children:[c("i",{className:"bi-person me-1"}),c("span",{className:"text-nowrap",children:r.setOwner})]}),c(YA,{show:f,onHide:()=>h(!1),dealershipId:i})]}),g(ee,{size:"sm",variant:"primary",onClick:C,className:"ms-2 d-flex",children:[c("i",{className:"bi-wrench me-1"}),c("span",{className:"text-nowrap",children:r.manage})]})]}):g(Wt,{children:[g(ee,{size:"sm",variant:"danger",onClick:()=>y(!0),children:[c("i",{className:"bi-trash me-1"}),r.deleteData]}),c(ZA,{show:p,onHide:()=>y(!1),onConfirm:x})]})})})]})},XA=({data:e,columns:t})=>{const{locale:n}=ye(),{getTableProps:r,getTableBodyProps:i,headerGroups:o,page:a,canPreviousPage:s,canNextPage:u,pageOptions:l,nextPage:f,previousPage:h,setPageSize:p,state:{pageIndex:y,pageSize:C}}=cr.useTable({columns:t,data:e,autoResetPage:!1,autoResetFilters:!1},cr.usePagination);return g("div",{children:[g(Bo,{variant:"info",children:[c("i",{className:"bi-info-circle me-2"}),'New dealerships are created in the config file. They will appear here after a script restart! Dealerships removed from the config will show as "Removed", and you can erase all their database data from here.']}),g(ea,{hover:!0,className:"bootstrap-table",...r(),children:[c("thead",{children:o.map(x=>c("tr",{...x.getHeaderGroupProps(),children:x.headers.map(N=>c("th",{...N.getHeaderProps(),children:N.render("Header")}))}))}),c("tbody",{...i(),children:a.length?a.map((x,N)=>c(QA,{dealer:x.original},x.original.name)):c("tr",{children:c("td",{colSpan:100,align:"center",children:n.noDealershipsFound})})})]}),g("div",{className:"pagination d-flex justify-content-between",children:[c("div",{children:g(ee,{variant:"primary",onClick:()=>h(),disabled:!s,children:[c("i",{className:"bi-arrow-left"})," ",n.previous]})}),g("div",{className:"d-flex align-items-center",children:[g("span",{className:"me-3",children:[n.page," ",y+1," ",n.of," ",l.length]}),c(j.Select,{size:"sm",value:C,onChange:x=>{p(Number(x.target.value))},style:{width:110},children:[10,20,30,40,50].map(x=>g("option",{value:x,children:[n.show," ",x]},x))})]}),c("div",{children:g(ee,{variant:"primary",onClick:()=>f(),disabled:!u,children:[n.next," ",c("i",{className:"bi-arrow-right"})]})})]})]})},JA=({goBack:e})=>{const{event:t,config:n,locale:r}=ye(),[i,o]=m.useState(""),[a,s]=m.useState([]),[u,l]=m.useState([]);m.useEffect(()=>{s(t.dealers||[])},[t.dealers]),m.useEffect(()=>{l(a.filter(({name:p,label:y})=>{const C=i.toLocaleLowerCase().split(" ").filter(x=>x).map(x=>x.trim());return C.filter(x=>`${p} ${y}`.toLocaleLowerCase().includes(x)).length===C.length}))},[a,i]);const f=m.useMemo(()=>[{Header:r.id,accessor:"name"},{Header:r.type,accessor:"type"},{Header:r.name,accessor:"label"},{Header:r.owner,accessor:"owner"},{Header:r.bankBalance,accessor:"balance"},{Header:r.status,accessor:"status"},{Header:"",accessor:"x"}],[]),h=u;return g(Wt,{children:[g(z.Header,{className:"gap-3",closeButton:!0,children:[g(ee,{size:"sm",variant:"dark",onClick:()=>e(),children:[c("i",{className:"bi-arrow-left"})," ",r.back]}),c(z.Title,{as:"h5",children:r.dealershipsAdmin})]}),g(z.Body,{className:"p-0",children:[c(j.Group,{className:"d-flex p-3 search-and-filter",children:g(Gt,{children:[c(Gt.Text,{children:c("i",{className:"bi-search"})}),c(j.Control,{type:"search",placeholder:r.search,value:i,onChange:p=>o(p.target.value)})]})}),c("div",{className:"p-3 pt-0",children:a.length?c(XA,{columns:f,data:h}):r.noDealershipsFound})]}),g(z.Footer,{className:"d-flex justify-content-between",children:[g("div",{className:"text-muted",children:[a.length," ",r.dealersCount]}),!n.HideWatermark&&c(ta,{})]})]})},FC=({type:e,show:t,onHide:n,vehicle:r,onSubmit:i})=>{const{config:o,event:a,locale:s}=ye(),u=m.useMemo(()=>a.vehicles,[a.vehicles]),l=Object.keys(o.Categories||{}),[f,h]=m.useState(null),p=m.useRef();m.useEffect(()=>{h(null)},[t]);const y=async x=>{p.current&&clearTimeout(p.current),h(null),p.current=setTimeout(async()=>{const N=x.target.value,{valid:w}=await Ne("verify-spawn-code",{spawnCode:N});h(w)},500)},C=(x,N)=>{if(e==="add"&&u.find(w=>w.spawn_code===x.spawn_code))return N.setFieldError("spawn_code",s.errorVehicleWithSpawnCodeExists);i({...x,created_at:(r==null?void 0:r.created_at)||de.now().toMillis()}),n(),h(null),e==="add"&&N.resetForm()};return c(z,{show:t,onHide:()=>n(),centered:!0,style:{zIndex:9999},children:c(xC,{initialValues:{brand:(r==null?void 0:r.brand)||"",model:(r==null?void 0:r.model)||"",spawn_code:(r==null?void 0:r.spawn_code)||"",category:(r==null?void 0:r.category)||l[0],price:(r==null?void 0:r.price)||0,dealerships:(r==null?void 0:r.dealerships)||[],updateDealerPrices:!1},validationSchema:Kh().shape({brand:Oi().max(100),model:Oi().max(100).required(s.required),spawn_code:Oi().max(100).required(s.required),category:Oi().oneOf(l).required(s.required),price:qh().min(0).required(s.required),dealerships:$C().of(Oi()),updateDealerPrices:TC().required(s.required)}),onSubmit:C,children:({values:x,handleChange:N,setFieldValue:w,handleSubmit:E,touched:b,errors:T})=>g("form",{onSubmit:E,children:[c(z.Header,{closeButton:!0,children:g(z.Title,{as:"h5",children:[s[e]," ",s.vehicle]})}),g(z.Body,{children:[g(j.Group,{className:"mb-3",controlId:"validationFormik03",children:[c(j.Label,{children:s.spawnCode}),c(j.Control,{type:"text",name:"spawn_code",placeholder:`${s.forExample}: adder`,value:x.spawn_code,onChange:N,onKeyUp:y,disabled:e==="edit",isInvalid:f===!1||!!b.spawn_code&&!!T.spawn_code,isValid:f===!0}),c(j.Control.Feedback,{type:"invalid",children:f===!1?s.spawnCodeInvalid:T.spawn_code})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:s.brand}),c(j.Control,{name:"brand",placeholder:`${s.forExample}: Bugatti (Optional)`,value:x.brand,onChange:N,isInvalid:!!b.brand&&!!T.brand}),c(j.Control.Feedback,{type:"invalid",children:T.brand})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:s.model}),c(j.Control,{type:"text",name:"model",placeholder:`${s.forExample}: Veyron`,value:x.model,onChange:N,isInvalid:!!b.model&&!!T.model}),c(j.Control.Feedback,{type:"invalid",children:T.model})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:s.category}),g(j.Select,{name:"category",value:x.category,onChange:N,isInvalid:!!b.category&&!!T.category,children:[c("option",{value:"",children:"Select a category"}),l.map(R=>c("option",{value:R,children:o.Categories[R]},R))]}),c(j.Control.Feedback,{type:"invalid",children:T.model})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:s.price}),g(Gt,{hasValidation:!0,children:[c(j.Control,{type:"number",name:"price",value:x.price,onChange:N,isInvalid:!!b.price&&!!T.price}),c(j.Control.Feedback,{type:"invalid",children:T.price})]}),(x.price!==(r==null?void 0:r.price)||x.updateDealerPrices)&&c(j.Check,{type:"checkbox",id:"updateDealerPrices",name:"updateDealerPrices",label:s.overwriteDealerPrices,checked:x.updateDealerPrices,onChange:N,className:"mt-2"})]}),g(Ue,{children:[c(Ue.Header,{children:s.dealerships}),c(j.Group,{as:Ue.Body,children:Object.keys(o.DealershipLocations).map((R,M)=>c(j.Check,{label:R,name:"payment-method",type:"checkbox",id:`dealership-${R}`,checked:x.dealerships.includes(R),onChange:F=>F.target.checked?w("dealerships",[...x.dealerships,R]):w("dealerships",x.dealerships.filter(A=>R!==A))},M))})]})]}),c(z.Footer,{children:c(ee,{type:"submit",variant:"primary",disabled:e==="add"&&f===!1,children:s[e]})})]})})})},eL=({show:e,onHide:t,onConfirm:n})=>{const{locale:r}=ye();return g(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:r.deleteVehicle})}),c(z.Body,{children:r.deleteConfirmation}),g(z.Footer,{children:[c(ee,{variant:"primary",onClick:()=>{n(),t()},children:r.yes}),c(ee,{variant:"secondary",onClick:()=>t(),children:r.no})]})]})},tL=({vehicle:e,updateVehicle:t,deleteVehicle:n})=>{var w;const{config:r,locale:i}=ye(),{brand:o,model:a,category:s,spawn_code:u,dealerships:l,price:f}=e,[h,p]=m.useState(!1),[y,C]=m.useState(!1),x=E=>{t(E)},N=()=>{n()};return g("tr",{children:[g("td",{className:"admin-vehicle-row-name",children:[o," ",a]}),c("td",{children:u}),c("td",{children:l.join(", ")||"-"}),c("td",{children:(w=r.Categories)==null?void 0:w[s]}),c("td",{children:Le(f,r)}),g("td",{className:"text-end",children:[g(ee,{size:"sm",variant:"link text-decoration-none",onClick:()=>p(!0),children:[c("i",{className:"bi-pencil me-1"}),i.edit]}),g(ee,{size:"sm",variant:"danger",onClick:()=>C(!0),className:"ms-2",children:[c("i",{className:"bi-trash me-1"}),i.delete]}),c(FC,{type:"edit",show:h,onHide:()=>p(!1),vehicle:e,onSubmit:x}),c(eL,{show:y,onHide:()=>C(!1),onConfirm:N})]})]})},nL=({data:e,columns:t,onUpdateVehicle:n,onDeleteVehicle:r})=>{const{locale:i}=ye(),{getTableProps:o,getTableBodyProps:a,headerGroups:s,prepareRow:u,page:l,canPreviousPage:f,canNextPage:h,pageOptions:p,pageCount:y,gotoPage:C,nextPage:x,previousPage:N,setPageSize:w,state:{pageIndex:E,pageSize:b}}=cr.useTable({columns:t,data:e,autoResetPage:!1,autoResetFilters:!1},cr.usePagination);return g("div",{children:[g(ea,{hover:!0,className:"bootstrap-table",...o(),children:[c("thead",{children:s.map(T=>c("tr",{...T.getHeaderGroupProps(),children:T.headers.map(R=>c("th",{...R.getHeaderProps(),children:R.render("Header")}))}))}),c("tbody",{...a(),children:l.length?l.map((T,R)=>c(tL,{vehicle:T.original,updateVehicle:M=>n(T.original.spawn_code,M),deleteVehicle:()=>r(T.original.spawn_code)},T.original.spawn_code)):c("tr",{children:c("td",{colSpan:100,align:"center",children:i.noVehicles})})})]}),g("div",{className:"pagination d-flex justify-content-between",children:[g(ee,{variant:"primary",onClick:()=>N(),disabled:!f,children:[c("i",{className:"bi-arrow-left"})," ",i.previous]}),g("div",{className:"d-flex align-items-center",children:[g("span",{className:"me-3",children:[i.page," ",E+1," ",i.of," ",p.length]}),c(j.Select,{size:"sm",value:b,onChange:T=>{w(Number(T.target.value))},style:{width:110},children:[10,20,30,40,50].map(T=>g("option",{value:T,children:[i.show," ",T]},T))})]}),g(ee,{variant:"primary",onClick:()=>x(),disabled:!h,children:[i.next," ",c("i",{className:"bi-arrow-right"})]})]})]})},Rg=["Append","Overwrite"],_g=[["qbshared","QBCore shared/vehicles.lua"],["qbx_shared","Qbox shared/vehicles.lua"],["esxdb","ESX vehicles table"]],rL=({show:e,onHide:t})=>{const{locale:n}=ye(),[r,i]=m.useState(_g[0][0]),[o,a]=m.useState(Rg[0]),[s,u]=m.useState(!1),[l,f]=m.useState(!1);return c(z,{show:e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:g("form",{onSubmit:async p=>{p.preventDefault(),u(!0);try{await Ne("import-vehicles-data",{location:r,behaviour:o}),t()}catch(y){f(`Error: ${y==null?void 0:y.reason}`)}u(!1)},children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:n.importVehicles})}),g(z.Body,{children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:n.importFrom}),c(j.Select,{id:"location",value:r,onChange:p=>i(p.target.value),children:_g.map((p,y)=>c("option",{value:p[0],children:p[1]},y))})]}),g(j.Group,{children:[c(j.Label,{children:n.importBehaviour}),c(Gt,{className:"gap-3",children:Rg.map(p=>c(j.Check,{id:`behaviour-${p}`,type:"radio",name:"behaviour",label:p,checked:o===p,onChange:()=>a(p)},p))})]}),o==="Overwrite"&&g(Bo,{variant:"warning",className:"mt-4",children:[c("i",{className:"bi-exclamation-triangle me-2"}),c("span",{children:"Warning: Overwriting vehicles data will cause you to lose all existing vehicles, orders, display vehicles and sales."})]}),!!l&&g(Bo,{variant:"danger",className:"mt-4",children:[c("i",{className:"bi-exclamation-circle me-2"}),c("span",{children:l})]})]}),c(z.Footer,{children:c(ee,{type:"submit",disabled:s,children:s?`${n.importing}...`:n.import})})]})})},iL=({goBack:e})=>{const{event:t,config:n,locale:r}=ye(),i={all:"All Categories",...n.Categories||{}},o={[r.sortByNewest]:(I,$)=>de.fromMillis($.created_at)`${I.brand} ${I.model}`.localeCompare(`${$.brand} ${$.model}`),[r.sortByCheapest]:(I,$)=>I.price-$.price,[r.sortByMostExpensive]:(I,$)=>$.price-I.price},[a,s]=m.useState(""),[u,l]=m.useState(Object.keys(o)[0]),[f,h]=m.useState("all"),[p,y]=m.useState([]),[C,x]=m.useState([]),[N,w]=m.useState(!1),[E,b]=m.useState(!1);m.useEffect(()=>{y(t.vehicles||[])},[t.vehicles]),m.useEffect(()=>{x(p.filter(({brand:I,model:$})=>{const W=a.toLocaleLowerCase().split(" ").filter(Z=>Z).map(Z=>Z.trim());return W.filter(Z=>`${I} ${$}`.toLocaleLowerCase().includes(Z)).length===W.length}).filter(I=>f==="all"?!0:I.category===f).sort(o[u]))},[p,a,f,u]);const T=async I=>{y($=>[I,...$]),await Ne("add-vehicle",I)},R=async(I,$)=>{y(W=>W.map(Z=>Z.spawn_code===I?{...Z,...$}:Z)),await Ne("update-vehicle",$)},M=async I=>{y($=>$.filter(W=>W.spawn_code!==I)),await Ne("delete-vehicle",{spawn_code:I})},F=m.useMemo(()=>[{Header:r.vehicle,accessor:"vehicle"},{Header:r.spawnCode,accessor:"spawn_code"},{Header:r.dealerships,accessor:"dealers"},{Header:r.category,accessor:"category"},{Header:r.price,accessor:"price"},{Header:"",accessor:"x"}],[]),A=C;return g(Wt,{children:[g(z.Header,{className:"gap-3",closeButton:!0,children:[g(ee,{size:"sm",variant:"dark",onClick:()=>e(),children:[c("i",{className:"bi-arrow-left"})," ",r.back]}),c(z.Title,{as:"h5",children:r.vehiclesAdmin})]}),g(z.Body,{className:"p-0",children:[g(j.Group,{className:"d-flex p-3 search-and-filter",children:[g(Gt,{children:[c(Gt.Text,{children:c("i",{className:"bi-search"})}),c(j.Control,{type:"search",placeholder:r.search,value:a,onChange:I=>s(I.target.value)}),c(uh,{variant:"dark",title:c("i",{className:"bi-filter"}),id:"input-group-dropdown-2",align:"end",menuVariant:"dark",children:Object.keys(o).map((I,$)=>c(si.Item,{onClick:()=>l(I),active:u===I,children:I},$))}),c(j.Select,{style:{maxWidth:220},value:f,onChange:I=>h(I.target.value),children:Object.keys(i).map(I=>c("option",{value:I,children:i[I]},I))})]}),g(ee,{className:"flex-shrink-0 ms-3",variant:"outline-warning",onClick:()=>b(!0),children:[c("i",{className:"bi-box-arrow-right me-2"}),c("span",{children:r.importVehicles})]}),c(rL,{show:E,onHide:()=>b(!1)}),g(ee,{className:"flex-shrink-0 ms-3",onClick:()=>w(!0),children:[c("i",{className:"bi-plus me-2"}),c("span",{children:r.add})]}),c(FC,{type:"add",show:N,onHide:()=>w(!1),onSubmit:T})]}),c("div",{className:"p-3 pt-0",children:p.length?c(nL,{columns:F,data:A,onUpdateVehicle:R,onDeleteVehicle:M}):r.noVehicles})]}),g(z.Footer,{className:"d-flex justify-content-between",children:[g("div",{className:"text-muted",children:[p.length," ",r.vehiclesCount]}),!n.HideWatermark&&c(ta,{})]})]})},oL=()=>{const{event:e,onCloseModal:t,locale:n,config:r}=ye(),[i,o]=m.useState(!1);return g(z,{show:e.type==="vehiclesAdmin",onHide:()=>t(),size:"xl",centered:!0,backdrop:!1,scrollable:!0,className:`vehicles-admin-modal ${i?"":"small"}`,children:[!i&&g(Wt,{children:[c(z.Header,{className:"gap-3",closeButton:!0,children:c(z.Title,{as:"h5",children:n.admin})}),c(z.Body,{children:g(ur,{children:[c(Xe,{children:c(Ue,{className:"admin-nav-btn",bg:"darker",onClick:()=>o("dealers"),children:g(Ue.Body,{className:"text-center",children:[c("i",{className:"bi-coin h2"}),c("h5",{className:"mt-2 mb-0",children:n.dealerships})]})})}),c(Xe,{children:c(Ue,{className:"admin-nav-btn",bg:"darker",onClick:()=>o("vehicles"),children:g(Ue.Body,{className:"text-center",children:[c("i",{className:"bi-car-front h2"}),c("h5",{className:"mt-2 mb-0",children:n.vehicles})]})})})]})}),!r.HideWatermark&&g(z.Footer,{className:"d-flex justify-content-between",children:[c("div",{}),c(ta,{})]})]}),i==="dealers"&&c(JA,{goBack:()=>o(!1)}),i==="vehicles"&&c(iL,{goBack:()=>o(!1)})]})},aL=({show:e,onHide:t,vehicle:n})=>{const{config:r,locale:i}=ye(),o=async()=>{try{await Ne("finance-make-payment",{plate:n.plate,type:e,sendNUI:!0})}catch{}t()};return g(z,{show:!!e,onHide:()=>t(),style:{zIndex:9999},centered:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:i.makePayment})}),g(z.Body,{children:[`${i.earlyPaymentConfirmation} `,Le(e==="payment"?n.finance_data.recurring_payment:e==="pay-in-full"?n.finance_data.total-n.finance_data.paid:0,r),"?"]}),g(z.Footer,{children:[c(ee,{variant:"primary",onClick:o,children:i.yes}),c(ee,{variant:"secondary",onClick:()=>t(),children:i.no})]})]})},sL=({vehicle:e})=>{const{config:t,locale:n}=ye(),[r,i]=m.useState(!1),[o,a]=m.useState("");return m.useEffect(()=>{const s=()=>{e.finance_data.payment_failed&&e.finance_data.seconds_to_repo?(e.finance_data.seconds_to_repo-=10,e.finance_data.seconds_to_repo/3600>1.5?a(`${Math.round(e.finance_data.seconds_to_repo/3600)} ${n.hours||"hours(s)"}`):a(`${Math.round(e.finance_data.seconds_to_repo/60)} ${n.mins||"min(s)"}`)):e.finance_data.seconds_to_next_payment&&(e.finance_data.seconds_to_next_payment-=10,e.finance_data.seconds_to_next_payment/3600>1.5?a(`${Math.round(e.finance_data.seconds_to_next_payment/3600)} ${n.hours||"hours(s)"}`):a(`${Math.round(e.finance_data.seconds_to_next_payment/60)} ${n.mins||"min(s)"}`))};let u;return s(),u=setInterval(()=>s(),1e4),()=>clearInterval(u)},[e]),g(kl.Item,{eventKey:e.plate,children:[c(kl.Header,{children:g("div",{className:"d-flex flex-fill justify-content-between",children:[g("div",{children:[e.vehicleLabel,c(vn,{bg:"dark",text:"warning",className:"ms-2",style:{fontFamily:"monospace"},children:e.plate})]}),g("div",{children:[c(vn,{bg:e.finance_data.payment_failed?"danger":"success",className:"me-2",children:e.finance_data.payment_failed?n.failed:n.active}),c(vn,{bg:"secondary",className:"me-3",children:Le(e.finance_data.total-e.finance_data.paid,t)+` ${n.remaining}`})]})]})}),g(kl.Body,{children:[e.finance_data.payment_failed&&g(Bo,{variant:"danger",children:[c("i",{className:"bi-exclamation-triangle-fill me-2"}),n.repossessionWarning]}),g("div",{className:"d-flex justify-content-between",children:[g("div",{className:"flex-fill",children:[g("div",{className:"d-flex justify-content-between mb-2",children:[g("div",{children:[c("small",{children:n.recurringPayment}),c("h4",{className:"white",children:Le(e.finance_data.recurring_payment,t)})]}),g("div",{children:[c("small",{children:n.remainingBalance}),c("h4",{className:"white",children:Le(e.finance_data.total-e.finance_data.paid,t)})]}),g("div",{children:[c("small",{children:n.remainingPayments}),g("h4",{className:"white",children:[e.finance_data.payments_complete,g("small",{children:[" / ",e.finance_data.total_payments]})]})]})]}),c("div",{className:"mb-4",children:g("small",{children:[c("i",{className:"bi-clock me-2"}),`${n.paymentTakenEvery} `,g("strong",{children:[e.finance_data.payment_interval," ",n.hours]}),`. ${e.finance_data.payment_failed?n.vehicleRepossessed:n.nextPayment} `,c("strong",{children:o})]})})]}),g("div",{className:"d-flex flex-column ms-5",children:[c(ee,{size:"sm",className:"mb-2",variant:"primary",onClick:()=>i("payment"),children:n.makePayment}),c(ee,{size:"sm",variant:"outline-primary",onClick:()=>i("pay-in-full"),children:n.payInFull}),c(aL,{show:r,onHide:()=>i(!1),vehicle:e})]})]}),c("div",{className:"finance-container",children:g("div",{className:"finance-progress-bar",children:[c("div",{className:"finance-progress-bar-inner bg-success",style:{width:(e.finance_data.payments_complete-1)/(e.finance_data.total_payments-1)*100+"%"}}),c("div",{className:"points-container",children:Array(e.finance_data.total_payments).fill(!0).map((s,u)=>c("div",{className:"point",children:c("i",{className:`${u{var i;const{event:e,onCloseModal:t,locale:n,config:r}=ye();return g(z,{show:e.type==="manageFinance",onHide:()=>t(),size:"lg",centered:!0,backdrop:!1,scrollable:!0,children:[c(z.Header,{closeButton:!0,children:c(z.Title,{as:"h5",children:n.financedVehicles})}),c(z.Body,{className:"p-0 pb-2 pt-2",children:c(kl,{flush:!0,children:(i=e.vehicles)!=null&&i.length?e.vehicles.map((o,a)=>c(sL,{vehicle:o},a)):c("div",{className:"p-3",children:n.noFinancedVehicles})})}),!r.HideWatermark&&c(z.Footer,{children:c(ta,{})})]})},uL=()=>{var n;const{event:e,locale:t}=ye();return e.type!=="displayVehicleHud"?null:c(Ue,{bg:"black",className:`display-vehicle-hud ${e.vehiclePlaced?"vehicle-placed":""}`,children:g(Ue.Body,{children:[c("div",{className:`place-vehicle-prompt ${e.vehiclePlaced?"opacity-0":"opacity-1"} `,children:c("p",{className:"m-0",dangerouslySetInnerHTML:{__html:(n=t.placeVehiclePrompt)==null?void 0:n.replace("%{value}","ENTER")}})}),c("div",{className:`d-flex align-items-center justify-content-between vehicle-controls ${e.vehiclePlaced?"opacity-1":"opacity-0"}`,children:g("div",{className:"d-flex w-100 justify-content-between",children:[g("div",{className:"d-flex gap-5",children:[g("div",{className:"d-flex flex-column gap-1",children:[c("div",{className:"text-muted",children:"Movement"}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"W"})," Forward"]}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"S"})," Back"]})]}),g("div",{className:"d-flex flex-column gap-1",children:[c("div",{children:" "}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"A"})," Left"]}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"D"})," Right"]})]}),g("div",{className:"d-flex flex-column gap-1",children:[c("div",{className:"text-muted",children:"Rotate"}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"Q"})," Rotate left"]}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"E"})," Rotate right"]})]})]}),g("div",{className:"d-flex flex-column gap-1",children:[c("div",{className:"text-muted",children:" "}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"ENTER"})," Save"]}),g("div",{className:"d-flex align-items-center",children:[c("kbd",{children:"X"})," Cancel"]})]})]})})]})})};var DC={exports:{}};/*! * Signature Pad v2.3.2 * https://github.com/szimek/signature_pad * * Copyright 2017 Szymon Nowak * Released under the MIT license * * The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from: * http://corner.squareup.com/2012/07/smoother-signatures.html * * Implementation of interpolation using cubic Bézier curves is taken from: * http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript * * Algorithm for approximated length of a Bézier curve is taken from: * http://www.lemoda.net/maths/bezier-length/index.html * */function qi(e,t,n){this.x=e,this.y=t,this.time=n||new Date().getTime()}qi.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1};qi.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))};qi.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time};function Zh(e,t,n,r){this.startPoint=e,this.control1=t,this.control2=n,this.endPoint=r}Zh.prototype.length=function(){for(var e=10,t=0,n=void 0,r=void 0,i=0;i<=e;i+=1){var o=i/e,a=this._point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),s=this._point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(i>0){var u=a-n,l=s-r;t+=Math.sqrt(u*u+l*l)}n=a,r=s}return t};Zh.prototype._point=function(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e};function cL(e,t,n){var r,i,o,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:Date.now(),a=null,o=e.apply(r,i),a||(r=i=null)};return function(){var l=Date.now();!s&&n.leading===!1&&(s=l);var f=t-(l-s);return r=this,i=arguments,f<=0||f>t?(a&&(clearTimeout(a),a=null),s=l,o=e.apply(r,i),a||(r=i=null)):!a&&n.trailing!==!1&&(a=setTimeout(u,f)),o}}function et(e,t){var n=this,r=t||{};this.velocityFilterWeight=r.velocityFilterWeight||.7,this.minWidth=r.minWidth||.5,this.maxWidth=r.maxWidth||2.5,this.throttle="throttle"in r?r.throttle:16,this.minDistance="minDistance"in r?r.minDistance:5,this.throttle?this._strokeMoveUpdate=cL(et.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=et.prototype._strokeUpdate,this.dotSize=r.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=r.penColor||"black",this.backgroundColor=r.backgroundColor||"rgba(0,0,0,0)",this.onBegin=r.onBegin,this.onEnd=r.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(i){i.which===1&&(n._mouseButtonDown=!0,n._strokeBegin(i))},this._handleMouseMove=function(i){n._mouseButtonDown&&n._strokeMoveUpdate(i)},this._handleMouseUp=function(i){i.which===1&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(i))},this._handleTouchStart=function(i){if(i.targetTouches.length===1){var o=i.changedTouches[0];n._strokeBegin(o)}},this._handleTouchMove=function(i){i.preventDefault();var o=i.targetTouches[0];n._strokeMoveUpdate(o)},this._handleTouchEnd=function(i){var o=i.target===n._canvas;o&&(i.preventDefault(),n._strokeEnd(i))},this.on()}et.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0};et.prototype.fromDataURL=function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=new Image,i=n.ratio||window.devicePixelRatio||1,o=n.width||this._canvas.width/i,a=n.height||this._canvas.height/i;this._reset(),r.src=e,r.onload=function(){t._ctx.drawImage(r,0,0,o,a)},this._isEmpty=!1};et.prototype.toDataURL=function(e){var t;switch(e){case"image/svg+xml":return this._toSVG();default:for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i2,n=this.points[0];if(!t&&n&&this._drawDot(n),n){var r=this._data[this._data.length-1],i=r[r.length-1];n.equals(i)||r.push({x:n.x,y:n.y,time:n.time,color:this.penColor})}typeof this.onEnd=="function"&&this.onEnd(e)};et.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)};et.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)};et.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor};et.prototype._createPoint=function(e,t,n){var r=this._canvas.getBoundingClientRect();return new qi(e-r.left,t-r.top,n||new Date().getTime())};et.prototype._addPoint=function(e){var t=this.points,n=void 0;if(t.push(e),t.length>2){t.length===3&&t.unshift(t[0]),n=this._calculateCurveControlPoints(t[0],t[1],t[2]);var r=n.c2;n=this._calculateCurveControlPoints(t[1],t[2],t[3]);var i=n.c1,o=new Zh(t[1],r,i,t[2]),a=this._calculateCurveWidths(o);return t.shift(),{curve:o,widths:a}}return{}};et.prototype._calculateCurveControlPoints=function(e,t,n){var r=e.x-t.x,i=e.y-t.y,o=t.x-n.x,a=t.y-n.y,s={x:(e.x+t.x)/2,y:(e.y+t.y)/2},u={x:(t.x+n.x)/2,y:(t.y+n.y)/2},l=Math.sqrt(r*r+i*i),f=Math.sqrt(o*o+a*a),h=s.x-u.x,p=s.y-u.y,y=f/(l+f),C={x:u.x+h*y,y:u.y+p*y},x=t.x-C.x,N=t.y-C.y;return{c1:new qi(s.x+x,s.y+N),c2:new qi(u.x+x,u.y+N)}};et.prototype._calculateCurveWidths=function(e){var t=e.startPoint,n=e.endPoint,r={start:null,end:null},i=this.velocityFilterWeight*n.velocityFrom(t)+(1-this.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(i);return r.start=this._lastWidth,r.end=o,this._lastVelocity=i,this._lastWidth=o,r};et.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)};et.prototype._drawPoint=function(e,t,n){var r=this._ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1};et.prototype._drawCurve=function(e,t,n){var r=this._ctx,i=n-t,o=Math.floor(e.length());r.beginPath();for(var a=0;a1)for(var o=0;o",h=u.innerHTML;if(h===void 0){var p=document.createElement("dummy"),y=u.childNodes;p.innerHTML="";for(var C=0;C-1;x+=y)for(var N=0;N-1;x+=y)for(var N=0;N=0||Object.prototype.hasOwnProperty.call(I,Z)&&(W[Z]=I[Z]);return W}function h(I,$){if(!(I instanceof $))throw new TypeError("Cannot call a class as a function")}function p(I,$){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!$||typeof $!="object"&&typeof $!="function"?I:$}function y(I,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);I.prototype=Object.create($&&$.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(I,$):I.__proto__=$)}Object.defineProperty(s,"__esModule",{value:!0});var C=Object.assign||function(I){for(var $=1;${var E,b;const{event:e,setEvent:t,onCloseModal:n,locale:r,config:i}=ye(),[o,a]=m.useState(hd),[s,u]=m.useState(hd[0]),[l,f]=m.useState(!1),[h,p]=m.useState(!1);m.useEffect(()=>{p(!1)},[e.type]),m.useEffect(()=>{var R,M,F;const T=(F=(M=(R=e.config)==null?void 0:R.DealershipLocations)==null?void 0:M[e.dealershipId])==null?void 0:F.paymentOptions;T?(a(T),u(T[0])):u(hd[0])},[e.config,e.dealershipId]);const y=()=>{var R;let T=e.vehiclePrice;return e.financed&&(T=e.vehiclePrice*(1+i.FinanceInterest)*e.downPayment),(((R=e.playerBalances)==null?void 0:R[s])||0)>=T},C=()=>{const T=e.vehiclePrice*(1+i.FinanceInterest);return Math.round((T-T*e.downPayment)/e.noOfPayments)},x=async()=>{f(!0);try{await Ne("purchase-vehicle",{purchaseType:"personal",paymentMethod:s,dealership:e.dealershipId,vehicle:e.vehicleSpawnCode,color:e.color,finance:!!e.financed,directSaleUuid:e.uuid})}catch{n(),f(!1)}await Ne("accept-direct-sale-request",e.uuid),f(!1),n()},N=async()=>{f(!0),await Ne("deny-direct-sale-request",e.uuid),f(!1),n()},w=async()=>{try{const T=await Ne("get-player-balances",e.dealershipId);if(!T)return;t(R=>({...R,playerBalances:T}))}catch{console.error("Could not refresh balances.")}};return g(z,{show:e.type==="show-direct-sale-request",centered:!0,backdrop:!1,scrollable:!0,children:[c(z.Header,{className:"gap-3",children:g(z.Title,{as:"h5",children:[c("i",{className:"bi-car-front me-2"}),r.purchaseRequest]})}),g(z.Body,{children:[g(ur,{children:[g(Xe,{sm:12,children:[c(j.Label,{className:"mb-1",children:r.dealer}),g("p",{className:"text-white",children:[e.dealerName," (",e.dealershipLabel,")"]})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:r.vehicle}),c("p",{className:"text-white",children:e.vehicleLabel})]}),e.color&&i.VehicleColourOptions&&g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:r.colour}),c("p",{className:"text-white",children:(b=(E=i.VehicleColourOptions)==null?void 0:E[e.color-1])==null?void 0:b.label})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:r.payToday}),c("p",{className:"text-white",children:Le(e.financed?e.vehiclePrice*(1+i.FinanceInterest)*e.downPayment:e.vehiclePrice,i)})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:r.financed}),g("p",{className:"text-white",children:[e.financed?r.yes:r.no,e.financed?` (${i.FinanceInterest*100}% ${r.interest})`:""]})]}),e.financed&&g(Wt,{children:[g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:r.payments}),g("p",{className:"text-white",children:[e.noOfPayments," ",r.paymentsOf," ",Le(C(),i)]})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:r.paymentTakenEvery}),g("p",{className:"text-white",children:[i.FinancePaymentInterval," ",r.hours]})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:r.totalPayable}),c("p",{className:"text-white mb-2",children:Le(e.vehiclePrice*(1+i.FinanceInterest),i)})]})]})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:r.paymentSource}),c("div",{children:o.map((T,R)=>{var F;if(T==="cash"&&e.financed)return null;let M=0;return e.playerBalances&&(M=((F=e.playerBalances)==null?void 0:F[T])||0),c(j.Check,{label:g("div",{className:"d-flex align-items-center",children:[c("span",{className:"me-2",children:r[T]||T}),c(vn,{bg:"secondary",text:"dark",children:Le(M,i)}),c(ee,{variant:"dark",onClick:w,size:"sm",className:"ms-2 p-0 pe-1 ps-1",children:c("i",{className:"bi-arrow-clockwise"})})]}),name:"payment-method",type:"radio",id:`payment-method-${T}`,checked:s===T,onChange:A=>u(T)},R)})})]}),c(j.Label,{className:"",children:r.signHere}),c("div",{style:{border:"2px dashed #777",borderRadius:7,width:"min-content"},children:c(mL,{penColor:"white",onEnd:()=>p(!0),canvasProps:{width:350,height:60}})})]}),g(z.Footer,{className:"d-flex justify-content-between",children:[c(ee,{variant:"primary",onClick:x,disabled:!h||!y()||l,children:h?y()?"Accept & Purchase":r.notEnoughMoney:r.signFirstError}),c(ee,{variant:"danger",onClick:N,disabled:l,children:r.denyRequest})]})]})},yL=({onSelectVehicle:e})=>{var C;const{event:t,locale:n,config:r}=ye(),i=m.useRef(null),[o,a]=m.useState(""),[s,u]=m.useState(!1),[l,f]=m.useState([]),[h,p]=m.useState([]);return m.useEffect(()=>{var x,N;o.length>0?f(t.vehicles):f(s?(x=t.vehicles)==null?void 0:x.filter(w=>s&&w.category===s):[]),(N=i.current)==null||N.scrollTo(0,0)},[o.length>0,s]),m.useEffect(()=>{p(l.filter(({brand:x,model:N,spawn_code:w})=>{const E=o.toLocaleLowerCase().split(" ").filter(b=>b).map(b=>b.trim());return E.filter(b=>`${x} ${N} ${w}`.toLocaleLowerCase().includes(b)).length===E.length}))},[l,o]),g("div",{ref:i,children:[c("div",{className:"mb-3",children:g(Gt,{children:[s&&!o&&g(ee,{onClick:()=>{u(!1)},size:"sm",variant:"outline-secondary",children:[c("i",{className:"bi-arrow-left"})," ",n.allCategories]}),c(j.Control,{type:"search",placeholder:n.search,value:o,onChange:x=>a(x.target.value)})]})}),!s&&!o?c("div",{children:(C=t.categories)==null?void 0:C.map(x=>g(Ue,{className:"showroom-category-btn mb-3",bg:"darker",onClick:()=>u(x),children:[c(Ue.Body,{className:"h5 mb-0 text-white",children:r.Categories[x]}),c(Ue.Footer,{children:g("small",{className:"text-muted",children:[t.vehicles.filter(N=>N.category===x).length," ",n.vehiclesCount]})})]}))}):c("div",{children:h.length?h.map((x,N)=>c(Ue,{className:"mb-3",bg:"darker",children:c(Ue.Body,{className:"p-0",children:g("button",{className:"showroom-vehicle",onClick:()=>e(x),disabled:x.stock==0,children:[g("div",{className:"showroom-vehicle-name-stock",children:[g("div",{children:[c("small",{className:"text-muted",children:x.brand}),c("p",{children:x.model})]}),c(vn,{bg:x.stock>0?"success":"danger",text:"white",pill:!0,children:x.stock>0?n.inStock:n.outOfStock})]}),c("div",{className:"d-flex align-items-center justify-content-between",children:c("h4",{children:Le(x.price,r)})})]})})})):n.noVehicles})]})},gL=({player:e,setPlayer:t})=>{const{locale:n,event:r}=ye(),[i,o]=m.useState(e||""),a=r.nearbyPlayers||[];return g("div",{children:[g(j.Group,{children:[c(j.Label,{children:n.nearbyPlayers}),g(j.Select,{value:i,onChange:s=>o(s.target.value),children:[c("option",{value:"",disabled:!0,children:a.length?n.selectPlayer:n.noPlayersNearby}),a.map(({id:s,name:u})=>c("option",{value:s,children:u},s))]})]}),c("div",{className:"mt-3",children:c(ee,{onClick:()=>t(i),disabled:!i,children:n.next})})]})},wL=({vehicle:e,player:t})=>{const{locale:n,onCloseModal:r,event:i,config:o}=ye(),[a,s]=m.useState(1),[u,l]=m.useState(!1),[f,h]=m.useState(o.FinancePayments||12),[p,y]=m.useState(o.FinanceDownPayment||.1),C=()=>{const N=e.price*(1+o.FinanceInterest);return(N-N*(p||0))/(f||1)};return g("form",{onSubmit:async N=>{N.preventDefault(),await Ne("send-direct-sale-request",{playerId:parseInt(t),model:e.spawn_code,colour:a,finance:u,financePayments:f,financeDownPayment:p}),r()},children:[g(j.Group,{className:"mb-3",children:[c(j.Label,{children:n.colour}),c(j.Select,{value:a,onChange:N=>s(parseInt(N.target.value||"1")),children:(o.VehicleColourOptions||[]).map(({label:N},w)=>c("option",{value:w+1,children:N}))})]}),g(j.Group,{className:"mb-3",children:[c(j.Label,{children:n.financing}),c(j.Check,{label:n.payInFull,name:"payment-type",type:"radio",id:"payment-infull",checked:!u,onChange:N=>l(!N.target.checked)}),i.enableFinance&&c(j.Check,{label:c("div",{className:"d-flex align-items-center",children:c("span",{className:"me-2",children:n.financed})}),name:"payment-type",type:"radio",id:"payment-finance",checked:u,onChange:N=>l(N.target.checked)})]}),u&&g(ur,{className:"mb-3",children:[c(Xe,{children:g(j.Group,{children:[c(j.Label,{children:n.financePayments}),c(j.Control,{type:"number",id:"FinancePayments",value:f,min:1,max:100,onChange:N=>h(N.target.value?parseInt(N.target.value):""),required:!0})]})}),c(Xe,{children:g(j.Group,{children:[c(j.Label,{children:n.initialPayment}),g(Gt,{children:[c(j.Control,{type:"number",id:"FinanceDownPayment",value:p?Math.round(p*100):"",onChange:N=>y(N.target.value?Math.min(1,parseInt(N.target.value)/100):""),min:0,max:99,required:!0}),c(Gt.Text,{children:"%"})]})]})})]}),c(Ue,{className:"mb-3",border:"primary",children:c(Ue.Body,{children:g(ur,{children:[g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:n.payToday}),c("p",{className:"text-white",children:Le(u?e.price*(1+o.FinanceInterest)*(p||0):e.price,o)})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:n.financed}),g("p",{className:"text-white",children:[u?n.yes:n.no,u?` (${o.FinanceInterest*100}% ${n.interest})`:""]})]}),u&&g(Wt,{children:[g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:n.payments}),g("p",{className:"text-white",children:[f||1,c("small",{children:" x "}),Le(C(),o)]})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:n.paymentTakenEvery}),g("p",{className:"text-white",children:[o.FinancePaymentInterval," ",n.hours]})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:n.totalPayable}),c("p",{className:"text-white mb-2",children:Le(e.price*(1+o.FinanceInterest),o)})]})]}),g(Xe,{sm:6,children:[c(j.Label,{className:"mb-1",children:n.commission}),g("p",{className:"text-white mb-2",children:[Le(e.price*(u?1+o.FinanceInterest:1)*i.commission||.1,o)," ","(",i.commission*100,"%)"]})]})]})})}),c(ee,{type:"submit",variant:"primary",children:n.sendRequest})]})},SL=()=>{const{event:e,onCloseModal:t,locale:n}=ye(),[r,i]=m.useState(),[o,a]=m.useState("");return m.useEffect(()=>{i(void 0),a("")},[e.type]),g(z,{show:e.type==="showDSSellVehicle",onHide:()=>t(),centered:!0,backdrop:!1,scrollable:!0,children:[c(z.Header,{className:"gap-3",closeButton:!0,children:g(z.Title,{as:"h5",children:[c("i",{className:"bi-car-front me-2"}),n.sellVehicle]})}),c(z.Body,{style:{maxHeight:"80vh"},children:r?o?g("div",{children:[g(hr,{children:[c(hr.Item,{onClick:()=>i(void 0),children:n.selectVehicle}),c(hr.Item,{onClick:()=>a(""),children:n.selectPlayer}),c(hr.Item,{active:!0,children:n.vehicleTerms})]}),c(wL,{vehicle:r,player:o})]}):g("div",{children:[g(hr,{children:[c(hr.Item,{onClick:()=>i(void 0),children:n.selectVehicle}),c(hr.Item,{active:!0,children:n.selectPlayer})]}),c(gL,{player:o,setPlayer:a})]}):g("div",{children:[c(hr,{children:c(hr.Item,{active:!0,children:n.selectVehicle})}),c(yL,{onSelectVehicle:i})]})})]})},xL=()=>{var s,u,l;const{event:e,onCloseModal:t,locale:n}=ye(),[r,i]=m.useState(!1),o=async()=>{i(!0),await Ne("accept-hire-request",e.data),i(!1),t()},a=async()=>{i(!0),await Ne("deny-hire-request",{requesterId:e.data.requesterId}),i(!1),t()};return g(z,{show:e.type==="showConfirmEmployment",centered:!0,backdrop:!1,children:[c(z.Header,{className:"gap-3",children:c(z.Title,{as:"h5",children:n.employmentRequest})}),g(z.Body,{children:[c("p",{children:(u=n.jobOfferDescription)==null?void 0:u.replace("%{value}",(s=e.data)==null?void 0:s.dealershipId)}),g("p",{className:"mb-0",children:[n.role,": ",n[`${(l=e.data)==null?void 0:l.role}Role`]]})]}),g(z.Footer,{className:"d-flex justify-content-between",children:[c(ee,{variant:"primary",onClick:o,disabled:r,children:n.accept}),c(ee,{variant:"dark",onClick:a,disabled:r,children:n.denyRequest})]})]})},CL=()=>{const{event:e,onCloseModal:t,config:n,locale:r}=ye(),[i,o]=m.useState(!1),a=async()=>{o(!0),await Ne("sell-vehicle-price-accepted",e),t(),o(!1)},s=async()=>{t()};return g(z,{show:e.type==="sell-vehicle-to-dealer",centered:!0,backdrop:!1,children:[c(z.Header,{className:"gap-3",children:c(z.Title,{as:"h5",children:r.sellVehicle})}),g(z.Body,{children:[c("p",{children:r.dealershipWantsYourVehicle}),g("p",{className:"mb-0",children:[r.purchasePrice,c("strong",{children:Le(e.value,n)})]})]}),g(z.Footer,{className:"d-flex justify-content-between",children:[c(ee,{variant:"success",onClick:a,disabled:i,children:r.accept}),c(ee,{variant:"dark",onClick:s,children:r.denyRequest})]})]})};function bL(){return c("div",{className:"",children:g(M_,{children:[!1,c(z_,{}),c(qA,{}),c(KA,{}),c(oL,{}),c(lL,{}),c(uL,{}),c(vL,{}),c(SL,{}),c(xL,{}),c(CL,{})]})})}md.createRoot(document.getElementById("root")).render(c(bL,{}))});export default EL();