@danhachuel/jobfinder 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +2 -2
- package/package.json +3 -3
- package/scripts/cli.mjs +10 -29
- package/src/server/storage/bootstrap.mjs +0 -1
- package/src/ui/dist/assets/index-CT_D8FEQ.css +2 -0
- package/src/ui/dist/assets/{index-Dyz0cjaY.js → index-DF1owmbE.js} +2 -2
- package/src/ui/dist/index.html +3 -3
- package/src/ui/dist/assets/index-I2Td16Kp.css +0 -2
|
@@ -8,6 +8,6 @@ Error generating stack: `+e.message+`
|
|
|
8
8
|
`+e.stack}}var We=Object.prototype.hasOwnProperty,Ge=t.unstable_scheduleCallback,Ke=t.unstable_cancelCallback,qe=t.unstable_shouldYield,Je=t.unstable_requestPaint,Ye=t.unstable_now,Xe=t.unstable_getCurrentPriorityLevel,Ze=t.unstable_ImmediatePriority,Qe=t.unstable_UserBlockingPriority,$e=t.unstable_NormalPriority,et=t.unstable_LowPriority,tt=t.unstable_IdlePriority,nt=t.log,rt=t.unstable_setDisableYieldValue,it=null,at=null;function ot(e){if(typeof nt==`function`&&rt(e),at&&typeof at.setStrictMode==`function`)try{at.setStrictMode(it,e)}catch{}}var st=Math.clz32?Math.clz32:ut,ct=Math.log,lt=Math.LN2;function ut(e){return e>>>=0,e===0?32:31-(ct(e)/lt|0)|0}var dt=256,ft=262144,pt=4194304;function mt(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ht(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=mt(n))):i=mt(o):i=mt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=mt(n))):i=mt(o)):i=mt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function gt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _t(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-st(n),i=1<<r;t|=e[r],n&=~i}return t}function vt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yt(){var e=pt;return pt<<=1,!(pt&62914560)&&(pt=4194304),e}function bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function St(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-st(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ct(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ct(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-st(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function wt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-st(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Tt(e,t){var n=t&-t;return n=n&42?1:Et(n),(n&(e.suspendedLanes|t))===0?n:0}function Et(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Dt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ot(){var e=k.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function kt(e,t){var n=k.p;try{return k.p=e,t()}finally{k.p=n}}var At=Math.random().toString(36).slice(2),jt=`__reactFiber$`+At,Mt=`__reactProps$`+At,Nt=`__reactContainer$`+At,Pt=`__reactEvents$`+At,Ft=`__reactListeners$`+At,It=`__reactHandles$`+At,Lt=`__reactResources$`+At,Rt=`__reactMarker$`+At,zt=`__reactLoad$`+At;function Bt(e){delete e[jt],delete e[Mt],delete e[Ft],delete e[It]}function Vt(e){var t;if(t=e[jt])return t;for(var n=e.parentNode;n;){if(t=n[Nt]||n[jt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[jt])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Ht(e){if(e=e[jt]||e[Nt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ut(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Wt(e){var t=e[Lt];return t||=e[Lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Gt(e){e[Rt]=!0}function Kt(e){e[zt]=void 0}var qt=new Set,Jt={};function Yt(e,t){Xt(e,t),Xt(e+`Capture`,t)}function Xt(e,t){for(Jt[e]=t,e=0;e<t.length;e++)qt.add(t[e])}var Zt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Qt={},$t={};function en(e){return We.call($t,e)?!0:We.call(Qt,e)?!1:Zt.test(e)?$t[e]=!0:(Qt[e]=!0,!1)}var A=!1;function tn(){var e=A;return A=!1,e}function nn(e,t,n){if(en(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function rn(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function an(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function on(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function sn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function cn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ln(e){if(!e._valueTracker){var t=sn(e)?`checked`:`value`;e._valueTracker=cn(e,t,``+e[t])}}function un(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=sn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var dn=/[\n"\\]/g;function fn(e){return e.replace(dn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function pn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+on(t)):e.value!==``+on(t)&&(e.value=``+on(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):hn(e,on(n)):o===`number`&&e.value==t?hn(e,on(e.value)):hn(e,on(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+on(s):e.removeAttribute(`name`)}function mn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){ln(e);return}n=n==null?``:``+on(n),t=t==null?n:``+on(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),ln(e)}function hn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function gn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+on(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _n(e,t,n){t!=null&&(t=``+on(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+on(n)}function vn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(Se(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=on(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),ln(e)}function yn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function xn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||bn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Sn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,A=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(xn(e,a,r),A=!0)}else for(var o in t)t.hasOwnProperty(o)&&xn(e,o,t[o])}function Cn(e){if(e.indexOf(`-`)===-1)return!1;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 wn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Tn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function En(e){return Tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Dn(){}var On=null;function kn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var An=null,jn=null;function Mn(e){var t=Ht(e);if(t&&(e=t.stateNode)){var n=e[Mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(pn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+fn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Mt]||null;if(!a)throw Error(i(90));pn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&un(r)}break a;case`textarea`:_n(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&gn(e,!!n.multiple,t,!1)}}}var Nn=!1;function Pn(e,t,n){if(Nn)return e(t,n);Nn=!0;try{return e(t)}finally{if(Nn=!1,(An!==null||jn!==null)&&(zd(),An&&(t=An,e=jn,jn=An=null,Mn(t),e)))for(t=0;t<e.length;t++)Mn(e[t])}}function Fn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Mt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var In=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ln=!1;if(In)try{var Rn={};Object.defineProperty(Rn,"passive",{get:function(){Ln=!0}}),window.addEventListener(`test`,Rn,Rn),window.removeEventListener(`test`,Rn,Rn)}catch{Ln=!1}var zn=null,Bn=null,Vn=null;function Hn(){if(Vn)return Vn;var e,t=Bn,n=t.length,r,i=`value`in zn?zn.value:zn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Vn=i.slice(e,1<r?1-r:void 0)}function Un(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Wn(){return!0}function Gn(){return!1}function Kn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Wn:Gn,this.isPropagationStopped=Gn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Wn)},persist:function(){},isPersistent:Wn}),t}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jn=Kn(qn),Yn=D({},qn,{view:0,detail:0}),Xn=Kn(Yn),Zn,Qn,$n,er=D({},Yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ur,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==$n&&($n&&e.type===`mousemove`?(Zn=e.screenX-$n.screenX,Qn=e.screenY-$n.screenY):Qn=Zn=0,$n=e),Zn)},movementY:function(e){return`movementY`in e?e.movementY:Qn}}),tr=Kn(er),nr=Kn(D({},er,{dataTransfer:0})),rr=Kn(D({},Yn,{relatedTarget:0})),j=Kn(D({},qn,{animationName:0,elapsedTime:0,pseudoElement:0})),ir=Kn(D({},qn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),ar=Kn(D({},qn,{data:0})),or={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},sr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},cr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function lr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cr[e])?!!t[e]:!1}function ur(){return lr}var dr=Kn(D({},Yn,{key:function(e){if(e.key){var t=or[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?sr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ur,charCode:function(e){return e.type===`keypress`?Un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),fr=Kn(D({},er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),pr=Kn(D({},qn,{submitter:0})),mr=Kn(D({},Yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ur})),hr=Kn(D({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0})),gr=Kn(D({},er,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),_r=Kn(D({},qn,{newState:0,oldState:0,source:0})),vr=[9,13,27,32],yr=In&&`CompositionEvent`in window,br=null;In&&`documentMode`in document&&(br=document.documentMode);var xr=In&&`TextEvent`in window&&!br,Sr=In&&(!yr||br&&8<br&&11>=br),Cr=` `,wr=!1;function Tr(e,t){switch(e){case`keyup`:return vr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Dr=!1;function Or(e,t){switch(e){case`compositionend`:return Er(t);case`keypress`:return t.which===32?(wr=!0,Cr):null;case`textInput`:return e=t.data,e===Cr&&wr?null:e;default:return null}}function kr(e,t){if(Dr)return e===`compositionend`||!yr&&Tr(e,t)?(e=Hn(),Vn=Bn=zn=null,Dr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Sr&&t.locale!==`ko`?null:t.data;default:return null}}var Ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Ar[e.type]:t===`textarea`}function Mr(e,t,n,r){An?jn?jn.push(r):jn=[r]:An=r,t=Jf(t,`onChange`),0<t.length&&(n=new Jn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Nr=null,Pr=null;function Fr(e){Vf(e,0)}function Ir(e){if(un(Ut(e)))return e}function Lr(e,t){if(e===`change`)return t}var Rr=!1;if(In){var zr;if(In){var Br=`oninput`in document;if(!Br){var Vr=document.createElement(`div`);Vr.setAttribute(`oninput`,`return;`),Br=typeof Vr.oninput==`function`}zr=Br}else zr=!1;Rr=zr&&(!document.documentMode||9<document.documentMode)}function Hr(){Nr&&(Nr.detachEvent(`onpropertychange`,Ur),Pr=Nr=null)}function Ur(e){if(e.propertyName===`value`&&Ir(Pr)){var t=[];Mr(t,Pr,e,kn(e)),Pn(Fr,t)}}function Wr(e,t,n){e===`focusin`?(Hr(),Nr=t,Pr=n,Nr.attachEvent(`onpropertychange`,Ur)):e===`focusout`&&Hr()}function Gr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Ir(Pr)}function Kr(e,t){if(e===`click`)return Ir(t)}function qr(e,t){if(e===`input`||e===`change`)return Ir(t)}function Jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Yr=typeof Object.is==`function`?Object.is:Jr;function Xr(e,t){if(Yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!We.call(t,i)||!Yr(e[i],t[i]))return!1}return!0}function Zr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $r(e,t){var n=Qr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Qr(n)}}function ei(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ei(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ti(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Zr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Zr(e.document)}return t}function ni(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`)}var ri=In&&`documentMode`in document&&11>=document.documentMode,ii=null,ai=null,oi=null,si=!1;function ci(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;si||ii==null||ii!==Zr(r)||(r=ii,`selectionStart`in r&&ni(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}),oi&&Xr(oi,r)||(oi=r,r=Jf(ai,`onSelect`),0<r.length&&(t=new Jn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ii)))}function li(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ui={animationend:li(`Animation`,`AnimationEnd`),animationiteration:li(`Animation`,`AnimationIteration`),animationstart:li(`Animation`,`AnimationStart`),transitionrun:li(`Transition`,`TransitionRun`),transitionstart:li(`Transition`,`TransitionStart`),transitioncancel:li(`Transition`,`TransitionCancel`),transitionend:li(`Transition`,`TransitionEnd`)},di={},fi={};In&&(fi=document.createElement(`div`).style,`AnimationEvent`in window||(delete ui.animationend.animation,delete ui.animationiteration.animation,delete ui.animationstart.animation),`TransitionEvent`in window||delete ui.transitionend.transition);function pi(e){if(di[e])return di[e];if(!ui[e])return e;var t=ui[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fi)return di[e]=t[n];return e}var mi=pi(`animationend`),hi=pi(`animationiteration`),gi=pi(`animationstart`),_i=pi(`transitionrun`),vi=pi(`transitionstart`),yi=pi(`transitioncancel`),bi=pi(`transitionend`),xi=new Map,Si=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Si.push(`scrollEnd`);function Ci(e,t){xi.set(e,t),Yt(t,[e])}var wi=0;function Ti(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=wi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Ei(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Di(e,t){return e=Ei(e),t=Ei(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Oi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ki=[],Ai=0,ji=0;function Mi(){for(var e=Ai,t=ji=Ai=0;t<e;){var n=ki[t];ki[t++]=null;var r=ki[t];ki[t++]=null;var i=ki[t];ki[t++]=null;var a=ki[t];if(ki[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ii(n,i,a)}}function Ni(e,t,n,r){ki[Ai++]=e,ki[Ai++]=t,ki[Ai++]=n,ki[Ai++]=r,ji|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Pi(e,t,n,r){return Ni(e,t,n,r),Li(e)}function Fi(e,t){return Ni(e,null,null,t),Li(e)}function Ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-st(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Li(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ri={};function zi(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.refCleanup=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 Bi(e,t,n,r){return new zi(e,t,n,r)}function Vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hi(e,t){var n=e.alternate;return n===null?(n=Bi(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&1206910976,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.refCleanup=e.refCleanup,n}function Ui(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Wi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Vi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,ke.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case pe:return e=Bi(31,n,t,a),e.elementType=pe,e.lanes=o,e;case re:return Gi(n.children,a,o,t);case ie:s=8,a|=24;break;case ae:return e=Bi(12,n,t,a|2),e.elementType=ae,e.lanes=o,e;case le:return e=Bi(13,n,t,a),e.elementType=le,e.lanes=o,e;case ue:return e=Bi(19,n,t,a),e.elementType=ue,e.lanes=o,e;case me:case ge:return e=a|32,e=Bi(30,n,t,e),e.elementType=ge,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case se:s=10;break a;case oe:s=9;break a;case ce:s=11;break a;case de:s=14;break a;case fe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Bi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Gi(e,t,n,r){return e=Bi(7,e,r,t),e.lanes=n,e}function Ki(e,t,n){return e=Bi(6,e,null,t),e.lanes=n,e}function qi(e){var t=Bi(18,null,null,0);return t.stateNode=e,t}function M(e,t,n){return t=Bi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ji=new WeakMap;function N(e,t){if(typeof e==`object`&&e){var n=Ji.get(e);return n===void 0?(t={value:e,source:t,stack:Ue(t)},Ji.set(e,t),t):n}return{value:e,source:t,stack:Ue(t)}}var Yi=[],Xi=0,Zi=null,Qi=0,$i=[],ea=0,ta=null,na=1,ra=``;function ia(e,t){Yi[Xi++]=Qi,Yi[Xi++]=Zi,Zi=e,Qi=t}function aa(e,t,n){$i[ea++]=na,$i[ea++]=ra,$i[ea++]=ta,ta=e;var r=na;e=ra;var i=32-st(r)-1;r&=~(1<<i),n+=1;var a=32-st(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,na=1<<32-st(t)+i|n<<i|r,ra=a+e}else na=1<<a|n<<i|r,ra=e}function oa(e){e.return!==null&&(ia(e,1),aa(e,1,0))}function sa(e){for(;e===Zi;)Zi=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null;for(;e===ta;)ta=$i[--ea],$i[ea]=null,ra=$i[--ea],$i[ea]=null,na=$i[--ea],$i[ea]=null}function ca(e,t){$i[ea++]=na,$i[ea++]=ra,$i[ea++]=ta,na=t.id,ra=t.overflow,ta=e}var la=null,ua=null,P=!1,F=null,da=!1,fa=Error(i(519));function pa(e){throw ya(N(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),fa}function ma(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[jt]=e,t[Mt]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<zf.length;n++)Q(zf[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),mn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),vn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ep(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=Dn),t=!0):t=!1,t||pa(e,!0)}function ha(e){for(la=e.return;la;)switch(la.tag){case 5:case 31:case 13:da=!1;return;case 27:case 3:da=!0;return;default:la=la.return}}function ga(e){if(e!==la)return!1;if(!P)return ha(e),P=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&ua&&pa(e),ha(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ua=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ua=dm(e)}else t===27?(t=ua,Sp(e.type)?(e=um,um=null,ua=e):ua=t):ua=la?lm(e.stateNode.nextSibling):null;return!0}function _a(){ua=la=null,P=!1}function va(){var e=F;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),F=null),e}function ya(e){F===null?F=[e]:F.push(e)}var ba=Ee(null),xa=null,Sa=null;function Ca(e,t,n){Oe(ba,t._currentValue),t._currentValue=n}function wa(e){e._currentValue=ba.current,De(ba)}function Ta(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ea(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ta(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ta(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ta(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Da(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Me.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&Ea(t,e,n,r),t.flags|=262144,e!==null}function Oa(e){for(e=e.firstContext;e!==null;){if(!Yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ka(e){xa=e,Sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Aa(e){return Ma(xa,e)}function ja(e,t){return xa===null&&ka(e),Ma(e,t)}function Ma(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Sa===null){if(e===null)throw Error(i(308));Sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sa=Sa.next=t;return n}var Na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Pa=t.unstable_scheduleCallback,Fa=t.unstable_NormalPriority,Ia={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function La(){return{controller:new Na,data:new Map,refCount:0}}function Ra(e){e.refCount--,e.refCount===0&&Pa(Fa,function(){e.controller.abort()})}function za(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ba=null;function Va(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ha=null,Ua=0,Wa=0,Ga=null;function Ka(e,t){if(Ha===null){var n=Ha=[];Ua=0,Wa=Pf(),Ga={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ua++,t.then(qa,qa),t}function qa(){if(--Ua===0&&(Ba=null,Ha!==null)){Ga!==null&&(Ga.status=`fulfilled`);var e=Ha;Ha=null,Wa=0,Ga=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ja(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Ya=O.S;O.S=function(e,t){if(hd=Ye(),typeof t==`object`&&t&&typeof t.then==`function`&&Ka(e,t),Ba!==null)for(var n=bf;n!==null;)za(n,Ba),n=n.next;if(n=e.types,n!==null){for(var r=bf;r!==null;)za(r,n),r=r.next;if(Wa!==0){r=Ba,r===null&&(r=Ba=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ya!==null&&Ya(e,t)};var Xa=Ee(null);function Za(){var e=Xa.current;return e===null?ed.pooledCache:e}function Qa(e,t){t===null?Oe(Xa,Xa.current):Oe(Xa,t.pool)}function $a(){var e=Za();return e===null?null:{parent:Ia._currentValue,pool:e}}var eo=Error(i(460)),to=Error(i(474)),no=Error(i(542)),ro={then:function(){}};function io(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ao(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Dn,Dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,I(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(Dn,Dn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,I(e),e}throw so=t,eo}}function oo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(so=e,eo):e}}var so=null;function co(){if(so===null)throw Error(i(459));var e=so;return so=null,e}function I(e){if(e===eo||e===no)throw Error(i(483))}var L=null,R=0;function lo(e){var t=R;return R+=1,L===null&&(L=[]),ao(L,e,t)}function uo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function z(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function fo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Hi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ki(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===re?(e=d(e,t,n.props.children,r,n.key),uo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===fe&&oo(i)===t.type)?(t=a(t,n.props),uo(t,n),t.return=e,t):(t=Wi(n.type,n.key,n.props,null,e.mode,r),uo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=M(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Gi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ki(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=Wi(t.type,t.key,t.props,null,e.mode,n),uo(n,t),n.return=e,n;case ne:return t=M(t,e.mode,n),t.return=e,t;case fe:return t=oo(t),f(e,t,n)}if(Se(t)||ye(t))return t=Gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,lo(t),n);if(t.$$typeof===se)return f(e,ja(e,t),n);z(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case fe:return n=oo(n),p(e,t,n,r)}if(Se(n)||ye(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,lo(n),r);if(n.$$typeof===se)return p(e,t,ja(e,n),r);z(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case fe:return r=oo(r),m(e,t,n,r,i)}if(Se(r)||ye(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,lo(r),i);if(r.$$typeof===se)return m(e,t,n,ja(t,r),i);z(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),P&&ia(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return P&&ia(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),P&&ia(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),P&&ia(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return P&&ia(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),P&&ia(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case te:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),uo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===fe&&oo(l)===r.type){n(e,r.sibling),c=a(r,o.props),uo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Gi(o.props.children,e.mode,c,o.key),uo(c,o),c.return=e,e=c):(c=Wi(o.type,o.key,o.props,null,e.mode,c),uo(c,o),c.return=e,e=c)}return s(e);case ne:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=M(o,e.mode,c),c.return=e,e=c}return s(e);case fe:return o=oo(o),_(e,r,o,c)}if(Se(o))return h(e,r,o,c);if(ye(o)){if(l=ye(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,lo(o),c);if(o.$$typeof===se)return _(e,r,ja(e,o),c);z(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ki(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{R=0;var i=_(e,t,n,r);return L=null,i}catch(t){if(t===eo||t===no)throw t;var a=Bi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var po=fo(!0),mo=fo(!1),B=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Li(e),Ii(e,null,n),t}return Ni(e,r,t,n),Li(e)}function yo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wt(e,n)}}function bo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=Ga;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;B=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===Wa&&(xo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:B=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),od|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=Ee(null),Do=Ee(0);function Oo(e,t){e=ad,Oe(Do,e),Oe(Eo,t),ad=e|t.baseLanes}function ko(){Oe(Do,ad),Oe(Eo,Eo.current)}function Ao(){ad=Do.current,De(Eo),De(Do)}var V=Ee(null),H=null;function jo(e){var t=e.alternate;Oe(Io,Io.current&1),Oe(V,e),H===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(H=e)}function Mo(e){Oe(Io,Io.current),Oe(V,e),H===null&&(H=e)}function No(e){e.tag===22?(Oe(Io,Io.current),Oe(V,e),H===null&&(H=e)):Po()}function Po(){Oe(Io,Io.current),Oe(V,V.current)}function Fo(e){De(V),H===e&&(H=null),De(Io)}var Io=Ee(0);function Lo(e,t){Oe(V,V.current),Oe(Io,t)}function Ro(e){De(Io),De(V),H===e&&(H=null)}function zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Bo=0,U=null,W=null,Vo=null,Ho=!1,Uo=!1,Wo=!1,Go=0,Ko=0,qo=null,Jo=0;function Yo(){throw Error(i(321))}function Xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yr(e[n],t[n]))return!1;return!0}function Zo(e,t,n,r,i,a){return Bo=a,U=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?mc:hc,Wo=!1,a=n(r,i),Wo=!1,Uo&&(a=$o(t,n,r,i)),Qo(e),a}function Qo(e){O.H=pc;var t=W!==null&&W.next!==null;if(Bo=0,Vo=W=U=null,Ho=!1,Ko=0,qo=null,t)throw Error(i(300));e===null||Mc||(e=e.dependencies,e!==null&&Oa(e)&&(Mc=!0))}function $o(e,t,n,r){U=e;var a=0;do{if(Uo&&(qo=null),Ko=0,Uo=!1,25<=a)throw Error(i(301));if(a+=1,Vo=W=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=gc,o=t(n,r)}while(Uo);return o}function es(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?ss(t):t,e=e.useState()[0],(W===null?null:W.memoizedState)!==e&&(U.flags|=1024),t}function ts(){var e=Go!==0;return Go=0,e}function ns(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function rs(e){if(Ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ho=!1}Bo=0,Vo=W=U=null,Uo=!1,Ko=Go=0,qo=null}function is(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vo===null?U.memoizedState=Vo=e:Vo=Vo.next=e,Vo}function as(){if(W===null){var e=U.alternate;e=e===null?null:e.memoizedState}else e=W.next;var t=Vo===null?U.memoizedState:Vo.next;if(t!==null)Vo=t,W=e;else{if(e===null)throw U.alternate===null?Error(i(467)):Error(i(310));W=e,e={memoizedState:W.memoizedState,baseState:W.baseState,baseQueue:W.baseQueue,queue:W.queue,next:null},Vo===null?U.memoizedState=Vo=e:Vo=Vo.next=e}return Vo}function os(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ss(e){var t=Ko;return Ko+=1,qo===null&&(qo=[]),e=ao(qo,e,t),t=U,(Vo===null?t.memoizedState:Vo.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?mc:hc),e}function cs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ss(e);if(e.$$typeof===_e)return;if(e.$$typeof===se)return Aa(e)}throw Error(i(438,String(e)))}function ls(e){var t=null,n=U.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=U.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=os(),U.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=he;return t.index++,n}function us(e,t){return typeof t==`function`?t(e):t}function ds(e){return fs(as(),W,e)}function fs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Bo&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Wa&&(d=!0);else if((Bo&p)===p){u=u.next,p===Wa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,U.lanes|=p,od|=p;f=u.action,Wo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,U.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Yr(o,e.memoizedState)&&(Mc=!0,d&&(n=Ga,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ps(e){var t=as(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Yr(o,t.memoizedState)||(Mc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ms(e,t,n){var r=U,a=as(),o=P;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Yr((W||a).memoizedState,n);if(s&&(a.memoizedState=n,Mc=!0),a=a.queue,zs(_s.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Vo!==null&&!!(Vo.memoizedState.tag&1),Ps(e?9:8,{destroy:void 0},gs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Bo&127||hs(r,t,n)}return n}function hs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=U.updateQueue,t===null?(t=os(),U.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gs(e,t,n,r){t.value=n,t.getSnapshot=r,vs(t)&&ys(e)}function _s(e,t,n){return n(function(){vs(t)&&ys(e)})}function vs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yr(e,n)}catch{return!0}}function ys(e){var t=Fi(e,2);t!==null&&Pd(t,e,2)}function bs(e){var t=is();if(typeof e==`function`){var n=e;if(e=n(),Wo){ot(!0);try{n()}finally{ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:e},t}function xs(e,t,n,r){return e.baseState=n,fs(e,W,typeof r==`function`?r:us)}function Ss(e,t,n,r,a){if(uc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Cs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Cs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};o.types=a===null?null:a.types,O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),ws(e,t,s)}catch(n){Es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),ws(e,t,a)}catch(n){Es(e,t,n)}}function ws(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ts(e,t,n)},function(n){return Es(e,t,n)}):Ts(e,t,n)}function Ts(e,t,n){t.status=`fulfilled`,t.value=n,Ds(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cs(e,n)))}function Es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ds(t),t=t.next;while(t!==r)}e.action=null}function Ds(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Os(e,t){return t}function ks(e,t){if(P){var n=ed.formState;if(n!==null){a:{var r=U;if(P){if(ua){b:{for(var i=ua,a=da;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ua=lm(i.nextSibling),r=i.data===`F!`;break a}}pa(r)}r=!1}r&&(t=n[0])}}return n=is(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:t},n.queue=r,n=sc.bind(null,U,r),r.dispatch=n,r=bs(!1),a=lc.bind(null,U,!1,r.queue),r=is(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ss.bind(null,U,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function As(e){return js(as(),W,e)}function js(e,t,n){if(t=fs(e,t,Os)[0],e=ds(us)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ss(t)}catch(e){throw e===eo?no:e}else r=t;t=as();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(U.flags|=2048,Ps(9,{destroy:void 0},Ms.bind(null,i,n),null)),[r,a,e]}function Ms(e,t){e.action=t}function Ns(e){var t=as(),n=W;if(n!==null)return js(t,n,e);as(),t=t.memoizedState,n=as();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ps(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=U.updateQueue,t===null&&(t=os(),U.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Fs(){return as().memoizedState}function Is(e,t,n,r){var i=is();U.flags|=e,i.memoizedState=Ps(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ls(e,t,n,r){var i=as();r=r===void 0?null:r;var a=i.memoizedState.inst;W!==null&&r!==null&&Xo(r,W.memoizedState.deps)?i.memoizedState=Ps(t,a,n,r):(U.flags|=e,i.memoizedState=Ps(1|t,a,n,r))}function Rs(e,t){Is(8390656,8,e,t)}function zs(e,t){Ls(2048,8,e,t)}function Bs(e){U.flags|=4;var t=U.updateQueue;if(t===null)t=os(),U.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vs(e){var t=as().memoizedState;return Bs({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Hs(e,t){return Ls(4,2,e,t)}function Us(e,t){return Ls(4,4,e,t)}function Ws(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Gs(e,t,n){n=n==null?null:n.concat([e]),Ls(4,4,Ws.bind(null,t,e),n)}function Ks(){}function qs(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Js(e,t){var n=as();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Xo(t,r[1]))return r[0];if(r=e(),Wo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r}function Ys(e,t,n){return n===void 0||Bo&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),U.lanes|=e,od|=e,n)}function Xs(e,t,n,r){return Yr(n,t)?n:Eo.current===null?!(Bo&106)||Bo&1073741824&&!(J&261930)?(Mc=!0,e.memoizedState=n):(e=Md(),U.lanes|=e,od|=e,t):(e=Ys(e,n,r),Yr(e,t)||(Mc=!0),e)}function Zs(e,t,n,r,i){var a=k.p;k.p=a!==0&&8>a?a:8;var o=O.T,s={};s.types=o===null?null:o.types,O.T=s,lc(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?cc(e,t,Ja(c,r),jd(e)):cc(e,t,r,jd(e))}catch(n){cc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function Qs(){}function $s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ec(e).queue;Zs(e,a,t,Ce,n===null?Qs:function(){return tc(e),n(r)})}function ec(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ce,baseState:Ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:Ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:us,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tc(e){var t=ec(e);t.next===null&&(t=e.alternate.memoizedState),cc(e,t.next.queue,{},jd())}function nc(){return Aa(sh)}function rc(){return as().memoizedState}function ic(){return as().memoizedState}function ac(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=_o(n);var r=vo(t,e,n);r!==null&&(Pd(r,t,n),yo(r,t,n)),t={cache:La()},e.payload=t;return}t=t.return}}function oc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)?dc(t,n):(n=Pi(e,t,n,r),n!==null&&(Pd(n,e,r),fc(n,t,r)))}function sc(e,t,n){cc(e,t,n,jd())}function cc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(uc(e))dc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Yr(s,o))return Ni(e,t,i,0),ed===null&&Mi(),!1}catch{}if(n=Pi(e,t,i,r),n!==null)return Pd(n,e,r),fc(n,t,r),!0}return!1}function lc(e,t,n,r){if(r={lane:2,revertLane:Pf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(i(479))}else t=Pi(e,n,r,2),t!==null&&Pd(t,e,2)}function uc(e){var t=e.alternate;return e===U||t!==null&&t===U}function dc(e,t){Uo=Ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function fc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wt(e,n)}}var pc={readContext:Aa,use:cs,useCallback:Yo,useContext:Yo,useEffect:Yo,useImperativeHandle:Yo,useLayoutEffect:Yo,useInsertionEffect:Yo,useMemo:Yo,useReducer:Yo,useRef:Yo,useState:Yo,useDebugValue:Yo,useDeferredValue:Yo,useTransition:Yo,useSyncExternalStore:Yo,useId:Yo,useHostTransitionStatus:Yo,useFormState:Yo,useActionState:Yo,useOptimistic:Yo,useMemoCache:Yo,useCacheRefresh:Yo,useEffectEvent:Yo},mc={readContext:Aa,use:cs,useCallback:function(e,t){return is().memoizedState=[e,t===void 0?null:t],e},useContext:Aa,useEffect:Rs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Is(4194308,4,Ws.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Is(4194308,4,e,t)},useInsertionEffect:function(e,t){Is(4,2,e,t)},useMemo:function(e,t){var n=is();t=t===void 0?null:t;var r=e();if(Wo){ot(!0);try{e()}finally{ot(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=is();if(n!==void 0){var i=n(t);if(Wo){ot(!0);try{n(t)}finally{ot(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=oc.bind(null,U,e),[r.memoizedState,e]},useRef:function(e){var t=is();return e={current:e},t.memoizedState=e},useState:function(e){e=bs(e);var t=e.queue,n=sc.bind(null,U,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ks,useDeferredValue:function(e,t){return Ys(is(),e,t)},useTransition:function(){var e=bs(!1);return e=Zs.bind(null,U,e.queue,!0,!1),is().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=U,a=is();if(P){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));J&127||hs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Rs(_s.bind(null,r,o,e),[e]),r.flags|=2048,Ps(9,{destroy:void 0},gs.bind(null,r,o,n,t),null),n},useId:function(){var e=is(),t=ed.identifierPrefix;if(P){var n=ra,r=na;n=(r&~(1<<32-st(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Jo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:nc,useFormState:ks,useActionState:ks,useOptimistic:function(e){var t=is();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=lc.bind(null,U,!0,n),n.dispatch=t,[e,t]},useMemoCache:ls,useCacheRefresh:function(){return is().memoizedState=ac.bind(null,U)},useEffectEvent:function(e){var t=is(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hc={readContext:Aa,use:cs,useCallback:qs,useContext:Aa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ds,useRef:Fs,useState:function(){return ds(us)},useDebugValue:Ks,useDeferredValue:function(e,t){return Xs(as(),W.memoizedState,e,t)},useTransition:function(){var e=ds(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:As,useActionState:As,useOptimistic:function(e,t){return xs(as(),W,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs},gc={readContext:Aa,use:cs,useCallback:qs,useContext:Aa,useEffect:zs,useImperativeHandle:Gs,useInsertionEffect:Hs,useLayoutEffect:Us,useMemo:Js,useReducer:ps,useRef:Fs,useState:function(){return ps(us)},useDebugValue:Ks,useDeferredValue:function(e,t){var n=as();return W===null?Ys(n,e,t):Xs(n,W.memoizedState,e,t)},useTransition:function(){var e=ps(us)[0],t=as().memoizedState;return[typeof e==`boolean`?e:ss(e),t]},useSyncExternalStore:ms,useId:rc,useHostTransitionStatus:nc,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){var n=as();return W===null?(n.baseState=e,[e,n.queue.dispatch]):xs(n,W,e,t)},useMemoCache:ls,useCacheRefresh:ic,useEffectEvent:Vs};function _c(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Pd(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Pd(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(Pd(t,e,n),yo(t,e,n))}};function yc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Xr(n,r)||!Xr(i,a):!0}function bc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&vc.enqueueReplaceState(t,t.state,null)}function xc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Sc(e){Oi(e)}function Cc(e){console.error(e)}function wc(e){Oi(e)}function Tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ec(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Tc(e,t)},n}function Oc(e){return e=_o(e),e.tag=3,e}function kc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ec(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Ac(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Da(t,n,a,!0),n=V.current,n!==null){switch(n.tag){case 31:case 13:case 19:return H===null?Kd():n.alternate===null&&X===0&&(X=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),mf(e,r,a)),!1;case 22:return n.flags|=65536,r===ro?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),mf(e,r,a)),!1}throw Error(i(435,n.tag))}return mf(e,r,a),Kd(),!1}if(P)return t=V.current,t===null?(r!==fa&&(t=Error(i(423),{cause:r}),ya(N(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=N(r,n),a=Dc(e.stateNode,r,a),bo(e,a),X!==4&&(X=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==fa&&(e=Error(i(422),{cause:r}),ya(N(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=N(o,n),dd===null?dd=[o]:dd.push(o),X!==4&&(X=2),t===null)return!0;r=N(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Dc(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Oc(a),kc(a,e,n,r),bo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var jc=Error(i(461)),Mc=!1;function Nc(e,t,n,r){t.child=e===null?mo(t,null,n,r):po(t,e.child,n,r)}function Pc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ka(t),r=Zo(e,t,n,o,a,i),s=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(P&&s&&oa(t),t.flags|=1,Nc(e,t,r,i),t.child)}function Fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Vi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Ic(e,t,a,r,i)):(e=Wi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ll(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Xr:n,n(o,r)&&e.ref===t.ref)return cl(e,t,i)}return t.flags|=1,e=Hi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Xr(a,r)&&e.ref===t.ref){if(Mc=!1,t.pendingProps=r=a,ll(e,i))e.flags&131072&&(Mc=!0);else return t.lanes=e.lanes,cl(e,t,i)}}return Wc(e,t,n,r,i)}function Lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return zc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),No(t);else return r=t.lanes=536870912,zc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Qa(t,null),ko(),Po()):(Qa(t,a.cachePool),Oo(t,a),Po(),t.memoizedState=null);return Nc(e,t,i,n),t.child}function Rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zc(e,t,n,r,i){var a=Za();return a=a===null?null:{parent:Ia._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Qa(t,null),ko(),No(t),e!==null&&Da(e,t,r,!0),t.childLanes=i,null}function Bc(e,t){return t=$c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vc(e,t,n){return po(t,e.child,null,n),e=Bc(t,t.pendingProps),e.flags|=2,Fo(t),t.memoizedState=null,e}function Hc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(P){if(r.mode===`hidden`)return e=Bc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Rc(null,e);if(Mo(t),(e=ua)?(e=am(e,da),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ta===null?null:{id:na,overflow:ra},retryLane:536870912,hydrationErrors:null},n=qi(e),n.return=t,t.child=n,la=t,ua=null)):e=null,e===null)throw pa(t);return t.lanes=536870912,null}return Bc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Mo(t),a){if(t.flags&256)t.flags&=-257,t=Vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Mc||Da(e,t,n,!1),a=(n&e.childLanes)!==0,Mc||a){if(Eo.current===null){if(r=ed,r!==null&&(s=Tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Fi(e,s),Pd(r,e,s),jc;Kd()}t=Vc(e,t,n)}else e=o.treeContext,ua=lm(s.nextSibling),la=t,P=!0,F=null,da=!1,e!==null&&ca(t,e),t=Bc(t,r),t.flags|=134221824;return t}return e=Hi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Wc(e,t,n,r,i){return ka(t),n=Zo(e,t,n,r,void 0,i),r=ts(),e!==null&&!Mc?(ns(e,t,i),cl(e,t,i)):(P&&r&&oa(t),t.flags|=1,Nc(e,t,n,i),t.child)}function Gc(e,t,n,r,i,a){return ka(t),t.updateQueue=null,n=$o(t,r,n,i),Qo(e),r=ts(),e!==null&&!Mc?(ns(e,t,a),cl(e,t,a)):(P&&r&&oa(t),t.flags|=1,Nc(e,t,n,a),t.child)}function Kc(e,t,n,r,i){if(ka(t),t.stateNode===null){var a=Ri,o=n.contextType;typeof o==`object`&&o&&(a=Aa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=vc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Aa(o):Ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(_c(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&vc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=xc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ri,typeof u==`object`&&u&&(o=Aa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&bc(t,a,r,o),B=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||B?(typeof d==`function`&&(_c(t,n,d,r),l=t.memoizedState),(c=B||yc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,go(e,t),o=t.memoizedProps,u=xc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ri,typeof l==`object`&&l&&(c=Aa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&bc(t,a,r,c),B=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||B||e!==null&&e.dependencies!==null&&Oa(e.dependencies)?(typeof s==`function`&&(_c(t,n,s,r),p=t.memoizedState),(u=B||yc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Oa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Uc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=po(t,e.child,null,i),t.child=po(t,null,n,i)):Nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=cl(e,t,i),e}function qc(e,t,n,r){return _a(),t.flags|=256,Nc(e,t,n,r),t.child}var Jc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yc(e){return{baseLanes:e,cachePool:$a()}}function Xc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Zc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Io.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(P){if(i?jo(t):Po(),(e=ua)?(e=am(e,da),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ta===null?null:{id:na,overflow:ra},retryLane:536870912,hydrationErrors:null},n=qi(e),n.return=t,t.child=n,la=t,ua=null)):e=null,e===null)throw pa(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Po(),i=t.mode,a=$c({mode:`hidden`,children:a},i),r=Gi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Yc(n),r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(null,r)):(jo(t),Qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return tl(e,t,a,o,r,c,s,n)}return i?(Po(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Hi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Gi(i,a,n,null),i.flags|=2):i=Hi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Rc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Yc(n):(a=i.cachePool,a===null?a=$a():(s=Ia._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Xc(e,o,n),t.memoizedState=Jc,Rc(e.child,r)):(jo(t),n=e.child,e=n.sibling,n=Hi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Qc(e,t){return t=$c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function $c(e,t){return e=Bi(22,e,null,t),e.lanes=0,e}function el(e,t,n){return po(t,e.child,null,n),e=Qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(jo(t),t.flags&=-257,el(e,t,c)):t.memoizedState===null?(Po(),o=a.fallback,s=t.mode,a=$c({mode:`visible`,children:a.children},s),o=Gi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,po(t,e.child,null,c),a=t.child,a.memoizedState=Yc(c),a.childLanes=Xc(e,r,c),t.memoizedState=Jc,Rc(null,a)):(Po(),t.child=e.child,t.flags|=128,null);if(jo(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ya({value:a,source:null,stack:null})),el(e,t,c)}if(Mc||Da(e,t,c,!1),r=(c&e.childLanes)!==0,Mc||r){if(Eo.current!==null)return el(e,t,c);if(r=ed,r!==null&&(a=Tt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Fi(e,a),Pd(r,e,a),jc;return om(o)||Kd(),el(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ua=lm(o.nextSibling),la=t,P=!0,F=null,da=!1,e!==null&&ca(t,e),t=Qc(t,a.children),t.flags|=134221824,t)}function nl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ta(e.return,t,n)}function rl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&zo(n)===null&&(t=e),e=e.sibling}return t}function il(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function al(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ol(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Io.current;if(t.flags&128)return Lo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Lo(t,o),i===`backwards`&&e!==null?(al(e),Nc(e,t,r,n),al(e)):Nc(e,t,r,n),r=P?Qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nl(e,n,t);else if(e.tag===19)nl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,al(t)),il(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}il(t,!0,n,null,a,r);break;case`together`:il(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=rl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),il(t,!1,i,n,a,r)}return t.child}function sl(e,t,n){var r=t.pendingProps;return Ca(t,t.type,r.value),Nc(e,t,r.children,n),t.child}function cl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Da(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ll(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Oa(e)))}function ul(e,t,n){switch(t.tag){case 3:Ne(t,t.stateNode.containerInfo),Ca(t,Ia,e.memoizedState.cache),_a();break;case 27:case 5:Fe(t);break;case 4:Ne(t,t.stateNode.containerInfo);break;case 10:Ca(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return jo(t),t.flags|=128,null;r=Da(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Zc(e,t,n):(jo(t),e=cl(e,t,n),e===null?null:e.sibling)}jo(t);break;case 19:if(t.flags&128)return ol(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Da(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ol(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Lo(t,Io.current),r)break;return null;case 22:return t.lanes=0,Lc(e,t,n,t.pendingProps);case 24:Ca(t,Ia,e.memoizedState.cache)}return cl(e,t,n)}function dl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Mc=!0;else{if(!ll(e,n)&&!(t.flags&128))return Mc=!1,ul(e,t,n);Mc=!!(e.flags&131072)}}else Mc=!1,P&&t.flags&1048576&&aa(t,Qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=oo(t.elementType),t.type=e,typeof e==`function`)Vi(e)?(r=xc(e,r),t.tag=1,t=Kc(null,t,e,r,n)):(t.tag=0,t=Wc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ce){t.tag=11,t=Pc(null,t,e,r,n);break a}if(a===de){t.tag=14,t=Fc(null,t,e,r,n);break a}if(a===se){t.tag=10,t.type=e,t=sl(null,t,n);break a}}throw t=xe(e)||e,Error(i(306,t,``))}}return t;case 0:return Wc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=xc(r,t.pendingProps),Kc(e,t,r,a,n);case 3:a:{if(Ne(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ca(t,Ia,r),r!==o.cache&&Ea(t,[Ia],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=qc(e,t,r,n);break a}if(r!==a){a=N(Error(i(424)),t),ya(a),t=qc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ua=lm(e.firstChild),la=t,P=!0,F=null,da=!0,n=mo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(_a(),r===a){t=cl(e,t,n);break a}Nc(e,t,r,n)}t=t.child}return t;case 26:return Uc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:P||(t.stateNode=fp(t.type,t.pendingProps,je.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Fe(t),e===null&&P&&(r=t.stateNode=hm(t.type,t.pendingProps,je.current),la=t,da=!0,a=ua,Sp(t.type)?(um=a,ua=lm(r.firstChild)):ua=a),Nc(e,t,t.pendingProps.children,n),Uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&P&&((a=r=ua)&&(r=rm(r,t.type,t.pendingProps,da),r===null?a=!1:(t.stateNode=r,la=t,ua=lm(r.firstChild),da=!1,a=!0)),a||pa(t)),Fe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Zo(e,t,es,null,null,n),sh._currentValue=a),Uc(e,t),Nc(e,t,r,n),t.child;case 6:return e===null&&P&&((e=n=ua)&&(n=im(n,t.pendingProps,da),n===null?e=!1:(t.stateNode=n,la=t,ua=null,e=!0)),e||pa(t)),null;case 13:return Zc(e,t,n);case 4:return Ne(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=po(t,null,r,n):Nc(e,t,r,n),t.child;case 11:return Pc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Uc(e,t),Nc(e,t,r,n),t.child;case 8:return Nc(e,t,t.pendingProps.children,n),t.child;case 12:return Nc(e,t,t.pendingProps.children,n),t.child;case 10:return sl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ka(t),a=Aa(a),r=r(a),t.flags|=1,Nc(e,t,r,n),t.child;case 14:return Fc(e,t,t.type,t.pendingProps,n);case 15:return Ic(e,t,t.type,t.pendingProps,n);case 19:return ol(e,t,n);case 31:return Hc(e,t,n);case 22:return Lc(e,t,n,t.pendingProps);case 24:return ka(t),r=Aa(Ia),e===null?(a=Za(),a===null&&(a=ed,o=La(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ho(t),Ca(t,Ia,a)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ca(t,Ia,r),r!==a.cache&&Ea(t,[Ia],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ca(t,Ia,r))),Nc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:P&&oa(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Uc(e,t),Nc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function fl(e){e.flags|=4}function pl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw so=ro,to}}else e.flags&=-16777217}function ml(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Ud())e.flags|=8192;else throw so=ro,to}}function hl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:yt(),e.lanes|=t,ud|=t)}function gl(e,t){if(!P)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function _l(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function vl(e,t,n){var r=t.pendingProps;switch(sa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _l(t),null;case 1:return _l(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),wa(Ia),Pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ga(t)?fl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,va())),_l(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(fl(t),o===null?(_l(t),pl(t,a,null,r,n)):(_l(t),ml(t,o))):o?o===e.memoizedState?(_l(t),t.flags&=-16777217):(fl(t),_l(t),ml(t,o)):(e=e.memoizedProps,e!==r&&fl(t),_l(t),pl(t,a,e,r,n)),null;case 27:if(Ie(t),n=je.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}e=ke.current,ga(t)?ma(t,e):(e=hm(a,r,n),t.stateNode=e,fl(t))}return _l(t),t.subtreeFlags&=-33554433,null;case 5:if(Ie(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return _l(t),t.subtreeFlags&=-33554433,null}if(o=ke.current,ga(t))ma(t,o);else{var s=lp(je.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[jt]=t,o[Mt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&fl(t)}}return _l(t),t.subtreeFlags&=-33554433,pl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&fl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=je.current,ga(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=la,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[jt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||pa(t,!0)}else e=lp(e).createTextNode(r),e[jt]=t,t.stateNode=e}return _l(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ga(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[jt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),e=!1}else n=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Fo(t),t):(Fo(t),null);if(t.flags&128)throw Error(i(558))}return _l(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ga(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[jt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_l(t),a=!1}else a=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Fo(t),t):(Fo(t),null)}return Fo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),hl(t,t.updateQueue),_l(t),null);case 4:return Pe(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,_l(t),null;case 10:return wa(t.type),_l(t),null;case 19:if(Ro(t),r=t.memoizedState,r===null)return _l(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)gl(r,!1);else{if(X!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=zo(e),o!==null){for(t.flags|=128,gl(r,!1),e=o.updateQueue,t.updateQueue=e,hl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ui(n,e),n=n.sibling;return Lo(t,Io.current&1|2),P&&ia(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ye()>gd&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=zo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,hl(t,e),gl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!P)return _l(t),null}else 2*Ye()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,gl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ye(),e.sibling=null,o=Io.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||P?Lo(t,o):(n=o,Oe(V,t),Oe(Io,n),H===null&&(H=t)),P&&ia(t,r.treeForkCount),e}return _l(t),null;case 22:case 23:return Fo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(_l(t),t.subtreeFlags&6&&(t.flags|=8192)):_l(t),n=t.updateQueue,n!==null&&hl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&De(Xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),wa(Ia),_l(t),null;case 25:return null;case 30:return t.flags|=33554432,_l(t),null}throw Error(i(156,t.tag))}function yl(e,t){switch(sa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wa(Ia),Pe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ie(t),null;case 31:if(t.memoizedState!==null){if(Fo(t),t.alternate===null)throw Error(i(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Fo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ro(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Pe(),null;case 10:return wa(t.type),null;case 22:case 23:return Fo(t),Ao(),e!==null&&De(Xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return wa(Ia),null;case 25:return null;default:return null}}function bl(e,t){switch(sa(t),t.tag){case 3:wa(Ia),Pe();break;case 26:case 27:case 5:Ie(t);break;case 4:Pe();break;case 31:t.memoizedState!==null&&Fo(t);break;case 13:Fo(t);break;case 19:Ro(t);break;case 10:wa(t.type);break;case 22:case 23:Fo(t),Ao(),e!==null&&De(Xa);break;case 24:wa(Ia)}}function xl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Z(t,t.return,e)}}function Sl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Cl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){Z(e,e.return,t)}}}function wl(e,t,n){n.props=xc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Tl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ti(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);h(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Z(e,t,n)}}function El(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Z(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Z(e,t,n)}else n.current=null}}function Dl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function Ol(e){for(var t=e.return;t!==null&&(jl(t)&&em(e.stateNode,t.stateNode),!Al(t));)t=t.return}function kl(e){for(var t=e.return;t!==null&&(jl(t)&&tm(e.stateNode,t.stateNode),!Al(t));)t=t.return}function Al(e){return e.tag===5||e.tag===3||e.tag===27}function jl(e){return e&&e.tag===7&&e.stateNode!==null}function Ml(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Z(e,e.return,t)}}function Nl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Mt]=t}catch(t){Z(e,e.return,t)}}function Pl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Fl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Pl(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.tag===27&&Sp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Il(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dn)),Dl(e,r),A=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Il(e,t,n,r),e=e.sibling;e!==null;)Il(e,t,n,r),e=e.sibling}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Dl(e,r),A=!0;else if(i!==4&&(i===27&&(Dl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[jt]=e,t[Mt]=n}catch(t){Z(e,e.return,t)}}var zl=!1,Bl=null;function Vl(e){(e.tag===30||e.subtreeFlags&33554432)&&(zl=!0)}var Hl=null;function Ul(){var e=Hl;return Hl=null,e}var Wl=0;function Gl(e,t,n,r,i){return Wl=0,Kl(e.child,t,n,r,i)}function Kl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);zl=!0,Tp(o,Wl===0?t:t+`_`+Wl,n),Wl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Kl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function ql(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||ql(e.child,t),e=e.sibling}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Jl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Di(t.default,t.share),t!==`none`&&(Gl(e,n,t,null,!1)||ql(e.child,!1))}e=e.sibling}}function Yl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ti(r,n),a=Di(r.default,n.paired?r.share:r.enter);a===`none`?Jl(e):Gl(e,i,a,null,!1)?(Jl(e),n.paired||t||Nd(e,r.onEnter)):ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e,t),e=e.sibling;else Jl(e)}function Xl(e){if(Bl!==null&&Bl.size!==0){var t=Bl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Di(n.default,n.share);if(a!==`none`&&(Gl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):ql(e.child,!1)),t.delete(r),t.size===0)break}}}Xl(e)}e=e.sibling}}}function Zl(e){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode),r=Bl===null?void 0:Bl.get(n),i=Di(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Gl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Bl.delete(n),Nd(e,t.onShare)):ql(e.child,!1)),Bl!==null&&Xl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Zl(e),e=e.sibling;else Bl!==null&&Xl(e)}function Ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ti(t,e.stateNode);t=Di(t.default,t.update),e.flags&=-5,t!==`none`&&Gl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Ql(e);e=e.sibling}}function $l(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,ql(e.child,!1))}$l(e)}e=e.sibling}}function eu(e){if(e.tag===30)e.stateNode.paired=null,ql(e.child,!1),$l(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else $l(e)}function tu(e){for(e=e.child;e!==null;)e.tag===30?ql(e.child,!1):e.subtreeFlags&33554432&&tu(e),e=e.sibling}function nu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Wl<a.length){var l=a[Wl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Wl===0?n:n+`_`+Wl,i),s&&e.flags&4||(Hl===null&&(Hl=[]),Hl.push(c,Wl===0?r:r+`_`+Wl,t.memoizedProps)),Wl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:nu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ru(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ti(n,r),a=Di(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Wl=0,i=nu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ru(e,t);e=e.sibling}}var iu=!1,G=!1,au=!1,ou=!1,su=typeof WeakSet==`function`?WeakSet:Set,cu=null,lu=!1,uu=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,sp=gh,e=ti(e),ni(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,cu=t,t=n?9270:1024;cu!==null;){if(e=cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Zl(r[a]);if(e.alternate===null&&e.flags&2)n&&Vl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Zl(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Vl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,cu=r):(n&&Ql(e),mu(n))}}Bl=null}function mu(e){for(;cu!==null;){var t=cu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=xc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Z(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Ti(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Di(a.default,a.update),a!==`none`&&Gl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,cu=r;break}cu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&xl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=xc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}}r&64&&Cl(n),r&512&&Tl(n,n.return);break;case 3:if(Fu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{To(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Rl(n);case 26:case 5:Fu(e,n),t===null&&r&4&&Ml(n),r&512&&Tl(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=_f.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||iu,!r){var a=t!==null&&t.memoizedState!==null||G;t=iu,i=G,iu=r,(G=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),iu=t,G=i}break;case 30:Fu(e,n),r&512&&Tl(n,n.return);break;case 7:r&512&&Tl(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Z(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,A=!0}catch(t){Z(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Z(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Bt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(at&&typeof at.onCommitFiberUnmount==`function`)try{at.onCommitFiberUnmount(it,n)}catch{}switch(n.tag){case 26:G||El(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!G&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:G||El(n,t),kl(n);var r=bu,i=xu;Sp(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:G||El(n,t),kl(n);case 6:if(n.tag===6&&kl(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),A=!0}catch(e){Z(n,t,e)}else try{bu.removeChild(n.stateNode),A=!0}catch(e){Z(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:Sl(2,n,t),G||Sl(4,n,t),Su(e,t,n);break;case 1:G||(El(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&wl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:G=(r=G)||n.memoizedState!==null,Su(e,t,n),G=r;break;case 30:El(n,t),Su(e,t,n);break;case 7:G||El(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Z(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Z(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new su),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=vf.bind(null,e,t);t.then(r,r)}})}function Ou(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Ou(t,e,n),ju(e),a&4&&(Sl(3,e,e.return),xl(3,e),Sl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(G||r===null||El(r,r.return)),a&64&&iu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ku,Ou(t,e,n),ju(e),a&512&&(G||r===null||El(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(iu)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Rt]||r[jt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[jt]=e,Gt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[jt]=e,Gt(r),t=r}e.stateNode=t}}else iu||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Nl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||G||t.parentNode.removeChild(t)):a.count--,n===null?iu||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(G||r===null||El(r,r.return)),r!==null&&a&4&&Nl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=au,au=!1,Ou(t,e,n),au=o,ju(e),a&512&&(G||r===null||El(r,r.return)),e.flags&32){t=e.stateNode;try{yn(t,``),A=!0}catch(t){Z(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Nl(e,t,r===null?t:r.memoizedProps)),a&1024&&(ou=!0);break;case 6:if(Ou(t,e,n),ju(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,A=!0}catch(t){Z(e,e.return,t)}}break;case 3:if(A=!1,Wm=null,o=ku,ku=bm(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Z(e,e.return,t)}ou&&(ou=!1,Mu(e)),A=!1;break;case 4:a=au,au=iu,r=tn(),o=ku,ku=bm(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,A&&uu&&(du=!0),A=r,au=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Ye()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=iu,l=G,u=au;iu=c||o,au=u||o,G=l||s,Ou(t,e,n),G=l,au=u,iu=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||iu||G||(t=s||G,n=iu,r=G,iu=o||iu,G=t,Iu(e,2),iu=n,G=r),!o&&au||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(G||r===null||El(r,r.return)),a=tn(),o=uu,s=(n&335544064)===n,c=e.memoizedProps,uu=s&&Di(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&A&&(e.flags|=4),uu=o,A=a;break;case 21:break;case 7:a&512&&(G||r===null||El(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Pl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(jl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Al(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ll(e,Fl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(yn(l,``),n.flags&=-33),Ll(e,Fl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Il(e,Fl(e),u,s);break;default:throw Error(i(161))}}catch(t){Z(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else ru(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Yl(e,!1);else switch(e.tag){case 3:if(fu=lu=!1,Ul(),Nu(t,e),!lu&&!du){if(e=Hl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),fu=!0}Hl=null;break;case 5:Nu(t,e);break;case 4:r=lu,lu=!1,Nu(t,e),lu&&(du=!0),lu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Yl(e,!1));break;case 30:r=lu,i=Ul(),lu=!1,Nu(t,e),lu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ti(a,o),o=Ti(n.memoizedProps,o);var s=Di(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Wl=0,t=nu(e,n,t,o,s,a,!0),Wl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Hl=i):i!==null&&(i.push.apply(i,Hl),Hl=i),lu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Sl(4,n,n.return),Iu(n,r);break;case 1:El(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&wl(n,n.return,i),Iu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:El(n,n.return),n.tag!==5&&n.tag!==27||kl(n),Iu(n,r);break;case 6:kl(n);break;case 26:El(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||G||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:El(n,n.return),Iu(n,r);break;case 7:El(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Lu(i,a,n),xl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)wo(l[i],c)}catch(e){Z(r,r.return,e)}}s&&o&64&&Cl(a),Tl(a,a.return);break;case 27:n&2&&Rl(a);case 5:a.tag!==5&&a.tag!==27||Ol(a),Lu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 6:Ol(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||iu||Km(bm(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&Ml(a),Tl(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),Tl(a,a.return);break;case 30:Lu(i,a,n),Tl(a,a.return);break;case 7:Tl(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ra(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ra(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&tu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&eu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&xl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ra(a)));break;case 12:if(a&2048){Bu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Z(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&eu(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&eu(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ql(a.child,!0),ql(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Hu(a,o,s,c,i),xl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=ku;ku=bm(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Bl===null&&(Bl=new Map),Bl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;cu!==null;){var n=cu;switch(n.tag){case 0:case 11:case 15:Sl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cu=r;else a:for(n=e;cu!==null;){r=cu;var i=r.sibling,a=r.return;if(yu(r),r===n){cu=null;break a}if(i!==null){i.return=a,cu=i;break a}cu=a}}}var Qu={getCacheForType:function(e){var t=Aa(Ia),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Aa(Ia).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,K=0,ed=null,q=null,J=0,Y=0,td=null,nd=!1,rd=!1,id=!1,ad=0,X=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return K&2&&J!==0?J&-J:O.T===null?Ot():Pf()}function Md(){if(ld===0){if(!(J&536870912)||P){var e=ft;ft<<=1,!(ft&3932160)&&(ft=262144),ld=e}else ld=536870912}return e=V.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(Ti(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===ed&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,J,ld,!1)),xt(e,n),K&2&&e===ed||(e===ed&&(!(K&2)&&(sd|=n),X===4&&Rd(e,J,ld,!1)),Ef(e))}function Fd(e,t,n){if(K&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||gt(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){rd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n))a=qd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(id&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Vd(e,0),Rd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!nd);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-Ye(),10<a)){if(Rd(r,t,ld,!nd),ht(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=gp(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,nd,o,`Throttled`,-0,0),a);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,nd,o,null,-0,0)}break}}while(1);Ef(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dn},Bl=null,Ku(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Ye():(a&4194048)===a?hd-Ye():0,m=eh(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Rd(e,t,n,r){t=_t(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-st(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ct(e,n,t)}function zd(){return K&6?!0:(Df(0,!1),!1)}function Bd(){if(q!==null){if(Y===0)var e=q.return;else e=q,Sa=xa=null,rs(e),L=null,R=0,e=q;for(;e!==null;)bl(e.alternate,e),e=e.return;q=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),ed=e,q=n=Hi(e.current,null),J=t,Y=0,td=null,nd=!1,rd=gt(e,t),id=!1,ud=ld=cd=sd=od=X=0,fd=dd=null,pd=!1,ad=_t(e,t),Mi(),n}function Hd(e,t){U=null,O.H=pc,t===eo||t===no?(t=co(),Y=3):t===to?(t=co(),Y=4):Y=t===jc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,td=t,q===null&&(X=1,Tc(e,N(t,e.current)))}function Ud(){var e=V.current;return e===null?!0:(J&4194048)===J?H===null:(J&62914560)===J||J&536870912?e===H:!1}function Wd(){var e=O.H;return O.H=pc,e===null?pc:e}function Gd(){var e=O.A;return O.A=Qu,e}function Kd(){X=4,nd||(J&4194048)!==J&&V.current!==null||(rd=!0),!(od&134217727)&&!(sd&134217727)||ed===null||Rd(ed,J,ld,!1)}function qd(e,t,n){var r=K;K|=2;var i=Wd(),a=Gd();(ed!==e||J!==t)&&(_d=null,Vd(e,t)),t=!1;var o=X;a:do try{if(Y!==0&&q!==null){var s=q,c=td;switch(Y){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:V.current===null&&(t=!0);var l=Y;if(Y=0,td=null,$d(e,s,c,l),n&&rd){o=0;break a}break;default:l=Y,Y=0,td=null,$d(e,s,c,l)}}Jd(),o=X;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,Sa=xa=null,K=r,O.H=i,O.A=a,q===null&&(ed=null,J=0,Mi()),o}function Jd(){for(;q!==null;)Zd(q)}function Yd(e,t){var n=K;K|=2;var r=Wd(),a=Gd();ed!==e||J!==t?(_d=null,gd=Ye()+500,Vd(e,t)):rd=gt(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=td;b:switch(Y){case 1:Y=0,td=null,$d(e,t,o,1);break;case 2:case 9:if(io(o)){Y=0,td=null,Qd(t);break}t=function(){Y!==2&&Y!==9||ed!==e||(Y=7),Ef(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:io(o)?(Y=0,td=null,Qd(t)):(Y=0,td=null,$d(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Ym(s):c.stateNode.complete){Y=0,td=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,ef(u))}break b}}Y=0,td=null,$d(e,t,o,5);break;case 6:Y=0,td=null,$d(e,t,o,6);break;case 8:Bd(),X=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return Sa=xa=null,O.H=r,O.A=a,K=n,q===null?(ed=null,J=0,Mi(),X):0}function Xd(){for(;q!==null&&!qe();)Zd(q)}function Zd(e){var t=dl(e.alternate,e,ad);e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Gc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=Gc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:rs(t);var r=t;r===la&&(P?(ha(r),r.tag===5&&r.stateNode!=null&&(ua=r.stateNode)):(ha(r),P=!0));default:bl(n,t),t=q=Ui(t,ad),t=dl(n,t,ad)}e.memoizedProps=e.pendingProps,t===null?ef(e):q=t}function $d(e,t,n,r){Sa=xa=null,rs(t),L=null,R=0;var i=t.return;try{if(Ac(e,i,t,n,J)){X=1,Tc(e,N(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;X=1,Tc(e,N(n,e.current)),q=null;return}t.flags&32768?(P||r===1?e=!0:rd||J&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=V.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,nd);return}e=t.return;var n=vl(t.alternate,t,ad);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);X===0&&(X=5)}function tf(e,t){do{var n=yl(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);X=6,q=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(q=ed=null,J=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=ji,St(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Va(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,yf($e,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),zl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=O.T,O.T=null,i=k.p,k.p=2,a=K,K|=4;try{pu(e,t,n)}finally{K=a,k.p=i,O.T=r}}yd=1,zl?Ed=Mp(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,Pu(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=O.T,O.T=null;var i=k.p;k.p=2;var a=K;K|=4;try{uu=du=!1,Au(t,e,n),n=cp;var o=ti(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&ei(s.ownerDocument.documentElement,s)){if(c!==null&&ni(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=$r(s,h),v=$r(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{K=a,k.p=i,O.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=K;K|=4;try{hu(e,t.alternate,t)}finally{K=i,k.p=r,O.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,Je();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),Dt(r),n=n.stateNode,at&&typeof at.onCommitFiberRoot==`function`)try{at.onCommitFiberRoot(it,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=O.T,a=k.p,k.p=2,O.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{O.T=n,k.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Ef(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Df(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ra(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=Dt(Sd),r=O.T,a=k.p;try{k.p=32>n?32:n,O.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,K&6)throw Error(i(331));var c=K;if(K|=4,Yu(o.current),Vu(o,o.current,s,n),K=c,Df(0,!1),at&&typeof at.onPostCommitFiberRoot==`function`)try{at.onPostCommitFiberRoot(it,o)}catch{}return!0}finally{k.p=a,O.T=r,uf(e,t)}}function pf(e,t,n){t=N(n,t),t=Dc(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(xt(e,2),Ef(e))}function Z(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=N(n,e),n=Oc(2),r=vo(t,n,2),r!==null&&(kc(n,r,t,e),xt(r,2),Ef(r));break}}t=t.return}}function mf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(id=!0,i.add(n),e=hf.bind(null,e,t,n),t.then(e,e))}function hf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(J&n)===n&&(X===4||X===3&&(J&62914560)===J&&300>Ye()-md?K&2?cd|=n:Vd(e,0):cd|=n,ud===J&&(ud=0)),Ef(e)}function gf(e,t){t===0&&(t=yt()),e=Fi(e,t),e!==null&&(xt(e,t),Ef(e))}function _f(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gf(e,n)}function vf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),gf(e,n)}function yf(e,t){return Ge(e,t)}var bf=null,xf=null,Sf=!1,Cf=!1,wf=!1,Tf=0;function Ef(e){e!==xf&&e.next===null&&(xf===null?bf=xf=e:xf=xf.next=e),Cf=!0,Sf||(Sf=!0,Nf())}function Df(e,t){if(!wf&&Cf){wf=!0;do for(var n=!1,r=bf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-st(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Mf(r,a))}else a=J,a=ht(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||gt(r,a)||(n=!0,Mf(r,a))}r=r.next}while(n);wf=!1}}function Of(){kf()}function kf(){Cf=Sf=!1;var e=0;Tf!==0&&hp()&&(e=Tf);for(var t=Ye(),n=null,r=bf;r!==null;){var i=r.next,a=Af(r,t);a===0?(r.next=null,n===null?bf=i:n.next=i,i===null&&(xf=n)):(n=r,(e!==0||a&3)&&(Cf=!0)),r=i}yd!==0&&yd!==5||Df(e,!1),Tf!==0&&(Tf=0)}function Af(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-st(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=vt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=J,n=ht(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||gt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ke(r),Dt(n)){case 2:case 8:n=Qe;break;case 32:n=$e;break;case 268435456:n=tt;break;default:n=$e}return r=jf.bind(null,e),n=Ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ke(r),e.callbackPriority=2,e.callbackNode=null,2}function jf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=J;return r=ht(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),Af(e,Ye()),e.callbackNode!=null&&e.callbackNode===n?jf.bind(null,e):null)}function Mf(e,t){if(df())return null;Fd(e,t,!0)}function Nf(){bp(function(){K&6?Ge(Ze,Of):kf()})}function Pf(){if(Tf===0){var e=Wa;e===0&&(e=dt,dt<<=1,!(dt&261888)&&(dt=256)),Tf=e}return Tf}function Ff(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:En(e)}function If(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Ff((i[Mt]||null).action),o=r.submitter;o&&(t=(t=o[Mt]||null)?Ff(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Jn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Tf!==0){var e=new FormData(i,o);$s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),$s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Lf=0;Lf<Si.length;Lf++){var Rf=Si[Lf];Ci(Rf.toLowerCase(),`on`+(Rf[0].toUpperCase()+Rf.slice(1)))}Ci(mi,`onAnimationEnd`),Ci(hi,`onAnimationIteration`),Ci(gi,`onAnimationStart`),Ci(`dblclick`,`onDoubleClick`),Ci(`focusin`,`onFocus`),Ci(`focusout`,`onBlur`),Ci(_i,`onTransitionRun`),Ci(vi,`onTransitionStart`),Ci(yi,`onTransitionCancel`),Ci(bi,`onTransitionEnd`),Xt(`onMouseEnter`,[`mouseout`,`mouseover`]),Xt(`onMouseLeave`,[`mouseout`,`mouseover`]),Xt(`onPointerEnter`,[`pointerout`,`pointerover`]),Xt(`onPointerLeave`,[`pointerout`,`pointerover`]),Yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var zf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Bf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(zf));function Vf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Oi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Oi(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[Pt];n===void 0&&(n=t[Pt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Hf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Uf=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Uf]){e[Uf]=!0,qt.forEach(function(t){t!==`selectionchange`&&(Bf.has(t)||Hf(t,!1,e),Hf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uf]||(t[Uf]=!0,Hf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!Ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Kf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Vt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Pn(function(){var r=a,i=kn(n),s=[];a:{var c=xi.get(e);if(c!==void 0){var l=Jn,u=e;switch(e){case`keypress`:if(Un(n)===0)break a;case`keydown`:case`keyup`:l=dr;break;case`focusin`:u=`focus`,l=rr;break;case`focusout`:u=`blur`,l=rr;break;case`beforeblur`:case`afterblur`:l=rr;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=tr;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=nr;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=mr;break;case mi:case hi:case gi:l=j;break;case bi:l=hr;break;case`scroll`:case`scrollend`:l=Xn;break;case`wheel`:l=gr;break;case`copy`:case`cut`:case`paste`:l=ir;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=fr;break;case`submit`:l=pr;break;case`toggle`:case`beforetoggle`:l=_r}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Fn(m,p),g!=null&&d.push(qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==On&&(u=n.relatedTarget||n.fromElement)&&(Vt(u)||u[Nt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Vt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=tr,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=fr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ut(c),h=l==null?u:Ut(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Vt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Ut(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Lr;else if(jr(c)){if(Rr)_=qr;else{_=Gr;var v=Wr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Cn(r.elementType)&&(_=Lr):_=Kr;if(_&&=_(e,r)){Mr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ut(r):window,e){case`focusin`:(jr(v)||v.contentEditable===`true`)&&(ii=v,ai=r,oi=null);break;case`focusout`:oi=ai=ii=null;break;case`mousedown`:si=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:si=!1,ci(s,n,i);break;case`selectionchange`:if(ri)break;case`keydown`:case`keyup`:ci(s,n,i)}var y;if(yr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Dr?Tr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(Sr&&n.locale!==`ko`&&(Dr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Dr&&(y=Hn()):(zn=i,Bn=`value`in zn?zn.value:zn.textContent,Dr=!0)),v=Jf(r,b),0<v.length&&(b=new ar(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Er(n),y!==null&&(b.data=y)))),(y=xr?Or(e,n):kr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new ar(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),If(s,e,r,n,i)}Vf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Fn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Fn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Fn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Fn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
9
9
|
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&yn(e,``+r);else return;break;case`className`:rn(e,`class`,r);break;case`tabIndex`:rn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:rn(e,n,r);break;case`style`:Sn(e,r,o);return;case`data`:if(t!==`object`){rn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=En(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=En(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Dn);return;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=En(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),nn(e,`popover`,r);break;case`xlinkActuate`:an(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:an(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:an(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:an(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:an(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:an(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:nn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=wn.get(n)||n,nn(e,n,r);else return}A=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:Sn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)yn(e,``+r);else return;break;case`onScroll`:r!=null&&Q(`scroll`,e);return;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Dn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Jt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Mt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}A=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):nn(e,n,r)}return}A=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}mn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&gn(e,!!r,n,!0):gn(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}vn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<zf.length;r++)Q(zf[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(Cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(A=!0),o=m;break;case`name`:m!==f&&(A=!0),a=m;break;case`checked`:m!==f&&(A=!0),u=m;break;case`defaultChecked`:m!==f&&(A=!0),d=m;break;case`value`:m!==f&&(A=!0),s=m;break;case`defaultValue`:m!==f&&(A=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}pn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(A=!0),p=o;break;case`defaultValue`:o!==l&&(A=!0),c=o;break;case`multiple`:o!==l&&(A=!0),s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?gn(e,!!n,n?[]:``,!1):gn(e,!!n,t,!0)):gn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(A=!0),p=a;break;case`defaultValue`:a!==o&&(A=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}_n(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(A=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[jt]=r,n[Mt]=t,np(n,e,t),Gt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Rt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Vt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Bt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Rt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&$(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Dn&&(e.onclick=null),Bt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Bt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=k.d;k.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=zd();return e||t}function Cm(e){var t=Ht(e);t!==null&&t.tag===5&&t.type===`form`?tc(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=fn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Gt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+fn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+fn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+fn(n.imageSizes)+`"]`)):i+=`[href="`+fn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[zt]=!0,o.onload=o.onerror=function(){Kt(o)}),Gt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+fn(r)+`"][href="`+fn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Gt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Wt(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Gt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Wt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Gt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Wt(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Gt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=je.current)?bm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=Wt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=Wt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=Wt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Pm(e){return`href="`+fn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[zt]){r.loading=1;return}}else t=e.createElement(`link`),t[zt]=!0,t.onload=t.onerror=Kt.bind(null,t),np(t,`link`,n),Gt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+fn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+fn(n.href)+`"]`);if(r)return t.instance=r,Gt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Gt(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,Gt(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),Gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,Gt(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Gt(a),np(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Rt]||a[jt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Gt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:se,Provider:null,Consumer:null,_currentValue:Ce,_currentValue2:Ce,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Bi(3,null,null,t),e.current=a,a.stateNode=e,t=La(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function uh(e){return e?(e=Ri,e):Ri}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(Pd(n,e,t),yo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Fi(e,67108864);t!==null&&Pd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=jd();t=Et(t);var n=Fi(e,t);n!==null&&Pd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,yh(e,t,n,r)}finally{k.p=a,O.T=i}}function vh(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,yh(e,t,n,r)}finally{k.p=a,O.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Kf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=mt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-st(o);s.entanglements[1]|=c,o&=~c}Ef(a),!(K&6)&&(gd=Ye()+500,Df(0,!1))}}break;case 31:case 13:s=Fi(a,2),s!==null&&Pd(s,a,2),zd(),ph(a,2)}if(a=bh(r),a===null&&Kf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function bh(e){return e=kn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Vt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Xe()){case Ze:return 2;case Qe:return 8;case $e:case et:return 32;case tt:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ht(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Vt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,kt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,kt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);On=r,n.target.dispatchEvent(r),On=null}else return t=Ht(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Ht(n);a!==null&&(e.splice(t,3),t-=3,$s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Mt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Mt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),zd(),t[Nt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ot();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.1`)throw Error(i(527,Kh,`19.3.1`));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{it=Jh.inject(qh),at=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Sc,s=Cc,c=wc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[Nt]=t.current,Wf(e),new Wh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,y=/^[\\/]{2}/;function b(e,t){return t+e.replace(/\\/g,`/`)}var x=`popstate`;function S(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function C(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ee(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:te(t)}return re(t,n,null,e)}function w(e,t){if(e===!1||e==null)throw Error(t)}function T(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function E(){return Math.random().toString(36).substring(2,10)}function D(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ee(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?ne(t):t,state:n,key:t&&t.key||r||E(),mask:i}}function te({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function ne(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function re(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=S(e)?e:ee(h.location,e,t);n&&n(r,e),l=u()+1;let d=D(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=S(e)?e:ee(h.location,e,t);n&&n(r,e),l=u();let i=D(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ie(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(x,d),c=e,()=>{i.removeEventListener(x,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ie(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),w(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:te(t);return i=i.replace(/ $/,`%20`),!n&&y.test(i)&&(i=r+i),new URL(i,r)}function ae(e,t,n=`/`){return oe(e,t,n,!1)}function oe(e,t,n,r,i){let a=Ce((typeof t==`string`?ne(t):t).pathname||`/`,n);if(a==null)return null;let o=i??se(e),s=null,c=k(a);for(let e=0;s==null&&e<o.length;++e)s=be(o[e],c,r);return s}function se(e){let t=ce(e);return ue(t),t}function ce(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;w(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=je([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(w(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ce(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:ve(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=O(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of le(e.path))a(e,t,!0,n)}),t}function le(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=le(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ue(e){e.sort((e,t)=>e.score===t.score?ye(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var de=/^:[\w-]+$/,fe=3,pe=2,me=1,he=10,ge=-2,_e=e=>e===`*`;function ve(e,t){let n=e.split(`/`),r=n.length;return n.some(_e)&&(r+=ge),t&&(r+=pe),n.filter(e=>!_e(e)).reduce((e,t)=>e+(de.test(t)?fe:t===``?me:he),r)}function ye(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function be(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Se(u,l,s.matcher,s.compiledParams):xe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=xe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:je([a,d.pathname]),pathnameBase:Ne(je([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=je([a,d.pathnameBase]))}return o}function xe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=O(e.path,e.caseSensitive,e.end);return Se(e,t,n,r)}function Se(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Me(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Me(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function O(e,t=!1,n=!0){T(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function k(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return T(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ce(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function we(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ne(e):e,a;return n?(n=Ae(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Te(n.substring(1),`/`):Te(n,t)):a=t,{pathname:a,search:Pe(r),hash:Fe(i)}}function Te(e,t){let n=Me(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Ee(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function De(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Oe(e){let t=De(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function ke(e,t,n,r=!1){let i;typeof e==`string`?i=ne(e):(i={...e},w(!i.pathname||!i.pathname.includes(`?`),Ee(`?`,`pathname`,`search`,i)),w(!i.pathname||!i.pathname.includes(`#`),Ee(`#`,`pathname`,`hash`,i)),w(!i.search||!i.search.includes(`#`),Ee(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=we(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ae=e=>e.replace(/[\\/]{2,}/g,`/`),je=e=>Ae(e.join(`/`));function Me(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ne=e=>Me(e).replace(/^\/*/,`/`),Pe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Fe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ie=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Le(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Re(e){return je(e.map(e=>e.route.path).filter(Boolean))||`/`}var ze=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Be(e,t){let n=e;if(typeof n!=`string`||!v.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ze)try{let e=new URL(window.location.href),r=y.test(n)?new URL(b(n,e.protocol)):new URL(n),a=Ce(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{T(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ve=new URL(`http://localhost`);function He(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ve)}catch{return Ve}}function Ue(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function We(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Ge(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Ue(i,n),s=!Ue(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!We(e,i)||!Ue(i,a)))throw Error(`External navigation is not allowed`)}var Ke=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ke);var qe=[`GET`,...Ke];new Set(qe);var Je=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ye(e){try{return Je.includes(new URL(e).protocol)}catch{return!1}}var Xe=_.createContext(null);Xe.displayName=`DataRouter`;var Ze=_.createContext(null);Ze.displayName=`DataRouterState`;var Qe=_.createContext(!1);function $e(){return _.useContext(Qe)}var et=_.createContext({isTransitioning:!1});et.displayName=`ViewTransition`;var tt=_.createContext(new Map);tt.displayName=`Fetchers`;var nt=_.createContext(null);nt.displayName=`Await`;var rt=_.createContext(null);rt.displayName=`Navigation`;var it=_.createContext(null);it.displayName=`Location`;var at=_.createContext({outlet:null,matches:[],isDataRoute:!1});at.displayName=`Route`;var ot=_.createContext(null);ot.displayName=`RouteError`;var st=`REACT_ROUTER_ERROR`,ct=`REDIRECT`,lt=`ROUTE_ERROR_RESPONSE`;function ut(e){if(e.startsWith(`${st}:${ct}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function dt(e){if(e.startsWith(`${st}:${lt}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ie(t.status,t.statusText,t.data)}catch{}}function ft(e,{relative:t}={}){w(pt(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=_.useContext(rt),{hash:i,pathname:a,search:o}=xt(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:je([n,a])),r.createHref({pathname:s,search:o,hash:i})}function pt(){return _.useContext(it)!=null}function mt(){return w(pt(),`useLocation() may be used only in the context of a <Router> component.`),_.useContext(it).location}var ht=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function gt(e){_.useContext(rt).static||_.useLayoutEffect(e)}function _t(){let{isDataRoute:e}=_.useContext(at);return e?Rt():vt()}function vt(){w(pt(),`useNavigate() may be used only in the context of a <Router> component.`);let e=_.useContext(Xe),{basename:t,navigator:n}=_.useContext(rt),{matches:r}=_.useContext(at),{pathname:i}=mt(),a=JSON.stringify(Oe(r)),o=_.useRef(!1);return gt(()=>{o.current=!0}),_.useCallback((r,s={})=>{if(T(o.current,ht),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=ke(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:je([t,c.pathname])),Ge(typeof r==`string`?r:te(r),n.createHref(c),He(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var yt=_.createContext(null);function bt(e){let t=_.useContext(at).outlet;return _.useMemo(()=>t&&_.createElement(yt.Provider,{value:e},t),[t,e])}function xt(e,{relative:t}={}){let{matches:n}=_.useContext(at),{pathname:r}=mt(),i=JSON.stringify(Oe(n));return _.useMemo(()=>ke(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function St(e,t){return Ct(e,t)}function Ct(e,t,n){w(pt(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=_.useContext(rt),{matches:i}=_.useContext(at),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Bt(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
10
|
|
|
11
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=mt(),d;if(t){let e=typeof t==`string`?ne(t):t;w(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ae(e,{pathname:p});T(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),T(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=At(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:je([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:je([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(it.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function wt(){let e=Lt(),t=Le(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var Tt=_.createElement(wt,null),Et=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=dt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(at.Provider,{value:this.props.routeContext},_.createElement(ot.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(Ot,{error:e},t):t}};Et.contextType=Qe;var Dt=new WeakMap;function Ot({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(rt);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ut(t.digest);if(e){let i=Dt.get(t);if(i)throw i;let a=Be(e.location,n),o=a.absoluteURL||a.to;if(Ge(e.location,o,He(r),`allow-explicit`),Ye(o))throw Error(`Invalid redirect location`);if(ze&&!Dt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Dt.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function kt({routeContext:e,match:t,children:n}){let r=_.useContext(Xe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(at.Provider,{value:e},n)}function At(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Re(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Tt,o&&(s<0&&c===0?(Bt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(kt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(Et,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function jt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mt(e){let t=_.useContext(Xe);return w(t,jt(e)),t}function Nt(e){let t=_.useContext(Ze);return w(t,jt(e)),t}function Pt(e){let t=_.useContext(at);return w(t,jt(e)),t}function Ft(e){let t=Pt(e),n=t.matches[t.matches.length-1];return w(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function It(){return Ft(`useRouteId`)}function Lt(){let e=_.useContext(ot),t=Nt(`useRouteError`),n=Ft(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Rt(){let{router:e}=Mt(`useNavigate`),t=Ft(`useNavigate`),n=_.useRef(!1);return gt(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{T(n.current,ht),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var zt={};function Bt(e,t,n){!t&&!zt[e]&&(zt[e]=!0,T(!1,n))}_.memo(Vt);function Vt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Ct(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ht({to:e,replace:t,state:n,relative:r}){w(pt(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=_.useContext(rt);T(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=_.useContext(at),{pathname:s}=mt(),c=_t(),l=ke(e,Oe(o),s,r===`path`);Ge(typeof e==`string`?e:te(e),a.createHref(l),He(a),`reject`);let u=JSON.stringify(l);return _.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Ut(e){return bt(e.context)}function Wt(e){w(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Gt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){w(!pt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ne(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=Ce(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return T(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(rt.Provider,{value:c},_.createElement(it.Provider,{children:t,value:h}))}function Kt({children:e,location:t}){return St(qt(e),t)}_.Component;function qt(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,qt(e.props.children,i));return}w(e.type===Wt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),w(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=qt(e.props.children,i)),n.push(a)}),n}var Jt=`get`,Yt=`application/x-www-form-urlencoded`;function Xt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Zt(e){return Xt(e)&&e.tagName.toLowerCase()===`button`}function Qt(e){return Xt(e)&&e.tagName.toLowerCase()===`form`}function $t(e){return Xt(e)&&e.tagName.toLowerCase()===`input`}function en(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function A(e,t){return e.button===0&&(!t||t===`_self`)&&!en(e)}function tn(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function nn(e,t){let n=tn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var rn=null;function an(){if(rn===null)try{new FormData(document.createElement(`form`),0),rn=!1}catch{rn=!0}return rn}var on=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function sn(e){return e!=null&&!on.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yt}"`),null):e}function cn(e,t){let n,r,i,a,o;if(Qt(e)){let o=e.getAttribute(`action`);r=o?Ce(o,t):null,n=e.getAttribute(`method`)||Jt,i=sn(e.getAttribute(`enctype`))||Yt,a=new FormData(e)}else if(Zt(e)||$t(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ce(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Jt,i=sn(e.getAttribute(`formenctype`))||sn(o.getAttribute(`enctype`))||Yt,a=new FormData(o,e),!an()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Xt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Jt,r=null,i=Yt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ln(e,t){if(e===!1||e==null)throw Error(t)}function un(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ce(i.pathname,t)===`/`?`${Me(t)}/_root.${r}`:`${Me(i.pathname)}.${r}`,i}async function dn(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fn(e){return e!=null&&typeof e.page==`string`}function pn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function mn(e,t,n){return yn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await dn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(pn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function hn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function gn(e,t,{includeHydrateFallback:n}={}){return _n(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function _n(e){return[...new Set(e)]}function vn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function yn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!fn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(vn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function bn(){let e=_.useContext(Xe);return ln(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function xn(){let e=_.useContext(Ze);return ln(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Sn=_.createContext(void 0);Sn.displayName=`FrameworkContext`;function Cn(){let e=_.useContext(Sn);return ln(e,`You must render this element inside a <HydratedRouter> element`),e}function wn(e,t){let n=_.useContext(Sn),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Tn(s,p),onBlur:Tn(c,m),onMouseEnter:Tn(l,p),onMouseLeave:Tn(u,m),onTouchStart:Tn(d,p)}]:[a,f,{}]:[!1,f,{}]}function Tn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function En({page:e,...t}){let n=$e(),{nonce:r}=Cn(),{router:i}=bn(),a=_.useMemo(()=>ae(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(On,{page:e,matches:a,...t}):_.createElement(kn,{page:e,matches:a,...t})):null}function Dn(e){let{manifest:t,routeModules:n}=Cn(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return mn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function On({page:e,matches:t,...n}){let r=mt(),{future:i}=Cn(),{basename:a}=bn(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=un(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function kn({page:e,matches:t,...n}){let r=mt(),{future:i,manifest:a,routeModules:o}=Cn(),{basename:s}=bn(),{loaderData:c,matches:l}=xn(),u=_.useMemo(()=>hn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>hn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=un(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>gn(d,a),[d,a]),m=Dn(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function An(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var jn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{jn&&(window.__reactRouterVersion=`7.18.5`)}catch{}function Mn({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=C({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(Gt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Nn=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:y}=_.useContext(rt),b=typeof l==`string`&&v.test(l),x=Be(l,h);l=x.to;let S=ft(l,{relative:r}),C=mt(),w=null;if(o){let e=ke(o,[],C.mask?C.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:je([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=wn(n,p),ee=Rn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:y});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let ne=!(x.isExternal||i),re=_.createElement(`a`,{...p,...D,href:(ne?w:void 0)||x.absoluteURL||S,onClick:ne?te:e,ref:An(m,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?_.createElement(_.Fragment,null,re,_.createElement(En,{page:S})):re});Nn.displayName=`Link`;var Pn=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=xt(a,{relative:c.relative}),d=mt(),f=_.useContext(Ze),{navigator:p,basename:m}=_.useContext(rt),h=f!=null&&Wn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Ce(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(Nn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Pn.displayName=`NavLink`;var Fn=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Jt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(rt),g=Hn(),y=Un(s,{relative:l}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&v.test(s);return _.createElement(`form`,{ref:m,method:b,action:y,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!x&&e===`render`?`true`:void 0})});Fn.displayName=`Form`;function In(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ln(e){let t=_.useContext(Xe);return w(t,In(e)),t}function Rn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=_t(),d=mt(),f=xt(e,{relative:o});return _.useCallback(p=>{if(A(p,t)){p.preventDefault();let t=n===void 0?te(d)===te(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function zn(e){T(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(tn(e)),n=_.useRef(!1),r=mt(),i=_.useMemo(()=>nn(r.search,n.current?null:t.current),[r.search]),a=_t();return[i,_.useCallback((e,t)=>{let r=tn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Bn=0,Vn=()=>`__${String(++Bn)}__`;function Hn(){let{router:e}=Ln(`useSubmit`),{basename:t}=_.useContext(rt),n=It(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=cn(e,t);if(a.navigate===!1){let e=a.fetcherKey||Vn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Un(e,{relative:t}={}){let{basename:n}=_.useContext(rt),r=_.useContext(at);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...xt(e||`.`,{relative:t})},o=mt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:je([n,a.pathname])),te(a)}function Wn(e,{relative:t}={}){let n=_.useContext(et);w(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ln(`useViewTransitionState`),i=xt(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ce(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ce(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xe(i.pathname,o)!=null||xe(i.pathname,a)!=null}var Gn=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Kn(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Gn(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var qn=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Jn=e=>{let t=qn(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Zn(e){return e!=null}function Qn(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Xn.width,a=e.size??e.height??Xn.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Yn(...c):Yn(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Xn[`stroke-width`])*Number(e.size??e.width??Xn.width)/Number(t.size??t.width??Xn.width):t.strokeWidth??Xn[`stroke-width`];return[`svg`,{...Object.entries(Xn).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Zn(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Zn(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Zn(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function $n(e,t={}){return Qn(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var er=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},tr=(0,_.createContext)({}),nr=()=>(0,_.useContext)(tr),rr=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=nr()??{},b=!!c||er(d),[x,S,C=[]]=$n(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Yn(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function j(e,t=[],n=[]){let r=typeof e==`string`?Kn(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(rr,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Jn(r.name)),i}var ir={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};ir.node;var ar=j(ir),or={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};or.node;var sr=j(or),cr={name:`briefcase-business`,size:24,node:[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]};cr.node;var lr=j(cr),ur={name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]};ur.node;var dr=j(ur),fr={name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]};fr.node;var pr=j(fr),mr={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};mr.node;var hr=j(mr),gr={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};gr.node;var _r=j(gr),vr={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};vr.node;var yr=j(vr),br={name:`circle-play`,size:24,node:[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`play-circle`]};br.node;var xr=j(br),Sr={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Sr.node;var Cr=j(Sr),wr={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};wr.node;var Tr=j(wr),Er={name:`cookie`,size:24,node:[[`path`,{d:`M11 17h.01`,key:`dukryu`}],[`path`,{d:`M11.496 2c.324-.016.558.292.529.615a4 4 0 004.235 4.368.713.713 0 01.758.757 4 4 0 004.366 4.237c.323-.03.63.204.614.527a10 10 0 01-2.915 6.566A1 1 0 114.93 4.918 10 10 0 0111.496 2`,key:`1x76et`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 16h.01`,key:`1f9h7w`}],[`path`,{d:`M16 3h.01`,key:`ll0zb8`}],[`path`,{d:`M21 4h.01`,key:`uw58yv`}],[`path`,{d:`M21 8h.01`,key:`17axm7`}],[`path`,{d:`M7 14h.01`,key:`1qa3f1`}],[`path`,{d:`M9 8h.01`,key:`1jwowd`}]]};Er.node;var Dr=j(Er),Or={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Or.node;var kr=j(Or),Ar={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ar.node;var jr=j(Ar),Mr={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Mr.node;var Nr=j(Mr),Pr={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Pr.node;var Fr=j(Pr),Ir={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Ir.node;var Lr=j(Ir),Rr={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Rr.node;var zr=j(Rr),Br={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Br.node;var Vr=j(Br),Hr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Hr.node;var Ur=j(Hr),Wr={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Wr.node;var Gr=j(Wr),Kr={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Kr.node;var qr=j(Kr),Jr={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Jr.node;var Yr=j(Jr),Xr={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Xr.node;var Zr=j(Xr),Qr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Qr.node;var $r=j(Qr),ei={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};ei.node;var ti=j(ei),ni={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ni.node;var ri=j(ni),ii={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};ii.node;var ai=j(ii),oi={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};oi.node;var si=j(oi),ci={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};ci.node;var li=j(ci),ui={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ui.node;var di=j(ui),fi={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};fi.node;var pi=j(fi),mi={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};mi.node;var hi=j(mi),gi={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};gi.node;var _i=j(gi),vi={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};vi.node;var yi=j(vi),bi={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};bi.node;var xi=j(bi),Si={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};Si.node;var Ci=j(Si),wi={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};wi.node;var Ti=j(wi),Ei={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ei.node;var Di=j(Ei),Oi={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};Oi.node;var ki=j(Oi),Ai={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Ai.node;var ji=j(Ai),Mi={name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};Mi.node;var Ni=j(Mi),Pi={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Pi.node;var Fi=j(Pi),Ii={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Ii.node;var Li=j(Ii),Ri={name:`wifi`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]};Ri.node;var zi=j(Ri),Bi={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Bi.node;var Vi=j(Bi),Hi={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Hi.node;var Ui=j(Hi),Wi=c(g(),1),Gi=`/api`,Ki=class extends Error{constructor(e,t,n){super(e),this.status=t,this.payload=n}};async function qi(e,t,{body:n,raw:r,query:i,headers:a}={}){let o=new URL(`${Gi}${t}`,window.location.origin);if(i)for(let[e,t]of Object.entries(i))t!=null&&t!==``&&o.searchParams.set(e,String(t));let s={method:e,headers:{...a??{}}};n!==void 0&&(r?s.body=n:(s.headers[`Content-Type`]=`application/json`,s.body=JSON.stringify(n)));let c=await fetch(o,s),l=(c.headers.get(`content-type`)??``).includes(`application/json`)?await c.json().catch(()=>null):await c.text().catch(()=>null);if(c.status===401&&l?.error?.code===`unauthorized`&&window.dispatchEvent(new Event(`jobfinder:unauthorized`)),!c.ok)throw new Ki((l?.error?.message??(typeof l==`string`?l:c.statusText))||`HTTP ${c.status}`,c.status,l?.error??l);return l}var M={get:(e,t)=>qi(`GET`,e,t),post:(e,t,n)=>qi(`POST`,e,{...n,body:t}),put:(e,t,n)=>qi(`PUT`,e,{...n,body:t}),del:(e,t)=>qi(`DELETE`,e,t)},Ji=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),N=o(((e,t)=>{t.exports=Ji()}))(),Yi=(0,_.createContext)(null);function Xi({children:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),a=(0,_.useCallback)(async()=>{try{let e=await M.get(`/auth/session`);n(e.authenticated?e.user:null)}catch{n(null)}finally{i(!1)}},[]);(0,_.useEffect)(()=>{a()},[a]),(0,_.useEffect)(()=>{let e=()=>n(null);return window.addEventListener(`jobfinder:unauthorized`,e),()=>window.removeEventListener(`jobfinder:unauthorized`,e)},[]);let o=(0,_.useCallback)(async(e,t)=>{let r=await M.post(`/auth/login`,{email:e,password:t});return n(r.user),r},[]),s=(0,_.useCallback)(async()=>{try{await M.post(`/auth/logout`)}catch{}n(null)},[]);return(0,N.jsx)(Yi.Provider,{value:{user:t,loading:r,login:o,logout:s,check:a},children:e})}function Zi(){let e=(0,_.useContext)(Yi);if(!e)throw Error(`useAuth must be used inside AuthProvider`);return e}function Qi(e){let t=(String(e??``).split(`@`)[0]??``).split(/[._-]+/).filter(Boolean);return t.length?t.slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``):`JF`}var $i=`https://www.linkedin.com/help/linkedin/answer/a526048/acesso-as-apis-do-linkedin?lang=pt`;function ea(e){return String(e??``).split(`.`).map(e=>String(Number(e))).join(`.`)}function ta({children:e}){return(0,N.jsx)(`li`,{className:`sidebar-section`,children:e})}function na({to:e,icon:t,children:n,end:r}){return(0,N.jsx)(`li`,{children:(0,N.jsxs)(Pn,{to:e,end:r,className:({isActive:e})=>`sidebar-link ${e?`active`:``}`,children:[t&&(0,N.jsx)(t,{className:`mr-3 h-4 w-4 shrink-0`}),(0,N.jsx)(`span`,{children:n})]})})}function ra({icon:e,label:t,children:n}){let r=mt(),i=n.some(e=>e.props.to===r.pathname),[a,o]=(0,_.useState)(i);return(0,N.jsxs)(`li`,{children:[(0,N.jsxs)(`button`,{onClick:()=>o(e=>!e),className:`sidebar-link w-full text-left`,"aria-expanded":a,children:[e&&(0,N.jsx)(e,{className:`mr-3 h-4 w-4 shrink-0`}),(0,N.jsx)(`span`,{children:t}),(0,N.jsx)(_r,{className:`ml-auto h-3 w-3 transition-transform ${a?`rotate-180`:``}`})]}),a&&(0,N.jsx)(`ul`,{className:`mt-1 space-y-1 pb-1`,children:n})]})}function ia({to:e,children:t}){return(0,N.jsx)(`li`,{children:(0,N.jsx)(Pn,{to:e,className:({isActive:e})=>`sidebar-link ${e?`active`:``} !pl-12`,children:(0,N.jsx)(`span`,{children:t})})})}function aa({officialApiConfigured:e}){let t=_t(),{user:n,logout:r}=Zi();return(0,N.jsxs)(`aside`,{className:`flex h-full w-64 shrink-0 flex-col bg-[#1e1b4b] text-white`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-white/10 p-6`,children:[(0,N.jsxs)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:[`Job`,(0,N.jsx)(`span`,{className:`text-[#818cf8]`,children:`Finder`})]}),(0,N.jsxs)(`span`,{className:`rounded border border-indigo-400/30 bg-indigo-500/10 px-2 py-0.5 text-[10px] font-medium text-indigo-300`,title:`Versao 0.1.04 (npm: ${ea(`0.1.04`)})`,children:[`v`,`0.1.04`]})]}),(0,N.jsx)(`nav`,{className:`flex-1 overflow-y-auto py-4`,children:(0,N.jsxs)(`ul`,{className:`space-y-1`,children:[(0,N.jsx)(na,{to:`/`,icon:Vr,end:!0,children:`Painel`}),(0,N.jsx)(ta,{children:`Conexões`}),(0,N.jsxs)(ra,{icon:Fi,label:`Conexões`,children:[(0,N.jsx)(ia,{to:`/conexoes`,children:`Networking`}),(0,N.jsx)(ia,{to:`/conexoes/dm`,children:`Cascatas de DM`})]}),(0,N.jsx)(ta,{children:`Vagas`}),(0,N.jsxs)(ra,{icon:dr,label:`Vagas`,children:[(0,N.jsx)(ia,{to:`/vagas`,children:`Buscar vagas`}),(0,N.jsx)(ia,{to:`/vagas/candidaturas`,children:`Candidaturas`})]}),(0,N.jsx)(ta,{children:`Postagens`}),(0,N.jsx)(na,{to:`/postagens`,icon:ti,children:`Postagens`}),(0,N.jsx)(na,{to:`/postagens/agendar`,icon:pr,children:`Agendar`}),(0,N.jsx)(ta,{children:`Integrações`}),(0,N.jsx)(na,{to:`/integracoes`,icon:ai,children:`LinkedIn`}),(0,N.jsxs)(`li`,{children:[(0,N.jsxs)(`a`,{href:$i,target:`_blank`,rel:`noreferrer noopener`,className:`sidebar-link`,title:`A API oficial é o método recomendado. Se indisponível, o app usa cookies de sessão como fallback.`,children:[(0,N.jsx)(zr,{className:`mr-3 h-4 w-4 shrink-0 text-[#818cf8]`}),(0,N.jsx)(`span`,{className:`flex-1`,children:`Criar API Oficial do LinkedIn`}),(0,N.jsx)(kr,{className:`h-3 w-3 text-gray-400`})]}),!e&&(0,N.jsx)(`span`,{className:`ml-6 mt-1 inline-block rounded-full bg-amber-400/20 px-2 py-0.5 text-[10px] font-medium text-amber-300`,children:`⚠ Recomendado`})]}),(0,N.jsx)(na,{to:`/configuracoes`,icon:yi,children:`Configurações`}),(0,N.jsx)(ta,{children:`Suporte`}),(0,N.jsx)(na,{to:`/integracoes?tab=suporte`,icon:Cr,children:`Suporte`})]})}),(0,N.jsxs)(`div`,{className:`mt-auto border-t border-white/10 p-4`,children:[(0,N.jsxs)(`div`,{className:`mb-3 flex items-center gap-3 rounded-lg bg-white/5 px-3 py-2.5`,children:[(0,N.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-indigo-500/20 text-xs font-bold text-indigo-200`,children:Qi(n?.email)}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`truncate text-xs font-semibold text-white`,children:n?.name??`Conta local`}),(0,N.jsx)(`p`,{className:`truncate text-[10px] text-gray-400`,children:n?.email??`—`})]})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,N.jsx)(`a`,{href:`https://github.com/DanHachuel/JobFinder`,target:`_blank`,rel:`noreferrer noopener`,className:`flex items-center justify-center gap-2 rounded-lg bg-white/5 px-4 py-2.5 text-xs text-gray-300 transition hover:bg-white/10`,children:`100% local`}),(0,N.jsxs)(`button`,{type:`button`,onClick:async()=>{await r(),t(`/login`,{replace:!0})},className:`flex items-center justify-center gap-2 rounded-lg bg-white/5 px-4 py-2.5 text-xs text-gray-300 transition hover:bg-red-500/20 hover:text-red-200`,title:`Encerrar a sessão local`,children:[(0,N.jsx)(qr,{className:`h-3.5 w-3.5`}),`Sair`]})]})]})]})}var oa=`https://github.com/DanHachuel/JobFinder#tutorial`;function sa({title:e,dryRun:t,connected:n,mode:r}){let{user:i}=Zi();return(0,N.jsxs)(`header`,{className:`flex items-center justify-between border-b border-gray-200 bg-white px-8 py-4 shadow-sm`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(`h2`,{className:`text-lg font-semibold text-gray-800`,children:e}),t&&(0,N.jsxs)(`span`,{className:`badge bg-amber-100 text-amber-800`,title:`Modo dry-run: nenhuma ação real é enviada ao LinkedIn`,children:[(0,N.jsx)(Lr,{className:`mr-1 h-3 w-3`}),`dry-run`]}),!t&&(0,N.jsxs)(`span`,{className:`badge bg-red-100 text-red-800`,title:`Modo real: postagens, convites, DMs e candidaturas serão executados de verdade no LinkedIn`,children:[(0,N.jsx)(Ui,{className:`mr-1 h-3 w-3`}),`Real Mode`]}),n&&!t&&(0,N.jsxs)(`span`,{className:`badge bg-green-100 text-green-800`,title:`Canal do LinkedIn conectado (${r??`cookie`}) — ações reais serão enviadas`,children:[(0,N.jsx)(xi,{className:`mr-1 h-3 w-3`}),`conectado`]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,N.jsxs)(`a`,{href:oa,target:`_blank`,rel:`noreferrer noopener`,className:`text-sm font-medium text-indigo-600 hover:text-indigo-800`,children:[(0,N.jsx)(xr,{className:`mr-1 inline h-4 w-4`}),`Ver tutorial`]}),(0,N.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-indigo-100 text-sm font-bold text-indigo-600`,title:`${i?.email??`conta local`} — sessão local (jobfinder_session)`,children:Qi(i?.email)})]})]})}var ca=(0,_.createContext)(null),la=[[`/`,`Painel`],[`/postagens/agendar`,`Agendar postagem`],[`/postagens`,`Postagens`],[`/conexoes/dm`,`Cascatas de DM`],[`/conexoes`,`Networking — conexões`],[`/vagas/candidaturas`,`Candidaturas`],[`/vagas`,`Buscar vagas`],[`/integracoes`,`Integrações — LinkedIn`],[`/configuracoes`,`Configurações`],[`/config`,`Configurações`]];function ua(){return(0,_.useContext)(ca)}function P({children:e}){let t=mt(),{user:n}=Zi(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),s=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/health`),M.get(`/linkedin/status`)]);i(e),o(t)}catch{i(null),o(null)}},[]);(0,_.useEffect)(()=>{s()},[s,t.pathname]);let c=la.find(([e])=>t.pathname.startsWith(e))?.[1]??`Painel`,l=a?.dryRun??r?.dryRun??!0;return(0,N.jsx)(ca.Provider,{value:{health:r,linkedin:a,user:n,refresh:s},children:(0,N.jsxs)(`div`,{className:`flex h-screen w-full overflow-hidden overflow-x-hidden bg-gray-100`,children:[(0,N.jsx)(aa,{officialApiConfigured:!!a?.channel?.official?.hasAccessToken}),(0,N.jsxs)(`main`,{className:`flex h-full min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,N.jsx)(sa,{title:c,dryRun:l,connected:!!a?.connected,mode:a?.mode}),(0,N.jsxs)(`div`,{className:`flex-1 overflow-y-auto overflow-x-hidden p-8`,children:[e,(0,N.jsxs)(`footer`,{className:`mt-8 flex items-center justify-between border-t border-gray-200 pt-4 text-xs text-gray-400`,children:[(0,N.jsx)(`span`,{children:`© 2026 JobFinder (DanHachuel) · execução 100% local`}),(0,N.jsx)(`span`,{children:`Armazenamento em JSON · nenhum dado sai desta máquina`})]})]},t.pathname)]})]})})}function F({label:e,value:t,hint:n,icon:r,tone:i=`text-gray-800`,extra:a}){return(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:e}),r&&(0,N.jsx)(r,{className:`h-5 w-5 text-gray-300`})]}),(0,N.jsx)(`p`,{className:`mt-2 text-2xl font-bold ${i}`,children:t}),n&&(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-400`,children:n}),a]})}function da({percent:e,tone:t=`bg-indigo-500`,label:n,showPercent:r=!0}){let i=Math.min(100,Math.max(0,Math.round(e??0)));return(0,N.jsxs)(`div`,{children:[(n||r)&&(0,N.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsx)(`span`,{children:n}),r&&(0,N.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[i,`%`]})]}),(0,N.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-gray-200`,children:(0,N.jsx)(`div`,{className:`h-full rounded-full ${t} transition-all duration-500`,style:{width:`${i}%`}})})]})}function fa({used:e,limit:t,label:n,tone:r=`bg-indigo-500`,warning:i=80}){let a=t??0,o=a?Math.round(e/a*100):0;return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsx)(`span`,{children:n}),(0,N.jsxs)(`span`,{className:`font-semibold text-gray-700`,children:[e,` de `,a]})]}),(0,N.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-gray-200`,children:(0,N.jsx)(`div`,{className:`h-full rounded-full ${o>=i?`bg-red-500`:r} transition-all duration-500`,style:{width:`${Math.min(100,o)}%`}})})]})}function pa({label:e=`Carregando…`}){return(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-12 text-sm text-gray-500`,children:[(0,N.jsx)(Ur,{className:`h-5 w-5 animate-spin text-indigo-500`}),e]})}function ma({icon:e,title:t,hint:n,action:r}){return(0,N.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-white/50 px-6 py-12 text-center`,children:[e&&(0,N.jsx)(e,{className:`mb-3 h-8 w-8 text-gray-300`}),(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:t}),n&&(0,N.jsx)(`p`,{className:`mt-1 max-w-md text-xs text-gray-500`,children:n}),r&&(0,N.jsx)(`div`,{className:`mt-4`,children:r})]})}function ha({open:e,title:t,onClose:n,children:r,footer:i}){return e?(0,N.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/40 p-4`,role:`dialog`,"aria-modal":`true`,children:(0,N.jsxs)(`div`,{className:`w-full max-w-lg rounded-2xl bg-white shadow-xl`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between border-b border-gray-100 px-5 py-4`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:t}),(0,N.jsx)(`button`,{onClick:n,className:`rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600`,"aria-label":`Fechar`,children:(0,N.jsx)(Vi,{className:`h-5 w-5`})})]}),(0,N.jsx)(`div`,{className:`px-5 py-4 text-sm text-gray-700`,children:r}),i&&(0,N.jsx)(`div`,{className:`flex justify-end gap-2 border-t border-gray-100 px-5 py-4`,children:i})]})}):null}function ga(e){return e+.5|0}var _a=(e,t,n)=>Math.max(Math.min(e,n),t);function va(e){return _a(ga(e*2.55),0,255)}function ya(e){return _a(ga(e*255),0,255)}function ba(e){return _a(ga(e/2.55)/100,0,1)}function xa(e){return _a(ga(e*100),0,100)}var Sa={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ca=[...`0123456789ABCDEF`],wa=e=>Ca[e&15],Ta=e=>Ca[(e&240)>>4]+Ca[e&15],Ea=e=>(e&240)>>4==(e&15),Da=e=>Ea(e.r)&&Ea(e.g)&&Ea(e.b)&&Ea(e.a);function Oa(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&Sa[e[1]]*17,g:255&Sa[e[2]]*17,b:255&Sa[e[3]]*17,a:t===5?Sa[e[4]]*17:255}:(t===7||t===9)&&(n={r:Sa[e[1]]<<4|Sa[e[2]],g:Sa[e[3]]<<4|Sa[e[4]],b:Sa[e[5]]<<4|Sa[e[6]],a:t===9?Sa[e[7]]<<4|Sa[e[8]]:255})),n}var ka=(e,t)=>e<255?t(e):``;function Aa(e){var t=Da(e)?wa:Ta;return e?`#`+t(e.r)+t(e.g)+t(e.b)+ka(e.a,t):void 0}var ja=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ma(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function Na(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Pa(e,t,n){let r=Ma(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Fa(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Ia(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=Fa(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function La(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(ya)}function Ra(e,t,n){return La(Ma,e,t,n)}function za(e,t,n){return La(Pa,e,t,n)}function Ba(e,t,n){return La(Na,e,t,n)}function Va(e){return(e%360+360)%360}function Ha(e){let t=ja.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?va(+t[5]):ya(+t[5]));let i=Va(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?za(i,a,o):t[1]===`hsv`?Ba(i,a,o):Ra(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function Ua(e,t){var n=Ia(e);n[0]=Va(n[0]+t),n=Ra(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Wa(e){if(!e)return;let t=Ia(e),n=t[0],r=xa(t[1]),i=xa(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${ba(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var Ga={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},Ka={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function qa(){let e={},t=Object.keys(Ka),n=Object.keys(Ga),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,Ga[a]);a=parseInt(Ka[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var Ja;function Ya(e){Ja||(Ja=qa(),Ja.transparent=[0,0,0,0]);let t=Ja[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Xa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Za(e){let t=Xa.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?va(e):_a(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?va(r):_a(r,0,255)),i=255&(t[4]?va(i):_a(i,0,255)),a=255&(t[6]?va(a):_a(a,0,255)),{r,g:i,b:a,a:n}}}function Qa(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ba(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var $a=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,eo=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function to(e,t,n){let r=eo(ba(e.r)),i=eo(ba(e.g)),a=eo(ba(e.b));return{r:ya($a(r+n*(eo(ba(t.r))-r))),g:ya($a(i+n*(eo(ba(t.g))-i))),b:ya($a(a+n*(eo(ba(t.b))-a))),a:e.a+n*(t.a-e.a)}}function no(e,t,n){if(e){let r=Ia(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Ra(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ro(e,t){return e&&Object.assign(t||{},e)}function io(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=ya(e[3]))):(t=ro(e,{r:0,g:0,b:0,a:1}),t.a=ya(t.a)),t}function ao(e){return e.charAt(0)===`r`?Za(e):Ha(e)}var oo=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=io(t):n===`string`&&(r=Oa(t)||Ya(t)||ao(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=ro(this._rgb);return e&&(e.a=ba(e.a)),e}set rgb(e){this._rgb=io(e)}rgbString(){return this._valid?Qa(this._rgb):void 0}hexString(){return this._valid?Aa(this._rgb):void 0}hslString(){return this._valid?Wa(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=to(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=ya(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=ga(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return no(this._rgb,2,e),this}darken(e){return no(this._rgb,2,-e),this}saturate(e){return no(this._rgb,1,e),this}desaturate(e){return no(this._rgb,1,-e),this}rotate(e){return Ua(this._rgb,e),this}};function so(){}var co=(()=>{let e=0;return()=>e++})();function I(e){return e==null}function L(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function R(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function lo(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function uo(e,t){return lo(e)?e:t}function z(e,t){return e===void 0?t:e}var fo=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,po=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function mo(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function B(e,t,n,r){let i,a,o;if(L(e)){if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i)}else if(R(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function ho(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function go(e){if(L(e))return e.map(go);if(R(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=go(e[n[i]]);return t}return e}function _o(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function vo(e,t,n,r){if(!_o(e))return;let i=t[e],a=n[e];R(i)&&R(a)?yo(i,a,r):t[e]=go(a)}function yo(e,t,n){let r=L(t)?t:[t],i=r.length;if(!R(e))return e;n||={};let a=n.merger||vo,o;for(let t=0;t<i;++t){if(o=r[t],!R(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function bo(e,t){return yo(e,t,{merger:xo})}function xo(e,t,n){if(!_o(e))return;let r=t[e],i=n[e];R(r)&&R(i)?bo(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=go(i))}var So={"":e=>e,x:e=>e.x,y:e=>e.y};function Co(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function wo(e){let t=Co(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function To(e,t){return(So[t]||(So[t]=wo(t)))(e)}function Eo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Do=e=>e!==void 0,Oo=e=>typeof e==`function`,ko=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Ao(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var V=Math.PI,H=2*V;H+V;var jo=1/0,Mo=V/180,No=V/2,Po=V/4,Fo=V*2/3,Io=Math.log10,Lo=Math.sign;function Ro(e,t,n){return Math.abs(e-t)<n}function zo(e){let t=Math.round(e);e=Ro(e,t,e/1e3)?t:e;let n=10**Math.floor(Io(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Bo(e){let t=[],n=Math.sqrt(e),r=1;for(;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function U(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function W(e){return!U(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Vo(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Ho(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Uo(e){return V/180*e}function Wo(e){return 180/V*e}function Go(e){if(!lo(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Ko(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*V&&(a+=H),{angle:a,distance:i}}function qo(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Jo(e){return(e%H+H)%H}function Yo(e,t,n,r){let i=Jo(e),a=Jo(t),o=Jo(n),s=Jo(a-i),c=Jo(o-i),l=Jo(i-a),u=Jo(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function Xo(e,t,n){return Math.max(t,Math.min(n,e))}function Zo(e){return Xo(e,-32768,32767)}function Qo(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function $o(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var es=(e,t,n,r)=>$o(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),ts=(e,t,n)=>$o(e,n,r=>e[r][t]>=n);function ns(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var rs=[`push`,`pop`,`shift`,`splice`,`unshift`];function is(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),rs.forEach(t=>{let n=`_onData`+Eo(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})}))}function as(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),r.length>0||(rs.forEach(t=>{delete e[t]}),delete e._chartjs)}function os(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var ss=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function cs(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,ss.call(window,()=>{r=!1,e.apply(t,n)}))}}function ls(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var us=e=>e===`start`?`left`:e===`end`?`right`:`center`,ds=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,fs=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t,ps=e=>e===0||e===1,ms=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*H/n)),hs=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*H/n)+1,gs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*No)+1,easeOutSine:e=>Math.sin(e*No),easeInOutSine:e=>-.5*(Math.cos(V*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>ps(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ps(e)?e:ms(e,.075,.3),easeOutElastic:e=>ps(e)?e:hs(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return ps(e)?e:e<.5?.5*ms(e*2,t,n):.5+.5*hs(e*2-1,t,n)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-gs.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?gs.easeInBounce(e*2)*.5:gs.easeOutBounce(e*2-1)*.5+.5};function _s(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function vs(e){return _s(e)?e:new oo(e)}function ys(e){return _s(e)?e:new oo(e).saturate(.5).darken(.1).hexString()}var bs=[`x`,`y`,`borderWidth`,`radius`,`tension`],xs=[`color`,`borderColor`,`backgroundColor`];function Ss(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:xs},numbers:{type:`number`,properties:bs}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Cs(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var ws=new Map;function Ts(e,t){t||={};let n=e+JSON.stringify(t),r=ws.get(n);return r||(r=new Intl.NumberFormat(e,t),ws.set(n,r)),r}function Es(e,t,n){return Ts(t,n).format(e)}var Ds={values(e){return L(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Os(e,n)}let o=Io(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Es(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Io(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Ds.numeric.call(this,e,t,n):``}};function Os(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ks={formatters:Ds};function As(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ks.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var js=Object.create(null),Ms=Object.create(null);function Ns(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Ps(e,t,n){return typeof t==`string`?yo(Ns(e,t),n):yo(Ns(e,``),t)}var Fs=new class{constructor(e,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>ys(t.backgroundColor),this.hoverBorderColor=(e,t)=>ys(t.borderColor),this.hoverColor=(e,t)=>ys(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Ps(this,e,t)}get(e){return Ns(this,e)}describe(e,t){return Ps(Ms,e,t)}override(e,t){return Ps(js,e,t)}route(e,t,n,r){let i=Ns(this,e),a=Ns(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return R(e)?Object.assign({},t,e):z(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Ss,Cs,As]);function Is(e){return!e||I(e.size)||I(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Ls(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Rs(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!L(d))o=Ls(e,i,a,o,d);else if(L(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!L(f)&&(o=Ls(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function zs(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Bs(e,t){(t||e)&&(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Vs(e,t,n,r){Hs(e,t,n,r,null)}function Hs(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Mo;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`))e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();else if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,H):e.arc(n,r,h,0,H),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Fo,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Fo,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+Po)*c,d=Math.cos(g+Po)*(i?i/2-l:c),s=Math.sin(g+Po)*c,f=Math.sin(g+Po)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-V,g-No),e.arc(n+f,r-o,l,g-No,g),e.arc(n+d,r+s,l,g,g+No),e.arc(n-f,r+o,l,g+No,g+V),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=Po;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=Po;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=Po,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function Us(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ws(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Gs(e){e.restore()}function Ks(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),I(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function qs(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function Js(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ys(e,t,n,r,i,a={}){let o=L(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,Ks(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&Js(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),I(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),qs(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function Xs(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*V,V,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,V,No,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,No,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-No,!0),e.lineTo(n+o.topLeft,r)}var Zs=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Qs=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function $s(e,t){let n=(``+e).match(Zs);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100}return t*e}var ec=e=>+e||0;function tc(e,t){let n={},r=R(t),i=r?Object.keys(t):t,a=R(e)?r?n=>z(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=ec(a(e));return n}function nc(e){return tc(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function rc(e){return tc(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function ic(e){let t=nc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ac(e,t){e||={},t||=Fs.font;let n=z(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=z(e.style,t.style);r&&!(``+r).match(Qs)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:z(e.family,t.family),lineHeight:$s(z(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:z(e.weight,t.weight),string:``};return i.string=Is(i),i}function oc(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&L(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function sc(e,t,n){let{min:r,max:i}=e,a=po(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function cc(e,t){return Object.assign(Object.create(e),t)}function lc(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Tc(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>lc([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return mc(n,r,()=>wc(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Ec(e).includes(t)},ownKeys(e){return Ec(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function uc(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:dc(e,r),setContext:t=>uc(e,t,n,r),override:i=>uc(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return mc(e,t,()=>hc(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function dc(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Oo(n)?n:()=>n,isIndexable:Oo(r)?r:()=>r}}var fc=(e,t)=>e?e+Eo(t):t,pc=(e,t)=>R(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function mc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function hc(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Oo(s)&&o.isScriptable(t)&&(s=gc(t,s,e,n)),L(s)&&s.length&&(s=_c(t,s,e,o.isIndexable)),pc(t,s)&&(s=uc(s,i,a&&a[t],o)),s}function gc(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),pc(e,c)&&(c=xc(i._scopes,i,e,c)),c}function _c(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(R(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=xc(r,i,e,c);t.push(uc(n,a,o&&o[e],s))}}return t}function vc(e,t,n){return Oo(e)?e(t,n):e}var yc=(e,t)=>e===!0?t:typeof e==`string`?To(t,e):void 0;function bc(e,t,n,r,i){for(let a of t){let t=yc(n,a);if(t){e.add(t);let a=vc(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function xc(e,t,n,r){let i=t._rootScopes,a=vc(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Sc(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Sc(s,o,a,c,r),c===null)?!1:lc(Array.from(s),[``],i,a,()=>Cc(t,n,r))}function Sc(e,t,n,r,i){for(;n;)n=bc(e,t,n,r,i);return n}function Cc(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return L(i)&&R(n)?n:i||{}}function wc(e,t,n,r){let i;for(let a of t)if(i=Tc(fc(a,e),n),i!==void 0)return pc(e,i)?xc(n,r,e,i):i}function Tc(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Ec(e){let t=e._keys;return t||=e._keys=Dc(e._scopes),t}function Dc(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}function Oc(){return typeof window<`u`&&typeof document<`u`}function kc(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Ac(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var jc=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Mc(e,t){return jc(e).getPropertyValue(t)}var Nc=[`top`,`right`,`bottom`,`left`];function Pc(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=Nc[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var Fc=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Ic(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(Fc(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function Lc(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=jc(n),a=i.boxSizing===`border-box`,o=Pc(i,`padding`),s=Pc(i,`border`,`width`),{x:c,y:l,box:u}=Ic(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function Rc(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&kc(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=jc(a),s=Pc(o,`border`,`width`),c=Pc(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Ac(o.maxWidth,a,`clientWidth`),i=Ac(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||jo,maxHeight:i||jo}}var zc=e=>Math.round(e*10)/10;function Bc(e,t,n,r){let i=jc(e),a=Pc(i,`margin`),o=Ac(i.maxWidth,e,`clientWidth`)||jo,s=Ac(i.maxHeight,e,`clientHeight`)||jo,c=Rc(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Pc(i,`border`,`width`),t=Pc(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=zc(Math.min(l,o,c.maxWidth)),u=zc(Math.min(u,s,c.maxHeight)),l&&!u&&(u=zc(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=zc(Math.floor(u*r))),{width:l,height:u}}function Vc(e,t,n){let r=t||1,i=zc(e.height*r),a=zc(e.width*r);e.height=zc(e.height),e.width=zc(e.width);let o=e.canvas;o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`);let s=Math.floor(i),c=Math.floor(a);return e.currentDevicePixelRatio!==r||o.height!==s||o.width!==c?(e.currentDevicePixelRatio=r,o.height=s,o.width=c,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var Hc=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Oc()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function Uc(e,t){let n=Mc(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}var Wc=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},Gc=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Kc(e,t,n){return e?Wc(t,n):Gc()}function qc(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function Jc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function Yc(e,t,n){return e.options.clip?e[n]:t[n]}function Xc(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:Yc(n,t,`left`),right:Yc(n,t,`right`),top:Yc(r,t,`top`),bottom:Yc(r,t,`bottom`)}:t}function Zc(e,t){let n=t._clip;if(n.disabled)return!1;let r=Xc(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var Qc=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,ss.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},$c=`transparent`,el={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=vs(e||$c),i=r.valid&&vs(t||$c);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},tl=class{constructor(e,t,n,r){let i=t[n];r=oc([e.to,r,i,e.from]);let a=oc([e.from,i,r]);this._active=!0,this._fn=e.fn||el[e.type||typeof a],this._easing=gs[e.easing]||gs.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=oc([e.to,t,r,e.from]),this._from=oc([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;this._active=i!==o&&(a||t<n),this._active?t<0?this._target[r]=i:(s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)):(this._target[r]=o,this._notify(!0))}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},nl=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!R(e))return;let t=Object.keys(Fs.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!R(i))return;let a={};for(let e of t)a[e]=i[e];(L(i.properties)&&i.properties||[r]).forEach(e=>{e!==r&&n.has(e)||n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=il(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&rl(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u){if(d&&u.active()){u.update(d,l,o);continue}u.cancel()}!d||!d.duration?e[c]=l:(i[c]=u=new tl(d,e,c,l),r.push(u))}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Qc.add(this._chart,n),!0}};function rl(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function il(e,t){if(!t)return;let n=e.options;if(!n)e.options=t;else return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function al(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function ol(e,t,n){if(n===!1)return!1;let r=al(e,n),i=al(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function sl(e){let t,n,r,i;return R(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function cl(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function ll(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],lo(l)&&(a||t===0||Lo(t)===Lo(l))&&(t+=l)}return!u&&!r.all?0:t}function ul(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function dl(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function fl(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function pl(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function ml(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function hl(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function gl(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=fl(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=ml(i,u,a),f[s]=d,f._top=hl(f,o,!0,r.type),f._bottom=hl(f,o,!1,r.type);let m=f._visualValues||(f._visualValues={});m[s]=d}}function _l(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function vl(e,t){return cc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function yl(e,t,n){return cc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function bl(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;t&&t[r]!==void 0&&t[r][n]!==void 0&&(delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n])}}}var xl=e=>e===`reset`||e===`none`,Sl=(e,t)=>t?e:Object.assign({},e),Cl=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:cl(n,!0),values:null},wl=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=dl(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&bl(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=z(n.xAxisID,_l(e,`x`)),a=t.yAxisID=z(n.yAxisID,_l(e,`y`)),o=t.rAxisID=z(n.rAxisID,_l(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&as(this._data,this),e._stacked&&bl(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(R(t)){let e=this._cachedMeta;this._data=ul(t,e)}else if(n!==t){if(n){as(n,this);let e=this._cachedMeta;bl(e),e._parsed=[]}t&&Object.isExtensible(t)&&is(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=dl(t.vScale,t),t.stack!==n.stack&&(r=!0,bl(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(gl(this,t._parsed),t._stacked=dl(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length||n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=L(r[e])?this.parseArrayData(n,r,e,t):R(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&gl(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(To(f,o),d),y:a.parse(To(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return ll({keys:cl(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=ll(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=Cl(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=pl(o),d,f;function p(){f=r[d];let t=f[o.axis];return!lo(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],lo(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=sl(z(this.options.clip,ol(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=yl(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=vl(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&Do(n);if(o)return Sl(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(Fs.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(Sl(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new nl(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||xl(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){xl(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!xl(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&bl(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};function Tl(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=os(r.sort((e,t)=>e-t))}return e._cache.$bar}function El(e){let t=e.iScale,n=Tl(t,e.type),r=t._length,i,a,o,s,c=()=>{o!==32767&&o!==-32768&&(Do(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),c();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),c();return r}function Dl(e,t,n,r){let i=n.barThickness,a,o;return I(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function Ol(e,t,n,r){let i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,c=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);let l=a-(a-Math.min(o,s))/2*c;return{chunk:Math.abs(s-o)/2*c/r,ratio:n.barPercentage,start:l}}function kl(e,t,n,r){let i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a),c=o,l=s;Math.abs(o)>Math.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function Al(e,t,n,r){return L(e)?kl(e,t,n,r):t[n.axis]=n.parse(e,r),t}function jl(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[i.axis]=s||i.parse(o[l],l),c.push(Al(f,d,a,l));return c}function Ml(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Nl(e,t,n){return e===0?(t.isHorizontal()?1:-1)*(t.min>=n?1:-1):Lo(e)}function Pl(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.base<e.y,n=`bottom`,r=`top`),t?(i=`end`,a=`start`):(i=`start`,a=`end`),{start:n,end:r,reverse:t,top:i,bottom:a}}function Fl(e,t,n,r){let i=t.borderSkipped,a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:s,reverse:c,top:l,bottom:u}=Pl(e);i===`middle`&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=u:(a[Il(u,o,s,c)]=!0,i=l)),a[Il(i,o,s,c)]=!0,e.borderSkipped=a}function Il(e,t,n,r){return r?(e=Ll(e,t,n),e=Rl(e,n,t)):e=Rl(e,t,n),e}function Ll(e,t,n){return e===t?n:e===n?t:e}function Rl(e,t,n){return e===`start`?t:e===`end`?n:e}function zl(e,{inflateAmount:t},n){e.inflateAmount=t===`auto`?n===1?.33:0:t}var Bl=class extends wl{static id=`bar`;static defaults={datasetElementType:!1,dataElementType:`bar`,categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:`number`,properties:[`x`,`y`,`base`,`width`,`height`]}}};static overrides={scales:{_index_:{type:`category`,offset:!0,grid:{offset:!0}},_value_:{type:`linear`,beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return jl(e,t,n,r)}parseArrayData(e,t,n,r){return jl(e,t,n,r)}parseObjectData(e,t,n,r){let{iScale:i,vScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=i.axis===`x`?o:s,l=a.axis===`x`?o:s,u=[],d,f,p,m;for(d=n,f=n+r;d<f;++d)m=t[d],p={},p[i.axis]=i.parse(To(m,c),d),u.push(Al(To(m,l),p,a,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,a=Ml(i)?`[`+i.start+`, `+i.end+`]`:``+n.getLabelForValue(r[n.axis]);return{label:``+t.getLabelForValue(r[t.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{index:a,_cachedMeta:{vScale:o}}=this,s=o.getBasePixel(),c=o.isHorizontal(),l=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let f=t;f<t+n;f++){let t=this.getParsed(f),n=i||I(t[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,l),m=(t._stacks||{})[o.axis],h={horizontal:c,base:n.base,enableBorderRadius:!m||Ml(t._custom)||a===m._top||a===m._bottom,x:c?n.head:p.center,y:c?p.center:n.head,height:c?p.size:Math.abs(n.size),width:c?Math.abs(n.size):p.size};d&&(h.options=u||this.resolveDataElementOptions(f,e[f].active?`active`:r));let g=h.options||e[f].options;Fl(h,g,m,a),zl(h,g,l.ratio),this.updateElement(e[f],f,h,r)}}_getStacks(e,t){let{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(I(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[z(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i<a;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));let o=e.barThickness;return{min:o||El(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:i,minBarLength:a}}=this,o=i||0,s=this.getParsed(e),c=s._custom,l=Ml(c),u=s[t.axis],d=0,f=n?this.applyStack(t,s,n):u,p,m;f!==u&&(d=f-u,f=u),l&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Lo(u)!==Lo(c.barEnd)&&(d=0),d+=u);let h=!I(i)&&!l?i:d,g=t.getPixelForValue(h);if(p=this.chart.getDataVisibility(e)?t.getPixelForValue(d+f):g,m=p-g,Math.abs(m)<a){m=Nl(m,t,o)*a,u===o&&(g-=m/2);let e=t.getPixelForDecimal(0),i=t.getPixelForDecimal(1);g=Math.max(Math.min(g,Math.max(e,i)),Math.min(e,i)),p=g+m,n&&!l&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(p)-t.getValueForPixel(g))}if(g===t.getPixelForValue(o)){let e=Lo(m)*t.getLineWidthForValue(o)/2;g+=e,m-=e}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(e,t){let n=t.scale,r=this.options,i=r.skipNull,a=z(r.maxBarThickness,1/0),o,s,c=this._getAxisCount();if(t.grouped){let n=i?this._getStackCount(e):t.stackCount,l=r.barThickness===`flex`?Ol(e,t,r,n*c):Dl(e,t,r,n*c),u=this.chart.options.indexAxis===`x`?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(z(u,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+d;o=l.start+l.chunk*f+l.chunk/2,s=Math.min(a,l.chunk*l.ratio)}else o=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(a,t.min*t.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)this.getParsed(i)[t.axis]!==null&&!n[i].hidden&&n[i].draw(this._ctx)}};function Vl(e,t,n){let r=1,i=1,a=0,o=0;if(t<H){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>Yo(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>Yo(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(No,u,f),_=m(V,l,d),v=m(V+No,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Hl=class extends wl{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,spacingMode:`angular`,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`&&e!==`spacingMode`,_indexable:e=>e!==`spacing`&&e!==`spacingMode`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(R(n[e])){let{key:e=`value`}=this._parsing;i=t=>+To(n[t],e)}let a,o;for(a=e,o=e+t;a<o;++a)r._parsed[a]=i(a)}}_getRotation(){return Uo(this.options.rotation-90)}_getCircumference(){return Uo(this.options.circumference)}_getRotationExtents(){let e=H,t=-H;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(fo(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:c,rotation:l}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:f,offsetY:p}=Vl(l,c,o),m=(t.width-i)/u,h=(t.height-i)/d,g=Math.max(Math.min(m,h)/2,0),_=po(this.options.radius,g),v=(_-Math.max(_*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*_,this.offsetY=p*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/H)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g=0;for(;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r=0;for(;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*H:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Es(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(z(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};function Ul(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Wl={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Ul()}parse(){return Ul()}format(){return Ul()}add(){return Ul()}diff(){return Ul()}startOf(){return Ul()}endOf(){return Ul()}}};function Gl(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ts:es;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!I(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!I(e[t.axis]));r.hi+=Math.max(0,o)}return r}if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Kl(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Gl(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function ql(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function Jl(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||Kl(e,n,t,function(n,o,s){(i||Us(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function Yl(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=Ko(e,{x:t.x,y:t.y});Yo(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return Kl(e,n,t,a),i}function Xl(e,t,n,r,i,a){let o=[],s=ql(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return Kl(e,n,t,l),o}function Zl(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?Yl(e,t,n,i):Xl(e,t,n,r,i,a)}function Ql(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return Kl(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var $l={evaluateInteractionItems:Kl,modes:{index(e,t,n,r){let i=Lc(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Jl(e,i,a,r,o):Zl(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=Lc(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Jl(e,i,a,r,o):Zl(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return Jl(e,Lc(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=Lc(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return Zl(e,i,a,n.intersect,r,o)},x(e,t,n,r){return Ql(e,Lc(t,e),`x`,n.intersect,r)},y(e,t,n,r){return Ql(e,Lc(t,e),`y`,n.intersect,r)}}},eu=[`left`,`top`,`right`,`bottom`];function tu(e,t){return e.filter(e=>e.pos===t)}function nu(e,t){return e.filter(e=>eu.indexOf(e.pos)===-1&&e.box.axis===t)}function ru(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function iu(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function G(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!eu.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function au(e,t){let n=G(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function ou(e){let t=iu(e),n=ru(t.filter(e=>e.box.fullSize),!0),r=ru(tu(t,`left`),!0),i=ru(tu(t,`right`)),a=ru(tu(t,`top`),!0),o=ru(tu(t,`bottom`)),s=nu(t,`x`),c=nu(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:tu(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function su(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function cu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function lu(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!R(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&cu(o,a.getPadding());let s=Math.max(0,t.outerWidth-su(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-su(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function uu(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function du(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function fu(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,du(s.horizontal,t));let{same:o,other:d}=lu(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&fu(i,t,n,r)||u}function pu(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function mu(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;Do(c.start)&&(o=c.start),e.fullSize?pu(e,i.left,o,n.outerWidth-i.right-i.left,a):pu(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;Do(c.start)&&(a=c.start),e.fullSize?pu(e,a,i.top,o,n.outerHeight-i.bottom-i.top):pu(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var hu={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=ic(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=ou(e.boxes),c=s.vertical,l=s.horizontal;B(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);cu(f,ic(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=au(c.concat(l),d);fu(s.fullSize,p,d,m),fu(c,p,d,m),fu(l,p,d,m)&&fu(c,p,d,m),uu(p),mu(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,mu(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},B(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},gu=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},_u=class extends gu{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},vu=`$chartjs`,yu={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},bu=e=>e===null||e===``;function xu(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[vu]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,bu(i)){let t=Uc(e,`width`);t!==void 0&&(e.width=t)}if(bu(r)){if(e.style.height===``)e.height=e.width/(t||2);else{let t=Uc(e,`height`);t!==void 0&&(e.height=t)}}return e}var Su=Hc?{passive:!0}:!1;function Cu(e,t,n){e&&e.addEventListener(t,n,Su)}function wu(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Su)}function Tu(e,t){let n=yu[e.type]||e.type,{x:r,y:i}=Lc(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function Eu(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function Du(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Eu(n.addedNodes,r),t&&=!Eu(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Ou(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Eu(n.removedNodes,r),t&&=!Eu(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var ku=new Map,Au=0;function ju(){let e=window.devicePixelRatio;e!==Au&&(Au=e,ku.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Mu(e,t){ku.size||window.addEventListener(`resize`,ju),ku.set(e,t)}function Nu(e){ku.delete(e),ku.size||window.removeEventListener(`resize`,ju)}function Pu(e,t,n){let r=e.canvas,i=r&&kc(r);if(!i)return;let a=cs((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;(n!==0||r!==0)&&a(n,r)});return o.observe(i),Mu(e,a),o}function Fu(e,t,n){n&&n.disconnect(),t===`resize`&&Nu(e)}function Iu(e,t,n){let r=e.canvas,i=cs(t=>{e.ctx!==null&&n(Tu(t,e))},e);return Cu(r,t,i),i}var Lu=class extends gu{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(xu(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[vu])return!1;let n=t[vu].initial;[`height`,`width`].forEach(e=>{let r=n[e];I(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[vu],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:Du,detach:Ou,resize:Pu}[t]||Iu)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:Fu,detach:Fu,resize:Fu}[t]||wu)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Bc(e,t,n,r)}isAttached(e){let t=e&&kc(e);return!!(t&&t.isConnected)}};function Ru(e){return!Oc()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?_u:Lu}var zu=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return W(this.x)&&W(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Bu(e,t){let n=e.options.ticks,r=Vu(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Uu(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Wu(t,l,a,o/i),l;let u=Hu(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(Gu(t,l,u,I(r)?0:s-r,s),e=0,n=o-1;e<n;e++)Gu(t,l,u,a[e],a[e+1]);return Gu(t,l,u,c,I(r)?t.length:c+r),l}return Gu(t,l,u),l}function Vu(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+ +!t,i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Hu(e,t,n){let r=Ku(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Bo(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function Uu(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Wu(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function Gu(e,t,n,r,i){let a=z(r,0),o=Math.min(z(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function Ku(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var qu=e=>e===`left`?`right`:e===`right`?`left`:e,Ju=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Yu=(e,t)=>Math.min(t||e,e);function Xu(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function Zu(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Qu(e,t){B(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function $u(e){return e.drawTicks?e.tickLength:0}function K(e,t){if(!e.display)return 0;let n=ac(e.font,t),r=ic(e.padding);return(L(e.text)?e.text.length:1)*n.lineHeight+r.height}function ed(e,t){return cc(e,{scale:t,type:`scale`})}function q(e,t,n){return cc(e,{tick:n,index:t,type:`tick`})}function J(e,t,n){let r=us(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=qu(r)),r}function Y(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=ds(r,a,s),R(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:Ju(e,n,t);f=s-a}else{if(R(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:Ju(e,n,t);m=ds(r,o,i),d=n===`left`?-No:No}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var td=class e extends zu{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=uo(e,1/0),t=uo(t,-1/0),n=uo(n,1/0),r=uo(r,-1/0),{min:uo(e,n),max:uo(t,r),minDefined:lo(e),maxDefined:lo(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:uo(t,uo(n,t)),max:uo(n,uo(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){mo(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=sc(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?Xu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Bu(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){mo(this.options.afterUpdate,[this])}beforeSetDimensions(){mo(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){mo(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),mo(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){mo(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=mo(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){mo(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){mo(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=Yu(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=Xo(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-$u(e.grid)-t.padding-K(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=Wo(Math.min(Math.asin(Xo((l.highest.height+6)/o,-1,1)),Math.asin(Xo(s/c,-1,1))-Math.asin(Xo(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){mo(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){mo(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=K(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=$u(i)+a):(e.height=this.maxHeight,e.width=$u(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=Uo(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){mo(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)I(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=Xu(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/Yu(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!I(p)&&!L(p))v=Ls(r,g.data,g.gc,v,p),y=_;else if(L(p))for(d=0,f=p.length;d<f;++d)b=p[d],!I(b)&&!L(b)&&(v=Ls(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}Qu(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return Zo(this._alignToPixels?zs(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=q(this.getContext(),e,n)}return this.$context||=ed(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=Uo(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=$u(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return zs(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(R(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(R(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=z(r.ticks.maxTicksLimit,l),te=Math.max(1,Math.ceil(l/ee));for(_=0;_<l;_+=te){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=Zu(this,_,s),v!==void 0&&(y=zs(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=$u(n.grid),f=d+l,p=u?-l:f,m=-Uo(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,ee=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(R(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(R(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?ee=`top`:s===`end`&&(ee=`bottom`));let te=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=L(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-te.highest.height/2-t*T+T:-te.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?te.highest.height/2-t*T:te.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=ic(e.backdropPadding),n=te.heights[g],r=te.widths[g],i=D-t.top,a=0-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2)}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Uo(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=zs(e,this.left,a)-a/2,l=zs(e,this.right,o)+o/2,u=d=s):(u=zs(e,this.top,a)-a/2,d=zs(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&Ws(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;Ys(t,i,0,a,r,n)}n&&Gs(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=ac(n.font),a=ic(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||R(t)?(s+=a.bottom,L(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=Y(this,s,t,o);Ys(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:J(o,t,r),textBaseline:`middle`,translation:[c,l],strokeColor:n.strokeColor,strokeWidth:n.strokeWidth})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=z(t.grid&&t.grid.z,-1),i=z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]!==this.id||e&&a.type!==e||r.push(a)}return r}_resolveTickFontOptions(e){return ac(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},nd=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;ad(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r||(r[i]=e,rd(e,a,n),this.override&&Fs.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in Fs[r]&&(delete Fs[r][n],this.override&&delete js[n])}};function rd(e,t,n){let r=yo(Object.create(null),[n?Fs.get(n):{},Fs.get(t),e.defaults]);Fs.set(t,r),e.defaultRoutes&&id(t,e.defaultRoutes),e.descriptors&&Fs.describe(t,e.descriptors)}function id(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);Fs.route(a,i,c,s)})}function ad(e){return`id`in e&&`defaults`in e}var X=new class{constructor(){this.controllers=new nd(wl,`datasets`,!0),this.elements=new nd(zu,`elements`),this.plugins=new nd(Object,`plugins`),this.scales=new nd(td,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):B(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Eo(e);mo(n[`before`+r],[],n),t[e](n),mo(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},od=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(mo(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){I(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=z(n.options&&n.options.plugins,{}),i=sd(n);return r===!1&&!t?[]:ld(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function sd(e){let t={},n=[],r=Object.keys(X.plugins.items);for(let e=0;e<r.length;e++)n.push(X.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function cd(e,t){return!t&&e===!1?null:e===!0?{}:e}function ld(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=cd(r[t],i);c!==null&&a.push({plugin:s,options:ud(e.config,{plugin:s,local:n[t]},c,o)})}return a}function ud(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function dd(e,t){let n=Fs.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function fd(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function pd(e,t){return e===t?`_index_`:`_value_`}function md(e){if(e===`x`||e===`y`||e===`r`)return e}function hd(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function gd(e,...t){if(md(e))return e;for(let n of t){let t=n.axis||hd(n.position)||e.length>1&&md(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function _d(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function vd(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return _d(e,`x`,n[0])||_d(e,`y`,n[0])}return{}}function yd(e,t){let n=js[e.type]||{scales:{}},r=t.scales||{},i=dd(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!R(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=gd(t,o,vd(t,e),Fs.scales[o.type]),c=pd(s,i),l=n.scales||{};a[t]=bo(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||dd(i,t),s=(js[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=fd(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),bo(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];bo(t,[Fs.scales[t.type],Fs.scale])}),a}function bd(e){let t=e.options||={};t.plugins=z(t.plugins,{}),t.scales=yd(e,t)}function xd(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Sd(e){return e||={},e.data=xd(e.data),bd(e),e}var Cd=new Map,wd=new Set;function Td(e,t){let n=Cd.get(e);return n||(n=t(),Cd.set(e,n),wd.add(n)),n}var Ed=(e,t,n)=>{let r=To(t,n);r!==void 0&&e.add(r)},Dd=class{constructor(e){this._config=Sd(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=xd(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),bd(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Td(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return Td(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return Td(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return Td(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>Ed(s,e,t))),t.forEach(e=>Ed(s,r,e)),t.forEach(e=>Ed(s,js[i]||{},e)),t.forEach(e=>Ed(s,Fs,e)),t.forEach(e=>Ed(s,Ms,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),wd.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,js[t]||{},Fs.datasets[t]||{},{type:t},Fs,Ms]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=Od(this._resolverCache,e,r),s=a;if(Ad(a,t)){i.$shared=!1,n=Oo(n)?n():n;let t=this.createResolver(e,n,o);s=uc(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=Od(this._resolverCache,e,n);return R(t)?uc(i,t,void 0,r):i}};function Od(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:lc(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var kd=e=>R(e)&&Object.getOwnPropertyNames(e).some(t=>Oo(e[t]));function Ad(e,t){let{isScriptable:n,isIndexable:r}=dc(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Oo(o)||kd(o))||a&&L(o))return!0}return!1}var jd=`4.6.1`,Md=[`top`,`bottom`,`left`,`right`,`chartArea`];function Nd(e,t){return e===`top`||e===`bottom`||Md.indexOf(e)===-1&&t===`x`}function Pd(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Fd(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),mo(n&&n.onComplete,[e],t)}function Id(e){let t=e.chart,n=t.options.animation;mo(n&&n.onProgress,[e],t)}function Ld(e){return Oc()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Rd={},zd=e=>{let t=Ld(e);return Object.values(Rd).filter(e=>e.canvas===t).pop()};function Bd(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Vd(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Hd=class{static defaults=Fs;static instances=Rd;static overrides=js;static registry=X;static version=jd;static getChart=zd;static register(...e){X.add(...e),Ud()}static unregister(...e){X.remove(...e),Ud()}constructor(e,t){let n=this.config=new Dd(t),r=Ld(e),i=zd(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Ru(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;this.id=co(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new od,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ls(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Rd[this.id]=this,!o||!s?console.error(`Failed to create chart: can't acquire context from the given item`):(Qc.listen(this,`complete`,Fd),Qc.listen(this,`progress`,Id),this._initialize(),this.attached&&this.update())}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return I(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return X}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():Vc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Bs(this.canvas,this.ctx),this}stop(){return Qc.stop(this),this}resize(e,t){Qc.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Vc(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),mo(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){B(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=gd(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),B(i,t=>{let i=t.options,a=i.id,o=gd(a,i),s=z(i.type,t.dtype);(i.position===void 0||Nd(i.position,o)!==Nd(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(X.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),B(r,(e,t)=>{e||delete n[t]}),B(n,e=>{hu.configure(this,e,e.options),hu.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Pd(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||dd(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=X.getController(a),{datasetElementType:r,dataElementType:o}=Fs.datasets[a];Object.assign(t,{dataElementType:X.getElement(o),datasetElementType:r&&X.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){B(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||B(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Pd(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){B(this.scales,e=>{hu.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;ko(new Set(Object.keys(this._listeners)),new Set(e.events))&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Bd(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!ko(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;hu.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],B(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Oo(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(Qc.has(this)?this.attached&&!Qc.running(this)&&Qc.start(this):(this.draw(),Fd({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Zc(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&Ws(t,r),e.controller.draw(),r&&Gs(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return Us(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=$l.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=cc(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Do(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Qc.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Bs(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Rd[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};B(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){B(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},B(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});ho(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Ao(e),c=Vd(e,this._lastEvent,n,s);n&&(this._lastEvent=null,mo(i.onHover,[e,o,this],this),s&&mo(i.onClick,[e,o,this],this));let l=!ho(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Ud(){return B(Hd.instances,e=>e._plugins.invalidate())}function Wd(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,Jo(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,Jo(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*Jo(r-n));if(u===`round`)e.arc(i,a,t,n-V/2,r+V/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+V/2)+i,c=-o*Math.sin(n+V/2)+a,l=o*Math.cos(r+V/2)+i,u=o*Math.sin(r+V/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Gd(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+No,r-No),e.closePath(),e.clip()}function Kd(e){return tc(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function qd(e,t,n,r){let i=Kd(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return Xo(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Xo(i.innerStart,0,o),innerEnd:Xo(i.innerEnd,0,o)}}function Jd(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Yd(e,t,n,r){let{x:i,y:a,startAngle:o,pixelMargin:s,innerRadius:c}=t,l=Math.max(t.outerRadius+r+n-s,0),u=c>0?c+r+n+s:0;e.beginPath(),e.arc(i,a,l,o,o+H),u>0&&(e.moveTo(i+Math.cos(o)*u,a+Math.sin(o)*u),e.arc(i,a,u,o+H,o,!0)),e.closePath()}function Xd(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,{spacingMode:d=`angular`}=t.options,f=i-c;if(a&&t.options.selfJoin&&Math.abs(f)>=H-1e-4){Yd(e,t,n,r);return}let p=Math.max(t.outerRadius+r+n-l,0),m=u>0?u+r+n+l:0,h=0,g=0,_=p>0?Math.max(.001,f*p-n/V)/p:.001,v=(f-_)/2;if(r){let e=((u>0?u-r:0)+(p>0?p-r:0))/2,t=(()=>{let t=e===0?f:f*e/(e+r);return(f-t)/2})(),n=e>0?Math.asin(Math.min(1,r/e)):0,i=Math.max(0,_/2-.001),a=Math.sin(i);if(d===`parallel`){if(m===0&&a>0){let e=r/a,t=Math.max(0,p-.001);m=Math.min(e,t)}let e=Math.min(p>0?p*a:1/0,m>0?m*a:1/0),t=Math.min(r,e);h=p>0?Math.asin(Math.min(1,t/p)):Math.min(i,n),g=m>0?Math.asin(Math.min(1,t/m)):h}else d===`proportional`?(h=Math.min(i,t),g=Math.min(i,t)):(h=Math.min(i,n),g=Math.min(i,n))}let y=c+v+h,b=i-v-h,x=c+v+g,S=i-v-g,C=Math.min(b-y,S-x),{outerStart:w,outerEnd:T,innerStart:E,innerEnd:D}=qd(t,m,p,C),ee=p-w,te=p-T,ne=y+w/ee,re=b-T/te,ie=m+E,ae=m+D,oe=x+E/ie,se=S-D/ae;if(e.beginPath(),a){let t=(ne+re)/2;if(e.arc(o,s,p,ne,t),e.arc(o,s,p,t,re),T>0){let t=Jd(te,re,o,s);e.arc(t.x,t.y,T,re,b+No)}let n=Jd(ae,S,o,s);if(e.lineTo(n.x,n.y),D>0){let t=Jd(ae,se,o,s);e.arc(t.x,t.y,D,S+No,se+Math.PI)}let r=(S-D/m+(x+E/m))/2;if(e.arc(o,s,m,S-D/m,r,!0),e.arc(o,s,m,r,x+E/m,!0),E>0){let t=Jd(ie,oe,o,s);e.arc(t.x,t.y,E,oe+Math.PI,x-No)}let i=Jd(ee,y,o,s);if(e.lineTo(i.x,i.y),w>0){let t=Jd(ee,ne,o,s);e.arc(t.x,t.y,w,y-No,ne)}}else{e.moveTo(o,s);let t=Math.cos(ne)*p+o,n=Math.sin(ne)*p+s;e.lineTo(t,n);let r=Math.cos(re)*p+o,i=Math.sin(re)*p+s;e.lineTo(r,i)}e.closePath()}function Zd(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Xd(e,t,n,r,c,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+(s%H||H))}return Xd(e,t,n,r,c,i),e.fill(),c}function Qd(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=c,m=c.borderAlign===`inner`;if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=l*2,e.lineJoin=u||`round`):(e.lineWidth=l,e.lineJoin=u||`bevel`);let h=t.endAngle,g=Math.abs(h-o)>=H-1e-4;if(a){Xd(e,t,n,r,h,i);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(h=o+(s%H||H))}m&&Gd(e,t,h),!(g&&t.innerRadius>0)&&c.selfJoin&&h-o>=V&&p===0&&u!==`miter`&&Wd(e,t,h),a||(Xd(e,t,n,r,h,i),e.stroke())}var $d=class extends zu{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,spacingMode:`angular`,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;circular;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,this.circular=!1,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=Ko(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=z(l,o-a),f=Yo(r,a,o)&&a!==o,p=d>=H||f,m=Qo(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>H?Math.floor(n/H):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(V,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Zd(e,this,s,i,a),Qd(e,this,s,i,a),e.restore()}};function ef(e,t){let{x:n,y:r,base:i,width:a,height:o}=e.getProps([`x`,`y`,`base`,`width`,`height`],t),s,c,l,u,d;return e.horizontal?(d=o/2,s=Math.min(n,i),c=Math.max(n,i),l=r-d,u=r+d):(d=a/2,s=n-d,c=n+d,l=Math.min(r,i),u=Math.max(r,i)),{left:s,top:l,right:c,bottom:u}}function tf(e,t,n,r){return e?0:Xo(t,n,r)}function nf(e,t,n){let r=e.options.borderWidth,i=e.borderSkipped,a=nc(r);return{t:tf(i.top,a.top,0,n),r:tf(i.right,a.right,0,t),b:tf(i.bottom,a.bottom,0,n),l:tf(i.left,a.left,0,t)}}function rf(e,t,n){let{enableBorderRadius:r}=e.getProps([`enableBorderRadius`]),i=e.options.borderRadius,a=rc(i),o=Math.min(t,n),s=e.borderSkipped,c=r||R(i);return{topLeft:tf(!c||s.top||s.left,a.topLeft,0,o),topRight:tf(!c||s.top||s.right,a.topRight,0,o),bottomLeft:tf(!c||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:tf(!c||s.bottom||s.right,a.bottomRight,0,o)}}function af(e){let t=ef(e),n=t.right-t.left,r=t.bottom-t.top,i=nf(e,n/2,r/2),a=rf(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function of(e,t,n,r){let i=t===null,a=n===null,o=e&&!(i&&a)&&ef(e,r);return o&&(i||Qo(t,o.left,o.right))&&(a||Qo(n,o.top,o.bottom))}function sf(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function cf(e,t){e.rect(t.x,t.y,t.w,t.h)}function lf(e,t,n={}){let r=e.x===n.x?0:-t,i=e.y===n.y?0:-t,a=(e.x+e.w===n.x+n.w?0:t)-r,o=(e.y+e.h===n.y+n.h?0:t)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}var uf=class extends zu{static id=`bar`;static defaults={borderSkipped:`start`,borderWidth:0,borderRadius:0,inflateAmount:`auto`,pointStyle:void 0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:a}=af(this),o=sf(a.radius)?Xs:cf;e.save(),(a.w!==i.w||a.h!==i.h)&&(e.beginPath(),o(e,lf(a,t,i)),e.clip(),o(e,lf(i,-t,a)),e.fillStyle=n,e.fill(`evenodd`)),e.beginPath(),o(e,lf(i,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return of(this,e,t,n)}inXRange(e,t){return of(this,e,null,t)}inYRange(e,t){return of(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps([`x`,`y`,`base`,`horizontal`],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return e===`x`?this.width/2:this.height/2}},df=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},ff=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,pf=class extends zu{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=mo(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=ac(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=df(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=Z(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=Kc(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=ds(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=ds(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=ds(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=ds(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;Ws(e,this),this._draw(),Gs(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=Fs.color,s=Kc(e.rtl,this.left,this.width),c=ac(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=df(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=z(n.lineWidth,1);if(r.fillStyle=z(n.fillStyle,o),r.lineCap=z(n.lineCap,`butt`),r.lineDashOffset=z(n.lineDashOffset,0),r.lineJoin=z(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=z(n.strokeStyle,o),r.setLineDash(z(n.lineDash,[])),a.usePointStyle){let o={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},c=s.xPlus(e,p/2),l=t+d;Hs(r,o,c,l,a.pointStyleWidth&&p)}else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=rc(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?Xs(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){Ys(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:ds(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:ds(i,this.top+y+l,this.bottom-t[0].height),line:0},qc(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=ds(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=ds(i,this.top+y+l,this.bottom-t[f.line].height));let w=s.x(S);if(g(w,C,o),S=fs(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=gf(o,e)+l}else f.y+=b}),Jc(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=ac(t.font),r=ic(t.padding);if(!t.display)return;let i=Kc(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=ds(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+ds(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=ds(o,u,u+d);a.textAlign=i.textAlign(us(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,Ys(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=ac(e.font),n=ic(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(Qo(e,this.left,this.right)&&Qo(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],Qo(e,r.left,r.left+r.width)&&Qo(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!_f(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=ff(r,n);r&&!i&&mo(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&mo(t.onHover,[e,n,this],this)}else n&&mo(t.onClick,[e,n,this],this)}};function Z(e,t,n,r,i){return{itemWidth:mf(r,e,t,n),itemHeight:hf(i,r,t.lineHeight)}}function mf(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function hf(e,t,n){let r=e;return typeof t.text!=`string`&&(r=gf(t,n)),r}function gf(e,t){return t*(e.text?e.text.length:0)}function _f(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var vf={id:`legend`,_element:pf,start(e,t,n){let r=e.legend=new pf({ctx:e.ctx,options:n,chart:e});hu.configure(e,r,n),hu.addBox(e,r)},stop(e){hu.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;hu.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=ic(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},yf={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=qo(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function bf(e,t){return t&&(L(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function xf(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
|
|
11
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=mt(),d;if(t){let e=typeof t==`string`?ne(t):t;w(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ae(e,{pathname:p});T(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),T(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=At(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:je([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:je([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?_.createElement(it.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function wt(){let e=Lt(),t=Le(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=_.createElement(_.Fragment,null,_.createElement(`p`,null,`💿 Hey developer 👋`),_.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,_.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,_.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),_.createElement(_.Fragment,null,_.createElement(`h2`,null,`Unexpected Application Error!`),_.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?_.createElement(`pre`,{style:i},n):null,o)}var Tt=_.createElement(wt,null),Et=class extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=dt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:_.createElement(at.Provider,{value:this.props.routeContext},_.createElement(ot.Provider,{value:e,children:this.props.component}));return this.context?_.createElement(Ot,{error:e},t):t}};Et.contextType=Qe;var Dt=new WeakMap;function Ot({children:e,error:t}){let{basename:n,navigator:r}=_.useContext(rt);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ut(t.digest);if(e){let i=Dt.get(t);if(i)throw i;let a=Be(e.location,n),o=a.absoluteURL||a.to;if(Ge(e.location,o,He(r),`allow-explicit`),Ye(o))throw Error(`Invalid redirect location`);if(ze&&!Dt.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Dt.set(t,n),n}}return _.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function kt({routeContext:e,match:t,children:n}){let r=_.useContext(Xe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),_.createElement(at.Provider,{value:e},n)}function At(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Re(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Tt,o&&(s<0&&c===0?(Bt(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?_.createElement(n.route.Component,null):n.route.element?n.route.element:e,_.createElement(kt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?_.createElement(Et,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function jt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mt(e){let t=_.useContext(Xe);return w(t,jt(e)),t}function Nt(e){let t=_.useContext(Ze);return w(t,jt(e)),t}function Pt(e){let t=_.useContext(at);return w(t,jt(e)),t}function Ft(e){let t=Pt(e),n=t.matches[t.matches.length-1];return w(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function It(){return Ft(`useRouteId`)}function Lt(){let e=_.useContext(ot),t=Nt(`useRouteError`),n=Ft(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Rt(){let{router:e}=Mt(`useNavigate`),t=Ft(`useNavigate`),n=_.useRef(!1);return gt(()=>{n.current=!0}),_.useCallback(async(r,i={})=>{T(n.current,ht),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var zt={};function Bt(e,t,n){!t&&!zt[e]&&(zt[e]=!0,T(!1,n))}_.memo(Vt);function Vt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Ct(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Ht({to:e,replace:t,state:n,relative:r}){w(pt(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=_.useContext(rt);T(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=_.useContext(at),{pathname:s}=mt(),c=_t(),l=ke(e,Oe(o),s,r===`path`);Ge(typeof e==`string`?e:te(e),a.createHref(l),He(a),`reject`);let u=JSON.stringify(l);return _.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Ut(e){return bt(e.context)}function Wt(e){w(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Gt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){w(!pt(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=_.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ne(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=_.useMemo(()=>{let e=Ce(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return T(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:_.createElement(rt.Provider,{value:c},_.createElement(it.Provider,{children:t,value:h}))}function Kt({children:e,location:t}){return St(qt(e),t)}_.Component;function qt(e,t=[]){let n=[];return _.Children.forEach(e,(e,r)=>{if(!_.isValidElement(e))return;let i=[...t,r];if(e.type===_.Fragment){n.push.apply(n,qt(e.props.children,i));return}w(e.type===Wt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),w(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=qt(e.props.children,i)),n.push(a)}),n}var Jt=`get`,Yt=`application/x-www-form-urlencoded`;function Xt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Zt(e){return Xt(e)&&e.tagName.toLowerCase()===`button`}function Qt(e){return Xt(e)&&e.tagName.toLowerCase()===`form`}function $t(e){return Xt(e)&&e.tagName.toLowerCase()===`input`}function en(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function A(e,t){return e.button===0&&(!t||t===`_self`)&&!en(e)}function tn(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function nn(e,t){let n=tn(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var rn=null;function an(){if(rn===null)try{new FormData(document.createElement(`form`),0),rn=!1}catch{rn=!0}return rn}var on=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function sn(e){return e!=null&&!on.has(e)?(T(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yt}"`),null):e}function cn(e,t){let n,r,i,a,o;if(Qt(e)){let o=e.getAttribute(`action`);r=o?Ce(o,t):null,n=e.getAttribute(`method`)||Jt,i=sn(e.getAttribute(`enctype`))||Yt,a=new FormData(e)}else if(Zt(e)||$t(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ce(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Jt,i=sn(e.getAttribute(`formenctype`))||sn(o.getAttribute(`enctype`))||Yt,a=new FormData(o,e),!an()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Xt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Jt,r=null,i=Yt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function ln(e,t){if(e===!1||e==null)throw Error(t)}function un(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Ce(i.pathname,t)===`/`?`${Me(t)}/_root.${r}`:`${Me(i.pathname)}.${r}`,i}async function dn(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fn(e){return e!=null&&typeof e.page==`string`}function pn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function mn(e,t,n){return yn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await dn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(pn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function hn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function gn(e,t,{includeHydrateFallback:n}={}){return _n(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function _n(e){return[...new Set(e)]}function vn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function yn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!fn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(vn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function bn(){let e=_.useContext(Xe);return ln(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function xn(){let e=_.useContext(Ze);return ln(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Sn=_.createContext(void 0);Sn.displayName=`FrameworkContext`;function Cn(){let e=_.useContext(Sn);return ln(e,`You must render this element inside a <HydratedRouter> element`),e}function wn(e,t){let n=_.useContext(Sn),[r,i]=_.useState(!1),[a,o]=_.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=_.useRef(null);_.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),_.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Tn(s,p),onBlur:Tn(c,m),onMouseEnter:Tn(l,p),onMouseLeave:Tn(u,m),onTouchStart:Tn(d,p)}]:[a,f,{}]:[!1,f,{}]}function Tn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function En({page:e,...t}){let n=$e(),{nonce:r}=Cn(),{router:i}=bn(),a=_.useMemo(()=>ae(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?_.createElement(On,{page:e,matches:a,...t}):_.createElement(kn,{page:e,matches:a,...t})):null}function Dn(e){let{manifest:t,routeModules:n}=Cn(),[r,i]=_.useState([]);return _.useEffect(()=>{let r=!1;return mn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function On({page:e,matches:t,...n}){let r=mt(),{future:i}=Cn(),{basename:a}=bn(),o=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=un(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return _.createElement(_.Fragment,null,o.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function kn({page:e,matches:t,...n}){let r=mt(),{future:i,manifest:a,routeModules:o}=Cn(),{basename:s}=bn(),{loaderData:c,matches:l}=xn(),u=_.useMemo(()=>hn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=_.useMemo(()=>hn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=_.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=un(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=_.useMemo(()=>gn(d,a),[d,a]),m=Dn(d);return _.createElement(_.Fragment,null,f.map(e=>_.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>_.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>_.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function An(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}_.Component;var jn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{jn&&(window.__reactRouterVersion=`7.18.5`)}catch{}function Mn({basename:e,children:t,useTransitions:n,window:r}){let i=_.useRef();i.current??=C({window:r,v5Compat:!0});let a=i.current,[o,s]=_.useState({action:a.action,location:a.location}),c=_.useCallback(e=>{n===!1?s(e):_.startTransition(()=>s(e))},[n]);return _.useLayoutEffect(()=>a.listen(c),[a,c]),_.createElement(Gt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Nn=_.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:y}=_.useContext(rt),b=typeof l==`string`&&v.test(l),x=Be(l,h);l=x.to;let S=ft(l,{relative:r}),C=mt(),w=null;if(o){let e=ke(o,[],C.mask?C.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:je([h,e.pathname])),w=g.createHref(e)}let[T,E,D]=wn(n,p),ee=Rn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:y});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let ne=!(x.isExternal||i),re=_.createElement(`a`,{...p,...D,href:(ne?w:void 0)||x.absoluteURL||S,onClick:ne?te:e,ref:An(m,E),target:c,"data-discover":!b&&t===`render`?`true`:void 0});return T&&!b?_.createElement(_.Fragment,null,re,_.createElement(En,{page:S})):re});Nn.displayName=`Link`;var Pn=_.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=xt(a,{relative:c.relative}),d=mt(),f=_.useContext(Ze),{navigator:p,basename:m}=_.useContext(rt),h=f!=null&&Wn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Ce(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=v===g||!r&&v.startsWith(g)&&v.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return _.createElement(Nn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Pn.displayName=`NavLink`;var Fn=_.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Jt,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=_.useContext(rt),g=Hn(),y=Un(s,{relative:l}),b=o.toLowerCase()===`get`?`get`:`post`,x=typeof s==`string`&&v.test(s);return _.createElement(`form`,{ref:m,method:b,action:y,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?_.startTransition(()=>p()):p()},...p,"data-discover":!x&&e===`render`?`true`:void 0})});Fn.displayName=`Form`;function In(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ln(e){let t=_.useContext(Xe);return w(t,In(e)),t}function Rn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=_t(),d=mt(),f=xt(e,{relative:o});return _.useCallback(p=>{if(A(p,t)){p.preventDefault();let t=n===void 0?te(d)===te(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?_.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function zn(e){T(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=_.useRef(tn(e)),n=_.useRef(!1),r=mt(),i=_.useMemo(()=>nn(r.search,n.current?null:t.current),[r.search]),a=_t();return[i,_.useCallback((e,t)=>{let r=tn(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Bn=0,Vn=()=>`__${String(++Bn)}__`;function Hn(){let{router:e}=Ln(`useSubmit`),{basename:t}=_.useContext(rt),n=It(),r=e.fetch,i=e.navigate;return _.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=cn(e,t);if(a.navigate===!1){let e=a.fetcherKey||Vn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Un(e,{relative:t}={}){let{basename:n}=_.useContext(rt),r=_.useContext(at);w(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...xt(e||`.`,{relative:t})},o=mt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:je([n,a.pathname])),te(a)}function Wn(e,{relative:t}={}){let n=_.useContext(et);w(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ln(`useViewTransitionState`),i=xt(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ce(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ce(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xe(i.pathname,o)!=null||xe(i.pathname,a)!=null}var Gn=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Kn(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Gn(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var qn=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Jn=e=>{let t=qn(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Xn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Zn(e){return e!=null}function Qn(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Xn.width,a=e.size??e.height??Xn.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Yn(...c):Yn(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Xn[`stroke-width`])*Number(e.size??e.width??Xn.width)/Number(t.size??t.width??Xn.width):t.strokeWidth??Xn[`stroke-width`];return[`svg`,{...Object.entries(Xn).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Zn(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Zn(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Zn(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function $n(e,t={}){return Qn(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var er=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},tr=(0,_.createContext)({}),nr=()=>(0,_.useContext)(tr),rr=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=nr()??{},b=!!c||er(d),[x,S,C=[]]=$n(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Yn(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function j(e,t=[],n=[]){let r=typeof e==`string`?Kn(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(rr,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Jn(r.name)),i}var ir={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};ir.node;var ar=j(ir),or={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};or.node;var sr=j(or),cr={name:`briefcase-business`,size:24,node:[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]};cr.node;var lr=j(cr),ur={name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]};ur.node;var dr=j(ur),fr={name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]};fr.node;var pr=j(fr),mr={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};mr.node;var hr=j(mr),gr={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};gr.node;var _r=j(gr),vr={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};vr.node;var yr=j(vr),br={name:`circle-play`,size:24,node:[[`path`,{d:`M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z`,key:`kmsa83`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`play-circle`]};br.node;var xr=j(br),Sr={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5`,key:`1awbb0`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Sr.node;var Cr=j(Sr),wr={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};wr.node;var Tr=j(wr),Er={name:`cookie`,size:24,node:[[`path`,{d:`M11 17h.01`,key:`dukryu`}],[`path`,{d:`M11.496 2c.324-.016.558.292.529.615a4 4 0 004.235 4.368.713.713 0 01.758.757 4 4 0 004.366 4.237c.323-.03.63.204.614.527a10 10 0 01-2.915 6.566A1 1 0 114.93 4.918 10 10 0 0111.496 2`,key:`1x76et`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 16h.01`,key:`1f9h7w`}],[`path`,{d:`M16 3h.01`,key:`ll0zb8`}],[`path`,{d:`M21 4h.01`,key:`uw58yv`}],[`path`,{d:`M21 8h.01`,key:`17axm7`}],[`path`,{d:`M7 14h.01`,key:`1qa3f1`}],[`path`,{d:`M9 8h.01`,key:`1jwowd`}]]};Er.node;var Dr=j(Er),Or={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Or.node;var kr=j(Or),Ar={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ar.node;var jr=j(Ar),Mr={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Mr.node;var Nr=j(Mr),Pr={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Pr.node;var Fr=j(Pr),Ir={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};Ir.node;var Lr=j(Ir),Rr={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Rr.node;var zr=j(Rr),Br={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]};Br.node;var Vr=j(Br),Hr={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Hr.node;var Ur=j(Hr),Wr={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Wr.node;var Gr=j(Wr),Kr={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};Kr.node;var qr=j(Kr),Jr={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};Jr.node;var Yr=j(Jr),Xr={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Xr.node;var Zr=j(Xr),Qr={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Qr.node;var $r=j(Qr),ei={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};ei.node;var ti=j(ei),ni={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ni.node;var ri=j(ni),ii={name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]};ii.node;var ai=j(ii),oi={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};oi.node;var si=j(oi),ci={name:`power`,size:24,node:[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]};ci.node;var li=j(ci),ui={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};ui.node;var di=j(ui),fi={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};fi.node;var pi=j(fi),mi={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};mi.node;var hi=j(mi),gi={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};gi.node;var _i=j(gi),vi={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};vi.node;var yi=j(vi),bi={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};bi.node;var xi=j(bi),Si={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};Si.node;var Ci=j(Si),wi={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};wi.node;var Ti=j(wi),Ei={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Ei.node;var Di=j(Ei),Oi={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};Oi.node;var ki=j(Oi),Ai={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Ai.node;var ji=j(Ai),Mi={name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};Mi.node;var Ni=j(Mi),Pi={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Pi.node;var Fi=j(Pi),Ii={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Ii.node;var Li=j(Ii),Ri={name:`wifi`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]};Ri.node;var zi=j(Ri),Bi={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Bi.node;var Vi=j(Bi),Hi={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Hi.node;var Ui=j(Hi),Wi=c(g(),1),Gi=`/api`,Ki=class extends Error{constructor(e,t,n){super(e),this.status=t,this.payload=n}};async function qi(e,t,{body:n,raw:r,query:i,headers:a}={}){let o=new URL(`${Gi}${t}`,window.location.origin);if(i)for(let[e,t]of Object.entries(i))t!=null&&t!==``&&o.searchParams.set(e,String(t));let s={method:e,headers:{...a??{}}};n!==void 0&&(r?s.body=n:(s.headers[`Content-Type`]=`application/json`,s.body=JSON.stringify(n)));let c=await fetch(o,s),l=(c.headers.get(`content-type`)??``).includes(`application/json`)?await c.json().catch(()=>null):await c.text().catch(()=>null);if(c.status===401&&l?.error?.code===`unauthorized`&&window.dispatchEvent(new Event(`jobfinder:unauthorized`)),!c.ok)throw new Ki((l?.error?.message??(typeof l==`string`?l:c.statusText))||`HTTP ${c.status}`,c.status,l?.error??l);return l}var M={get:(e,t)=>qi(`GET`,e,t),post:(e,t,n)=>qi(`POST`,e,{...n,body:t}),put:(e,t,n)=>qi(`PUT`,e,{...n,body:t}),del:(e,t)=>qi(`DELETE`,e,t)},Ji=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),N=o(((e,t)=>{t.exports=Ji()}))(),Yi=(0,_.createContext)(null);function Xi({children:e}){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!0),a=(0,_.useCallback)(async()=>{try{let e=await M.get(`/auth/session`);n(e.authenticated?e.user:null)}catch{n(null)}finally{i(!1)}},[]);(0,_.useEffect)(()=>{a()},[a]),(0,_.useEffect)(()=>{let e=()=>n(null);return window.addEventListener(`jobfinder:unauthorized`,e),()=>window.removeEventListener(`jobfinder:unauthorized`,e)},[]);let o=(0,_.useCallback)(async(e,t)=>{let r=await M.post(`/auth/login`,{email:e,password:t});return n(r.user),r},[]),s=(0,_.useCallback)(async()=>{try{await M.post(`/auth/logout`)}catch{}n(null)},[]);return(0,N.jsx)(Yi.Provider,{value:{user:t,loading:r,login:o,logout:s,check:a},children:e})}function Zi(){let e=(0,_.useContext)(Yi);if(!e)throw Error(`useAuth must be used inside AuthProvider`);return e}function Qi(e){let t=(String(e??``).split(`@`)[0]??``).split(/[._-]+/).filter(Boolean);return t.length?t.slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``):`JF`}var $i=`https://www.linkedin.com/help/linkedin/answer/a526048/acesso-as-apis-do-linkedin?lang=pt`;function ea(e){return String(e??``).split(`.`).map(e=>String(Number(e))).join(`.`)}function ta({children:e}){return(0,N.jsx)(`li`,{className:`sidebar-section`,children:e})}function na({to:e,icon:t,children:n,end:r}){return(0,N.jsx)(`li`,{children:(0,N.jsxs)(Pn,{to:e,end:r,className:({isActive:e})=>`sidebar-link ${e?`active`:``}`,children:[t&&(0,N.jsx)(t,{className:`mr-3 h-4 w-4 shrink-0`}),(0,N.jsx)(`span`,{children:n})]})})}function ra({icon:e,label:t,children:n}){let r=mt(),i=n.some(e=>e.props.to===r.pathname),[a,o]=(0,_.useState)(i);return(0,N.jsxs)(`li`,{children:[(0,N.jsxs)(`button`,{onClick:()=>o(e=>!e),className:`sidebar-link w-full text-left`,"aria-expanded":a,children:[e&&(0,N.jsx)(e,{className:`mr-3 h-4 w-4 shrink-0`}),(0,N.jsx)(`span`,{children:t}),(0,N.jsx)(_r,{className:`ml-auto h-3 w-3 transition-transform ${a?`rotate-180`:``}`})]}),a&&(0,N.jsx)(`ul`,{className:`mt-1 space-y-1 pb-1`,children:n})]})}function ia({to:e,children:t}){return(0,N.jsx)(`li`,{children:(0,N.jsx)(Pn,{to:e,className:({isActive:e})=>`sidebar-link ${e?`active`:``} !pl-12`,children:(0,N.jsx)(`span`,{children:t})})})}function aa({officialApiConfigured:e}){let t=_t(),{user:n,logout:r}=Zi();return(0,N.jsxs)(`aside`,{className:`flex h-full w-64 shrink-0 flex-col bg-[#1e1b4b] text-white`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-white/10 p-6`,children:[(0,N.jsxs)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:[`Job`,(0,N.jsx)(`span`,{className:`text-[#818cf8]`,children:`Finder`})]}),(0,N.jsxs)(`span`,{className:`rounded border border-indigo-400/30 bg-indigo-500/10 px-2 py-0.5 text-[10px] font-medium text-indigo-300`,title:`Versao 0.1.05 (npm: ${ea(`0.1.05`)})`,children:[`v`,`0.1.05`]})]}),(0,N.jsx)(`nav`,{className:`flex-1 overflow-y-auto py-4`,children:(0,N.jsxs)(`ul`,{className:`space-y-1`,children:[(0,N.jsx)(na,{to:`/`,icon:Vr,end:!0,children:`Painel`}),(0,N.jsx)(ta,{children:`Conexões`}),(0,N.jsxs)(ra,{icon:Fi,label:`Conexões`,children:[(0,N.jsx)(ia,{to:`/conexoes`,children:`Networking`}),(0,N.jsx)(ia,{to:`/conexoes/dm`,children:`Cascatas de DM`})]}),(0,N.jsx)(ta,{children:`Vagas`}),(0,N.jsxs)(ra,{icon:dr,label:`Vagas`,children:[(0,N.jsx)(ia,{to:`/vagas`,children:`Buscar vagas`}),(0,N.jsx)(ia,{to:`/vagas/candidaturas`,children:`Candidaturas`})]}),(0,N.jsx)(ta,{children:`Postagens`}),(0,N.jsx)(na,{to:`/postagens`,icon:ti,children:`Postagens`}),(0,N.jsx)(na,{to:`/postagens/agendar`,icon:pr,children:`Agendar`}),(0,N.jsx)(ta,{children:`Integrações`}),(0,N.jsx)(na,{to:`/integracoes`,icon:ai,children:`LinkedIn`}),(0,N.jsxs)(`li`,{children:[(0,N.jsxs)(`a`,{href:$i,target:`_blank`,rel:`noreferrer noopener`,className:`sidebar-link`,title:`A API oficial é o método recomendado. Se indisponível, o app usa cookies de sessão como fallback.`,children:[(0,N.jsx)(zr,{className:`mr-3 h-4 w-4 shrink-0 text-[#818cf8]`}),(0,N.jsx)(`span`,{className:`flex-1`,children:`Criar API Oficial do LinkedIn`}),(0,N.jsx)(kr,{className:`h-3 w-3 text-gray-400`})]}),!e&&(0,N.jsx)(`span`,{className:`ml-6 mt-1 inline-block rounded-full bg-amber-400/20 px-2 py-0.5 text-[10px] font-medium text-amber-300`,children:`⚠ Recomendado`})]}),(0,N.jsx)(na,{to:`/configuracoes`,icon:yi,children:`Configurações`}),(0,N.jsx)(ta,{children:`Suporte`}),(0,N.jsx)(na,{to:`/integracoes?tab=suporte`,icon:Cr,children:`Suporte`})]})}),(0,N.jsxs)(`div`,{className:`mt-auto border-t border-white/10 p-4`,children:[(0,N.jsxs)(`div`,{className:`mb-3 flex items-center gap-3 rounded-lg bg-white/5 px-3 py-2.5`,children:[(0,N.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-indigo-500/20 text-xs font-bold text-indigo-200`,children:Qi(n?.email)}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`truncate text-xs font-semibold text-white`,children:n?.name??`Conta`}),(0,N.jsx)(`p`,{className:`truncate text-[10px] text-gray-400`,children:n?.email??`—`})]})]}),(0,N.jsxs)(`button`,{type:`button`,onClick:async()=>{await r(),t(`/login`,{replace:!0})},className:`flex w-full items-center justify-center gap-2 rounded-lg bg-white/5 px-4 py-2.5 text-xs text-gray-300 transition hover:bg-red-500/20 hover:text-red-200`,title:`Encerrar a sessão`,children:[(0,N.jsx)(qr,{className:`h-3.5 w-3.5`}),`Sair`]})]})]})}var oa=`https://github.com/DanHachuel/JobFinder#tutorial`;function sa({title:e,dryRun:t,connected:n,mode:r}){let{user:i}=Zi();return(0,N.jsxs)(`header`,{className:`flex items-center justify-between border-b border-gray-200 bg-white px-8 py-4 shadow-sm`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(`h2`,{className:`text-lg font-semibold text-gray-800`,children:e}),t&&(0,N.jsxs)(`span`,{className:`badge bg-amber-100 text-amber-800`,title:`Modo dry-run: nenhuma ação real é enviada ao LinkedIn`,children:[(0,N.jsx)(Lr,{className:`mr-1 h-3 w-3`}),`dry-run`]}),!t&&(0,N.jsxs)(`span`,{className:`badge bg-red-100 text-red-800`,title:`Modo real: postagens, convites, DMs e candidaturas serão executados de verdade no LinkedIn`,children:[(0,N.jsx)(Ui,{className:`mr-1 h-3 w-3`}),`Real Mode`]}),n&&!t&&(0,N.jsxs)(`span`,{className:`badge bg-green-100 text-green-800`,title:`Canal do LinkedIn conectado (${r??`cookie`}) — ações reais serão enviadas`,children:[(0,N.jsx)(xi,{className:`mr-1 h-3 w-3`}),`conectado`]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,N.jsxs)(`a`,{href:oa,target:`_blank`,rel:`noreferrer noopener`,className:`text-sm font-medium text-indigo-600 hover:text-indigo-800`,children:[(0,N.jsx)(xr,{className:`mr-1 inline h-4 w-4`}),`Ver tutorial`]}),(0,N.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-indigo-100 text-sm font-bold text-indigo-600`,title:`${i?.email??`conta`} — sessão autenticada`,children:Qi(i?.email)})]})]})}var ca=(0,_.createContext)(null),la=[[`/`,`Painel`],[`/postagens/agendar`,`Agendar postagem`],[`/postagens`,`Postagens`],[`/conexoes/dm`,`Cascatas de DM`],[`/conexoes`,`Networking — conexões`],[`/vagas/candidaturas`,`Candidaturas`],[`/vagas`,`Buscar vagas`],[`/integracoes`,`Integrações — LinkedIn`],[`/configuracoes`,`Configurações`],[`/config`,`Configurações`]];function ua(){return(0,_.useContext)(ca)}function P({children:e}){let t=mt(),{user:n}=Zi(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),s=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/health`),M.get(`/linkedin/status`)]);i(e),o(t)}catch{i(null),o(null)}},[]);(0,_.useEffect)(()=>{s()},[s,t.pathname]);let c=la.find(([e])=>t.pathname.startsWith(e))?.[1]??`Painel`,l=a?.dryRun??r?.dryRun??!0;return(0,N.jsx)(ca.Provider,{value:{health:r,linkedin:a,user:n,refresh:s},children:(0,N.jsxs)(`div`,{className:`flex h-screen w-full overflow-hidden overflow-x-hidden bg-gray-100`,children:[(0,N.jsx)(aa,{officialApiConfigured:!!a?.channel?.official?.hasAccessToken}),(0,N.jsxs)(`main`,{className:`flex h-full min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,N.jsx)(sa,{title:c,dryRun:l,connected:!!a?.connected,mode:a?.mode}),(0,N.jsxs)(`div`,{className:`flex-1 overflow-y-auto overflow-x-hidden p-8`,children:[e,(0,N.jsxs)(`footer`,{className:`mt-8 flex items-center justify-between border-t border-gray-200 pt-4 text-xs text-gray-400`,children:[(0,N.jsx)(`span`,{children:`© 2026 JobFinder (DanHachuel)`}),(0,N.jsx)(`span`,{children:`Armazenamento em JSON`})]})]},t.pathname)]})]})})}function F({label:e,value:t,hint:n,icon:r,tone:i=`text-gray-800`,extra:a}){return(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:e}),r&&(0,N.jsx)(r,{className:`h-5 w-5 text-gray-300`})]}),(0,N.jsx)(`p`,{className:`mt-2 text-2xl font-bold ${i}`,children:t}),n&&(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-400`,children:n}),a]})}function da({percent:e,tone:t=`bg-indigo-500`,label:n,showPercent:r=!0}){let i=Math.min(100,Math.max(0,Math.round(e??0)));return(0,N.jsxs)(`div`,{children:[(n||r)&&(0,N.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsx)(`span`,{children:n}),r&&(0,N.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[i,`%`]})]}),(0,N.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-gray-200`,children:(0,N.jsx)(`div`,{className:`h-full rounded-full ${t} transition-all duration-500`,style:{width:`${i}%`}})})]})}function fa({used:e,limit:t,label:n,tone:r=`bg-indigo-500`,warning:i=80}){let a=t??0,o=a?Math.round(e/a*100):0;return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsx)(`span`,{children:n}),(0,N.jsxs)(`span`,{className:`font-semibold text-gray-700`,children:[e,` de `,a]})]}),(0,N.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-gray-200`,children:(0,N.jsx)(`div`,{className:`h-full rounded-full ${o>=i?`bg-red-500`:r} transition-all duration-500`,style:{width:`${Math.min(100,o)}%`}})})]})}function pa({label:e=`Carregando…`}){return(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-12 text-sm text-gray-500`,children:[(0,N.jsx)(Ur,{className:`h-5 w-5 animate-spin text-indigo-500`}),e]})}function ma({icon:e,title:t,hint:n,action:r}){return(0,N.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-white/50 px-6 py-12 text-center`,children:[e&&(0,N.jsx)(e,{className:`mb-3 h-8 w-8 text-gray-300`}),(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:t}),n&&(0,N.jsx)(`p`,{className:`mt-1 max-w-md text-xs text-gray-500`,children:n}),r&&(0,N.jsx)(`div`,{className:`mt-4`,children:r})]})}function ha({open:e,title:t,onClose:n,children:r,footer:i}){return e?(0,N.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/40 p-4`,role:`dialog`,"aria-modal":`true`,children:(0,N.jsxs)(`div`,{className:`w-full max-w-lg rounded-2xl bg-white shadow-xl`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between border-b border-gray-100 px-5 py-4`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:t}),(0,N.jsx)(`button`,{onClick:n,className:`rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600`,"aria-label":`Fechar`,children:(0,N.jsx)(Vi,{className:`h-5 w-5`})})]}),(0,N.jsx)(`div`,{className:`px-5 py-4 text-sm text-gray-700`,children:r}),i&&(0,N.jsx)(`div`,{className:`flex justify-end gap-2 border-t border-gray-100 px-5 py-4`,children:i})]})}):null}function ga(e){return e+.5|0}var _a=(e,t,n)=>Math.max(Math.min(e,n),t);function va(e){return _a(ga(e*2.55),0,255)}function ya(e){return _a(ga(e*255),0,255)}function ba(e){return _a(ga(e/2.55)/100,0,1)}function xa(e){return _a(ga(e*100),0,100)}var Sa={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ca=[...`0123456789ABCDEF`],wa=e=>Ca[e&15],Ta=e=>Ca[(e&240)>>4]+Ca[e&15],Ea=e=>(e&240)>>4==(e&15),Da=e=>Ea(e.r)&&Ea(e.g)&&Ea(e.b)&&Ea(e.a);function Oa(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&Sa[e[1]]*17,g:255&Sa[e[2]]*17,b:255&Sa[e[3]]*17,a:t===5?Sa[e[4]]*17:255}:(t===7||t===9)&&(n={r:Sa[e[1]]<<4|Sa[e[2]],g:Sa[e[3]]<<4|Sa[e[4]],b:Sa[e[5]]<<4|Sa[e[6]],a:t===9?Sa[e[7]]<<4|Sa[e[8]]:255})),n}var ka=(e,t)=>e<255?t(e):``;function Aa(e){var t=Da(e)?wa:Ta;return e?`#`+t(e.r)+t(e.g)+t(e.b)+ka(e.a,t):void 0}var ja=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ma(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function Na(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function Pa(e,t,n){let r=Ma(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function Fa(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Ia(e){let t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s,c,l;return i!==a&&(l=i-a,c=o>.5?l/(2-i-a):l/(i+a),s=Fa(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function La(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(ya)}function Ra(e,t,n){return La(Ma,e,t,n)}function za(e,t,n){return La(Pa,e,t,n)}function Ba(e,t,n){return La(Na,e,t,n)}function Va(e){return(e%360+360)%360}function Ha(e){let t=ja.exec(e),n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?va(+t[5]):ya(+t[5]));let i=Va(+t[2]),a=t[3]/100,o=t[4]/100;return r=t[1]===`hwb`?za(i,a,o):t[1]===`hsv`?Ba(i,a,o):Ra(i,a,o),{r:r[0],g:r[1],b:r[2],a:n}}function Ua(e,t){var n=Ia(e);n[0]=Va(n[0]+t),n=Ra(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Wa(e){if(!e)return;let t=Ia(e),n=t[0],r=xa(t[1]),i=xa(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${ba(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}var Ga={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},Ka={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function qa(){let e={},t=Object.keys(Ka),n=Object.keys(Ga),r,i,a,o,s;for(r=0;r<t.length;r++){for(o=s=t[r],i=0;i<n.length;i++)a=n[i],s=s.replace(a,Ga[a]);a=parseInt(Ka[o],16),e[s]=[a>>16&255,a>>8&255,a&255]}return e}var Ja;function Ya(e){Ja||(Ja=qa(),Ja.transparent=[0,0,0,0]);let t=Ja[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Xa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Za(e){let t=Xa.exec(e),n=255,r,i,a;if(t){if(t[7]!==r){let e=+t[7];n=t[8]?va(e):_a(e*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?va(r):_a(r,0,255)),i=255&(t[4]?va(i):_a(i,0,255)),a=255&(t[6]?va(a):_a(a,0,255)),{r,g:i,b:a,a:n}}}function Qa(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ba(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var $a=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,eo=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function to(e,t,n){let r=eo(ba(e.r)),i=eo(ba(e.g)),a=eo(ba(e.b));return{r:ya($a(r+n*(eo(ba(t.r))-r))),g:ya($a(i+n*(eo(ba(t.g))-i))),b:ya($a(a+n*(eo(ba(t.b))-a))),a:e.a+n*(t.a-e.a)}}function no(e,t,n){if(e){let r=Ia(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Ra(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ro(e,t){return e&&Object.assign(t||{},e)}function io(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=ya(e[3]))):(t=ro(e,{r:0,g:0,b:0,a:1}),t.a=ya(t.a)),t}function ao(e){return e.charAt(0)===`r`?Za(e):Ha(e)}var oo=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,r;n===`object`?r=io(t):n===`string`&&(r=Oa(t)||Ya(t)||ao(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=ro(this._rgb);return e&&(e.a=ba(e.a)),e}set rgb(e){this._rgb=io(e)}rgbString(){return this._valid?Qa(this._rgb):void 0}hexString(){return this._valid?Aa(this._rgb):void 0}hslString(){return this._valid?Wa(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=to(this._rgb,e._rgb,t)),this}clone(){return new e(this.rgb)}alpha(e){return this._rgb.a=ya(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb;return e.r=e.g=e.b=ga(e.r*.3+e.g*.59+e.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return no(this._rgb,2,e),this}darken(e){return no(this._rgb,2,-e),this}saturate(e){return no(this._rgb,1,e),this}desaturate(e){return no(this._rgb,1,-e),this}rotate(e){return Ua(this._rgb,e),this}};function so(){}var co=(()=>{let e=0;return()=>e++})();function I(e){return e==null}function L(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function R(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function lo(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function uo(e,t){return lo(e)?e:t}function z(e,t){return e===void 0?t:e}var fo=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,po=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function mo(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function B(e,t,n,r){let i,a,o;if(L(e)){if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;i<a;i++)t.call(n,e[i],i)}else if(R(e))for(o=Object.keys(e),a=o.length,i=0;i<a;i++)t.call(n,e[o[i]],o[i])}function ho(e,t){let n,r,i,a;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],a=t[n],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function go(e){if(L(e))return e.map(go);if(R(e)){let t=Object.create(null),n=Object.keys(e),r=n.length,i=0;for(;i<r;++i)t[n[i]]=go(e[n[i]]);return t}return e}function _o(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function vo(e,t,n,r){if(!_o(e))return;let i=t[e],a=n[e];R(i)&&R(a)?yo(i,a,r):t[e]=go(a)}function yo(e,t,n){let r=L(t)?t:[t],i=r.length;if(!R(e))return e;n||={};let a=n.merger||vo,o;for(let t=0;t<i;++t){if(o=r[t],!R(o))continue;let i=Object.keys(o);for(let t=0,r=i.length;t<r;++t)a(i[t],e,o,n)}return e}function bo(e,t){return yo(e,t,{merger:xo})}function xo(e,t,n){if(!_o(e))return;let r=t[e],i=n[e];R(r)&&R(i)?bo(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=go(i))}var So={"":e=>e,x:e=>e.x,y:e=>e.y};function Co(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function wo(e){let t=Co(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function To(e,t){return(So[t]||(So[t]=wo(t)))(e)}function Eo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Do=e=>e!==void 0,Oo=e=>typeof e==`function`,ko=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Ao(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var V=Math.PI,H=2*V;H+V;var jo=1/0,Mo=V/180,No=V/2,Po=V/4,Fo=V*2/3,Io=Math.log10,Lo=Math.sign;function Ro(e,t,n){return Math.abs(e-t)<n}function zo(e){let t=Math.round(e);e=Ro(e,t,e/1e3)?t:e;let n=10**Math.floor(Io(e)),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Bo(e){let t=[],n=Math.sqrt(e),r=1;for(;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((e,t)=>e-t).pop(),t}function U(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function W(e){return!U(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Vo(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Ho(e,t,n){let r,i,a;for(r=0,i=e.length;r<i;r++)a=e[r][n],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Uo(e){return V/180*e}function Wo(e){return 180/V*e}function Go(e){if(!lo(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function Ko(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r),a=Math.atan2(r,n);return a<-.5*V&&(a+=H),{angle:a,distance:i}}function qo(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function Jo(e){return(e%H+H)%H}function Yo(e,t,n,r){let i=Jo(e),a=Jo(t),o=Jo(n),s=Jo(a-i),c=Jo(o-i),l=Jo(i-a),u=Jo(i-o);return i===a||i===o||r&&a===o||s>c&&l<u}function Xo(e,t,n){return Math.max(t,Math.min(n,e))}function Zo(e){return Xo(e,-32768,32767)}function Qo(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function $o(e,t,n){n||=(n=>e[n]<t);let r=e.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var es=(e,t,n,r)=>$o(e,n,r?r=>{let i=e[r][t];return i<n||i===n&&e[r+1][t]===n}:r=>e[r][t]<n),ts=(e,t,n)=>$o(e,n,r=>e[r][t]>=n);function ns(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}var rs=[`push`,`pop`,`shift`,`splice`,`unshift`];function is(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),rs.forEach(t=>{let n=`_onData`+Eo(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})}))}function as(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),r.length>0||(rs.forEach(t=>{delete e[t]}),delete e._chartjs)}function os(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var ss=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function cs(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,ss.call(window,()=>{r=!1,e.apply(t,n)}))}}function ls(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var us=e=>e===`start`?`left`:e===`end`?`right`:`center`,ds=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,fs=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t,ps=e=>e===0||e===1,ms=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*H/n)),hs=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*H/n)+1,gs={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*No)+1,easeOutSine:e=>Math.sin(e*No),easeInOutSine:e=>-.5*(Math.cos(V*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>ps(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ps(e)?e:ms(e,.075,.3),easeOutElastic:e=>ps(e)?e:hs(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return ps(e)?e:e<.5?.5*ms(e*2,t,n):.5+.5*hs(e*2-1,t,n)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return--e*e*(2.70158*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-gs.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?gs.easeInBounce(e*2)*.5:gs.easeOutBounce(e*2-1)*.5+.5};function _s(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function vs(e){return _s(e)?e:new oo(e)}function ys(e){return _s(e)?e:new oo(e).saturate(.5).darken(.1).hexString()}var bs=[`x`,`y`,`borderWidth`,`radius`,`tension`],xs=[`color`,`borderColor`,`backgroundColor`];function Ss(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:xs},numbers:{type:`number`,properties:bs}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Cs(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var ws=new Map;function Ts(e,t){t||={};let n=e+JSON.stringify(t),r=ws.get(n);return r||(r=new Intl.NumberFormat(e,t),ws.set(n,r)),r}function Es(e,t,n){return Ts(t,n).format(e)}var Ds={values(e){return L(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Os(e,n)}let o=Io(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),Es(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Io(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Ds.numeric.call(this,e,t,n):``}};function Os(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ks={formatters:Ds};function As(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ks.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var js=Object.create(null),Ms=Object.create(null);function Ns(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;t<r;++t){let r=n[t];e=e[r]||(e[r]=Object.create(null))}return e}function Ps(e,t,n){return typeof t==`string`?yo(Ns(e,t),n):yo(Ns(e,``),t)}var Fs=new class{constructor(e,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=e=>e.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>ys(t.backgroundColor),this.hoverBorderColor=(e,t)=>ys(t.borderColor),this.hoverColor=(e,t)=>ys(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return Ps(this,e,t)}get(e){return Ns(this,e)}describe(e,t){return Ps(Ms,e,t)}override(e,t){return Ps(js,e,t)}route(e,t,n,r){let i=Ns(this,e),a=Ns(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return R(e)?Object.assign({},t,e):z(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Ss,Cs,As]);function Is(e){return!e||I(e.size)||I(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Ls(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Rs(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;c<s;c++)if(d=n[c],d!=null&&!L(d))o=Ls(e,i,a,o,d);else if(L(d))for(l=0,u=d.length;l<u;l++)f=d[l],f!=null&&!L(f)&&(o=Ls(e,i,a,o,f));e.restore();let p=a.length/2;if(p>n.length){for(c=0;c<p;c++)delete i[a[c]];a.splice(0,p)}return o}function zs(e,t,n){let r=e.currentDevicePixelRatio,i=n===0?0:Math.max(n/2,.5);return Math.round((t-i)*r)/r+i}function Bs(e,t){(t||e)&&(t||=e.getContext(`2d`),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Vs(e,t,n,r){Hs(e,t,n,r,null)}function Hs(e,t,n,r,i){let a,o,s,c,l,u,d,f,p=t.pointStyle,m=t.rotation,h=t.radius,g=(m||0)*Mo;if(p&&typeof p==`object`&&(a=p.toString(),a===`[object HTMLImageElement]`||a===`[object HTMLCanvasElement]`))e.save(),e.translate(n,r),e.rotate(g),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();else if(!(isNaN(h)||h<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,h,0,0,H):e.arc(n,r,h,0,H),e.closePath();break;case`triangle`:u=i?i/2:h,e.moveTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Fo,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),g+=Fo,e.lineTo(n+Math.sin(g)*u,r-Math.cos(g)*h),e.closePath();break;case`rectRounded`:l=h*.516,c=h-l,o=Math.cos(g+Po)*c,d=Math.cos(g+Po)*(i?i/2-l:c),s=Math.sin(g+Po)*c,f=Math.sin(g+Po)*(i?i/2-l:c),e.arc(n-d,r-s,l,g-V,g-No),e.arc(n+f,r-o,l,g-No,g),e.arc(n+d,r+s,l,g,g+No),e.arc(n-f,r+o,l,g+No,g+V),e.closePath();break;case`rect`:if(!m){c=Math.SQRT1_2*h,u=i?i/2:c,e.rect(n-u,r-c,2*u,2*c);break}g+=Po;case`rectRot`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+f,r-o),e.lineTo(n+d,r+s),e.lineTo(n-f,r+o),e.closePath();break;case`crossRot`:g+=Po;case`cross`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`star`:d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),g+=Po,d=Math.cos(g)*(i?i/2:h),o=Math.cos(g)*h,s=Math.sin(g)*h,f=Math.sin(g)*(i?i/2:h),e.moveTo(n-d,r-s),e.lineTo(n+d,r+s),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case`line`:o=i?i/2:Math.cos(g)*h,s=Math.sin(g)*h,e.moveTo(n-o,r-s),e.lineTo(n+o,r+s);break;case`dash`:e.moveTo(n,r),e.lineTo(n+Math.cos(g)*(i?i/2:h),r+Math.sin(g)*h);break;case!1:e.closePath()}e.fill(),t.borderWidth>0&&e.stroke()}}function Us(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ws(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Gs(e){e.restore()}function Ks(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),I(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function qs(e,t,n,r,i){if(i.strikethrough||i.underline){let a=e.measureText(r),o=t-a.actualBoundingBoxLeft,s=t+a.actualBoundingBoxRight,c=n-a.actualBoundingBoxAscent,l=n+a.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(s,u),e.stroke()}}function Js(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ys(e,t,n,r,i,a={}){let o=L(t)?t:[t],s=a.strokeWidth>0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,Ks(e,a),c=0;c<o.length;++c)l=o[c],a.backdrop&&Js(e,a.backdrop),s&&(a.strokeColor&&(e.strokeStyle=a.strokeColor),I(a.strokeWidth)||(e.lineWidth=a.strokeWidth),e.strokeText(l,n,r,a.maxWidth)),e.fillText(l,n,r,a.maxWidth),qs(e,n,r,l,a),r+=Number(i.lineHeight);e.restore()}function Xs(e,t){let{x:n,y:r,w:i,h:a,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*V,V,!0),e.lineTo(n,r+a-o.bottomLeft),e.arc(n+o.bottomLeft,r+a-o.bottomLeft,o.bottomLeft,V,No,!0),e.lineTo(n+i-o.bottomRight,r+a),e.arc(n+i-o.bottomRight,r+a-o.bottomRight,o.bottomRight,No,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-No,!0),e.lineTo(n+o.topLeft,r)}var Zs=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Qs=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function $s(e,t){let n=(``+e).match(Zs);if(!n||n[1]===`normal`)return t*1.2;switch(e=+n[2],n[3]){case`px`:return e;case`%`:e/=100}return t*e}var ec=e=>+e||0;function tc(e,t){let n={},r=R(t),i=r?Object.keys(t):t,a=R(e)?r?n=>z(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=ec(a(e));return n}function nc(e){return tc(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function rc(e){return tc(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function ic(e){let t=nc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ac(e,t){e||={},t||=Fs.font;let n=z(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=z(e.style,t.style);r&&!(``+r).match(Qs)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:z(e.family,t.family),lineHeight:$s(z(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:z(e.weight,t.weight),string:``};return i.string=Is(i),i}function oc(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;a<o;++a)if(s=e[a],s!==void 0&&(t!==void 0&&typeof s==`function`&&(s=s(t),i=!1),n!==void 0&&L(s)&&(s=s[n%s.length],i=!1),s!==void 0))return r&&!i&&(r.cacheable=!1),s}function sc(e,t,n){let{min:r,max:i}=e,a=po(t,(i-r)/2),o=(e,t)=>n&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function cc(e,t){return Object.assign(Object.create(e),t)}function lc(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=Tc(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>lc([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return mc(n,r,()=>wc(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return Ec(e).includes(t)},ownKeys(e){return Ec(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function uc(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:dc(e,r),setContext:t=>uc(e,t,n,r),override:i=>uc(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return mc(e,t,()=>hc(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function dc(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Oo(n)?n:()=>n,isIndexable:Oo(r)?r:()=>r}}var fc=(e,t)=>e?e+Eo(t):t,pc=(e,t)=>R(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function mc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function hc(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Oo(s)&&o.isScriptable(t)&&(s=gc(t,s,e,n)),L(s)&&s.length&&(s=_c(t,s,e,o.isIndexable)),pc(t,s)&&(s=uc(s,i,a&&a[t],o)),s}function gc(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),pc(e,c)&&(c=xc(i._scopes,i,e,c)),c}function _c(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(R(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=xc(r,i,e,c);t.push(uc(n,a,o&&o[e],s))}}return t}function vc(e,t,n){return Oo(e)?e(t,n):e}var yc=(e,t)=>e===!0?t:typeof e==`string`?To(t,e):void 0;function bc(e,t,n,r,i){for(let a of t){let t=yc(n,a);if(t){e.add(t);let a=vc(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function xc(e,t,n,r){let i=t._rootScopes,a=vc(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=Sc(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=Sc(s,o,a,c,r),c===null)?!1:lc(Array.from(s),[``],i,a,()=>Cc(t,n,r))}function Sc(e,t,n,r,i){for(;n;)n=bc(e,t,n,r,i);return n}function Cc(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return L(i)&&R(n)?n:i||{}}function wc(e,t,n,r){let i;for(let a of t)if(i=Tc(fc(a,e),n),i!==void 0)return pc(e,i)?xc(n,r,e,i):i}function Tc(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function Ec(e){let t=e._keys;return t||=e._keys=Dc(e._scopes),t}function Dc(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}function Oc(){return typeof window<`u`&&typeof document<`u`}function kc(e){let t=e.parentNode;return t&&t.toString()===`[object ShadowRoot]`&&(t=t.host),t}function Ac(e,t,n){let r;return typeof e==`string`?(r=parseInt(e,10),e.indexOf(`%`)!==-1&&(r=r/100*t.parentNode[n])):r=e,r}var jc=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Mc(e,t){return jc(e).getPropertyValue(t)}var Nc=[`top`,`right`,`bottom`,`left`];function Pc(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=Nc[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var Fc=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Ic(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(Fc(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function Lc(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=jc(n),a=i.boxSizing===`border-box`,o=Pc(i,`padding`),s=Pc(i,`border`,`width`),{x:c,y:l,box:u}=Ic(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function Rc(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&kc(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=jc(a),s=Pc(o,`border`,`width`),c=Pc(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Ac(o.maxWidth,a,`clientWidth`),i=Ac(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||jo,maxHeight:i||jo}}var zc=e=>Math.round(e*10)/10;function Bc(e,t,n,r){let i=jc(e),a=Pc(i,`margin`),o=Ac(i.maxWidth,e,`clientWidth`)||jo,s=Ac(i.maxHeight,e,`clientHeight`)||jo,c=Rc(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Pc(i,`border`,`width`),t=Pc(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=zc(Math.min(l,o,c.maxWidth)),u=zc(Math.min(u,s,c.maxHeight)),l&&!u&&(u=zc(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=zc(Math.floor(u*r))),{width:l,height:u}}function Vc(e,t,n){let r=t||1,i=zc(e.height*r),a=zc(e.width*r);e.height=zc(e.height),e.width=zc(e.width);let o=e.canvas;o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`);let s=Math.floor(i),c=Math.floor(a);return e.currentDevicePixelRatio!==r||o.height!==s||o.width!==c?(e.currentDevicePixelRatio=r,o.height=s,o.width=c,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var Hc=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Oc()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function Uc(e,t){let n=Mc(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}var Wc=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},Gc=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Kc(e,t,n){return e?Wc(t,n):Gc()}function qc(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function Jc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function Yc(e,t,n){return e.options.clip?e[n]:t[n]}function Xc(e,t){let{xScale:n,yScale:r}=e;return n&&r?{left:Yc(n,t,`left`),right:Yc(n,t,`right`),top:Yc(r,t,`top`),bottom:Yc(r,t,`bottom`)}:t}function Zc(e,t){let n=t._clip;if(n.disabled)return!1;let r=Xc(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}var Qc=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){let i=t.listeners[r],a=t.duration;i.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,ss.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},$c=`transparent`,el={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=vs(e||$c),i=r.valid&&vs(t||$c);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},tl=class{constructor(e,t,n,r){let i=t[n];r=oc([e.to,r,i,e.from]);let a=oc([e.from,i,r]);this._active=!0,this._fn=e.fn||el[e.type||typeof a],this._easing=gs[e.easing]||gs.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=oc([e.to,t,r,e.from]),this._from=oc([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;this._active=i!==o&&(a||t<n),this._active?t<0?this._target[r]=i:(s=t/n%2,s=a&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)):(this._target[r]=o,this._notify(!0))}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}},nl=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!R(e))return;let t=Object.keys(Fs.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{let i=e[r];if(!R(i))return;let a={};for(let e of t)a[e]=i[e];(L(i.properties)&&i.properties||[r]).forEach(e=>{e!==r&&n.has(e)||n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=il(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&rl(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u){if(d&&u.active()){u.update(d,l,o);continue}u.cancel()}!d||!d.duration?e[c]=l:(i[c]=u=new tl(d,e,c,l),r.push(u))}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Qc.add(this._chart,n),!0}};function rl(e,t){let n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){let i=e[r[t]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function il(e,t){if(!t)return;let n=e.options;if(!n)e.options=t;else return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function al(e,t){let n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,a=n.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function ol(e,t,n){if(n===!1)return!1;let r=al(e,n),i=al(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function sl(e){let t,n,r,i;return R(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function cl(e,t){let n=[],r=e._getSortedDatasetMetas(t),i,a;for(i=0,a=r.length;i<a;++i)n.push(r[i].index);return n}function ll(e,t,n,r={}){let i=e.keys,a=r.mode===`single`,o,s,c,l;if(t===null)return;let u=!1;for(o=0,s=i.length;o<s;++o){if(c=+i[o],c===n){if(u=!0,r.all)continue;break}l=e.values[c],lo(l)&&(a||t===0||Lo(t)===Lo(l))&&(t+=l)}return!u&&!r.all?0:t}function ul(e,t){let{iScale:n,vScale:r}=t,i=n.axis===`x`?`x`:`y`,a=r.axis===`x`?`x`:`y`,o=Object.keys(e),s=Array(o.length),c,l,u;for(c=0,l=o.length;c<l;++c)u=o[c],s[c]={[i]:u,[a]:e[u]};return s}function dl(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function fl(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function pl(e){let{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:-1/0,max:i?n:1/0}}function ml(e,t,n){let r=e[t]||(e[t]={});return r[n]||(r[n]={})}function hl(e,t,n,r){for(let i of t.getMatchingVisibleMetas(r).reverse()){let t=e[i.index];if(n&&t>0||!n&&t<0)return i.index}return null}function gl(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=fl(a,o,r),d=t.length,f;for(let e=0;e<d;++e){let n=t[e],{[c]:a,[l]:d}=n,p=n._stacks||={};f=p[l]=ml(i,u,a),f[s]=d,f._top=hl(f,o,!0,r.type),f._bottom=hl(f,o,!1,r.type);let m=f._visualValues||(f._visualValues={});m[s]=d}}function _l(e,t){let n=e.scales;return Object.keys(n).filter(e=>n[e].axis===t).shift()}function vl(e,t){return cc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function yl(e,t,n){return cc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function bl(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;t&&t[r]!==void 0&&t[r][n]!==void 0&&(delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n])}}}var xl=e=>e===`reset`||e===`none`,Sl=(e,t)=>t?e:Object.assign({},e),Cl=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:cl(n,!0),values:null},wl=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=dl(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&bl(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=z(n.xAxisID,_l(e,`x`)),a=t.yAxisID=z(n.yAxisID,_l(e,`y`)),o=t.rAxisID=z(n.rAxisID,_l(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&&as(this._data,this),e._stacked&&bl(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(R(t)){let e=this._cachedMeta;this._data=ul(t,e)}else if(n!==t){if(n){as(n,this);let e=this._cachedMeta;bl(e),e._parsed=[]}t&&Object.isExtensible(t)&&is(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=dl(t.vScale,t),t.stack!==n.stack&&(r=!0,bl(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(gl(this,t._parsed),t._stacked=dl(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length||n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=L(r[e])?this.parseArrayData(n,r,e,t):R(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]<c[o];for(l=0;l<t;++l)n._parsed[l+e]=u=d[l],s&&(i()&&(s=!1),c=u);n._sorted=s}a&&gl(this,d)}parsePrimitiveData(e,t,n,r){let{iScale:i,vScale:a}=e,o=i.axis,s=a.axis,c=i.getLabels(),l=i===a,u=Array(r),d,f,p;for(d=0,f=r;d<f;++d)p=d+n,u[d]={[o]:l||i.parse(c[p],p),[s]:a.parse(t[p],p)};return u}parseArrayData(e,t,n,r){let{xScale:i,yScale:a}=e,o=Array(r),s,c,l,u;for(s=0,c=r;s<c;++s)l=s+n,u=t[l],o[s]={x:i.parse(u[0],l),y:a.parse(u[1],l)};return o}parseObjectData(e,t,n,r){let{xScale:i,yScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=Array(r),l,u,d,f;for(l=0,u=r;l<u;++l)d=l+n,f=t[d],c[l]={x:i.parse(To(f,o),d),y:a.parse(To(f,s),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){let r=this.chart,i=this._cachedMeta,a=t[e.axis];return ll({keys:cl(r,!0),values:t._stacks[e.axis]._visualValues},a,i.index,{mode:n})}updateRangeFromParsed(e,t,n,r){let i=n[t.axis],a=i===null?NaN:i,o=r&&n._stacks[t.axis];r&&o&&(r.values=o,a=ll(r,i,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){let n=this._cachedMeta,r=n._parsed,i=n._sorted&&e===n.iScale,a=r.length,o=this._getOtherScale(e),s=Cl(t,n,this.chart),c={min:1/0,max:-1/0},{min:l,max:u}=pl(o),d,f;function p(){f=r[d];let t=f[o.axis];return!lo(f[e.axis])||l>t||u<t}for(d=0;d<a&&!(!p()&&(this.updateRangeFromParsed(c,e,f,s),i));++d);if(i){for(d=a-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r<i;++r)a=t[r][e.axis],lo(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){let t=this._cachedMeta,n=t.iScale,r=t.vScale,i=this.getParsed(e);return{label:n?``+n.getLabelForValue(i[n.axis]):``,value:r?``+r.getLabelForValue(i[r.axis]):``}}_update(e){let t=this._cachedMeta;this.update(e||`default`),t._clip=sl(z(this.options.clip,ol(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){let e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],i=t.chartArea,a=[],o=this._drawStart||0,s=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop,l;for(n.dataset&&n.dataset.draw(e,i,o,s),l=o;l<o+s;++l){let t=r[l];t.hidden||(t.active&&c?a.push(t):t.draw(e,i))}for(l=0;l<a.length;++l)a[l].draw(e,i)}getStyle(e,t){let n=t?`active`:`default`;return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){let r=this.getDataset(),i;if(e>=0&&e<this._cachedMeta.data.length){let t=this._cachedMeta.data[e];i=t.$context||=yl(this.getContext(),e,t),i.parsed=this.getParsed(e),i.raw=r.data[e],i.index=i.dataIndex=e}else i=this.$context||=vl(this.chart.getContext(),this.index),i.dataset=r,i.index=i.datasetIndex=this.index;return i.active=!!t,i.mode=n,i}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t=`default`,n){let r=t===`active`,i=this._cachedDataOpts,a=e+`-`+t,o=i[a],s=this.enableOptionSharing&&Do(n);if(o)return Sl(o,s);let c=this.chart.config,l=c.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,`hover`,e,``]:[e,``],d=c.getOptionScopes(this.getDataset(),l),f=Object.keys(Fs.elements[e]),p=c.resolveNamedOptions(d,f,()=>this.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(Sl(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new nl(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||xl(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){xl(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!xl(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i<r&&this._removeElements(i,r-i)}_insertElements(e,t,n=!0){let r=this._cachedMeta,i=r.data,a=e+t,o,s=e=>{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;o<a;++o)i[o]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(i,e,t,`reset`)}updateElements(e,t,n,r){}_removeElements(e,t){let n=this._cachedMeta;if(this._parsing){let r=n._parsed.splice(e,t);n._stacked&&bl(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{let[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){let e=arguments.length;this._sync([`_insertElements`,this.getDataset().data.length-e,e])}_onDataPop(){this._sync([`_removeElements`,this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync([`_removeElements`,0,1])}_onDataSplice(e,t){t&&this._sync([`_removeElements`,e,t]);let n=arguments.length-2;n&&this._sync([`_insertElements`,e,n])}_onDataUnshift(){this._sync([`_insertElements`,0,arguments.length])}};function Tl(e,t){if(!e._cache.$bar){let n=e.getMatchingVisibleMetas(t),r=[];for(let t=0,i=n.length;t<i;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=os(r.sort((e,t)=>e-t))}return e._cache.$bar}function El(e){let t=e.iScale,n=Tl(t,e.type),r=t._length,i,a,o,s,c=()=>{o!==32767&&o!==-32768&&(Do(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i<a;++i)o=t.getPixelForValue(n[i]),c();for(s=void 0,i=0,a=t.ticks.length;i<a;++i)o=t.getPixelForTick(i),c();return r}function Dl(e,t,n,r){let i=n.barThickness,a,o;return I(i)?(a=t.min*n.categoryPercentage,o=n.barPercentage):(a=i*r,o=1),{chunk:a/r,ratio:o,start:t.pixels[e]-a/2}}function Ol(e,t,n,r){let i=t.pixels,a=i[e],o=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null,c=n.categoryPercentage;o===null&&(o=a-(s===null?t.end-t.start:s-a)),s===null&&(s=a+a-o);let l=a-(a-Math.min(o,s))/2*c;return{chunk:Math.abs(s-o)/2*c/r,ratio:n.barPercentage,start:l}}function kl(e,t,n,r){let i=n.parse(e[0],r),a=n.parse(e[1],r),o=Math.min(i,a),s=Math.max(i,a),c=o,l=s;Math.abs(o)>Math.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function Al(e,t,n,r){return L(e)?kl(e,t,n,r):t[n.axis]=n.parse(e,r),t}function jl(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l<u;++l)f=t[l],d={},d[i.axis]=s||i.parse(o[l],l),c.push(Al(f,d,a,l));return c}function Ml(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Nl(e,t,n){return e===0?(t.isHorizontal()?1:-1)*(t.min>=n?1:-1):Lo(e)}function Pl(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.base<e.y,n=`bottom`,r=`top`),t?(i=`end`,a=`start`):(i=`start`,a=`end`),{start:n,end:r,reverse:t,top:i,bottom:a}}function Fl(e,t,n,r){let i=t.borderSkipped,a={};if(!i){e.borderSkipped=a;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:o,end:s,reverse:c,top:l,bottom:u}=Pl(e);i===`middle`&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=u:(a[Il(u,o,s,c)]=!0,i=l)),a[Il(i,o,s,c)]=!0,e.borderSkipped=a}function Il(e,t,n,r){return r?(e=Ll(e,t,n),e=Rl(e,n,t)):e=Rl(e,t,n),e}function Ll(e,t,n){return e===t?n:e===n?t:e}function Rl(e,t,n){return e===`start`?t:e===`end`?n:e}function zl(e,{inflateAmount:t},n){e.inflateAmount=t===`auto`?n===1?.33:0:t}var Bl=class extends wl{static id=`bar`;static defaults={datasetElementType:!1,dataElementType:`bar`,categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:`number`,properties:[`x`,`y`,`base`,`width`,`height`]}}};static overrides={scales:{_index_:{type:`category`,offset:!0,grid:{offset:!0}},_value_:{type:`linear`,beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return jl(e,t,n,r)}parseArrayData(e,t,n,r){return jl(e,t,n,r)}parseObjectData(e,t,n,r){let{iScale:i,vScale:a}=e,{xAxisKey:o=`x`,yAxisKey:s=`y`}=this._parsing,c=i.axis===`x`?o:s,l=a.axis===`x`?o:s,u=[],d,f,p,m;for(d=n,f=n+r;d<f;++d)m=t[d],p={},p[i.axis]=i.parse(To(m,c),d),u.push(Al(To(m,l),p,a,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);let i=n._custom;i&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,i.min),e.max=Math.max(e.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(e){let{iScale:t,vScale:n}=this._cachedMeta,r=this.getParsed(e),i=r._custom,a=Ml(i)?`[`+i.start+`, `+i.end+`]`:``+n.getLabelForValue(r[n.axis]);return{label:``+t.getLabelForValue(r[t.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){let t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){let i=r===`reset`,{index:a,_cachedMeta:{vScale:o}}=this,s=o.getBasePixel(),c=o.isHorizontal(),l=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let f=t;f<t+n;f++){let t=this.getParsed(f),n=i||I(t[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,l),m=(t._stacks||{})[o.axis],h={horizontal:c,base:n.base,enableBorderRadius:!m||Ml(t._custom)||a===m._top||a===m._bottom,x:c?n.head:p.center,y:c?p.center:n.head,height:c?p.size:Math.abs(n.size),width:c?Math.abs(n.size):p.size};d&&(h.options=u||this.resolveDataElementOptions(f,e[f].active?`active`:r));let g=h.options||e[f].options;Fl(h,g,m,a),zl(h,g,l.ratio),this.updateElement(e[f],f,h,r)}}_getStacks(e,t){let{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter(e=>e.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(I(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[z(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;i<a;++i)r.push(n.getPixelForValue(this.getParsed(i)[n.axis],i));let o=e.barThickness;return{min:o||El(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:o?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){let{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:i,minBarLength:a}}=this,o=i||0,s=this.getParsed(e),c=s._custom,l=Ml(c),u=s[t.axis],d=0,f=n?this.applyStack(t,s,n):u,p,m;f!==u&&(d=f-u,f=u),l&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Lo(u)!==Lo(c.barEnd)&&(d=0),d+=u);let h=!I(i)&&!l?i:d,g=t.getPixelForValue(h);if(p=this.chart.getDataVisibility(e)?t.getPixelForValue(d+f):g,m=p-g,Math.abs(m)<a){m=Nl(m,t,o)*a,u===o&&(g-=m/2);let e=t.getPixelForDecimal(0),i=t.getPixelForDecimal(1);g=Math.max(Math.min(g,Math.max(e,i)),Math.min(e,i)),p=g+m,n&&!l&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(p)-t.getValueForPixel(g))}if(g===t.getPixelForValue(o)){let e=Lo(m)*t.getLineWidthForValue(o)/2;g+=e,m-=e}return{size:m,base:g,head:p,center:p+m/2}}_calculateBarIndexPixels(e,t){let n=t.scale,r=this.options,i=r.skipNull,a=z(r.maxBarThickness,1/0),o,s,c=this._getAxisCount();if(t.grouped){let n=i?this._getStackCount(e):t.stackCount,l=r.barThickness===`flex`?Ol(e,t,r,n*c):Dl(e,t,r,n*c),u=this.chart.options.indexAxis===`x`?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(z(u,this.getFirstScaleIdForIndexAxis())),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?e:void 0)+d;o=l.start+l.chunk*f+l.chunk/2,s=Math.min(a,l.chunk*l.ratio)}else o=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(a,t.min*t.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}}draw(){let e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length,i=0;for(;i<r;++i)this.getParsed(i)[t.axis]!==null&&!n[i].hidden&&n[i].draw(this._ctx)}};function Vl(e,t,n){let r=1,i=1,a=0,o=0;if(t<H){let s=e,c=s+t,l=Math.cos(s),u=Math.sin(s),d=Math.cos(c),f=Math.sin(c),p=(e,t,r)=>Yo(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>Yo(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(No,u,f),_=m(V,l,d),v=m(V+No,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var Hl=class extends wl{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,spacingMode:`angular`,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`&&e!==`spacingMode`,_indexable:e=>e!==`spacing`&&e!==`spacingMode`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(R(n[e])){let{key:e=`value`}=this._parsing;i=t=>+To(n[t],e)}let a,o;for(a=e,o=e+t;a<o;++a)r._parsed[a]=i(a)}}_getRotation(){return Uo(this.options.rotation-90)}_getCircumference(){return Uo(this.options.circumference)}_getRotationExtents(){let e=H,t=-H;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let r=this.chart.getDatasetMeta(n).controller,i=r._getRotation(),a=r._getCircumference();e=Math.min(e,i),t=Math.max(t,i+a)}return{rotation:e,circumference:t-e}}update(e){let{chartArea:t}=this.chart,n=this._cachedMeta,r=n.data,i=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(t.width,t.height)-i)/2,0),o=Math.min(fo(this.options.cutout,a),1),s=this._getRingWeight(this.index),{circumference:c,rotation:l}=this._getRotationExtents(),{ratioX:u,ratioY:d,offsetX:f,offsetY:p}=Vl(l,c,o),m=(t.width-i)/u,h=(t.height-i)/d,g=Math.max(Math.min(m,h)/2,0),_=po(this.options.radius,g),v=(_-Math.max(_*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*_,this.offsetY=p*_,n.total=this.calculateTotal(),this.outerRadius=_-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*s,0),this.updateElements(r,0,r.length,e)}_circumference(e,t){let n=this.options,r=this._cachedMeta,i=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*i/H)}updateElements(e,t,n,r){let i=r===`reset`,a=this.chart,o=a.chartArea,s=a.options.animation,c=(o.left+o.right)/2,l=(o.top+o.bottom)/2,u=i&&s.animateScale,d=u?0:this.innerRadius,f=u?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,r),h=this._getRotation(),g=0;for(;g<t;++g)h+=this._circumference(g,i);for(g=t;g<t+n;++g){let t=this._circumference(g,i),n=e[g],a={x:c+this.offsetX,y:l+this.offsetY,startAngle:h,endAngle:h+t,circumference:t,outerRadius:f,innerRadius:d};m&&(a.options=p||this.resolveDataElementOptions(g,n.active?`active`:r)),h+=t,this.updateElement(n,g,a,r)}}calculateTotal(){let e=this._cachedMeta,t=e.data,n=0,r=0;for(;r<t.length;r++){let i=e._parsed[r];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(r)&&!t[r].hidden&&(n+=Math.abs(i))}return n}calculateCircumference(e){let t=this._cachedMeta.total;return t>0&&!isNaN(e)?Math.abs(e)/t*H:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Es(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r<i;++r)if(n.isDatasetVisible(r)){a=n.getDatasetMeta(r),e=a.data,o=a.controller;break}}if(!e)return 0;for(r=0,i=e.length;r<i;++r)s=o.resolveDataElementOptions(r),s.borderAlign!==`inner`&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){let e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(z(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};function Ul(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var Wl={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return Ul()}parse(){return Ul()}format(){return Ul()}add(){return Ul()}diff(){return Ul()}startOf(){return Ul()}endOf(){return Ul()}}};function Gl(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?ts:es;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!I(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!I(e[t.axis]));r.hi+=Math.max(0,o)}return r}if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Kl(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e<n;++e){let{index:n,data:s}=a[e],{lo:c,hi:l}=Gl(a[e],t,o,i);for(let e=c;e<=l;++e){let t=s[e];t.skip||r(t,n,e)}}}function ql(e){let t=e.indexOf(`x`)!==-1,n=e.indexOf(`y`)!==-1;return function(e,r){let i=t?Math.abs(e.x-r.x):0,a=n?Math.abs(e.y-r.y):0;return Math.sqrt(i**2+a**2)}}function Jl(e,t,n,r,i){let a=[];return!i&&!e.isPointInArea(t)||Kl(e,n,t,function(n,o,s){(i||Us(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&a.push({element:n,datasetIndex:o,index:s})},!0),a}function Yl(e,t,n,r){let i=[];function a(e,n,a){let{startAngle:o,endAngle:s}=e.getProps([`startAngle`,`endAngle`],r),{angle:c}=Ko(e,{x:t.x,y:t.y});Yo(c,o,s)&&i.push({element:e,datasetIndex:n,index:a})}return Kl(e,n,t,a),i}function Xl(e,t,n,r,i,a){let o=[],s=ql(n),c=1/0;function l(n,l,u){let d=n.inRange(t.x,t.y,i);if(r&&!d)return;let f=n.getCenterPoint(i);if(!(a||e.isPointInArea(f))&&!d)return;let p=s(t,f);p<c?(o=[{element:n,datasetIndex:l,index:u}],c=p):p===c&&o.push({element:n,datasetIndex:l,index:u})}return Kl(e,n,t,l),o}function Zl(e,t,n,r,i,a){return!a&&!e.isPointInArea(t)?[]:n===`r`&&!r?Yl(e,t,n,i):Xl(e,t,n,r,i,a)}function Ql(e,t,n,r,i){let a=[],o=n===`x`?`inXRange`:`inYRange`,s=!1;return Kl(e,n,t,(e,r,c)=>{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var $l={evaluateInteractionItems:Kl,modes:{index(e,t,n,r){let i=Lc(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Jl(e,i,a,r,o):Zl(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=Lc(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Jl(e,i,a,r,o):Zl(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point(e,t,n,r){return Jl(e,Lc(t,e),n.axis||`xy`,r,n.includeInvisible||!1)},nearest(e,t,n,r){let i=Lc(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1;return Zl(e,i,a,n.intersect,r,o)},x(e,t,n,r){return Ql(e,Lc(t,e),`x`,n.intersect,r)},y(e,t,n,r){return Ql(e,Lc(t,e),`y`,n.intersect,r)}}},eu=[`left`,`top`,`right`,`bottom`];function tu(e,t){return e.filter(e=>e.pos===t)}function nu(e,t){return e.filter(e=>eu.indexOf(e.pos)===-1&&e.box.axis===t)}function ru(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function iu(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:a,options:{stack:o,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&a+o,stackWeight:s});return t}function G(e){let t={};for(let n of e){let{stack:e,pos:r,stackWeight:i}=n;if(!e||!eu.includes(r))continue;let a=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function au(e,t){let n=G(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t,a,o,s;for(a=0,o=e.length;a<o;++a){s=e[a];let{fullSize:o}=s.box,c=n[s.stack],l=c&&s.stackWeight/c.weight;s.horizontal?(s.width=l?l*r:o&&t.availableWidth,s.height=i):(s.width=r,s.height=l?l*i:o&&t.availableHeight)}return n}function ou(e){let t=iu(e),n=ru(t.filter(e=>e.box.fullSize),!0),r=ru(tu(t,`left`),!0),i=ru(tu(t,`right`)),a=ru(tu(t,`top`),!0),o=ru(tu(t,`bottom`)),s=nu(t,`x`),c=nu(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:tu(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function su(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function cu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function lu(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!R(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&cu(o,a.getPadding());let s=Math.max(0,t.outerWidth-su(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-su(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function uu(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function du(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function fu(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a<o;++a){s=e[a],c=s.box,c.update(s.width||t.w,s.height||t.h,du(s.horizontal,t));let{same:o,other:d}=lu(t,n,s,r);l|=o&&i.length,u||=d,c.fullSize||i.push(s)}return l&&fu(i,t,n,r)||u}function pu(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function mu(e,t,n,r){let i=n.padding,{x:a,y:o}=t;for(let s of e){let e=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/c.weight||1;if(s.horizontal){let r=t.w*l,a=c.size||e.height;Do(c.start)&&(o=c.start),e.fullSize?pu(e,i.left,o,n.outerWidth-i.right-i.left,a):pu(e,t.left+c.placed,o,r,a),c.start=o,c.placed+=r,o=e.bottom}else{let r=t.h*l,o=c.size||e.width;Do(c.start)&&(a=c.start),e.fullSize?pu(e,a,i.top,o,n.outerHeight-i.bottom-i.top):pu(e,a,t.top+c.placed,o,r),c.start=a,c.placed+=r,a=e.right}}t.x=a,t.y=o}var hu={addBox(e,t){e.boxes||=[],t.fullSize=t.fullSize||!1,t.position=t.position||`top`,t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;let i=ic(e.options.layout.padding),a=Math.max(t-i.width,0),o=Math.max(n-i.height,0),s=ou(e.boxes),c=s.vertical,l=s.horizontal;B(e.boxes,e=>{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);cu(f,ic(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=au(c.concat(l),d);fu(s.fullSize,p,d,m),fu(c,p,d,m),fu(l,p,d,m)&&fu(c,p,d,m),uu(p),mu(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,mu(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},B(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},gu=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},_u=class extends gu{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},vu=`$chartjs`,yu={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},bu=e=>e===null||e===``;function xu(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[vu]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,bu(i)){let t=Uc(e,`width`);t!==void 0&&(e.width=t)}if(bu(r)){if(e.style.height===``)e.height=e.width/(t||2);else{let t=Uc(e,`height`);t!==void 0&&(e.height=t)}}return e}var Su=Hc?{passive:!0}:!1;function Cu(e,t,n){e&&e.addEventListener(t,n,Su)}function wu(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Su)}function Tu(e,t){let n=yu[e.type]||e.type,{x:r,y:i}=Lc(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function Eu(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function Du(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Eu(n.addedNodes,r),t&&=!Eu(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Ou(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=Eu(n.removedNodes,r),t&&=!Eu(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var ku=new Map,Au=0;function ju(){let e=window.devicePixelRatio;e!==Au&&(Au=e,ku.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Mu(e,t){ku.size||window.addEventListener(`resize`,ju),ku.set(e,t)}function Nu(e){ku.delete(e),ku.size||window.removeEventListener(`resize`,ju)}function Pu(e,t,n){let r=e.canvas,i=r&&kc(r);if(!i)return;let a=cs((e,t)=>{let r=i.clientWidth;n(e,t),r<i.clientWidth&&n()},window),o=new ResizeObserver(e=>{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;(n!==0||r!==0)&&a(n,r)});return o.observe(i),Mu(e,a),o}function Fu(e,t,n){n&&n.disconnect(),t===`resize`&&Nu(e)}function Iu(e,t,n){let r=e.canvas,i=cs(t=>{e.ctx!==null&&n(Tu(t,e))},e);return Cu(r,t,i),i}var Lu=class extends gu{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(xu(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[vu])return!1;let n=t[vu].initial;[`height`,`width`].forEach(e=>{let r=n[e];I(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[vu],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:Du,detach:Ou,resize:Pu}[t]||Iu)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:Fu,detach:Fu,resize:Fu}[t]||wu)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Bc(e,t,n,r)}isAttached(e){let t=e&&kc(e);return!!(t&&t.isConnected)}};function Ru(e){return!Oc()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?_u:Lu}var zu=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return W(this.x)&&W(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function Bu(e,t){let n=e.options.ticks,r=Vu(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?Uu(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return Wu(t,l,a,o/i),l;let u=Hu(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(Gu(t,l,u,I(r)?0:s-r,s),e=0,n=o-1;e<n;e++)Gu(t,l,u,a[e],a[e+1]);return Gu(t,l,u,c,I(r)?t.length:c+r),l}return Gu(t,l,u),l}function Vu(e){let t=e.options.offset,n=e._tickSize(),r=e._length/n+ +!t,i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Hu(e,t,n){let r=Ku(e),i=t.length/n;if(!r)return Math.max(i,1);let a=Bo(r);for(let e=0,t=a.length-1;e<t;e++){let t=a[e];if(t>i)return t}return Math.max(i,1)}function Uu(e){let t=[],n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Wu(e,t,n,r){let i=0,a=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}function Gu(e,t,n,r,i){let a=z(r,0),o=Math.min(z(i,e.length),e.length),s=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-r,n=c/Math.floor(c/n)),u=a;u<0;)s++,u=Math.round(a+s*n);for(l=Math.max(a,0);l<o;l++)l===u&&(t.push(e[l]),s++,u=Math.round(a+s*n))}function Ku(e){let t=e.length,n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}var qu=e=>e===`left`?`right`:e===`right`?`left`:e,Ju=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Yu=(e,t)=>Math.min(t||e,e);function Xu(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;a<i;a+=r)n.push(e[Math.floor(a)]);return n}function Zu(e,t,n){let r=e.ticks.length,i=Math.min(t,r-1),a=e._startPixel,o=e._endPixel,s=1e-6,c=e.getPixelForTick(i),l;if(!(n&&(l=r===1?Math.max(c-a,o-c):t===0?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<a-s||c>o+s)))return c}function Qu(e,t){B(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;i<r;++i)delete e.data[n[i]];n.splice(0,r)}})}function $u(e){return e.drawTicks?e.tickLength:0}function K(e,t){if(!e.display)return 0;let n=ac(e.font,t),r=ic(e.padding);return(L(e.text)?e.text.length:1)*n.lineHeight+r.height}function ed(e,t){return cc(e,{scale:t,type:`scale`})}function q(e,t,n){return cc(e,{tick:n,index:t,type:`tick`})}function J(e,t,n){let r=us(e);return(n&&t!==`right`||!n&&t===`right`)&&(r=qu(r)),r}function Y(e,t,n,r){let{top:i,left:a,bottom:o,right:s,chart:c}=e,{chartArea:l,scales:u}=c,d=0,f,p,m,h=o-i,g=s-a;if(e.isHorizontal()){if(p=ds(r,a,s),R(n)){let e=Object.keys(n)[0],r=n[e];m=u[e].getPixelForValue(r)+h-t}else m=n===`center`?(l.bottom+l.top)/2+h-t:Ju(e,n,t);f=s-a}else{if(R(n)){let e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)-g+t}else p=n===`center`?(l.left+l.right)/2-g+t:Ju(e,n,t);m=ds(r,o,i),d=n===`left`?-No:No}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}var td=class e extends zu{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=uo(e,1/0),t=uo(t,-1/0),n=uo(n,1/0),r=uo(r,-1/0),{min:uo(e,n),max:uo(t,r),minDefined:lo(e),maxDefined:lo(t)}}getMinMax(e){let{min:t,max:n,minDefined:r,maxDefined:i}=this.getUserBounds(),a;if(r&&i)return{min:t,max:n};let o=this.getMatchingVisibleMetas();for(let s=0,c=o.length;s<c;++s)a=o[s].controller.getMinMax(this,e),r||(t=Math.min(t,a.min)),i||(n=Math.max(n,a.max));return t=i&&t>n?n:t,n=r&&t>n?t:n,{min:uo(t,uo(n,t)),max:uo(n,uo(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){mo(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=sc(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o<this.ticks.length;this._convertTicksToLabels(s?Xu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source===`auto`)&&(this.ticks=Bu(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){mo(this.options.afterUpdate,[this])}beforeSetDimensions(){mo(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){mo(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),mo(this.options[e],[this])}beforeDataLimits(){this._callHooks(`beforeDataLimits`)}determineDataLimits(){}afterDataLimits(){this._callHooks(`afterDataLimits`)}beforeBuildTicks(){this._callHooks(`beforeBuildTicks`)}buildTicks(){return[]}afterBuildTicks(){this._callHooks(`afterBuildTicks`)}beforeTickToLabelConversion(){mo(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,n,r,i;for(n=0,r=e.length;n<r;n++)i=e[n],i.label=mo(t.callback,[i.value,n,e],this)}afterTickToLabelConversion(){mo(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){mo(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,n=Yu(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,i=t.maxRotation,a=r,o,s,c;if(!this._isVisible()||!t.display||r>=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=Xo(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-$u(e.grid)-t.padding-K(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=Wo(Math.min(Math.asin(Xo((l.highest.height+6)/o,-1,1)),Math.asin(Xo(s/c,-1,1))-Math.asin(Xo(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){mo(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){mo(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=K(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=$u(i)+a):(e.height=this.maxHeight,e.width=$u(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=Uo(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){mo(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)I(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=Xu(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){let{ctx:r,_longestTextCache:i}=this,a=[],o=[],s=Math.floor(t/Yu(t,n)),c=0,l=0,u,d,f,p,m,h,g,_,v,y,b;for(u=0;u<t;u+=s){if(p=e[u].label,m=this._resolveTickFontOptions(u),r.font=h=m.string,g=i[h]=i[h]||{data:{},gc:[]},_=m.lineHeight,v=y=0,!I(p)&&!L(p))v=Ls(r,g.data,g.gc,v,p),y=_;else if(L(p))for(d=0,f=p.length;d<f;++d)b=p[d],!I(b)&&!L(b)&&(v=Ls(r,g.data,g.gc,v,b),y+=_);a.push(v),o.push(y),c=Math.max(v,c),l=Math.max(y,l)}Qu(i,t);let x=a.indexOf(c),S=o.indexOf(l),C=e=>({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return Zo(this._alignToPixels?zs(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let n=t[e];return n.$context||=q(this.getContext(),e,n)}return this.$context||=ed(this.chart.getContext(),this)}_tickSize(){let e=this.options.ticks,t=Uo(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),i=this._getLabelSizes(),a=e.autoSkipPadding||0,o=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return this.isHorizontal()?s*n>o*r?o/n:s/r:s*r<o*n?s/n:o/r}_isVisible(){let e=this.options.display;return e===`auto`?this.getMatchingVisibleMetas().length>0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+ +!!s,u=$u(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return zs(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(R(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(R(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=z(r.ticks.maxTicksLimit,l),te=Math.max(1,Math.ceil(l/ee));for(_=0;_<l;_+=te){let e=this.getContext(_),t=i.setContext(e),r=o.setContext(e),a=t.lineWidth,l=t.color,u=r.dash||[],f=r.dashOffset,p=t.tickWidth,m=t.tickColor,h=t.tickBorderDash||[],g=t.tickBorderDashOffset;v=Zu(this,_,s),v!==void 0&&(y=zs(n,v,a),c?b=S=w=E=y:x=C=T=D=y,d.push({tx1:b,ty1:x,tx2:S,ty2:C,x1:w,y1:T,x2:E,y2:D,width:a,color:l,borderDash:u,borderDashOffset:f,tickWidth:p,tickColor:m,tickBorderDash:h,tickBorderDashOffset:g}))}return this._ticksLength=l,this._borderValue=g,d}_computeLabelItems(e){let t=this.axis,n=this.options,{position:r,ticks:i}=n,a=this.isHorizontal(),o=this.ticks,{align:s,crossAlign:c,padding:l,mirror:u}=i,d=$u(n.grid),f=d+l,p=u?-l:f,m=-Uo(this.labelRotation),h=[],g,_,v,y,b,x,S,C,w,T,E,D,ee=`middle`;if(r===`top`)x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(r===`bottom`)x=this.top+p,S=this._getXAxisLabelAlignment();else if(r===`left`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(r===`right`){let e=this._getYAxisLabelAlignment(d);S=e.textAlign,b=e.x}else if(t===`x`){if(r===`center`)x=(e.top+e.bottom)/2+f;else if(R(r)){let e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+f}S=this._getXAxisLabelAlignment()}else if(t===`y`){if(r===`center`)b=(e.left+e.right)/2-f;else if(R(r)){let e=Object.keys(r)[0],t=r[e];b=this.chart.scales[e].getPixelForValue(t)}S=this._getYAxisLabelAlignment(d).textAlign}t===`y`&&(s===`start`?ee=`top`:s===`end`&&(ee=`bottom`));let te=this._getLabelSizes();for(g=0,_=o.length;g<_;++g){v=o[g],y=v.label;let e=i.setContext(this.getContext(g));C=this.getPixelForTick(g)+i.labelOffset,w=this._resolveTickFontOptions(g),T=w.lineHeight,E=L(y)?y.length:1;let t=E/2,n=e.color,s=e.textStrokeColor,l=e.textStrokeWidth,d=S;a?(b=C,S===`inner`&&(d=g===_-1?this.options.reverse?`left`:`right`:g===0?this.options.reverse?`right`:`left`:`center`),D=r===`top`?c===`near`||m!==0?-E*T+T/2:c===`center`?-te.highest.height/2-t*T+T:-te.highest.height+T/2:c===`near`||m!==0?T/2:c===`center`?te.highest.height/2-t*T:te.highest.height-E*T,u&&(D*=-1),m!==0&&!e.showLabelBackdrop&&(b+=T/2*Math.sin(m))):(x=C,D=(1-E)*T/2);let f;if(e.showLabelBackdrop){let t=ic(e.backdropPadding),n=te.heights[g],r=te.widths[g],i=D-t.top,a=0-t.left;switch(ee){case`middle`:i-=n/2;break;case`bottom`:i-=n}switch(S){case`center`:a-=r/2;break;case`right`:a-=r;break;case`inner`:g===_-1?a-=r:g>0&&(a-=r/2)}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-Uo(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i<a;++i){let e=r[i];t.drawOnChartArea&&o({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&o({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){let{chart:e,ctx:t,options:{border:n,grid:r}}=this,i=n.setContext(this.getContext()),a=n.display?i.width:0;if(!a)return;let o=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue,c,l,u,d;this.isHorizontal()?(c=zs(e,this.left,a)-a/2,l=zs(e,this.right,o)+o/2,u=d=s):(u=zs(e,this.top,a)-a/2,d=zs(e,this.bottom,o)+o/2,c=l=s),t.save(),t.lineWidth=i.width,t.strokeStyle=i.color,t.beginPath(),t.moveTo(c,u),t.lineTo(l,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let t=this.ctx,n=this._computeLabelArea();n&&Ws(t,n);let r=this.getLabelItems(e);for(let e of r){let n=e.options,r=e.font,i=e.label,a=e.textOffset;Ys(t,i,0,a,r,n)}n&&Gs(t)}drawTitle(){let{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;let i=ac(n.font),a=ic(n.padding),o=n.align,s=i.lineHeight/2;t===`bottom`||t===`center`||R(t)?(s+=a.bottom,L(n.text)&&(s+=i.lineHeight*(n.text.length-1))):s+=a.top;let{titleX:c,titleY:l,maxWidth:u,rotation:d}=Y(this,s,t,o);Ys(e,n.text,0,0,i,{color:n.color,maxWidth:u,rotation:d,textAlign:J(o,t,r),textBaseline:`middle`,translation:[c,l],strokeColor:n.strokeColor,strokeWidth:n.strokeWidth})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,r=z(t.grid&&t.grid.z,-1),i=z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:e=>{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i<a;++i){let a=t[i];a[n]!==this.id||e&&a.type!==e||r.push(a)}return r}_resolveTickFontOptions(e){return ac(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},nd=class{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),n;ad(t)&&(n=this.register(t));let r=this.items,i=e.id,a=this.scope+`.`+i;if(!i)throw Error(`class does not have id: `+e);return i in r||(r[i]=e,rd(e,a,n),this.override&&Fs.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){let t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in Fs[r]&&(delete Fs[r][n],this.override&&delete js[n])}};function rd(e,t,n){let r=yo(Object.create(null),[n?Fs.get(n):{},Fs.get(t),e.defaults]);Fs.set(t,r),e.defaultRoutes&&id(t,e.defaultRoutes),e.descriptors&&Fs.describe(t,e.descriptors)}function id(e,t){Object.keys(t).forEach(n=>{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);Fs.route(a,i,c,s)})}function ad(e){return`id`in e&&`defaults`in e}var X=new class{constructor(){this.controllers=new nd(wl,`datasets`,!0),this.elements=new nd(zu,`elements`),this.plugins=new nd(Object,`plugins`),this.scales=new nd(td,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):B(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=Eo(e);mo(n[`before`+r],[],n),t[e](n),mo(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){let r=t.get(e);if(r===void 0)throw Error(`"`+e+`" is not a registered `+n+`.`);return r}},od=class{constructor(){this._init=void 0}notify(e,t,n,r){if(t===`beforeInit`&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,`install`)),this._init===void 0)return;let i=r?this._descriptors(e).filter(r):this._descriptors(e),a=this._notify(i,e,t,n);return t===`afterDestroy`&&(this._notify(i,e,`stop`),this._notify(this._init,e,`uninstall`),this._init=void 0),a}_notify(e,t,n,r){r||={};for(let i of e){let e=i.plugin,a=e[n];if(mo(a,[t,r,i.options],e)===!1&&r.cancelable)return!1}return!0}invalidate(){I(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let n=e&&e.config,r=z(n.options&&n.options.plugins,{}),i=sd(n);return r===!1&&!t?[]:ld(e,i,r,t)}_notifyStateChanges(e){let t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function sd(e){let t={},n=[],r=Object.keys(X.plugins.items);for(let e=0;e<r.length;e++)n.push(X.getPlugin(r[e]));let i=e.plugins||[];for(let e=0;e<i.length;e++){let r=i[e];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function cd(e,t){return!t&&e===!1?null:e===!0?{}:e}function ld(e,{plugins:t,localIds:n},r,i){let a=[],o=e.getContext();for(let s of t){let t=s.id,c=cd(r[t],i);c!==null&&a.push({plugin:s,options:ud(e.config,{plugin:s,local:n[t]},c,o)})}return a}function ud(e,{plugin:t,local:n},r,i){let a=e.pluginScopeKeys(t),o=e.getOptionScopes(r,a);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[``],{scriptable:!1,indexable:!1,allKeys:!0})}function dd(e,t){let n=Fs.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||`x`}function fd(e,t){let n=e;return e===`_index_`?n=t:e===`_value_`&&(n=t===`x`?`y`:`x`),n}function pd(e,t){return e===t?`_index_`:`_value_`}function md(e){if(e===`x`||e===`y`||e===`r`)return e}function hd(e){if(e===`top`||e===`bottom`)return`x`;if(e===`left`||e===`right`)return`y`}function gd(e,...t){if(md(e))return e;for(let n of t){let t=n.axis||hd(n.position)||e.length>1&&md(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function _d(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function vd(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return _d(e,`x`,n[0])||_d(e,`y`,n[0])}return{}}function yd(e,t){let n=js[e.type]||{scales:{}},r=t.scales||{},i=dd(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!R(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=gd(t,o,vd(t,e),Fs.scales[o.type]),c=pd(s,i),l=n.scales||{};a[t]=bo(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||dd(i,t),s=(js[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=fd(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),bo(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];bo(t,[Fs.scales[t.type],Fs.scale])}),a}function bd(e){let t=e.options||={};t.plugins=z(t.plugins,{}),t.scales=yd(e,t)}function xd(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Sd(e){return e||={},e.data=xd(e.data),bd(e),e}var Cd=new Map,wd=new Set;function Td(e,t){let n=Cd.get(e);return n||(n=t(),Cd.set(e,n),wd.add(n)),n}var Ed=(e,t,n)=>{let r=To(t,n);r!==void 0&&e.add(r)},Dd=class{constructor(e){this._config=Sd(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=xd(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),bd(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Td(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return Td(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return Td(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return Td(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>Ed(s,e,t))),t.forEach(e=>Ed(s,r,e)),t.forEach(e=>Ed(s,js[i]||{},e)),t.forEach(e=>Ed(s,Fs,e)),t.forEach(e=>Ed(s,Ms,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),wd.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,js[t]||{},Fs.datasets[t]||{},{type:t},Fs,Ms]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=Od(this._resolverCache,e,r),s=a;if(Ad(a,t)){i.$shared=!1,n=Oo(n)?n():n;let t=this.createResolver(e,n,o);s=uc(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=Od(this._resolverCache,e,n);return R(t)?uc(i,t,void 0,r):i}};function Od(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:lc(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var kd=e=>R(e)&&Object.getOwnPropertyNames(e).some(t=>Oo(e[t]));function Ad(e,t){let{isScriptable:n,isIndexable:r}=dc(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Oo(o)||kd(o))||a&&L(o))return!0}return!1}var jd=`4.6.1`,Md=[`top`,`bottom`,`left`,`right`,`chartArea`];function Nd(e,t){return e===`top`||e===`bottom`||Md.indexOf(e)===-1&&t===`x`}function Pd(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Fd(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),mo(n&&n.onComplete,[e],t)}function Id(e){let t=e.chart,n=t.options.animation;mo(n&&n.onProgress,[e],t)}function Ld(e){return Oc()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Rd={},zd=e=>{let t=Ld(e);return Object.values(Rd).filter(e=>e.canvas===t).pop()};function Bd(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Vd(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var Hd=class{static defaults=Fs;static instances=Rd;static overrides=js;static registry=X;static version=jd;static getChart=zd;static register(...e){X.add(...e),Ud()}static unregister(...e){X.remove(...e),Ud()}constructor(e,t){let n=this.config=new Dd(t),r=Ld(e),i=zd(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(Ru(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;this.id=co(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new od,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ls(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],Rd[this.id]=this,!o||!s?console.error(`Failed to create chart: can't acquire context from the given item`):(Qc.listen(this,`complete`,Fd),Qc.listen(this,`progress`,Id),this._initialize(),this.attached&&this.update())}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return I(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return X}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():Vc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Bs(this.canvas,this.ctx),this}stop(){return Qc.stop(this),this}resize(e,t){Qc.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Vc(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),mo(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){B(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=gd(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),B(i,t=>{let i=t.options,a=i.id,o=gd(a,i),s=z(i.type,t.dtype);(i.position===void 0||Nd(i.position,o)!==Nd(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(X.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),B(r,(e,t)=>{e||delete n[t]}),B(n,e=>{hu.configure(this,e,e.options),hu.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(Pd(`order`,`index`))}_removeUnreferencedMetasets(){let{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){let r=t[n],i=this.getDatasetMeta(n),a=r.type||this.config.type;if(i.type&&i.type!==a&&(this._destroyDatasetMeta(n),i=this.getDatasetMeta(n)),i.type=a,i.indexAxis=r.indexAxis||dd(a,this.options),i.order=r.order||0,i.index=n,i.label=``+r.label,i.visible=this.isDatasetVisible(n),i.controller)i.controller.updateIndex(n),i.controller.linkScales();else{let t=X.getController(a),{datasetElementType:r,dataElementType:o}=Fs.datasets[a];Object.assign(t,{dataElementType:X.getElement(o),datasetElementType:r&&X.getElement(r)}),i.controller=new t(this,n),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){B(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e<t;e++){let{controller:t}=this.getDatasetMeta(e),n=!r&&i.indexOf(t)===-1;t.buildOrUpdateElements(n),a=Math.max(+t.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),r||B(i,e=>{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(Pd(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){B(this.scales,e=>{hu.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;ko(new Set(Object.keys(this._listeners)),new Set(e.events))&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)Bd(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;e<t;e++)if(!ko(r,n(e)))return;return Array.from(r).map(e=>e.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;hu.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],B(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Oo(e)?e({datasetIndex:t}):e);this.notifyPlugins(`afterDatasetsUpdate`,{mode:e})}}_updateDataset(e,t){let n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins(`beforeDatasetUpdate`,r)!==!1&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins(`afterDatasetUpdate`,r))}render(){this.notifyPlugins(`beforeRender`,{cancelable:!0})!==!1&&(Qc.has(this)?this.attached&&!Qc.running(this)&&Qc.start(this):(this.draw(),Fd({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){let{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins(`beforeDraw`,{cancelable:!0})===!1)return;let t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins(`afterDraw`)}_getSortedDatasetMetas(e){let t=this._sortedMetasets,n=[],r,i;for(r=0,i=t.length;r<i;++r){let i=t[r];(!e||i.visible)&&n.push(i)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins(`beforeDatasetsDraw`,{cancelable:!0})===!1)return;let e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Zc(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&Ws(t,r),e.controller.draw(),r&&Gs(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return Us(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=$l.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=cc(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Do(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Qc.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins(`beforeDestroy`);let{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Bs(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Rd[this.id],this.notifyPlugins(`afterDestroy`)}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};B(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){B(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},B(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o<s;++o){a=e[o];let t=a&&this.getDatasetMeta(a.datasetIndex).controller;t&&t[r+`HoverStyle`](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){let t=this._active||[],n=e.map(({datasetIndex:e,index:t})=>{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});ho(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Ao(e),c=Vd(e,this._lastEvent,n,s);n&&(this._lastEvent=null,mo(i.onHover,[e,o,this],this),s&&mo(i.onClick,[e,o,this],this));let l=!ho(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function Ud(){return B(Hd.instances,e=>e._plugins.invalidate())}function Wd(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,Jo(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,Jo(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*Jo(r-n));if(u===`round`)e.arc(i,a,t,n-V/2,r+V/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+V/2)+i,c=-o*Math.sin(n+V/2)+a,l=o*Math.cos(r+V/2)+i,u=o*Math.sin(r+V/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Gd(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+No,r-No),e.closePath(),e.clip()}function Kd(e){return tc(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function qd(e,t,n,r){let i=Kd(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return Xo(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:Xo(i.innerStart,0,o),innerEnd:Xo(i.innerEnd,0,o)}}function Jd(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Yd(e,t,n,r){let{x:i,y:a,startAngle:o,pixelMargin:s,innerRadius:c}=t,l=Math.max(t.outerRadius+r+n-s,0),u=c>0?c+r+n+s:0;e.beginPath(),e.arc(i,a,l,o,o+H),u>0&&(e.moveTo(i+Math.cos(o)*u,a+Math.sin(o)*u),e.arc(i,a,u,o+H,o,!0)),e.closePath()}function Xd(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,{spacingMode:d=`angular`}=t.options,f=i-c;if(a&&t.options.selfJoin&&Math.abs(f)>=H-1e-4){Yd(e,t,n,r);return}let p=Math.max(t.outerRadius+r+n-l,0),m=u>0?u+r+n+l:0,h=0,g=0,_=p>0?Math.max(.001,f*p-n/V)/p:.001,v=(f-_)/2;if(r){let e=((u>0?u-r:0)+(p>0?p-r:0))/2,t=(()=>{let t=e===0?f:f*e/(e+r);return(f-t)/2})(),n=e>0?Math.asin(Math.min(1,r/e)):0,i=Math.max(0,_/2-.001),a=Math.sin(i);if(d===`parallel`){if(m===0&&a>0){let e=r/a,t=Math.max(0,p-.001);m=Math.min(e,t)}let e=Math.min(p>0?p*a:1/0,m>0?m*a:1/0),t=Math.min(r,e);h=p>0?Math.asin(Math.min(1,t/p)):Math.min(i,n),g=m>0?Math.asin(Math.min(1,t/m)):h}else d===`proportional`?(h=Math.min(i,t),g=Math.min(i,t)):(h=Math.min(i,n),g=Math.min(i,n))}let y=c+v+h,b=i-v-h,x=c+v+g,S=i-v-g,C=Math.min(b-y,S-x),{outerStart:w,outerEnd:T,innerStart:E,innerEnd:D}=qd(t,m,p,C),ee=p-w,te=p-T,ne=y+w/ee,re=b-T/te,ie=m+E,ae=m+D,oe=x+E/ie,se=S-D/ae;if(e.beginPath(),a){let t=(ne+re)/2;if(e.arc(o,s,p,ne,t),e.arc(o,s,p,t,re),T>0){let t=Jd(te,re,o,s);e.arc(t.x,t.y,T,re,b+No)}let n=Jd(ae,S,o,s);if(e.lineTo(n.x,n.y),D>0){let t=Jd(ae,se,o,s);e.arc(t.x,t.y,D,S+No,se+Math.PI)}let r=(S-D/m+(x+E/m))/2;if(e.arc(o,s,m,S-D/m,r,!0),e.arc(o,s,m,r,x+E/m,!0),E>0){let t=Jd(ie,oe,o,s);e.arc(t.x,t.y,E,oe+Math.PI,x-No)}let i=Jd(ee,y,o,s);if(e.lineTo(i.x,i.y),w>0){let t=Jd(ee,ne,o,s);e.arc(t.x,t.y,w,y-No,ne)}}else{e.moveTo(o,s);let t=Math.cos(ne)*p+o,n=Math.sin(ne)*p+s;e.lineTo(t,n);let r=Math.cos(re)*p+o,i=Math.sin(re)*p+s;e.lineTo(r,i)}e.closePath()}function Zd(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){Xd(e,t,n,r,c,i);for(let t=0;t<a;++t)e.fill();isNaN(s)||(c=o+(s%H||H))}return Xd(e,t,n,r,c,i),e.fill(),c}function Qd(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=c,m=c.borderAlign===`inner`;if(!l)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=l*2,e.lineJoin=u||`round`):(e.lineWidth=l,e.lineJoin=u||`bevel`);let h=t.endAngle,g=Math.abs(h-o)>=H-1e-4;if(a){Xd(e,t,n,r,h,i);for(let t=0;t<a;++t)e.stroke();isNaN(s)||(h=o+(s%H||H))}m&&Gd(e,t,h),!(g&&t.innerRadius>0)&&c.selfJoin&&h-o>=V&&p===0&&u!==`miter`&&Wd(e,t,h),a||(Xd(e,t,n,r,h,i),e.stroke())}var $d=class extends zu{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,spacingMode:`angular`,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;circular;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,this.circular=!1,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=Ko(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=z(l,o-a),f=Yo(r,a,o)&&a!==o,p=d>=H||f,m=Qo(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>H?Math.floor(n/H):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(V,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Zd(e,this,s,i,a),Qd(e,this,s,i,a),e.restore()}};function ef(e,t){let{x:n,y:r,base:i,width:a,height:o}=e.getProps([`x`,`y`,`base`,`width`,`height`],t),s,c,l,u,d;return e.horizontal?(d=o/2,s=Math.min(n,i),c=Math.max(n,i),l=r-d,u=r+d):(d=a/2,s=n-d,c=n+d,l=Math.min(r,i),u=Math.max(r,i)),{left:s,top:l,right:c,bottom:u}}function tf(e,t,n,r){return e?0:Xo(t,n,r)}function nf(e,t,n){let r=e.options.borderWidth,i=e.borderSkipped,a=nc(r);return{t:tf(i.top,a.top,0,n),r:tf(i.right,a.right,0,t),b:tf(i.bottom,a.bottom,0,n),l:tf(i.left,a.left,0,t)}}function rf(e,t,n){let{enableBorderRadius:r}=e.getProps([`enableBorderRadius`]),i=e.options.borderRadius,a=rc(i),o=Math.min(t,n),s=e.borderSkipped,c=r||R(i);return{topLeft:tf(!c||s.top||s.left,a.topLeft,0,o),topRight:tf(!c||s.top||s.right,a.topRight,0,o),bottomLeft:tf(!c||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:tf(!c||s.bottom||s.right,a.bottomRight,0,o)}}function af(e){let t=ef(e),n=t.right-t.left,r=t.bottom-t.top,i=nf(e,n/2,r/2),a=rf(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function of(e,t,n,r){let i=t===null,a=n===null,o=e&&!(i&&a)&&ef(e,r);return o&&(i||Qo(t,o.left,o.right))&&(a||Qo(n,o.top,o.bottom))}function sf(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function cf(e,t){e.rect(t.x,t.y,t.w,t.h)}function lf(e,t,n={}){let r=e.x===n.x?0:-t,i=e.y===n.y?0:-t,a=(e.x+e.w===n.x+n.w?0:t)-r,o=(e.y+e.h===n.y+n.h?0:t)-i;return{x:e.x+r,y:e.y+i,w:e.w+a,h:e.h+o,radius:e.radius}}var uf=class extends zu{static id=`bar`;static defaults={borderSkipped:`start`,borderWidth:0,borderRadius:0,inflateAmount:`auto`,pointStyle:void 0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:i,outer:a}=af(this),o=sf(a.radius)?Xs:cf;e.save(),(a.w!==i.w||a.h!==i.h)&&(e.beginPath(),o(e,lf(a,t,i)),e.clip(),o(e,lf(i,-t,a)),e.fillStyle=n,e.fill(`evenodd`)),e.beginPath(),o(e,lf(i,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return of(this,e,t,n)}inXRange(e,t){return of(this,e,null,t)}inYRange(e,t){return of(this,null,e,t)}getCenterPoint(e){let{x:t,y:n,base:r,horizontal:i}=this.getProps([`x`,`y`,`base`,`horizontal`],e);return{x:i?(t+r)/2:t,y:i?n:(n+r)/2}}getRange(e){return e===`x`?this.width/2:this.height/2}},df=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},ff=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,pf=class extends zu{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=mo(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=ac(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=df(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=Z(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=Kc(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=ds(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=ds(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=ds(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=ds(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;Ws(e,this),this._draw(),Gs(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=Fs.color,s=Kc(e.rtl,this.left,this.width),c=ac(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=df(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=z(n.lineWidth,1);if(r.fillStyle=z(n.fillStyle,o),r.lineCap=z(n.lineCap,`butt`),r.lineDashOffset=z(n.lineDashOffset,0),r.lineJoin=z(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=z(n.strokeStyle,o),r.setLineDash(z(n.lineDash,[])),a.usePointStyle){let o={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},c=s.xPlus(e,p/2),l=t+d;Hs(r,o,c,l,a.pointStyleWidth&&p)}else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=rc(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?Xs(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){Ys(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:ds(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:ds(i,this.top+y+l,this.bottom-t[0].height),line:0},qc(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=ds(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=ds(i,this.top+y+l,this.bottom-t[f.line].height));let w=s.x(S);if(g(w,C,o),S=fs(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=gf(o,e)+l}else f.y+=b}),Jc(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=ac(t.font),r=ic(t.padding);if(!t.display)return;let i=Kc(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=ds(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+ds(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=ds(o,u,u+d);a.textAlign=i.textAlign(us(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,Ys(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=ac(e.font),n=ic(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(Qo(e,this.left,this.right)&&Qo(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;n<i.length;++n)if(r=i[n],Qo(e,r.left,r.left+r.width)&&Qo(t,r.top,r.top+r.height))return this.legendItems[n]}return null}handleEvent(e){let t=this.options;if(!_f(e.type,t))return;let n=this._getLegendItemAt(e.x,e.y);if(e.type===`mousemove`||e.type===`mouseout`){let r=this._hoveredItem,i=ff(r,n);r&&!i&&mo(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!i&&mo(t.onHover,[e,n,this],this)}else n&&mo(t.onClick,[e,n,this],this)}};function Z(e,t,n,r,i){return{itemWidth:mf(r,e,t,n),itemHeight:hf(i,r,t.lineHeight)}}function mf(e,t,n,r){let i=e.text;return i&&typeof i!=`string`&&(i=i.reduce((e,t)=>e.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function hf(e,t,n){let r=e;return typeof t.text!=`string`&&(r=gf(t,n)),r}function gf(e,t){return t*(e.text?e.text.length:0)}function _f(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var vf={id:`legend`,_element:pf,start(e,t,n){let r=e.legend=new pf({ctx:e.ctx,options:n,chart:e});hu.configure(e,r,n),hu.addBox(e,r)},stop(e){hu.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;hu.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=ic(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},yf={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;t<n;++t){let n=e[t].element;if(n&&n.hasValue()){let e=n.tooltipPosition();r.add(e.x),i+=e.y,++a}}return a===0||r.size===0?!1:{x:[...r].reduce((e,t)=>e+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a<o;++a){let n=e[a].element;if(n&&n.hasValue()){let e=qo(t,n.getCenterPoint());e<i&&(i=e,s=n)}}if(s){let e=s.tooltipPosition();n=e.x,r=e.y}return{x:n,y:r}}};function bf(e,t){return t&&(L(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function xf(e){return(typeof e==`string`||e instanceof String)&&e.indexOf(`
|
|
12
12
|
`)>-1?e.split(`
|
|
13
|
-
`):e}function Sf(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Cf(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=ac(t.bodyFont),l=ac(t.titleFont),u=ac(t.footerFont),d=a.length,f=i.length,p=r.length,m=ic(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,B(e.title,y),n.font=c.string,B(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,B(r,e=>{B(e.before,y),B(e.lines,y),B(e.after,y)}),v=0,n.font=u.string,B(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function wf(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function Tf(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function Ef(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),Tf(l,e,t,n)&&(l=`center`),l}function Df(e,t,n){let r=n.yAlign||t.yAlign||wf(e,n);return{xAlign:n.xAlign||t.xAlign||Ef(e,t,n,r),yAlign:r}}function Of(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function kf(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:r-=t===`bottom`?i+n:i/2,r}function Af(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=rc(o),m=Of(t,s),h=kf(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:Xo(m,0,r.width-t.width),y:Xo(h,0,r.height-t.height)}}function jf(e,t,n){let r=ic(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function Mf(e){return bf([],xf(e))}function Nf(e,t,n){return cc(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function Pf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Ff={beforeTitle:so,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:so,beforeBody:so,beforeLabel:so,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return I(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:so,afterBody:so,beforeFooter:so,footer:so,afterFooter:so};function If(e,t,n,r){let i=e[t].call(n,r);return i===void 0?Ff[t].call(n,r):i}var Lf=class extends zu{static positioners=yf;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new nl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=Nf(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=If(n,`beforeTitle`,this,e),i=If(n,`title`,this,e),a=If(n,`afterTitle`,this,e),o=[];return o=bf(o,xf(r)),o=bf(o,xf(i)),o=bf(o,xf(a)),o}getBeforeBody(e,t){return Mf(If(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return B(e,e=>{let t={before:[],lines:[],after:[]},i=Pf(n,e);bf(t.before,xf(If(i,`beforeLabel`,this,e))),bf(t.lines,If(i,`label`,this,e)),bf(t.after,xf(If(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return Mf(If(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=If(n,`beforeFooter`,this,e),i=If(n,`footer`,this,e),a=If(n,`afterFooter`,this,e),o=[];return o=bf(o,xf(r)),o=bf(o,xf(i)),o=bf(o,xf(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(Sf(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),B(o,t=>{let n=Pf(e.callbacks,t);r.push(If(n,`labelColor`,this,t)),i.push(If(n,`labelPointStyle`,this,t)),a.push(If(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=yf[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=Cf(this,n),o=Object.assign({},e,t),s=Df(this.chart,n,o),c=Af(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=rc(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=Kc(n.rtl,this.x,this.width);for(e.x=jf(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=ac(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=ac(i.bodyFont),u=jf(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Vs(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Vs(e,t,n,l)}else{e.lineWidth=R(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=rc(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Xs(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),Xs(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=ac(n.bodyFont),d=u.lineHeight,f=0,p=Kc(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=jf(this,h,n),t.fillStyle=n.bodyColor,B(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,B(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;B(g.after,m)}f=0,d=u.lineHeight,B(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=Kc(n.rtl,this.x,this.width);for(e.x=jf(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=ac(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=rc(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=yf[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=Cf(this,e),o=Object.assign({},n,this._size),s=Df(t,e,o),c=Af(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=ic(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),qc(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),Jc(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!ho(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!ho(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=yf[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},Rf={id:`tooltip`,_element:Lf,positioners:yf,afterInit(e,t,n){n&&(e.tooltip=new Lf({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:Ff},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},zf=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Bf(e,t,n,r){let i=e.indexOf(t);return i===-1?zf(e,t,n,r):i===e.lastIndexOf(t)?i:n}var Vf=(e,t)=>e===null?null:Xo(Math.round(e),0,t);function Q(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var Hf=class extends td{static id=`category`;static defaults={ticks:{callback:Q}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(I(e))return null;let n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:Bf(n,e,z(t,e),this._addedLabels),Vf(t,n.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-+!n,1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return Q.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Uf(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!I(a),_=!I(o),v=!I(c),y=(h-m)/(u+1),b=zo((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=zo(w*b/p/f)*f),I(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&Vo((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Ro(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(Go(b),Go(S));x=10**(I(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Ro(Math.round((S+E*b)*x)/x,a,Wf(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Ro(n[n.length-1].value,o,Wf(o,y,e))?n[n.length-1].value=o:n.push({value:o}):_&&C!==o||n.push({value:C}),n}function Wf(e,t,{horizontal:n,minRotation:r}){let i=Uo(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var Gf=class extends td{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return I(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=Lo(r),t=Lo(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Uf({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&Ho(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Es(e,this.chart.options.locale,this.options.ticks.format)}},Kf=class extends Gf{static id=`linear`;static defaults={ticks:{callback:ks.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=lo(e)?e:0,this.max=lo(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=Uo(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},qf=e=>Math.floor(Io(e)),Jf=(e,t)=>10**(qf(e)+t);function Yf(e){return e/10**qf(e)==1}function Xf(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Zf(e,t){let n=qf(t-e);for(;Xf(e,t,n)>10;)n++;for(;Xf(e,t,n)<10;)n--;return Math.min(n,qf(e))}function Qf(e,{min:t,max:n}){t=uo(e.min,t);let r=[],i=qf(t),a=Zf(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=uo(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:Yf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=uo(e.max,f);return r.push({value:p,major:Yf(p),significand:d}),r}(class extends td{static id=`logarithmic`;static defaults={ticks:{callback:ks.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=Gf.prototype.parse.apply(this,[e,t]);if(n===0)this._zero=!0;else return lo(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=lo(e)?Math.max(0,e):null,this.max=lo(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!lo(this._userMin)&&(this.min=e===Jf(this.min,0)?Jf(this.min,-1):Jf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Jf(n,-1)),a(Jf(r,1)))),n<=0&&i(Jf(r,-1)),r<=0&&a(Jf(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=Qf({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&Ho(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Es(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Io(e),this._valueRange=Io(this.max)-Io(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Io(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function $f(e){let t=e.ticks;if(t.display&&e.display){let e=ic(t.backdropPadding);return z(t.font&&t.font.size,Fs.font.size)+e.height}return 0}function ep(e,t,n){return n=L(n)?n:[n],{w:Rs(e,t.string,n),h:n.length*t.lineHeight}}function $(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function tp(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?V/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=ac(a.font),d=ep(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=Jo(e.getIndexAngle(c)+s),p=Math.round(Wo(f));np(n,t,f,$(p,l.x,d.w,0,180),$(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ap(e,r,i)}function np(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function rp(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(Wo(Jo(c.angle+No))),u=cp(c.y,s.h,l),d=op(l),f=sp(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function ip(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(Us({x:n,y:r},t)||Us({x:n,y:a},t)||Us({x:i,y:r},t)||Us({x:i,y:a},t))}function ap(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:$f(a)/2,additionalAngle:o?V/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=rp(e,a,c);r.push(i),s===`auto`&&(i.visible=ip(i,l),i.visible&&(l=i))}return r}function op(e){return e===0||e===180?`center`:e<180?`left`:`right`}function sp(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function cp(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function lp(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!I(s)){let n=rc(t.borderRadius),c=ic(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),Xs(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function up(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));lp(n,a,t);let o=ac(a.font),{x:s,y:c,textAlign:l}=t;Ys(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function dp(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,H);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function fp(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),dp(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function pp(e,t,n){return cc(e,{label:n,index:t,type:`pointLabel`})}(class extends Gf{static id=`radialLinear`;static defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`};static descriptors={angleLines:{_fallback:`grid`}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=ic($f(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=lo(e)&&!isNaN(e)?e:0,this.max=lo(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$f(this.options))}generateTickLabels(e){Gf.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=mo(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?tp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=H/(this._pointLabels.length||1),n=this.options.startAngle||0;return Jo(e*t+Uo(n))}getDistanceFromCenterForValue(e){if(I(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(I(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return pp(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-No+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),dp(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&up(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);fp(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;a&&i&&(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=ac(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=ic(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}Ys(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var mp={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hp=Object.keys(mp);function gp(e,t){return e-t}function _p(e,t){if(I(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),lo(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(W(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function vp(e,t,n,r){let i=hp.length;for(let a=hp.indexOf(e);a<i-1;++a){let e=mp[hp[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return hp[a]}return hp[i-1]}function yp(e,t,n,r,i){for(let a=hp.length-1;a>=hp.indexOf(n);a--){let n=hp[a];if(mp[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return hp[n?hp.indexOf(n):0]}function bp(e){for(let t=hp.indexOf(e)+1,n=hp.length;t<n;++t)if(mp[hp[t]].common)return hp[t]}function xp(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=$o(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function Sp(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Cp(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:Sp(e,r,i,n)}var wp=class extends td{static id=`time`;static defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new Wl._date(e.adapters.date);r.init(t),bo(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:_p(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}a&&o||(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=lo(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=lo(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=ns(r,i,a);return this._unit=t.unit||(n.autoSkip?vp(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):yp(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:bp(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),Cp(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=Xo(t,0,a),n=Xo(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||vp(i.minUnit,t,n,this._getLabelCapacity(t)),o=z(r.ticks.stepSize,1),s=a===`week`&&i.isoWeekday,c=W(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)xp(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&xp(l,d,p),Object.keys(l).sort(gp).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return mo(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=Uo(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,Cp(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(_p(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return os(e.sort(gp))}};function Tp(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=es(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=es(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends wp{static id=`timeseries`;static defaults=wp.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Tp(t,this.min),this._tableRange=Tp(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&n.length!==1||n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Tp(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Tp(this._table,n*this._tableRange+this._minPos,!0)}});var Ep=`label`;function Dp(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function Op(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function kp(e,t){e.labels=t}function Ap(e,t,n=Ep){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function jp(e,t=Ep){let n={labels:[],datasets:[]};return kp(n,e.labels),Ap(n,e.datasets,t),n}function Mp(e,t){let{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,p=(0,_.useRef)(null),m=(0,_.useRef)(null),h=()=>{p.current&&(m.current=new Hd(p.current,{type:o,data:jp(s,a),options:c&&{...c},plugins:l}),Dp(t,m.current))},g=()=>{Dp(t,null),m.current&&=(m.current.destroy(),null)};return(0,_.useEffect)(()=>{!i&&m.current&&c&&Op(m.current,c)},[i,c]),(0,_.useEffect)(()=>{!i&&m.current&&kp(m.current.config.data,s.labels)},[i,s.labels]),(0,_.useEffect)(()=>{!i&&m.current&&s.datasets&&Ap(m.current.config.data,s.datasets,a)},[i,s.datasets]),(0,_.useEffect)(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,c,s.labels,s.datasets,d]),(0,_.useEffect)(()=>{m.current&&(g(),setTimeout(h))},[o]),(0,_.useEffect)(()=>(h(),()=>g()),[]),(0,N.jsx)(`canvas`,{ref:p,role:`img`,height:n,width:r,...f,children:u})}var Np=(0,_.forwardRef)(Mp);function Pp(e,t){return Hd.register(t),(0,_.forwardRef)((t,n)=>(0,N.jsx)(Np,{...t,ref:n,type:e}))}var Fp=Pp(`bar`,Bl),Ip=Pp(`doughnut`,Hl);Hd.register(Hf,Kf,uf,$d,Rf,vf),Hd.defaults.font.family=`'Inter Variable', 'Inter', sans-serif`,Hd.defaults.color=`#6b7280`;var Lp={indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{beginAtZero:!0,grid:{color:`#f3f4f6`},ticks:{precision:0}},y:{grid:{display:!1}}}},Rp={responsive:!0,maintainAspectRatio:!1,cutout:`70%`,plugins:{legend:{display:!1}}};function zp({data:e,color:t=`rgba(99, 102, 241, 0.8)`}){let n=(0,_.useMemo)(()=>({labels:e.map(e=>e.label),datasets:[{label:`Quantidade`,data:e.map(e=>e.value),backgroundColor:t,borderRadius:4,barThickness:20}]}),[e,t]);return!e.length||e.every(e=>e.value===0)?(0,N.jsx)(`p`,{className:`py-8 text-center text-xs text-gray-400`,children:`Sem dados no período.`}):(0,N.jsx)(`div`,{className:`chart-box`,children:(0,N.jsx)(Fp,{data:n,options:Lp})})}function Bp({data:e}){let t=(0,_.useMemo)(()=>({labels:e.map(e=>e.label),datasets:[{data:e.map(e=>e.value),backgroundColor:e.map(e=>e.color),borderWidth:0}]}),[e]);return!e.length||e.every(e=>e.value===0)?(0,N.jsx)(`p`,{className:`py-8 text-center text-xs text-gray-400`,children:`Sem dados no período.`}):(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`chart-box flex items-center justify-center`,children:(0,N.jsx)(Ip,{data:t,options:Rp})}),(0,N.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center justify-center gap-4 text-xs text-gray-500`,children:e.map(e=>(0,N.jsxs)(`span`,{className:`flex items-center`,children:[(0,N.jsx)(`span`,{className:`mr-1.5 inline-block h-2.5 w-2.5 rounded-full`,style:{backgroundColor:e.color}}),e.label,`: `,(0,N.jsx)(`strong`,{className:`ml-1 text-gray-700`,children:e.value})]},e.label))})]})}var Vp=new Intl.DateTimeFormat(`pt-BR`,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`});new Intl.DateTimeFormat(`pt-BR`,{day:`2-digit`,month:`2-digit`});function Hp(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:Vp.format(t)}function Up(e){if(!e)return`—`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`—`;let n=t.getTime()-Date.now(),r=Math.abs(n),i=new Intl.RelativeTimeFormat(`pt-BR`,{numeric:`auto`});for(let[e,t]of[[`day`,864e5],[`hour`,36e5],[`minute`,6e4]])if(r>=t)return i.format(Math.round(n/t),e);return i.format(Math.round(n/6e4),`minute`)}function Wp(e){return e>=75?`text-green-600`:e>=50?`text-amber-600`:e>0?`text-red-600`:`text-gray-400`}function Gp(e){return e>=75?`bg-green-500`:e>=50?`bg-amber-500`:e>0?`bg-red-500`:`bg-gray-300`}function Kp(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(null),o=async()=>{try{a(null),t(await M.get(`/dashboard`))}catch(e){a(e.message)}finally{r(!1)}};if((0,_.useEffect)(()=>{o()},[]),n)return(0,N.jsx)(pa,{label:`Carregando painel…`});if(i)return(0,N.jsx)(ma,{icon:zi,title:`Servidor indisponível`,hint:i,action:(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:o,children:`Tentar novamente`})});if(!e)return null;let s=e.applications.byStatus??{},c=e.posts.byStatus??{};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h1`,{className:`text-2xl font-bold text-gray-800`,children:`Olá 👋 bem-vindo ao seu painel`}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:e.dryRun?`Modo dry-run ativo — tudo é simulado até você conectar o LinkedIn em Integrações e desativar o dry-run.`:`Modo ativo — as ações serão enviadas de verdade ao LinkedIn.`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-4`,children:[(0,N.jsx)(F,{label:`Conexão LinkedIn`,value:e.connection.connected?`Conectado`:`Dry-run`,hint:`Modo: ${e.connection.mode}${e.connection.channel?` · ${e.connection.channel}`:``}`,icon:zi,tone:e.connection.connected?`text-green-600`:`text-amber-600`}),(0,N.jsx)(F,{label:`Postagens publicadas (7d)`,value:e.posts.publishedLast7Days,hint:`${c.scheduled??0} agendadas`,icon:ti}),(0,N.jsx)(F,{label:`Convites enviados`,value:e.connections.sent,hint:`${e.connections.quota.remaining} restantes esta semana`,icon:Fi}),(0,N.jsx)(F,{label:`DMs hoje`,value:e.dms.daily.used,hint:`limite: ${e.dms.daily.limit}/dia`,icon:Zr})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(fa,{used:e.connections.quota.used,limit:e.connections.quota.limit,label:`Convites esta semana`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[`Restam `,(0,N.jsx)(`strong`,{className:`text-gray-600`,children:e.connections.quota.remaining}),` convites antes do limite semanal.`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(fa,{used:e.dms.daily.used,limit:e.dms.daily.limit,label:`DMs hoje`,tone:`bg-purple-500`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[e.dms.stepsPending,` mensagens pendentes nas cascatas ativas (`,e.dms.activeCascades,` ativas).`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(fa,{used:e.applications.quota.used,limit:e.applications.quota.limit,label:`Candidaturas hoje`,tone:`bg-emerald-500`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[e.jobs.saved??e.jobs.total,` vagas salvas · match médio `,e.jobs.averageScore]})]})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Postagens publicadas (7 dias)`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Uma publicação por dia mantém o algoritmo favorável.`})]}),(0,N.jsxs)(`button`,{className:`text-xs font-medium text-indigo-600 hover:text-indigo-800`,onClick:o,children:[(0,N.jsx)(di,{className:`mr-1 inline h-3 w-3`}),`Atualizar`]})]}),(0,N.jsx)(`div`,{className:`mt-4`,children:(0,N.jsx)(zp,{data:(e.posts.series??[]).map(e=>({label:e.day.slice(5),value:e.count}))})})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`div`,{className:`flex items-start justify-between`,children:(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Candidaturas por status`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Sucesso, intervenção manual e falhas ficam isolados em vermelho.`})]})}),(0,N.jsx)(`div`,{className:`mt-4`,children:(0,N.jsx)(Bp,{data:[{label:`Enviadas`,value:s.submitted??0,color:`#3b82f6`},{label:`Dry-run`,value:s.dry_run??0,color:`#a5b4fc`},{label:`Intervenção`,value:s.needs_intervention??0,color:`#f59e0b`},{label:`Falhas`,value:s.failed??0,color:`#ef4444`}]})})]})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card lg:col-span-2`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Onboarding (checklist)`}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsx)(qp,{done:!!e.connection.connected,label:`Conectar o LinkedIn (API oficial ou cookies)`,children:(0,N.jsx)(Nn,{to:`/integracoes`,className:`text-indigo-600 hover:text-indigo-800`,children:`Abrir Integrações`})}),(0,N.jsx)(qp,{done:!e.dryRun,label:`Desativar o dry-run em Configurações`,children:(0,N.jsx)(Nn,{to:`/config`,className:`text-indigo-600 hover:text-indigo-800`,children:`Abrir Configurações`})}),(0,N.jsx)(qp,{done:!!e.jobs.resumeLoaded,label:`Enviar seu currículo para o match de vagas`,children:(0,N.jsx)(Nn,{to:`/vagas`,className:`text-indigo-600 hover:text-indigo-800`,children:`Enviar currículo`})}),(0,N.jsx)(qp,{done:(e.posts.byStatus?.published??0)>0,label:`Publicar ou agendar a primeira postagem`,children:(0,N.jsx)(Nn,{to:`/postagens`,className:`text-indigo-600 hover:text-indigo-800`,children:`Escrever post`})}),(0,N.jsx)(qp,{done:e.connections.sent>0,label:`Enviar o primeiro convite de conexão`,children:(0,N.jsx)(Nn,{to:`/conexoes`,className:`text-indigo-600 hover:text-indigo-800`,children:`Buscar pessoas`})})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`h3`,{className:`flex items-center gap-2 text-base font-semibold text-gray-800`,children:[(0,N.jsx)(ar,{className:`h-4 w-4 text-gray-400`}),`Atividade recente`]}),(0,N.jsxs)(`ul`,{className:`mt-4 space-y-3`,children:[(e.logs??[]).slice(0,8).map((e,t)=>(0,N.jsxs)(`li`,{className:`border-b border-gray-50 pb-2 text-xs last:border-0`,children:[(0,N.jsx)(`span`,{className:`font-medium text-gray-600`,children:e.module}),` `,(0,N.jsx)(`span`,{className:`text-gray-500`,children:e.message}),(0,N.jsx)(`div`,{className:`text-[10px] text-gray-400`,children:Up(e.ts)})]},t)),!e.logs?.length&&(0,N.jsx)(`li`,{className:`text-xs text-gray-400`,children:`Nenhuma atividade ainda.`})]})]})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-gray-500`,children:[(0,N.jsx)(`span`,{className:`font-semibold uppercase tracking-wide text-gray-400`,children:`Resumo`}),(0,N.jsxs)(`span`,{children:[`Postagens: `,e.posts.total]}),(0,N.jsxs)(`span`,{children:[`Conexões: `,e.connections.total]}),(0,N.jsxs)(`span`,{children:[`Cascatas: `,e.dms.cascades]}),(0,N.jsxs)(`span`,{children:[`Vagas: `,e.jobs.total]}),(0,N.jsxs)(`span`,{children:[`Candidaturas: `,e.applications.total]}),(0,N.jsxs)(`span`,{children:[`Atualizado: `,Hp(new Date().toISOString())]})]})]})}function qp({done:e,label:t,children:n}){return(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-bold ${e?`bg-green-100 text-green-700`:`bg-gray-100 text-gray-400`}`,children:e?`✓`:`•`}),(0,N.jsx)(`span`,{className:`flex-1 text-sm ${e?`text-gray-400 line-through`:`text-gray-700`}`,children:t}),!e&&(0,N.jsx)(`span`,{className:`text-xs font-medium`,children:n})]})}var Jp=(0,_.createContext)(null),Yp=0;function Xp({children:e}){let[t,n]=(0,_.useState)([]),r=(0,_.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),i=(0,_.useCallback)((e,t)=>{Yp+=1;let i=Yp;n(n=>[...n,{id:i,tone:e,message:t}]),setTimeout(()=>r(i),4500)},[r]),a=(0,_.useMemo)(()=>({success:e=>i(`success`,e),error:e=>i(`error`,e),info:e=>i(`info`,e)}),[i]),o={success:`border-green-200 bg-green-50 text-green-800`,error:`border-red-200 bg-red-50 text-red-700`,info:`border-indigo-200 bg-indigo-50 text-indigo-800`};return(0,N.jsxs)(Jp.Provider,{value:a,children:[e,(0,N.jsx)(`div`,{className:`pointer-events-none fixed bottom-6 right-6 z-50 flex w-80 flex-col gap-2`,children:t.map(e=>(0,N.jsx)(`div`,{role:`status`,className:`pointer-events-auto rounded-lg border px-4 py-3 text-sm shadow-lg ${o[e.tone]}`,children:e.message},e.id))})]})}function Zp(){let e=(0,_.useContext)(Jp);if(!e)throw Error(`useToast must be used inside ToastProvider`);return e}var Qp={published:`bg-green-100 text-green-800`,sent:`bg-green-100 text-green-800`,submitted:`bg-green-100 text-green-800`,active:`bg-green-100 text-green-800`,dry_run:`bg-indigo-100 text-indigo-700`,draft:`bg-gray-100 text-gray-700`,scheduled:`bg-amber-100 text-amber-800`,pending:`bg-gray-100 text-gray-700`,failed:`bg-red-100 text-red-700`,blocked:`bg-red-100 text-red-700`,cancelled:`bg-gray-100 text-gray-500`,completed:`bg-green-100 text-green-800`,paused:`bg-amber-100 text-amber-800`,waiting_reply:`bg-indigo-100 text-indigo-700`,needs_intervention:`bg-amber-100 text-amber-800`,saved:`bg-green-100 text-green-800`,discarded:`bg-gray-100 text-gray-500`,applied:`bg-indigo-100 text-indigo-700`,untested:`bg-gray-100 text-gray-500`,inactive:`bg-gray-100 text-gray-500`,simulated:`bg-indigo-100 text-indigo-700`},$p={published:`Publicado`,sent:`Enviado`,submitted:`Enviada`,active:`Ativo`,dry_run:`Dry-run`,draft:`Rascunho`,scheduled:`Agendado`,pending:`Pendente`,failed:`Falha`,blocked:`Bloqueado`,cancelled:`Cancelado`,completed:`Concluído`,paused:`Pausado`,waiting_reply:`Aguardando resposta`,needs_intervention:`Intervenção manual`,saved:`Salva`,discarded:`Descartada`,applied:`Candidatado`,untested:`Não testado`,inactive:`Inativo`,simulated:`Simulado`};function em({status:e,simulated:t}){let n=Qp[e]??`bg-gray-100 text-gray-600`,r=$p[e]??e;return(0,N.jsxs)(`span`,{className:`badge ${n}`,children:[e===`failed`&&(0,N.jsx)(`span`,{className:`mr-1.5 inline-block h-2 w-2 rounded-full bg-red-500`}),r,t&&e!==`dry_run`&&` · simulado`]})}var tm=3e3,nm=[[``,`Todos`],[`draft`,`Rascunhos`],[`scheduled`,`Agendados`],[`published`,`Publicados`],[`failed`,`Falhas`],[`cancelled`,`Cancelados`]];function rm(){let e=Zp(),[t,n]=(0,_.useState)({items:[],total:0,page:1}),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)(!0),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1),b=(0,_.useCallback)(async()=>{m(!0);try{let[e,t,r]=await Promise.all([M.get(`/posts`,{query:{status:s,topicId:l,page:d,limit:10}}),M.get(`/posts/stats`),M.get(`/topics`)]);n(e),i(t),o(r.topics)}catch(t){e.error(`Falha ao carregar postagens: ${t.message}`)}finally{m(!1)}},[s,l,d,e]);(0,_.useEffect)(()=>{b()},[b]);let x=async()=>{if(!h.trim())e.error(`Escreva o texto do post.`);else try{await M.post(`/posts`,{text:h}),g(``),e.success(`Rascunho criado. Publique quando estiver pronto.`),b()}catch(t){e.error(t.message)}},S=async t=>{y(t);try{await M.post(`/posts/${t}/publish`),e.success(`Postagem publicada!`),b()}catch(t){e.error(`Falha ao publicar: ${t.message}`)}finally{y(null)}},C=async t=>{try{await M.post(`/posts/${t}/cancel`),e.info(`Agendamento cancelado.`),b()}catch(t){e.error(t.message)}},w=async t=>{try{await M.del(`/posts/${t}`),e.info(`Postagem removida.`),b()}catch(t){e.error(t.message)}},T=async t=>{let n=window.prompt(`Agendar para (YYYY-MM-DDTHH:MM):`,new Date(Date.now()+36e5).toISOString().slice(0,16));if(n)try{await M.post(`/posts/${t}/schedule`,{scheduledAt:new Date(n).toISOString()}),e.success(`Postagem agendada.`),b()}catch(t){e.error(t.message)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsx)(F,{label:`Publicadas`,value:r?.byStatus?.published??0,hint:`total no histórico`}),(0,N.jsx)(F,{label:`Agendadas`,value:r?.byStatus?.scheduled??0,hint:`próximas 24h+`}),(0,N.jsx)(F,{label:`Rascunhos`,value:r?.byStatus?.draft??0,hint:`aguardando revisão`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Nova postagem manual`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Texto puro — o LinkedIn não aceita markdown. Preview obrigatório antes de publicar.`}),(0,N.jsx)(`textarea`,{className:`input mt-4 h-64 resize-y`,placeholder:`Escreva sua postagem aqui…`,value:h,onChange:e=>g(e.target.value)}),(0,N.jsxs)(`div`,{className:`mt-2 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Limite LinkedIn: `,tm]}),(0,N.jsxs)(`span`,{className:h.length>tm?`font-bold text-red-600`:``,children:[h.length,` / `,tm]})]}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:x,disabled:!h.trim()||h.length>tm,children:[(0,N.jsx)(ti,{className:`h-4 w-4`}),`Salvar rascunho`]}),(0,N.jsx)(`span`,{className:`self-center text-xs text-gray-400`,children:`Publique pelo botão no histórico →`})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Preview`}),(0,N.jsx)(`div`,{className:`mt-4 max-h-64 overflow-y-auto rounded-lg border border-gray-100 bg-gray-50 p-4 text-sm whitespace-pre-wrap text-gray-700`,children:h||(0,N.jsx)(`span`,{className:`text-gray-400`,children:`O preview aparece aqui conforme você digita.`})}),(0,N.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,N.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-indigo-100 text-xs font-bold text-indigo-600`,children:`JF`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:`Você`}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:`Publicar agora · visível para todos`})]})]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Histórico`}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`select`,{className:`input w-auto`,value:s,onChange:e=>{c(e.target.value),f(1)},children:nm.map(([e,t])=>(0,N.jsx)(`option`,{value:e,children:t},e))}),(0,N.jsxs)(`select`,{className:`input w-auto`,value:l,onChange:e=>{u(e.target.value),f(1)},children:[(0,N.jsx)(`option`,{value:``,children:`Todos os temas`}),a.map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})]}),p?(0,N.jsx)(pa,{}):t.items.length===0?(0,N.jsx)(ma,{icon:ti,title:`Nenhuma postagem encontrada`,hint:`Crie um rascunho acima, gere com LLM em Postagens > Agendar ou ajuste os filtros.`}):(0,N.jsx)(`div`,{className:`mt-4 overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400`,children:[(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Tema`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Texto`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Status`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Data`}),(0,N.jsx)(`th`,{className:`pb-2 text-right`,children:`Ações`})]})}),(0,N.jsx)(`tbody`,{children:t.items.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-gray-50 last:border-0`,children:[(0,N.jsx)(`td`,{className:`py-3 pr-4 text-gray-600`,children:e.topicName??`—`}),(0,N.jsxs)(`td`,{className:`max-w-xs py-3 pr-4`,children:[(0,N.jsxs)(`p`,{className:`truncate text-gray-700`,title:e.text,children:[e.text.slice(0,80),e.text.length>80?`…`:``]}),e.error&&(0,N.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:e.error})]}),(0,N.jsx)(`td`,{className:`py-3 pr-4`,children:(0,N.jsx)(em,{status:e.status,simulated:e.simulated})}),(0,N.jsx)(`td`,{className:`py-3 pr-4 text-xs text-gray-500`,children:e.publishedAt?`Publicado ${Hp(e.publishedAt)}`:e.scheduledAt?`Agendado ${Hp(e.scheduledAt)}`:Hp(e.createdAt)}),(0,N.jsx)(`td`,{className:`py-3 text-right`,children:(0,N.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[[`draft`,`failed`].includes(e.status)&&(0,N.jsx)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>S(e.id),disabled:v===e.id,title:`Publicar agora`,children:(0,N.jsx)(_i,{className:`h-3.5 w-3.5`})}),[`draft`,`failed`].includes(e.status)&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>T(e.id),title:`Agendar`,children:(0,N.jsx)(pr,{className:`h-3.5 w-3.5`})}),e.status===`scheduled`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>C(e.id),title:`Cancelar agendamento`,children:(0,N.jsx)(Tr,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>w(e.id),title:`Excluir`,children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})})]},e.id))})]})}),t.total>t.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,t.page,` · `,t.total,` registros`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:d<=1,onClick:()=>f(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:d*t.limit>=t.total,onClick:()=>f(e=>e+1),children:`Próxima`})]})]})]}),(0,N.jsxs)(`p`,{className:`flex items-center gap-1 text-xs text-gray-400`,children:[(0,N.jsx)(Ti,{className:`h-3.5 w-3.5`}),`Para gerar posts com LLM a partir de temas, use a tela Agendar.`]})]})}function im(){let e=Zp(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),h=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/topics`),M.get(`/posts`,{query:{status:`scheduled`,limit:20}})]);n(e.topics),i(t.items)}catch(t){e.error(`Falha ao carregar: ${t.message}`)}},[e]);(0,_.useEffect)(()=>{h()},[h]);let g=async()=>{if(!s)e.error(`Selecione um tema.`);else{f(!0);try{let t=await M.post(`/posts/generate`,{topicId:s,instructions:l});o(t.post),e.success(`Texto gerado (${t.generated.provider}/${t.generated.model}, ${t.generated.chars} caracteres). Revise o preview.`)}catch(t){e.error(`Geração falhou: ${t.message}`)}finally{f(!1)}}},v=async()=>{if(a)try{await M.post(`/posts/${a.id}/publish`),e.success(`Postagem publicada!`),o(null),h()}catch(t){e.error(`Falha ao publicar: ${t.message}`)}},y=async()=>{if(a){if(!p)e.error(`Escolha data e hora.`);else try{await M.post(`/posts/${a.id}/schedule`,{scheduledAt:new Date(p).toISOString()}),e.success(`Postagem agendada com sucesso.`),o(null),m(``),h()}catch(t){e.error(t.message)}}},b=async t=>{try{await M.post(`/posts/${t}/cancel`),e.info(`Agendamento cancelado.`),h()}catch(t){e.error(t.message)}},x=async t=>{try{await M.del(`/posts/${t}`),h()}catch(t){e.error(t.message)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Temas pré-definidos`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`A LLM escreve o post a partir do tema e das diretrizes. Gerencie a lista em Configurações › Temas.`}),(0,N.jsx)(`div`,{className:`mt-4 grid grid-cols-1 gap-3 md:grid-cols-3`,children:t.map(e=>(0,N.jsxs)(`button`,{onClick:()=>c(e.id),className:`rounded-xl border p-4 text-left transition ${s===e.id?`border-indigo-400 bg-indigo-50`:`border-gray-100 bg-white hover:border-gray-300`}`,children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:e.name}),(0,N.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-gray-500`,children:e.prompt||`Sem diretriz adicional`}),(0,N.jsxs)(`p`,{className:`mt-2 text-[10px] uppercase tracking-wide text-gray-400`,children:[e.postsCount??0,` posts gerados`]})]},e.id))})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Gerar post com LLM`}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`topic`,children:`Tema`}),(0,N.jsxs)(`select`,{id:`topic`,className:`input`,value:s,onChange:e=>c(e.target.value),children:[(0,N.jsx)(`option`,{value:``,children:`Selecione…`}),t.map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`instructions`,children:`Instruções adicionais (opcional)`}),(0,N.jsx)(`textarea`,{id:`instructions`,className:`input h-24 resize-y`,placeholder:`Ex.: mencione que estou contratando para a vaga de dev sênior`,value:l,onChange:e=>u(e.target.value)}),(0,N.jsxs)(`button`,{className:`btn-primary mt-4`,onClick:g,disabled:d||!s,children:[(0,N.jsx)(Li,{className:`h-4 w-4`}),d?`Gerando…`:`Gerar e revisar`]}),(0,N.jsx)(`p`,{className:`mt-2 text-xs text-gray-400`,children:`A publicação só acontece após a sua aprovação no preview. Provedor configurado em Configurações › LLM.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Preview do rascunho`}),a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`mt-4 max-h-56 overflow-y-auto rounded-lg border border-gray-100 bg-gray-50 p-4 text-sm whitespace-pre-wrap text-gray-700`,children:a.text}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-gray-400`,children:[a.text.length,` caracteres · gerado por `,a.generatedBy?.provider??`LLM`,` / `,a.generatedBy?.model??`—`]}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-end gap-2`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`scheduleAt`,children:`Agendar para`}),(0,N.jsx)(`input`,{id:`scheduleAt`,type:`datetime-local`,className:`input`,value:p,onChange:e=>m(e.target.value)})]}),(0,N.jsxs)(`button`,{className:`btn-secondary`,onClick:y,children:[(0,N.jsx)(pr,{className:`h-4 w-4`}),`Agendar`]}),(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:v,children:[(0,N.jsx)(Ti,{className:`h-4 w-4`}),`Publicar agora`]})]})]}):(0,N.jsx)(`p`,{className:`mt-4 rounded-lg border border-dashed border-gray-200 p-6 text-center text-xs text-gray-400`,children:`Gere um texto para visualizar o preview aqui.`})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Fila de agendamentos`}),(0,N.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[r.length,` pendentes`]})]}),r.length===0?(0,N.jsx)(ma,{icon:pr,title:`Nenhum agendamento`,hint:`Gere um post com LLM e agende a publicação para uma data futura.`}):(0,N.jsx)(`ul`,{className:`mt-4 space-y-3`,children:r.map(e=>(0,N.jsxs)(`li`,{className:`rounded-lg border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`p`,{className:`truncate text-sm font-medium text-gray-700`,children:e.text.slice(0,90)}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-400`,children:[e.topicName??`Manual`,` · `,Hp(e.scheduledAt)]})]}),(0,N.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,N.jsx)(em,{status:e.status,simulated:e.simulated}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id),title:`Cancelar`,children:(0,N.jsx)(Tr,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>x(e.id),title:`Excluir`,children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})]}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(da,{percent:Math.max(0,Math.min(100,100-(new Date(e.scheduledAt)-Date.now())/36e5*10)),label:`Tempo até a publicação`,showPercent:!1})})]},e.id))})]})]})}var am=`Oi {{nome}}, acompanho seu trabalho na {{empresa}}. Adorei sua atuação como {{cargo}} — vamos conectar?`;function om(){let e=Zp(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(am),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(new Set),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)({items:[],total:0,page:1,limit:20}),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(1),b=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/connections`,{query:{page:v,limit:10}}),M.get(`/connections/limits`)]);m(e),g(t.invitations)}catch(t){e.error(`Falha ao carregar histórico: ${t.message}`)}},[v,e]);(0,_.useEffect)(()=>{b()},[b]);let x=async()=>{if(!t.trim())e.error(`Digite uma palavra-chave (cargo, empresa, skill ou localização).`);else{u(!0);try{let n=await M.post(`/connections/search`,{keyword:t});o(n.profiles),c(new Set),n.simulated&&e.info(`Dry-run: resultados simulados para você explorar a interface.`)}catch(t){e.error(`Busca falhou: ${t.message}`)}finally{u(!1)}}},S=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsx)(F,{label:`Convites enviados`,value:p.total,hint:`total no histórico`}),(0,N.jsx)(F,{label:`Restam esta semana`,value:h?.remaining??`—`,hint:`limite: ${h?.limit??100}`}),(0,N.jsx)(F,{label:`Perfis na busca`,value:a.length,hint:`${s.size} selecionados`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Networking por palavra-chave`}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,N.jsx)(`input`,{className:`input max-w-md`,placeholder:`Ex.: tech recruiter, engenheiro de dados, product manager São Paulo`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&x()}),(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:x,disabled:l,children:[(0,N.jsx)(hi,{className:`h-4 w-4`}),l?`Buscando…`:`Buscar perfis`]}),(0,N.jsxs)(`button`,{className:`btn-secondary`,onClick:()=>c(new Set(a.map(e=>e.profileId))),disabled:!a.length,children:[(0,N.jsx)(yr,{className:`h-4 w-4`}),`Selecionar todos`]}),(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>c(new Set),disabled:!s.size,children:`Limpar seleção`})]}),l&&(0,N.jsx)(pa,{label:`Buscando perfis…`}),!l&&a.length>0&&(0,N.jsx)(`ul`,{className:`mt-4 divide-y divide-gray-50`,children:a.map(e=>(0,N.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:s.has(e.profileId),onChange:()=>S(e.profileId)}),(0,N.jsxs)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-indigo-100 text-sm font-bold text-indigo-600`,children:[e.firstName?.[0]??`?`,e.lastName?.[0]??``]}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`p`,{className:`text-sm font-medium text-gray-800`,children:[e.firstName,` `,e.lastName]}),(0,N.jsxs)(`p`,{className:`truncate text-xs text-gray-500`,children:[e.headline,` · `,e.location]})]}),e.simulated&&(0,N.jsx)(`span`,{className:`badge bg-indigo-50 text-indigo-500`,children:`simulado`})]},e.profileId))}),!l&&a.length===0&&(0,N.jsx)(`p`,{className:`mt-4 text-xs text-gray-400`,children:`Nenhuma busca ainda. Os resultados aparecem aqui para seleção individual ou em lote.`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Mensagem do convite`}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Variáveis suportadas: `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`{{nome}}`}),`, `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`{{empresa}}`}),`, `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`{{cargo}}`}),` · limite de 300 caracteres do LinkedIn.`]}),(0,N.jsx)(`textarea`,{className:`input mt-4 h-40 resize-y`,value:r,onChange:e=>i(e.target.value)}),(0,N.jsxs)(`div`,{className:`mt-2 text-right text-xs text-gray-500`,children:[r.length,` / 300`]}),(0,N.jsxs)(`button`,{className:`btn-primary mt-2 w-full`,onClick:async()=>{if(!s.size)e.error(`Selecione ao menos um perfil.`);else{f(!0);try{let t=a.filter(e=>s.has(e.profileId)),n=await M.post(`/connections/invitations`,{profiles:t,message:r}),i=n.results.filter(e=>e.status===`sent`).length,o=n.results.filter(e=>e.status===`blocked`).length,l=n.results.filter(e=>e.status===`failed`).length;e.success(`Convites enviados: ${i}${o?` · bloqueados: ${o}`:``}${l?` · falhas: ${l}`:``}`),c(new Set),b()}catch(t){e.error(`Falha no envio: ${t.message}`)}finally{f(!1)}}},disabled:d||!s.size,children:[(0,N.jsx)(Ni,{className:`h-4 w-4`}),d?`Enviando…`:`Enviar convite (${s.size})`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limite semanal (Goal Gradient)`}),(0,N.jsx)(`div`,{className:`mt-6`,children:h&&(0,N.jsx)(fa,{used:h.used,limit:h.limit,label:`Convites esta semana`})}),(0,N.jsx)(`p`,{className:`mt-6 text-xs text-gray-400`,children:`Padrão 100 convites por semana (configurável em Configurações). Os envios passam pelo rate limiter central com delays humanos entre cada ação. Dry-run + sem conexão = envio simulado.`})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Histórico de convites`}),p.items.length===0?(0,N.jsx)(ma,{icon:_i,title:`Nenhum convite enviado`,hint:`Faça uma busca, selecione perfis e envie convites personalizados.`}):(0,N.jsx)(`div`,{className:`mt-4 overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400`,children:[(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Contato`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Mensagem`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Status`}),(0,N.jsx)(`th`,{className:`pb-2`,children:`Data`})]})}),(0,N.jsx)(`tbody`,{children:p.items.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-gray-50 last:border-0`,children:[(0,N.jsxs)(`td`,{className:`py-3 pr-4`,children:[(0,N.jsx)(`p`,{className:`font-medium text-gray-700`,children:e.name}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.headline})]}),(0,N.jsx)(`td`,{className:`max-w-xs py-3 pr-4 text-xs text-gray-500`,title:e.message,children:e.message?.slice(0,70)}),(0,N.jsxs)(`td`,{className:`py-3 pr-4`,children:[(0,N.jsx)(em,{status:e.status,simulated:e.simulated}),e.error&&(0,N.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:e.error})]}),(0,N.jsx)(`td`,{className:`py-3 text-xs text-gray-500`,children:Hp(e.sentAt)})]},e.id))})]})}),p.total>p.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,p.page,` · `,p.total,` registros`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:v<=1,onClick:()=>y(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:v*p.limit>=p.total,onClick:()=>y(e=>e+1),children:`Próxima`})]})]})]})]})}var sm=5;function cm(){let e=Zp(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)([{text:``,delayDays:0},{text:``,delayDays:2}]),v=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/cascades`),M.get(`/cascades/stats`)]);n(e.cascades),i(t)}catch(t){e.error(`Falha ao carregar cascatas: ${t.message}`)}finally{o(!1)}},[e]);(0,_.useEffect)(()=>{v()},[v]);let y=async()=>{try{await M.post(`/cascades`,{contactName:l,profileId:d,approvalRequired:p,sequence:h.filter(e=>e.text.trim())}),e.success(`Cascata criada.`),c(!1),u(``),f(``),g([{text:``,delayDays:0},{text:``,delayDays:2}]),v()}catch(t){e.error(t.message)}},b=async(t,n)=>{try{await M.post(`/cascades/${t}/status`,{status:n}),v()}catch(t){e.error(t.message)}},x=async t=>{try{await M.post(`/cascades/${t}/approve`),e.success(`Mensagem aprovada.`),v()}catch(t){e.error(t.message)}},S=async t=>{try{await M.del(`/cascades/${t}`),v()}catch(t){e.error(t.message)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-4`,children:[(0,N.jsx)(F,{label:`DMs hoje`,value:r?.daily.used??0,hint:`limite ${r?.maxPerDay??5}/dia`,icon:Zr}),(0,N.jsx)(F,{label:`Cascatas ativas`,value:r?.byStatus?.active??0,hint:`${r?.total??0} no total`}),(0,N.jsx)(F,{label:`Aguardando resposta`,value:r?.byStatus?.waiting_reply??0,hint:`pausadas automaticamente`}),(0,N.jsx)(F,{label:`Intervalo mínimo`,value:`${r?.intervalMinutes??30} min`,hint:`entre mensagens`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card lg:col-span-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Cascatas em andamento`}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:async()=>{let t=await M.post(`/cascades/check-replies`);t.paused?.length?e.info(`${t.paused.length} cascata(s) pausada(s) por resposta do contato.`):e.info(t.error?`Verificação falhou: ${t.error}`:`Nenhuma resposta nova detectada.`),v()},title:`Verificar respostas na caixa de entrada`,children:[(0,N.jsx)(di,{className:`h-3.5 w-3.5`}),`Verificar respostas`]}),(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:async()=>{let t=await M.post(`/cascades/tick`);e.info(`Processamento: ${t.sent} enviadas, ${t.skipped} aguardando.`),v()},title:`Rodar o motor agora (teste)`,children:[(0,N.jsx)(ri,{className:`h-3.5 w-3.5`}),`Processar agora`]}),(0,N.jsx)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>c(!0),children:`+ Nova cascata`})]})]}),a?(0,N.jsx)(pa,{}):t.length===0?(0,N.jsx)(ma,{icon:Zr,title:`Nenhuma cascata criada`,hint:`Crie uma sequência de até 5 mensagens com delays em dias. Ideal para follow-up após convites aceitos.`}):(0,N.jsx)(`ul`,{className:`mt-4 space-y-4`,children:t.map(e=>(0,N.jsxs)(`li`,{className:`rounded-xl border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:e.contactName}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`Criada em `,Hp(e.createdAt),e.nextStepAt?` · próxima mensagem ${Hp(e.nextStepAt)}`:``]}),e.lastReplyAt&&(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-indigo-500`,children:[`Resposta recebida em `,Hp(e.lastReplyAt)]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(em,{status:e.status}),e.pendingApprovals?.length>0&&(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>x(e.id),children:[(0,N.jsx)(hr,{className:`h-3.5 w-3.5`}),`Aprovar msg `,e.pendingApprovals[0]+1]}),e.status===`active`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id,`paused`),children:(0,N.jsx)($r,{className:`h-3.5 w-3.5`})}),e.status===`paused`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id,`active`),children:(0,N.jsx)(ri,{className:`h-3.5 w-3.5`})}),e.status!==`cancelled`&&e.status!==`completed`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id,`cancelled`),children:(0,N.jsx)(Tr,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>S(e.id),children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})]}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(da,{percent:e.progress?.percent??0,label:`${e.progress?.sent??0} de ${e.progress?.total??0} mensagens enviadas`,showPercent:!1})}),(0,N.jsx)(`ol`,{className:`mt-3 space-y-2`,children:(e.steps??[]).map(e=>(0,N.jsxs)(`li`,{className:`flex items-start gap-2 rounded-lg bg-gray-50 p-3 text-xs`,children:[(0,N.jsx)(`span`,{className:`font-bold text-gray-400`,children:e.stepIndex+1}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`whitespace-pre-wrap text-gray-700`,children:e.text}),(0,N.jsxs)(`p`,{className:`mt-1 text-[10px] text-gray-400`,children:[`delay: `,e.delayDays,` dia(s) · `,e.sentAt?`enviada ${Hp(e.sentAt)}`:e.status===`failed`?`falha: ${e.error}`:`pendente`]})]}),(0,N.jsx)(em,{status:e.status===`sent`?`sent`:e.status})]},e.stepIndex))})]},e.id))})]}),(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limite diário`}),(0,N.jsx)(`div`,{className:`mt-6`,children:r&&(0,N.jsx)(fa,{used:r.daily.used,limit:r.daily.limit,label:`Mensagens enviadas hoje`,tone:`bg-purple-500`})}),(0,N.jsxs)(`p`,{className:`mt-4 text-xs text-gray-400`,children:[`Hard limit de `,sm,` mensagens por dia. Entre mensagens o app respeita o intervalo mínimo configurável (`,r?.intervalMinutes??30,` min) e delays humanos aleatórios.`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Como funciona`}),(0,N.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs text-gray-500`,children:[(0,N.jsxs)(`li`,{children:[`1. Cada mensagem tem um `,(0,N.jsx)(`strong`,{children:`delay em dias`}),` (ex.: msg 1 hoje, msg 2 em 2 dias).`]}),(0,N.jsx)(`li`,{children:`2. O motor roda a cada minuto e envia o que estiver devido, respeitando o limite diário.`}),(0,N.jsxs)(`li`,{children:[`3. Se o contato `,(0,N.jsx)(`strong`,{children:`responder`}),`, a cascata pausa automaticamente.`]}),(0,N.jsxs)(`li`,{children:[`4. Ative a `,(0,N.jsx)(`strong`,{children:`aprovação manual`}),` para revisar cada mensagem antes do envio.`]})]})]})]})]}),(0,N.jsxs)(ha,{open:s,title:`Nova cascata de DM`,onClose:()=>c(!1),footer:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>c(!1),children:`Cancelar`}),(0,N.jsx)(`button`,{className:`btn-primary`,onClick:y,children:`Criar cascata`})]}),children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`contact`,children:`Nome do contato`}),(0,N.jsx)(`input`,{id:`contact`,className:`input`,placeholder:`Ex.: Ana Silva`,value:l,onChange:e=>u(e.target.value)}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`profileId`,children:`ID do perfil (LinkedIn)`}),(0,N.jsx)(`input`,{id:`profileId`,className:`input`,placeholder:`Ex.: demo-0 (perfil aceito no convite)`,value:d,onChange:e=>f(e.target.value)}),(0,N.jsxs)(`p`,{className:`label mt-4`,children:[`Mensagens (máx. `,sm,`)`]}),(0,N.jsx)(`div`,{className:`space-y-3`,children:h.map((e,t)=>(0,N.jsxs)(`div`,{className:`rounded-lg border border-gray-100 p-3`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-semibold text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Mensagem `,t+1]}),(0,N.jsxs)(`label`,{className:`flex items-center gap-1 font-normal`,children:[`delay (dias)`,(0,N.jsx)(`input`,{type:`number`,min:`0`,className:`input !w-16 !py-1`,value:e.delayDays,onChange:n=>{let r=[...h];r[t]={...e,delayDays:Number(n.target.value)||0},g(r)}})]})]}),(0,N.jsx)(`textarea`,{className:`input mt-2 h-20 resize-y`,placeholder:`Texto da mensagem…`,value:e.text,onChange:n=>{let r=[...h];r[t]={...e,text:n.target.value},g(r)}})]},t))}),h.length<sm&&(0,N.jsx)(`button`,{className:`btn-secondary mt-3`,onClick:()=>g([...h,{text:``,delayDays:h.length*2}]),children:`+ Adicionar mensagem`}),(0,N.jsxs)(`label`,{className:`mt-4 flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:p,onChange:e=>m(e.target.checked)}),`Exigir aprovação manual antes de cada envio`]})]})]})}function lm(){let e=Zp(),{linkedin:t}=ua(),n=(0,_.useRef)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)({items:[],total:0,page:1}),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(1),[v,y]=(0,_.useState)({title:``,location:``,remote:!1}),b=(0,_.useCallback)(async()=>{try{let[e,t,n]=await Promise.all([M.get(`/resume`),M.get(`/jobs`,{query:{status:`saved`,page:h,limit:10}}),M.get(`/jobs/stats`)]);i(e.resume),f(t),m(n)}catch(t){e.error(`Falha ao carregar: ${t.message}`)}},[h,e]);(0,_.useEffect)(()=>{b()},[b]);let x=async t=>{if(t){o(!0);try{let n=await M.post(`/resume?fileName=${encodeURIComponent(t.name)}&mimeType=${encodeURIComponent(t.type||``)}`,t,{raw:!0,headers:{"Content-Type":t.type||`application/octet-stream`}});i(n.resume),e.success(`Currículo processado: ${n.resume.skills.length} skills detectadas.`)}catch(t){t instanceof Ki?e.error(t.message):e.error(`Falha ao processar o currículo.`)}finally{o(!1),n.current&&(n.current.value=``)}}},S=async()=>{if(!v.title.trim())e.error(`Informe o cargo desejado.`);else{c(!0);try{let t=await M.post(`/jobs/search`,v);u(t.jobs),t.simulated&&e.info(`Dry-run: vagas simuladas para explorar o match.`)}catch(t){e.error(`Busca falhou: ${t.message}`)}finally{c(!1)}}},C=async(t,n)=>{try{await M.post(`/jobs`,{job:t,status:n}),e.success(n===`saved`?`Vaga salva.`:`Vaga descartada.`),b()}catch(t){e.error(t.message)}},w=async t=>{try{await M.del(`/jobs/${t}`),b()}catch(t){e.error(t.message)}},T=async t=>{try{let n=await M.post(`/applications`,{job:t,dryRun:!0});e.success(`Candidatura registrada (${n.application.status===`dry_run`?`dry-run`:n.application.status}).`),b()}catch(t){e.error(`Falha ao candidatar: ${t.message}`)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-4`,children:[(0,N.jsx)(F,{label:`Currículo`,value:r?.skills?.length?`${r.skills.length} skills`:`Não enviado`,hint:r?.fileName??`PDF, DOCX ou TXT`}),(0,N.jsx)(F,{label:`Vagas salvas`,value:d.total,hint:`match calculado localmente`}),(0,N.jsx)(F,{label:`Match médio`,value:p?.averageScore??`—`,hint:`currículo × vagas salvas`}),(0,N.jsx)(F,{label:`Resultados na busca`,value:l.length,hint:`score semântico 0–100`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Currículo`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Processamento 100% local (PDF via pdfjs, DOCX via mammoth).`}),(0,N.jsx)(`input`,{ref:n,type:`file`,accept:`.pdf,.docx,.txt,application/pdf,text/plain`,className:`mt-4 hidden`,onChange:e=>x(e.target.files?.[0])}),(0,N.jsxs)(`button`,{className:`btn-primary mt-2`,onClick:()=>n.current?.click(),disabled:a,children:[(0,N.jsx)(ji,{className:`h-4 w-4`}),a?`Processando…`:`Enviar currículo`]}),r?.skills?.length>0&&(0,N.jsxs)(`div`,{className:`mt-4`,children:[(0,N.jsx)(`p`,{className:`label`,children:`Skills detectadas`}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.skills.map(e=>(0,N.jsx)(`span`,{className:`badge bg-indigo-50 text-indigo-600`,children:e},e))}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[r.titles?.length?`Títulos: ${r.titles.join(` · `)}`:``,r.yearsExperience?` · ${r.yearsExperience} anos de experiência`:``,r.languages?.length?` · Idiomas: ${r.languages.join(`, `)}`:``]})]}),!r?.skills?.length&&(0,N.jsx)(`p`,{className:`mt-4 rounded-lg border border-dashed border-gray-200 p-6 text-center text-xs text-gray-400`,children:`Envie seu currículo para ver o score de match em cada vaga.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Buscar vagas`}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`jobTitle`,children:`Cargo / palavras-chave`}),(0,N.jsx)(`input`,{id:`jobTitle`,className:`input`,placeholder:`Ex.: Engenheiro de Software`,value:v.title,onChange:e=>y({...v,title:e.target.value})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`jobLocation`,children:`Localização`}),(0,N.jsx)(`input`,{id:`jobLocation`,className:`input`,placeholder:`Ex.: São Paulo, Remoto`,value:v.location,onChange:e=>y({...v,location:e.target.value})})]}),(0,N.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:v.remote,onChange:e=>y({...v,remote:e.target.checked})}),`Somente remotas`]})]}),(0,N.jsxs)(`button`,{className:`btn-primary mt-4 w-full`,onClick:S,disabled:s,children:[(0,N.jsx)(hi,{className:`h-4 w-4`}),s?`Buscando…`:`Buscar vagas`]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-gray-400`,children:[`Dry-run ativo (`,t?.mode??`dry-run`,`): use Integrações para conectar e buscar de verdade.`]})]})]}),l.length>0&&(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`h3`,{className:`text-base font-semibold text-gray-800`,children:[`Resultados (`,l.length,`)`]}),(0,N.jsx)(`ul`,{className:`mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2`,children:l.map(e=>(0,N.jsxs)(`li`,{className:`rounded-xl border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:e.title}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[e.company,` · `,e.location,e.easyApply===null?``:e.easyApply?` · Easy Apply`:` · candidatura externa`]})]}),(0,N.jsx)(`span`,{className:`text-2xl font-bold ${Wp(e.matchScore)}`,children:e.matchScore})]}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(da,{percent:e.matchScore,tone:Gp(e.matchScore),showPercent:!1})}),(0,N.jsx)(`p`,{className:`mt-2 text-xs font-medium text-gray-600`,children:e.recommendation}),e.skillGaps?.length>0&&(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-400`,children:[`Lacunas: `,e.skillGaps.join(`, `)]}),(0,N.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>C(e,`saved`),children:[(0,N.jsx)(pi,{className:`h-3.5 w-3.5`}),`Salvar`]}),(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>C(e,`discarded`),children:[(0,N.jsx)(Di,{className:`h-3.5 w-3.5`}),`Descartar`]}),(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>T(e),children:[(0,N.jsx)(_i,{className:`h-3.5 w-3.5`}),`Candidatar-se (dry-run)`]})]})]},e.jobId))})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Vagas salvas`}),d.items.length===0?(0,N.jsx)(ma,{icon:Fr,title:`Nenhuma vaga salva`,hint:`Busque vagas acima e salve as que fizerem sentido para seu perfil.`}):(0,N.jsx)(`ul`,{className:`mt-4 space-y-3`,children:d.items.map(e=>(0,N.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 rounded-lg border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:e.title}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[e.company,` · `,e.location]})]}),(0,N.jsx)(em,{status:e.status===`discarded`?`discarded`:`saved`}),(0,N.jsx)(`span`,{className:`text-lg font-bold ${Wp(e.matchScore)}`,children:e.matchScore}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>T(e),children:[(0,N.jsx)(_i,{className:`h-3.5 w-3.5`}),`Candidatar`]}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>w(e.id),children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})]},e.id))}),d.total>d.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,d.page,` · `,d.total,` vagas salvas`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:h<=1,onClick:()=>g(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:h*d.limit>=d.total,onClick:()=>g(e=>e+1),children:`Próxima`})]})]})]})]})}function um(){let e=Zp(),[t,n]=(0,_.useState)({items:[],total:0,page:1,limit:20}),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(1),[s,c]=(0,_.useState)(``),l=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/applications`,{query:{status:s,page:a,limit:10}}),M.get(`/applications/limits`)]);n(e),i(t.applications)}catch(t){e.error(`Falha ao carregar candidaturas: ${t.message}`)}},[s,a,e]);(0,_.useEffect)(()=>{l()},[l]);let u=async t=>{try{await M.post(`/applications/${t}/retry`,{dryRun:!1}),e.info(`Nova tentativa iniciada.`),l()}catch(t){e.error(t.message)}},d=(t.items??[]).filter(e=>e.status===`submitted`).length;return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsx)(F,{label:`Candidaturas`,value:t.total,hint:`total registrado`}),(0,N.jsx)(F,{label:`Enviadas hoje`,value:r?.used??0,hint:`limite: ${r?.limit??20}/dia`}),(0,N.jsx)(F,{label:`Enviadas com sucesso`,value:d,hint:`Easy Apply`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card lg:col-span-2`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Histórico de candidaturas`}),(0,N.jsxs)(`select`,{className:`input w-auto`,value:s,onChange:e=>{c(e.target.value),o(1)},children:[(0,N.jsx)(`option`,{value:``,children:`Todos os status`}),(0,N.jsx)(`option`,{value:`submitted`,children:`Enviadas`}),(0,N.jsx)(`option`,{value:`dry_run`,children:`Dry-run`}),(0,N.jsx)(`option`,{value:`needs_intervention`,children:`Intervenção manual`}),(0,N.jsx)(`option`,{value:`failed`,children:`Falhas`}),(0,N.jsx)(`option`,{value:`blocked`,children:`Bloqueadas`})]})]}),t.items.length?(0,N.jsx)(`div`,{className:`mt-4 overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400`,children:[(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Vaga`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Score`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Status`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Relatório`}),(0,N.jsx)(`th`,{className:`pb-2`,children:`Ações`})]})}),(0,N.jsx)(`tbody`,{children:t.items.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-gray-50 last:border-0`,children:[(0,N.jsxs)(`td`,{className:`py-3 pr-4`,children:[(0,N.jsx)(`p`,{className:`font-medium text-gray-700`,children:e.jobTitle}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.company})]}),(0,N.jsx)(`td`,{className:`py-3 pr-4 font-bold text-gray-600`,children:e.matchScore??`—`}),(0,N.jsx)(`td`,{className:`py-3 pr-4`,children:(0,N.jsx)(em,{status:e.status,simulated:e.dryRun})}),(0,N.jsxs)(`td`,{className:`max-w-xs py-3 pr-4 text-xs text-gray-500`,children:[e.report?.notes??`—`,e.report?.screenshot&&(0,N.jsx)(`span`,{className:`block text-[10px] text-gray-400`,children:`screenshot salvo em ~/.jobfinder/screenshots/`})]}),(0,N.jsx)(`td`,{className:`py-3`,children:[`failed`,`needs_intervention`].includes(e.status)&&(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>u(e.id),children:[(0,N.jsx)(di,{className:`h-3.5 w-3.5`}),`Tentar de novo`]})})]},e.id))})]})}):(0,N.jsx)(ma,{icon:lr,title:`Nenhuma candidatura`,hint:`Candidate-se a partir da tela de Vagas. O modo dry-run é o padrão até você conectar o LinkedIn.`}),t.total>t.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,t.page,` · `,t.total,` registros`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:a<=1,onClick:()=>o(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:a*t.limit>=t.total,onClick:()=>o(e=>e+1),children:`Próxima`})]})]})]}),(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limite diário`}),(0,N.jsx)(`div`,{className:`mt-6`,children:r&&(0,N.jsx)(fa,{used:r.used,limit:r.limit,label:`Candidaturas hoje`,tone:`bg-emerald-500`})}),(0,N.jsx)(`p`,{className:`mt-4 text-xs text-gray-400`,children:`Padrão 20/dia (configurável). Cada candidatura passa pelo rate limiter com delays humanos e reutiliza a sessão do navegador com os cookies conectados.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Sobre o Easy Apply`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-500`,children:[`A automação usa Playwright (opcional). Sem ele instalado — ou com dry-run ativo — o app registra a candidatura como`,(0,N.jsx)(`strong`,{children:` dry-run`}),` e nada é enviado. Formulários complexos retornam `,(0,N.jsx)(`strong`,{children:`intervenção manual`}),` com screenshot salvo localmente.`]}),(0,N.jsx)(`p`,{className:`mt-3 text-xs text-gray-400`,children:`Instalar sob demanda: npm i -g playwright && npx playwright install chromium`})]})]})]})]})}var dm=`https://www.linkedin.com/help/linkedin/answer/a526048/acesso-as-apis-do-linkedin?lang=pt`,fm=`https://chromewebstore.google.com/detail/get-cookieslocally/cclelndahbckbenkjhflpdbgdldlbecc`;function pm(){let e=Zp(),[t]=zn(),n=(0,_.useRef)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(`LinkedIn principal`),[p,m]=(0,_.useState)(!0),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(!1),b=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/linkedin/status`),M.get(`/channels`)]);i(e),o(t.channels)}catch(t){e.error(`Falha ao carregar integrações: ${t.message}`)}finally{m(!1)}},[e]);(0,_.useEffect)(()=>{b()},[b]),(0,_.useEffect)(()=>{let n=t.get(`linkedin`);n===`connected`&&e.success(`API Oficial conectada com sucesso!`),n===`error`&&e.error(`Falha no OAuth: ${t.get(`reason`)??`erro desconhecido`}`),n&&window.history.replaceState({},``,`/integracoes`)},[t,e]);let x=async()=>{if(!s||!l)e.error(`Preencha clientId e clientSecret.`);else try{await M.post(`/channels/official`,{label:d,clientId:s,clientSecret:l}),e.success(`Credenciais salvas localmente. Agora inicie o OAuth.`),b()}catch(t){e.error(t.message)}},S=async()=>{try{let t=await M.post(`/channels/oauth/start`);window.open(t.url,`_blank`,`noopener,noreferrer,width=600,height=800`),e.info(`Complete a autorização no LinkedIn; você voltará para esta tela automaticamente.`)}catch(t){e.error(t.message)}},C=async()=>{g(!0);try{let t=await M.post(`/linkedin/test`);t.ok?e.success(`Conexão OK (${t.mode}${t.profile?`: ${t.profile.name??t.profile.firstName??``}`:``})`):e.error(t.message),b()}catch(t){e.error(t.message)}finally{g(!1)}},w=async t=>{try{await M.post(`/channels/${t}/activate`),e.success(`Canal ativado.`),b()}catch(t){e.error(t.message)}},T=async t=>{try{await M.del(`/channels/${t}`),e.info(`Canal removido.`),b()}catch(t){e.error(t.message)}},E=async t=>{if(t)try{let n=await M.post(`/channels/cookies?label=${encodeURIComponent(t.name)}`,t,{raw:!0,headers:{"Content-Type":`text/plain`}});n.test.ok?e.success(`Sessão válida! Perfil: ${n.test.profile.firstName??``} ${n.test.profile.lastName??``}`):e.error(`Cookies salvos, mas o teste falhou: ${n.test.message}. Verifique se o LinkedIn está acessível desta máquina.`),b()}catch(t){e.error(t.message)}finally{n.current&&(n.current.value=``)}};if(p)return(0,N.jsx)(pa,{label:`Carregando integrações…`});let D=!!r?.connected;return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:`Status da conexão`}),(0,N.jsx)(`div`,{className:`mt-2 flex items-center gap-2`,children:(0,N.jsxs)(`span`,{className:`badge ${D?`bg-green-100 text-green-800`:`bg-amber-100 text-amber-800`}`,children:[(0,N.jsx)(`span`,{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${D?`bg-green-500`:`bg-amber-500`}`}),D?r.mode===`official`?`API Oficial`:`Cookies de sessão`:`Dry-run (sem canal)`]})}),(0,N.jsx)(`p`,{className:`mt-3 text-xs text-gray-400`,children:r?.dryRun?r?.dryRunReason===`global-dry-run`?`Canal conectado, mas o dry-run global está ativo em Configurações.`:`Nenhum canal conectado — tudo está sendo simulado.`:`Modo ativo: as ações serão enviadas ao LinkedIn.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:`Canais cadastrados`}),(0,N.jsx)(`p`,{className:`mt-2 text-2xl font-bold text-gray-800`,children:a.length}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-400`,children:[a.filter(e=>e.authMode===`official`).length,` via API oficial · `,a.filter(e=>e.authMode===`cookie`).length,` via cookies`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:`Testar conexão`}),(0,N.jsxs)(`button`,{className:`btn-secondary mt-3 w-full`,onClick:C,disabled:h,children:[(0,N.jsx)(di,{className:`h-4 w-4`}),h?`Testando…`:`Testar agora`]}),(0,N.jsxs)(`button`,{className:`btn-primary mt-2 w-full`,onClick:()=>window.open(dm,`_blank`,`noopener,noreferrer`),children:[(0,N.jsx)(zr,{className:`h-4 w-4`}),`Criar API Oficial do LinkedIn`]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Método recomendado — API Oficial (OAuth 2.0)`}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Crie seu app no LinkedIn (botão acima), copie o `,(0,N.jsx)(`strong`,{children:`Client ID`}),` e o `,(0,N.jsx)(`strong`,{children:`Client Secret`}),` e registre o redirect`,(0,N.jsx)(`code`,{className:`mx-1 rounded bg-gray-100 px-1`,children:`http://127.0.0.1:4040/api/channels/oauth/callback`}),`. As credenciais ficam apenas no arquivo local`,(0,N.jsx)(`code`,{className:`mx-1 rounded bg-gray-100 px-1`,children:`~/.jobfinder/channels.json`}),`.`]}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`channelLabel`,children:`Nome do canal`}),(0,N.jsx)(`input`,{id:`channelLabel`,className:`input`,value:d,onChange:e=>f(e.target.value)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`clientId`,children:`Client ID`}),(0,N.jsx)(`input`,{id:`clientId`,className:`input`,placeholder:`77xxxxxxx`,value:s,onChange:e=>c(e.target.value)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`clientSecret`,children:`Client Secret`}),(0,N.jsx)(`input`,{id:`clientSecret`,type:`password`,className:`input`,placeholder:`••••••••`,value:l,onChange:e=>u(e.target.value)})]})]}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:x,children:[(0,N.jsx)(ai,{className:`h-4 w-4`}),`Salvar credenciais`]}),(0,N.jsxs)(`button`,{className:`btn-secondary`,onClick:S,children:[(0,N.jsx)(zr,{className:`h-4 w-4`}),`Iniciar autorização OAuth`]})]}),!r?.channel?.official?.hasAccessToken&&a.every(e=>!e.official?.hasAccessToken)&&(0,N.jsx)(`span`,{className:`badge mt-3 bg-amber-100 text-amber-800`,children:`⚠ Recomendado`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Fallback — cookies de sessão`}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Com a extensão `,(0,N.jsx)(`a`,{href:fm,target:`_blank`,rel:`noreferrer noopener`,className:`text-indigo-600 hover:text-indigo-800`,children:`"Get cookies.txt LOCALLY"`}),`, exporte os cookies de `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`linkedin.com`}),` (formato cookies.txt) e envie abaixo. O app usa a API interna (Voyager) para convites, DMs e Easy Apply.`]}),(0,N.jsx)(`div`,{className:`mt-4 rounded-lg border border-amber-200 bg-amber-50 p-4`,children:(0,N.jsxs)(`p`,{className:`flex items-start gap-2 text-xs text-amber-800`,children:[(0,N.jsx)(Ci,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(`strong`,{children:`Uso por conta e risco:`}),` automação pode violar os Termos de Serviço do LinkedIn e resultar em restrições da conta. Os cookies ficam `,(0,N.jsx)(`strong`,{children:`somente no seu computador`}),` e nunca são compartilhados. Respeite os limites de rate configurados.`]})]})}),(0,N.jsx)(`input`,{ref:n,type:`file`,accept:`.txt,text/plain`,className:`mt-4 hidden`,onChange:e=>E(e.target.files?.[0])}),(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:()=>n.current?.click(),children:[(0,N.jsx)(Dr,{className:`h-4 w-4`}),`Enviar cookies.txt`]}),(0,N.jsx)(`button`,{className:`btn-secondary ml-2`,onClick:()=>y(!0),children:`Como exportar?`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Canais conectados`}),a.length===0?(0,N.jsx)(ma,{icon:ai,title:`Nenhum canal cadastrado`,hint:`Use a API Oficial (recomendado) ou envie os cookies de sessão.`}):(0,N.jsx)(`ul`,{className:`mt-4 divide-y divide-gray-50`,children:a.map(e=>(0,N.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`p`,{className:`text-sm font-medium text-gray-800`,children:[e.label,` `,(0,N.jsx)(`span`,{className:`ml-1 text-xs text-gray-400`,children:e.authMode===`official`?`API Oficial`:`cookies`})]}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[e.official?.hasAccessToken?`token válido${e.official.expiresAt?` até ${Hp(e.official.expiresAt)}`:``}`:``,e.cookiesCount?`${e.cookiesCount} cookies (${e.cookieNames?.slice(0,3).join(`, `)}…)`:``,e.lastError?` · último erro: ${e.lastError}`:``]})]}),(0,N.jsx)(em,{status:e.status===`active`?`active`:e.status}),e.status!==`active`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>w(e.id),title:`Tornar ativo`,children:(0,N.jsx)(li,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>T(e.id),title:`Remover`,children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]},e.id))})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Suporte`}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3 text-xs text-gray-500`,children:[(0,N.jsx)(da,{label:`Diagnóstico do ambiente`,percent:100,showPercent:!1,tone:`bg-green-500`}),(0,N.jsxs)(`p`,{children:[`Servidor resposta OK · dados em `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`~/.jobfinder/`}),` · versão 0.0.01`]}),(0,N.jsxs)(`p`,{children:[`Dúvidas e issues: `,(0,N.jsx)(`a`,{href:`https://github.com/DanHachuel/JobFinder/issues`,target:`_blank`,rel:`noreferrer noopener`,className:`text-indigo-600 hover:text-indigo-800`,children:`github.com/DanHachuel/JobFinder/issues`}),` · `,(0,N.jsx)(`a`,{href:`https://github.com/DanHachuel/JobFinder#tutorial`,target:`_blank`,rel:`noreferrer noopener`,className:`text-indigo-600 hover:text-indigo-800`,children:`tutorial completo`})]})]})]}),(0,N.jsxs)(ha,{open:v,title:`Como exportar os cookies`,onClose:()=>y(!1),children:[(0,N.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-xs text-gray-600`,children:[(0,N.jsx)(`li`,{children:`Instale a extensão "Get cookies.txt LOCALLY" no Chrome/Edge.`}),(0,N.jsxs)(`li`,{children:[`Acesse `,(0,N.jsx)(`strong`,{children:`linkedin.com`}),` logado na sua conta.`]}),(0,N.jsxs)(`li`,{children:[`Clique no ícone da extensão e escolha `,(0,N.jsx)(`strong`,{children:`Export`}),` (formato cookies.txt).`]}),(0,N.jsxs)(`li`,{children:[`Volte aqui e envie o arquivo. O app valida `,(0,N.jsx)(`code`,{children:`li_at`}),` e `,(0,N.jsx)(`code`,{children:`JSESSIONID`}),` automaticamente.`]})]}),(0,N.jsx)(`p`,{className:`mt-4 text-xs text-gray-500`,children:`A sessão expira quando o LinkedIn invalida os cookies — reexporte se os testes começarem a falhar.`})]})]})}var mm=[[`ollama`,`Ollama (local, sem chave)`],[`openai`,`OpenAI`],[`deepseek`,`DeepSeek`],[`anthropic`,`Anthropic`]],hm={currentPassword:``,newPassword:``,confirmPassword:``};function gm(){let e=Zp(),{user:t}=Zi(),{refresh:n}=ua(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(!0),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)({name:``,prompt:``}),[h,g]=(0,_.useState)(hm),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(!1),w=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/config`),M.get(`/topics`)]);i(e.config),o(t.topics)}catch(t){e.error(`Falha ao carregar configuração: ${t.message}`)}finally{c(!1)}},[e]);(0,_.useEffect)(()=>{w()},[w]);let T=async()=>{u(!0);try{let{llm:t,limits:a,outreach:o,linkedin:s,...c}=r,l={...c,llm:{...t,apiKey:t.apiKey===`***`?``:t.apiKey},limits:a,outreach:o,linkedin:s};l.llm.apiKey||delete l.llm.apiKey;let u=await M.put(`/config`,l);i(u.config),e.success(`Configuração salva.`),n?.()}catch(t){e.error(t.message)}finally{u(!1)}},E=async t=>{x(!0);try{let r=await M.put(`/config`,{dryRun:t});i(r.config),e.success(t?`Dry-run reativado — nenhuma ação real será enviada ao LinkedIn.`:`Modo real ativado — o JobFinder executará ações reais no LinkedIn.`),n?.()}catch(t){e.error(t.message)}finally{x(!1)}},D=e=>{e?E(!0):C(!0)},ee=async t=>{if(t.preventDefault(),h.newPassword!==h.confirmPassword)e.error(`A nova senha e a confirmação não coincidem.`);else if(h.newPassword.length<6)e.error(`A nova senha precisa de pelo menos 6 caracteres.`);else{y(!0);try{await M.put(`/auth/password`,h),e.success(`Senha alterada. Use a nova senha no próximo login.`),g(hm)}catch(t){e.error(t.message)}finally{y(!1)}}},te=async()=>{if(!p.name.trim())e.error(`Dê um nome ao tema.`);else try{await M.post(`/topics`,p),e.success(`Tema criado.`),f(!1),m({name:``,prompt:``}),w()}catch(t){e.error(t.message)}},ne=async t=>{try{await M.put(`/topics/${t.id}`,{active:!t.active}),w()}catch(t){e.error(t.message)}},re=async t=>{try{await M.del(`/topics/${t}`),w()}catch(t){e.error(t.message)}};return s||!r?(0,N.jsx)(pa,{label:`Carregando configuração…`}):(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card ${r.dryRun?`border-amber-200 bg-amber-50`:`border-red-200 bg-red-50`}`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-start gap-3`,children:[r.dryRun?(0,N.jsx)(Lr,{className:`mt-0.5 h-6 w-6 shrink-0 text-amber-500`}):(0,N.jsx)(Ui,{className:`mt-0.5 h-6 w-6 shrink-0 text-red-500`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:r.dryRun?`Modo dry-run ativo`:`Modo real ativo (ações reais)`}),(0,N.jsx)(`p`,{className:`mt-1 max-w-2xl text-xs text-gray-600`,children:r.dryRun?`Nenhuma chamada real ao LinkedIn é feita: postagens, convites, DMs e candidaturas são simulados. Explore o app com segurança.`:`As automações vão agir de verdade na sua conta do LinkedIn. Respeite os limites abaixo e confira o canal conectado em Integrações.`}),(0,N.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-xs font-medium text-red-700`,children:[(0,N.jsx)(ki,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),`Ao desativar o modo Dry-run, o JobFinder executará ações reais no LinkedIn (postagens, convites, DMs e candidaturas). Use com responsabilidade.`]})]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(`span`,{className:`badge ${r.dryRun?`bg-amber-100 text-amber-800`:`bg-red-100 text-red-800`}`,children:r.dryRun?`dry-run`:`Real Mode`}),(0,N.jsx)(_m,{checked:!r.dryRun,disabled:b,onChange:e=>D(!e.target.checked),label:r.dryRun?`Desativar dry-run`:`Ativar dry-run`})]})]}),(0,N.jsxs)(`p`,{className:`mt-3 text-[11px] text-gray-500`,children:[`O estado é salvo em `,(0,N.jsx)(`code`,{className:`font-mono`,children:`config.json`})," (`dryRun`) e vale para todo o backend — inclusive o scheduler e as cascatas de DM."]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(zr,{className:`h-5 w-5 text-indigo-500`}),(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Segurança`})]}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Conta local única: `,(0,N.jsx)(`span`,{className:`font-medium text-gray-700`,children:t?.email}),` · a senha fica apenas em`,` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`~/.jobfinder/auth.json`}),`, com hash scrypt (nunca em texto puro).`]}),(0,N.jsxs)(`form`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,onSubmit:ee,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`currentPassword`,children:`Senha atual`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`currentPassword`,type:`password`,autoComplete:`current-password`,className:`input !pl-10`,value:h.currentPassword,onChange:e=>g({...h,currentPassword:e.target.value})})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`newPassword`,children:`Nova senha`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`newPassword`,type:`password`,autoComplete:`new-password`,className:`input !pl-10`,placeholder:`mínimo de 6 caracteres`,value:h.newPassword,onChange:e=>g({...h,newPassword:e.target.value})})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`confirmPassword`,children:`Confirmar nova senha`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`confirmPassword`,type:`password`,autoComplete:`new-password`,className:`input !pl-10`,value:h.confirmPassword,onChange:e=>g({...h,confirmPassword:e.target.value})})]})]}),(0,N.jsx)(`div`,{className:`md:col-span-3 flex justify-end`,children:(0,N.jsxs)(`button`,{className:`btn-primary`,type:`submit`,disabled:v,children:[(0,N.jsx)(pi,{className:`h-4 w-4`}),v?`Salvando…`:`Alterar senha`]})})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Provedor de LLM`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`provider`,children:`Provedor`}),(0,N.jsx)(`select`,{id:`provider`,className:`input`,value:r.llm.provider,onChange:e=>i({...r,llm:{...r.llm,provider:e.target.value}}),children:mm.map(([e,t])=>(0,N.jsx)(`option`,{value:e,children:t},e))})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`model`,children:`Modelo`}),(0,N.jsx)(`input`,{id:`model`,className:`input`,value:r.llm.model,onChange:e=>i({...r,llm:{...r.llm,model:e.target.value}})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`baseUrl`,children:`Base URL`}),(0,N.jsx)(`input`,{id:`baseUrl`,className:`input`,value:r.llm.baseUrl,onChange:e=>i({...r,llm:{...r.llm,baseUrl:e.target.value}})})]}),(0,N.jsxs)(`div`,{className:`md:col-span-2`,children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`apiKey`,children:`API Key (vazio = usar Ollama local sem chave)`}),(0,N.jsx)(`input`,{id:`apiKey`,type:`password`,className:`input`,placeholder:r.llm.apiKey===`***`?`•••• (já configurada — digite uma nova para trocar)`:``,value:r.llm.apiKey===`***`?``:r.llm.apiKey,onChange:e=>i({...r,llm:{...r.llm,apiKey:e.target.value}})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`label`,{className:`label`,htmlFor:`temperature`,children:[`Temperatura (`,r.llm.temperature,`)`]}),(0,N.jsx)(`input`,{id:`temperature`,type:`range`,min:`0`,max:`1`,step:`0.1`,className:`w-full accent-indigo-500`,value:r.llm.temperature,onChange:e=>i({...r,llm:{...r.llm,temperature:Number(e.target.value)}})})]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limites de rate (proteção da conta)`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,N.jsx)(vm,{label:`Convites por semana`,value:r.limits.invitationsPerWeek,onChange:e=>i({...r,limits:{...r.limits,invitationsPerWeek:e}})}),(0,N.jsx)(vm,{label:`DMs por dia (máx. 5)`,value:r.limits.dmsPerDay,onChange:e=>i({...r,limits:{...r.limits,dmsPerDay:e}})}),(0,N.jsx)(vm,{label:`Intervalo entre DMs (min)`,value:r.limits.dmIntervalMinutes,onChange:e=>i({...r,limits:{...r.limits,dmIntervalMinutes:e}})}),(0,N.jsx)(vm,{label:`Candidaturas por dia`,value:r.limits.applicationsPerDay,onChange:e=>i({...r,limits:{...r.limits,applicationsPerDay:e}})}),(0,N.jsx)(vm,{label:`Delay mínimo entre ações (ms)`,value:r.limits.minDelayMs,onChange:e=>i({...r,limits:{...r.limits,minDelayMs:e}})}),(0,N.jsx)(vm,{label:`Delay máximo entre ações (ms)`,value:r.limits.maxDelayMs,onChange:e=>i({...r,limits:{...r.limits,maxDelayMs:e}})})]}),(0,N.jsxs)(`div`,{className:`mt-4`,children:[(0,N.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:r.outreach?.pauseOnReply!==!1,onChange:e=>i({...r,outreach:{...r.outreach,pauseOnReply:e.target.checked}})}),`Pausar cascatas de DM automaticamente quando o contato responder`]}),(0,N.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:!!r.outreach?.autoApproveDms,onChange:e=>i({...r,outreach:{...r.outreach,autoApproveDms:e.target.checked}})}),`Aprovar mensagens de DM automaticamente (sem revisão manual)`]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Servidor local`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,N.jsx)(vm,{label:`Porta`,value:r.port,onChange:e=>i({...r,port:e})}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`host`,children:`Host`}),(0,N.jsx)(`input`,{id:`host`,className:`input`,value:r.host,onChange:e=>i({...r,host:e.target.value})})]})]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-gray-400`,children:[`A porta só muda na próxima inicialização: npx --yes @danhachuel/jobfinder@<versão> start --port `,r.port]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Temas de postagem`}),(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>f(!0),children:[(0,N.jsx)(si,{className:`h-3.5 w-3.5`}),`Novo tema`]})]}),(0,N.jsx)(`ul`,{className:`mt-4 divide-y divide-gray-50`,children:a.map(e=>(0,N.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:e.name}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.prompt||`Sem diretriz`})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1 text-xs text-gray-500`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:e.active,onChange:()=>ne(e)}),`ativo`]}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>re(e.id),children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]},e.id))})]}),(0,N.jsx)(`div`,{className:`sticky bottom-4 flex justify-end`,children:(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:T,disabled:l,children:[(0,N.jsx)(pi,{className:`h-4 w-4`}),l?`Salvando…`:`Salvar configuração`]})}),(0,N.jsxs)(ha,{open:S,title:`Desativar o dry-run?`,onClose:()=>C(!1),footer:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>C(!1),children:`Cancelar`}),(0,N.jsx)(`button`,{className:`btn-danger`,onClick:()=>{C(!1),E(!1)},children:`Sim, ativar modo real`})]}),children:[(0,N.jsx)(`p`,{className:`text-sm text-gray-700`,children:`Ao desativar o modo Dry-run, o JobFinder executará ações reais no LinkedIn (postagens, convites, DMs e candidaturas). Use com responsabilidade.`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-500`,children:[`Confirme também que há um canal do LinkedIn conectado em `,(0,N.jsx)(`span`,{className:`font-medium`,children:`Integrações`}),` — sem canal, as ações reais são bloqueadas pelo backend.`]})]}),(0,N.jsxs)(ha,{open:d,title:`Novo tema`,onClose:()=>f(!1),footer:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>f(!1),children:`Cancelar`}),(0,N.jsx)(`button`,{className:`btn-primary`,onClick:te,children:`Criar`})]}),children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`topicName`,children:`Nome`}),(0,N.jsx)(`input`,{id:`topicName`,className:`input`,placeholder:`Ex.: Inteligência Artificial no trabalho`,value:p.name,onChange:e=>m({...p,name:e.target.value})}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`topicPrompt`,children:`Diretriz para a LLM`}),(0,N.jsx)(`textarea`,{id:`topicPrompt`,className:`input h-24 resize-y`,placeholder:`Ex.: explique um conceito de IA com exemplo prático do dia a dia`,value:p.prompt,onChange:e=>m({...p,prompt:e.target.value})})]})]})}function _m({checked:e,onChange:t,disabled:n,label:r}){return(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm font-medium text-gray-700`,children:[(0,N.jsxs)(`span`,{className:`relative inline-block h-6 w-11 shrink-0`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`absolute inset-0 h-full w-full cursor-pointer opacity-0`,checked:e,disabled:n,onChange:t,"aria-label":r}),(0,N.jsx)(`span`,{className:`pointer-events-none block h-6 w-11 rounded-full bg-gray-300 transition peer-checked:bg-red-500 peer-disabled:opacity-50`}),(0,N.jsx)(`span`,{className:`pointer-events-none absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow transition peer-checked:translate-x-5`})]}),r]})}function vm({label:e,value:t,onChange:n}){return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,children:e}),(0,N.jsx)(`input`,{type:`number`,className:`input`,value:t??0,onChange:e=>n(Number(e.target.value)||0)})]})}var ym=[{icon:ti,title:`Publique com LLM`},{icon:Fr,title:`Conecte-se`},{icon:Zr,title:`DMs em cascata`},{icon:dr,title:`Candidate-se`}],bm=[{left:`8%`,size:4,color:`#818cf8`,duration:10,delay:0},{left:`22%`,size:3,color:`#818cf8`,duration:11,delay:1},{left:`38%`,size:5,color:`#a5b4fc`,duration:12,delay:1},{left:`55%`,size:3,color:`#818cf8`,duration:11,delay:1.8},{left:`70%`,size:4,color:`#f472b6`,duration:14,delay:.5},{left:`82%`,size:3,color:`#a5b4fc`,duration:12,delay:1.8},{left:`93%`,size:4,color:`#6366f1`,duration:10,delay:3.8}];function xm(){let e=_t(),t=mt(),{user:n,login:r}=Zi(),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(null),g=(0,_.useCallback)(async()=>{try{let e=await M.get(`/auth/defaults`);h(e.firstRun?e:null)}catch{h(null)}},[]);(0,_.useEffect)(()=>{g()},[g]);let v=t.state?.from??`/`;return n?(0,N.jsx)(Ht,{to:v,replace:!0}):(0,N.jsxs)(`div`,{className:`flex h-screen w-full overflow-hidden`,children:[(0,N.jsxs)(`div`,{className:`relative hidden w-1/2 overflow-hidden bg-[#1e1b4b] lg:flex`,children:[(0,N.jsx)(`div`,{className:`login-orb login-orb-a`}),(0,N.jsx)(`div`,{className:`login-orb login-orb-b`}),(0,N.jsx)(`div`,{className:`login-orb login-orb-center`}),bm.map(e=>(0,N.jsx)(`span`,{className:`login-particle`,style:{left:e.left,width:e.size,height:e.size,background:e.color,animationDuration:`${e.duration}s`,animationDelay:`${e.delay}s`}},e.left)),(0,N.jsxs)(`div`,{className:`relative z-10 flex h-full w-full flex-col justify-center px-16`,children:[(0,N.jsxs)(`h1`,{className:`text-2xl font-bold tracking-tight text-white`,children:[`Job`,(0,N.jsx)(`span`,{className:`text-[#818cf8]`,children:`Finder`}),(0,N.jsx)(`span`,{className:`ml-3 rounded border border-indigo-400/30 bg-indigo-500/10 px-2 py-0.5 text-[10px] font-medium align-middle text-indigo-300`,children:`100% local`})]}),(0,N.jsxs)(`h2`,{className:`mt-10 max-w-xl text-4xl font-bold leading-tight text-white`,children:[`Tudo o que você precisa para `,(0,N.jsx)(`span`,{className:`text-[#818cf8]`,children:`automatizar sua carreira`}),` no LinkedIn em um só lugar`]}),(0,N.jsx)(`p`,{className:`mt-4 max-w-md text-lg text-white/50`,children:`Menos trabalho manual, mais candidaturas certas — seus dados nunca saem desta máquina.`}),(0,N.jsx)(`div`,{className:`mt-12 grid max-w-2xl grid-cols-4 gap-6`,children:ym.map((e,t)=>(0,N.jsxs)(`div`,{className:`login-step flex flex-col items-center gap-3`,style:{animationDelay:`${.3+t*.15}s`},children:[(0,N.jsxs)(`div`,{className:`relative flex h-24 w-24 items-center justify-center rounded-2xl border border-indigo-400/20 bg-indigo-500/10 backdrop-blur-md transition hover:border-indigo-400/50`,children:[(0,N.jsx)(`span`,{className:`absolute left-3 top-2 text-[10px] font-semibold text-indigo-400/60`,children:t+1}),(0,N.jsx)(e.icon,{className:`h-9 w-9 text-[#a5b4fc]`}),t<ym.length-1&&(0,N.jsx)(`span`,{className:`login-step-arrow`})]}),(0,N.jsx)(`h3`,{className:`text-center text-sm font-medium text-white/65`,children:e.title})]},e.title))})]})]}),(0,N.jsxs)(`div`,{className:`flex w-full flex-col justify-between overflow-y-auto bg-gray-50 p-8 lg:w-1/2`,children:[(0,N.jsx)(`div`,{className:`flex justify-end`,children:(0,N.jsxs)(`span`,{className:`badge bg-indigo-100 text-indigo-700`,title:`Aplicativo local — nenhum dado sai desta máquina`,children:[(0,N.jsx)(Ti,{className:`mr-1 h-3 w-3`}),`execução local`]})}),(0,N.jsxs)(`div`,{className:`mx-auto w-full max-w-sm`,children:[(0,N.jsx)(`h2`,{className:`text-2xl font-bold text-gray-800`,children:`Bem-vindo de volta!`}),(0,N.jsx)(`p`,{className:`mt-2 text-sm text-gray-500`,children:`Acesso local ao JobFinder — informe seu e-mail e senha.`}),u&&(0,N.jsx)(`div`,{className:`mt-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700`,role:`alert`,children:u}),(0,N.jsxs)(`form`,{className:`mt-6 space-y-5`,onSubmit:async t=>{t.preventDefault(),d(``),p(!0);try{await r(i.trim(),o),e(v,{replace:!0})}catch(e){d(e.message||`Não foi possível entrar. Verifique o e-mail e a senha.`)}finally{p(!1)}},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`email`,children:`E-mail`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Yr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`email`,type:`email`,required:!0,autoComplete:`email`,className:`input !pl-10`,placeholder:`seu@email.com`,value:i,onChange:e=>a(e.target.value)})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`password`,children:`Senha`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`password`,type:c?`text`:`password`,required:!0,autoComplete:`current-password`,className:`input !pl-10 !pr-11`,placeholder:`••••••`,value:o,onChange:e=>s(e.target.value)}),(0,N.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 rounded-lg p-1.5 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>l(e=>!e),"aria-label":c?`Ocultar senha`:`Mostrar senha`,title:c?`Ocultar senha`:`Mostrar senha`,children:c?(0,N.jsx)(Nr,{className:`h-4 w-4`}):(0,N.jsx)(jr,{className:`h-4 w-4`})})]})]}),(0,N.jsxs)(`button`,{className:`btn-primary w-full`,type:`submit`,disabled:f,children:[f?(0,N.jsx)(Ur,{className:`h-4 w-4 animate-spin`}):(0,N.jsx)(sr,{className:`h-4 w-4`}),f?`Entrando…`:`Entrar`]})]}),m&&(0,N.jsxs)(`div`,{className:`mt-6 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-xs text-amber-800`,children:[(0,N.jsx)(`p`,{className:`font-semibold`,children:`Primeiro acesso (usuário local pré-criado)`}),(0,N.jsxs)(`p`,{className:`mt-1`,children:[`E-mail `,(0,N.jsx)(`code`,{className:`font-mono font-semibold`,children:m.email}),` · senha`,` `,(0,N.jsx)(`code`,{className:`font-mono font-semibold`,children:`123456`})]}),(0,N.jsx)(`p`,{className:`mt-1 text-amber-700`,children:`Troque a senha em Configurações → Segurança após o primeiro login.`})]})]}),(0,N.jsxs)(`div`,{className:`mt-8 text-center text-xs text-gray-400`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,N.jsx)(`a`,{className:`hover:text-indigo-600`,href:`/legal/terms.html`,target:`_blank`,rel:`noreferrer noopener`,children:`Termos de Uso`}),(0,N.jsx)(`span`,{className:`opacity-50`,children:`|`}),(0,N.jsx)(`a`,{className:`hover:text-indigo-600`,href:`/legal/privacy.html`,target:`_blank`,rel:`noreferrer noopener`,children:`Política de Privacidade`})]}),(0,N.jsx)(`div`,{className:`mt-2`,children:"© 2026 JobFinder (DanHachuel) · dados em `~/.jobfinder/`"})]})]})]})}function Sm(){return(0,N.jsxs)(`div`,{className:`flex h-screen w-full items-center justify-center bg-[#1e1b4b] text-indigo-200`,children:[(0,N.jsx)(Ur,{className:`mr-2 h-5 w-5 animate-spin`}),(0,N.jsx)(`span`,{className:`text-sm`,children:`Verificando sessão…`})]})}function Cm(){let{user:e,loading:t}=Zi(),n=mt();return t?(0,N.jsx)(Sm,{}):e?(0,N.jsx)(P,{children:(0,N.jsx)(Ut,{})}):(0,N.jsx)(Ht,{to:`/login`,replace:!0,state:{from:n.pathname}})}function wm(){return(0,N.jsxs)(Kt,{children:[(0,N.jsx)(Wt,{path:`/login`,element:(0,N.jsx)(xm,{})}),(0,N.jsxs)(Wt,{element:(0,N.jsx)(Cm,{}),children:[(0,N.jsx)(Wt,{path:`/`,element:(0,N.jsx)(Kp,{})}),(0,N.jsx)(Wt,{path:`/postagens`,element:(0,N.jsx)(rm,{})}),(0,N.jsx)(Wt,{path:`/postagens/agendar`,element:(0,N.jsx)(im,{})}),(0,N.jsx)(Wt,{path:`/conexoes`,element:(0,N.jsx)(om,{})}),(0,N.jsx)(Wt,{path:`/conexoes/dm`,element:(0,N.jsx)(cm,{})}),(0,N.jsx)(Wt,{path:`/vagas`,element:(0,N.jsx)(lm,{})}),(0,N.jsx)(Wt,{path:`/vagas/candidaturas`,element:(0,N.jsx)(um,{})}),(0,N.jsx)(Wt,{path:`/integracoes`,element:(0,N.jsx)(pm,{})}),(0,N.jsx)(Wt,{path:`/config`,element:(0,N.jsx)(gm,{})}),(0,N.jsx)(Wt,{path:`/configuracoes`,element:(0,N.jsx)(gm,{})}),(0,N.jsx)(Wt,{path:`*`,element:(0,N.jsx)(Ht,{to:`/`,replace:!0})})]})]})}Wi.createRoot(document.getElementById(`root`)).render((0,N.jsx)(_.StrictMode,{children:(0,N.jsx)(Mn,{children:(0,N.jsx)(Xp,{children:(0,N.jsx)(Xi,{children:(0,N.jsx)(wm,{})})})})}));
|
|
13
|
+
`):e}function Sf(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Cf(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=ac(t.bodyFont),l=ac(t.titleFont),u=ac(t.footerFont),d=a.length,f=i.length,p=r.length,m=ic(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,B(e.title,y),n.font=c.string,B(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,B(r,e=>{B(e.before,y),B(e.lines,y),B(e.after,y)}),v=0,n.font=u.string,B(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function wf(e,t){let{y:n,height:r}=t;return n<r/2?`top`:n>e.height-r/2?`bottom`:`center`}function Tf(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function Ef(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),Tf(l,e,t,n)&&(l=`center`),l}function Df(e,t,n){let r=n.yAlign||t.yAlign||wf(e,n);return{xAlign:n.xAlign||t.xAlign||Ef(e,t,n,r),yAlign:r}}function Of(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function kf(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:r-=t===`bottom`?i+n:i/2,r}function Af(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=rc(o),m=Of(t,s),h=kf(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:Xo(m,0,r.width-t.width),y:Xo(h,0,r.height-t.height)}}function jf(e,t,n){let r=ic(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function Mf(e){return bf([],xf(e))}function Nf(e,t,n){return cc(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function Pf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var Ff={beforeTitle:so,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return``},afterTitle:so,beforeBody:so,beforeLabel:so,label(e){if(this&&this.options&&this.options.mode===`dataset`)return e.label+`: `+e.formattedValue||e.formattedValue;let t=e.dataset.label||``;t&&(t+=`: `);let n=e.formattedValue;return I(n)||(t+=n),t},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:so,afterBody:so,beforeFooter:so,footer:so,afterFooter:so};function If(e,t,n,r){let i=e[t].call(n,r);return i===void 0?Ff[t].call(n,r):i}var Lf=class extends zu{static positioners=yf;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let e=this._cachedAnimations;if(e)return e;let t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,i=new nl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||=Nf(this.chart.getContext(),this,this._tooltipItems)}getTitle(e,t){let{callbacks:n}=t,r=If(n,`beforeTitle`,this,e),i=If(n,`title`,this,e),a=If(n,`afterTitle`,this,e),o=[];return o=bf(o,xf(r)),o=bf(o,xf(i)),o=bf(o,xf(a)),o}getBeforeBody(e,t){return Mf(If(t.callbacks,`beforeBody`,this,e))}getBody(e,t){let{callbacks:n}=t,r=[];return B(e,e=>{let t={before:[],lines:[],after:[]},i=Pf(n,e);bf(t.before,xf(If(i,`beforeLabel`,this,e))),bf(t.lines,If(i,`label`,this,e)),bf(t.after,xf(If(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return Mf(If(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=If(n,`beforeFooter`,this,e),i=If(n,`footer`,this,e),a=If(n,`afterFooter`,this,e),o=[];return o=bf(o,xf(r)),o=bf(o,xf(i)),o=bf(o,xf(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;s<c;++s)o.push(Sf(this.chart,t[s]));return e.filter&&(o=o.filter((t,r,i)=>e.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),B(o,t=>{let n=Pf(e.callbacks,t);r.push(If(n,`labelColor`,this,t)),i.push(If(n,`labelPointStyle`,this,t)),a.push(If(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=yf[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=Cf(this,n),o=Object.assign({},e,t),s=Df(this.chart,n,o),c=Af(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=rc(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=Kc(n.rtl,this.x,this.width);for(e.x=jf(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=ac(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;s<i;++s)t.fillText(r[s],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+o,s+1===i&&(e.y+=n.titleMarginBottom-o)}}_drawColorBox(e,t,n,r,i){let a=this.labelColors[n],o=this.labelPointStyles[n],{boxHeight:s,boxWidth:c}=i,l=ac(i.bodyFont),u=jf(this,`left`,i),d=r.x(u),f=s<l.lineHeight?(l.lineHeight-s)/2:0,p=t.y+f;if(i.usePointStyle){let t={radius:Math.min(c,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},n=r.leftForLtr(d,c)+c/2,l=p+s/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,Vs(e,t,n,l),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,Vs(e,t,n,l)}else{e.lineWidth=R(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;let t=r.leftForLtr(d,c),n=r.leftForLtr(r.xPlus(d,1),c-2),o=rc(a.borderRadius);Object.values(o).some(e=>e!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Xs(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),Xs(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=ac(n.bodyFont),d=u.lineHeight,f=0,p=Kc(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=jf(this,h,n),t.fillStyle=n.bodyColor,B(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y<x;++y){for(g=r[y],_=this.labelTextColors[y],t.fillStyle=_,B(g.before,m),v=g.lines,o&&v.length&&(this._drawColorBox(t,e,y,p,n),d=Math.max(u.lineHeight,s)),b=0,S=v.length;b<S;++b)m(v[b]),d=u.lineHeight;B(g.after,m)}f=0,d=u.lineHeight,B(this.afterBody,m),e.y-=i}drawFooter(e,t,n){let r=this.footer,i=r.length,a,o;if(i){let s=Kc(n.rtl,this.x,this.width);for(e.x=jf(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline=`middle`,a=ac(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,o=0;o<i;++o)t.fillText(r[o],s.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){let{xAlign:i,yAlign:a}=this,{x:o,y:s}=e,{width:c,height:l}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=rc(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(o+u,s),a===`top`&&this.drawCaret(e,t,n,r),t.lineTo(o+c-d,s),t.quadraticCurveTo(o+c,s,o+c,s+d),a===`center`&&i===`right`&&this.drawCaret(e,t,n,r),t.lineTo(o+c,s+l-p),t.quadraticCurveTo(o+c,s+l,o+c-p,s+l),a===`bottom`&&this.drawCaret(e,t,n,r),t.lineTo(o+f,s+l),t.quadraticCurveTo(o,s+l,o,s+l-f),a===`center`&&i===`left`&&this.drawCaret(e,t,n,r),t.lineTo(o,s+u),t.quadraticCurveTo(o,s,o+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=yf[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=Cf(this,e),o=Object.assign({},n,this._size),s=Df(t,e,o),c=Af(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=ic(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),qc(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),Jc(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!ho(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!ho(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=yf[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},Rf={id:`tooltip`,_element:Lf,positioners:yf,afterInit(e,t,n){n&&(e.tooltip=new Lf({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:Ff},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},zf=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Bf(e,t,n,r){let i=e.indexOf(t);return i===-1?zf(e,t,n,r):i===e.lastIndexOf(t)?i:n}var Vf=(e,t)=>e===null?null:Xo(Math.round(e),0,t);function Q(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var Hf=class extends td{static id=`category`;static defaults={ticks:{callback:Q}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(I(e))return null;let n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:Bf(n,e,z(t,e),this._addedLabels),Vf(t,n.length-1)}determineDataLimits(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),{min:n,max:r}=this.getMinMax(!0);this.options.bounds===`ticks`&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){let e=this.min,t=this.max,n=this.options.offset,r=[],i=this.getLabels();i=e===0&&t===i.length-1?i:i.slice(e,t+1),this._valueRange=Math.max(i.length-+!n,1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return Q.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!=`number`&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function Uf(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!I(a),_=!I(o),v=!I(c),y=(h-m)/(u+1),b=zo((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=zo(w*b/p/f)*f),I(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&Vo((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=Ro(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(Go(b),Go(S));x=10**(I(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),S<a&&E++,Ro(Math.round((S+E*b)*x)/x,a,Wf(a,y,e))&&E++):S<a&&E++);E<w;++E){let e=Math.round((S+E*b)*x)/x;if(_&&e>o)break;n.push({value:e})}return _&&d&&C!==o?n.length&&Ro(n[n.length-1].value,o,Wf(o,y,e))?n[n.length-1].value=o:n.push({value:o}):_&&C!==o||n.push({value:C}),n}function Wf(e,t,{horizontal:n,minRotation:r}){let i=Uo(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var Gf=class extends td{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return I(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=Lo(r),t=Lo(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=Uf({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&Ho(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return Es(e,this.chart.options.locale,this.options.ticks.format)}},Kf=class extends Gf{static id=`linear`;static defaults={ticks:{callback:ks.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=lo(e)?e:0,this.max=lo(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=Uo(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},qf=e=>Math.floor(Io(e)),Jf=(e,t)=>10**(qf(e)+t);function Yf(e){return e/10**qf(e)==1}function Xf(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Zf(e,t){let n=qf(t-e);for(;Xf(e,t,n)>10;)n++;for(;Xf(e,t,n)<10;)n--;return Math.min(n,qf(e))}function Qf(e,{min:t,max:n}){t=uo(e.min,t);let r=[],i=qf(t),a=Zf(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=uo(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f<n;)r.push({value:f,major:Yf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=uo(e.max,f);return r.push({value:p,major:Yf(p),significand:d}),r}(class extends td{static id=`logarithmic`;static defaults={ticks:{callback:ks.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=Gf.prototype.parse.apply(this,[e,t]);if(n===0)this._zero=!0;else return lo(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=lo(e)?Math.max(0,e):null,this.max=lo(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!lo(this._userMin)&&(this.min=e===Jf(this.min,0)?Jf(this.min,-1):Jf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Jf(n,-1)),a(Jf(r,1)))),n<=0&&i(Jf(r,-1)),r<=0&&a(Jf(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=Qf({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&Ho(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:Es(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Io(e),this._valueRange=Io(this.max)-Io(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Io(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function $f(e){let t=e.ticks;if(t.display&&e.display){let e=ic(t.backdropPadding);return z(t.font&&t.font.size,Fs.font.size)+e.height}return 0}function ep(e,t,n){return n=L(n)?n:[n],{w:Rs(e,t.string,n),h:n.length*t.lineHeight}}function $(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function tp(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?V/a:0;for(let c=0;c<a;c++){let a=o.setContext(e.getPointLabelContext(c));i[c]=a.padding;let l=e.getPointPosition(c,e.drawingArea+i[c],s),u=ac(a.font),d=ep(e.ctx,u,e._pointLabels[c]);r[c]=d;let f=Jo(e.getIndexAngle(c)+s),p=Math.round(Wo(f));np(n,t,f,$(p,l.x,d.w,0,180),$(p,l.y,d.h,90,270))}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ap(e,r,i)}function np(e,t,n,r,i){let a=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n)),s=0,c=0;r.start<t.l?(s=(t.l-r.start)/a,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.start<t.t?(c=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function rp(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(Wo(Jo(c.angle+No))),u=cp(c.y,s.h,l),d=op(l),f=sp(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function ip(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(Us({x:n,y:r},t)||Us({x:n,y:a},t)||Us({x:i,y:r},t)||Us({x:i,y:a},t))}function ap(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:$f(a)/2,additionalAngle:o?V/i:0},l;for(let a=0;a<i;a++){c.padding=n[a],c.size=t[a];let i=rp(e,a,c);r.push(i),s===`auto`&&(i.visible=ip(i,l),i.visible&&(l=i))}return r}function op(e){return e===0||e===180?`center`:e<180?`left`:`right`}function sp(e,t,n){return n===`right`?e-=t:n===`center`&&(e-=t/2),e}function cp(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function lp(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!I(s)){let n=rc(t.borderRadius),c=ic(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),Xs(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function up(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));lp(n,a,t);let o=ac(a.font),{x:s,y:c,textAlign:l}=t;Ys(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function dp(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,H);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a<r;a++)n=e.getPointPosition(a,t),i.lineTo(n.x,n.y)}}function fp(e,t,n,r,i){let a=e.ctx,o=t.circular,{color:s,lineWidth:c}=t;!o&&!r||!s||!c||n<0||(a.save(),a.strokeStyle=s,a.lineWidth=c,a.setLineDash(i.dash||[]),a.lineDashOffset=i.dashOffset,a.beginPath(),dp(e,n,o,r),a.closePath(),a.stroke(),a.restore())}function pp(e,t,n){return cc(e,{label:n,index:t,type:`pointLabel`})}(class extends Gf{static id=`radialLinear`;static defaults={display:!0,animate:!0,position:`chartArea`,angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":`borderColor`,"pointLabels.color":`color`,"ticks.color":`color`};static descriptors={angleLines:{_fallback:`grid`}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=ic($f(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=lo(e)&&!isNaN(e)?e:0,this.max=lo(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/$f(this.options))}generateTickLabels(e){Gf.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((e,t)=>{let n=mo(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?tp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=H/(this._pointLabels.length||1),n=this.options.startAngle||0;return Jo(e*t+Uo(n))}getDistanceFromCenterForValue(e){if(I(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(I(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let n=t[e];return pp(this.getContext(),e,n)}}getPointPosition(e,t,n=0){let r=this.getIndexAngle(e)-No+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:n,right:r,bottom:i}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:i}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let n=this.ctx;n.save(),n.beginPath(),dp(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:n,grid:r,border:i}=t,a=this._pointLabels.length,o,s,c;if(t.pointLabels.display&&up(this,a),r.display&&this.ticks.forEach((e,t)=>{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);fp(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;a&&i&&(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=ac(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=ic(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}Ys(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var mp={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hp=Object.keys(mp);function gp(e,t){return e-t}function _p(e,t){if(I(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),lo(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(W(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function vp(e,t,n,r){let i=hp.length;for(let a=hp.indexOf(e);a<i-1;++a){let e=mp[hp[a]],i=e.steps?e.steps:2**53-1;if(e.common&&Math.ceil((n-t)/(i*e.size))<=r)return hp[a]}return hp[i-1]}function yp(e,t,n,r,i){for(let a=hp.length-1;a>=hp.indexOf(n);a--){let n=hp[a];if(mp[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return hp[n?hp.indexOf(n):0]}function bp(e){for(let t=hp.indexOf(e)+1,n=hp.length;t<n;++t)if(mp[hp[t]].common)return hp[t]}function xp(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:r,hi:i}=$o(n,t),a=n[r]>=t?n[r]:n[i];e[a]=!0}}function Sp(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Cp(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o<a;++o)s=t[o],i[s]=o,r.push({value:s,major:!1});return a===0||!n?r:Sp(e,r,i,n)}var wp=class extends td{static id=`time`;static defaults={bounds:`data`,adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:`millisecond`,displayFormats:{}},ticks:{source:`auto`,callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit=`day`,this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){let n=e.time||={},r=this._adapter=new Wl._date(e.adapters.date);r.init(t),bo(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:_p(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let e=this.options,t=this._adapter,n=e.time.unit||`day`,{min:r,max:i,minDefined:a,maxDefined:o}=this.getUserBounds();function s(e){!a&&!isNaN(e.min)&&(r=Math.min(r,e.min)),!o&&!isNaN(e.max)&&(i=Math.max(i,e.max))}a&&o||(s(this._getLabelBounds()),(e.bounds!==`ticks`||e.ticks.source!==`labels`)&&s(this.getMinMax(!1))),r=lo(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),i=lo(i)&&!isNaN(i)?i:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,i-1),this.max=Math.max(r+1,i)}_getLabelBounds(){let e=this.getLabelTimestamps(),t=1/0,n=-1/0;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){let e=this.options,t=e.time,n=e.ticks,r=n.source===`labels`?this.getLabelTimestamps():this._generate();e.bounds===`ticks`&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);let i=this.min,a=this.max,o=ns(r,i,a);return this._unit=t.unit||(n.autoSkip?vp(t.minUnit,this.min,this.max,this._getLabelCapacity(i)):yp(this,o.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit===`year`?void 0:bp(this._unit),this.initOffsets(r),e.reverse&&o.reverse(),Cp(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=Xo(t,0,a),n=Xo(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||vp(i.minUnit,t,n,this._getLabelCapacity(t)),o=z(r.ticks.stepSize,1),s=a===`week`&&i.isoWeekday,c=W(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+e.add(d,o,a),f++)xp(l,d,p);return(d===n||r.bounds===`ticks`||f===1)&&xp(l,d,p),Object.keys(l).sort(gp).map(e=>+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return mo(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){let t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){let t=this.options.ticks,n=this.ctx.measureText(e).width,r=Uo(this.isHorizontal()?t.maxRotation:t.minRotation),i=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:n*i+o*a,h:n*a+o*i}}_getLabelCapacity(e){let t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,i=this._tickFormatFunction(e,0,Cp(this,[e],this._majorUnit),r),a=this._getLabelSize(i),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t<n;++t)e=e.concat(r[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){let e=this._cache.labels||[],t,n;if(e.length)return e;let r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(_p(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return os(e.sort(gp))}};function Tp(e,t,n){let r=0,i=e.length-1,a,o,s,c;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=es(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=es(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends wp{static id=`timeseries`;static defaults=wp.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Tp(t,this.min),this._tableRange=Tp(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a<o;++a)c=e[a],c>=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;a<o;++a)l=r[a+1],s=r[a-1],c=r[a],Math.round((l+s)/2)!==c&&i.push({time:c,pos:a/(o-1)});return i}_generate(){let e=this.min,t=this.max,n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&n.length!==1||n.push(t),n.sort((e,t)=>e-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Tp(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Tp(this._table,n*this._tableRange+this._minPos,!0)}});var Ep=`label`;function Dp(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function Op(e,t){let n=e.options;n&&t&&Object.assign(n,t)}function kp(e,t){e.labels=t}function Ap(e,t,n=Ep){let r=[];e.datasets=t.map(t=>{let i=e.datasets.find(e=>e[n]===t[n]);return!i||!t.data||r.includes(i)?{...t}:(r.push(i),Object.assign(i,t),i)})}function jp(e,t=Ep){let n={labels:[],datasets:[]};return kp(n,e.labels),Ap(n,e.datasets,t),n}function Mp(e,t){let{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:a,type:o,data:s,options:c,plugins:l=[],fallbackContent:u,updateMode:d,...f}=e,p=(0,_.useRef)(null),m=(0,_.useRef)(null),h=()=>{p.current&&(m.current=new Hd(p.current,{type:o,data:jp(s,a),options:c&&{...c},plugins:l}),Dp(t,m.current))},g=()=>{Dp(t,null),m.current&&=(m.current.destroy(),null)};return(0,_.useEffect)(()=>{!i&&m.current&&c&&Op(m.current,c)},[i,c]),(0,_.useEffect)(()=>{!i&&m.current&&kp(m.current.config.data,s.labels)},[i,s.labels]),(0,_.useEffect)(()=>{!i&&m.current&&s.datasets&&Ap(m.current.config.data,s.datasets,a)},[i,s.datasets]),(0,_.useEffect)(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,c,s.labels,s.datasets,d]),(0,_.useEffect)(()=>{m.current&&(g(),setTimeout(h))},[o]),(0,_.useEffect)(()=>(h(),()=>g()),[]),(0,N.jsx)(`canvas`,{ref:p,role:`img`,height:n,width:r,...f,children:u})}var Np=(0,_.forwardRef)(Mp);function Pp(e,t){return Hd.register(t),(0,_.forwardRef)((t,n)=>(0,N.jsx)(Np,{...t,ref:n,type:e}))}var Fp=Pp(`bar`,Bl),Ip=Pp(`doughnut`,Hl);Hd.register(Hf,Kf,uf,$d,Rf,vf),Hd.defaults.font.family=`'Inter Variable', 'Inter', sans-serif`,Hd.defaults.color=`#6b7280`;var Lp={indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{beginAtZero:!0,grid:{color:`#f3f4f6`},ticks:{precision:0}},y:{grid:{display:!1}}}},Rp={responsive:!0,maintainAspectRatio:!1,cutout:`70%`,plugins:{legend:{display:!1}}};function zp({data:e,color:t=`rgba(99, 102, 241, 0.8)`}){let n=(0,_.useMemo)(()=>({labels:e.map(e=>e.label),datasets:[{label:`Quantidade`,data:e.map(e=>e.value),backgroundColor:t,borderRadius:4,barThickness:20}]}),[e,t]);return!e.length||e.every(e=>e.value===0)?(0,N.jsx)(`p`,{className:`py-8 text-center text-xs text-gray-400`,children:`Sem dados no período.`}):(0,N.jsx)(`div`,{className:`chart-box`,children:(0,N.jsx)(Fp,{data:n,options:Lp})})}function Bp({data:e}){let t=(0,_.useMemo)(()=>({labels:e.map(e=>e.label),datasets:[{data:e.map(e=>e.value),backgroundColor:e.map(e=>e.color),borderWidth:0}]}),[e]);return!e.length||e.every(e=>e.value===0)?(0,N.jsx)(`p`,{className:`py-8 text-center text-xs text-gray-400`,children:`Sem dados no período.`}):(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`div`,{className:`chart-box flex items-center justify-center`,children:(0,N.jsx)(Ip,{data:t,options:Rp})}),(0,N.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center justify-center gap-4 text-xs text-gray-500`,children:e.map(e=>(0,N.jsxs)(`span`,{className:`flex items-center`,children:[(0,N.jsx)(`span`,{className:`mr-1.5 inline-block h-2.5 w-2.5 rounded-full`,style:{backgroundColor:e.color}}),e.label,`: `,(0,N.jsx)(`strong`,{className:`ml-1 text-gray-700`,children:e.value})]},e.label))})]})}var Vp=new Intl.DateTimeFormat(`pt-BR`,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`});new Intl.DateTimeFormat(`pt-BR`,{day:`2-digit`,month:`2-digit`});function Hp(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:Vp.format(t)}function Up(e){if(!e)return`—`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`—`;let n=t.getTime()-Date.now(),r=Math.abs(n),i=new Intl.RelativeTimeFormat(`pt-BR`,{numeric:`auto`});for(let[e,t]of[[`day`,864e5],[`hour`,36e5],[`minute`,6e4]])if(r>=t)return i.format(Math.round(n/t),e);return i.format(Math.round(n/6e4),`minute`)}function Wp(e){return e>=75?`text-green-600`:e>=50?`text-amber-600`:e>0?`text-red-600`:`text-gray-400`}function Gp(e){return e>=75?`bg-green-500`:e>=50?`bg-amber-500`:e>0?`bg-red-500`:`bg-gray-300`}function Kp(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(null),o=async()=>{try{a(null),t(await M.get(`/dashboard`))}catch(e){a(e.message)}finally{r(!1)}};if((0,_.useEffect)(()=>{o()},[]),n)return(0,N.jsx)(pa,{label:`Carregando painel…`});if(i)return(0,N.jsx)(ma,{icon:zi,title:`Servidor indisponível`,hint:i,action:(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:o,children:`Tentar novamente`})});if(!e)return null;let s=e.applications.byStatus??{},c=e.posts.byStatus??{};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h1`,{className:`text-2xl font-bold text-gray-800`,children:`Olá 👋 bem-vindo ao seu painel`}),(0,N.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:e.dryRun?`Modo dry-run ativo — tudo é simulado até você conectar o LinkedIn em Integrações e desativar o dry-run.`:`Modo ativo — as ações serão enviadas de verdade ao LinkedIn.`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2 xl:grid-cols-4`,children:[(0,N.jsx)(F,{label:`Conexão LinkedIn`,value:e.connection.connected?`Conectado`:`Dry-run`,hint:`Modo: ${e.connection.mode}${e.connection.channel?` · ${e.connection.channel}`:``}`,icon:zi,tone:e.connection.connected?`text-green-600`:`text-amber-600`}),(0,N.jsx)(F,{label:`Postagens publicadas (7d)`,value:e.posts.publishedLast7Days,hint:`${c.scheduled??0} agendadas`,icon:ti}),(0,N.jsx)(F,{label:`Convites enviados`,value:e.connections.sent,hint:`${e.connections.quota.remaining} restantes esta semana`,icon:Fi}),(0,N.jsx)(F,{label:`DMs hoje`,value:e.dms.daily.used,hint:`limite: ${e.dms.daily.limit}/dia`,icon:Zr})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(fa,{used:e.connections.quota.used,limit:e.connections.quota.limit,label:`Convites esta semana`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[`Restam `,(0,N.jsx)(`strong`,{className:`text-gray-600`,children:e.connections.quota.remaining}),` convites antes do limite semanal.`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(fa,{used:e.dms.daily.used,limit:e.dms.daily.limit,label:`DMs hoje`,tone:`bg-purple-500`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[e.dms.stepsPending,` mensagens pendentes nas cascatas ativas (`,e.dms.activeCascades,` ativas).`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(fa,{used:e.applications.quota.used,limit:e.applications.quota.limit,label:`Candidaturas hoje`,tone:`bg-emerald-500`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[e.jobs.saved??e.jobs.total,` vagas salvas · match médio `,e.jobs.averageScore]})]})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Postagens publicadas (7 dias)`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Uma publicação por dia mantém o algoritmo favorável.`})]}),(0,N.jsxs)(`button`,{className:`text-xs font-medium text-indigo-600 hover:text-indigo-800`,onClick:o,children:[(0,N.jsx)(di,{className:`mr-1 inline h-3 w-3`}),`Atualizar`]})]}),(0,N.jsx)(`div`,{className:`mt-4`,children:(0,N.jsx)(zp,{data:(e.posts.series??[]).map(e=>({label:e.day.slice(5),value:e.count}))})})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`div`,{className:`flex items-start justify-between`,children:(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Candidaturas por status`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Sucesso, intervenção manual e falhas ficam isolados em vermelho.`})]})}),(0,N.jsx)(`div`,{className:`mt-4`,children:(0,N.jsx)(Bp,{data:[{label:`Enviadas`,value:s.submitted??0,color:`#3b82f6`},{label:`Dry-run`,value:s.dry_run??0,color:`#a5b4fc`},{label:`Intervenção`,value:s.needs_intervention??0,color:`#f59e0b`},{label:`Falhas`,value:s.failed??0,color:`#ef4444`}]})})]})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card lg:col-span-2`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Onboarding (checklist)`}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsx)(qp,{done:!!e.connection.connected,label:`Conectar o LinkedIn (API oficial ou cookies)`,children:(0,N.jsx)(Nn,{to:`/integracoes`,className:`text-indigo-600 hover:text-indigo-800`,children:`Abrir Integrações`})}),(0,N.jsx)(qp,{done:!e.dryRun,label:`Desativar o dry-run em Configurações`,children:(0,N.jsx)(Nn,{to:`/config`,className:`text-indigo-600 hover:text-indigo-800`,children:`Abrir Configurações`})}),(0,N.jsx)(qp,{done:!!e.jobs.resumeLoaded,label:`Enviar seu currículo para o match de vagas`,children:(0,N.jsx)(Nn,{to:`/vagas`,className:`text-indigo-600 hover:text-indigo-800`,children:`Enviar currículo`})}),(0,N.jsx)(qp,{done:(e.posts.byStatus?.published??0)>0,label:`Publicar ou agendar a primeira postagem`,children:(0,N.jsx)(Nn,{to:`/postagens`,className:`text-indigo-600 hover:text-indigo-800`,children:`Escrever post`})}),(0,N.jsx)(qp,{done:e.connections.sent>0,label:`Enviar o primeiro convite de conexão`,children:(0,N.jsx)(Nn,{to:`/conexoes`,className:`text-indigo-600 hover:text-indigo-800`,children:`Buscar pessoas`})})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`h3`,{className:`flex items-center gap-2 text-base font-semibold text-gray-800`,children:[(0,N.jsx)(ar,{className:`h-4 w-4 text-gray-400`}),`Atividade recente`]}),(0,N.jsxs)(`ul`,{className:`mt-4 space-y-3`,children:[(e.logs??[]).slice(0,8).map((e,t)=>(0,N.jsxs)(`li`,{className:`border-b border-gray-50 pb-2 text-xs last:border-0`,children:[(0,N.jsx)(`span`,{className:`font-medium text-gray-600`,children:e.module}),` `,(0,N.jsx)(`span`,{className:`text-gray-500`,children:e.message}),(0,N.jsx)(`div`,{className:`text-[10px] text-gray-400`,children:Up(e.ts)})]},t)),!e.logs?.length&&(0,N.jsx)(`li`,{className:`text-xs text-gray-400`,children:`Nenhuma atividade ainda.`})]})]})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs text-gray-500`,children:[(0,N.jsx)(`span`,{className:`font-semibold uppercase tracking-wide text-gray-400`,children:`Resumo`}),(0,N.jsxs)(`span`,{children:[`Postagens: `,e.posts.total]}),(0,N.jsxs)(`span`,{children:[`Conexões: `,e.connections.total]}),(0,N.jsxs)(`span`,{children:[`Cascatas: `,e.dms.cascades]}),(0,N.jsxs)(`span`,{children:[`Vagas: `,e.jobs.total]}),(0,N.jsxs)(`span`,{children:[`Candidaturas: `,e.applications.total]}),(0,N.jsxs)(`span`,{children:[`Atualizado: `,Hp(new Date().toISOString())]})]})]})}function qp({done:e,label:t,children:n}){return(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(`span`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-bold ${e?`bg-green-100 text-green-700`:`bg-gray-100 text-gray-400`}`,children:e?`✓`:`•`}),(0,N.jsx)(`span`,{className:`flex-1 text-sm ${e?`text-gray-400 line-through`:`text-gray-700`}`,children:t}),!e&&(0,N.jsx)(`span`,{className:`text-xs font-medium`,children:n})]})}var Jp=(0,_.createContext)(null),Yp=0;function Xp({children:e}){let[t,n]=(0,_.useState)([]),r=(0,_.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),i=(0,_.useCallback)((e,t)=>{Yp+=1;let i=Yp;n(n=>[...n,{id:i,tone:e,message:t}]),setTimeout(()=>r(i),4500)},[r]),a=(0,_.useMemo)(()=>({success:e=>i(`success`,e),error:e=>i(`error`,e),info:e=>i(`info`,e)}),[i]),o={success:`border-green-200 bg-green-50 text-green-800`,error:`border-red-200 bg-red-50 text-red-700`,info:`border-indigo-200 bg-indigo-50 text-indigo-800`};return(0,N.jsxs)(Jp.Provider,{value:a,children:[e,(0,N.jsx)(`div`,{className:`pointer-events-none fixed bottom-6 right-6 z-50 flex w-80 flex-col gap-2`,children:t.map(e=>(0,N.jsx)(`div`,{role:`status`,className:`pointer-events-auto rounded-lg border px-4 py-3 text-sm shadow-lg ${o[e.tone]}`,children:e.message},e.id))})]})}function Zp(){let e=(0,_.useContext)(Jp);if(!e)throw Error(`useToast must be used inside ToastProvider`);return e}var Qp={published:`bg-green-100 text-green-800`,sent:`bg-green-100 text-green-800`,submitted:`bg-green-100 text-green-800`,active:`bg-green-100 text-green-800`,dry_run:`bg-indigo-100 text-indigo-700`,draft:`bg-gray-100 text-gray-700`,scheduled:`bg-amber-100 text-amber-800`,pending:`bg-gray-100 text-gray-700`,failed:`bg-red-100 text-red-700`,blocked:`bg-red-100 text-red-700`,cancelled:`bg-gray-100 text-gray-500`,completed:`bg-green-100 text-green-800`,paused:`bg-amber-100 text-amber-800`,waiting_reply:`bg-indigo-100 text-indigo-700`,needs_intervention:`bg-amber-100 text-amber-800`,saved:`bg-green-100 text-green-800`,discarded:`bg-gray-100 text-gray-500`,applied:`bg-indigo-100 text-indigo-700`,untested:`bg-gray-100 text-gray-500`,inactive:`bg-gray-100 text-gray-500`,simulated:`bg-indigo-100 text-indigo-700`},$p={published:`Publicado`,sent:`Enviado`,submitted:`Enviada`,active:`Ativo`,dry_run:`Dry-run`,draft:`Rascunho`,scheduled:`Agendado`,pending:`Pendente`,failed:`Falha`,blocked:`Bloqueado`,cancelled:`Cancelado`,completed:`Concluído`,paused:`Pausado`,waiting_reply:`Aguardando resposta`,needs_intervention:`Intervenção manual`,saved:`Salva`,discarded:`Descartada`,applied:`Candidatado`,untested:`Não testado`,inactive:`Inativo`,simulated:`Simulado`};function em({status:e,simulated:t}){let n=Qp[e]??`bg-gray-100 text-gray-600`,r=$p[e]??e;return(0,N.jsxs)(`span`,{className:`badge ${n}`,children:[e===`failed`&&(0,N.jsx)(`span`,{className:`mr-1.5 inline-block h-2 w-2 rounded-full bg-red-500`}),r,t&&e!==`dry_run`&&` · simulado`]})}var tm=3e3,nm=[[``,`Todos`],[`draft`,`Rascunhos`],[`scheduled`,`Agendados`],[`published`,`Publicados`],[`failed`,`Falhas`],[`cancelled`,`Cancelados`]];function rm(){let e=Zp(),[t,n]=(0,_.useState)({items:[],total:0,page:1}),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(1),[p,m]=(0,_.useState)(!0),[h,g]=(0,_.useState)(``),[v,y]=(0,_.useState)(!1),b=(0,_.useCallback)(async()=>{m(!0);try{let[e,t,r]=await Promise.all([M.get(`/posts`,{query:{status:s,topicId:l,page:d,limit:10}}),M.get(`/posts/stats`),M.get(`/topics`)]);n(e),i(t),o(r.topics)}catch(t){e.error(`Falha ao carregar postagens: ${t.message}`)}finally{m(!1)}},[s,l,d,e]);(0,_.useEffect)(()=>{b()},[b]);let x=async()=>{if(!h.trim())e.error(`Escreva o texto do post.`);else try{await M.post(`/posts`,{text:h}),g(``),e.success(`Rascunho criado. Publique quando estiver pronto.`),b()}catch(t){e.error(t.message)}},S=async t=>{y(t);try{await M.post(`/posts/${t}/publish`),e.success(`Postagem publicada!`),b()}catch(t){e.error(`Falha ao publicar: ${t.message}`)}finally{y(null)}},C=async t=>{try{await M.post(`/posts/${t}/cancel`),e.info(`Agendamento cancelado.`),b()}catch(t){e.error(t.message)}},w=async t=>{try{await M.del(`/posts/${t}`),e.info(`Postagem removida.`),b()}catch(t){e.error(t.message)}},T=async t=>{let n=window.prompt(`Agendar para (YYYY-MM-DDTHH:MM):`,new Date(Date.now()+36e5).toISOString().slice(0,16));if(n)try{await M.post(`/posts/${t}/schedule`,{scheduledAt:new Date(n).toISOString()}),e.success(`Postagem agendada.`),b()}catch(t){e.error(t.message)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsx)(F,{label:`Publicadas`,value:r?.byStatus?.published??0,hint:`total no histórico`}),(0,N.jsx)(F,{label:`Agendadas`,value:r?.byStatus?.scheduled??0,hint:`próximas 24h+`}),(0,N.jsx)(F,{label:`Rascunhos`,value:r?.byStatus?.draft??0,hint:`aguardando revisão`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Nova postagem manual`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Texto puro — o LinkedIn não aceita markdown. Preview obrigatório antes de publicar.`}),(0,N.jsx)(`textarea`,{className:`input mt-4 h-64 resize-y`,placeholder:`Escreva sua postagem aqui…`,value:h,onChange:e=>g(e.target.value)}),(0,N.jsxs)(`div`,{className:`mt-2 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Limite LinkedIn: `,tm]}),(0,N.jsxs)(`span`,{className:h.length>tm?`font-bold text-red-600`:``,children:[h.length,` / `,tm]})]}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:x,disabled:!h.trim()||h.length>tm,children:[(0,N.jsx)(ti,{className:`h-4 w-4`}),`Salvar rascunho`]}),(0,N.jsx)(`span`,{className:`self-center text-xs text-gray-400`,children:`Publique pelo botão no histórico →`})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Preview`}),(0,N.jsx)(`div`,{className:`mt-4 max-h-64 overflow-y-auto rounded-lg border border-gray-100 bg-gray-50 p-4 text-sm whitespace-pre-wrap text-gray-700`,children:h||(0,N.jsx)(`span`,{className:`text-gray-400`,children:`O preview aparece aqui conforme você digita.`})}),(0,N.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,N.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-indigo-100 text-xs font-bold text-indigo-600`,children:`JF`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-700`,children:`Você`}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:`Publicar agora · visível para todos`})]})]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Histórico`}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`select`,{className:`input w-auto`,value:s,onChange:e=>{c(e.target.value),f(1)},children:nm.map(([e,t])=>(0,N.jsx)(`option`,{value:e,children:t},e))}),(0,N.jsxs)(`select`,{className:`input w-auto`,value:l,onChange:e=>{u(e.target.value),f(1)},children:[(0,N.jsx)(`option`,{value:``,children:`Todos os temas`}),a.map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})]}),p?(0,N.jsx)(pa,{}):t.items.length===0?(0,N.jsx)(ma,{icon:ti,title:`Nenhuma postagem encontrada`,hint:`Crie um rascunho acima, gere com LLM em Postagens > Agendar ou ajuste os filtros.`}):(0,N.jsx)(`div`,{className:`mt-4 overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400`,children:[(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Tema`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Texto`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Status`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Data`}),(0,N.jsx)(`th`,{className:`pb-2 text-right`,children:`Ações`})]})}),(0,N.jsx)(`tbody`,{children:t.items.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-gray-50 last:border-0`,children:[(0,N.jsx)(`td`,{className:`py-3 pr-4 text-gray-600`,children:e.topicName??`—`}),(0,N.jsxs)(`td`,{className:`max-w-xs py-3 pr-4`,children:[(0,N.jsxs)(`p`,{className:`truncate text-gray-700`,title:e.text,children:[e.text.slice(0,80),e.text.length>80?`…`:``]}),e.error&&(0,N.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:e.error})]}),(0,N.jsx)(`td`,{className:`py-3 pr-4`,children:(0,N.jsx)(em,{status:e.status,simulated:e.simulated})}),(0,N.jsx)(`td`,{className:`py-3 pr-4 text-xs text-gray-500`,children:e.publishedAt?`Publicado ${Hp(e.publishedAt)}`:e.scheduledAt?`Agendado ${Hp(e.scheduledAt)}`:Hp(e.createdAt)}),(0,N.jsx)(`td`,{className:`py-3 text-right`,children:(0,N.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[[`draft`,`failed`].includes(e.status)&&(0,N.jsx)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>S(e.id),disabled:v===e.id,title:`Publicar agora`,children:(0,N.jsx)(_i,{className:`h-3.5 w-3.5`})}),[`draft`,`failed`].includes(e.status)&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>T(e.id),title:`Agendar`,children:(0,N.jsx)(pr,{className:`h-3.5 w-3.5`})}),e.status===`scheduled`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>C(e.id),title:`Cancelar agendamento`,children:(0,N.jsx)(Tr,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>w(e.id),title:`Excluir`,children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})})]},e.id))})]})}),t.total>t.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,t.page,` · `,t.total,` registros`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:d<=1,onClick:()=>f(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:d*t.limit>=t.total,onClick:()=>f(e=>e+1),children:`Próxima`})]})]})]}),(0,N.jsxs)(`p`,{className:`flex items-center gap-1 text-xs text-gray-400`,children:[(0,N.jsx)(Ti,{className:`h-3.5 w-3.5`}),`Para gerar posts com LLM a partir de temas, use a tela Agendar.`]})]})}function im(){let e=Zp(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(``),h=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/topics`),M.get(`/posts`,{query:{status:`scheduled`,limit:20}})]);n(e.topics),i(t.items)}catch(t){e.error(`Falha ao carregar: ${t.message}`)}},[e]);(0,_.useEffect)(()=>{h()},[h]);let g=async()=>{if(!s)e.error(`Selecione um tema.`);else{f(!0);try{let t=await M.post(`/posts/generate`,{topicId:s,instructions:l});o(t.post),e.success(`Texto gerado (${t.generated.provider}/${t.generated.model}, ${t.generated.chars} caracteres). Revise o preview.`)}catch(t){e.error(`Geração falhou: ${t.message}`)}finally{f(!1)}}},v=async()=>{if(a)try{await M.post(`/posts/${a.id}/publish`),e.success(`Postagem publicada!`),o(null),h()}catch(t){e.error(`Falha ao publicar: ${t.message}`)}},y=async()=>{if(a){if(!p)e.error(`Escolha data e hora.`);else try{await M.post(`/posts/${a.id}/schedule`,{scheduledAt:new Date(p).toISOString()}),e.success(`Postagem agendada com sucesso.`),o(null),m(``),h()}catch(t){e.error(t.message)}}},b=async t=>{try{await M.post(`/posts/${t}/cancel`),e.info(`Agendamento cancelado.`),h()}catch(t){e.error(t.message)}},x=async t=>{try{await M.del(`/posts/${t}`),h()}catch(t){e.error(t.message)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Temas pré-definidos`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`A LLM escreve o post a partir do tema e das diretrizes. Gerencie a lista em Configurações › Temas.`}),(0,N.jsx)(`div`,{className:`mt-4 grid grid-cols-1 gap-3 md:grid-cols-3`,children:t.map(e=>(0,N.jsxs)(`button`,{onClick:()=>c(e.id),className:`rounded-xl border p-4 text-left transition ${s===e.id?`border-indigo-400 bg-indigo-50`:`border-gray-100 bg-white hover:border-gray-300`}`,children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:e.name}),(0,N.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs text-gray-500`,children:e.prompt||`Sem diretriz adicional`}),(0,N.jsxs)(`p`,{className:`mt-2 text-[10px] uppercase tracking-wide text-gray-400`,children:[e.postsCount??0,` posts gerados`]})]},e.id))})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Gerar post com LLM`}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`topic`,children:`Tema`}),(0,N.jsxs)(`select`,{id:`topic`,className:`input`,value:s,onChange:e=>c(e.target.value),children:[(0,N.jsx)(`option`,{value:``,children:`Selecione…`}),t.map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`instructions`,children:`Instruções adicionais (opcional)`}),(0,N.jsx)(`textarea`,{id:`instructions`,className:`input h-24 resize-y`,placeholder:`Ex.: mencione que estou contratando para a vaga de dev sênior`,value:l,onChange:e=>u(e.target.value)}),(0,N.jsxs)(`button`,{className:`btn-primary mt-4`,onClick:g,disabled:d||!s,children:[(0,N.jsx)(Li,{className:`h-4 w-4`}),d?`Gerando…`:`Gerar e revisar`]}),(0,N.jsx)(`p`,{className:`mt-2 text-xs text-gray-400`,children:`A publicação só acontece após a sua aprovação no preview. Provedor configurado em Configurações › LLM.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Preview do rascunho`}),a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`mt-4 max-h-56 overflow-y-auto rounded-lg border border-gray-100 bg-gray-50 p-4 text-sm whitespace-pre-wrap text-gray-700`,children:a.text}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-gray-400`,children:[a.text.length,` caracteres · gerado por `,a.generatedBy?.provider??`LLM`,` / `,a.generatedBy?.model??`—`]}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-end gap-2`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`scheduleAt`,children:`Agendar para`}),(0,N.jsx)(`input`,{id:`scheduleAt`,type:`datetime-local`,className:`input`,value:p,onChange:e=>m(e.target.value)})]}),(0,N.jsxs)(`button`,{className:`btn-secondary`,onClick:y,children:[(0,N.jsx)(pr,{className:`h-4 w-4`}),`Agendar`]}),(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:v,children:[(0,N.jsx)(Ti,{className:`h-4 w-4`}),`Publicar agora`]})]})]}):(0,N.jsx)(`p`,{className:`mt-4 rounded-lg border border-dashed border-gray-200 p-6 text-center text-xs text-gray-400`,children:`Gere um texto para visualizar o preview aqui.`})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Fila de agendamentos`}),(0,N.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[r.length,` pendentes`]})]}),r.length===0?(0,N.jsx)(ma,{icon:pr,title:`Nenhum agendamento`,hint:`Gere um post com LLM e agende a publicação para uma data futura.`}):(0,N.jsx)(`ul`,{className:`mt-4 space-y-3`,children:r.map(e=>(0,N.jsxs)(`li`,{className:`rounded-lg border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`p`,{className:`truncate text-sm font-medium text-gray-700`,children:e.text.slice(0,90)}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-400`,children:[e.topicName??`Manual`,` · `,Hp(e.scheduledAt)]})]}),(0,N.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,N.jsx)(em,{status:e.status,simulated:e.simulated}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id),title:`Cancelar`,children:(0,N.jsx)(Tr,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>x(e.id),title:`Excluir`,children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})]}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(da,{percent:Math.max(0,Math.min(100,100-(new Date(e.scheduledAt)-Date.now())/36e5*10)),label:`Tempo até a publicação`,showPercent:!1})})]},e.id))})]})]})}var am=`Oi {{nome}}, acompanho seu trabalho na {{empresa}}. Adorei sua atuação como {{cargo}} — vamos conectar?`;function om(){let e=Zp(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(am),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(new Set),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)({items:[],total:0,page:1,limit:20}),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(1),b=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/connections`,{query:{page:v,limit:10}}),M.get(`/connections/limits`)]);m(e),g(t.invitations)}catch(t){e.error(`Falha ao carregar histórico: ${t.message}`)}},[v,e]);(0,_.useEffect)(()=>{b()},[b]);let x=async()=>{if(!t.trim())e.error(`Digite uma palavra-chave (cargo, empresa, skill ou localização).`);else{u(!0);try{let n=await M.post(`/connections/search`,{keyword:t});o(n.profiles),c(new Set),n.simulated&&e.info(`Dry-run: resultados simulados para você explorar a interface.`)}catch(t){e.error(`Busca falhou: ${t.message}`)}finally{u(!1)}}},S=e=>{c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsx)(F,{label:`Convites enviados`,value:p.total,hint:`total no histórico`}),(0,N.jsx)(F,{label:`Restam esta semana`,value:h?.remaining??`—`,hint:`limite: ${h?.limit??100}`}),(0,N.jsx)(F,{label:`Perfis na busca`,value:a.length,hint:`${s.size} selecionados`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Networking por palavra-chave`}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,N.jsx)(`input`,{className:`input max-w-md`,placeholder:`Ex.: tech recruiter, engenheiro de dados, product manager São Paulo`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&x()}),(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:x,disabled:l,children:[(0,N.jsx)(hi,{className:`h-4 w-4`}),l?`Buscando…`:`Buscar perfis`]}),(0,N.jsxs)(`button`,{className:`btn-secondary`,onClick:()=>c(new Set(a.map(e=>e.profileId))),disabled:!a.length,children:[(0,N.jsx)(yr,{className:`h-4 w-4`}),`Selecionar todos`]}),(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>c(new Set),disabled:!s.size,children:`Limpar seleção`})]}),l&&(0,N.jsx)(pa,{label:`Buscando perfis…`}),!l&&a.length>0&&(0,N.jsx)(`ul`,{className:`mt-4 divide-y divide-gray-50`,children:a.map(e=>(0,N.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:s.has(e.profileId),onChange:()=>S(e.profileId)}),(0,N.jsxs)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-indigo-100 text-sm font-bold text-indigo-600`,children:[e.firstName?.[0]??`?`,e.lastName?.[0]??``]}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`p`,{className:`text-sm font-medium text-gray-800`,children:[e.firstName,` `,e.lastName]}),(0,N.jsxs)(`p`,{className:`truncate text-xs text-gray-500`,children:[e.headline,` · `,e.location]})]}),e.simulated&&(0,N.jsx)(`span`,{className:`badge bg-indigo-50 text-indigo-500`,children:`simulado`})]},e.profileId))}),!l&&a.length===0&&(0,N.jsx)(`p`,{className:`mt-4 text-xs text-gray-400`,children:`Nenhuma busca ainda. Os resultados aparecem aqui para seleção individual ou em lote.`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Mensagem do convite`}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Variáveis suportadas: `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`{{nome}}`}),`, `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`{{empresa}}`}),`, `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`{{cargo}}`}),` · limite de 300 caracteres do LinkedIn.`]}),(0,N.jsx)(`textarea`,{className:`input mt-4 h-40 resize-y`,value:r,onChange:e=>i(e.target.value)}),(0,N.jsxs)(`div`,{className:`mt-2 text-right text-xs text-gray-500`,children:[r.length,` / 300`]}),(0,N.jsxs)(`button`,{className:`btn-primary mt-2 w-full`,onClick:async()=>{if(!s.size)e.error(`Selecione ao menos um perfil.`);else{f(!0);try{let t=a.filter(e=>s.has(e.profileId)),n=await M.post(`/connections/invitations`,{profiles:t,message:r}),i=n.results.filter(e=>e.status===`sent`).length,o=n.results.filter(e=>e.status===`blocked`).length,l=n.results.filter(e=>e.status===`failed`).length;e.success(`Convites enviados: ${i}${o?` · bloqueados: ${o}`:``}${l?` · falhas: ${l}`:``}`),c(new Set),b()}catch(t){e.error(`Falha no envio: ${t.message}`)}finally{f(!1)}}},disabled:d||!s.size,children:[(0,N.jsx)(Ni,{className:`h-4 w-4`}),d?`Enviando…`:`Enviar convite (${s.size})`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limite semanal (Goal Gradient)`}),(0,N.jsx)(`div`,{className:`mt-6`,children:h&&(0,N.jsx)(fa,{used:h.used,limit:h.limit,label:`Convites esta semana`})}),(0,N.jsx)(`p`,{className:`mt-6 text-xs text-gray-400`,children:`Padrão 100 convites por semana (configurável em Configurações). Os envios passam pelo rate limiter central com delays humanos entre cada ação. Dry-run + sem conexão = envio simulado.`})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Histórico de convites`}),p.items.length===0?(0,N.jsx)(ma,{icon:_i,title:`Nenhum convite enviado`,hint:`Faça uma busca, selecione perfis e envie convites personalizados.`}):(0,N.jsx)(`div`,{className:`mt-4 overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400`,children:[(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Contato`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Mensagem`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Status`}),(0,N.jsx)(`th`,{className:`pb-2`,children:`Data`})]})}),(0,N.jsx)(`tbody`,{children:p.items.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-gray-50 last:border-0`,children:[(0,N.jsxs)(`td`,{className:`py-3 pr-4`,children:[(0,N.jsx)(`p`,{className:`font-medium text-gray-700`,children:e.name}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.headline})]}),(0,N.jsx)(`td`,{className:`max-w-xs py-3 pr-4 text-xs text-gray-500`,title:e.message,children:e.message?.slice(0,70)}),(0,N.jsxs)(`td`,{className:`py-3 pr-4`,children:[(0,N.jsx)(em,{status:e.status,simulated:e.simulated}),e.error&&(0,N.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:e.error})]}),(0,N.jsx)(`td`,{className:`py-3 text-xs text-gray-500`,children:Hp(e.sentAt)})]},e.id))})]})}),p.total>p.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,p.page,` · `,p.total,` registros`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:v<=1,onClick:()=>y(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:v*p.limit>=p.total,onClick:()=>y(e=>e+1),children:`Próxima`})]})]})]})]})}var sm=5;function cm(){let e=Zp(),[t,n]=(0,_.useState)([]),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(``),[p,m]=(0,_.useState)(!1),[h,g]=(0,_.useState)([{text:``,delayDays:0},{text:``,delayDays:2}]),v=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/cascades`),M.get(`/cascades/stats`)]);n(e.cascades),i(t)}catch(t){e.error(`Falha ao carregar cascatas: ${t.message}`)}finally{o(!1)}},[e]);(0,_.useEffect)(()=>{v()},[v]);let y=async()=>{try{await M.post(`/cascades`,{contactName:l,profileId:d,approvalRequired:p,sequence:h.filter(e=>e.text.trim())}),e.success(`Cascata criada.`),c(!1),u(``),f(``),g([{text:``,delayDays:0},{text:``,delayDays:2}]),v()}catch(t){e.error(t.message)}},b=async(t,n)=>{try{await M.post(`/cascades/${t}/status`,{status:n}),v()}catch(t){e.error(t.message)}},x=async t=>{try{await M.post(`/cascades/${t}/approve`),e.success(`Mensagem aprovada.`),v()}catch(t){e.error(t.message)}},S=async t=>{try{await M.del(`/cascades/${t}`),v()}catch(t){e.error(t.message)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-4`,children:[(0,N.jsx)(F,{label:`DMs hoje`,value:r?.daily.used??0,hint:`limite ${r?.maxPerDay??5}/dia`,icon:Zr}),(0,N.jsx)(F,{label:`Cascatas ativas`,value:r?.byStatus?.active??0,hint:`${r?.total??0} no total`}),(0,N.jsx)(F,{label:`Aguardando resposta`,value:r?.byStatus?.waiting_reply??0,hint:`pausadas automaticamente`}),(0,N.jsx)(F,{label:`Intervalo mínimo`,value:`${r?.intervalMinutes??30} min`,hint:`entre mensagens`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card lg:col-span-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Cascatas em andamento`}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:async()=>{let t=await M.post(`/cascades/check-replies`);t.paused?.length?e.info(`${t.paused.length} cascata(s) pausada(s) por resposta do contato.`):e.info(t.error?`Verificação falhou: ${t.error}`:`Nenhuma resposta nova detectada.`),v()},title:`Verificar respostas na caixa de entrada`,children:[(0,N.jsx)(di,{className:`h-3.5 w-3.5`}),`Verificar respostas`]}),(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:async()=>{let t=await M.post(`/cascades/tick`);e.info(`Processamento: ${t.sent} enviadas, ${t.skipped} aguardando.`),v()},title:`Rodar o motor agora (teste)`,children:[(0,N.jsx)(ri,{className:`h-3.5 w-3.5`}),`Processar agora`]}),(0,N.jsx)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>c(!0),children:`+ Nova cascata`})]})]}),a?(0,N.jsx)(pa,{}):t.length===0?(0,N.jsx)(ma,{icon:Zr,title:`Nenhuma cascata criada`,hint:`Crie uma sequência de até 5 mensagens com delays em dias. Ideal para follow-up após convites aceitos.`}):(0,N.jsx)(`ul`,{className:`mt-4 space-y-4`,children:t.map(e=>(0,N.jsxs)(`li`,{className:`rounded-xl border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:e.contactName}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`Criada em `,Hp(e.createdAt),e.nextStepAt?` · próxima mensagem ${Hp(e.nextStepAt)}`:``]}),e.lastReplyAt&&(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-indigo-500`,children:[`Resposta recebida em `,Hp(e.lastReplyAt)]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(em,{status:e.status}),e.pendingApprovals?.length>0&&(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>x(e.id),children:[(0,N.jsx)(hr,{className:`h-3.5 w-3.5`}),`Aprovar msg `,e.pendingApprovals[0]+1]}),e.status===`active`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id,`paused`),children:(0,N.jsx)($r,{className:`h-3.5 w-3.5`})}),e.status===`paused`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id,`active`),children:(0,N.jsx)(ri,{className:`h-3.5 w-3.5`})}),e.status!==`cancelled`&&e.status!==`completed`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>b(e.id,`cancelled`),children:(0,N.jsx)(Tr,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>S(e.id),children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})]}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(da,{percent:e.progress?.percent??0,label:`${e.progress?.sent??0} de ${e.progress?.total??0} mensagens enviadas`,showPercent:!1})}),(0,N.jsx)(`ol`,{className:`mt-3 space-y-2`,children:(e.steps??[]).map(e=>(0,N.jsxs)(`li`,{className:`flex items-start gap-2 rounded-lg bg-gray-50 p-3 text-xs`,children:[(0,N.jsx)(`span`,{className:`font-bold text-gray-400`,children:e.stepIndex+1}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`whitespace-pre-wrap text-gray-700`,children:e.text}),(0,N.jsxs)(`p`,{className:`mt-1 text-[10px] text-gray-400`,children:[`delay: `,e.delayDays,` dia(s) · `,e.sentAt?`enviada ${Hp(e.sentAt)}`:e.status===`failed`?`falha: ${e.error}`:`pendente`]})]}),(0,N.jsx)(em,{status:e.status===`sent`?`sent`:e.status})]},e.stepIndex))})]},e.id))})]}),(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limite diário`}),(0,N.jsx)(`div`,{className:`mt-6`,children:r&&(0,N.jsx)(fa,{used:r.daily.used,limit:r.daily.limit,label:`Mensagens enviadas hoje`,tone:`bg-purple-500`})}),(0,N.jsxs)(`p`,{className:`mt-4 text-xs text-gray-400`,children:[`Hard limit de `,sm,` mensagens por dia. Entre mensagens o app respeita o intervalo mínimo configurável (`,r?.intervalMinutes??30,` min) e delays humanos aleatórios.`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Como funciona`}),(0,N.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs text-gray-500`,children:[(0,N.jsxs)(`li`,{children:[`1. Cada mensagem tem um `,(0,N.jsx)(`strong`,{children:`delay em dias`}),` (ex.: msg 1 hoje, msg 2 em 2 dias).`]}),(0,N.jsx)(`li`,{children:`2. O motor roda a cada minuto e envia o que estiver devido, respeitando o limite diário.`}),(0,N.jsxs)(`li`,{children:[`3. Se o contato `,(0,N.jsx)(`strong`,{children:`responder`}),`, a cascata pausa automaticamente.`]}),(0,N.jsxs)(`li`,{children:[`4. Ative a `,(0,N.jsx)(`strong`,{children:`aprovação manual`}),` para revisar cada mensagem antes do envio.`]})]})]})]})]}),(0,N.jsxs)(ha,{open:s,title:`Nova cascata de DM`,onClose:()=>c(!1),footer:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>c(!1),children:`Cancelar`}),(0,N.jsx)(`button`,{className:`btn-primary`,onClick:y,children:`Criar cascata`})]}),children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`contact`,children:`Nome do contato`}),(0,N.jsx)(`input`,{id:`contact`,className:`input`,placeholder:`Ex.: Ana Silva`,value:l,onChange:e=>u(e.target.value)}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`profileId`,children:`ID do perfil (LinkedIn)`}),(0,N.jsx)(`input`,{id:`profileId`,className:`input`,placeholder:`Ex.: demo-0 (perfil aceito no convite)`,value:d,onChange:e=>f(e.target.value)}),(0,N.jsxs)(`p`,{className:`label mt-4`,children:[`Mensagens (máx. `,sm,`)`]}),(0,N.jsx)(`div`,{className:`space-y-3`,children:h.map((e,t)=>(0,N.jsxs)(`div`,{className:`rounded-lg border border-gray-100 p-3`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-semibold text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Mensagem `,t+1]}),(0,N.jsxs)(`label`,{className:`flex items-center gap-1 font-normal`,children:[`delay (dias)`,(0,N.jsx)(`input`,{type:`number`,min:`0`,className:`input !w-16 !py-1`,value:e.delayDays,onChange:n=>{let r=[...h];r[t]={...e,delayDays:Number(n.target.value)||0},g(r)}})]})]}),(0,N.jsx)(`textarea`,{className:`input mt-2 h-20 resize-y`,placeholder:`Texto da mensagem…`,value:e.text,onChange:n=>{let r=[...h];r[t]={...e,text:n.target.value},g(r)}})]},t))}),h.length<sm&&(0,N.jsx)(`button`,{className:`btn-secondary mt-3`,onClick:()=>g([...h,{text:``,delayDays:h.length*2}]),children:`+ Adicionar mensagem`}),(0,N.jsxs)(`label`,{className:`mt-4 flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:p,onChange:e=>m(e.target.checked)}),`Exigir aprovação manual antes de cada envio`]})]})]})}function lm(){let e=Zp(),{linkedin:t}=ua(),n=(0,_.useRef)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)({items:[],total:0,page:1}),[p,m]=(0,_.useState)(null),[h,g]=(0,_.useState)(1),[v,y]=(0,_.useState)({title:``,location:``,remote:!1}),b=(0,_.useCallback)(async()=>{try{let[e,t,n]=await Promise.all([M.get(`/resume`),M.get(`/jobs`,{query:{status:`saved`,page:h,limit:10}}),M.get(`/jobs/stats`)]);i(e.resume),f(t),m(n)}catch(t){e.error(`Falha ao carregar: ${t.message}`)}},[h,e]);(0,_.useEffect)(()=>{b()},[b]);let x=async t=>{if(t){o(!0);try{let n=await M.post(`/resume?fileName=${encodeURIComponent(t.name)}&mimeType=${encodeURIComponent(t.type||``)}`,t,{raw:!0,headers:{"Content-Type":t.type||`application/octet-stream`}});i(n.resume),e.success(`Currículo processado: ${n.resume.skills.length} skills detectadas.`)}catch(t){t instanceof Ki?e.error(t.message):e.error(`Falha ao processar o currículo.`)}finally{o(!1),n.current&&(n.current.value=``)}}},S=async()=>{if(!v.title.trim())e.error(`Informe o cargo desejado.`);else{c(!0);try{let t=await M.post(`/jobs/search`,v);u(t.jobs),t.simulated&&e.info(`Dry-run: vagas simuladas para explorar o match.`)}catch(t){e.error(`Busca falhou: ${t.message}`)}finally{c(!1)}}},C=async(t,n)=>{try{await M.post(`/jobs`,{job:t,status:n}),e.success(n===`saved`?`Vaga salva.`:`Vaga descartada.`),b()}catch(t){e.error(t.message)}},w=async t=>{try{await M.del(`/jobs/${t}`),b()}catch(t){e.error(t.message)}},T=async t=>{try{let n=await M.post(`/applications`,{job:t,dryRun:!0});e.success(`Candidatura registrada (${n.application.status===`dry_run`?`dry-run`:n.application.status}).`),b()}catch(t){e.error(`Falha ao candidatar: ${t.message}`)}};return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-4`,children:[(0,N.jsx)(F,{label:`Currículo`,value:r?.skills?.length?`${r.skills.length} skills`:`Não enviado`,hint:r?.fileName??`PDF, DOCX ou TXT`}),(0,N.jsx)(F,{label:`Vagas salvas`,value:d.total,hint:`match semântico`}),(0,N.jsx)(F,{label:`Match médio`,value:p?.averageScore??`—`,hint:`currículo × vagas salvas`}),(0,N.jsx)(F,{label:`Resultados na busca`,value:l.length,hint:`score semântico 0–100`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-2`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Currículo`}),(0,N.jsx)(`p`,{className:`mt-1 text-xs text-gray-500`,children:`Processamento automático (PDF via pdfjs, DOCX via mammoth).`}),(0,N.jsx)(`input`,{ref:n,type:`file`,accept:`.pdf,.docx,.txt,application/pdf,text/plain`,className:`mt-4 hidden`,onChange:e=>x(e.target.files?.[0])}),(0,N.jsxs)(`button`,{className:`btn-primary mt-2`,onClick:()=>n.current?.click(),disabled:a,children:[(0,N.jsx)(ji,{className:`h-4 w-4`}),a?`Processando…`:`Enviar currículo`]}),r?.skills?.length>0&&(0,N.jsxs)(`div`,{className:`mt-4`,children:[(0,N.jsx)(`p`,{className:`label`,children:`Skills detectadas`}),(0,N.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.skills.map(e=>(0,N.jsx)(`span`,{className:`badge bg-indigo-50 text-indigo-600`,children:e},e))}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-400`,children:[r.titles?.length?`Títulos: ${r.titles.join(` · `)}`:``,r.yearsExperience?` · ${r.yearsExperience} anos de experiência`:``,r.languages?.length?` · Idiomas: ${r.languages.join(`, `)}`:``]})]}),!r?.skills?.length&&(0,N.jsx)(`p`,{className:`mt-4 rounded-lg border border-dashed border-gray-200 p-6 text-center text-xs text-gray-400`,children:`Envie seu currículo para ver o score de match em cada vaga.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Buscar vagas`}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`jobTitle`,children:`Cargo / palavras-chave`}),(0,N.jsx)(`input`,{id:`jobTitle`,className:`input`,placeholder:`Ex.: Engenheiro de Software`,value:v.title,onChange:e=>y({...v,title:e.target.value})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`jobLocation`,children:`Localização`}),(0,N.jsx)(`input`,{id:`jobLocation`,className:`input`,placeholder:`Ex.: São Paulo, Remoto`,value:v.location,onChange:e=>y({...v,location:e.target.value})})]}),(0,N.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:v.remote,onChange:e=>y({...v,remote:e.target.checked})}),`Somente remotas`]})]}),(0,N.jsxs)(`button`,{className:`btn-primary mt-4 w-full`,onClick:S,disabled:s,children:[(0,N.jsx)(hi,{className:`h-4 w-4`}),s?`Buscando…`:`Buscar vagas`]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-gray-400`,children:[`Dry-run ativo (`,t?.mode??`dry-run`,`): use Integrações para conectar e buscar de verdade.`]})]})]}),l.length>0&&(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`h3`,{className:`text-base font-semibold text-gray-800`,children:[`Resultados (`,l.length,`)`]}),(0,N.jsx)(`ul`,{className:`mt-4 grid grid-cols-1 gap-4 xl:grid-cols-2`,children:l.map(e=>(0,N.jsxs)(`li`,{className:`rounded-xl border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:e.title}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[e.company,` · `,e.location,e.easyApply===null?``:e.easyApply?` · Easy Apply`:` · candidatura externa`]})]}),(0,N.jsx)(`span`,{className:`text-2xl font-bold ${Wp(e.matchScore)}`,children:e.matchScore})]}),(0,N.jsx)(`div`,{className:`mt-3`,children:(0,N.jsx)(da,{percent:e.matchScore,tone:Gp(e.matchScore),showPercent:!1})}),(0,N.jsx)(`p`,{className:`mt-2 text-xs font-medium text-gray-600`,children:e.recommendation}),e.skillGaps?.length>0&&(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-400`,children:[`Lacunas: `,e.skillGaps.join(`, `)]}),(0,N.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>C(e,`saved`),children:[(0,N.jsx)(pi,{className:`h-3.5 w-3.5`}),`Salvar`]}),(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>C(e,`discarded`),children:[(0,N.jsx)(Di,{className:`h-3.5 w-3.5`}),`Descartar`]}),(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>T(e),children:[(0,N.jsx)(_i,{className:`h-3.5 w-3.5`}),`Candidatar-se (dry-run)`]})]})]},e.jobId))})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Vagas salvas`}),d.items.length===0?(0,N.jsx)(ma,{icon:Fr,title:`Nenhuma vaga salva`,hint:`Busque vagas acima e salve as que fizerem sentido para seu perfil.`}):(0,N.jsx)(`ul`,{className:`mt-4 space-y-3`,children:d.items.map(e=>(0,N.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 rounded-lg border border-gray-100 p-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:e.title}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-500`,children:[e.company,` · `,e.location]})]}),(0,N.jsx)(em,{status:e.status===`discarded`?`discarded`:`saved`}),(0,N.jsx)(`span`,{className:`text-lg font-bold ${Wp(e.matchScore)}`,children:e.matchScore}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>T(e),children:[(0,N.jsx)(_i,{className:`h-3.5 w-3.5`}),`Candidatar`]}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>w(e.id),children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]})]},e.id))}),d.total>d.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,d.page,` · `,d.total,` vagas salvas`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:h<=1,onClick:()=>g(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:h*d.limit>=d.total,onClick:()=>g(e=>e+1),children:`Próxima`})]})]})]})]})}function um(){let e=Zp(),[t,n]=(0,_.useState)({items:[],total:0,page:1,limit:20}),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(1),[s,c]=(0,_.useState)(``),l=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/applications`,{query:{status:s,page:a,limit:10}}),M.get(`/applications/limits`)]);n(e),i(t.applications)}catch(t){e.error(`Falha ao carregar candidaturas: ${t.message}`)}},[s,a,e]);(0,_.useEffect)(()=>{l()},[l]);let u=async t=>{try{await M.post(`/applications/${t}/retry`,{dryRun:!1}),e.info(`Nova tentativa iniciada.`),l()}catch(t){e.error(t.message)}},d=(t.items??[]).filter(e=>e.status===`submitted`).length;return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsx)(F,{label:`Candidaturas`,value:t.total,hint:`total registrado`}),(0,N.jsx)(F,{label:`Enviadas hoje`,value:r?.used??0,hint:`limite: ${r?.limit??20}/dia`}),(0,N.jsx)(F,{label:`Enviadas com sucesso`,value:d,hint:`Easy Apply`})]}),(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 lg:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card lg:col-span-2`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Histórico de candidaturas`}),(0,N.jsxs)(`select`,{className:`input w-auto`,value:s,onChange:e=>{c(e.target.value),o(1)},children:[(0,N.jsx)(`option`,{value:``,children:`Todos os status`}),(0,N.jsx)(`option`,{value:`submitted`,children:`Enviadas`}),(0,N.jsx)(`option`,{value:`dry_run`,children:`Dry-run`}),(0,N.jsx)(`option`,{value:`needs_intervention`,children:`Intervenção manual`}),(0,N.jsx)(`option`,{value:`failed`,children:`Falhas`}),(0,N.jsx)(`option`,{value:`blocked`,children:`Bloqueadas`})]})]}),t.items.length?(0,N.jsx)(`div`,{className:`mt-4 overflow-x-auto`,children:(0,N.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{className:`border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400`,children:[(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Vaga`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Score`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Status`}),(0,N.jsx)(`th`,{className:`pb-2 pr-4`,children:`Relatório`}),(0,N.jsx)(`th`,{className:`pb-2`,children:`Ações`})]})}),(0,N.jsx)(`tbody`,{children:t.items.map(e=>(0,N.jsxs)(`tr`,{className:`border-b border-gray-50 last:border-0`,children:[(0,N.jsxs)(`td`,{className:`py-3 pr-4`,children:[(0,N.jsx)(`p`,{className:`font-medium text-gray-700`,children:e.jobTitle}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.company})]}),(0,N.jsx)(`td`,{className:`py-3 pr-4 font-bold text-gray-600`,children:e.matchScore??`—`}),(0,N.jsx)(`td`,{className:`py-3 pr-4`,children:(0,N.jsx)(em,{status:e.status,simulated:e.dryRun})}),(0,N.jsxs)(`td`,{className:`max-w-xs py-3 pr-4 text-xs text-gray-500`,children:[e.report?.notes??`—`,e.report?.screenshot&&(0,N.jsx)(`span`,{className:`block text-[10px] text-gray-400`,children:`screenshot salvo em ~/.jobfinder/screenshots/`})]}),(0,N.jsx)(`td`,{className:`py-3`,children:[`failed`,`needs_intervention`].includes(e.status)&&(0,N.jsxs)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>u(e.id),children:[(0,N.jsx)(di,{className:`h-3.5 w-3.5`}),`Tentar de novo`]})})]},e.id))})]})}):(0,N.jsx)(ma,{icon:lr,title:`Nenhuma candidatura`,hint:`Candidate-se a partir da tela de Vagas. O modo dry-run é o padrão até você conectar o LinkedIn.`}),t.total>t.limit&&(0,N.jsxs)(`div`,{className:`mt-4 flex items-center justify-between text-xs text-gray-500`,children:[(0,N.jsxs)(`span`,{children:[`Página `,t.page,` · `,t.total,` registros`]}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:a<=1,onClick:()=>o(e=>e-1),children:`Anterior`}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,disabled:a*t.limit>=t.total,onClick:()=>o(e=>e+1),children:`Próxima`})]})]})]}),(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limite diário`}),(0,N.jsx)(`div`,{className:`mt-6`,children:r&&(0,N.jsx)(fa,{used:r.used,limit:r.limit,label:`Candidaturas hoje`,tone:`bg-emerald-500`})}),(0,N.jsx)(`p`,{className:`mt-4 text-xs text-gray-400`,children:`Padrão 20/dia (configurável). Cada candidatura passa pelo rate limiter com delays humanos e reutiliza a sessão do navegador com os cookies conectados.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Sobre o Easy Apply`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-500`,children:[`A automação usa Playwright (opcional). Sem ele instalado — ou com dry-run ativo — o app registra a candidatura como`,(0,N.jsx)(`strong`,{children:` dry-run`}),` e nada é enviado. Formulários complexos retornam `,(0,N.jsx)(`strong`,{children:`intervenção manual`}),` com screenshot salvo no servidor.`]}),(0,N.jsx)(`p`,{className:`mt-3 text-xs text-gray-400`,children:`Instalar sob demanda: npm i -g playwright && npx playwright install chromium`})]})]})]})]})}var dm=`https://www.linkedin.com/help/linkedin/answer/a526048/acesso-as-apis-do-linkedin?lang=pt`,fm=`https://chromewebstore.google.com/detail/get-cookieslocally/cclelndahbckbenkjhflpdbgdldlbecc`;function pm(){let e=Zp(),[t]=zn(),n=(0,_.useRef)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(``),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(`LinkedIn principal`),[p,m]=(0,_.useState)(!0),[h,g]=(0,_.useState)(!1),[v,y]=(0,_.useState)(!1),b=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/linkedin/status`),M.get(`/channels`)]);i(e),o(t.channels)}catch(t){e.error(`Falha ao carregar integrações: ${t.message}`)}finally{m(!1)}},[e]);(0,_.useEffect)(()=>{b()},[b]),(0,_.useEffect)(()=>{let n=t.get(`linkedin`);n===`connected`&&e.success(`API Oficial conectada com sucesso!`),n===`error`&&e.error(`Falha no OAuth: ${t.get(`reason`)??`erro desconhecido`}`),n&&window.history.replaceState({},``,`/integracoes`)},[t,e]);let x=async()=>{if(!s||!l)e.error(`Preencha clientId e clientSecret.`);else try{await M.post(`/channels/official`,{label:d,clientId:s,clientSecret:l}),e.success(`Credenciais salvas localmente. Agora inicie o OAuth.`),b()}catch(t){e.error(t.message)}},S=async()=>{try{let t=await M.post(`/channels/oauth/start`);window.open(t.url,`_blank`,`noopener,noreferrer,width=600,height=800`),e.info(`Complete a autorização no LinkedIn; você voltará para esta tela automaticamente.`)}catch(t){e.error(t.message)}},C=async()=>{g(!0);try{let t=await M.post(`/linkedin/test`);t.ok?e.success(`Conexão OK (${t.mode}${t.profile?`: ${t.profile.name??t.profile.firstName??``}`:``})`):e.error(t.message),b()}catch(t){e.error(t.message)}finally{g(!1)}},w=async t=>{try{await M.post(`/channels/${t}/activate`),e.success(`Canal ativado.`),b()}catch(t){e.error(t.message)}},T=async t=>{try{await M.del(`/channels/${t}`),e.info(`Canal removido.`),b()}catch(t){e.error(t.message)}},E=async t=>{if(t)try{let n=await M.post(`/channels/cookies?label=${encodeURIComponent(t.name)}`,t,{raw:!0,headers:{"Content-Type":`text/plain`}});n.test.ok?e.success(`Sessão válida! Perfil: ${n.test.profile.firstName??``} ${n.test.profile.lastName??``}`):e.error(`Cookies salvos, mas o teste falhou: ${n.test.message}. Verifique se o LinkedIn está acessível desta máquina.`),b()}catch(t){e.error(t.message)}finally{n.current&&(n.current.value=``)}};if(p)return(0,N.jsx)(pa,{label:`Carregando integrações…`});let D=!!r?.connected;return(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:`Status da conexão`}),(0,N.jsx)(`div`,{className:`mt-2 flex items-center gap-2`,children:(0,N.jsxs)(`span`,{className:`badge ${D?`bg-green-100 text-green-800`:`bg-amber-100 text-amber-800`}`,children:[(0,N.jsx)(`span`,{className:`mr-1.5 inline-block h-2 w-2 rounded-full ${D?`bg-green-500`:`bg-amber-500`}`}),D?r.mode===`official`?`API Oficial`:`Cookies de sessão`:`Dry-run (sem canal)`]})}),(0,N.jsx)(`p`,{className:`mt-3 text-xs text-gray-400`,children:r?.dryRun?r?.dryRunReason===`global-dry-run`?`Canal conectado, mas o dry-run global está ativo em Configurações.`:`Nenhum canal conectado — tudo está sendo simulado.`:`Modo ativo: as ações serão enviadas ao LinkedIn.`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:`Canais cadastrados`}),(0,N.jsx)(`p`,{className:`mt-2 text-2xl font-bold text-gray-800`,children:a.length}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-400`,children:[a.filter(e=>e.authMode===`official`).length,` via API oficial · `,a.filter(e=>e.authMode===`cookie`).length,` via cookies`]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-500`,children:`Testar conexão`}),(0,N.jsxs)(`button`,{className:`btn-secondary mt-3 w-full`,onClick:C,disabled:h,children:[(0,N.jsx)(di,{className:`h-4 w-4`}),h?`Testando…`:`Testar agora`]}),(0,N.jsxs)(`button`,{className:`btn-primary mt-2 w-full`,onClick:()=>window.open(dm,`_blank`,`noopener,noreferrer`),children:[(0,N.jsx)(zr,{className:`h-4 w-4`}),`Criar API Oficial do LinkedIn`]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Método recomendado — API Oficial (OAuth 2.0)`}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Crie seu app no LinkedIn (botão acima), copie o `,(0,N.jsx)(`strong`,{children:`Client ID`}),` e o `,(0,N.jsx)(`strong`,{children:`Client Secret`}),` e registre o redirect`,(0,N.jsx)(`code`,{className:`mx-1 rounded bg-gray-100 px-1`,children:`http://127.0.0.1:4040/api/channels/oauth/callback`}),`. As credenciais ficam apenas no arquivo local`,(0,N.jsx)(`code`,{className:`mx-1 rounded bg-gray-100 px-1`,children:`~/.jobfinder/channels.json`}),`.`]}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`channelLabel`,children:`Nome do canal`}),(0,N.jsx)(`input`,{id:`channelLabel`,className:`input`,value:d,onChange:e=>f(e.target.value)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`clientId`,children:`Client ID`}),(0,N.jsx)(`input`,{id:`clientId`,className:`input`,placeholder:`77xxxxxxx`,value:s,onChange:e=>c(e.target.value)})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`clientSecret`,children:`Client Secret`}),(0,N.jsx)(`input`,{id:`clientSecret`,type:`password`,className:`input`,placeholder:`••••••••`,value:l,onChange:e=>u(e.target.value)})]})]}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:x,children:[(0,N.jsx)(ai,{className:`h-4 w-4`}),`Salvar credenciais`]}),(0,N.jsxs)(`button`,{className:`btn-secondary`,onClick:S,children:[(0,N.jsx)(zr,{className:`h-4 w-4`}),`Iniciar autorização OAuth`]})]}),!r?.channel?.official?.hasAccessToken&&a.every(e=>!e.official?.hasAccessToken)&&(0,N.jsx)(`span`,{className:`badge mt-3 bg-amber-100 text-amber-800`,children:`⚠ Recomendado`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Fallback — cookies de sessão`}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Com a extensão `,(0,N.jsx)(`a`,{href:fm,target:`_blank`,rel:`noreferrer noopener`,className:`text-indigo-600 hover:text-indigo-800`,children:`"Get cookies.txt LOCALLY"`}),`, exporte os cookies de `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`linkedin.com`}),` (formato cookies.txt) e envie abaixo. O app usa a API interna (Voyager) para convites, DMs e Easy Apply.`]}),(0,N.jsx)(`div`,{className:`mt-4 rounded-lg border border-amber-200 bg-amber-50 p-4`,children:(0,N.jsxs)(`p`,{className:`flex items-start gap-2 text-xs text-amber-800`,children:[(0,N.jsx)(Ci,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(`strong`,{children:`Uso por conta e risco:`}),` automação pode violar os Termos de Serviço do LinkedIn e resultar em restrições da conta. Os cookies ficam `,(0,N.jsx)(`strong`,{children:`somente no seu computador`}),` e nunca são compartilhados. Respeite os limites de rate configurados.`]})]})}),(0,N.jsx)(`input`,{ref:n,type:`file`,accept:`.txt,text/plain`,className:`mt-4 hidden`,onChange:e=>E(e.target.files?.[0])}),(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:()=>n.current?.click(),children:[(0,N.jsx)(Dr,{className:`h-4 w-4`}),`Enviar cookies.txt`]}),(0,N.jsx)(`button`,{className:`btn-secondary ml-2`,onClick:()=>y(!0),children:`Como exportar?`})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Canais conectados`}),a.length===0?(0,N.jsx)(ma,{icon:ai,title:`Nenhum canal cadastrado`,hint:`Use a API Oficial (recomendado) ou envie os cookies de sessão.`}):(0,N.jsx)(`ul`,{className:`mt-4 divide-y divide-gray-50`,children:a.map(e=>(0,N.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`p`,{className:`text-sm font-medium text-gray-800`,children:[e.label,` `,(0,N.jsx)(`span`,{className:`ml-1 text-xs text-gray-400`,children:e.authMode===`official`?`API Oficial`:`cookies`})]}),(0,N.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[e.official?.hasAccessToken?`token válido${e.official.expiresAt?` até ${Hp(e.official.expiresAt)}`:``}`:``,e.cookiesCount?`${e.cookiesCount} cookies (${e.cookieNames?.slice(0,3).join(`, `)}…)`:``,e.lastError?` · último erro: ${e.lastError}`:``]})]}),(0,N.jsx)(em,{status:e.status===`active`?`active`:e.status}),e.status!==`active`&&(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs`,onClick:()=>w(e.id),title:`Tornar ativo`,children:(0,N.jsx)(li,{className:`h-3.5 w-3.5`})}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>T(e.id),title:`Remover`,children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]},e.id))})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Suporte`}),(0,N.jsxs)(`div`,{className:`mt-4 space-y-3 text-xs text-gray-500`,children:[(0,N.jsx)(da,{label:`Diagnóstico do ambiente`,percent:100,showPercent:!1,tone:`bg-green-500`}),(0,N.jsxs)(`p`,{children:[`Servidor resposta OK · dados em `,(0,N.jsx)(`code`,{className:`rounded bg-gray-100 px-1`,children:`~/.jobfinder/`}),` · versão 0.0.01`]}),(0,N.jsxs)(`p`,{children:[`Dúvidas e issues: `,(0,N.jsx)(`a`,{href:`https://github.com/DanHachuel/JobFinder/issues`,target:`_blank`,rel:`noreferrer noopener`,className:`text-indigo-600 hover:text-indigo-800`,children:`github.com/DanHachuel/JobFinder/issues`}),` · `,(0,N.jsx)(`a`,{href:`https://github.com/DanHachuel/JobFinder#tutorial`,target:`_blank`,rel:`noreferrer noopener`,className:`text-indigo-600 hover:text-indigo-800`,children:`tutorial completo`})]})]})]}),(0,N.jsxs)(ha,{open:v,title:`Como exportar os cookies`,onClose:()=>y(!1),children:[(0,N.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-xs text-gray-600`,children:[(0,N.jsx)(`li`,{children:`Instale a extensão "Get cookies.txt LOCALLY" no Chrome/Edge.`}),(0,N.jsxs)(`li`,{children:[`Acesse `,(0,N.jsx)(`strong`,{children:`linkedin.com`}),` logado na sua conta.`]}),(0,N.jsxs)(`li`,{children:[`Clique no ícone da extensão e escolha `,(0,N.jsx)(`strong`,{children:`Export`}),` (formato cookies.txt).`]}),(0,N.jsxs)(`li`,{children:[`Volte aqui e envie o arquivo. O app valida `,(0,N.jsx)(`code`,{children:`li_at`}),` e `,(0,N.jsx)(`code`,{children:`JSESSIONID`}),` automaticamente.`]})]}),(0,N.jsx)(`p`,{className:`mt-4 text-xs text-gray-500`,children:`A sessão expira quando o LinkedIn invalida os cookies — reexporte se os testes começarem a falhar.`})]})]})}var mm=[[`ollama`,`Ollama (local, sem chave)`],[`openai`,`OpenAI`],[`deepseek`,`DeepSeek`],[`anthropic`,`Anthropic`]],hm={currentPassword:``,newPassword:``,confirmPassword:``};function gm(){let e=Zp(),{user:t}=Zi(),{refresh:n}=ua(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(!0),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)({name:``,prompt:``}),[h,g]=(0,_.useState)(hm),[v,y]=(0,_.useState)(!1),[b,x]=(0,_.useState)(!1),[S,C]=(0,_.useState)(!1),w=(0,_.useCallback)(async()=>{try{let[e,t]=await Promise.all([M.get(`/config`),M.get(`/topics`)]);i(e.config),o(t.topics)}catch(t){e.error(`Falha ao carregar configuração: ${t.message}`)}finally{c(!1)}},[e]);(0,_.useEffect)(()=>{w()},[w]);let T=async()=>{u(!0);try{let{llm:t,limits:a,outreach:o,linkedin:s,...c}=r,l={...c,llm:{...t,apiKey:t.apiKey===`***`?``:t.apiKey},limits:a,outreach:o,linkedin:s};l.llm.apiKey||delete l.llm.apiKey;let u=await M.put(`/config`,l);i(u.config),e.success(`Configuração salva.`),n?.()}catch(t){e.error(t.message)}finally{u(!1)}},E=async t=>{x(!0);try{let r=await M.put(`/config`,{dryRun:t});i(r.config),e.success(t?`Dry-run reativado — nenhuma ação real será enviada ao LinkedIn.`:`Modo real ativado — o JobFinder executará ações reais no LinkedIn.`),n?.()}catch(t){e.error(t.message)}finally{x(!1)}},D=e=>{e?E(!0):C(!0)},ee=async t=>{if(t.preventDefault(),h.newPassword!==h.confirmPassword)e.error(`A nova senha e a confirmação não coincidem.`);else if(h.newPassword.length<6)e.error(`A nova senha precisa de pelo menos 6 caracteres.`);else{y(!0);try{await M.put(`/auth/password`,h),e.success(`Senha alterada. Use a nova senha no próximo login.`),g(hm)}catch(t){e.error(t.message)}finally{y(!1)}}},te=async()=>{if(!p.name.trim())e.error(`Dê um nome ao tema.`);else try{await M.post(`/topics`,p),e.success(`Tema criado.`),f(!1),m({name:``,prompt:``}),w()}catch(t){e.error(t.message)}},ne=async t=>{try{await M.put(`/topics/${t.id}`,{active:!t.active}),w()}catch(t){e.error(t.message)}},re=async t=>{try{await M.del(`/topics/${t}`),w()}catch(t){e.error(t.message)}};return s||!r?(0,N.jsx)(pa,{label:`Carregando configuração…`}):(0,N.jsxs)(`div`,{className:`space-y-6`,children:[(0,N.jsxs)(`div`,{className:`card ${r.dryRun?`border-amber-200 bg-amber-50`:`border-red-200 bg-red-50`}`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`flex items-start gap-3`,children:[r.dryRun?(0,N.jsx)(Lr,{className:`mt-0.5 h-6 w-6 shrink-0 text-amber-500`}):(0,N.jsx)(Ui,{className:`mt-0.5 h-6 w-6 shrink-0 text-red-500`}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:r.dryRun?`Modo dry-run ativo`:`Modo real ativo (ações reais)`}),(0,N.jsx)(`p`,{className:`mt-1 max-w-2xl text-xs text-gray-600`,children:r.dryRun?`Nenhuma chamada real ao LinkedIn é feita: postagens, convites, DMs e candidaturas são simulados. Explore o app com segurança.`:`As automações vão agir de verdade na sua conta do LinkedIn. Respeite os limites abaixo e confira o canal conectado em Integrações.`}),(0,N.jsxs)(`p`,{className:`mt-2 flex items-start gap-1.5 text-xs font-medium text-red-700`,children:[(0,N.jsx)(ki,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),`Ao desativar o modo Dry-run, o JobFinder executará ações reais no LinkedIn (postagens, convites, DMs e candidaturas). Use com responsabilidade.`]})]})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,N.jsx)(`span`,{className:`badge ${r.dryRun?`bg-amber-100 text-amber-800`:`bg-red-100 text-red-800`}`,children:r.dryRun?`dry-run`:`Real Mode`}),(0,N.jsx)(_m,{checked:!r.dryRun,disabled:b,onChange:e=>D(!e.target.checked),label:r.dryRun?`Desativar dry-run`:`Ativar dry-run`})]})]}),(0,N.jsxs)(`p`,{className:`mt-3 text-[11px] text-gray-500`,children:[`O estado é salvo em `,(0,N.jsx)(`code`,{className:`font-mono`,children:`config.json`})," (`dryRun`) e vale para todo o backend — inclusive o scheduler e as cascatas de DM."]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(zr,{className:`h-5 w-5 text-indigo-500`}),(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Segurança`})]}),(0,N.jsxs)(`p`,{className:`mt-1 text-xs text-gray-500`,children:[`Conta única: `,(0,N.jsx)(`span`,{className:`font-medium text-gray-700`,children:t?.email}),` · a senha fica apenas em`,` `,(0,N.jsx)(`code`,{className:`font-mono`,children:`~/.jobfinder/auth.json`}),`, com hash scrypt (nunca em texto puro).`]}),(0,N.jsxs)(`form`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,onSubmit:ee,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`currentPassword`,children:`Senha atual`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`currentPassword`,type:`password`,autoComplete:`current-password`,className:`input !pl-10`,value:h.currentPassword,onChange:e=>g({...h,currentPassword:e.target.value})})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`newPassword`,children:`Nova senha`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`newPassword`,type:`password`,autoComplete:`new-password`,className:`input !pl-10`,placeholder:`mínimo de 6 caracteres`,value:h.newPassword,onChange:e=>g({...h,newPassword:e.target.value})})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`confirmPassword`,children:`Confirmar nova senha`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`confirmPassword`,type:`password`,autoComplete:`new-password`,className:`input !pl-10`,value:h.confirmPassword,onChange:e=>g({...h,confirmPassword:e.target.value})})]})]}),(0,N.jsx)(`div`,{className:`md:col-span-3 flex justify-end`,children:(0,N.jsxs)(`button`,{className:`btn-primary`,type:`submit`,disabled:v,children:[(0,N.jsx)(pi,{className:`h-4 w-4`}),v?`Salvando…`:`Alterar senha`]})})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Provedor de LLM`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`provider`,children:`Provedor`}),(0,N.jsx)(`select`,{id:`provider`,className:`input`,value:r.llm.provider,onChange:e=>i({...r,llm:{...r.llm,provider:e.target.value}}),children:mm.map(([e,t])=>(0,N.jsx)(`option`,{value:e,children:t},e))})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`model`,children:`Modelo`}),(0,N.jsx)(`input`,{id:`model`,className:`input`,value:r.llm.model,onChange:e=>i({...r,llm:{...r.llm,model:e.target.value}})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`baseUrl`,children:`Base URL`}),(0,N.jsx)(`input`,{id:`baseUrl`,className:`input`,value:r.llm.baseUrl,onChange:e=>i({...r,llm:{...r.llm,baseUrl:e.target.value}})})]}),(0,N.jsxs)(`div`,{className:`md:col-span-2`,children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`apiKey`,children:`API Key (vazio = usar Ollama local sem chave)`}),(0,N.jsx)(`input`,{id:`apiKey`,type:`password`,className:`input`,placeholder:r.llm.apiKey===`***`?`•••• (já configurada — digite uma nova para trocar)`:``,value:r.llm.apiKey===`***`?``:r.llm.apiKey,onChange:e=>i({...r,llm:{...r.llm,apiKey:e.target.value}})})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`label`,{className:`label`,htmlFor:`temperature`,children:[`Temperatura (`,r.llm.temperature,`)`]}),(0,N.jsx)(`input`,{id:`temperature`,type:`range`,min:`0`,max:`1`,step:`0.1`,className:`w-full accent-indigo-500`,value:r.llm.temperature,onChange:e=>i({...r,llm:{...r.llm,temperature:Number(e.target.value)}})})]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Limites de rate (proteção da conta)`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,N.jsx)(vm,{label:`Convites por semana`,value:r.limits.invitationsPerWeek,onChange:e=>i({...r,limits:{...r.limits,invitationsPerWeek:e}})}),(0,N.jsx)(vm,{label:`DMs por dia (máx. 5)`,value:r.limits.dmsPerDay,onChange:e=>i({...r,limits:{...r.limits,dmsPerDay:e}})}),(0,N.jsx)(vm,{label:`Intervalo entre DMs (min)`,value:r.limits.dmIntervalMinutes,onChange:e=>i({...r,limits:{...r.limits,dmIntervalMinutes:e}})}),(0,N.jsx)(vm,{label:`Candidaturas por dia`,value:r.limits.applicationsPerDay,onChange:e=>i({...r,limits:{...r.limits,applicationsPerDay:e}})}),(0,N.jsx)(vm,{label:`Delay mínimo entre ações (ms)`,value:r.limits.minDelayMs,onChange:e=>i({...r,limits:{...r.limits,minDelayMs:e}})}),(0,N.jsx)(vm,{label:`Delay máximo entre ações (ms)`,value:r.limits.maxDelayMs,onChange:e=>i({...r,limits:{...r.limits,maxDelayMs:e}})})]}),(0,N.jsxs)(`div`,{className:`mt-4`,children:[(0,N.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:r.outreach?.pauseOnReply!==!1,onChange:e=>i({...r,outreach:{...r.outreach,pauseOnReply:e.target.checked}})}),`Pausar cascatas de DM automaticamente quando o contato responder`]}),(0,N.jsxs)(`label`,{className:`mt-2 flex items-center gap-2 text-sm text-gray-600`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:!!r.outreach?.autoApproveDms,onChange:e=>i({...r,outreach:{...r.outreach,autoApproveDms:e.target.checked}})}),`Aprovar mensagens de DM automaticamente (sem revisão manual)`]})]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Servidor local`}),(0,N.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,N.jsx)(vm,{label:`Porta`,value:r.port,onChange:e=>i({...r,port:e})}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`host`,children:`Host`}),(0,N.jsx)(`input`,{id:`host`,className:`input`,value:r.host,onChange:e=>i({...r,host:e.target.value})})]})]}),(0,N.jsxs)(`p`,{className:`mt-2 text-xs text-gray-400`,children:[`A porta só muda na próxima inicialização: npx --yes @danhachuel/jobfinder@<versão> start --port `,r.port]})]}),(0,N.jsxs)(`div`,{className:`card`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h3`,{className:`text-base font-semibold text-gray-800`,children:`Temas de postagem`}),(0,N.jsxs)(`button`,{className:`btn-primary !px-3 !py-1.5 text-xs`,onClick:()=>f(!0),children:[(0,N.jsx)(si,{className:`h-3.5 w-3.5`}),`Novo tema`]})]}),(0,N.jsx)(`ul`,{className:`mt-4 divide-y divide-gray-50`,children:a.map(e=>(0,N.jsxs)(`li`,{className:`flex flex-wrap items-center gap-3 py-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`p`,{className:`text-sm font-medium text-gray-800`,children:e.name}),(0,N.jsx)(`p`,{className:`text-xs text-gray-400`,children:e.prompt||`Sem diretriz`})]}),(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-1 text-xs text-gray-500`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-indigo-500`,checked:e.active,onChange:()=>ne(e)}),`ativo`]}),(0,N.jsx)(`button`,{className:`btn-secondary !px-3 !py-1.5 text-xs !text-red-600`,onClick:()=>re(e.id),children:(0,N.jsx)(Di,{className:`h-3.5 w-3.5`})})]},e.id))})]}),(0,N.jsx)(`div`,{className:`sticky bottom-4 flex justify-end`,children:(0,N.jsxs)(`button`,{className:`btn-primary`,onClick:T,disabled:l,children:[(0,N.jsx)(pi,{className:`h-4 w-4`}),l?`Salvando…`:`Salvar configuração`]})}),(0,N.jsxs)(ha,{open:S,title:`Desativar o dry-run?`,onClose:()=>C(!1),footer:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>C(!1),children:`Cancelar`}),(0,N.jsx)(`button`,{className:`btn-danger`,onClick:()=>{C(!1),E(!1)},children:`Sim, ativar modo real`})]}),children:[(0,N.jsx)(`p`,{className:`text-sm text-gray-700`,children:`Ao desativar o modo Dry-run, o JobFinder executará ações reais no LinkedIn (postagens, convites, DMs e candidaturas). Use com responsabilidade.`}),(0,N.jsxs)(`p`,{className:`mt-3 text-xs text-gray-500`,children:[`Confirme também que há um canal do LinkedIn conectado em `,(0,N.jsx)(`span`,{className:`font-medium`,children:`Integrações`}),` — sem canal, as ações reais são bloqueadas pelo backend.`]})]}),(0,N.jsxs)(ha,{open:d,title:`Novo tema`,onClose:()=>f(!1),footer:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{className:`btn-secondary`,onClick:()=>f(!1),children:`Cancelar`}),(0,N.jsx)(`button`,{className:`btn-primary`,onClick:te,children:`Criar`})]}),children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`topicName`,children:`Nome`}),(0,N.jsx)(`input`,{id:`topicName`,className:`input`,placeholder:`Ex.: Inteligência Artificial no trabalho`,value:p.name,onChange:e=>m({...p,name:e.target.value})}),(0,N.jsx)(`label`,{className:`label mt-4`,htmlFor:`topicPrompt`,children:`Diretriz para a LLM`}),(0,N.jsx)(`textarea`,{id:`topicPrompt`,className:`input h-24 resize-y`,placeholder:`Ex.: explique um conceito de IA com exemplo prático do dia a dia`,value:p.prompt,onChange:e=>m({...p,prompt:e.target.value})})]})]})}function _m({checked:e,onChange:t,disabled:n,label:r}){return(0,N.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2 text-sm font-medium text-gray-700`,children:[(0,N.jsxs)(`span`,{className:`relative inline-block h-6 w-11 shrink-0`,children:[(0,N.jsx)(`input`,{type:`checkbox`,className:`absolute inset-0 h-full w-full cursor-pointer opacity-0`,checked:e,disabled:n,onChange:t,"aria-label":r}),(0,N.jsx)(`span`,{className:`pointer-events-none block h-6 w-11 rounded-full bg-gray-300 transition peer-checked:bg-red-500 peer-disabled:opacity-50`}),(0,N.jsx)(`span`,{className:`pointer-events-none absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow transition peer-checked:translate-x-5`})]}),r]})}function vm({label:e,value:t,onChange:n}){return(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,children:e}),(0,N.jsx)(`input`,{type:`number`,className:`input`,value:t??0,onChange:e=>n(Number(e.target.value)||0)})]})}var ym=[{icon:ti,title:`Publique com LLM`},{icon:Fr,title:`Conecte-se`},{icon:Zr,title:`DMs em cascata`},{icon:dr,title:`Candidate-se`}],bm=[{left:`8%`,size:4,color:`#818cf8`,duration:10,delay:0},{left:`22%`,size:3,color:`#818cf8`,duration:11,delay:1},{left:`38%`,size:5,color:`#a5b4fc`,duration:12,delay:1},{left:`55%`,size:3,color:`#818cf8`,duration:11,delay:1.8},{left:`70%`,size:4,color:`#f472b6`,duration:14,delay:.5},{left:`82%`,size:3,color:`#a5b4fc`,duration:12,delay:1.8},{left:`93%`,size:4,color:`#6366f1`,duration:10,delay:3.8}];function xm(){let e=_t(),t=mt(),{user:n,login:r}=Zi(),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(!1),[m,h]=(0,_.useState)(null),g=(0,_.useCallback)(async()=>{try{let e=await M.get(`/auth/defaults`);h(e.firstRun?e:null)}catch{h(null)}},[]);(0,_.useEffect)(()=>{g()},[g]);let v=t.state?.from??`/`;return n?(0,N.jsx)(Ht,{to:v,replace:!0}):(0,N.jsxs)(`div`,{className:`flex h-screen w-full overflow-hidden`,children:[(0,N.jsxs)(`div`,{className:`relative hidden w-1/2 overflow-hidden bg-[#1e1b4b] lg:flex`,children:[(0,N.jsx)(`div`,{className:`login-orb login-orb-a`}),(0,N.jsx)(`div`,{className:`login-orb login-orb-b`}),(0,N.jsx)(`div`,{className:`login-orb login-orb-center`}),bm.map(e=>(0,N.jsx)(`span`,{className:`login-particle`,style:{left:e.left,width:e.size,height:e.size,background:e.color,animationDuration:`${e.duration}s`,animationDelay:`${e.delay}s`}},e.left)),(0,N.jsxs)(`div`,{className:`relative z-10 flex h-full w-full flex-col justify-center px-16`,children:[(0,N.jsxs)(`h1`,{className:`text-2xl font-bold tracking-tight text-white`,children:[`Job`,(0,N.jsx)(`span`,{className:`text-[#818cf8]`,children:`Finder`})]}),(0,N.jsxs)(`h2`,{className:`mt-10 max-w-xl text-4xl font-bold leading-tight text-white`,children:[`Tudo o que você precisa para `,(0,N.jsx)(`span`,{className:`text-[#818cf8]`,children:`automatizar sua carreira`}),` no LinkedIn em um só lugar`]}),(0,N.jsx)(`p`,{className:`mt-4 max-w-md text-lg text-white/50`,children:`Menos trabalho manual, mais candidaturas certas — em um só lugar.`}),(0,N.jsx)(`div`,{className:`mt-12 grid max-w-2xl grid-cols-4 gap-6`,children:ym.map((e,t)=>(0,N.jsxs)(`div`,{className:`login-step flex flex-col items-center gap-3`,style:{animationDelay:`${.3+t*.15}s`},children:[(0,N.jsxs)(`div`,{className:`relative flex h-24 w-24 items-center justify-center rounded-2xl border border-indigo-400/20 bg-indigo-500/10 backdrop-blur-md transition hover:border-indigo-400/50`,children:[(0,N.jsx)(`span`,{className:`absolute left-3 top-2 text-[10px] font-semibold text-indigo-400/60`,children:t+1}),(0,N.jsx)(e.icon,{className:`h-9 w-9 text-[#a5b4fc]`}),t<ym.length-1&&(0,N.jsx)(`span`,{className:`login-step-arrow`})]}),(0,N.jsx)(`h3`,{className:`text-center text-sm font-medium text-white/65`,children:e.title})]},e.title))})]})]}),(0,N.jsxs)(`div`,{className:`flex w-full flex-col justify-between overflow-y-auto bg-gray-50 p-8 lg:w-1/2`,children:[(0,N.jsx)(`div`,{className:`flex justify-end`,children:(0,N.jsxs)(`span`,{className:`badge bg-indigo-100 text-indigo-700`,title:`JobFinder — automação inteligente para LinkedIn`,children:[(0,N.jsx)(Ti,{className:`mr-1 h-3 w-3`}),`automação inteligente`]})}),(0,N.jsxs)(`div`,{className:`mx-auto w-full max-w-sm`,children:[(0,N.jsx)(`h2`,{className:`text-2xl font-bold text-gray-800`,children:`Bem-vindo de volta!`}),(0,N.jsx)(`p`,{className:`mt-2 text-sm text-gray-500`,children:`Acesso ao JobFinder — informe seu e-mail e senha.`}),u&&(0,N.jsx)(`div`,{className:`mt-6 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700`,role:`alert`,children:u}),(0,N.jsxs)(`form`,{className:`mt-6 space-y-5`,onSubmit:async t=>{t.preventDefault(),d(``),p(!0);try{await r(i.trim(),o),e(v,{replace:!0})}catch(e){d(e.message||`Não foi possível entrar. Verifique o e-mail e a senha.`)}finally{p(!1)}},children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`email`,children:`E-mail`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Yr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`email`,type:`email`,required:!0,autoComplete:`email`,className:`input !pl-10`,placeholder:`seu@email.com`,value:i,onChange:e=>a(e.target.value)})]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`label`,htmlFor:`password`,children:`Senha`}),(0,N.jsxs)(`div`,{className:`relative`,children:[(0,N.jsx)(Gr,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400`}),(0,N.jsx)(`input`,{id:`password`,type:c?`text`:`password`,required:!0,autoComplete:`current-password`,className:`input !pl-10 !pr-11`,placeholder:`••••••`,value:o,onChange:e=>s(e.target.value)}),(0,N.jsx)(`button`,{type:`button`,className:`absolute right-2 top-1/2 -translate-y-1/2 rounded-lg p-1.5 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600`,onClick:()=>l(e=>!e),"aria-label":c?`Ocultar senha`:`Mostrar senha`,title:c?`Ocultar senha`:`Mostrar senha`,children:c?(0,N.jsx)(Nr,{className:`h-4 w-4`}):(0,N.jsx)(jr,{className:`h-4 w-4`})})]})]}),(0,N.jsxs)(`button`,{className:`btn-primary w-full`,type:`submit`,disabled:f,children:[f?(0,N.jsx)(Ur,{className:`h-4 w-4 animate-spin`}):(0,N.jsx)(sr,{className:`h-4 w-4`}),f?`Entrando…`:`Entrar`]})]}),m&&(0,N.jsxs)(`div`,{className:`mt-6 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-xs text-amber-800`,children:[(0,N.jsx)(`p`,{className:`font-semibold`,children:`Primeiro acesso (usuário pré-criado)`}),(0,N.jsxs)(`p`,{className:`mt-1`,children:[`E-mail `,(0,N.jsx)(`code`,{className:`font-mono font-semibold`,children:m.email}),` · senha`,` `,(0,N.jsx)(`code`,{className:`font-mono font-semibold`,children:`123456`})]}),(0,N.jsx)(`p`,{className:`mt-1 text-amber-700`,children:`Troque a senha em Configurações → Segurança após o primeiro login.`})]})]}),(0,N.jsxs)(`div`,{className:`mt-8 text-center text-xs text-gray-400`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,N.jsx)(`a`,{className:`hover:text-indigo-600`,href:`/legal/terms.html`,target:`_blank`,rel:`noreferrer noopener`,children:`Termos de Uso`}),(0,N.jsx)(`span`,{className:`opacity-50`,children:`|`}),(0,N.jsx)(`a`,{className:`hover:text-indigo-600`,href:`/legal/privacy.html`,target:`_blank`,rel:`noreferrer noopener`,children:`Política de Privacidade`})]}),(0,N.jsx)(`div`,{className:`mt-2`,children:"© 2026 JobFinder (DanHachuel) · dados em `~/.jobfinder/`"})]})]})]})}function Sm(){return(0,N.jsxs)(`div`,{className:`flex h-screen w-full items-center justify-center bg-[#1e1b4b] text-indigo-200`,children:[(0,N.jsx)(Ur,{className:`mr-2 h-5 w-5 animate-spin`}),(0,N.jsx)(`span`,{className:`text-sm`,children:`Verificando sessão…`})]})}function Cm(){let{user:e,loading:t}=Zi(),n=mt();return t?(0,N.jsx)(Sm,{}):e?(0,N.jsx)(P,{children:(0,N.jsx)(Ut,{})}):(0,N.jsx)(Ht,{to:`/login`,replace:!0,state:{from:n.pathname}})}function wm(){return(0,N.jsxs)(Kt,{children:[(0,N.jsx)(Wt,{path:`/login`,element:(0,N.jsx)(xm,{})}),(0,N.jsxs)(Wt,{element:(0,N.jsx)(Cm,{}),children:[(0,N.jsx)(Wt,{path:`/`,element:(0,N.jsx)(Kp,{})}),(0,N.jsx)(Wt,{path:`/postagens`,element:(0,N.jsx)(rm,{})}),(0,N.jsx)(Wt,{path:`/postagens/agendar`,element:(0,N.jsx)(im,{})}),(0,N.jsx)(Wt,{path:`/conexoes`,element:(0,N.jsx)(om,{})}),(0,N.jsx)(Wt,{path:`/conexoes/dm`,element:(0,N.jsx)(cm,{})}),(0,N.jsx)(Wt,{path:`/vagas`,element:(0,N.jsx)(lm,{})}),(0,N.jsx)(Wt,{path:`/vagas/candidaturas`,element:(0,N.jsx)(um,{})}),(0,N.jsx)(Wt,{path:`/integracoes`,element:(0,N.jsx)(pm,{})}),(0,N.jsx)(Wt,{path:`/config`,element:(0,N.jsx)(gm,{})}),(0,N.jsx)(Wt,{path:`/configuracoes`,element:(0,N.jsx)(gm,{})}),(0,N.jsx)(Wt,{path:`*`,element:(0,N.jsx)(Ht,{to:`/`,replace:!0})})]})]})}Wi.createRoot(document.getElementById(`root`)).render((0,N.jsx)(_.StrictMode,{children:(0,N.jsx)(Mn,{children:(0,N.jsx)(Xp,{children:(0,N.jsx)(Xi,{children:(0,N.jsx)(wm,{})})})})}));
|