diff --git a/assets/index-Cw30ilpq.js b/assets/index-tew09Cp7.js similarity index 96% rename from assets/index-Cw30ilpq.js rename to assets/index-tew09Cp7.js index 94f8213..25aa39c 100644 --- a/assets/index-Cw30ilpq.js +++ b/assets/index-tew09Cp7.js @@ -1,4 +1,4 @@ -var GQ=Object.defineProperty;var jQ=(t,e,n)=>e in t?GQ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var WQ=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var bi=(t,e,n)=>(jQ(t,typeof e!="symbol"?e+"":e,n),n);var gnt=WQ((Es,Ms)=>{function qQ(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var W1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ya(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ju(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var v9={exports:{}},tC={},y9={exports:{}},pn={};/** +var GQ=Object.defineProperty;var jQ=(t,e,n)=>e in t?GQ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var WQ=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var bi=(t,e,n)=>(jQ(t,typeof e!="symbol"?e+"":e,n),n);var gnt=WQ((Es,Ms)=>{function qQ(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var W1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function va(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ju(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var v9={exports:{}},tC={},y9={exports:{}},pn={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var GQ=Object.defineProperty;var jQ=(t,e,n)=>e in t?GQ(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var qy=Symbol.for("react.element"),XQ=Symbol.for("react.portal"),KQ=Symbol.for("react.fragment"),YQ=Symbol.for("react.strict_mode"),ZQ=Symbol.for("react.profiler"),QQ=Symbol.for("react.provider"),JQ=Symbol.for("react.context"),eJ=Symbol.for("react.forward_ref"),tJ=Symbol.for("react.suspense"),nJ=Symbol.for("react.memo"),rJ=Symbol.for("react.lazy"),SL=Symbol.iterator;function iJ(t){return t===null||typeof t!="object"?null:(t=SL&&t[SL]||t["@@iterator"],typeof t=="function"?t:null)}var b9={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x9=Object.assign,w9={};function rg(t,e,n){this.props=t,this.context=e,this.refs=w9,this.updater=n||b9}rg.prototype.isReactComponent={};rg.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};rg.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _9(){}_9.prototype=rg.prototype;function a3(t,e,n){this.props=t,this.context=e,this.refs=w9,this.updater=n||b9}var l3=a3.prototype=new _9;l3.constructor=a3;x9(l3,rg.prototype);l3.isPureReactComponent=!0;var CL=Array.isArray,S9=Object.prototype.hasOwnProperty,u3={current:null},C9={key:!0,ref:!0,__self:!0,__source:!0};function E9(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)S9.call(e,r)&&!C9.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1e in t?GQ(t,e,{enumerable:!0,config `+N2+t}var F2=!1;function O2(t,e){if(!t||F2)return"";F2=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(` `),o=r.stack.split(` `),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{F2=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?B0(t):""}function xJ(t){switch(t.tag){case 5:return B0(t.type);case 16:return B0("Lazy");case 13:return B0("Suspense");case 19:return B0("SuspenseList");case 0:case 2:case 15:return t=O2(t.type,!1),t;case 11:return t=O2(t.type.render,!1),t;case 1:return t=O2(t.type,!0),t;default:return""}}function dP(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Lp:return"Fragment";case kp:return"Portal";case lP:return"Profiler";case p3:return"StrictMode";case uP:return"Suspense";case cP:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case N9:return(t.displayName||"Context")+".Consumer";case I9:return(t._context.displayName||"Context")+".Provider";case m3:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case g3:return e=t.displayName||null,e!==null?e:dP(t.type)||"Memo";case xc:e=t._payload,t=t._init;try{return dP(t(e))}catch{}}return null}function wJ(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dP(e);case 8:return e===p3?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function nd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function O9(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _J(t){var e=O9(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function K1(t){t._valueTracker||(t._valueTracker=_J(t))}function k9(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=O9(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function g_(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function fP(t,e){var n=e.checked;return Cr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function PL(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=nd(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function L9(t,e){e=e.checked,e!=null&&h3(t,"checked",e,!1)}function hP(t,e){L9(t,e);var n=nd(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?pP(t,e.type,n):e.hasOwnProperty("defaultValue")&&pP(t,e.type,nd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function DL(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function pP(t,e,n){(e!=="number"||g_(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var $0=Array.isArray;function am(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Y1.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Lv(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var nv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},SJ=["Webkit","ms","Moz","O"];Object.keys(nv).forEach(function(t){SJ.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),nv[e]=nv[t]})});function U9(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||nv.hasOwnProperty(t)&&nv[t]?(""+e).trim():e+"px"}function H9(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=U9(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var CJ=Cr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vP(t,e){if(e){if(CJ[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(tt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(tt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(tt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(tt(62))}}function yP(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 bP=null;function v3(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var xP=null,lm=null,um=null;function NL(t){if(t=Yy(t)){if(typeof xP!="function")throw Error(tt(280));var e=t.stateNode;e&&(e=sC(e),xP(t.stateNode,t.type,e))}}function V9(t){lm?um?um.push(t):um=[t]:lm=t}function G9(){if(lm){var t=lm,e=um;if(um=lm=null,NL(t),e)for(t=0;t>>=0,t===0?32:31-(OJ(t)/kJ|0)|0}var Z1=64,Q1=4194304;function z0(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function x_(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=z0(a):(o&=s,o!==0&&(r=z0(o)))}else s=n&~i,s!==0?r=z0(s):o!==0&&(r=z0(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Xy(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ga(e),t[e]=n}function zJ(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=iv),HL=" ",VL=!1;function c7(t,e){switch(t){case"keyup":return pee.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function d7(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Bp=!1;function gee(t,e){switch(t){case"compositionend":return d7(e);case"keypress":return e.which!==32?null:(VL=!0,HL);case"textInput":return t=e.data,t===HL&&VL?null:t;default:return null}}function vee(t,e){if(Bp)return t==="compositionend"||!E3&&c7(t,e)?(t=l7(),Lw=_3=Fc=null,Bp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qL(n)}}function m7(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?m7(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function g7(){for(var t=window,e=g_();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=g_(t.document)}return e}function M3(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Mee(t){var e=g7(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&m7(n.ownerDocument.documentElement,n)){if(r!==null&&M3(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=XL(n,o);var s=XL(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$p=null,MP=null,sv=null,TP=!1;function KL(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;TP||$p==null||$p!==g_(r)||(r=$p,"selectionStart"in r&&M3(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}),sv&&Vv(sv,r)||(sv=r,r=S_(MP,"onSelect"),0Hp||(t.current=NP[Hp],NP[Hp]=null,Hp--)}function Jn(t,e){Hp++,NP[Hp]=t.current,t.current=e}var rd={},so=gd(rd),jo=gd(!1),Rf=rd;function Pm(t,e){var n=t.type.contextTypes;if(!n)return rd;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Wo(t){return t=t.childContextTypes,t!=null}function E_(){sr(jo),sr(so)}function n4(t,e,n){if(so.current!==rd)throw Error(tt(168));Jn(so,e),Jn(jo,n)}function E7(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(tt(108,wJ(t)||"Unknown",i));return Cr({},n,r)}function M_(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rd,Rf=so.current,Jn(so,t),Jn(jo,jo.current),!0}function r4(t,e,n){var r=t.stateNode;if(!r)throw Error(tt(169));n?(t=E7(t,e,Rf),r.__reactInternalMemoizedMergedChildContext=t,sr(jo),sr(so),Jn(so,t)):sr(jo),Jn(jo,n)}var vu=null,aC=!1,K2=!1;function M7(t){vu===null?vu=[t]:vu.push(t)}function Bee(t){aC=!0,M7(t)}function vd(){if(!K2&&vu!==null){K2=!0;var t=0,e=zn;try{var n=vu;for(zn=1;t>=s,i-=s,Cu=1<<32-Ga(e)+i|n<P?(A=M,M=null):A=M.sibling;var R=f(m,M,x[P],_);if(R===null){M===null&&(M=A);break}t&&M&&R.alternate===null&&e(m,M),w=o(R,w,P),S===null?C=R:S.sibling=R,S=R,M=A}if(P===x.length)return n(m,M),hr&&Yd(m,P),C;if(M===null){for(;PP?(A=M,M=null):A=M.sibling;var F=f(m,M,R.value,_);if(F===null){M===null&&(M=A);break}t&&M&&F.alternate===null&&e(m,M),w=o(F,w,P),S===null?C=F:S.sibling=F,S=F,M=A}if(R.done)return n(m,M),hr&&Yd(m,P),C;if(M===null){for(;!R.done;P++,R=x.next())R=d(m,R.value,_),R!==null&&(w=o(R,w,P),S===null?C=R:S.sibling=R,S=R);return hr&&Yd(m,P),C}for(M=r(m,M);!R.done;P++,R=x.next())R=h(M,m,P,R.value,_),R!==null&&(t&&R.alternate!==null&&M.delete(R.key===null?P:R.key),w=o(R,w,P),S===null?C=R:S.sibling=R,S=R);return t&&M.forEach(function($){return e(m,$)}),hr&&Yd(m,P),C}function b(m,w,x,_){if(typeof x=="object"&&x!==null&&x.type===Lp&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case X1:e:{for(var C=x.key,S=w;S!==null;){if(S.key===C){if(C=x.type,C===Lp){if(S.tag===7){n(m,S.sibling),w=i(S,x.props.children),w.return=m,m=w;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===xc&&c4(C)===S.type){n(m,S.sibling),w=i(S,x.props),w.ref=i0(m,S,x),w.return=m,m=w;break e}n(m,S);break}else e(m,S);S=S.sibling}x.type===Lp?(w=xf(x.props.children,m.mode,_,x.key),w.return=m,m=w):(_=jw(x.type,x.key,x.props,null,m.mode,_),_.ref=i0(m,w,x),_.return=m,m=_)}return s(m);case kp:e:{for(S=x.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(m,w.sibling),w=i(w,x.children||[]),w.return=m,m=w;break e}else{n(m,w);break}else e(m,w);w=w.sibling}w=rT(x,m.mode,_),w.return=m,m=w}return s(m);case xc:return S=x._init,b(m,w,S(x._payload),_)}if($0(x))return p(m,w,x,_);if(Jg(x))return g(m,w,x,_);ox(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(m,w.sibling),w=i(w,x),w.return=m,m=w):(n(m,w),w=nT(x,m.mode,_),w.return=m,m=w),s(m)):n(m,w)}return b}var Rm=F7(!0),O7=F7(!1),Zy={},Dl=gd(Zy),qv=gd(Zy),Xv=gd(Zy);function uf(t){if(t===Zy)throw Error(tt(174));return t}function O3(t,e){switch(Jn(Xv,e),Jn(qv,t),Jn(Dl,Zy),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:gP(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=gP(e,t)}sr(Dl),Jn(Dl,e)}function Im(){sr(Dl),sr(qv),sr(Xv)}function k7(t){uf(Xv.current);var e=uf(Dl.current),n=gP(e,t.type);e!==n&&(Jn(qv,t),Jn(Dl,n))}function k3(t){qv.current===t&&(sr(Dl),sr(qv))}var yr=gd(0);function I_(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Y2=[];function L3(){for(var t=0;tn?n:4,t(!0);var r=Z2.transition;Z2.transition={};try{t(!1),e()}finally{zn=n,Z2.transition=r}}function Q7(){return ha().memoizedState}function Hee(t,e,n){var r=Xc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},J7(t))eH(e,n);else if(n=D7(t,e,n,r),n!==null){var i=Eo();ja(n,t,r,i),tH(n,e,r)}}function Vee(t,e,n){var r=Xc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(J7(t))eH(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Ka(a,s)){var l=e.interleaved;l===null?(i.next=i,N3(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=D7(t,e,i,r),n!==null&&(i=Eo(),ja(n,t,r,i),tH(n,e,r))}}function J7(t){var e=t.alternate;return t===wr||e!==null&&e===wr}function eH(t,e){av=N_=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function tH(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,b3(t,n)}}var F_={readContext:fa,useCallback:Zi,useContext:Zi,useEffect:Zi,useImperativeHandle:Zi,useInsertionEffect:Zi,useLayoutEffect:Zi,useMemo:Zi,useReducer:Zi,useRef:Zi,useState:Zi,useDebugValue:Zi,useDeferredValue:Zi,useTransition:Zi,useMutableSource:Zi,useSyncExternalStore:Zi,useId:Zi,unstable_isNewReconciler:!1},Gee={readContext:fa,useCallback:function(t,e){return gl().memoizedState=[t,e===void 0?null:e],t},useContext:fa,useEffect:f4,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Uw(4194308,4,q7.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Uw(4194308,4,t,e)},useInsertionEffect:function(t,e){return Uw(4,2,t,e)},useMemo:function(t,e){var n=gl();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=gl();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Hee.bind(null,wr,t),[r.memoizedState,t]},useRef:function(t){var e=gl();return t={current:t},e.memoizedState=t},useState:d4,useDebugValue:H3,useDeferredValue:function(t){return gl().memoizedState=t},useTransition:function(){var t=d4(!1),e=t[0];return t=Uee.bind(null,t[1]),gl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=wr,i=gl();if(hr){if(n===void 0)throw Error(tt(407));n=n()}else{if(n=e(),Ti===null)throw Error(tt(349));Nf&30||$7(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,f4(U7.bind(null,r,o,t),[t]),r.flags|=2048,Zv(9,z7.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=gl(),e=Ti.identifierPrefix;if(hr){var n=Eu,r=Cu;n=(r&~(1<<32-Ga(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Kv++,0")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{F2=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?B0(t):""}function xJ(t){switch(t.tag){case 5:return B0(t.type);case 16:return B0("Lazy");case 13:return B0("Suspense");case 19:return B0("SuspenseList");case 0:case 2:case 15:return t=O2(t.type,!1),t;case 11:return t=O2(t.type.render,!1),t;case 1:return t=O2(t.type,!0),t;default:return""}}function dP(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Lp:return"Fragment";case kp:return"Portal";case lP:return"Profiler";case p3:return"StrictMode";case uP:return"Suspense";case cP:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case N9:return(t.displayName||"Context")+".Consumer";case I9:return(t._context.displayName||"Context")+".Provider";case m3:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case g3:return e=t.displayName||null,e!==null?e:dP(t.type)||"Memo";case xc:e=t._payload,t=t._init;try{return dP(t(e))}catch{}}return null}function wJ(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dP(e);case 8:return e===p3?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function nd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function O9(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _J(t){var e=O9(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function K1(t){t._valueTracker||(t._valueTracker=_J(t))}function k9(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=O9(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function g_(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function fP(t,e){var n=e.checked;return Cr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function PL(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=nd(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function L9(t,e){e=e.checked,e!=null&&h3(t,"checked",e,!1)}function hP(t,e){L9(t,e);var n=nd(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?pP(t,e.type,n):e.hasOwnProperty("defaultValue")&&pP(t,e.type,nd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function DL(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function pP(t,e,n){(e!=="number"||g_(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var $0=Array.isArray;function am(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Y1.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Lv(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var nv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},SJ=["Webkit","ms","Moz","O"];Object.keys(nv).forEach(function(t){SJ.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),nv[e]=nv[t]})});function U9(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||nv.hasOwnProperty(t)&&nv[t]?(""+e).trim():e+"px"}function H9(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=U9(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var CJ=Cr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function vP(t,e){if(e){if(CJ[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(tt(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(tt(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(tt(61))}if(e.style!=null&&typeof e.style!="object")throw Error(tt(62))}}function yP(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 bP=null;function v3(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var xP=null,lm=null,um=null;function NL(t){if(t=Yy(t)){if(typeof xP!="function")throw Error(tt(280));var e=t.stateNode;e&&(e=sC(e),xP(t.stateNode,t.type,e))}}function V9(t){lm?um?um.push(t):um=[t]:lm=t}function G9(){if(lm){var t=lm,e=um;if(um=lm=null,NL(t),e)for(t=0;t>>=0,t===0?32:31-(OJ(t)/kJ|0)|0}var Z1=64,Q1=4194304;function z0(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function x_(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=z0(a):(o&=s,o!==0&&(r=z0(o)))}else s=n&~i,s!==0?r=z0(s):o!==0&&(r=z0(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Xy(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Va(e),t[e]=n}function zJ(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=iv),HL=" ",VL=!1;function c7(t,e){switch(t){case"keyup":return pee.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function d7(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Bp=!1;function gee(t,e){switch(t){case"compositionend":return d7(e);case"keypress":return e.which!==32?null:(VL=!0,HL);case"textInput":return t=e.data,t===HL&&VL?null:t;default:return null}}function vee(t,e){if(Bp)return t==="compositionend"||!E3&&c7(t,e)?(t=l7(),Lw=_3=Fc=null,Bp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qL(n)}}function m7(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?m7(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function g7(){for(var t=window,e=g_();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=g_(t.document)}return e}function M3(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Mee(t){var e=g7(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&m7(n.ownerDocument.documentElement,n)){if(r!==null&&M3(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=XL(n,o);var s=XL(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$p=null,MP=null,sv=null,TP=!1;function KL(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;TP||$p==null||$p!==g_(r)||(r=$p,"selectionStart"in r&&M3(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}),sv&&Vv(sv,r)||(sv=r,r=S_(MP,"onSelect"),0Hp||(t.current=NP[Hp],NP[Hp]=null,Hp--)}function Jn(t,e){Hp++,NP[Hp]=t.current,t.current=e}var rd={},so=gd(rd),jo=gd(!1),Rf=rd;function Pm(t,e){var n=t.type.contextTypes;if(!n)return rd;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Wo(t){return t=t.childContextTypes,t!=null}function E_(){sr(jo),sr(so)}function n4(t,e,n){if(so.current!==rd)throw Error(tt(168));Jn(so,e),Jn(jo,n)}function E7(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(tt(108,wJ(t)||"Unknown",i));return Cr({},n,r)}function M_(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||rd,Rf=so.current,Jn(so,t),Jn(jo,jo.current),!0}function r4(t,e,n){var r=t.stateNode;if(!r)throw Error(tt(169));n?(t=E7(t,e,Rf),r.__reactInternalMemoizedMergedChildContext=t,sr(jo),sr(so),Jn(so,t)):sr(jo),Jn(jo,n)}var vu=null,aC=!1,K2=!1;function M7(t){vu===null?vu=[t]:vu.push(t)}function Bee(t){aC=!0,M7(t)}function vd(){if(!K2&&vu!==null){K2=!0;var t=0,e=zn;try{var n=vu;for(zn=1;t>=s,i-=s,Cu=1<<32-Va(e)+i|n<P?(A=M,M=null):A=M.sibling;var R=f(m,M,x[P],_);if(R===null){M===null&&(M=A);break}t&&M&&R.alternate===null&&e(m,M),w=o(R,w,P),S===null?C=R:S.sibling=R,S=R,M=A}if(P===x.length)return n(m,M),hr&&Yd(m,P),C;if(M===null){for(;PP?(A=M,M=null):A=M.sibling;var F=f(m,M,R.value,_);if(F===null){M===null&&(M=A);break}t&&M&&F.alternate===null&&e(m,M),w=o(F,w,P),S===null?C=F:S.sibling=F,S=F,M=A}if(R.done)return n(m,M),hr&&Yd(m,P),C;if(M===null){for(;!R.done;P++,R=x.next())R=d(m,R.value,_),R!==null&&(w=o(R,w,P),S===null?C=R:S.sibling=R,S=R);return hr&&Yd(m,P),C}for(M=r(m,M);!R.done;P++,R=x.next())R=h(M,m,P,R.value,_),R!==null&&(t&&R.alternate!==null&&M.delete(R.key===null?P:R.key),w=o(R,w,P),S===null?C=R:S.sibling=R,S=R);return t&&M.forEach(function($){return e(m,$)}),hr&&Yd(m,P),C}function b(m,w,x,_){if(typeof x=="object"&&x!==null&&x.type===Lp&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case X1:e:{for(var C=x.key,S=w;S!==null;){if(S.key===C){if(C=x.type,C===Lp){if(S.tag===7){n(m,S.sibling),w=i(S,x.props.children),w.return=m,m=w;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===xc&&c4(C)===S.type){n(m,S.sibling),w=i(S,x.props),w.ref=i0(m,S,x),w.return=m,m=w;break e}n(m,S);break}else e(m,S);S=S.sibling}x.type===Lp?(w=xf(x.props.children,m.mode,_,x.key),w.return=m,m=w):(_=jw(x.type,x.key,x.props,null,m.mode,_),_.ref=i0(m,w,x),_.return=m,m=_)}return s(m);case kp:e:{for(S=x.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(m,w.sibling),w=i(w,x.children||[]),w.return=m,m=w;break e}else{n(m,w);break}else e(m,w);w=w.sibling}w=rT(x,m.mode,_),w.return=m,m=w}return s(m);case xc:return S=x._init,b(m,w,S(x._payload),_)}if($0(x))return p(m,w,x,_);if(Jg(x))return g(m,w,x,_);ox(m,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(m,w.sibling),w=i(w,x),w.return=m,m=w):(n(m,w),w=nT(x,m.mode,_),w.return=m,m=w),s(m)):n(m,w)}return b}var Rm=F7(!0),O7=F7(!1),Zy={},Pl=gd(Zy),qv=gd(Zy),Xv=gd(Zy);function uf(t){if(t===Zy)throw Error(tt(174));return t}function O3(t,e){switch(Jn(Xv,e),Jn(qv,t),Jn(Pl,Zy),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:gP(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=gP(e,t)}sr(Pl),Jn(Pl,e)}function Im(){sr(Pl),sr(qv),sr(Xv)}function k7(t){uf(Xv.current);var e=uf(Pl.current),n=gP(e,t.type);e!==n&&(Jn(qv,t),Jn(Pl,n))}function k3(t){qv.current===t&&(sr(Pl),sr(qv))}var yr=gd(0);function I_(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Y2=[];function L3(){for(var t=0;tn?n:4,t(!0);var r=Z2.transition;Z2.transition={};try{t(!1),e()}finally{zn=n,Z2.transition=r}}function Q7(){return fa().memoizedState}function Hee(t,e,n){var r=Xc(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},J7(t))eH(e,n);else if(n=D7(t,e,n,r),n!==null){var i=Eo();Ga(n,t,r,i),tH(n,e,r)}}function Vee(t,e,n){var r=Xc(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(J7(t))eH(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Xa(a,s)){var l=e.interleaved;l===null?(i.next=i,N3(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=D7(t,e,i,r),n!==null&&(i=Eo(),Ga(n,t,r,i),tH(n,e,r))}}function J7(t){var e=t.alternate;return t===wr||e!==null&&e===wr}function eH(t,e){av=N_=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function tH(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,b3(t,n)}}var F_={readContext:da,useCallback:Zi,useContext:Zi,useEffect:Zi,useImperativeHandle:Zi,useInsertionEffect:Zi,useLayoutEffect:Zi,useMemo:Zi,useReducer:Zi,useRef:Zi,useState:Zi,useDebugValue:Zi,useDeferredValue:Zi,useTransition:Zi,useMutableSource:Zi,useSyncExternalStore:Zi,useId:Zi,unstable_isNewReconciler:!1},Gee={readContext:da,useCallback:function(t,e){return ml().memoizedState=[t,e===void 0?null:e],t},useContext:da,useEffect:f4,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Uw(4194308,4,q7.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Uw(4194308,4,t,e)},useInsertionEffect:function(t,e){return Uw(4,2,t,e)},useMemo:function(t,e){var n=ml();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=ml();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Hee.bind(null,wr,t),[r.memoizedState,t]},useRef:function(t){var e=ml();return t={current:t},e.memoizedState=t},useState:d4,useDebugValue:H3,useDeferredValue:function(t){return ml().memoizedState=t},useTransition:function(){var t=d4(!1),e=t[0];return t=Uee.bind(null,t[1]),ml().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=wr,i=ml();if(hr){if(n===void 0)throw Error(tt(407));n=n()}else{if(n=e(),Ti===null)throw Error(tt(349));Nf&30||$7(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,f4(U7.bind(null,r,o,t),[t]),r.flags|=2048,Zv(9,z7.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=ml(),e=Ti.identifierPrefix;if(hr){var n=Eu,r=Cu;n=(r&~(1<<32-Va(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Kv++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Cl]=e,t[Wv]=r,cH(t,e,!1,!1),e.stateNode=t;e:{switch(s=yP(n,r),n){case"dialog":tr("cancel",t),tr("close",t),i=r;break;case"iframe":case"object":case"embed":tr("load",t),i=r;break;case"video":case"audio":for(i=0;iFm&&(e.flags|=128,r=!0,o0(o,!1),e.lanes=4194304)}else{if(!r)if(t=I_(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),o0(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!hr)return Qi(e),null}else 2*Ur()-o.renderingStartTime>Fm&&n!==1073741824&&(e.flags|=128,r=!0,o0(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ur(),e.sibling=null,n=yr.current,Jn(yr,r?n&1|2:n&1),e):(Qi(e),null);case 22:case 23:return X3(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?gs&1073741824&&(Qi(e),e.subtreeFlags&6&&(e.flags|=8192)):Qi(e),null;case 24:return null;case 25:return null}throw Error(tt(156,e.tag))}function Qee(t,e){switch(A3(e),e.tag){case 1:return Wo(e.type)&&E_(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Im(),sr(jo),sr(so),L3(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return k3(e),null;case 13:if(sr(yr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(tt(340));Dm()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return sr(yr),null;case 4:return Im(),null;case 10:return I3(e.type._context),null;case 22:case 23:return X3(),null;case 24:return null;default:return null}}var ax=!1,ro=!1,Jee=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Wp(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Rr(t,e,r)}else n.current=null}function jP(t,e,n){try{n()}catch(r){Rr(t,e,r)}}var w4=!1;function ete(t,e){if(AP=w_,t=g7(),M3(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++u===i&&(a=s),f===o&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(PP={focusedElem:t,selectionRange:n},w_=!1,yt=e;yt!==null;)if(e=yt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,yt=t;else for(;yt!==null;){e=yt;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,b=p.memoizedState,m=e.stateNode,w=m.getSnapshotBeforeUpdate(e.elementType===e.type?g:Da(e.type,g),b);m.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(tt(163))}}catch(_){Rr(e,e.return,_)}if(t=e.sibling,t!==null){t.return=e.return,yt=t;break}yt=e.return}return p=w4,w4=!1,p}function lv(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&jP(e,n,o)}i=i.next}while(i!==r)}}function cC(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function WP(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function hH(t){var e=t.alternate;e!==null&&(t.alternate=null,hH(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Cl],delete e[Wv],delete e[IP],delete e[kee],delete e[Lee])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function pH(t){return t.tag===5||t.tag===3||t.tag===4}function _4(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pH(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qP(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=C_));else if(r!==4&&(t=t.child,t!==null))for(qP(t,e,n),t=t.sibling;t!==null;)qP(t,e,n),t=t.sibling}function XP(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(XP(t,e,n),t=t.sibling;t!==null;)XP(t,e,n),t=t.sibling}var Li=null,Na=!1;function lc(t,e,n){for(n=n.child;n!==null;)mH(t,e,n),n=n.sibling}function mH(t,e,n){if(Pl&&typeof Pl.onCommitFiberUnmount=="function")try{Pl.onCommitFiberUnmount(nC,n)}catch{}switch(n.tag){case 5:ro||Wp(n,e);case 6:var r=Li,i=Na;Li=null,lc(t,e,n),Li=r,Na=i,Li!==null&&(Na?(t=Li,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Li.removeChild(n.stateNode));break;case 18:Li!==null&&(Na?(t=Li,n=n.stateNode,t.nodeType===8?X2(t.parentNode,n):t.nodeType===1&&X2(t,n),Uv(t)):X2(Li,n.stateNode));break;case 4:r=Li,i=Na,Li=n.stateNode.containerInfo,Na=!0,lc(t,e,n),Li=r,Na=i;break;case 0:case 11:case 14:case 15:if(!ro&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&jP(n,e,s),i=i.next}while(i!==r)}lc(t,e,n);break;case 1:if(!ro&&(Wp(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Rr(n,e,a)}lc(t,e,n);break;case 21:lc(t,e,n);break;case 22:n.mode&1?(ro=(r=ro)||n.memoizedState!==null,lc(t,e,n),ro=r):lc(t,e,n);break;default:lc(t,e,n)}}function S4(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Jee),e.forEach(function(r){var i=ute.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ca(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ur()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nte(r/1960))-r,10t?16:t,Oc===null)var r=!1;else{if(t=Oc,Oc=null,L_=0,_n&6)throw Error(tt(331));var i=_n;for(_n|=4,yt=t.current;yt!==null;){var o=yt,s=o.child;if(yt.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lUr()-W3?bf(t,0):j3|=n),qo(t,e)}function SH(t,e){e===0&&(t.mode&1?(e=Q1,Q1<<=1,!(Q1&130023424)&&(Q1=4194304)):e=1);var n=Eo();t=ku(t,e),t!==null&&(Xy(t,e,n),qo(t,n))}function lte(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),SH(t,n)}function ute(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(tt(314))}r!==null&&r.delete(e),SH(t,n)}var CH;CH=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||jo.current)Go=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Go=!1,Yee(t,e,n);Go=!!(t.flags&131072)}else Go=!1,hr&&e.flags&1048576&&T7(e,A_,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Hw(t,e),t=e.pendingProps;var i=Pm(e,so.current);dm(e,n),i=$3(null,e,r,t,i,n);var o=z3();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Wo(r)?(o=!0,M_(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,F3(e),i.updater=lC,e.stateNode=i,i._reactInternals=e,BP(e,r,t,n),e=UP(null,e,r,!0,o,n)):(e.tag=0,hr&&o&&T3(e),bo(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Hw(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=dte(r),t=Da(r,t),i){case 0:e=zP(null,e,r,t,n);break e;case 1:e=y4(null,e,r,t,n);break e;case 11:e=g4(null,e,r,t,n);break e;case 14:e=v4(null,e,r,Da(r.type,t),n);break e}throw Error(tt(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Da(r,i),zP(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Da(r,i),y4(t,e,r,i,n);case 3:e:{if(aH(e),t===null)throw Error(tt(387));r=e.pendingProps,o=e.memoizedState,i=o.element,R7(t,e),R_(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Nm(Error(tt(423)),e),e=b4(t,e,r,n,i);break e}else if(r!==i){i=Nm(Error(tt(424)),e),e=b4(t,e,r,n,i);break e}else for(Cs=jc(e.stateNode.containerInfo.firstChild),Ts=e,hr=!0,Fa=null,n=O7(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dm(),r===i){e=Lu(t,e,n);break e}bo(t,e,r,n)}e=e.child}return e;case 5:return k7(e),t===null&&OP(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,DP(r,i)?s=null:o!==null&&DP(r,o)&&(e.flags|=32),sH(t,e),bo(t,e,s,n),e.child;case 6:return t===null&&OP(e),null;case 13:return lH(t,e,n);case 4:return O3(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Rm(e,null,r,n):bo(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Da(r,i),g4(t,e,r,i,n);case 7:return bo(t,e,e.pendingProps,n),e.child;case 8:return bo(t,e,e.pendingProps.children,n),e.child;case 12:return bo(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Jn(P_,r._currentValue),r._currentValue=s,o!==null)if(Ka(o.value,s)){if(o.children===i.children&&!jo.current){e=Lu(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Du(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),kP(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(tt(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),kP(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}bo(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,dm(e,n),i=fa(i),r=r(i),e.flags|=1,bo(t,e,r,n),e.child;case 14:return r=e.type,i=Da(r,e.pendingProps),i=Da(r.type,i),v4(t,e,r,i,n);case 15:return iH(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Da(r,i),Hw(t,e),e.tag=1,Wo(r)?(t=!0,M_(e)):t=!1,dm(e,n),N7(e,r,i),BP(e,r,i,n),UP(null,e,r,!0,t,n);case 19:return uH(t,e,n);case 22:return oH(t,e,n)}throw Error(tt(156,e.tag))};function EH(t,e){return Z9(t,e)}function cte(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 sa(t,e,n,r){return new cte(t,e,n,r)}function Y3(t){return t=t.prototype,!(!t||!t.isReactComponent)}function dte(t){if(typeof t=="function")return Y3(t)?1:0;if(t!=null){if(t=t.$$typeof,t===m3)return 11;if(t===g3)return 14}return 2}function Kc(t,e){var n=t.alternate;return n===null?(n=sa(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function jw(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")Y3(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Lp:return xf(n.children,i,o,e);case p3:s=8,i|=8;break;case lP:return t=sa(12,n,e,i|2),t.elementType=lP,t.lanes=o,t;case uP:return t=sa(13,n,e,i),t.elementType=uP,t.lanes=o,t;case cP:return t=sa(19,n,e,i),t.elementType=cP,t.lanes=o,t;case F9:return fC(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case I9:s=10;break e;case N9:s=9;break e;case m3:s=11;break e;case g3:s=14;break e;case xc:s=16,r=null;break e}throw Error(tt(130,t==null?t:typeof t,""))}return e=sa(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function xf(t,e,n,r){return t=sa(7,t,r,e),t.lanes=n,t}function fC(t,e,n,r){return t=sa(22,t,r,e),t.elementType=F9,t.lanes=n,t.stateNode={isHidden:!1},t}function nT(t,e,n){return t=sa(6,t,null,e),t.lanes=n,t}function rT(t,e,n){return e=sa(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function fte(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=L2(0),this.expirationTimes=L2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=L2(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Z3(t,e,n,r,i,o,s,a,l){return t=new fte(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=sa(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},F3(o),t}function hte(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PH)}catch(t){console.error(t)}}PH(),T9.exports=Os;var qu=T9.exports;const cx=ya(qu);var DH,R4=qu;DH=sP.createRoot=R4.createRoot,sP.hydrateRoot=R4.hydrateRoot;const Jv={black:"#000",white:"#fff"},Ih={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Nh={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Fh={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Oh={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},kh={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},a0={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},yte={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Bu(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n=0)&&(n[i]=t[i]);return n}function RH(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var xte=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,wte=RH(function(t){return xte.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function _te(t){if(t.sheet)return t.sheet;for(var e=0;e0?Bi(sg,--Zo):0,Om--,Yr===10&&(Om=1,yC--),Yr}function As(){return Yr=Zo2||ty(Yr)>3?"":" "}function Ote(t,e){for(;--e&&As()&&!(Yr<48||Yr>102||Yr>57&&Yr<65||Yr>70&&Yr<97););return Jy(t,Ww()+(e<6&&Rl()==32&&As()==32))}function eD(t){for(;As();)switch(Yr){case t:return Zo;case 34:case 39:t!==34&&t!==39&&eD(Yr);break;case 40:t===41&&eD(t);break;case 92:As();break}return Zo}function kte(t,e){for(;As()&&t+Yr!==57;)if(t+Yr===84&&Rl()===47)break;return"/*"+Jy(e,Zo-1)+"*"+vC(t===47?t:As())}function Lte(t){for(;!ty(Rl());)As();return Jy(t,Zo)}function Bte(t){return LH(Xw("",null,null,null,[""],t=kH(t),0,[0],t))}function Xw(t,e,n,r,i,o,s,a,l){for(var u=0,c=0,d=s,f=0,h=0,p=0,g=1,b=1,m=1,w=0,x="",_=i,C=o,S=r,M=x;b;)switch(p=w,w=As()){case 40:if(p!=108&&Bi(M,d-1)==58){JP(M+=Dn(qw(w),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:M+=qw(w);break;case 9:case 10:case 13:case 32:M+=Fte(p);break;case 92:M+=Ote(Ww()-1,7);continue;case 47:switch(Rl()){case 42:case 47:dx($te(kte(As(),Ww()),e,n),l);break;default:M+="/"}break;case 123*g:a[u++]=xl(M)*m;case 125*g:case 59:case 0:switch(w){case 0:case 125:b=0;case 59+c:m==-1&&(M=Dn(M,/\f/g,"")),h>0&&xl(M)-d&&dx(h>32?N4(M+";",r,n,d-1):N4(Dn(M," ","")+";",r,n,d-2),l);break;case 59:M+=";";default:if(dx(S=I4(M,e,n,u,c,i,a,x,_=[],C=[],d),o),w===123)if(c===0)Xw(M,e,S,S,_,o,d,a,C);else switch(f===99&&Bi(M,3)===110?100:f){case 100:case 108:case 109:case 115:Xw(t,S,S,r&&dx(I4(t,S,S,0,0,i,a,x,i,_=[],d),C),i,C,d,a,r?_:C);break;default:Xw(M,S,S,S,[""],C,0,a,C)}}u=c=h=0,g=m=1,x=M="",d=s;break;case 58:d=1+xl(M),h=p;default:if(g<1){if(w==123)--g;else if(w==125&&g++==0&&Nte()==125)continue}switch(M+=vC(w),w*g){case 38:m=c>0?1:(M+="\f",-1);break;case 44:a[u++]=(xl(M)-1)*m,m=1;break;case 64:Rl()===45&&(M+=qw(As())),f=Rl(),c=d=xl(x=M+=Lte(Ww())),w++;break;case 45:p===45&&xl(M)==2&&(g=0)}}return o}function I4(t,e,n,r,i,o,s,a,l,u,c){for(var d=i-1,f=i===0?o:[""],h=rI(f),p=0,g=0,b=0;p0?f[m]+" "+w:Dn(w,/&\f/g,f[m])))&&(l[b++]=x);return bC(t,e,n,i===0?tI:a,l,u,c)}function $te(t,e,n){return bC(t,e,n,IH,vC(Ite()),ey(t,2,-2),0)}function N4(t,e,n,r){return bC(t,e,n,nI,ey(t,0,r),ey(t,r+1,-1),r)}function hm(t,e){for(var n="",r=rI(t),i=0;i6)switch(Bi(t,e+1)){case 109:if(Bi(t,e+4)!==45)break;case 102:return Dn(t,/(.+:)(.+)-([^]+)/,"$1"+Pn+"$2-$3$1"+z_+(Bi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~JP(t,"stretch")?BH(Dn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Bi(t,e+1)!==115)break;case 6444:switch(Bi(t,xl(t)-3-(~JP(t,"!important")&&10))){case 107:return Dn(t,":",":"+Pn)+t;case 101:return Dn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Pn+(Bi(t,14)===45?"inline-":"")+"box$3$1"+Pn+"$2$3$1"+to+"$2box$3")+t}break;case 5936:switch(Bi(t,e+11)){case 114:return Pn+t+to+Dn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Pn+t+to+Dn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Pn+t+to+Dn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Pn+t+to+t+t}return t}var Xte=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case nI:e.return=BH(e.value,e.length);break;case NH:return hm([l0(e,{value:Dn(e.value,"@","@"+Pn)})],i);case tI:if(e.length)return Rte(e.props,function(o){switch(Dte(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return hm([l0(e,{props:[Dn(o,/:(read-\w+)/,":"+z_+"$1")]})],i);case"::placeholder":return hm([l0(e,{props:[Dn(o,/:(plac\w+)/,":"+Pn+"input-$1")]}),l0(e,{props:[Dn(o,/:(plac\w+)/,":"+z_+"$1")]}),l0(e,{props:[Dn(o,/:(plac\w+)/,to+"input-$1")]})],i)}return""})}},Kte=[Xte],$H=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var b=g.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=e.stylisPlugins||Kte,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var b=g.getAttribute("data-emotion").split(" "),m=1;m<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Sl]=e,t[Wv]=r,cH(t,e,!1,!1),e.stateNode=t;e:{switch(s=yP(n,r),n){case"dialog":tr("cancel",t),tr("close",t),i=r;break;case"iframe":case"object":case"embed":tr("load",t),i=r;break;case"video":case"audio":for(i=0;iFm&&(e.flags|=128,r=!0,o0(o,!1),e.lanes=4194304)}else{if(!r)if(t=I_(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),o0(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!hr)return Qi(e),null}else 2*Ur()-o.renderingStartTime>Fm&&n!==1073741824&&(e.flags|=128,r=!0,o0(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ur(),e.sibling=null,n=yr.current,Jn(yr,r?n&1|2:n&1),e):(Qi(e),null);case 22:case 23:return X3(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?gs&1073741824&&(Qi(e),e.subtreeFlags&6&&(e.flags|=8192)):Qi(e),null;case 24:return null;case 25:return null}throw Error(tt(156,e.tag))}function Qee(t,e){switch(A3(e),e.tag){case 1:return Wo(e.type)&&E_(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Im(),sr(jo),sr(so),L3(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return k3(e),null;case 13:if(sr(yr),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(tt(340));Dm()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return sr(yr),null;case 4:return Im(),null;case 10:return I3(e.type._context),null;case 22:case 23:return X3(),null;case 24:return null;default:return null}}var ax=!1,ro=!1,Jee=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Wp(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Rr(t,e,r)}else n.current=null}function jP(t,e,n){try{n()}catch(r){Rr(t,e,r)}}var w4=!1;function ete(t,e){if(AP=w_,t=g7(),M3(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===n&&++u===i&&(a=s),f===o&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(PP={focusedElem:t,selectionRange:n},w_=!1,yt=e;yt!==null;)if(e=yt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,yt=t;else for(;yt!==null;){e=yt;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,b=p.memoizedState,m=e.stateNode,w=m.getSnapshotBeforeUpdate(e.elementType===e.type?g:Pa(e.type,g),b);m.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(tt(163))}}catch(_){Rr(e,e.return,_)}if(t=e.sibling,t!==null){t.return=e.return,yt=t;break}yt=e.return}return p=w4,w4=!1,p}function lv(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&jP(e,n,o)}i=i.next}while(i!==r)}}function cC(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function WP(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function hH(t){var e=t.alternate;e!==null&&(t.alternate=null,hH(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Sl],delete e[Wv],delete e[IP],delete e[kee],delete e[Lee])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function pH(t){return t.tag===5||t.tag===3||t.tag===4}function _4(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pH(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qP(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=C_));else if(r!==4&&(t=t.child,t!==null))for(qP(t,e,n),t=t.sibling;t!==null;)qP(t,e,n),t=t.sibling}function XP(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(XP(t,e,n),t=t.sibling;t!==null;)XP(t,e,n),t=t.sibling}var Li=null,Ia=!1;function lc(t,e,n){for(n=n.child;n!==null;)mH(t,e,n),n=n.sibling}function mH(t,e,n){if(Al&&typeof Al.onCommitFiberUnmount=="function")try{Al.onCommitFiberUnmount(nC,n)}catch{}switch(n.tag){case 5:ro||Wp(n,e);case 6:var r=Li,i=Ia;Li=null,lc(t,e,n),Li=r,Ia=i,Li!==null&&(Ia?(t=Li,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Li.removeChild(n.stateNode));break;case 18:Li!==null&&(Ia?(t=Li,n=n.stateNode,t.nodeType===8?X2(t.parentNode,n):t.nodeType===1&&X2(t,n),Uv(t)):X2(Li,n.stateNode));break;case 4:r=Li,i=Ia,Li=n.stateNode.containerInfo,Ia=!0,lc(t,e,n),Li=r,Ia=i;break;case 0:case 11:case 14:case 15:if(!ro&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&jP(n,e,s),i=i.next}while(i!==r)}lc(t,e,n);break;case 1:if(!ro&&(Wp(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Rr(n,e,a)}lc(t,e,n);break;case 21:lc(t,e,n);break;case 22:n.mode&1?(ro=(r=ro)||n.memoizedState!==null,lc(t,e,n),ro=r):lc(t,e,n);break;default:lc(t,e,n)}}function S4(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Jee),e.forEach(function(r){var i=ute.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Sa(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ur()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nte(r/1960))-r,10t?16:t,Oc===null)var r=!1;else{if(t=Oc,Oc=null,L_=0,_n&6)throw Error(tt(331));var i=_n;for(_n|=4,yt=t.current;yt!==null;){var o=yt,s=o.child;if(yt.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lUr()-W3?bf(t,0):j3|=n),qo(t,e)}function SH(t,e){e===0&&(t.mode&1?(e=Q1,Q1<<=1,!(Q1&130023424)&&(Q1=4194304)):e=1);var n=Eo();t=ku(t,e),t!==null&&(Xy(t,e,n),qo(t,n))}function lte(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),SH(t,n)}function ute(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(tt(314))}r!==null&&r.delete(e),SH(t,n)}var CH;CH=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||jo.current)Go=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Go=!1,Yee(t,e,n);Go=!!(t.flags&131072)}else Go=!1,hr&&e.flags&1048576&&T7(e,A_,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Hw(t,e),t=e.pendingProps;var i=Pm(e,so.current);dm(e,n),i=$3(null,e,r,t,i,n);var o=z3();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Wo(r)?(o=!0,M_(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,F3(e),i.updater=lC,e.stateNode=i,i._reactInternals=e,BP(e,r,t,n),e=UP(null,e,r,!0,o,n)):(e.tag=0,hr&&o&&T3(e),bo(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Hw(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=dte(r),t=Pa(r,t),i){case 0:e=zP(null,e,r,t,n);break e;case 1:e=y4(null,e,r,t,n);break e;case 11:e=g4(null,e,r,t,n);break e;case 14:e=v4(null,e,r,Pa(r.type,t),n);break e}throw Error(tt(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pa(r,i),zP(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pa(r,i),y4(t,e,r,i,n);case 3:e:{if(aH(e),t===null)throw Error(tt(387));r=e.pendingProps,o=e.memoizedState,i=o.element,R7(t,e),R_(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Nm(Error(tt(423)),e),e=b4(t,e,r,n,i);break e}else if(r!==i){i=Nm(Error(tt(424)),e),e=b4(t,e,r,n,i);break e}else for(Cs=jc(e.stateNode.containerInfo.firstChild),Ts=e,hr=!0,Na=null,n=O7(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Dm(),r===i){e=Lu(t,e,n);break e}bo(t,e,r,n)}e=e.child}return e;case 5:return k7(e),t===null&&OP(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,DP(r,i)?s=null:o!==null&&DP(r,o)&&(e.flags|=32),sH(t,e),bo(t,e,s,n),e.child;case 6:return t===null&&OP(e),null;case 13:return lH(t,e,n);case 4:return O3(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Rm(e,null,r,n):bo(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pa(r,i),g4(t,e,r,i,n);case 7:return bo(t,e,e.pendingProps,n),e.child;case 8:return bo(t,e,e.pendingProps.children,n),e.child;case 12:return bo(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Jn(P_,r._currentValue),r._currentValue=s,o!==null)if(Xa(o.value,s)){if(o.children===i.children&&!jo.current){e=Lu(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Du(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),kP(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(tt(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),kP(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}bo(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,dm(e,n),i=da(i),r=r(i),e.flags|=1,bo(t,e,r,n),e.child;case 14:return r=e.type,i=Pa(r,e.pendingProps),i=Pa(r.type,i),v4(t,e,r,i,n);case 15:return iH(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pa(r,i),Hw(t,e),e.tag=1,Wo(r)?(t=!0,M_(e)):t=!1,dm(e,n),N7(e,r,i),BP(e,r,i,n),UP(null,e,r,!0,t,n);case 19:return uH(t,e,n);case 22:return oH(t,e,n)}throw Error(tt(156,e.tag))};function EH(t,e){return Z9(t,e)}function cte(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 sa(t,e,n,r){return new cte(t,e,n,r)}function Y3(t){return t=t.prototype,!(!t||!t.isReactComponent)}function dte(t){if(typeof t=="function")return Y3(t)?1:0;if(t!=null){if(t=t.$$typeof,t===m3)return 11;if(t===g3)return 14}return 2}function Kc(t,e){var n=t.alternate;return n===null?(n=sa(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function jw(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")Y3(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Lp:return xf(n.children,i,o,e);case p3:s=8,i|=8;break;case lP:return t=sa(12,n,e,i|2),t.elementType=lP,t.lanes=o,t;case uP:return t=sa(13,n,e,i),t.elementType=uP,t.lanes=o,t;case cP:return t=sa(19,n,e,i),t.elementType=cP,t.lanes=o,t;case F9:return fC(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case I9:s=10;break e;case N9:s=9;break e;case m3:s=11;break e;case g3:s=14;break e;case xc:s=16,r=null;break e}throw Error(tt(130,t==null?t:typeof t,""))}return e=sa(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function xf(t,e,n,r){return t=sa(7,t,r,e),t.lanes=n,t}function fC(t,e,n,r){return t=sa(22,t,r,e),t.elementType=F9,t.lanes=n,t.stateNode={isHidden:!1},t}function nT(t,e,n){return t=sa(6,t,null,e),t.lanes=n,t}function rT(t,e,n){return e=sa(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function fte(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=L2(0),this.expirationTimes=L2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=L2(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Z3(t,e,n,r,i,o,s,a,l){return t=new fte(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=sa(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},F3(o),t}function hte(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PH)}catch(t){console.error(t)}}PH(),T9.exports=Os;var qu=T9.exports;const cx=va(qu);var DH,R4=qu;DH=sP.createRoot=R4.createRoot,sP.hydrateRoot=R4.hydrateRoot;const Jv={black:"#000",white:"#fff"},Ih={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Nh={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Fh={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Oh={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},kh={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},a0={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},yte={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function Bu(t){let e="https://mui.com/production-error/?code="+t;for(let n=1;n=0)&&(n[i]=t[i]);return n}function RH(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var xte=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,wte=RH(function(t){return xte.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function _te(t){if(t.sheet)return t.sheet;for(var e=0;e0?Bi(sg,--Zo):0,Om--,Yr===10&&(Om=1,yC--),Yr}function As(){return Yr=Zo2||ty(Yr)>3?"":" "}function Ote(t,e){for(;--e&&As()&&!(Yr<48||Yr>102||Yr>57&&Yr<65||Yr>70&&Yr<97););return Jy(t,Ww()+(e<6&&Dl()==32&&As()==32))}function eD(t){for(;As();)switch(Yr){case t:return Zo;case 34:case 39:t!==34&&t!==39&&eD(Yr);break;case 40:t===41&&eD(t);break;case 92:As();break}return Zo}function kte(t,e){for(;As()&&t+Yr!==57;)if(t+Yr===84&&Dl()===47)break;return"/*"+Jy(e,Zo-1)+"*"+vC(t===47?t:As())}function Lte(t){for(;!ty(Dl());)As();return Jy(t,Zo)}function Bte(t){return LH(Xw("",null,null,null,[""],t=kH(t),0,[0],t))}function Xw(t,e,n,r,i,o,s,a,l){for(var u=0,c=0,d=s,f=0,h=0,p=0,g=1,b=1,m=1,w=0,x="",_=i,C=o,S=r,M=x;b;)switch(p=w,w=As()){case 40:if(p!=108&&Bi(M,d-1)==58){JP(M+=Dn(qw(w),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:M+=qw(w);break;case 9:case 10:case 13:case 32:M+=Fte(p);break;case 92:M+=Ote(Ww()-1,7);continue;case 47:switch(Dl()){case 42:case 47:dx($te(kte(As(),Ww()),e,n),l);break;default:M+="/"}break;case 123*g:a[u++]=bl(M)*m;case 125*g:case 59:case 0:switch(w){case 0:case 125:b=0;case 59+c:m==-1&&(M=Dn(M,/\f/g,"")),h>0&&bl(M)-d&&dx(h>32?N4(M+";",r,n,d-1):N4(Dn(M," ","")+";",r,n,d-2),l);break;case 59:M+=";";default:if(dx(S=I4(M,e,n,u,c,i,a,x,_=[],C=[],d),o),w===123)if(c===0)Xw(M,e,S,S,_,o,d,a,C);else switch(f===99&&Bi(M,3)===110?100:f){case 100:case 108:case 109:case 115:Xw(t,S,S,r&&dx(I4(t,S,S,0,0,i,a,x,i,_=[],d),C),i,C,d,a,r?_:C);break;default:Xw(M,S,S,S,[""],C,0,a,C)}}u=c=h=0,g=m=1,x=M="",d=s;break;case 58:d=1+bl(M),h=p;default:if(g<1){if(w==123)--g;else if(w==125&&g++==0&&Nte()==125)continue}switch(M+=vC(w),w*g){case 38:m=c>0?1:(M+="\f",-1);break;case 44:a[u++]=(bl(M)-1)*m,m=1;break;case 64:Dl()===45&&(M+=qw(As())),f=Dl(),c=d=bl(x=M+=Lte(Ww())),w++;break;case 45:p===45&&bl(M)==2&&(g=0)}}return o}function I4(t,e,n,r,i,o,s,a,l,u,c){for(var d=i-1,f=i===0?o:[""],h=rI(f),p=0,g=0,b=0;p0?f[m]+" "+w:Dn(w,/&\f/g,f[m])))&&(l[b++]=x);return bC(t,e,n,i===0?tI:a,l,u,c)}function $te(t,e,n){return bC(t,e,n,IH,vC(Ite()),ey(t,2,-2),0)}function N4(t,e,n,r){return bC(t,e,n,nI,ey(t,0,r),ey(t,r+1,-1),r)}function hm(t,e){for(var n="",r=rI(t),i=0;i6)switch(Bi(t,e+1)){case 109:if(Bi(t,e+4)!==45)break;case 102:return Dn(t,/(.+:)(.+)-([^]+)/,"$1"+Pn+"$2-$3$1"+z_+(Bi(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~JP(t,"stretch")?BH(Dn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Bi(t,e+1)!==115)break;case 6444:switch(Bi(t,bl(t)-3-(~JP(t,"!important")&&10))){case 107:return Dn(t,":",":"+Pn)+t;case 101:return Dn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Pn+(Bi(t,14)===45?"inline-":"")+"box$3$1"+Pn+"$2$3$1"+to+"$2box$3")+t}break;case 5936:switch(Bi(t,e+11)){case 114:return Pn+t+to+Dn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Pn+t+to+Dn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Pn+t+to+Dn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Pn+t+to+t+t}return t}var Xte=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case nI:e.return=BH(e.value,e.length);break;case NH:return hm([l0(e,{value:Dn(e.value,"@","@"+Pn)})],i);case tI:if(e.length)return Rte(e.props,function(o){switch(Dte(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return hm([l0(e,{props:[Dn(o,/:(read-\w+)/,":"+z_+"$1")]})],i);case"::placeholder":return hm([l0(e,{props:[Dn(o,/:(plac\w+)/,":"+Pn+"input-$1")]}),l0(e,{props:[Dn(o,/:(plac\w+)/,":"+z_+"$1")]}),l0(e,{props:[Dn(o,/:(plac\w+)/,to+"input-$1")]})],i)}return""})}},Kte=[Xte],$H=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var b=g.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var i=e.stylisPlugins||Kte,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var b=g.getAttribute("data-emotion").split(" "),m=1;m=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var ane={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},lne=/[A-Z]|^ms/g,une=/_EMO_([^_]+?)_([^]*?)_EMO_/g,WH=function(e){return e.charCodeAt(1)===45},O4=function(e){return e!=null&&typeof e!="boolean"},iT=RH(function(t){return WH(t)?t:t.replace(lne,"-$&").toLowerCase()}),k4=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(une,function(r,i,o){return wl={name:i,styles:o,next:wl},i})}return ane[e]!==1&&!WH(e)&&typeof n=="number"&&n!==0?n+"px":n};function ny(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return wl={name:n.name,styles:n.styles,next:wl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)wl={name:r.name,styles:r.styles,next:wl},r=r.next;var i=n.styles+";";return i}return cne(t,e,n)}case"function":{if(t!==void 0){var o=wl,s=n(t);return wl=o,ny(t,e,s)}break}}if(e==null)return n;var a=e[n];return a!==void 0?a:n}function cne(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?gne:vne},U4=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},yne=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return GH(n,r,i),fne(function(){return jH(n,r,i)}),null},bne=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=U4(e,n,r),l=a||z4(i),u=!l("as");return function(){var c=arguments,d=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;he(Mne(i)?n:i):e;return D.jsx(mne,{styles:r})}function lI(t,e){return tD(t,e)}const tV=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},Tne=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:eV,StyledEngineProvider:Ene,ThemeContext:DC,css:km,default:lI,internal_processStyles:tV,keyframes:yd},Symbol.toStringTag,{value:"Module"}));function bu(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function nV(t){if(!bu(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=nV(t[n])}),e}function Mo(t,e,n={clone:!0}){const r=n.clone?O({},t):t;return bu(t)&&bu(e)&&Object.keys(e).forEach(i=>{i!=="__proto__"&&(bu(e[i])&&i in t&&bu(t[i])?r[i]=Mo(t[i],e[i],n):n.clone?r[i]=bu(e[i])?nV(e[i]):e[i]:r[i]=e[i])}),r}const Ane=Object.freeze(Object.defineProperty({__proto__:null,default:Mo,isPlainObject:bu},Symbol.toStringTag,{value:"Module"})),Pne=["values","unit","step"],Dne=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>O({},n,{[r.key]:r.val}),{})};function rV(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Be(t,Pne),o=Dne(e),s=Object.keys(o);function a(f){return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n})`}function l(f){return`@media (max-width:${(typeof e[f]=="number"?e[f]:f)-r/100}${n})`}function u(f,h){const p=s.indexOf(h);return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n}) and (max-width:${(p!==-1&&typeof e[s[p]]=="number"?e[s[p]]:h)-r/100}${n})`}function c(f){return s.indexOf(f)+1`@media (min-width:${uI[t]}px)`};function Qo(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||H4;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||H4;return Object.keys(e).reduce((s,a)=>{if(Object.keys(o.values||uI).indexOf(a)!==-1){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function iV(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function oV(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function Ine(t,...e){const n=iV(t),r=[n,...e].reduce((i,o)=>Mo(i,o),{});return oV(Object.keys(n),r)}function Nne(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function wf({values:t,breakpoints:e,base:n}){const r=n||Nne(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function Ge(t){if(typeof t!="string")throw new Error(Bu(7));return t.charAt(0).toUpperCase()+t.slice(1)}const Fne=Object.freeze(Object.defineProperty({__proto__:null,default:Ge},Symbol.toStringTag,{value:"Module"}));function RC(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function U_(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=RC(t,n)||r,e&&(i=e(i,r,t)),i}function Vr(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,u=RC(l,r)||{};return Qo(s,a,d=>{let f=U_(u,i,d);return d===f&&typeof d=="string"&&(f=U_(u,i,`${e}${d==="default"?"":Ge(d)}`,d)),n===!1?f:{[n]:f}})};return o.propTypes={},o.filterProps=[e],o}function One(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const kne={m:"margin",p:"padding"},Lne={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},V4={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Bne=One(t=>{if(t.length>2)if(V4[t])t=V4[t];else return[t];const[e,n]=t.split(""),r=kne[e],i=Lne[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),cI=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],dI=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...cI,...dI];function eb(t,e,n,r){var i;const o=(i=RC(t,e,!1))!=null?i:n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}function fI(t){return eb(t,"spacing",8)}function kf(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function $ne(t,e){return n=>t.reduce((r,i)=>(r[i]=kf(e,n),r),{})}function zne(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=Bne(n),o=$ne(i,r),s=t[n];return Qo(t,s,o)}function sV(t,e){const n=fI(t.theme);return Object.keys(t).map(r=>zne(t,e,r,n)).reduce(dv,{})}function Pr(t){return sV(t,cI)}Pr.propTypes={};Pr.filterProps=cI;function Dr(t){return sV(t,dI)}Dr.propTypes={};Dr.filterProps=dI;function Une(t=8){if(t.mui)return t;const e=fI({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function IC(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?dv(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function na(t){return typeof t!="number"?t:`${t}px solid`}function ba(t,e){return Vr({prop:t,themeKey:"borders",transform:e})}const Hne=ba("border",na),Vne=ba("borderTop",na),Gne=ba("borderRight",na),jne=ba("borderBottom",na),Wne=ba("borderLeft",na),qne=ba("borderColor"),Xne=ba("borderTopColor"),Kne=ba("borderRightColor"),Yne=ba("borderBottomColor"),Zne=ba("borderLeftColor"),Qne=ba("outline",na),Jne=ba("outlineColor"),NC=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=eb(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:kf(e,r)});return Qo(t,t.borderRadius,n)}return null};NC.propTypes={};NC.filterProps=["borderRadius"];IC(Hne,Vne,Gne,jne,Wne,qne,Xne,Kne,Yne,Zne,NC,Qne,Jne);const FC=t=>{if(t.gap!==void 0&&t.gap!==null){const e=eb(t.theme,"spacing",8),n=r=>({gap:kf(e,r)});return Qo(t,t.gap,n)}return null};FC.propTypes={};FC.filterProps=["gap"];const OC=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=eb(t.theme,"spacing",8),n=r=>({columnGap:kf(e,r)});return Qo(t,t.columnGap,n)}return null};OC.propTypes={};OC.filterProps=["columnGap"];const kC=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=eb(t.theme,"spacing",8),n=r=>({rowGap:kf(e,r)});return Qo(t,t.rowGap,n)}return null};kC.propTypes={};kC.filterProps=["rowGap"];const ere=Vr({prop:"gridColumn"}),tre=Vr({prop:"gridRow"}),nre=Vr({prop:"gridAutoFlow"}),rre=Vr({prop:"gridAutoColumns"}),ire=Vr({prop:"gridAutoRows"}),ore=Vr({prop:"gridTemplateColumns"}),sre=Vr({prop:"gridTemplateRows"}),are=Vr({prop:"gridTemplateAreas"}),lre=Vr({prop:"gridArea"});IC(FC,OC,kC,ere,tre,nre,rre,ire,ore,sre,are,lre);function pm(t,e){return e==="grey"?e:t}const ure=Vr({prop:"color",themeKey:"palette",transform:pm}),cre=Vr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:pm}),dre=Vr({prop:"backgroundColor",themeKey:"palette",transform:pm});IC(ure,cre,dre);function ws(t){return t<=1&&t!==0?`${t*100}%`:t}const fre=Vr({prop:"width",transform:ws}),hI=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const o=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||uI[n];return o?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ws(n)}};return Qo(t,t.maxWidth,e)}return null};hI.filterProps=["maxWidth"];const hre=Vr({prop:"minWidth",transform:ws}),pre=Vr({prop:"height",transform:ws}),mre=Vr({prop:"maxHeight",transform:ws}),gre=Vr({prop:"minHeight",transform:ws});Vr({prop:"size",cssProperty:"width",transform:ws});Vr({prop:"size",cssProperty:"height",transform:ws});const vre=Vr({prop:"boxSizing"});IC(fre,hI,hre,pre,mre,gre,vre);const tb={border:{themeKey:"borders",transform:na},borderTop:{themeKey:"borders",transform:na},borderRight:{themeKey:"borders",transform:na},borderBottom:{themeKey:"borders",transform:na},borderLeft:{themeKey:"borders",transform:na},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:na},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:NC},color:{themeKey:"palette",transform:pm},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:pm},backgroundColor:{themeKey:"palette",transform:pm},p:{style:Dr},pt:{style:Dr},pr:{style:Dr},pb:{style:Dr},pl:{style:Dr},px:{style:Dr},py:{style:Dr},padding:{style:Dr},paddingTop:{style:Dr},paddingRight:{style:Dr},paddingBottom:{style:Dr},paddingLeft:{style:Dr},paddingX:{style:Dr},paddingY:{style:Dr},paddingInline:{style:Dr},paddingInlineStart:{style:Dr},paddingInlineEnd:{style:Dr},paddingBlock:{style:Dr},paddingBlockStart:{style:Dr},paddingBlockEnd:{style:Dr},m:{style:Pr},mt:{style:Pr},mr:{style:Pr},mb:{style:Pr},ml:{style:Pr},mx:{style:Pr},my:{style:Pr},margin:{style:Pr},marginTop:{style:Pr},marginRight:{style:Pr},marginBottom:{style:Pr},marginLeft:{style:Pr},marginX:{style:Pr},marginY:{style:Pr},marginInline:{style:Pr},marginInlineStart:{style:Pr},marginInlineEnd:{style:Pr},marginBlock:{style:Pr},marginBlockStart:{style:Pr},marginBlockEnd:{style:Pr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:FC},rowGap:{style:kC},columnGap:{style:OC},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ws},maxWidth:{style:hI},minWidth:{transform:ws},height:{transform:ws},maxHeight:{transform:ws},minHeight:{transform:ws},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function yre(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function bre(t,e){return typeof t=="function"?t(e):t}function aV(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:c,style:d}=a;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const f=RC(i,u)||{};return d?d(s):Qo(s,r,p=>{let g=U_(f,c,p);return p===g&&typeof p=="string"&&(g=U_(f,c,`${n}${p==="default"?"":Ge(p)}`,p)),l===!1?g:{[l]:g}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const s=(r=o.unstable_sxConfig)!=null?r:tb;function a(l){let u=l;if(typeof l=="function")u=l(o);else if(typeof l!="object")return l;if(!u)return null;const c=iV(o.breakpoints),d=Object.keys(c);let f=c;return Object.keys(u).forEach(h=>{const p=bre(u[h],o);if(p!=null)if(typeof p=="object")if(s[h])f=dv(f,t(h,p,o,s));else{const g=Qo({theme:o},p,b=>({[h]:b}));yre(g,p)?f[h]=e({sx:p,theme:o}):f=dv(f,g)}else f=dv(f,t(h,p,o,s))}),oV(d,f)}return Array.isArray(i)?i.map(a):a(i)}return e}const lg=aV();lg.filterProps=["sx"];function lV(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const xre=["breakpoints","palette","spacing","shape"];function nb(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,s=Be(t,xre),a=rV(n),l=Une(i);let u=Mo({breakpoints:a,direction:"ltr",components:{},palette:O({mode:"light"},r),spacing:l,shape:O({},Rne,o)},s);return u.applyStyles=lV,u=e.reduce((c,d)=>Mo(c,d),u),u.unstable_sxConfig=O({},tb,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(d){return lg({sx:d,theme:this})},u}const wre=Object.freeze(Object.defineProperty({__proto__:null,default:nb,private_createBreakpoints:rV,unstable_applyStyles:lV},Symbol.toStringTag,{value:"Module"}));function _re(t){return Object.keys(t).length===0}function Sre(t=null){const e=E.useContext(DC);return!e||_re(e)?t:e}const Cre=nb();function LC(t=Cre){return Sre(t)}function Ere({styles:t,themeId:e,defaultTheme:n={}}){const r=LC(n),i=typeof t=="function"?t(e&&r[e]||r):t;return D.jsx(eV,{styles:i})}const Mre=["sx"],Tre=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:tb;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function rb(t){const{sx:e}=t,n=Be(t,Mre),{systemProps:r,otherProps:i}=Tre(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return bu(a)?O({},r,a):r}:o=O({},r,e),O({},i,{sx:o})}const Are=Object.freeze(Object.defineProperty({__proto__:null,default:lg,extendSxProp:rb,unstable_createStyleFunctionSx:aV,unstable_defaultSxConfig:tb},Symbol.toStringTag,{value:"Module"})),G4=t=>t,Pre=()=>{let t=G4;return{configure(e){t=e},generate(e){return t(e)},reset(){t=G4}}},pI=Pre();function uV(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ea!=="theme"&&a!=="sx"&&a!=="as"})(lg);return E.forwardRef(function(l,u){const c=LC(n),d=rb(l),{className:f,component:h="div"}=d,p=Be(d,Dre);return D.jsx(o,O({as:h,ref:u,className:nt(f,i?i(r):r),theme:e&&c[e]||c},p))})}const cV={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function It(t,e,n="Mui"){const r=cV[e];return r?`${n}-${r}`:`${pI.generate(t)}-${e}`}function At(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=It(t,i,n)}),r}var dV={exports:{}},Hn={};/** + */var Di=typeof Symbol=="function"&&Symbol.for,iI=Di?Symbol.for("react.element"):60103,oI=Di?Symbol.for("react.portal"):60106,xC=Di?Symbol.for("react.fragment"):60107,wC=Di?Symbol.for("react.strict_mode"):60108,_C=Di?Symbol.for("react.profiler"):60114,SC=Di?Symbol.for("react.provider"):60109,CC=Di?Symbol.for("react.context"):60110,sI=Di?Symbol.for("react.async_mode"):60111,EC=Di?Symbol.for("react.concurrent_mode"):60111,MC=Di?Symbol.for("react.forward_ref"):60112,TC=Di?Symbol.for("react.suspense"):60113,Yte=Di?Symbol.for("react.suspense_list"):60120,AC=Di?Symbol.for("react.memo"):60115,PC=Di?Symbol.for("react.lazy"):60116,Zte=Di?Symbol.for("react.block"):60121,Qte=Di?Symbol.for("react.fundamental"):60117,Jte=Di?Symbol.for("react.responder"):60118,ene=Di?Symbol.for("react.scope"):60119;function Ls(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case iI:switch(t=t.type,t){case sI:case EC:case xC:case _C:case wC:case TC:return t;default:switch(t=t&&t.$$typeof,t){case CC:case MC:case PC:case AC:case SC:return t;default:return e}}case oI:return e}}}function UH(t){return Ls(t)===EC}Un.AsyncMode=sI;Un.ConcurrentMode=EC;Un.ContextConsumer=CC;Un.ContextProvider=SC;Un.Element=iI;Un.ForwardRef=MC;Un.Fragment=xC;Un.Lazy=PC;Un.Memo=AC;Un.Portal=oI;Un.Profiler=_C;Un.StrictMode=wC;Un.Suspense=TC;Un.isAsyncMode=function(t){return UH(t)||Ls(t)===sI};Un.isConcurrentMode=UH;Un.isContextConsumer=function(t){return Ls(t)===CC};Un.isContextProvider=function(t){return Ls(t)===SC};Un.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===iI};Un.isForwardRef=function(t){return Ls(t)===MC};Un.isFragment=function(t){return Ls(t)===xC};Un.isLazy=function(t){return Ls(t)===PC};Un.isMemo=function(t){return Ls(t)===AC};Un.isPortal=function(t){return Ls(t)===oI};Un.isProfiler=function(t){return Ls(t)===_C};Un.isStrictMode=function(t){return Ls(t)===wC};Un.isSuspense=function(t){return Ls(t)===TC};Un.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===xC||t===EC||t===_C||t===wC||t===TC||t===Yte||typeof t=="object"&&t!==null&&(t.$$typeof===PC||t.$$typeof===AC||t.$$typeof===SC||t.$$typeof===CC||t.$$typeof===MC||t.$$typeof===Qte||t.$$typeof===Jte||t.$$typeof===ene||t.$$typeof===Zte)};Un.typeOf=Ls;zH.exports=Un;var tne=zH.exports,HH=tne,nne={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},rne={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},VH={};VH[HH.ForwardRef]=nne;VH[HH.Memo]=rne;var ine=!0;function one(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):r+=i+" "}),r}var GH=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||ine===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},jH=function(e,n,r){GH(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function sne(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var ane={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},lne=/[A-Z]|^ms/g,une=/_EMO_([^_]+?)_([^]*?)_EMO_/g,WH=function(e){return e.charCodeAt(1)===45},O4=function(e){return e!=null&&typeof e!="boolean"},iT=RH(function(t){return WH(t)?t:t.replace(lne,"-$&").toLowerCase()}),k4=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(une,function(r,i,o){return xl={name:i,styles:o,next:xl},i})}return ane[e]!==1&&!WH(e)&&typeof n=="number"&&n!==0?n+"px":n};function ny(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return xl={name:n.name,styles:n.styles,next:xl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)xl={name:r.name,styles:r.styles,next:xl},r=r.next;var i=n.styles+";";return i}return cne(t,e,n)}case"function":{if(t!==void 0){var o=xl,s=n(t);return xl=o,ny(t,e,s)}break}}if(e==null)return n;var a=e[n];return a!==void 0?a:n}function cne(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i96?gne:vne},U4=function(e,n,r){var i;if(n){var o=n.shouldForwardProp;i=e.__emotion_forwardProp&&o?function(s){return e.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},yne=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return GH(n,r,i),fne(function(){return jH(n,r,i)}),null},bne=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,o,s;n!==void 0&&(o=n.label,s=n.target);var a=U4(e,n,r),l=a||z4(i),u=!l("as");return function(){var c=arguments,d=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;he(Mne(i)?n:i):e;return D.jsx(mne,{styles:r})}function lI(t,e){return tD(t,e)}const tV=(t,e)=>{Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))},Tne=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:eV,StyledEngineProvider:Ene,ThemeContext:DC,css:km,default:lI,internal_processStyles:tV,keyframes:yd},Symbol.toStringTag,{value:"Module"}));function bu(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function nV(t){if(!bu(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=nV(t[n])}),e}function Mo(t,e,n={clone:!0}){const r=n.clone?O({},t):t;return bu(t)&&bu(e)&&Object.keys(e).forEach(i=>{i!=="__proto__"&&(bu(e[i])&&i in t&&bu(t[i])?r[i]=Mo(t[i],e[i],n):n.clone?r[i]=bu(e[i])?nV(e[i]):e[i]:r[i]=e[i])}),r}const Ane=Object.freeze(Object.defineProperty({__proto__:null,default:Mo,isPlainObject:bu},Symbol.toStringTag,{value:"Module"})),Pne=["values","unit","step"],Dne=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,r)=>n.val-r.val),e.reduce((n,r)=>O({},n,{[r.key]:r.val}),{})};function rV(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=t,i=Be(t,Pne),o=Dne(e),s=Object.keys(o);function a(f){return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n})`}function l(f){return`@media (max-width:${(typeof e[f]=="number"?e[f]:f)-r/100}${n})`}function u(f,h){const p=s.indexOf(h);return`@media (min-width:${typeof e[f]=="number"?e[f]:f}${n}) and (max-width:${(p!==-1&&typeof e[s[p]]=="number"?e[s[p]]:h)-r/100}${n})`}function c(f){return s.indexOf(f)+1`@media (min-width:${uI[t]}px)`};function Qo(t,e,n){const r=t.theme||{};if(Array.isArray(e)){const o=r.breakpoints||H4;return e.reduce((s,a,l)=>(s[o.up(o.keys[l])]=n(e[l]),s),{})}if(typeof e=="object"){const o=r.breakpoints||H4;return Object.keys(e).reduce((s,a)=>{if(Object.keys(o.values||uI).indexOf(a)!==-1){const l=o.up(a);s[l]=n(e[a],a)}else{const l=a;s[l]=e[l]}return s},{})}return n(e)}function iV(t={}){var e;return((e=t.keys)==null?void 0:e.reduce((r,i)=>{const o=t.up(i);return r[o]={},r},{}))||{}}function oV(t,e){return t.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},e)}function Ine(t,...e){const n=iV(t),r=[n,...e].reduce((i,o)=>Mo(i,o),{});return oV(Object.keys(n),r)}function Nne(t,e){if(typeof t!="object")return{};const n={},r=Object.keys(e);return Array.isArray(t)?r.forEach((i,o)=>{o{t[i]!=null&&(n[i]=!0)}),n}function wf({values:t,breakpoints:e,base:n}){const r=n||Nne(t,e),i=Object.keys(r);if(i.length===0)return t;let o;return i.reduce((s,a,l)=>(Array.isArray(t)?(s[a]=t[l]!=null?t[l]:t[o],o=l):typeof t=="object"?(s[a]=t[a]!=null?t[a]:t[o],o=a):s[a]=t,s),{})}function Ge(t){if(typeof t!="string")throw new Error(Bu(7));return t.charAt(0).toUpperCase()+t.slice(1)}const Fne=Object.freeze(Object.defineProperty({__proto__:null,default:Ge},Symbol.toStringTag,{value:"Module"}));function RC(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const r=`vars.${e}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,t);if(r!=null)return r}return e.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,t)}function U_(t,e,n,r=n){let i;return typeof t=="function"?i=t(n):Array.isArray(t)?i=t[n]||r:i=RC(t,n)||r,e&&(i=e(i,r,t)),i}function Vr(t){const{prop:e,cssProperty:n=t.prop,themeKey:r,transform:i}=t,o=s=>{if(s[e]==null)return null;const a=s[e],l=s.theme,u=RC(l,r)||{};return Qo(s,a,d=>{let f=U_(u,i,d);return d===f&&typeof d=="string"&&(f=U_(u,i,`${e}${d==="default"?"":Ge(d)}`,d)),n===!1?f:{[n]:f}})};return o.propTypes={},o.filterProps=[e],o}function One(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const kne={m:"margin",p:"padding"},Lne={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},V4={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Bne=One(t=>{if(t.length>2)if(V4[t])t=V4[t];else return[t];const[e,n]=t.split(""),r=kne[e],i=Lne[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),cI=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],dI=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...cI,...dI];function eb(t,e,n,r){var i;const o=(i=RC(t,e,!1))!=null?i:n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}function fI(t){return eb(t,"spacing",8)}function kf(t,e){if(typeof e=="string"||e==null)return e;const n=Math.abs(e),r=t(n);return e>=0?r:typeof r=="number"?-r:`-${r}`}function $ne(t,e){return n=>t.reduce((r,i)=>(r[i]=kf(e,n),r),{})}function zne(t,e,n,r){if(e.indexOf(n)===-1)return null;const i=Bne(n),o=$ne(i,r),s=t[n];return Qo(t,s,o)}function sV(t,e){const n=fI(t.theme);return Object.keys(t).map(r=>zne(t,e,r,n)).reduce(dv,{})}function Pr(t){return sV(t,cI)}Pr.propTypes={};Pr.filterProps=cI;function Dr(t){return sV(t,dI)}Dr.propTypes={};Dr.filterProps=dI;function Une(t=8){if(t.mui)return t;const e=fI({spacing:t}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const s=e(o);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function IC(...t){const e=t.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>e[o]?dv(i,e[o](r)):i,{});return n.propTypes={},n.filterProps=t.reduce((r,i)=>r.concat(i.filterProps),[]),n}function na(t){return typeof t!="number"?t:`${t}px solid`}function ya(t,e){return Vr({prop:t,themeKey:"borders",transform:e})}const Hne=ya("border",na),Vne=ya("borderTop",na),Gne=ya("borderRight",na),jne=ya("borderBottom",na),Wne=ya("borderLeft",na),qne=ya("borderColor"),Xne=ya("borderTopColor"),Kne=ya("borderRightColor"),Yne=ya("borderBottomColor"),Zne=ya("borderLeftColor"),Qne=ya("outline",na),Jne=ya("outlineColor"),NC=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=eb(t.theme,"shape.borderRadius",4),n=r=>({borderRadius:kf(e,r)});return Qo(t,t.borderRadius,n)}return null};NC.propTypes={};NC.filterProps=["borderRadius"];IC(Hne,Vne,Gne,jne,Wne,qne,Xne,Kne,Yne,Zne,NC,Qne,Jne);const FC=t=>{if(t.gap!==void 0&&t.gap!==null){const e=eb(t.theme,"spacing",8),n=r=>({gap:kf(e,r)});return Qo(t,t.gap,n)}return null};FC.propTypes={};FC.filterProps=["gap"];const OC=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=eb(t.theme,"spacing",8),n=r=>({columnGap:kf(e,r)});return Qo(t,t.columnGap,n)}return null};OC.propTypes={};OC.filterProps=["columnGap"];const kC=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=eb(t.theme,"spacing",8),n=r=>({rowGap:kf(e,r)});return Qo(t,t.rowGap,n)}return null};kC.propTypes={};kC.filterProps=["rowGap"];const ere=Vr({prop:"gridColumn"}),tre=Vr({prop:"gridRow"}),nre=Vr({prop:"gridAutoFlow"}),rre=Vr({prop:"gridAutoColumns"}),ire=Vr({prop:"gridAutoRows"}),ore=Vr({prop:"gridTemplateColumns"}),sre=Vr({prop:"gridTemplateRows"}),are=Vr({prop:"gridTemplateAreas"}),lre=Vr({prop:"gridArea"});IC(FC,OC,kC,ere,tre,nre,rre,ire,ore,sre,are,lre);function pm(t,e){return e==="grey"?e:t}const ure=Vr({prop:"color",themeKey:"palette",transform:pm}),cre=Vr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:pm}),dre=Vr({prop:"backgroundColor",themeKey:"palette",transform:pm});IC(ure,cre,dre);function ws(t){return t<=1&&t!==0?`${t*100}%`:t}const fre=Vr({prop:"width",transform:ws}),hI=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{var r,i;const o=((r=t.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||uI[n];return o?((i=t.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:ws(n)}};return Qo(t,t.maxWidth,e)}return null};hI.filterProps=["maxWidth"];const hre=Vr({prop:"minWidth",transform:ws}),pre=Vr({prop:"height",transform:ws}),mre=Vr({prop:"maxHeight",transform:ws}),gre=Vr({prop:"minHeight",transform:ws});Vr({prop:"size",cssProperty:"width",transform:ws});Vr({prop:"size",cssProperty:"height",transform:ws});const vre=Vr({prop:"boxSizing"});IC(fre,hI,hre,pre,mre,gre,vre);const tb={border:{themeKey:"borders",transform:na},borderTop:{themeKey:"borders",transform:na},borderRight:{themeKey:"borders",transform:na},borderBottom:{themeKey:"borders",transform:na},borderLeft:{themeKey:"borders",transform:na},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:na},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:NC},color:{themeKey:"palette",transform:pm},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:pm},backgroundColor:{themeKey:"palette",transform:pm},p:{style:Dr},pt:{style:Dr},pr:{style:Dr},pb:{style:Dr},pl:{style:Dr},px:{style:Dr},py:{style:Dr},padding:{style:Dr},paddingTop:{style:Dr},paddingRight:{style:Dr},paddingBottom:{style:Dr},paddingLeft:{style:Dr},paddingX:{style:Dr},paddingY:{style:Dr},paddingInline:{style:Dr},paddingInlineStart:{style:Dr},paddingInlineEnd:{style:Dr},paddingBlock:{style:Dr},paddingBlockStart:{style:Dr},paddingBlockEnd:{style:Dr},m:{style:Pr},mt:{style:Pr},mr:{style:Pr},mb:{style:Pr},ml:{style:Pr},mx:{style:Pr},my:{style:Pr},margin:{style:Pr},marginTop:{style:Pr},marginRight:{style:Pr},marginBottom:{style:Pr},marginLeft:{style:Pr},marginX:{style:Pr},marginY:{style:Pr},marginInline:{style:Pr},marginInlineStart:{style:Pr},marginInlineEnd:{style:Pr},marginBlock:{style:Pr},marginBlockStart:{style:Pr},marginBlockEnd:{style:Pr},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:FC},rowGap:{style:kC},columnGap:{style:OC},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:ws},maxWidth:{style:hI},minWidth:{transform:ws},height:{transform:ws},maxHeight:{transform:ws},minHeight:{transform:ws},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function yre(...t){const e=t.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(e);return t.every(r=>n.size===Object.keys(r).length)}function bre(t,e){return typeof t=="function"?t(e):t}function aV(){function t(n,r,i,o){const s={[n]:r,theme:i},a=o[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:u,transform:c,style:d}=a;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const f=RC(i,u)||{};return d?d(s):Qo(s,r,p=>{let g=U_(f,c,p);return p===g&&typeof p=="string"&&(g=U_(f,c,`${n}${p==="default"?"":Ge(p)}`,p)),l===!1?g:{[l]:g}})}function e(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const s=(r=o.unstable_sxConfig)!=null?r:tb;function a(l){let u=l;if(typeof l=="function")u=l(o);else if(typeof l!="object")return l;if(!u)return null;const c=iV(o.breakpoints),d=Object.keys(c);let f=c;return Object.keys(u).forEach(h=>{const p=bre(u[h],o);if(p!=null)if(typeof p=="object")if(s[h])f=dv(f,t(h,p,o,s));else{const g=Qo({theme:o},p,b=>({[h]:b}));yre(g,p)?f[h]=e({sx:p,theme:o}):f=dv(f,g)}else f=dv(f,t(h,p,o,s))}),oV(d,f)}return Array.isArray(i)?i.map(a):a(i)}return e}const lg=aV();lg.filterProps=["sx"];function lV(t,e){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(t).replace(/(\[[^\]]+\])/,"*:where($1)")]:e}:n.palette.mode===t?e:{}}const xre=["breakpoints","palette","spacing","shape"];function nb(t={},...e){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=t,s=Be(t,xre),a=rV(n),l=Une(i);let u=Mo({breakpoints:a,direction:"ltr",components:{},palette:O({mode:"light"},r),spacing:l,shape:O({},Rne,o)},s);return u.applyStyles=lV,u=e.reduce((c,d)=>Mo(c,d),u),u.unstable_sxConfig=O({},tb,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(d){return lg({sx:d,theme:this})},u}const wre=Object.freeze(Object.defineProperty({__proto__:null,default:nb,private_createBreakpoints:rV,unstable_applyStyles:lV},Symbol.toStringTag,{value:"Module"}));function _re(t){return Object.keys(t).length===0}function Sre(t=null){const e=E.useContext(DC);return!e||_re(e)?t:e}const Cre=nb();function LC(t=Cre){return Sre(t)}function Ere({styles:t,themeId:e,defaultTheme:n={}}){const r=LC(n),i=typeof t=="function"?t(e&&r[e]||r):t;return D.jsx(eV,{styles:i})}const Mre=["sx"],Tre=t=>{var e,n;const r={systemProps:{},otherProps:{}},i=(e=t==null||(n=t.theme)==null?void 0:n.unstable_sxConfig)!=null?e:tb;return Object.keys(t).forEach(o=>{i[o]?r.systemProps[o]=t[o]:r.otherProps[o]=t[o]}),r};function rb(t){const{sx:e}=t,n=Be(t,Mre),{systemProps:r,otherProps:i}=Tre(n);let o;return Array.isArray(e)?o=[r,...e]:typeof e=="function"?o=(...s)=>{const a=e(...s);return bu(a)?O({},r,a):r}:o=O({},r,e),O({},i,{sx:o})}const Are=Object.freeze(Object.defineProperty({__proto__:null,default:lg,extendSxProp:rb,unstable_createStyleFunctionSx:aV,unstable_defaultSxConfig:tb},Symbol.toStringTag,{value:"Module"})),G4=t=>t,Pre=()=>{let t=G4;return{configure(e){t=e},generate(e){return t(e)},reset(){t=G4}}},pI=Pre();function uV(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;ea!=="theme"&&a!=="sx"&&a!=="as"})(lg);return E.forwardRef(function(l,u){const c=LC(n),d=rb(l),{className:f,component:h="div"}=d,p=Be(d,Dre);return D.jsx(o,O({as:h,ref:u,className:nt(f,i?i(r):r),theme:e&&c[e]||c},p))})}const cV={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function It(t,e,n="Mui"){const r=cV[e];return r?`${n}-${r}`:`${pI.generate(t)}-${e}`}function At(t,e,n="Mui"){const r={};return e.forEach(i=>{r[i]=It(t,i,n)}),r}var dV={exports:{}},Hn={};/** * @license React * react-is.production.min.js * @@ -52,7 +52,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var mI=Symbol.for("react.element"),gI=Symbol.for("react.portal"),BC=Symbol.for("react.fragment"),$C=Symbol.for("react.strict_mode"),zC=Symbol.for("react.profiler"),UC=Symbol.for("react.provider"),HC=Symbol.for("react.context"),Ire=Symbol.for("react.server_context"),VC=Symbol.for("react.forward_ref"),GC=Symbol.for("react.suspense"),jC=Symbol.for("react.suspense_list"),WC=Symbol.for("react.memo"),qC=Symbol.for("react.lazy"),Nre=Symbol.for("react.offscreen"),fV;fV=Symbol.for("react.module.reference");function xa(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case mI:switch(t=t.type,t){case BC:case zC:case $C:case GC:case jC:return t;default:switch(t=t&&t.$$typeof,t){case Ire:case HC:case VC:case qC:case WC:case UC:return t;default:return e}}case gI:return e}}}Hn.ContextConsumer=HC;Hn.ContextProvider=UC;Hn.Element=mI;Hn.ForwardRef=VC;Hn.Fragment=BC;Hn.Lazy=qC;Hn.Memo=WC;Hn.Portal=gI;Hn.Profiler=zC;Hn.StrictMode=$C;Hn.Suspense=GC;Hn.SuspenseList=jC;Hn.isAsyncMode=function(){return!1};Hn.isConcurrentMode=function(){return!1};Hn.isContextConsumer=function(t){return xa(t)===HC};Hn.isContextProvider=function(t){return xa(t)===UC};Hn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===mI};Hn.isForwardRef=function(t){return xa(t)===VC};Hn.isFragment=function(t){return xa(t)===BC};Hn.isLazy=function(t){return xa(t)===qC};Hn.isMemo=function(t){return xa(t)===WC};Hn.isPortal=function(t){return xa(t)===gI};Hn.isProfiler=function(t){return xa(t)===zC};Hn.isStrictMode=function(t){return xa(t)===$C};Hn.isSuspense=function(t){return xa(t)===GC};Hn.isSuspenseList=function(t){return xa(t)===jC};Hn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===BC||t===zC||t===$C||t===GC||t===jC||t===Nre||typeof t=="object"&&t!==null&&(t.$$typeof===qC||t.$$typeof===WC||t.$$typeof===UC||t.$$typeof===HC||t.$$typeof===VC||t.$$typeof===fV||t.getModuleId!==void 0)};Hn.typeOf=xa;dV.exports=Hn;var j4=dV.exports;const Fre=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function hV(t){const e=`${t}`.match(Fre);return e&&e[1]||""}function pV(t,e=""){return t.displayName||t.name||hV(t)||e}function W4(t,e,n){const r=pV(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function Ore(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return pV(t,"Component");if(typeof t=="object")switch(t.$$typeof){case j4.ForwardRef:return W4(t,t.render,"ForwardRef");case j4.Memo:return W4(t,t.type,"memo");default:return}}}const kre=Object.freeze(Object.defineProperty({__proto__:null,default:Ore,getFunctionName:hV},Symbol.toStringTag,{value:"Module"})),Lre=["ownerState"],Bre=["variants"],$re=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function zre(t){return Object.keys(t).length===0}function Ure(t){return typeof t=="string"&&t.charCodeAt(0)>96}function sT(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Hre=nb(),Vre=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function fx({defaultTheme:t,theme:e,themeId:n}){return zre(e)?t:e[n]||e}function Gre(t){return t?(e,n)=>n[t]:null}function Kw(t,e){let{ownerState:n}=e,r=Be(e,Lre);const i=typeof t=="function"?t(O({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>Kw(o,O({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=Be(i,Bre);return o.forEach(l=>{let u=!0;typeof l.props=="function"?u=l.props(O({ownerState:n},r,n)):Object.keys(l.props).forEach(c=>{(n==null?void 0:n[c])!==l.props[c]&&r[c]!==l.props[c]&&(u=!1)}),u&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style(O({ownerState:n},r,n)):l.style))}),a}return i}function jre(t={}){const{themeId:e,defaultTheme:n=Hre,rootShouldForwardProp:r=sT,slotShouldForwardProp:i=sT}=t,o=s=>lg(O({},s,{theme:fx(O({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{tV(s,C=>C.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:u,skipVariantsResolver:c,skipSx:d,overridesResolver:f=Gre(Vre(u))}=a,h=Be(a,$re),p=c!==void 0?c:u&&u!=="Root"&&u!=="root"||!1,g=d||!1;let b,m=sT;u==="Root"||u==="root"?m=r:u?m=i:Ure(s)&&(m=void 0);const w=lI(s,O({shouldForwardProp:m,label:b},h)),x=C=>typeof C=="function"&&C.__emotion_real!==C||bu(C)?S=>Kw(C,O({},S,{theme:fx({theme:S.theme,defaultTheme:n,themeId:e})})):C,_=(C,...S)=>{let M=x(C);const P=S?S.map(x):[];l&&f&&P.push(F=>{const $=fx(O({},F,{defaultTheme:n,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const j=$.components[l].styleOverrides,k={};return Object.entries(j).forEach(([U,G])=>{k[U]=Kw(G,O({},F,{theme:$}))}),f(F,k)}),l&&!p&&P.push(F=>{var $;const j=fx(O({},F,{defaultTheme:n,themeId:e})),k=j==null||($=j.components)==null||($=$[l])==null?void 0:$.variants;return Kw({variants:k},O({},F,{theme:j}))}),g||P.push(o);const A=P.length-S.length;if(Array.isArray(C)&&A>0){const F=new Array(A).fill("");M=[...C,...F],M.raw=[...C.raw,...F]}const R=w(M,...P);return s.muiName&&(R.muiName=s.muiName),R};return w.withConfig&&(_.withConfig=w.withConfig),_}}const Wre=jre();function vI(t,e){const n=O({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=O({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=O({},o),Object.keys(i).forEach(s=>{n[r][s]=vI(i[s],o[s])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function qre(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:vI(e.components[n].defaultProps,r)}function mV({props:t,name:e,defaultTheme:n,themeId:r}){let i=LC(n);return r&&(i=i[r]||i),qre({theme:i,name:e,props:t})}const _r=typeof window<"u"?E.useLayoutEffect:E.useEffect;function gV(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const Xre=Object.freeze(Object.defineProperty({__proto__:null,default:gV},Symbol.toStringTag,{value:"Module"}));function yI(t,e=0,n=1){return gV(t,e,n)}function Kre(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function XC(t){if(t.type)return t;if(t.charAt(0)==="#")return XC(Kre(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Bu(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(Bu(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function bI(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function ra(t,e){return t=XC(t),e=yI(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,bI(t)}function xI(t,e){if(t=XC(t),e=yI(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return bI(t)}function wI(t,e){if(t=XC(t),e=yI(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return bI(t)}function aT(t,e){return()=>null}function H_(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function ug(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function Yre(t,e){return()=>null}function Yw(t,e){var n,r;return E.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Sr(t){return t&&t.ownerDocument||document}function Bl(t){return Sr(t).defaultView||window}function Zre(t,e){return()=>null}function ry(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let q4=0;function Qre(t){const[e,n]=E.useState(t),r=t||e;return E.useEffect(()=>{e==null&&(q4+=1,n(`mui-${q4}`))},[e]),r}const X4=oP.useId;function jn(t){if(X4!==void 0){const e=X4();return t??e}return Qre(t)}function Jre(t,e,n,r,i){return null}function Ru({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=E.useRef(t!==void 0),[o,s]=E.useState(e),a=i?t:o,l=E.useCallback(u=>{i||s(u)},[]);return[a,l]}function ar(t){const e=E.useRef(t);return _r(()=>{e.current=t}),E.useRef((...n)=>(0,e.current)(...n)).current}function An(...t){return E.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{ry(n,e)})},t)}const K4={};function eie(t,e){const n=E.useRef(K4);return n.current===K4&&(n.current=t(e)),n}const tie=[];function nie(t){E.useEffect(t,tie)}class ib{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new ib}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function Kp(){const t=eie(ib.create).current;return nie(t.disposeEffect),t}let KC=!0,rD=!1;const rie=new ib,iie={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function oie(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&iie[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function sie(t){t.metaKey||t.altKey||t.ctrlKey||(KC=!0)}function lT(){KC=!1}function aie(){this.visibilityState==="hidden"&&rD&&(KC=!0)}function lie(t){t.addEventListener("keydown",sie,!0),t.addEventListener("mousedown",lT,!0),t.addEventListener("pointerdown",lT,!0),t.addEventListener("touchstart",lT,!0),t.addEventListener("visibilitychange",aie,!0)}function uie(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return KC||oie(e)}function _I(){const t=E.useCallback(i=>{i!=null&&lie(i.ownerDocument)},[]),e=E.useRef(!1);function n(){return e.current?(rD=!0,rie.start(100,()=>{rD=!1}),e.current=!1,!0):!1}function r(i){return uie(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function vV(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}const SI=t=>{const e=E.useRef({});return E.useEffect(()=>{e.current=t}),e.current};function Qe(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,s)=>{if(s){const a=e(s);a!==""&&o.push(a),n&&n[s]&&o.push(n[s])}return o},[]).join(" ")}),r}const cie=E.createContext(),CI=()=>{const t=E.useContext(cie);return t??!1};function iy(t){"@babel/helpers - typeof";return iy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iy(t)}function die(t,e){if(iy(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(iy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lm(t){var e=die(t,"string");return iy(e)=="symbol"?e:e+""}const fie=["component","direction","spacing","divider","children","className","useFlexGap"],hie=nb(),pie=Wre("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function mie(t){return mV({props:t,name:"MuiStack",defaultTheme:hie})}function gie(t,e){const n=E.Children.toArray(t).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],yie=({ownerState:t,theme:e})=>{let n=O({display:"flex",flexDirection:"column"},Qo({theme:e},wf({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=fI(e),i=Object.keys(e.breakpoints.values).reduce((l,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(l[u]=!0),l),{}),o=wf({values:t.direction,base:i}),s=wf({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,u,c)=>{if(!o[l]){const f=u>0?o[c[u-1]]:"column";o[l]=f}}),n=Mo(n,Qo({theme:e},s,(l,u)=>t.useFlexGap?{gap:kf(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${vie(u?o[u]:t.direction)}`]:kf(r,l)}}))}return n=Ine(e.breakpoints,n),n};function yV(t={}){const{createStyledComponent:e=pie,useThemeProps:n=mie,componentName:r="MuiStack"}=t,i=()=>Qe({root:["root"]},l=>It(r,l),{}),o=e(yie);return E.forwardRef(function(l,u){const c=n(l),d=rb(c),{component:f="div",direction:h="column",spacing:p=0,divider:g,children:b,className:m,useFlexGap:w=!1}=d,x=Be(d,fie),_={direction:h,spacing:p,useFlexGap:w},C=i();return D.jsx(o,O({as:f,ownerState:_,ref:u,className:nt(C.root,m)},x,{children:g?gie(b,g):b}))})}const Y4=yV();function bie(t,e){return O({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Gr={},bV={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(bV);var YC=bV.exports;const xie=ju(bte),wie=ju(Xre);var xV=YC;Object.defineProperty(Gr,"__esModule",{value:!0});var fn=Gr.alpha=CV;Gr.blend=Iie;Gr.colorChannel=void 0;var EI=Gr.darken=AI;Gr.decomposeColor=pa;Gr.emphasize=EV;var _ie=Gr.getContrastRatio=Tie;Gr.getLuminance=V_;Gr.hexToRgb=wV;Gr.hslToRgb=SV;var MI=Gr.lighten=PI;Gr.private_safeAlpha=Aie;Gr.private_safeColorChannel=void 0;Gr.private_safeDarken=Pie;Gr.private_safeEmphasize=Rie;Gr.private_safeLighten=Die;Gr.recomposeColor=cg;Gr.rgbToHex=Mie;var Z4=xV(xie),Sie=xV(wie);function TI(t,e=0,n=1){return(0,Sie.default)(t,e,n)}function wV(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Cie(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function pa(t){if(t.type)return t;if(t.charAt(0)==="#")return pa(wV(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,Z4.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,Z4.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const _V=t=>{const e=pa(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Gr.colorChannel=_V;const Eie=(t,e)=>{try{return _V(t)}catch{return t}};Gr.private_safeColorChannel=Eie;function cg(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Mie(t){if(t.indexOf("#")===0)return t;const{values:e}=pa(t);return`#${e.map((n,r)=>Cie(r===3?Math.round(255*n):n)).join("")}`}function SV(t){t=pa(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(u,c=(u+n/30)%12)=>i-o*Math.max(Math.min(c-3,9-c,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),cg({type:a,values:l})}function V_(t){t=pa(t);let e=t.type==="hsl"||t.type==="hsla"?pa(SV(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Tie(t,e){const n=V_(t),r=V_(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function CV(t,e){return t=pa(t),e=TI(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,cg(t)}function Aie(t,e,n){try{return CV(t,e)}catch{return t}}function AI(t,e){if(t=pa(t),e=TI(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return cg(t)}function Pie(t,e,n){try{return AI(t,e)}catch{return t}}function PI(t,e){if(t=pa(t),e=TI(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return cg(t)}function Die(t,e,n){try{return PI(t,e)}catch{return t}}function EV(t,e=.15){return V_(t)>.5?AI(t,e):PI(t,e)}function Rie(t,e,n){try{return EV(t,e)}catch{return t}}function Iie(t,e,n,r=1){const i=(l,u)=>Math.round((l**(1/r)*(1-n)+u**(1/r)*n)**r),o=pa(t),s=pa(e),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return cg({type:"rgb",values:a})}const Nie=["mode","contrastThreshold","tonalOffset"],Q4={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Jv.white,default:Jv.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},uT={text:{primary:Jv.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Jv.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function J4(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=MI(t.main,i):e==="dark"&&(t.dark=EI(t.main,o)))}function Fie(t="light"){return t==="dark"?{main:Fh[200],light:Fh[50],dark:Fh[400]}:{main:Fh[700],light:Fh[400],dark:Fh[800]}}function Oie(t="light"){return t==="dark"?{main:Nh[200],light:Nh[50],dark:Nh[400]}:{main:Nh[500],light:Nh[300],dark:Nh[700]}}function kie(t="light"){return t==="dark"?{main:Ih[500],light:Ih[300],dark:Ih[700]}:{main:Ih[700],light:Ih[400],dark:Ih[800]}}function Lie(t="light"){return t==="dark"?{main:Oh[400],light:Oh[300],dark:Oh[700]}:{main:Oh[700],light:Oh[500],dark:Oh[900]}}function Bie(t="light"){return t==="dark"?{main:kh[400],light:kh[300],dark:kh[700]}:{main:kh[800],light:kh[500],dark:kh[900]}}function $ie(t="light"){return t==="dark"?{main:a0[400],light:a0[300],dark:a0[700]}:{main:"#ed6c02",light:a0[500],dark:a0[900]}}function zie(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Be(t,Nie),o=t.primary||Fie(e),s=t.secondary||Oie(e),a=t.error||kie(e),l=t.info||Lie(e),u=t.success||Bie(e),c=t.warning||$ie(e);function d(g){return _ie(g,uT.text.primary)>=n?uT.text.primary:Q4.text.primary}const f=({color:g,name:b,mainShade:m=500,lightShade:w=300,darkShade:x=700})=>{if(g=O({},g),!g.main&&g[m]&&(g.main=g[m]),!g.hasOwnProperty("main"))throw new Error(Bu(11,b?` (${b})`:"",m));if(typeof g.main!="string")throw new Error(Bu(12,b?` (${b})`:"",JSON.stringify(g.main)));return J4(g,"light",w,r),J4(g,"dark",x,r),g.contrastText||(g.contrastText=d(g.main)),g},h={dark:uT,light:Q4};return Mo(O({common:O({},Jv),mode:e,primary:f({color:o,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:c,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:u,name:"success"}),grey:yte,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r},h[e]),i)}const Uie=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Hie(t){return Math.round(t*1e5)/1e5}const e5={textTransform:"uppercase"},t5='"Roboto", "Helvetica", "Arial", sans-serif';function Vie(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=t5,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:u=16,allVariants:c,pxToRem:d}=n,f=Be(n,Uie),h=i/14,p=d||(m=>`${m/u*h}rem`),g=(m,w,x,_,C)=>O({fontFamily:r,fontWeight:m,fontSize:p(w),lineHeight:x},r===t5?{letterSpacing:`${Hie(_/w)}em`}:{},C,c),b={h1:g(o,96,1.167,-1.5),h2:g(o,60,1.2,-.5),h3:g(s,48,1.167,0),h4:g(s,34,1.235,.25),h5:g(s,24,1.334,0),h6:g(a,20,1.6,.15),subtitle1:g(s,16,1.75,.15),subtitle2:g(a,14,1.57,.1),body1:g(s,16,1.5,.15),body2:g(s,14,1.43,.15),button:g(a,14,1.75,.4,e5),caption:g(s,12,1.66,.4),overline:g(s,12,2.66,1,e5),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Mo(O({htmlFontSize:u,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const Gie=.2,jie=.14,Wie=.12;function ur(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Gie})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${jie})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${Wie})`].join(",")}const qie=["none",ur(0,2,1,-1,0,1,1,0,0,1,3,0),ur(0,3,1,-2,0,2,2,0,0,1,5,0),ur(0,3,3,-2,0,3,4,0,0,1,8,0),ur(0,2,4,-1,0,4,5,0,0,1,10,0),ur(0,3,5,-1,0,5,8,0,0,1,14,0),ur(0,3,5,-1,0,6,10,0,0,1,18,0),ur(0,4,5,-2,0,7,10,1,0,2,16,1),ur(0,5,5,-3,0,8,10,1,0,3,14,2),ur(0,5,6,-3,0,9,12,1,0,3,16,2),ur(0,6,6,-3,0,10,14,1,0,4,18,3),ur(0,6,7,-4,0,11,15,1,0,4,20,3),ur(0,7,8,-4,0,12,17,2,0,5,22,4),ur(0,7,8,-4,0,13,19,2,0,5,24,4),ur(0,7,9,-4,0,14,21,2,0,5,26,4),ur(0,8,9,-5,0,15,22,2,0,6,28,5),ur(0,8,10,-5,0,16,24,2,0,6,30,5),ur(0,8,11,-5,0,17,26,2,0,6,32,5),ur(0,9,11,-5,0,18,28,2,0,7,34,6),ur(0,9,12,-6,0,19,29,2,0,7,36,6),ur(0,10,13,-6,0,20,31,3,0,8,38,7),ur(0,10,13,-6,0,21,33,3,0,8,40,7),ur(0,10,14,-6,0,22,35,3,0,8,42,7),ur(0,11,14,-7,0,23,36,3,0,9,44,8),ur(0,11,15,-7,0,24,38,3,0,9,46,8)],Xie=["duration","easing","delay"],Kie={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Yie={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function n5(t){return`${Math.round(t)}ms`}function Zie(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function Qie(t){const e=O({},Kie,t.easing),n=O({},Yie,t.duration);return O({getAutoHeightDuration:Zie,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0}=o;return Be(o,Xie),(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:n5(s)} ${a} ${typeof l=="string"?l:n5(l)}`).join(",")}},t,{easing:e,duration:n})}const Jie={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},eoe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function MV(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,s=Be(t,eoe);if(t.vars)throw new Error(Bu(18));const a=zie(r),l=nb(t);let u=Mo(l,{mixins:bie(l.breakpoints,n),palette:a,shadows:qie.slice(),typography:Vie(a,o),transitions:Qie(i),zIndex:O({},Jie)});return u=Mo(u,s),u=e.reduce((c,d)=>Mo(c,d),u),u.unstable_sxConfig=O({},tb,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(d){return lg({sx:d,theme:this})},u}function toe(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function noe(t){return parseFloat(t)}const ZC=MV();function ob(){const t=LC(ZC);return t[Qy]||t}function kt({props:t,name:e}){return mV({props:t,name:e,defaultTheme:ZC,themeId:Qy})}var sb={},cT={exports:{}},r5;function roe(){return r5||(r5=1,function(t){function e(n,r){if(n==null)return{};var i={},o=Object.keys(n),s,a;for(a=0;a=0)&&(i[s]=n[s]);return i}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(cT)),cT.exports}const TV=ju(Tne),ioe=ju(Ane),ooe=ju(Fne),soe=ju(kre),aoe=ju(wre),loe=ju(Are);var dg=YC;Object.defineProperty(sb,"__esModule",{value:!0});var uoe=sb.default=_oe;sb.shouldForwardProp=Zw;sb.systemDefaultTheme=void 0;var Zs=dg(YH()),iD=dg(roe()),i5=goe(TV),coe=ioe;dg(ooe);dg(soe);var doe=dg(aoe),foe=dg(loe);const hoe=["ownerState"],poe=["variants"],moe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function AV(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(AV=function(r){return r?n:e})(t)}function goe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=AV(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function voe(t){return Object.keys(t).length===0}function yoe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function Zw(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const boe=sb.systemDefaultTheme=(0,doe.default)(),xoe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function hx({defaultTheme:t,theme:e,themeId:n}){return voe(e)?t:e[n]||e}function woe(t){return t?(e,n)=>n[t]:null}function Qw(t,e){let{ownerState:n}=e,r=(0,iD.default)(e,hoe);const i=typeof t=="function"?t((0,Zs.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>Qw(o,(0,Zs.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=(0,iD.default)(i,poe);return o.forEach(l=>{let u=!0;typeof l.props=="function"?u=l.props((0,Zs.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(c=>{(n==null?void 0:n[c])!==l.props[c]&&r[c]!==l.props[c]&&(u=!1)}),u&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style((0,Zs.default)({ownerState:n},r,n)):l.style))}),a}return i}function _oe(t={}){const{themeId:e,defaultTheme:n=boe,rootShouldForwardProp:r=Zw,slotShouldForwardProp:i=Zw}=t,o=s=>(0,foe.default)((0,Zs.default)({},s,{theme:hx((0,Zs.default)({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{(0,i5.internal_processStyles)(s,C=>C.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:u,skipVariantsResolver:c,skipSx:d,overridesResolver:f=woe(xoe(u))}=a,h=(0,iD.default)(a,moe),p=c!==void 0?c:u&&u!=="Root"&&u!=="root"||!1,g=d||!1;let b,m=Zw;u==="Root"||u==="root"?m=r:u?m=i:yoe(s)&&(m=void 0);const w=(0,i5.default)(s,(0,Zs.default)({shouldForwardProp:m,label:b},h)),x=C=>typeof C=="function"&&C.__emotion_real!==C||(0,coe.isPlainObject)(C)?S=>Qw(C,(0,Zs.default)({},S,{theme:hx({theme:S.theme,defaultTheme:n,themeId:e})})):C,_=(C,...S)=>{let M=x(C);const P=S?S.map(x):[];l&&f&&P.push(F=>{const $=hx((0,Zs.default)({},F,{defaultTheme:n,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const j=$.components[l].styleOverrides,k={};return Object.entries(j).forEach(([U,G])=>{k[U]=Qw(G,(0,Zs.default)({},F,{theme:$}))}),f(F,k)}),l&&!p&&P.push(F=>{var $;const j=hx((0,Zs.default)({},F,{defaultTheme:n,themeId:e})),k=j==null||($=j.components)==null||($=$[l])==null?void 0:$.variants;return Qw({variants:k},(0,Zs.default)({},F,{theme:j}))}),g||P.push(o);const A=P.length-S.length;if(Array.isArray(C)&&A>0){const F=new Array(A).fill("");M=[...C,...F],M.raw=[...C.raw,...F]}const R=w(M,...P);return s.muiName&&(R.muiName=s.muiName),R};return w.withConfig&&(_.withConfig=w.withConfig),_}}function PV(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const uo=t=>PV(t)&&t!=="classes",ze=uoe({themeId:Qy,defaultTheme:ZC,rootShouldForwardProp:uo}),o5=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function Soe(t){return It("MuiSvgIcon",t)}At("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Coe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Eoe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Ge(e)}`,`fontSize${Ge(n)}`]};return Qe(i,Soe,r)},Moe=ze("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Ge(n.color)}`],e[`fontSize${Ge(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,s,a,l,u,c,d,f,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=t.typography)==null||(s=o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem",medium:((a=t.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((u=t.typography)==null||(c=u.pxToRem)==null?void 0:c.call(u,35))||"2.1875rem"}[e.fontSize],color:(d=(f=(t.vars||t).palette)==null||(f=f[e.color])==null?void 0:f.main)!=null?d:{action:(h=(t.vars||t).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.disabled,inherit:void 0}[e.color]}}),oD=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:d,viewBox:f="0 0 24 24"}=r,h=Be(r,Coe),p=E.isValidElement(i)&&i.type==="svg",g=O({},r,{color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:c,viewBox:f,hasSvgAsChild:p}),b={};c||(b.viewBox=f);const m=Eoe(g);return D.jsxs(Moe,O({as:a,className:nt(m.root,o),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n},b,h,p&&i.props,{ownerState:g,children:[p?i.props.children:i,d?D.jsx("title",{children:d}):null]}))});oD.muiName="SvgIcon";function mn(t,e){function n(r,i){return D.jsx(oD,O({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=oD.muiName,E.memo(E.forwardRef(n))}const Toe={configure:t=>{pI.configure(t)}},Aoe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:Ge,createChainedFunction:H_,createSvgIcon:mn,debounce:ug,deprecatedPropType:Yre,isMuiElement:Yw,ownerDocument:Sr,ownerWindow:Bl,requirePropFactory:Zre,setRef:ry,unstable_ClassNameGenerator:Toe,unstable_useEnhancedEffect:_r,unstable_useId:jn,unsupportedProp:Jre,useControlled:Ru,useEventCallback:ar,useForkRef:An,useIsFocusVisible:_I},Symbol.toStringTag,{value:"Module"}));function DI(t){return kt}function sD(t,e){return sD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},sD(t,e)}function RI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,sD(t,e)}const s5={disabled:!1},G_=ie.createContext(null);var Poe=function(e){return e.scrollTop},H0="unmounted",Qd="exited",Jd="entering",mp="entered",aD="exiting",jl=function(t){RI(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=Qd,o.appearStatus=Jd):l=mp:r.unmountOnExit||r.mountOnEnter?l=H0:l=Qd,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===H0?{status:Qd}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==Jd&&s!==mp&&(o=Jd):(s===Jd||s===mp)&&(o=aD)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Jd){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:cx.findDOMNode(this);s&&Poe(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Qd&&this.setState({status:H0})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[cx.findDOMNode(this),a],u=l[0],c=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!i&&!s||s5.disabled){this.safeSetState({status:mp},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:Jd},function(){o.props.onEntering(u,c),o.onTransitionEnd(f,function(){o.safeSetState({status:mp},function(){o.props.onEntered(u,c)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:cx.findDOMNode(this);if(!o||s5.disabled){this.safeSetState({status:Qd},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:aD},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:Qd},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:cx.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===H0)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Be(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ie.createElement(G_.Provider,{value:null},typeof s=="function"?s(i,a):ie.cloneElement(ie.Children.only(s),a))},e}(ie.Component);jl.contextType=G_;jl.propTypes={};function Lh(){}jl.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Lh,onEntering:Lh,onEntered:Lh,onExit:Lh,onExiting:Lh,onExited:Lh};jl.UNMOUNTED=H0;jl.EXITED=Qd;jl.ENTERING=Jd;jl.ENTERED=mp;jl.EXITING=aD;function Doe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function II(t,e){var n=function(o){return e&&E.isValidElement(o)?e(o):o},r=Object.create(null);return t&&E.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Roe(t,e){t=t||{},e=e||{};function n(c){return c in e?e[c]:t[c]}var r=Object.create(null),i=[];for(var o in t)o in e?i.length&&(r[o]=i,i=[]):i.push(o);var s,a={};for(var l in e){if(r[l])for(s=0;st.scrollTop;function j_(t,e){var n,r;const{timeout:i,easing:o,style:s={}}=t;return{duration:(n=s.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=s.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:s.transitionDelay}}function koe(t){return It("MuiPaper",t)}At("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Loe=["className","component","elevation","square","variant"],Boe=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Qe(o,koe,i)},$oe=ze("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return O({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&O({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${fn("#fff",o5(e.elevation))}, ${fn("#fff",o5(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),Xu=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:s=1,square:a=!1,variant:l="elevation"}=r,u=Be(r,Loe),c=O({},r,{component:o,elevation:s,square:a,variant:l}),d=Boe(c);return D.jsx($oe,O({as:o,ownerState:c,className:nt(d.root,i),ref:n},u))});function oy(t){return typeof t=="string"}function V0(t,e,n){return t===void 0||oy(t)?e:O({},e,{ownerState:O({},e.ownerState,n)})}const zoe={disableDefaultClasses:!1},Uoe=E.createContext(zoe);function Hoe(t){const{disableDefaultClasses:e}=E.useContext(Uoe);return n=>e?"":t(n)}function RV(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function Voe(t,e,n){return typeof t=="function"?t(e,n):t}function a5(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function Goe(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=nt(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p=O({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),g=O({},n,i,r);return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=RV(O({},i,r)),a=a5(r),l=a5(i),u=e(s),c=nt(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d=O({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),f=O({},u,n,l,a);return c.length>0&&(f.className=c),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:u.ref}}const joe=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function $u(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,s=Be(t,joe),a=o?{}:Voe(r,i),{props:l,internalRef:u}=Goe(O({},s,{externalSlotProps:a})),c=An(u,a==null?void 0:a.ref,(e=t.additionalProps)==null?void 0:e.ref);return V0(n,O({},l,{ref:c}),i)}function Woe(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:u}=t,[c,d]=E.useState(!1),f=nt(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=nt(n.child,c&&n.childLeaving,r&&n.childPulsate);return!a&&!c&&d(!0),E.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,u);return()=>{clearTimeout(g)}}},[l,a,u]),D.jsx("span",{className:f,style:h,children:D.jsx("span",{className:p})})}const Js=At("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),qoe=["center","classes","className"];let QC=t=>t,l5,u5,c5,d5;const lD=550,Xoe=80,Koe=yd(l5||(l5=QC` + */var mI=Symbol.for("react.element"),gI=Symbol.for("react.portal"),BC=Symbol.for("react.fragment"),$C=Symbol.for("react.strict_mode"),zC=Symbol.for("react.profiler"),UC=Symbol.for("react.provider"),HC=Symbol.for("react.context"),Ire=Symbol.for("react.server_context"),VC=Symbol.for("react.forward_ref"),GC=Symbol.for("react.suspense"),jC=Symbol.for("react.suspense_list"),WC=Symbol.for("react.memo"),qC=Symbol.for("react.lazy"),Nre=Symbol.for("react.offscreen"),fV;fV=Symbol.for("react.module.reference");function ba(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case mI:switch(t=t.type,t){case BC:case zC:case $C:case GC:case jC:return t;default:switch(t=t&&t.$$typeof,t){case Ire:case HC:case VC:case qC:case WC:case UC:return t;default:return e}}case gI:return e}}}Hn.ContextConsumer=HC;Hn.ContextProvider=UC;Hn.Element=mI;Hn.ForwardRef=VC;Hn.Fragment=BC;Hn.Lazy=qC;Hn.Memo=WC;Hn.Portal=gI;Hn.Profiler=zC;Hn.StrictMode=$C;Hn.Suspense=GC;Hn.SuspenseList=jC;Hn.isAsyncMode=function(){return!1};Hn.isConcurrentMode=function(){return!1};Hn.isContextConsumer=function(t){return ba(t)===HC};Hn.isContextProvider=function(t){return ba(t)===UC};Hn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===mI};Hn.isForwardRef=function(t){return ba(t)===VC};Hn.isFragment=function(t){return ba(t)===BC};Hn.isLazy=function(t){return ba(t)===qC};Hn.isMemo=function(t){return ba(t)===WC};Hn.isPortal=function(t){return ba(t)===gI};Hn.isProfiler=function(t){return ba(t)===zC};Hn.isStrictMode=function(t){return ba(t)===$C};Hn.isSuspense=function(t){return ba(t)===GC};Hn.isSuspenseList=function(t){return ba(t)===jC};Hn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===BC||t===zC||t===$C||t===GC||t===jC||t===Nre||typeof t=="object"&&t!==null&&(t.$$typeof===qC||t.$$typeof===WC||t.$$typeof===UC||t.$$typeof===HC||t.$$typeof===VC||t.$$typeof===fV||t.getModuleId!==void 0)};Hn.typeOf=ba;dV.exports=Hn;var j4=dV.exports;const Fre=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function hV(t){const e=`${t}`.match(Fre);return e&&e[1]||""}function pV(t,e=""){return t.displayName||t.name||hV(t)||e}function W4(t,e,n){const r=pV(e);return t.displayName||(r!==""?`${n}(${r})`:n)}function Ore(t){if(t!=null){if(typeof t=="string")return t;if(typeof t=="function")return pV(t,"Component");if(typeof t=="object")switch(t.$$typeof){case j4.ForwardRef:return W4(t,t.render,"ForwardRef");case j4.Memo:return W4(t,t.type,"memo");default:return}}}const kre=Object.freeze(Object.defineProperty({__proto__:null,default:Ore,getFunctionName:hV},Symbol.toStringTag,{value:"Module"})),Lre=["ownerState"],Bre=["variants"],$re=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function zre(t){return Object.keys(t).length===0}function Ure(t){return typeof t=="string"&&t.charCodeAt(0)>96}function sT(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Hre=nb(),Vre=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function fx({defaultTheme:t,theme:e,themeId:n}){return zre(e)?t:e[n]||e}function Gre(t){return t?(e,n)=>n[t]:null}function Kw(t,e){let{ownerState:n}=e,r=Be(e,Lre);const i=typeof t=="function"?t(O({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>Kw(o,O({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=Be(i,Bre);return o.forEach(l=>{let u=!0;typeof l.props=="function"?u=l.props(O({ownerState:n},r,n)):Object.keys(l.props).forEach(c=>{(n==null?void 0:n[c])!==l.props[c]&&r[c]!==l.props[c]&&(u=!1)}),u&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style(O({ownerState:n},r,n)):l.style))}),a}return i}function jre(t={}){const{themeId:e,defaultTheme:n=Hre,rootShouldForwardProp:r=sT,slotShouldForwardProp:i=sT}=t,o=s=>lg(O({},s,{theme:fx(O({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{tV(s,C=>C.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:u,skipVariantsResolver:c,skipSx:d,overridesResolver:f=Gre(Vre(u))}=a,h=Be(a,$re),p=c!==void 0?c:u&&u!=="Root"&&u!=="root"||!1,g=d||!1;let b,m=sT;u==="Root"||u==="root"?m=r:u?m=i:Ure(s)&&(m=void 0);const w=lI(s,O({shouldForwardProp:m,label:b},h)),x=C=>typeof C=="function"&&C.__emotion_real!==C||bu(C)?S=>Kw(C,O({},S,{theme:fx({theme:S.theme,defaultTheme:n,themeId:e})})):C,_=(C,...S)=>{let M=x(C);const P=S?S.map(x):[];l&&f&&P.push(F=>{const $=fx(O({},F,{defaultTheme:n,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const j=$.components[l].styleOverrides,k={};return Object.entries(j).forEach(([U,G])=>{k[U]=Kw(G,O({},F,{theme:$}))}),f(F,k)}),l&&!p&&P.push(F=>{var $;const j=fx(O({},F,{defaultTheme:n,themeId:e})),k=j==null||($=j.components)==null||($=$[l])==null?void 0:$.variants;return Kw({variants:k},O({},F,{theme:j}))}),g||P.push(o);const A=P.length-S.length;if(Array.isArray(C)&&A>0){const F=new Array(A).fill("");M=[...C,...F],M.raw=[...C.raw,...F]}const R=w(M,...P);return s.muiName&&(R.muiName=s.muiName),R};return w.withConfig&&(_.withConfig=w.withConfig),_}}const Wre=jre();function vI(t,e){const n=O({},e);return Object.keys(t).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=O({},t[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=t[r]||{},o=e[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=O({},o),Object.keys(i).forEach(s=>{n[r][s]=vI(i[s],o[s])}))}else n[r]===void 0&&(n[r]=t[r])}),n}function qre(t){const{theme:e,name:n,props:r}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?r:vI(e.components[n].defaultProps,r)}function mV({props:t,name:e,defaultTheme:n,themeId:r}){let i=LC(n);return r&&(i=i[r]||i),qre({theme:i,name:e,props:t})}const _r=typeof window<"u"?E.useLayoutEffect:E.useEffect;function gV(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const Xre=Object.freeze(Object.defineProperty({__proto__:null,default:gV},Symbol.toStringTag,{value:"Module"}));function yI(t,e=0,n=1){return gV(t,e,n)}function Kre(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function XC(t){if(t.type)return t;if(t.charAt(0)==="#")return XC(Kre(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Bu(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(Bu(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}function bI(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function ra(t,e){return t=XC(t),e=yI(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,bI(t)}function xI(t,e){if(t=XC(t),e=yI(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return bI(t)}function wI(t,e){if(t=XC(t),e=yI(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return bI(t)}function aT(t,e){return()=>null}function H_(...t){return t.reduce((e,n)=>n==null?e:function(...i){e.apply(this,i),n.apply(this,i)},()=>{})}function ug(t,e=166){let n;function r(...i){const o=()=>{t.apply(this,i)};clearTimeout(n),n=setTimeout(o,e)}return r.clear=()=>{clearTimeout(n)},r}function Yre(t,e){return()=>null}function Yw(t,e){var n,r;return E.isValidElement(t)&&e.indexOf((n=t.type.muiName)!=null?n:(r=t.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Sr(t){return t&&t.ownerDocument||document}function Ll(t){return Sr(t).defaultView||window}function Zre(t,e){return()=>null}function ry(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let q4=0;function Qre(t){const[e,n]=E.useState(t),r=t||e;return E.useEffect(()=>{e==null&&(q4+=1,n(`mui-${q4}`))},[e]),r}const X4=oP.useId;function jn(t){if(X4!==void 0){const e=X4();return t??e}return Qre(t)}function Jre(t,e,n,r,i){return null}function Ru({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=E.useRef(t!==void 0),[o,s]=E.useState(e),a=i?t:o,l=E.useCallback(u=>{i||s(u)},[]);return[a,l]}function ar(t){const e=E.useRef(t);return _r(()=>{e.current=t}),E.useRef((...n)=>(0,e.current)(...n)).current}function An(...t){return E.useMemo(()=>t.every(e=>e==null)?null:e=>{t.forEach(n=>{ry(n,e)})},t)}const K4={};function eie(t,e){const n=E.useRef(K4);return n.current===K4&&(n.current=t(e)),n}const tie=[];function nie(t){E.useEffect(t,tie)}class ib{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new ib}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}}function Kp(){const t=eie(ib.create).current;return nie(t.disposeEffect),t}let KC=!0,rD=!1;const rie=new ib,iie={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function oie(t){const{type:e,tagName:n}=t;return!!(n==="INPUT"&&iie[e]&&!t.readOnly||n==="TEXTAREA"&&!t.readOnly||t.isContentEditable)}function sie(t){t.metaKey||t.altKey||t.ctrlKey||(KC=!0)}function lT(){KC=!1}function aie(){this.visibilityState==="hidden"&&rD&&(KC=!0)}function lie(t){t.addEventListener("keydown",sie,!0),t.addEventListener("mousedown",lT,!0),t.addEventListener("pointerdown",lT,!0),t.addEventListener("touchstart",lT,!0),t.addEventListener("visibilitychange",aie,!0)}function uie(t){const{target:e}=t;try{return e.matches(":focus-visible")}catch{}return KC||oie(e)}function _I(){const t=E.useCallback(i=>{i!=null&&lie(i.ownerDocument)},[]),e=E.useRef(!1);function n(){return e.current?(rD=!0,rie.start(100,()=>{rD=!1}),e.current=!1,!0):!1}function r(i){return uie(i)?(e.current=!0,!0):!1}return{isFocusVisibleRef:e,onFocus:r,onBlur:n,ref:t}}function vV(t){const e=t.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}const SI=t=>{const e=E.useRef({});return E.useEffect(()=>{e.current=t}),e.current};function Qe(t,e,n=void 0){const r={};return Object.keys(t).forEach(i=>{r[i]=t[i].reduce((o,s)=>{if(s){const a=e(s);a!==""&&o.push(a),n&&n[s]&&o.push(n[s])}return o},[]).join(" ")}),r}const cie=E.createContext(),CI=()=>{const t=E.useContext(cie);return t??!1};function iy(t){"@babel/helpers - typeof";return iy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iy(t)}function die(t,e){if(iy(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(iy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Lm(t){var e=die(t,"string");return iy(e)=="symbol"?e:e+""}const fie=["component","direction","spacing","divider","children","className","useFlexGap"],hie=nb(),pie=Wre("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function mie(t){return mV({props:t,name:"MuiStack",defaultTheme:hie})}function gie(t,e){const n=E.Children.toArray(t).filter(Boolean);return n.reduce((r,i,o)=>(r.push(i),o({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],yie=({ownerState:t,theme:e})=>{let n=O({display:"flex",flexDirection:"column"},Qo({theme:e},wf({values:t.direction,breakpoints:e.breakpoints.values}),r=>({flexDirection:r})));if(t.spacing){const r=fI(e),i=Object.keys(e.breakpoints.values).reduce((l,u)=>((typeof t.spacing=="object"&&t.spacing[u]!=null||typeof t.direction=="object"&&t.direction[u]!=null)&&(l[u]=!0),l),{}),o=wf({values:t.direction,base:i}),s=wf({values:t.spacing,base:i});typeof o=="object"&&Object.keys(o).forEach((l,u,c)=>{if(!o[l]){const f=u>0?o[c[u-1]]:"column";o[l]=f}}),n=Mo(n,Qo({theme:e},s,(l,u)=>t.useFlexGap?{gap:kf(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${vie(u?o[u]:t.direction)}`]:kf(r,l)}}))}return n=Ine(e.breakpoints,n),n};function yV(t={}){const{createStyledComponent:e=pie,useThemeProps:n=mie,componentName:r="MuiStack"}=t,i=()=>Qe({root:["root"]},l=>It(r,l),{}),o=e(yie);return E.forwardRef(function(l,u){const c=n(l),d=rb(c),{component:f="div",direction:h="column",spacing:p=0,divider:g,children:b,className:m,useFlexGap:w=!1}=d,x=Be(d,fie),_={direction:h,spacing:p,useFlexGap:w},C=i();return D.jsx(o,O({as:f,ownerState:_,ref:u,className:nt(C.root,m)},x,{children:g?gie(b,g):b}))})}const Y4=yV();function bie(t,e){return O({toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}}},e)}var Gr={},bV={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(bV);var YC=bV.exports;const xie=ju(bte),wie=ju(Xre);var xV=YC;Object.defineProperty(Gr,"__esModule",{value:!0});var fn=Gr.alpha=CV;Gr.blend=Iie;Gr.colorChannel=void 0;var EI=Gr.darken=AI;Gr.decomposeColor=ha;Gr.emphasize=EV;var _ie=Gr.getContrastRatio=Tie;Gr.getLuminance=V_;Gr.hexToRgb=wV;Gr.hslToRgb=SV;var MI=Gr.lighten=PI;Gr.private_safeAlpha=Aie;Gr.private_safeColorChannel=void 0;Gr.private_safeDarken=Pie;Gr.private_safeEmphasize=Rie;Gr.private_safeLighten=Die;Gr.recomposeColor=cg;Gr.rgbToHex=Mie;var Z4=xV(xie),Sie=xV(wie);function TI(t,e=0,n=1){return(0,Sie.default)(t,e,n)}function wV(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Cie(t){const e=t.toString(16);return e.length===1?`0${e}`:e}function ha(t){if(t.type)return t;if(t.charAt(0)==="#")return ha(wV(t));const e=t.indexOf("("),n=t.substring(0,e);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error((0,Z4.default)(9,t));let r=t.substring(e+1,t.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error((0,Z4.default)(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const _V=t=>{const e=ha(t);return e.values.slice(0,3).map((n,r)=>e.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};Gr.colorChannel=_V;const Eie=(t,e)=>{try{return _V(t)}catch{return t}};Gr.private_safeColorChannel=Eie;function cg(t){const{type:e,colorSpace:n}=t;let{values:r}=t;return e.indexOf("rgb")!==-1?r=r.map((i,o)=>o<3?parseInt(i,10):i):e.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),e.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${e}(${r})`}function Mie(t){if(t.indexOf("#")===0)return t;const{values:e}=ha(t);return`#${e.map((n,r)=>Cie(r===3?Math.round(255*n):n)).join("")}`}function SV(t){t=ha(t);const{values:e}=t,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),s=(u,c=(u+n/30)%12)=>i-o*Math.max(Math.min(c-3,9-c,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return t.type==="hsla"&&(a+="a",l.push(e[3])),cg({type:a,values:l})}function V_(t){t=ha(t);let e=t.type==="hsl"||t.type==="hsla"?ha(SV(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function Tie(t,e){const n=V_(t),r=V_(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function CV(t,e){return t=ha(t),e=TI(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,cg(t)}function Aie(t,e,n){try{return CV(t,e)}catch{return t}}function AI(t,e){if(t=ha(t),e=TI(e),t.type.indexOf("hsl")!==-1)t.values[2]*=1-e;else if(t.type.indexOf("rgb")!==-1||t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]*=1-e;return cg(t)}function Pie(t,e,n){try{return AI(t,e)}catch{return t}}function PI(t,e){if(t=ha(t),e=TI(e),t.type.indexOf("hsl")!==-1)t.values[2]+=(100-t.values[2])*e;else if(t.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return cg(t)}function Die(t,e,n){try{return PI(t,e)}catch{return t}}function EV(t,e=.15){return V_(t)>.5?AI(t,e):PI(t,e)}function Rie(t,e,n){try{return EV(t,e)}catch{return t}}function Iie(t,e,n,r=1){const i=(l,u)=>Math.round((l**(1/r)*(1-n)+u**(1/r)*n)**r),o=ha(t),s=ha(e),a=[i(o.values[0],s.values[0]),i(o.values[1],s.values[1]),i(o.values[2],s.values[2])];return cg({type:"rgb",values:a})}const Nie=["mode","contrastThreshold","tonalOffset"],Q4={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Jv.white,default:Jv.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},uT={text:{primary:Jv.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Jv.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function J4(t,e,n,r){const i=r.light||r,o=r.dark||r*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=MI(t.main,i):e==="dark"&&(t.dark=EI(t.main,o)))}function Fie(t="light"){return t==="dark"?{main:Fh[200],light:Fh[50],dark:Fh[400]}:{main:Fh[700],light:Fh[400],dark:Fh[800]}}function Oie(t="light"){return t==="dark"?{main:Nh[200],light:Nh[50],dark:Nh[400]}:{main:Nh[500],light:Nh[300],dark:Nh[700]}}function kie(t="light"){return t==="dark"?{main:Ih[500],light:Ih[300],dark:Ih[700]}:{main:Ih[700],light:Ih[400],dark:Ih[800]}}function Lie(t="light"){return t==="dark"?{main:Oh[400],light:Oh[300],dark:Oh[700]}:{main:Oh[700],light:Oh[500],dark:Oh[900]}}function Bie(t="light"){return t==="dark"?{main:kh[400],light:kh[300],dark:kh[700]}:{main:kh[800],light:kh[500],dark:kh[900]}}function $ie(t="light"){return t==="dark"?{main:a0[400],light:a0[300],dark:a0[700]}:{main:"#ed6c02",light:a0[500],dark:a0[900]}}function zie(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:r=.2}=t,i=Be(t,Nie),o=t.primary||Fie(e),s=t.secondary||Oie(e),a=t.error||kie(e),l=t.info||Lie(e),u=t.success||Bie(e),c=t.warning||$ie(e);function d(g){return _ie(g,uT.text.primary)>=n?uT.text.primary:Q4.text.primary}const f=({color:g,name:b,mainShade:m=500,lightShade:w=300,darkShade:x=700})=>{if(g=O({},g),!g.main&&g[m]&&(g.main=g[m]),!g.hasOwnProperty("main"))throw new Error(Bu(11,b?` (${b})`:"",m));if(typeof g.main!="string")throw new Error(Bu(12,b?` (${b})`:"",JSON.stringify(g.main)));return J4(g,"light",w,r),J4(g,"dark",x,r),g.contrastText||(g.contrastText=d(g.main)),g},h={dark:uT,light:Q4};return Mo(O({common:O({},Jv),mode:e,primary:f({color:o,name:"primary"}),secondary:f({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:a,name:"error"}),warning:f({color:c,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:u,name:"success"}),grey:yte,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r},h[e]),i)}const Uie=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Hie(t){return Math.round(t*1e5)/1e5}const e5={textTransform:"uppercase"},t5='"Roboto", "Helvetica", "Arial", sans-serif';function Vie(t,e){const n=typeof e=="function"?e(t):e,{fontFamily:r=t5,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:u=16,allVariants:c,pxToRem:d}=n,f=Be(n,Uie),h=i/14,p=d||(m=>`${m/u*h}rem`),g=(m,w,x,_,C)=>O({fontFamily:r,fontWeight:m,fontSize:p(w),lineHeight:x},r===t5?{letterSpacing:`${Hie(_/w)}em`}:{},C,c),b={h1:g(o,96,1.167,-1.5),h2:g(o,60,1.2,-.5),h3:g(s,48,1.167,0),h4:g(s,34,1.235,.25),h5:g(s,24,1.334,0),h6:g(a,20,1.6,.15),subtitle1:g(s,16,1.75,.15),subtitle2:g(a,14,1.57,.1),body1:g(s,16,1.5,.15),body2:g(s,14,1.43,.15),button:g(a,14,1.75,.4,e5),caption:g(s,12,1.66,.4),overline:g(s,12,2.66,1,e5),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Mo(O({htmlFontSize:u,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},b),f,{clone:!1})}const Gie=.2,jie=.14,Wie=.12;function ur(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${Gie})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${jie})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${Wie})`].join(",")}const qie=["none",ur(0,2,1,-1,0,1,1,0,0,1,3,0),ur(0,3,1,-2,0,2,2,0,0,1,5,0),ur(0,3,3,-2,0,3,4,0,0,1,8,0),ur(0,2,4,-1,0,4,5,0,0,1,10,0),ur(0,3,5,-1,0,5,8,0,0,1,14,0),ur(0,3,5,-1,0,6,10,0,0,1,18,0),ur(0,4,5,-2,0,7,10,1,0,2,16,1),ur(0,5,5,-3,0,8,10,1,0,3,14,2),ur(0,5,6,-3,0,9,12,1,0,3,16,2),ur(0,6,6,-3,0,10,14,1,0,4,18,3),ur(0,6,7,-4,0,11,15,1,0,4,20,3),ur(0,7,8,-4,0,12,17,2,0,5,22,4),ur(0,7,8,-4,0,13,19,2,0,5,24,4),ur(0,7,9,-4,0,14,21,2,0,5,26,4),ur(0,8,9,-5,0,15,22,2,0,6,28,5),ur(0,8,10,-5,0,16,24,2,0,6,30,5),ur(0,8,11,-5,0,17,26,2,0,6,32,5),ur(0,9,11,-5,0,18,28,2,0,7,34,6),ur(0,9,12,-6,0,19,29,2,0,7,36,6),ur(0,10,13,-6,0,20,31,3,0,8,38,7),ur(0,10,13,-6,0,21,33,3,0,8,40,7),ur(0,10,14,-6,0,22,35,3,0,8,42,7),ur(0,11,14,-7,0,23,36,3,0,9,44,8),ur(0,11,15,-7,0,24,38,3,0,9,46,8)],Xie=["duration","easing","delay"],Kie={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Yie={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function n5(t){return`${Math.round(t)}ms`}function Zie(t){if(!t)return 0;const e=t/36;return Math.round((4+15*e**.25+e/5)*10)}function Qie(t){const e=O({},Kie,t.easing),n=O({},Yie,t.duration);return O({getAutoHeightDuration:Zie,create:(i=["all"],o={})=>{const{duration:s=n.standard,easing:a=e.easeInOut,delay:l=0}=o;return Be(o,Xie),(Array.isArray(i)?i:[i]).map(u=>`${u} ${typeof s=="string"?s:n5(s)} ${a} ${typeof l=="string"?l:n5(l)}`).join(",")}},t,{easing:e,duration:n})}const Jie={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},eoe=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function MV(t={},...e){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=t,s=Be(t,eoe);if(t.vars)throw new Error(Bu(18));const a=zie(r),l=nb(t);let u=Mo(l,{mixins:bie(l.breakpoints,n),palette:a,shadows:qie.slice(),typography:Vie(a,o),transitions:Qie(i),zIndex:O({},Jie)});return u=Mo(u,s),u=e.reduce((c,d)=>Mo(c,d),u),u.unstable_sxConfig=O({},tb,s==null?void 0:s.unstable_sxConfig),u.unstable_sx=function(d){return lg({sx:d,theme:this})},u}function toe(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function noe(t){return parseFloat(t)}const ZC=MV();function ob(){const t=LC(ZC);return t[Qy]||t}function kt({props:t,name:e}){return mV({props:t,name:e,defaultTheme:ZC,themeId:Qy})}var sb={},cT={exports:{}},r5;function roe(){return r5||(r5=1,function(t){function e(n,r){if(n==null)return{};var i={},o=Object.keys(n),s,a;for(a=0;a=0)&&(i[s]=n[s]);return i}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(cT)),cT.exports}const TV=ju(Tne),ioe=ju(Ane),ooe=ju(Fne),soe=ju(kre),aoe=ju(wre),loe=ju(Are);var dg=YC;Object.defineProperty(sb,"__esModule",{value:!0});var uoe=sb.default=_oe;sb.shouldForwardProp=Zw;sb.systemDefaultTheme=void 0;var Zs=dg(YH()),iD=dg(roe()),i5=goe(TV),coe=ioe;dg(ooe);dg(soe);var doe=dg(aoe),foe=dg(loe);const hoe=["ownerState"],poe=["variants"],moe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function AV(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(AV=function(r){return r?n:e})(t)}function goe(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=AV(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function voe(t){return Object.keys(t).length===0}function yoe(t){return typeof t=="string"&&t.charCodeAt(0)>96}function Zw(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const boe=sb.systemDefaultTheme=(0,doe.default)(),xoe=t=>t&&t.charAt(0).toLowerCase()+t.slice(1);function hx({defaultTheme:t,theme:e,themeId:n}){return voe(e)?t:e[n]||e}function woe(t){return t?(e,n)=>n[t]:null}function Qw(t,e){let{ownerState:n}=e,r=(0,iD.default)(e,hoe);const i=typeof t=="function"?t((0,Zs.default)({ownerState:n},r)):t;if(Array.isArray(i))return i.flatMap(o=>Qw(o,(0,Zs.default)({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let a=(0,iD.default)(i,poe);return o.forEach(l=>{let u=!0;typeof l.props=="function"?u=l.props((0,Zs.default)({ownerState:n},r,n)):Object.keys(l.props).forEach(c=>{(n==null?void 0:n[c])!==l.props[c]&&r[c]!==l.props[c]&&(u=!1)}),u&&(Array.isArray(a)||(a=[a]),a.push(typeof l.style=="function"?l.style((0,Zs.default)({ownerState:n},r,n)):l.style))}),a}return i}function _oe(t={}){const{themeId:e,defaultTheme:n=boe,rootShouldForwardProp:r=Zw,slotShouldForwardProp:i=Zw}=t,o=s=>(0,foe.default)((0,Zs.default)({},s,{theme:hx((0,Zs.default)({},s,{defaultTheme:n,themeId:e}))}));return o.__mui_systemSx=!0,(s,a={})=>{(0,i5.internal_processStyles)(s,C=>C.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:u,skipVariantsResolver:c,skipSx:d,overridesResolver:f=woe(xoe(u))}=a,h=(0,iD.default)(a,moe),p=c!==void 0?c:u&&u!=="Root"&&u!=="root"||!1,g=d||!1;let b,m=Zw;u==="Root"||u==="root"?m=r:u?m=i:yoe(s)&&(m=void 0);const w=(0,i5.default)(s,(0,Zs.default)({shouldForwardProp:m,label:b},h)),x=C=>typeof C=="function"&&C.__emotion_real!==C||(0,coe.isPlainObject)(C)?S=>Qw(C,(0,Zs.default)({},S,{theme:hx({theme:S.theme,defaultTheme:n,themeId:e})})):C,_=(C,...S)=>{let M=x(C);const P=S?S.map(x):[];l&&f&&P.push(F=>{const $=hx((0,Zs.default)({},F,{defaultTheme:n,themeId:e}));if(!$.components||!$.components[l]||!$.components[l].styleOverrides)return null;const j=$.components[l].styleOverrides,k={};return Object.entries(j).forEach(([U,G])=>{k[U]=Qw(G,(0,Zs.default)({},F,{theme:$}))}),f(F,k)}),l&&!p&&P.push(F=>{var $;const j=hx((0,Zs.default)({},F,{defaultTheme:n,themeId:e})),k=j==null||($=j.components)==null||($=$[l])==null?void 0:$.variants;return Qw({variants:k},(0,Zs.default)({},F,{theme:j}))}),g||P.push(o);const A=P.length-S.length;if(Array.isArray(C)&&A>0){const F=new Array(A).fill("");M=[...C,...F],M.raw=[...C.raw,...F]}const R=w(M,...P);return s.muiName&&(R.muiName=s.muiName),R};return w.withConfig&&(_.withConfig=w.withConfig),_}}function PV(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const uo=t=>PV(t)&&t!=="classes",ze=uoe({themeId:Qy,defaultTheme:ZC,rootShouldForwardProp:uo}),o5=t=>{let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,(e/100).toFixed(2)};function Soe(t){return It("MuiSvgIcon",t)}At("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Coe=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Eoe=t=>{const{color:e,fontSize:n,classes:r}=t,i={root:["root",e!=="inherit"&&`color${Ge(e)}`,`fontSize${Ge(n)}`]};return Qe(i,Soe,r)},Moe=ze("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="inherit"&&e[`color${Ge(n.color)}`],e[`fontSize${Ge(n.fontSize)}`]]}})(({theme:t,ownerState:e})=>{var n,r,i,o,s,a,l,u,c,d,f,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=t.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(i=t.transitions)==null||(i=i.duration)==null?void 0:i.shorter}),fontSize:{inherit:"inherit",small:((o=t.typography)==null||(s=o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem",medium:((a=t.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((u=t.typography)==null||(c=u.pxToRem)==null?void 0:c.call(u,35))||"2.1875rem"}[e.fontSize],color:(d=(f=(t.vars||t).palette)==null||(f=f[e.color])==null?void 0:f.main)!=null?d:{action:(h=(t.vars||t).palette)==null||(h=h.action)==null?void 0:h.active,disabled:(p=(t.vars||t).palette)==null||(p=p.action)==null?void 0:p.disabled,inherit:void 0}[e.color]}}),oD=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:d,viewBox:f="0 0 24 24"}=r,h=Be(r,Coe),p=E.isValidElement(i)&&i.type==="svg",g=O({},r,{color:s,component:a,fontSize:l,instanceFontSize:e.fontSize,inheritViewBox:c,viewBox:f,hasSvgAsChild:p}),b={};c||(b.viewBox=f);const m=Eoe(g);return D.jsxs(Moe,O({as:a,className:nt(m.root,o),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n},b,h,p&&i.props,{ownerState:g,children:[p?i.props.children:i,d?D.jsx("title",{children:d}):null]}))});oD.muiName="SvgIcon";function mn(t,e){function n(r,i){return D.jsx(oD,O({"data-testid":`${e}Icon`,ref:i},r,{children:t}))}return n.muiName=oD.muiName,E.memo(E.forwardRef(n))}const Toe={configure:t=>{pI.configure(t)}},Aoe=Object.freeze(Object.defineProperty({__proto__:null,capitalize:Ge,createChainedFunction:H_,createSvgIcon:mn,debounce:ug,deprecatedPropType:Yre,isMuiElement:Yw,ownerDocument:Sr,ownerWindow:Ll,requirePropFactory:Zre,setRef:ry,unstable_ClassNameGenerator:Toe,unstable_useEnhancedEffect:_r,unstable_useId:jn,unsupportedProp:Jre,useControlled:Ru,useEventCallback:ar,useForkRef:An,useIsFocusVisible:_I},Symbol.toStringTag,{value:"Module"}));function DI(t){return kt}function sD(t,e){return sD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},sD(t,e)}function RI(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,sD(t,e)}const s5={disabled:!1},G_=ie.createContext(null);var Poe=function(e){return e.scrollTop},H0="unmounted",Qd="exited",Jd="entering",mp="entered",aD="exiting",jl=function(t){RI(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,a=s&&!s.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?a?(l=Qd,o.appearStatus=Jd):l=mp:r.unmountOnExit||r.mountOnEnter?l=H0:l=Qd,o.state={status:l},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===H0?{status:Qd}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==Jd&&s!==mp&&(o=Jd):(s===Jd||s===mp)&&(o=aD)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,a;return o=s=a=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,a=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:a}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Jd){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:cx.findDOMNode(this);s&&Poe(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Qd&&this.setState({status:H0})},n.performEnter=function(i){var o=this,s=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[cx.findDOMNode(this),a],u=l[0],c=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!i&&!s||s5.disabled){this.safeSetState({status:mp},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:Jd},function(){o.props.onEntering(u,c),o.onTransitionEnd(f,function(){o.safeSetState({status:mp},function(){o.props.onEntered(u,c)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:cx.findDOMNode(this);if(!o||s5.disabled){this.safeSetState({status:Qd},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:aD},function(){i.props.onExiting(a),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:Qd},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,o.nextCallback=null,i(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:cx.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===H0)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var a=Be(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ie.createElement(G_.Provider,{value:null},typeof s=="function"?s(i,a):ie.cloneElement(ie.Children.only(s),a))},e}(ie.Component);jl.contextType=G_;jl.propTypes={};function Lh(){}jl.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Lh,onEntering:Lh,onEntered:Lh,onExit:Lh,onExiting:Lh,onExited:Lh};jl.UNMOUNTED=H0;jl.EXITED=Qd;jl.ENTERING=Jd;jl.ENTERED=mp;jl.EXITING=aD;function Doe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function II(t,e){var n=function(o){return e&&E.isValidElement(o)?e(o):o},r=Object.create(null);return t&&E.Children.map(t,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function Roe(t,e){t=t||{},e=e||{};function n(c){return c in e?e[c]:t[c]}var r=Object.create(null),i=[];for(var o in t)o in e?i.length&&(r[o]=i,i=[]):i.push(o);var s,a={};for(var l in e){if(r[l])for(s=0;st.scrollTop;function j_(t,e){var n,r;const{timeout:i,easing:o,style:s={}}=t;return{duration:(n=s.transitionDuration)!=null?n:typeof i=="number"?i:i[e.mode]||0,easing:(r=s.transitionTimingFunction)!=null?r:typeof o=="object"?o[e.mode]:o,delay:s.transitionDelay}}function koe(t){return It("MuiPaper",t)}At("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Loe=["className","component","elevation","square","variant"],Boe=t=>{const{square:e,elevation:n,variant:r,classes:i}=t,o={root:["root",r,!e&&"rounded",r==="elevation"&&`elevation${n}`]};return Qe(o,koe,i)},$oe=ze("div",{name:"MuiPaper",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],!n.square&&e.rounded,n.variant==="elevation"&&e[`elevation${n.elevation}`]]}})(({theme:t,ownerState:e})=>{var n;return O({backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow")},!e.square&&{borderRadius:t.shape.borderRadius},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.divider}`},e.variant==="elevation"&&O({boxShadow:(t.vars||t).shadows[e.elevation]},!t.vars&&t.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${fn("#fff",o5(e.elevation))}, ${fn("#fff",o5(e.elevation))})`},t.vars&&{backgroundImage:(n=t.vars.overlays)==null?void 0:n[e.elevation]}))}),Xu=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiPaper"}),{className:i,component:o="div",elevation:s=1,square:a=!1,variant:l="elevation"}=r,u=Be(r,Loe),c=O({},r,{component:o,elevation:s,square:a,variant:l}),d=Boe(c);return D.jsx($oe,O({as:o,ownerState:c,className:nt(d.root,i),ref:n},u))});function oy(t){return typeof t=="string"}function V0(t,e,n){return t===void 0||oy(t)?e:O({},e,{ownerState:O({},e.ownerState,n)})}const zoe={disableDefaultClasses:!1},Uoe=E.createContext(zoe);function Hoe(t){const{disableDefaultClasses:e}=E.useContext(Uoe);return n=>e?"":t(n)}function RV(t,e=[]){if(t===void 0)return{};const n={};return Object.keys(t).filter(r=>r.match(/^on[A-Z]/)&&typeof t[r]=="function"&&!e.includes(r)).forEach(r=>{n[r]=t[r]}),n}function Voe(t,e,n){return typeof t=="function"?t(e,n):t}function a5(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function Goe(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=t;if(!e){const h=nt(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),p=O({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),g=O({},n,i,r);return h.length>0&&(g.className=h),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const s=RV(O({},i,r)),a=a5(r),l=a5(i),u=e(s),c=nt(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d=O({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),f=O({},u,n,l,a);return c.length>0&&(f.className=c),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:u.ref}}const joe=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function $u(t){var e;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=t,s=Be(t,joe),a=o?{}:Voe(r,i),{props:l,internalRef:u}=Goe(O({},s,{externalSlotProps:a})),c=An(u,a==null?void 0:a.ref,(e=t.additionalProps)==null?void 0:e.ref);return V0(n,O({},l,{ref:c}),i)}function Woe(t){const{className:e,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:s,in:a,onExited:l,timeout:u}=t,[c,d]=E.useState(!1),f=nt(e,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:s,height:s,top:-(s/2)+o,left:-(s/2)+i},p=nt(n.child,c&&n.childLeaving,r&&n.childPulsate);return!a&&!c&&d(!0),E.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,u);return()=>{clearTimeout(g)}}},[l,a,u]),D.jsx("span",{className:f,style:h,children:D.jsx("span",{className:p})})}const Js=At("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),qoe=["center","classes","className"];let QC=t=>t,l5,u5,c5,d5;const lD=550,Xoe=80,Koe=yd(l5||(l5=QC` 0% { transform: scale(0); opacity: 0.1; @@ -125,8 +125,8 @@ Error generating stack: `+o.message+` animation-iteration-count: infinite; animation-delay: 200ms; } -`),Js.rippleVisible,Koe,lD,({theme:t})=>t.transitions.easing.easeInOut,Js.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Js.child,Js.childLeaving,Yoe,lD,({theme:t})=>t.transitions.easing.easeInOut,Js.childPulsate,Zoe,({theme:t})=>t.transitions.easing.easeInOut),ese=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s}=r,a=Be(r,qoe),[l,u]=E.useState([]),c=E.useRef(0),d=E.useRef(null);E.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=E.useRef(!1),h=Kp(),p=E.useRef(null),g=E.useRef(null),b=E.useCallback(_=>{const{pulsate:C,rippleX:S,rippleY:M,rippleSize:P,cb:A}=_;u(R=>[...R,D.jsx(Joe,{classes:{ripple:nt(o.ripple,Js.ripple),rippleVisible:nt(o.rippleVisible,Js.rippleVisible),ripplePulsate:nt(o.ripplePulsate,Js.ripplePulsate),child:nt(o.child,Js.child),childLeaving:nt(o.childLeaving,Js.childLeaving),childPulsate:nt(o.childPulsate,Js.childPulsate)},timeout:lD,pulsate:C,rippleX:S,rippleY:M,rippleSize:P},c.current)]),c.current+=1,d.current=A},[o]),m=E.useCallback((_={},C={},S=()=>{})=>{const{pulsate:M=!1,center:P=i||C.pulsate,fakeElement:A=!1}=C;if((_==null?void 0:_.type)==="mousedown"&&f.current){f.current=!1;return}(_==null?void 0:_.type)==="touchstart"&&(f.current=!0);const R=A?null:g.current,F=R?R.getBoundingClientRect():{width:0,height:0,left:0,top:0};let $,j,k;if(P||_===void 0||_.clientX===0&&_.clientY===0||!_.clientX&&!_.touches)$=Math.round(F.width/2),j=Math.round(F.height/2);else{const{clientX:U,clientY:G}=_.touches&&_.touches.length>0?_.touches[0]:_;$=Math.round(U-F.left),j=Math.round(G-F.top)}if(P)k=Math.sqrt((2*F.width**2+F.height**2)/3),k%2===0&&(k+=1);else{const U=Math.max(Math.abs((R?R.clientWidth:0)-$),$)*2+2,G=Math.max(Math.abs((R?R.clientHeight:0)-j),j)*2+2;k=Math.sqrt(U**2+G**2)}_!=null&&_.touches?p.current===null&&(p.current=()=>{b({pulsate:M,rippleX:$,rippleY:j,rippleSize:k,cb:S})},h.start(Xoe,()=>{p.current&&(p.current(),p.current=null)})):b({pulsate:M,rippleX:$,rippleY:j,rippleSize:k,cb:S})},[i,b,h]),w=E.useCallback(()=>{m({},{pulsate:!0})},[m]),x=E.useCallback((_,C)=>{if(h.clear(),(_==null?void 0:_.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(_,C)});return}p.current=null,u(S=>S.length>0?S.slice(1):S),d.current=C},[h]);return E.useImperativeHandle(n,()=>({pulsate:w,start:m,stop:x}),[w,m,x]),D.jsx(Qoe,O({className:nt(Js.root,o.root,s),ref:g},a,{children:D.jsx(NI,{component:null,exit:!0,children:l})}))});function tse(t){return It("MuiButtonBase",t)}const nse=At("MuiButtonBase",["root","disabled","focusVisible"]),rse=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],ise=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=Qe({root:["root",e&&"disabled",n&&"focusVisible"]},tse,i);return n&&r&&(s.root+=` ${r}`),s},ose=ze("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${nse.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Bm=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:u=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:h="a",onBlur:p,onClick:g,onContextMenu:b,onDragLeave:m,onFocus:w,onFocusVisible:x,onKeyDown:_,onKeyUp:C,onMouseDown:S,onMouseLeave:M,onMouseUp:P,onTouchEnd:A,onTouchMove:R,onTouchStart:F,tabIndex:$=0,TouchRippleProps:j,touchRippleRef:k,type:U}=r,G=Be(r,rse),B=E.useRef(null),L=E.useRef(null),N=An(L,k),{isFocusVisibleRef:W,onFocus:K,onBlur:Q,ref:J}=_I(),[ae,ve]=E.useState(!1);u&&ae&&ve(!1),E.useImperativeHandle(i,()=>({focusVisible:()=>{ve(!0),B.current.focus()}}),[]);const[fe,Me]=E.useState(!1);E.useEffect(()=>{Me(!0)},[]);const ye=fe&&!c&&!u;E.useEffect(()=>{ae&&f&&!c&&fe&&L.current.pulsate()},[c,f,ae,fe]);function we(ge,be,Te=d){return ar(Re=>(be&&be(Re),!Te&&L.current&&L.current[ge](Re),!0))}const Fe=we("start",S),Oe=we("stop",b),re=we("stop",m),_e=we("stop",P),Ce=we("stop",ge=>{ae&&ge.preventDefault(),M&&M(ge)}),X=we("start",F),Z=we("stop",A),he=we("stop",R),Y=we("stop",ge=>{Q(ge),W.current===!1&&ve(!1),p&&p(ge)},!1),ne=ar(ge=>{B.current||(B.current=ge.currentTarget),K(ge),W.current===!0&&(ve(!0),x&&x(ge)),w&&w(ge)}),se=()=>{const ge=B.current;return l&&l!=="button"&&!(ge.tagName==="A"&&ge.href)},xe=E.useRef(!1),Pe=ar(ge=>{f&&!xe.current&&ae&&L.current&&ge.key===" "&&(xe.current=!0,L.current.stop(ge,()=>{L.current.start(ge)})),ge.target===ge.currentTarget&&se()&&ge.key===" "&&ge.preventDefault(),_&&_(ge),ge.target===ge.currentTarget&&se()&&ge.key==="Enter"&&!u&&(ge.preventDefault(),g&&g(ge))}),z=ar(ge=>{f&&ge.key===" "&&L.current&&ae&&!ge.defaultPrevented&&(xe.current=!1,L.current.stop(ge,()=>{L.current.pulsate(ge)})),C&&C(ge),g&&ge.target===ge.currentTarget&&se()&&ge.key===" "&&!ge.defaultPrevented&&g(ge)});let H=l;H==="button"&&(G.href||G.to)&&(H=h);const te={};H==="button"?(te.type=U===void 0?"button":U,te.disabled=u):(!G.href&&!G.to&&(te.role="button"),u&&(te["aria-disabled"]=u));const le=An(n,J,B),de=O({},r,{centerRipple:o,component:l,disabled:u,disableRipple:c,disableTouchRipple:d,focusRipple:f,tabIndex:$,focusVisible:ae}),ue=ise(de);return D.jsxs(ose,O({as:H,className:nt(ue.root,a),ownerState:de,onBlur:Y,onClick:g,onContextMenu:Oe,onFocus:ne,onKeyDown:Pe,onKeyUp:z,onMouseDown:Fe,onMouseLeave:Ce,onMouseUp:_e,onDragLeave:re,onTouchEnd:Z,onTouchMove:he,onTouchStart:X,ref:le,tabIndex:u?-1:$,type:U},te,G,{children:[s,ye?D.jsx(ese,O({ref:N,center:o},j)):null]}))});function sse(t){return It("MuiIconButton",t)}const ase=At("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),lse=["edge","children","className","color","disabled","disableFocusRipple","size"],use=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,s={root:["root",n&&"disabled",r!=="default"&&`color${Ge(r)}`,i&&`edge${Ge(i)}`,`size${Ge(o)}`]};return Qe(s,sse,e)},cse=ze(Bm,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Ge(n.color)}`],n.edge&&e[`edge${Ge(n.edge)}`],e[`size${Ge(n.size)}`]]}})(({theme:t,ownerState:e})=>O({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return O({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&O({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":O({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${ase.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),io=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:u=!1,size:c="medium"}=r,d=Be(r,lse),f=O({},r,{edge:i,color:a,disabled:l,disableFocusRipple:u,size:c}),h=use(f);return D.jsx(cse,O({className:nt(h.root,s),centerRipple:!0,focusRipple:!u,disabled:l,ref:n},d,{ownerState:f,children:o}))}),dse=mn(D.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function fse(t){return It("MuiTypography",t)}At("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const hse=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],pse=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${Ge(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Qe(a,fse,s)},mse=ze("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${Ge(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>O({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),f5={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},gse={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},vse=t=>gse[t]||t,xn=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTypography"}),i=vse(r.color),o=rb(O({},r,{color:i})),{align:s="inherit",className:a,component:l,gutterBottom:u=!1,noWrap:c=!1,paragraph:d=!1,variant:f="body1",variantMapping:h=f5}=o,p=Be(o,hse),g=O({},o,{align:s,color:i,className:a,component:l,gutterBottom:u,noWrap:c,paragraph:d,variant:f,variantMapping:h}),b=l||(d?"p":h[f]||f5[f])||"span",m=pse(g);return D.jsx(mse,O({as:b,ref:n,ownerState:g,className:nt(m.root,a)},p))});function yse(t){return It("MuiAppBar",t)}At("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const bse=["className","color","enableColorOnDark","position"],xse=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${Ge(e)}`,`position${Ge(n)}`]};return Qe(i,yse,r)},px=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,wse=ze(Xu,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Ge(n.position)}`],e[`color${Ge(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return O({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&O({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&O({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&O({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:px(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:px(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:px(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:px(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),_se=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed"}=r,l=Be(r,bse),u=O({},r,{color:o,position:a,enableColorOnDark:s}),c=xse(u);return D.jsx(wse,O({square:!0,component:"header",ownerState:u,elevation:4,className:nt(c.root,i,a==="fixed"&&"mui-fixed"),ref:n},l))});function Sse(t){const{badgeContent:e,invisible:n=!1,max:r=99,showZero:i=!1}=t,o=SI({badgeContent:e,max:r});let s=n;n===!1&&e===0&&!i&&(s=!0);const{badgeContent:a,max:l=r}=s?o:t,u=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:u}}const IV="base";function Cse(t){return`${IV}--${t}`}function Ese(t,e){return`${IV}-${t}-${e}`}function NV(t,e){const n=cV[e];return n?Cse(n):Ese(t,e)}function Mse(t,e){const n={};return e.forEach(r=>{n[r]=NV(t,r)}),n}function h5(t){return t.substring(2).toLowerCase()}function Tse(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const c=An(e.ref,a),d=ar(p=>{const g=u.current;u.current=!1;const b=Sr(a.current);if(!l.current||!a.current||"clientX"in p&&Tse(p,b))return;if(s.current){s.current=!1;return}let m;p.composedPath?m=p.composedPath().indexOf(a.current)>-1:m=!b.documentElement.contains(p.target)||a.current.contains(p.target),!m&&(n||!g)&&i(p)}),f=p=>g=>{u.current=!0;const b=e.props[p];b&&b(g)},h={ref:c};return o!==!1&&(h[o]=f(o)),E.useEffect(()=>{if(o!==!1){const p=h5(o),g=Sr(a.current),b=()=>{s.current=!0};return g.addEventListener(p,d),g.addEventListener("touchmove",b),()=>{g.removeEventListener(p,d),g.removeEventListener("touchmove",b)}}},[d,o]),r!==!1&&(h[r]=f(r)),E.useEffect(()=>{if(r!==!1){const p=h5(r),g=Sr(a.current);return g.addEventListener(p,d),()=>{g.removeEventListener(p,d)}}},[d,r]),D.jsx(E.Fragment,{children:E.cloneElement(e,h)})}const Ase=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Pse(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function Dse(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function Rse(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||Dse(t))}function Ise(t){const e=[],n=[];return Array.from(t.querySelectorAll(Ase)).forEach((r,i)=>{const o=Pse(r);o===-1||!Rse(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function Nse(){return!0}function OV(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=Ise,isEnabled:s=Nse,open:a}=t,l=E.useRef(!1),u=E.useRef(null),c=E.useRef(null),d=E.useRef(null),f=E.useRef(null),h=E.useRef(!1),p=E.useRef(null),g=An(e.ref,p),b=E.useRef(null);E.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),E.useEffect(()=>{if(!a||!p.current)return;const x=Sr(p.current);return p.current.contains(x.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),E.useEffect(()=>{if(!a||!p.current)return;const x=Sr(p.current),_=M=>{b.current=M,!(r||!s()||M.key!=="Tab")&&x.activeElement===p.current&&M.shiftKey&&(l.current=!0,c.current&&c.current.focus())},C=()=>{const M=p.current;if(M===null)return;if(!x.hasFocus()||!s()||l.current){l.current=!1;return}if(M.contains(x.activeElement)||r&&x.activeElement!==u.current&&x.activeElement!==c.current)return;if(x.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!h.current)return;let P=[];if((x.activeElement===u.current||x.activeElement===c.current)&&(P=o(p.current)),P.length>0){var A,R;const F=!!((A=b.current)!=null&&A.shiftKey&&((R=b.current)==null?void 0:R.key)==="Tab"),$=P[0],j=P[P.length-1];typeof $!="string"&&typeof j!="string"&&(F?j.focus():$.focus())}else M.focus()};x.addEventListener("focusin",C),x.addEventListener("keydown",_,!0);const S=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&C()},50);return()=>{clearInterval(S),x.removeEventListener("focusin",C),x.removeEventListener("keydown",_,!0)}},[n,r,i,s,a,o]);const m=x=>{d.current===null&&(d.current=x.relatedTarget),h.current=!0,f.current=x.target;const _=e.props.onFocus;_&&_(x)},w=x=>{d.current===null&&(d.current=x.relatedTarget),h.current=!0};return D.jsxs(E.Fragment,{children:[D.jsx("div",{tabIndex:a?0:-1,onFocus:w,ref:u,"data-testid":"sentinelStart"}),E.cloneElement(e,{ref:g,onFocus:m}),D.jsx("div",{tabIndex:a?0:-1,onFocus:w,ref:c,"data-testid":"sentinelEnd"})]})}function Fse(t){return typeof t=="function"?t():t}const kV=E.forwardRef(function(e,n){const{children:r,container:i,disablePortal:o=!1}=e,[s,a]=E.useState(null),l=An(E.isValidElement(r)?r.ref:null,n);if(_r(()=>{o||a(Fse(i)||document.body)},[i,o]),_r(()=>{if(s&&!o)return ry(n,s),()=>{ry(n,null)}},[n,s,o]),o){if(E.isValidElement(r)){const u={ref:l};return E.cloneElement(r,u)}return D.jsx(E.Fragment,{children:r})}return D.jsx(E.Fragment,{children:s&&qu.createPortal(r,s)})});function Ose(t){const e=Sr(t);return e.body===t?Bl(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function fv(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function p5(t){return parseInt(Bl(t).getComputedStyle(t).paddingRight,10)||0}function kse(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function m5(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=o.indexOf(s)===-1,l=!kse(s);a&&l&&fv(s,i)})}function dT(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function Lse(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(Ose(r)){const s=vV(Sr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${p5(r)+s}px`;const a=Sr(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${p5(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Sr(r).body;else{const s=r.parentElement,a=Bl(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function Bse(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class $se{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&fv(e.modalRef,!1);const i=Bse(n);m5(n,e.mount,e.modalRef,i,!0);const o=dT(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=dT(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=Lse(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=dT(this.containers,s=>s.modals.indexOf(e)!==-1),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&fv(e.modalRef,n),m5(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&fv(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function zse(t){return typeof t=="function"?t():t}function Use(t){return t?t.props.hasOwnProperty("in"):!1}const Hse=new $se;function Vse(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=Hse,closeAfterTransition:o=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:u,open:c,rootRef:d}=t,f=E.useRef({}),h=E.useRef(null),p=E.useRef(null),g=An(p,d),[b,m]=E.useState(!c),w=Use(l);let x=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(x=!1);const _=()=>Sr(h.current),C=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),S=()=>{i.mount(C(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},M=ar(()=>{const G=zse(e)||_().body;i.add(C(),G),p.current&&S()}),P=E.useCallback(()=>i.isTopModal(C()),[i]),A=ar(G=>{h.current=G,G&&(c&&P()?S():p.current&&fv(p.current,x))}),R=E.useCallback(()=>{i.remove(C(),x)},[x,i]);E.useEffect(()=>()=>{R()},[R]),E.useEffect(()=>{c?M():(!w||!o)&&R()},[c,R,w,o,M]);const F=G=>B=>{var L;(L=G.onKeyDown)==null||L.call(G,B),!(B.key!=="Escape"||B.which===229||!P())&&(n||(B.stopPropagation(),u&&u(B,"escapeKeyDown")))},$=G=>B=>{var L;(L=G.onClick)==null||L.call(G,B),B.target===B.currentTarget&&u&&u(B,"backdropClick")};return{getRootProps:(G={})=>{const B=RV(t);delete B.onTransitionEnter,delete B.onTransitionExited;const L=O({},B,G);return O({role:"presentation"},L,{onKeyDown:F(L),ref:g})},getBackdropProps:(G={})=>{const B=G;return O({"aria-hidden":!0},B,{onClick:$(B),open:c})},getTransitionProps:()=>{const G=()=>{m(!1),s&&s()},B=()=>{m(!0),a&&a(),o&&R()};return{onEnter:H_(G,l==null?void 0:l.props.onEnter),onExited:H_(B,l==null?void 0:l.props.onExited)}},rootRef:g,portalRef:A,isTopModal:P,exited:b,hasTransition:w}}var Xo="top",ma="bottom",ga="right",Ko="left",FI="auto",ab=[Xo,ma,ga,Ko],$m="start",sy="end",Gse="clippingParents",LV="viewport",u0="popper",jse="reference",g5=ab.reduce(function(t,e){return t.concat([e+"-"+$m,e+"-"+sy])},[]),BV=[].concat(ab,[FI]).reduce(function(t,e){return t.concat([e,e+"-"+$m,e+"-"+sy])},[]),Wse="beforeRead",qse="read",Xse="afterRead",Kse="beforeMain",Yse="main",Zse="afterMain",Qse="beforeWrite",Jse="write",eae="afterWrite",tae=[Wse,qse,Xse,Kse,Yse,Zse,Qse,Jse,eae];function $l(t){return t?(t.nodeName||"").toLowerCase():null}function Ns(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Lf(t){var e=Ns(t).Element;return t instanceof e||t instanceof Element}function ua(t){var e=Ns(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function OI(t){if(typeof ShadowRoot>"u")return!1;var e=Ns(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function nae(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!ua(o)||!$l(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function rae(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!ua(i)||!$l(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const iae={name:"applyStyles",enabled:!0,phase:"write",fn:nae,effect:rae,requires:["computeStyles"]};function Il(t){return t.split("-")[0]}var _f=Math.max,W_=Math.min,zm=Math.round;function uD(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function $V(){return!/^((?!chrome|android).)*safari/i.test(uD())}function Um(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&ua(t)&&(i=t.offsetWidth>0&&zm(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&zm(r.height)/t.offsetHeight||1);var s=Lf(t)?Ns(t):window,a=s.visualViewport,l=!$V()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function kI(t){var e=Um(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function zV(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&OI(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function zu(t){return Ns(t).getComputedStyle(t)}function oae(t){return["table","td","th"].indexOf($l(t))>=0}function bd(t){return((Lf(t)?t.ownerDocument:t.document)||window.document).documentElement}function JC(t){return $l(t)==="html"?t:t.assignedSlot||t.parentNode||(OI(t)?t.host:null)||bd(t)}function v5(t){return!ua(t)||zu(t).position==="fixed"?null:t.offsetParent}function sae(t){var e=/firefox/i.test(uD()),n=/Trident/i.test(uD());if(n&&ua(t)){var r=zu(t);if(r.position==="fixed")return null}var i=JC(t);for(OI(i)&&(i=i.host);ua(i)&&["html","body"].indexOf($l(i))<0;){var o=zu(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function lb(t){for(var e=Ns(t),n=v5(t);n&&oae(n)&&zu(n).position==="static";)n=v5(n);return n&&($l(n)==="html"||$l(n)==="body"&&zu(n).position==="static")?e:n||sae(t)||e}function LI(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function hv(t,e,n){return _f(t,W_(e,n))}function aae(t,e,n){var r=hv(t,e,n);return r>n?n:r}function UV(){return{top:0,right:0,bottom:0,left:0}}function HV(t){return Object.assign({},UV(),t)}function VV(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var lae=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,HV(typeof e!="number"?e:VV(e,ab))};function uae(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Il(n.placement),l=LI(a),u=[Ko,ga].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=lae(i.padding,n),f=kI(o),h=l==="y"?Xo:Ko,p=l==="y"?ma:ga,g=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],b=s[l]-n.rects.reference[l],m=lb(o),w=m?l==="y"?m.clientHeight||0:m.clientWidth||0:0,x=g/2-b/2,_=d[h],C=w-f[c]-d[p],S=w/2-f[c]/2+x,M=hv(_,S,C),P=l;n.modifiersData[r]=(e={},e[P]=M,e.centerOffset=M-S,e)}}function cae(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||zV(e.elements.popper,i)&&(e.elements.arrow=i))}const dae={name:"arrow",enabled:!0,phase:"main",fn:uae,effect:cae,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Hm(t){return t.split("-")[1]}var fae={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hae(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:zm(n*i)/i||0,y:zm(r*i)/i||0}}function y5(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,f=s.x,h=f===void 0?0:f,p=s.y,g=p===void 0?0:p,b=typeof c=="function"?c({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var m=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),x=Ko,_=Xo,C=window;if(u){var S=lb(n),M="clientHeight",P="clientWidth";if(S===Ns(n)&&(S=bd(n),zu(S).position!=="static"&&a==="absolute"&&(M="scrollHeight",P="scrollWidth")),S=S,i===Xo||(i===Ko||i===ga)&&o===sy){_=ma;var A=d&&S===C&&C.visualViewport?C.visualViewport.height:S[M];g-=A-r.height,g*=l?1:-1}if(i===Ko||(i===Xo||i===ma)&&o===sy){x=ga;var R=d&&S===C&&C.visualViewport?C.visualViewport.width:S[P];h-=R-r.width,h*=l?1:-1}}var F=Object.assign({position:a},u&&fae),$=c===!0?hae({x:h,y:g},Ns(n)):{x:h,y:g};if(h=$.x,g=$.y,l){var j;return Object.assign({},F,(j={},j[_]=w?"0":"",j[x]=m?"0":"",j.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",j))}return Object.assign({},F,(e={},e[_]=w?g+"px":"",e[x]=m?h+"px":"",e.transform="",e))}function pae(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Il(e.placement),variation:Hm(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,y5(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,y5(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const mae={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pae,data:{}};var mx={passive:!0};function gae(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=Ns(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,mx)}),a&&l.addEventListener("resize",n.update,mx),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,mx)}),a&&l.removeEventListener("resize",n.update,mx)}}const vae={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:gae,data:{}};var yae={left:"right",right:"left",bottom:"top",top:"bottom"};function Jw(t){return t.replace(/left|right|bottom|top/g,function(e){return yae[e]})}var bae={start:"end",end:"start"};function b5(t){return t.replace(/start|end/g,function(e){return bae[e]})}function BI(t){var e=Ns(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function $I(t){return Um(bd(t)).left+BI(t).scrollLeft}function xae(t,e){var n=Ns(t),r=bd(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=$V();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+$I(t),y:l}}function wae(t){var e,n=bd(t),r=BI(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=_f(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=_f(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+$I(t),l=-r.scrollTop;return zu(i||n).direction==="rtl"&&(a+=_f(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function zI(t){var e=zu(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function GV(t){return["html","body","#document"].indexOf($l(t))>=0?t.ownerDocument.body:ua(t)&&zI(t)?t:GV(JC(t))}function pv(t,e){var n;e===void 0&&(e=[]);var r=GV(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Ns(r),s=i?[o].concat(o.visualViewport||[],zI(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(pv(JC(s)))}function cD(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function _ae(t,e){var n=Um(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function x5(t,e,n){return e===LV?cD(xae(t,n)):Lf(e)?_ae(e,n):cD(wae(bd(t)))}function Sae(t){var e=pv(JC(t)),n=["absolute","fixed"].indexOf(zu(t).position)>=0,r=n&&ua(t)?lb(t):t;return Lf(r)?e.filter(function(i){return Lf(i)&&zV(i,r)&&$l(i)!=="body"}):[]}function Cae(t,e,n,r){var i=e==="clippingParents"?Sae(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=x5(t,u,r);return l.top=_f(c.top,l.top),l.right=W_(c.right,l.right),l.bottom=W_(c.bottom,l.bottom),l.left=_f(c.left,l.left),l},x5(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function jV(t){var e=t.reference,n=t.element,r=t.placement,i=r?Il(r):null,o=r?Hm(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Xo:l={x:s,y:e.y-n.height};break;case ma:l={x:s,y:e.y+e.height};break;case ga:l={x:e.x+e.width,y:a};break;case Ko:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?LI(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case $m:l[u]=l[u]-(e[c]/2-n[c]/2);break;case sy:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function ay(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?Gse:a,u=n.rootBoundary,c=u===void 0?LV:u,d=n.elementContext,f=d===void 0?u0:d,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,b=g===void 0?0:g,m=HV(typeof b!="number"?b:VV(b,ab)),w=f===u0?jse:u0,x=t.rects.popper,_=t.elements[p?w:f],C=Cae(Lf(_)?_:_.contextElement||bd(t.elements.popper),l,c,s),S=Um(t.elements.reference),M=jV({reference:S,element:x,strategy:"absolute",placement:i}),P=cD(Object.assign({},x,M)),A=f===u0?P:S,R={top:C.top-A.top+m.top,bottom:A.bottom-C.bottom+m.bottom,left:C.left-A.left+m.left,right:A.right-C.right+m.right},F=t.modifiersData.offset;if(f===u0&&F){var $=F[i];Object.keys(R).forEach(function(j){var k=[ga,ma].indexOf(j)>=0?1:-1,U=[Xo,ma].indexOf(j)>=0?"y":"x";R[j]+=$[U]*k})}return R}function Eae(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?BV:l,c=Hm(r),d=c?a?g5:g5.filter(function(p){return Hm(p)===c}):ab,f=d.filter(function(p){return u.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,g){return p[g]=ay(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[Il(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function Mae(t){if(Il(t)===FI)return[];var e=Jw(t);return[b5(t),e,b5(e)]}function Tae(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,b=e.options.placement,m=Il(b),w=m===b,x=l||(w||!p?[Jw(b)]:Mae(b)),_=[b].concat(x).reduce(function(ae,ve){return ae.concat(Il(ve)===FI?Eae(e,{placement:ve,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:g}):ve)},[]),C=e.rects.reference,S=e.rects.popper,M=new Map,P=!0,A=_[0],R=0;R<_.length;R++){var F=_[R],$=Il(F),j=Hm(F)===$m,k=[Xo,ma].indexOf($)>=0,U=k?"width":"height",G=ay(e,{placement:F,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),B=k?j?ga:Ko:j?ma:Xo;C[U]>S[U]&&(B=Jw(B));var L=Jw(B),N=[];if(o&&N.push(G[$]<=0),a&&N.push(G[B]<=0,G[L]<=0),N.every(function(ae){return ae})){A=F,P=!1;break}M.set(F,N)}if(P)for(var W=p?3:1,K=function(ve){var fe=_.find(function(Me){var ye=M.get(Me);if(ye)return ye.slice(0,ve).every(function(we){return we})});if(fe)return A=fe,"break"},Q=W;Q>0;Q--){var J=K(Q);if(J==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const Aae={name:"flip",enabled:!0,phase:"main",fn:Tae,requiresIfExists:["offset"],data:{_skip:!1}};function w5(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _5(t){return[Xo,ga,ma,Ko].some(function(e){return t[e]>=0})}function Pae(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ay(e,{elementContext:"reference"}),a=ay(e,{altBoundary:!0}),l=w5(s,r),u=w5(a,i,o),c=_5(l),d=_5(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const Dae={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Pae};function Rae(t,e,n){var r=Il(t),i=[Ko,Xo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Ko,ga].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Iae(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=BV.reduce(function(c,d){return c[d]=Rae(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}const Nae={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Iae};function Fae(t){var e=t.state,n=t.name;e.modifiersData[n]=jV({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Oae={name:"popperOffsets",enabled:!0,phase:"read",fn:Fae,data:{}};function kae(t){return t==="x"?"y":"x"}function Lae(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,g=p===void 0?0:p,b=ay(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),m=Il(e.placement),w=Hm(e.placement),x=!w,_=LI(m),C=kae(_),S=e.modifiersData.popperOffsets,M=e.rects.reference,P=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,R=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(S){if(o){var j,k=_==="y"?Xo:Ko,U=_==="y"?ma:ga,G=_==="y"?"height":"width",B=S[_],L=B+b[k],N=B-b[U],W=h?-P[G]/2:0,K=w===$m?M[G]:P[G],Q=w===$m?-P[G]:-M[G],J=e.elements.arrow,ae=h&&J?kI(J):{width:0,height:0},ve=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:UV(),fe=ve[k],Me=ve[U],ye=hv(0,M[G],ae[G]),we=x?M[G]/2-W-ye-fe-R.mainAxis:K-ye-fe-R.mainAxis,Fe=x?-M[G]/2+W+ye+Me+R.mainAxis:Q+ye+Me+R.mainAxis,Oe=e.elements.arrow&&lb(e.elements.arrow),re=Oe?_==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,_e=(j=F==null?void 0:F[_])!=null?j:0,Ce=B+we-_e-re,X=B+Fe-_e,Z=hv(h?W_(L,Ce):L,B,h?_f(N,X):N);S[_]=Z,$[_]=Z-B}if(a){var he,Y=_==="x"?Xo:Ko,ne=_==="x"?ma:ga,se=S[C],xe=C==="y"?"height":"width",Pe=se+b[Y],z=se-b[ne],H=[Xo,Ko].indexOf(m)!==-1,te=(he=F==null?void 0:F[C])!=null?he:0,le=H?Pe:se-M[xe]-P[xe]-te+R.altAxis,de=H?se+M[xe]+P[xe]-te-R.altAxis:z,ue=h&&H?aae(le,se,de):hv(h?le:Pe,se,h?de:z);S[C]=ue,$[C]=ue-se}e.modifiersData[r]=$}}const Bae={name:"preventOverflow",enabled:!0,phase:"main",fn:Lae,requiresIfExists:["offset"]};function $ae(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function zae(t){return t===Ns(t)||!ua(t)?BI(t):$ae(t)}function Uae(t){var e=t.getBoundingClientRect(),n=zm(e.width)/t.offsetWidth||1,r=zm(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Hae(t,e,n){n===void 0&&(n=!1);var r=ua(e),i=ua(e)&&Uae(e),o=bd(e),s=Um(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(($l(e)!=="body"||zI(o))&&(a=zae(e)),ua(e)?(l=Um(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=$I(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Vae(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function Gae(t){var e=Vae(t);return tae.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function jae(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Wae(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var S5={placement:"bottom",modifiers:[],strategy:"absolute"};function C5(){for(var t=arguments.length,e=new Array(t),n=0;nQe({root:["root"]},Hoe(Yae)),nle={},rle=E.forwardRef(function(e,n){var r;const{anchorEl:i,children:o,direction:s,disablePortal:a,modifiers:l,open:u,placement:c,popperOptions:d,popperRef:f,slotProps:h={},slots:p={},TransitionProps:g}=e,b=Be(e,Zae),m=E.useRef(null),w=An(m,n),x=E.useRef(null),_=An(x,f),C=E.useRef(_);_r(()=>{C.current=_},[_]),E.useImperativeHandle(f,()=>x.current,[]);const S=Jae(c,s),[M,P]=E.useState(S),[A,R]=E.useState(dD(i));E.useEffect(()=>{x.current&&x.current.forceUpdate()}),E.useEffect(()=>{i&&R(dD(i))},[i]),_r(()=>{if(!A||!u)return;const U=L=>{P(L.placement)};let G=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:L})=>{U(L)}}];l!=null&&(G=G.concat(l)),d&&d.modifiers!=null&&(G=G.concat(d.modifiers));const B=Kae(A,m.current,O({placement:S},d,{modifiers:G}));return C.current(B),()=>{B.destroy(),C.current(null)}},[A,a,l,u,d,S]);const F={placement:M};g!==null&&(F.TransitionProps=g);const $=tle(),j=(r=p.root)!=null?r:"div",k=$u({elementType:j,externalSlotProps:h.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:w},ownerState:e,className:$.root});return D.jsx(j,O({},k,{children:typeof o=="function"?o(F):o}))}),ile=E.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:u,open:c,placement:d="bottom",popperOptions:f=nle,popperRef:h,style:p,transition:g=!1,slotProps:b={},slots:m={}}=e,w=Be(e,Qae),[x,_]=E.useState(!0),C=()=>{_(!1)},S=()=>{_(!0)};if(!l&&!c&&(!g||x))return null;let M;if(o)M=o;else if(r){const R=dD(r);M=R&&ele(R)?Sr(R).body:Sr(null).body}const P=!c&&l&&(!g||x)?"none":void 0,A=g?{in:c,onEnter:C,onExited:S}:void 0;return D.jsx(kV,{disablePortal:a,container:M,children:D.jsx(rle,O({anchorEl:r,direction:s,disablePortal:a,modifiers:u,ref:n,open:g?!x:c,placement:d,popperOptions:f,popperRef:h,slotProps:b,slots:m},w,{style:O({position:"fixed",top:0,left:0,display:P},p),TransitionProps:A,children:i}))})}),ole=["onChange","maxRows","minRows","style","value"];function gx(t){return parseInt(t,10)||0}const sle={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function ale(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const lle=E.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a}=e,l=Be(e,ole),{current:u}=E.useRef(a!=null),c=E.useRef(null),d=An(n,c),f=E.useRef(null),h=E.useCallback(()=>{const b=c.current,w=Bl(b).getComputedStyle(b);if(w.width==="0px")return{outerHeightStyle:0,overflowing:!1};const x=f.current;x.style.width=w.width,x.value=b.value||e.placeholder||"x",x.value.slice(-1)===` -`&&(x.value+=" ");const _=w.boxSizing,C=gx(w.paddingBottom)+gx(w.paddingTop),S=gx(w.borderBottomWidth)+gx(w.borderTopWidth),M=x.scrollHeight;x.value="x";const P=x.scrollHeight;let A=M;o&&(A=Math.max(Number(o)*P,A)),i&&(A=Math.min(Number(i)*P,A)),A=Math.max(A,P);const R=A+(_==="border-box"?C+S:0),F=Math.abs(A-M)<=1;return{outerHeightStyle:R,overflowing:F}},[i,o,e.placeholder]),p=E.useCallback(()=>{const b=h();if(ale(b))return;const m=c.current;m.style.height=`${b.outerHeightStyle}px`,m.style.overflow=b.overflowing?"hidden":""},[h]);_r(()=>{const b=()=>{p()};let m;const w=ug(b),x=c.current,_=Bl(x);_.addEventListener("resize",w);let C;return typeof ResizeObserver<"u"&&(C=new ResizeObserver(b),C.observe(x)),()=>{w.clear(),cancelAnimationFrame(m),_.removeEventListener("resize",w),C&&C.disconnect()}},[h,p]),_r(()=>{p()});const g=b=>{u||p(),r&&r(b)};return D.jsxs(E.Fragment,{children:[D.jsx("textarea",O({value:a,onChange:g,ref:d,rows:o,style:s},l)),D.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:O({},sle.shadow,s,{paddingTop:0,paddingBottom:0})})]})});function E5(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function qV(t={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:s=!1}=t;return(a,{inputValue:l,getOptionLabel:u})=>{let c=s?l.trim():l;n&&(c=c.toLowerCase()),e&&(c=E5(c));const d=c?a.filter(f=>{let h=(o||u)(f);return n&&(h=h.toLowerCase()),e&&(h=E5(h)),i==="start"?h.indexOf(c)===0:h.indexOf(c)>-1}):a;return typeof r=="number"?d.slice(0,r):d}}function vx(t,e){for(let n=0;n{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))};function dle(t){const{unstable_isActiveElementInListbox:e=cle,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:s=!1,clearOnBlur:a=!t.freeSolo,clearOnEscape:l=!1,componentName:u="useAutocomplete",defaultValue:c=t.multiple?[]:null,disableClearable:d=!1,disableCloseOnSelect:f=!1,disabled:h,disabledItemsFocusable:p=!1,disableListWrap:g=!1,filterOptions:b=ule,filterSelectedOptions:m=!1,freeSolo:w=!1,getOptionDisabled:x,getOptionKey:_,getOptionLabel:C=qe=>{var Ue;return(Ue=qe.label)!=null?Ue:qe},groupBy:S,handleHomeEndKeys:M=!t.freeSolo,id:P,includeInputInList:A=!1,inputValue:R,isOptionEqualToValue:F=(qe,Ue)=>qe===Ue,multiple:$=!1,onChange:j,onClose:k,onHighlightChange:U,onInputChange:G,onOpen:B,open:L,openOnFocus:N=!1,options:W,readOnly:K=!1,selectOnFocus:Q=!t.freeSolo,value:J}=t,ae=jn(P);let ve=C;ve=qe=>{const Ue=C(qe);return typeof Ue!="string"?String(Ue):Ue};const fe=E.useRef(!1),Me=E.useRef(!0),ye=E.useRef(null),we=E.useRef(null),[Fe,Oe]=E.useState(null),[re,_e]=E.useState(-1),Ce=i?0:-1,X=E.useRef(Ce),[Z,he]=Ru({controlled:J,default:c,name:u}),[Y,ne]=Ru({controlled:R,default:"",name:u,state:"inputValue"}),[se,xe]=E.useState(!1),Pe=E.useCallback((qe,Ue)=>{if(!($?Z.length!(m&&($?Z:[Z]).some(Ue=>Ue!==null&&F(qe,Ue)))),{inputValue:de&&te?"":Y,getOptionLabel:ve}):[],be=SI({filteredOptions:ge,value:Z,inputValue:Y});E.useEffect(()=>{const qe=Z!==be.value;se&&!qe||w&&!qe||Pe(null,Z)},[Z,Pe,se,be.value,w]);const Te=z&&ge.length>0&&!K,Re=ar(qe=>{qe===-1?ye.current.focus():Fe.querySelector(`[data-tag-index="${qe}"]`).focus()});E.useEffect(()=>{$&&re>Z.length-1&&(_e(-1),Re(-1))},[Z,$,re,Re]);function Ve(qe,Ue){if(!we.current||qe<0||qe>=ge.length)return-1;let ee=qe;for(;;){const pe=we.current.querySelector(`[data-option-index="${ee}"]`),Ae=p?!1:!pe||pe.disabled||pe.getAttribute("aria-disabled")==="true";if(pe&&pe.hasAttribute("tabindex")&&!Ae)return ee;if(Ue==="next"?ee=(ee+1)%ge.length:ee=(ee-1+ge.length)%ge.length,ee===qe)return-1}}const Le=ar(({event:qe,index:Ue,reason:ee="auto"})=>{if(X.current=Ue,Ue===-1?ye.current.removeAttribute("aria-activedescendant"):ye.current.setAttribute("aria-activedescendant",`${ae}-option-${Ue}`),U&&U(qe,Ue===-1?null:ge[Ue],ee),!we.current)return;const pe=we.current.querySelector(`[role="option"].${n}-focused`);pe&&(pe.classList.remove(`${n}-focused`),pe.classList.remove(`${n}-focusVisible`));let Ae=we.current;if(we.current.getAttribute("role")!=="listbox"&&(Ae=we.current.parentElement.querySelector('[role="listbox"]')),!Ae)return;if(Ue===-1){Ae.scrollTop=0;return}const Ee=we.current.querySelector(`[data-option-index="${Ue}"]`);if(Ee&&(Ee.classList.add(`${n}-focused`),ee==="keyboard"&&Ee.classList.add(`${n}-focusVisible`),Ae.scrollHeight>Ae.clientHeight&&ee!=="mouse"&&ee!=="touch")){const ke=Ee,at=Ae.clientHeight+Ae.scrollTop,_t=ke.offsetTop+ke.offsetHeight;_t>at?Ae.scrollTop=_t-Ae.clientHeight:ke.offsetTop-ke.offsetHeight*(S?1.3:0){if(!ue)return;const Ee=Ve((()=>{const ke=ge.length-1;if(Ue==="reset")return Ce;if(Ue==="start")return 0;if(Ue==="end")return ke;const at=X.current+Ue;return at<0?at===-1&&A?-1:g&&X.current!==-1||Math.abs(Ue)>1?0:ke:at>ke?at===ke+1&&A?-1:g||Math.abs(Ue)>1?ke:0:at})(),ee);if(Le({index:Ee,reason:pe,event:qe}),r&&Ue!=="reset")if(Ee===-1)ye.current.value=Y;else{const ke=ve(ge[Ee]);ye.current.value=ke,ke.toLowerCase().indexOf(Y.toLowerCase())===0&&Y.length>0&&ye.current.setSelectionRange(Y.length,ke.length)}}),it=()=>{const qe=(Ue,ee)=>{const pe=Ue?ve(Ue):"",Ae=ee?ve(ee):"";return pe===Ae};if(X.current!==-1&&be.filteredOptions&&be.filteredOptions.length!==ge.length&&be.inputValue===Y&&($?Z.length===be.value.length&&be.value.every((Ue,ee)=>ve(Z[ee])===ve(Ue)):qe(be.value,Z))){const Ue=be.filteredOptions[X.current];if(Ue)return vx(ge,ee=>ve(ee)===ve(Ue))}return-1},ot=E.useCallback(()=>{if(!ue)return;const qe=it();if(qe!==-1){X.current=qe;return}const Ue=$?Z[0]:Z;if(ge.length===0||Ue==null){Ye({diff:"reset"});return}if(we.current){if(Ue!=null){const ee=ge[X.current];if($&&ee&&vx(Z,Ae=>F(ee,Ae))!==-1)return;const pe=vx(ge,Ae=>F(Ae,Ue));pe===-1?Ye({diff:"reset"}):Le({index:pe});return}if(X.current>=ge.length-1){Le({index:ge.length-1});return}Le({index:X.current})}},[ge.length,$?!1:Z,m,Ye,Le,ue,Y,$]),ht=ar(qe=>{ry(we,qe),qe&&ot()});E.useEffect(()=>{ot()},[ot]);const Je=qe=>{z||(H(!0),le(!0),B&&B(qe))},Ot=(qe,Ue)=>{z&&(H(!1),k&&k(qe,Ue))},Se=(qe,Ue,ee,pe)=>{if($){if(Z.length===Ue.length&&Z.every((Ae,Ee)=>Ae===Ue[Ee]))return}else if(Z===Ue)return;j&&j(qe,Ue,ee,pe),he(Ue)},st=E.useRef(!1),Ze=(qe,Ue,ee="selectOption",pe="options")=>{let Ae=ee,Ee=Ue;if($){Ee=Array.isArray(Z)?Z.slice():[];const ke=vx(Ee,at=>F(Ue,at));ke===-1?Ee.push(Ue):pe!=="freeSolo"&&(Ee.splice(ke,1),Ae="removeOption")}Pe(qe,Ee),Se(qe,Ee,Ae,{option:Ue}),!f&&(!qe||!qe.ctrlKey&&!qe.metaKey)&&Ot(qe,Ae),(s===!0||s==="touch"&&st.current||s==="mouse"&&!st.current)&&ye.current.blur()};function je(qe,Ue){if(qe===-1)return-1;let ee=qe;for(;;){if(Ue==="next"&&ee===Z.length||Ue==="previous"&&ee===-1)return-1;const pe=Fe.querySelector(`[data-tag-index="${ee}"]`);if(!pe||!pe.hasAttribute("tabindex")||pe.disabled||pe.getAttribute("aria-disabled")==="true")ee+=Ue==="next"?1:-1;else return ee}}const et=(qe,Ue)=>{if(!$)return;Y===""&&Ot(qe,"toggleInput");let ee=re;re===-1?Y===""&&Ue==="previous"&&(ee=Z.length-1):(ee+=Ue==="next"?1:-1,ee<0&&(ee=0),ee===Z.length&&(ee=-1)),ee=je(ee,Ue),_e(ee),Re(ee)},Tt=qe=>{fe.current=!0,ne(""),G&&G(qe,"","clear"),Se(qe,$?[]:null,"clear")},Qt=qe=>Ue=>{if(qe.onKeyDown&&qe.onKeyDown(Ue),!Ue.defaultMuiPrevented&&(re!==-1&&["ArrowLeft","ArrowRight"].indexOf(Ue.key)===-1&&(_e(-1),Re(-1)),Ue.which!==229))switch(Ue.key){case"Home":ue&&M&&(Ue.preventDefault(),Ye({diff:"start",direction:"next",reason:"keyboard",event:Ue}));break;case"End":ue&&M&&(Ue.preventDefault(),Ye({diff:"end",direction:"previous",reason:"keyboard",event:Ue}));break;case"PageUp":Ue.preventDefault(),Ye({diff:-M5,direction:"previous",reason:"keyboard",event:Ue}),Je(Ue);break;case"PageDown":Ue.preventDefault(),Ye({diff:M5,direction:"next",reason:"keyboard",event:Ue}),Je(Ue);break;case"ArrowDown":Ue.preventDefault(),Ye({diff:1,direction:"next",reason:"keyboard",event:Ue}),Je(Ue);break;case"ArrowUp":Ue.preventDefault(),Ye({diff:-1,direction:"previous",reason:"keyboard",event:Ue}),Je(Ue);break;case"ArrowLeft":et(Ue,"previous");break;case"ArrowRight":et(Ue,"next");break;case"Enter":if(X.current!==-1&&ue){const ee=ge[X.current],pe=x?x(ee):!1;if(Ue.preventDefault(),pe)return;Ze(Ue,ee,"selectOption"),r&&ye.current.setSelectionRange(ye.current.value.length,ye.current.value.length)}else w&&Y!==""&&de===!1&&($&&Ue.preventDefault(),Ze(Ue,Y,"createOption","freeSolo"));break;case"Escape":ue?(Ue.preventDefault(),Ue.stopPropagation(),Ot(Ue,"escape")):l&&(Y!==""||$&&Z.length>0)&&(Ue.preventDefault(),Ue.stopPropagation(),Tt(Ue));break;case"Backspace":if($&&!K&&Y===""&&Z.length>0){const ee=re===-1?Z.length-1:re,pe=Z.slice();pe.splice(ee,1),Se(Ue,pe,"removeOption",{option:Z[ee]})}break;case"Delete":if($&&!K&&Y===""&&Z.length>0&&re!==-1){const ee=re,pe=Z.slice();pe.splice(ee,1),Se(Ue,pe,"removeOption",{option:Z[ee]})}break}},Fn=qe=>{xe(!0),N&&!fe.current&&Je(qe)},Vn=qe=>{if(e(we)){ye.current.focus();return}xe(!1),Me.current=!0,fe.current=!1,o&&X.current!==-1&&ue?Ze(qe,ge[X.current],"blur"):o&&w&&Y!==""?Ze(qe,Y,"blur","freeSolo"):a&&Pe(qe,Z),Ot(qe,"blur")},Ut=qe=>{const Ue=qe.target.value;Y!==Ue&&(ne(Ue),le(!1),G&&G(qe,Ue,"input")),Ue===""?!d&&!$&&Se(qe,null,"clear"):Je(qe)},Wt=qe=>{const Ue=Number(qe.currentTarget.getAttribute("data-option-index"));X.current!==Ue&&Le({event:qe,index:Ue,reason:"mouse"})},On=qe=>{Le({event:qe,index:Number(qe.currentTarget.getAttribute("data-option-index")),reason:"touch"}),st.current=!0},Er=qe=>{const Ue=Number(qe.currentTarget.getAttribute("data-option-index"));Ze(qe,ge[Ue],"selectOption"),st.current=!1},Ii=qe=>Ue=>{const ee=Z.slice();ee.splice(qe,1),Se(Ue,ee,"removeOption",{option:Z[qe]})},Io=qe=>{z?Ot(qe,"toggleInput"):Je(qe)},jr=qe=>{qe.currentTarget.contains(qe.target)&&qe.target.getAttribute("id")!==ae&&qe.preventDefault()},Ni=qe=>{qe.currentTarget.contains(qe.target)&&(ye.current.focus(),Q&&Me.current&&ye.current.selectionEnd-ye.current.selectionStart===0&&ye.current.select(),Me.current=!1)},co=qe=>{!h&&(Y===""||!z)&&Io(qe)};let Fi=w&&Y.length>0;Fi=Fi||($?Z.length>0:Z!==null);let fo=ge;return S&&(fo=ge.reduce((qe,Ue,ee)=>{const pe=S(Ue);return qe.length>0&&qe[qe.length-1].group===pe?qe[qe.length-1].options.push(Ue):qe.push({key:ee,index:ee,group:pe,options:[Ue]}),qe},[])),h&&se&&Vn(),{getRootProps:(qe={})=>O({"aria-owns":Te?`${ae}-listbox`:null},qe,{onKeyDown:Qt(qe),onMouseDown:jr,onClick:Ni}),getInputLabelProps:()=>({id:`${ae}-label`,htmlFor:ae}),getInputProps:()=>({id:ae,value:Y,onBlur:Vn,onFocus:Fn,onChange:Ut,onMouseDown:co,"aria-activedescendant":ue?"":null,"aria-autocomplete":r?"both":"list","aria-controls":Te?`${ae}-listbox`:void 0,"aria-expanded":Te,autoComplete:"off",ref:ye,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:h}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Tt}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Io}),getTagProps:({index:qe})=>O({key:qe,"data-tag-index":qe,tabIndex:-1},!K&&{onDelete:Ii(qe)}),getListboxProps:()=>({role:"listbox",id:`${ae}-listbox`,"aria-labelledby":`${ae}-label`,ref:ht,onMouseDown:qe=>{qe.preventDefault()}}),getOptionProps:({index:qe,option:Ue})=>{var ee;const pe=($?Z:[Z]).some(Ee=>Ee!=null&&F(Ue,Ee)),Ae=x?x(Ue):!1;return{key:(ee=_==null?void 0:_(Ue))!=null?ee:ve(Ue),tabIndex:-1,role:"option",id:`${ae}-option-${qe}`,onMouseMove:Wt,onClick:Er,onTouchStart:On,"data-option-index":qe,"aria-disabled":Ae,"aria-selected":pe}},id:ae,inputValue:Y,value:Z,dirty:Fi,expanded:ue&&Fe,popupOpen:ue,focused:se||re!==-1,anchorEl:Fe,setAnchorEl:Oe,focusedTag:re,groupedOptions:fo}}var UI={};Object.defineProperty(UI,"__esModule",{value:!0});var XV=UI.default=void 0,fle=ple(E),hle=TV;function KV(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(KV=function(r){return r?n:e})(t)}function ple(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=KV(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function mle(t){return Object.keys(t).length===0}function gle(t=null){const e=fle.useContext(hle.ThemeContext);return!e||mle(e)?t:e}XV=UI.default=gle;const vle=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],yle=ze(ile,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Yf=E.forwardRef(function(e,n){var r;const i=XV(),o=kt({props:e,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:u,container:c,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:g,popperOptions:b,popperRef:m,transition:w,slots:x,slotProps:_}=o,C=Be(o,vle),S=(r=x==null?void 0:x.root)!=null?r:l==null?void 0:l.Root,M=O({anchorEl:s,container:c,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:g,popperOptions:b,popperRef:m,transition:w},C);return D.jsx(yle,O({as:a,direction:i==null?void 0:i.direction,slots:{root:S},slotProps:_??u},M,{ref:n}))});function ble(t){return It("MuiListSubheader",t)}At("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const xle=["className","color","component","disableGutters","disableSticky","inset"],wle=t=>{const{classes:e,color:n,disableGutters:r,inset:i,disableSticky:o}=t,s={root:["root",n!=="default"&&`color${Ge(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return Qe(s,ble,e)},_le=ze("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Ge(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(({theme:t,ownerState:e})=>O({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},e.color==="primary"&&{color:(t.vars||t).palette.primary.main},e.color==="inherit"&&{color:"inherit"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.inset&&{paddingLeft:72},!e.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),YV=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiListSubheader"}),{className:i,color:o="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:u=!1}=r,c=Be(r,xle),d=O({},r,{color:o,component:s,disableGutters:a,disableSticky:l,inset:u}),f=wle(d);return D.jsx(_le,O({as:s,className:nt(f.root,i),ref:n,ownerState:d},c))});YV.muiSkipListHighlight=!0;const Sle=mn(D.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Cle(t){return It("MuiChip",t)}const Mn=At("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Ele=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],Mle=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=t,u={root:["root",l,n&&"disabled",`size${Ge(r)}`,`color${Ge(i)}`,a&&"clickable",a&&`clickableColor${Ge(i)}`,s&&"deletable",s&&`deletableColor${Ge(i)}`,`${l}${Ge(i)}`],label:["label",`label${Ge(r)}`],avatar:["avatar",`avatar${Ge(r)}`,`avatarColor${Ge(i)}`],icon:["icon",`icon${Ge(r)}`,`iconColor${Ge(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Ge(r)}`,`deleteIconColor${Ge(i)}`,`deleteIcon${Ge(l)}Color${Ge(i)}`]};return Qe(u,Cle,e)},Tle=ze("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${Mn.avatar}`]:e.avatar},{[`& .${Mn.avatar}`]:e[`avatar${Ge(a)}`]},{[`& .${Mn.avatar}`]:e[`avatarColor${Ge(r)}`]},{[`& .${Mn.icon}`]:e.icon},{[`& .${Mn.icon}`]:e[`icon${Ge(a)}`]},{[`& .${Mn.icon}`]:e[`iconColor${Ge(i)}`]},{[`& .${Mn.deleteIcon}`]:e.deleteIcon},{[`& .${Mn.deleteIcon}`]:e[`deleteIcon${Ge(a)}`]},{[`& .${Mn.deleteIcon}`]:e[`deleteIconColor${Ge(r)}`]},{[`& .${Mn.deleteIcon}`]:e[`deleteIcon${Ge(l)}Color${Ge(r)}`]},e.root,e[`size${Ge(a)}`],e[`color${Ge(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${Ge(r)})`],s&&e.deletable,s&&r!=="default"&&e[`deletableColor${Ge(r)}`],e[l],e[`${l}${Ge(r)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return O({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Mn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Mn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:n,fontSize:t.typography.pxToRem(12)},[`& .${Mn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${Mn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${Mn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${Mn.icon}`]:O({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&O({color:t.vars?t.vars.palette.Chip.defaultIconColor:n},e.color!=="default"&&{color:"inherit"})),[`& .${Mn.deleteIcon}`]:O({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:fn(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:fn(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:fn(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${Mn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${Mn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>O({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${Mn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${Mn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>O({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${Mn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Mn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${Mn.avatar}`]:{marginLeft:4},[`& .${Mn.avatarSmall}`]:{marginLeft:2},[`& .${Mn.icon}`]:{marginLeft:4},[`& .${Mn.iconSmall}`]:{marginLeft:2},[`& .${Mn.deleteIcon}`]:{marginRight:5},[`& .${Mn.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:fn(t.palette[e.color].main,.7)}`,[`&.${Mn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${Mn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:fn(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${Mn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:fn(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),Ale=ze("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${Ge(r)}`]]}})(({ownerState:t})=>O({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function T5(t){return t.key==="Backspace"||t.key==="Delete"}const HI=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:u,disabled:c=!1,icon:d,label:f,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:b,size:m="medium",variant:w="filled",tabIndex:x,skipFocusWhenDisabled:_=!1}=r,C=Be(r,Ele),S=E.useRef(null),M=An(S,n),P=N=>{N.stopPropagation(),p&&p(N)},A=N=>{N.currentTarget===N.target&&T5(N)&&N.preventDefault(),g&&g(N)},R=N=>{N.currentTarget===N.target&&(p&&T5(N)?p(N):N.key==="Escape"&&S.current&&S.current.blur()),b&&b(N)},F=s!==!1&&h?!0:s,$=F||p?Bm:l||"div",j=O({},r,{component:$,disabled:c,size:m,color:a,iconColor:E.isValidElement(d)&&d.props.color||a,onDelete:!!p,clickable:F,variant:w}),k=Mle(j),U=$===Bm?O({component:l||"div",focusVisibleClassName:k.focusVisible},p&&{disableRipple:!0}):{};let G=null;p&&(G=u&&E.isValidElement(u)?E.cloneElement(u,{className:nt(u.props.className,k.deleteIcon),onClick:P}):D.jsx(Sle,{className:nt(k.deleteIcon),onClick:P}));let B=null;i&&E.isValidElement(i)&&(B=E.cloneElement(i,{className:nt(k.avatar,i.props.className)}));let L=null;return d&&E.isValidElement(d)&&(L=E.cloneElement(d,{className:nt(k.icon,d.props.className)})),D.jsxs(Tle,O({as:$,className:nt(k.root,o),disabled:F&&c?!0:void 0,onClick:h,onKeyDown:A,onKeyUp:R,ref:M,tabIndex:_&&c?-1:x,ownerState:j},U,C,{children:[B||L,D.jsx(Ale,{className:nt(k.label),ownerState:j,children:f}),G]}))});function xd({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const eE=E.createContext(void 0);function Wl(){return E.useContext(eE)}function ZV(t){return D.jsx(Ere,O({},t,{defaultTheme:ZC,themeId:Qy}))}function A5(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function q_(t,e=!1){return t&&(A5(t.value)&&t.value!==""||e&&A5(t.defaultValue)&&t.defaultValue!=="")}function Ple(t){return t.startAdornment}function Dle(t){return It("MuiInputBase",t)}const vs=At("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Rle=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],tE=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${Ge(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},nE=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},Ile=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:u,multiline:c,readOnly:d,size:f,startAdornment:h,type:p}=t,g={root:["root",`color${Ge(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",f&&f!=="medium"&&`size${Ge(f)}`,c&&"multiline",h&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel",d&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",c&&"inputMultiline",f==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",d&&"readOnly"]};return Qe(g,Dle,e)},rE=ze("div",{name:"MuiInputBase",slot:"Root",overridesResolver:tE})(({theme:t,ownerState:e})=>O({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${vs.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&O({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),iE=ze("input",{name:"MuiInputBase",slot:"Input",overridesResolver:nE})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=O({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return O({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${vs.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${vs.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),Nle=D.jsx(ZV,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),Fle=E.forwardRef(function(e,n){var r;const i=kt({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:s,autoFocus:a,className:l,components:u={},componentsProps:c={},defaultValue:d,disabled:f,disableInjectingGlobalStyles:h,endAdornment:p,fullWidth:g=!1,id:b,inputComponent:m="input",inputProps:w={},inputRef:x,maxRows:_,minRows:C,multiline:S=!1,name:M,onBlur:P,onChange:A,onClick:R,onFocus:F,onKeyDown:$,onKeyUp:j,placeholder:k,readOnly:U,renderSuffix:G,rows:B,slotProps:L={},slots:N={},startAdornment:W,type:K="text",value:Q}=i,J=Be(i,Rle),ae=w.value!=null?w.value:Q,{current:ve}=E.useRef(ae!=null),fe=E.useRef(),Me=E.useCallback(ue=>{},[]),ye=An(fe,x,w.ref,Me),[we,Fe]=E.useState(!1),Oe=Wl(),re=xd({props:i,muiFormControl:Oe,states:["color","disabled","error","hiddenLabel","size","required","filled"]});re.focused=Oe?Oe.focused:we,E.useEffect(()=>{!Oe&&f&&we&&(Fe(!1),P&&P())},[Oe,f,we,P]);const _e=Oe&&Oe.onFilled,Ce=Oe&&Oe.onEmpty,X=E.useCallback(ue=>{q_(ue)?_e&&_e():Ce&&Ce()},[_e,Ce]);_r(()=>{ve&&X({value:ae})},[ae,X,ve]);const Z=ue=>{if(re.disabled){ue.stopPropagation();return}F&&F(ue),w.onFocus&&w.onFocus(ue),Oe&&Oe.onFocus?Oe.onFocus(ue):Fe(!0)},he=ue=>{P&&P(ue),w.onBlur&&w.onBlur(ue),Oe&&Oe.onBlur?Oe.onBlur(ue):Fe(!1)},Y=(ue,...ge)=>{if(!ve){const be=ue.target||fe.current;if(be==null)throw new Error(Bu(1));X({value:be.value})}w.onChange&&w.onChange(ue,...ge),A&&A(ue,...ge)};E.useEffect(()=>{X(fe.current)},[]);const ne=ue=>{fe.current&&ue.currentTarget===ue.target&&fe.current.focus(),R&&R(ue)};let se=m,xe=w;S&&se==="input"&&(B?xe=O({type:void 0,minRows:B,maxRows:B},xe):xe=O({type:void 0,maxRows:_,minRows:C},xe),se=lle);const Pe=ue=>{X(ue.animationName==="mui-auto-fill-cancel"?fe.current:{value:"x"})};E.useEffect(()=>{Oe&&Oe.setAdornedStart(!!W)},[Oe,W]);const z=O({},i,{color:re.color||"primary",disabled:re.disabled,endAdornment:p,error:re.error,focused:re.focused,formControl:Oe,fullWidth:g,hiddenLabel:re.hiddenLabel,multiline:S,size:re.size,startAdornment:W,type:K}),H=Ile(z),te=N.root||u.Root||rE,le=L.root||c.root||{},de=N.input||u.Input||iE;return xe=O({},xe,(r=L.input)!=null?r:c.input),D.jsxs(E.Fragment,{children:[!h&&Nle,D.jsxs(te,O({},le,!oy(te)&&{ownerState:O({},z,le.ownerState)},{ref:n,onClick:ne},J,{className:nt(H.root,le.className,l,U&&"MuiInputBase-readOnly"),children:[W,D.jsx(eE.Provider,{value:null,children:D.jsx(de,O({ownerState:z,"aria-invalid":re.error,"aria-describedby":o,autoComplete:s,autoFocus:a,defaultValue:d,disabled:re.disabled,id:b,onAnimationStart:Pe,name:M,placeholder:k,readOnly:U,required:re.required,rows:B,value:ae,onKeyDown:$,onKeyUp:j,type:K},xe,!oy(de)&&{as:se,ownerState:O({},z,xe.ownerState)},{ref:ye,className:nt(H.input,xe.className,U&&"MuiInputBase-readOnly"),onBlur:he,onChange:Y,onFocus:Z}))}),p,G?G(O({},re,{startAdornment:W})):null]}))]})}),fg=Fle;function Ole(t){return It("MuiInput",t)}const Ic=O({},vs,At("MuiInput",["root","underline","input"]));function kle(t){return It("MuiOutlinedInput",t)}const vl=O({},vs,At("MuiOutlinedInput",["root","notchedOutline","input"]));function Lle(t){return It("MuiFilledInput",t)}const ys=O({},vs,At("MuiFilledInput",["root","underline","input"])),QV=mn(D.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Ble(t){return It("MuiAutocomplete",t)}const sn=At("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var P5,D5;const $le=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],zle=["ref"],Ule=DI(),Hle=t=>{const{classes:e,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:u,size:c}=t,d={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Ge(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Qe(d,Ble,e)},Vle=ze("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:s,size:a}=n;return[{[`& .${sn.tag}`]:e.tag},{[`& .${sn.tag}`]:e[`tagSize${Ge(a)}`]},{[`& .${sn.inputRoot}`]:e.inputRoot},{[`& .${sn.input}`]:e.input},{[`& .${sn.input}`]:s&&e.inputFocused},e.root,r&&e.fullWidth,o&&e.hasPopupIcon,i&&e.hasClearIcon]}})({[`&.${sn.focused} .${sn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${sn.clearIndicator}`]:{visibility:"visible"}},[`& .${sn.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${sn.inputRoot}`]:{flexWrap:"wrap",[`.${sn.hasPopupIcon}&, .${sn.hasClearIcon}&`]:{paddingRight:30},[`.${sn.hasPopupIcon}.${sn.hasClearIcon}&`]:{paddingRight:56},[`& .${sn.input}`]:{width:0,minWidth:30}},[`& .${Ic.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Ic.root}.${vs.sizeSmall}`]:{[`& .${Ic.input}`]:{padding:"2px 4px 3px 0"}},[`& .${vl.root}`]:{padding:9,[`.${sn.hasPopupIcon}&, .${sn.hasClearIcon}&`]:{paddingRight:39},[`.${sn.hasPopupIcon}.${sn.hasClearIcon}&`]:{paddingRight:65},[`& .${sn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${sn.endAdornment}`]:{right:9}},[`& .${vl.root}.${vs.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${sn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${ys.root}`]:{paddingTop:19,paddingLeft:8,[`.${sn.hasPopupIcon}&, .${sn.hasClearIcon}&`]:{paddingRight:39},[`.${sn.hasPopupIcon}.${sn.hasClearIcon}&`]:{paddingRight:65},[`& .${ys.input}`]:{padding:"7px 4px"},[`& .${sn.endAdornment}`]:{right:9}},[`& .${ys.root}.${vs.sizeSmall}`]:{paddingBottom:1,[`& .${ys.input}`]:{padding:"2.5px 4px"}},[`& .${vs.hiddenLabel}`]:{paddingTop:8},[`& .${ys.root}.${vs.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${sn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${ys.root}.${vs.hiddenLabel}.${vs.sizeSmall}`]:{[`& .${sn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${sn.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${sn.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${sn.input}`]:{opacity:1}}}]}),Gle=ze("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,e)=>e.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),jle=ze(io,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),Wle=ze(io,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},e)=>O({},e.popupIndicator,t.popupOpen&&e.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),qle=ze(Yf,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${sn.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),Xle=ze(Xu,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>O({},t.typography.body1,{overflow:"auto"})),Kle=ze("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Yle=ze("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Zle=ze("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${sn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${sn.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${sn.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${sn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),Qle=ze(YV,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,e)=>e.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),Jle=ze("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,e)=>e.groupUl})({padding:0,[`& .${sn.option}`]:{paddingLeft:24}}),ly=E.forwardRef(function(e,n){var r,i,o,s;const a=Ule({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:u=!1,autoSelect:c=!1,blurOnSelect:d=!1,ChipProps:f,className:h,clearIcon:p=P5||(P5=D.jsx(dse,{fontSize:"small"})),clearOnBlur:g=!a.freeSolo,clearOnEscape:b=!1,clearText:m="Clear",closeText:w="Close",componentsProps:x={},defaultValue:_=a.multiple?[]:null,disableClearable:C=!1,disableCloseOnSelect:S=!1,disabled:M=!1,disabledItemsFocusable:P=!1,disableListWrap:A=!1,disablePortal:R=!1,filterSelectedOptions:F=!1,forcePopupIcon:$="auto",freeSolo:j=!1,fullWidth:k=!1,getLimitTagsText:U=pe=>`+${pe}`,getOptionLabel:G,groupBy:B,handleHomeEndKeys:L=!a.freeSolo,includeInputInList:N=!1,limitTags:W=-1,ListboxComponent:K="ul",ListboxProps:Q,loading:J=!1,loadingText:ae="Loading…",multiple:ve=!1,noOptionsText:fe="No options",openOnFocus:Me=!1,openText:ye="Open",PaperComponent:we=Xu,PopperComponent:Fe=Yf,popupIcon:Oe=D5||(D5=D.jsx(QV,{})),readOnly:re=!1,renderGroup:_e,renderInput:Ce,renderOption:X,renderTags:Z,selectOnFocus:he=!a.freeSolo,size:Y="medium",slotProps:ne={}}=a,se=Be(a,$le),{getRootProps:xe,getInputProps:Pe,getInputLabelProps:z,getPopupIndicatorProps:H,getClearProps:te,getTagProps:le,getListboxProps:de,getOptionProps:ue,value:ge,dirty:be,expanded:Te,id:Re,popupOpen:Ve,focused:Le,focusedTag:Ye,anchorEl:it,setAnchorEl:ot,inputValue:ht,groupedOptions:Je}=dle(O({},a,{componentName:"Autocomplete"})),Ot=!C&&!M&&be&&!re,Se=(!j||$===!0)&&$!==!1,{onMouseDown:st}=Pe(),{ref:Ze}=Q??{},je=de(),{ref:et}=je,Tt=Be(je,zle),Qt=An(et,Ze),Vn=G||(pe=>{var Ae;return(Ae=pe.label)!=null?Ae:pe}),Ut=O({},a,{disablePortal:R,expanded:Te,focused:Le,fullWidth:k,getOptionLabel:Vn,hasClearIcon:Ot,hasPopupIcon:Se,inputFocused:Ye===-1,popupOpen:Ve,size:Y}),Wt=Hle(Ut);let On;if(ve&&ge.length>0){const pe=Ae=>O({className:Wt.tag,disabled:M},le(Ae));Z?On=Z(ge,pe,Ut):On=ge.map((Ae,Ee)=>D.jsx(HI,O({label:Vn(Ae),size:Y},pe({index:Ee}),f)))}if(W>-1&&Array.isArray(On)){const pe=On.length-W;!Le&&pe>0&&(On=On.splice(0,W),On.push(D.jsx("span",{className:Wt.tag,children:U(pe)},On.length)))}const Ii=_e||(pe=>D.jsxs("li",{children:[D.jsx(Qle,{className:Wt.groupLabel,ownerState:Ut,component:"div",children:pe.group}),D.jsx(Jle,{className:Wt.groupUl,ownerState:Ut,children:pe.children})]},pe.key)),jr=X||((pe,Ae)=>E.createElement("li",O({},pe,{key:pe.key}),Vn(Ae))),Ni=(pe,Ae)=>{const Ee=ue({option:pe,index:Ae});return jr(O({},Ee,{className:Wt.option}),pe,{selected:Ee["aria-selected"],index:Ae,inputValue:ht},Ut)},co=(r=ne.clearIndicator)!=null?r:x.clearIndicator,Fi=(i=ne.paper)!=null?i:x.paper,fo=(o=ne.popper)!=null?o:x.popper,qe=(s=ne.popupIndicator)!=null?s:x.popupIndicator,Ue=pe=>D.jsx(qle,O({as:Fe,disablePortal:R,style:{width:it?it.clientWidth:null},ownerState:Ut,role:"presentation",anchorEl:it,open:Ve},fo,{className:nt(Wt.popper,fo==null?void 0:fo.className),children:D.jsx(Xle,O({ownerState:Ut,as:we},Fi,{className:nt(Wt.paper,Fi==null?void 0:Fi.className),children:pe}))}));let ee=null;return Je.length>0?ee=Ue(D.jsx(Zle,O({as:K,className:Wt.listbox,ownerState:Ut},Tt,Q,{ref:Qt,children:Je.map((pe,Ae)=>B?Ii({key:pe.key,group:pe.group,children:pe.options.map((Ee,ke)=>Ni(Ee,pe.index+ke))}):Ni(pe,Ae))}))):J&&Je.length===0?ee=Ue(D.jsx(Kle,{className:Wt.loading,ownerState:Ut,children:ae})):Je.length===0&&!j&&!J&&(ee=Ue(D.jsx(Yle,{className:Wt.noOptions,ownerState:Ut,role:"presentation",onMouseDown:pe=>{pe.preventDefault()},children:fe}))),D.jsxs(E.Fragment,{children:[D.jsx(Vle,O({ref:n,className:nt(Wt.root,h),ownerState:Ut},xe(se),{children:Ce({id:Re,disabled:M,fullWidth:!0,size:Y==="small"?"small":void 0,InputLabelProps:z(),InputProps:O({ref:ot,className:Wt.inputRoot,startAdornment:On,onClick:pe=>{pe.target===pe.currentTarget&&st(pe)}},(Ot||Se)&&{endAdornment:D.jsxs(Gle,{className:Wt.endAdornment,ownerState:Ut,children:[Ot?D.jsx(jle,O({},te(),{"aria-label":m,title:m,ownerState:Ut},co,{className:nt(Wt.clearIndicator,co==null?void 0:co.className),children:p})):null,Se?D.jsx(Wle,O({},H(),{disabled:M,"aria-label":Ve?w:ye,title:Ve?w:ye,ownerState:Ut},qe,{className:nt(Wt.popupIndicator,qe==null?void 0:qe.className),children:Oe})):null]})}),inputProps:O({className:Wt.input,disabled:M,readOnly:re},Pe())})})),it?ee:null]})}),eue=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],tue={entering:{opacity:1},entered:{opacity:1}},JV=E.forwardRef(function(e,n){const r=ob(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:u,onEnter:c,onEntered:d,onEntering:f,onExit:h,onExited:p,onExiting:g,style:b,timeout:m=i,TransitionComponent:w=jl}=e,x=Be(e,eue),_=E.useRef(null),C=An(_,a.ref,n),S=k=>U=>{if(k){const G=_.current;U===void 0?k(G):k(G,U)}},M=S(f),P=S((k,U)=>{DV(k);const G=j_({style:b,timeout:m,easing:l},{mode:"enter"});k.style.webkitTransition=r.transitions.create("opacity",G),k.style.transition=r.transitions.create("opacity",G),c&&c(k,U)}),A=S(d),R=S(g),F=S(k=>{const U=j_({style:b,timeout:m,easing:l},{mode:"exit"});k.style.webkitTransition=r.transitions.create("opacity",U),k.style.transition=r.transitions.create("opacity",U),h&&h(k)}),$=S(p),j=k=>{o&&o(_.current,k)};return D.jsx(w,O({appear:s,in:u,nodeRef:_,onEnter:P,onEntered:A,onEntering:M,onExit:F,onExited:$,onExiting:R,addEndListener:j,timeout:m},x,{children:(k,U)=>E.cloneElement(a,O({style:O({opacity:0,visibility:k==="exited"&&!u?"hidden":void 0},tue[k],b,a.props.style),ref:C},U))}))});function nue(t){return It("MuiBackdrop",t)}At("MuiBackdrop",["root","invisible"]);const rue=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],iue=t=>{const{classes:e,invisible:n}=t;return Qe({root:["root",n&&"invisible"]},nue,e)},oue=ze("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>O({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),eG=E.forwardRef(function(e,n){var r,i,o;const s=kt({props:e,name:"MuiBackdrop"}),{children:a,className:l,component:u="div",components:c={},componentsProps:d={},invisible:f=!1,open:h,slotProps:p={},slots:g={},TransitionComponent:b=JV,transitionDuration:m}=s,w=Be(s,rue),x=O({},s,{component:u,invisible:f}),_=iue(x),C=(r=p.root)!=null?r:d.root;return D.jsx(b,O({in:h,timeout:m},w,{children:D.jsx(oue,O({"aria-hidden":!0},C,{as:(i=(o=g.root)!=null?o:c.Root)!=null?i:u,className:nt(_.root,l,C==null?void 0:C.className),ownerState:O({},x,C==null?void 0:C.ownerState),classes:_,ref:n,children:a}))}))});function sue(t){return It("MuiBadge",t)}const uc=At("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),aue=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],fT=10,hT=4,lue=DI(),uue=t=>{const{color:e,anchorOrigin:n,invisible:r,overlap:i,variant:o,classes:s={}}=t,a={root:["root"],badge:["badge",o,r&&"invisible",`anchorOrigin${Ge(n.vertical)}${Ge(n.horizontal)}`,`anchorOrigin${Ge(n.vertical)}${Ge(n.horizontal)}${Ge(i)}`,`overlap${Ge(i)}`,e!=="default"&&`color${Ge(e)}`]};return Qe(a,sue,s)},cue=ze("span",{name:"MuiBadge",slot:"Root",overridesResolver:(t,e)=>e.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),due=ze("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.badge,e[n.variant],e[`anchorOrigin${Ge(n.anchorOrigin.vertical)}${Ge(n.anchorOrigin.horizontal)}${Ge(n.overlap)}`],n.color!=="default"&&e[`color${Ge(n.color)}`],n.invisible&&e.invisible]}})(({theme:t})=>{var e;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(12),minWidth:fT*2,lineHeight:1,padding:"0 6px",height:fT*2,borderRadius:fT,zIndex:1,transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.enteringScreen}),variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r,i;return((r=t.vars)!=null?r:t).palette[n].main&&((i=t.vars)!=null?i:t).palette[n].contrastText}).map(n=>({props:{color:n},style:{backgroundColor:(t.vars||t).palette[n].main,color:(t.vars||t).palette[n].contrastText}})),{props:{variant:"dot"},style:{borderRadius:hT,height:hT*2,minWidth:hT*2,padding:0}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.leavingScreen})}}]}}),VI=E.forwardRef(function(e,n){var r,i,o,s,a,l;const u=lue({props:e,name:"MuiBadge"}),{anchorOrigin:c={vertical:"top",horizontal:"right"},className:d,component:f,components:h={},componentsProps:p={},children:g,overlap:b="rectangular",color:m="default",invisible:w=!1,max:x=99,badgeContent:_,slots:C,slotProps:S,showZero:M=!1,variant:P="standard"}=u,A=Be(u,aue),{badgeContent:R,invisible:F,max:$,displayValue:j}=Sse({max:x,invisible:w,badgeContent:_,showZero:M}),k=SI({anchorOrigin:c,color:m,overlap:b,variant:P,badgeContent:_}),U=F||R==null&&P!=="dot",{color:G=m,overlap:B=b,anchorOrigin:L=c,variant:N=P}=U?k:u,W=N!=="dot"?j:void 0,K=O({},u,{badgeContent:R,invisible:U,max:$,displayValue:W,showZero:M,anchorOrigin:L,color:G,overlap:B,variant:N}),Q=uue(K),J=(r=(i=C==null?void 0:C.root)!=null?i:h.Root)!=null?r:cue,ae=(o=(s=C==null?void 0:C.badge)!=null?s:h.Badge)!=null?o:due,ve=(a=S==null?void 0:S.root)!=null?a:p.root,fe=(l=S==null?void 0:S.badge)!=null?l:p.badge,Me=$u({elementType:J,externalSlotProps:ve,externalForwardedProps:A,additionalProps:{ref:n,as:f},ownerState:K,className:nt(ve==null?void 0:ve.className,Q.root,d)}),ye=$u({elementType:ae,externalSlotProps:fe,ownerState:K,className:nt(Q.badge,fe==null?void 0:fe.className)});return D.jsxs(J,O({},Me,{children:[g,D.jsx(ae,O({},ye,{children:W}))]}))}),fue=At("MuiBox",["root"]),hue=MV(),pue=Rre({themeId:Qy,defaultTheme:hue,defaultClassName:fue.root,generateClassName:pI.generate});function mue(t){return It("MuiButton",t)}const yx=At("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),gue=E.createContext({}),vue=E.createContext(void 0),yue=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],bue=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${Ge(e)}`,`size${Ge(i)}`,`${o}Size${Ge(i)}`,`color${Ge(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Ge(i)}`],endIcon:["icon","endIcon",`iconSize${Ge(i)}`]},l=Qe(a,mue,s);return O({},s,l)},tG=t=>O({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),xue=ze(Bm,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Ge(n.color)}`],e[`size${Ge(n.size)}`],e[`${n.variant}Size${Ge(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],o=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return O({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":O({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":O({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${yx.focusVisible}`]:O({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${yx.disabled}`]:O({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${fn(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${yx.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${yx.disabled}`]:{boxShadow:"none"}}),wue=ze("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${Ge(n.size)}`]]}})(({ownerState:t})=>O({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},tG(t))),_ue=ze("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${Ge(n.size)}`]]}})(({ownerState:t})=>O({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},tG(t))),Bf=E.forwardRef(function(e,n){const r=E.useContext(gue),i=E.useContext(vue),o=vI(r,e),s=kt({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:u="button",className:c,disabled:d=!1,disableElevation:f=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:b=!1,size:m="medium",startIcon:w,type:x,variant:_="text"}=s,C=Be(s,yue),S=O({},s,{color:l,component:u,disabled:d,disableElevation:f,disableFocusRipple:h,fullWidth:b,size:m,type:x,variant:_}),M=bue(S),P=w&&D.jsx(wue,{className:M.startIcon,ownerState:S,children:w}),A=p&&D.jsx(_ue,{className:M.endIcon,ownerState:S,children:p}),R=i||"";return D.jsxs(xue,O({ownerState:S,className:nt(r.className,M.root,c,R),component:u,disabled:d,focusRipple:!h,focusVisibleClassName:nt(M.focusVisible,g),ref:n,type:x},C,{classes:M,children:[P,a,A]}))});function Sue(t){return It("MuiCard",t)}At("MuiCard",["root"]);const Cue=["className","raised"],Eue=t=>{const{classes:e}=t;return Qe({root:["root"]},Sue,e)},Mue=ze(Xu,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),xu=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,s=Be(r,Cue),a=O({},r,{raised:o}),l=Eue(a);return D.jsx(Mue,O({className:nt(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a},s))});function Tue(t){return It("MuiCardContent",t)}At("MuiCardContent",["root"]);const Aue=["className","component"],Pue=t=>{const{classes:e}=t;return Qe({root:["root"]},Tue,e)},Due=ze("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),GI=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,s=Be(r,Aue),a=O({},r,{component:o}),l=Pue(a);return D.jsx(Due,O({as:o,className:nt(l.root,i),ownerState:a,ref:n},s))});function Rue(t){return It("PrivateSwitchBase",t)}At("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Iue=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Nue=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Ge(i)}`],input:["input"]};return Qe(o,Rue,e)},Fue=ze(Bm)(({ownerState:t})=>O({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),Oue=ze("input",{shouldForwardProp:uo})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),jI=E.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:u=!1,edge:c=!1,icon:d,id:f,inputProps:h,inputRef:p,name:g,onBlur:b,onChange:m,onFocus:w,readOnly:x,required:_=!1,tabIndex:C,type:S,value:M}=e,P=Be(e,Iue),[A,R]=Ru({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),F=Wl(),$=N=>{w&&w(N),F&&F.onFocus&&F.onFocus(N)},j=N=>{b&&b(N),F&&F.onBlur&&F.onBlur(N)},k=N=>{if(N.nativeEvent.defaultPrevented)return;const W=N.target.checked;R(W),m&&m(N,W)};let U=l;F&&typeof U>"u"&&(U=F.disabled);const G=S==="checkbox"||S==="radio",B=O({},e,{checked:A,disabled:U,disableFocusRipple:u,edge:c}),L=Nue(B);return D.jsxs(Fue,O({component:"span",className:nt(L.root,s),centerRipple:!0,focusRipple:!u,disabled:U,tabIndex:null,role:void 0,onFocus:$,onBlur:j,ownerState:B,ref:n},P,{children:[D.jsx(Oue,O({autoFocus:r,checked:i,defaultChecked:a,className:L.input,disabled:U,id:G?f:void 0,name:g,onChange:k,readOnly:x,ref:p,required:_,ownerState:B,tabIndex:C,type:S},S==="checkbox"&&M===void 0?{}:{value:M},h)),A?o:d]}))}),kue=mn(D.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Lue=mn(D.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Bue=mn(D.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function $ue(t){return It("MuiCheckbox",t)}const pT=At("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),zue=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],Uue=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${Ge(r)}`,`size${Ge(i)}`]},s=Qe(o,$ue,e);return O({},e,s)},Hue=ze(jI,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${Ge(n.size)}`],n.color!=="default"&&e[`color${Ge(n.color)}`]]}})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${pT.checked}, &.${pT.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${pT.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),Vue=D.jsx(Lue,{}),Gue=D.jsx(kue,{}),jue=D.jsx(Bue,{}),vc=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiCheckbox"}),{checkedIcon:s=Vue,color:a="primary",icon:l=Gue,indeterminate:u=!1,indeterminateIcon:c=jue,inputProps:d,size:f="medium",className:h}=o,p=Be(o,zue),g=u?c:l,b=u?c:s,m=O({},o,{color:a,indeterminate:u,size:f}),w=Uue(m);return D.jsx(Hue,O({type:"checkbox",inputProps:O({"data-indeterminate":u},d),icon:E.cloneElement(g,{fontSize:(r=g.props.fontSize)!=null?r:f}),checkedIcon:E.cloneElement(b,{fontSize:(i=b.props.fontSize)!=null?i:f}),ownerState:m,ref:n,className:nt(w.root,h)},p,{classes:w}))});function Wue(t){return It("MuiCircularProgress",t)}At("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const que=["className","color","disableShrink","size","style","thickness","value","variant"];let oE=t=>t,R5,I5,N5,F5;const cc=44,Xue=yd(R5||(R5=oE` +`),Js.rippleVisible,Koe,lD,({theme:t})=>t.transitions.easing.easeInOut,Js.ripplePulsate,({theme:t})=>t.transitions.duration.shorter,Js.child,Js.childLeaving,Yoe,lD,({theme:t})=>t.transitions.easing.easeInOut,Js.childPulsate,Zoe,({theme:t})=>t.transitions.easing.easeInOut),ese=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTouchRipple"}),{center:i=!1,classes:o={},className:s}=r,a=Be(r,qoe),[l,u]=E.useState([]),c=E.useRef(0),d=E.useRef(null);E.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=E.useRef(!1),h=Kp(),p=E.useRef(null),g=E.useRef(null),b=E.useCallback(_=>{const{pulsate:C,rippleX:S,rippleY:M,rippleSize:P,cb:A}=_;u(R=>[...R,D.jsx(Joe,{classes:{ripple:nt(o.ripple,Js.ripple),rippleVisible:nt(o.rippleVisible,Js.rippleVisible),ripplePulsate:nt(o.ripplePulsate,Js.ripplePulsate),child:nt(o.child,Js.child),childLeaving:nt(o.childLeaving,Js.childLeaving),childPulsate:nt(o.childPulsate,Js.childPulsate)},timeout:lD,pulsate:C,rippleX:S,rippleY:M,rippleSize:P},c.current)]),c.current+=1,d.current=A},[o]),m=E.useCallback((_={},C={},S=()=>{})=>{const{pulsate:M=!1,center:P=i||C.pulsate,fakeElement:A=!1}=C;if((_==null?void 0:_.type)==="mousedown"&&f.current){f.current=!1;return}(_==null?void 0:_.type)==="touchstart"&&(f.current=!0);const R=A?null:g.current,F=R?R.getBoundingClientRect():{width:0,height:0,left:0,top:0};let $,j,k;if(P||_===void 0||_.clientX===0&&_.clientY===0||!_.clientX&&!_.touches)$=Math.round(F.width/2),j=Math.round(F.height/2);else{const{clientX:U,clientY:G}=_.touches&&_.touches.length>0?_.touches[0]:_;$=Math.round(U-F.left),j=Math.round(G-F.top)}if(P)k=Math.sqrt((2*F.width**2+F.height**2)/3),k%2===0&&(k+=1);else{const U=Math.max(Math.abs((R?R.clientWidth:0)-$),$)*2+2,G=Math.max(Math.abs((R?R.clientHeight:0)-j),j)*2+2;k=Math.sqrt(U**2+G**2)}_!=null&&_.touches?p.current===null&&(p.current=()=>{b({pulsate:M,rippleX:$,rippleY:j,rippleSize:k,cb:S})},h.start(Xoe,()=>{p.current&&(p.current(),p.current=null)})):b({pulsate:M,rippleX:$,rippleY:j,rippleSize:k,cb:S})},[i,b,h]),w=E.useCallback(()=>{m({},{pulsate:!0})},[m]),x=E.useCallback((_,C)=>{if(h.clear(),(_==null?void 0:_.type)==="touchend"&&p.current){p.current(),p.current=null,h.start(0,()=>{x(_,C)});return}p.current=null,u(S=>S.length>0?S.slice(1):S),d.current=C},[h]);return E.useImperativeHandle(n,()=>({pulsate:w,start:m,stop:x}),[w,m,x]),D.jsx(Qoe,O({className:nt(Js.root,o.root,s),ref:g},a,{children:D.jsx(NI,{component:null,exit:!0,children:l})}))});function tse(t){return It("MuiButtonBase",t)}const nse=At("MuiButtonBase",["root","disabled","focusVisible"]),rse=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],ise=t=>{const{disabled:e,focusVisible:n,focusVisibleClassName:r,classes:i}=t,s=Qe({root:["root",e&&"disabled",n&&"focusVisible"]},tse,i);return n&&r&&(s.root+=` ${r}`),s},ose=ze("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${nse.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Bm=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiButtonBase"}),{action:i,centerRipple:o=!1,children:s,className:a,component:l="button",disabled:u=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:h="a",onBlur:p,onClick:g,onContextMenu:b,onDragLeave:m,onFocus:w,onFocusVisible:x,onKeyDown:_,onKeyUp:C,onMouseDown:S,onMouseLeave:M,onMouseUp:P,onTouchEnd:A,onTouchMove:R,onTouchStart:F,tabIndex:$=0,TouchRippleProps:j,touchRippleRef:k,type:U}=r,G=Be(r,rse),B=E.useRef(null),L=E.useRef(null),N=An(L,k),{isFocusVisibleRef:W,onFocus:K,onBlur:Q,ref:J}=_I(),[ae,ve]=E.useState(!1);u&&ae&&ve(!1),E.useImperativeHandle(i,()=>({focusVisible:()=>{ve(!0),B.current.focus()}}),[]);const[fe,Me]=E.useState(!1);E.useEffect(()=>{Me(!0)},[]);const ye=fe&&!c&&!u;E.useEffect(()=>{ae&&f&&!c&&fe&&L.current.pulsate()},[c,f,ae,fe]);function we(ge,be,Te=d){return ar(Re=>(be&&be(Re),!Te&&L.current&&L.current[ge](Re),!0))}const Fe=we("start",S),Oe=we("stop",b),re=we("stop",m),_e=we("stop",P),Ce=we("stop",ge=>{ae&&ge.preventDefault(),M&&M(ge)}),X=we("start",F),Z=we("stop",A),he=we("stop",R),Y=we("stop",ge=>{Q(ge),W.current===!1&&ve(!1),p&&p(ge)},!1),ne=ar(ge=>{B.current||(B.current=ge.currentTarget),K(ge),W.current===!0&&(ve(!0),x&&x(ge)),w&&w(ge)}),se=()=>{const ge=B.current;return l&&l!=="button"&&!(ge.tagName==="A"&&ge.href)},xe=E.useRef(!1),Pe=ar(ge=>{f&&!xe.current&&ae&&L.current&&ge.key===" "&&(xe.current=!0,L.current.stop(ge,()=>{L.current.start(ge)})),ge.target===ge.currentTarget&&se()&&ge.key===" "&&ge.preventDefault(),_&&_(ge),ge.target===ge.currentTarget&&se()&&ge.key==="Enter"&&!u&&(ge.preventDefault(),g&&g(ge))}),z=ar(ge=>{f&&ge.key===" "&&L.current&&ae&&!ge.defaultPrevented&&(xe.current=!1,L.current.stop(ge,()=>{L.current.pulsate(ge)})),C&&C(ge),g&&ge.target===ge.currentTarget&&se()&&ge.key===" "&&!ge.defaultPrevented&&g(ge)});let H=l;H==="button"&&(G.href||G.to)&&(H=h);const te={};H==="button"?(te.type=U===void 0?"button":U,te.disabled=u):(!G.href&&!G.to&&(te.role="button"),u&&(te["aria-disabled"]=u));const le=An(n,J,B),de=O({},r,{centerRipple:o,component:l,disabled:u,disableRipple:c,disableTouchRipple:d,focusRipple:f,tabIndex:$,focusVisible:ae}),ue=ise(de);return D.jsxs(ose,O({as:H,className:nt(ue.root,a),ownerState:de,onBlur:Y,onClick:g,onContextMenu:Oe,onFocus:ne,onKeyDown:Pe,onKeyUp:z,onMouseDown:Fe,onMouseLeave:Ce,onMouseUp:_e,onDragLeave:re,onTouchEnd:Z,onTouchMove:he,onTouchStart:X,ref:le,tabIndex:u?-1:$,type:U},te,G,{children:[s,ye?D.jsx(ese,O({ref:N,center:o},j)):null]}))});function sse(t){return It("MuiIconButton",t)}const ase=At("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),lse=["edge","children","className","color","disabled","disableFocusRipple","size"],use=t=>{const{classes:e,disabled:n,color:r,edge:i,size:o}=t,s={root:["root",n&&"disabled",r!=="default"&&`color${Ge(r)}`,i&&`edge${Ge(i)}`,`size${Ge(o)}`]};return Qe(s,sse,e)},cse=ze(Bm,{name:"MuiIconButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Ge(n.color)}`],n.edge&&e[`edge${Ge(n.edge)}`],e[`size${Ge(n.size)}`]]}})(({theme:t,ownerState:e})=>O({textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest})},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12}),({theme:t,ownerState:e})=>{var n;const r=(n=(t.vars||t).palette)==null?void 0:n[e.color];return O({},e.color==="inherit"&&{color:"inherit"},e.color!=="inherit"&&e.color!=="default"&&O({color:r==null?void 0:r.main},!e.disableRipple&&{"&:hover":O({},r&&{backgroundColor:t.vars?`rgba(${r.mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(r.main,t.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),e.size==="small"&&{padding:5,fontSize:t.typography.pxToRem(18)},e.size==="large"&&{padding:12,fontSize:t.typography.pxToRem(28)},{[`&.${ase.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled}})}),io=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:u=!1,size:c="medium"}=r,d=Be(r,lse),f=O({},r,{edge:i,color:a,disabled:l,disableFocusRipple:u,size:c}),h=use(f);return D.jsx(cse,O({className:nt(h.root,s),centerRipple:!0,focusRipple:!u,disabled:l,ref:n},d,{ownerState:f,children:o}))}),dse=mn(D.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function fse(t){return It("MuiTypography",t)}At("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const hse=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],pse=t=>{const{align:e,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=t,a={root:["root",o,t.align!=="inherit"&&`align${Ge(e)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return Qe(a,fse,s)},mse=ze("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${Ge(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(({theme:t,ownerState:e})=>O({margin:0},e.variant==="inherit"&&{font:"inherit"},e.variant!=="inherit"&&t.typography[e.variant],e.align!=="inherit"&&{textAlign:e.align},e.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},e.gutterBottom&&{marginBottom:"0.35em"},e.paragraph&&{marginBottom:16})),f5={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},gse={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},vse=t=>gse[t]||t,xn=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTypography"}),i=vse(r.color),o=rb(O({},r,{color:i})),{align:s="inherit",className:a,component:l,gutterBottom:u=!1,noWrap:c=!1,paragraph:d=!1,variant:f="body1",variantMapping:h=f5}=o,p=Be(o,hse),g=O({},o,{align:s,color:i,className:a,component:l,gutterBottom:u,noWrap:c,paragraph:d,variant:f,variantMapping:h}),b=l||(d?"p":h[f]||f5[f])||"span",m=pse(g);return D.jsx(mse,O({as:b,ref:n,ownerState:g,className:nt(m.root,a)},p))});function yse(t){return It("MuiAppBar",t)}At("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const bse=["className","color","enableColorOnDark","position"],xse=t=>{const{color:e,position:n,classes:r}=t,i={root:["root",`color${Ge(e)}`,`position${Ge(n)}`]};return Qe(i,yse,r)},px=(t,e)=>t?`${t==null?void 0:t.replace(")","")}, ${e})`:e,wse=ze(Xu,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Ge(n.position)}`],e[`color${Ge(n.color)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[900];return O({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},e.position==="fixed"&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},e.position==="absolute"&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="sticky"&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},e.position==="static"&&{position:"static"},e.position==="relative"&&{position:"relative"},!t.vars&&O({},e.color==="default"&&{backgroundColor:n,color:t.palette.getContrastText(n)},e.color&&e.color!=="default"&&e.color!=="inherit"&&e.color!=="transparent"&&{backgroundColor:t.palette[e.color].main,color:t.palette[e.color].contrastText},e.color==="inherit"&&{color:"inherit"},t.palette.mode==="dark"&&!e.enableColorOnDark&&{backgroundColor:null,color:null},e.color==="transparent"&&O({backgroundColor:"transparent",color:"inherit"},t.palette.mode==="dark"&&{backgroundImage:"none"})),t.vars&&O({},e.color==="default"&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette.AppBar.defaultBg:px(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":e.enableColorOnDark?t.vars.palette.text.primary:px(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},e.color&&!e.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":e.enableColorOnDark?t.vars.palette[e.color].main:px(t.vars.palette.AppBar.darkBg,t.vars.palette[e.color].main),"--AppBar-color":e.enableColorOnDark?t.vars.palette[e.color].contrastText:px(t.vars.palette.AppBar.darkColor,t.vars.palette[e.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:e.color==="inherit"?"inherit":"var(--AppBar-color)"},e.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),_se=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed"}=r,l=Be(r,bse),u=O({},r,{color:o,position:a,enableColorOnDark:s}),c=xse(u);return D.jsx(wse,O({square:!0,component:"header",ownerState:u,elevation:4,className:nt(c.root,i,a==="fixed"&&"mui-fixed"),ref:n},l))});function Sse(t){const{badgeContent:e,invisible:n=!1,max:r=99,showZero:i=!1}=t,o=SI({badgeContent:e,max:r});let s=n;n===!1&&e===0&&!i&&(s=!0);const{badgeContent:a,max:l=r}=s?o:t,u=a&&Number(a)>l?`${l}+`:a;return{badgeContent:a,invisible:s,max:l,displayValue:u}}const IV="base";function Cse(t){return`${IV}--${t}`}function Ese(t,e){return`${IV}-${t}-${e}`}function NV(t,e){const n=cV[e];return n?Cse(n):Ese(t,e)}function Mse(t,e){const n={};return e.forEach(r=>{n[r]=NV(t,r)}),n}function h5(t){return t.substring(2).toLowerCase()}function Tse(t,e){return e.documentElement.clientWidth(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const c=An(e.ref,a),d=ar(p=>{const g=u.current;u.current=!1;const b=Sr(a.current);if(!l.current||!a.current||"clientX"in p&&Tse(p,b))return;if(s.current){s.current=!1;return}let m;p.composedPath?m=p.composedPath().indexOf(a.current)>-1:m=!b.documentElement.contains(p.target)||a.current.contains(p.target),!m&&(n||!g)&&i(p)}),f=p=>g=>{u.current=!0;const b=e.props[p];b&&b(g)},h={ref:c};return o!==!1&&(h[o]=f(o)),E.useEffect(()=>{if(o!==!1){const p=h5(o),g=Sr(a.current),b=()=>{s.current=!0};return g.addEventListener(p,d),g.addEventListener("touchmove",b),()=>{g.removeEventListener(p,d),g.removeEventListener("touchmove",b)}}},[d,o]),r!==!1&&(h[r]=f(r)),E.useEffect(()=>{if(r!==!1){const p=h5(r),g=Sr(a.current);return g.addEventListener(p,d),()=>{g.removeEventListener(p,d)}}},[d,r]),D.jsx(E.Fragment,{children:E.cloneElement(e,h)})}const Ase=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Pse(t){const e=parseInt(t.getAttribute("tabindex")||"",10);return Number.isNaN(e)?t.contentEditable==="true"||(t.nodeName==="AUDIO"||t.nodeName==="VIDEO"||t.nodeName==="DETAILS")&&t.getAttribute("tabindex")===null?0:t.tabIndex:e}function Dse(t){if(t.tagName!=="INPUT"||t.type!=="radio"||!t.name)return!1;const e=r=>t.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=e(`[name="${t.name}"]:checked`);return n||(n=e(`[name="${t.name}"]`)),n!==t}function Rse(t){return!(t.disabled||t.tagName==="INPUT"&&t.type==="hidden"||Dse(t))}function Ise(t){const e=[],n=[];return Array.from(t.querySelectorAll(Ase)).forEach((r,i)=>{const o=Pse(r);o===-1||!Rse(r)||(o===0?e.push(r):n.push({documentOrder:i,tabIndex:o,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(e)}function Nse(){return!0}function OV(t){const{children:e,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=Ise,isEnabled:s=Nse,open:a}=t,l=E.useRef(!1),u=E.useRef(null),c=E.useRef(null),d=E.useRef(null),f=E.useRef(null),h=E.useRef(!1),p=E.useRef(null),g=An(e.ref,p),b=E.useRef(null);E.useEffect(()=>{!a||!p.current||(h.current=!n)},[n,a]),E.useEffect(()=>{if(!a||!p.current)return;const x=Sr(p.current);return p.current.contains(x.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[a]),E.useEffect(()=>{if(!a||!p.current)return;const x=Sr(p.current),_=M=>{b.current=M,!(r||!s()||M.key!=="Tab")&&x.activeElement===p.current&&M.shiftKey&&(l.current=!0,c.current&&c.current.focus())},C=()=>{const M=p.current;if(M===null)return;if(!x.hasFocus()||!s()||l.current){l.current=!1;return}if(M.contains(x.activeElement)||r&&x.activeElement!==u.current&&x.activeElement!==c.current)return;if(x.activeElement!==f.current)f.current=null;else if(f.current!==null)return;if(!h.current)return;let P=[];if((x.activeElement===u.current||x.activeElement===c.current)&&(P=o(p.current)),P.length>0){var A,R;const F=!!((A=b.current)!=null&&A.shiftKey&&((R=b.current)==null?void 0:R.key)==="Tab"),$=P[0],j=P[P.length-1];typeof $!="string"&&typeof j!="string"&&(F?j.focus():$.focus())}else M.focus()};x.addEventListener("focusin",C),x.addEventListener("keydown",_,!0);const S=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&C()},50);return()=>{clearInterval(S),x.removeEventListener("focusin",C),x.removeEventListener("keydown",_,!0)}},[n,r,i,s,a,o]);const m=x=>{d.current===null&&(d.current=x.relatedTarget),h.current=!0,f.current=x.target;const _=e.props.onFocus;_&&_(x)},w=x=>{d.current===null&&(d.current=x.relatedTarget),h.current=!0};return D.jsxs(E.Fragment,{children:[D.jsx("div",{tabIndex:a?0:-1,onFocus:w,ref:u,"data-testid":"sentinelStart"}),E.cloneElement(e,{ref:g,onFocus:m}),D.jsx("div",{tabIndex:a?0:-1,onFocus:w,ref:c,"data-testid":"sentinelEnd"})]})}function Fse(t){return typeof t=="function"?t():t}const kV=E.forwardRef(function(e,n){const{children:r,container:i,disablePortal:o=!1}=e,[s,a]=E.useState(null),l=An(E.isValidElement(r)?r.ref:null,n);if(_r(()=>{o||a(Fse(i)||document.body)},[i,o]),_r(()=>{if(s&&!o)return ry(n,s),()=>{ry(n,null)}},[n,s,o]),o){if(E.isValidElement(r)){const u={ref:l};return E.cloneElement(r,u)}return D.jsx(E.Fragment,{children:r})}return D.jsx(E.Fragment,{children:s&&qu.createPortal(r,s)})});function Ose(t){const e=Sr(t);return e.body===t?Ll(t).innerWidth>e.documentElement.clientWidth:t.scrollHeight>t.clientHeight}function fv(t,e){e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden")}function p5(t){return parseInt(Ll(t).getComputedStyle(t).paddingRight,10)||0}function kse(t){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(t.tagName)!==-1,r=t.tagName==="INPUT"&&t.getAttribute("type")==="hidden";return n||r}function m5(t,e,n,r,i){const o=[e,n,...r];[].forEach.call(t.children,s=>{const a=o.indexOf(s)===-1,l=!kse(s);a&&l&&fv(s,i)})}function dT(t,e){let n=-1;return t.some((r,i)=>e(r)?(n=i,!0):!1),n}function Lse(t,e){const n=[],r=t.container;if(!e.disableScrollLock){if(Ose(r)){const s=vV(Sr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${p5(r)+s}px`;const a=Sr(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${p5(l)+s}px`})}let o;if(r.parentNode instanceof DocumentFragment)o=Sr(r).body;else{const s=r.parentElement,a=Ll(r);o=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:s,property:a})=>{o?s.style.setProperty(a,o):s.style.removeProperty(a)})}}function Bse(t){const e=[];return[].forEach.call(t.children,n=>{n.getAttribute("aria-hidden")==="true"&&e.push(n)}),e}class $se{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,n){let r=this.modals.indexOf(e);if(r!==-1)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&fv(e.modalRef,!1);const i=Bse(n);m5(n,e.mount,e.modalRef,i,!0);const o=dT(this.containers,s=>s.container===n);return o!==-1?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:n,restore:null,hiddenSiblings:i}),r)}mount(e,n){const r=dT(this.containers,o=>o.modals.indexOf(e)!==-1),i=this.containers[r];i.restore||(i.restore=Lse(i,n))}remove(e,n=!0){const r=this.modals.indexOf(e);if(r===-1)return r;const i=dT(this.containers,s=>s.modals.indexOf(e)!==-1),o=this.containers[i];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),o.modals.length===0)o.restore&&o.restore(),e.modalRef&&fv(e.modalRef,n),m5(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(i,1);else{const s=o.modals[o.modals.length-1];s.modalRef&&fv(s.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}}function zse(t){return typeof t=="function"?t():t}function Use(t){return t?t.props.hasOwnProperty("in"):!1}const Hse=new $se;function Vse(t){const{container:e,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=Hse,closeAfterTransition:o=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:u,open:c,rootRef:d}=t,f=E.useRef({}),h=E.useRef(null),p=E.useRef(null),g=An(p,d),[b,m]=E.useState(!c),w=Use(l);let x=!0;(t["aria-hidden"]==="false"||t["aria-hidden"]===!1)&&(x=!1);const _=()=>Sr(h.current),C=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),S=()=>{i.mount(C(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},M=ar(()=>{const G=zse(e)||_().body;i.add(C(),G),p.current&&S()}),P=E.useCallback(()=>i.isTopModal(C()),[i]),A=ar(G=>{h.current=G,G&&(c&&P()?S():p.current&&fv(p.current,x))}),R=E.useCallback(()=>{i.remove(C(),x)},[x,i]);E.useEffect(()=>()=>{R()},[R]),E.useEffect(()=>{c?M():(!w||!o)&&R()},[c,R,w,o,M]);const F=G=>B=>{var L;(L=G.onKeyDown)==null||L.call(G,B),!(B.key!=="Escape"||B.which===229||!P())&&(n||(B.stopPropagation(),u&&u(B,"escapeKeyDown")))},$=G=>B=>{var L;(L=G.onClick)==null||L.call(G,B),B.target===B.currentTarget&&u&&u(B,"backdropClick")};return{getRootProps:(G={})=>{const B=RV(t);delete B.onTransitionEnter,delete B.onTransitionExited;const L=O({},B,G);return O({role:"presentation"},L,{onKeyDown:F(L),ref:g})},getBackdropProps:(G={})=>{const B=G;return O({"aria-hidden":!0},B,{onClick:$(B),open:c})},getTransitionProps:()=>{const G=()=>{m(!1),s&&s()},B=()=>{m(!0),a&&a(),o&&R()};return{onEnter:H_(G,l==null?void 0:l.props.onEnter),onExited:H_(B,l==null?void 0:l.props.onExited)}},rootRef:g,portalRef:A,isTopModal:P,exited:b,hasTransition:w}}var Xo="top",pa="bottom",ma="right",Ko="left",FI="auto",ab=[Xo,pa,ma,Ko],$m="start",sy="end",Gse="clippingParents",LV="viewport",u0="popper",jse="reference",g5=ab.reduce(function(t,e){return t.concat([e+"-"+$m,e+"-"+sy])},[]),BV=[].concat(ab,[FI]).reduce(function(t,e){return t.concat([e,e+"-"+$m,e+"-"+sy])},[]),Wse="beforeRead",qse="read",Xse="afterRead",Kse="beforeMain",Yse="main",Zse="afterMain",Qse="beforeWrite",Jse="write",eae="afterWrite",tae=[Wse,qse,Xse,Kse,Yse,Zse,Qse,Jse,eae];function Bl(t){return t?(t.nodeName||"").toLowerCase():null}function Ns(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Lf(t){var e=Ns(t).Element;return t instanceof e||t instanceof Element}function ua(t){var e=Ns(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function OI(t){if(typeof ShadowRoot>"u")return!1;var e=Ns(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function nae(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!ua(o)||!Bl(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function rae(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,u){return l[u]="",l},{});!ua(i)||!Bl(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const iae={name:"applyStyles",enabled:!0,phase:"write",fn:nae,effect:rae,requires:["computeStyles"]};function Rl(t){return t.split("-")[0]}var _f=Math.max,W_=Math.min,zm=Math.round;function uD(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function $V(){return!/^((?!chrome|android).)*safari/i.test(uD())}function Um(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&ua(t)&&(i=t.offsetWidth>0&&zm(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&zm(r.height)/t.offsetHeight||1);var s=Lf(t)?Ns(t):window,a=s.visualViewport,l=!$V()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/i,c=(r.top+(l&&a?a.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function kI(t){var e=Um(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function zV(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&OI(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function zu(t){return Ns(t).getComputedStyle(t)}function oae(t){return["table","td","th"].indexOf(Bl(t))>=0}function bd(t){return((Lf(t)?t.ownerDocument:t.document)||window.document).documentElement}function JC(t){return Bl(t)==="html"?t:t.assignedSlot||t.parentNode||(OI(t)?t.host:null)||bd(t)}function v5(t){return!ua(t)||zu(t).position==="fixed"?null:t.offsetParent}function sae(t){var e=/firefox/i.test(uD()),n=/Trident/i.test(uD());if(n&&ua(t)){var r=zu(t);if(r.position==="fixed")return null}var i=JC(t);for(OI(i)&&(i=i.host);ua(i)&&["html","body"].indexOf(Bl(i))<0;){var o=zu(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function lb(t){for(var e=Ns(t),n=v5(t);n&&oae(n)&&zu(n).position==="static";)n=v5(n);return n&&(Bl(n)==="html"||Bl(n)==="body"&&zu(n).position==="static")?e:n||sae(t)||e}function LI(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function hv(t,e,n){return _f(t,W_(e,n))}function aae(t,e,n){var r=hv(t,e,n);return r>n?n:r}function UV(){return{top:0,right:0,bottom:0,left:0}}function HV(t){return Object.assign({},UV(),t)}function VV(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var lae=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,HV(typeof e!="number"?e:VV(e,ab))};function uae(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Rl(n.placement),l=LI(a),u=[Ko,ma].indexOf(a)>=0,c=u?"height":"width";if(!(!o||!s)){var d=lae(i.padding,n),f=kI(o),h=l==="y"?Xo:Ko,p=l==="y"?pa:ma,g=n.rects.reference[c]+n.rects.reference[l]-s[l]-n.rects.popper[c],b=s[l]-n.rects.reference[l],m=lb(o),w=m?l==="y"?m.clientHeight||0:m.clientWidth||0:0,x=g/2-b/2,_=d[h],C=w-f[c]-d[p],S=w/2-f[c]/2+x,M=hv(_,S,C),P=l;n.modifiersData[r]=(e={},e[P]=M,e.centerOffset=M-S,e)}}function cae(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||zV(e.elements.popper,i)&&(e.elements.arrow=i))}const dae={name:"arrow",enabled:!0,phase:"main",fn:uae,effect:cae,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Hm(t){return t.split("-")[1]}var fae={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hae(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:zm(n*i)/i||0,y:zm(r*i)/i||0}}function y5(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,u=t.adaptive,c=t.roundOffsets,d=t.isFixed,f=s.x,h=f===void 0?0:f,p=s.y,g=p===void 0?0:p,b=typeof c=="function"?c({x:h,y:g}):{x:h,y:g};h=b.x,g=b.y;var m=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),x=Ko,_=Xo,C=window;if(u){var S=lb(n),M="clientHeight",P="clientWidth";if(S===Ns(n)&&(S=bd(n),zu(S).position!=="static"&&a==="absolute"&&(M="scrollHeight",P="scrollWidth")),S=S,i===Xo||(i===Ko||i===ma)&&o===sy){_=pa;var A=d&&S===C&&C.visualViewport?C.visualViewport.height:S[M];g-=A-r.height,g*=l?1:-1}if(i===Ko||(i===Xo||i===pa)&&o===sy){x=ma;var R=d&&S===C&&C.visualViewport?C.visualViewport.width:S[P];h-=R-r.width,h*=l?1:-1}}var F=Object.assign({position:a},u&&fae),$=c===!0?hae({x:h,y:g},Ns(n)):{x:h,y:g};if(h=$.x,g=$.y,l){var j;return Object.assign({},F,(j={},j[_]=w?"0":"",j[x]=m?"0":"",j.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",j))}return Object.assign({},F,(e={},e[_]=w?g+"px":"",e[x]=m?h+"px":"",e.transform="",e))}function pae(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Rl(e.placement),variation:Hm(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,y5(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,y5(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const mae={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pae,data:{}};var mx={passive:!0};function gae(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=Ns(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,mx)}),a&&l.addEventListener("resize",n.update,mx),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,mx)}),a&&l.removeEventListener("resize",n.update,mx)}}const vae={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:gae,data:{}};var yae={left:"right",right:"left",bottom:"top",top:"bottom"};function Jw(t){return t.replace(/left|right|bottom|top/g,function(e){return yae[e]})}var bae={start:"end",end:"start"};function b5(t){return t.replace(/start|end/g,function(e){return bae[e]})}function BI(t){var e=Ns(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function $I(t){return Um(bd(t)).left+BI(t).scrollLeft}function xae(t,e){var n=Ns(t),r=bd(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var u=$V();(u||!u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+$I(t),y:l}}function wae(t){var e,n=bd(t),r=BI(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=_f(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=_f(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+$I(t),l=-r.scrollTop;return zu(i||n).direction==="rtl"&&(a+=_f(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function zI(t){var e=zu(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function GV(t){return["html","body","#document"].indexOf(Bl(t))>=0?t.ownerDocument.body:ua(t)&&zI(t)?t:GV(JC(t))}function pv(t,e){var n;e===void 0&&(e=[]);var r=GV(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Ns(r),s=i?[o].concat(o.visualViewport||[],zI(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(pv(JC(s)))}function cD(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function _ae(t,e){var n=Um(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function x5(t,e,n){return e===LV?cD(xae(t,n)):Lf(e)?_ae(e,n):cD(wae(bd(t)))}function Sae(t){var e=pv(JC(t)),n=["absolute","fixed"].indexOf(zu(t).position)>=0,r=n&&ua(t)?lb(t):t;return Lf(r)?e.filter(function(i){return Lf(i)&&zV(i,r)&&Bl(i)!=="body"}):[]}function Cae(t,e,n,r){var i=e==="clippingParents"?Sae(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,u){var c=x5(t,u,r);return l.top=_f(c.top,l.top),l.right=W_(c.right,l.right),l.bottom=W_(c.bottom,l.bottom),l.left=_f(c.left,l.left),l},x5(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function jV(t){var e=t.reference,n=t.element,r=t.placement,i=r?Rl(r):null,o=r?Hm(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case Xo:l={x:s,y:e.y-n.height};break;case pa:l={x:s,y:e.y+e.height};break;case ma:l={x:e.x+e.width,y:a};break;case Ko:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var u=i?LI(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case $m:l[u]=l[u]-(e[c]/2-n[c]/2);break;case sy:l[u]=l[u]+(e[c]/2-n[c]/2);break}}return l}function ay(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?Gse:a,u=n.rootBoundary,c=u===void 0?LV:u,d=n.elementContext,f=d===void 0?u0:d,h=n.altBoundary,p=h===void 0?!1:h,g=n.padding,b=g===void 0?0:g,m=HV(typeof b!="number"?b:VV(b,ab)),w=f===u0?jse:u0,x=t.rects.popper,_=t.elements[p?w:f],C=Cae(Lf(_)?_:_.contextElement||bd(t.elements.popper),l,c,s),S=Um(t.elements.reference),M=jV({reference:S,element:x,strategy:"absolute",placement:i}),P=cD(Object.assign({},x,M)),A=f===u0?P:S,R={top:C.top-A.top+m.top,bottom:A.bottom-C.bottom+m.bottom,left:C.left-A.left+m.left,right:A.right-C.right+m.right},F=t.modifiersData.offset;if(f===u0&&F){var $=F[i];Object.keys(R).forEach(function(j){var k=[ma,pa].indexOf(j)>=0?1:-1,U=[Xo,pa].indexOf(j)>=0?"y":"x";R[j]+=$[U]*k})}return R}function Eae(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?BV:l,c=Hm(r),d=c?a?g5:g5.filter(function(p){return Hm(p)===c}):ab,f=d.filter(function(p){return u.indexOf(p)>=0});f.length===0&&(f=d);var h=f.reduce(function(p,g){return p[g]=ay(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[Rl(g)],p},{});return Object.keys(h).sort(function(p,g){return h[p]-h[g]})}function Mae(t){if(Rl(t)===FI)return[];var e=Jw(t);return[b5(t),e,b5(e)]}function Tae(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=h===void 0?!0:h,g=n.allowedAutoPlacements,b=e.options.placement,m=Rl(b),w=m===b,x=l||(w||!p?[Jw(b)]:Mae(b)),_=[b].concat(x).reduce(function(ae,ve){return ae.concat(Rl(ve)===FI?Eae(e,{placement:ve,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:g}):ve)},[]),C=e.rects.reference,S=e.rects.popper,M=new Map,P=!0,A=_[0],R=0;R<_.length;R++){var F=_[R],$=Rl(F),j=Hm(F)===$m,k=[Xo,pa].indexOf($)>=0,U=k?"width":"height",G=ay(e,{placement:F,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),B=k?j?ma:Ko:j?pa:Xo;C[U]>S[U]&&(B=Jw(B));var L=Jw(B),N=[];if(o&&N.push(G[$]<=0),a&&N.push(G[B]<=0,G[L]<=0),N.every(function(ae){return ae})){A=F,P=!1;break}M.set(F,N)}if(P)for(var W=p?3:1,K=function(ve){var fe=_.find(function(Me){var ye=M.get(Me);if(ye)return ye.slice(0,ve).every(function(we){return we})});if(fe)return A=fe,"break"},Q=W;Q>0;Q--){var J=K(Q);if(J==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const Aae={name:"flip",enabled:!0,phase:"main",fn:Tae,requiresIfExists:["offset"],data:{_skip:!1}};function w5(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function _5(t){return[Xo,ma,pa,Ko].some(function(e){return t[e]>=0})}function Pae(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ay(e,{elementContext:"reference"}),a=ay(e,{altBoundary:!0}),l=w5(s,r),u=w5(a,i,o),c=_5(l),d=_5(u);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const Dae={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Pae};function Rae(t,e,n){var r=Rl(t),i=[Ko,Xo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[Ko,ma].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Iae(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=BV.reduce(function(c,d){return c[d]=Rae(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}const Nae={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Iae};function Fae(t){var e=t.state,n=t.name;e.modifiersData[n]=jV({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Oae={name:"popperOffsets",enabled:!0,phase:"read",fn:Fae,data:{}};function kae(t){return t==="x"?"y":"x"}function Lae(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=f===void 0?!0:f,p=n.tetherOffset,g=p===void 0?0:p,b=ay(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),m=Rl(e.placement),w=Hm(e.placement),x=!w,_=LI(m),C=kae(_),S=e.modifiersData.popperOffsets,M=e.rects.reference,P=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,R=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),F=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,$={x:0,y:0};if(S){if(o){var j,k=_==="y"?Xo:Ko,U=_==="y"?pa:ma,G=_==="y"?"height":"width",B=S[_],L=B+b[k],N=B-b[U],W=h?-P[G]/2:0,K=w===$m?M[G]:P[G],Q=w===$m?-P[G]:-M[G],J=e.elements.arrow,ae=h&&J?kI(J):{width:0,height:0},ve=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:UV(),fe=ve[k],Me=ve[U],ye=hv(0,M[G],ae[G]),we=x?M[G]/2-W-ye-fe-R.mainAxis:K-ye-fe-R.mainAxis,Fe=x?-M[G]/2+W+ye+Me+R.mainAxis:Q+ye+Me+R.mainAxis,Oe=e.elements.arrow&&lb(e.elements.arrow),re=Oe?_==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,_e=(j=F==null?void 0:F[_])!=null?j:0,Ce=B+we-_e-re,X=B+Fe-_e,Z=hv(h?W_(L,Ce):L,B,h?_f(N,X):N);S[_]=Z,$[_]=Z-B}if(a){var he,Y=_==="x"?Xo:Ko,ne=_==="x"?pa:ma,se=S[C],xe=C==="y"?"height":"width",Pe=se+b[Y],z=se-b[ne],H=[Xo,Ko].indexOf(m)!==-1,te=(he=F==null?void 0:F[C])!=null?he:0,le=H?Pe:se-M[xe]-P[xe]-te+R.altAxis,de=H?se+M[xe]+P[xe]-te-R.altAxis:z,ue=h&&H?aae(le,se,de):hv(h?le:Pe,se,h?de:z);S[C]=ue,$[C]=ue-se}e.modifiersData[r]=$}}const Bae={name:"preventOverflow",enabled:!0,phase:"main",fn:Lae,requiresIfExists:["offset"]};function $ae(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function zae(t){return t===Ns(t)||!ua(t)?BI(t):$ae(t)}function Uae(t){var e=t.getBoundingClientRect(),n=zm(e.width)/t.offsetWidth||1,r=zm(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Hae(t,e,n){n===void 0&&(n=!1);var r=ua(e),i=ua(e)&&Uae(e),o=bd(e),s=Um(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Bl(e)!=="body"||zI(o))&&(a=zae(e)),ua(e)?(l=Um(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=$I(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Vae(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function Gae(t){var e=Vae(t);return tae.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function jae(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Wae(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var S5={placement:"bottom",modifiers:[],strategy:"absolute"};function C5(){for(var t=arguments.length,e=new Array(t),n=0;nQe({root:["root"]},Hoe(Yae)),nle={},rle=E.forwardRef(function(e,n){var r;const{anchorEl:i,children:o,direction:s,disablePortal:a,modifiers:l,open:u,placement:c,popperOptions:d,popperRef:f,slotProps:h={},slots:p={},TransitionProps:g}=e,b=Be(e,Zae),m=E.useRef(null),w=An(m,n),x=E.useRef(null),_=An(x,f),C=E.useRef(_);_r(()=>{C.current=_},[_]),E.useImperativeHandle(f,()=>x.current,[]);const S=Jae(c,s),[M,P]=E.useState(S),[A,R]=E.useState(dD(i));E.useEffect(()=>{x.current&&x.current.forceUpdate()}),E.useEffect(()=>{i&&R(dD(i))},[i]),_r(()=>{if(!A||!u)return;const U=L=>{P(L.placement)};let G=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:L})=>{U(L)}}];l!=null&&(G=G.concat(l)),d&&d.modifiers!=null&&(G=G.concat(d.modifiers));const B=Kae(A,m.current,O({placement:S},d,{modifiers:G}));return C.current(B),()=>{B.destroy(),C.current(null)}},[A,a,l,u,d,S]);const F={placement:M};g!==null&&(F.TransitionProps=g);const $=tle(),j=(r=p.root)!=null?r:"div",k=$u({elementType:j,externalSlotProps:h.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:w},ownerState:e,className:$.root});return D.jsx(j,O({},k,{children:typeof o=="function"?o(F):o}))}),ile=E.forwardRef(function(e,n){const{anchorEl:r,children:i,container:o,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:u,open:c,placement:d="bottom",popperOptions:f=nle,popperRef:h,style:p,transition:g=!1,slotProps:b={},slots:m={}}=e,w=Be(e,Qae),[x,_]=E.useState(!0),C=()=>{_(!1)},S=()=>{_(!0)};if(!l&&!c&&(!g||x))return null;let M;if(o)M=o;else if(r){const R=dD(r);M=R&&ele(R)?Sr(R).body:Sr(null).body}const P=!c&&l&&(!g||x)?"none":void 0,A=g?{in:c,onEnter:C,onExited:S}:void 0;return D.jsx(kV,{disablePortal:a,container:M,children:D.jsx(rle,O({anchorEl:r,direction:s,disablePortal:a,modifiers:u,ref:n,open:g?!x:c,placement:d,popperOptions:f,popperRef:h,slotProps:b,slots:m},w,{style:O({position:"fixed",top:0,left:0,display:P},p),TransitionProps:A,children:i}))})}),ole=["onChange","maxRows","minRows","style","value"];function gx(t){return parseInt(t,10)||0}const sle={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function ale(t){return t==null||Object.keys(t).length===0||t.outerHeightStyle===0&&!t.overflowing}const lle=E.forwardRef(function(e,n){const{onChange:r,maxRows:i,minRows:o=1,style:s,value:a}=e,l=Be(e,ole),{current:u}=E.useRef(a!=null),c=E.useRef(null),d=An(n,c),f=E.useRef(null),h=E.useCallback(()=>{const b=c.current,w=Ll(b).getComputedStyle(b);if(w.width==="0px")return{outerHeightStyle:0,overflowing:!1};const x=f.current;x.style.width=w.width,x.value=b.value||e.placeholder||"x",x.value.slice(-1)===` +`&&(x.value+=" ");const _=w.boxSizing,C=gx(w.paddingBottom)+gx(w.paddingTop),S=gx(w.borderBottomWidth)+gx(w.borderTopWidth),M=x.scrollHeight;x.value="x";const P=x.scrollHeight;let A=M;o&&(A=Math.max(Number(o)*P,A)),i&&(A=Math.min(Number(i)*P,A)),A=Math.max(A,P);const R=A+(_==="border-box"?C+S:0),F=Math.abs(A-M)<=1;return{outerHeightStyle:R,overflowing:F}},[i,o,e.placeholder]),p=E.useCallback(()=>{const b=h();if(ale(b))return;const m=c.current;m.style.height=`${b.outerHeightStyle}px`,m.style.overflow=b.overflowing?"hidden":""},[h]);_r(()=>{const b=()=>{p()};let m;const w=ug(b),x=c.current,_=Ll(x);_.addEventListener("resize",w);let C;return typeof ResizeObserver<"u"&&(C=new ResizeObserver(b),C.observe(x)),()=>{w.clear(),cancelAnimationFrame(m),_.removeEventListener("resize",w),C&&C.disconnect()}},[h,p]),_r(()=>{p()});const g=b=>{u||p(),r&&r(b)};return D.jsxs(E.Fragment,{children:[D.jsx("textarea",O({value:a,onChange:g,ref:d,rows:o,style:s},l)),D.jsx("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:O({},sle.shadow,s,{paddingTop:0,paddingBottom:0})})]})});function E5(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function qV(t={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:s=!1}=t;return(a,{inputValue:l,getOptionLabel:u})=>{let c=s?l.trim():l;n&&(c=c.toLowerCase()),e&&(c=E5(c));const d=c?a.filter(f=>{let h=(o||u)(f);return n&&(h=h.toLowerCase()),e&&(h=E5(h)),i==="start"?h.indexOf(c)===0:h.indexOf(c)>-1}):a;return typeof r=="number"?d.slice(0,r):d}}function vx(t,e){for(let n=0;n{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))};function dle(t){const{unstable_isActiveElementInListbox:e=cle,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:i=!1,autoSelect:o=!1,blurOnSelect:s=!1,clearOnBlur:a=!t.freeSolo,clearOnEscape:l=!1,componentName:u="useAutocomplete",defaultValue:c=t.multiple?[]:null,disableClearable:d=!1,disableCloseOnSelect:f=!1,disabled:h,disabledItemsFocusable:p=!1,disableListWrap:g=!1,filterOptions:b=ule,filterSelectedOptions:m=!1,freeSolo:w=!1,getOptionDisabled:x,getOptionKey:_,getOptionLabel:C=qe=>{var Ue;return(Ue=qe.label)!=null?Ue:qe},groupBy:S,handleHomeEndKeys:M=!t.freeSolo,id:P,includeInputInList:A=!1,inputValue:R,isOptionEqualToValue:F=(qe,Ue)=>qe===Ue,multiple:$=!1,onChange:j,onClose:k,onHighlightChange:U,onInputChange:G,onOpen:B,open:L,openOnFocus:N=!1,options:W,readOnly:K=!1,selectOnFocus:Q=!t.freeSolo,value:J}=t,ae=jn(P);let ve=C;ve=qe=>{const Ue=C(qe);return typeof Ue!="string"?String(Ue):Ue};const fe=E.useRef(!1),Me=E.useRef(!0),ye=E.useRef(null),we=E.useRef(null),[Fe,Oe]=E.useState(null),[re,_e]=E.useState(-1),Ce=i?0:-1,X=E.useRef(Ce),[Z,he]=Ru({controlled:J,default:c,name:u}),[Y,ne]=Ru({controlled:R,default:"",name:u,state:"inputValue"}),[se,xe]=E.useState(!1),Pe=E.useCallback((qe,Ue)=>{if(!($?Z.length!(m&&($?Z:[Z]).some(Ue=>Ue!==null&&F(qe,Ue)))),{inputValue:de&&te?"":Y,getOptionLabel:ve}):[],be=SI({filteredOptions:ge,value:Z,inputValue:Y});E.useEffect(()=>{const qe=Z!==be.value;se&&!qe||w&&!qe||Pe(null,Z)},[Z,Pe,se,be.value,w]);const Te=z&&ge.length>0&&!K,Re=ar(qe=>{qe===-1?ye.current.focus():Fe.querySelector(`[data-tag-index="${qe}"]`).focus()});E.useEffect(()=>{$&&re>Z.length-1&&(_e(-1),Re(-1))},[Z,$,re,Re]);function Ve(qe,Ue){if(!we.current||qe<0||qe>=ge.length)return-1;let ee=qe;for(;;){const pe=we.current.querySelector(`[data-option-index="${ee}"]`),Ae=p?!1:!pe||pe.disabled||pe.getAttribute("aria-disabled")==="true";if(pe&&pe.hasAttribute("tabindex")&&!Ae)return ee;if(Ue==="next"?ee=(ee+1)%ge.length:ee=(ee-1+ge.length)%ge.length,ee===qe)return-1}}const Le=ar(({event:qe,index:Ue,reason:ee="auto"})=>{if(X.current=Ue,Ue===-1?ye.current.removeAttribute("aria-activedescendant"):ye.current.setAttribute("aria-activedescendant",`${ae}-option-${Ue}`),U&&U(qe,Ue===-1?null:ge[Ue],ee),!we.current)return;const pe=we.current.querySelector(`[role="option"].${n}-focused`);pe&&(pe.classList.remove(`${n}-focused`),pe.classList.remove(`${n}-focusVisible`));let Ae=we.current;if(we.current.getAttribute("role")!=="listbox"&&(Ae=we.current.parentElement.querySelector('[role="listbox"]')),!Ae)return;if(Ue===-1){Ae.scrollTop=0;return}const Ee=we.current.querySelector(`[data-option-index="${Ue}"]`);if(Ee&&(Ee.classList.add(`${n}-focused`),ee==="keyboard"&&Ee.classList.add(`${n}-focusVisible`),Ae.scrollHeight>Ae.clientHeight&&ee!=="mouse"&&ee!=="touch")){const ke=Ee,at=Ae.clientHeight+Ae.scrollTop,_t=ke.offsetTop+ke.offsetHeight;_t>at?Ae.scrollTop=_t-Ae.clientHeight:ke.offsetTop-ke.offsetHeight*(S?1.3:0){if(!ue)return;const Ee=Ve((()=>{const ke=ge.length-1;if(Ue==="reset")return Ce;if(Ue==="start")return 0;if(Ue==="end")return ke;const at=X.current+Ue;return at<0?at===-1&&A?-1:g&&X.current!==-1||Math.abs(Ue)>1?0:ke:at>ke?at===ke+1&&A?-1:g||Math.abs(Ue)>1?ke:0:at})(),ee);if(Le({index:Ee,reason:pe,event:qe}),r&&Ue!=="reset")if(Ee===-1)ye.current.value=Y;else{const ke=ve(ge[Ee]);ye.current.value=ke,ke.toLowerCase().indexOf(Y.toLowerCase())===0&&Y.length>0&&ye.current.setSelectionRange(Y.length,ke.length)}}),it=()=>{const qe=(Ue,ee)=>{const pe=Ue?ve(Ue):"",Ae=ee?ve(ee):"";return pe===Ae};if(X.current!==-1&&be.filteredOptions&&be.filteredOptions.length!==ge.length&&be.inputValue===Y&&($?Z.length===be.value.length&&be.value.every((Ue,ee)=>ve(Z[ee])===ve(Ue)):qe(be.value,Z))){const Ue=be.filteredOptions[X.current];if(Ue)return vx(ge,ee=>ve(ee)===ve(Ue))}return-1},ot=E.useCallback(()=>{if(!ue)return;const qe=it();if(qe!==-1){X.current=qe;return}const Ue=$?Z[0]:Z;if(ge.length===0||Ue==null){Ye({diff:"reset"});return}if(we.current){if(Ue!=null){const ee=ge[X.current];if($&&ee&&vx(Z,Ae=>F(ee,Ae))!==-1)return;const pe=vx(ge,Ae=>F(Ae,Ue));pe===-1?Ye({diff:"reset"}):Le({index:pe});return}if(X.current>=ge.length-1){Le({index:ge.length-1});return}Le({index:X.current})}},[ge.length,$?!1:Z,m,Ye,Le,ue,Y,$]),ht=ar(qe=>{ry(we,qe),qe&&ot()});E.useEffect(()=>{ot()},[ot]);const Je=qe=>{z||(H(!0),le(!0),B&&B(qe))},Ot=(qe,Ue)=>{z&&(H(!1),k&&k(qe,Ue))},Se=(qe,Ue,ee,pe)=>{if($){if(Z.length===Ue.length&&Z.every((Ae,Ee)=>Ae===Ue[Ee]))return}else if(Z===Ue)return;j&&j(qe,Ue,ee,pe),he(Ue)},st=E.useRef(!1),Ze=(qe,Ue,ee="selectOption",pe="options")=>{let Ae=ee,Ee=Ue;if($){Ee=Array.isArray(Z)?Z.slice():[];const ke=vx(Ee,at=>F(Ue,at));ke===-1?Ee.push(Ue):pe!=="freeSolo"&&(Ee.splice(ke,1),Ae="removeOption")}Pe(qe,Ee),Se(qe,Ee,Ae,{option:Ue}),!f&&(!qe||!qe.ctrlKey&&!qe.metaKey)&&Ot(qe,Ae),(s===!0||s==="touch"&&st.current||s==="mouse"&&!st.current)&&ye.current.blur()};function je(qe,Ue){if(qe===-1)return-1;let ee=qe;for(;;){if(Ue==="next"&&ee===Z.length||Ue==="previous"&&ee===-1)return-1;const pe=Fe.querySelector(`[data-tag-index="${ee}"]`);if(!pe||!pe.hasAttribute("tabindex")||pe.disabled||pe.getAttribute("aria-disabled")==="true")ee+=Ue==="next"?1:-1;else return ee}}const et=(qe,Ue)=>{if(!$)return;Y===""&&Ot(qe,"toggleInput");let ee=re;re===-1?Y===""&&Ue==="previous"&&(ee=Z.length-1):(ee+=Ue==="next"?1:-1,ee<0&&(ee=0),ee===Z.length&&(ee=-1)),ee=je(ee,Ue),_e(ee),Re(ee)},Tt=qe=>{fe.current=!0,ne(""),G&&G(qe,"","clear"),Se(qe,$?[]:null,"clear")},Qt=qe=>Ue=>{if(qe.onKeyDown&&qe.onKeyDown(Ue),!Ue.defaultMuiPrevented&&(re!==-1&&["ArrowLeft","ArrowRight"].indexOf(Ue.key)===-1&&(_e(-1),Re(-1)),Ue.which!==229))switch(Ue.key){case"Home":ue&&M&&(Ue.preventDefault(),Ye({diff:"start",direction:"next",reason:"keyboard",event:Ue}));break;case"End":ue&&M&&(Ue.preventDefault(),Ye({diff:"end",direction:"previous",reason:"keyboard",event:Ue}));break;case"PageUp":Ue.preventDefault(),Ye({diff:-M5,direction:"previous",reason:"keyboard",event:Ue}),Je(Ue);break;case"PageDown":Ue.preventDefault(),Ye({diff:M5,direction:"next",reason:"keyboard",event:Ue}),Je(Ue);break;case"ArrowDown":Ue.preventDefault(),Ye({diff:1,direction:"next",reason:"keyboard",event:Ue}),Je(Ue);break;case"ArrowUp":Ue.preventDefault(),Ye({diff:-1,direction:"previous",reason:"keyboard",event:Ue}),Je(Ue);break;case"ArrowLeft":et(Ue,"previous");break;case"ArrowRight":et(Ue,"next");break;case"Enter":if(X.current!==-1&&ue){const ee=ge[X.current],pe=x?x(ee):!1;if(Ue.preventDefault(),pe)return;Ze(Ue,ee,"selectOption"),r&&ye.current.setSelectionRange(ye.current.value.length,ye.current.value.length)}else w&&Y!==""&&de===!1&&($&&Ue.preventDefault(),Ze(Ue,Y,"createOption","freeSolo"));break;case"Escape":ue?(Ue.preventDefault(),Ue.stopPropagation(),Ot(Ue,"escape")):l&&(Y!==""||$&&Z.length>0)&&(Ue.preventDefault(),Ue.stopPropagation(),Tt(Ue));break;case"Backspace":if($&&!K&&Y===""&&Z.length>0){const ee=re===-1?Z.length-1:re,pe=Z.slice();pe.splice(ee,1),Se(Ue,pe,"removeOption",{option:Z[ee]})}break;case"Delete":if($&&!K&&Y===""&&Z.length>0&&re!==-1){const ee=re,pe=Z.slice();pe.splice(ee,1),Se(Ue,pe,"removeOption",{option:Z[ee]})}break}},Fn=qe=>{xe(!0),N&&!fe.current&&Je(qe)},Vn=qe=>{if(e(we)){ye.current.focus();return}xe(!1),Me.current=!0,fe.current=!1,o&&X.current!==-1&&ue?Ze(qe,ge[X.current],"blur"):o&&w&&Y!==""?Ze(qe,Y,"blur","freeSolo"):a&&Pe(qe,Z),Ot(qe,"blur")},Ut=qe=>{const Ue=qe.target.value;Y!==Ue&&(ne(Ue),le(!1),G&&G(qe,Ue,"input")),Ue===""?!d&&!$&&Se(qe,null,"clear"):Je(qe)},Wt=qe=>{const Ue=Number(qe.currentTarget.getAttribute("data-option-index"));X.current!==Ue&&Le({event:qe,index:Ue,reason:"mouse"})},On=qe=>{Le({event:qe,index:Number(qe.currentTarget.getAttribute("data-option-index")),reason:"touch"}),st.current=!0},Er=qe=>{const Ue=Number(qe.currentTarget.getAttribute("data-option-index"));Ze(qe,ge[Ue],"selectOption"),st.current=!1},Ii=qe=>Ue=>{const ee=Z.slice();ee.splice(qe,1),Se(Ue,ee,"removeOption",{option:Z[qe]})},Io=qe=>{z?Ot(qe,"toggleInput"):Je(qe)},jr=qe=>{qe.currentTarget.contains(qe.target)&&qe.target.getAttribute("id")!==ae&&qe.preventDefault()},Ni=qe=>{qe.currentTarget.contains(qe.target)&&(ye.current.focus(),Q&&Me.current&&ye.current.selectionEnd-ye.current.selectionStart===0&&ye.current.select(),Me.current=!1)},co=qe=>{!h&&(Y===""||!z)&&Io(qe)};let Fi=w&&Y.length>0;Fi=Fi||($?Z.length>0:Z!==null);let fo=ge;return S&&(fo=ge.reduce((qe,Ue,ee)=>{const pe=S(Ue);return qe.length>0&&qe[qe.length-1].group===pe?qe[qe.length-1].options.push(Ue):qe.push({key:ee,index:ee,group:pe,options:[Ue]}),qe},[])),h&&se&&Vn(),{getRootProps:(qe={})=>O({"aria-owns":Te?`${ae}-listbox`:null},qe,{onKeyDown:Qt(qe),onMouseDown:jr,onClick:Ni}),getInputLabelProps:()=>({id:`${ae}-label`,htmlFor:ae}),getInputProps:()=>({id:ae,value:Y,onBlur:Vn,onFocus:Fn,onChange:Ut,onMouseDown:co,"aria-activedescendant":ue?"":null,"aria-autocomplete":r?"both":"list","aria-controls":Te?`${ae}-listbox`:void 0,"aria-expanded":Te,autoComplete:"off",ref:ye,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:h}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Tt}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Io}),getTagProps:({index:qe})=>O({key:qe,"data-tag-index":qe,tabIndex:-1},!K&&{onDelete:Ii(qe)}),getListboxProps:()=>({role:"listbox",id:`${ae}-listbox`,"aria-labelledby":`${ae}-label`,ref:ht,onMouseDown:qe=>{qe.preventDefault()}}),getOptionProps:({index:qe,option:Ue})=>{var ee;const pe=($?Z:[Z]).some(Ee=>Ee!=null&&F(Ue,Ee)),Ae=x?x(Ue):!1;return{key:(ee=_==null?void 0:_(Ue))!=null?ee:ve(Ue),tabIndex:-1,role:"option",id:`${ae}-option-${qe}`,onMouseMove:Wt,onClick:Er,onTouchStart:On,"data-option-index":qe,"aria-disabled":Ae,"aria-selected":pe}},id:ae,inputValue:Y,value:Z,dirty:Fi,expanded:ue&&Fe,popupOpen:ue,focused:se||re!==-1,anchorEl:Fe,setAnchorEl:Oe,focusedTag:re,groupedOptions:fo}}var UI={};Object.defineProperty(UI,"__esModule",{value:!0});var XV=UI.default=void 0,fle=ple(E),hle=TV;function KV(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(KV=function(r){return r?n:e})(t)}function ple(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=KV(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=t[o]}return r.default=t,n&&n.set(t,r),r}function mle(t){return Object.keys(t).length===0}function gle(t=null){const e=fle.useContext(hle.ThemeContext);return!e||mle(e)?t:e}XV=UI.default=gle;const vle=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],yle=ze(ile,{name:"MuiPopper",slot:"Root",overridesResolver:(t,e)=>e.root})({}),Yf=E.forwardRef(function(e,n){var r;const i=XV(),o=kt({props:e,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:u,container:c,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:g,popperOptions:b,popperRef:m,transition:w,slots:x,slotProps:_}=o,C=Be(o,vle),S=(r=x==null?void 0:x.root)!=null?r:l==null?void 0:l.Root,M=O({anchorEl:s,container:c,disablePortal:d,keepMounted:f,modifiers:h,open:p,placement:g,popperOptions:b,popperRef:m,transition:w},C);return D.jsx(yle,O({as:a,direction:i==null?void 0:i.direction,slots:{root:S},slotProps:_??u},M,{ref:n}))});function ble(t){return It("MuiListSubheader",t)}At("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const xle=["className","color","component","disableGutters","disableSticky","inset"],wle=t=>{const{classes:e,color:n,disableGutters:r,inset:i,disableSticky:o}=t,s={root:["root",n!=="default"&&`color${Ge(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return Qe(s,ble,e)},_le=ze("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Ge(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(({theme:t,ownerState:e})=>O({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},e.color==="primary"&&{color:(t.vars||t).palette.primary.main},e.color==="inherit"&&{color:"inherit"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.inset&&{paddingLeft:72},!e.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),YV=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiListSubheader"}),{className:i,color:o="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:u=!1}=r,c=Be(r,xle),d=O({},r,{color:o,component:s,disableGutters:a,disableSticky:l,inset:u}),f=wle(d);return D.jsx(_le,O({as:s,className:nt(f.root,i),ref:n,ownerState:d},c))});YV.muiSkipListHighlight=!0;const Sle=mn(D.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Cle(t){return It("MuiChip",t)}const Mn=At("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Ele=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],Mle=t=>{const{classes:e,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=t,u={root:["root",l,n&&"disabled",`size${Ge(r)}`,`color${Ge(i)}`,a&&"clickable",a&&`clickableColor${Ge(i)}`,s&&"deletable",s&&`deletableColor${Ge(i)}`,`${l}${Ge(i)}`],label:["label",`label${Ge(r)}`],avatar:["avatar",`avatar${Ge(r)}`,`avatarColor${Ge(i)}`],icon:["icon",`icon${Ge(r)}`,`iconColor${Ge(o)}`],deleteIcon:["deleteIcon",`deleteIcon${Ge(r)}`,`deleteIconColor${Ge(i)}`,`deleteIcon${Ge(l)}Color${Ge(i)}`]};return Qe(u,Cle,e)},Tle=ze("div",{name:"MuiChip",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${Mn.avatar}`]:e.avatar},{[`& .${Mn.avatar}`]:e[`avatar${Ge(a)}`]},{[`& .${Mn.avatar}`]:e[`avatarColor${Ge(r)}`]},{[`& .${Mn.icon}`]:e.icon},{[`& .${Mn.icon}`]:e[`icon${Ge(a)}`]},{[`& .${Mn.icon}`]:e[`iconColor${Ge(i)}`]},{[`& .${Mn.deleteIcon}`]:e.deleteIcon},{[`& .${Mn.deleteIcon}`]:e[`deleteIcon${Ge(a)}`]},{[`& .${Mn.deleteIcon}`]:e[`deleteIconColor${Ge(r)}`]},{[`& .${Mn.deleteIcon}`]:e[`deleteIcon${Ge(l)}Color${Ge(r)}`]},e.root,e[`size${Ge(a)}`],e[`color${Ge(r)}`],o&&e.clickable,o&&r!=="default"&&e[`clickableColor${Ge(r)})`],s&&e.deletable,s&&r!=="default"&&e[`deletableColor${Ge(r)}`],e[l],e[`${l}${Ge(r)}`]]}})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?t.palette.grey[700]:t.palette.grey[300];return O({maxWidth:"100%",fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(t.vars||t).palette.text.primary,backgroundColor:(t.vars||t).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:t.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Mn.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Mn.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:t.vars?t.vars.palette.Chip.defaultAvatarColor:n,fontSize:t.typography.pxToRem(12)},[`& .${Mn.avatarColorPrimary}`]:{color:(t.vars||t).palette.primary.contrastText,backgroundColor:(t.vars||t).palette.primary.dark},[`& .${Mn.avatarColorSecondary}`]:{color:(t.vars||t).palette.secondary.contrastText,backgroundColor:(t.vars||t).palette.secondary.dark},[`& .${Mn.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:t.typography.pxToRem(10)},[`& .${Mn.icon}`]:O({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&O({color:t.vars?t.vars.palette.Chip.defaultIconColor:n},e.color!=="default"&&{color:"inherit"})),[`& .${Mn.deleteIcon}`]:O({WebkitTapHighlightColor:"transparent",color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.26)`:fn(t.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:fn(t.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:t.vars?`rgba(${t.vars.palette[e.color].contrastTextChannel} / 0.7)`:fn(t.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(t.vars||t).palette[e.color].main,color:(t.vars||t).palette[e.color].contrastText},e.onDelete&&{[`&.${Mn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${Mn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}})},({theme:t,ownerState:e})=>O({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)},[`&.${Mn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.action.selectedChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.action.selected,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)},"&:active":{boxShadow:(t.vars||t).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${Mn.focusVisible}`]:{backgroundColor:(t.vars||t).palette[e.color].dark}}),({theme:t,ownerState:e})=>O({},e.variant==="outlined"&&{backgroundColor:"transparent",border:t.vars?`1px solid ${t.vars.palette.Chip.defaultBorder}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[700]}`,[`&.${Mn.clickable}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Mn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`& .${Mn.avatar}`]:{marginLeft:4},[`& .${Mn.avatarSmall}`]:{marginLeft:2},[`& .${Mn.icon}`]:{marginLeft:4},[`& .${Mn.iconSmall}`]:{marginLeft:2},[`& .${Mn.deleteIcon}`]:{marginRight:5},[`& .${Mn.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(t.vars||t).palette[e.color].main,border:`1px solid ${t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:fn(t.palette[e.color].main,.7)}`,[`&.${Mn.clickable}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette[e.color].main,t.palette.action.hoverOpacity)},[`&.${Mn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.focusOpacity})`:fn(t.palette[e.color].main,t.palette.action.focusOpacity)},[`& .${Mn.deleteIcon}`]:{color:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / 0.7)`:fn(t.palette[e.color].main,.7),"&:hover, &:active":{color:(t.vars||t).palette[e.color].main}}})),Ale=ze("span",{name:"MuiChip",slot:"Label",overridesResolver:(t,e)=>{const{ownerState:n}=t,{size:r}=n;return[e.label,e[`label${Ge(r)}`]]}})(({ownerState:t})=>O({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},t.variant==="outlined"&&{paddingLeft:11,paddingRight:11},t.size==="small"&&{paddingLeft:8,paddingRight:8},t.size==="small"&&t.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function T5(t){return t.key==="Backspace"||t.key==="Delete"}const HI=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:u,disabled:c=!1,icon:d,label:f,onClick:h,onDelete:p,onKeyDown:g,onKeyUp:b,size:m="medium",variant:w="filled",tabIndex:x,skipFocusWhenDisabled:_=!1}=r,C=Be(r,Ele),S=E.useRef(null),M=An(S,n),P=N=>{N.stopPropagation(),p&&p(N)},A=N=>{N.currentTarget===N.target&&T5(N)&&N.preventDefault(),g&&g(N)},R=N=>{N.currentTarget===N.target&&(p&&T5(N)?p(N):N.key==="Escape"&&S.current&&S.current.blur()),b&&b(N)},F=s!==!1&&h?!0:s,$=F||p?Bm:l||"div",j=O({},r,{component:$,disabled:c,size:m,color:a,iconColor:E.isValidElement(d)&&d.props.color||a,onDelete:!!p,clickable:F,variant:w}),k=Mle(j),U=$===Bm?O({component:l||"div",focusVisibleClassName:k.focusVisible},p&&{disableRipple:!0}):{};let G=null;p&&(G=u&&E.isValidElement(u)?E.cloneElement(u,{className:nt(u.props.className,k.deleteIcon),onClick:P}):D.jsx(Sle,{className:nt(k.deleteIcon),onClick:P}));let B=null;i&&E.isValidElement(i)&&(B=E.cloneElement(i,{className:nt(k.avatar,i.props.className)}));let L=null;return d&&E.isValidElement(d)&&(L=E.cloneElement(d,{className:nt(k.icon,d.props.className)})),D.jsxs(Tle,O({as:$,className:nt(k.root,o),disabled:F&&c?!0:void 0,onClick:h,onKeyDown:A,onKeyUp:R,ref:M,tabIndex:_&&c?-1:x,ownerState:j},U,C,{children:[B||L,D.jsx(Ale,{className:nt(k.label),ownerState:j,children:f}),G]}))});function xd({props:t,states:e,muiFormControl:n}){return e.reduce((r,i)=>(r[i]=t[i],n&&typeof t[i]>"u"&&(r[i]=n[i]),r),{})}const eE=E.createContext(void 0);function Wl(){return E.useContext(eE)}function ZV(t){return D.jsx(Ere,O({},t,{defaultTheme:ZC,themeId:Qy}))}function A5(t){return t!=null&&!(Array.isArray(t)&&t.length===0)}function q_(t,e=!1){return t&&(A5(t.value)&&t.value!==""||e&&A5(t.defaultValue)&&t.defaultValue!=="")}function Ple(t){return t.startAdornment}function Dle(t){return It("MuiInputBase",t)}const vs=At("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Rle=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],tE=(t,e)=>{const{ownerState:n}=t;return[e.root,n.formControl&&e.formControl,n.startAdornment&&e.adornedStart,n.endAdornment&&e.adornedEnd,n.error&&e.error,n.size==="small"&&e.sizeSmall,n.multiline&&e.multiline,n.color&&e[`color${Ge(n.color)}`],n.fullWidth&&e.fullWidth,n.hiddenLabel&&e.hiddenLabel]},nE=(t,e)=>{const{ownerState:n}=t;return[e.input,n.size==="small"&&e.inputSizeSmall,n.multiline&&e.inputMultiline,n.type==="search"&&e.inputTypeSearch,n.startAdornment&&e.inputAdornedStart,n.endAdornment&&e.inputAdornedEnd,n.hiddenLabel&&e.inputHiddenLabel]},Ile=t=>{const{classes:e,color:n,disabled:r,error:i,endAdornment:o,focused:s,formControl:a,fullWidth:l,hiddenLabel:u,multiline:c,readOnly:d,size:f,startAdornment:h,type:p}=t,g={root:["root",`color${Ge(n)}`,r&&"disabled",i&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",f&&f!=="medium"&&`size${Ge(f)}`,c&&"multiline",h&&"adornedStart",o&&"adornedEnd",u&&"hiddenLabel",d&&"readOnly"],input:["input",r&&"disabled",p==="search"&&"inputTypeSearch",c&&"inputMultiline",f==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",h&&"inputAdornedStart",o&&"inputAdornedEnd",d&&"readOnly"]};return Qe(g,Dle,e)},rE=ze("div",{name:"MuiInputBase",slot:"Root",overridesResolver:tE})(({theme:t,ownerState:e})=>O({},t.typography.body1,{color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${vs.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"}},e.multiline&&O({padding:"4px 0 5px"},e.size==="small"&&{paddingTop:1}),e.fullWidth&&{width:"100%"})),iE=ze("input",{name:"MuiInputBase",slot:"Input",overridesResolver:nE})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light",r=O({color:"currentColor"},t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})}),i={opacity:"0 !important"},o=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return O({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${vs.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&:-ms-input-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus:-ms-input-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${vs.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},e.size==="small"&&{paddingTop:1},e.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},e.type==="search"&&{MozAppearance:"textfield"})}),Nle=D.jsx(ZV,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),Fle=E.forwardRef(function(e,n){var r;const i=kt({props:e,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:s,autoFocus:a,className:l,components:u={},componentsProps:c={},defaultValue:d,disabled:f,disableInjectingGlobalStyles:h,endAdornment:p,fullWidth:g=!1,id:b,inputComponent:m="input",inputProps:w={},inputRef:x,maxRows:_,minRows:C,multiline:S=!1,name:M,onBlur:P,onChange:A,onClick:R,onFocus:F,onKeyDown:$,onKeyUp:j,placeholder:k,readOnly:U,renderSuffix:G,rows:B,slotProps:L={},slots:N={},startAdornment:W,type:K="text",value:Q}=i,J=Be(i,Rle),ae=w.value!=null?w.value:Q,{current:ve}=E.useRef(ae!=null),fe=E.useRef(),Me=E.useCallback(ue=>{},[]),ye=An(fe,x,w.ref,Me),[we,Fe]=E.useState(!1),Oe=Wl(),re=xd({props:i,muiFormControl:Oe,states:["color","disabled","error","hiddenLabel","size","required","filled"]});re.focused=Oe?Oe.focused:we,E.useEffect(()=>{!Oe&&f&&we&&(Fe(!1),P&&P())},[Oe,f,we,P]);const _e=Oe&&Oe.onFilled,Ce=Oe&&Oe.onEmpty,X=E.useCallback(ue=>{q_(ue)?_e&&_e():Ce&&Ce()},[_e,Ce]);_r(()=>{ve&&X({value:ae})},[ae,X,ve]);const Z=ue=>{if(re.disabled){ue.stopPropagation();return}F&&F(ue),w.onFocus&&w.onFocus(ue),Oe&&Oe.onFocus?Oe.onFocus(ue):Fe(!0)},he=ue=>{P&&P(ue),w.onBlur&&w.onBlur(ue),Oe&&Oe.onBlur?Oe.onBlur(ue):Fe(!1)},Y=(ue,...ge)=>{if(!ve){const be=ue.target||fe.current;if(be==null)throw new Error(Bu(1));X({value:be.value})}w.onChange&&w.onChange(ue,...ge),A&&A(ue,...ge)};E.useEffect(()=>{X(fe.current)},[]);const ne=ue=>{fe.current&&ue.currentTarget===ue.target&&fe.current.focus(),R&&R(ue)};let se=m,xe=w;S&&se==="input"&&(B?xe=O({type:void 0,minRows:B,maxRows:B},xe):xe=O({type:void 0,maxRows:_,minRows:C},xe),se=lle);const Pe=ue=>{X(ue.animationName==="mui-auto-fill-cancel"?fe.current:{value:"x"})};E.useEffect(()=>{Oe&&Oe.setAdornedStart(!!W)},[Oe,W]);const z=O({},i,{color:re.color||"primary",disabled:re.disabled,endAdornment:p,error:re.error,focused:re.focused,formControl:Oe,fullWidth:g,hiddenLabel:re.hiddenLabel,multiline:S,size:re.size,startAdornment:W,type:K}),H=Ile(z),te=N.root||u.Root||rE,le=L.root||c.root||{},de=N.input||u.Input||iE;return xe=O({},xe,(r=L.input)!=null?r:c.input),D.jsxs(E.Fragment,{children:[!h&&Nle,D.jsxs(te,O({},le,!oy(te)&&{ownerState:O({},z,le.ownerState)},{ref:n,onClick:ne},J,{className:nt(H.root,le.className,l,U&&"MuiInputBase-readOnly"),children:[W,D.jsx(eE.Provider,{value:null,children:D.jsx(de,O({ownerState:z,"aria-invalid":re.error,"aria-describedby":o,autoComplete:s,autoFocus:a,defaultValue:d,disabled:re.disabled,id:b,onAnimationStart:Pe,name:M,placeholder:k,readOnly:U,required:re.required,rows:B,value:ae,onKeyDown:$,onKeyUp:j,type:K},xe,!oy(de)&&{as:se,ownerState:O({},z,xe.ownerState)},{ref:ye,className:nt(H.input,xe.className,U&&"MuiInputBase-readOnly"),onBlur:he,onChange:Y,onFocus:Z}))}),p,G?G(O({},re,{startAdornment:W})):null]}))]})}),fg=Fle;function Ole(t){return It("MuiInput",t)}const Ic=O({},vs,At("MuiInput",["root","underline","input"]));function kle(t){return It("MuiOutlinedInput",t)}const gl=O({},vs,At("MuiOutlinedInput",["root","notchedOutline","input"]));function Lle(t){return It("MuiFilledInput",t)}const ys=O({},vs,At("MuiFilledInput",["root","underline","input"])),QV=mn(D.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Ble(t){return It("MuiAutocomplete",t)}const sn=At("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var P5,D5;const $le=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],zle=["ref"],Ule=DI(),Hle=t=>{const{classes:e,disablePortal:n,expanded:r,focused:i,fullWidth:o,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:u,size:c}=t,d={root:["root",r&&"expanded",i&&"focused",o&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Ge(c)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Qe(d,Ble,e)},Vle=ze("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{fullWidth:r,hasClearIcon:i,hasPopupIcon:o,inputFocused:s,size:a}=n;return[{[`& .${sn.tag}`]:e.tag},{[`& .${sn.tag}`]:e[`tagSize${Ge(a)}`]},{[`& .${sn.inputRoot}`]:e.inputRoot},{[`& .${sn.input}`]:e.input},{[`& .${sn.input}`]:s&&e.inputFocused},e.root,r&&e.fullWidth,o&&e.hasPopupIcon,i&&e.hasClearIcon]}})({[`&.${sn.focused} .${sn.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${sn.clearIndicator}`]:{visibility:"visible"}},[`& .${sn.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${sn.inputRoot}`]:{flexWrap:"wrap",[`.${sn.hasPopupIcon}&, .${sn.hasClearIcon}&`]:{paddingRight:30},[`.${sn.hasPopupIcon}.${sn.hasClearIcon}&`]:{paddingRight:56},[`& .${sn.input}`]:{width:0,minWidth:30}},[`& .${Ic.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Ic.root}.${vs.sizeSmall}`]:{[`& .${Ic.input}`]:{padding:"2px 4px 3px 0"}},[`& .${gl.root}`]:{padding:9,[`.${sn.hasPopupIcon}&, .${sn.hasClearIcon}&`]:{paddingRight:39},[`.${sn.hasPopupIcon}.${sn.hasClearIcon}&`]:{paddingRight:65},[`& .${sn.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${sn.endAdornment}`]:{right:9}},[`& .${gl.root}.${vs.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${sn.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${ys.root}`]:{paddingTop:19,paddingLeft:8,[`.${sn.hasPopupIcon}&, .${sn.hasClearIcon}&`]:{paddingRight:39},[`.${sn.hasPopupIcon}.${sn.hasClearIcon}&`]:{paddingRight:65},[`& .${ys.input}`]:{padding:"7px 4px"},[`& .${sn.endAdornment}`]:{right:9}},[`& .${ys.root}.${vs.sizeSmall}`]:{paddingBottom:1,[`& .${ys.input}`]:{padding:"2.5px 4px"}},[`& .${vs.hiddenLabel}`]:{paddingTop:8},[`& .${ys.root}.${vs.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${sn.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${ys.root}.${vs.hiddenLabel}.${vs.sizeSmall}`]:{[`& .${sn.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${sn.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${sn.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${sn.input}`]:{opacity:1}}}]}),Gle=ze("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,e)=>e.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),jle=ze(io,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),Wle=ze(io,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},e)=>O({},e.popupIndicator,t.popupOpen&&e.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),qle=ze(Yf,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${sn.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),Xle=ze(Xu,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>O({},t.typography.body1,{overflow:"auto"})),Kle=ze("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Yle=ze("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Zle=ze("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${sn.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${sn.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${sn.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${sn.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${sn.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),Qle=ze(YV,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,e)=>e.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),Jle=ze("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,e)=>e.groupUl})({padding:0,[`& .${sn.option}`]:{paddingLeft:24}}),ly=E.forwardRef(function(e,n){var r,i,o,s;const a=Ule({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:u=!1,autoSelect:c=!1,blurOnSelect:d=!1,ChipProps:f,className:h,clearIcon:p=P5||(P5=D.jsx(dse,{fontSize:"small"})),clearOnBlur:g=!a.freeSolo,clearOnEscape:b=!1,clearText:m="Clear",closeText:w="Close",componentsProps:x={},defaultValue:_=a.multiple?[]:null,disableClearable:C=!1,disableCloseOnSelect:S=!1,disabled:M=!1,disabledItemsFocusable:P=!1,disableListWrap:A=!1,disablePortal:R=!1,filterSelectedOptions:F=!1,forcePopupIcon:$="auto",freeSolo:j=!1,fullWidth:k=!1,getLimitTagsText:U=pe=>`+${pe}`,getOptionLabel:G,groupBy:B,handleHomeEndKeys:L=!a.freeSolo,includeInputInList:N=!1,limitTags:W=-1,ListboxComponent:K="ul",ListboxProps:Q,loading:J=!1,loadingText:ae="Loading…",multiple:ve=!1,noOptionsText:fe="No options",openOnFocus:Me=!1,openText:ye="Open",PaperComponent:we=Xu,PopperComponent:Fe=Yf,popupIcon:Oe=D5||(D5=D.jsx(QV,{})),readOnly:re=!1,renderGroup:_e,renderInput:Ce,renderOption:X,renderTags:Z,selectOnFocus:he=!a.freeSolo,size:Y="medium",slotProps:ne={}}=a,se=Be(a,$le),{getRootProps:xe,getInputProps:Pe,getInputLabelProps:z,getPopupIndicatorProps:H,getClearProps:te,getTagProps:le,getListboxProps:de,getOptionProps:ue,value:ge,dirty:be,expanded:Te,id:Re,popupOpen:Ve,focused:Le,focusedTag:Ye,anchorEl:it,setAnchorEl:ot,inputValue:ht,groupedOptions:Je}=dle(O({},a,{componentName:"Autocomplete"})),Ot=!C&&!M&&be&&!re,Se=(!j||$===!0)&&$!==!1,{onMouseDown:st}=Pe(),{ref:Ze}=Q??{},je=de(),{ref:et}=je,Tt=Be(je,zle),Qt=An(et,Ze),Vn=G||(pe=>{var Ae;return(Ae=pe.label)!=null?Ae:pe}),Ut=O({},a,{disablePortal:R,expanded:Te,focused:Le,fullWidth:k,getOptionLabel:Vn,hasClearIcon:Ot,hasPopupIcon:Se,inputFocused:Ye===-1,popupOpen:Ve,size:Y}),Wt=Hle(Ut);let On;if(ve&&ge.length>0){const pe=Ae=>O({className:Wt.tag,disabled:M},le(Ae));Z?On=Z(ge,pe,Ut):On=ge.map((Ae,Ee)=>D.jsx(HI,O({label:Vn(Ae),size:Y},pe({index:Ee}),f)))}if(W>-1&&Array.isArray(On)){const pe=On.length-W;!Le&&pe>0&&(On=On.splice(0,W),On.push(D.jsx("span",{className:Wt.tag,children:U(pe)},On.length)))}const Ii=_e||(pe=>D.jsxs("li",{children:[D.jsx(Qle,{className:Wt.groupLabel,ownerState:Ut,component:"div",children:pe.group}),D.jsx(Jle,{className:Wt.groupUl,ownerState:Ut,children:pe.children})]},pe.key)),jr=X||((pe,Ae)=>E.createElement("li",O({},pe,{key:pe.key}),Vn(Ae))),Ni=(pe,Ae)=>{const Ee=ue({option:pe,index:Ae});return jr(O({},Ee,{className:Wt.option}),pe,{selected:Ee["aria-selected"],index:Ae,inputValue:ht},Ut)},co=(r=ne.clearIndicator)!=null?r:x.clearIndicator,Fi=(i=ne.paper)!=null?i:x.paper,fo=(o=ne.popper)!=null?o:x.popper,qe=(s=ne.popupIndicator)!=null?s:x.popupIndicator,Ue=pe=>D.jsx(qle,O({as:Fe,disablePortal:R,style:{width:it?it.clientWidth:null},ownerState:Ut,role:"presentation",anchorEl:it,open:Ve},fo,{className:nt(Wt.popper,fo==null?void 0:fo.className),children:D.jsx(Xle,O({ownerState:Ut,as:we},Fi,{className:nt(Wt.paper,Fi==null?void 0:Fi.className),children:pe}))}));let ee=null;return Je.length>0?ee=Ue(D.jsx(Zle,O({as:K,className:Wt.listbox,ownerState:Ut},Tt,Q,{ref:Qt,children:Je.map((pe,Ae)=>B?Ii({key:pe.key,group:pe.group,children:pe.options.map((Ee,ke)=>Ni(Ee,pe.index+ke))}):Ni(pe,Ae))}))):J&&Je.length===0?ee=Ue(D.jsx(Kle,{className:Wt.loading,ownerState:Ut,children:ae})):Je.length===0&&!j&&!J&&(ee=Ue(D.jsx(Yle,{className:Wt.noOptions,ownerState:Ut,role:"presentation",onMouseDown:pe=>{pe.preventDefault()},children:fe}))),D.jsxs(E.Fragment,{children:[D.jsx(Vle,O({ref:n,className:nt(Wt.root,h),ownerState:Ut},xe(se),{children:Ce({id:Re,disabled:M,fullWidth:!0,size:Y==="small"?"small":void 0,InputLabelProps:z(),InputProps:O({ref:ot,className:Wt.inputRoot,startAdornment:On,onClick:pe=>{pe.target===pe.currentTarget&&st(pe)}},(Ot||Se)&&{endAdornment:D.jsxs(Gle,{className:Wt.endAdornment,ownerState:Ut,children:[Ot?D.jsx(jle,O({},te(),{"aria-label":m,title:m,ownerState:Ut},co,{className:nt(Wt.clearIndicator,co==null?void 0:co.className),children:p})):null,Se?D.jsx(Wle,O({},H(),{disabled:M,"aria-label":Ve?w:ye,title:Ve?w:ye,ownerState:Ut},qe,{className:nt(Wt.popupIndicator,qe==null?void 0:qe.className),children:Oe})):null]})}),inputProps:O({className:Wt.input,disabled:M,readOnly:re},Pe())})})),it?ee:null]})}),eue=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],tue={entering:{opacity:1},entered:{opacity:1}},JV=E.forwardRef(function(e,n){const r=ob(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:a,easing:l,in:u,onEnter:c,onEntered:d,onEntering:f,onExit:h,onExited:p,onExiting:g,style:b,timeout:m=i,TransitionComponent:w=jl}=e,x=Be(e,eue),_=E.useRef(null),C=An(_,a.ref,n),S=k=>U=>{if(k){const G=_.current;U===void 0?k(G):k(G,U)}},M=S(f),P=S((k,U)=>{DV(k);const G=j_({style:b,timeout:m,easing:l},{mode:"enter"});k.style.webkitTransition=r.transitions.create("opacity",G),k.style.transition=r.transitions.create("opacity",G),c&&c(k,U)}),A=S(d),R=S(g),F=S(k=>{const U=j_({style:b,timeout:m,easing:l},{mode:"exit"});k.style.webkitTransition=r.transitions.create("opacity",U),k.style.transition=r.transitions.create("opacity",U),h&&h(k)}),$=S(p),j=k=>{o&&o(_.current,k)};return D.jsx(w,O({appear:s,in:u,nodeRef:_,onEnter:P,onEntered:A,onEntering:M,onExit:F,onExited:$,onExiting:R,addEndListener:j,timeout:m},x,{children:(k,U)=>E.cloneElement(a,O({style:O({opacity:0,visibility:k==="exited"&&!u?"hidden":void 0},tue[k],b,a.props.style),ref:C},U))}))});function nue(t){return It("MuiBackdrop",t)}At("MuiBackdrop",["root","invisible"]);const rue=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],iue=t=>{const{classes:e,invisible:n}=t;return Qe({root:["root",n&&"invisible"]},nue,e)},oue=ze("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.invisible&&e.invisible]}})(({ownerState:t})=>O({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},t.invisible&&{backgroundColor:"transparent"})),eG=E.forwardRef(function(e,n){var r,i,o;const s=kt({props:e,name:"MuiBackdrop"}),{children:a,className:l,component:u="div",components:c={},componentsProps:d={},invisible:f=!1,open:h,slotProps:p={},slots:g={},TransitionComponent:b=JV,transitionDuration:m}=s,w=Be(s,rue),x=O({},s,{component:u,invisible:f}),_=iue(x),C=(r=p.root)!=null?r:d.root;return D.jsx(b,O({in:h,timeout:m},w,{children:D.jsx(oue,O({"aria-hidden":!0},C,{as:(i=(o=g.root)!=null?o:c.Root)!=null?i:u,className:nt(_.root,l,C==null?void 0:C.className),ownerState:O({},x,C==null?void 0:C.ownerState),classes:_,ref:n,children:a}))}))});function sue(t){return It("MuiBadge",t)}const uc=At("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),aue=["anchorOrigin","className","classes","component","components","componentsProps","children","overlap","color","invisible","max","badgeContent","slots","slotProps","showZero","variant"],fT=10,hT=4,lue=DI(),uue=t=>{const{color:e,anchorOrigin:n,invisible:r,overlap:i,variant:o,classes:s={}}=t,a={root:["root"],badge:["badge",o,r&&"invisible",`anchorOrigin${Ge(n.vertical)}${Ge(n.horizontal)}`,`anchorOrigin${Ge(n.vertical)}${Ge(n.horizontal)}${Ge(i)}`,`overlap${Ge(i)}`,e!=="default"&&`color${Ge(e)}`]};return Qe(a,sue,s)},cue=ze("span",{name:"MuiBadge",slot:"Root",overridesResolver:(t,e)=>e.root})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),due=ze("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.badge,e[n.variant],e[`anchorOrigin${Ge(n.anchorOrigin.vertical)}${Ge(n.anchorOrigin.horizontal)}${Ge(n.overlap)}`],n.color!=="default"&&e[`color${Ge(n.color)}`],n.invisible&&e.invisible]}})(({theme:t})=>{var e;return{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(12),minWidth:fT*2,lineHeight:1,padding:"0 6px",height:fT*2,borderRadius:fT,zIndex:1,transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.enteringScreen}),variants:[...Object.keys(((e=t.vars)!=null?e:t).palette).filter(n=>{var r,i;return((r=t.vars)!=null?r:t).palette[n].main&&((i=t.vars)!=null?i:t).palette[n].contrastText}).map(n=>({props:{color:n},style:{backgroundColor:(t.vars||t).palette[n].main,color:(t.vars||t).palette[n].contrastText}})),{props:{variant:"dot"},style:{borderRadius:hT,height:hT*2,minWidth:hT*2,padding:0}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="right"&&n.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="top"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:n})=>n.anchorOrigin.vertical==="bottom"&&n.anchorOrigin.horizontal==="left"&&n.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${uc.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:t.transitions.create("transform",{easing:t.transitions.easing.easeInOut,duration:t.transitions.duration.leavingScreen})}}]}}),VI=E.forwardRef(function(e,n){var r,i,o,s,a,l;const u=lue({props:e,name:"MuiBadge"}),{anchorOrigin:c={vertical:"top",horizontal:"right"},className:d,component:f,components:h={},componentsProps:p={},children:g,overlap:b="rectangular",color:m="default",invisible:w=!1,max:x=99,badgeContent:_,slots:C,slotProps:S,showZero:M=!1,variant:P="standard"}=u,A=Be(u,aue),{badgeContent:R,invisible:F,max:$,displayValue:j}=Sse({max:x,invisible:w,badgeContent:_,showZero:M}),k=SI({anchorOrigin:c,color:m,overlap:b,variant:P,badgeContent:_}),U=F||R==null&&P!=="dot",{color:G=m,overlap:B=b,anchorOrigin:L=c,variant:N=P}=U?k:u,W=N!=="dot"?j:void 0,K=O({},u,{badgeContent:R,invisible:U,max:$,displayValue:W,showZero:M,anchorOrigin:L,color:G,overlap:B,variant:N}),Q=uue(K),J=(r=(i=C==null?void 0:C.root)!=null?i:h.Root)!=null?r:cue,ae=(o=(s=C==null?void 0:C.badge)!=null?s:h.Badge)!=null?o:due,ve=(a=S==null?void 0:S.root)!=null?a:p.root,fe=(l=S==null?void 0:S.badge)!=null?l:p.badge,Me=$u({elementType:J,externalSlotProps:ve,externalForwardedProps:A,additionalProps:{ref:n,as:f},ownerState:K,className:nt(ve==null?void 0:ve.className,Q.root,d)}),ye=$u({elementType:ae,externalSlotProps:fe,ownerState:K,className:nt(Q.badge,fe==null?void 0:fe.className)});return D.jsxs(J,O({},Me,{children:[g,D.jsx(ae,O({},ye,{children:W}))]}))}),fue=At("MuiBox",["root"]),hue=MV(),pue=Rre({themeId:Qy,defaultTheme:hue,defaultClassName:fue.root,generateClassName:pI.generate});function mue(t){return It("MuiButton",t)}const yx=At("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),gue=E.createContext({}),vue=E.createContext(void 0),yue=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],bue=t=>{const{color:e,disableElevation:n,fullWidth:r,size:i,variant:o,classes:s}=t,a={root:["root",o,`${o}${Ge(e)}`,`size${Ge(i)}`,`${o}Size${Ge(i)}`,`color${Ge(e)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${Ge(i)}`],endIcon:["icon","endIcon",`iconSize${Ge(i)}`]},l=Qe(a,mue,s);return O({},s,l)},tG=t=>O({},t.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},t.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},t.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),xue=ze(Bm,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Ge(n.color)}`],e[`size${Ge(n.size)}`],e[`${n.variant}Size${Ge(n.size)}`],n.color==="inherit"&&e.colorInherit,n.disableElevation&&e.disableElevation,n.fullWidth&&e.fullWidth]}})(({theme:t,ownerState:e})=>{var n,r;const i=t.palette.mode==="light"?t.palette.grey[300]:t.palette.grey[800],o=t.palette.mode==="light"?t.palette.grey.A100:t.palette.grey[700];return O({},t.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":O({textDecoration:"none",backgroundColor:t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette.text.primary,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="text"&&e.color!=="inherit"&&{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="outlined"&&e.color!=="inherit"&&{border:`1px solid ${(t.vars||t).palette[e.color].main}`,backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},e.variant==="contained"&&{backgroundColor:t.vars?t.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2],backgroundColor:(t.vars||t).palette.grey[300]}},e.variant==="contained"&&e.color!=="inherit"&&{backgroundColor:(t.vars||t).palette[e.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[e.color].main}}),"&:active":O({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[8]}),[`&.${yx.focusVisible}`]:O({},e.variant==="contained"&&{boxShadow:(t.vars||t).shadows[6]}),[`&.${yx.disabled}`]:O({color:(t.vars||t).palette.action.disabled},e.variant==="outlined"&&{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},e.variant==="contained"&&{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground})},e.variant==="text"&&{padding:"6px 8px"},e.variant==="text"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main},e.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},e.variant==="outlined"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main,border:t.vars?`1px solid rgba(${t.vars.palette[e.color].mainChannel} / 0.5)`:`1px solid ${fn(t.palette[e.color].main,.5)}`},e.variant==="contained"&&{color:t.vars?t.vars.palette.text.primary:(n=(r=t.palette).getContrastText)==null?void 0:n.call(r,t.palette.grey[300]),backgroundColor:t.vars?t.vars.palette.Button.inheritContainedBg:i,boxShadow:(t.vars||t).shadows[2]},e.variant==="contained"&&e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].contrastText,backgroundColor:(t.vars||t).palette[e.color].main},e.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},e.size==="small"&&e.variant==="text"&&{padding:"4px 5px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="text"&&{padding:"8px 11px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="outlined"&&{padding:"3px 9px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="outlined"&&{padding:"7px 21px",fontSize:t.typography.pxToRem(15)},e.size==="small"&&e.variant==="contained"&&{padding:"4px 10px",fontSize:t.typography.pxToRem(13)},e.size==="large"&&e.variant==="contained"&&{padding:"8px 22px",fontSize:t.typography.pxToRem(15)},e.fullWidth&&{width:"100%"})},({ownerState:t})=>t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${yx.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${yx.disabled}`]:{boxShadow:"none"}}),wue=ze("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.startIcon,e[`iconSize${Ge(n.size)}`]]}})(({ownerState:t})=>O({display:"inherit",marginRight:8,marginLeft:-4},t.size==="small"&&{marginLeft:-2},tG(t))),_ue=ze("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.endIcon,e[`iconSize${Ge(n.size)}`]]}})(({ownerState:t})=>O({display:"inherit",marginRight:-4,marginLeft:8},t.size==="small"&&{marginRight:-2},tG(t))),Bf=E.forwardRef(function(e,n){const r=E.useContext(gue),i=E.useContext(vue),o=vI(r,e),s=kt({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:u="button",className:c,disabled:d=!1,disableElevation:f=!1,disableFocusRipple:h=!1,endIcon:p,focusVisibleClassName:g,fullWidth:b=!1,size:m="medium",startIcon:w,type:x,variant:_="text"}=s,C=Be(s,yue),S=O({},s,{color:l,component:u,disabled:d,disableElevation:f,disableFocusRipple:h,fullWidth:b,size:m,type:x,variant:_}),M=bue(S),P=w&&D.jsx(wue,{className:M.startIcon,ownerState:S,children:w}),A=p&&D.jsx(_ue,{className:M.endIcon,ownerState:S,children:p}),R=i||"";return D.jsxs(xue,O({ownerState:S,className:nt(r.className,M.root,c,R),component:u,disabled:d,focusRipple:!h,focusVisibleClassName:nt(M.focusVisible,g),ref:n,type:x},C,{classes:M,children:[P,a,A]}))});function Sue(t){return It("MuiCard",t)}At("MuiCard",["root"]);const Cue=["className","raised"],Eue=t=>{const{classes:e}=t;return Qe({root:["root"]},Sue,e)},Mue=ze(Xu,{name:"MuiCard",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({overflow:"hidden"})),xu=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiCard"}),{className:i,raised:o=!1}=r,s=Be(r,Cue),a=O({},r,{raised:o}),l=Eue(a);return D.jsx(Mue,O({className:nt(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a},s))});function Tue(t){return It("MuiCardContent",t)}At("MuiCardContent",["root"]);const Aue=["className","component"],Pue=t=>{const{classes:e}=t;return Qe({root:["root"]},Tue,e)},Due=ze("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(t,e)=>e.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),GI=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiCardContent"}),{className:i,component:o="div"}=r,s=Be(r,Aue),a=O({},r,{component:o}),l=Pue(a);return D.jsx(Due,O({as:o,className:nt(l.root,i),ownerState:a,ref:n},s))});function Rue(t){return It("PrivateSwitchBase",t)}At("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Iue=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Nue=t=>{const{classes:e,checked:n,disabled:r,edge:i}=t,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${Ge(i)}`],input:["input"]};return Qe(o,Rue,e)},Fue=ze(Bm)(({ownerState:t})=>O({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),Oue=ze("input",{shouldForwardProp:uo})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),jI=E.forwardRef(function(e,n){const{autoFocus:r,checked:i,checkedIcon:o,className:s,defaultChecked:a,disabled:l,disableFocusRipple:u=!1,edge:c=!1,icon:d,id:f,inputProps:h,inputRef:p,name:g,onBlur:b,onChange:m,onFocus:w,readOnly:x,required:_=!1,tabIndex:C,type:S,value:M}=e,P=Be(e,Iue),[A,R]=Ru({controlled:i,default:!!a,name:"SwitchBase",state:"checked"}),F=Wl(),$=N=>{w&&w(N),F&&F.onFocus&&F.onFocus(N)},j=N=>{b&&b(N),F&&F.onBlur&&F.onBlur(N)},k=N=>{if(N.nativeEvent.defaultPrevented)return;const W=N.target.checked;R(W),m&&m(N,W)};let U=l;F&&typeof U>"u"&&(U=F.disabled);const G=S==="checkbox"||S==="radio",B=O({},e,{checked:A,disabled:U,disableFocusRipple:u,edge:c}),L=Nue(B);return D.jsxs(Fue,O({component:"span",className:nt(L.root,s),centerRipple:!0,focusRipple:!u,disabled:U,tabIndex:null,role:void 0,onFocus:$,onBlur:j,ownerState:B,ref:n},P,{children:[D.jsx(Oue,O({autoFocus:r,checked:i,defaultChecked:a,className:L.input,disabled:U,id:G?f:void 0,name:g,onChange:k,readOnly:x,ref:p,required:_,ownerState:B,tabIndex:C,type:S},S==="checkbox"&&M===void 0?{}:{value:M},h)),A?o:d]}))}),kue=mn(D.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),Lue=mn(D.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Bue=mn(D.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function $ue(t){return It("MuiCheckbox",t)}const pT=At("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),zue=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],Uue=t=>{const{classes:e,indeterminate:n,color:r,size:i}=t,o={root:["root",n&&"indeterminate",`color${Ge(r)}`,`size${Ge(i)}`]},s=Qe(o,$ue,e);return O({},e,s)},Hue=ze(jI,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.indeterminate&&e.indeterminate,e[`size${Ge(n.size)}`],n.color!=="default"&&e[`color${Ge(n.color)}`]]}})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${pT.checked}, &.${pT.indeterminate}`]:{color:(t.vars||t).palette[e.color].main},[`&.${pT.disabled}`]:{color:(t.vars||t).palette.action.disabled}})),Vue=D.jsx(Lue,{}),Gue=D.jsx(kue,{}),jue=D.jsx(Bue,{}),vc=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiCheckbox"}),{checkedIcon:s=Vue,color:a="primary",icon:l=Gue,indeterminate:u=!1,indeterminateIcon:c=jue,inputProps:d,size:f="medium",className:h}=o,p=Be(o,zue),g=u?c:l,b=u?c:s,m=O({},o,{color:a,indeterminate:u,size:f}),w=Uue(m);return D.jsx(Hue,O({type:"checkbox",inputProps:O({"data-indeterminate":u},d),icon:E.cloneElement(g,{fontSize:(r=g.props.fontSize)!=null?r:f}),checkedIcon:E.cloneElement(b,{fontSize:(i=b.props.fontSize)!=null?i:f}),ownerState:m,ref:n,className:nt(w.root,h)},p,{classes:w}))});function Wue(t){return It("MuiCircularProgress",t)}At("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const que=["className","color","disableShrink","size","style","thickness","value","variant"];let oE=t=>t,R5,I5,N5,F5;const cc=44,Xue=yd(R5||(R5=oE` 0% { transform: rotate(0deg); } @@ -153,7 +153,7 @@ Error generating stack: `+o.message+` animation: ${0} 1.4s linear infinite; `),Xue)),Que=ze("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(t,e)=>e.svg})({display:"block"}),Jue=ze("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.circle,e[`circle${Ge(n.variant)}`],n.disableShrink&&e.circleDisableShrink]}})(({ownerState:t,theme:e})=>O({stroke:"currentColor"},t.variant==="determinate"&&{transition:e.transitions.create("stroke-dashoffset")},t.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink&&km(F5||(F5=oE` animation: ${0} 1.4s ease-in-out infinite; - `),Kue)),ece=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:u=3.6,value:c=0,variant:d="indeterminate"}=r,f=Be(r,que),h=O({},r,{color:o,disableShrink:s,size:a,thickness:u,value:c,variant:d}),p=Yue(h),g={},b={},m={};if(d==="determinate"){const w=2*Math.PI*((cc-u)/2);g.strokeDasharray=w.toFixed(3),m["aria-valuenow"]=Math.round(c),g.strokeDashoffset=`${((100-c)/100*w).toFixed(3)}px`,b.transform="rotate(-90deg)"}return D.jsx(Zue,O({className:nt(p.root,i),style:O({width:a,height:a},b,l),ownerState:h,ref:n,role:"progressbar"},m,f,{children:D.jsx(Que,{className:p.svg,ownerState:h,viewBox:`${cc/2} ${cc/2} ${cc} ${cc}`,children:D.jsx(Jue,{className:p.circle,style:g,ownerState:h,cx:cc,cy:cc,r:(cc-u)/2,fill:"none",strokeWidth:u})})}))}),tce=(t,e)=>O({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),nce=t=>O({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),rce=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([s,a])=>{var l;r[t.getColorSchemeSelector(s).replace(/\s*&/,"")]={colorScheme:(l=a.palette)==null?void 0:l.mode}});let i=O({html:tce(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:O({margin:0},nce(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const o=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function ice(t){const e=kt({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return D.jsxs(E.Fragment,{children:[D.jsx(ZV,{styles:i=>rce(i,r)}),n]})}function oce(t){return It("MuiModal",t)}At("MuiModal",["root","hidden","backdrop"]);const sce=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],ace=t=>{const{open:e,exited:n,classes:r}=t;return Qe({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},oce,r)},lce=ze("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>O({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),uce=ze(eG,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),nG=E.forwardRef(function(e,n){var r,i,o,s,a,l;const u=kt({name:"MuiModal",props:e}),{BackdropComponent:c=uce,BackdropProps:d,className:f,closeAfterTransition:h=!1,children:p,container:g,component:b,components:m={},componentsProps:w={},disableAutoFocus:x=!1,disableEnforceFocus:_=!1,disableEscapeKeyDown:C=!1,disablePortal:S=!1,disableRestoreFocus:M=!1,disableScrollLock:P=!1,hideBackdrop:A=!1,keepMounted:R=!1,onBackdropClick:F,open:$,slotProps:j,slots:k}=u,U=Be(u,sce),G=O({},u,{closeAfterTransition:h,disableAutoFocus:x,disableEnforceFocus:_,disableEscapeKeyDown:C,disablePortal:S,disableRestoreFocus:M,disableScrollLock:P,hideBackdrop:A,keepMounted:R}),{getRootProps:B,getBackdropProps:L,getTransitionProps:N,portalRef:W,isTopModal:K,exited:Q,hasTransition:J}=Vse(O({},G,{rootRef:n})),ae=O({},G,{exited:Q}),ve=ace(ae),fe={};if(p.props.tabIndex===void 0&&(fe.tabIndex="-1"),J){const{onEnter:_e,onExited:Ce}=N();fe.onEnter=_e,fe.onExited=Ce}const Me=(r=(i=k==null?void 0:k.root)!=null?i:m.Root)!=null?r:lce,ye=(o=(s=k==null?void 0:k.backdrop)!=null?s:m.Backdrop)!=null?o:c,we=(a=j==null?void 0:j.root)!=null?a:w.root,Fe=(l=j==null?void 0:j.backdrop)!=null?l:w.backdrop,Oe=$u({elementType:Me,externalSlotProps:we,externalForwardedProps:U,getSlotProps:B,additionalProps:{ref:n,as:b},ownerState:ae,className:nt(f,we==null?void 0:we.className,ve==null?void 0:ve.root,!ae.open&&ae.exited&&(ve==null?void 0:ve.hidden))}),re=$u({elementType:ye,externalSlotProps:Fe,additionalProps:d,getSlotProps:_e=>L(O({},_e,{onClick:Ce=>{F&&F(Ce),_e!=null&&_e.onClick&&_e.onClick(Ce)}})),className:nt(Fe==null?void 0:Fe.className,d==null?void 0:d.className,ve==null?void 0:ve.backdrop),ownerState:ae});return!R&&!$&&(!J||Q)?null:D.jsx(kV,{ref:W,container:g,disablePortal:S,children:D.jsxs(Me,O({},Oe,{children:[!A&&c?D.jsx(ye,O({},re)):null,D.jsx(OV,{disableEnforceFocus:_,disableAutoFocus:x,disableRestoreFocus:M,isEnabled:K,open:$,children:E.cloneElement(p,fe)})]}))})});function cce(t){return It("MuiDialog",t)}const mT=At("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),rG=E.createContext({}),dce=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],fce=ze(eG,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),hce=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,s={root:["root"],container:["container",`scroll${Ge(n)}`],paper:["paper",`paperScroll${Ge(n)}`,`paperWidth${Ge(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Qe(s,cce,e)},pce=ze(nG,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),mce=ze("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${Ge(n.scroll)}`]]}})(({ownerState:t})=>O({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),gce=ze(Xu,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${Ge(n.scroll)}`],e[`paperWidth${Ge(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>O({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${mT.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${mT.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${mT.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),iG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDialog"}),i=ob(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,BackdropComponent:l,BackdropProps:u,children:c,className:d,disableEscapeKeyDown:f=!1,fullScreen:h=!1,fullWidth:p=!1,maxWidth:g="sm",onBackdropClick:b,onClose:m,open:w,PaperComponent:x=Xu,PaperProps:_={},scroll:C="paper",TransitionComponent:S=JV,transitionDuration:M=o,TransitionProps:P}=r,A=Be(r,dce),R=O({},r,{disableEscapeKeyDown:f,fullScreen:h,fullWidth:p,maxWidth:g,scroll:C}),F=hce(R),$=E.useRef(),j=B=>{$.current=B.target===B.currentTarget},k=B=>{$.current&&($.current=null,b&&b(B),m&&m(B,"backdropClick"))},U=jn(a),G=E.useMemo(()=>({titleId:U}),[U]);return D.jsx(pce,O({className:nt(F.root,d),closeAfterTransition:!0,components:{Backdrop:fce},componentsProps:{backdrop:O({transitionDuration:M,as:l},u)},disableEscapeKeyDown:f,onClose:m,open:w,ref:n,onClick:k,ownerState:R},A,{children:D.jsx(S,O({appear:!0,in:w,timeout:M,role:"presentation"},P,{children:D.jsx(mce,{className:nt(F.container),onMouseDown:j,ownerState:R,children:D.jsx(gce,O({as:x,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":U},_,{className:nt(F.paper,_.className),ownerState:R,children:D.jsx(rG.Provider,{value:G,children:c})}))})}))}))});function vce(t){return It("MuiDialogContent",t)}At("MuiDialogContent",["root","dividers"]);function yce(t){return It("MuiDialogTitle",t)}const bce=At("MuiDialogTitle",["root"]),xce=["className","dividers"],wce=t=>{const{classes:e,dividers:n}=t;return Qe({root:["root",n&&"dividers"]},vce,e)},_ce=ze("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>O({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${bce.root} + &`]:{paddingTop:0}})),oG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1}=r,s=Be(r,xce),a=O({},r,{dividers:o}),l=wce(a);return D.jsx(_ce,O({className:nt(l.root,i),ownerState:a,ref:n},s))}),Sce=["className","id"],Cce=t=>{const{classes:e}=t;return Qe({root:["root"]},yce,e)},Ece=ze(xn,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),sG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDialogTitle"}),{className:i,id:o}=r,s=Be(r,Sce),a=r,l=Cce(a),{titleId:u=o}=E.useContext(rG);return D.jsx(Ece,O({component:"h2",className:nt(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??u},s))});function Mce(t){return It("MuiDivider",t)}const O5=At("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Tce=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],Ace=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=t;return Qe({root:["root",e&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},Mce,r)},Pce=ze("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>O({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:fn(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>O({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>O({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>O({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>O({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),Dce=ze("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>O({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),ca=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,component:a=o?"div":"hr",flexItem:l=!1,light:u=!1,orientation:c="horizontal",role:d=a!=="hr"?"separator":void 0,textAlign:f="center",variant:h="fullWidth"}=r,p=Be(r,Tce),g=O({},r,{absolute:i,component:a,flexItem:l,light:u,orientation:c,role:d,textAlign:f,variant:h}),b=Ace(g);return D.jsx(Pce,O({as:a,className:nt(b.root,s),role:d,ref:n,ownerState:g},p,{children:o?D.jsx(Dce,{className:b.wrapper,ownerState:g,children:o}):null}))});ca.muiSkipListHighlight=!0;const Rce=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Ice=t=>{const{classes:e,disableUnderline:n}=t,i=Qe({root:["root",!n&&"underline"],input:["input"]},Lle,e);return O({},e,i)},Nce=ze(rE,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...tE(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return O({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${ys.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${ys.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:a}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ys.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ys.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ys.disabled}, .${ys.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${ys.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&O({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),Fce=ze(iE,{name:"MuiFilledInput",slot:"Input",overridesResolver:nE})(({theme:t,ownerState:e})=>O({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),WI=E.forwardRef(function(e,n){var r,i,o,s;const a=kt({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:u,fullWidth:c=!1,inputComponent:d="input",multiline:f=!1,slotProps:h,slots:p={},type:g="text"}=a,b=Be(a,Rce),m=O({},a,{fullWidth:c,inputComponent:d,multiline:f,type:g}),w=Ice(a),x={root:{ownerState:m},input:{ownerState:m}},_=h??u?Mo(x,h??u):x,C=(r=(i=p.root)!=null?i:l.Root)!=null?r:Nce,S=(o=(s=p.input)!=null?s:l.Input)!=null?o:Fce;return D.jsx(fg,O({slots:{root:C,input:S},componentsProps:_,fullWidth:c,inputComponent:d,multiline:f,ref:n,type:g},b,{classes:w}))});WI.muiName="Input";function Oce(t){return It("MuiFormControl",t)}At("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const kce=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Lce=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${Ge(n)}`,r&&"fullWidth"]};return Qe(i,Oce,e)},Bce=ze("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>O({},e.root,e[`margin${Ge(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>O({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),Ai=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:u=!1,focused:c,fullWidth:d=!1,hiddenLabel:f=!1,margin:h="none",required:p=!1,size:g="medium",variant:b="outlined"}=r,m=Be(r,kce),w=O({},r,{color:s,component:a,disabled:l,error:u,fullWidth:d,hiddenLabel:f,margin:h,required:p,size:g,variant:b}),x=Lce(w),[_,C]=E.useState(()=>{let j=!1;return i&&E.Children.forEach(i,k=>{if(!Yw(k,["Input","Select"]))return;const U=Yw(k,["Select"])?k.props.input:k;U&&Ple(U.props)&&(j=!0)}),j}),[S,M]=E.useState(()=>{let j=!1;return i&&E.Children.forEach(i,k=>{Yw(k,["Input","Select"])&&(q_(k.props,!0)||q_(k.props.inputProps,!0))&&(j=!0)}),j}),[P,A]=E.useState(!1);l&&P&&A(!1);const R=c!==void 0&&!l?c:P;let F;const $=E.useMemo(()=>({adornedStart:_,setAdornedStart:C,color:s,disabled:l,error:u,filled:S,focused:R,fullWidth:d,hiddenLabel:f,size:g,onBlur:()=>{A(!1)},onEmpty:()=>{M(!1)},onFilled:()=>{M(!0)},onFocus:()=>{A(!0)},registerEffect:F,required:p,variant:b}),[_,s,l,u,S,R,d,f,F,p,g,b]);return D.jsx(eE.Provider,{value:$,children:D.jsx(Bce,O({as:a,ownerState:w,className:nt(x.root,o),ref:n},m,{children:i}))})}),cn=yV({createStyledComponent:ze("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>kt({props:t,name:"MuiStack"})});function $ce(t){return It("MuiFormControlLabel",t)}const G0=At("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),zce=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],Uce=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,s={root:["root",n&&"disabled",`labelPlacement${Ge(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Qe(s,$ce,e)},Hce=ze("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${G0.label}`]:e.label},e.root,e[`labelPlacement${Ge(n.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>O({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${G0.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${G0.label}`]:{[`&.${G0.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),Vce=ze("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${G0.error}`]:{color:(t.vars||t).palette.error.main}})),Bo=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiFormControlLabel"}),{className:s,componentsProps:a={},control:l,disabled:u,disableTypography:c,label:d,labelPlacement:f="end",required:h,slotProps:p={}}=o,g=Be(o,zce),b=Wl(),m=(r=u??l.props.disabled)!=null?r:b==null?void 0:b.disabled,w=h??l.props.required,x={disabled:m,required:w};["checked","name","onChange","value","inputRef"].forEach(A=>{typeof l.props[A]>"u"&&typeof o[A]<"u"&&(x[A]=o[A])});const _=xd({props:o,muiFormControl:b,states:["error"]}),C=O({},o,{disabled:m,labelPlacement:f,required:w,error:_.error}),S=Uce(C),M=(i=p.typography)!=null?i:a.typography;let P=d;return P!=null&&P.type!==xn&&!c&&(P=D.jsx(xn,O({component:"span"},M,{className:nt(S.label,M==null?void 0:M.className),children:P}))),D.jsxs(Hce,O({className:nt(S.root,s),ownerState:C,ref:n},g,{children:[E.cloneElement(l,x),w?D.jsxs(cn,{display:"block",children:[P,D.jsxs(Vce,{ownerState:C,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):P]}))});function Gce(t){return It("MuiFormGroup",t)}At("MuiFormGroup",["root","row","error"]);const jce=["className","row"],Wce=t=>{const{classes:e,row:n,error:r}=t;return Qe({root:["root",n&&"row",r&&"error"]},Gce,e)},qce=ze("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})(({ownerState:t})=>O({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),aG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,s=Be(r,jce),a=Wl(),l=xd({props:r,muiFormControl:a,states:["error"]}),u=O({},r,{row:o,error:l.error}),c=Wce(u);return D.jsx(qce,O({className:nt(c.root,i),ownerState:u,ref:n},s))});function Xce(t){return It("MuiFormHelperText",t)}const k5=At("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var L5;const Kce=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Yce=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,u={root:["root",i&&"disabled",o&&"error",r&&`size${Ge(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Qe(u,Xce,e)},Zce=ze("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${Ge(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${k5.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${k5.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),Qce=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p"}=r,a=Be(r,Kce),l=Wl(),u=xd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),c=O({},r,{component:s,contained:u.variant==="filled"||u.variant==="outlined",variant:u.variant,size:u.size,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required}),d=Yce(c);return D.jsx(Zce,O({as:s,ownerState:c,className:nt(d.root,o),ref:n},a,{children:i===" "?L5||(L5=D.jsx("span",{className:"notranslate",children:"​"})):i}))});function Jce(t){return It("MuiFormLabel",t)}const mv=At("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ede=["children","className","color","component","disabled","error","filled","focused","required"],tde=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${Ge(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return Qe(l,Jce,e)},nde=ze("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>O({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${mv.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${mv.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${mv.error}`]:{color:(t.vars||t).palette.error.main}})),rde=ze("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${mv.error}`]:{color:(t.vars||t).palette.error.main}})),qI=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:s="label"}=r,a=Be(r,ede),l=Wl(),u=xd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),c=O({},r,{color:u.color||"primary",component:s,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required}),d=tde(c);return D.jsxs(nde,O({as:s,ownerState:c,className:nt(d.root,o),ref:n},a,{children:[i,u.required&&D.jsxs(rde,{ownerState:c,"aria-hidden":!0,className:d.asterisk,children:[" ","*"]})]}))}),B5=E.createContext();function ide(t){return It("MuiGrid",t)}const ode=[0,1,2,3,4,5,6,7,8,9,10],sde=["column-reverse","column","row-reverse","row"],ade=["nowrap","wrap-reverse","wrap"],c0=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],uy=At("MuiGrid",["root","container","item","zeroMinWidth",...ode.map(t=>`spacing-xs-${t}`),...sde.map(t=>`direction-xs-${t}`),...ade.map(t=>`wrap-xs-${t}`),...c0.map(t=>`grid-xs-${t}`),...c0.map(t=>`grid-sm-${t}`),...c0.map(t=>`grid-md-${t}`),...c0.map(t=>`grid-lg-${t}`),...c0.map(t=>`grid-xl-${t}`)]),lde=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function mm(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function ude({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=wf({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let u={};if(e.container&&e.item&&e.columnSpacing!==0){const c=t.spacing(e.columnSpacing);if(c!=="0px"){const d=`calc(${l} + ${mm(c)})`;u={flexBasis:d,maxWidth:d}}}o=O({flexBasis:l,flexGrow:0,maxWidth:l},u)}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function cde({theme:t,ownerState:e}){const n=wf({values:e.direction,breakpoints:t.breakpoints.values});return Qo({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${uy.item}`]={maxWidth:"none"}),i})}function lG({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function dde({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=wf({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=lG({breakpoints:t.breakpoints.values,values:o})),i=Qo({theme:t},o,(a,l)=>{var u;const c=t.spacing(a);return c!=="0px"?{marginTop:`-${mm(c)}`,[`& > .${uy.item}`]:{paddingTop:mm(c)}}:(u=s)!=null&&u.includes(l)?{}:{marginTop:0,[`& > .${uy.item}`]:{paddingTop:0}}})}return i}function fde({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=wf({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=lG({breakpoints:t.breakpoints.values,values:o})),i=Qo({theme:t},o,(a,l)=>{var u;const c=t.spacing(a);return c!=="0px"?{width:`calc(100% + ${mm(c)})`,marginLeft:`-${mm(c)}`,[`& > .${uy.item}`]:{paddingLeft:mm(c)}}:(u=s)!=null&&u.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${uy.item}`]:{paddingLeft:0}}})}return i}function hde(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const pde=ze("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:u}=n;let c=[];r&&(c=hde(s,u,e));const d=[];return u.forEach(f=>{const h=n[f];h&&d.push(e[`grid-${f}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...c,i!=="row"&&e[`direction-xs-${String(i)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...d]}})(({ownerState:t})=>O({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),cde,dde,fde,ude);function mde(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const gde=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let u=[];n&&(u=mde(o,l));const c=[];l.forEach(f=>{const h=t[f];h&&c.push(`grid-${f}-${String(h)}`)});const d={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...u,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...c]};return Qe(d,ide,e)},kc=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiGrid"}),{breakpoints:i}=ob(),o=rb(r),{className:s,columns:a,columnSpacing:l,component:u="div",container:c=!1,direction:d="row",item:f=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:b=!1}=o,m=Be(o,lde),w=h||p,x=l||p,_=E.useContext(B5),C=c?a||12:_,S={},M=O({},m);i.keys.forEach(R=>{m[R]!=null&&(S[R]=m[R],delete M[R])});const P=O({},o,{columns:C,container:c,direction:d,item:f,rowSpacing:w,columnSpacing:x,wrap:g,zeroMinWidth:b,spacing:p},S,{breakpoints:i.keys}),A=gde(P);return D.jsx(B5.Provider,{value:C,children:D.jsx(pde,O({ownerState:P,className:nt(A.root,s),as:u,ref:n},M))})}),vde=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function fD(t){return`scale(${t}, ${t**2})`}const yde={entering:{opacity:1,transform:fD(1)},entered:{opacity:1,transform:"none"}},gT=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),cy=E.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:u,onEntering:c,onExit:d,onExited:f,onExiting:h,style:p,timeout:g="auto",TransitionComponent:b=jl}=e,m=Be(e,vde),w=Kp(),x=E.useRef(),_=ob(),C=E.useRef(null),S=An(C,o.ref,n),M=U=>G=>{if(U){const B=C.current;G===void 0?U(B):U(B,G)}},P=M(c),A=M((U,G)=>{DV(U);const{duration:B,delay:L,easing:N}=j_({style:p,timeout:g,easing:s},{mode:"enter"});let W;g==="auto"?(W=_.transitions.getAutoHeightDuration(U.clientHeight),x.current=W):W=B,U.style.transition=[_.transitions.create("opacity",{duration:W,delay:L}),_.transitions.create("transform",{duration:gT?W:W*.666,delay:L,easing:N})].join(","),l&&l(U,G)}),R=M(u),F=M(h),$=M(U=>{const{duration:G,delay:B,easing:L}=j_({style:p,timeout:g,easing:s},{mode:"exit"});let N;g==="auto"?(N=_.transitions.getAutoHeightDuration(U.clientHeight),x.current=N):N=G,U.style.transition=[_.transitions.create("opacity",{duration:N,delay:B}),_.transitions.create("transform",{duration:gT?N:N*.666,delay:gT?B:B||N*.333,easing:L})].join(","),U.style.opacity=0,U.style.transform=fD(.75),d&&d(U)}),j=M(f),k=U=>{g==="auto"&&w.start(x.current||0,U),r&&r(C.current,U)};return D.jsx(b,O({appear:i,in:a,nodeRef:C,onEnter:A,onEntered:R,onEntering:P,onExit:$,onExited:j,onExiting:F,addEndListener:k,timeout:g==="auto"?null:g},m,{children:(U,G)=>E.cloneElement(o,O({style:O({opacity:0,transform:fD(.75),visibility:U==="exited"&&!a?"hidden":void 0},yde[U],p,o.props.style),ref:S},G))}))});cy.muiSupportAuto=!0;const bde=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],xde=t=>{const{classes:e,disableUnderline:n}=t,i=Qe({root:["root",!n&&"underline"],input:["input"]},Ole,e);return O({},e,i)},wde=ze(rE,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...tE(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),O({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Ic.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Ic.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Ic.disabled}, .${Ic.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Ic.disabled}:before`]:{borderBottomStyle:"dotted"}})}),_de=ze(iE,{name:"MuiInput",slot:"Input",overridesResolver:nE})({}),XI=E.forwardRef(function(e,n){var r,i,o,s;const a=kt({props:e,name:"MuiInput"}),{disableUnderline:l,components:u={},componentsProps:c,fullWidth:d=!1,inputComponent:f="input",multiline:h=!1,slotProps:p,slots:g={},type:b="text"}=a,m=Be(a,bde),w=xde(a),_={root:{ownerState:{disableUnderline:l}}},C=p??c?Mo(p??c,_):_,S=(r=(i=g.root)!=null?i:u.Root)!=null?r:wde,M=(o=(s=g.input)!=null?s:u.Input)!=null?o:_de;return D.jsx(fg,O({slots:{root:S,input:M},slotProps:C,fullWidth:d,inputComponent:f,multiline:h,ref:n,type:b},m,{classes:w}))});XI.muiName="Input";function Sde(t){return It("MuiInputAdornment",t)}const $5=At("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var z5;const Cde=["children","className","component","disablePointerEvents","disableTypography","position","variant"],Ede=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Ge(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Mde=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=t,a={root:["root",n&&"disablePointerEvents",i&&`position${Ge(i)}`,s,r&&"hiddenLabel",o&&`size${Ge(o)}`]};return Qe(a,Sde,e)},Tde=ze("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Ede})(({theme:t,ownerState:e})=>O({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},e.variant==="filled"&&{[`&.${$5.positionStart}&:not(.${$5.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),si=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:u,variant:c}=r,d=Be(r,Cde),f=Wl()||{};let h=c;c&&f.variant,f&&!h&&(h=f.variant);const p=O({},r,{hiddenLabel:f.hiddenLabel,size:f.size,disablePointerEvents:a,position:u,variant:h}),g=Mde(p);return D.jsx(eE.Provider,{value:null,children:D.jsx(Tde,O({as:s,ownerState:p,className:nt(g.root,o),ref:n},d,{children:typeof i=="string"&&!l?D.jsx(xn,{color:"text.secondary",children:i}):D.jsxs(E.Fragment,{children:[u==="start"?z5||(z5=D.jsx("span",{className:"notranslate",children:"​"})):null,i]})}))})});function Ade(t){return It("MuiInputLabel",t)}At("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Pde=["disableAnimation","margin","shrink","variant","className"],Dde=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Ge(r)}`,s],asterisk:[a&&"asterisk"]},u=Qe(l,Ade,e);return O({},e,u)},Rde=ze(qI,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${mv.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>O({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&O({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&O({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&O({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),da=E.forwardRef(function(e,n){const r=kt({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:s}=r,a=Be(r,Pde),l=Wl();let u=o;typeof u>"u"&&l&&(u=l.filled||l.focused||l.adornedStart);const c=xd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),d=O({},r,{disableAnimation:i,formControl:l,shrink:u,size:c.size,variant:c.variant,required:c.required,focused:c.focused}),f=Dde(d);return D.jsx(Rde,O({"data-shrink":u,ownerState:d,ref:n,className:nt(f.root,s)},a,{classes:f}))}),X_=E.createContext({});function Ide(t){return It("MuiList",t)}At("MuiList",["root","padding","dense","subheader"]);const Nde=["children","className","component","dense","disablePadding","subheader"],Fde=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Qe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},Ide,e)},Ode=ze("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>O({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),kde=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:u}=r,c=Be(r,Nde),d=E.useMemo(()=>({dense:a}),[a]),f=O({},r,{component:s,dense:a,disablePadding:l}),h=Fde(f);return D.jsx(X_.Provider,{value:d,children:D.jsxs(Ode,O({as:s,className:nt(h.root,o),ref:n,ownerState:f},c,{children:[u,i]}))})});function Lde(t){return It("MuiListItemIcon",t)}const U5=At("MuiListItemIcon",["root","alignItemsFlexStart"]),Bde=["className"],$de=t=>{const{alignItems:e,classes:n}=t;return Qe({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},Lde,n)},zde=ze("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(({theme:t,ownerState:e})=>O({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},e.alignItems==="flex-start"&&{marginTop:8})),Ude=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiListItemIcon"}),{className:i}=r,o=Be(r,Bde),s=E.useContext(X_),a=O({},r,{alignItems:s.alignItems}),l=$de(a);return D.jsx(zde,O({className:nt(l.root,i),ownerState:a,ref:n},o))}),H5=At("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),Hde=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function vT(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function V5(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function uG(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function d0(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!uG(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const ub=E.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:c,variant:d="selectedMenu"}=e,f=Be(e,Hde),h=E.useRef(null),p=E.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});_r(()=>{i&&h.current.focus()},[i]),E.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:_})=>{const C=!h.current.style.width;if(x.clientHeight{const _=h.current,C=x.key,S=Sr(_).activeElement;if(C==="ArrowDown")x.preventDefault(),d0(_,S,u,l,vT);else if(C==="ArrowUp")x.preventDefault(),d0(_,S,u,l,V5);else if(C==="Home")x.preventDefault(),d0(_,null,u,l,vT);else if(C==="End")x.preventDefault(),d0(_,null,u,l,V5);else if(C.length===1){const M=p.current,P=C.toLowerCase(),A=performance.now();M.keys.length>0&&(A-M.lastTime>500?(M.keys=[],M.repeating=!0,M.previousKeyMatched=!0):M.repeating&&P!==M.keys[0]&&(M.repeating=!1)),M.lastTime=A,M.keys.push(P);const R=S&&!M.repeating&&uG(S,M);M.previousKeyMatched&&(R||d0(_,S,!1,l,vT,M))?x.preventDefault():M.previousKeyMatched=!1}c&&c(x)},b=An(h,n);let m=-1;E.Children.forEach(s,(x,_)=>{if(!E.isValidElement(x)){m===_&&(m+=1,m>=s.length&&(m=-1));return}x.props.disabled||(d==="selectedMenu"&&x.props.selected||m===-1)&&(m=_),m===_&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(m+=1,m>=s.length&&(m=-1))});const w=E.Children.map(s,(x,_)=>{if(_===m){const C={};return o&&(C.autoFocus=!0),x.props.tabIndex===void 0&&d==="selectedMenu"&&(C.tabIndex=0),E.cloneElement(x,C)}return x});return D.jsx(kde,O({role:"menu",ref:b,className:a,onKeyDown:g,tabIndex:i?0:-1},f,{children:w}))});function Vde(t){return It("MuiPopover",t)}At("MuiPopover",["root","paper"]);const Gde=["onEntering"],jde=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],Wde=["slotProps"];function G5(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function j5(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function W5(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function yT(t){return typeof t=="function"?t():t}const qde=t=>{const{classes:e}=t;return Qe({root:["root"],paper:["paper"]},Vde,e)},Xde=ze(nG,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),cG=ze(Xu,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),dG=E.forwardRef(function(e,n){var r,i,o;const s=kt({props:e,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:u={vertical:"top",horizontal:"left"},anchorPosition:c,anchorReference:d="anchorEl",children:f,className:h,container:p,elevation:g=8,marginThreshold:b=16,open:m,PaperProps:w={},slots:x,slotProps:_,transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:S=cy,transitionDuration:M="auto",TransitionProps:{onEntering:P}={},disableScrollLock:A=!1}=s,R=Be(s.TransitionProps,Gde),F=Be(s,jde),$=(r=_==null?void 0:_.paper)!=null?r:w,j=E.useRef(),k=An(j,$.ref),U=O({},s,{anchorOrigin:u,anchorReference:d,elevation:g,marginThreshold:b,externalPaperSlotProps:$,transformOrigin:C,TransitionComponent:S,transitionDuration:M,TransitionProps:R}),G=qde(U),B=E.useCallback(()=>{if(d==="anchorPosition")return c;const _e=yT(l),X=(_e&&_e.nodeType===1?_e:Sr(j.current).body).getBoundingClientRect();return{top:X.top+G5(X,u.vertical),left:X.left+j5(X,u.horizontal)}},[l,u.horizontal,u.vertical,c,d]),L=E.useCallback(_e=>({vertical:G5(_e,C.vertical),horizontal:j5(_e,C.horizontal)}),[C.horizontal,C.vertical]),N=E.useCallback(_e=>{const Ce={width:_e.offsetWidth,height:_e.offsetHeight},X=L(Ce);if(d==="none")return{top:null,left:null,transformOrigin:W5(X)};const Z=B();let he=Z.top-X.vertical,Y=Z.left-X.horizontal;const ne=he+Ce.height,se=Y+Ce.width,xe=Bl(yT(l)),Pe=xe.innerHeight-b,z=xe.innerWidth-b;if(b!==null&&hePe){const H=ne-Pe;he-=H,X.vertical+=H}if(b!==null&&Yz){const H=se-z;Y-=H,X.horizontal+=H}return{top:`${Math.round(he)}px`,left:`${Math.round(Y)}px`,transformOrigin:W5(X)}},[l,d,B,L,b]),[W,K]=E.useState(m),Q=E.useCallback(()=>{const _e=j.current;if(!_e)return;const Ce=N(_e);Ce.top!==null&&(_e.style.top=Ce.top),Ce.left!==null&&(_e.style.left=Ce.left),_e.style.transformOrigin=Ce.transformOrigin,K(!0)},[N]);E.useEffect(()=>(A&&window.addEventListener("scroll",Q),()=>window.removeEventListener("scroll",Q)),[l,A,Q]);const J=(_e,Ce)=>{P&&P(_e,Ce),Q()},ae=()=>{K(!1)};E.useEffect(()=>{m&&Q()}),E.useImperativeHandle(a,()=>m?{updatePosition:()=>{Q()}}:null,[m,Q]),E.useEffect(()=>{if(!m)return;const _e=ug(()=>{Q()}),Ce=Bl(l);return Ce.addEventListener("resize",_e),()=>{_e.clear(),Ce.removeEventListener("resize",_e)}},[l,m,Q]);let ve=M;M==="auto"&&!S.muiSupportAuto&&(ve=void 0);const fe=p||(l?Sr(yT(l)).body:void 0),Me=(i=x==null?void 0:x.root)!=null?i:Xde,ye=(o=x==null?void 0:x.paper)!=null?o:cG,we=$u({elementType:ye,externalSlotProps:O({},$,{style:W?$.style:O({},$.style,{opacity:0})}),additionalProps:{elevation:g,ref:k},ownerState:U,className:nt(G.paper,$==null?void 0:$.className)}),Fe=$u({elementType:Me,externalSlotProps:(_==null?void 0:_.root)||{},externalForwardedProps:F,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:fe,open:m},ownerState:U,className:nt(G.root,h)}),{slotProps:Oe}=Fe,re=Be(Fe,Wde);return D.jsx(Me,O({},re,!oy(Me)&&{slotProps:Oe,disableScrollLock:A},{children:D.jsx(S,O({appear:!0,in:m,onEntering:J,onExited:ae,timeout:ve},R,{children:D.jsx(ye,O({},we,{children:f}))}))}))});function Kde(t){return It("MuiMenu",t)}At("MuiMenu",["root","paper","list"]);const Yde=["onEntering"],Zde=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Qde={vertical:"top",horizontal:"right"},Jde={vertical:"top",horizontal:"left"},efe=t=>{const{classes:e}=t;return Qe({root:["root"],paper:["paper"],list:["list"]},Kde,e)},tfe=ze(dG,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),nfe=ze(cG,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),rfe=ze(ub,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),ife=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:u=!1,MenuListProps:c={},onClose:d,open:f,PaperProps:h={},PopoverClasses:p,transitionDuration:g="auto",TransitionProps:{onEntering:b}={},variant:m="selectedMenu",slots:w={},slotProps:x={}}=o,_=Be(o.TransitionProps,Yde),C=Be(o,Zde),S=CI(),M=O({},o,{autoFocus:s,disableAutoFocusItem:u,MenuListProps:c,onEntering:b,PaperProps:h,transitionDuration:g,TransitionProps:_,variant:m}),P=efe(M),A=s&&!u&&f,R=E.useRef(null),F=(L,N)=>{R.current&&R.current.adjustStyleForScrollbar(L,{direction:S?"rtl":"ltr"}),b&&b(L,N)},$=L=>{L.key==="Tab"&&(L.preventDefault(),d&&d(L,"tabKeyDown"))};let j=-1;E.Children.map(a,(L,N)=>{E.isValidElement(L)&&(L.props.disabled||(m==="selectedMenu"&&L.props.selected||j===-1)&&(j=N))});const k=(r=w.paper)!=null?r:nfe,U=(i=x.paper)!=null?i:h,G=$u({elementType:w.root,externalSlotProps:x.root,ownerState:M,className:[P.root,l]}),B=$u({elementType:k,externalSlotProps:U,ownerState:M,className:P.paper});return D.jsx(tfe,O({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?Qde:Jde,slots:{paper:k,root:w.root},slotProps:{root:G,paper:B},open:f,ref:n,transitionDuration:g,TransitionProps:O({onEntering:F},_),ownerState:M},C,{classes:p,children:D.jsx(rfe,O({onKeyDown:$,actions:R,autoFocus:s&&(j===-1||u),autoFocusItem:A,variant:m},c,{className:nt(P.list,c.className),children:a}))}))});function ofe(t){return It("MuiMenuItem",t)}const f0=At("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),sfe=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],afe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},lfe=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=Qe({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},ofe,s);return O({},s,l)},ufe=ze(Bm,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:afe})(({theme:t,ownerState:e})=>O({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${f0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${f0.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${f0.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${f0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${f0.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${O5.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${O5.inset}`]:{marginLeft:52},[`& .${H5.root}`]:{marginTop:0,marginBottom:0},[`& .${H5.inset}`]:{paddingLeft:36},[`& .${U5.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&O({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${U5.root} svg`]:{fontSize:"1.25rem"}}))),wn=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:f}=r,h=Be(r,sfe),p=E.useContext(X_),g=E.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),b=E.useRef(null);_r(()=>{i&&b.current&&b.current.focus()},[i]);const m=O({},r,{dense:g.dense,divider:a,disableGutters:l}),w=lfe(r),x=An(b,n);let _;return r.disabled||(_=d!==void 0?d:-1),D.jsx(X_.Provider,{value:g,children:D.jsx(ufe,O({ref:x,role:c,tabIndex:_,component:o,focusVisibleClassName:nt(w.focusVisible,u),className:nt(w.root,f)},h,{ownerState:m,classes:w}))})});function cfe(t){return It("MuiNativeSelect",t)}const KI=At("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),dfe=["className","disabled","error","IconComponent","inputRef","variant"],ffe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ge(n)}`,o&&"iconOpen",r&&"disabled"]};return Qe(a,cfe,e)},fG=({ownerState:t,theme:e})=>O({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":O({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${KI.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),hfe=ze("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:uo,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${KI.multiple}`]:e.multiple}]}})(fG),hG=({ownerState:t,theme:e})=>O({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${KI.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),pfe=ze("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Ge(n.variant)}`],n.open&&e.iconOpen]}})(hG),mfe=E.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard"}=e,u=Be(e,dfe),c=O({},e,{disabled:i,variant:l,error:o}),d=ffe(c);return D.jsxs(E.Fragment,{children:[D.jsx(hfe,O({ownerState:c,className:nt(d.select,r),disabled:i,ref:a||n},u)),e.multiple?null:D.jsx(pfe,{as:s,ownerState:c,className:d.icon})]})});var q5;const gfe=["children","classes","className","label","notched"],vfe=ze("fieldset",{shouldForwardProp:uo})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),yfe=ze("legend",{shouldForwardProp:uo})(({ownerState:t,theme:e})=>O({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&O({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function bfe(t){const{className:e,label:n,notched:r}=t,i=Be(t,gfe),o=n!=null&&n!=="",s=O({},t,{notched:r,withLabel:o});return D.jsx(vfe,O({"aria-hidden":!0,className:e,ownerState:s},i,{children:D.jsx(yfe,{ownerState:s,children:o?D.jsx("span",{children:n}):q5||(q5=D.jsx("span",{className:"notranslate",children:"​"}))})}))}const xfe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],wfe=t=>{const{classes:e}=t,r=Qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},kle,e);return O({},e,r)},_fe=ze(rE,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:tE})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return O({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${vl.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${vl.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${vl.focused} .${vl.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${vl.error} .${vl.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${vl.disabled} .${vl.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&O({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),Sfe=ze(bfe,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),Cfe=ze(iE,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:nE})(({theme:t,ownerState:e})=>O({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),YI=E.forwardRef(function(e,n){var r,i,o,s,a;const l=kt({props:e,name:"MuiOutlinedInput"}),{components:u={},fullWidth:c=!1,inputComponent:d="input",label:f,multiline:h=!1,notched:p,slots:g={},type:b="text"}=l,m=Be(l,xfe),w=wfe(l),x=Wl(),_=xd({props:l,muiFormControl:x,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),C=O({},l,{color:_.color||"primary",disabled:_.disabled,error:_.error,focused:_.focused,formControl:x,fullWidth:c,hiddenLabel:_.hiddenLabel,multiline:h,size:_.size,type:b}),S=(r=(i=g.root)!=null?i:u.Root)!=null?r:_fe,M=(o=(s=g.input)!=null?s:u.Input)!=null?o:Cfe;return D.jsx(fg,O({slots:{root:S,input:M},renderSuffix:P=>D.jsx(Sfe,{ownerState:C,className:w.notchedOutline,label:f!=null&&f!==""&&_.required?a||(a=D.jsxs(E.Fragment,{children:[f," ","*"]})):f,notched:typeof p<"u"?p:!!(P.startAdornment||P.filled||P.focused)}),fullWidth:c,inputComponent:d,multiline:h,ref:n,type:b},m,{classes:O({},w,{notchedOutline:null})}))});YI.muiName="Input";const Efe=mn(D.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Mfe=mn(D.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Tfe=mn(D.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),Afe=mn(D.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),Pfe=ze("span",{shouldForwardProp:uo})({position:"relative",display:"flex"}),Dfe=ze(Tfe)({transform:"scale(1)"}),Rfe=ze(Afe)(({theme:t,ownerState:e})=>O({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}));function pG(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=O({},t,{checked:e});return D.jsxs(Pfe,{className:n.root,ownerState:i,children:[D.jsx(Dfe,{fontSize:r,className:n.background,ownerState:i}),D.jsx(Rfe,{fontSize:r,className:n.dot,ownerState:i})]})}const mG=E.createContext(void 0);function Ife(){return E.useContext(mG)}function Nfe(t){return It("MuiRadio",t)}const X5=At("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),Ffe=["checked","checkedIcon","color","icon","name","onChange","size","className"],Ofe=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${Ge(n)}`,r!=="medium"&&`size${Ge(r)}`]};return O({},e,Qe(i,Nfe,e))},kfe=ze(jI,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${Ge(n.size)}`],e[`color${Ge(n.color)}`]]}})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${X5.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${X5.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function Lfe(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const K5=D.jsx(pG,{checked:!0}),Y5=D.jsx(pG,{}),gm=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiRadio"}),{checked:s,checkedIcon:a=K5,color:l="primary",icon:u=Y5,name:c,onChange:d,size:f="medium",className:h}=o,p=Be(o,Ffe),g=O({},o,{color:l,size:f}),b=Ofe(g),m=Ife();let w=s;const x=H_(d,m&&m.onChange);let _=c;return m&&(typeof w>"u"&&(w=Lfe(m.value,o.value)),typeof _>"u"&&(_=m.name)),D.jsx(kfe,O({type:"radio",icon:E.cloneElement(u,{fontSize:(r=Y5.props.fontSize)!=null?r:f}),checkedIcon:E.cloneElement(a,{fontSize:(i=K5.props.fontSize)!=null?i:f}),ownerState:g,classes:b,name:_,checked:w,onChange:x,ref:n,className:nt(b.root,h)},p))});function Bfe(t){return It("MuiRadioGroup",t)}At("MuiRadioGroup",["root","row","error"]);const $fe=["actions","children","className","defaultValue","name","onChange","value"],zfe=t=>{const{classes:e,row:n,error:r}=t;return Qe({root:["root",n&&"row",r&&"error"]},Bfe,e)},gG=E.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:u}=e,c=Be(e,$fe),d=E.useRef(null),f=zfe(e),[h,p]=Ru({controlled:u,default:s,name:"RadioGroup"});E.useImperativeHandle(r,()=>({focus:()=>{let w=d.current.querySelector("input:not(:disabled):checked");w||(w=d.current.querySelector("input:not(:disabled)")),w&&w.focus()}}),[]);const g=An(n,d),b=jn(a),m=E.useMemo(()=>({name:b,onChange(w){p(w.target.value),l&&l(w,w.target.value)},value:h}),[b,l,p,h]);return D.jsx(mG.Provider,{value:m,children:D.jsx(aG,O({role:"radiogroup",ref:g,className:nt(f.root,o)},c,{children:i}))})});function Ufe(t){return It("MuiSelect",t)}const h0=At("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Z5;const Hfe=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],Vfe=ze("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${h0.select}`]:e.select},{[`&.${h0.select}`]:e[n.variant]},{[`&.${h0.error}`]:e.error},{[`&.${h0.multiple}`]:e.multiple}]}})(fG,{[`&.${h0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Gfe=ze("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Ge(n.variant)}`],n.open&&e.iconOpen]}})(hG),jfe=ze("input",{shouldForwardProp:t=>PV(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Q5(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function Wfe(t){return t==null||typeof t=="string"&&!t.trim()}const qfe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ge(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Qe(a,Ufe,e)},Xfe=E.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:s,autoWidth:a,children:l,className:u,defaultOpen:c,defaultValue:d,disabled:f,displayEmpty:h,error:p=!1,IconComponent:g,inputRef:b,labelId:m,MenuProps:w={},multiple:x,name:_,onBlur:C,onChange:S,onClose:M,onFocus:P,onOpen:A,open:R,readOnly:F,renderValue:$,SelectDisplayProps:j={},tabIndex:k,value:U,variant:G="standard"}=e,B=Be(e,Hfe),[L,N]=Ru({controlled:U,default:d,name:"Select"}),[W,K]=Ru({controlled:R,default:c,name:"Select"}),Q=E.useRef(null),J=E.useRef(null),[ae,ve]=E.useState(null),{current:fe}=E.useRef(R!=null),[Me,ye]=E.useState(),we=An(n,b),Fe=E.useCallback(Ve=>{J.current=Ve,Ve&&ve(Ve)},[]),Oe=ae==null?void 0:ae.parentNode;E.useImperativeHandle(we,()=>({focus:()=>{J.current.focus()},node:Q.current,value:L}),[L]),E.useEffect(()=>{c&&W&&ae&&!fe&&(ye(a?null:Oe.clientWidth),J.current.focus())},[ae,a]),E.useEffect(()=>{s&&J.current.focus()},[s]),E.useEffect(()=>{if(!m)return;const Ve=Sr(J.current).getElementById(m);if(Ve){const Le=()=>{getSelection().isCollapsed&&J.current.focus()};return Ve.addEventListener("click",Le),()=>{Ve.removeEventListener("click",Le)}}},[m]);const re=(Ve,Le)=>{Ve?A&&A(Le):M&&M(Le),fe||(ye(a?null:Oe.clientWidth),K(Ve))},_e=Ve=>{Ve.button===0&&(Ve.preventDefault(),J.current.focus(),re(!0,Ve))},Ce=Ve=>{re(!1,Ve)},X=E.Children.toArray(l),Z=Ve=>{const Le=X.find(Ye=>Ye.props.value===Ve.target.value);Le!==void 0&&(N(Le.props.value),S&&S(Ve,Le))},he=Ve=>Le=>{let Ye;if(Le.currentTarget.hasAttribute("tabindex")){if(x){Ye=Array.isArray(L)?L.slice():[];const it=L.indexOf(Ve.props.value);it===-1?Ye.push(Ve.props.value):Ye.splice(it,1)}else Ye=Ve.props.value;if(Ve.props.onClick&&Ve.props.onClick(Le),L!==Ye&&(N(Ye),S)){const it=Le.nativeEvent||Le,ot=new it.constructor(it.type,it);Object.defineProperty(ot,"target",{writable:!0,value:{value:Ye,name:_}}),S(ot,Ve)}x||re(!1,Le)}},Y=Ve=>{F||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Ve.key)!==-1&&(Ve.preventDefault(),re(!0,Ve))},ne=ae!==null&&W,se=Ve=>{!ne&&C&&(Object.defineProperty(Ve,"target",{writable:!0,value:{value:L,name:_}}),C(Ve))};delete B["aria-invalid"];let xe,Pe;const z=[];let H=!1;(q_({value:L})||h)&&($?xe=$(L):H=!0);const te=X.map(Ve=>{if(!E.isValidElement(Ve))return null;let Le;if(x){if(!Array.isArray(L))throw new Error(Bu(2));Le=L.some(Ye=>Q5(Ye,Ve.props.value)),Le&&H&&z.push(Ve.props.children)}else Le=Q5(L,Ve.props.value),Le&&H&&(Pe=Ve.props.children);return E.cloneElement(Ve,{"aria-selected":Le?"true":"false",onClick:he(Ve),onKeyUp:Ye=>{Ye.key===" "&&Ye.preventDefault(),Ve.props.onKeyUp&&Ve.props.onKeyUp(Ye)},role:"option",selected:Le,value:void 0,"data-value":Ve.props.value})});H&&(x?z.length===0?xe=null:xe=z.reduce((Ve,Le,Ye)=>(Ve.push(Le),Ye{const{classes:e}=t;return e},ZI={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>uo(t)&&t!=="variant",slot:"Root"},Qfe=ze(XI,ZI)(""),Jfe=ze(YI,ZI)(""),ehe=ze(WI,ZI)(""),Ps=E.forwardRef(function(e,n){const r=kt({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:c=QV,id:d,input:f,inputProps:h,label:p,labelId:g,MenuProps:b,multiple:m=!1,native:w=!1,onClose:x,onOpen:_,open:C,renderValue:S,SelectDisplayProps:M,variant:P="outlined"}=r,A=Be(r,Kfe),R=w?mfe:Xfe,F=Wl(),$=xd({props:r,muiFormControl:F,states:["variant","error"]}),j=$.variant||P,k=O({},r,{variant:j,classes:s}),U=Zfe(k),G=Be(U,Yfe),B=f||{standard:D.jsx(Qfe,{ownerState:k}),outlined:D.jsx(Jfe,{label:p,ownerState:k}),filled:D.jsx(ehe,{ownerState:k})}[j],L=An(n,B.ref);return D.jsx(E.Fragment,{children:E.cloneElement(B,O({inputComponent:R,inputProps:O({children:o,error:$.error,IconComponent:c,variant:j,type:void 0,multiple:m},w?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:u,labelId:g,MenuProps:b,onClose:x,onOpen:_,open:C,renderValue:S,SelectDisplayProps:O({id:d},M)},h,{classes:h?Mo(G,h.classes):G},f?f.props.inputProps:{})},(m&&w||u)&&j==="outlined"?{notched:!0}:{},{ref:L,className:nt(B.props.className,a,U.root)},!f&&{variant:j},A))})});Ps.muiName="Select";function the(t){return It("MuiSkeleton",t)}At("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const nhe=["animation","className","component","height","style","variant","width"];let K_=t=>t,J5,eB,tB,nB;const rhe=t=>{const{classes:e,variant:n,animation:r,hasChildren:i,width:o,height:s}=t;return Qe({root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!s&&"heightAuto"]},the,e)},ihe=yd(J5||(J5=K_` + `),Kue)),ece=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,size:a=40,style:l,thickness:u=3.6,value:c=0,variant:d="indeterminate"}=r,f=Be(r,que),h=O({},r,{color:o,disableShrink:s,size:a,thickness:u,value:c,variant:d}),p=Yue(h),g={},b={},m={};if(d==="determinate"){const w=2*Math.PI*((cc-u)/2);g.strokeDasharray=w.toFixed(3),m["aria-valuenow"]=Math.round(c),g.strokeDashoffset=`${((100-c)/100*w).toFixed(3)}px`,b.transform="rotate(-90deg)"}return D.jsx(Zue,O({className:nt(p.root,i),style:O({width:a,height:a},b,l),ownerState:h,ref:n,role:"progressbar"},m,f,{children:D.jsx(Que,{className:p.svg,ownerState:h,viewBox:`${cc/2} ${cc/2} ${cc} ${cc}`,children:D.jsx(Jue,{className:p.circle,style:g,ownerState:h,cx:cc,cy:cc,r:(cc-u)/2,fill:"none",strokeWidth:u})})}))}),tce=(t,e)=>O({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},e&&!t.vars&&{colorScheme:t.palette.mode}),nce=t=>O({color:(t.vars||t).palette.text.primary},t.typography.body1,{backgroundColor:(t.vars||t).palette.background.default,"@media print":{backgroundColor:(t.vars||t).palette.common.white}}),rce=(t,e=!1)=>{var n;const r={};e&&t.colorSchemes&&Object.entries(t.colorSchemes).forEach(([s,a])=>{var l;r[t.getColorSchemeSelector(s).replace(/\s*&/,"")]={colorScheme:(l=a.palette)==null?void 0:l.mode}});let i=O({html:tce(t,e),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:t.typography.fontWeightBold},body:O({margin:0},nce(t),{"&::backdrop":{backgroundColor:(t.vars||t).palette.background.default}})},r);const o=(n=t.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return o&&(i=[i,o]),i};function ice(t){const e=kt({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=e;return D.jsxs(E.Fragment,{children:[D.jsx(ZV,{styles:i=>rce(i,r)}),n]})}function oce(t){return It("MuiModal",t)}At("MuiModal",["root","hidden","backdrop"]);const sce=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],ace=t=>{const{open:e,exited:n,classes:r}=t;return Qe({root:["root",!e&&n&&"hidden"],backdrop:["backdrop"]},oce,r)},lce=ze("div",{name:"MuiModal",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.open&&n.exited&&e.hidden]}})(({theme:t,ownerState:e})=>O({position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0},!e.open&&e.exited&&{visibility:"hidden"})),uce=ze(eG,{name:"MuiModal",slot:"Backdrop",overridesResolver:(t,e)=>e.backdrop})({zIndex:-1}),nG=E.forwardRef(function(e,n){var r,i,o,s,a,l;const u=kt({name:"MuiModal",props:e}),{BackdropComponent:c=uce,BackdropProps:d,className:f,closeAfterTransition:h=!1,children:p,container:g,component:b,components:m={},componentsProps:w={},disableAutoFocus:x=!1,disableEnforceFocus:_=!1,disableEscapeKeyDown:C=!1,disablePortal:S=!1,disableRestoreFocus:M=!1,disableScrollLock:P=!1,hideBackdrop:A=!1,keepMounted:R=!1,onBackdropClick:F,open:$,slotProps:j,slots:k}=u,U=Be(u,sce),G=O({},u,{closeAfterTransition:h,disableAutoFocus:x,disableEnforceFocus:_,disableEscapeKeyDown:C,disablePortal:S,disableRestoreFocus:M,disableScrollLock:P,hideBackdrop:A,keepMounted:R}),{getRootProps:B,getBackdropProps:L,getTransitionProps:N,portalRef:W,isTopModal:K,exited:Q,hasTransition:J}=Vse(O({},G,{rootRef:n})),ae=O({},G,{exited:Q}),ve=ace(ae),fe={};if(p.props.tabIndex===void 0&&(fe.tabIndex="-1"),J){const{onEnter:_e,onExited:Ce}=N();fe.onEnter=_e,fe.onExited=Ce}const Me=(r=(i=k==null?void 0:k.root)!=null?i:m.Root)!=null?r:lce,ye=(o=(s=k==null?void 0:k.backdrop)!=null?s:m.Backdrop)!=null?o:c,we=(a=j==null?void 0:j.root)!=null?a:w.root,Fe=(l=j==null?void 0:j.backdrop)!=null?l:w.backdrop,Oe=$u({elementType:Me,externalSlotProps:we,externalForwardedProps:U,getSlotProps:B,additionalProps:{ref:n,as:b},ownerState:ae,className:nt(f,we==null?void 0:we.className,ve==null?void 0:ve.root,!ae.open&&ae.exited&&(ve==null?void 0:ve.hidden))}),re=$u({elementType:ye,externalSlotProps:Fe,additionalProps:d,getSlotProps:_e=>L(O({},_e,{onClick:Ce=>{F&&F(Ce),_e!=null&&_e.onClick&&_e.onClick(Ce)}})),className:nt(Fe==null?void 0:Fe.className,d==null?void 0:d.className,ve==null?void 0:ve.backdrop),ownerState:ae});return!R&&!$&&(!J||Q)?null:D.jsx(kV,{ref:W,container:g,disablePortal:S,children:D.jsxs(Me,O({},Oe,{children:[!A&&c?D.jsx(ye,O({},re)):null,D.jsx(OV,{disableEnforceFocus:_,disableAutoFocus:x,disableRestoreFocus:M,isEnabled:K,open:$,children:E.cloneElement(p,fe)})]}))})});function cce(t){return It("MuiDialog",t)}const mT=At("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),rG=E.createContext({}),dce=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],fce=ze(eG,{name:"MuiDialog",slot:"Backdrop",overrides:(t,e)=>e.backdrop})({zIndex:-1}),hce=t=>{const{classes:e,scroll:n,maxWidth:r,fullWidth:i,fullScreen:o}=t,s={root:["root"],container:["container",`scroll${Ge(n)}`],paper:["paper",`paperScroll${Ge(n)}`,`paperWidth${Ge(String(r))}`,i&&"paperFullWidth",o&&"paperFullScreen"]};return Qe(s,cce,e)},pce=ze(nG,{name:"MuiDialog",slot:"Root",overridesResolver:(t,e)=>e.root})({"@media print":{position:"absolute !important"}}),mce=ze("div",{name:"MuiDialog",slot:"Container",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.container,e[`scroll${Ge(n.scroll)}`]]}})(({ownerState:t})=>O({height:"100%","@media print":{height:"auto"},outline:0},t.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},t.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),gce=ze(Xu,{name:"MuiDialog",slot:"Paper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.paper,e[`scrollPaper${Ge(n.scroll)}`],e[`paperWidth${Ge(String(n.maxWidth))}`],n.fullWidth&&e.paperFullWidth,n.fullScreen&&e.paperFullScreen]}})(({theme:t,ownerState:e})=>O({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:t.breakpoints.unit==="px"?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${mT.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${t.breakpoints.values[e.maxWidth]}${t.breakpoints.unit}`,[`&.${mT.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${mT.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),iG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDialog"}),i=ob(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,BackdropComponent:l,BackdropProps:u,children:c,className:d,disableEscapeKeyDown:f=!1,fullScreen:h=!1,fullWidth:p=!1,maxWidth:g="sm",onBackdropClick:b,onClose:m,open:w,PaperComponent:x=Xu,PaperProps:_={},scroll:C="paper",TransitionComponent:S=JV,transitionDuration:M=o,TransitionProps:P}=r,A=Be(r,dce),R=O({},r,{disableEscapeKeyDown:f,fullScreen:h,fullWidth:p,maxWidth:g,scroll:C}),F=hce(R),$=E.useRef(),j=B=>{$.current=B.target===B.currentTarget},k=B=>{$.current&&($.current=null,b&&b(B),m&&m(B,"backdropClick"))},U=jn(a),G=E.useMemo(()=>({titleId:U}),[U]);return D.jsx(pce,O({className:nt(F.root,d),closeAfterTransition:!0,components:{Backdrop:fce},componentsProps:{backdrop:O({transitionDuration:M,as:l},u)},disableEscapeKeyDown:f,onClose:m,open:w,ref:n,onClick:k,ownerState:R},A,{children:D.jsx(S,O({appear:!0,in:w,timeout:M,role:"presentation"},P,{children:D.jsx(mce,{className:nt(F.container),onMouseDown:j,ownerState:R,children:D.jsx(gce,O({as:x,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":U},_,{className:nt(F.paper,_.className),ownerState:R,children:D.jsx(rG.Provider,{value:G,children:c})}))})}))}))});function vce(t){return It("MuiDialogContent",t)}At("MuiDialogContent",["root","dividers"]);function yce(t){return It("MuiDialogTitle",t)}const bce=At("MuiDialogTitle",["root"]),xce=["className","dividers"],wce=t=>{const{classes:e,dividers:n}=t;return Qe({root:["root",n&&"dividers"]},vce,e)},_ce=ze("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.dividers&&e.dividers]}})(({theme:t,ownerState:e})=>O({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}:{[`.${bce.root} + &`]:{paddingTop:0}})),oG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDialogContent"}),{className:i,dividers:o=!1}=r,s=Be(r,xce),a=O({},r,{dividers:o}),l=wce(a);return D.jsx(_ce,O({className:nt(l.root,i),ownerState:a,ref:n},s))}),Sce=["className","id"],Cce=t=>{const{classes:e}=t;return Qe({root:["root"]},yce,e)},Ece=ze(xn,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(t,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),sG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDialogTitle"}),{className:i,id:o}=r,s=Be(r,Sce),a=r,l=Cce(a),{titleId:u=o}=E.useContext(rG);return D.jsx(Ece,O({component:"h2",className:nt(l.root,i),ownerState:a,ref:n,variant:"h6",id:o??u},s))});function Mce(t){return It("MuiDivider",t)}const O5=At("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Tce=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],Ace=t=>{const{absolute:e,children:n,classes:r,flexItem:i,light:o,orientation:s,textAlign:a,variant:l}=t;return Qe({root:["root",e&&"absolute",l,o&&"light",s==="vertical"&&"vertical",i&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",a==="right"&&s!=="vertical"&&"textAlignRight",a==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},Mce,r)},Pce=ze("div",{name:"MuiDivider",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.absolute&&e.absolute,e[n.variant],n.light&&e.light,n.orientation==="vertical"&&e.vertical,n.flexItem&&e.flexItem,n.children&&e.withChildren,n.children&&n.orientation==="vertical"&&e.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&e.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&e.textAlignLeft]}})(({theme:t,ownerState:e})=>O({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin"},e.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},e.light&&{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:fn(t.palette.divider,.08)},e.variant==="inset"&&{marginLeft:72},e.variant==="middle"&&e.orientation==="horizontal"&&{marginLeft:t.spacing(2),marginRight:t.spacing(2)},e.variant==="middle"&&e.orientation==="vertical"&&{marginTop:t.spacing(1),marginBottom:t.spacing(1)},e.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},e.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:t})=>O({},t.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,"&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:t,ownerState:e})=>O({},e.children&&e.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`}}),({theme:t,ownerState:e})=>O({},e.children&&e.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`}}),({ownerState:t})=>O({},t.textAlign==="right"&&t.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},t.textAlign==="left"&&t.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),Dce=ze("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.wrapper,n.orientation==="vertical"&&e.wrapperVertical]}})(({theme:t,ownerState:e})=>O({display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`},e.orientation==="vertical"&&{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`})),$l=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiDivider"}),{absolute:i=!1,children:o,className:s,component:a=o?"div":"hr",flexItem:l=!1,light:u=!1,orientation:c="horizontal",role:d=a!=="hr"?"separator":void 0,textAlign:f="center",variant:h="fullWidth"}=r,p=Be(r,Tce),g=O({},r,{absolute:i,component:a,flexItem:l,light:u,orientation:c,role:d,textAlign:f,variant:h}),b=Ace(g);return D.jsx(Pce,O({as:a,className:nt(b.root,s),role:d,ref:n,ownerState:g},p,{children:o?D.jsx(Dce,{className:b.wrapper,ownerState:g,children:o}):null}))});$l.muiSkipListHighlight=!0;const Rce=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Ice=t=>{const{classes:e,disableUnderline:n}=t,i=Qe({root:["root",!n&&"underline"],input:["input"]},Lle,e);return O({},e,i)},Nce=ze(rE,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...tE(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{var n;const r=t.palette.mode==="light",i=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",o=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return O({position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o}},[`&.${ys.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:o},[`&.${ys.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:a}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(t.vars||t).palette[e.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ys.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ys.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:i}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ys.disabled}, .${ys.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${ys.disabled}:before`]:{borderBottomStyle:"dotted"}},e.startAdornment&&{paddingLeft:12},e.endAdornment&&{paddingRight:12},e.multiline&&O({padding:"25px 12px 8px"},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9}))}),Fce=ze(iE,{name:"MuiFilledInput",slot:"Input",overridesResolver:nE})(({theme:t,ownerState:e})=>O({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{paddingTop:21,paddingBottom:4},e.hiddenLabel&&{paddingTop:16,paddingBottom:17},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0},e.hiddenLabel&&e.size==="small"&&{paddingTop:8,paddingBottom:9},e.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),WI=E.forwardRef(function(e,n){var r,i,o,s;const a=kt({props:e,name:"MuiFilledInput"}),{components:l={},componentsProps:u,fullWidth:c=!1,inputComponent:d="input",multiline:f=!1,slotProps:h,slots:p={},type:g="text"}=a,b=Be(a,Rce),m=O({},a,{fullWidth:c,inputComponent:d,multiline:f,type:g}),w=Ice(a),x={root:{ownerState:m},input:{ownerState:m}},_=h??u?Mo(x,h??u):x,C=(r=(i=p.root)!=null?i:l.Root)!=null?r:Nce,S=(o=(s=p.input)!=null?s:l.Input)!=null?o:Fce;return D.jsx(fg,O({slots:{root:C,input:S},componentsProps:_,fullWidth:c,inputComponent:d,multiline:f,ref:n,type:g},b,{classes:w}))});WI.muiName="Input";function Oce(t){return It("MuiFormControl",t)}At("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const kce=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Lce=t=>{const{classes:e,margin:n,fullWidth:r}=t,i={root:["root",n!=="none"&&`margin${Ge(n)}`,r&&"fullWidth"]};return Qe(i,Oce,e)},Bce=ze("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:t},e)=>O({},e.root,e[`margin${Ge(t.margin)}`],t.fullWidth&&e.fullWidth)})(({ownerState:t})=>O({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},t.margin==="normal"&&{marginTop:16,marginBottom:8},t.margin==="dense"&&{marginTop:8,marginBottom:4},t.fullWidth&&{width:"100%"})),Ai=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:u=!1,focused:c,fullWidth:d=!1,hiddenLabel:f=!1,margin:h="none",required:p=!1,size:g="medium",variant:b="outlined"}=r,m=Be(r,kce),w=O({},r,{color:s,component:a,disabled:l,error:u,fullWidth:d,hiddenLabel:f,margin:h,required:p,size:g,variant:b}),x=Lce(w),[_,C]=E.useState(()=>{let j=!1;return i&&E.Children.forEach(i,k=>{if(!Yw(k,["Input","Select"]))return;const U=Yw(k,["Select"])?k.props.input:k;U&&Ple(U.props)&&(j=!0)}),j}),[S,M]=E.useState(()=>{let j=!1;return i&&E.Children.forEach(i,k=>{Yw(k,["Input","Select"])&&(q_(k.props,!0)||q_(k.props.inputProps,!0))&&(j=!0)}),j}),[P,A]=E.useState(!1);l&&P&&A(!1);const R=c!==void 0&&!l?c:P;let F;const $=E.useMemo(()=>({adornedStart:_,setAdornedStart:C,color:s,disabled:l,error:u,filled:S,focused:R,fullWidth:d,hiddenLabel:f,size:g,onBlur:()=>{A(!1)},onEmpty:()=>{M(!1)},onFilled:()=>{M(!0)},onFocus:()=>{A(!0)},registerEffect:F,required:p,variant:b}),[_,s,l,u,S,R,d,f,F,p,g,b]);return D.jsx(eE.Provider,{value:$,children:D.jsx(Bce,O({as:a,ownerState:w,className:nt(x.root,o),ref:n},m,{children:i}))})}),cn=yV({createStyledComponent:ze("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root}),useThemeProps:t=>kt({props:t,name:"MuiStack"})});function $ce(t){return It("MuiFormControlLabel",t)}const G0=At("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),zce=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],Uce=t=>{const{classes:e,disabled:n,labelPlacement:r,error:i,required:o}=t,s={root:["root",n&&"disabled",`labelPlacement${Ge(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return Qe(s,$ce,e)},Hce=ze("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${G0.label}`]:e.label},e.root,e[`labelPlacement${Ge(n.labelPlacement)}`]]}})(({theme:t,ownerState:e})=>O({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${G0.disabled}`]:{cursor:"default"}},e.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},e.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},e.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${G0.label}`]:{[`&.${G0.disabled}`]:{color:(t.vars||t).palette.text.disabled}}})),Vce=ze("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${G0.error}`]:{color:(t.vars||t).palette.error.main}})),Bo=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiFormControlLabel"}),{className:s,componentsProps:a={},control:l,disabled:u,disableTypography:c,label:d,labelPlacement:f="end",required:h,slotProps:p={}}=o,g=Be(o,zce),b=Wl(),m=(r=u??l.props.disabled)!=null?r:b==null?void 0:b.disabled,w=h??l.props.required,x={disabled:m,required:w};["checked","name","onChange","value","inputRef"].forEach(A=>{typeof l.props[A]>"u"&&typeof o[A]<"u"&&(x[A]=o[A])});const _=xd({props:o,muiFormControl:b,states:["error"]}),C=O({},o,{disabled:m,labelPlacement:f,required:w,error:_.error}),S=Uce(C),M=(i=p.typography)!=null?i:a.typography;let P=d;return P!=null&&P.type!==xn&&!c&&(P=D.jsx(xn,O({component:"span"},M,{className:nt(S.label,M==null?void 0:M.className),children:P}))),D.jsxs(Hce,O({className:nt(S.root,s),ownerState:C,ref:n},g,{children:[E.cloneElement(l,x),w?D.jsxs(cn,{display:"block",children:[P,D.jsxs(Vce,{ownerState:C,"aria-hidden":!0,className:S.asterisk,children:[" ","*"]})]}):P]}))});function Gce(t){return It("MuiFormGroup",t)}At("MuiFormGroup",["root","row","error"]);const jce=["className","row"],Wce=t=>{const{classes:e,row:n,error:r}=t;return Qe({root:["root",n&&"row",r&&"error"]},Gce,e)},qce=ze("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.row&&e.row]}})(({ownerState:t})=>O({display:"flex",flexDirection:"column",flexWrap:"wrap"},t.row&&{flexDirection:"row"})),aG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormGroup"}),{className:i,row:o=!1}=r,s=Be(r,jce),a=Wl(),l=xd({props:r,muiFormControl:a,states:["error"]}),u=O({},r,{row:o,error:l.error}),c=Wce(u);return D.jsx(qce,O({className:nt(c.root,i),ownerState:u,ref:n},s))});function Xce(t){return It("MuiFormHelperText",t)}const k5=At("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var L5;const Kce=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Yce=t=>{const{classes:e,contained:n,size:r,disabled:i,error:o,filled:s,focused:a,required:l}=t,u={root:["root",i&&"disabled",o&&"error",r&&`size${Ge(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return Qe(u,Xce,e)},Zce=ze("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size&&e[`size${Ge(n.size)}`],n.contained&&e.contained,n.filled&&e.filled]}})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},t.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${k5.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${k5.error}`]:{color:(t.vars||t).palette.error.main}},e.size==="small"&&{marginTop:4},e.contained&&{marginLeft:14,marginRight:14})),Qce=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormHelperText"}),{children:i,className:o,component:s="p"}=r,a=Be(r,Kce),l=Wl(),u=xd({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),c=O({},r,{component:s,contained:u.variant==="filled"||u.variant==="outlined",variant:u.variant,size:u.size,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required}),d=Yce(c);return D.jsx(Zce,O({as:s,ownerState:c,className:nt(d.root,o),ref:n},a,{children:i===" "?L5||(L5=D.jsx("span",{className:"notranslate",children:"​"})):i}))});function Jce(t){return It("MuiFormLabel",t)}const mv=At("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ede=["children","className","color","component","disabled","error","filled","focused","required"],tde=t=>{const{classes:e,color:n,focused:r,disabled:i,error:o,filled:s,required:a}=t,l={root:["root",`color${Ge(n)}`,i&&"disabled",o&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",o&&"error"]};return Qe(l,Jce,e)},nde=ze("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:t},e)=>O({},e.root,t.color==="secondary"&&e.colorSecondary,t.filled&&e.filled)})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},t.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${mv.focused}`]:{color:(t.vars||t).palette[e.color].main},[`&.${mv.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${mv.error}`]:{color:(t.vars||t).palette.error.main}})),rde=ze("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(t,e)=>e.asterisk})(({theme:t})=>({[`&.${mv.error}`]:{color:(t.vars||t).palette.error.main}})),qI=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiFormLabel"}),{children:i,className:o,component:s="label"}=r,a=Be(r,ede),l=Wl(),u=xd({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),c=O({},r,{color:u.color||"primary",component:s,disabled:u.disabled,error:u.error,filled:u.filled,focused:u.focused,required:u.required}),d=tde(c);return D.jsxs(nde,O({as:s,ownerState:c,className:nt(d.root,o),ref:n},a,{children:[i,u.required&&D.jsxs(rde,{ownerState:c,"aria-hidden":!0,className:d.asterisk,children:[" ","*"]})]}))}),B5=E.createContext();function ide(t){return It("MuiGrid",t)}const ode=[0,1,2,3,4,5,6,7,8,9,10],sde=["column-reverse","column","row-reverse","row"],ade=["nowrap","wrap-reverse","wrap"],c0=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],uy=At("MuiGrid",["root","container","item","zeroMinWidth",...ode.map(t=>`spacing-xs-${t}`),...sde.map(t=>`direction-xs-${t}`),...ade.map(t=>`wrap-xs-${t}`),...c0.map(t=>`grid-xs-${t}`),...c0.map(t=>`grid-sm-${t}`),...c0.map(t=>`grid-md-${t}`),...c0.map(t=>`grid-lg-${t}`),...c0.map(t=>`grid-xl-${t}`)]),lde=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function mm(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function ude({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,i)=>{let o={};if(e[i]&&(n=e[i]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=wf({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[i]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let u={};if(e.container&&e.item&&e.columnSpacing!==0){const c=t.spacing(e.columnSpacing);if(c!=="0px"){const d=`calc(${l} + ${mm(c)})`;u={flexBasis:d,maxWidth:d}}}o=O({flexBasis:l,flexGrow:0,maxWidth:l},u)}return t.breakpoints.values[i]===0?Object.assign(r,o):r[t.breakpoints.up(i)]=o,r},{})}function cde({theme:t,ownerState:e}){const n=wf({values:e.direction,breakpoints:t.breakpoints.values});return Qo({theme:t},n,r=>{const i={flexDirection:r};return r.indexOf("column")===0&&(i[`& > .${uy.item}`]={maxWidth:"none"}),i})}function lG({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(i=>{n===""&&e[i]!==0&&(n=i)});const r=Object.keys(t).sort((i,o)=>t[i]-t[o]);return r.slice(0,r.indexOf(n))}function dde({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let i={};if(n&&r!==0){const o=wf({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=lG({breakpoints:t.breakpoints.values,values:o})),i=Qo({theme:t},o,(a,l)=>{var u;const c=t.spacing(a);return c!=="0px"?{marginTop:`-${mm(c)}`,[`& > .${uy.item}`]:{paddingTop:mm(c)}}:(u=s)!=null&&u.includes(l)?{}:{marginTop:0,[`& > .${uy.item}`]:{paddingTop:0}}})}return i}function fde({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let i={};if(n&&r!==0){const o=wf({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=lG({breakpoints:t.breakpoints.values,values:o})),i=Qo({theme:t},o,(a,l)=>{var u;const c=t.spacing(a);return c!=="0px"?{width:`calc(100% + ${mm(c)})`,marginLeft:`-${mm(c)}`,[`& > .${uy.item}`]:{paddingLeft:mm(c)}}:(u=s)!=null&&u.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${uy.item}`]:{paddingLeft:0}}})}return i}function hde(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(i=>{const o=t[i];Number(o)>0&&r.push(n[`spacing-${i}-${String(o)}`])}),r}const pde=ze("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:i,item:o,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:u}=n;let c=[];r&&(c=hde(s,u,e));const d=[];return u.forEach(f=>{const h=n[f];h&&d.push(e[`grid-${f}-${String(h)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...c,i!=="row"&&e[`direction-xs-${String(i)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...d]}})(({ownerState:t})=>O({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),cde,dde,fde,ude);function mde(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const i=t[r];if(Number(i)>0){const o=`spacing-${r}-${String(i)}`;n.push(o)}}),n}const gde=t=>{const{classes:e,container:n,direction:r,item:i,spacing:o,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let u=[];n&&(u=mde(o,l));const c=[];l.forEach(f=>{const h=t[f];h&&c.push(`grid-${f}-${String(h)}`)});const d={root:["root",n&&"container",i&&"item",a&&"zeroMinWidth",...u,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...c]};return Qe(d,ide,e)},kc=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiGrid"}),{breakpoints:i}=ob(),o=rb(r),{className:s,columns:a,columnSpacing:l,component:u="div",container:c=!1,direction:d="row",item:f=!1,rowSpacing:h,spacing:p=0,wrap:g="wrap",zeroMinWidth:b=!1}=o,m=Be(o,lde),w=h||p,x=l||p,_=E.useContext(B5),C=c?a||12:_,S={},M=O({},m);i.keys.forEach(R=>{m[R]!=null&&(S[R]=m[R],delete M[R])});const P=O({},o,{columns:C,container:c,direction:d,item:f,rowSpacing:w,columnSpacing:x,wrap:g,zeroMinWidth:b,spacing:p},S,{breakpoints:i.keys}),A=gde(P);return D.jsx(B5.Provider,{value:C,children:D.jsx(pde,O({ownerState:P,className:nt(A.root,s),as:u,ref:n},M))})}),vde=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function fD(t){return`scale(${t}, ${t**2})`}const yde={entering:{opacity:1,transform:fD(1)},entered:{opacity:1,transform:"none"}},gT=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),cy=E.forwardRef(function(e,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:u,onEntering:c,onExit:d,onExited:f,onExiting:h,style:p,timeout:g="auto",TransitionComponent:b=jl}=e,m=Be(e,vde),w=Kp(),x=E.useRef(),_=ob(),C=E.useRef(null),S=An(C,o.ref,n),M=U=>G=>{if(U){const B=C.current;G===void 0?U(B):U(B,G)}},P=M(c),A=M((U,G)=>{DV(U);const{duration:B,delay:L,easing:N}=j_({style:p,timeout:g,easing:s},{mode:"enter"});let W;g==="auto"?(W=_.transitions.getAutoHeightDuration(U.clientHeight),x.current=W):W=B,U.style.transition=[_.transitions.create("opacity",{duration:W,delay:L}),_.transitions.create("transform",{duration:gT?W:W*.666,delay:L,easing:N})].join(","),l&&l(U,G)}),R=M(u),F=M(h),$=M(U=>{const{duration:G,delay:B,easing:L}=j_({style:p,timeout:g,easing:s},{mode:"exit"});let N;g==="auto"?(N=_.transitions.getAutoHeightDuration(U.clientHeight),x.current=N):N=G,U.style.transition=[_.transitions.create("opacity",{duration:N,delay:B}),_.transitions.create("transform",{duration:gT?N:N*.666,delay:gT?B:B||N*.333,easing:L})].join(","),U.style.opacity=0,U.style.transform=fD(.75),d&&d(U)}),j=M(f),k=U=>{g==="auto"&&w.start(x.current||0,U),r&&r(C.current,U)};return D.jsx(b,O({appear:i,in:a,nodeRef:C,onEnter:A,onEntered:R,onEntering:P,onExit:$,onExited:j,onExiting:F,addEndListener:k,timeout:g==="auto"?null:g},m,{children:(U,G)=>E.cloneElement(o,O({style:O({opacity:0,transform:fD(.75),visibility:U==="exited"&&!a?"hidden":void 0},yde[U],p,o.props.style),ref:S},G))}))});cy.muiSupportAuto=!0;const bde=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],xde=t=>{const{classes:e,disableUnderline:n}=t,i=Qe({root:["root",!n&&"underline"],input:["input"]},Ole,e);return O({},e,i)},wde=ze(rE,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiInput",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[...tE(t,e),!n.disableUnderline&&e.underline]}})(({theme:t,ownerState:e})=>{let r=t.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),O({position:"relative"},e.formControl&&{"label + &":{marginTop:16}},!e.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[e.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Ic.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Ic.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Ic.disabled}, .${Ic.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Ic.disabled}:before`]:{borderBottomStyle:"dotted"}})}),_de=ze(iE,{name:"MuiInput",slot:"Input",overridesResolver:nE})({}),XI=E.forwardRef(function(e,n){var r,i,o,s;const a=kt({props:e,name:"MuiInput"}),{disableUnderline:l,components:u={},componentsProps:c,fullWidth:d=!1,inputComponent:f="input",multiline:h=!1,slotProps:p,slots:g={},type:b="text"}=a,m=Be(a,bde),w=xde(a),_={root:{ownerState:{disableUnderline:l}}},C=p??c?Mo(p??c,_):_,S=(r=(i=g.root)!=null?i:u.Root)!=null?r:wde,M=(o=(s=g.input)!=null?s:u.Input)!=null?o:_de;return D.jsx(fg,O({slots:{root:S,input:M},slotProps:C,fullWidth:d,inputComponent:f,multiline:h,ref:n,type:b},m,{classes:w}))});XI.muiName="Input";function Sde(t){return It("MuiInputAdornment",t)}const $5=At("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var z5;const Cde=["children","className","component","disablePointerEvents","disableTypography","position","variant"],Ede=(t,e)=>{const{ownerState:n}=t;return[e.root,e[`position${Ge(n.position)}`],n.disablePointerEvents===!0&&e.disablePointerEvents,e[n.variant]]},Mde=t=>{const{classes:e,disablePointerEvents:n,hiddenLabel:r,position:i,size:o,variant:s}=t,a={root:["root",n&&"disablePointerEvents",i&&`position${Ge(i)}`,s,r&&"hiddenLabel",o&&`size${Ge(o)}`]};return Qe(a,Sde,e)},Tde=ze("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Ede})(({theme:t,ownerState:e})=>O({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},e.variant==="filled"&&{[`&.${$5.positionStart}&:not(.${$5.hiddenLabel})`]:{marginTop:16}},e.position==="start"&&{marginRight:8},e.position==="end"&&{marginLeft:8},e.disablePointerEvents===!0&&{pointerEvents:"none"})),si=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiInputAdornment"}),{children:i,className:o,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:u,variant:c}=r,d=Be(r,Cde),f=Wl()||{};let h=c;c&&f.variant,f&&!h&&(h=f.variant);const p=O({},r,{hiddenLabel:f.hiddenLabel,size:f.size,disablePointerEvents:a,position:u,variant:h}),g=Mde(p);return D.jsx(eE.Provider,{value:null,children:D.jsx(Tde,O({as:s,ownerState:p,className:nt(g.root,o),ref:n},d,{children:typeof i=="string"&&!l?D.jsx(xn,{color:"text.secondary",children:i}):D.jsxs(E.Fragment,{children:[u==="start"?z5||(z5=D.jsx("span",{className:"notranslate",children:"​"})):null,i]})}))})});function Ade(t){return It("MuiInputLabel",t)}At("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Pde=["disableAnimation","margin","shrink","variant","className"],Dde=t=>{const{classes:e,formControl:n,size:r,shrink:i,disableAnimation:o,variant:s,required:a}=t,l={root:["root",n&&"formControl",!o&&"animated",i&&"shrink",r&&r!=="normal"&&`size${Ge(r)}`,s],asterisk:[a&&"asterisk"]},u=Qe(l,Ade,e);return O({},e,u)},Rde=ze(qI,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${mv.asterisk}`]:e.asterisk},e.root,n.formControl&&e.formControl,n.size==="small"&&e.sizeSmall,n.shrink&&e.shrink,!n.disableAnimation&&e.animated,n.focused&&e.focused,e[n.variant]]}})(({theme:t,ownerState:e})=>O({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},e.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},e.size==="small"&&{transform:"translate(0, 17px) scale(1)"},e.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!e.disableAnimation&&{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})},e.variant==="filled"&&O({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},e.shrink&&O({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},e.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),e.variant==="outlined"&&O({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},e.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},e.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),ca=E.forwardRef(function(e,n){const r=kt({name:"MuiInputLabel",props:e}),{disableAnimation:i=!1,shrink:o,className:s}=r,a=Be(r,Pde),l=Wl();let u=o;typeof u>"u"&&l&&(u=l.filled||l.focused||l.adornedStart);const c=xd({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),d=O({},r,{disableAnimation:i,formControl:l,shrink:u,size:c.size,variant:c.variant,required:c.required,focused:c.focused}),f=Dde(d);return D.jsx(Rde,O({"data-shrink":u,ownerState:d,ref:n,className:nt(f.root,s)},a,{classes:f}))}),X_=E.createContext({});function Ide(t){return It("MuiList",t)}At("MuiList",["root","padding","dense","subheader"]);const Nde=["children","className","component","dense","disablePadding","subheader"],Fde=t=>{const{classes:e,disablePadding:n,dense:r,subheader:i}=t;return Qe({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},Ide,e)},Ode=ze("ul",{name:"MuiList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disablePadding&&e.padding,n.dense&&e.dense,n.subheader&&e.subheader]}})(({ownerState:t})=>O({listStyle:"none",margin:0,padding:0,position:"relative"},!t.disablePadding&&{paddingTop:8,paddingBottom:8},t.subheader&&{paddingTop:0})),kde=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiList"}),{children:i,className:o,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:u}=r,c=Be(r,Nde),d=E.useMemo(()=>({dense:a}),[a]),f=O({},r,{component:s,dense:a,disablePadding:l}),h=Fde(f);return D.jsx(X_.Provider,{value:d,children:D.jsxs(Ode,O({as:s,className:nt(h.root,o),ref:n,ownerState:f},c,{children:[u,i]}))})});function Lde(t){return It("MuiListItemIcon",t)}const U5=At("MuiListItemIcon",["root","alignItemsFlexStart"]),Bde=["className"],$de=t=>{const{alignItems:e,classes:n}=t;return Qe({root:["root",e==="flex-start"&&"alignItemsFlexStart"]},Lde,n)},zde=ze("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.alignItems==="flex-start"&&e.alignItemsFlexStart]}})(({theme:t,ownerState:e})=>O({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},e.alignItems==="flex-start"&&{marginTop:8})),Ude=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiListItemIcon"}),{className:i}=r,o=Be(r,Bde),s=E.useContext(X_),a=O({},r,{alignItems:s.alignItems}),l=$de(a);return D.jsx(zde,O({className:nt(l.root,i),ownerState:a,ref:n},o))}),H5=At("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),Hde=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function vT(t,e,n){return t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:n?null:t.firstChild}function V5(t,e,n){return t===e?n?t.firstChild:t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:n?null:t.lastChild}function uG(t,e){if(e===void 0)return!0;let n=t.innerText;return n===void 0&&(n=t.textContent),n=n.trim().toLowerCase(),n.length===0?!1:e.repeating?n[0]===e.keys[0]:n.indexOf(e.keys.join(""))===0}function d0(t,e,n,r,i,o){let s=!1,a=i(t,e,e?n:!1);for(;a;){if(a===t.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!uG(a,o)||l)a=i(t,a,n);else return a.focus(),!0}return!1}const ub=E.forwardRef(function(e,n){const{actions:r,autoFocus:i=!1,autoFocusItem:o=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:c,variant:d="selectedMenu"}=e,f=Be(e,Hde),h=E.useRef(null),p=E.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});_r(()=>{i&&h.current.focus()},[i]),E.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(x,{direction:_})=>{const C=!h.current.style.width;if(x.clientHeight{const _=h.current,C=x.key,S=Sr(_).activeElement;if(C==="ArrowDown")x.preventDefault(),d0(_,S,u,l,vT);else if(C==="ArrowUp")x.preventDefault(),d0(_,S,u,l,V5);else if(C==="Home")x.preventDefault(),d0(_,null,u,l,vT);else if(C==="End")x.preventDefault(),d0(_,null,u,l,V5);else if(C.length===1){const M=p.current,P=C.toLowerCase(),A=performance.now();M.keys.length>0&&(A-M.lastTime>500?(M.keys=[],M.repeating=!0,M.previousKeyMatched=!0):M.repeating&&P!==M.keys[0]&&(M.repeating=!1)),M.lastTime=A,M.keys.push(P);const R=S&&!M.repeating&&uG(S,M);M.previousKeyMatched&&(R||d0(_,S,!1,l,vT,M))?x.preventDefault():M.previousKeyMatched=!1}c&&c(x)},b=An(h,n);let m=-1;E.Children.forEach(s,(x,_)=>{if(!E.isValidElement(x)){m===_&&(m+=1,m>=s.length&&(m=-1));return}x.props.disabled||(d==="selectedMenu"&&x.props.selected||m===-1)&&(m=_),m===_&&(x.props.disabled||x.props.muiSkipListHighlight||x.type.muiSkipListHighlight)&&(m+=1,m>=s.length&&(m=-1))});const w=E.Children.map(s,(x,_)=>{if(_===m){const C={};return o&&(C.autoFocus=!0),x.props.tabIndex===void 0&&d==="selectedMenu"&&(C.tabIndex=0),E.cloneElement(x,C)}return x});return D.jsx(kde,O({role:"menu",ref:b,className:a,onKeyDown:g,tabIndex:i?0:-1},f,{children:w}))});function Vde(t){return It("MuiPopover",t)}At("MuiPopover",["root","paper"]);const Gde=["onEntering"],jde=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],Wde=["slotProps"];function G5(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.height/2:e==="bottom"&&(n=t.height),n}function j5(t,e){let n=0;return typeof e=="number"?n=e:e==="center"?n=t.width/2:e==="right"&&(n=t.width),n}function W5(t){return[t.horizontal,t.vertical].map(e=>typeof e=="number"?`${e}px`:e).join(" ")}function yT(t){return typeof t=="function"?t():t}const qde=t=>{const{classes:e}=t;return Qe({root:["root"],paper:["paper"]},Vde,e)},Xde=ze(nG,{name:"MuiPopover",slot:"Root",overridesResolver:(t,e)=>e.root})({}),cG=ze(Xu,{name:"MuiPopover",slot:"Paper",overridesResolver:(t,e)=>e.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),dG=E.forwardRef(function(e,n){var r,i,o;const s=kt({props:e,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:u={vertical:"top",horizontal:"left"},anchorPosition:c,anchorReference:d="anchorEl",children:f,className:h,container:p,elevation:g=8,marginThreshold:b=16,open:m,PaperProps:w={},slots:x,slotProps:_,transformOrigin:C={vertical:"top",horizontal:"left"},TransitionComponent:S=cy,transitionDuration:M="auto",TransitionProps:{onEntering:P}={},disableScrollLock:A=!1}=s,R=Be(s.TransitionProps,Gde),F=Be(s,jde),$=(r=_==null?void 0:_.paper)!=null?r:w,j=E.useRef(),k=An(j,$.ref),U=O({},s,{anchorOrigin:u,anchorReference:d,elevation:g,marginThreshold:b,externalPaperSlotProps:$,transformOrigin:C,TransitionComponent:S,transitionDuration:M,TransitionProps:R}),G=qde(U),B=E.useCallback(()=>{if(d==="anchorPosition")return c;const _e=yT(l),X=(_e&&_e.nodeType===1?_e:Sr(j.current).body).getBoundingClientRect();return{top:X.top+G5(X,u.vertical),left:X.left+j5(X,u.horizontal)}},[l,u.horizontal,u.vertical,c,d]),L=E.useCallback(_e=>({vertical:G5(_e,C.vertical),horizontal:j5(_e,C.horizontal)}),[C.horizontal,C.vertical]),N=E.useCallback(_e=>{const Ce={width:_e.offsetWidth,height:_e.offsetHeight},X=L(Ce);if(d==="none")return{top:null,left:null,transformOrigin:W5(X)};const Z=B();let he=Z.top-X.vertical,Y=Z.left-X.horizontal;const ne=he+Ce.height,se=Y+Ce.width,xe=Ll(yT(l)),Pe=xe.innerHeight-b,z=xe.innerWidth-b;if(b!==null&&hePe){const H=ne-Pe;he-=H,X.vertical+=H}if(b!==null&&Yz){const H=se-z;Y-=H,X.horizontal+=H}return{top:`${Math.round(he)}px`,left:`${Math.round(Y)}px`,transformOrigin:W5(X)}},[l,d,B,L,b]),[W,K]=E.useState(m),Q=E.useCallback(()=>{const _e=j.current;if(!_e)return;const Ce=N(_e);Ce.top!==null&&(_e.style.top=Ce.top),Ce.left!==null&&(_e.style.left=Ce.left),_e.style.transformOrigin=Ce.transformOrigin,K(!0)},[N]);E.useEffect(()=>(A&&window.addEventListener("scroll",Q),()=>window.removeEventListener("scroll",Q)),[l,A,Q]);const J=(_e,Ce)=>{P&&P(_e,Ce),Q()},ae=()=>{K(!1)};E.useEffect(()=>{m&&Q()}),E.useImperativeHandle(a,()=>m?{updatePosition:()=>{Q()}}:null,[m,Q]),E.useEffect(()=>{if(!m)return;const _e=ug(()=>{Q()}),Ce=Ll(l);return Ce.addEventListener("resize",_e),()=>{_e.clear(),Ce.removeEventListener("resize",_e)}},[l,m,Q]);let ve=M;M==="auto"&&!S.muiSupportAuto&&(ve=void 0);const fe=p||(l?Sr(yT(l)).body:void 0),Me=(i=x==null?void 0:x.root)!=null?i:Xde,ye=(o=x==null?void 0:x.paper)!=null?o:cG,we=$u({elementType:ye,externalSlotProps:O({},$,{style:W?$.style:O({},$.style,{opacity:0})}),additionalProps:{elevation:g,ref:k},ownerState:U,className:nt(G.paper,$==null?void 0:$.className)}),Fe=$u({elementType:Me,externalSlotProps:(_==null?void 0:_.root)||{},externalForwardedProps:F,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:fe,open:m},ownerState:U,className:nt(G.root,h)}),{slotProps:Oe}=Fe,re=Be(Fe,Wde);return D.jsx(Me,O({},re,!oy(Me)&&{slotProps:Oe,disableScrollLock:A},{children:D.jsx(S,O({appear:!0,in:m,onEntering:J,onExited:ae,timeout:ve},R,{children:D.jsx(ye,O({},we,{children:f}))}))}))});function Kde(t){return It("MuiMenu",t)}At("MuiMenu",["root","paper","list"]);const Yde=["onEntering"],Zde=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Qde={vertical:"top",horizontal:"right"},Jde={vertical:"top",horizontal:"left"},efe=t=>{const{classes:e}=t;return Qe({root:["root"],paper:["paper"],list:["list"]},Kde,e)},tfe=ze(dG,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(t,e)=>e.root})({}),nfe=ze(cG,{name:"MuiMenu",slot:"Paper",overridesResolver:(t,e)=>e.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),rfe=ze(ub,{name:"MuiMenu",slot:"List",overridesResolver:(t,e)=>e.list})({outline:0}),ife=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:u=!1,MenuListProps:c={},onClose:d,open:f,PaperProps:h={},PopoverClasses:p,transitionDuration:g="auto",TransitionProps:{onEntering:b}={},variant:m="selectedMenu",slots:w={},slotProps:x={}}=o,_=Be(o.TransitionProps,Yde),C=Be(o,Zde),S=CI(),M=O({},o,{autoFocus:s,disableAutoFocusItem:u,MenuListProps:c,onEntering:b,PaperProps:h,transitionDuration:g,TransitionProps:_,variant:m}),P=efe(M),A=s&&!u&&f,R=E.useRef(null),F=(L,N)=>{R.current&&R.current.adjustStyleForScrollbar(L,{direction:S?"rtl":"ltr"}),b&&b(L,N)},$=L=>{L.key==="Tab"&&(L.preventDefault(),d&&d(L,"tabKeyDown"))};let j=-1;E.Children.map(a,(L,N)=>{E.isValidElement(L)&&(L.props.disabled||(m==="selectedMenu"&&L.props.selected||j===-1)&&(j=N))});const k=(r=w.paper)!=null?r:nfe,U=(i=x.paper)!=null?i:h,G=$u({elementType:w.root,externalSlotProps:x.root,ownerState:M,className:[P.root,l]}),B=$u({elementType:k,externalSlotProps:U,ownerState:M,className:P.paper});return D.jsx(tfe,O({onClose:d,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?Qde:Jde,slots:{paper:k,root:w.root},slotProps:{root:G,paper:B},open:f,ref:n,transitionDuration:g,TransitionProps:O({onEntering:F},_),ownerState:M},C,{classes:p,children:D.jsx(rfe,O({onKeyDown:$,actions:R,autoFocus:s&&(j===-1||u),autoFocusItem:A,variant:m},c,{className:nt(P.list,c.className),children:a}))}))});function ofe(t){return It("MuiMenuItem",t)}const f0=At("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),sfe=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],afe=(t,e)=>{const{ownerState:n}=t;return[e.root,n.dense&&e.dense,n.divider&&e.divider,!n.disableGutters&&e.gutters]},lfe=t=>{const{disabled:e,dense:n,divider:r,disableGutters:i,selected:o,classes:s}=t,l=Qe({root:["root",n&&"dense",e&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},ofe,s);return O({},s,l)},ufe=ze(Bm,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:afe})(({theme:t,ownerState:e})=>O({},t.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${f0.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${f0.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${f0.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${f0.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${f0.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`& + .${O5.root}`]:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},[`& + .${O5.inset}`]:{marginLeft:52},[`& .${H5.root}`]:{marginTop:0,marginBottom:0},[`& .${H5.inset}`]:{paddingLeft:36},[`& .${U5.root}`]:{minWidth:36}},!e.dense&&{[t.breakpoints.up("sm")]:{minHeight:"auto"}},e.dense&&O({minHeight:32,paddingTop:4,paddingBottom:4},t.typography.body2,{[`& .${U5.root} svg`]:{fontSize:"1.25rem"}}))),wn=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:f}=r,h=Be(r,sfe),p=E.useContext(X_),g=E.useMemo(()=>({dense:s||p.dense||!1,disableGutters:l}),[p.dense,s,l]),b=E.useRef(null);_r(()=>{i&&b.current&&b.current.focus()},[i]);const m=O({},r,{dense:g.dense,divider:a,disableGutters:l}),w=lfe(r),x=An(b,n);let _;return r.disabled||(_=d!==void 0?d:-1),D.jsx(X_.Provider,{value:g,children:D.jsx(ufe,O({ref:x,role:c,tabIndex:_,component:o,focusVisibleClassName:nt(w.focusVisible,u),className:nt(w.root,f)},h,{ownerState:m,classes:w}))})});function cfe(t){return It("MuiNativeSelect",t)}const KI=At("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),dfe=["className","disabled","error","IconComponent","inputRef","variant"],ffe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ge(n)}`,o&&"iconOpen",r&&"disabled"]};return Qe(a,cfe,e)},fG=({ownerState:t,theme:e})=>O({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":O({},e.vars?{backgroundColor:`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:e.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${KI.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},t.variant==="filled"&&{"&&&":{paddingRight:32}},t.variant==="outlined"&&{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}),hfe=ze("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:uo,overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.select,e[n.variant],n.error&&e.error,{[`&.${KI.multiple}`]:e.multiple}]}})(fG),hG=({ownerState:t,theme:e})=>O({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${KI.disabled}`]:{color:(e.vars||e).palette.action.disabled}},t.open&&{transform:"rotate(180deg)"},t.variant==="filled"&&{right:7},t.variant==="outlined"&&{right:7}),pfe=ze("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Ge(n.variant)}`],n.open&&e.iconOpen]}})(hG),mfe=E.forwardRef(function(e,n){const{className:r,disabled:i,error:o,IconComponent:s,inputRef:a,variant:l="standard"}=e,u=Be(e,dfe),c=O({},e,{disabled:i,variant:l,error:o}),d=ffe(c);return D.jsxs(E.Fragment,{children:[D.jsx(hfe,O({ownerState:c,className:nt(d.select,r),disabled:i,ref:a||n},u)),e.multiple?null:D.jsx(pfe,{as:s,ownerState:c,className:d.icon})]})});var q5;const gfe=["children","classes","className","label","notched"],vfe=ze("fieldset",{shouldForwardProp:uo})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),yfe=ze("legend",{shouldForwardProp:uo})(({ownerState:t,theme:e})=>O({float:"unset",width:"auto",overflow:"hidden"},!t.withLabel&&{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})},t.withLabel&&O({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},t.notched&&{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})})));function bfe(t){const{className:e,label:n,notched:r}=t,i=Be(t,gfe),o=n!=null&&n!=="",s=O({},t,{notched:r,withLabel:o});return D.jsx(vfe,O({"aria-hidden":!0,className:e,ownerState:s},i,{children:D.jsx(yfe,{ownerState:s,children:o?D.jsx("span",{children:n}):q5||(q5=D.jsx("span",{className:"notranslate",children:"​"}))})}))}const xfe=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],wfe=t=>{const{classes:e}=t,r=Qe({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},kle,e);return O({},e,r)},_fe=ze(rE,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:tE})(({theme:t,ownerState:e})=>{const n=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return O({position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${gl.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${gl.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${gl.focused} .${gl.notchedOutline}`]:{borderColor:(t.vars||t).palette[e.color].main,borderWidth:2},[`&.${gl.error} .${gl.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${gl.disabled} .${gl.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}},e.startAdornment&&{paddingLeft:14},e.endAdornment&&{paddingRight:14},e.multiline&&O({padding:"16.5px 14px"},e.size==="small"&&{padding:"8.5px 14px"}))}),Sfe=ze(bfe,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(t,e)=>e.notchedOutline})(({theme:t})=>{const e=t.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:e}}),Cfe=ze(iE,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:nE})(({theme:t,ownerState:e})=>O({padding:"16.5px 14px"},!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:t.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:t.palette.mode==="light"?null:"#fff",caretColor:t.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},e.size==="small"&&{padding:"8.5px 14px"},e.multiline&&{padding:0},e.startAdornment&&{paddingLeft:0},e.endAdornment&&{paddingRight:0})),YI=E.forwardRef(function(e,n){var r,i,o,s,a;const l=kt({props:e,name:"MuiOutlinedInput"}),{components:u={},fullWidth:c=!1,inputComponent:d="input",label:f,multiline:h=!1,notched:p,slots:g={},type:b="text"}=l,m=Be(l,xfe),w=wfe(l),x=Wl(),_=xd({props:l,muiFormControl:x,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),C=O({},l,{color:_.color||"primary",disabled:_.disabled,error:_.error,focused:_.focused,formControl:x,fullWidth:c,hiddenLabel:_.hiddenLabel,multiline:h,size:_.size,type:b}),S=(r=(i=g.root)!=null?i:u.Root)!=null?r:_fe,M=(o=(s=g.input)!=null?s:u.Input)!=null?o:Cfe;return D.jsx(fg,O({slots:{root:S,input:M},renderSuffix:P=>D.jsx(Sfe,{ownerState:C,className:w.notchedOutline,label:f!=null&&f!==""&&_.required?a||(a=D.jsxs(E.Fragment,{children:[f," ","*"]})):f,notched:typeof p<"u"?p:!!(P.startAdornment||P.filled||P.focused)}),fullWidth:c,inputComponent:d,multiline:h,ref:n,type:b},m,{classes:O({},w,{notchedOutline:null})}))});YI.muiName="Input";const Efe=mn(D.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Mfe=mn(D.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Tfe=mn(D.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),Afe=mn(D.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),Pfe=ze("span",{shouldForwardProp:uo})({position:"relative",display:"flex"}),Dfe=ze(Tfe)({transform:"scale(1)"}),Rfe=ze(Afe)(({theme:t,ownerState:e})=>O({left:0,position:"absolute",transform:"scale(0)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeIn,duration:t.transitions.duration.shortest})},e.checked&&{transform:"scale(1)",transition:t.transitions.create("transform",{easing:t.transitions.easing.easeOut,duration:t.transitions.duration.shortest})}));function pG(t){const{checked:e=!1,classes:n={},fontSize:r}=t,i=O({},t,{checked:e});return D.jsxs(Pfe,{className:n.root,ownerState:i,children:[D.jsx(Dfe,{fontSize:r,className:n.background,ownerState:i}),D.jsx(Rfe,{fontSize:r,className:n.dot,ownerState:i})]})}const mG=E.createContext(void 0);function Ife(){return E.useContext(mG)}function Nfe(t){return It("MuiRadio",t)}const X5=At("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),Ffe=["checked","checkedIcon","color","icon","name","onChange","size","className"],Ofe=t=>{const{classes:e,color:n,size:r}=t,i={root:["root",`color${Ge(n)}`,r!=="medium"&&`size${Ge(r)}`]};return O({},e,Qe(i,Nfe,e))},kfe=ze(jI,{shouldForwardProp:t=>uo(t)||t==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.size!=="medium"&&e[`size${Ge(n.size)}`],e[`color${Ge(n.color)}`]]}})(({theme:t,ownerState:e})=>O({color:(t.vars||t).palette.text.secondary},!e.disableRipple&&{"&:hover":{backgroundColor:t.vars?`rgba(${e.color==="default"?t.vars.palette.action.activeChannel:t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(e.color==="default"?t.palette.action.active:t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${X5.checked}`]:{color:(t.vars||t).palette[e.color].main}},{[`&.${X5.disabled}`]:{color:(t.vars||t).palette.action.disabled}}));function Lfe(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}const K5=D.jsx(pG,{checked:!0}),Y5=D.jsx(pG,{}),gm=E.forwardRef(function(e,n){var r,i;const o=kt({props:e,name:"MuiRadio"}),{checked:s,checkedIcon:a=K5,color:l="primary",icon:u=Y5,name:c,onChange:d,size:f="medium",className:h}=o,p=Be(o,Ffe),g=O({},o,{color:l,size:f}),b=Ofe(g),m=Ife();let w=s;const x=H_(d,m&&m.onChange);let _=c;return m&&(typeof w>"u"&&(w=Lfe(m.value,o.value)),typeof _>"u"&&(_=m.name)),D.jsx(kfe,O({type:"radio",icon:E.cloneElement(u,{fontSize:(r=Y5.props.fontSize)!=null?r:f}),checkedIcon:E.cloneElement(a,{fontSize:(i=K5.props.fontSize)!=null?i:f}),ownerState:g,classes:b,name:_,checked:w,onChange:x,ref:n,className:nt(b.root,h)},p))});function Bfe(t){return It("MuiRadioGroup",t)}At("MuiRadioGroup",["root","row","error"]);const $fe=["actions","children","className","defaultValue","name","onChange","value"],zfe=t=>{const{classes:e,row:n,error:r}=t;return Qe({root:["root",n&&"row",r&&"error"]},Bfe,e)},gG=E.forwardRef(function(e,n){const{actions:r,children:i,className:o,defaultValue:s,name:a,onChange:l,value:u}=e,c=Be(e,$fe),d=E.useRef(null),f=zfe(e),[h,p]=Ru({controlled:u,default:s,name:"RadioGroup"});E.useImperativeHandle(r,()=>({focus:()=>{let w=d.current.querySelector("input:not(:disabled):checked");w||(w=d.current.querySelector("input:not(:disabled)")),w&&w.focus()}}),[]);const g=An(n,d),b=jn(a),m=E.useMemo(()=>({name:b,onChange(w){p(w.target.value),l&&l(w,w.target.value)},value:h}),[b,l,p,h]);return D.jsx(mG.Provider,{value:m,children:D.jsx(aG,O({role:"radiogroup",ref:g,className:nt(f.root,o)},c,{children:i}))})});function Ufe(t){return It("MuiSelect",t)}const h0=At("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Z5;const Hfe=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],Vfe=ze("div",{name:"MuiSelect",slot:"Select",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`&.${h0.select}`]:e.select},{[`&.${h0.select}`]:e[n.variant]},{[`&.${h0.error}`]:e.error},{[`&.${h0.multiple}`]:e.multiple}]}})(fG,{[`&.${h0.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Gfe=ze("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.icon,n.variant&&e[`icon${Ge(n.variant)}`],n.open&&e.iconOpen]}})(hG),jfe=ze("input",{shouldForwardProp:t=>PV(t)&&t!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(t,e)=>e.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Q5(t,e){return typeof e=="object"&&e!==null?t===e:String(t)===String(e)}function Wfe(t){return t==null||typeof t=="string"&&!t.trim()}const qfe=t=>{const{classes:e,variant:n,disabled:r,multiple:i,open:o,error:s}=t,a={select:["select",n,r&&"disabled",i&&"multiple",s&&"error"],icon:["icon",`icon${Ge(n)}`,o&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Qe(a,Ufe,e)},Xfe=E.forwardRef(function(e,n){var r;const{"aria-describedby":i,"aria-label":o,autoFocus:s,autoWidth:a,children:l,className:u,defaultOpen:c,defaultValue:d,disabled:f,displayEmpty:h,error:p=!1,IconComponent:g,inputRef:b,labelId:m,MenuProps:w={},multiple:x,name:_,onBlur:C,onChange:S,onClose:M,onFocus:P,onOpen:A,open:R,readOnly:F,renderValue:$,SelectDisplayProps:j={},tabIndex:k,value:U,variant:G="standard"}=e,B=Be(e,Hfe),[L,N]=Ru({controlled:U,default:d,name:"Select"}),[W,K]=Ru({controlled:R,default:c,name:"Select"}),Q=E.useRef(null),J=E.useRef(null),[ae,ve]=E.useState(null),{current:fe}=E.useRef(R!=null),[Me,ye]=E.useState(),we=An(n,b),Fe=E.useCallback(Ve=>{J.current=Ve,Ve&&ve(Ve)},[]),Oe=ae==null?void 0:ae.parentNode;E.useImperativeHandle(we,()=>({focus:()=>{J.current.focus()},node:Q.current,value:L}),[L]),E.useEffect(()=>{c&&W&&ae&&!fe&&(ye(a?null:Oe.clientWidth),J.current.focus())},[ae,a]),E.useEffect(()=>{s&&J.current.focus()},[s]),E.useEffect(()=>{if(!m)return;const Ve=Sr(J.current).getElementById(m);if(Ve){const Le=()=>{getSelection().isCollapsed&&J.current.focus()};return Ve.addEventListener("click",Le),()=>{Ve.removeEventListener("click",Le)}}},[m]);const re=(Ve,Le)=>{Ve?A&&A(Le):M&&M(Le),fe||(ye(a?null:Oe.clientWidth),K(Ve))},_e=Ve=>{Ve.button===0&&(Ve.preventDefault(),J.current.focus(),re(!0,Ve))},Ce=Ve=>{re(!1,Ve)},X=E.Children.toArray(l),Z=Ve=>{const Le=X.find(Ye=>Ye.props.value===Ve.target.value);Le!==void 0&&(N(Le.props.value),S&&S(Ve,Le))},he=Ve=>Le=>{let Ye;if(Le.currentTarget.hasAttribute("tabindex")){if(x){Ye=Array.isArray(L)?L.slice():[];const it=L.indexOf(Ve.props.value);it===-1?Ye.push(Ve.props.value):Ye.splice(it,1)}else Ye=Ve.props.value;if(Ve.props.onClick&&Ve.props.onClick(Le),L!==Ye&&(N(Ye),S)){const it=Le.nativeEvent||Le,ot=new it.constructor(it.type,it);Object.defineProperty(ot,"target",{writable:!0,value:{value:Ye,name:_}}),S(ot,Ve)}x||re(!1,Le)}},Y=Ve=>{F||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Ve.key)!==-1&&(Ve.preventDefault(),re(!0,Ve))},ne=ae!==null&&W,se=Ve=>{!ne&&C&&(Object.defineProperty(Ve,"target",{writable:!0,value:{value:L,name:_}}),C(Ve))};delete B["aria-invalid"];let xe,Pe;const z=[];let H=!1;(q_({value:L})||h)&&($?xe=$(L):H=!0);const te=X.map(Ve=>{if(!E.isValidElement(Ve))return null;let Le;if(x){if(!Array.isArray(L))throw new Error(Bu(2));Le=L.some(Ye=>Q5(Ye,Ve.props.value)),Le&&H&&z.push(Ve.props.children)}else Le=Q5(L,Ve.props.value),Le&&H&&(Pe=Ve.props.children);return E.cloneElement(Ve,{"aria-selected":Le?"true":"false",onClick:he(Ve),onKeyUp:Ye=>{Ye.key===" "&&Ye.preventDefault(),Ve.props.onKeyUp&&Ve.props.onKeyUp(Ye)},role:"option",selected:Le,value:void 0,"data-value":Ve.props.value})});H&&(x?z.length===0?xe=null:xe=z.reduce((Ve,Le,Ye)=>(Ve.push(Le),Ye{const{classes:e}=t;return e},ZI={name:"MuiSelect",overridesResolver:(t,e)=>e.root,shouldForwardProp:t=>uo(t)&&t!=="variant",slot:"Root"},Qfe=ze(XI,ZI)(""),Jfe=ze(YI,ZI)(""),ehe=ze(WI,ZI)(""),Ps=E.forwardRef(function(e,n){const r=kt({name:"MuiSelect",props:e}),{autoWidth:i=!1,children:o,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:c=QV,id:d,input:f,inputProps:h,label:p,labelId:g,MenuProps:b,multiple:m=!1,native:w=!1,onClose:x,onOpen:_,open:C,renderValue:S,SelectDisplayProps:M,variant:P="outlined"}=r,A=Be(r,Kfe),R=w?mfe:Xfe,F=Wl(),$=xd({props:r,muiFormControl:F,states:["variant","error"]}),j=$.variant||P,k=O({},r,{variant:j,classes:s}),U=Zfe(k),G=Be(U,Yfe),B=f||{standard:D.jsx(Qfe,{ownerState:k}),outlined:D.jsx(Jfe,{label:p,ownerState:k}),filled:D.jsx(ehe,{ownerState:k})}[j],L=An(n,B.ref);return D.jsx(E.Fragment,{children:E.cloneElement(B,O({inputComponent:R,inputProps:O({children:o,error:$.error,IconComponent:c,variant:j,type:void 0,multiple:m},w?{id:d}:{autoWidth:i,defaultOpen:l,displayEmpty:u,labelId:g,MenuProps:b,onClose:x,onOpen:_,open:C,renderValue:S,SelectDisplayProps:O({id:d},M)},h,{classes:h?Mo(G,h.classes):G},f?f.props.inputProps:{})},(m&&w||u)&&j==="outlined"?{notched:!0}:{},{ref:L,className:nt(B.props.className,a,U.root)},!f&&{variant:j},A))})});Ps.muiName="Select";function the(t){return It("MuiSkeleton",t)}At("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const nhe=["animation","className","component","height","style","variant","width"];let K_=t=>t,J5,eB,tB,nB;const rhe=t=>{const{classes:e,variant:n,animation:r,hasChildren:i,width:o,height:s}=t;return Qe({root:["root",n,r,i&&"withChildren",i&&!o&&"fitContent",i&&!s&&"heightAuto"]},the,e)},ihe=yd(J5||(J5=K_` 0% { opacity: 1; } @@ -204,34 +204,34 @@ Error generating stack: `+o.message+` top: 0; } `),ohe,(e.vars||e).palette.action.hover)),ahe=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiSkeleton"}),{animation:i="pulse",className:o,component:s="span",height:a,style:l,variant:u="text",width:c}=r,d=Be(r,nhe),f=O({},r,{animation:i,component:s,variant:u,hasChildren:!!d.children}),h=rhe(f);return D.jsx(she,O({as:s,ref:n,className:nt(h.root,o),ownerState:f},d,{style:O({width:c,height:a},l)}))});function lhe(t){return It("MuiTooltip",t)}const Lc=At("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),uhe=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function che(t){return Math.round(t*1e5)/1e5}const dhe=t=>{const{classes:e,disableInteractive:n,arrow:r,touch:i,placement:o}=t,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",i&&"touch",`tooltipPlacement${Ge(o.split("-")[0])}`],arrow:["arrow"]};return Qe(s,lhe,e)},fhe=ze(Yf,{name:"MuiTooltip",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.popper,!n.disableInteractive&&e.popperInteractive,n.arrow&&e.popperArrow,!n.open&&e.popperClose]}})(({theme:t,ownerState:e,open:n})=>O({zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none"},!e.disableInteractive&&{pointerEvents:"auto"},!n&&{pointerEvents:"none"},e.arrow&&{[`&[data-popper-placement*="bottom"] .${Lc.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Lc.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Lc.arrow}`]:O({},e.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Lc.arrow}`]:O({},e.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),hhe=ze("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.tooltip,n.touch&&e.touch,n.arrow&&e.tooltipArrow,e[`tooltipPlacement${Ge(n.placement.split("-")[0])}`]]}})(({theme:t,ownerState:e})=>O({backgroundColor:t.vars?t.vars.palette.Tooltip.bg:fn(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium},e.arrow&&{position:"relative",margin:0},e.touch&&{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:`${che(16/14)}em`,fontWeight:t.typography.fontWeightRegular},{[`.${Lc.popper}[data-popper-placement*="left"] &`]:O({transformOrigin:"right center"},e.isRtl?O({marginLeft:"14px"},e.touch&&{marginLeft:"24px"}):O({marginRight:"14px"},e.touch&&{marginRight:"24px"})),[`.${Lc.popper}[data-popper-placement*="right"] &`]:O({transformOrigin:"left center"},e.isRtl?O({marginRight:"14px"},e.touch&&{marginRight:"24px"}):O({marginLeft:"14px"},e.touch&&{marginLeft:"24px"})),[`.${Lc.popper}[data-popper-placement*="top"] &`]:O({transformOrigin:"center bottom",marginBottom:"14px"},e.touch&&{marginBottom:"24px"}),[`.${Lc.popper}[data-popper-placement*="bottom"] &`]:O({transformOrigin:"center top",marginTop:"14px"},e.touch&&{marginTop:"24px"})})),phe=ze("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(t,e)=>e.arrow})(({theme:t})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:fn(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let bx=!1;const rB=new ib;let p0={x:0,y:0};function xx(t,e){return(n,...r)=>{e&&e(n,...r),t(n,...r)}}const mhe=E.forwardRef(function(e,n){var r,i,o,s,a,l,u,c,d,f,h,p,g,b,m,w,x,_,C;const S=kt({props:e,name:"MuiTooltip"}),{arrow:M=!1,children:P,components:A={},componentsProps:R={},describeChild:F=!1,disableFocusListener:$=!1,disableHoverListener:j=!1,disableInteractive:k=!1,disableTouchListener:U=!1,enterDelay:G=100,enterNextDelay:B=0,enterTouchDelay:L=700,followCursor:N=!1,id:W,leaveDelay:K=0,leaveTouchDelay:Q=1500,onClose:J,onOpen:ae,open:ve,placement:fe="bottom",PopperComponent:Me,PopperProps:ye={},slotProps:we={},slots:Fe={},title:Oe,TransitionComponent:re=cy,TransitionProps:_e}=S,Ce=Be(S,uhe),X=E.isValidElement(P)?P:D.jsx("span",{children:P}),Z=ob(),he=CI(),[Y,ne]=E.useState(),[se,xe]=E.useState(null),Pe=E.useRef(!1),z=k||N,H=Kp(),te=Kp(),le=Kp(),de=Kp(),[ue,ge]=Ru({controlled:ve,default:!1,name:"Tooltip",state:"open"});let be=ue;const Te=jn(W),Re=E.useRef(),Ve=ar(()=>{Re.current!==void 0&&(document.body.style.WebkitUserSelect=Re.current,Re.current=void 0),de.clear()});E.useEffect(()=>Ve,[Ve]);const Le=Ee=>{rB.clear(),bx=!0,ge(!0),ae&&!be&&ae(Ee)},Ye=ar(Ee=>{rB.start(800+K,()=>{bx=!1}),ge(!1),J&&be&&J(Ee),H.start(Z.transitions.duration.shortest,()=>{Pe.current=!1})}),it=Ee=>{Pe.current&&Ee.type!=="touchstart"||(Y&&Y.removeAttribute("title"),te.clear(),le.clear(),G||bx&&B?te.start(bx?B:G,()=>{Le(Ee)}):Le(Ee))},ot=Ee=>{te.clear(),le.start(K,()=>{Ye(Ee)})},{isFocusVisibleRef:ht,onBlur:Je,onFocus:Ot,ref:Se}=_I(),[,st]=E.useState(!1),Ze=Ee=>{Je(Ee),ht.current===!1&&(st(!1),ot(Ee))},je=Ee=>{Y||ne(Ee.currentTarget),Ot(Ee),ht.current===!0&&(st(!0),it(Ee))},et=Ee=>{Pe.current=!0;const ke=X.props;ke.onTouchStart&&ke.onTouchStart(Ee)},Tt=Ee=>{et(Ee),le.clear(),H.clear(),Ve(),Re.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",de.start(L,()=>{document.body.style.WebkitUserSelect=Re.current,it(Ee)})},Qt=Ee=>{X.props.onTouchEnd&&X.props.onTouchEnd(Ee),Ve(),le.start(Q,()=>{Ye(Ee)})};E.useEffect(()=>{if(!be)return;function Ee(ke){(ke.key==="Escape"||ke.key==="Esc")&&Ye(ke)}return document.addEventListener("keydown",Ee),()=>{document.removeEventListener("keydown",Ee)}},[Ye,be]);const Fn=An(X.ref,Se,ne,n);!Oe&&Oe!==0&&(be=!1);const Vn=E.useRef(),Ut=Ee=>{const ke=X.props;ke.onMouseMove&&ke.onMouseMove(Ee),p0={x:Ee.clientX,y:Ee.clientY},Vn.current&&Vn.current.update()},Wt={},On=typeof Oe=="string";F?(Wt.title=!be&&On&&!j?Oe:null,Wt["aria-describedby"]=be?Te:null):(Wt["aria-label"]=On?Oe:null,Wt["aria-labelledby"]=be&&!On?Te:null);const Er=O({},Wt,Ce,X.props,{className:nt(Ce.className,X.props.className),onTouchStart:et,ref:Fn},N?{onMouseMove:Ut}:{}),Ii={};U||(Er.onTouchStart=Tt,Er.onTouchEnd=Qt),j||(Er.onMouseOver=xx(it,Er.onMouseOver),Er.onMouseLeave=xx(ot,Er.onMouseLeave),z||(Ii.onMouseOver=it,Ii.onMouseLeave=ot)),$||(Er.onFocus=xx(je,Er.onFocus),Er.onBlur=xx(Ze,Er.onBlur),z||(Ii.onFocus=je,Ii.onBlur=Ze));const Io=E.useMemo(()=>{var Ee;let ke=[{name:"arrow",enabled:!!se,options:{element:se,padding:4}}];return(Ee=ye.popperOptions)!=null&&Ee.modifiers&&(ke=ke.concat(ye.popperOptions.modifiers)),O({},ye.popperOptions,{modifiers:ke})},[se,ye]),jr=O({},S,{isRtl:he,arrow:M,disableInteractive:z,placement:fe,PopperComponentProp:Me,touch:Pe.current}),Ni=dhe(jr),co=(r=(i=Fe.popper)!=null?i:A.Popper)!=null?r:fhe,Fi=(o=(s=(a=Fe.transition)!=null?a:A.Transition)!=null?s:re)!=null?o:cy,fo=(l=(u=Fe.tooltip)!=null?u:A.Tooltip)!=null?l:hhe,qe=(c=(d=Fe.arrow)!=null?d:A.Arrow)!=null?c:phe,Ue=V0(co,O({},ye,(f=we.popper)!=null?f:R.popper,{className:nt(Ni.popper,ye==null?void 0:ye.className,(h=(p=we.popper)!=null?p:R.popper)==null?void 0:h.className)}),jr),ee=V0(Fi,O({},_e,(g=we.transition)!=null?g:R.transition),jr),pe=V0(fo,O({},(b=we.tooltip)!=null?b:R.tooltip,{className:nt(Ni.tooltip,(m=(w=we.tooltip)!=null?w:R.tooltip)==null?void 0:m.className)}),jr),Ae=V0(qe,O({},(x=we.arrow)!=null?x:R.arrow,{className:nt(Ni.arrow,(_=(C=we.arrow)!=null?C:R.arrow)==null?void 0:_.className)}),jr);return D.jsxs(E.Fragment,{children:[E.cloneElement(X,Er),D.jsx(co,O({as:Me??Yf,placement:fe,anchorEl:N?{getBoundingClientRect:()=>({top:p0.y,left:p0.x,right:p0.x,bottom:p0.y,width:0,height:0})}:Y,popperRef:Vn,open:Y?be:!1,id:Te,transition:!0},Ii,Ue,{popperOptions:Io,children:({TransitionProps:Ee})=>D.jsx(Fi,O({timeout:Z.transitions.duration.shorter},Ee,ee,{children:D.jsxs(fo,O({},pe,{children:[Oe,M?D.jsx(qe,O({},Ae,{ref:xe})):null]}))}))}))]})});function ghe(t){return It("MuiSwitch",t)}const no=At("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),vhe=["className","color","edge","size","sx"],yhe=DI(),bhe=t=>{const{classes:e,edge:n,size:r,color:i,checked:o,disabled:s}=t,a={root:["root",n&&`edge${Ge(n)}`,`size${Ge(r)}`],switchBase:["switchBase",`color${Ge(i)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=Qe(a,ghe,e);return O({},e,l)},xhe=ze("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${Ge(n.edge)}`],e[`size${Ge(n.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${no.thumb}`]:{width:16,height:16},[`& .${no.switchBase}`]:{padding:4,[`&.${no.checked}`]:{transform:"translateX(16px)"}}}}]}),whe=ze(jI,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${no.input}`]:e.input},n.color!=="default"&&e[`color${Ge(n.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${no.checked}`]:{transform:"translateX(20px)"},[`&.${no.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${no.checked} + .${no.track}`]:{opacity:.5},[`&.${no.disabled} + .${no.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${no.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,e])=>e.main&&e.light).map(([e])=>({props:{color:e},style:{[`&.${no.checked}`]:{color:(t.vars||t).palette[e].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fn(t.palette[e].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${no.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e}DisabledColor`]:`${t.palette.mode==="light"?MI(t.palette[e].main,.62):EI(t.palette[e].main,.55)}`}},[`&.${no.checked} + .${no.track}`]:{backgroundColor:(t.vars||t).palette[e].main}}}))]})),_he=ze("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),She=ze("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),Che=E.forwardRef(function(e,n){const r=yhe({props:e,name:"MuiSwitch"}),{className:i,color:o="primary",edge:s=!1,size:a="medium",sx:l}=r,u=Be(r,vhe),c=O({},r,{color:o,edge:s,size:a}),d=bhe(c),f=D.jsx(She,{className:d.thumb,ownerState:c});return D.jsxs(xhe,{className:nt(d.root,i),sx:l,ownerState:c,children:[D.jsx(whe,O({type:"checkbox",icon:f,checkedIcon:f,ref:n,ownerState:c},u,{classes:O({},d,{root:d.switchBase})})),D.jsx(_he,{className:d.track,ownerState:c})]})}),vG=E.createContext();function Ehe(t){return It("MuiTable",t)}At("MuiTable",["root","stickyHeader"]);const Mhe=["className","component","padding","size","stickyHeader"],The=t=>{const{classes:e,stickyHeader:n}=t;return Qe({root:["root",n&&"stickyHeader"]},Ehe,e)},Ahe=ze("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>O({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":O({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),iB="table",Phe=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTable"}),{className:i,component:o=iB,padding:s="normal",size:a="medium",stickyHeader:l=!1}=r,u=Be(r,Mhe),c=O({},r,{component:o,padding:s,size:a,stickyHeader:l}),d=The(c),f=E.useMemo(()=>({padding:s,size:a,stickyHeader:l}),[s,a,l]);return D.jsx(vG.Provider,{value:f,children:D.jsx(Ahe,O({as:o,role:o===iB?null:"table",ref:n,className:nt(d.root,i),ownerState:c},u))})}),QI=E.createContext();function Dhe(t){return It("MuiTableCell",t)}const Rhe=At("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Ihe=["align","className","component","padding","scope","size","sortDirection","variant"],Nhe=t=>{const{classes:e,variant:n,align:r,padding:i,size:o,stickyHeader:s}=t,a={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${Ge(r)}`,i!=="normal"&&`padding${Ge(i)}`,`size${Ge(o)}`]};return Qe(a,Dhe,e)},Fhe=ze("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`size${Ge(n.size)}`],n.padding!=="normal"&&e[`padding${Ge(n.padding)}`],n.align!=="inherit"&&e[`align${Ge(n.align)}`],n.stickyHeader&&e.stickyHeader]}})(({theme:t,ownerState:e})=>O({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid - ${t.palette.mode==="light"?MI(fn(t.palette.divider,1),.88):EI(fn(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},e.variant==="body"&&{color:(t.vars||t).palette.text.primary},e.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${Rhe.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),ri=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:u,sortDirection:c,variant:d}=r,f=Be(r,Ihe),h=E.useContext(vG),p=E.useContext(QI),g=p&&p.variant==="head";let b;s?b=s:b=g?"th":"td";let m=l;b==="td"?m=void 0:!m&&g&&(m="col");const w=d||p&&p.variant,x=O({},r,{align:i,component:b,padding:a||(h&&h.padding?h.padding:"normal"),size:u||(h&&h.size?h.size:"medium"),sortDirection:c,stickyHeader:w==="head"&&h&&h.stickyHeader,variant:w}),_=Nhe(x);let C=null;return c&&(C=c==="asc"?"ascending":"descending"),D.jsx(Fhe,O({as:b,ref:n,className:nt(_.root,o),"aria-sort":C,scope:m,ownerState:x},f))});function Ohe(t){return It("MuiTableContainer",t)}At("MuiTableContainer",["root"]);const khe=["className","component"],Lhe=t=>{const{classes:e}=t;return Qe({root:["root"]},Ohe,e)},Bhe=ze("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),$he=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,s=Be(r,khe),a=O({},r,{component:o}),l=Lhe(a);return D.jsx(Bhe,O({ref:n,as:o,className:nt(l.root,i),ownerState:a},s))});function zhe(t){return It("MuiTableHead",t)}At("MuiTableHead",["root"]);const Uhe=["className","component"],Hhe=t=>{const{classes:e}=t;return Qe({root:["root"]},zhe,e)},Vhe=ze("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),Ghe={variant:"head"},oB="thead",jhe=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableHead"}),{className:i,component:o=oB}=r,s=Be(r,Uhe),a=O({},r,{component:o}),l=Hhe(a);return D.jsx(QI.Provider,{value:Ghe,children:D.jsx(Vhe,O({as:o,className:nt(l.root,i),ref:n,role:o===oB?null:"rowgroup",ownerState:a},s))})});function Whe(t){return It("MuiToolbar",t)}At("MuiToolbar",["root","gutters","regular","dense"]);const qhe=["className","component","disableGutters","variant"],Xhe=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Qe({root:["root",!n&&"gutters",r]},Whe,e)},Khe=ze("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>O({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),yG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular"}=r,l=Be(r,qhe),u=O({},r,{component:o,disableGutters:s,variant:a}),c=Xhe(u);return D.jsx(Khe,O({as:o,className:nt(c.root,i),ref:n,ownerState:u},l))}),Yhe=mn(D.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),Zhe=mn(D.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),Qhe=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],Jhe=E.forwardRef(function(e,n){var r,i,o,s,a,l,u,c;const{backIconButtonProps:d,count:f,disabled:h=!1,getItemAriaLabel:p,nextIconButtonProps:g,onPageChange:b,page:m,rowsPerPage:w,showFirstButton:x,showLastButton:_,slots:C={},slotProps:S={}}=e,M=Be(e,Qhe),P=CI(),A=we=>{b(we,0)},R=we=>{b(we,m-1)},F=we=>{b(we,m+1)},$=we=>{b(we,Math.max(0,Math.ceil(f/w)-1))},j=(r=C.firstButton)!=null?r:io,k=(i=C.lastButton)!=null?i:io,U=(o=C.nextButton)!=null?o:io,G=(s=C.previousButton)!=null?s:io,B=(a=C.firstButtonIcon)!=null?a:Efe,L=(l=C.lastButtonIcon)!=null?l:Mfe,N=(u=C.nextButtonIcon)!=null?u:Zhe,W=(c=C.previousButtonIcon)!=null?c:Yhe,K=P?k:j,Q=P?U:G,J=P?G:U,ae=P?j:k,ve=P?S.lastButton:S.firstButton,fe=P?S.nextButton:S.previousButton,Me=P?S.previousButton:S.nextButton,ye=P?S.firstButton:S.lastButton;return D.jsxs("div",O({ref:n},M,{children:[x&&D.jsx(K,O({onClick:A,disabled:h||m===0,"aria-label":p("first",m),title:p("first",m)},ve,{children:P?D.jsx(L,O({},S.lastButtonIcon)):D.jsx(B,O({},S.firstButtonIcon))})),D.jsx(Q,O({onClick:R,disabled:h||m===0,color:"inherit","aria-label":p("previous",m),title:p("previous",m)},fe??d,{children:P?D.jsx(N,O({},S.nextButtonIcon)):D.jsx(W,O({},S.previousButtonIcon))})),D.jsx(J,O({onClick:F,disabled:h||(f!==-1?m>=Math.ceil(f/w)-1:!1),color:"inherit","aria-label":p("next",m),title:p("next",m)},Me??g,{children:P?D.jsx(W,O({},S.previousButtonIcon)):D.jsx(N,O({},S.nextButtonIcon))})),_&&D.jsx(ae,O({onClick:$,disabled:h||m>=Math.ceil(f/w)-1,"aria-label":p("last",m),title:p("last",m)},ye,{children:P?D.jsx(B,O({},S.firstButtonIcon)):D.jsx(L,O({},S.lastButtonIcon))}))]}))});function epe(t){return It("MuiTablePagination",t)}const Sf=At("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var sB;const tpe=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],npe=ze(ri,{name:"MuiTablePagination",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}})),rpe=ze(yG,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(t,e)=>O({[`& .${Sf.actions}`]:e.actions},e.toolbar)})(({theme:t})=>({minHeight:52,paddingRight:2,[`${t.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${Sf.actions}`]:{flexShrink:0,marginLeft:20}})),ipe=ze("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})({flex:"1 1 100%"}),ope=ze("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(t,e)=>e.selectLabel})(({theme:t})=>O({},t.typography.body2,{flexShrink:0})),spe=ze(Ps,{name:"MuiTablePagination",slot:"Select",overridesResolver:(t,e)=>O({[`& .${Sf.selectIcon}`]:e.selectIcon,[`& .${Sf.select}`]:e.select},e.input,e.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${Sf.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),ape=ze(wn,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(t,e)=>e.menuItem})({}),lpe=ze("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(t,e)=>e.displayedRows})(({theme:t})=>O({},t.typography.body2,{flexShrink:0}));function upe({from:t,to:e,count:n}){return`${t}–${e} of ${n!==-1?n:`more than ${e}`}`}function cpe(t){return`Go to ${t} page`}const dpe=t=>{const{classes:e}=t;return Qe({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},epe,e)},fpe=E.forwardRef(function(e,n){var r;const i=kt({props:e,name:"MuiTablePagination"}),{ActionsComponent:o=Jhe,backIconButtonProps:s,className:a,colSpan:l,component:u=ri,count:c,disabled:d=!1,getItemAriaLabel:f=cpe,labelDisplayedRows:h=upe,labelRowsPerPage:p="Rows per page:",nextIconButtonProps:g,onPageChange:b,onRowsPerPageChange:m,page:w,rowsPerPage:x,rowsPerPageOptions:_=[10,25,50,100],SelectProps:C={},showFirstButton:S=!1,showLastButton:M=!1,slotProps:P={},slots:A={}}=i,R=Be(i,tpe),F=i,$=dpe(F),j=(r=P==null?void 0:P.select)!=null?r:C,k=j.native?"option":ape;let U;(u===ri||u==="td")&&(U=l||1e3);const G=jn(j.id),B=jn(j.labelId),L=()=>c===-1?(w+1)*x:x===-1?c:Math.min(c,(w+1)*x);return D.jsx(npe,O({colSpan:U,ref:n,as:u,ownerState:F,className:nt($.root,a)},R,{children:D.jsxs(rpe,{className:$.toolbar,children:[D.jsx(ipe,{className:$.spacer}),_.length>1&&D.jsx(ope,{className:$.selectLabel,id:B,children:p}),_.length>1&&D.jsx(spe,O({variant:"standard"},!j.variant&&{input:sB||(sB=D.jsx(fg,{}))},{value:x,onChange:m,id:G,labelId:B},j,{classes:O({},j.classes,{root:nt($.input,$.selectRoot,(j.classes||{}).root),select:nt($.select,(j.classes||{}).select),icon:nt($.selectIcon,(j.classes||{}).icon)}),disabled:d,children:_.map(N=>E.createElement(k,O({},!oy(k)&&{ownerState:F},{className:$.menuItem,key:N.label?N.label:N,value:N.value?N.value:N}),N.label?N.label:N))})),D.jsx(lpe,{className:$.displayedRows,children:h({from:c===0?0:w*x+1,to:L(),count:c===-1?-1:c,page:w})}),D.jsx(o,{className:$.actions,backIconButtonProps:s,count:c,nextIconButtonProps:g,onPageChange:b,page:w,rowsPerPage:x,showFirstButton:S,showLastButton:M,slotProps:P.actions,slots:A.actions,getItemAriaLabel:f,disabled:d})]})}))});function hpe(t){return It("MuiTableRow",t)}const aB=At("MuiTableRow",["root","selected","hover","head","footer"]),ppe=["className","component","hover","selected"],mpe=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Qe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},hpe,e)},gpe=ze("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${aB.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${aB.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),lB="tr",wx=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableRow"}),{className:i,component:o=lB,hover:s=!1,selected:a=!1}=r,l=Be(r,ppe),u=E.useContext(QI),c=O({},r,{component:o,hover:s,selected:a,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),d=mpe(c);return D.jsx(gpe,O({as:o,ref:n,className:nt(d.root,i),role:o===lB?null:"row",ownerState:c},l))});function vpe(t){return It("MuiTextField",t)}At("MuiTextField",["root"]);const ype=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],bpe={standard:XI,filled:WI,outlined:YI},xpe=t=>{const{classes:e}=t;return Qe({root:["root"]},vpe,e)},wpe=ze(Ai,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),$n=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:u,disabled:c=!1,error:d=!1,FormHelperTextProps:f,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:b,inputProps:m,InputProps:w,inputRef:x,label:_,maxRows:C,minRows:S,multiline:M=!1,name:P,onBlur:A,onChange:R,onFocus:F,placeholder:$,required:j=!1,rows:k,select:U=!1,SelectProps:G,type:B,value:L,variant:N="outlined"}=r,W=Be(r,ype),K=O({},r,{autoFocus:o,color:l,disabled:c,error:d,fullWidth:h,multiline:M,required:j,select:U,variant:N}),Q=xpe(K),J={};N==="outlined"&&(b&&typeof b.shrink<"u"&&(J.notched=b.shrink),J.label=_),U&&((!G||!G.native)&&(J.id=void 0),J["aria-describedby"]=void 0);const ae=jn(g),ve=p&&ae?`${ae}-helper-text`:void 0,fe=_&&ae?`${ae}-label`:void 0,Me=bpe[N],ye=D.jsx(Me,O({"aria-describedby":ve,autoComplete:i,autoFocus:o,defaultValue:u,fullWidth:h,multiline:M,name:P,rows:k,maxRows:C,minRows:S,type:B,value:L,id:ae,inputRef:x,onBlur:A,onChange:R,onFocus:F,placeholder:$,inputProps:m},J,w));return D.jsxs(wpe,O({className:nt(Q.root,a),disabled:c,error:d,fullWidth:h,ref:n,required:j,color:l,variant:N,ownerState:K},W,{children:[_!=null&&_!==""&&D.jsx(da,O({htmlFor:ae,id:fe},b,{children:_})),U?D.jsx(Ps,O({"aria-describedby":ve,id:ae,labelId:fe,value:L,input:ye},G,{children:s})):ye,p&&D.jsx(Qce,O({id:ve},f,{children:p}))]}))});var bG={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Qn(t){return typeof t=="number"}function kr(t){return!t||typeof t!="object"||typeof t.constructor!="function"?!1:t.isBigNumber===!0&&typeof t.constructor.prototype=="object"&&t.constructor.prototype.isBigNumber===!0||typeof t.constructor.isDecimal=="function"&&t.constructor.isDecimal(t)===!0}function gv(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isComplex===!0||!1}function xG(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isFraction===!0||!1}function _c(t){return t&&t.constructor.prototype.isUnit===!0||!1}function _l(t){return typeof t=="string"}var gr=Array.isArray;function Or(t){return t&&t.constructor.prototype.isMatrix===!0||!1}function dy(t){return Array.isArray(t)||Or(t)}function _pe(t){return t&&t.isDenseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Spe(t){return t&&t.isSparseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Cpe(t){return t&&t.constructor.prototype.isRange===!0||!1}function JI(t){return t&&t.constructor.prototype.isIndex===!0||!1}function Epe(t){return typeof t=="boolean"}function Mpe(t){return t&&t.constructor.prototype.isResultSet===!0||!1}function Tpe(t){return t&&t.constructor.prototype.isHelp===!0||!1}function Ape(t){return typeof t=="function"}function Ppe(t){return t instanceof Date}function Dpe(t){return t instanceof RegExp}function eN(t){return!!(t&&typeof t=="object"&&t.constructor===Object&&!gv(t)&&!xG(t))}function Rpe(t){return t===null}function Ipe(t){return t===void 0}function Npe(t){return t&&t.isAccessorNode===!0&&t.constructor.prototype.isNode===!0||!1}function Fpe(t){return t&&t.isArrayNode===!0&&t.constructor.prototype.isNode===!0||!1}function Ope(t){return t&&t.isAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function kpe(t){return t&&t.isBlockNode===!0&&t.constructor.prototype.isNode===!0||!1}function Lpe(t){return t&&t.isConditionalNode===!0&&t.constructor.prototype.isNode===!0||!1}function Bpe(t){return t&&t.isConstantNode===!0&&t.constructor.prototype.isNode===!0||!1}function $pe(t){return t&&t.isFunctionAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function zpe(t){return t&&t.isFunctionNode===!0&&t.constructor.prototype.isNode===!0||!1}function Upe(t){return t&&t.isIndexNode===!0&&t.constructor.prototype.isNode===!0||!1}function Hpe(t){return t&&t.isNode===!0&&t.constructor.prototype.isNode===!0||!1}function Vpe(t){return t&&t.isObjectNode===!0&&t.constructor.prototype.isNode===!0||!1}function Gpe(t){return t&&t.isOperatorNode===!0&&t.constructor.prototype.isNode===!0||!1}function jpe(t){return t&&t.isParenthesisNode===!0&&t.constructor.prototype.isNode===!0||!1}function Wpe(t){return t&&t.isRangeNode===!0&&t.constructor.prototype.isNode===!0||!1}function qpe(t){return t&&t.isRelationalNode===!0&&t.constructor.prototype.isNode===!0||!1}function Xpe(t){return t&&t.isSymbolNode===!0&&t.constructor.prototype.isNode===!0||!1}function Kpe(t){return t&&t.constructor.prototype.isChain===!0||!1}function aa(t){var e=typeof t;return e==="object"?t===null?"null":kr(t)?"BigNumber":t.constructor&&t.constructor.name?t.constructor.name:"Object":e}function dr(t){var e=typeof t;if(e==="number"||e==="string"||e==="boolean"||t===null||t===void 0)return t;if(typeof t.clone=="function")return t.clone();if(Array.isArray(t))return t.map(function(n){return dr(n)});if(t instanceof Date)return new Date(t.valueOf());if(kr(t))return t;if(eN(t))return Ype(t,dr);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(t,")"))}function Ype(t,e){var n={};for(var r in t)Gn(t,r)&&(n[r]=e(t[r]));return n}function wG(t,e){for(var n in e)Gn(e,n)&&(t[n]=e[n]);return t}function Vm(t,e){var n,r,i;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(r=0,i=t.length;r *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),ri=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableCell"}),{align:i="inherit",className:o,component:s,padding:a,scope:l,size:u,sortDirection:c,variant:d}=r,f=Be(r,Ihe),h=E.useContext(vG),p=E.useContext(QI),g=p&&p.variant==="head";let b;s?b=s:b=g?"th":"td";let m=l;b==="td"?m=void 0:!m&&g&&(m="col");const w=d||p&&p.variant,x=O({},r,{align:i,component:b,padding:a||(h&&h.padding?h.padding:"normal"),size:u||(h&&h.size?h.size:"medium"),sortDirection:c,stickyHeader:w==="head"&&h&&h.stickyHeader,variant:w}),_=Nhe(x);let C=null;return c&&(C=c==="asc"?"ascending":"descending"),D.jsx(Fhe,O({as:b,ref:n,className:nt(_.root,o),"aria-sort":C,scope:m,ownerState:x},f))});function Ohe(t){return It("MuiTableContainer",t)}At("MuiTableContainer",["root"]);const khe=["className","component"],Lhe=t=>{const{classes:e}=t;return Qe({root:["root"]},Ohe,e)},Bhe=ze("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(t,e)=>e.root})({width:"100%",overflowX:"auto"}),$he=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableContainer"}),{className:i,component:o="div"}=r,s=Be(r,khe),a=O({},r,{component:o}),l=Lhe(a);return D.jsx(Bhe,O({ref:n,as:o,className:nt(l.root,i),ownerState:a},s))});function zhe(t){return It("MuiTableHead",t)}At("MuiTableHead",["root"]);const Uhe=["className","component"],Hhe=t=>{const{classes:e}=t;return Qe({root:["root"]},zhe,e)},Vhe=ze("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"table-header-group"}),Ghe={variant:"head"},oB="thead",jhe=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableHead"}),{className:i,component:o=oB}=r,s=Be(r,Uhe),a=O({},r,{component:o}),l=Hhe(a);return D.jsx(QI.Provider,{value:Ghe,children:D.jsx(Vhe,O({as:o,className:nt(l.root,i),ref:n,role:o===oB?null:"rowgroup",ownerState:a},s))})});function Whe(t){return It("MuiToolbar",t)}At("MuiToolbar",["root","gutters","regular","dense"]);const qhe=["className","component","disableGutters","variant"],Xhe=t=>{const{classes:e,disableGutters:n,variant:r}=t;return Qe({root:["root",!n&&"gutters",r]},Whe,e)},Khe=ze("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableGutters&&e.gutters,e[n.variant]]}})(({theme:t,ownerState:e})=>O({position:"relative",display:"flex",alignItems:"center"},!e.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},e.variant==="dense"&&{minHeight:48}),({theme:t,ownerState:e})=>e.variant==="regular"&&t.mixins.toolbar),yG=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular"}=r,l=Be(r,qhe),u=O({},r,{component:o,disableGutters:s,variant:a}),c=Xhe(u);return D.jsx(Khe,O({as:o,className:nt(c.root,i),ref:n,ownerState:u},l))}),Yhe=mn(D.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),Zhe=mn(D.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),Qhe=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],Jhe=E.forwardRef(function(e,n){var r,i,o,s,a,l,u,c;const{backIconButtonProps:d,count:f,disabled:h=!1,getItemAriaLabel:p,nextIconButtonProps:g,onPageChange:b,page:m,rowsPerPage:w,showFirstButton:x,showLastButton:_,slots:C={},slotProps:S={}}=e,M=Be(e,Qhe),P=CI(),A=we=>{b(we,0)},R=we=>{b(we,m-1)},F=we=>{b(we,m+1)},$=we=>{b(we,Math.max(0,Math.ceil(f/w)-1))},j=(r=C.firstButton)!=null?r:io,k=(i=C.lastButton)!=null?i:io,U=(o=C.nextButton)!=null?o:io,G=(s=C.previousButton)!=null?s:io,B=(a=C.firstButtonIcon)!=null?a:Efe,L=(l=C.lastButtonIcon)!=null?l:Mfe,N=(u=C.nextButtonIcon)!=null?u:Zhe,W=(c=C.previousButtonIcon)!=null?c:Yhe,K=P?k:j,Q=P?U:G,J=P?G:U,ae=P?j:k,ve=P?S.lastButton:S.firstButton,fe=P?S.nextButton:S.previousButton,Me=P?S.previousButton:S.nextButton,ye=P?S.firstButton:S.lastButton;return D.jsxs("div",O({ref:n},M,{children:[x&&D.jsx(K,O({onClick:A,disabled:h||m===0,"aria-label":p("first",m),title:p("first",m)},ve,{children:P?D.jsx(L,O({},S.lastButtonIcon)):D.jsx(B,O({},S.firstButtonIcon))})),D.jsx(Q,O({onClick:R,disabled:h||m===0,color:"inherit","aria-label":p("previous",m),title:p("previous",m)},fe??d,{children:P?D.jsx(N,O({},S.nextButtonIcon)):D.jsx(W,O({},S.previousButtonIcon))})),D.jsx(J,O({onClick:F,disabled:h||(f!==-1?m>=Math.ceil(f/w)-1:!1),color:"inherit","aria-label":p("next",m),title:p("next",m)},Me??g,{children:P?D.jsx(W,O({},S.previousButtonIcon)):D.jsx(N,O({},S.nextButtonIcon))})),_&&D.jsx(ae,O({onClick:$,disabled:h||m>=Math.ceil(f/w)-1,"aria-label":p("last",m),title:p("last",m)},ye,{children:P?D.jsx(B,O({},S.firstButtonIcon)):D.jsx(L,O({},S.lastButtonIcon))}))]}))});function epe(t){return It("MuiTablePagination",t)}const Sf=At("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var sB;const tpe=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],npe=ze(ri,{name:"MuiTablePagination",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}})),rpe=ze(yG,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(t,e)=>O({[`& .${Sf.actions}`]:e.actions},e.toolbar)})(({theme:t})=>({minHeight:52,paddingRight:2,[`${t.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${Sf.actions}`]:{flexShrink:0,marginLeft:20}})),ipe=ze("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})({flex:"1 1 100%"}),ope=ze("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(t,e)=>e.selectLabel})(({theme:t})=>O({},t.typography.body2,{flexShrink:0})),spe=ze(Ps,{name:"MuiTablePagination",slot:"Select",overridesResolver:(t,e)=>O({[`& .${Sf.selectIcon}`]:e.selectIcon,[`& .${Sf.select}`]:e.select},e.input,e.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${Sf.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),ape=ze(wn,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(t,e)=>e.menuItem})({}),lpe=ze("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(t,e)=>e.displayedRows})(({theme:t})=>O({},t.typography.body2,{flexShrink:0}));function upe({from:t,to:e,count:n}){return`${t}–${e} of ${n!==-1?n:`more than ${e}`}`}function cpe(t){return`Go to ${t} page`}const dpe=t=>{const{classes:e}=t;return Qe({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},epe,e)},fpe=E.forwardRef(function(e,n){var r;const i=kt({props:e,name:"MuiTablePagination"}),{ActionsComponent:o=Jhe,backIconButtonProps:s,className:a,colSpan:l,component:u=ri,count:c,disabled:d=!1,getItemAriaLabel:f=cpe,labelDisplayedRows:h=upe,labelRowsPerPage:p="Rows per page:",nextIconButtonProps:g,onPageChange:b,onRowsPerPageChange:m,page:w,rowsPerPage:x,rowsPerPageOptions:_=[10,25,50,100],SelectProps:C={},showFirstButton:S=!1,showLastButton:M=!1,slotProps:P={},slots:A={}}=i,R=Be(i,tpe),F=i,$=dpe(F),j=(r=P==null?void 0:P.select)!=null?r:C,k=j.native?"option":ape;let U;(u===ri||u==="td")&&(U=l||1e3);const G=jn(j.id),B=jn(j.labelId),L=()=>c===-1?(w+1)*x:x===-1?c:Math.min(c,(w+1)*x);return D.jsx(npe,O({colSpan:U,ref:n,as:u,ownerState:F,className:nt($.root,a)},R,{children:D.jsxs(rpe,{className:$.toolbar,children:[D.jsx(ipe,{className:$.spacer}),_.length>1&&D.jsx(ope,{className:$.selectLabel,id:B,children:p}),_.length>1&&D.jsx(spe,O({variant:"standard"},!j.variant&&{input:sB||(sB=D.jsx(fg,{}))},{value:x,onChange:m,id:G,labelId:B},j,{classes:O({},j.classes,{root:nt($.input,$.selectRoot,(j.classes||{}).root),select:nt($.select,(j.classes||{}).select),icon:nt($.selectIcon,(j.classes||{}).icon)}),disabled:d,children:_.map(N=>E.createElement(k,O({},!oy(k)&&{ownerState:F},{className:$.menuItem,key:N.label?N.label:N,value:N.value?N.value:N}),N.label?N.label:N))})),D.jsx(lpe,{className:$.displayedRows,children:h({from:c===0?0:w*x+1,to:L(),count:c===-1?-1:c,page:w})}),D.jsx(o,{className:$.actions,backIconButtonProps:s,count:c,nextIconButtonProps:g,onPageChange:b,page:w,rowsPerPage:x,showFirstButton:S,showLastButton:M,slotProps:P.actions,slots:A.actions,getItemAriaLabel:f,disabled:d})]})}))});function hpe(t){return It("MuiTableRow",t)}const aB=At("MuiTableRow",["root","selected","hover","head","footer"]),ppe=["className","component","hover","selected"],mpe=t=>{const{classes:e,selected:n,hover:r,head:i,footer:o}=t;return Qe({root:["root",n&&"selected",r&&"hover",i&&"head",o&&"footer"]},hpe,e)},gpe=ze("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.head&&e.head,n.footer&&e.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${aB.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${aB.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:fn(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:fn(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),lB="tr",wx=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTableRow"}),{className:i,component:o=lB,hover:s=!1,selected:a=!1}=r,l=Be(r,ppe),u=E.useContext(QI),c=O({},r,{component:o,hover:s,selected:a,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),d=mpe(c);return D.jsx(gpe,O({as:o,ref:n,className:nt(d.root,i),role:o===lB?null:"row",ownerState:c},l))});function vpe(t){return It("MuiTextField",t)}At("MuiTextField",["root"]);const ype=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],bpe={standard:XI,filled:WI,outlined:YI},xpe=t=>{const{classes:e}=t;return Qe({root:["root"]},vpe,e)},wpe=ze(Ai,{name:"MuiTextField",slot:"Root",overridesResolver:(t,e)=>e.root})({}),$n=E.forwardRef(function(e,n){const r=kt({props:e,name:"MuiTextField"}),{autoComplete:i,autoFocus:o=!1,children:s,className:a,color:l="primary",defaultValue:u,disabled:c=!1,error:d=!1,FormHelperTextProps:f,fullWidth:h=!1,helperText:p,id:g,InputLabelProps:b,inputProps:m,InputProps:w,inputRef:x,label:_,maxRows:C,minRows:S,multiline:M=!1,name:P,onBlur:A,onChange:R,onFocus:F,placeholder:$,required:j=!1,rows:k,select:U=!1,SelectProps:G,type:B,value:L,variant:N="outlined"}=r,W=Be(r,ype),K=O({},r,{autoFocus:o,color:l,disabled:c,error:d,fullWidth:h,multiline:M,required:j,select:U,variant:N}),Q=xpe(K),J={};N==="outlined"&&(b&&typeof b.shrink<"u"&&(J.notched=b.shrink),J.label=_),U&&((!G||!G.native)&&(J.id=void 0),J["aria-describedby"]=void 0);const ae=jn(g),ve=p&&ae?`${ae}-helper-text`:void 0,fe=_&&ae?`${ae}-label`:void 0,Me=bpe[N],ye=D.jsx(Me,O({"aria-describedby":ve,autoComplete:i,autoFocus:o,defaultValue:u,fullWidth:h,multiline:M,name:P,rows:k,maxRows:C,minRows:S,type:B,value:L,id:ae,inputRef:x,onBlur:A,onChange:R,onFocus:F,placeholder:$,inputProps:m},J,w));return D.jsxs(wpe,O({className:nt(Q.root,a),disabled:c,error:d,fullWidth:h,ref:n,required:j,color:l,variant:N,ownerState:K},W,{children:[_!=null&&_!==""&&D.jsx(ca,O({htmlFor:ae,id:fe},b,{children:_})),U?D.jsx(Ps,O({"aria-describedby":ve,id:ae,labelId:fe,value:L,input:ye},G,{children:s})):ye,p&&D.jsx(Qce,O({id:ve},f,{children:p}))]}))});var bG={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function Qn(t){return typeof t=="number"}function kr(t){return!t||typeof t!="object"||typeof t.constructor!="function"?!1:t.isBigNumber===!0&&typeof t.constructor.prototype=="object"&&t.constructor.prototype.isBigNumber===!0||typeof t.constructor.isDecimal=="function"&&t.constructor.isDecimal(t)===!0}function gv(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isComplex===!0||!1}function xG(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isFraction===!0||!1}function _c(t){return t&&t.constructor.prototype.isUnit===!0||!1}function wl(t){return typeof t=="string"}var gr=Array.isArray;function Or(t){return t&&t.constructor.prototype.isMatrix===!0||!1}function dy(t){return Array.isArray(t)||Or(t)}function _pe(t){return t&&t.isDenseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Spe(t){return t&&t.isSparseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Cpe(t){return t&&t.constructor.prototype.isRange===!0||!1}function JI(t){return t&&t.constructor.prototype.isIndex===!0||!1}function Epe(t){return typeof t=="boolean"}function Mpe(t){return t&&t.constructor.prototype.isResultSet===!0||!1}function Tpe(t){return t&&t.constructor.prototype.isHelp===!0||!1}function Ape(t){return typeof t=="function"}function Ppe(t){return t instanceof Date}function Dpe(t){return t instanceof RegExp}function eN(t){return!!(t&&typeof t=="object"&&t.constructor===Object&&!gv(t)&&!xG(t))}function Rpe(t){return t===null}function Ipe(t){return t===void 0}function Npe(t){return t&&t.isAccessorNode===!0&&t.constructor.prototype.isNode===!0||!1}function Fpe(t){return t&&t.isArrayNode===!0&&t.constructor.prototype.isNode===!0||!1}function Ope(t){return t&&t.isAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function kpe(t){return t&&t.isBlockNode===!0&&t.constructor.prototype.isNode===!0||!1}function Lpe(t){return t&&t.isConditionalNode===!0&&t.constructor.prototype.isNode===!0||!1}function Bpe(t){return t&&t.isConstantNode===!0&&t.constructor.prototype.isNode===!0||!1}function $pe(t){return t&&t.isFunctionAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function zpe(t){return t&&t.isFunctionNode===!0&&t.constructor.prototype.isNode===!0||!1}function Upe(t){return t&&t.isIndexNode===!0&&t.constructor.prototype.isNode===!0||!1}function Hpe(t){return t&&t.isNode===!0&&t.constructor.prototype.isNode===!0||!1}function Vpe(t){return t&&t.isObjectNode===!0&&t.constructor.prototype.isNode===!0||!1}function Gpe(t){return t&&t.isOperatorNode===!0&&t.constructor.prototype.isNode===!0||!1}function jpe(t){return t&&t.isParenthesisNode===!0&&t.constructor.prototype.isNode===!0||!1}function Wpe(t){return t&&t.isRangeNode===!0&&t.constructor.prototype.isNode===!0||!1}function qpe(t){return t&&t.isRelationalNode===!0&&t.constructor.prototype.isNode===!0||!1}function Xpe(t){return t&&t.isSymbolNode===!0&&t.constructor.prototype.isNode===!0||!1}function Kpe(t){return t&&t.constructor.prototype.isChain===!0||!1}function aa(t){var e=typeof t;return e==="object"?t===null?"null":kr(t)?"BigNumber":t.constructor&&t.constructor.name?t.constructor.name:"Object":e}function dr(t){var e=typeof t;if(e==="number"||e==="string"||e==="boolean"||t===null||t===void 0)return t;if(typeof t.clone=="function")return t.clone();if(Array.isArray(t))return t.map(function(n){return dr(n)});if(t instanceof Date)return new Date(t.valueOf());if(kr(t))return t;if(eN(t))return Ype(t,dr);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(t,")"))}function Ype(t,e){var n={};for(var r in t)Gn(t,r)&&(n[r]=e(t[r]));return n}function wG(t,e){for(var n in e)Gn(e,n)&&(t[n]=e[n]);return t}function Vm(t,e){var n,r,i;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(r=0,i=t.length;r1&&arguments[1]!==void 0?arguments[1]:"any";const te=H?a(H).index:i.length,le=[];for(let ue=0;ue{const le=r.get(te);return!le.isAny&&le.test(z)});return H.length?H:["any"]}function f(z){return z&&typeof z=="function"&&"_typedFunctionData"in z}function h(z,H,te){if(!f(z))throw new TypeError(cB);const le=te&&te.exact,de=Array.isArray(H)?H.join(","):H,ue=_(de),ge=b(ue);if(!le||ge in z.signatures){const Ve=z._typedFunctionData.signatureMap.get(ge);if(Ve)return Ve}const be=ue.length;let Te;if(le){Te=[];let Ve;for(Ve in z.signatures)Te.push(z._typedFunctionData.signatureMap.get(Ve))}else Te=z._typedFunctionData.signatures;for(let Ve=0;Ve!ht.has(Je.name)))continue}Ye.push(it)}}if(Te=Ye,Te.length===0)break}let Re;for(Re of Te)if(Re.params.length<=be)return Re;throw new TypeError("Signature not found (signature: "+(z.name||"unnamed")+"("+b(ue,", ")+"))")}function p(z,H,te){return h(z,H,te).implementation}function g(z,H){const te=a(H);if(te.test(z))return z;const le=te.conversionsTo;if(le.length===0)throw new Error("There are no conversions to "+H+" defined.");for(let de=0;de1&&arguments[1]!==void 0?arguments[1]:",";return z.map(te=>te.name).join(H)}function m(z){const H=z.indexOf("...")===0,le=(H?z.length>3?z.slice(3):"any":z).split("|").map(be=>a(be.trim()));let de=!1,ue=H?"...":"";return{types:le.map(function(be){return de=be.isAny||de,ue+=be.name+"|",{name:be.name,typeIndex:be.index,test:be.test,isAny:be.isAny,conversion:null,conversionIndex:-1}}),name:ue.slice(0,-1),hasAny:de,hasConversion:!1,restParam:H}}function w(z){const H=z.types.map(ge=>ge.name),te=B(H);let le=z.hasAny,de=z.name;const ue=te.map(function(ge){const be=a(ge.from);return le=be.isAny||le,de+="|"+ge.from,{name:ge.from,typeIndex:be.index,test:be.test,isAny:be.isAny,conversion:ge,conversionIndex:ge.index}});return{types:z.types.concat(ue),name:de,hasAny:le,hasConversion:ue.length>0,restParam:z.restParam}}function x(z){return z.typeSet||(z.typeSet=new Set,z.types.forEach(H=>z.typeSet.add(H.name))),z.typeSet}function _(z){const H=[];if(typeof z!="string")throw new TypeError("Signatures must be strings");const te=z.trim();if(te==="")return H;const le=te.split(",");for(let de=0;de=de+1}}else return z.length===0?function(ue){return ue.length===0}:z.length===1?(te=S(z[0]),function(ue){return te(ue[0])&&ue.length===1}):z.length===2?(te=S(z[0]),le=S(z[1]),function(ue){return te(ue[0])&&le(ue[1])&&ue.length===2}):(H=z.map(S),function(ue){for(let ge=0;ge{const de=A(le.params,H);let ue;for(ue of de)te.add(ue)}),te.has("any")?["any"]:Array.from(te)}function $(z,H,te){let le,de;const ue=z||"unnamed";let ge=te,be;for(be=0;be{const it=P(Ye.params,be),ot=S(it);(be0){const Ye=d(H[be]);return le=new TypeError("Unexpected type of argument in function "+ue+" (expected: "+de.join(" or ")+", actual: "+Ye.join(" | ")+", index: "+be+")"),le.data={category:"wrongType",fn:ue,index:be,actual:Ye,expected:de},le}}else ge=Le}const Te=ge.map(function(Le){return C(Le.params)?1/0:Le.params.length});if(H.lengthRe)return le=new TypeError("Too many arguments in function "+ue+" (expected: "+Re+", actual: "+H.length+")"),le.data={category:"tooManyArgs",fn:ue,index:H.length,expectedLength:Re},le;const Ve=[];for(let Le=0;Le0)return 1;const le=k(z)-k(H);return le<0?-1:le>0?1:0}function G(z,H){const te=z.params,le=H.params,de=we(te),ue=we(le),ge=C(te),be=C(le);if(ge&&de.hasAny){if(!be||!ue.hasAny)return 1}else if(be&&ue.hasAny)return-1;let Te=0,Re=0,Ve;for(Ve of te)Ve.hasAny&&++Te,Ve.hasConversion&&++Re;let Le=0,Ye=0;for(Ve of le)Ve.hasAny&&++Le,Ve.hasConversion&&++Ye;if(Te!==Le)return Te-Le;if(ge&&de.hasConversion){if(!be||!ue.hasConversion)return 1}else if(be&&ue.hasConversion)return-1;if(Re!==Ye)return Re-Ye;if(ge){if(!be)return 1}else if(be)return-1;const it=(te.length-le.length)*(ge?-1:1);if(it!==0)return it;const ot=[];let ht=0;for(let Ot=0;Ot1&&H.sort((de,ue)=>de.index-ue.index);let te=H[0].conversionsTo;if(z.length===1)return te;te=te.concat([]);const le=new Set(z);for(let de=1;dede.hasConversion)){const de=C(z),ue=z.map(N);te=function(){const be=[],Te=de?arguments.length-1:arguments.length;for(let Re=0;ReTe.name).join("|"),hasAny:be.some(Te=>Te.isAny),hasConversion:!1,restParam:!0}),ge.push(ue)}else ge=ue.types.map(function(be){return{types:[be],name:be.name,hasAny:be.isAny,hasConversion:be.conversion,restParam:!1}});return re(ge,function(be){return H(te,le+1,de.concat([be]))})}else return[de]}return H(z,0,[])}function K(z,H){const te=Math.max(z.length,H.length);for(let be=0;be=le:ge?le>=de:le===de}function Q(z){return z.map(H=>he(H)?X(H.referToSelf.callback):Z(H)?Ce(H.referTo.references,H.referTo.callback):H)}function J(z,H,te){const le=[];let de;for(de of z){let ue=te[de];if(typeof ue!="number")throw new TypeError('No definition for referenced signature "'+de+'"');if(ue=H[ue],typeof ue!="function")return!1;le.push(ue)}return le}function ae(z,H,te){const le=Q(z),de=new Array(le.length).fill(!1);let ue=!0;for(;ue;){ue=!1;let ge=!0;for(let be=0;be{const le=z[te];if(H.test(le.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function fe(z,H){if(s.createCount++,Object.keys(H).length===0)throw new SyntaxError("No signatures provided");s.warnAgainstDeprecatedThis&&ve(H);const te=[],le=[],de={},ue=[];let ge;for(ge in H){if(!Object.prototype.hasOwnProperty.call(H,ge))continue;const lt=_(ge);if(!lt)continue;te.forEach(function(Ln){if(K(Ln,lt))throw new TypeError('Conflicting signatures "'+b(Ln)+'" and "'+b(lt)+'".')}),te.push(lt);const Et=le.length;le.push(H[ge]);const Ht=lt.map(w);let zt;for(zt of W(Ht)){const Ln=b(zt);ue.push({params:zt,name:Ln,fn:Et}),zt.every(ei=>!ei.hasConversion)&&(de[Ln]=Et)}}ue.sort(G);const be=ae(le,de,Nt);let Te;for(Te in de)Object.prototype.hasOwnProperty.call(de,Te)&&(de[Te]=be[de[Te]]);const Re=[],Ve=new Map;for(Te of ue)Ve.has(Te.name)||(Te.fn=be[Te.fn],Re.push(Te),Ve.set(Te.name,Te));const Le=Re[0]&&Re[0].params.length<=2&&!C(Re[0].params),Ye=Re[1]&&Re[1].params.length<=2&&!C(Re[1].params),it=Re[2]&&Re[2].params.length<=2&&!C(Re[2].params),ot=Re[3]&&Re[3].params.length<=2&&!C(Re[3].params),ht=Re[4]&&Re[4].params.length<=2&&!C(Re[4].params),Je=Re[5]&&Re[5].params.length<=2&&!C(Re[5].params),Ot=Le&&Ye&&it&&ot&&ht&&Je;for(let lt=0;ltlt.test),at=Re.map(lt=>lt.implementation),_t=function(){for(let Et=Ae;Etb(_(te))),H=we(arguments);if(typeof H!="function")throw new TypeError("Callback function expected as last argument");return Ce(z,H)}function Ce(z,H){return{referTo:{references:z,callback:H}}}function X(z){if(typeof z!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:z}}}function Z(z){return z&&typeof z.referTo=="object"&&Array.isArray(z.referTo.references)&&typeof z.referTo.callback=="function"}function he(z){return z&&typeof z.referToSelf=="object"&&typeof z.referToSelf.callback=="function"}function Y(z,H){if(!z)return H;if(H&&H!==z){const te=new Error("Function names do not match (expected: "+z+", actual: "+H+")");throw te.data={actual:H,expected:z},te}return z}function ne(z){let H;for(const te in z)Object.prototype.hasOwnProperty.call(z,te)&&(f(z[te])||typeof z[te].signature=="string")&&(H=Y(H,z[te].name));return H}function se(z,H){let te;for(te in H)if(Object.prototype.hasOwnProperty.call(H,te)){if(te in z&&H[te]!==z[te]){const le=new Error('Signature "'+te+'" is defined twice');throw le.data={signature:te,sourceFunction:H[te],destFunction:z[te]},le}z[te]=H[te]}}const xe=s;s=function(z){const H=typeof z=="string",te=H?1:0;let le=H?z:"";const de={};for(let ue=te;uede.from===z.from);if(!te)throw new Error("Attempt to remove nonexistent conversion from "+z.from+" to "+z.to);if(te.convert!==z.convert)throw new Error("Conversion to remove does not match existing conversion");const le=H.conversionsTo.indexOf(te);H.conversionsTo.splice(le,1)},s.resolve=function(z,H){if(!f(z))throw new TypeError(cB);const te=z._typedFunctionData.signatures;for(let le=0;le2**(n-1)-1||t<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!or(t))throw new Error("Value must be an integer");t<0&&(t=t+2**n),o="i".concat(n)}var s="";return t<0&&(t=-t,s="-"),"".concat(s).concat(i).concat(t.toString(e)).concat(o)}function hD(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:n,precision:r,wordSize:i}=SG(e);switch(n){case"fixed":return CG(t,r);case"exponential":return EG(t,r);case"engineering":return eme(t,r);case"bin":return bT(t,2,i);case"oct":return bT(t,8,i);case"hex":return bT(t,16,i);case"auto":return tme(t,r,e).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],s=arguments[4];return o!=="."?o+s:s});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function SG(t){var e="auto",n,r;if(t!==void 0)if(Qn(t))n=t;else if(kr(t))n=t.toNumber();else if(eN(t))t.precision!==void 0&&(n=fB(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),t.wordSize!==void 0&&(r=fB(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(e=t.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:n,wordSize:r}}function cb(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var n=e[1],r=e[2],i=parseFloat(e[4]||"0"),o=r.indexOf(".");i+=o!==-1?o-1:r.length-1;var s=r.replace(".","").replace(/^0*/,function(a){return i-=a.length,""}).replace(/0*$/,"").split("").map(function(a){return parseInt(a)});return s.length===0&&(s.push(0),i++),{sign:n,coefficients:s,exponent:i}}function eme(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=cb(t),r=sE(n,e),i=r.exponent,o=r.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Qn(e))for(;e>o.length||i-s+1>o.length;)o.push(0);else for(var a=Math.abs(i-s)-(o.length-1),l=0;l0;)c++,u--;var d=o.slice(c).join(""),f=Qn(e)&&d.length||d.match(/[1-9]/)?"."+d:"",h=o.slice(0,c).join("")+f+"e"+(i>=0?"+":"")+s.toString();return r.sign+h}function CG(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=cb(t),r=typeof e=="number"?sE(n,n.exponent+1+e):n,i=r.coefficients,o=r.exponent+1,s=o+(e||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function tme(t,e,n){if(isNaN(t)||!isFinite(t))return String(t);var r=hB(n==null?void 0:n.lowerExp,-3),i=hB(n==null?void 0:n.upperExp,5),o=cb(t),s=e?sE(o,e):o;if(s.exponent=i)return EG(t,e);var a=s.coefficients,l=s.exponent;a.length0?l:0;return ue){var i=r.splice(e,r.length-e);if(i[0]>=5){var o=e-1;for(r[o]++;r[o]===10;)r.pop(),o===0&&(r.unshift(0),n.exponent++,o++),o--,r[o]++}}return n}function vm(t){for(var e=[],n=0;n=o&&u=0?"+":"")+r.toString()}function pB(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function sme(t,e){return t.toFixed(e)}function mB(t,e){return Qn(t)?t:kr(t)?t.toNumber():e}function ame(t,e){var n=t.length-e.length,r=t.length;return t.substring(n,r)===e}function Ir(t,e){var n=lme(t,e);return e&&typeof e=="object"&&"truncate"in e&&n.length>e.truncate?n.substring(0,e.truncate-3)+"...":n}function lme(t,e){if(typeof t=="number")return hD(t,e);if(kr(t))return ime(t,e);if(ume(t))return!e||e.fraction!=="decimal"?t.s*t.n+"/"+t.d:t.toString();if(Array.isArray(t))return MG(t,e);if(_l(t))return gB(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var n=Object.keys(t).map(r=>gB(r)+": "+Ir(t[r],e));return"{"+n.join(", ")+"}"}return String(t)}function gB(t){for(var e=String(t),n="",r=0;r=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}wd.prototype=new RangeError;wd.prototype.constructor=RangeError;wd.prototype.name="IndexError";wd.prototype.isIndexError=!0;function To(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function TG(t,e,n){var r,i=t.length;if(i!==e[n])throw new Rn(i,e[n]);if(n")}function yB(t,e){var n=e.length===0;if(n){if(Array.isArray(t))throw new Rn(t.length,0)}else TG(t,e,0)}function vr(t,e){if(t!==void 0){if(!Qn(t)||!or(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new wd(t,e)}}function Y_(t,e,n){if(!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new Error("Resizing to scalar is not supported");e.forEach(function(i){if(!Qn(i)||!or(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ir(e)+")")}),(Qn(t)||kr(t))&&(t=[t]);var r=n!==void 0?n:0;return pD(t,e,0,r),t}function pD(t,e,n,r){var i,o,s=t.length,a=e[n],l=Math.min(s,a);if(t.length=a,n=0,l=e%n===0;if(a)if(l)r[o]=-e/n;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-n);return r}function PG(t){return t.reduce((e,n)=>e*n,1)}function cme(t,e){for(var n=t,r,i=e.length-1;i>0;i--){var o=e[i];r=[];for(var s=n.length/o,a=0;a1)return t.slice(1).reduce(function(n,r){return IG(n,r,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function fme(){for(var t=arguments.length,e=new Array(t),n=0;nf.length),i=Math.max(...r),o=new Array(i).fill(null),s=0;so[c]&&(o[c]=a[u])}for(var d=0;d1||t[i]>e[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(r," with size ").concat(t[i]," to size ").concat(e[o]))}}function bB(t,e){var n=To(t);if(Vm(n,e))return t;Q_(n,e);var r=fme(n,e),i=r.length,o=[...Array(i-n.length).fill(1),...n],s=pme(t);n.length!gme(o)).every(o=>n[o]!==void 0);if(!r){var i=e.filter(o=>n[o]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function gme(t){return t&&t[0]==="?"}function vme(t){return t&&t[0]==="?"?t.slice(1):t}function yme(t,e){if(OG(t)&&FG(t,e))return t[e];throw typeof t[e]=="function"&&wme(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function bme(t,e,n){if(OG(t)&&FG(t,e))return t[e]=n,n;throw new Error('No access to property "'+e+'"')}function xme(t,e){return e in t}function FG(t,e){return!t||typeof t!="object"?!1:Gn(_me,e)?!0:!(e in Object.prototype||e in Function.prototype)}function wme(t,e){return t==null||typeof t[e]!="function"||Gn(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:Gn(Sme,e)?!0:!(e in Object.prototype||e in Function.prototype)}function OG(t){return typeof t=="object"&&t&&t.constructor===Object}var _me={length:!0,name:!0},Sme={toString:!0,valueOf:!0,toLocaleString:!0};class Cme{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(e){return yme(this.wrappedObject,e)}set(e,n){return bme(this.wrappedObject,e,n),this}has(e){return xme(this.wrappedObject,e)}entries(){return Eme(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var n of this.keys())e(this.get(n),n,this)}delete(e){delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}function Eme(t,e){return{next:()=>{var n=t.next();return n.done?n:{value:e(n.value),done:!1}}}}function Mme(t){return t?t instanceof Map||t instanceof Cme||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}var kG=function(){return kG=dB.create,dB},Tme=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Ame=dt("typed",Tme,function(e){var{BigNumber:n,Complex:r,DenseMatrix:i,Fraction:o}=e,s=kG();return s.clear(),s.addTypes([{name:"number",test:Qn},{name:"Complex",test:gv},{name:"BigNumber",test:kr},{name:"Fraction",test:xG},{name:"Unit",test:_c},{name:"identifier",test:a=>_l&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(a)},{name:"string",test:_l},{name:"Chain",test:Kpe},{name:"Array",test:gr},{name:"Matrix",test:Or},{name:"DenseMatrix",test:_pe},{name:"SparseMatrix",test:Spe},{name:"Range",test:Cpe},{name:"Index",test:JI},{name:"boolean",test:Epe},{name:"ResultSet",test:Mpe},{name:"Help",test:Tpe},{name:"function",test:Ape},{name:"Date",test:Ppe},{name:"RegExp",test:Dpe},{name:"null",test:Rpe},{name:"undefined",test:Ipe},{name:"AccessorNode",test:Npe},{name:"ArrayNode",test:Fpe},{name:"AssignmentNode",test:Ope},{name:"BlockNode",test:kpe},{name:"ConditionalNode",test:Lpe},{name:"ConstantNode",test:Bpe},{name:"FunctionNode",test:zpe},{name:"FunctionAssignmentNode",test:$pe},{name:"IndexNode",test:Upe},{name:"Node",test:Hpe},{name:"ObjectNode",test:Vpe},{name:"OperatorNode",test:Gpe},{name:"ParenthesisNode",test:jpe},{name:"RangeNode",test:Wpe},{name:"RelationalNode",test:qpe},{name:"SymbolNode",test:Xpe},{name:"Map",test:Mme},{name:"Object",test:eN}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||wT(l),nme(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new n(l)}},{from:"number",to:"Complex",convert:function(l){return r||_x(l),new r(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return r||_x(l),new r(l.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(l){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(l){return r||_x(l),new r(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){o||_T(l);var u=new o(l);if(u.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(l){var u=Number(l);if(isNaN(u))throw new Error('Cannot convert "'+l+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(l){n||wT(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(l){o||_T(l);try{return new o(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){r||_x(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return n||wT(l),new n(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return o||_T(l),new o(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return i||Pme(),new i(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),s.onMismatch=(a,l,u)=>{var c=s.createError(a,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&dy(l[0])&&u.some(f=>!f.params.includes(","))){var d=new TypeError("Function '".concat(a,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(a,")'."));throw d.data=c.data,d}throw c},s.onMismatch=(a,l,u)=>{var c=s.createError(a,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&dy(l[0])&&u.some(f=>!f.params.includes(","))){var d=new TypeError("Function '".concat(a,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(a,")'."));throw d.data=c.data,d}throw c},s});function wT(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function _x(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Pme(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function _T(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}/*! +`);return Object.freeze(bG)};Xp(Gi,bG,{MATRIX_OPTIONS:Qpe,NUMBER_OPTIONS:Jpe});function uB(){return!0}function Xs(){return!1}function Bh(){}const cB="Argument is not a typed-function.";function _G(){function t(z){return typeof z=="object"&&z!==null&&z.constructor===Object}const e=[{name:"number",test:function(z){return typeof z=="number"}},{name:"string",test:function(z){return typeof z=="string"}},{name:"boolean",test:function(z){return typeof z=="boolean"}},{name:"Function",test:function(z){return typeof z=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(z){return z instanceof Date}},{name:"RegExp",test:function(z){return z instanceof RegExp}},{name:"Object",test:t},{name:"null",test:function(z){return z===null}},{name:"undefined",test:function(z){return z===void 0}}],n={name:"any",test:uB,isAny:!0};let r,i,o=0,s={createCount:0};function a(z){const H=r.get(z);if(H)return H;let te='Unknown type "'+z+'"';const le=z.toLowerCase();let de;for(de of i)if(de.toLowerCase()===le){te+='. Did you mean "'+de+'" ?';break}throw new TypeError(te)}function l(z){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const te=H?a(H).index:i.length,le=[];for(let ue=0;ue{const le=r.get(te);return!le.isAny&&le.test(z)});return H.length?H:["any"]}function f(z){return z&&typeof z=="function"&&"_typedFunctionData"in z}function h(z,H,te){if(!f(z))throw new TypeError(cB);const le=te&&te.exact,de=Array.isArray(H)?H.join(","):H,ue=_(de),ge=b(ue);if(!le||ge in z.signatures){const Ve=z._typedFunctionData.signatureMap.get(ge);if(Ve)return Ve}const be=ue.length;let Te;if(le){Te=[];let Ve;for(Ve in z.signatures)Te.push(z._typedFunctionData.signatureMap.get(Ve))}else Te=z._typedFunctionData.signatures;for(let Ve=0;Ve!ht.has(Je.name)))continue}Ye.push(it)}}if(Te=Ye,Te.length===0)break}let Re;for(Re of Te)if(Re.params.length<=be)return Re;throw new TypeError("Signature not found (signature: "+(z.name||"unnamed")+"("+b(ue,", ")+"))")}function p(z,H,te){return h(z,H,te).implementation}function g(z,H){const te=a(H);if(te.test(z))return z;const le=te.conversionsTo;if(le.length===0)throw new Error("There are no conversions to "+H+" defined.");for(let de=0;de1&&arguments[1]!==void 0?arguments[1]:",";return z.map(te=>te.name).join(H)}function m(z){const H=z.indexOf("...")===0,le=(H?z.length>3?z.slice(3):"any":z).split("|").map(be=>a(be.trim()));let de=!1,ue=H?"...":"";return{types:le.map(function(be){return de=be.isAny||de,ue+=be.name+"|",{name:be.name,typeIndex:be.index,test:be.test,isAny:be.isAny,conversion:null,conversionIndex:-1}}),name:ue.slice(0,-1),hasAny:de,hasConversion:!1,restParam:H}}function w(z){const H=z.types.map(ge=>ge.name),te=B(H);let le=z.hasAny,de=z.name;const ue=te.map(function(ge){const be=a(ge.from);return le=be.isAny||le,de+="|"+ge.from,{name:ge.from,typeIndex:be.index,test:be.test,isAny:be.isAny,conversion:ge,conversionIndex:ge.index}});return{types:z.types.concat(ue),name:de,hasAny:le,hasConversion:ue.length>0,restParam:z.restParam}}function x(z){return z.typeSet||(z.typeSet=new Set,z.types.forEach(H=>z.typeSet.add(H.name))),z.typeSet}function _(z){const H=[];if(typeof z!="string")throw new TypeError("Signatures must be strings");const te=z.trim();if(te==="")return H;const le=te.split(",");for(let de=0;de=de+1}}else return z.length===0?function(ue){return ue.length===0}:z.length===1?(te=S(z[0]),function(ue){return te(ue[0])&&ue.length===1}):z.length===2?(te=S(z[0]),le=S(z[1]),function(ue){return te(ue[0])&&le(ue[1])&&ue.length===2}):(H=z.map(S),function(ue){for(let ge=0;ge{const de=A(le.params,H);let ue;for(ue of de)te.add(ue)}),te.has("any")?["any"]:Array.from(te)}function $(z,H,te){let le,de;const ue=z||"unnamed";let ge=te,be;for(be=0;be{const it=P(Ye.params,be),ot=S(it);(be0){const Ye=d(H[be]);return le=new TypeError("Unexpected type of argument in function "+ue+" (expected: "+de.join(" or ")+", actual: "+Ye.join(" | ")+", index: "+be+")"),le.data={category:"wrongType",fn:ue,index:be,actual:Ye,expected:de},le}}else ge=Le}const Te=ge.map(function(Le){return C(Le.params)?1/0:Le.params.length});if(H.lengthRe)return le=new TypeError("Too many arguments in function "+ue+" (expected: "+Re+", actual: "+H.length+")"),le.data={category:"tooManyArgs",fn:ue,index:H.length,expectedLength:Re},le;const Ve=[];for(let Le=0;Le0)return 1;const le=k(z)-k(H);return le<0?-1:le>0?1:0}function G(z,H){const te=z.params,le=H.params,de=we(te),ue=we(le),ge=C(te),be=C(le);if(ge&&de.hasAny){if(!be||!ue.hasAny)return 1}else if(be&&ue.hasAny)return-1;let Te=0,Re=0,Ve;for(Ve of te)Ve.hasAny&&++Te,Ve.hasConversion&&++Re;let Le=0,Ye=0;for(Ve of le)Ve.hasAny&&++Le,Ve.hasConversion&&++Ye;if(Te!==Le)return Te-Le;if(ge&&de.hasConversion){if(!be||!ue.hasConversion)return 1}else if(be&&ue.hasConversion)return-1;if(Re!==Ye)return Re-Ye;if(ge){if(!be)return 1}else if(be)return-1;const it=(te.length-le.length)*(ge?-1:1);if(it!==0)return it;const ot=[];let ht=0;for(let Ot=0;Ot1&&H.sort((de,ue)=>de.index-ue.index);let te=H[0].conversionsTo;if(z.length===1)return te;te=te.concat([]);const le=new Set(z);for(let de=1;dede.hasConversion)){const de=C(z),ue=z.map(N);te=function(){const be=[],Te=de?arguments.length-1:arguments.length;for(let Re=0;ReTe.name).join("|"),hasAny:be.some(Te=>Te.isAny),hasConversion:!1,restParam:!0}),ge.push(ue)}else ge=ue.types.map(function(be){return{types:[be],name:be.name,hasAny:be.isAny,hasConversion:be.conversion,restParam:!1}});return re(ge,function(be){return H(te,le+1,de.concat([be]))})}else return[de]}return H(z,0,[])}function K(z,H){const te=Math.max(z.length,H.length);for(let be=0;be=le:ge?le>=de:le===de}function Q(z){return z.map(H=>he(H)?X(H.referToSelf.callback):Z(H)?Ce(H.referTo.references,H.referTo.callback):H)}function J(z,H,te){const le=[];let de;for(de of z){let ue=te[de];if(typeof ue!="number")throw new TypeError('No definition for referenced signature "'+de+'"');if(ue=H[ue],typeof ue!="function")return!1;le.push(ue)}return le}function ae(z,H,te){const le=Q(z),de=new Array(le.length).fill(!1);let ue=!0;for(;ue;){ue=!1;let ge=!0;for(let be=0;be{const le=z[te];if(H.test(le.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function fe(z,H){if(s.createCount++,Object.keys(H).length===0)throw new SyntaxError("No signatures provided");s.warnAgainstDeprecatedThis&&ve(H);const te=[],le=[],de={},ue=[];let ge;for(ge in H){if(!Object.prototype.hasOwnProperty.call(H,ge))continue;const lt=_(ge);if(!lt)continue;te.forEach(function(Ln){if(K(Ln,lt))throw new TypeError('Conflicting signatures "'+b(Ln)+'" and "'+b(lt)+'".')}),te.push(lt);const Et=le.length;le.push(H[ge]);const Ht=lt.map(w);let zt;for(zt of W(Ht)){const Ln=b(zt);ue.push({params:zt,name:Ln,fn:Et}),zt.every(ei=>!ei.hasConversion)&&(de[Ln]=Et)}}ue.sort(G);const be=ae(le,de,Nt);let Te;for(Te in de)Object.prototype.hasOwnProperty.call(de,Te)&&(de[Te]=be[de[Te]]);const Re=[],Ve=new Map;for(Te of ue)Ve.has(Te.name)||(Te.fn=be[Te.fn],Re.push(Te),Ve.set(Te.name,Te));const Le=Re[0]&&Re[0].params.length<=2&&!C(Re[0].params),Ye=Re[1]&&Re[1].params.length<=2&&!C(Re[1].params),it=Re[2]&&Re[2].params.length<=2&&!C(Re[2].params),ot=Re[3]&&Re[3].params.length<=2&&!C(Re[3].params),ht=Re[4]&&Re[4].params.length<=2&&!C(Re[4].params),Je=Re[5]&&Re[5].params.length<=2&&!C(Re[5].params),Ot=Le&&Ye&&it&&ot&&ht&&Je;for(let lt=0;ltlt.test),at=Re.map(lt=>lt.implementation),_t=function(){for(let Et=Ae;Etb(_(te))),H=we(arguments);if(typeof H!="function")throw new TypeError("Callback function expected as last argument");return Ce(z,H)}function Ce(z,H){return{referTo:{references:z,callback:H}}}function X(z){if(typeof z!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:z}}}function Z(z){return z&&typeof z.referTo=="object"&&Array.isArray(z.referTo.references)&&typeof z.referTo.callback=="function"}function he(z){return z&&typeof z.referToSelf=="object"&&typeof z.referToSelf.callback=="function"}function Y(z,H){if(!z)return H;if(H&&H!==z){const te=new Error("Function names do not match (expected: "+z+", actual: "+H+")");throw te.data={actual:H,expected:z},te}return z}function ne(z){let H;for(const te in z)Object.prototype.hasOwnProperty.call(z,te)&&(f(z[te])||typeof z[te].signature=="string")&&(H=Y(H,z[te].name));return H}function se(z,H){let te;for(te in H)if(Object.prototype.hasOwnProperty.call(H,te)){if(te in z&&H[te]!==z[te]){const le=new Error('Signature "'+te+'" is defined twice');throw le.data={signature:te,sourceFunction:H[te],destFunction:z[te]},le}z[te]=H[te]}}const xe=s;s=function(z){const H=typeof z=="string",te=H?1:0;let le=H?z:"";const de={};for(let ue=te;uede.from===z.from);if(!te)throw new Error("Attempt to remove nonexistent conversion from "+z.from+" to "+z.to);if(te.convert!==z.convert)throw new Error("Conversion to remove does not match existing conversion");const le=H.conversionsTo.indexOf(te);H.conversionsTo.splice(le,1)},s.resolve=function(z,H){if(!f(z))throw new TypeError(cB);const te=z._typedFunctionData.signatures;for(let le=0;le2**(n-1)-1||t<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!or(t))throw new Error("Value must be an integer");t<0&&(t=t+2**n),o="i".concat(n)}var s="";return t<0&&(t=-t,s="-"),"".concat(s).concat(i).concat(t.toString(e)).concat(o)}function hD(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:n,precision:r,wordSize:i}=SG(e);switch(n){case"fixed":return CG(t,r);case"exponential":return EG(t,r);case"engineering":return eme(t,r);case"bin":return bT(t,2,i);case"oct":return bT(t,8,i);case"hex":return bT(t,16,i);case"auto":return tme(t,r,e).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],s=arguments[4];return o!=="."?o+s:s});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function SG(t){var e="auto",n,r;if(t!==void 0)if(Qn(t))n=t;else if(kr(t))n=t.toNumber();else if(eN(t))t.precision!==void 0&&(n=fB(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),t.wordSize!==void 0&&(r=fB(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(e=t.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:n,wordSize:r}}function cb(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var n=e[1],r=e[2],i=parseFloat(e[4]||"0"),o=r.indexOf(".");i+=o!==-1?o-1:r.length-1;var s=r.replace(".","").replace(/^0*/,function(a){return i-=a.length,""}).replace(/0*$/,"").split("").map(function(a){return parseInt(a)});return s.length===0&&(s.push(0),i++),{sign:n,coefficients:s,exponent:i}}function eme(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=cb(t),r=sE(n,e),i=r.exponent,o=r.coefficients,s=i%3===0?i:i<0?i-3-i%3:i-i%3;if(Qn(e))for(;e>o.length||i-s+1>o.length;)o.push(0);else for(var a=Math.abs(i-s)-(o.length-1),l=0;l0;)c++,u--;var d=o.slice(c).join(""),f=Qn(e)&&d.length||d.match(/[1-9]/)?"."+d:"",h=o.slice(0,c).join("")+f+"e"+(i>=0?"+":"")+s.toString();return r.sign+h}function CG(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=cb(t),r=typeof e=="number"?sE(n,n.exponent+1+e):n,i=r.coefficients,o=r.exponent+1,s=o+(e||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function tme(t,e,n){if(isNaN(t)||!isFinite(t))return String(t);var r=hB(n==null?void 0:n.lowerExp,-3),i=hB(n==null?void 0:n.upperExp,5),o=cb(t),s=e?sE(o,e):o;if(s.exponent=i)return EG(t,e);var a=s.coefficients,l=s.exponent;a.length0?l:0;return ue){var i=r.splice(e,r.length-e);if(i[0]>=5){var o=e-1;for(r[o]++;r[o]===10;)r.pop(),o===0&&(r.unshift(0),n.exponent++,o++),o--,r[o]++}}return n}function vm(t){for(var e=[],n=0;n=o&&u=0?"+":"")+r.toString()}function pB(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function sme(t,e){return t.toFixed(e)}function mB(t,e){return Qn(t)?t:kr(t)?t.toNumber():e}function ame(t,e){var n=t.length-e.length,r=t.length;return t.substring(n,r)===e}function Ir(t,e){var n=lme(t,e);return e&&typeof e=="object"&&"truncate"in e&&n.length>e.truncate?n.substring(0,e.truncate-3)+"...":n}function lme(t,e){if(typeof t=="number")return hD(t,e);if(kr(t))return ime(t,e);if(ume(t))return!e||e.fraction!=="decimal"?t.s*t.n+"/"+t.d:t.toString();if(Array.isArray(t))return MG(t,e);if(wl(t))return gB(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var n=Object.keys(t).map(r=>gB(r)+": "+Ir(t[r],e));return"{"+n.join(", ")+"}"}return String(t)}function gB(t){for(var e=String(t),n="",r=0;r=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}wd.prototype=new RangeError;wd.prototype.constructor=RangeError;wd.prototype.name="IndexError";wd.prototype.isIndexError=!0;function To(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function TG(t,e,n){var r,i=t.length;if(i!==e[n])throw new Rn(i,e[n]);if(n")}function yB(t,e){var n=e.length===0;if(n){if(Array.isArray(t))throw new Rn(t.length,0)}else TG(t,e,0)}function vr(t,e){if(t!==void 0){if(!Qn(t)||!or(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new wd(t,e)}}function Y_(t,e,n){if(!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new Error("Resizing to scalar is not supported");e.forEach(function(i){if(!Qn(i)||!or(i)||i<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ir(e)+")")}),(Qn(t)||kr(t))&&(t=[t]);var r=n!==void 0?n:0;return pD(t,e,0,r),t}function pD(t,e,n,r){var i,o,s=t.length,a=e[n],l=Math.min(s,a);if(t.length=a,n=0,l=e%n===0;if(a)if(l)r[o]=-e/n;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-n);return r}function PG(t){return t.reduce((e,n)=>e*n,1)}function cme(t,e){for(var n=t,r,i=e.length-1;i>0;i--){var o=e[i];r=[];for(var s=n.length/o,a=0;a1)return t.slice(1).reduce(function(n,r){return IG(n,r,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function fme(){for(var t=arguments.length,e=new Array(t),n=0;nf.length),i=Math.max(...r),o=new Array(i).fill(null),s=0;so[c]&&(o[c]=a[u])}for(var d=0;d1||t[i]>e[o])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(r," with size ").concat(t[i]," to size ").concat(e[o]))}}function bB(t,e){var n=To(t);if(Vm(n,e))return t;Q_(n,e);var r=fme(n,e),i=r.length,o=[...Array(i-n.length).fill(1),...n],s=pme(t);n.length!gme(o)).every(o=>n[o]!==void 0);if(!r){var i=e.filter(o=>n[o]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(i.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function gme(t){return t&&t[0]==="?"}function vme(t){return t&&t[0]==="?"?t.slice(1):t}function yme(t,e){if(OG(t)&&FG(t,e))return t[e];throw typeof t[e]=="function"&&wme(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function bme(t,e,n){if(OG(t)&&FG(t,e))return t[e]=n,n;throw new Error('No access to property "'+e+'"')}function xme(t,e){return e in t}function FG(t,e){return!t||typeof t!="object"?!1:Gn(_me,e)?!0:!(e in Object.prototype||e in Function.prototype)}function wme(t,e){return t==null||typeof t[e]!="function"||Gn(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:Gn(Sme,e)?!0:!(e in Object.prototype||e in Function.prototype)}function OG(t){return typeof t=="object"&&t&&t.constructor===Object}var _me={length:!0,name:!0},Sme={toString:!0,valueOf:!0,toLocaleString:!0};class Cme{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(e){return yme(this.wrappedObject,e)}set(e,n){return bme(this.wrappedObject,e,n),this}has(e){return xme(this.wrappedObject,e)}entries(){return Eme(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var n of this.keys())e(this.get(n),n,this)}delete(e){delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}function Eme(t,e){return{next:()=>{var n=t.next();return n.done?n:{value:e(n.value),done:!1}}}}function Mme(t){return t?t instanceof Map||t instanceof Cme||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}var kG=function(){return kG=dB.create,dB},Tme=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Ame=dt("typed",Tme,function(e){var{BigNumber:n,Complex:r,DenseMatrix:i,Fraction:o}=e,s=kG();return s.clear(),s.addTypes([{name:"number",test:Qn},{name:"Complex",test:gv},{name:"BigNumber",test:kr},{name:"Fraction",test:xG},{name:"Unit",test:_c},{name:"identifier",test:a=>wl&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(a)},{name:"string",test:wl},{name:"Chain",test:Kpe},{name:"Array",test:gr},{name:"Matrix",test:Or},{name:"DenseMatrix",test:_pe},{name:"SparseMatrix",test:Spe},{name:"Range",test:Cpe},{name:"Index",test:JI},{name:"boolean",test:Epe},{name:"ResultSet",test:Mpe},{name:"Help",test:Tpe},{name:"function",test:Ape},{name:"Date",test:Ppe},{name:"RegExp",test:Dpe},{name:"null",test:Rpe},{name:"undefined",test:Ipe},{name:"AccessorNode",test:Npe},{name:"ArrayNode",test:Fpe},{name:"AssignmentNode",test:Ope},{name:"BlockNode",test:kpe},{name:"ConditionalNode",test:Lpe},{name:"ConstantNode",test:Bpe},{name:"FunctionNode",test:zpe},{name:"FunctionAssignmentNode",test:$pe},{name:"IndexNode",test:Upe},{name:"Node",test:Hpe},{name:"ObjectNode",test:Vpe},{name:"OperatorNode",test:Gpe},{name:"ParenthesisNode",test:jpe},{name:"RangeNode",test:Wpe},{name:"RelationalNode",test:qpe},{name:"SymbolNode",test:Xpe},{name:"Map",test:Mme},{name:"Object",test:eN}]),s.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(n||wT(l),nme(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new n(l)}},{from:"number",to:"Complex",convert:function(l){return r||_x(l),new r(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return r||_x(l),new r(l.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(l){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(l){return r||_x(l),new r(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){o||_T(l);var u=new o(l);if(u.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(l){var u=Number(l);if(isNaN(u))throw new Error('Cannot convert "'+l+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(l){n||wT(l);try{return new n(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(l){o||_T(l);try{return new o(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){r||_x(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return n||wT(l),new n(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return o||_T(l),new o(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return i||Pme(),new i(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),s.onMismatch=(a,l,u)=>{var c=s.createError(a,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&dy(l[0])&&u.some(f=>!f.params.includes(","))){var d=new TypeError("Function '".concat(a,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(a,")'."));throw d.data=c.data,d}throw c},s.onMismatch=(a,l,u)=>{var c=s.createError(a,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&dy(l[0])&&u.some(f=>!f.params.includes(","))){var d=new TypeError("Function '".concat(a,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(a,")'."));throw d.data=c.data,d}throw c},s});function wT(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function _x(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Pme(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function _T(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}/*! * decimal.js v10.4.3 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2022 Michael Mclaughlin * MIT Licence - */var Yp=9e15,_d=1e9,mD="0123456789abcdef",J_="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",eS="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",gD={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Yp,maxE:Yp,crypto:!1},LG,Mu,Gt=!0,aE="[DecimalError] ",id=aE+"Invalid argument: ",BG=aE+"Precision limit exceeded",$G=aE+"crypto unavailable",zG="[object Decimal]",ao=Math.floor,oi=Math.pow,Dme=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Rme=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ime=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,UG=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Wa=1e7,$t=7,Nme=9007199254740991,Fme=J_.length-1,vD=eS.length-1,Ke={toStringTag:zG};Ke.absoluteValue=Ke.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Ft(t)};Ke.ceil=function(){return Ft(new this.constructor(this),this.e+1,2)};Ke.clampedTo=Ke.clamp=function(t,e){var n,r=this,i=r.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(id+e);return n=r.cmp(t),n<0?t:r.cmp(e)>0?e:new i(r)};Ke.comparedTo=Ke.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(r=s.length,i=a.length,e=0,n=ra[e]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1};Ke.cosine=Ke.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+$t,r.rounding=1,n=Ome(r,WG(r,n)),r.precision=t,r.rounding=e,Ft(Mu==2||Mu==3?n.neg():n,t,e,!0)):new r(1):new r(NaN)};Ke.cubeRoot=Ke.cbrt=function(){var t,e,n,r,i,o,s,a,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(Gt=!1,o=c.s*oi(c.s*c,1/3),!o||Math.abs(o)==1/0?(n=$i(c.d),t=c.e,(o=(t-n.length+1)%3)&&(n+=o==1||o==-2?"0":"00"),o=oi(n,1/3),t=ao((t+1)/3)-(t%3==(t<0?-1:2)),o==1/0?n="5e"+t:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+t),r=new d(n),r.s=c.s):r=new d(o.toString()),s=(t=d.precision)+3;;)if(a=r,l=a.times(a).times(a),u=l.plus(c),r=qn(u.plus(c).times(a),u.plus(l),s+2,1),$i(a.d).slice(0,s)===(n=$i(r.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!i&&n=="4999"){if(!i&&(Ft(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(Ft(r,t+1,1),e=!r.times(r).times(r).eq(c));break}return Gt=!0,Ft(r,t,d.rounding,e)};Ke.decimalPlaces=Ke.dp=function(){var t,e=this.d,n=NaN;if(e){if(t=e.length-1,n=(t-ao(this.e/$t))*$t,t=e[t],t)for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n};Ke.dividedBy=Ke.div=function(t){return qn(this,new this.constructor(t))};Ke.dividedToIntegerBy=Ke.divToInt=function(t){var e=this,n=e.constructor;return Ft(qn(e,new n(t),0,1,1),n.precision,n.rounding)};Ke.equals=Ke.eq=function(t){return this.cmp(t)===0};Ke.floor=function(){return Ft(new this.constructor(this),this.e+1,3)};Ke.greaterThan=Ke.gt=function(t){return this.cmp(t)>0};Ke.greaterThanOrEqualTo=Ke.gte=function(t){var e=this.cmp(t);return e==1||e===0};Ke.hyperbolicCosine=Ke.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(t=Math.ceil(i/3),e=(1/uE(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),o=Gm(s,1,o.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return Ft(o,s.precision=n,s.rounding=r,!0)};Ke.hyperbolicSine=Ke.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,r=i.d.length,r<3)i=Gm(o,2,i,i,!0);else{t=1.4*Math.sqrt(r),t=t>16?16:t|0,i=i.times(1/uE(5,t)),i=Gm(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=e,o.rounding=n,Ft(i,e,n,!0)};Ke.hyperbolicTangent=Ke.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,qn(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)};Ke.inverseCosine=Ke.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return r!==-1?r===0?e.isNeg()?za(n,i,o):new n(0):new n(NaN):e.isZero()?za(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=za(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))};Ke.inverseHyperbolicCosine=Ke.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Gt=!1,n=n.times(n).minus(1).sqrt().plus(n),Gt=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)};Ke.inverseHyperbolicSine=Ke.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Gt=!1,n=n.times(n).plus(1).sqrt().plus(n),Gt=!0,r.precision=t,r.rounding=e,n.ln())};Ke.inverseHyperbolicTangent=Ke.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?Ft(new o(i),t,e,!0):(o.precision=n=r-i.e,i=qn(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)};Ke.inverseSine=Ke.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,e!==-1?e===0?(t=za(o,n+4,r).times(.5),t.s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))};Ke.inverseTangent=Ke.atan=function(){var t,e,n,r,i,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=vD)return s=za(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=vD)return s=za(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=a=d+10,c.rounding=1,n=Math.min(28,a/$t+2|0),t=n;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(Gt=!1,e=Math.ceil(a/$t),r=1,l=u.times(u),s=new c(u),i=u;t!==-1;)if(i=i.times(l),o=s.minus(i.div(r+=2)),i=i.times(l),s=o.plus(i.div(r+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<this.d.length-2};Ke.isNaN=function(){return!this.s};Ke.isNegative=Ke.isNeg=function(){return this.s<0};Ke.isPositive=Ke.isPos=function(){return this.s>0};Ke.isZero=function(){return!!this.d&&this.d[0]===0};Ke.lessThan=Ke.lt=function(t){return this.cmp(t)<0};Ke.lessThanOrEqualTo=Ke.lte=function(t){return this.cmp(t)<1};Ke.logarithm=Ke.log=function(t){var e,n,r,i,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding,h=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),n=t.d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new c(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10===0;)i/=10;o=i!==1}if(Gt=!1,a=d+h,s=Bc(u,a),r=e?tS(c,a+10):Bc(t,a),l=qn(s,r,a,1),fy(l.d,i=d,f))do if(a+=10,s=Bc(u,a),r=e?tS(c,a+10):Bc(t,a),l=qn(s,r,a,1),!o){+$i(l.d).slice(i+1,i+15)+1==1e14&&(l=Ft(l,d+1,0));break}while(fy(l.d,i+=10,f));return Gt=!0,Ft(l,d,f)};Ke.minus=Ke.sub=function(t){var e,n,r,i,o,s,a,l,u,c,d,f,h=this,p=h.constructor;if(t=new p(t),!h.d||!t.d)return!h.s||!t.s?t=new p(NaN):h.d?t.s=-t.s:t=new p(t.d||h.s!==t.s?h:NaN),t;if(h.s!=t.s)return t.s=-t.s,h.plus(t);if(u=h.d,f=t.d,a=p.precision,l=p.rounding,!u[0]||!f[0]){if(f[0])t.s=-t.s;else if(u[0])t=new p(h);else return new p(l===3?-0:0);return Gt?Ft(t,a,l):t}if(n=ao(t.e/$t),c=ao(h.e/$t),u=u.slice(),o=c-n,o){for(d=o<0,d?(e=u,o=-o,s=f.length):(e=f,n=c,s=u.length),r=Math.max(Math.ceil(a/$t),s)+2,o>r&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for(r=u.length,s=f.length,d=r0;--r)u[s++]=0;for(r=f.length;r>o;){if(u[--r]s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,n=c,c=u,u=n),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/Wa|0,u[i]%=Wa;for(e&&(u.unshift(e),++r),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=lE(u,r),Gt?Ft(t,a,l):t};Ke.precision=Ke.sd=function(t){var e,n=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(id+t);return n.d?(e=HG(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e};Ke.round=function(){var t=this,e=t.constructor;return Ft(new e(t),t.e+1,e.rounding)};Ke.sine=Ke.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+$t,r.rounding=1,n=Lme(r,WG(r,n)),r.precision=t,r.rounding=e,Ft(Mu>2?n.neg():n,t,e,!0)):new r(NaN)};Ke.squareRoot=Ke.sqrt=function(){var t,e,n,r,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(Gt=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=$i(a),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=ao((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),r=new c(e)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(o=r,r=o.plus(qn(s,o,n+2,1)).times(.5),$i(o.d).slice(0,n)===(e=$i(r.d)).slice(0,n))if(e=e.slice(n-3,n+1),e=="9999"||!i&&e=="4999"){if(!i&&(Ft(o,l+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Ft(r,l+1,1),t=!r.times(r).eq(s));break}return Gt=!0,Ft(r,l,c.rounding,t)};Ke.tangent=Ke.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,n=n.sin(),n.s=1,n=qn(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,Ft(Mu==2||Mu==4?n.neg():n,t,e,!0)):new r(NaN)};Ke.times=Ke.mul=function(t){var e,n,r,i,o,s,a,l,u,c=this,d=c.constructor,f=c.d,h=(t=new d(t)).d;if(t.s*=c.s,!f||!f[0]||!h||!h[0])return new d(!t.s||f&&!f[0]&&!h||h&&!h[0]&&!f?NaN:!f||!h?t.s/0:t.s*0);for(n=ao(c.e/$t)+ao(t.e/$t),l=f.length,u=h.length,l=0;){for(e=0,i=l+r;i>r;)a=o[i]+h[r]*f[i-r-1]+e,o[i--]=a%Wa|0,e=a/Wa|0;o[i]=(o[i]+e)%Wa|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=lE(o,n),Gt?Ft(t,d.precision,d.rounding):t};Ke.toBinary=function(t,e){return nN(this,2,t,e)};Ke.toDecimalPlaces=Ke.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(es(t,0,_d),e===void 0?e=r.rounding:es(e,0,8),Ft(n,t+n.e+1,e))};Ke.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=zl(r,!0):(es(t,0,_d),e===void 0?e=i.rounding:es(e,0,8),r=Ft(new i(r),t+1,e),n=zl(r,!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n};Ke.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?n=zl(i):(es(t,0,_d),e===void 0?e=o.rounding:es(e,0,8),r=Ft(new o(i),t+i.e+1,e),n=zl(r,!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n};Ke.toFraction=function(t){var e,n,r,i,o,s,a,l,u,c,d,f,h=this,p=h.d,g=h.constructor;if(!p)return new g(h);if(u=n=new g(1),r=l=new g(0),e=new g(r),o=e.e=HG(p)-h.e-1,s=o%$t,e.d[0]=oi(10,s<0?$t+s:s),t==null)t=o>0?e:u;else{if(a=new g(t),!a.isInt()||a.lt(u))throw Error(id+a);t=a.gt(e)?o>0?e:u:a}for(Gt=!1,a=new g($i(p)),c=g.precision,g.precision=o=p.length*$t*2;d=qn(a,e,0,1,1),i=n.plus(d.times(r)),i.cmp(t)!=1;)n=r,r=i,i=u,u=l.plus(d.times(i)),l=i,i=e,e=a.minus(d.times(i)),a=i;return i=qn(t.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=h.s,f=qn(u,r,o,1).minus(h).abs().cmp(qn(l,n,o,1).minus(h).abs())<1?[u,r]:[l,n],g.precision=c,Gt=!0,f};Ke.toHexadecimal=Ke.toHex=function(t,e){return nN(this,16,t,e)};Ke.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),t==null){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),e===void 0?e=r.rounding:es(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(Gt=!1,n=qn(n,t,0,e,1).times(t),Gt=!0,Ft(n)):(t.s=n.s,n=t),n};Ke.toNumber=function(){return+this};Ke.toOctal=function(t,e){return nN(this,8,t,e)};Ke.toPower=Ke.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,u=+(t=new l(t));if(!a.d||!t.d||!a.d[0]||!t.d[0])return new l(oi(+a,u));if(a=new l(a),a.eq(1))return a;if(r=l.precision,o=l.rounding,t.eq(1))return Ft(a,r,o);if(e=ao(t.e/$t),e>=t.d.length-1&&(n=u<0?-u:u)<=Nme)return i=VG(l,a,n,r),t.s<0?new l(1).div(i):Ft(i,r,o);if(s=a.s,s<0){if(el.maxE+1||e0?s/0:0):(Gt=!1,l.rounding=a.s=1,n=Math.min(12,(e+"").length),i=yD(t.times(Bc(a,r+n)),r),i.d&&(i=Ft(i,r+5,1),fy(i.d,r,o)&&(e=r+10,i=Ft(yD(t.times(Bc(a,e+n)),e),e+5,1),+$i(i.d).slice(r+1,r+15)+1==1e14&&(i=Ft(i,r+1,0)))),i.s=s,Gt=!0,l.rounding=o,Ft(i,r,o))};Ke.toPrecision=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=zl(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(es(t,1,_d),e===void 0?e=i.rounding:es(e,0,8),r=Ft(new i(r),t,e),n=zl(r,t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n};Ke.toSignificantDigits=Ke.toSD=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(es(t,1,_d),e===void 0?e=r.rounding:es(e,0,8)),Ft(new r(n),t,e)};Ke.toString=function(){var t=this,e=t.constructor,n=zl(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n};Ke.truncated=Ke.trunc=function(){return Ft(new this.constructor(this),this.e+1,1)};Ke.valueOf=Ke.toJSON=function(){var t=this,e=t.constructor,n=zl(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};function $i(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;en)throw Error(id+t)}function fy(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=$t,i=0):(i=Math.ceil((e+1)/$t),e%=$t),o=oi(10,$t-e),a=t[i]%o|0,r==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),s=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[i+1]/o/100|0)==oi(10,e-2)-1||(a==o/2||a==0)&&(t[i+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),s=(r||n<4)&&a==9999||!r&&n>3&&a==4999):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==oi(10,e-3)-1,s}function e_(t,e,n){for(var r,i=[0],o,s=0,a=t.length;sn-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Ome(t,e){var n,r,i;if(e.isZero())return e;r=e.d.length,r<32?(n=Math.ceil(r/3),i=(1/uE(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=Gm(t,1,e.times(i),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}var qn=function(){function t(r,i,o){var s,a=0,l=r.length;for(r=r.slice();l--;)s=r[l]*i+a,r[l]=s%o|0,a=s/o|0;return a&&r.unshift(a),r}function e(r,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o,s){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,s,a,l){var u,c,d,f,h,p,g,b,m,w,x,_,C,S,M,P,A,R,F,$,j=r.constructor,k=r.s==i.s?1:-1,U=r.d,G=i.d;if(!U||!U[0]||!G||!G[0])return new j(!r.s||!i.s||(U?G&&U[0]==G[0]:!G)?NaN:U&&U[0]==0||!G?k*0:k/0);for(l?(h=1,c=r.e-i.e):(l=Wa,h=$t,c=ao(r.e/h)-ao(i.e/h)),F=G.length,A=U.length,m=new j(k),w=m.d=[],d=0;G[d]==(U[d]||0);d++);if(G[d]>(U[d]||0)&&c--,o==null?(S=o=j.precision,s=j.rounding):a?S=o+(r.e-i.e)+1:S=o,S<0)w.push(1),p=!0;else{if(S=S/h+2|0,d=0,F==1){for(f=0,G=G[0],S++;(d1&&(G=t(G,f,l),U=t(U,f,l),F=G.length,A=U.length),P=F,x=U.slice(0,F),_=x.length;_=l/2&&++R;do f=0,u=e(G,x,F,_),u<0?(C=x[0],F!=_&&(C=C*l+(x[1]||0)),f=C/R|0,f>1?(f>=l&&(f=l-1),g=t(G,f,l),b=g.length,_=x.length,u=e(g,x,b,_),u==1&&(f--,n(g,F=10;f/=10)d++;m.e=d+c*h-1,Ft(m,a?o+m.e+1:o,s,p)}return m}}();function Ft(t,e,n,r){var i,o,s,a,l,u,c,d,f,h=t.constructor;e:if(e!=null){if(d=t.d,!d)return t;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=e-i,o<0)o+=$t,s=e,c=d[f=0],l=c/oi(10,i-s-1)%10|0;else if(f=Math.ceil((o+1)/$t),a=d.length,f>=a)if(r){for(;a++<=f;)d.push(0);c=l=0,i=1,o%=$t,s=o-$t+1}else break e;else{for(c=a=d[f],i=1;a>=10;a/=10)i++;o%=$t,s=o-$t+i,l=s<0?0:c/oi(10,i-s-1)%10|0}if(r=r||e<0||d[f+1]!==void 0||(s<0?c:c%oi(10,i-s-1)),u=n<4?(l||r)&&(n==0||n==(t.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(o>0?s>0?c/oi(10,i-s):0:d[f-1])%10&1||n==(t.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=t.e+1,d[0]=oi(10,($t-e%$t)%$t),t.e=-e||0):d[0]=t.e=0,t;if(o==0?(d.length=f,a=1,f--):(d.length=f+1,a=oi(10,$t-o),d[f]=s>0?(c/oi(10,i-s)%oi(10,s)|0)*a:0),u)for(;;)if(f==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,d[0]==Wa&&(d[0]=1));break}else{if(d[f]+=a,d[f]!=Wa)break;d[f--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return Gt&&(t.e>h.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+Sc(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+Sc(-i-1)+o,n&&(r=n-s)>0&&(o+=Sc(r))):i>=s?(o+=Sc(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Sc(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=Sc(r))),o}function lE(t,e){var n=t[0];for(e*=$t;n>=10;n/=10)e++;return e}function tS(t,e,n){if(e>Fme)throw Gt=!0,n&&(t.precision=n),Error(BG);return Ft(new t(J_),e,1,!0)}function za(t,e,n){if(e>vD)throw Error(BG);return Ft(new t(eS),e,n,!0)}function HG(t){var e=t.length-1,n=e*$t+1;if(e=t[e],e){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function Sc(t){for(var e="";t--;)e+="0";return e}function VG(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/$t+4);for(Gt=!1;;){if(n%2&&(o=o.times(e),wB(o.d,s)&&(i=!0)),n=ao(n/2),n===0){n=o.d.length-1,i&&o.d[n]===0&&++o.d[n];break}e=e.times(e),wB(e.d,s)}return Gt=!0,o}function xB(t){return t.d[t.d.length-1]&1}function GG(t,e,n){for(var r,i=new t(e[0]),o=0;++o17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(Gt=!1,l=p):l=e,a=new f(.03125);t.e>-2;)t=t.times(a),d+=5;for(r=Math.log(oi(2,d))/Math.LN10*2+5|0,l+=r,n=o=s=new f(1),f.precision=l;;){if(o=Ft(o.times(t),l,1),n=n.times(++c),a=s.plus(qn(o,n,l,1)),$i(a.d).slice(0,l)===$i(s.d).slice(0,l)){for(i=d;i--;)s=Ft(s.times(s),l,1);if(e==null)if(u<3&&fy(s.d,l-r,h,u))f.precision=l+=10,n=o=a=new f(1),c=0,u++;else return Ft(s,f.precision=p,h,Gt=!0);else return f.precision=p,s}s=a}}function Bc(t,e){var n,r,i,o,s,a,l,u,c,d,f,h=1,p=10,g=t,b=g.d,m=g.constructor,w=m.rounding,x=m.precision;if(g.s<0||!b||!b[0]||!g.e&&b[0]==1&&b.length==1)return new m(b&&!b[0]?-1/0:g.s!=1?NaN:b?0:g);if(e==null?(Gt=!1,c=x):c=e,m.precision=c+=p,n=$i(b),r=n.charAt(0),Math.abs(o=g.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(t),n=$i(g.d),r=n.charAt(0),h++;o=g.e,r>1?(g=new m("0."+n),o++):g=new m(r+"."+n.slice(1))}else return u=tS(m,c+2,x).times(o+""),g=Bc(new m(r+"."+n.slice(1)),c-p).plus(u),m.precision=x,e==null?Ft(g,x,w,Gt=!0):g;for(d=g,l=s=g=qn(g.minus(1),g.plus(1),c,1),f=Ft(g.times(g),c,1),i=3;;){if(s=Ft(s.times(f),c,1),u=l.plus(qn(s,new m(i),c,1)),$i(u.d).slice(0,c)===$i(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(tS(m,c+2,x).times(o+""))),l=qn(l,new m(h),c,1),e==null)if(fy(l.d,c-p,w,a))m.precision=c+=p,u=s=g=qn(d.minus(1),d.plus(1),c,1),f=Ft(g.times(g),c,1),i=a=1;else return Ft(l,m.precision=x,w,Gt=!0);else return m.precision=x,l;l=u,i+=2}}function jG(t){return String(t.s*t.s/0)}function bD(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;r++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(r,i),e){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%$t,n<0&&(r+=$t),rt.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),UG.test(e))return bD(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Rme.test(e))n=16,e=e.toLowerCase();else if(Dme.test(e))n=2;else if(Ime.test(e))n=8;else throw Error(id+e);for(o=e.search(/p/i),o>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,r=t.constructor,s&&(e=e.replace(".",""),a=e.length,o=a-o,i=VG(r,new r(n),o,o*2)),u=e_(e,n,Wa),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new r(t.s*0):(t.e=lE(u,c),t.d=u,Gt=!1,s&&(t=qn(t,i,a*4)),l&&(t=t.times(Math.abs(l)<54?oi(2,l):od.pow(2,l))),Gt=!0,t)}function Lme(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:Gm(t,2,e,e);n=1.4*Math.sqrt(r),n=n>16?16:n|0,e=e.times(1/uE(5,n)),e=Gm(t,2,e,e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}function Gm(t,e,n,r,i){var o,s,a,l,u=t.precision,c=Math.ceil(u/$t);for(Gt=!1,l=n.times(n),a=new t(r);;){if(s=qn(a.times(l),new t(e++*e++),u,1),a=i?r.plus(s):r.minus(s),r=qn(s.times(l),new t(e++*e++),u,1),s=a.plus(r),s.d[c]!==void 0){for(o=c;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=r,r=s,s=o}return Gt=!0,s.d.length=c+1,s}function uE(t,e){for(var n=t;--e;)n*=t;return n}function WG(t,e){var n,r=e.s<0,i=za(t,t.precision,1),o=i.times(.5);if(e=e.abs(),e.lte(o))return Mu=r?4:1,e;if(n=e.divToInt(i),n.isZero())Mu=r?3:2;else{if(e=e.minus(n.times(i)),e.lte(o))return Mu=xB(n)?r?2:3:r?4:1,e;Mu=xB(n)?r?1:4:r?3:2}return e.minus(i).abs()}function nN(t,e,n,r){var i,o,s,a,l,u,c,d,f,h=t.constructor,p=n!==void 0;if(p?(es(n,1,_d),r===void 0?r=h.rounding:es(r,0,8)):(n=h.precision,r=h.rounding),!t.isFinite())c=jG(t);else{for(c=zl(t),s=c.indexOf("."),p?(i=2,e==16?n=n*4-3:e==8&&(n=n*3-2)):i=e,s>=0&&(c=c.replace(".",""),f=new h(1),f.e=c.length-s,f.d=e_(zl(f),10,i),f.e=f.d.length),d=e_(c,10,i),o=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=p?"0p+0":"0";else{if(s<0?o--:(t=new h(t),t.d=d,t.e=o,t=qn(t,f,n,r,0,i),d=t.d,o=t.e,u=LG),s=d[n],a=i/2,u=u||d[n+1]!==void 0,u=r<4?(s!==void 0||u)&&(r===0||r===(t.s<0?3:2)):s>a||s===a&&(r===4||u||r===6&&d[n-1]&1||r===(t.s<0?8:7)),d.length=n,u)for(;++d[--n]>i-1;)d[n]=0,n||(++o,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(d=e_(c,i,e),l=d.length;!d[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else oe)return t.length=e,!0}function Bme(t){return new this(t).abs()}function $me(t){return new this(t).acos()}function zme(t){return new this(t).acosh()}function Ume(t,e){return new this(t).plus(e)}function Hme(t){return new this(t).asin()}function Vme(t){return new this(t).asinh()}function Gme(t){return new this(t).atan()}function jme(t){return new this(t).atanh()}function Wme(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return!t.s||!e.s?n=new this(NaN):!t.d&&!e.d?(n=za(this,o,1).times(e.s>0?.25:.75),n.s=t.s):!e.d||t.isZero()?(n=e.s<0?za(this,r,i):new this(0),n.s=t.s):!t.d||e.isZero()?(n=za(this,o,1).times(.5),n.s=t.s):e.s<0?(this.precision=o,this.rounding=1,n=this.atan(qn(t,e,o,1)),e=za(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(qn(t,e,o,1)),n}function qme(t){return new this(t).cbrt()}function Xme(t){return Ft(t=new this(t),t.e+1,2)}function Kme(t,e,n){return new this(t).clamp(e,n)}function Yme(t){if(!t||typeof t!="object")throw Error(aE+"Object expected");var e,n,r,i=t.defaults===!0,o=["precision",1,_d,"rounding",0,8,"toExpNeg",-Yp,0,"toExpPos",0,Yp,"maxE",0,Yp,"minE",-Yp,0,"modulo",0,9];for(e=0;e=o[e+1]&&r<=o[e+2])this[n]=r;else throw Error(id+n+": "+r);if(n="crypto",i&&(this[n]=gD[n]),(r=t[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error($G);else this[n]=!1;else throw Error(id+n+": "+r);return this}function Zme(t){return new this(t).cos()}function Qme(t){return new this(t).cosh()}function qG(t){var e,n,r;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,_B(o)){u.s=o.s,Gt?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;Gt?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=r/4}else throw Error($G);else for(;o=10;i/=10)r++;r<$t&&(n-=$t-r)}return s.e=n,s.d=a,s}function hge(t){return Ft(t=new this(t),t.e+1,this.rounding)}function pge(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function mge(t){return new this(t).sin()}function gge(t){return new this(t).sinh()}function vge(t){return new this(t).sqrt()}function yge(t,e){return new this(t).sub(e)}function bge(){var t=0,e=arguments,n=new this(e[t]);for(Gt=!1;n.s&&++t{var{on:e,config:n}=t,r=od.clone({precision:n.precision,modulo:od.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(i){return new r(i.value)},e&&e("config",function(i,o){i.precision!==o.precision&&r.config({precision:i.precision})}),r},{isClass:!0}),XG={exports:{}};/** + */var Yp=9e15,_d=1e9,mD="0123456789abcdef",J_="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",eS="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",gD={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Yp,maxE:Yp,crypto:!1},LG,Mu,Gt=!0,aE="[DecimalError] ",id=aE+"Invalid argument: ",BG=aE+"Precision limit exceeded",$G=aE+"crypto unavailable",zG="[object Decimal]",ao=Math.floor,oi=Math.pow,Dme=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Rme=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ime=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,UG=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ja=1e7,$t=7,Nme=9007199254740991,Fme=J_.length-1,vD=eS.length-1,Ke={toStringTag:zG};Ke.absoluteValue=Ke.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Ft(t)};Ke.ceil=function(){return Ft(new this.constructor(this),this.e+1,2)};Ke.clampedTo=Ke.clamp=function(t,e){var n,r=this,i=r.constructor;if(t=new i(t),e=new i(e),!t.s||!e.s)return new i(NaN);if(t.gt(e))throw Error(id+e);return n=r.cmp(t),n<0?t:r.cmp(e)>0?e:new i(r)};Ke.comparedTo=Ke.cmp=function(t){var e,n,r,i,o=this,s=o.d,a=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(r=s.length,i=a.length,e=0,n=ra[e]^l<0?1:-1;return r===i?0:r>i^l<0?1:-1};Ke.cosine=Ke.cos=function(){var t,e,n=this,r=n.constructor;return n.d?n.d[0]?(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+$t,r.rounding=1,n=Ome(r,WG(r,n)),r.precision=t,r.rounding=e,Ft(Mu==2||Mu==3?n.neg():n,t,e,!0)):new r(1):new r(NaN)};Ke.cubeRoot=Ke.cbrt=function(){var t,e,n,r,i,o,s,a,l,u,c=this,d=c.constructor;if(!c.isFinite()||c.isZero())return new d(c);for(Gt=!1,o=c.s*oi(c.s*c,1/3),!o||Math.abs(o)==1/0?(n=$i(c.d),t=c.e,(o=(t-n.length+1)%3)&&(n+=o==1||o==-2?"0":"00"),o=oi(n,1/3),t=ao((t+1)/3)-(t%3==(t<0?-1:2)),o==1/0?n="5e"+t:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+t),r=new d(n),r.s=c.s):r=new d(o.toString()),s=(t=d.precision)+3;;)if(a=r,l=a.times(a).times(a),u=l.plus(c),r=qn(u.plus(c).times(a),u.plus(l),s+2,1),$i(a.d).slice(0,s)===(n=$i(r.d)).slice(0,s))if(n=n.slice(s-3,s+1),n=="9999"||!i&&n=="4999"){if(!i&&(Ft(a,t+1,0),a.times(a).times(a).eq(c))){r=a;break}s+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(Ft(r,t+1,1),e=!r.times(r).times(r).eq(c));break}return Gt=!0,Ft(r,t,d.rounding,e)};Ke.decimalPlaces=Ke.dp=function(){var t,e=this.d,n=NaN;if(e){if(t=e.length-1,n=(t-ao(this.e/$t))*$t,t=e[t],t)for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n};Ke.dividedBy=Ke.div=function(t){return qn(this,new this.constructor(t))};Ke.dividedToIntegerBy=Ke.divToInt=function(t){var e=this,n=e.constructor;return Ft(qn(e,new n(t),0,1,1),n.precision,n.rounding)};Ke.equals=Ke.eq=function(t){return this.cmp(t)===0};Ke.floor=function(){return Ft(new this.constructor(this),this.e+1,3)};Ke.greaterThan=Ke.gt=function(t){return this.cmp(t)>0};Ke.greaterThanOrEqualTo=Ke.gte=function(t){var e=this.cmp(t);return e==1||e===0};Ke.hyperbolicCosine=Ke.cosh=function(){var t,e,n,r,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;n=s.precision,r=s.rounding,s.precision=n+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(t=Math.ceil(i/3),e=(1/uE(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),o=Gm(s,1,o.times(e),new s(1),!0);for(var l,u=t,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return Ft(o,s.precision=n,s.rounding=r,!0)};Ke.hyperbolicSine=Ke.sinh=function(){var t,e,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(e=o.precision,n=o.rounding,o.precision=e+Math.max(i.e,i.sd())+4,o.rounding=1,r=i.d.length,r<3)i=Gm(o,2,i,i,!0);else{t=1.4*Math.sqrt(r),t=t>16?16:t|0,i=i.times(1/uE(5,t)),i=Gm(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);t--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=e,o.rounding=n,Ft(i,e,n,!0)};Ke.hyperbolicTangent=Ke.tanh=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+7,r.rounding=1,qn(n.sinh(),n.cosh(),r.precision=t,r.rounding=e)):new r(n.s)};Ke.inverseCosine=Ke.acos=function(){var t,e=this,n=e.constructor,r=e.abs().cmp(1),i=n.precision,o=n.rounding;return r!==-1?r===0?e.isNeg()?$a(n,i,o):new n(0):new n(NaN):e.isZero()?$a(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,e=e.asin(),t=$a(n,i+4,o).times(.5),n.precision=i,n.rounding=o,t.minus(e))};Ke.inverseHyperbolicCosine=Ke.acosh=function(){var t,e,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(t=r.precision,e=r.rounding,r.precision=t+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,Gt=!1,n=n.times(n).minus(1).sqrt().plus(n),Gt=!0,r.precision=t,r.rounding=e,n.ln()):new r(n)};Ke.inverseHyperbolicSine=Ke.asinh=function(){var t,e,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,Gt=!1,n=n.times(n).plus(1).sqrt().plus(n),Gt=!0,r.precision=t,r.rounding=e,n.ln())};Ke.inverseHyperbolicTangent=Ke.atanh=function(){var t,e,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=o.precision,e=o.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?Ft(new o(i),t,e,!0):(o.precision=n=r-i.e,i=qn(i.plus(1),new o(1).minus(i),n+t,1),o.precision=t+4,o.rounding=1,i=i.ln(),o.precision=t,o.rounding=e,i.times(.5))):new o(NaN)};Ke.inverseSine=Ke.asin=function(){var t,e,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(e=i.abs().cmp(1),n=o.precision,r=o.rounding,e!==-1?e===0?(t=$a(o,n+4,r).times(.5),t.s=i.s,t):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))};Ke.inverseTangent=Ke.atan=function(){var t,e,n,r,i,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&d+4<=vD)return s=$a(c,d+4,f).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(d+4<=vD)return s=$a(c,d+4,f).times(.5),s.s=u.s,s}for(c.precision=a=d+10,c.rounding=1,n=Math.min(28,a/$t+2|0),t=n;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(Gt=!1,e=Math.ceil(a/$t),r=1,l=u.times(u),s=new c(u),i=u;t!==-1;)if(i=i.times(l),o=s.minus(i.div(r+=2)),i=i.times(l),s=o.plus(i.div(r+=2)),s.d[e]!==void 0)for(t=e;s.d[t]===o.d[t]&&t--;);return n&&(s=s.times(2<this.d.length-2};Ke.isNaN=function(){return!this.s};Ke.isNegative=Ke.isNeg=function(){return this.s<0};Ke.isPositive=Ke.isPos=function(){return this.s>0};Ke.isZero=function(){return!!this.d&&this.d[0]===0};Ke.lessThan=Ke.lt=function(t){return this.cmp(t)<0};Ke.lessThanOrEqualTo=Ke.lte=function(t){return this.cmp(t)<1};Ke.logarithm=Ke.log=function(t){var e,n,r,i,o,s,a,l,u=this,c=u.constructor,d=c.precision,f=c.rounding,h=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),n=t.d,t.s<0||!n||!n[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(n=u.d,u.s<0||!n||!n[0]||u.eq(1))return new c(n&&!n[0]?-1/0:u.s!=1?NaN:n?0:1/0);if(e)if(n.length>1)o=!0;else{for(i=n[0];i%10===0;)i/=10;o=i!==1}if(Gt=!1,a=d+h,s=Bc(u,a),r=e?tS(c,a+10):Bc(t,a),l=qn(s,r,a,1),fy(l.d,i=d,f))do if(a+=10,s=Bc(u,a),r=e?tS(c,a+10):Bc(t,a),l=qn(s,r,a,1),!o){+$i(l.d).slice(i+1,i+15)+1==1e14&&(l=Ft(l,d+1,0));break}while(fy(l.d,i+=10,f));return Gt=!0,Ft(l,d,f)};Ke.minus=Ke.sub=function(t){var e,n,r,i,o,s,a,l,u,c,d,f,h=this,p=h.constructor;if(t=new p(t),!h.d||!t.d)return!h.s||!t.s?t=new p(NaN):h.d?t.s=-t.s:t=new p(t.d||h.s!==t.s?h:NaN),t;if(h.s!=t.s)return t.s=-t.s,h.plus(t);if(u=h.d,f=t.d,a=p.precision,l=p.rounding,!u[0]||!f[0]){if(f[0])t.s=-t.s;else if(u[0])t=new p(h);else return new p(l===3?-0:0);return Gt?Ft(t,a,l):t}if(n=ao(t.e/$t),c=ao(h.e/$t),u=u.slice(),o=c-n,o){for(d=o<0,d?(e=u,o=-o,s=f.length):(e=f,n=c,s=u.length),r=Math.max(Math.ceil(a/$t),s)+2,o>r&&(o=r,e.length=1),e.reverse(),r=o;r--;)e.push(0);e.reverse()}else{for(r=u.length,s=f.length,d=r0;--r)u[s++]=0;for(r=f.length;r>o;){if(u[--r]s?o+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,n=c,c=u,u=n),e=0;i;)e=(u[--i]=u[i]+c[i]+e)/ja|0,u[i]%=ja;for(e&&(u.unshift(e),++r),s=u.length;u[--s]==0;)u.pop();return t.d=u,t.e=lE(u,r),Gt?Ft(t,a,l):t};Ke.precision=Ke.sd=function(t){var e,n=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(id+t);return n.d?(e=HG(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e};Ke.round=function(){var t=this,e=t.constructor;return Ft(new e(t),t.e+1,e.rounding)};Ke.sine=Ke.sin=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+Math.max(n.e,n.sd())+$t,r.rounding=1,n=Lme(r,WG(r,n)),r.precision=t,r.rounding=e,Ft(Mu>2?n.neg():n,t,e,!0)):new r(NaN)};Ke.squareRoot=Ke.sqrt=function(){var t,e,n,r,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(Gt=!1,u=Math.sqrt(+s),u==0||u==1/0?(e=$i(a),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=ao((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),r=new c(e)):r=new c(u.toString()),n=(l=c.precision)+3;;)if(o=r,r=o.plus(qn(s,o,n+2,1)).times(.5),$i(o.d).slice(0,n)===(e=$i(r.d)).slice(0,n))if(e=e.slice(n-3,n+1),e=="9999"||!i&&e=="4999"){if(!i&&(Ft(o,l+1,0),o.times(o).eq(s))){r=o;break}n+=4,i=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Ft(r,l+1,1),t=!r.times(r).eq(s));break}return Gt=!0,Ft(r,l,c.rounding,t)};Ke.tangent=Ke.tan=function(){var t,e,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(t=r.precision,e=r.rounding,r.precision=t+10,r.rounding=1,n=n.sin(),n.s=1,n=qn(n,new r(1).minus(n.times(n)).sqrt(),t+10,0),r.precision=t,r.rounding=e,Ft(Mu==2||Mu==4?n.neg():n,t,e,!0)):new r(NaN)};Ke.times=Ke.mul=function(t){var e,n,r,i,o,s,a,l,u,c=this,d=c.constructor,f=c.d,h=(t=new d(t)).d;if(t.s*=c.s,!f||!f[0]||!h||!h[0])return new d(!t.s||f&&!f[0]&&!h||h&&!h[0]&&!f?NaN:!f||!h?t.s/0:t.s*0);for(n=ao(c.e/$t)+ao(t.e/$t),l=f.length,u=h.length,l=0;){for(e=0,i=l+r;i>r;)a=o[i]+h[r]*f[i-r-1]+e,o[i--]=a%ja|0,e=a/ja|0;o[i]=(o[i]+e)%ja|0}for(;!o[--s];)o.pop();return e?++n:o.shift(),t.d=o,t.e=lE(o,n),Gt?Ft(t,d.precision,d.rounding):t};Ke.toBinary=function(t,e){return nN(this,2,t,e)};Ke.toDecimalPlaces=Ke.toDP=function(t,e){var n=this,r=n.constructor;return n=new r(n),t===void 0?n:(es(t,0,_d),e===void 0?e=r.rounding:es(e,0,8),Ft(n,t+n.e+1,e))};Ke.toExponential=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=zl(r,!0):(es(t,0,_d),e===void 0?e=i.rounding:es(e,0,8),r=Ft(new i(r),t+1,e),n=zl(r,!0,t+1)),r.isNeg()&&!r.isZero()?"-"+n:n};Ke.toFixed=function(t,e){var n,r,i=this,o=i.constructor;return t===void 0?n=zl(i):(es(t,0,_d),e===void 0?e=o.rounding:es(e,0,8),r=Ft(new o(i),t+i.e+1,e),n=zl(r,!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n};Ke.toFraction=function(t){var e,n,r,i,o,s,a,l,u,c,d,f,h=this,p=h.d,g=h.constructor;if(!p)return new g(h);if(u=n=new g(1),r=l=new g(0),e=new g(r),o=e.e=HG(p)-h.e-1,s=o%$t,e.d[0]=oi(10,s<0?$t+s:s),t==null)t=o>0?e:u;else{if(a=new g(t),!a.isInt()||a.lt(u))throw Error(id+a);t=a.gt(e)?o>0?e:u:a}for(Gt=!1,a=new g($i(p)),c=g.precision,g.precision=o=p.length*$t*2;d=qn(a,e,0,1,1),i=n.plus(d.times(r)),i.cmp(t)!=1;)n=r,r=i,i=u,u=l.plus(d.times(i)),l=i,i=e,e=a.minus(d.times(i)),a=i;return i=qn(t.minus(n),r,0,1,1),l=l.plus(i.times(u)),n=n.plus(i.times(r)),l.s=u.s=h.s,f=qn(u,r,o,1).minus(h).abs().cmp(qn(l,n,o,1).minus(h).abs())<1?[u,r]:[l,n],g.precision=c,Gt=!0,f};Ke.toHexadecimal=Ke.toHex=function(t,e){return nN(this,16,t,e)};Ke.toNearest=function(t,e){var n=this,r=n.constructor;if(n=new r(n),t==null){if(!n.d)return n;t=new r(1),e=r.rounding}else{if(t=new r(t),e===void 0?e=r.rounding:es(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(Gt=!1,n=qn(n,t,0,e,1).times(t),Gt=!0,Ft(n)):(t.s=n.s,n=t),n};Ke.toNumber=function(){return+this};Ke.toOctal=function(t,e){return nN(this,8,t,e)};Ke.toPower=Ke.pow=function(t){var e,n,r,i,o,s,a=this,l=a.constructor,u=+(t=new l(t));if(!a.d||!t.d||!a.d[0]||!t.d[0])return new l(oi(+a,u));if(a=new l(a),a.eq(1))return a;if(r=l.precision,o=l.rounding,t.eq(1))return Ft(a,r,o);if(e=ao(t.e/$t),e>=t.d.length-1&&(n=u<0?-u:u)<=Nme)return i=VG(l,a,n,r),t.s<0?new l(1).div(i):Ft(i,r,o);if(s=a.s,s<0){if(el.maxE+1||e0?s/0:0):(Gt=!1,l.rounding=a.s=1,n=Math.min(12,(e+"").length),i=yD(t.times(Bc(a,r+n)),r),i.d&&(i=Ft(i,r+5,1),fy(i.d,r,o)&&(e=r+10,i=Ft(yD(t.times(Bc(a,e+n)),e),e+5,1),+$i(i.d).slice(r+1,r+15)+1==1e14&&(i=Ft(i,r+1,0)))),i.s=s,Gt=!0,l.rounding=o,Ft(i,r,o))};Ke.toPrecision=function(t,e){var n,r=this,i=r.constructor;return t===void 0?n=zl(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(es(t,1,_d),e===void 0?e=i.rounding:es(e,0,8),r=Ft(new i(r),t,e),n=zl(r,t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+n:n};Ke.toSignificantDigits=Ke.toSD=function(t,e){var n=this,r=n.constructor;return t===void 0?(t=r.precision,e=r.rounding):(es(t,1,_d),e===void 0?e=r.rounding:es(e,0,8)),Ft(new r(n),t,e)};Ke.toString=function(){var t=this,e=t.constructor,n=zl(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n};Ke.truncated=Ke.trunc=function(){return Ft(new this.constructor(this),this.e+1,1)};Ke.valueOf=Ke.toJSON=function(){var t=this,e=t.constructor,n=zl(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};function $i(t){var e,n,r,i=t.length-1,o="",s=t[0];if(i>0){for(o+=s,e=1;en)throw Error(id+t)}function fy(t,e,n,r){var i,o,s,a;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=$t,i=0):(i=Math.ceil((e+1)/$t),e%=$t),o=oi(10,$t-e),a=t[i]%o|0,r==null?e<3?(e==0?a=a/100|0:e==1&&(a=a/10|0),s=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):s=(n<4&&a+1==o||n>3&&a+1==o/2)&&(t[i+1]/o/100|0)==oi(10,e-2)-1||(a==o/2||a==0)&&(t[i+1]/o/100|0)==0:e<4?(e==0?a=a/1e3|0:e==1?a=a/100|0:e==2&&(a=a/10|0),s=(r||n<4)&&a==9999||!r&&n>3&&a==4999):s=((r||n<4)&&a+1==o||!r&&n>3&&a+1==o/2)&&(t[i+1]/o/1e3|0)==oi(10,e-3)-1,s}function e_(t,e,n){for(var r,i=[0],o,s=0,a=t.length;sn-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Ome(t,e){var n,r,i;if(e.isZero())return e;r=e.d.length,r<32?(n=Math.ceil(r/3),i=(1/uE(4,n)).toString()):(n=16,i="2.3283064365386962890625e-10"),t.precision+=n,e=Gm(t,1,e.times(i),new t(1));for(var o=n;o--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=n,e}var qn=function(){function t(r,i,o){var s,a=0,l=r.length;for(r=r.slice();l--;)s=r[l]*i+a,r[l]=s%o|0,a=s/o|0;return a&&r.unshift(a),r}function e(r,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function n(r,i,o,s){for(var a=0;o--;)r[o]-=a,a=r[o]1;)r.shift()}return function(r,i,o,s,a,l){var u,c,d,f,h,p,g,b,m,w,x,_,C,S,M,P,A,R,F,$,j=r.constructor,k=r.s==i.s?1:-1,U=r.d,G=i.d;if(!U||!U[0]||!G||!G[0])return new j(!r.s||!i.s||(U?G&&U[0]==G[0]:!G)?NaN:U&&U[0]==0||!G?k*0:k/0);for(l?(h=1,c=r.e-i.e):(l=ja,h=$t,c=ao(r.e/h)-ao(i.e/h)),F=G.length,A=U.length,m=new j(k),w=m.d=[],d=0;G[d]==(U[d]||0);d++);if(G[d]>(U[d]||0)&&c--,o==null?(S=o=j.precision,s=j.rounding):a?S=o+(r.e-i.e)+1:S=o,S<0)w.push(1),p=!0;else{if(S=S/h+2|0,d=0,F==1){for(f=0,G=G[0],S++;(d1&&(G=t(G,f,l),U=t(U,f,l),F=G.length,A=U.length),P=F,x=U.slice(0,F),_=x.length;_=l/2&&++R;do f=0,u=e(G,x,F,_),u<0?(C=x[0],F!=_&&(C=C*l+(x[1]||0)),f=C/R|0,f>1?(f>=l&&(f=l-1),g=t(G,f,l),b=g.length,_=x.length,u=e(g,x,b,_),u==1&&(f--,n(g,F=10;f/=10)d++;m.e=d+c*h-1,Ft(m,a?o+m.e+1:o,s,p)}return m}}();function Ft(t,e,n,r){var i,o,s,a,l,u,c,d,f,h=t.constructor;e:if(e!=null){if(d=t.d,!d)return t;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=e-i,o<0)o+=$t,s=e,c=d[f=0],l=c/oi(10,i-s-1)%10|0;else if(f=Math.ceil((o+1)/$t),a=d.length,f>=a)if(r){for(;a++<=f;)d.push(0);c=l=0,i=1,o%=$t,s=o-$t+1}else break e;else{for(c=a=d[f],i=1;a>=10;a/=10)i++;o%=$t,s=o-$t+i,l=s<0?0:c/oi(10,i-s-1)%10|0}if(r=r||e<0||d[f+1]!==void 0||(s<0?c:c%oi(10,i-s-1)),u=n<4?(l||r)&&(n==0||n==(t.s<0?3:2)):l>5||l==5&&(n==4||r||n==6&&(o>0?s>0?c/oi(10,i-s):0:d[f-1])%10&1||n==(t.s<0?8:7)),e<1||!d[0])return d.length=0,u?(e-=t.e+1,d[0]=oi(10,($t-e%$t)%$t),t.e=-e||0):d[0]=t.e=0,t;if(o==0?(d.length=f,a=1,f--):(d.length=f+1,a=oi(10,$t-o),d[f]=s>0?(c/oi(10,i-s)%oi(10,s)|0)*a:0),u)for(;;)if(f==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(t.e++,d[0]==ja&&(d[0]=1));break}else{if(d[f]+=a,d[f]!=ja)break;d[f--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return Gt&&(t.e>h.maxE?(t.d=null,t.e=NaN):t.e0?o=o.charAt(0)+"."+o.slice(1)+Sc(r):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):i<0?(o="0."+Sc(-i-1)+o,n&&(r=n-s)>0&&(o+=Sc(r))):i>=s?(o+=Sc(i+1-s),n&&(r=n-i-1)>0&&(o=o+"."+Sc(r))):((r=i+1)0&&(i+1===s&&(o+="."),o+=Sc(r))),o}function lE(t,e){var n=t[0];for(e*=$t;n>=10;n/=10)e++;return e}function tS(t,e,n){if(e>Fme)throw Gt=!0,n&&(t.precision=n),Error(BG);return Ft(new t(J_),e,1,!0)}function $a(t,e,n){if(e>vD)throw Error(BG);return Ft(new t(eS),e,n,!0)}function HG(t){var e=t.length-1,n=e*$t+1;if(e=t[e],e){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function Sc(t){for(var e="";t--;)e+="0";return e}function VG(t,e,n,r){var i,o=new t(1),s=Math.ceil(r/$t+4);for(Gt=!1;;){if(n%2&&(o=o.times(e),wB(o.d,s)&&(i=!0)),n=ao(n/2),n===0){n=o.d.length-1,i&&o.d[n]===0&&++o.d[n];break}e=e.times(e),wB(e.d,s)}return Gt=!0,o}function xB(t){return t.d[t.d.length-1]&1}function GG(t,e,n){for(var r,i=new t(e[0]),o=0;++o17)return new f(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(Gt=!1,l=p):l=e,a=new f(.03125);t.e>-2;)t=t.times(a),d+=5;for(r=Math.log(oi(2,d))/Math.LN10*2+5|0,l+=r,n=o=s=new f(1),f.precision=l;;){if(o=Ft(o.times(t),l,1),n=n.times(++c),a=s.plus(qn(o,n,l,1)),$i(a.d).slice(0,l)===$i(s.d).slice(0,l)){for(i=d;i--;)s=Ft(s.times(s),l,1);if(e==null)if(u<3&&fy(s.d,l-r,h,u))f.precision=l+=10,n=o=a=new f(1),c=0,u++;else return Ft(s,f.precision=p,h,Gt=!0);else return f.precision=p,s}s=a}}function Bc(t,e){var n,r,i,o,s,a,l,u,c,d,f,h=1,p=10,g=t,b=g.d,m=g.constructor,w=m.rounding,x=m.precision;if(g.s<0||!b||!b[0]||!g.e&&b[0]==1&&b.length==1)return new m(b&&!b[0]?-1/0:g.s!=1?NaN:b?0:g);if(e==null?(Gt=!1,c=x):c=e,m.precision=c+=p,n=$i(b),r=n.charAt(0),Math.abs(o=g.e)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(t),n=$i(g.d),r=n.charAt(0),h++;o=g.e,r>1?(g=new m("0."+n),o++):g=new m(r+"."+n.slice(1))}else return u=tS(m,c+2,x).times(o+""),g=Bc(new m(r+"."+n.slice(1)),c-p).plus(u),m.precision=x,e==null?Ft(g,x,w,Gt=!0):g;for(d=g,l=s=g=qn(g.minus(1),g.plus(1),c,1),f=Ft(g.times(g),c,1),i=3;;){if(s=Ft(s.times(f),c,1),u=l.plus(qn(s,new m(i),c,1)),$i(u.d).slice(0,c)===$i(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(tS(m,c+2,x).times(o+""))),l=qn(l,new m(h),c,1),e==null)if(fy(l.d,c-p,w,a))m.precision=c+=p,u=s=g=qn(d.minus(1),d.plus(1),c,1),f=Ft(g.times(g),c,1),i=a=1;else return Ft(l,m.precision=x,w,Gt=!0);else return m.precision=x,l;l=u,i+=2}}function jG(t){return String(t.s*t.s/0)}function bD(t,e){var n,r,i;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(n<0&&(n=r),n+=+e.slice(r+1),e=e.substring(0,r)):n<0&&(n=e.length),r=0;e.charCodeAt(r)===48;r++);for(i=e.length;e.charCodeAt(i-1)===48;--i);if(e=e.slice(r,i),e){if(i-=r,t.e=n=n-r-1,t.d=[],r=(n+1)%$t,n<0&&(r+=$t),rt.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),UG.test(e))return bD(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(Rme.test(e))n=16,e=e.toLowerCase();else if(Dme.test(e))n=2;else if(Ime.test(e))n=8;else throw Error(id+e);for(o=e.search(/p/i),o>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),s=o>=0,r=t.constructor,s&&(e=e.replace(".",""),a=e.length,o=a-o,i=VG(r,new r(n),o,o*2)),u=e_(e,n,ja),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new r(t.s*0):(t.e=lE(u,c),t.d=u,Gt=!1,s&&(t=qn(t,i,a*4)),l&&(t=t.times(Math.abs(l)<54?oi(2,l):od.pow(2,l))),Gt=!0,t)}function Lme(t,e){var n,r=e.d.length;if(r<3)return e.isZero()?e:Gm(t,2,e,e);n=1.4*Math.sqrt(r),n=n>16?16:n|0,e=e.times(1/uE(5,n)),e=Gm(t,2,e,e);for(var i,o=new t(5),s=new t(16),a=new t(20);n--;)i=e.times(e),e=e.times(o.plus(i.times(s.times(i).minus(a))));return e}function Gm(t,e,n,r,i){var o,s,a,l,u=t.precision,c=Math.ceil(u/$t);for(Gt=!1,l=n.times(n),a=new t(r);;){if(s=qn(a.times(l),new t(e++*e++),u,1),a=i?r.plus(s):r.minus(s),r=qn(s.times(l),new t(e++*e++),u,1),s=a.plus(r),s.d[c]!==void 0){for(o=c;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=r,r=s,s=o}return Gt=!0,s.d.length=c+1,s}function uE(t,e){for(var n=t;--e;)n*=t;return n}function WG(t,e){var n,r=e.s<0,i=$a(t,t.precision,1),o=i.times(.5);if(e=e.abs(),e.lte(o))return Mu=r?4:1,e;if(n=e.divToInt(i),n.isZero())Mu=r?3:2;else{if(e=e.minus(n.times(i)),e.lte(o))return Mu=xB(n)?r?2:3:r?4:1,e;Mu=xB(n)?r?1:4:r?3:2}return e.minus(i).abs()}function nN(t,e,n,r){var i,o,s,a,l,u,c,d,f,h=t.constructor,p=n!==void 0;if(p?(es(n,1,_d),r===void 0?r=h.rounding:es(r,0,8)):(n=h.precision,r=h.rounding),!t.isFinite())c=jG(t);else{for(c=zl(t),s=c.indexOf("."),p?(i=2,e==16?n=n*4-3:e==8&&(n=n*3-2)):i=e,s>=0&&(c=c.replace(".",""),f=new h(1),f.e=c.length-s,f.d=e_(zl(f),10,i),f.e=f.d.length),d=e_(c,10,i),o=l=d.length;d[--l]==0;)d.pop();if(!d[0])c=p?"0p+0":"0";else{if(s<0?o--:(t=new h(t),t.d=d,t.e=o,t=qn(t,f,n,r,0,i),d=t.d,o=t.e,u=LG),s=d[n],a=i/2,u=u||d[n+1]!==void 0,u=r<4?(s!==void 0||u)&&(r===0||r===(t.s<0?3:2)):s>a||s===a&&(r===4||u||r===6&&d[n-1]&1||r===(t.s<0?8:7)),d.length=n,u)for(;++d[--n]>i-1;)d[n]=0,n||(++o,d.unshift(1));for(l=d.length;!d[l-1];--l);for(s=0,c="";s1)if(e==16||e==8){for(s=e==16?4:3,--l;l%s;l++)c+="0";for(d=e_(c,i,e),l=d.length;!d[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else oe)return t.length=e,!0}function Bme(t){return new this(t).abs()}function $me(t){return new this(t).acos()}function zme(t){return new this(t).acosh()}function Ume(t,e){return new this(t).plus(e)}function Hme(t){return new this(t).asin()}function Vme(t){return new this(t).asinh()}function Gme(t){return new this(t).atan()}function jme(t){return new this(t).atanh()}function Wme(t,e){t=new this(t),e=new this(e);var n,r=this.precision,i=this.rounding,o=r+4;return!t.s||!e.s?n=new this(NaN):!t.d&&!e.d?(n=$a(this,o,1).times(e.s>0?.25:.75),n.s=t.s):!e.d||t.isZero()?(n=e.s<0?$a(this,r,i):new this(0),n.s=t.s):!t.d||e.isZero()?(n=$a(this,o,1).times(.5),n.s=t.s):e.s<0?(this.precision=o,this.rounding=1,n=this.atan(qn(t,e,o,1)),e=$a(this,o,1),this.precision=r,this.rounding=i,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(qn(t,e,o,1)),n}function qme(t){return new this(t).cbrt()}function Xme(t){return Ft(t=new this(t),t.e+1,2)}function Kme(t,e,n){return new this(t).clamp(e,n)}function Yme(t){if(!t||typeof t!="object")throw Error(aE+"Object expected");var e,n,r,i=t.defaults===!0,o=["precision",1,_d,"rounding",0,8,"toExpNeg",-Yp,0,"toExpPos",0,Yp,"maxE",0,Yp,"minE",-Yp,0,"modulo",0,9];for(e=0;e=o[e+1]&&r<=o[e+2])this[n]=r;else throw Error(id+n+": "+r);if(n="crypto",i&&(this[n]=gD[n]),(r=t[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error($G);else this[n]=!1;else throw Error(id+n+": "+r);return this}function Zme(t){return new this(t).cos()}function Qme(t){return new this(t).cosh()}function qG(t){var e,n,r;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,_B(o)){u.s=o.s,Gt?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;Gt?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(e,o):(a.push(i%1e7),o+=4);o=r/4}else throw Error($G);else for(;o=10;i/=10)r++;r<$t&&(n-=$t-r)}return s.e=n,s.d=a,s}function hge(t){return Ft(t=new this(t),t.e+1,this.rounding)}function pge(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function mge(t){return new this(t).sin()}function gge(t){return new this(t).sinh()}function vge(t){return new this(t).sqrt()}function yge(t,e){return new this(t).sub(e)}function bge(){var t=0,e=arguments,n=new this(e[t]);for(Gt=!1;n.s&&++t{var{on:e,config:n}=t,r=od.clone({precision:n.precision,modulo:od.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(i){return new r(i.value)},e&&e("config",function(i,o){i.precision!==o.precision&&r.config({precision:i.precision})}),r},{isClass:!0}),XG={exports:{}};/** * @license Complex.js v2.1.1 12/05/2020 * * Copyright (c) 2020, Robert Eisele (robert@xarg.org) * Dual licensed under the MIT or GPL Version 2 licenses. **/(function(t,e){(function(n){var r=Math.cosh||function(d){return Math.abs(d)<1e-9?1-d:(Math.exp(d)+Math.exp(-d))*.5},i=Math.sinh||function(d){return Math.abs(d)<1e-9?d:(Math.exp(d)-Math.exp(-d))*.5},o=function(d){var f=Math.PI/4;if(-f>d||d>f)return Math.cos(d)-1;var h=d*d;return h*(h*(h*(h*(h*(h*(h*(h/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},s=function(d,f){var h=Math.abs(d),p=Math.abs(f);return h<3e3&&p<3e3?Math.sqrt(h*h+p*p):(h0&&a();break;case"number":h.im=0,h.re=d;break;default:a()}return isNaN(h.re)||isNaN(h.im),h};function c(d,f){if(!(this instanceof c))return new c(d,f);var h=u(d,f);this.re=h.re,this.im=h.im}c.prototype={re:0,im:0,sign:function(){var d=this.abs();return new c(this.re/d,this.im/d)},add:function(d,f){var h=new c(d,f);return this.isInfinite()&&h.isInfinite()?c.NAN:this.isInfinite()||h.isInfinite()?c.INFINITY:new c(this.re+h.re,this.im+h.im)},sub:function(d,f){var h=new c(d,f);return this.isInfinite()&&h.isInfinite()?c.NAN:this.isInfinite()||h.isInfinite()?c.INFINITY:new c(this.re-h.re,this.im-h.im)},mul:function(d,f){var h=new c(d,f);return this.isInfinite()&&h.isZero()||this.isZero()&&h.isInfinite()?c.NAN:this.isInfinite()||h.isInfinite()?c.INFINITY:h.im===0&&this.im===0?new c(this.re*h.re,0):new c(this.re*h.re-this.im*h.im,this.re*h.im+this.im*h.re)},div:function(d,f){var h=new c(d,f);if(this.isZero()&&h.isZero()||this.isInfinite()&&h.isInfinite())return c.NAN;if(this.isInfinite()||h.isZero())return c.INFINITY;if(this.isZero()||h.isInfinite())return c.ZERO;d=this.re,f=this.im;var p=h.re,g=h.im,b,m;return g===0?new c(d/p,f/p):Math.abs(p)0)return new c(Math.pow(d,h.re),0);if(d===0)switch((h.re%4+4)%4){case 0:return new c(Math.pow(f,h.re),0);case 1:return new c(0,Math.pow(f,h.re));case 2:return new c(-Math.pow(f,h.re),0);case 3:return new c(0,-Math.pow(f,h.re))}}if(d===0&&f===0&&h.re>0&&h.im>=0)return c.ZERO;var p=Math.atan2(f,d),g=l(d,f);return d=Math.exp(h.re*g-h.im*p),f=h.im*g+h.re*p,new c(d*Math.cos(f),d*Math.sin(f))},sqrt:function(){var d=this.re,f=this.im,h=this.abs(),p,g;if(d>=0){if(f===0)return new c(Math.sqrt(d),0);p=.5*Math.sqrt(2*(h+d))}else p=Math.abs(f)/Math.sqrt(2*(h-d));return d<=0?g=.5*Math.sqrt(2*(h-d)):g=Math.abs(f)/Math.sqrt(2*(h+d)),new c(p,f<0?-g:g)},exp:function(){var d=Math.exp(this.re);return this.im,new c(d*Math.cos(this.im),d*Math.sin(this.im))},expm1:function(){var d=this.re,f=this.im;return new c(Math.expm1(d)*Math.cos(f)+o(f),Math.exp(d)*Math.sin(f))},log:function(){var d=this.re,f=this.im;return new c(l(d,f),Math.atan2(f,d))},abs:function(){return s(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var d=this.re,f=this.im;return new c(Math.sin(d)*r(f),Math.cos(d)*i(f))},cos:function(){var d=this.re,f=this.im;return new c(Math.cos(d)*r(f),-Math.sin(d)*i(f))},tan:function(){var d=2*this.re,f=2*this.im,h=Math.cos(d)+r(f);return new c(Math.sin(d)/h,i(f)/h)},cot:function(){var d=2*this.re,f=2*this.im,h=Math.cos(d)-r(f);return new c(-Math.sin(d)/h,i(f)/h)},sec:function(){var d=this.re,f=this.im,h=.5*r(2*f)+.5*Math.cos(2*d);return new c(Math.cos(d)*r(f)/h,Math.sin(d)*i(f)/h)},csc:function(){var d=this.re,f=this.im,h=.5*r(2*f)-.5*Math.cos(2*d);return new c(Math.sin(d)*r(f)/h,-Math.cos(d)*i(f)/h)},asin:function(){var d=this.re,f=this.im,h=new c(f*f-d*d+1,-2*d*f).sqrt(),p=new c(h.re-f,h.im+d).log();return new c(p.im,-p.re)},acos:function(){var d=this.re,f=this.im,h=new c(f*f-d*d+1,-2*d*f).sqrt(),p=new c(h.re-f,h.im+d).log();return new c(Math.PI/2-p.im,p.re)},atan:function(){var d=this.re,f=this.im;if(d===0){if(f===1)return new c(0,1/0);if(f===-1)return new c(0,-1/0)}var h=d*d+(1-f)*(1-f),p=new c((1-f*f-d*d)/h,-2*d/h).log();return new c(-.5*p.im,.5*p.re)},acot:function(){var d=this.re,f=this.im;if(f===0)return new c(Math.atan2(1,d),0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).atan():new c(d!==0?d/0:0,f!==0?-f/0:0).atan()},asec:function(){var d=this.re,f=this.im;if(d===0&&f===0)return new c(0,1/0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).acos():new c(d!==0?d/0:0,f!==0?-f/0:0).acos()},acsc:function(){var d=this.re,f=this.im;if(d===0&&f===0)return new c(Math.PI/2,1/0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).asin():new c(d!==0?d/0:0,f!==0?-f/0:0).asin()},sinh:function(){var d=this.re,f=this.im;return new c(i(d)*Math.cos(f),r(d)*Math.sin(f))},cosh:function(){var d=this.re,f=this.im;return new c(r(d)*Math.cos(f),i(d)*Math.sin(f))},tanh:function(){var d=2*this.re,f=2*this.im,h=r(d)+Math.cos(f);return new c(i(d)/h,Math.sin(f)/h)},coth:function(){var d=2*this.re,f=2*this.im,h=r(d)-Math.cos(f);return new c(i(d)/h,-Math.sin(f)/h)},csch:function(){var d=this.re,f=this.im,h=Math.cos(2*f)-r(2*d);return new c(-2*i(d)*Math.cos(f)/h,2*r(d)*Math.sin(f)/h)},sech:function(){var d=this.re,f=this.im,h=Math.cos(2*f)+r(2*d);return new c(2*r(d)*Math.cos(f)/h,-2*i(d)*Math.sin(f)/h)},asinh:function(){var d=this.im;this.im=-this.re,this.re=d;var f=this.asin();return this.re=-this.im,this.im=d,d=f.re,f.re=-f.im,f.im=d,f},acosh:function(){var d=this.acos();if(d.im<=0){var f=d.re;d.re=-d.im,d.im=f}else{var f=d.im;d.im=-d.re,d.re=f}return d},atanh:function(){var d=this.re,f=this.im,h=d>1&&f===0,p=1-d,g=1+d,b=p*p+f*f,m=b!==0?new c((g*p-f*f)/b,(f*p+g*f)/b):new c(d!==-1?d/0:0,f!==0?f/0:0),w=m.re;return m.re=l(m.re,m.im)/2,m.im=Math.atan2(m.im,w)/2,h&&(m.im=-m.im),m},acoth:function(){var d=this.re,f=this.im;if(d===0&&f===0)return new c(0,Math.PI/2);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).atanh():new c(d!==0?d/0:0,f!==0?-f/0:0).atanh()},acsch:function(){var d=this.re,f=this.im;if(f===0)return new c(d!==0?Math.log(d+Math.sqrt(d*d+1)):1/0,0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).asinh():new c(d!==0?d/0:0,f!==0?-f/0:0).asinh()},asech:function(){var d=this.re,f=this.im;if(this.isZero())return c.INFINITY;var h=d*d+f*f;return h!==0?new c(d/h,-f/h).acosh():new c(d!==0?d/0:0,f!==0?-f/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var d=this.re,f=this.im,h=d*d+f*f;return new c(d/h,-f/h)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(d){return d=Math.pow(10,d||0),new c(Math.ceil(this.re*d)/d,Math.ceil(this.im*d)/d)},floor:function(d){return d=Math.pow(10,d||0),new c(Math.floor(this.re*d)/d,Math.floor(this.im*d)/d)},round:function(d){return d=Math.pow(10,d||0),new c(Math.round(this.re*d)/d,Math.round(this.im*d)/d)},equals:function(d,f){var h=new c(d,f);return Math.abs(h.re-this.re)<=c.EPSILON&&Math.abs(h.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var d=this.re,f=this.im,h="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(d)(Object.defineProperty(ki,"name",{value:"Complex"}),ki.prototype.constructor=ki,ki.prototype.type="Complex",ki.prototype.isComplex=!0,ki.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},ki.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},ki.prototype.format=function(t){var e="",n=this.im,r=this.re,i=hD(this.re,t),o=hD(this.im,t),s=Qn(t)?t:t?t.precision:null;if(s!==null){var a=Math.pow(10,-s);Math.abs(r/n)e.re?1:t.ree.im?1:t.im0&&a();break;case"number":h.im=0,h.re=d;break;default:a()}return isNaN(h.re)||isNaN(h.im),h};function c(d,f){if(!(this instanceof c))return new c(d,f);var h=u(d,f);this.re=h.re,this.im=h.im}c.prototype={re:0,im:0,sign:function(){var d=this.abs();return new c(this.re/d,this.im/d)},add:function(d,f){var h=new c(d,f);return this.isInfinite()&&h.isInfinite()?c.NAN:this.isInfinite()||h.isInfinite()?c.INFINITY:new c(this.re+h.re,this.im+h.im)},sub:function(d,f){var h=new c(d,f);return this.isInfinite()&&h.isInfinite()?c.NAN:this.isInfinite()||h.isInfinite()?c.INFINITY:new c(this.re-h.re,this.im-h.im)},mul:function(d,f){var h=new c(d,f);return this.isInfinite()&&h.isZero()||this.isZero()&&h.isInfinite()?c.NAN:this.isInfinite()||h.isInfinite()?c.INFINITY:h.im===0&&this.im===0?new c(this.re*h.re,0):new c(this.re*h.re-this.im*h.im,this.re*h.im+this.im*h.re)},div:function(d,f){var h=new c(d,f);if(this.isZero()&&h.isZero()||this.isInfinite()&&h.isInfinite())return c.NAN;if(this.isInfinite()||h.isZero())return c.INFINITY;if(this.isZero()||h.isInfinite())return c.ZERO;d=this.re,f=this.im;var p=h.re,g=h.im,b,m;return g===0?new c(d/p,f/p):Math.abs(p)0)return new c(Math.pow(d,h.re),0);if(d===0)switch((h.re%4+4)%4){case 0:return new c(Math.pow(f,h.re),0);case 1:return new c(0,Math.pow(f,h.re));case 2:return new c(-Math.pow(f,h.re),0);case 3:return new c(0,-Math.pow(f,h.re))}}if(d===0&&f===0&&h.re>0&&h.im>=0)return c.ZERO;var p=Math.atan2(f,d),g=l(d,f);return d=Math.exp(h.re*g-h.im*p),f=h.im*g+h.re*p,new c(d*Math.cos(f),d*Math.sin(f))},sqrt:function(){var d=this.re,f=this.im,h=this.abs(),p,g;if(d>=0){if(f===0)return new c(Math.sqrt(d),0);p=.5*Math.sqrt(2*(h+d))}else p=Math.abs(f)/Math.sqrt(2*(h-d));return d<=0?g=.5*Math.sqrt(2*(h-d)):g=Math.abs(f)/Math.sqrt(2*(h+d)),new c(p,f<0?-g:g)},exp:function(){var d=Math.exp(this.re);return this.im,new c(d*Math.cos(this.im),d*Math.sin(this.im))},expm1:function(){var d=this.re,f=this.im;return new c(Math.expm1(d)*Math.cos(f)+o(f),Math.exp(d)*Math.sin(f))},log:function(){var d=this.re,f=this.im;return new c(l(d,f),Math.atan2(f,d))},abs:function(){return s(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var d=this.re,f=this.im;return new c(Math.sin(d)*r(f),Math.cos(d)*i(f))},cos:function(){var d=this.re,f=this.im;return new c(Math.cos(d)*r(f),-Math.sin(d)*i(f))},tan:function(){var d=2*this.re,f=2*this.im,h=Math.cos(d)+r(f);return new c(Math.sin(d)/h,i(f)/h)},cot:function(){var d=2*this.re,f=2*this.im,h=Math.cos(d)-r(f);return new c(-Math.sin(d)/h,i(f)/h)},sec:function(){var d=this.re,f=this.im,h=.5*r(2*f)+.5*Math.cos(2*d);return new c(Math.cos(d)*r(f)/h,Math.sin(d)*i(f)/h)},csc:function(){var d=this.re,f=this.im,h=.5*r(2*f)-.5*Math.cos(2*d);return new c(Math.sin(d)*r(f)/h,-Math.cos(d)*i(f)/h)},asin:function(){var d=this.re,f=this.im,h=new c(f*f-d*d+1,-2*d*f).sqrt(),p=new c(h.re-f,h.im+d).log();return new c(p.im,-p.re)},acos:function(){var d=this.re,f=this.im,h=new c(f*f-d*d+1,-2*d*f).sqrt(),p=new c(h.re-f,h.im+d).log();return new c(Math.PI/2-p.im,p.re)},atan:function(){var d=this.re,f=this.im;if(d===0){if(f===1)return new c(0,1/0);if(f===-1)return new c(0,-1/0)}var h=d*d+(1-f)*(1-f),p=new c((1-f*f-d*d)/h,-2*d/h).log();return new c(-.5*p.im,.5*p.re)},acot:function(){var d=this.re,f=this.im;if(f===0)return new c(Math.atan2(1,d),0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).atan():new c(d!==0?d/0:0,f!==0?-f/0:0).atan()},asec:function(){var d=this.re,f=this.im;if(d===0&&f===0)return new c(0,1/0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).acos():new c(d!==0?d/0:0,f!==0?-f/0:0).acos()},acsc:function(){var d=this.re,f=this.im;if(d===0&&f===0)return new c(Math.PI/2,1/0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).asin():new c(d!==0?d/0:0,f!==0?-f/0:0).asin()},sinh:function(){var d=this.re,f=this.im;return new c(i(d)*Math.cos(f),r(d)*Math.sin(f))},cosh:function(){var d=this.re,f=this.im;return new c(r(d)*Math.cos(f),i(d)*Math.sin(f))},tanh:function(){var d=2*this.re,f=2*this.im,h=r(d)+Math.cos(f);return new c(i(d)/h,Math.sin(f)/h)},coth:function(){var d=2*this.re,f=2*this.im,h=r(d)-Math.cos(f);return new c(i(d)/h,-Math.sin(f)/h)},csch:function(){var d=this.re,f=this.im,h=Math.cos(2*f)-r(2*d);return new c(-2*i(d)*Math.cos(f)/h,2*r(d)*Math.sin(f)/h)},sech:function(){var d=this.re,f=this.im,h=Math.cos(2*f)+r(2*d);return new c(2*r(d)*Math.cos(f)/h,-2*i(d)*Math.sin(f)/h)},asinh:function(){var d=this.im;this.im=-this.re,this.re=d;var f=this.asin();return this.re=-this.im,this.im=d,d=f.re,f.re=-f.im,f.im=d,f},acosh:function(){var d=this.acos();if(d.im<=0){var f=d.re;d.re=-d.im,d.im=f}else{var f=d.im;d.im=-d.re,d.re=f}return d},atanh:function(){var d=this.re,f=this.im,h=d>1&&f===0,p=1-d,g=1+d,b=p*p+f*f,m=b!==0?new c((g*p-f*f)/b,(f*p+g*f)/b):new c(d!==-1?d/0:0,f!==0?f/0:0),w=m.re;return m.re=l(m.re,m.im)/2,m.im=Math.atan2(m.im,w)/2,h&&(m.im=-m.im),m},acoth:function(){var d=this.re,f=this.im;if(d===0&&f===0)return new c(0,Math.PI/2);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).atanh():new c(d!==0?d/0:0,f!==0?-f/0:0).atanh()},acsch:function(){var d=this.re,f=this.im;if(f===0)return new c(d!==0?Math.log(d+Math.sqrt(d*d+1)):1/0,0);var h=d*d+f*f;return h!==0?new c(d/h,-f/h).asinh():new c(d!==0?d/0:0,f!==0?-f/0:0).asinh()},asech:function(){var d=this.re,f=this.im;if(this.isZero())return c.INFINITY;var h=d*d+f*f;return h!==0?new c(d/h,-f/h).acosh():new c(d!==0?d/0:0,f!==0?-f/0:0).acosh()},inverse:function(){if(this.isZero())return c.INFINITY;if(this.isInfinite())return c.ZERO;var d=this.re,f=this.im,h=d*d+f*f;return new c(d/h,-f/h)},conjugate:function(){return new c(this.re,-this.im)},neg:function(){return new c(-this.re,-this.im)},ceil:function(d){return d=Math.pow(10,d||0),new c(Math.ceil(this.re*d)/d,Math.ceil(this.im*d)/d)},floor:function(d){return d=Math.pow(10,d||0),new c(Math.floor(this.re*d)/d,Math.floor(this.im*d)/d)},round:function(d){return d=Math.pow(10,d||0),new c(Math.round(this.re*d)/d,Math.round(this.im*d)/d)},equals:function(d,f){var h=new c(d,f);return Math.abs(h.re-this.re)<=c.EPSILON&&Math.abs(h.im-this.im)<=c.EPSILON},clone:function(){return new c(this.re,this.im)},toString:function(){var d=this.re,f=this.im,h="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(d)(Object.defineProperty(ki,"name",{value:"Complex"}),ki.prototype.constructor=ki,ki.prototype.type="Complex",ki.prototype.isComplex=!0,ki.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},ki.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},ki.prototype.format=function(t){var e="",n=this.im,r=this.re,i=hD(this.re,t),o=hD(this.im,t),s=Qn(t)?t:t?t.precision:null;if(s!==null){var a=Math.pow(10,-s);Math.abs(r/n)e.re?1:t.ree.im?1:t.im1&&(w[x]=(w[x]||0)+1):w[m]=(w[m]||0)+1,w}var l=function(m,w){var x=0,_=1,C=1,S=0,M=0,P=0,A=1,R=1,F=0,$=1,j=1,k=1,U=1e7,G;if(m!=null)if(w!==void 0){if(x=m,_=w,C=x*_,x%1!==0||_%1!==0)throw b()}else switch(typeof m){case"object":{if("d"in m&&"n"in m)x=m.n,_=m.d,"s"in m&&(x*=m.s);else if(0 in m)x=m[0],1 in m&&(_=m[1]);else throw g();C=x*_;break}case"number":{if(m<0&&(C=m,m=-m),m%1===0)x=m;else if(m>0){for(m>=1&&(R=Math.pow(10,Math.floor(1+Math.log(m)/Math.LN10)),m/=R);$<=U&&k<=U;)if(G=(F+j)/($+k),m===G){$+k<=U?(x=F+j,_=$+k):k>$?(x=j,_=k):(x=F,_=$);break}else m>G?(F+=j,$+=k):(j+=F,k+=$),$>U?(x=j,_=k):(x=F,_=$);x*=R}else(isNaN(m)||isNaN(w))&&(_=x=NaN);break}case"string":{if($=m.match(/\d+|./g),$===null)throw g();if($[F]==="-"?(C=-1,F++):$[F]==="+"&&F++,$.length===F+1?M=o($[F++],C):$[F+1]==="."||$[F]==="."?($[F]!=="."&&(S=o($[F++],C)),F++,(F+1===$.length||$[F+1]==="("&&$[F+3]===")"||$[F+1]==="'"&&$[F+3]==="'")&&(M=o($[F],C),A=Math.pow(10,$[F].length),F++),($[F]==="("&&$[F+2]===")"||$[F]==="'"&&$[F+2]==="'")&&(P=o($[F+1],C),R=Math.pow(10,$[F+1].length)-1,F+=3)):$[F+1]==="/"||$[F+1]===":"?(M=o($[F],C),A=o($[F+2],1),F+=3):$[F+3]==="/"&&$[F+1]===" "&&(S=o($[F],C),M=o($[F+2],C),A=o($[F+4],1),F+=5),$.length<=F){_=A*R,C=x=P+_*S+R*M;break}}default:throw g()}if(_===0)throw p();i.s=C<0?-1:1,i.n=Math.abs(x),i.d=Math.abs(_)};function u(m,w,x){for(var _=1;w>0;m=m*m%x,w>>=1)w&1&&(_=_*m%x);return _}function c(m,w){for(;w%2===0;w/=2);for(;w%5===0;w/=5);if(w===1)return 0;for(var x=10%w,_=1;x!==1;_++)if(x=x*10%w,_>r)return 0;return _}function d(m,w,x){for(var _=1,C=u(10,x,w),S=0;S<300;S++){if(_===C)return S;_=_*10%w,C=C*10%w}return 0}function f(m,w){if(!m)return w;if(!w)return m;for(;;){if(m%=w,!m)return w;if(w%=m,!w)return m}}function h(m,w){if(l(m,w),this instanceof h)m=f(i.d,i.n),this.s=i.s,this.n=i.n/m,this.d=i.d/m;else return s(i.s*i.n,i.d)}var p=function(){return new Error("Division by Zero")},g=function(){return new Error("Invalid argument")},b=function(){return new Error("Parameters must be integer")};h.prototype={s:1,n:0,d:1,abs:function(){return s(this.n,this.d)},neg:function(){return s(-this.s*this.n,this.d)},add:function(m,w){return l(m,w),s(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(m,w){return l(m,w),s(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(m,w){return l(m,w),s(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(m,w){return l(m,w),s(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return s(this.s*this.n,this.d)},mod:function(m,w){if(isNaN(this.n)||isNaN(this.d))return new h(NaN);if(m===void 0)return s(this.s*this.n%this.d,1);if(l(m,w),i.n===0&&this.d===0)throw p();return s(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(m,w){return l(m,w),s(f(i.n,this.n)*f(i.d,this.d),i.d*this.d)},lcm:function(m,w){return l(m,w),i.n===0&&this.n===0?s(0,1):s(i.n*this.n,f(i.n,this.n)*f(i.d,this.d))},ceil:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):s(Math.ceil(m*this.s*this.n/this.d),m)},floor:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):s(Math.floor(m*this.s*this.n/this.d),m)},round:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):s(Math.round(m*this.s*this.n/this.d),m)},inverse:function(){return s(this.s*this.d,this.n)},pow:function(m,w){if(l(m,w),i.d===1)return i.s<0?s(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):s(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var x=a(this.n),_=a(this.d),C=1,S=1;for(var M in x)if(M!=="1"){if(M==="0"){C=0;break}if(x[M]*=i.n,x[M]%i.d===0)x[M]/=i.d;else return null;C*=Math.pow(M,x[M])}for(var M in _)if(M!=="1"){if(_[M]*=i.n,_[M]%i.d===0)_[M]/=i.d;else return null;S*=Math.pow(M,_[M])}return i.s<0?s(S,C):s(C,S)},equals:function(m,w){return l(m,w),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(m,w){l(m,w);var x=this.s*this.n*i.d-i.s*i.n*this.d;return(0=0;S--)C=C.inverse().add(x[S]);if(Math.abs(C.sub(w).valueOf())0&&(x+=w,x+=" ",_%=C),x+=_,x+="/",x+=C),x},toLatex:function(m){var w,x="",_=this.n,C=this.d;return this.s<0&&(x+="-"),C===1?x+=_:(m&&(w=Math.floor(_/C))>0&&(x+=w,_%=C),x+="\\frac{",x+=_,x+="}{",x+=C,x+="}"),x},toContinued:function(){var m,w=this.n,x=this.d,_=[];if(isNaN(w)||isNaN(x))return _;do _.push(Math.floor(w/x)),m=w%x,w=x,x=m;while(w!==1);return _},toString:function(m){var w=this.n,x=this.d;if(isNaN(w)||isNaN(x))return"NaN";m=m||15;var _=c(w,x),C=d(w,x,_),S=this.s<0?"-":"";if(S+=w/x|0,w%=x,w*=10,w&&(S+="."),_){for(var M=C;M--;)S+=w/x|0,w%=x,w*=10;S+="(";for(var M=_;M--;)S+=w/x|0,w%=x,w*=10;S+=")"}else for(var M=m;w&&M--;)S+=w/x|0,w%=x,w*=10;return S}},Object.defineProperty(h,"__esModule",{value:!0}),h.default=h,h.Fraction=h,t.exports=h})()})(KG);var Dge=KG.exports;const ou=ya(Dge);var Rge="Fraction",Ige=[],Nge=dt(Rge,Ige,()=>(Object.defineProperty(ou,"name",{value:"Fraction"}),ou.prototype.constructor=ou,ou.prototype.type="Fraction",ou.prototype.isFraction=!0,ou.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},ou.fromJSON=function(t){return new ou(t)},ou),{isClass:!0}),Fge="Matrix",Oge=[],kge=dt(Fge,Oge,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,n,r){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function Lge(t){var e=0,n=1,r=Object.create(null),i=Object.create(null),o=0,s=function(l){var u=i[l];if(u&&(delete r[u],delete i[l],--e,n===u)){if(!e){o=0,n=1;return}for(;!Object.prototype.hasOwnProperty.call(r,++n););}};return t=Math.abs(t),{hit:function(l){var u=i[l],c=++o;if(r[c]=l,i[l]=c,!u)return++e,e<=t?void 0:(l=r[n],s(l),l);if(delete r[u],n===u)for(;!Object.prototype.hasOwnProperty.call(r,++n););},delete:s,clear:function(){e=o=0,n=1,r=Object.create(null),i=Object.create(null)}}}function db(t){var{hasher:e,limit:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=n??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function r(){typeof r.cache!="object"&&(r.cache={values:new Map,lru:Lge(n||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o{var{Matrix:e}=t;function n(c,d){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(d&&!_l(d))throw new Error("Invalid datatype: "+d);if(Or(c))c.type==="DenseMatrix"?(this._data=dr(c._data),this._size=dr(c._size),this._datatype=d||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=d||c._datatype);else if(c&&gr(c.data)&&gr(c.size))this._data=c.data,this._size=c.size,yB(this._data,this._size),this._datatype=d||c.datatype;else if(gr(c))this._data=u(c),this._size=To(this._data),yB(this._data,this._size),this._datatype=d;else{if(c)throw new TypeError("Unsupported type of data ("+aa(c)+")");this._data=[],this._size=[0],this._datatype=d}}n.prototype=new e,n.prototype.createDenseMatrix=function(c,d){return new n(c,d)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Z_(this._data,aa)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,d){return new n(c,d)},n.prototype.subset=function(c,d,f){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return o(this,c,d,f);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){if(!gr(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new Rn(c.length,this._size.length);for(var d=0;d");var x=d.max().map(function(S){return S+1});l(c,x,h);var _=p.length,C=0;s(c._data,d,f,_,C)}return c}function s(c,d,f,h,p){var g=p===h-1,b=d.dimension(p);g?b.forEach(function(m,w){vr(m),c[m]=f[w[0]]}):b.forEach(function(m,w){vr(m),s(c[m],d,f[w[0]],h,p+1)})}n.prototype.resize=function(c,d,f){if(!dy(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),p=f?this.clone():this;return a(p,h,d)};function a(c,d,f){if(d.length===0){for(var h=c._data;gr(h);)h=h[0];return h}return c._size=d.slice(0),c._data=Y_(c._data,c._size,f),c}n.prototype.reshape=function(c,d){var f=d?this.clone():this;f._data=AG(f._data,c);var h=f._size.reduce((p,g)=>p*g);return f._size=tN(c,h),f};function l(c,d,f){for(var h=c._size.slice(0),p=!1;h.lengthh[g]&&(h[g]=d[g],p=!0);p&&a(c,h,f)}n.prototype.clone=function(){var c=new n({data:dr(this._data),size:dr(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var d=this,f=YG(c),h=function b(m,w){return gr(m)?m.map(function(x,_){return b(x,w.concat(_))}):f===1?c(m):f===2?c(m,w):c(m,w,d)},p=h(this._data,[]),g=this._datatype!==void 0?Z_(p,aa):void 0;return new n(p,g)},n.prototype.forEach=function(c){var d=this,f=function h(p,g){gr(p)?p.forEach(function(b,m){h(b,g.concat(m))}):c(p,g,d)};f(this._data,[])},n.prototype[Symbol.iterator]=function*(){var c=function*d(f,h){if(gr(f))for(var p=0;p[x[m]]);d.push(new n(w,c._datatype))},g=0;g0?c:0,f=c<0?-c:0,h=this._size[0],p=this._size[1],g=Math.min(h-f,p-d),b=[],m=0;m0?f:0,g=f<0?-f:0,b=c[0],m=c[1],w=Math.min(b-g,m-p),x;if(gr(d)){if(d.length!==w)throw new Error("Invalid value array length");x=function(P){return d[P]}}else if(Or(d)){var _=d.size();if(_.length!==1||_[0]!==w)throw new Error("Invalid matrix length");x=function(P){return d.get([P])}}else x=function(){return d};h||(h=kr(x(0))?x(0).mul(0):0);var C=[];if(c.length>0){C=Y_(C,c,h);for(var S=0;S=r.length)throw new wd(e,r.length);return Or(t)?t.create(nS(t.valueOf(),e,n)):nS(t,e,n)}function nS(t,e,n){var r,i,o,s;if(e<=0)if(Array.isArray(t[0])){for(s=Uge(t),i=[],r=0;r{var{typed:e}=t;return e(SB,{number:or,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),JG="number",cE="number, number";function ej(t){return Math.abs(t)}ej.signature=JG;function tj(t,e){return t+e}tj.signature=cE;function nj(t,e){return t-e}nj.signature=cE;function rj(t,e){return t*e}rj.signature=cE;function ij(t){return-t}ij.signature=JG;function oj(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}oj.signature=cE;function m0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!or(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(CG(t,e))}var Gge="number";function sj(t){return t===0}sj.signature=Gge;var CB="isNumeric",jge=["typed"],Wge=dt(CB,jge,t=>{var{typed:e}=t;return e(CB,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),EB="isZero",qge=["typed"],Xge=dt(EB,qge,t=>{var{typed:e}=t;return e(EB,{number:sj,BigNumber:function(r){return r.isZero()},Complex:function(r){return r.re===0&&r.im===0},Fraction:function(r){return r.d===1&&r.n===0},Unit:e.referToSelf(n=>r=>e.find(n,r.valueType())(r.value)),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})});function Ya(t,e,n){if(n==null)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var r=t.minus(e).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),e.abs());return r.lte(i.times(n))}return!1}function Kge(t,e,n){return Jo(t.re,e.re,n)&&Jo(t.im,e.im,n)}var fb=dt("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(!r.equalBase(i))throw new Error("Cannot compare units with different base");return e.find(n,[r.valueType(),i.valueType()])(r.value,i.value)})}}),rS="equalScalar",Yge=["typed","config"],Zge=dt(rS,Yge,t=>{var{typed:e,config:n}=t,r=fb({typed:e});return e(rS,{"boolean, boolean":function(o,s){return o===s},"number, number":function(o,s){return Jo(o,s,n.epsilon)},"BigNumber, BigNumber":function(o,s){return o.eq(s)||Ya(o,s,n.epsilon)},"Fraction, Fraction":function(o,s){return o.equals(s)},"Complex, Complex":function(o,s){return Kge(o,s,n.epsilon)}},r)});dt(rS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(rS,{"number, number":function(i,o){return Jo(i,o,n.epsilon)}})});var Qge="SparseMatrix",Jge=["typed","equalScalar","Matrix"],e0e=dt(Qge,Jge,t=>{var{typed:e,equalScalar:n,Matrix:r}=t;function i(g,b){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(b&&!_l(b))throw new Error("Invalid datatype: "+b);if(Or(g))o(this,g,b);else if(g&&gr(g.index)&&gr(g.ptr)&&gr(g.size))this._values=g.values,this._index=g.index,this._ptr=g.ptr,this._size=g.size,this._datatype=b||g.datatype;else if(gr(g))s(this,g,b);else{if(g)throw new TypeError("Unsupported type of data ("+aa(g)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=b}}function o(g,b,m){b.type==="SparseMatrix"?(g._values=b._values?dr(b._values):void 0,g._index=dr(b._index),g._ptr=dr(b._ptr),g._size=dr(b._size),g._datatype=m||b._datatype):s(g,b.valueOf(),m||b._datatype)}function s(g,b,m){g._values=[],g._index=[],g._ptr=[],g._datatype=m;var w=b.length,x=0,_=n,C=0;if(_l(m)&&(_=e.find(n,[m,m])||n,C=e.convert(0,m)),w>0){var S=0;do{g._ptr.push(g._index.length);for(var M=0;M");if(x.length===1){var P=b.dimension(0);P.forEach(function(F,$){vr(F),g.set([F,0],m[$[0]],w)})}else{var A=b.dimension(0),R=b.dimension(1);A.forEach(function(F,$){vr(F),R.forEach(function(j,k){vr(j),g.set([F,j],m[$[0]][k[0]],w)})})}}return g}i.prototype.get=function(g){if(!gr(g))throw new TypeError("Array expected");if(g.length!==this._size.length)throw new Rn(g.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var b=g[0],m=g[1];vr(b,this._size[0]),vr(m,this._size[1]);var w=u(b,this._ptr[m],this._ptr[m+1],this._index);return w_-1||x>C-1)&&(f(this,Math.max(w+1,_),Math.max(x+1,C),m),_=this._size[0],C=this._size[1]),vr(w,_),vr(x,C);var P=u(w,this._ptr[x],this._ptr[x+1],this._index);return PArray.isArray(_)&&_.length===1?_[0]:_);if(w.length!==2)throw new Error("Only two dimensions matrix are supported");w.forEach(function(_){if(!Qn(_)||!or(_)||_<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ir(w)+")")});var x=m?this.clone():this;return f(x,w[0],w[1],b)};function f(g,b,m,w){var x=w||0,_=n,C=0;_l(g._datatype)&&(_=e.find(n,[g._datatype,g._datatype])||n,C=e.convert(0,g._datatype),x=e.convert(x,g._datatype));var S=!_(x,C),M=g._size[0],P=g._size[1],A,R,F;if(m>P){for(R=P;RM){if(S){var $=0;for(R=0;Rb-1&&(g._values.splice(F,1),g._index.splice(F,1),k++)}g._ptr[R]=g._values.length}return g._size[0]=b,g._size[1]=m,g}i.prototype.reshape=function(g,b){if(!gr(g))throw new TypeError("Array expected");if(g.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");g.forEach(function(N){if(!Qn(N)||!or(N)||N<=-2||N===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ir(g)+")")});var m=this._size[0]*this._size[1];g=tN(g,m);var w=g[0]*g[1];if(m!==w)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var x=b?this.clone():this;if(this._size[0]===g[0]&&this._size[1]===g[1])return x;for(var _=[],C=0;C=b&&G<=m&&F(g._values[U],G-b,$-w)}else{for(var B={},L=j;L1&&(w[x]=(w[x]||0)+1):w[m]=(w[m]||0)+1,w}var l=function(m,w){var x=0,_=1,C=1,S=0,M=0,P=0,A=1,R=1,F=0,$=1,j=1,k=1,U=1e7,G;if(m!=null)if(w!==void 0){if(x=m,_=w,C=x*_,x%1!==0||_%1!==0)throw b()}else switch(typeof m){case"object":{if("d"in m&&"n"in m)x=m.n,_=m.d,"s"in m&&(x*=m.s);else if(0 in m)x=m[0],1 in m&&(_=m[1]);else throw g();C=x*_;break}case"number":{if(m<0&&(C=m,m=-m),m%1===0)x=m;else if(m>0){for(m>=1&&(R=Math.pow(10,Math.floor(1+Math.log(m)/Math.LN10)),m/=R);$<=U&&k<=U;)if(G=(F+j)/($+k),m===G){$+k<=U?(x=F+j,_=$+k):k>$?(x=j,_=k):(x=F,_=$);break}else m>G?(F+=j,$+=k):(j+=F,k+=$),$>U?(x=j,_=k):(x=F,_=$);x*=R}else(isNaN(m)||isNaN(w))&&(_=x=NaN);break}case"string":{if($=m.match(/\d+|./g),$===null)throw g();if($[F]==="-"?(C=-1,F++):$[F]==="+"&&F++,$.length===F+1?M=o($[F++],C):$[F+1]==="."||$[F]==="."?($[F]!=="."&&(S=o($[F++],C)),F++,(F+1===$.length||$[F+1]==="("&&$[F+3]===")"||$[F+1]==="'"&&$[F+3]==="'")&&(M=o($[F],C),A=Math.pow(10,$[F].length),F++),($[F]==="("&&$[F+2]===")"||$[F]==="'"&&$[F+2]==="'")&&(P=o($[F+1],C),R=Math.pow(10,$[F+1].length)-1,F+=3)):$[F+1]==="/"||$[F+1]===":"?(M=o($[F],C),A=o($[F+2],1),F+=3):$[F+3]==="/"&&$[F+1]===" "&&(S=o($[F],C),M=o($[F+2],C),A=o($[F+4],1),F+=5),$.length<=F){_=A*R,C=x=P+_*S+R*M;break}}default:throw g()}if(_===0)throw p();i.s=C<0?-1:1,i.n=Math.abs(x),i.d=Math.abs(_)};function u(m,w,x){for(var _=1;w>0;m=m*m%x,w>>=1)w&1&&(_=_*m%x);return _}function c(m,w){for(;w%2===0;w/=2);for(;w%5===0;w/=5);if(w===1)return 0;for(var x=10%w,_=1;x!==1;_++)if(x=x*10%w,_>r)return 0;return _}function d(m,w,x){for(var _=1,C=u(10,x,w),S=0;S<300;S++){if(_===C)return S;_=_*10%w,C=C*10%w}return 0}function f(m,w){if(!m)return w;if(!w)return m;for(;;){if(m%=w,!m)return w;if(w%=m,!w)return m}}function h(m,w){if(l(m,w),this instanceof h)m=f(i.d,i.n),this.s=i.s,this.n=i.n/m,this.d=i.d/m;else return s(i.s*i.n,i.d)}var p=function(){return new Error("Division by Zero")},g=function(){return new Error("Invalid argument")},b=function(){return new Error("Parameters must be integer")};h.prototype={s:1,n:0,d:1,abs:function(){return s(this.n,this.d)},neg:function(){return s(-this.s*this.n,this.d)},add:function(m,w){return l(m,w),s(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(m,w){return l(m,w),s(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(m,w){return l(m,w),s(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(m,w){return l(m,w),s(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return s(this.s*this.n,this.d)},mod:function(m,w){if(isNaN(this.n)||isNaN(this.d))return new h(NaN);if(m===void 0)return s(this.s*this.n%this.d,1);if(l(m,w),i.n===0&&this.d===0)throw p();return s(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(m,w){return l(m,w),s(f(i.n,this.n)*f(i.d,this.d),i.d*this.d)},lcm:function(m,w){return l(m,w),i.n===0&&this.n===0?s(0,1):s(i.n*this.n,f(i.n,this.n)*f(i.d,this.d))},ceil:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):s(Math.ceil(m*this.s*this.n/this.d),m)},floor:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):s(Math.floor(m*this.s*this.n/this.d),m)},round:function(m){return m=Math.pow(10,m||0),isNaN(this.n)||isNaN(this.d)?new h(NaN):s(Math.round(m*this.s*this.n/this.d),m)},inverse:function(){return s(this.s*this.d,this.n)},pow:function(m,w){if(l(m,w),i.d===1)return i.s<0?s(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):s(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var x=a(this.n),_=a(this.d),C=1,S=1;for(var M in x)if(M!=="1"){if(M==="0"){C=0;break}if(x[M]*=i.n,x[M]%i.d===0)x[M]/=i.d;else return null;C*=Math.pow(M,x[M])}for(var M in _)if(M!=="1"){if(_[M]*=i.n,_[M]%i.d===0)_[M]/=i.d;else return null;S*=Math.pow(M,_[M])}return i.s<0?s(S,C):s(C,S)},equals:function(m,w){return l(m,w),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(m,w){l(m,w);var x=this.s*this.n*i.d-i.s*i.n*this.d;return(0=0;S--)C=C.inverse().add(x[S]);if(Math.abs(C.sub(w).valueOf())0&&(x+=w,x+=" ",_%=C),x+=_,x+="/",x+=C),x},toLatex:function(m){var w,x="",_=this.n,C=this.d;return this.s<0&&(x+="-"),C===1?x+=_:(m&&(w=Math.floor(_/C))>0&&(x+=w,_%=C),x+="\\frac{",x+=_,x+="}{",x+=C,x+="}"),x},toContinued:function(){var m,w=this.n,x=this.d,_=[];if(isNaN(w)||isNaN(x))return _;do _.push(Math.floor(w/x)),m=w%x,w=x,x=m;while(w!==1);return _},toString:function(m){var w=this.n,x=this.d;if(isNaN(w)||isNaN(x))return"NaN";m=m||15;var _=c(w,x),C=d(w,x,_),S=this.s<0?"-":"";if(S+=w/x|0,w%=x,w*=10,w&&(S+="."),_){for(var M=C;M--;)S+=w/x|0,w%=x,w*=10;S+="(";for(var M=_;M--;)S+=w/x|0,w%=x,w*=10;S+=")"}else for(var M=m;w&&M--;)S+=w/x|0,w%=x,w*=10;return S}},Object.defineProperty(h,"__esModule",{value:!0}),h.default=h,h.Fraction=h,t.exports=h})()})(KG);var Dge=KG.exports;const ou=va(Dge);var Rge="Fraction",Ige=[],Nge=dt(Rge,Ige,()=>(Object.defineProperty(ou,"name",{value:"Fraction"}),ou.prototype.constructor=ou,ou.prototype.type="Fraction",ou.prototype.isFraction=!0,ou.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},ou.fromJSON=function(t){return new ou(t)},ou),{isClass:!0}),Fge="Matrix",Oge=[],kge=dt(Fge,Oge,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,n,r){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,n,r){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function Lge(t){var e=0,n=1,r=Object.create(null),i=Object.create(null),o=0,s=function(l){var u=i[l];if(u&&(delete r[u],delete i[l],--e,n===u)){if(!e){o=0,n=1;return}for(;!Object.prototype.hasOwnProperty.call(r,++n););}};return t=Math.abs(t),{hit:function(l){var u=i[l],c=++o;if(r[c]=l,i[l]=c,!u)return++e,e<=t?void 0:(l=r[n],s(l),l);if(delete r[u],n===u)for(;!Object.prototype.hasOwnProperty.call(r,++n););},delete:s,clear:function(){e=o=0,n=1,r=Object.create(null),i=Object.create(null)}}}function db(t){var{hasher:e,limit:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=n??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function r(){typeof r.cache!="object"&&(r.cache={values:new Map,lru:Lge(n||Number.POSITIVE_INFINITY)});for(var i=[],o=0;o{var{Matrix:e}=t;function n(c,d){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(d&&!wl(d))throw new Error("Invalid datatype: "+d);if(Or(c))c.type==="DenseMatrix"?(this._data=dr(c._data),this._size=dr(c._size),this._datatype=d||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=d||c._datatype);else if(c&&gr(c.data)&&gr(c.size))this._data=c.data,this._size=c.size,yB(this._data,this._size),this._datatype=d||c.datatype;else if(gr(c))this._data=u(c),this._size=To(this._data),yB(this._data,this._size),this._datatype=d;else{if(c)throw new TypeError("Unsupported type of data ("+aa(c)+")");this._data=[],this._size=[0],this._datatype=d}}n.prototype=new e,n.prototype.createDenseMatrix=function(c,d){return new n(c,d)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Z_(this._data,aa)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(c,d){return new n(c,d)},n.prototype.subset=function(c,d,f){switch(arguments.length){case 1:return r(this,c);case 2:case 3:return o(this,c,d,f);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(c){if(!gr(c))throw new TypeError("Array expected");if(c.length!==this._size.length)throw new Rn(c.length,this._size.length);for(var d=0;d");var x=d.max().map(function(S){return S+1});l(c,x,h);var _=p.length,C=0;s(c._data,d,f,_,C)}return c}function s(c,d,f,h,p){var g=p===h-1,b=d.dimension(p);g?b.forEach(function(m,w){vr(m),c[m]=f[w[0]]}):b.forEach(function(m,w){vr(m),s(c[m],d,f[w[0]],h,p+1)})}n.prototype.resize=function(c,d,f){if(!dy(c))throw new TypeError("Array or Matrix expected");var h=c.valueOf().map(g=>Array.isArray(g)&&g.length===1?g[0]:g),p=f?this.clone():this;return a(p,h,d)};function a(c,d,f){if(d.length===0){for(var h=c._data;gr(h);)h=h[0];return h}return c._size=d.slice(0),c._data=Y_(c._data,c._size,f),c}n.prototype.reshape=function(c,d){var f=d?this.clone():this;f._data=AG(f._data,c);var h=f._size.reduce((p,g)=>p*g);return f._size=tN(c,h),f};function l(c,d,f){for(var h=c._size.slice(0),p=!1;h.lengthh[g]&&(h[g]=d[g],p=!0);p&&a(c,h,f)}n.prototype.clone=function(){var c=new n({data:dr(this._data),size:dr(this._size),datatype:this._datatype});return c},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(c){var d=this,f=YG(c),h=function b(m,w){return gr(m)?m.map(function(x,_){return b(x,w.concat(_))}):f===1?c(m):f===2?c(m,w):c(m,w,d)},p=h(this._data,[]),g=this._datatype!==void 0?Z_(p,aa):void 0;return new n(p,g)},n.prototype.forEach=function(c){var d=this,f=function h(p,g){gr(p)?p.forEach(function(b,m){h(b,g.concat(m))}):c(p,g,d)};f(this._data,[])},n.prototype[Symbol.iterator]=function*(){var c=function*d(f,h){if(gr(f))for(var p=0;p[x[m]]);d.push(new n(w,c._datatype))},g=0;g0?c:0,f=c<0?-c:0,h=this._size[0],p=this._size[1],g=Math.min(h-f,p-d),b=[],m=0;m0?f:0,g=f<0?-f:0,b=c[0],m=c[1],w=Math.min(b-g,m-p),x;if(gr(d)){if(d.length!==w)throw new Error("Invalid value array length");x=function(P){return d[P]}}else if(Or(d)){var _=d.size();if(_.length!==1||_[0]!==w)throw new Error("Invalid matrix length");x=function(P){return d.get([P])}}else x=function(){return d};h||(h=kr(x(0))?x(0).mul(0):0);var C=[];if(c.length>0){C=Y_(C,c,h);for(var S=0;S=r.length)throw new wd(e,r.length);return Or(t)?t.create(nS(t.valueOf(),e,n)):nS(t,e,n)}function nS(t,e,n){var r,i,o,s;if(e<=0)if(Array.isArray(t[0])){for(s=Uge(t),i=[],r=0;r{var{typed:e}=t;return e(SB,{number:or,BigNumber:function(r){return r.isInt()},Fraction:function(r){return r.d===1&&isFinite(r.n)},"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),JG="number",cE="number, number";function ej(t){return Math.abs(t)}ej.signature=JG;function tj(t,e){return t+e}tj.signature=cE;function nj(t,e){return t-e}nj.signature=cE;function rj(t,e){return t*e}rj.signature=cE;function ij(t){return-t}ij.signature=JG;function oj(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}oj.signature=cE;function m0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!or(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(CG(t,e))}var Gge="number";function sj(t){return t===0}sj.signature=Gge;var CB="isNumeric",jge=["typed"],Wge=dt(CB,jge,t=>{var{typed:e}=t;return e(CB,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),EB="isZero",qge=["typed"],Xge=dt(EB,qge,t=>{var{typed:e}=t;return e(EB,{number:sj,BigNumber:function(r){return r.isZero()},Complex:function(r){return r.re===0&&r.im===0},Fraction:function(r){return r.d===1&&r.n===0},Unit:e.referToSelf(n=>r=>e.find(n,r.valueType())(r.value)),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})});function Ka(t,e,n){if(n==null)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var r=t.minus(e).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),e.abs());return r.lte(i.times(n))}return!1}function Kge(t,e,n){return Jo(t.re,e.re,n)&&Jo(t.im,e.im,n)}var fb=dt("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(!r.equalBase(i))throw new Error("Cannot compare units with different base");return e.find(n,[r.valueType(),i.valueType()])(r.value,i.value)})}}),rS="equalScalar",Yge=["typed","config"],Zge=dt(rS,Yge,t=>{var{typed:e,config:n}=t,r=fb({typed:e});return e(rS,{"boolean, boolean":function(o,s){return o===s},"number, number":function(o,s){return Jo(o,s,n.epsilon)},"BigNumber, BigNumber":function(o,s){return o.eq(s)||Ka(o,s,n.epsilon)},"Fraction, Fraction":function(o,s){return o.equals(s)},"Complex, Complex":function(o,s){return Kge(o,s,n.epsilon)}},r)});dt(rS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(rS,{"number, number":function(i,o){return Jo(i,o,n.epsilon)}})});var Qge="SparseMatrix",Jge=["typed","equalScalar","Matrix"],e0e=dt(Qge,Jge,t=>{var{typed:e,equalScalar:n,Matrix:r}=t;function i(g,b){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(b&&!wl(b))throw new Error("Invalid datatype: "+b);if(Or(g))o(this,g,b);else if(g&&gr(g.index)&&gr(g.ptr)&&gr(g.size))this._values=g.values,this._index=g.index,this._ptr=g.ptr,this._size=g.size,this._datatype=b||g.datatype;else if(gr(g))s(this,g,b);else{if(g)throw new TypeError("Unsupported type of data ("+aa(g)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=b}}function o(g,b,m){b.type==="SparseMatrix"?(g._values=b._values?dr(b._values):void 0,g._index=dr(b._index),g._ptr=dr(b._ptr),g._size=dr(b._size),g._datatype=m||b._datatype):s(g,b.valueOf(),m||b._datatype)}function s(g,b,m){g._values=[],g._index=[],g._ptr=[],g._datatype=m;var w=b.length,x=0,_=n,C=0;if(wl(m)&&(_=e.find(n,[m,m])||n,C=e.convert(0,m)),w>0){var S=0;do{g._ptr.push(g._index.length);for(var M=0;M");if(x.length===1){var P=b.dimension(0);P.forEach(function(F,$){vr(F),g.set([F,0],m[$[0]],w)})}else{var A=b.dimension(0),R=b.dimension(1);A.forEach(function(F,$){vr(F),R.forEach(function(j,k){vr(j),g.set([F,j],m[$[0]][k[0]],w)})})}}return g}i.prototype.get=function(g){if(!gr(g))throw new TypeError("Array expected");if(g.length!==this._size.length)throw new Rn(g.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var b=g[0],m=g[1];vr(b,this._size[0]),vr(m,this._size[1]);var w=u(b,this._ptr[m],this._ptr[m+1],this._index);return w_-1||x>C-1)&&(f(this,Math.max(w+1,_),Math.max(x+1,C),m),_=this._size[0],C=this._size[1]),vr(w,_),vr(x,C);var P=u(w,this._ptr[x],this._ptr[x+1],this._index);return PArray.isArray(_)&&_.length===1?_[0]:_);if(w.length!==2)throw new Error("Only two dimensions matrix are supported");w.forEach(function(_){if(!Qn(_)||!or(_)||_<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ir(w)+")")});var x=m?this.clone():this;return f(x,w[0],w[1],b)};function f(g,b,m,w){var x=w||0,_=n,C=0;wl(g._datatype)&&(_=e.find(n,[g._datatype,g._datatype])||n,C=e.convert(0,g._datatype),x=e.convert(x,g._datatype));var S=!_(x,C),M=g._size[0],P=g._size[1],A,R,F;if(m>P){for(R=P;RM){if(S){var $=0;for(R=0;Rb-1&&(g._values.splice(F,1),g._index.splice(F,1),k++)}g._ptr[R]=g._values.length}return g._size[0]=b,g._size[1]=m,g}i.prototype.reshape=function(g,b){if(!gr(g))throw new TypeError("Array expected");if(g.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");g.forEach(function(N){if(!Qn(N)||!or(N)||N<=-2||N===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ir(g)+")")});var m=this._size[0]*this._size[1];g=tN(g,m);var w=g[0]*g[1];if(m!==w)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var x=b?this.clone():this;if(this._size[0]===g[0]&&this._size[1]===g[1])return x;for(var _=[],C=0;C=b&&G<=m&&F(g._values[U],G-b,$-w)}else{for(var B={},L=j;L "+(this._values?Ir(this._values[M],g):"X")}return x},i.prototype.toString=function(){return Ir(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(g){if(g){if(kr(g)&&(g=g.toNumber()),!Qn(g)||!or(g))throw new TypeError("The parameter k must be an integer number")}else g=0;var b=g>0?g:0,m=g<0?-g:0,w=this._size[0],x=this._size[1],_=Math.min(w-m,x-b),C=[],S=[],M=[];M[0]=0;for(var P=b;P0?m:0,M=m<0?-m:0,P=g[0],A=g[1],R=Math.min(P-M,A-S),F;if(gr(b)){if(b.length!==R)throw new Error("Invalid value array length");F=function(W){return b[W]}}else if(Or(b)){var $=b.size();if($.length!==1||$[0]!==R)throw new Error("Invalid matrix length");F=function(W){return b.get([W])}}else F=function(){return b};for(var j=[],k=[],U=[],G=0;G=0&&B=M||x[A]!==b)){var F=w?w[P]:void 0;x.splice(A,0,b),w&&w.splice(A,0,F),x.splice(A<=P?P+1:P,1),w&&w.splice(A<=P?P+1:P,1);continue}if(A=M||x[P]!==g)){var $=w?w[A]:void 0;x.splice(P,0,g),w&&w.splice(P,0,$),x.splice(P<=A?A+1:A,1),w&&w.splice(P<=A?A+1:A,1)}}},i},{isClass:!0}),t0e="number",n0e=["typed"];function r0e(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var n={"0b":2,"0o":8,"0x":16}[e[1]],r=e[2],i=e[3];return{input:t,radix:n,integerPart:r,fractionalPart:i}}else return null}function i0e(t){for(var e=parseInt(t.integerPart,t.radix),n=0,r=0;r{var{typed:e}=t,n=e("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=r0e(i);if(o)return i0e(o);var s=0,a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);a&&(s=Number(a[2]),i=a[1]);var l=Number(i);if(isNaN(l))throw new SyntaxError('String "'+i+'" is not a valid number');if(a){if(l>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));l>=2**(s-1)&&(l=l-2**s)}return l},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))});return n.fromJSON=function(r){return parseFloat(r.value)},n}),s0e="bignumber",a0e=["typed","BigNumber"],l0e=dt(s0e,a0e,t=>{var{typed:e,BigNumber:n}=t;return e("bignumber",{"":function(){return new n(0)},number:function(i){return new n(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var s=o[2],a=n(o[1]),l=new n(2).pow(Number(s));if(a.gt(l.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var u=new n(2).pow(Number(s)-1);return a.gte(u)?a.sub(l):a}return new n(i)},BigNumber:function(i){return i},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),Fraction:function(i){return new n(i.n).div(i.d).times(i.s)},null:function(i){return new n(0)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))})}),u0e="fraction",c0e=["typed","Fraction"],d0e=dt(u0e,c0e,t=>{var{typed:e,Fraction:n}=t;return e("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new n(i)},string:function(i){return new n(i)},"number, number":function(i,o){return new n(i,o)},null:function(i){return new n(0)},BigNumber:function(i){return new n(i.toString())},Fraction:function(i){return i},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),Object:function(i){return new n(i)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))})}),MB="matrix",f0e=["typed","Matrix","DenseMatrix","SparseMatrix"],h0e=dt(MB,f0e,t=>{var{typed:e,Matrix:n,DenseMatrix:r,SparseMatrix:i}=t;return e(MB,{"":function(){return o([])},string:function(a){return o([],a)},"string, string":function(a,l){return o([],a,l)},Array:function(a){return o(a)},Matrix:function(a){return o(a,a.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(s,a,l){if(a==="dense"||a==="default"||a===void 0)return new r(s,l);if(a==="sparse")return new i(s,l);throw new TypeError("Unknown matrix type "+JSON.stringify(a)+".")}}),TB="unaryMinus",p0e=["typed"],m0e=dt(TB,p0e,t=>{var{typed:e}=t;return e(TB,{number:ij,"Complex | BigNumber | Fraction":n=>n.neg(),Unit:e.referToSelf(n=>r=>{var i=r.clone();return i.value=e.find(n,i.valueType())(r.value),i}),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),AB="abs",g0e=["typed"],v0e=dt(AB,g0e,t=>{var{typed:e}=t;return e(AB,{number:ej,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),PB="addScalar",y0e=["typed"],b0e=dt(PB,y0e,t=>{var{typed:e}=t;return e(PB,{"number, number":tj,"Complex, Complex":function(r,i){return r.add(i)},"BigNumber, BigNumber":function(r,i){return r.plus(i)},"Fraction, Fraction":function(r,i){return r.add(i)},"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var o=r.clone();return o.value=e.find(n,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),DB="subtractScalar",x0e=["typed"],w0e=dt(DB,x0e,t=>{var{typed:e}=t;return e(DB,{"number, number":nj,"Complex, Complex":function(r,i){return r.sub(i)},"BigNumber, BigNumber":function(r,i){return r.minus(i)},"Fraction, Fraction":function(r,i){return r.sub(i)},"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var o=r.clone();return o.value=e.find(n,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),_0e="matAlgo11xS0s",S0e=["typed","equalScalar"],hb=dt(_0e,S0e,t=>{var{typed:e,equalScalar:n}=t;return function(i,o,s,a){var l=i._values,u=i._index,c=i._ptr,d=i._size,f=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=d[0],p=d[1],g,b=n,m=0,w=s;typeof f=="string"&&(g=f,b=e.find(n,[g,g]),m=e.convert(0,g),o=e.convert(o,g),w=e.find(s,[g,g]));for(var x=[],_=[],C=[],S=0;S{var{typed:e,DenseMatrix:n}=t;return function(i,o,s,a){var l=i._values,u=i._index,c=i._ptr,d=i._size,f=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=d[0],p=d[1],g,b=s;typeof f=="string"&&(g=f,o=e.convert(o,g),b=e.find(s,[g,g]));for(var m=[],w=[],x=[],_=0;_{var{typed:e}=t;return function(i,o,s,a){var l=i._data,u=i._size,c=i._datatype,d,f=s;typeof c=="string"&&(d=c,o=e.convert(o,d),f=e.find(s,[d,d]));var h=u.length>0?n(f,0,u,u[0],l,o,a):[];return i.createDenseMatrix({data:h,size:dr(u),datatype:d})};function n(r,i,o,s,a,l,u){var c=[];if(i===o.length-1)for(var d=0;d{var{typed:e,config:n,round:r}=t;return e(xD,{number:function(o){return Jo(o,r(o),n.epsilon)?r(o):Math.ceil(o)},"number, number":function(o,s){if(Jo(o,r(o,s),n.epsilon))return r(o,s);var[a,l]="".concat(o,"e").split("e"),u=Math.ceil(Number("".concat(a,"e").concat(Number(l)+s)));return[a,l]="".concat(u,"e").split("e"),Number("".concat(a,"e").concat(Number(l)-s))}})}),D0e=dt(xD,A0e,t=>{var{typed:e,config:n,round:r,matrix:i,equalScalar:o,zeros:s,DenseMatrix:a}=t,l=hb({typed:e,equalScalar:o}),u=ql({typed:e,DenseMatrix:a}),c=Zf({typed:e}),d=P0e({typed:e,config:n,round:r});return e("ceil",{number:d.signatures.number,"number,number":d.signatures["number,number"],Complex:function(h){return h.ceil()},"Complex, number":function(h,p){return h.ceil(p)},"Complex, BigNumber":function(h,p){return h.ceil(p.toNumber())},BigNumber:function(h){return Ya(h,r(h),n.epsilon)?r(h):h.ceil()},"BigNumber, BigNumber":function(h,p){return Ya(h,r(h,p),n.epsilon)?r(h,p):h.toDecimalPlaces(p.toNumber(),od.ROUND_CEIL)},Fraction:function(h){return h.ceil()},"Fraction, number":function(h,p){return h.ceil(p)},"Fraction, BigNumber":function(h,p){return h.ceil(p.toNumber())},"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"Array, number | BigNumber":e.referToSelf(f=>(h,p)=>ui(h,g=>f(g,p))),"SparseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>l(h,p,f,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>c(h,p,f,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(f=>(h,p)=>c(i(p),h,f,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(f=>(h,p)=>o(h,0)?s(p.size(),p.storage()):p.storage()==="dense"?c(p,h,f,!0):u(p,h,f,!0))})}),wD="fix",R0e=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],I0e=dt(wD,["typed","ceil","floor"],t=>{var{typed:e,ceil:n,floor:r}=t;return e(wD,{number:function(o){return o>0?r(o):n(o)},"number, number":function(o,s){return o>0?r(o,s):n(o,s)}})}),N0e=dt(wD,R0e,t=>{var{typed:e,Complex:n,matrix:r,ceil:i,floor:o,equalScalar:s,zeros:a,DenseMatrix:l}=t,u=ql({typed:e,DenseMatrix:l}),c=Zf({typed:e}),d=I0e({typed:e,ceil:i,floor:o});return e("fix",{number:d.signatures.number,"number, number | BigNumber":d.signatures["number,number"],Complex:function(h){return new n(h.re>0?Math.floor(h.re):Math.ceil(h.re),h.im>0?Math.floor(h.im):Math.ceil(h.im))},"Complex, number":function(h,p){return new n(h.re>0?o(h.re,p):i(h.re,p),h.im>0?o(h.im,p):i(h.im,p))},"Complex, BigNumber":function(h,p){var g=p.toNumber();return new n(h.re>0?o(h.re,g):i(h.re,g),h.im>0?o(h.im,g):i(h.im,g))},BigNumber:function(h){return h.isNegative()?i(h):o(h)},"BigNumber, number | BigNumber":function(h,p){return h.isNegative()?i(h,p):o(h,p)},Fraction:function(h){return h.s<0?h.ceil():h.floor()},"Fraction, number | BigNumber":function(h,p){return h.s<0?i(h,p):o(h,p)},"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"Array | Matrix, number | BigNumber":e.referToSelf(f=>(h,p)=>ui(h,g=>f(g,p))),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(f=>(h,p)=>c(r(p),h,f,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(f=>(h,p)=>s(h,0)?a(p.size(),p.storage()):p.storage()==="dense"?c(p,h,f,!0):u(p,h,f,!0))})}),_D="floor",F0e=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],O0e=dt(_D,["typed","config","round"],t=>{var{typed:e,config:n,round:r}=t;return e(_D,{number:function(o){return Jo(o,r(o),n.epsilon)?r(o):Math.floor(o)},"number, number":function(o,s){if(Jo(o,r(o,s),n.epsilon))return r(o,s);var[a,l]="".concat(o,"e").split("e"),u=Math.floor(Number("".concat(a,"e").concat(Number(l)+s)));return[a,l]="".concat(u,"e").split("e"),Number("".concat(a,"e").concat(Number(l)-s))}})}),k0e=dt(_D,F0e,t=>{var{typed:e,config:n,round:r,matrix:i,equalScalar:o,zeros:s,DenseMatrix:a}=t,l=hb({typed:e,equalScalar:o}),u=ql({typed:e,DenseMatrix:a}),c=Zf({typed:e}),d=O0e({typed:e,config:n,round:r});return e("floor",{number:d.signatures.number,"number,number":d.signatures["number,number"],Complex:function(h){return h.floor()},"Complex, number":function(h,p){return h.floor(p)},"Complex, BigNumber":function(h,p){return h.floor(p.toNumber())},BigNumber:function(h){return Ya(h,r(h),n.epsilon)?r(h):h.floor()},"BigNumber, BigNumber":function(h,p){return Ya(h,r(h,p),n.epsilon)?r(h,p):h.toDecimalPlaces(p.toNumber(),od.ROUND_FLOOR)},Fraction:function(h){return h.floor()},"Fraction, number":function(h,p){return h.floor(p)},"Fraction, BigNumber":function(h,p){return h.floor(p.toNumber())},"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"Array, number | BigNumber":e.referToSelf(f=>(h,p)=>ui(h,g=>f(g,p))),"SparseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>l(h,p,f,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>c(h,p,f,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(f=>(h,p)=>c(i(p),h,f,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(f=>(h,p)=>o(h,0)?s(p.size(),p.storage()):p.storage()==="dense"?c(p,h,f,!0):u(p,h,f,!0))})}),L0e="matAlgo03xDSf",B0e=["typed"],hg=dt(L0e,B0e,t=>{var{typed:e}=t;return function(r,i,o,s){var a=r._data,l=r._size,u=r._datatype||r.getDataType(),c=i._values,d=i._index,f=i._ptr,h=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Rn(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],b=l[1],m,w=0,x=o;typeof u=="string"&&u===p&&u!=="mixed"&&(m=u,w=e.convert(0,m),x=e.find(o,[m,m]));for(var _=[],C=0;C{var{typed:e,equalScalar:n}=t;return function(i,o,s){var a=i._values,l=i._index,u=i._ptr,c=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,h=o._index,p=o._ptr,g=o._size,b=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==g.length)throw new Rn(c.length,g.length);if(c[0]!==g[0]||c[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+g+")");var m=c[0],w=c[1],x,_=n,C=0,S=s;typeof d=="string"&&d===b&&d!=="mixed"&&(x=d,_=e.find(n,[x,x]),C=e.convert(0,x),S=e.find(s,[x,x]));var M=a&&f?[]:void 0,P=[],A=[],R=M?[]:void 0,F=M?[]:void 0,$=[],j=[],k,U,G,B;for(U=0;U{var{typed:e}=t;return function(i,o,s){var a=i._data,l=i._size,u=i._datatype,c=o._data,d=o._size,f=o._datatype,h=[];if(l.length!==d.length)throw new Rn(l.length,d.length);for(var p=0;p0?n(b,0,h,h[0],a,c):[];return i.createDenseMatrix({data:m,size:h,datatype:g})};function n(r,i,o,s,a,l){var u=[];if(i===o.length-1)for(var c=0;c{var{concat:e}=t;return function(i,o){var s=Math.max(i._size.length,o._size.length);if(i._size.length===o._size.length&&i._size.every((p,g)=>p===o._size[g]))return[i,o];for(var a=n(i._size,s,0),l=n(o._size,s,0),u=[],c=0;c{var{typed:e,matrix:n,concat:r}=t,i=G0e({typed:e}),o=Zf({typed:e}),s=q0e({concat:r});return function(l){var u=l.elop,c=l.SD||l.DS,d;u?(d={"DenseMatrix, DenseMatrix":(g,b)=>i(...s(g,b),u),"Array, Array":(g,b)=>i(...s(n(g),n(b)),u).valueOf(),"Array, DenseMatrix":(g,b)=>i(...s(n(g),b),u),"DenseMatrix, Array":(g,b)=>i(...s(g,n(b)),u)},l.SS&&(d["SparseMatrix, SparseMatrix"]=(g,b)=>l.SS(...s(g,b),u,!1)),l.DS&&(d["DenseMatrix, SparseMatrix"]=(g,b)=>l.DS(...s(g,b),u,!1),d["Array, SparseMatrix"]=(g,b)=>l.DS(...s(n(g),b),u,!1)),c&&(d["SparseMatrix, DenseMatrix"]=(g,b)=>c(...s(b,g),u,!0),d["SparseMatrix, Array"]=(g,b)=>c(...s(n(b),g),u,!0))):(d={"DenseMatrix, DenseMatrix":e.referToSelf(g=>(b,m)=>i(...s(b,m),g)),"Array, Array":e.referToSelf(g=>(b,m)=>i(...s(n(b),n(m)),g).valueOf()),"Array, DenseMatrix":e.referToSelf(g=>(b,m)=>i(...s(n(b),m),g)),"DenseMatrix, Array":e.referToSelf(g=>(b,m)=>i(...s(b,n(m)),g))},l.SS&&(d["SparseMatrix, SparseMatrix"]=e.referToSelf(g=>(b,m)=>l.SS(...s(b,m),g,!1))),l.DS&&(d["DenseMatrix, SparseMatrix"]=e.referToSelf(g=>(b,m)=>l.DS(...s(b,m),g,!1)),d["Array, SparseMatrix"]=e.referToSelf(g=>(b,m)=>l.DS(...s(n(b),m),g,!1))),c&&(d["SparseMatrix, DenseMatrix"]=e.referToSelf(g=>(b,m)=>c(...s(m,b),g,!0)),d["SparseMatrix, Array"]=e.referToSelf(g=>(b,m)=>c(...s(n(m),b),g,!0))));var f=l.scalar||"any",h=l.Ds||l.Ss;h&&(u?(d["DenseMatrix,"+f]=(g,b)=>o(g,b,u,!1),d[f+", DenseMatrix"]=(g,b)=>o(b,g,u,!0),d["Array,"+f]=(g,b)=>o(n(g),b,u,!1).valueOf(),d[f+", Array"]=(g,b)=>o(n(b),g,u,!0).valueOf()):(d["DenseMatrix,"+f]=e.referToSelf(g=>(b,m)=>o(b,m,g,!1)),d[f+", DenseMatrix"]=e.referToSelf(g=>(b,m)=>o(m,b,g,!0)),d["Array,"+f]=e.referToSelf(g=>(b,m)=>o(n(b),m,g,!1).valueOf()),d[f+", Array"]=e.referToSelf(g=>(b,m)=>o(n(m),b,g,!0).valueOf())));var p=l.sS!==void 0?l.sS:l.Ss;return u?(l.Ss&&(d["SparseMatrix,"+f]=(g,b)=>l.Ss(g,b,u,!1)),p&&(d[f+", SparseMatrix"]=(g,b)=>p(b,g,u,!0))):(l.Ss&&(d["SparseMatrix,"+f]=e.referToSelf(g=>(b,m)=>l.Ss(b,m,g,!1))),p&&(d[f+", SparseMatrix"]=e.referToSelf(g=>(b,m)=>p(m,b,g,!0)))),u&&u.signatures&&wG(d,u.signatures),d}}),Y0e="matAlgo01xDSid",Z0e=["typed"],aj=dt(Y0e,Z0e,t=>{var{typed:e}=t;return function(r,i,o,s){var a=r._data,l=r._size,u=r._datatype||r.getDataType(),c=i._values,d=i._index,f=i._ptr,h=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Rn(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],b=l[1],m=typeof u=="string"&&u!=="mixed"&&u===p?u:void 0,w=m?e.find(o,[m,m]):o,x,_,C=[];for(x=0;x{var{typed:e,equalScalar:n}=t;return function(i,o,s){var a=i._values,l=i._index,u=i._ptr,c=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,h=o._index,p=o._ptr,g=o._size,b=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==g.length)throw new Rn(c.length,g.length);if(c[0]!==g[0]||c[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+g+")");var m=c[0],w=c[1],x,_=n,C=0,S=s;typeof d=="string"&&d===b&&d!=="mixed"&&(x=d,_=e.find(n,[x,x]),C=e.convert(0,x),S=e.find(s,[x,x]));var M=a&&f?[]:void 0,P=[],A=[],R=a&&f?[]:void 0,F=a&&f?[]:void 0,$=[],j=[],k,U,G,B,L;for(U=0;U{var{typed:e,DenseMatrix:n}=t;return function(i,o,s,a){var l=i._values,u=i._index,c=i._ptr,d=i._size,f=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=d[0],p=d[1],g,b=s;typeof f=="string"&&(g=f,o=e.convert(o,g),b=e.find(s,[g,g]));for(var m=[],w=[],x=[],_=0;_{var{typed:e}=t;return e("multiplyScalar",{"number, number":rj,"Complex, Complex":function(r,i){return r.mul(i)},"BigNumber, BigNumber":function(r,i){return r.times(i)},"Fraction, Fraction":function(r,i){return r.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(n,r)=>r.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,r)=>n.multiply(r)})}),RB="multiply",sve=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],ave=dt(RB,sve,t=>{var{typed:e,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:o,dot:s}=t,a=hb({typed:e,equalScalar:o}),l=Zf({typed:e});function u(C,S){switch(C.length){case 1:switch(S.length){case 1:if(C[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(C[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+C[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(C[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+C[1]+") must match Vector length ("+S[0]+")");break;case 2:if(C[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+C[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+C.length+" dimensions)")}}function c(C,S,M){if(M===0)throw new Error("Cannot multiply two empty vectors");return s(C,S)}function d(C,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return f(C,S)}function f(C,S){var M=C._data,P=C._size,A=C._datatype||C.getDataType(),R=S._data,F=S._size,$=S._datatype||S.getDataType(),j=P[0],k=F[1],U,G=r,B=i;A&&$&&A===$&&typeof A=="string"&&A!=="mixed"&&(U=A,G=e.find(r,[U,U]),B=e.find(i,[U,U]));for(var L=[],N=0;NMe)for(var we=0,Fe=0;Fe(S,M)=>{u(To(S),To(M));var P=C(n(S),n(M));return Or(P)?P.valueOf():P}),"Matrix, Matrix":function(S,M){var P=S.size(),A=M.size();return u(P,A),P.length===1?A.length===1?c(S,M,P[0]):d(S,M):A.length===1?h(S,M):p(S,M)},"Matrix, Array":e.referTo("Matrix,Matrix",C=>(S,M)=>C(S,n(M))),"Array, Matrix":e.referToSelf(C=>(S,M)=>C(n(S,M.storage()),M)),"SparseMatrix, any":function(S,M){return a(S,M,i,!1)},"DenseMatrix, any":function(S,M){return l(S,M,i,!1)},"any, SparseMatrix":function(S,M){return a(M,S,i,!0)},"any, DenseMatrix":function(S,M){return l(M,S,i,!0)},"Array, any":function(S,M){return l(n(S),M,i,!1).valueOf()},"any, Array":function(S,M){return l(n(M),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":e.referToSelf(C=>(S,M,P)=>{for(var A=C(S,M),R=0;R{var{typed:e,matrix:n,equalScalar:r,subtractScalar:i,unaryMinus:o,DenseMatrix:s,concat:a}=t,l=aj({typed:e}),u=hg({typed:e}),c=U0e({typed:e,equalScalar:r}),d=lj({typed:e,DenseMatrix:s}),f=ql({typed:e,DenseMatrix:s}),h=Qf({typed:e,matrix:n,concat:a});return e(IB,{"any, any":i},h({elop:i,SS:c,DS:l,SD:u,Ss:f,sS:d}))}),cve="matAlgo07xSSf",dve=["typed","DenseMatrix"],pb=dt(cve,dve,t=>{var{typed:e,DenseMatrix:n}=t;return function(o,s,a){var l=o._size,u=o._datatype||o._data===void 0?o._datatype:o.getDataType(),c=s._size,d=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(l.length!==c.length)throw new Rn(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var f=l[0],h=l[1],p,g=0,b=a;typeof u=="string"&&u===d&&u!=="mixed"&&(p=u,g=e.convert(0,p),b=e.find(a,[p,p]));var m,w,x=[];for(m=0;m{var{typed:e}=t;return e(NB,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),FB="concat",pve=["typed","matrix","isInteger"],mve=dt(FB,pve,t=>{var{typed:e,matrix:n,isInteger:r}=t;return e(FB,{"...Array | Matrix | number | BigNumber":function(o){var s,a=o.length,l=-1,u,c=!1,d=[];for(s=0;s0&&l>u)throw new wd(l,u+1)}else{var h=dr(f).valueOf(),p=To(h);if(d[s]=h,u=l,l=p.length-1,s>0&&l!==u)throw new Rn(u+1,l+1)}}if(d.length===0)throw new SyntaxError("At least one matrix expected");for(var g=d.shift();d.length;)g=NG(g,d.shift(),l);return c?n(g):g},"...string":function(o){return o.join("")}})}),OB="identity",gve=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],vve=dt(OB,gve,t=>{var{typed:e,config:n,matrix:r,BigNumber:i,DenseMatrix:o,SparseMatrix:s}=t;return e(OB,{"":function(){return n.matrix==="Matrix"?r([]):[]},string:function(c){return r(c)},"number | BigNumber":function(c){return l(c,c,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,d){return l(c,c,d)},"number | BigNumber, number | BigNumber":function(c,d){return l(c,d,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,d,f){return l(c,d,f)},Array:function(c){return a(c)},"Array, string":function(c,d){return a(c,d)},Matrix:function(c){return a(c.valueOf(),c.storage())},"Matrix, string":function(c,d){return a(c.valueOf(),d)}});function a(u,c){switch(u.length){case 0:return c?r(c):[];case 1:return l(u[0],u[0],c);case 2:return l(u[0],u[1],c);default:throw new Error("Vector containing two values expected")}}function l(u,c,d){var f=kr(u)||kr(c)?i:null;if(kr(u)&&(u=u.toNumber()),kr(c)&&(c=c.toNumber()),!or(u)||u<1)throw new Error("Parameters in function identity must be positive integers");if(!or(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var h=f?new i(1):1,p=f?new f(0):0,g=[u,c];if(d){if(d==="sparse")return s.diagonal(g,h,0,p);if(d==="dense")return o.diagonal(g,h,0,p);throw new TypeError('Unknown matrix type "'.concat(d,'"'))}for(var b=Y_([],g,p),m=u{var{typed:e,config:n,matrix:r}=t;return e(kB,{Matrix:function(o){return o.create(o.size())},Array:To,string:function(o){return n.matrix==="Array"?[o.length]:r([o.length])},"number | Complex | BigNumber | Unit | boolean | null":function(o){return n.matrix==="Array"?[]:r?r([]):xve()}})}),LB="zeros",Sve=["typed","config","matrix","BigNumber"],Cve=dt(LB,Sve,t=>{var{typed:e,config:n,matrix:r,BigNumber:i}=t;return e(LB,{"":function(){return n.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(u){var c=u[u.length-1];if(typeof c=="string"){var d=u.pop();return o(u,d)}else return n.matrix==="Array"?o(u):o(u,"default")},Array:o,Matrix:function(u){var c=u.storage();return o(u.valueOf(),c)},"Array | Matrix, string":function(u,c){return o(u.valueOf(),c)}});function o(l,u){var c=s(l),d=c?new i(0):0;if(a(l),u){var f=r(u);return l.length>0?f.resize(l,d):f}else{var h=[];return l.length>0?Y_(h,l,d):h}}function s(l){var u=!1;return l.forEach(function(c,d,f){kr(c)&&(u=!0,f[d]=c.toNumber())}),u}function a(l){l.forEach(function(u){if(typeof u!="number"||!or(u)||u<0)throw new Error("Parameters in function zeros must be positive integers")})}});function Eve(t,e,n){return e=Lm(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iS(t,e,n){var r;return String(t).indexOf("Unexpected type")!==-1?(r=arguments.length>2?" (type: "+aa(n)+", value: "+JSON.stringify(n)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+r)):String(t).indexOf("complex numbers")!==-1?(r=arguments.length>2?" (type: "+aa(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+r)):t}var BB="format",Mve=["typed"],Tve=dt(BB,Mve,t=>{var{typed:e}=t;return e(BB,{any:Ir,"any, Object | function | number | BigNumber":Ir})}),Ave="numeric",Pve=["number","?bignumber","?fraction"],Dve=dt(Ave,Pve,t=>{var{number:e,bignumber:n,fraction:r}=t,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:s=>e(s),BigNumber:n?s=>n(s):yve,Fraction:r?s=>r(s):bve};return function(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",u=arguments.length>2?arguments[2]:void 0;if(u!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=aa(a);if(!(c in i))throw new TypeError("Cannot convert "+a+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(l in o))throw new TypeError("Cannot convert "+a+' to type "'+l+'"; valid output types are '+Object.keys(o).join(", "));return l===c?a:o[l](a)}}),$B="divideScalar",Rve=["typed","numeric"],Ive=dt($B,Rve,t=>{var{typed:e,numeric:n}=t;return e($B,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,i)=>r.divide(i),"number | Fraction | Complex | BigNumber, Unit":(r,i)=>i.divideInto(r)})}),zB="pow",Nve=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],Fve=dt(zB,Nve,t=>{var{typed:e,config:n,identity:r,multiply:i,matrix:o,inv:s,number:a,fraction:l,Complex:u}=t;return e(zB,{"number, number":c,"Complex, Complex":function(p,g){return p.pow(g)},"BigNumber, BigNumber":function(p,g){return g.isInteger()||p>=0||n.predictable?p.pow(g):new u(p.toNumber(),0).pow(g.toNumber(),0)},"Fraction, Fraction":function(p,g){var b=p.pow(g);if(b!=null)return b;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(p.valueOf(),g.valueOf())},"Array, number":d,"Array, BigNumber":function(p,g){return d(p,g.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(p,g){return f(p,g.toNumber())},"Unit, number | BigNumber":function(p,g){return p.pow(g)}});function c(h,p){if(n.predictable&&!or(p)&&h<0)try{var g=l(p),b=a(g);if((p===b||Math.abs((p-b)/p)<1e-14)&&g.d%2===1)return(g.n%2===0?1:-1)*Math.pow(-h,p)}catch{}return n.predictable&&(h<-1&&p===1/0||h>-1&&h<0&&p===-1/0)?NaN:or(p)||h>=0||n.predictable?oj(h,p):h*h<1&&p===1/0||h*h>1&&p===-1/0?0:new u(h,0).pow(p,0)}function d(h,p){if(!or(p))throw new TypeError("For A^b, b must be an integer (value is "+p+")");var g=To(h);if(g.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+g.length+" dimensions)");if(g[0]!==g[1])throw new Error("For A^b, A must be square (size is "+g[0]+"x"+g[1]+")");if(p<0)try{return d(s(h),-p)}catch(w){throw w.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+p+")"):w}for(var b=r(g[0]).valueOf(),m=h;p>=1;)(p&1)===1&&(b=i(m,b)),p>>=1,m=i(m,m);return b}function f(h,p){return o(d(h.valueOf(),p))}}),$h="Number of decimals in function round must be an integer",UB="round",Ove=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],kve=dt(UB,Ove,t=>{var{typed:e,config:n,matrix:r,equalScalar:i,zeros:o,BigNumber:s,DenseMatrix:a}=t,l=hb({typed:e,equalScalar:i}),u=ql({typed:e,DenseMatrix:a}),c=Zf({typed:e});function d(f){return Math.abs(cb(f).exponent)}return e(UB,{number:function(h){var p=m0(h,d(n.epsilon)),g=Jo(h,p,n.epsilon)?p:h;return m0(g)},"number, number":function(h,p){var g=d(n.epsilon);if(p>=g)return m0(h,p);var b=m0(h,g),m=Jo(h,b,n.epsilon)?b:h;return m0(m,p)},"number, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);return new s(h).toDecimalPlaces(p.toNumber())},Complex:function(h){return h.round()},"Complex, number":function(h,p){if(p%1)throw new TypeError($h);return h.round(p)},"Complex, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);var g=p.toNumber();return h.round(g)},BigNumber:function(h){var p=new s(h).toDecimalPlaces(d(n.epsilon)),g=Ya(h,p,n.epsilon)?p:h;return g.toDecimalPlaces(0)},"BigNumber, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);var g=d(n.epsilon);if(p>=g)return h.toDecimalPlaces(p.toNumber());var b=h.toDecimalPlaces(g),m=Ya(h,b,n.epsilon)?b:h;return m.toDecimalPlaces(p.toNumber())},Fraction:function(h){return h.round()},"Fraction, number":function(h,p){if(p%1)throw new TypeError($h);return h.round(p)},"Fraction, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);return h.round(p.toNumber())},"Unit, number, Unit":e.referToSelf(f=>function(h,p,g){var b=h.toNumeric(g);return g.multiply(f(b,p))}),"Unit, BigNumber, Unit":e.referToSelf(f=>(h,p,g)=>f(h,p.toNumber(),g)),"Unit, Unit":e.referToSelf(f=>(h,p)=>f(h,0,p)),"Array | Matrix, number, Unit":e.referToSelf(f=>(h,p,g)=>ui(h,b=>f(b,p,g))),"Array | Matrix, BigNumber, Unit":e.referToSelf(f=>(h,p,g)=>f(h,p.toNumber(),g)),"Array | Matrix, Unit":e.referToSelf(f=>(h,p)=>f(h,0,p)),"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"SparseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>l(h,p,f,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>c(h,p,f,!1)),"Array, number | BigNumber":e.referToSelf(f=>(h,p)=>c(r(h),p,f,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(f=>(h,p)=>i(h,0)?o(p.size(),p.storage()):u(p,h,f,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(f=>(h,p)=>i(h,0)?o(p.size(),p.storage()):c(p,h,f,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(f=>(h,p)=>c(r(p),h,f,!0).valueOf())})}),oS="equal",Lve=["typed","matrix","equalScalar","DenseMatrix","concat"],Bve=dt(oS,Lve,t=>{var{typed:e,matrix:n,equalScalar:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:n,concat:o});return e(oS,$ve({typed:e,equalScalar:r}),u({elop:r,SS:a,DS:s,Ss:l}))}),$ve=dt(oS,["typed","equalScalar"],t=>{var{typed:e,equalScalar:n}=t;return e(oS,{"any, any":function(i,o){return i===null?o===null:o===null?i===null:i===void 0?o===void 0:o===void 0?i===void 0:n(i,o)}})}),sS="smaller",zve=["typed","config","matrix","DenseMatrix","concat"],Uve=dt(sS,zve,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(sS,Hve({typed:e,config:n}),{"boolean, boolean":(d,f)=>dd.compare(f)===-1,"Complex, Complex":function(f,h){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),Hve=dt(sS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(sS,{"number, number":function(i,o){return i{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(aS,jve({typed:e,config:n}),{"boolean, boolean":(d,f)=>d<=f,"BigNumber, BigNumber":function(f,h){return f.lte(h)||Ya(f,h,n.epsilon)},"Fraction, Fraction":(d,f)=>d.compare(f)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),jve=dt(aS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(aS,{"number, number":function(i,o){return i<=o||Jo(i,o,n.epsilon)}})}),lS="larger",Wve=["typed","config","matrix","DenseMatrix","concat"],qve=dt(lS,Wve,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(lS,Xve({typed:e,config:n}),{"boolean, boolean":(d,f)=>d>f,"BigNumber, BigNumber":function(f,h){return f.gt(h)&&!Ya(f,h,n.epsilon)},"Fraction, Fraction":(d,f)=>d.compare(f)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),Xve=dt(lS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(lS,{"number, number":function(i,o){return i>o&&!Jo(i,o,n.epsilon)}})}),uS="largerEq",Kve=["typed","config","matrix","DenseMatrix","concat"],Yve=dt(uS,Kve,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(uS,Zve({typed:e,config:n}),{"boolean, boolean":(d,f)=>d>=f,"BigNumber, BigNumber":function(f,h){return f.gte(h)||Ya(f,h,n.epsilon)},"Fraction, Fraction":(d,f)=>d.compare(f)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),Zve=dt(uS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(uS,{"number, number":function(i,o){return i>=o||Jo(i,o,n.epsilon)}})}),HB="max",Qve=["typed","config","numeric","larger"],Jve=dt(HB,Qve,t=>{var{typed:e,config:n,numeric:r,larger:i}=t;return e(HB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(l,u){return QG(l,u.valueOf(),o)},"...":function(l){if(ZG(l))throw new TypeError("Scalar values expected in function max");return s(l)}});function o(a,l){try{return i(a,l)?a:l}catch(u){throw iS(u,"max",l)}}function s(a){var l;if(rN(a,function(u){try{isNaN(u)&&typeof u=="number"?l=NaN:(l===void 0||i(u,l))&&(l=u)}catch(c){throw iS(c,"max",u)}}),l===void 0)throw new Error("Cannot calculate max of an empty array");return typeof l=="string"&&(l=r(l,n.number)),l}}),VB="min",eye=["typed","config","numeric","smaller"],tye=dt(VB,eye,t=>{var{typed:e,config:n,numeric:r,smaller:i}=t;return e(VB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(l,u){return QG(l,u.valueOf(),o)},"...":function(l){if(ZG(l))throw new TypeError("Scalar values expected in function min");return s(l)}});function o(a,l){try{return i(a,l)?a:l}catch(u){throw iS(u,"min",l)}}function s(a){var l;if(rN(a,function(u){try{isNaN(u)&&typeof u=="number"?l=NaN:(l===void 0||i(u,l))&&(l=u)}catch(c){throw iS(c,"min",u)}}),l===void 0)throw new Error("Cannot calculate min of an empty array");return typeof l=="string"&&(l=r(l,n.number)),l}});db(function(t){return new t(1).exp()},{hasher:dE});db(function(t){return new t(1).plus(new t(5).sqrt()).div(2)},{hasher:dE});var uj=db(function(t){return t.acos(-1)},{hasher:dE});db(function(t){return uj(t).times(2)},{hasher:dE});function dE(t){return t[0].precision}function GB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ST(t){for(var e=1;e{var{on:e,config:n,addScalar:r,subtractScalar:i,multiplyScalar:o,divideScalar:s,pow:a,abs:l,fix:u,round:c,equal:d,isNumeric:f,format:h,number:p,Complex:g,BigNumber:b,Fraction:m}=t,w=p;function x(X,Z){if(!(this instanceof x))throw new Error("Constructor must be called with the new operator");if(!(X==null||f(X)||gv(X)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,Z===void 0)this.units=[],this.dimensions=L.map(Y=>0);else if(typeof Z=="string"){var he=x.parse(Z);this.units=he.units,this.dimensions=he.dimensions}else if(_c(Z)&&Z.value===null)this.fixPrefix=Z.fixPrefix,this.skipAutomaticSimplification=Z.skipAutomaticSimplification,this.dimensions=Z.dimensions.slice(0),this.units=Z.units.map(Y=>Xp({},Y));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(X)}Object.defineProperty(x,"name",{value:"Unit"}),x.prototype.constructor=x,x.prototype.type="Unit",x.prototype.isUnit=!0;var _,C,S;function M(){for(;S===" "||S===" ";)R()}function P(X){return X>="0"&&X<="9"||X==="."}function A(X){return X>="0"&&X<="9"}function R(){C++,S=_.charAt(C)}function F(X){C=X,S=_.charAt(C)}function $(){var X="",Z=C;if(S==="+"?R():S==="-"&&(X+=S,R()),!P(S))return F(Z),null;if(S==="."){if(X+=S,R(),!A(S))return F(Z),null}else{for(;A(S);)X+=S,R();S==="."&&(X+=S,R())}for(;A(S);)X+=S,R();if(S==="E"||S==="e"){var he="",Y=C;if(he+=S,R(),(S==="+"||S==="-")&&(he+=S,R()),!A(S))return F(Y),X;for(X=X+he;A(S);)X+=S,R()}return X}function j(){for(var X="";A(S)||x.isValidAlpha(S);)X+=S,R();var Z=X.charAt(0);return x.isValidAlpha(Z)?X:null}function k(X){return S===X?(R(),X):null}x.parse=function(X,Z){if(Z=Z||{},_=X,C=-1,S="",typeof _!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var he=new x;he.units=[];var Y=1,ne=!1;R(),M();var se=$(),xe=null;if(se){if(n.number==="BigNumber")xe=new b(se);else if(n.number==="Fraction")try{xe=new m(se)}catch{xe=parseFloat(se)}else xe=parseFloat(se);M(),k("*")?(Y=1,ne=!0):k("/")&&(Y=-1,ne=!0)}for(var Pe=[],z=1;;){for(M();S==="(";)Pe.push(Y),z*=Y,Y=1,R(),M();var H=void 0;if(S){var te=S;if(H=j(),H===null)throw new SyntaxError('Unexpected "'+te+'" in "'+_+'" at index '+C.toString())}else break;var le=U(H);if(le===null)throw new SyntaxError('Unit "'+H+'" not found.');var de=Y*z;if(M(),k("^")){M();var ue=$();if(ue===null)throw new SyntaxError('In "'+X+'", "^" must be followed by a floating-point number');de*=ue}he.units.push({unit:le.unit,prefix:le.prefix,power:de});for(var ge=0;ge1||Math.abs(this.units[0].power-1)>1e-15},x.prototype._normalize=function(X){if(X==null||this.units.length===0)return X;for(var Z=X,he=x._getNumberConverter(aa(X)),Y=0;Y{if(Gn(J,X)){var Z=J[X],he=Z.prefixes[""];return{unit:Z,prefix:he}}for(var Y in J)if(Gn(J,Y)&&ame(X,Y)){var ne=J[Y],se=X.length-Y.length,xe=X.substring(0,se),Pe=Gn(ne.prefixes,xe)?ne.prefixes[xe]:void 0;if(Pe!==void 0)return{unit:ne,prefix:Pe}}return null},{hasher:X=>X[0],limit:100});x.isValuelessUnit=function(X){return U(X)!==null},x.prototype.hasBase=function(X){if(typeof X=="string"&&(X=N[X]),!X)return!1;for(var Z=0;Z1e-12)return!1;return!0},x.prototype.equalBase=function(X){for(var Z=0;Z1e-12)return!1;return!0},x.prototype.equals=function(X){return this.equalBase(X)&&d(this.value,X.value)},x.prototype.multiply=function(X){for(var Z=this.clone(),he=_c(X)?X:new x(X),Y=0;Y1e-12&&(Gn(Me,Pe)?Z.push({unit:Me[Pe].unit,prefix:Me[Pe].prefix,power:X.dimensions[xe]||0}):se=!0)}Z.length1e-12)if(Gn(fe.si,Y))Z.push({unit:fe.si[Y].unit,prefix:fe.si[Y].prefix,power:X.dimensions[he]||0});else throw new Error("Cannot express custom unit "+Y+" in SI units")}return X.units=Z,X.fixPrefix=!0,X.skipAutomaticSimplification=!0,this.value!==null?(X.value=null,this.to(X)):X},x.prototype.formatUnits=function(){for(var X="",Z="",he=0,Y=0,ne=0;ne0?(he++,X+=" "+this.units[ne].prefix.name+this.units[ne].unit.name,Math.abs(this.units[ne].power-1)>1e-15&&(X+="^"+this.units[ne].power)):this.units[ne].power<0&&Y++;if(Y>0)for(var se=0;se0?(Z+=" "+this.units[se].prefix.name+this.units[se].unit.name,Math.abs(this.units[se].power+1)>1e-15&&(Z+="^"+-this.units[se].power)):(Z+=" "+this.units[se].prefix.name+this.units[se].unit.name,Z+="^"+this.units[se].power));X=X.substr(1),Z=Z.substr(1),he>1&&Y>0&&(X="("+X+")"),Y>1&&he>0&&(Z="("+Z+")");var xe=X;return he>0&&Y>0&&(xe+=" / "),xe+=Z,xe},x.prototype.format=function(X){var Z=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),he=!1;typeof Z.value<"u"&&Z.value!==null&&gv(Z.value)&&(he=Math.abs(Z.value.re)<1e-14);for(var Y in Z.units)Gn(Z.units,Y)&&Z.units[Y].unit&&(Z.units[Y].unit.name==="VA"&&he?Z.units[Y].unit=J.VAR:Z.units[Y].unit.name==="VAR"&&!he&&(Z.units[Y].unit=J.VA));Z.units.length===1&&!Z.fixPrefix&&Math.abs(Z.units[0].power-Math.round(Z.units[0].power))<1e-14&&(Z.units[0].prefix=Z._bestPrefix());var ne=Z._denormalize(Z.value),se=Z.value!==null?h(ne,X||{}):"",xe=Z.formatUnits();return Z.value&&gv(Z.value)&&(se="("+se+")"),xe.length>0&&se.length>0&&(se+=" "),se+=xe,se},x.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var X=this.value!==null?l(this.value):0,Z=l(this.units[0].unit.value),he=this.units[0].prefix;if(X===0)return he;var Y=this.units[0].power,ne=Math.log(X/Math.pow(he.value*Z,Y))/Math.LN10-1.2;if(ne>-2.200001&&ne<1.800001)return he;ne=Math.abs(ne);var se=this.units[0].unit.prefixes;for(var xe in se)if(Gn(se,xe)){var Pe=se[xe];if(Pe.scientific){var z=Math.abs(Math.log(X/Math.pow(Pe.value*Z,Y))/Math.LN10-1.2);(z0)},J={meter:{name:"meter",base:N.LENGTH,prefixes:B.LONG,value:1,offset:0},inch:{name:"inch",base:N.LENGTH,prefixes:B.NONE,value:.0254,offset:0},foot:{name:"foot",base:N.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yard:{name:"yard",base:N.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mile:{name:"mile",base:N.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},link:{name:"link",base:N.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rod:{name:"rod",base:N.LENGTH,prefixes:B.NONE,value:5.0292,offset:0},chain:{name:"chain",base:N.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:N.LENGTH,prefixes:B.NONE,value:1e-10,offset:0},m:{name:"m",base:N.LENGTH,prefixes:B.SHORT,value:1,offset:0},in:{name:"in",base:N.LENGTH,prefixes:B.NONE,value:.0254,offset:0},ft:{name:"ft",base:N.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yd:{name:"yd",base:N.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mi:{name:"mi",base:N.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},li:{name:"li",base:N.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rd:{name:"rd",base:N.LENGTH,prefixes:B.NONE,value:5.02921,offset:0},ch:{name:"ch",base:N.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},mil:{name:"mil",base:N.LENGTH,prefixes:B.NONE,value:254e-7,offset:0},m2:{name:"m2",base:N.SURFACE,prefixes:B.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:N.SURFACE,prefixes:B.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:N.SURFACE,prefixes:B.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:N.SURFACE,prefixes:B.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:N.SURFACE,prefixes:B.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:N.SURFACE,prefixes:B.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:N.SURFACE,prefixes:B.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:N.SURFACE,prefixes:B.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:N.SURFACE,prefixes:B.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:N.SURFACE,prefixes:B.NONE,value:1e4,offset:0},m3:{name:"m3",base:N.VOLUME,prefixes:B.CUBIC,value:1,offset:0},L:{name:"L",base:N.VOLUME,prefixes:B.SHORT,value:.001,offset:0},l:{name:"l",base:N.VOLUME,prefixes:B.SHORT,value:.001,offset:0},litre:{name:"litre",base:N.VOLUME,prefixes:B.LONG,value:.001,offset:0},cuin:{name:"cuin",base:N.VOLUME,prefixes:B.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:N.VOLUME,prefixes:B.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:N.VOLUME,prefixes:B.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:N.VOLUME,prefixes:B.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:N.VOLUME,prefixes:B.NONE,value:15e-6,offset:0},drop:{name:"drop",base:N.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:N.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},minim:{name:"minim",base:N.VOLUME,prefixes:B.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:N.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:N.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:N.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:N.VOLUME,prefixes:B.NONE,value:1e-6,offset:0},cup:{name:"cup",base:N.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:N.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:N.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:N.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:N.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:N.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:N.VOLUME,prefixes:B.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:N.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:N.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:N.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:N.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:N.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:N.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:N.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:N.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},obl:{name:"obl",base:N.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},g:{name:"g",base:N.MASS,prefixes:B.SHORT,value:.001,offset:0},gram:{name:"gram",base:N.MASS,prefixes:B.LONG,value:.001,offset:0},ton:{name:"ton",base:N.MASS,prefixes:B.SHORT,value:907.18474,offset:0},t:{name:"t",base:N.MASS,prefixes:B.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:N.MASS,prefixes:B.LONG,value:1e3,offset:0},grain:{name:"grain",base:N.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:N.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:N.MASS,prefixes:B.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:N.MASS,prefixes:B.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:N.MASS,prefixes:B.NONE,value:45.359237,offset:0},stick:{name:"stick",base:N.MASS,prefixes:B.NONE,value:.115,offset:0},stone:{name:"stone",base:N.MASS,prefixes:B.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:N.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:N.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:N.MASS,prefixes:B.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:N.MASS,prefixes:B.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:N.MASS,prefixes:B.NONE,value:45.359237,offset:0},s:{name:"s",base:N.TIME,prefixes:B.SHORT,value:1,offset:0},min:{name:"min",base:N.TIME,prefixes:B.NONE,value:60,offset:0},h:{name:"h",base:N.TIME,prefixes:B.NONE,value:3600,offset:0},second:{name:"second",base:N.TIME,prefixes:B.LONG,value:1,offset:0},sec:{name:"sec",base:N.TIME,prefixes:B.LONG,value:1,offset:0},minute:{name:"minute",base:N.TIME,prefixes:B.NONE,value:60,offset:0},hour:{name:"hour",base:N.TIME,prefixes:B.NONE,value:3600,offset:0},day:{name:"day",base:N.TIME,prefixes:B.NONE,value:86400,offset:0},week:{name:"week",base:N.TIME,prefixes:B.NONE,value:7*86400,offset:0},month:{name:"month",base:N.TIME,prefixes:B.NONE,value:2629800,offset:0},year:{name:"year",base:N.TIME,prefixes:B.NONE,value:31557600,offset:0},decade:{name:"decade",base:N.TIME,prefixes:B.NONE,value:315576e3,offset:0},century:{name:"century",base:N.TIME,prefixes:B.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:N.TIME,prefixes:B.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:N.FREQUENCY,prefixes:B.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:N.FREQUENCY,prefixes:B.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:N.ANGLE,prefixes:B.SHORT,value:1,offset:0},radian:{name:"radian",base:N.ANGLE,prefixes:B.LONG,value:1,offset:0},deg:{name:"deg",base:N.ANGLE,prefixes:B.SHORT,value:null,offset:0},degree:{name:"degree",base:N.ANGLE,prefixes:B.LONG,value:null,offset:0},grad:{name:"grad",base:N.ANGLE,prefixes:B.SHORT,value:null,offset:0},gradian:{name:"gradian",base:N.ANGLE,prefixes:B.LONG,value:null,offset:0},cycle:{name:"cycle",base:N.ANGLE,prefixes:B.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:N.ANGLE,prefixes:B.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:N.ANGLE,prefixes:B.NONE,value:null,offset:0},A:{name:"A",base:N.CURRENT,prefixes:B.SHORT,value:1,offset:0},ampere:{name:"ampere",base:N.CURRENT,prefixes:B.LONG,value:1,offset:0},K:{name:"K",base:N.TEMPERATURE,prefixes:B.SHORT,value:1,offset:0},degC:{name:"degC",base:N.TEMPERATURE,prefixes:B.SHORT,value:1,offset:273.15},degF:{name:"degF",base:N.TEMPERATURE,prefixes:B.SHORT,value:new m(5,9),offset:459.67},degR:{name:"degR",base:N.TEMPERATURE,prefixes:B.SHORT,value:new m(5,9),offset:0},kelvin:{name:"kelvin",base:N.TEMPERATURE,prefixes:B.LONG,value:1,offset:0},celsius:{name:"celsius",base:N.TEMPERATURE,prefixes:B.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:N.TEMPERATURE,prefixes:B.LONG,value:new m(5,9),offset:459.67},rankine:{name:"rankine",base:N.TEMPERATURE,prefixes:B.LONG,value:new m(5,9),offset:0},mol:{name:"mol",base:N.AMOUNT_OF_SUBSTANCE,prefixes:B.SHORT,value:1,offset:0},mole:{name:"mole",base:N.AMOUNT_OF_SUBSTANCE,prefixes:B.LONG,value:1,offset:0},cd:{name:"cd",base:N.LUMINOUS_INTENSITY,prefixes:B.SHORT,value:1,offset:0},candela:{name:"candela",base:N.LUMINOUS_INTENSITY,prefixes:B.LONG,value:1,offset:0},N:{name:"N",base:N.FORCE,prefixes:B.SHORT,value:1,offset:0},newton:{name:"newton",base:N.FORCE,prefixes:B.LONG,value:1,offset:0},dyn:{name:"dyn",base:N.FORCE,prefixes:B.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:N.FORCE,prefixes:B.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:N.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:N.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:N.FORCE,prefixes:B.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:N.FORCE,prefixes:B.NONE,value:9.80665,offset:0},J:{name:"J",base:N.ENERGY,prefixes:B.SHORT,value:1,offset:0},joule:{name:"joule",base:N.ENERGY,prefixes:B.LONG,value:1,offset:0},erg:{name:"erg",base:N.ENERGY,prefixes:B.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:N.ENERGY,prefixes:B.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:N.ENERGY,prefixes:B.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:N.ENERGY,prefixes:B.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:N.ENERGY,prefixes:B.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:N.POWER,prefixes:B.SHORT,value:1,offset:0},watt:{name:"watt",base:N.POWER,prefixes:B.LONG,value:1,offset:0},hp:{name:"hp",base:N.POWER,prefixes:B.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:N.POWER,prefixes:B.SHORT,value:g.I,offset:0},VA:{name:"VA",base:N.POWER,prefixes:B.SHORT,value:1,offset:0},Pa:{name:"Pa",base:N.PRESSURE,prefixes:B.SHORT,value:1,offset:0},psi:{name:"psi",base:N.PRESSURE,prefixes:B.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:N.PRESSURE,prefixes:B.NONE,value:101325,offset:0},bar:{name:"bar",base:N.PRESSURE,prefixes:B.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:N.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:N.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:N.PRESSURE,prefixes:B.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:N.PRESSURE,prefixes:B.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:N.ELECTRIC_CHARGE,prefixes:B.LONG,value:1,offset:0},C:{name:"C",base:N.ELECTRIC_CHARGE,prefixes:B.SHORT,value:1,offset:0},farad:{name:"farad",base:N.ELECTRIC_CAPACITANCE,prefixes:B.LONG,value:1,offset:0},F:{name:"F",base:N.ELECTRIC_CAPACITANCE,prefixes:B.SHORT,value:1,offset:0},volt:{name:"volt",base:N.ELECTRIC_POTENTIAL,prefixes:B.LONG,value:1,offset:0},V:{name:"V",base:N.ELECTRIC_POTENTIAL,prefixes:B.SHORT,value:1,offset:0},ohm:{name:"ohm",base:N.ELECTRIC_RESISTANCE,prefixes:B.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:N.ELECTRIC_INDUCTANCE,prefixes:B.LONG,value:1,offset:0},H:{name:"H",base:N.ELECTRIC_INDUCTANCE,prefixes:B.SHORT,value:1,offset:0},siemens:{name:"siemens",base:N.ELECTRIC_CONDUCTANCE,prefixes:B.LONG,value:1,offset:0},S:{name:"S",base:N.ELECTRIC_CONDUCTANCE,prefixes:B.SHORT,value:1,offset:0},weber:{name:"weber",base:N.MAGNETIC_FLUX,prefixes:B.LONG,value:1,offset:0},Wb:{name:"Wb",base:N.MAGNETIC_FLUX,prefixes:B.SHORT,value:1,offset:0},tesla:{name:"tesla",base:N.MAGNETIC_FLUX_DENSITY,prefixes:B.LONG,value:1,offset:0},T:{name:"T",base:N.MAGNETIC_FLUX_DENSITY,prefixes:B.SHORT,value:1,offset:0},b:{name:"b",base:N.BIT,prefixes:B.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:N.BIT,prefixes:B.BINARY_LONG,value:1,offset:0},B:{name:"B",base:N.BIT,prefixes:B.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:N.BIT,prefixes:B.BINARY_LONG,value:8,offset:0}},ae={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function ve(X){if(X.number==="BigNumber"){var Z=uj(b);J.rad.value=new b(1),J.deg.value=Z.div(180),J.grad.value=Z.div(200),J.cycle.value=Z.times(2),J.arcsec.value=Z.div(648e3),J.arcmin.value=Z.div(10800)}else J.rad.value=1,J.deg.value=Math.PI/180,J.grad.value=Math.PI/200,J.cycle.value=Math.PI*2,J.arcsec.value=Math.PI/648e3,J.arcmin.value=Math.PI/10800;J.radian.value=J.rad.value,J.degree.value=J.deg.value,J.gradian.value=J.grad.value}ve(n),e&&e("config",function(X,Z){X.number!==Z.number&&ve(X)});var fe={si:{NONE:{unit:Q,prefix:B.NONE[""]},LENGTH:{unit:J.m,prefix:B.SHORT[""]},MASS:{unit:J.g,prefix:B.SHORT.k},TIME:{unit:J.s,prefix:B.SHORT[""]},CURRENT:{unit:J.A,prefix:B.SHORT[""]},TEMPERATURE:{unit:J.K,prefix:B.SHORT[""]},LUMINOUS_INTENSITY:{unit:J.cd,prefix:B.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:J.mol,prefix:B.SHORT[""]},ANGLE:{unit:J.rad,prefix:B.SHORT[""]},BIT:{unit:J.bits,prefix:B.SHORT[""]},FORCE:{unit:J.N,prefix:B.SHORT[""]},ENERGY:{unit:J.J,prefix:B.SHORT[""]},POWER:{unit:J.W,prefix:B.SHORT[""]},PRESSURE:{unit:J.Pa,prefix:B.SHORT[""]},ELECTRIC_CHARGE:{unit:J.C,prefix:B.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:J.F,prefix:B.SHORT[""]},ELECTRIC_POTENTIAL:{unit:J.V,prefix:B.SHORT[""]},ELECTRIC_RESISTANCE:{unit:J.ohm,prefix:B.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:J.H,prefix:B.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:J.S,prefix:B.SHORT[""]},MAGNETIC_FLUX:{unit:J.Wb,prefix:B.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:J.T,prefix:B.SHORT[""]},FREQUENCY:{unit:J.Hz,prefix:B.SHORT[""]}}};fe.cgs=JSON.parse(JSON.stringify(fe.si)),fe.cgs.LENGTH={unit:J.m,prefix:B.SHORT.c},fe.cgs.MASS={unit:J.g,prefix:B.SHORT[""]},fe.cgs.FORCE={unit:J.dyn,prefix:B.SHORT[""]},fe.cgs.ENERGY={unit:J.erg,prefix:B.NONE[""]},fe.us=JSON.parse(JSON.stringify(fe.si)),fe.us.LENGTH={unit:J.ft,prefix:B.NONE[""]},fe.us.MASS={unit:J.lbm,prefix:B.NONE[""]},fe.us.TEMPERATURE={unit:J.degF,prefix:B.NONE[""]},fe.us.FORCE={unit:J.lbf,prefix:B.NONE[""]},fe.us.ENERGY={unit:J.BTU,prefix:B.BTU[""]},fe.us.POWER={unit:J.hp,prefix:B.NONE[""]},fe.us.PRESSURE={unit:J.psi,prefix:B.NONE[""]},fe.auto=JSON.parse(JSON.stringify(fe.si));var Me=fe.auto;x.setUnitSystem=function(X){if(Gn(fe,X))Me=fe[X];else throw new Error("Unit system "+X+" does not exist. Choices are: "+Object.keys(fe).join(", "))},x.getUnitSystem=function(){for(var X in fe)if(Gn(fe,X)&&fe[X]===Me)return X},x.typeConverters={BigNumber:function(Z){return Z!=null&&Z.isFraction?new b(Z.n).div(Z.d).times(Z.s):new b(Z+"")},Fraction:function(Z){return new m(Z)},Complex:function(Z){return Z},number:function(Z){return Z!=null&&Z.isFraction?p(Z):Z}},x.prototype._numberConverter=function(){var X=x.typeConverters[this.valueType()];if(X)return X;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},x._getNumberConverter=function(X){if(!x.typeConverters[X])throw new TypeError('Unsupported type "'+X+'"');return x.typeConverters[X]};for(var ye in J)if(Gn(J,ye)){var we=J[ye];we.dimensions=we.base.dimensions}for(var Fe in ae)if(Gn(ae,Fe)){var Oe=J[ae[Fe]],re={};for(var _e in Oe)Gn(Oe,_e)&&(re[_e]=Oe[_e]);re.name=Fe,J[Fe]=re}x.isValidAlpha=function(Z){return/^[a-zA-Z]$/.test(Z)};function Ce(X){for(var Z=0;Z0&&!(x.isValidAlpha(S)||A(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+X+'"')}}return x.createUnit=function(X,Z){if(typeof X!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(Z&&Z.override){for(var he in X)if(Gn(X,he)&&x.deleteUnit(he),X[he].aliases)for(var Y=0;Y"u"||Z===null)&&(Z={}),typeof X!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Gn(J,X))throw new Error('Cannot create unit "'+X+'": a unit with that name already exists');Ce(X);var he=null,Y=[],ne=0,se,xe,Pe;if(Z&&Z.type==="Unit")he=Z.clone();else if(typeof Z=="string")Z!==""&&(se=Z);else if(typeof Z=="object")se=Z.definition,xe=Z.prefixes,ne=Z.offset,Pe=Z.baseName,Z.aliases&&(Y=Z.aliases.valueOf());else throw new TypeError('Cannot create unit "'+X+'" from "'+Z.toString()+'": expecting "string" or "Unit" or "Object"');if(Y){for(var z=0;z1e-12){be=!1;break}if(be){ue=!0,H.base=N[ge];break}}if(!ue){Pe=Pe||X+"_STUFF";var Re={dimensions:he.dimensions.slice(0)};Re.key=Pe,N[Pe]=Re,Me[Pe]={unit:H,prefix:B.NONE[""]},H.base=N[Pe]}}else{if(Pe=Pe||X+"_STUFF",L.indexOf(Pe)>=0)throw new Error('Cannot create new base unit "'+X+'": a base unit with that name already exists (and cannot be overridden)');L.push(Pe);for(var te in N)Gn(N,te)&&(N[te].dimensions[L.length-1]=0);for(var le={dimensions:[]},de=0;de{var{typed:e,Unit:n}=t;return e(jB,{Unit:function(i){return i.clone()},string:function(i){return n.isValuelessUnit(i)?new n(null,i):n.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,o){return new n(i,o)},"number | BigNumber | Fraction":function(i){return new n(i)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))})}),WB="createUnit",aye=["typed","Unit"],lye=dt(WB,aye,t=>{var{typed:e,Unit:n}=t;return e(WB,{"Object, Object":function(i,o){return n.createUnit(i,o)},Object:function(i){return n.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,o,s){var a={};return a[i]=o,n.createUnit(a,s)},"string, Unit | string | Object":function(i,o){var s={};return s[i]=o,n.createUnit(s,{})},string:function(i){var o={};return o[i]={},n.createUnit(o,{})}})}),cj=dt("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(n=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(n,r.valueType())(r.value)})}}),qB="cos",uye=["typed"],cye=dt(qB,uye,t=>{var{typed:e}=t,n=cj({typed:e});return e(qB,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),XB="sin",dye=["typed"],fye=dt(XB,dye,t=>{var{typed:e}=t,n=cj({typed:e});return e(XB,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),KB="add",hye=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],pye=dt(KB,hye,t=>{var{typed:e,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:o,SparseMatrix:s,concat:a}=t,l=aj({typed:e}),u=eve({typed:e,equalScalar:i}),c=lj({typed:e,DenseMatrix:o}),d=Qf({typed:e,matrix:n,concat:a});return e(KB,{"any, any":r,"any, any, ...any":e.referToSelf(f=>(h,p,g)=>{for(var b=f(h,p),m=0;m{var{typed:e,addScalar:n,multiplyScalar:r,conj:i,size:o}=t;return e(YB,{"Array | DenseMatrix, Array | DenseMatrix":a,"SparseMatrix, SparseMatrix":l});function s(c,d){var f=u(c),h=u(d),p,g;if(f.length===1)p=f[0];else if(f.length===2&&f[1]===1)p=f[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+f.join(", ")+")");if(h.length===1)g=h[0];else if(h.length===2&&h[1]===1)g=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(p!==g)throw new RangeError("Vectors must have equal length ("+p+" != "+g+")");if(p===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return p}function a(c,d){var f=s(c,d),h=Or(c)?c._data:c,p=Or(c)?c._datatype||c.getDataType():void 0,g=Or(d)?d._data:d,b=Or(d)?d._datatype||d.getDataType():void 0,m=u(c).length===2,w=u(d).length===2,x=n,_=r;if(p&&b&&p===b&&typeof p=="string"&&p!=="mixed"){var C=p;x=e.find(n,[C,C]),_=e.find(r,[C,C])}if(!m&&!w){for(var S=_(i(h[0]),g[0]),M=1;MS){_++;continue}C===S&&(b=m(b,w(h[x],g[_])),x++,_++)}return b}function u(c){return Or(c)?c.size():o(c)}}),ZB="det",vye=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],yye=dt(ZB,vye,t=>{var{typed:e,matrix:n,subtractScalar:r,multiply:i,divideScalar:o,isZero:s,unaryMinus:a}=t;return e(ZB,{any:function(c){return dr(c)},"Array | Matrix":function(c){var d;switch(Or(c)?d=c.size():Array.isArray(c)?(c=n(c),d=c.size()):d=[],d.length){case 0:return dr(c);case 1:if(d[0]===1)return dr(c.valueOf()[0]);if(d[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ir(d)+")");case 2:{var f=d[0],h=d[1];if(f===h)return l(c.clone().valueOf(),f);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+Ir(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ir(d)+")")}}});function l(u,c,d){if(c===1)return dr(u[0][0]);if(c===2)return r(i(u[0][0],u[1][1]),i(u[1][0],u[0][1]));for(var f=!1,h=new Array(c).fill(0).map((M,P)=>P),p=0;p{var{typed:e,matrix:n,divideScalar:r,addScalar:i,multiply:o,unaryMinus:s,det:a,identity:l,abs:u}=t;return e(QB,{"Array | Matrix":function(f){var h=Or(f)?f.size():To(f);switch(h.length){case 1:if(h[0]===1)return Or(f)?n([r(1,f.valueOf()[0])]):[r(1,f[0])];throw new RangeError("Matrix must be square (size: "+Ir(h)+")");case 2:{var p=h[0],g=h[1];if(p===g)return Or(f)?n(c(f.valueOf(),p,g),f.storage()):c(f,p,g);throw new RangeError("Matrix must be square (size: "+Ir(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ir(h)+")")}},any:function(f){return r(1,f)}});function c(d,f,h){var p,g,b,m,w;if(f===1){if(m=d[0][0],m===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,m)]]}else if(f===2){var x=a(d);if(x===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(d[1][1],x),r(s(d[0][1]),x)],[r(s(d[1][0]),x),r(d[0][0],x)]]}else{var _=d.concat();for(p=0;pM&&(M=u(_[p][S]),P=p),p++;if(M===0)throw Error("Cannot calculate inverse, determinant is zero");p=P,p!==S&&(w=_[S],_[S]=_[p],_[p]=w,w=C[S],C[S]=C[p],C[p]=w);var A=_[S],R=C[S];for(p=0;p{var{typed:e,matrix:n,multiply:r,equalScalar:i,divideScalar:o,inv:s}=t,a=hb({typed:e,equalScalar:i}),l=Zf({typed:e});return e("divide",wG({"Array | Matrix, Array | Matrix":function(c,d){return r(c,s(d))},"DenseMatrix, any":function(c,d){return l(c,d,o,!1)},"SparseMatrix, any":function(c,d){return a(c,d,o,!1)},"Array, any":function(c,d){return l(n(c),d,o,!1).valueOf()},"any, Array | Matrix":function(c,d){return r(c,s(d))}},o.signatures))}),pg=Ege({config:Gi}),fE=Pge({}),iN=Nge({}),oN=kge({}),ts=zge({Matrix:oN}),Xt=Ame({BigNumber:pg,Complex:fE,DenseMatrix:ts,Fraction:iN}),dj=v0e({typed:Xt}),mb=b0e({typed:Xt}),Cye=l0e({BigNumber:pg,typed:Xt}),Eye=hve({typed:Xt}),JB=cye({typed:Xt}),Xl=Zge({config:Gi,typed:Xt}),Mye=Tve({typed:Xt}),Tye=Vge({typed:Xt}),Aye=Xge({typed:Xt}),sN=ove({typed:Xt}),aN=o0e({typed:Xt}),e8=fye({typed:Xt}),lN=e0e({Matrix:oN,equalScalar:Xl,typed:Xt}),uN=w0e({typed:Xt}),cN=m0e({typed:Xt}),fj=d0e({Fraction:iN,typed:Xt}),Pye=Wge({typed:Xt}),Qr=h0e({DenseMatrix:ts,Matrix:oN,SparseMatrix:lN,typed:Xt}),dN=Dve({bignumber:Cye,fraction:fj,number:aN}),Dye=_ve({matrix:Qr,config:Gi,typed:Xt}),hE=Cve({BigNumber:pg,config:Gi,matrix:Qr,typed:Xt}),Jf=mve({isInteger:Tye,matrix:Qr,typed:Xt}),pE=Ive({numeric:dN,typed:Xt}),SD=Bve({DenseMatrix:ts,concat:Jf,equalScalar:Xl,matrix:Qr,typed:Xt}),hj=vve({BigNumber:pg,DenseMatrix:ts,SparseMatrix:lN,config:Gi,matrix:Qr,typed:Xt}),CT=Yve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),fN=kve({BigNumber:pg,DenseMatrix:ts,config:Gi,equalScalar:Xl,matrix:Qr,typed:Xt,zeros:hE}),Rye=Uve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),t8=uve({DenseMatrix:ts,concat:Jf,equalScalar:Xl,matrix:Qr,subtractScalar:uN,typed:Xt,unaryMinus:cN}),cS=pye({DenseMatrix:ts,SparseMatrix:lN,addScalar:mb,concat:Jf,equalScalar:Xl,matrix:Qr,typed:Xt}),Iye=gye({addScalar:mb,conj:Eye,multiplyScalar:sN,size:Dye,typed:Xt}),Nye=k0e({DenseMatrix:ts,config:Gi,equalScalar:Xl,matrix:Qr,round:fN,typed:Xt,zeros:hE}),j0=qve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),Fye=tye({config:Gi,numeric:dN,smaller:Rye,typed:Xt}),wi=ave({addScalar:mb,dot:Iye,equalScalar:Xl,matrix:Qr,multiplyScalar:sN,typed:Xt}),Oye=D0e({DenseMatrix:ts,config:Gi,equalScalar:Xl,matrix:Qr,round:fN,typed:Xt,zeros:hE}),kye=yye({divideScalar:pE,isZero:Aye,matrix:Qr,multiply:wi,subtractScalar:uN,typed:Xt,unaryMinus:cN}),Lye=N0e({Complex:fE,DenseMatrix:ts,ceil:Oye,equalScalar:Xl,floor:Nye,matrix:Qr,typed:Xt,zeros:hE}),Bye=Jve({config:Gi,larger:j0,numeric:dN,typed:Xt}),$ye=Gve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),pj=xye({abs:dj,addScalar:mb,det:kye,divideScalar:pE,identity:hj,matrix:Qr,multiply:wi,typed:Xt,unaryMinus:cN}),zye=Fve({Complex:fE,config:Gi,fraction:fj,identity:hj,inv:pj,matrix:Qr,multiply:wi,number:aN,typed:Xt}),Zp=iye({BigNumber:pg,Complex:fE,Fraction:iN,abs:dj,addScalar:mb,config:Gi,divideScalar:pE,equal:SD,fix:Lye,format:Mye,isNumeric:Pye,multiplyScalar:sN,number:aN,pow:zye,round:fN,subtractScalar:uN}),n8=lye({Unit:Zp,typed:Xt}),_o=Sye({divideScalar:pE,equalScalar:Xl,inv:pj,matrix:Qr,multiply:wi,typed:Xt}),Rt=sye({Unit:Zp,typed:Xt});const mj=Rt(299792458,"m/s"),gj=Rt(662607015e-42,"J s");var bs=(t=>(t.millimetre="mm",t.micrometre="um",t))(bs||{}),W0=(t=>(t.electronVolts="eV",t.kiloElectronVolts="keV",t))(W0||{}),ia=(t=>(t.nanometres="nm",t.angstroms="angstrom",t))(ia||{}),dS=(t=>(t.nanometres="nm^-1",t.angstroms="angstrom^-1",t))(dS||{}),q0=(t=>(t.radians="rad",t.degrees="deg",t))(q0||{});const Uye=t=>{const e=_o(wi(gj,mj),t.toSI());if(typeof e=="number"||!("units"in e))throw TypeError("The Units for constants h and c are wrong");return e},CD=t=>{const e=_o(wi(gj,mj),t.toSI());if(typeof e=="number"||!("units"in e))throw TypeError("units for constants h and c are wrong");return e},Qp=t=>{const e=parseFloat(t.trim());return!e&&e!=0?null:e};var Hye={BASE_URL:"https://diamondlightsource.github.io/dedi-web/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const r8=t=>{let e;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const h=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,h))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(Hye?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=e=t(r,i,l);return l},Vye=t=>t?r8(t):r8;var vj={exports:{}},yj={},bj={exports:{}},xj={};/** + (`+Ir(P,g)+", "+Ir(_,g)+") ==> "+(this._values?Ir(this._values[M],g):"X")}return x},i.prototype.toString=function(){return Ir(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(g){if(g){if(kr(g)&&(g=g.toNumber()),!Qn(g)||!or(g))throw new TypeError("The parameter k must be an integer number")}else g=0;var b=g>0?g:0,m=g<0?-g:0,w=this._size[0],x=this._size[1],_=Math.min(w-m,x-b),C=[],S=[],M=[];M[0]=0;for(var P=b;P0?m:0,M=m<0?-m:0,P=g[0],A=g[1],R=Math.min(P-M,A-S),F;if(gr(b)){if(b.length!==R)throw new Error("Invalid value array length");F=function(W){return b[W]}}else if(Or(b)){var $=b.size();if($.length!==1||$[0]!==R)throw new Error("Invalid matrix length");F=function(W){return b.get([W])}}else F=function(){return b};for(var j=[],k=[],U=[],G=0;G=0&&B=M||x[A]!==b)){var F=w?w[P]:void 0;x.splice(A,0,b),w&&w.splice(A,0,F),x.splice(A<=P?P+1:P,1),w&&w.splice(A<=P?P+1:P,1);continue}if(A=M||x[P]!==g)){var $=w?w[A]:void 0;x.splice(P,0,g),w&&w.splice(P,0,$),x.splice(P<=A?A+1:A,1),w&&w.splice(P<=A?A+1:A,1)}}},i},{isClass:!0}),t0e="number",n0e=["typed"];function r0e(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var n={"0b":2,"0o":8,"0x":16}[e[1]],r=e[2],i=e[3];return{input:t,radix:n,integerPart:r,fractionalPart:i}}else return null}function i0e(t){for(var e=parseInt(t.integerPart,t.radix),n=0,r=0;r{var{typed:e}=t,n=e("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var o=r0e(i);if(o)return i0e(o);var s=0,a=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);a&&(s=Number(a[2]),i=a[1]);var l=Number(i);if(isNaN(l))throw new SyntaxError('String "'+i+'" is not a valid number');if(a){if(l>2**s-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));l>=2**(s-1)&&(l=l-2**s)}return l},BigNumber:function(i){return i.toNumber()},Fraction:function(i){return i.valueOf()},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),null:function(i){return 0},"Unit, string | Unit":function(i,o){return i.toNumber(o)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))});return n.fromJSON=function(r){return parseFloat(r.value)},n}),s0e="bignumber",a0e=["typed","BigNumber"],l0e=dt(s0e,a0e,t=>{var{typed:e,BigNumber:n}=t;return e("bignumber",{"":function(){return new n(0)},number:function(i){return new n(i+"")},string:function(i){var o=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var s=o[2],a=n(o[1]),l=new n(2).pow(Number(s));if(a.gt(l.sub(1)))throw new SyntaxError('String "'.concat(i,'" is out of range'));var u=new n(2).pow(Number(s)-1);return a.gte(u)?a.sub(l):a}return new n(i)},BigNumber:function(i){return i},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),Fraction:function(i){return new n(i.n).div(i.d).times(i.s)},null:function(i){return new n(0)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))})}),u0e="fraction",c0e=["typed","Fraction"],d0e=dt(u0e,c0e,t=>{var{typed:e,Fraction:n}=t;return e("fraction",{number:function(i){if(!isFinite(i)||isNaN(i))throw new Error(i+" cannot be represented as a fraction");return new n(i)},string:function(i){return new n(i)},"number, number":function(i,o){return new n(i,o)},null:function(i){return new n(0)},BigNumber:function(i){return new n(i.toString())},Fraction:function(i){return i},Unit:e.referToSelf(r=>i=>{var o=i.clone();return o.value=r(i.value),o}),Object:function(i){return new n(i)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))})}),MB="matrix",f0e=["typed","Matrix","DenseMatrix","SparseMatrix"],h0e=dt(MB,f0e,t=>{var{typed:e,Matrix:n,DenseMatrix:r,SparseMatrix:i}=t;return e(MB,{"":function(){return o([])},string:function(a){return o([],a)},"string, string":function(a,l){return o([],a,l)},Array:function(a){return o(a)},Matrix:function(a){return o(a,a.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(s,a,l){if(a==="dense"||a==="default"||a===void 0)return new r(s,l);if(a==="sparse")return new i(s,l);throw new TypeError("Unknown matrix type "+JSON.stringify(a)+".")}}),TB="unaryMinus",p0e=["typed"],m0e=dt(TB,p0e,t=>{var{typed:e}=t;return e(TB,{number:ij,"Complex | BigNumber | Fraction":n=>n.neg(),Unit:e.referToSelf(n=>r=>{var i=r.clone();return i.value=e.find(n,i.valueType())(r.value),i}),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),AB="abs",g0e=["typed"],v0e=dt(AB,g0e,t=>{var{typed:e}=t;return e(AB,{number:ej,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),PB="addScalar",y0e=["typed"],b0e=dt(PB,y0e,t=>{var{typed:e}=t;return e(PB,{"number, number":tj,"Complex, Complex":function(r,i){return r.add(i)},"BigNumber, BigNumber":function(r,i){return r.plus(i)},"Fraction, Fraction":function(r,i){return r.add(i)},"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var o=r.clone();return o.value=e.find(n,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),DB="subtractScalar",x0e=["typed"],w0e=dt(DB,x0e,t=>{var{typed:e}=t;return e(DB,{"number, number":nj,"Complex, Complex":function(r,i){return r.sub(i)},"BigNumber, BigNumber":function(r,i){return r.minus(i)},"Fraction, Fraction":function(r,i){return r.sub(i)},"Unit, Unit":e.referToSelf(n=>(r,i)=>{if(r.value===null||r.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(i.value===null||i.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(i))throw new Error("Units do not match");var o=r.clone();return o.value=e.find(n,[o.valueType(),i.valueType()])(o.value,i.value),o.fixPrefix=!1,o})})}),_0e="matAlgo11xS0s",S0e=["typed","equalScalar"],hb=dt(_0e,S0e,t=>{var{typed:e,equalScalar:n}=t;return function(i,o,s,a){var l=i._values,u=i._index,c=i._ptr,d=i._size,f=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=d[0],p=d[1],g,b=n,m=0,w=s;typeof f=="string"&&(g=f,b=e.find(n,[g,g]),m=e.convert(0,g),o=e.convert(o,g),w=e.find(s,[g,g]));for(var x=[],_=[],C=[],S=0;S{var{typed:e,DenseMatrix:n}=t;return function(i,o,s,a){var l=i._values,u=i._index,c=i._ptr,d=i._size,f=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=d[0],p=d[1],g,b=s;typeof f=="string"&&(g=f,o=e.convert(o,g),b=e.find(s,[g,g]));for(var m=[],w=[],x=[],_=0;_{var{typed:e}=t;return function(i,o,s,a){var l=i._data,u=i._size,c=i._datatype,d,f=s;typeof c=="string"&&(d=c,o=e.convert(o,d),f=e.find(s,[d,d]));var h=u.length>0?n(f,0,u,u[0],l,o,a):[];return i.createDenseMatrix({data:h,size:dr(u),datatype:d})};function n(r,i,o,s,a,l,u){var c=[];if(i===o.length-1)for(var d=0;d{var{typed:e,config:n,round:r}=t;return e(xD,{number:function(o){return Jo(o,r(o),n.epsilon)?r(o):Math.ceil(o)},"number, number":function(o,s){if(Jo(o,r(o,s),n.epsilon))return r(o,s);var[a,l]="".concat(o,"e").split("e"),u=Math.ceil(Number("".concat(a,"e").concat(Number(l)+s)));return[a,l]="".concat(u,"e").split("e"),Number("".concat(a,"e").concat(Number(l)-s))}})}),D0e=dt(xD,A0e,t=>{var{typed:e,config:n,round:r,matrix:i,equalScalar:o,zeros:s,DenseMatrix:a}=t,l=hb({typed:e,equalScalar:o}),u=ql({typed:e,DenseMatrix:a}),c=Zf({typed:e}),d=P0e({typed:e,config:n,round:r});return e("ceil",{number:d.signatures.number,"number,number":d.signatures["number,number"],Complex:function(h){return h.ceil()},"Complex, number":function(h,p){return h.ceil(p)},"Complex, BigNumber":function(h,p){return h.ceil(p.toNumber())},BigNumber:function(h){return Ka(h,r(h),n.epsilon)?r(h):h.ceil()},"BigNumber, BigNumber":function(h,p){return Ka(h,r(h,p),n.epsilon)?r(h,p):h.toDecimalPlaces(p.toNumber(),od.ROUND_CEIL)},Fraction:function(h){return h.ceil()},"Fraction, number":function(h,p){return h.ceil(p)},"Fraction, BigNumber":function(h,p){return h.ceil(p.toNumber())},"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"Array, number | BigNumber":e.referToSelf(f=>(h,p)=>ui(h,g=>f(g,p))),"SparseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>l(h,p,f,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>c(h,p,f,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(f=>(h,p)=>c(i(p),h,f,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(f=>(h,p)=>o(h,0)?s(p.size(),p.storage()):p.storage()==="dense"?c(p,h,f,!0):u(p,h,f,!0))})}),wD="fix",R0e=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],I0e=dt(wD,["typed","ceil","floor"],t=>{var{typed:e,ceil:n,floor:r}=t;return e(wD,{number:function(o){return o>0?r(o):n(o)},"number, number":function(o,s){return o>0?r(o,s):n(o,s)}})}),N0e=dt(wD,R0e,t=>{var{typed:e,Complex:n,matrix:r,ceil:i,floor:o,equalScalar:s,zeros:a,DenseMatrix:l}=t,u=ql({typed:e,DenseMatrix:l}),c=Zf({typed:e}),d=I0e({typed:e,ceil:i,floor:o});return e("fix",{number:d.signatures.number,"number, number | BigNumber":d.signatures["number,number"],Complex:function(h){return new n(h.re>0?Math.floor(h.re):Math.ceil(h.re),h.im>0?Math.floor(h.im):Math.ceil(h.im))},"Complex, number":function(h,p){return new n(h.re>0?o(h.re,p):i(h.re,p),h.im>0?o(h.im,p):i(h.im,p))},"Complex, BigNumber":function(h,p){var g=p.toNumber();return new n(h.re>0?o(h.re,g):i(h.re,g),h.im>0?o(h.im,g):i(h.im,g))},BigNumber:function(h){return h.isNegative()?i(h):o(h)},"BigNumber, number | BigNumber":function(h,p){return h.isNegative()?i(h,p):o(h,p)},Fraction:function(h){return h.s<0?h.ceil():h.floor()},"Fraction, number | BigNumber":function(h,p){return h.s<0?i(h,p):o(h,p)},"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"Array | Matrix, number | BigNumber":e.referToSelf(f=>(h,p)=>ui(h,g=>f(g,p))),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(f=>(h,p)=>c(r(p),h,f,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(f=>(h,p)=>s(h,0)?a(p.size(),p.storage()):p.storage()==="dense"?c(p,h,f,!0):u(p,h,f,!0))})}),_D="floor",F0e=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],O0e=dt(_D,["typed","config","round"],t=>{var{typed:e,config:n,round:r}=t;return e(_D,{number:function(o){return Jo(o,r(o),n.epsilon)?r(o):Math.floor(o)},"number, number":function(o,s){if(Jo(o,r(o,s),n.epsilon))return r(o,s);var[a,l]="".concat(o,"e").split("e"),u=Math.floor(Number("".concat(a,"e").concat(Number(l)+s)));return[a,l]="".concat(u,"e").split("e"),Number("".concat(a,"e").concat(Number(l)-s))}})}),k0e=dt(_D,F0e,t=>{var{typed:e,config:n,round:r,matrix:i,equalScalar:o,zeros:s,DenseMatrix:a}=t,l=hb({typed:e,equalScalar:o}),u=ql({typed:e,DenseMatrix:a}),c=Zf({typed:e}),d=O0e({typed:e,config:n,round:r});return e("floor",{number:d.signatures.number,"number,number":d.signatures["number,number"],Complex:function(h){return h.floor()},"Complex, number":function(h,p){return h.floor(p)},"Complex, BigNumber":function(h,p){return h.floor(p.toNumber())},BigNumber:function(h){return Ka(h,r(h),n.epsilon)?r(h):h.floor()},"BigNumber, BigNumber":function(h,p){return Ka(h,r(h,p),n.epsilon)?r(h,p):h.toDecimalPlaces(p.toNumber(),od.ROUND_FLOOR)},Fraction:function(h){return h.floor()},"Fraction, number":function(h,p){return h.floor(p)},"Fraction, BigNumber":function(h,p){return h.floor(p.toNumber())},"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"Array, number | BigNumber":e.referToSelf(f=>(h,p)=>ui(h,g=>f(g,p))),"SparseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>l(h,p,f,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>c(h,p,f,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(f=>(h,p)=>c(i(p),h,f,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(f=>(h,p)=>o(h,0)?s(p.size(),p.storage()):p.storage()==="dense"?c(p,h,f,!0):u(p,h,f,!0))})}),L0e="matAlgo03xDSf",B0e=["typed"],hg=dt(L0e,B0e,t=>{var{typed:e}=t;return function(r,i,o,s){var a=r._data,l=r._size,u=r._datatype||r.getDataType(),c=i._values,d=i._index,f=i._ptr,h=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Rn(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],b=l[1],m,w=0,x=o;typeof u=="string"&&u===p&&u!=="mixed"&&(m=u,w=e.convert(0,m),x=e.find(o,[m,m]));for(var _=[],C=0;C{var{typed:e,equalScalar:n}=t;return function(i,o,s){var a=i._values,l=i._index,u=i._ptr,c=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,h=o._index,p=o._ptr,g=o._size,b=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==g.length)throw new Rn(c.length,g.length);if(c[0]!==g[0]||c[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+g+")");var m=c[0],w=c[1],x,_=n,C=0,S=s;typeof d=="string"&&d===b&&d!=="mixed"&&(x=d,_=e.find(n,[x,x]),C=e.convert(0,x),S=e.find(s,[x,x]));var M=a&&f?[]:void 0,P=[],A=[],R=M?[]:void 0,F=M?[]:void 0,$=[],j=[],k,U,G,B;for(U=0;U{var{typed:e}=t;return function(i,o,s){var a=i._data,l=i._size,u=i._datatype,c=o._data,d=o._size,f=o._datatype,h=[];if(l.length!==d.length)throw new Rn(l.length,d.length);for(var p=0;p0?n(b,0,h,h[0],a,c):[];return i.createDenseMatrix({data:m,size:h,datatype:g})};function n(r,i,o,s,a,l){var u=[];if(i===o.length-1)for(var c=0;c{var{concat:e}=t;return function(i,o){var s=Math.max(i._size.length,o._size.length);if(i._size.length===o._size.length&&i._size.every((p,g)=>p===o._size[g]))return[i,o];for(var a=n(i._size,s,0),l=n(o._size,s,0),u=[],c=0;c{var{typed:e,matrix:n,concat:r}=t,i=G0e({typed:e}),o=Zf({typed:e}),s=q0e({concat:r});return function(l){var u=l.elop,c=l.SD||l.DS,d;u?(d={"DenseMatrix, DenseMatrix":(g,b)=>i(...s(g,b),u),"Array, Array":(g,b)=>i(...s(n(g),n(b)),u).valueOf(),"Array, DenseMatrix":(g,b)=>i(...s(n(g),b),u),"DenseMatrix, Array":(g,b)=>i(...s(g,n(b)),u)},l.SS&&(d["SparseMatrix, SparseMatrix"]=(g,b)=>l.SS(...s(g,b),u,!1)),l.DS&&(d["DenseMatrix, SparseMatrix"]=(g,b)=>l.DS(...s(g,b),u,!1),d["Array, SparseMatrix"]=(g,b)=>l.DS(...s(n(g),b),u,!1)),c&&(d["SparseMatrix, DenseMatrix"]=(g,b)=>c(...s(b,g),u,!0),d["SparseMatrix, Array"]=(g,b)=>c(...s(n(b),g),u,!0))):(d={"DenseMatrix, DenseMatrix":e.referToSelf(g=>(b,m)=>i(...s(b,m),g)),"Array, Array":e.referToSelf(g=>(b,m)=>i(...s(n(b),n(m)),g).valueOf()),"Array, DenseMatrix":e.referToSelf(g=>(b,m)=>i(...s(n(b),m),g)),"DenseMatrix, Array":e.referToSelf(g=>(b,m)=>i(...s(b,n(m)),g))},l.SS&&(d["SparseMatrix, SparseMatrix"]=e.referToSelf(g=>(b,m)=>l.SS(...s(b,m),g,!1))),l.DS&&(d["DenseMatrix, SparseMatrix"]=e.referToSelf(g=>(b,m)=>l.DS(...s(b,m),g,!1)),d["Array, SparseMatrix"]=e.referToSelf(g=>(b,m)=>l.DS(...s(n(b),m),g,!1))),c&&(d["SparseMatrix, DenseMatrix"]=e.referToSelf(g=>(b,m)=>c(...s(m,b),g,!0)),d["SparseMatrix, Array"]=e.referToSelf(g=>(b,m)=>c(...s(n(m),b),g,!0))));var f=l.scalar||"any",h=l.Ds||l.Ss;h&&(u?(d["DenseMatrix,"+f]=(g,b)=>o(g,b,u,!1),d[f+", DenseMatrix"]=(g,b)=>o(b,g,u,!0),d["Array,"+f]=(g,b)=>o(n(g),b,u,!1).valueOf(),d[f+", Array"]=(g,b)=>o(n(b),g,u,!0).valueOf()):(d["DenseMatrix,"+f]=e.referToSelf(g=>(b,m)=>o(b,m,g,!1)),d[f+", DenseMatrix"]=e.referToSelf(g=>(b,m)=>o(m,b,g,!0)),d["Array,"+f]=e.referToSelf(g=>(b,m)=>o(n(b),m,g,!1).valueOf()),d[f+", Array"]=e.referToSelf(g=>(b,m)=>o(n(m),b,g,!0).valueOf())));var p=l.sS!==void 0?l.sS:l.Ss;return u?(l.Ss&&(d["SparseMatrix,"+f]=(g,b)=>l.Ss(g,b,u,!1)),p&&(d[f+", SparseMatrix"]=(g,b)=>p(b,g,u,!0))):(l.Ss&&(d["SparseMatrix,"+f]=e.referToSelf(g=>(b,m)=>l.Ss(b,m,g,!1))),p&&(d[f+", SparseMatrix"]=e.referToSelf(g=>(b,m)=>p(m,b,g,!0)))),u&&u.signatures&&wG(d,u.signatures),d}}),Y0e="matAlgo01xDSid",Z0e=["typed"],aj=dt(Y0e,Z0e,t=>{var{typed:e}=t;return function(r,i,o,s){var a=r._data,l=r._size,u=r._datatype||r.getDataType(),c=i._values,d=i._index,f=i._ptr,h=i._size,p=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(l.length!==h.length)throw new Rn(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var g=l[0],b=l[1],m=typeof u=="string"&&u!=="mixed"&&u===p?u:void 0,w=m?e.find(o,[m,m]):o,x,_,C=[];for(x=0;x{var{typed:e,equalScalar:n}=t;return function(i,o,s){var a=i._values,l=i._index,u=i._ptr,c=i._size,d=i._datatype||i._data===void 0?i._datatype:i.getDataType(),f=o._values,h=o._index,p=o._ptr,g=o._size,b=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==g.length)throw new Rn(c.length,g.length);if(c[0]!==g[0]||c[1]!==g[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+g+")");var m=c[0],w=c[1],x,_=n,C=0,S=s;typeof d=="string"&&d===b&&d!=="mixed"&&(x=d,_=e.find(n,[x,x]),C=e.convert(0,x),S=e.find(s,[x,x]));var M=a&&f?[]:void 0,P=[],A=[],R=a&&f?[]:void 0,F=a&&f?[]:void 0,$=[],j=[],k,U,G,B,L;for(U=0;U{var{typed:e,DenseMatrix:n}=t;return function(i,o,s,a){var l=i._values,u=i._index,c=i._ptr,d=i._size,f=i._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var h=d[0],p=d[1],g,b=s;typeof f=="string"&&(g=f,o=e.convert(o,g),b=e.find(s,[g,g]));for(var m=[],w=[],x=[],_=0;_{var{typed:e}=t;return e("multiplyScalar",{"number, number":rj,"Complex, Complex":function(r,i){return r.mul(i)},"BigNumber, BigNumber":function(r,i){return r.times(i)},"Fraction, Fraction":function(r,i){return r.mul(i)},"number | Fraction | BigNumber | Complex, Unit":(n,r)=>r.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,r)=>n.multiply(r)})}),RB="multiply",sve=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],ave=dt(RB,sve,t=>{var{typed:e,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:o,dot:s}=t,a=hb({typed:e,equalScalar:o}),l=Zf({typed:e});function u(C,S){switch(C.length){case 1:switch(S.length){case 1:if(C[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(C[0]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+C[0]+") must match Matrix rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;case 2:switch(S.length){case 1:if(C[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+C[1]+") must match Vector length ("+S[0]+")");break;case 2:if(C[1]!==S[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+C[1]+") must match Matrix B rows ("+S[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+S.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+C.length+" dimensions)")}}function c(C,S,M){if(M===0)throw new Error("Cannot multiply two empty vectors");return s(C,S)}function d(C,S){if(S.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return f(C,S)}function f(C,S){var M=C._data,P=C._size,A=C._datatype||C.getDataType(),R=S._data,F=S._size,$=S._datatype||S.getDataType(),j=P[0],k=F[1],U,G=r,B=i;A&&$&&A===$&&typeof A=="string"&&A!=="mixed"&&(U=A,G=e.find(r,[U,U]),B=e.find(i,[U,U]));for(var L=[],N=0;NMe)for(var we=0,Fe=0;Fe(S,M)=>{u(To(S),To(M));var P=C(n(S),n(M));return Or(P)?P.valueOf():P}),"Matrix, Matrix":function(S,M){var P=S.size(),A=M.size();return u(P,A),P.length===1?A.length===1?c(S,M,P[0]):d(S,M):A.length===1?h(S,M):p(S,M)},"Matrix, Array":e.referTo("Matrix,Matrix",C=>(S,M)=>C(S,n(M))),"Array, Matrix":e.referToSelf(C=>(S,M)=>C(n(S,M.storage()),M)),"SparseMatrix, any":function(S,M){return a(S,M,i,!1)},"DenseMatrix, any":function(S,M){return l(S,M,i,!1)},"any, SparseMatrix":function(S,M){return a(M,S,i,!0)},"any, DenseMatrix":function(S,M){return l(M,S,i,!0)},"Array, any":function(S,M){return l(n(S),M,i,!1).valueOf()},"any, Array":function(S,M){return l(n(M),S,i,!0).valueOf()},"any, any":i,"any, any, ...any":e.referToSelf(C=>(S,M,P)=>{for(var A=C(S,M),R=0;R{var{typed:e,matrix:n,equalScalar:r,subtractScalar:i,unaryMinus:o,DenseMatrix:s,concat:a}=t,l=aj({typed:e}),u=hg({typed:e}),c=U0e({typed:e,equalScalar:r}),d=lj({typed:e,DenseMatrix:s}),f=ql({typed:e,DenseMatrix:s}),h=Qf({typed:e,matrix:n,concat:a});return e(IB,{"any, any":i},h({elop:i,SS:c,DS:l,SD:u,Ss:f,sS:d}))}),cve="matAlgo07xSSf",dve=["typed","DenseMatrix"],pb=dt(cve,dve,t=>{var{typed:e,DenseMatrix:n}=t;return function(o,s,a){var l=o._size,u=o._datatype||o._data===void 0?o._datatype:o.getDataType(),c=s._size,d=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(l.length!==c.length)throw new Rn(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var f=l[0],h=l[1],p,g=0,b=a;typeof u=="string"&&u===d&&u!=="mixed"&&(p=u,g=e.convert(0,p),b=e.find(a,[p,p]));var m,w,x=[];for(m=0;m{var{typed:e}=t;return e(NB,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),"Array | Matrix":e.referToSelf(n=>r=>ui(r,n))})}),FB="concat",pve=["typed","matrix","isInteger"],mve=dt(FB,pve,t=>{var{typed:e,matrix:n,isInteger:r}=t;return e(FB,{"...Array | Matrix | number | BigNumber":function(o){var s,a=o.length,l=-1,u,c=!1,d=[];for(s=0;s0&&l>u)throw new wd(l,u+1)}else{var h=dr(f).valueOf(),p=To(h);if(d[s]=h,u=l,l=p.length-1,s>0&&l!==u)throw new Rn(u+1,l+1)}}if(d.length===0)throw new SyntaxError("At least one matrix expected");for(var g=d.shift();d.length;)g=NG(g,d.shift(),l);return c?n(g):g},"...string":function(o){return o.join("")}})}),OB="identity",gve=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],vve=dt(OB,gve,t=>{var{typed:e,config:n,matrix:r,BigNumber:i,DenseMatrix:o,SparseMatrix:s}=t;return e(OB,{"":function(){return n.matrix==="Matrix"?r([]):[]},string:function(c){return r(c)},"number | BigNumber":function(c){return l(c,c,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,d){return l(c,c,d)},"number | BigNumber, number | BigNumber":function(c,d){return l(c,d,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,d,f){return l(c,d,f)},Array:function(c){return a(c)},"Array, string":function(c,d){return a(c,d)},Matrix:function(c){return a(c.valueOf(),c.storage())},"Matrix, string":function(c,d){return a(c.valueOf(),d)}});function a(u,c){switch(u.length){case 0:return c?r(c):[];case 1:return l(u[0],u[0],c);case 2:return l(u[0],u[1],c);default:throw new Error("Vector containing two values expected")}}function l(u,c,d){var f=kr(u)||kr(c)?i:null;if(kr(u)&&(u=u.toNumber()),kr(c)&&(c=c.toNumber()),!or(u)||u<1)throw new Error("Parameters in function identity must be positive integers");if(!or(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var h=f?new i(1):1,p=f?new f(0):0,g=[u,c];if(d){if(d==="sparse")return s.diagonal(g,h,0,p);if(d==="dense")return o.diagonal(g,h,0,p);throw new TypeError('Unknown matrix type "'.concat(d,'"'))}for(var b=Y_([],g,p),m=u{var{typed:e,config:n,matrix:r}=t;return e(kB,{Matrix:function(o){return o.create(o.size())},Array:To,string:function(o){return n.matrix==="Array"?[o.length]:r([o.length])},"number | Complex | BigNumber | Unit | boolean | null":function(o){return n.matrix==="Array"?[]:r?r([]):xve()}})}),LB="zeros",Sve=["typed","config","matrix","BigNumber"],Cve=dt(LB,Sve,t=>{var{typed:e,config:n,matrix:r,BigNumber:i}=t;return e(LB,{"":function(){return n.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(u){var c=u[u.length-1];if(typeof c=="string"){var d=u.pop();return o(u,d)}else return n.matrix==="Array"?o(u):o(u,"default")},Array:o,Matrix:function(u){var c=u.storage();return o(u.valueOf(),c)},"Array | Matrix, string":function(u,c){return o(u.valueOf(),c)}});function o(l,u){var c=s(l),d=c?new i(0):0;if(a(l),u){var f=r(u);return l.length>0?f.resize(l,d):f}else{var h=[];return l.length>0?Y_(h,l,d):h}}function s(l){var u=!1;return l.forEach(function(c,d,f){kr(c)&&(u=!0,f[d]=c.toNumber())}),u}function a(l){l.forEach(function(u){if(typeof u!="number"||!or(u)||u<0)throw new Error("Parameters in function zeros must be positive integers")})}});function Eve(t,e,n){return e=Lm(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iS(t,e,n){var r;return String(t).indexOf("Unexpected type")!==-1?(r=arguments.length>2?" (type: "+aa(n)+", value: "+JSON.stringify(n)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+r)):String(t).indexOf("complex numbers")!==-1?(r=arguments.length>2?" (type: "+aa(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+r)):t}var BB="format",Mve=["typed"],Tve=dt(BB,Mve,t=>{var{typed:e}=t;return e(BB,{any:Ir,"any, Object | function | number | BigNumber":Ir})}),Ave="numeric",Pve=["number","?bignumber","?fraction"],Dve=dt(Ave,Pve,t=>{var{number:e,bignumber:n,fraction:r}=t,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:s=>e(s),BigNumber:n?s=>n(s):yve,Fraction:r?s=>r(s):bve};return function(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",u=arguments.length>2?arguments[2]:void 0;if(u!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=aa(a);if(!(c in i))throw new TypeError("Cannot convert "+a+' of type "'+c+'"; valid input types are '+Object.keys(i).join(", "));if(!(l in o))throw new TypeError("Cannot convert "+a+' to type "'+l+'"; valid output types are '+Object.keys(o).join(", "));return l===c?a:o[l](a)}}),$B="divideScalar",Rve=["typed","numeric"],Ive=dt($B,Rve,t=>{var{typed:e,numeric:n}=t;return e($B,{"number, number":function(i,o){return i/o},"Complex, Complex":function(i,o){return i.div(o)},"BigNumber, BigNumber":function(i,o){return i.div(o)},"Fraction, Fraction":function(i,o){return i.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(r,i)=>r.divide(i),"number | Fraction | Complex | BigNumber, Unit":(r,i)=>i.divideInto(r)})}),zB="pow",Nve=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],Fve=dt(zB,Nve,t=>{var{typed:e,config:n,identity:r,multiply:i,matrix:o,inv:s,number:a,fraction:l,Complex:u}=t;return e(zB,{"number, number":c,"Complex, Complex":function(p,g){return p.pow(g)},"BigNumber, BigNumber":function(p,g){return g.isInteger()||p>=0||n.predictable?p.pow(g):new u(p.toNumber(),0).pow(g.toNumber(),0)},"Fraction, Fraction":function(p,g){var b=p.pow(g);if(b!=null)return b;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(p.valueOf(),g.valueOf())},"Array, number":d,"Array, BigNumber":function(p,g){return d(p,g.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(p,g){return f(p,g.toNumber())},"Unit, number | BigNumber":function(p,g){return p.pow(g)}});function c(h,p){if(n.predictable&&!or(p)&&h<0)try{var g=l(p),b=a(g);if((p===b||Math.abs((p-b)/p)<1e-14)&&g.d%2===1)return(g.n%2===0?1:-1)*Math.pow(-h,p)}catch{}return n.predictable&&(h<-1&&p===1/0||h>-1&&h<0&&p===-1/0)?NaN:or(p)||h>=0||n.predictable?oj(h,p):h*h<1&&p===1/0||h*h>1&&p===-1/0?0:new u(h,0).pow(p,0)}function d(h,p){if(!or(p))throw new TypeError("For A^b, b must be an integer (value is "+p+")");var g=To(h);if(g.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+g.length+" dimensions)");if(g[0]!==g[1])throw new Error("For A^b, A must be square (size is "+g[0]+"x"+g[1]+")");if(p<0)try{return d(s(h),-p)}catch(w){throw w.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+p+")"):w}for(var b=r(g[0]).valueOf(),m=h;p>=1;)(p&1)===1&&(b=i(m,b)),p>>=1,m=i(m,m);return b}function f(h,p){return o(d(h.valueOf(),p))}}),$h="Number of decimals in function round must be an integer",UB="round",Ove=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],kve=dt(UB,Ove,t=>{var{typed:e,config:n,matrix:r,equalScalar:i,zeros:o,BigNumber:s,DenseMatrix:a}=t,l=hb({typed:e,equalScalar:i}),u=ql({typed:e,DenseMatrix:a}),c=Zf({typed:e});function d(f){return Math.abs(cb(f).exponent)}return e(UB,{number:function(h){var p=m0(h,d(n.epsilon)),g=Jo(h,p,n.epsilon)?p:h;return m0(g)},"number, number":function(h,p){var g=d(n.epsilon);if(p>=g)return m0(h,p);var b=m0(h,g),m=Jo(h,b,n.epsilon)?b:h;return m0(m,p)},"number, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);return new s(h).toDecimalPlaces(p.toNumber())},Complex:function(h){return h.round()},"Complex, number":function(h,p){if(p%1)throw new TypeError($h);return h.round(p)},"Complex, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);var g=p.toNumber();return h.round(g)},BigNumber:function(h){var p=new s(h).toDecimalPlaces(d(n.epsilon)),g=Ka(h,p,n.epsilon)?p:h;return g.toDecimalPlaces(0)},"BigNumber, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);var g=d(n.epsilon);if(p>=g)return h.toDecimalPlaces(p.toNumber());var b=h.toDecimalPlaces(g),m=Ka(h,b,n.epsilon)?b:h;return m.toDecimalPlaces(p.toNumber())},Fraction:function(h){return h.round()},"Fraction, number":function(h,p){if(p%1)throw new TypeError($h);return h.round(p)},"Fraction, BigNumber":function(h,p){if(!p.isInteger())throw new TypeError($h);return h.round(p.toNumber())},"Unit, number, Unit":e.referToSelf(f=>function(h,p,g){var b=h.toNumeric(g);return g.multiply(f(b,p))}),"Unit, BigNumber, Unit":e.referToSelf(f=>(h,p,g)=>f(h,p.toNumber(),g)),"Unit, Unit":e.referToSelf(f=>(h,p)=>f(h,0,p)),"Array | Matrix, number, Unit":e.referToSelf(f=>(h,p,g)=>ui(h,b=>f(b,p,g))),"Array | Matrix, BigNumber, Unit":e.referToSelf(f=>(h,p,g)=>f(h,p.toNumber(),g)),"Array | Matrix, Unit":e.referToSelf(f=>(h,p)=>f(h,0,p)),"Array | Matrix":e.referToSelf(f=>h=>ui(h,f)),"SparseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>l(h,p,f,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(f=>(h,p)=>c(h,p,f,!1)),"Array, number | BigNumber":e.referToSelf(f=>(h,p)=>c(r(h),p,f,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(f=>(h,p)=>i(h,0)?o(p.size(),p.storage()):u(p,h,f,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(f=>(h,p)=>i(h,0)?o(p.size(),p.storage()):c(p,h,f,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(f=>(h,p)=>c(r(p),h,f,!0).valueOf())})}),oS="equal",Lve=["typed","matrix","equalScalar","DenseMatrix","concat"],Bve=dt(oS,Lve,t=>{var{typed:e,matrix:n,equalScalar:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:n,concat:o});return e(oS,$ve({typed:e,equalScalar:r}),u({elop:r,SS:a,DS:s,Ss:l}))}),$ve=dt(oS,["typed","equalScalar"],t=>{var{typed:e,equalScalar:n}=t;return e(oS,{"any, any":function(i,o){return i===null?o===null:o===null?i===null:i===void 0?o===void 0:o===void 0?i===void 0:n(i,o)}})}),sS="smaller",zve=["typed","config","matrix","DenseMatrix","concat"],Uve=dt(sS,zve,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(sS,Hve({typed:e,config:n}),{"boolean, boolean":(d,f)=>dd.compare(f)===-1,"Complex, Complex":function(f,h){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),Hve=dt(sS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(sS,{"number, number":function(i,o){return i{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(aS,jve({typed:e,config:n}),{"boolean, boolean":(d,f)=>d<=f,"BigNumber, BigNumber":function(f,h){return f.lte(h)||Ka(f,h,n.epsilon)},"Fraction, Fraction":(d,f)=>d.compare(f)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),jve=dt(aS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(aS,{"number, number":function(i,o){return i<=o||Jo(i,o,n.epsilon)}})}),lS="larger",Wve=["typed","config","matrix","DenseMatrix","concat"],qve=dt(lS,Wve,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(lS,Xve({typed:e,config:n}),{"boolean, boolean":(d,f)=>d>f,"BigNumber, BigNumber":function(f,h){return f.gt(h)&&!Ka(f,h,n.epsilon)},"Fraction, Fraction":(d,f)=>d.compare(f)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),Xve=dt(lS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(lS,{"number, number":function(i,o){return i>o&&!Jo(i,o,n.epsilon)}})}),uS="largerEq",Kve=["typed","config","matrix","DenseMatrix","concat"],Yve=dt(uS,Kve,t=>{var{typed:e,config:n,matrix:r,DenseMatrix:i,concat:o}=t,s=hg({typed:e}),a=pb({typed:e,DenseMatrix:i}),l=ql({typed:e,DenseMatrix:i}),u=Qf({typed:e,matrix:r,concat:o}),c=fb({typed:e});return e(uS,Zve({typed:e,config:n}),{"boolean, boolean":(d,f)=>d>=f,"BigNumber, BigNumber":function(f,h){return f.gte(h)||Ka(f,h,n.epsilon)},"Fraction, Fraction":(d,f)=>d.compare(f)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,u({SS:a,DS:s,Ss:l}))}),Zve=dt(uS,["typed","config"],t=>{var{typed:e,config:n}=t;return e(uS,{"number, number":function(i,o){return i>=o||Jo(i,o,n.epsilon)}})}),HB="max",Qve=["typed","config","numeric","larger"],Jve=dt(HB,Qve,t=>{var{typed:e,config:n,numeric:r,larger:i}=t;return e(HB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(l,u){return QG(l,u.valueOf(),o)},"...":function(l){if(ZG(l))throw new TypeError("Scalar values expected in function max");return s(l)}});function o(a,l){try{return i(a,l)?a:l}catch(u){throw iS(u,"max",l)}}function s(a){var l;if(rN(a,function(u){try{isNaN(u)&&typeof u=="number"?l=NaN:(l===void 0||i(u,l))&&(l=u)}catch(c){throw iS(c,"max",u)}}),l===void 0)throw new Error("Cannot calculate max of an empty array");return typeof l=="string"&&(l=r(l,n.number)),l}}),VB="min",eye=["typed","config","numeric","smaller"],tye=dt(VB,eye,t=>{var{typed:e,config:n,numeric:r,smaller:i}=t;return e(VB,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(l,u){return QG(l,u.valueOf(),o)},"...":function(l){if(ZG(l))throw new TypeError("Scalar values expected in function min");return s(l)}});function o(a,l){try{return i(a,l)?a:l}catch(u){throw iS(u,"min",l)}}function s(a){var l;if(rN(a,function(u){try{isNaN(u)&&typeof u=="number"?l=NaN:(l===void 0||i(u,l))&&(l=u)}catch(c){throw iS(c,"min",u)}}),l===void 0)throw new Error("Cannot calculate min of an empty array");return typeof l=="string"&&(l=r(l,n.number)),l}});db(function(t){return new t(1).exp()},{hasher:dE});db(function(t){return new t(1).plus(new t(5).sqrt()).div(2)},{hasher:dE});var uj=db(function(t){return t.acos(-1)},{hasher:dE});db(function(t){return uj(t).times(2)},{hasher:dE});function dE(t){return t[0].precision}function GB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function ST(t){for(var e=1;e{var{on:e,config:n,addScalar:r,subtractScalar:i,multiplyScalar:o,divideScalar:s,pow:a,abs:l,fix:u,round:c,equal:d,isNumeric:f,format:h,number:p,Complex:g,BigNumber:b,Fraction:m}=t,w=p;function x(X,Z){if(!(this instanceof x))throw new Error("Constructor must be called with the new operator");if(!(X==null||f(X)||gv(X)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,Z===void 0)this.units=[],this.dimensions=L.map(Y=>0);else if(typeof Z=="string"){var he=x.parse(Z);this.units=he.units,this.dimensions=he.dimensions}else if(_c(Z)&&Z.value===null)this.fixPrefix=Z.fixPrefix,this.skipAutomaticSimplification=Z.skipAutomaticSimplification,this.dimensions=Z.dimensions.slice(0),this.units=Z.units.map(Y=>Xp({},Y));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(X)}Object.defineProperty(x,"name",{value:"Unit"}),x.prototype.constructor=x,x.prototype.type="Unit",x.prototype.isUnit=!0;var _,C,S;function M(){for(;S===" "||S===" ";)R()}function P(X){return X>="0"&&X<="9"||X==="."}function A(X){return X>="0"&&X<="9"}function R(){C++,S=_.charAt(C)}function F(X){C=X,S=_.charAt(C)}function $(){var X="",Z=C;if(S==="+"?R():S==="-"&&(X+=S,R()),!P(S))return F(Z),null;if(S==="."){if(X+=S,R(),!A(S))return F(Z),null}else{for(;A(S);)X+=S,R();S==="."&&(X+=S,R())}for(;A(S);)X+=S,R();if(S==="E"||S==="e"){var he="",Y=C;if(he+=S,R(),(S==="+"||S==="-")&&(he+=S,R()),!A(S))return F(Y),X;for(X=X+he;A(S);)X+=S,R()}return X}function j(){for(var X="";A(S)||x.isValidAlpha(S);)X+=S,R();var Z=X.charAt(0);return x.isValidAlpha(Z)?X:null}function k(X){return S===X?(R(),X):null}x.parse=function(X,Z){if(Z=Z||{},_=X,C=-1,S="",typeof _!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var he=new x;he.units=[];var Y=1,ne=!1;R(),M();var se=$(),xe=null;if(se){if(n.number==="BigNumber")xe=new b(se);else if(n.number==="Fraction")try{xe=new m(se)}catch{xe=parseFloat(se)}else xe=parseFloat(se);M(),k("*")?(Y=1,ne=!0):k("/")&&(Y=-1,ne=!0)}for(var Pe=[],z=1;;){for(M();S==="(";)Pe.push(Y),z*=Y,Y=1,R(),M();var H=void 0;if(S){var te=S;if(H=j(),H===null)throw new SyntaxError('Unexpected "'+te+'" in "'+_+'" at index '+C.toString())}else break;var le=U(H);if(le===null)throw new SyntaxError('Unit "'+H+'" not found.');var de=Y*z;if(M(),k("^")){M();var ue=$();if(ue===null)throw new SyntaxError('In "'+X+'", "^" must be followed by a floating-point number');de*=ue}he.units.push({unit:le.unit,prefix:le.prefix,power:de});for(var ge=0;ge1||Math.abs(this.units[0].power-1)>1e-15},x.prototype._normalize=function(X){if(X==null||this.units.length===0)return X;for(var Z=X,he=x._getNumberConverter(aa(X)),Y=0;Y{if(Gn(J,X)){var Z=J[X],he=Z.prefixes[""];return{unit:Z,prefix:he}}for(var Y in J)if(Gn(J,Y)&&ame(X,Y)){var ne=J[Y],se=X.length-Y.length,xe=X.substring(0,se),Pe=Gn(ne.prefixes,xe)?ne.prefixes[xe]:void 0;if(Pe!==void 0)return{unit:ne,prefix:Pe}}return null},{hasher:X=>X[0],limit:100});x.isValuelessUnit=function(X){return U(X)!==null},x.prototype.hasBase=function(X){if(typeof X=="string"&&(X=N[X]),!X)return!1;for(var Z=0;Z1e-12)return!1;return!0},x.prototype.equalBase=function(X){for(var Z=0;Z1e-12)return!1;return!0},x.prototype.equals=function(X){return this.equalBase(X)&&d(this.value,X.value)},x.prototype.multiply=function(X){for(var Z=this.clone(),he=_c(X)?X:new x(X),Y=0;Y1e-12&&(Gn(Me,Pe)?Z.push({unit:Me[Pe].unit,prefix:Me[Pe].prefix,power:X.dimensions[xe]||0}):se=!0)}Z.length1e-12)if(Gn(fe.si,Y))Z.push({unit:fe.si[Y].unit,prefix:fe.si[Y].prefix,power:X.dimensions[he]||0});else throw new Error("Cannot express custom unit "+Y+" in SI units")}return X.units=Z,X.fixPrefix=!0,X.skipAutomaticSimplification=!0,this.value!==null?(X.value=null,this.to(X)):X},x.prototype.formatUnits=function(){for(var X="",Z="",he=0,Y=0,ne=0;ne0?(he++,X+=" "+this.units[ne].prefix.name+this.units[ne].unit.name,Math.abs(this.units[ne].power-1)>1e-15&&(X+="^"+this.units[ne].power)):this.units[ne].power<0&&Y++;if(Y>0)for(var se=0;se0?(Z+=" "+this.units[se].prefix.name+this.units[se].unit.name,Math.abs(this.units[se].power+1)>1e-15&&(Z+="^"+-this.units[se].power)):(Z+=" "+this.units[se].prefix.name+this.units[se].unit.name,Z+="^"+this.units[se].power));X=X.substr(1),Z=Z.substr(1),he>1&&Y>0&&(X="("+X+")"),Y>1&&he>0&&(Z="("+Z+")");var xe=X;return he>0&&Y>0&&(xe+=" / "),xe+=Z,xe},x.prototype.format=function(X){var Z=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),he=!1;typeof Z.value<"u"&&Z.value!==null&&gv(Z.value)&&(he=Math.abs(Z.value.re)<1e-14);for(var Y in Z.units)Gn(Z.units,Y)&&Z.units[Y].unit&&(Z.units[Y].unit.name==="VA"&&he?Z.units[Y].unit=J.VAR:Z.units[Y].unit.name==="VAR"&&!he&&(Z.units[Y].unit=J.VA));Z.units.length===1&&!Z.fixPrefix&&Math.abs(Z.units[0].power-Math.round(Z.units[0].power))<1e-14&&(Z.units[0].prefix=Z._bestPrefix());var ne=Z._denormalize(Z.value),se=Z.value!==null?h(ne,X||{}):"",xe=Z.formatUnits();return Z.value&&gv(Z.value)&&(se="("+se+")"),xe.length>0&&se.length>0&&(se+=" "),se+=xe,se},x.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var X=this.value!==null?l(this.value):0,Z=l(this.units[0].unit.value),he=this.units[0].prefix;if(X===0)return he;var Y=this.units[0].power,ne=Math.log(X/Math.pow(he.value*Z,Y))/Math.LN10-1.2;if(ne>-2.200001&&ne<1.800001)return he;ne=Math.abs(ne);var se=this.units[0].unit.prefixes;for(var xe in se)if(Gn(se,xe)){var Pe=se[xe];if(Pe.scientific){var z=Math.abs(Math.log(X/Math.pow(Pe.value*Z,Y))/Math.LN10-1.2);(z0)},J={meter:{name:"meter",base:N.LENGTH,prefixes:B.LONG,value:1,offset:0},inch:{name:"inch",base:N.LENGTH,prefixes:B.NONE,value:.0254,offset:0},foot:{name:"foot",base:N.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yard:{name:"yard",base:N.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mile:{name:"mile",base:N.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},link:{name:"link",base:N.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rod:{name:"rod",base:N.LENGTH,prefixes:B.NONE,value:5.0292,offset:0},chain:{name:"chain",base:N.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:N.LENGTH,prefixes:B.NONE,value:1e-10,offset:0},m:{name:"m",base:N.LENGTH,prefixes:B.SHORT,value:1,offset:0},in:{name:"in",base:N.LENGTH,prefixes:B.NONE,value:.0254,offset:0},ft:{name:"ft",base:N.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yd:{name:"yd",base:N.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mi:{name:"mi",base:N.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},li:{name:"li",base:N.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rd:{name:"rd",base:N.LENGTH,prefixes:B.NONE,value:5.02921,offset:0},ch:{name:"ch",base:N.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},mil:{name:"mil",base:N.LENGTH,prefixes:B.NONE,value:254e-7,offset:0},m2:{name:"m2",base:N.SURFACE,prefixes:B.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:N.SURFACE,prefixes:B.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:N.SURFACE,prefixes:B.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:N.SURFACE,prefixes:B.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:N.SURFACE,prefixes:B.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:N.SURFACE,prefixes:B.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:N.SURFACE,prefixes:B.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:N.SURFACE,prefixes:B.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:N.SURFACE,prefixes:B.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:N.SURFACE,prefixes:B.NONE,value:1e4,offset:0},m3:{name:"m3",base:N.VOLUME,prefixes:B.CUBIC,value:1,offset:0},L:{name:"L",base:N.VOLUME,prefixes:B.SHORT,value:.001,offset:0},l:{name:"l",base:N.VOLUME,prefixes:B.SHORT,value:.001,offset:0},litre:{name:"litre",base:N.VOLUME,prefixes:B.LONG,value:.001,offset:0},cuin:{name:"cuin",base:N.VOLUME,prefixes:B.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:N.VOLUME,prefixes:B.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:N.VOLUME,prefixes:B.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:N.VOLUME,prefixes:B.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:N.VOLUME,prefixes:B.NONE,value:15e-6,offset:0},drop:{name:"drop",base:N.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:N.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},minim:{name:"minim",base:N.VOLUME,prefixes:B.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:N.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:N.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:N.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:N.VOLUME,prefixes:B.NONE,value:1e-6,offset:0},cup:{name:"cup",base:N.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:N.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:N.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:N.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:N.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:N.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:N.VOLUME,prefixes:B.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:N.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:N.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:N.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:N.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:N.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:N.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:N.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:N.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},obl:{name:"obl",base:N.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},g:{name:"g",base:N.MASS,prefixes:B.SHORT,value:.001,offset:0},gram:{name:"gram",base:N.MASS,prefixes:B.LONG,value:.001,offset:0},ton:{name:"ton",base:N.MASS,prefixes:B.SHORT,value:907.18474,offset:0},t:{name:"t",base:N.MASS,prefixes:B.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:N.MASS,prefixes:B.LONG,value:1e3,offset:0},grain:{name:"grain",base:N.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:N.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:N.MASS,prefixes:B.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:N.MASS,prefixes:B.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:N.MASS,prefixes:B.NONE,value:45.359237,offset:0},stick:{name:"stick",base:N.MASS,prefixes:B.NONE,value:.115,offset:0},stone:{name:"stone",base:N.MASS,prefixes:B.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:N.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:N.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:N.MASS,prefixes:B.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:N.MASS,prefixes:B.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:N.MASS,prefixes:B.NONE,value:45.359237,offset:0},s:{name:"s",base:N.TIME,prefixes:B.SHORT,value:1,offset:0},min:{name:"min",base:N.TIME,prefixes:B.NONE,value:60,offset:0},h:{name:"h",base:N.TIME,prefixes:B.NONE,value:3600,offset:0},second:{name:"second",base:N.TIME,prefixes:B.LONG,value:1,offset:0},sec:{name:"sec",base:N.TIME,prefixes:B.LONG,value:1,offset:0},minute:{name:"minute",base:N.TIME,prefixes:B.NONE,value:60,offset:0},hour:{name:"hour",base:N.TIME,prefixes:B.NONE,value:3600,offset:0},day:{name:"day",base:N.TIME,prefixes:B.NONE,value:86400,offset:0},week:{name:"week",base:N.TIME,prefixes:B.NONE,value:7*86400,offset:0},month:{name:"month",base:N.TIME,prefixes:B.NONE,value:2629800,offset:0},year:{name:"year",base:N.TIME,prefixes:B.NONE,value:31557600,offset:0},decade:{name:"decade",base:N.TIME,prefixes:B.NONE,value:315576e3,offset:0},century:{name:"century",base:N.TIME,prefixes:B.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:N.TIME,prefixes:B.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:N.FREQUENCY,prefixes:B.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:N.FREQUENCY,prefixes:B.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:N.ANGLE,prefixes:B.SHORT,value:1,offset:0},radian:{name:"radian",base:N.ANGLE,prefixes:B.LONG,value:1,offset:0},deg:{name:"deg",base:N.ANGLE,prefixes:B.SHORT,value:null,offset:0},degree:{name:"degree",base:N.ANGLE,prefixes:B.LONG,value:null,offset:0},grad:{name:"grad",base:N.ANGLE,prefixes:B.SHORT,value:null,offset:0},gradian:{name:"gradian",base:N.ANGLE,prefixes:B.LONG,value:null,offset:0},cycle:{name:"cycle",base:N.ANGLE,prefixes:B.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:N.ANGLE,prefixes:B.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:N.ANGLE,prefixes:B.NONE,value:null,offset:0},A:{name:"A",base:N.CURRENT,prefixes:B.SHORT,value:1,offset:0},ampere:{name:"ampere",base:N.CURRENT,prefixes:B.LONG,value:1,offset:0},K:{name:"K",base:N.TEMPERATURE,prefixes:B.SHORT,value:1,offset:0},degC:{name:"degC",base:N.TEMPERATURE,prefixes:B.SHORT,value:1,offset:273.15},degF:{name:"degF",base:N.TEMPERATURE,prefixes:B.SHORT,value:new m(5,9),offset:459.67},degR:{name:"degR",base:N.TEMPERATURE,prefixes:B.SHORT,value:new m(5,9),offset:0},kelvin:{name:"kelvin",base:N.TEMPERATURE,prefixes:B.LONG,value:1,offset:0},celsius:{name:"celsius",base:N.TEMPERATURE,prefixes:B.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:N.TEMPERATURE,prefixes:B.LONG,value:new m(5,9),offset:459.67},rankine:{name:"rankine",base:N.TEMPERATURE,prefixes:B.LONG,value:new m(5,9),offset:0},mol:{name:"mol",base:N.AMOUNT_OF_SUBSTANCE,prefixes:B.SHORT,value:1,offset:0},mole:{name:"mole",base:N.AMOUNT_OF_SUBSTANCE,prefixes:B.LONG,value:1,offset:0},cd:{name:"cd",base:N.LUMINOUS_INTENSITY,prefixes:B.SHORT,value:1,offset:0},candela:{name:"candela",base:N.LUMINOUS_INTENSITY,prefixes:B.LONG,value:1,offset:0},N:{name:"N",base:N.FORCE,prefixes:B.SHORT,value:1,offset:0},newton:{name:"newton",base:N.FORCE,prefixes:B.LONG,value:1,offset:0},dyn:{name:"dyn",base:N.FORCE,prefixes:B.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:N.FORCE,prefixes:B.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:N.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:N.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:N.FORCE,prefixes:B.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:N.FORCE,prefixes:B.NONE,value:9.80665,offset:0},J:{name:"J",base:N.ENERGY,prefixes:B.SHORT,value:1,offset:0},joule:{name:"joule",base:N.ENERGY,prefixes:B.LONG,value:1,offset:0},erg:{name:"erg",base:N.ENERGY,prefixes:B.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:N.ENERGY,prefixes:B.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:N.ENERGY,prefixes:B.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:N.ENERGY,prefixes:B.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:N.ENERGY,prefixes:B.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:N.POWER,prefixes:B.SHORT,value:1,offset:0},watt:{name:"watt",base:N.POWER,prefixes:B.LONG,value:1,offset:0},hp:{name:"hp",base:N.POWER,prefixes:B.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:N.POWER,prefixes:B.SHORT,value:g.I,offset:0},VA:{name:"VA",base:N.POWER,prefixes:B.SHORT,value:1,offset:0},Pa:{name:"Pa",base:N.PRESSURE,prefixes:B.SHORT,value:1,offset:0},psi:{name:"psi",base:N.PRESSURE,prefixes:B.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:N.PRESSURE,prefixes:B.NONE,value:101325,offset:0},bar:{name:"bar",base:N.PRESSURE,prefixes:B.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:N.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:N.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:N.PRESSURE,prefixes:B.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:N.PRESSURE,prefixes:B.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:N.ELECTRIC_CHARGE,prefixes:B.LONG,value:1,offset:0},C:{name:"C",base:N.ELECTRIC_CHARGE,prefixes:B.SHORT,value:1,offset:0},farad:{name:"farad",base:N.ELECTRIC_CAPACITANCE,prefixes:B.LONG,value:1,offset:0},F:{name:"F",base:N.ELECTRIC_CAPACITANCE,prefixes:B.SHORT,value:1,offset:0},volt:{name:"volt",base:N.ELECTRIC_POTENTIAL,prefixes:B.LONG,value:1,offset:0},V:{name:"V",base:N.ELECTRIC_POTENTIAL,prefixes:B.SHORT,value:1,offset:0},ohm:{name:"ohm",base:N.ELECTRIC_RESISTANCE,prefixes:B.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:N.ELECTRIC_INDUCTANCE,prefixes:B.LONG,value:1,offset:0},H:{name:"H",base:N.ELECTRIC_INDUCTANCE,prefixes:B.SHORT,value:1,offset:0},siemens:{name:"siemens",base:N.ELECTRIC_CONDUCTANCE,prefixes:B.LONG,value:1,offset:0},S:{name:"S",base:N.ELECTRIC_CONDUCTANCE,prefixes:B.SHORT,value:1,offset:0},weber:{name:"weber",base:N.MAGNETIC_FLUX,prefixes:B.LONG,value:1,offset:0},Wb:{name:"Wb",base:N.MAGNETIC_FLUX,prefixes:B.SHORT,value:1,offset:0},tesla:{name:"tesla",base:N.MAGNETIC_FLUX_DENSITY,prefixes:B.LONG,value:1,offset:0},T:{name:"T",base:N.MAGNETIC_FLUX_DENSITY,prefixes:B.SHORT,value:1,offset:0},b:{name:"b",base:N.BIT,prefixes:B.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:N.BIT,prefixes:B.BINARY_LONG,value:1,offset:0},B:{name:"B",base:N.BIT,prefixes:B.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:N.BIT,prefixes:B.BINARY_LONG,value:8,offset:0}},ae={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function ve(X){if(X.number==="BigNumber"){var Z=uj(b);J.rad.value=new b(1),J.deg.value=Z.div(180),J.grad.value=Z.div(200),J.cycle.value=Z.times(2),J.arcsec.value=Z.div(648e3),J.arcmin.value=Z.div(10800)}else J.rad.value=1,J.deg.value=Math.PI/180,J.grad.value=Math.PI/200,J.cycle.value=Math.PI*2,J.arcsec.value=Math.PI/648e3,J.arcmin.value=Math.PI/10800;J.radian.value=J.rad.value,J.degree.value=J.deg.value,J.gradian.value=J.grad.value}ve(n),e&&e("config",function(X,Z){X.number!==Z.number&&ve(X)});var fe={si:{NONE:{unit:Q,prefix:B.NONE[""]},LENGTH:{unit:J.m,prefix:B.SHORT[""]},MASS:{unit:J.g,prefix:B.SHORT.k},TIME:{unit:J.s,prefix:B.SHORT[""]},CURRENT:{unit:J.A,prefix:B.SHORT[""]},TEMPERATURE:{unit:J.K,prefix:B.SHORT[""]},LUMINOUS_INTENSITY:{unit:J.cd,prefix:B.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:J.mol,prefix:B.SHORT[""]},ANGLE:{unit:J.rad,prefix:B.SHORT[""]},BIT:{unit:J.bits,prefix:B.SHORT[""]},FORCE:{unit:J.N,prefix:B.SHORT[""]},ENERGY:{unit:J.J,prefix:B.SHORT[""]},POWER:{unit:J.W,prefix:B.SHORT[""]},PRESSURE:{unit:J.Pa,prefix:B.SHORT[""]},ELECTRIC_CHARGE:{unit:J.C,prefix:B.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:J.F,prefix:B.SHORT[""]},ELECTRIC_POTENTIAL:{unit:J.V,prefix:B.SHORT[""]},ELECTRIC_RESISTANCE:{unit:J.ohm,prefix:B.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:J.H,prefix:B.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:J.S,prefix:B.SHORT[""]},MAGNETIC_FLUX:{unit:J.Wb,prefix:B.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:J.T,prefix:B.SHORT[""]},FREQUENCY:{unit:J.Hz,prefix:B.SHORT[""]}}};fe.cgs=JSON.parse(JSON.stringify(fe.si)),fe.cgs.LENGTH={unit:J.m,prefix:B.SHORT.c},fe.cgs.MASS={unit:J.g,prefix:B.SHORT[""]},fe.cgs.FORCE={unit:J.dyn,prefix:B.SHORT[""]},fe.cgs.ENERGY={unit:J.erg,prefix:B.NONE[""]},fe.us=JSON.parse(JSON.stringify(fe.si)),fe.us.LENGTH={unit:J.ft,prefix:B.NONE[""]},fe.us.MASS={unit:J.lbm,prefix:B.NONE[""]},fe.us.TEMPERATURE={unit:J.degF,prefix:B.NONE[""]},fe.us.FORCE={unit:J.lbf,prefix:B.NONE[""]},fe.us.ENERGY={unit:J.BTU,prefix:B.BTU[""]},fe.us.POWER={unit:J.hp,prefix:B.NONE[""]},fe.us.PRESSURE={unit:J.psi,prefix:B.NONE[""]},fe.auto=JSON.parse(JSON.stringify(fe.si));var Me=fe.auto;x.setUnitSystem=function(X){if(Gn(fe,X))Me=fe[X];else throw new Error("Unit system "+X+" does not exist. Choices are: "+Object.keys(fe).join(", "))},x.getUnitSystem=function(){for(var X in fe)if(Gn(fe,X)&&fe[X]===Me)return X},x.typeConverters={BigNumber:function(Z){return Z!=null&&Z.isFraction?new b(Z.n).div(Z.d).times(Z.s):new b(Z+"")},Fraction:function(Z){return new m(Z)},Complex:function(Z){return Z},number:function(Z){return Z!=null&&Z.isFraction?p(Z):Z}},x.prototype._numberConverter=function(){var X=x.typeConverters[this.valueType()];if(X)return X;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},x._getNumberConverter=function(X){if(!x.typeConverters[X])throw new TypeError('Unsupported type "'+X+'"');return x.typeConverters[X]};for(var ye in J)if(Gn(J,ye)){var we=J[ye];we.dimensions=we.base.dimensions}for(var Fe in ae)if(Gn(ae,Fe)){var Oe=J[ae[Fe]],re={};for(var _e in Oe)Gn(Oe,_e)&&(re[_e]=Oe[_e]);re.name=Fe,J[Fe]=re}x.isValidAlpha=function(Z){return/^[a-zA-Z]$/.test(Z)};function Ce(X){for(var Z=0;Z0&&!(x.isValidAlpha(S)||A(S)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+X+'"')}}return x.createUnit=function(X,Z){if(typeof X!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(Z&&Z.override){for(var he in X)if(Gn(X,he)&&x.deleteUnit(he),X[he].aliases)for(var Y=0;Y"u"||Z===null)&&(Z={}),typeof X!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Gn(J,X))throw new Error('Cannot create unit "'+X+'": a unit with that name already exists');Ce(X);var he=null,Y=[],ne=0,se,xe,Pe;if(Z&&Z.type==="Unit")he=Z.clone();else if(typeof Z=="string")Z!==""&&(se=Z);else if(typeof Z=="object")se=Z.definition,xe=Z.prefixes,ne=Z.offset,Pe=Z.baseName,Z.aliases&&(Y=Z.aliases.valueOf());else throw new TypeError('Cannot create unit "'+X+'" from "'+Z.toString()+'": expecting "string" or "Unit" or "Object"');if(Y){for(var z=0;z1e-12){be=!1;break}if(be){ue=!0,H.base=N[ge];break}}if(!ue){Pe=Pe||X+"_STUFF";var Re={dimensions:he.dimensions.slice(0)};Re.key=Pe,N[Pe]=Re,Me[Pe]={unit:H,prefix:B.NONE[""]},H.base=N[Pe]}}else{if(Pe=Pe||X+"_STUFF",L.indexOf(Pe)>=0)throw new Error('Cannot create new base unit "'+X+'": a base unit with that name already exists (and cannot be overridden)');L.push(Pe);for(var te in N)Gn(N,te)&&(N[te].dimensions[L.length-1]=0);for(var le={dimensions:[]},de=0;de{var{typed:e,Unit:n}=t;return e(jB,{Unit:function(i){return i.clone()},string:function(i){return n.isValuelessUnit(i)?new n(null,i):n.parse(i,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(i,o){return new n(i,o)},"number | BigNumber | Fraction":function(i){return new n(i)},"Array | Matrix":e.referToSelf(r=>i=>ui(i,r))})}),WB="createUnit",aye=["typed","Unit"],lye=dt(WB,aye,t=>{var{typed:e,Unit:n}=t;return e(WB,{"Object, Object":function(i,o){return n.createUnit(i,o)},Object:function(i){return n.createUnit(i,{})},"string, Unit | string | Object, Object":function(i,o,s){var a={};return a[i]=o,n.createUnit(a,s)},"string, Unit | string | Object":function(i,o){var s={};return s[i]=o,n.createUnit(s,{})},string:function(i){var o={};return o[i]={},n.createUnit(o,{})}})}),cj=dt("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(n=>r=>{if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(n,r.valueType())(r.value)})}}),qB="cos",uye=["typed"],cye=dt(qB,uye,t=>{var{typed:e}=t,n=cj({typed:e});return e(qB,{number:Math.cos,"Complex | BigNumber":r=>r.cos()},n)}),XB="sin",dye=["typed"],fye=dt(XB,dye,t=>{var{typed:e}=t,n=cj({typed:e});return e(XB,{number:Math.sin,"Complex | BigNumber":r=>r.sin()},n)}),KB="add",hye=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],pye=dt(KB,hye,t=>{var{typed:e,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:o,SparseMatrix:s,concat:a}=t,l=aj({typed:e}),u=eve({typed:e,equalScalar:i}),c=lj({typed:e,DenseMatrix:o}),d=Qf({typed:e,matrix:n,concat:a});return e(KB,{"any, any":r,"any, any, ...any":e.referToSelf(f=>(h,p,g)=>{for(var b=f(h,p),m=0;m{var{typed:e,addScalar:n,multiplyScalar:r,conj:i,size:o}=t;return e(YB,{"Array | DenseMatrix, Array | DenseMatrix":a,"SparseMatrix, SparseMatrix":l});function s(c,d){var f=u(c),h=u(d),p,g;if(f.length===1)p=f[0];else if(f.length===2&&f[1]===1)p=f[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+f.join(", ")+")");if(h.length===1)g=h[0];else if(h.length===2&&h[1]===1)g=h[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+h.join(", ")+")");if(p!==g)throw new RangeError("Vectors must have equal length ("+p+" != "+g+")");if(p===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return p}function a(c,d){var f=s(c,d),h=Or(c)?c._data:c,p=Or(c)?c._datatype||c.getDataType():void 0,g=Or(d)?d._data:d,b=Or(d)?d._datatype||d.getDataType():void 0,m=u(c).length===2,w=u(d).length===2,x=n,_=r;if(p&&b&&p===b&&typeof p=="string"&&p!=="mixed"){var C=p;x=e.find(n,[C,C]),_=e.find(r,[C,C])}if(!m&&!w){for(var S=_(i(h[0]),g[0]),M=1;MS){_++;continue}C===S&&(b=m(b,w(h[x],g[_])),x++,_++)}return b}function u(c){return Or(c)?c.size():o(c)}}),ZB="det",vye=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],yye=dt(ZB,vye,t=>{var{typed:e,matrix:n,subtractScalar:r,multiply:i,divideScalar:o,isZero:s,unaryMinus:a}=t;return e(ZB,{any:function(c){return dr(c)},"Array | Matrix":function(c){var d;switch(Or(c)?d=c.size():Array.isArray(c)?(c=n(c),d=c.size()):d=[],d.length){case 0:return dr(c);case 1:if(d[0]===1)return dr(c.valueOf()[0]);if(d[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ir(d)+")");case 2:{var f=d[0],h=d[1];if(f===h)return l(c.clone().valueOf(),f);if(h===0)return 1;throw new RangeError("Matrix must be square (size: "+Ir(d)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ir(d)+")")}}});function l(u,c,d){if(c===1)return dr(u[0][0]);if(c===2)return r(i(u[0][0],u[1][1]),i(u[1][0],u[0][1]));for(var f=!1,h=new Array(c).fill(0).map((M,P)=>P),p=0;p{var{typed:e,matrix:n,divideScalar:r,addScalar:i,multiply:o,unaryMinus:s,det:a,identity:l,abs:u}=t;return e(QB,{"Array | Matrix":function(f){var h=Or(f)?f.size():To(f);switch(h.length){case 1:if(h[0]===1)return Or(f)?n([r(1,f.valueOf()[0])]):[r(1,f[0])];throw new RangeError("Matrix must be square (size: "+Ir(h)+")");case 2:{var p=h[0],g=h[1];if(p===g)return Or(f)?n(c(f.valueOf(),p,g),f.storage()):c(f,p,g);throw new RangeError("Matrix must be square (size: "+Ir(h)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ir(h)+")")}},any:function(f){return r(1,f)}});function c(d,f,h){var p,g,b,m,w;if(f===1){if(m=d[0][0],m===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,m)]]}else if(f===2){var x=a(d);if(x===0)throw Error("Cannot calculate inverse, determinant is zero");return[[r(d[1][1],x),r(s(d[0][1]),x)],[r(s(d[1][0]),x),r(d[0][0],x)]]}else{var _=d.concat();for(p=0;pM&&(M=u(_[p][S]),P=p),p++;if(M===0)throw Error("Cannot calculate inverse, determinant is zero");p=P,p!==S&&(w=_[S],_[S]=_[p],_[p]=w,w=C[S],C[S]=C[p],C[p]=w);var A=_[S],R=C[S];for(p=0;p{var{typed:e,matrix:n,multiply:r,equalScalar:i,divideScalar:o,inv:s}=t,a=hb({typed:e,equalScalar:i}),l=Zf({typed:e});return e("divide",wG({"Array | Matrix, Array | Matrix":function(c,d){return r(c,s(d))},"DenseMatrix, any":function(c,d){return l(c,d,o,!1)},"SparseMatrix, any":function(c,d){return a(c,d,o,!1)},"Array, any":function(c,d){return l(n(c),d,o,!1).valueOf()},"any, Array | Matrix":function(c,d){return r(c,s(d))}},o.signatures))}),pg=Ege({config:Gi}),fE=Pge({}),iN=Nge({}),oN=kge({}),ts=zge({Matrix:oN}),Xt=Ame({BigNumber:pg,Complex:fE,DenseMatrix:ts,Fraction:iN}),dj=v0e({typed:Xt}),mb=b0e({typed:Xt}),Cye=l0e({BigNumber:pg,typed:Xt}),Eye=hve({typed:Xt}),JB=cye({typed:Xt}),Xl=Zge({config:Gi,typed:Xt}),Mye=Tve({typed:Xt}),Tye=Vge({typed:Xt}),Aye=Xge({typed:Xt}),sN=ove({typed:Xt}),aN=o0e({typed:Xt}),e8=fye({typed:Xt}),lN=e0e({Matrix:oN,equalScalar:Xl,typed:Xt}),uN=w0e({typed:Xt}),cN=m0e({typed:Xt}),fj=d0e({Fraction:iN,typed:Xt}),Pye=Wge({typed:Xt}),Qr=h0e({DenseMatrix:ts,Matrix:oN,SparseMatrix:lN,typed:Xt}),dN=Dve({bignumber:Cye,fraction:fj,number:aN}),Dye=_ve({matrix:Qr,config:Gi,typed:Xt}),hE=Cve({BigNumber:pg,config:Gi,matrix:Qr,typed:Xt}),Jf=mve({isInteger:Tye,matrix:Qr,typed:Xt}),pE=Ive({numeric:dN,typed:Xt}),SD=Bve({DenseMatrix:ts,concat:Jf,equalScalar:Xl,matrix:Qr,typed:Xt}),hj=vve({BigNumber:pg,DenseMatrix:ts,SparseMatrix:lN,config:Gi,matrix:Qr,typed:Xt}),CT=Yve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),fN=kve({BigNumber:pg,DenseMatrix:ts,config:Gi,equalScalar:Xl,matrix:Qr,typed:Xt,zeros:hE}),Rye=Uve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),t8=uve({DenseMatrix:ts,concat:Jf,equalScalar:Xl,matrix:Qr,subtractScalar:uN,typed:Xt,unaryMinus:cN}),cS=pye({DenseMatrix:ts,SparseMatrix:lN,addScalar:mb,concat:Jf,equalScalar:Xl,matrix:Qr,typed:Xt}),Iye=gye({addScalar:mb,conj:Eye,multiplyScalar:sN,size:Dye,typed:Xt}),Nye=k0e({DenseMatrix:ts,config:Gi,equalScalar:Xl,matrix:Qr,round:fN,typed:Xt,zeros:hE}),j0=qve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),Fye=tye({config:Gi,numeric:dN,smaller:Rye,typed:Xt}),wi=ave({addScalar:mb,dot:Iye,equalScalar:Xl,matrix:Qr,multiplyScalar:sN,typed:Xt}),Oye=D0e({DenseMatrix:ts,config:Gi,equalScalar:Xl,matrix:Qr,round:fN,typed:Xt,zeros:hE}),kye=yye({divideScalar:pE,isZero:Aye,matrix:Qr,multiply:wi,subtractScalar:uN,typed:Xt,unaryMinus:cN}),Lye=N0e({Complex:fE,DenseMatrix:ts,ceil:Oye,equalScalar:Xl,floor:Nye,matrix:Qr,typed:Xt,zeros:hE}),Bye=Jve({config:Gi,larger:j0,numeric:dN,typed:Xt}),$ye=Gve({DenseMatrix:ts,concat:Jf,config:Gi,matrix:Qr,typed:Xt}),pj=xye({abs:dj,addScalar:mb,det:kye,divideScalar:pE,identity:hj,matrix:Qr,multiply:wi,typed:Xt,unaryMinus:cN}),zye=Fve({Complex:fE,config:Gi,fraction:fj,identity:hj,inv:pj,matrix:Qr,multiply:wi,number:aN,typed:Xt}),Zp=iye({BigNumber:pg,Complex:fE,Fraction:iN,abs:dj,addScalar:mb,config:Gi,divideScalar:pE,equal:SD,fix:Lye,format:Mye,isNumeric:Pye,multiplyScalar:sN,number:aN,pow:zye,round:fN,subtractScalar:uN}),n8=lye({Unit:Zp,typed:Xt}),_o=Sye({divideScalar:pE,equalScalar:Xl,inv:pj,matrix:Qr,multiply:wi,typed:Xt}),Rt=sye({Unit:Zp,typed:Xt});const mj=Rt(299792458,"m/s"),gj=Rt(662607015e-42,"J s");var bs=(t=>(t.millimetre="mm",t.micrometre="um",t))(bs||{}),W0=(t=>(t.electronVolts="eV",t.kiloElectronVolts="keV",t))(W0||{}),ia=(t=>(t.nanometres="nm",t.angstroms="angstrom",t))(ia||{}),dS=(t=>(t.nanometres="nm^-1",t.angstroms="angstrom^-1",t))(dS||{}),q0=(t=>(t.radians="rad",t.degrees="deg",t))(q0||{});const Uye=t=>{const e=_o(wi(gj,mj),t.toSI());if(typeof e=="number"||!("units"in e))throw TypeError("The Units for constants h and c are wrong");return e},CD=t=>{const e=_o(wi(gj,mj),t.toSI());if(typeof e=="number"||!("units"in e))throw TypeError("units for constants h and c are wrong");return e},Qp=t=>{const e=parseFloat(t.trim());return!e&&e!=0?null:e};var Hye={BASE_URL:"https://diamondlightsource.github.io/dedi-web/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const r8=t=>{let e;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(e):c;if(!Object.is(f,e)){const h=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,h))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(Hye?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=e=t(r,i,l);return l},Vye=t=>t?r8(t):r8;var vj={exports:{}},yj={},bj={exports:{}},xj={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -247,22 +247,22 @@ Example: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var mE=E,ebe=Jye;function tbe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var nbe=typeof Object.is=="function"?Object.is:tbe,rbe=ebe.useSyncExternalStore,ibe=mE.useRef,obe=mE.useEffect,sbe=mE.useMemo,abe=mE.useDebugValue;yj.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=ibe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=sbe(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&s.hasValue){var p=s.value;if(i(p,h))return d=p}return d=h}if(p=d,nbe(c,h))return p;var g=r(h);return i!==void 0&&i(p,g)?p:(c=h,d=g)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,i]);var a=rbe(t,o[0],o[1]);return obe(function(){s.hasValue=!0,s.value=a},[a]),abe(a),a};vj.exports=yj;var lbe=vj.exports;const ube=ya(lbe);var wj={BASE_URL:"https://diamondlightsource.github.io/dedi-web/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:cbe}=ie,{useSyncExternalStoreWithSelector:dbe}=ube;let i8=!1;const fbe=t=>t;function hbe(t,e=fbe,n){(wj?"production":void 0)!=="production"&&n&&!i8&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),i8=!0);const r=dbe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return cbe(r),r}const o8=t=>{(wj?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?Vye(t):t,n=(r,i)=>hbe(e,r,i);return Object.assign(n,e),n},eh=t=>t?o8(t):o8,pbe={resolution:{width:2527,height:2463},pixelSize:{width:.172,height:.172}},mbe={resolution:{width:619,height:487},pixelSize:{width:.172,height:.172}},gbe={"Pilatus P3-2M":{resolution:{width:1475,height:1679},pixelSize:{width:.172,height:.172}},"Pilatus P3-2M-DLS (for WAXS)":{resolution:{width:1475,height:1679},pixelSize:{width:.172,height:.172}},Pilatus6m:pbe,Pilatus100k:mbe,"Pilatus300k-W":{resolution:{width:195,height:1495},pixelSize:{width:.172,height:.172}},"Eiger 500k":{resolution:{width:1030,height:514},pixelSize:{width:.075,height:.075}},"Eiger 1M":{resolution:{width:1030,height:1065},pixelSize:{width:.075,height:.075}},"Eiger 4M":{resolution:{width:2070,height:2167},pixelSize:{width:.075,height:.075}},"Eiger 9M":{resolution:{width:3110,height:3269},pixelSize:{width:.075,height:.075}},"Eiger 16M":{resolution:{width:4150,height:4371},pixelSize:{width:.075,height:.075}}},vbe={"I22 SAXS Isotropic":{detector:"Pilatus P3-2M",beamline:"I22",beamstop:{centre:{x:738,y:100},clearance:10},cameraTube:{centre:{x:738,y:840}}},"I22 SAXS Anisotropic":{detector:"Pilatus P3-2M",beamline:"I22",beamstop:{centre:{x:738,y:840},clearance:10},cameraTube:{centre:{x:738,y:840}}}},ybe={beamstopDiameter:4,cameratubeDiameter:310,minWavelength:.062,maxWavelength:.335,minCameraLength:1.9,maxCameraLength:9.9,cameraLengthStep:.25},bbe={beamstopDiameter:10,cameratubeDiameter:345,minWavelength:.05,maxWavelength:.05,minCameraLength:0,maxCameraLength:10,cameraLengthStep:1},xbe={I22:ybe,test:bbe};function _j(t){return{...t,pixelSize:{height:Rt(t.pixelSize.height,"mm"),width:Rt(t.pixelSize.height,"mm")}}}const s8=Object.fromEntries(Object.entries(gbe).map(([t,e])=>[t,_j(e)]));function Sj(t){return{cameratubeDiameter:t.cameratubeDiameter,beamstopDiameter:t.beamstopDiameter,minWavelength:Rt(t.minWavelength,"nm").to("nm"),maxWavelength:Rt(t.maxWavelength,"nm").to("nm"),minCameraLength:Rt(t.minCameraLength,"m"),maxCameraLength:Rt(t.maxCameraLength,"m"),cameraLengthStep:Rt(t.cameraLengthStep,"m")}}const vv=Object.fromEntries(Object.entries(xbe).map(([t,e])=>[t,Sj(e)]));function wbe(t){return{...t,beamstop:{...t.beamstop,diameter:Rt(vv[t.beamline].beamstopDiameter,"mm")},cameraTube:{...t.cameraTube,diameter:Rt(vv[t.beamline].cameratubeDiameter,"mm")},wavelength:Rt(NaN,"nm"),angle:Rt(90,"deg"),cameraLength:vv[t.beamline].minCameraLength.toNumber("m")}}const yv=Object.fromEntries(Object.entries(vbe).map(([t,e])=>[t,wbe(e)])),ps=yv[Object.keys(yv)[0]],gE=eh(t=>({beamstop:ps.beamstop,updateCentre:e=>t(n=>({beamstop:{...n.beamstop,centre:{...n.beamstop.centre,...e}}})),updateDiameter:(e,n)=>t(r=>({beamstop:{...r.beamstop,diameter:Rt(e,n)}})),updateDiameterUnits:e=>t(n=>({beamstop:{...n.beamstop,diameter:n.beamstop.diameter.to(e)}})),updateClearance:e=>t(n=>({beamstop:{...n.beamstop,clearance:e}})),updateBeamstop:e=>t({beamstop:e})})),mg=eh(t=>({name:ps.detector,detector:s8[ps.detector],detectorRecord:s8,updateDetector:e=>t(n=>({detector:n.detectorRecord[e],name:e})),updatePixelUnits:e=>t(n=>({detector:{...n.detector,pixelSize:{height:n.detector.pixelSize.height.to(e),width:n.detector.pixelSize.width.to(e)}}})),addNewDetector:(e,n)=>{t(r=>({detectorRecord:{...r.detectorRecord,[e]:n}}))}}));function _be(){const t=gE(),e=a=>{t.updateCentre({x:parseFloat(a.target.value)})},n=a=>{t.updateCentre({y:parseFloat(a.target.value)})},r=a=>{t.updateClearance(parseFloat(a.target.value))},i=mg(a=>a.detector),o=()=>{t.updateCentre({x:i.resolution.width/2,y:i.resolution.height/2})},s=()=>{t.updateCentre({x:i.resolution.width/2,y:0})};return D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" Beamstop "}),D.jsx(ca,{}),D.jsxs(cn,{direction:"row",alignItems:"center",children:[D.jsxs(xn,{flexGrow:1,children:[" ","Diameter: ",t.beamstop.diameter.toNumber().toFixed(2)," "]}),D.jsxs(Ai,{children:[D.jsx(da,{children:"units "}),D.jsxs(Ps,{size:"small",label:"units",value:t.beamstop.diameter.formatUnits(),onChange:a=>t.updateDiameterUnits(a.target.value),children:[D.jsx(wn,{value:bs.millimetre,children:"mm"}),D.jsx(wn,{value:bs.micrometre,children:"μm"})]})]})]}),D.jsx(xn,{children:"Position:"}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"x",value:t.beamstop.centre.x,onChange:e,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx(Bf,{size:"small",variant:"outlined",onClick:o,children:"Centre detector"})]}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"y",value:t.beamstop.centre.y,onChange:n,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx(Bf,{size:"small",variant:"outlined",onClick:s,children:"Centre top edge"})]}),D.jsx(cn,{direction:"row",children:D.jsx($n,{type:"number",size:"small",label:"clearance",value:t.beamstop.clearance,onChange:r,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}})})]})}const vE=eh(t=>({cameraTube:ps.cameraTube,updateCentre:e=>t(n=>({cameraTube:{...n.cameraTube,centre:{...n.cameraTube.centre,...e}}})),updateDiameterUnits:e=>t(n=>({cameraTube:{...n.cameraTube,diameter:n.cameraTube.diameter.to(e)}})),updateCameraTube:e=>t({cameraTube:e}),updateDiameter:(e,n)=>t(r=>({cameraTube:{...r.cameraTube,diameter:Rt(e,n)}}))}));function Sbe(){const t=vE(),e=r=>{t.updateCentre({x:parseFloat(r.target.value)})},n=r=>{t.updateCentre({y:parseFloat(r.target.value)})};return D.jsxs(Y4,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" CameraTube "}),D.jsx(ca,{}),D.jsxs(Y4,{direction:"row",alignItems:"center",children:[D.jsxs(xn,{flexGrow:1,children:[" ","Diameter: ",t.cameraTube.diameter.toNumber()," "]}),D.jsxs(Ai,{children:[D.jsx(da,{children:"units "}),D.jsxs(Ps,{size:"small",label:"units",value:t.cameraTube.diameter.formatUnits(),onChange:r=>t.updateDiameterUnits(r.target.value),children:[D.jsx(wn,{value:bs.millimetre,children:"mm"}),D.jsx(wn,{value:bs.micrometre,children:"μm"})]})]})]}),D.jsx(xn,{children:"Position:"}),D.jsx($n,{type:"number",size:"small",label:"x",value:t.cameraTube.centre.x,onChange:e,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx($n,{type:"number",size:"small",label:"y",value:t.cameraTube.centre.y,onChange:n,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}})]})}const gg=eh(t=>({beamline:vv[ps.beamline],beamlineName:ps.beamline,beamlineRecord:vv,energy:CD(ps.wavelength).to("keV"),userEnergy:CD(ps.wavelength).to("keV").toNumber(),wavelength:ps.wavelength,userWavelength:ps.wavelength.toNumber(),angle:ps.angle,userAngle:ps.angle.toNumber(),cameraLength:ps.cameraLength,updateBeamline:e=>t(n=>({beamline:n.beamlineRecord[e],beamlineName:e})),addNewBeamline:(e,n)=>{t(r=>({beamlineRecord:{...r.beamlineRecord,[e]:n}}))},updateAngle:(e,n)=>t({angle:Rt(e??NaN,n),userAngle:e}),updateAngleUnits:e=>t(n=>({angle:n.angle.to(e),userAngle:n.angle.to(e).toNumber()})),updateCameraLength:e=>t({cameraLength:e}),updateWavelength:(e,n)=>t(r=>({wavelength:Rt(e??NaN,n),userWavelength:e,beamline:{...r.beamline,minWavelength:r.beamline.minWavelength.to(n),maxWavelength:r.beamline.maxWavelength.to(n)}})),updateWavelengthUnits:e=>t(n=>({wavelength:n.wavelength.to(e),userWavelength:n.wavelength.to(e).toNumber(),beamline:{...n.beamline,minWavelength:n.beamline.minWavelength.to(e),maxWavelength:n.beamline.maxWavelength.to(e)}})),updateEnergy:(e,n)=>t({energy:Rt(e??NaN,n),userEnergy:e}),updateEnergyUnits:e=>t(n=>({energy:n.energy.to(e),userEnergy:n.energy.to(e).toNumber()})),update:e=>t({...e})}));function Cbe(){const t=gg(),e=l=>{t.updateAngleUnits(l.target.value)},n=l=>{t.updateAngle(Qp(l.target.value),t.angle.formatUnits())},r=l=>{const u=Qp(l.target.value);t.updateWavelength(u,t.wavelength.formatUnits());const c=CD(Rt(u??NaN,t.wavelength.formatUnits()));t.updateEnergy(c.to(t.energy.formatUnits()).toNumber(),t.energy.formatUnits())},i=l=>{t.updateWavelengthUnits(l.target.value)},o=l=>{const u=Qp(l.target.value);t.updateEnergy(u,t.energy.formatUnits());const c=Uye(Rt(u??NaN,t.energy.formatUnits()));t.updateWavelength(c.to(t.wavelength.formatUnits()).toNumber(),t.wavelength.formatUnits())},s=l=>{t.updateEnergyUnits(l.target.value)},a=l=>{t.updateCameraLength(Qp(l.target.value))};return D.jsxs(cn,{spacing:2,children:[D.jsx(xn,{variant:"h6",children:"Beam properties"}),D.jsx(ca,{}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"energy",value:t.userEnergy,onChange:o}),D.jsxs(Ai,{children:[D.jsx(da,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.energy.formatUnits(),onChange:s,children:[D.jsx(wn,{value:W0.electronVolts,children:W0.electronVolts}),D.jsx(wn,{value:W0.kiloElectronVolts,children:W0.kiloElectronVolts})]})]})]}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"wavelength",value:t.userWavelength,onChange:r}),D.jsxs(Ai,{children:[D.jsx(da,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.wavelength.formatUnits(),onChange:i,children:[D.jsx(wn,{value:ia.nanometres,children:ia.nanometres}),D.jsx(wn,{value:ia.angstroms,children:"Å"})]})]})]}),D.jsxs(xn,{children:["Minimum allowed wavelength:"," "+t.beamline.minWavelength.toString()]}),D.jsxs(xn,{children:["Maximum allowed wavelength:"," "+t.beamline.maxWavelength.toString()]}),D.jsx(cn,{direction:"row",spacing:1,children:D.jsx($n,{type:"number",size:"small",label:"camera length",value:t.cameraLength??"",InputProps:{inputProps:{max:t.beamline.maxCameraLength.toNumber(),min:t.beamline.minCameraLength.toNumber(),step:t.beamline.cameraLengthStep.toNumber()},endAdornment:D.jsx(si,{position:"end",children:"m"})},onChange:a})}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"angle",defaultValue:"",value:t.userAngle??"",onChange:n}),D.jsxs(Ai,{children:[D.jsx(da,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.angle.formatUnits(),onChange:e,children:[D.jsx(wn,{value:q0.radians,children:q0.radians}),D.jsx(wn,{value:q0.degrees,children:q0.degrees})]})]})]})]})}const Cj=E.createContext(void 0);function Lt(){const t=E.useContext(Cj);if(t===void 0)throw new Error(["MUI: Could not find the data grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the data grid."].join(` -`));return t}const Ej=E.createContext(void 0),mt=()=>{const t=E.useContext(Ej);if(!t)throw new Error("MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return t};function ln(t){return It("MuiDataGrid",t)}const Ie=At("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","autoHeight","booleanCell","cell--editable","cell--editing","cell--textCenter","cell--textLeft","cell--textRight","cell--withRenderer","cell","cellContent","cellCheckbox","cellSkeleton","checkboxInput","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderDropZone","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnGroupHeader","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeader--showColumnBorder","columnHeaders","columnHeadersInner","columnHeadersInner--scrollable","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsPanel","columnsPanelRow","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filterForm","filterFormDeleteIcon","filterFormLinkOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","iconButtonContainer","iconSeparator","main","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","root","root--densityStandard","root--densityComfortable","root--densityCompact","row","row--editable","row--editing","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","scrollArea--left","scrollArea--right","scrollArea","selectedRowCount","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","pinnedColumns--left","pinnedColumns--right","pinnedColumnHeaders","pinnedColumnHeaders--left","pinnedColumnHeaders--right","withBorder","treeDataGroupingCell","treeDataGroupingCellToggle","groupingCriteriaCell","groupingCriteriaCellToggle","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),Ebe=t=>{const{classes:e}=t;return Qe({root:["main"]},ln,e)},Mbe=ze("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(t,e)=>e.main})(()=>({position:"relative",flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden"}));function Mj(t){const e=mt(),n=Ebe(e);return D.jsx(Mbe,{className:n.root,ownerState:e,children:t.children})}function Tbe(t,e){var n=function(_){var C=_.__resizeTriggers__,S=C.firstElementChild,M=C.lastElementChild,P=S.firstElementChild;M.scrollLeft=M.scrollWidth,M.scrollTop=M.scrollHeight,P.style.width=S.offsetWidth+1+"px",P.style.height=S.offsetHeight+1+"px",S.scrollLeft=S.scrollWidth,S.scrollTop=S.scrollHeight},r=function(_){return _.offsetWidth!=_.__resizeLast__.width||_.offsetHeight!=_.__resizeLast__.height},i=function(_){if(!(_.target.className.indexOf("contract-trigger")<0&&_.target.className.indexOf("expand-trigger")<0)){var C=this;n(this),this.__resizeRAF__&&e.cancelAnimationFrame(this.__resizeRAF__),this.__resizeRAF__=e.requestAnimationFrame(function(){r(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(S){S.call(C,_)}))})}},o=!1,s="",a="animationstart",l="Webkit Moz O ms".split(" "),u="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),c="";{var d=document.createElement("fakeelement");if(d.style.animationName!==void 0&&(o=!0),o===!1){for(var f=0;f div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .Mui-resizeTriggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',M=C.constructor.name==="ShadowRoot"?C:_.head||_.getElementsByTagName("head")[0],P=_.createElement("style");P.id="muiDetectElementResize",P.type="text/css",t!=null&&P.setAttribute("nonce",t),P.styleSheet?P.styleSheet.cssText=S:P.appendChild(_.createTextNode(S)),M.appendChild(P)}},m=function(_,C){if(!_.__resizeTriggers__){var S=_.ownerDocument,M=e.getComputedStyle(_);M&&M.position=="static"&&(_.style.position="relative"),b(S,_.getRootNode()),_.__resizeLast__={},_.__resizeListeners__=[],(_.__resizeTriggers__=S.createElement("div")).className="Mui-resizeTriggers",_.__resizeTriggers__.innerHTML='
',_.appendChild(_.__resizeTriggers__),n(_),_.addEventListener("scroll",i,!0),a&&(_.__resizeTriggers__.__animationListener__=function(A){A.animationName==h&&n(_)},_.__resizeTriggers__.addEventListener(a,_.__resizeTriggers__.__animationListener__))}_.__resizeListeners__.push(C)},w=function(_,C){if(_.__resizeListeners__.splice(_.__resizeListeners__.indexOf(C),1),!_.__resizeListeners__.length){_.removeEventListener("scroll",i,!0),_.__resizeTriggers__.__animationListener__&&(_.__resizeTriggers__.removeEventListener(a,_.__resizeTriggers__.__animationListener__),_.__resizeTriggers__.__animationListener__=null);try{_.__resizeTriggers__=!_.removeChild(_.__resizeTriggers__)}catch{}}};return{addResizeListener:m,removeResizeListener:w}}const Abe=["children","defaultHeight","defaultWidth","disableHeight","disableWidth","nonce","onResize","style"],Pbe=E.forwardRef(function(e,n){const{children:r,defaultHeight:i=null,defaultWidth:o=null,disableHeight:s=!1,disableWidth:a=!1,nonce:l,onResize:u,style:c}=e,d=Be(e,Abe),[f,h]=E.useState({height:i,width:o}),p=E.useRef(null),g=E.useRef(null),b=ar(()=>{if(g.current){const _=g.current.offsetHeight||0,C=g.current.offsetWidth||0,M=Bl(g.current).getComputedStyle(g.current),P=parseInt(M.paddingLeft,10)||0,A=parseInt(M.paddingRight,10)||0,R=parseInt(M.paddingTop,10)||0,F=parseInt(M.paddingBottom,10)||0,$=_-R-F,j=C-P-A;(!s&&f.height!==$||!a&&f.width!==j)&&(h({height:$,width:j}),u&&u({height:$,width:j}))}});_r(()=>{var _;if(g.current=p.current.parentElement,!g)return;const C=Bl((_=g.current)!=null?_:void 0),S=Tbe(l,C);return S.addResizeListener(g.current,b),b(),()=>{S.removeResizeListener(g.current,b)}},[l,b]);const m={overflow:"visible"},w={};s||(m.height=0,w.height=f.height),a||(m.width=0,w.width=f.width);const x=An(p,n);return D.jsx("div",O({ref:x,style:O({},m,c)},d,{children:f.height===null&&f.width===null?null:r(w)}))}),Ja=(t,e="warning")=>{let n=!1;const r=Array.isArray(t)?t.join(` -`):t;return()=>{n||(n=!0,e==="error"?console.error(r):console.warn(r))}},hN=(t,e)=>t;function Dbe(t){return t.acceptsApiRef}Ja(["MUI: `useGridSelector` has been called before the initialization of the state.","This hook can only be used inside the context of the grid."]);const gt=(t,e)=>Dbe(e)?e(t):e(t.current.state);var fS="NOT_FOUND";function Rbe(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:fS},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function Ibe(t,e){var n=[];function r(a){var l=n.findIndex(function(c){return e(a,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return fS}function i(a,l){r(a)===fS&&(n.unshift({key:a,value:l}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var Nbe=function(e,n){return e===n};function Fbe(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r{wu.cache===null&&(wu.cache={});const e=(...n)=>{const[r,i]=n,o=!!r.current,s=o?r.current.instanceId:i??"default",a=o?r.current.state:r;wu.cache===null&&(wu.cache={});const{cache:l}=wu;if(l[s]&&l[s].get(t))return l[s].get(t)(a,s);const u=Lbe(...t);return l[s]||(l[s]=new Map),l[s].set(t,u),u(a,s)};return e.acceptsApiRef=!0,e},Bbe=t=>{typeof t<"u"?wu.cache&&wu.cache[t]&&delete wu.cache[t]:wu.cache=null},Kl=t=>t.rows,yE=wt(Kl,t=>t.totalRowCount),$be=wt(Kl,t=>t.loading),zbe=wt(Kl,t=>t.totalTopLevelRowCount),ym=wt(Kl,t=>t.idRowsLookup),pN=wt(Kl,t=>t.idToIdLookup),$c=wt(Kl,t=>t.tree),Ube=wt(Kl,t=>t.groupingName),mN=wt(Kl,t=>t.treeDepth),df=wt(Kl,t=>t.ids),Hbe=wt(Kl,t=>t==null?void 0:t.additionalRowGroups),gb=wt(Hbe,t=>t==null?void 0:t.pinnedRows),Vbe=wt(gb,t=>{var e,n;return((t==null||(e=t.top)==null?void 0:e.length)||0)+((t==null||(n=t.bottom)==null?void 0:n.length)||0)}),gN=t=>t.sorting,vN=wt(gN,t=>t.sortedRows),yN=wt(vN,ym,(t,e)=>t.map(n=>({id:n,model:e[n]}))),Ra=wt(gN,t=>t.sortModel),Gbe=wt(Ra,t=>t.reduce((n,r,i)=>(n[r.field]={sortDirection:r.sort,sortIndex:t.length>1?i+1:void 0},n),{})),$f=t=>t.columns,Wm=wt($f,t=>t.all),th=wt($f,t=>t.lookup),qa=wt(Wm,th,(t,e)=>t.map(n=>e[n])),Tu=wt($f,t=>t.columnVisibilityModel),lo=wt(qa,Tu,(t,e)=>t.filter(n=>e[n.field]!==!1));wt(lo,t=>t.map(e=>e.field));const zf=wt(lo,t=>{const e=[];let n=0;for(let r=0;r{const n=t.length;return n===0?0:e[n-1]+t[n-1].computedWidth}),bN=wt(qa,t=>t.filter(e=>e.filterable)),jbe=wt(qa,t=>t.reduce((e,n)=>(n.filterable&&(e[n.field]=n),e),{}));hN(wt(bN,t=>t.map(e=>e.field)));hN(wt(lo,t=>t.length));const Wbe=hN(wt(zf,bE,(t,e)=>({totalWidth:e,positions:t}))),vb=t=>t.filter,Lo=wt(vb,t=>t.filterModel),qbe=wt(Lo,t=>t.quickFilterValues),Xbe=wt(vb,t=>t.visibleRowsLookup),Aj=wt(vb,t=>t.filteredRowsLookup);wt(vb,t=>t.filteredDescendantCountLookup);const Ku=wt(Xbe,yN,(t,e)=>e.filter(n=>t[n.id]!==!1)),bv=wt(Ku,t=>t.map(e=>e.id)),Kbe=wt(Aj,yN,(t,e)=>e.filter(n=>t[n.id]!==!1)),Ybe=wt(Kbe,t=>t.map(e=>e.id)),Pj=wt(Ku,$c,mN,(t,e,n)=>n<2?t:t.filter(r=>{var i;return((i=e[r.id])==null?void 0:i.depth)===0})),Dj=wt(Ku,t=>t.length),Rj=wt(Pj,t=>t.length),Ij=wt(Lo,th,(t,e)=>{var n;return(n=t.items)==null?void 0:n.filter(r=>{var i,o;if(!r.columnField)return!1;const s=e[r.columnField];if(!(s!=null&&s.filterOperators)||(s==null||(i=s.filterOperators)==null?void 0:i.length)===0)return!1;const a=s.filterOperators.find(l=>l.value===r.operatorValue);return a?!a.InputComponent||r.value!=null&&((o=r.value)==null?void 0:o.toString())!=="":!1})}),Zbe=wt(Ij,t=>t.reduce((n,r)=>(n[r.columnField]?n[r.columnField].push(r):n[r.columnField]=[r],n),{})),nh=t=>t.density,Nj=wt(nh,t=>t.value),yb=wt(nh,t=>t.rowHeight),Fj=wt(nh,t=>t.headerHeight),xN=wt(nh,t=>t.headerGroupingMaxDepth),Qbe=wt(nh,t=>t.factor),bb=wt(nh,t=>t.headerHeight*(1+t.headerGroupingMaxDepth));function Jbe(t){var e,n;const r=Lt(),i=mt(),o=gt(r,bb),[s,a]=E.useState(()=>{var c,d;return(c=(d=r.current.getRootDimensions())==null?void 0:d.viewportInnerSize)!=null?c:null}),l=E.useCallback(()=>{var c,d;a((c=(d=r.current.getRootDimensions())==null?void 0:d.viewportInnerSize)!=null?c:null)},[r]);_r(()=>r.current.subscribeEvent("viewportInnerSizeChange",l),[r,l]);let u=(e=s==null?void 0:s.height)!=null?e:0;return i.autoHeight&&u===0&&(u="auto"),s?D.jsx("div",O({style:{height:u,width:(n=s==null?void 0:s.width)!=null?n:0,position:"absolute",top:o,bottom:u==="auto"?0:void 0}},t)):null}function e1e(){const t=Lt(),e=mt(),n=gt(t,yE),r=gt(t,Dj),i=gt(t,$be),o=!i&&n===0,s=!i&&n>0&&r===0;let a=null;if(o){var l;a=D.jsx(e.components.NoRowsOverlay,O({},(l=e.componentsProps)==null?void 0:l.noRowsOverlay))}if(s){var u;a=D.jsx(e.components.NoResultsOverlay,O({},(u=e.componentsProps)==null?void 0:u.noResultsOverlay))}if(i){var c;a=D.jsx(e.components.LoadingOverlay,O({},(c=e.componentsProps)==null?void 0:c.loadingOverlay))}return a===null?null:D.jsx(Jbe,{children:a})}function t1e(t){const{children:e,VirtualScrollerComponent:n,ColumnHeadersComponent:r}=t,i=Lt(),o=mt(),s=gt(i,bb),[a,l]=E.useState(o.disableVirtualization),u=E.useCallback(()=>{l(!0)},[]),c=E.useCallback(()=>{l(!1)},[]);E.useEffect(()=>{l(o.disableVirtualization)},[o.disableVirtualization]),i.current.unstable_disableVirtualization=u,i.current.unstable_enableVirtualization=c;const d=E.useRef(null),f=E.useRef(null),h=E.useRef(null),p=E.useRef(null);i.current.columnHeadersContainerElementRef=f,i.current.columnHeadersElementRef=d,i.current.windowRef=h,i.current.renderingZoneRef=p;const g=E.useCallback(b=>{i.current.publishEvent("resize",b)},[i]);return D.jsxs(Mj,{children:[D.jsx(e1e,{}),D.jsx(r,{ref:f,innerRef:d}),D.jsx(Pbe,{nonce:o.nonce,disableHeight:o.autoHeight,onResize:g,children:b=>{const m={width:b.width,height:b.height?b.height-s:"auto",marginTop:s};return D.jsx(n,{ref:h,style:m,disableVirtualization:a})}}),e]})}function Jr(t,e){const n=E.useRef(null);if(n.current)return n.current;const r=t.current.getLogger(e);return n.current=r,r}let n1e=class extends E.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){this.props.api.current&&(this.logError(e),this.props.api.current.showError({error:e,errorInfo:n}))}logError(e,n){this.props.logger.error(`An unexpected error occurred. Error: ${e&&e.message}. `,e,n)}render(){var e;return this.props.hasError||(e=this.state)!=null&&e.hasError?this.props.render(this.state):this.props.children}};function r1e(t){const{children:e}=t,n=Lt(),r=Jr(n,"GridErrorHandler"),i=mt(),o=n.current.state.error;return D.jsx(n1e,{hasError:o!=null,api:n,logger:r,render:s=>{var a;return D.jsx(Mj,{children:D.jsx(i.components.ErrorOverlay,O({},s,o,(a=i.componentsProps)==null?void 0:a.errorOverlay))})},children:e})}function i1e(){var t;const e=Lt(),n=mt(),r=E.useRef(null);return e.current.footerRef=r,n.hideFooter?null:D.jsx("div",{ref:r,children:D.jsx(n.components.Footer,O({},(t=n.componentsProps)==null?void 0:t.footer))})}function o1e(){var t;const e=Lt(),n=mt(),r=E.useRef(null);return e.current.headerRef=r,D.jsx("div",{ref:r,children:D.jsx(n.components.Header,O({},(t=n.componentsProps)==null?void 0:t.header))})}function Oj(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;et.focus,ka=wt(Lj,t=>t.cell),s1e=wt(Lj,t=>t.columnHeader),Bj=t=>t.tabIndex,hS=wt(Bj,t=>t.cell),$j=wt(Bj,t=>t.columnHeader),a1e=["align","children","colIndex","colDef","cellMode","field","formattedValue","hasFocus","height","isEditable","rowId","tabIndex","value","width","className","showRightBorder","extendRowFullWidth","row","colSpan","disableDragEvents","onClick","onDoubleClick","onMouseDown","onMouseUp","onKeyDown","onDragEnter","onDragOver"];let MT;function l1e(){return MT===void 0&&document.createElement("div").focus({get preventScroll(){return MT=!0,!1}}),MT}const u1e=t=>{const{align:e,showRightBorder:n,isEditable:r,classes:i}=t,o={root:["cell",`cell--text${Ge(e)}`,r&&"cell--editable",n&&"withBorder"],content:["cellContent"]};return Qe(o,ln,i)};function c1e(t){const{align:e,children:n,colIndex:r,cellMode:i,field:o,formattedValue:s,hasFocus:a,height:l,isEditable:u,rowId:c,tabIndex:d,value:f,width:h,className:p,showRightBorder:g,colSpan:b,disableDragEvents:m,onClick:w,onDoubleClick:x,onMouseDown:_,onMouseUp:C,onKeyDown:S,onDragEnter:M,onDragOver:P}=t,A=Be(t,a1e),R=s??f,F=E.useRef(null),$=E.useRef(null),j=Lt(),k=mt(),U={align:e,showRightBorder:g,isEditable:u,classes:k.classes},G=u1e(U),B=E.useCallback(fe=>Me=>{const ye=j.current.getCellParams(c,o||"");j.current.publishEvent(fe,ye,Me),C&&C(Me)},[j,o,C,c]),L=E.useCallback(fe=>Me=>{const ye=j.current.getCellParams(c,o||"");j.current.publishEvent(fe,ye,Me),_&&_(Me)},[j,o,_,c]),N=E.useCallback((fe,Me)=>ye=>{if(!ye.currentTarget.contains(ye.target)||!j.current.getRow(c))return;const we=j.current.getCellParams(c,o||"");j.current.publishEvent(fe,we,ye),Me&&Me(ye)},[j,o,c]),W={minWidth:h,maxWidth:h,minHeight:l,maxHeight:l==="auto"?"none":l};E.useEffect(()=>{if(!a||i===an.Edit)return;const fe=Sr(j.current.rootElementRef.current);if(F.current&&!F.current.contains(fe.activeElement)){const Me=F.current.querySelector('[tabindex="0"]'),ye=$.current||Me||F.current;if(l1e())ye.focus({preventScroll:!0});else{const we=j.current.getScrollPosition();ye.focus(),j.current.scroll(we)}}},[a,i,j]);let K=A.onFocus;const J=j.current.getColumn(o).type==="actions",ae=()=>{if(n==null){const fe=R==null?void 0:R.toString();return D.jsx("div",{title:fe,className:G.content,children:fe})}return E.isValidElement(n)&&J?E.cloneElement(n,{focusElementRef:$}):n},ve=m?null:{onDragEnter:N("cellDragEnter",M),onDragOver:N("cellDragOver",P)};return D.jsx("div",O({ref:F,className:vn(p,G.root),role:"cell","data-field":o,"data-colindex":r,"aria-colindex":r+1,"aria-colspan":b,style:W,tabIndex:(i==="view"||!u)&&!J?d:-1,onClick:N("cellClick",w),onDoubleClick:N("cellDoubleClick",x),onMouseDown:L("cellMouseDown"),onMouseUp:B("cellMouseUp"),onKeyDown:N("cellKeyDown",S)},ve,A,{onFocus:K,children:ae()}))}const d1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","getValue"],f1e=t=>{const{classes:e}=t;return Qe({root:["booleanCell"]},ln,e)},h1e=t=>{const{value:e}=t,n=Be(t,d1e),r=Lt(),i=mt(),o={classes:i.classes},s=f1e(o),a=E.useMemo(()=>e?i.components.BooleanCellTrueIcon:i.components.BooleanCellFalseIcon,[i.components.BooleanCellFalseIcon,i.components.BooleanCellTrueIcon,e]);return D.jsx(a,O({fontSize:"small",className:s.root,titleAccess:r.current.getLocaleText(e?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!e},n))},p1e=E.memo(h1e),m1e=t=>t.rowNode.isAutoGenerated?"":D.jsx(p1e,O({},t)),g1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","getValue","hasFocus","isValidating","isProcessingProps","error","onValueChange"],v1e=t=>{const{classes:e}=t;return Qe({root:["editBooleanCell"]},ln,e)};function y1e(t){var e;const{id:n,value:r,field:i,className:o,hasFocus:s,onValueChange:a}=t,l=Be(t,g1e),u=Lt(),c=E.useRef(null),d=jn(),[f,h]=E.useState(r),p=mt(),g={classes:p.classes},b=v1e(g),m=E.useCallback(async w=>{const x=w.target.checked;a&&await a(w,x),h(x),await u.current.setEditCellValue({id:n,field:i,value:x},w)},[u,i,n,a]);return E.useEffect(()=>{h(r)},[r]),_r(()=>{s&&c.current.focus()},[s]),D.jsx("label",O({htmlFor:d,className:vn(b.root,o)},l,{children:D.jsx(p.components.BaseCheckbox,O({id:d,inputRef:c,checked:!!f,onChange:m,size:"small"},(e=p.componentsProps)==null?void 0:e.baseCheckbox))}))}const b1e=t=>D.jsx(y1e,O({},t)),x1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","getValue","inputProps","isValidating","isProcessingProps","onValueChange"],w1e=ze(fg)({fontSize:"inherit"}),_1e=t=>{const{classes:e}=t;return Qe({root:["editInputCell"]},ln,e)};function S1e(t){const{id:e,value:n,field:r,colDef:i,hasFocus:o,inputProps:s,onValueChange:a}=t,l=Be(t,x1e),u=i.type==="dateTime",c=Lt(),d=E.useRef(),f=E.useMemo(()=>{let x;n==null?x=null:n instanceof Date?x=n:x=new Date((n??"").toString());let _;return x==null||Number.isNaN(x.getTime())?_="":_=new Date(x.getTime()-x.getTimezoneOffset()*60*1e3).toISOString().substr(0,u?16:10),{parsed:x,formatted:_}},[n,u]),[h,p]=E.useState(f),b={classes:mt().classes},m=_1e(b),w=E.useCallback(async x=>{const _=x.target.value;let C;if(_==="")C=null;else{const[S,M]=_.split("T"),[P,A,R]=S.split("-");if(C=new Date,C.setFullYear(Number(P),Number(A)-1,Number(R)),C.setHours(0,0,0,0),M){const[F,$]=M.split(":");C.setHours(Number(F),Number($),0,0)}}a&&await a(x,C),p({parsed:C,formatted:_}),c.current.setEditCellValue({id:e,field:r,value:C},x)},[c,r,e,a]);return E.useEffect(()=>{p(x=>{var _,C;return f.parsed!==x.parsed&&((_=f.parsed)==null?void 0:_.getTime())!==((C=x.parsed)==null?void 0:C.getTime())?f:x})},[f]),_r(()=>{o&&d.current.focus()},[o]),D.jsx(w1e,O({inputRef:d,fullWidth:!0,className:m.root,type:u?"datetime-local":"date",inputProps:O({max:u?"9999-12-31T23:59":"9999-12-31"},s),value:h.formatted,onChange:w},l))}const zj=t=>D.jsx(S1e,O({},t)),C1e=mn(D.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),E1e=mn(D.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),a8=mn(D.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),l8=mn(D.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),M1e=mn(D.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),T1e=mn(D.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),A1e=mn(D.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");mn(D.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");mn(D.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");const P1e=mn(D.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),D1e=mn(D.jsx("path",{d:"M11 19V5h2v14z"}),"Separator"),R1e=mn(D.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),I1e=mn(D.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),N1e=mn(D.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),F1e=mn(D.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),TT=mn(D.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Uj=mn(D.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),O1e=mn(D.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),wN=mn(D.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),Hj=mn(D.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),k1e=mn(D.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),L1e=mn(D.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),B1e=mn(D.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");function zc(t){return typeof t=="object"&&t!==null?t.value:t}function pS(t,e){if(e===void 0)return;const n=e.find(r=>{const i=zc(r);return String(i)===String(t)});return zc(n)}const $1e=["item","applyValue","type","apiRef","focusElementRef"],z1e=({valueOptions:t,valueFormatter:e,field:n},r,i)=>(typeof t=="function"?["",...t({field:n})]:["",...t||[]]).map(s=>{const a=typeof s=="object",l=a?s.value:s,u=a?s.value:s,c=e&&s!==""?e({value:s,field:n,api:r}):s,d=a?s.label:c;return D.jsx(i,{value:u,children:d},l)}),Vj=500;function Sl(t){var e,n,r,i,o;const{item:s,applyValue:a,type:l,apiRef:u,focusElementRef:c}=t,d=Be(t,$1e),f=E.useRef(),[h,p]=E.useState((e=s.value)!=null?e:""),[g,b]=E.useState(!1),m=jn(),w=mt(),_=(r=(((n=w.componentsProps)==null?void 0:n.baseSelect)||{}).native)!=null?r:!0,C=l==="singleSelect"?{select:!0,SelectProps:O({native:_},(i=w.componentsProps)==null?void 0:i.baseSelect),children:z1e(u.current.getColumn(s.columnField),u.current,_?"option":wn)}:{},S=E.useCallback(P=>{let A=P.target.value;if(l==="singleSelect"){const R=u.current.getColumn(s.columnField),F=typeof R.valueOptions=="function"?R.valueOptions({field:R.field}):R.valueOptions;A=pS(A,F)}clearTimeout(f.current),p(String(A)),b(!0),f.current=setTimeout(()=>{a(O({},s,{value:A})),b(!1)},Vj)},[u,a,s,l]);E.useEffect(()=>()=>{clearTimeout(f.current)},[]),E.useEffect(()=>{var P;const A=(P=s.value)!=null?P:"";p(String(A))},[s.value]);const M=g?{endAdornment:D.jsx(wN,{})}:d.InputProps;return D.jsx(w.components.BaseTextField,O({id:m,label:u.current.getLocaleText("filterPanelInputLabel"),placeholder:u.current.getLocaleText("filterPanelInputPlaceholder"),value:h,onChange:S,variant:"standard",type:l||"text",InputProps:M,InputLabelProps:{shrink:!0},inputRef:c},C,d,(o=w.componentsProps)==null?void 0:o.baseTextField))}const U1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","getValue","isValidating","debounceMs","isProcessingProps","onValueChange"],H1e=t=>{const{classes:e}=t;return Qe({root:["editInputCell"]},ln,e)},V1e=ze(fg,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(t,e)=>e.editInputCell})(({theme:t})=>O({},t.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),G1e=E.forwardRef((t,e)=>{var n,r;const i=mt(),{id:o,value:s,field:a,colDef:l,hasFocus:u,debounceMs:c=(n=i.experimentalFeatures)!=null&&n.newEditingApi?200:Vj,isProcessingProps:d,onValueChange:f}=t,h=Be(t,U1e),p=Lt(),g=E.useRef(),[b,m]=E.useState(s),w=H1e(i),x=E.useCallback(async C=>{var S;const M=C.target.value;f&&await f(C,M);const P=p.current.getColumn(a);let A=M;P.valueParser&&(S=i.experimentalFeatures)!=null&&S.newEditingApi&&(A=P.valueParser(M,p.current.getCellParams(o,a))),m(A),p.current.setEditCellValue({id:o,field:a,value:A,debounceMs:c,unstable_skipValueParser:!0},C)},[p,c,a,o,f,(r=i.experimentalFeatures)==null?void 0:r.newEditingApi]),_=p.current.unstable_getEditCellMeta?p.current.unstable_getEditCellMeta(o,a):{};return E.useEffect(()=>{_.changeReason!=="debouncedSetEditCellValue"&&m(s)},[_.changeReason,s]),_r(()=>{u&&g.current.focus()},[u]),D.jsx(V1e,O({ref:e,inputRef:g,className:w.root,ownerState:i,fullWidth:!0,type:l.type==="number"?l.type:"text",value:b??"",onChange:x,endAdornment:d?D.jsx(wN,{}):void 0},h))}),j1e=t=>D.jsx(G1e,O({},t)),_N=t=>t==="Escape",Gj=t=>t==="Enter",xE=t=>t==="Tab",jj=t=>t===" ",W1e=t=>t.indexOf("Arrow")===0,q1e=t=>t==="Home"||t==="End",X1e=t=>t.indexOf("Page")===0,ED=t=>t==="Delete"||t==="Backspace";function wE(t){return t.key.length===1&&t.ctrlKey===!1&&t.metaKey===!1}const K1e=["Enter","Escape","Tab"],Y1e=["Enter","Tab"],Z1e=t=>Gj(t.key)||ED(t.key)||wE(t),Q1e=t=>K1e.indexOf(t)>-1,u8=t=>Y1e.indexOf(t)>-1,xb=t=>q1e(t)||W1e(t)||X1e(t)||jj(t),MD=t=>!!t.key,SN=t=>xE(t)||_N(t),J1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","getValue","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],exe=(t,e)=>{const n=typeof t=="object",r=n?t.value:t,i=n?t.value:t,o=n?t.label:t;return D.jsx(e,{value:i,children:o},r)};function txe(t){return!!t.key}function nxe(t){var e,n,r;const i=mt(),{id:o,value:s,api:a,field:l,row:u,colDef:c,hasFocus:d,error:f,onValueChange:h,initialOpen:p=i.editMode===oo.Cell}=t,g=Be(t,J1e),b=Lt(),m=E.useRef(),w=E.useRef(),[x,_]=E.useState(p),S=(n=(((e=i.componentsProps)==null?void 0:e.baseSelect)||{}).native)!=null?n:!1;let M;typeof c.valueOptions=="function"?M=c.valueOptions({id:o,row:u,field:l}):M=c.valueOptions,c.valueFormatter&&(M=M.map(F=>{if(typeof F=="object")return F;const $={field:l,api:a,value:F};return{value:F,label:String(c.valueFormatter($))}}));const P=async F=>{var $;_(!1);const j=F.target,k=pS(j.value,M);h&&await h(F,k);const U=await b.current.setEditCellValue({id:o,field:l,value:k},F);if(($=i.experimentalFeatures)!=null&&$.newEditingApi||i.editMode===oo.Row||U===!1)return;if(await Promise.resolve(b.current.commitCellChange({id:o,field:l},F))&&(b.current.setCellMode(o,l,"view"),F.key)){const B=b.current.getCellParams(o,l);b.current.publishEvent("cellNavigationKeyDown",B,F)}},A=(F,$)=>{if(i.editMode===oo.Row){_(!1);return}if($==="backdropClick"||_N(F.key)){var j;(j=i.experimentalFeatures)!=null&&j.newEditingApi?b.current.stopCellEditMode({id:o,field:l,ignoreModifications:!0}):b.current.setCellMode(o,l,"view")}},R=F=>{txe(F)&&F.key==="Enter"||_(!0)};return _r(()=>{d&&w.current.focus()},[d]),D.jsx(i.components.BaseSelect,O({ref:m,inputRef:w,value:s,onChange:P,open:x,onOpen:R,MenuProps:{onClose:A},error:f,native:S,fullWidth:!0},g,(r=i.componentsProps)==null?void 0:r.baseSelect,{children:M.map(F=>exe(F,S?"option":wn))}))}const rxe=t=>D.jsx(nxe,O({},t)),ixe=["open","target","onClickAway","children","position","className","onExited"],oxe=t=>{const{classes:e}=t;return Qe({root:["menu"]},ln,e)},sxe=ze(Yf,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(t,e)=>e.menu})(({theme:t})=>({zIndex:t.zIndex.modal,[`& .${Ie.menuList}`]:{outline:0}})),axe={"bottom-start":"top left","bottom-end":"top right"},_E=t=>{var e;const{open:n,target:r,onClickAway:i,children:o,position:s,className:a,onExited:l}=t,u=Be(t,ixe),c=Lt(),d=E.useRef(r),f=E.useRef(n),h=mt(),p=oxe(h);E.useEffect(()=>{f.current&&d.current&&d.current.focus();const b=n?"menuOpen":"menuClose";c.current.publishEvent(b,{target:r}),f.current=n,d.current=r},[c,n,r]);const g=b=>m=>{b&&b(),l&&l(m)};return D.jsx(sxe,O({as:h.components.BasePopper,className:vn(a,p.root),ownerState:h,open:n,anchorEl:r,transition:!0,placement:s},u,(e=h.componentsProps)==null?void 0:e.basePopper,{children:({TransitionProps:b,placement:m})=>D.jsx(FV,{onClickAway:i,mouseEvent:"onMouseDown",children:D.jsx(cy,O({},b,{style:{transformOrigin:axe[m]},onExited:g(b==null?void 0:b.onExited),children:D.jsx(Xu,{children:o})}))})}))},lxe=["colDef","id","api","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","getValue","tabIndex","position","focusElementRef"],uxe=t=>typeof t.getActions=="function",cxe=t=>{const{colDef:e,id:n,hasFocus:r,tabIndex:i,position:o="bottom-end",focusElementRef:s}=t,a=Be(t,lxe),[l,u]=E.useState(-1),[c,d]=E.useState(!1),f=Lt(),h=E.useRef(null),p=E.useRef(null),g=E.useRef(!1),b=E.useRef({}),m=jn(),w=jn(),x=mt();if(E.useLayoutEffect(()=>{r||Object.entries(b.current).forEach(([k,U])=>{U==null||U.stop({},()=>{delete b.current[k]})})},[r]),E.useEffect(()=>{if(l<0||!h.current||l>=h.current.children.length)return;h.current.children[l].focus({preventScroll:!0})},[l]),E.useEffect(()=>{r||(u(-1),g.current=!1)},[r]),E.useImperativeHandle(s,()=>({focus(){g.current||u(0)}}),[]),!uxe(e))throw new Error("MUI: Missing the `getActions` property in the `GridColDef`.");const _=e.getActions(f.current.getRowParams(n)),C=_.filter(k=>!k.props.showInMenu),S=_.filter(k=>k.props.showInMenu),M=C.length+(S.length?1:0);E.useEffect(()=>{l>=M&&u(M-1)},[l,M]);const P=()=>{d(!0),u(M-1),g.current=!0},A=()=>{d(!1)},R=k=>U=>{b.current[k]=U},F=(k,U)=>G=>{u(k),g.current=!0,U&&U(G)},$=k=>{if(M<=1)return;let U=l;k.key==="ArrowRight"?U+=1:k.key==="ArrowLeft"&&(U-=1),!(U<0||U>=M)&&U!==l&&(k.preventDefault(),k.stopPropagation(),u(U))},j=k=>{k.key==="Tab"&&k.preventDefault(),["Tab","Enter","Escape"].includes(k.key)&&A()};return D.jsxs("div",O({role:"menu",ref:h,tabIndex:-1,className:Ie.actionsCell,onKeyDown:$},a,{children:[C.map((k,U)=>E.cloneElement(k,{key:U,touchRippleRef:R(U),onClick:F(U,k.props.onClick),tabIndex:l===U?i:-1})),S.length>0&&w&&D.jsx(io,{ref:p,id:w,"aria-label":f.current.getLocaleText("actionsCellMore"),"aria-controls":m,"aria-expanded":c?"true":void 0,"aria-haspopup":"true",role:"menuitem",size:"small",onClick:P,touchRippleRef:R(w),tabIndex:l===C.length?i:-1,children:D.jsx(x.components.MoreActionsIcon,{fontSize:"small"})}),S.length>0&&D.jsx(_E,{onClickAway:A,onClick:A,open:c,target:p.current,position:o,children:D.jsx(ub,{id:m,className:Ie.menuList,onKeyDown:j,"aria-labelledby":w,variant:"menu",autoFocusItem:!0,children:S.map((k,U)=>E.cloneElement(k,{key:U}))})})]}))},dxe=t=>D.jsx(cxe,O({},t)),fxe=["field","align","width","contentWidth"],hxe=t=>{const{align:e,classes:n}=t,r={root:["cell","cellSkeleton",`cell--text${Ge(e)}`]};return Qe(r,ln,n)};function pxe(t){const{align:e,width:n,contentWidth:r}=t,i=Be(t,fxe),s={classes:mt().classes,align:e},a=hxe(s);return D.jsx("div",O({className:a.root,style:{width:n}},i,{children:D.jsx(ahe,{width:`${r}%`})}))}const mxe=ze("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(t,e)=>[{[`&.${Ie.autoHeight}`]:e.autoHeight},{[`&.${Ie.aggregationColumnHeader}`]:e.aggregationColumnHeader},{[`&.${Ie["aggregationColumnHeader--alignLeft"]}`]:e["aggregationColumnHeader--alignLeft"]},{[`&.${Ie["aggregationColumnHeader--alignCenter"]}`]:e["aggregationColumnHeader--alignCenter"]},{[`&.${Ie["aggregationColumnHeader--alignRight"]}`]:e["aggregationColumnHeader--alignRight"]},{[`&.${Ie.aggregationColumnHeaderLabel}`]:e.aggregationColumnHeaderLabel},{[`& .${Ie.editBooleanCell}`]:e.editBooleanCell},{[`& .${Ie["cell--editing"]}`]:e["cell--editing"]},{[`& .${Ie["cell--textCenter"]}`]:e["cell--textCenter"]},{[`& .${Ie["cell--textLeft"]}`]:e["cell--textLeft"]},{[`& .${Ie["cell--textRight"]}`]:e["cell--textRight"]},{[`& .${Ie["cell--withRenderer"]}`]:e["cell--withRenderer"]},{[`& .${Ie.cell}`]:e.cell},{[`& .${Ie.cellContent}`]:e.cellContent},{[`& .${Ie.cellCheckbox}`]:e.cellCheckbox},{[`& .${Ie.cellSkeleton}`]:e.cellSkeleton},{[`& .${Ie.checkboxInput}`]:e.checkboxInput},{[`& .${Ie["columnHeader--alignCenter"]}`]:e["columnHeader--alignCenter"]},{[`& .${Ie["columnHeader--alignLeft"]}`]:e["columnHeader--alignLeft"]},{[`& .${Ie["columnHeader--alignRight"]}`]:e["columnHeader--alignRight"]},{[`& .${Ie["columnHeader--dragging"]}`]:e["columnHeader--dragging"]},{[`& .${Ie["columnHeader--moving"]}`]:e["columnHeader--moving"]},{[`& .${Ie["columnHeader--numeric"]}`]:e["columnHeader--numeric"]},{[`& .${Ie["columnHeader--sortable"]}`]:e["columnHeader--sortable"]},{[`& .${Ie["columnHeader--sorted"]}`]:e["columnHeader--sorted"]},{[`& .${Ie.columnHeader}`]:e.columnHeader},{[`& .${Ie.columnHeaderCheckbox}`]:e.columnHeaderCheckbox},{[`& .${Ie.columnHeaderDraggableContainer}`]:e.columnHeaderDraggableContainer},{[`& .${Ie.columnHeaderTitleContainer}`]:e.columnHeaderTitleContainer},{[`& .${Ie["columnSeparator--resizable"]}`]:e["columnSeparator--resizable"]},{[`& .${Ie["columnSeparator--resizing"]}`]:e["columnSeparator--resizing"]},{[`& .${Ie.columnSeparator}`]:e.columnSeparator},{[`& .${Ie.filterIcon}`]:e.filterIcon},{[`& .${Ie.iconSeparator}`]:e.iconSeparator},{[`& .${Ie.menuIcon}`]:e.menuIcon},{[`& .${Ie.menuIconButton}`]:e.menuIconButton},{[`& .${Ie.menuOpen}`]:e.menuOpen},{[`& .${Ie.menuList}`]:e.menuList},{[`& .${Ie["row--editable"]}`]:e["row--editable"]},{[`& .${Ie["row--editing"]}`]:e["row--editing"]},{[`& .${Ie["row--dragging"]}`]:e["row--dragging"]},{[`& .${Ie.row}`]:e.row},{[`& .${Ie.rowReorderCellPlaceholder}`]:e.rowReorderCellPlaceholder},{[`& .${Ie.rowReorderCell}`]:e.rowReorderCell},{[`& .${Ie["rowReorderCell--draggable"]}`]:e["rowReorderCell--draggable"]},{[`& .${Ie.sortIcon}`]:e.sortIcon},{[`& .${Ie.withBorder}`]:e.withBorder},{[`& .${Ie.treeDataGroupingCell}`]:e.treeDataGroupingCell},{[`& .${Ie.treeDataGroupingCellToggle}`]:e.treeDataGroupingCellToggle},{[`& .${Ie.detailPanelToggleCell}`]:e.detailPanelToggleCell},{[`& .${Ie["detailPanelToggleCell--expanded"]}`]:e["detailPanelToggleCell--expanded"]},e.root]})(({theme:t})=>{const e=t.palette.mode==="light"?wI(ra(t.palette.divider,1),.88):xI(ra(t.palette.divider,1),.68);return O({flex:1,boxSizing:"border-box",position:"relative",border:`1px solid ${e}`,borderRadius:t.shape.borderRadius,color:t.palette.text.primary},t.typography.body2,{outline:"none",height:"100%",display:"flex",flexDirection:"column",[`&.${Ie.autoHeight}`]:{height:"auto",[`& .${Ie["row--lastVisible"]} .${Ie.cell}`]:{borderBottomColor:"transparent"}},[`& .${Ie["virtualScrollerContent--overflowed"]} .${Ie["row--lastVisible"]} .${Ie.cell}`]:{borderBottomColor:"transparent"},[`& .${Ie.columnHeader}, & .${Ie.cell}`]:{WebkitTapHighlightColor:"transparent",lineHeight:null,padding:"0 10px",boxSizing:"border-box"},[`& .${Ie.columnHeader}:focus-within, & .${Ie.cell}:focus-within`]:{outline:`solid ${ra(t.palette.primary.main,.5)} 1px`,outlineWidth:1,outlineOffset:-1},[`& .${Ie.columnHeader}:focus, & .${Ie.cell}:focus`]:{outline:`solid ${t.palette.primary.main} 1px`},[`& .${Ie.columnHeaderCheckbox}, & .${Ie.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${Ie.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${Ie["columnHeader--sorted"]} .${Ie.iconButtonContainer}, & .${Ie["columnHeader--filtered"]} .${Ie.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${Ie.columnHeader}:not(.${Ie["columnHeader--sorted"]}) .${Ie.sortIcon}`]:{opacity:0,transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.shorter})},[`& .${Ie.columnHeader}:not(.${Ie["columnHeader--sorted"]}):hover .${Ie.sortIcon}`]:{opacity:.5},[`& .${Ie.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${Ie.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${Ie["columnHeader--filledGroup"]} .${Ie.columnHeaderTitleContainer}`]:{borderBottom:`solid ${e} 1px`,boxSizing:"border-box"},[`& .${Ie["columnHeader--filledGroup"]}.${Ie["columnHeader--showColumnBorder"]} .${Ie.columnHeaderTitleContainer}`]:{borderBottom:"none"},[`& .${Ie["columnHeader--filledGroup"]}.${Ie["columnHeader--showColumnBorder"]}`]:{borderBottom:`solid ${e} 1px`,boxSizing:"border-box"},[`& .${Ie.sortIcon}, & .${Ie.filterIcon}`]:{fontSize:"inherit"},[`& .${Ie["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${Ie["columnHeader--alignCenter"]} .${Ie.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${Ie["columnHeader--alignRight"]} .${Ie.columnHeaderDraggableContainer}, & .${Ie["columnHeader--alignRight"]} .${Ie.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${Ie["columnHeader--alignCenter"]} .${Ie.menuIcon}, & .${Ie["columnHeader--alignRight"]} .${Ie.menuIcon}`]:{marginRight:"auto",marginLeft:-6},[`& .${Ie["columnHeader--alignRight"]} .${Ie.menuIcon}, & .${Ie["columnHeader--alignRight"]} .${Ie.menuIcon}`]:{marginRight:"auto",marginLeft:-10},[`& .${Ie["columnHeader--moving"]}`]:{backgroundColor:t.palette.action.hover},[`& .${Ie.columnSeparator}`]:{position:"absolute",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"center",color:e},[`& .${Ie["columnSeparator--sideLeft"]}`]:{left:-12},[`& .${Ie["columnSeparator--sideRight"]}`]:{right:-12},[`& .${Ie["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none","&:hover":{color:t.palette.text.primary,"@media (hover: none)":{color:e}},[`&.${Ie["columnSeparator--resizing"]}`]:{color:t.palette.text.primary},"& svg":{pointerEvents:"none"}},[`& .${Ie.iconSeparator}`]:{color:"inherit"},[`& .${Ie.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-10,display:"flex",alignItems:"center"},[`& .${Ie.columnHeader}:hover`]:{[`& .${Ie.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${Ie.menuIcon}`]:{width:"auto",visibility:"visible"}},[`.${Ie.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${Ie.row}`]:{display:"flex",width:"fit-content",breakInside:"avoid","&:hover, &.Mui-hovered":{backgroundColor:t.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&.Mui-selected":{backgroundColor:ra(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:ra(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:ra(t.palette.primary.main,t.palette.action.selectedOpacity)}}}},[`& .${Ie.cell}`]:{display:"flex",alignItems:"center",borderBottom:`1px solid ${e}`},[`& .${Ie.row}:not(.${Ie["row--dynamicHeight"]}) > .${Ie.cell}`]:{overflow:"hidden",whiteSpace:"nowrap"},[`& .${Ie.cellContent}`]:{overflow:"hidden",textOverflow:"ellipsis"},[`& .${Ie.cell}.${Ie["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:t.shadows[2],backgroundColor:t.palette.background.paper,"&:focus-within":{outline:`solid ${t.palette.primary.main} 1px`,outlineOffset:"-1px"}},[`& .${Ie["row--editing"]}`]:{boxShadow:t.shadows[2]},[`& .${Ie["row--editing"]} .${Ie.cell}`]:{boxShadow:t.shadows[0],backgroundColor:t.palette.background.paper},[`& .${Ie.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${Ie.booleanCell}[data-value="true"]`]:{color:t.palette.text.secondary},[`& .${Ie.booleanCell}[data-value="false"]`]:{color:t.palette.text.disabled},[`& .${Ie.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:t.spacing(1)},[`& .${Ie.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:t.palette.action.disabledOpacity},[`& .${Ie["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${Ie.rowReorderCellContainer}`]:{padding:0,alignItems:"stretch"},[`& .${Ie.withBorder}`]:{borderRight:`1px solid ${e}`},[`& .${Ie["cell--textLeft"]}`]:{justifyContent:"flex-start"},[`& .${Ie["cell--textRight"]}`]:{justifyContent:"flex-end"},[`& .${Ie["cell--textCenter"]}`]:{justifyContent:"center"},[`& .${Ie.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${Ie.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${Ie["columnHeader--dragging"]}, & .${Ie["row--dragging"]}`]:{background:t.palette.background.paper,padding:"0 12px",borderRadius:t.shape.borderRadius,opacity:t.palette.action.disabledOpacity},[`& .${Ie["row--dragging"]}`]:{background:t.palette.background.paper,padding:"0 12px",borderRadius:t.shape.borderRadius,opacity:t.palette.action.disabledOpacity,[`& .${Ie.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${Ie.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Ie.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:t.spacing(2)},[`& .${Ie.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Ie.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:t.spacing(2)}})}),gxe=["children","className"],vxe=t=>{const{autoHeight:e,density:n,classes:r}=t,i={root:["root",e&&"autoHeight",`root--density${Ge(n)}`]};return Qe(i,ln,r)},yxe=E.forwardRef(function(e,n){const r=mt(),{children:i,className:o}=e,s=Be(e,gxe),a=Lt(),l=gt(a,lo),u=gt(a,yE),c=gt(a,Nj),d=gt(a,xN),f=E.useRef(null),h=An(f,n),p=gt(a,Vbe),g=O({},r,{density:c}),b=vxe(g);a.current.rootElementRef=f;const[m,w]=E.useState(!1);return _r(()=>{w(!0)},[]),_r(()=>{m&&a.current.unstable_updateGridDimensionsRef()},[a,m]),m?D.jsx(mxe,O({ref:h,className:vn(o,b.root),ownerState:g,role:"grid","aria-colcount":l.length,"aria-rowcount":d+1+p+u,"aria-multiselectable":!r.disableMultipleSelection,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"]},s,{children:i})):null}),bxe=["className"],xxe=t=>{const{classes:e}=t;return Qe({root:["footerContainer"]},ln,e)},wxe=ze("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(t,e)=>e.footerContainer})(({theme:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:`1px solid ${t.palette.mode==="light"?wI(ra(t.palette.divider,1),.88):xI(ra(t.palette.divider,1),.68)}`})),_xe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,bxe),o=mt(),s=xxe(o);return D.jsx(wxe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),Sxe=["className"],Cxe=t=>{const{classes:e}=t;return Qe({root:["overlay"]},ln,e)},Exe=ze("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(t,e)=>e.overlay})(({theme:t})=>({position:"absolute",top:0,zIndex:4,width:"100%",height:"100%",pointerEvents:"none",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:ra(t.palette.background.default,t.palette.action.disabledOpacity)})),SE=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,Sxe),o=mt(),s=Cxe(o);return D.jsx(Exe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),Mxe=["className","children"],Txe=t=>{const{classes:e}=t;return Qe({root:["toolbarContainer"]},ln,e)},Axe=ze("div",{name:"MuiDataGrid",slot:"ToolbarContainer",overridesResolver:(t,e)=>e.toolbarContainer})(({theme:t})=>({display:"flex",alignItems:"center",flexWrap:"wrap",padding:t.spacing(.5,.5,0)})),Pxe=E.forwardRef(function(e,n){const{className:r,children:i}=e,o=Be(e,Mxe),s=mt(),a=Txe(s);return i?D.jsx(Axe,O({ref:n,className:vn(r,a.root),ownerState:s},o,{children:i})):null}),Dxe=["className"],Rxe=t=>{const{classes:e}=t;return Qe({root:["iconButtonContainer"]},ln,e)},Ixe=ze("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(t,e)=>e.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),Wj=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,Dxe),o=mt(),s=Rxe(o);return D.jsx(Ixe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),Nxe=t=>{const{classes:e}=t;return Qe({icon:["sortIcon"]},ln,e)};function Fxe(t,e,n,r){let i;const o={};return e==="asc"?i=t.ColumnSortedAscendingIcon:e==="desc"?i=t.ColumnSortedDescendingIcon:(i=t.ColumnUnsortedIcon,o.sortingOrder=r),i?D.jsx(i,O({fontSize:"small",className:n},o)):null}function Oxe(t){const{direction:e,index:n,sortingOrder:r}=t,i=Lt(),o=mt(),s=O({},t,{classes:o.classes}),a=Nxe(s),l=Fxe(o.components,e,a.icon,r);if(!l)return null;const u=D.jsx(io,{tabIndex:-1,"aria-label":i.current.getLocaleText("columnHeaderSortIconLabel"),title:i.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",children:l});return D.jsxs(Wj,{children:[n!=null&&D.jsx(VI,{badgeContent:n,color:"default",children:u}),n==null&&u]})}const kxe=E.memo(Oxe),Lxe=t=>{const{classes:e,open:n}=t;return Qe({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},ln,e)},Bxe=E.memo(t=>{const{column:e,open:n,columnMenuId:r,columnMenuButtonId:i,iconButtonRef:o}=t,s=Lt(),a=mt(),l=O({},t,{classes:a.classes}),u=Lxe(l),c=E.useCallback(d=>{d.preventDefault(),d.stopPropagation(),s.current.toggleColumnMenu(e.field)},[s,e.field]);return D.jsx("div",{className:u.root,children:D.jsx(io,{ref:o,tabIndex:-1,className:u.button,"aria-label":s.current.getLocaleText("columnMenuLabel"),title:s.current.getLocaleText("columnMenuLabel"),size:"small",onClick:c,"aria-expanded":n?"true":void 0,"aria-haspopup":"true","aria-controls":r,id:i,children:D.jsx(a.components.ColumnMenuIcon,{fontSize:"small"})})})});function $xe({columnMenuId:t,columnMenuButtonId:e,ContentComponent:n,contentComponentProps:r,field:i,open:o,target:s,onExited:a}){const l=Lt(),u=l.current.getColumn(i),c=E.useCallback(d=>{d.stopPropagation(),l.current.hideColumnMenu()},[l]);return s?D.jsx(_E,{placement:`bottom-${u.align==="right"?"start":"end"}`,open:o,target:s,onClickAway:c,onExited:a,children:D.jsx(n,O({currentColumn:u,hideMenu:c,open:o,id:t,labelledby:e},r))}):null}function zxe(t){return t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth}function Uxe(t,e){return t.closest(`.${e}`)}function CN(t){return t.replace(/["\\]/g,"\\$&")}function Hxe(t,e){return t.querySelector(`[role="columnheader"][data-field="${CN(e)}"]`)}function qj(t){return`.${Ie.row}[data-id="${CN(String(t))}"]`}function Vxe(t,e){return t.querySelector(qj(e))}function Gxe(t,{id:e,field:n}){const r=qj(e),i=`.${Ie.cell}[data-field="${CN(n)}"]`,o=`${r} ${i}`;return t.querySelector(o)}const jxe=["className"],Wxe=t=>{const{classes:e}=t;return Qe({root:["columnHeaderTitle"]},ln,e)},qxe=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(t,e)=>e.columnHeaderTitle})(({theme:t})=>({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:t.typography.fontWeightMedium})),Xxe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,jxe),o=mt(),s=Wxe(o);return D.jsx(qxe,O({ref:n,className:vn(s.root,r),ownerState:o},i))});function Kxe(t){var e;const{label:n,description:r,columnWidth:i}=t,o=mt(),s=E.useRef(null),[a,l]=E.useState("");return E.useEffect(()=>{if(!r&&s&&s.current){const u=zxe(s.current);l(u?n:"")}},[s,i,r,n]),D.jsx(o.components.BaseTooltip,O({title:r||a},(e=o.componentsProps)==null?void 0:e.baseTooltip,{children:D.jsx(Xxe,{ref:s,children:n})}))}const Yxe=["resizable","resizing","height","side"];var TD;(function(t){t.Left="left",t.Right="right"})(TD||(TD={}));const Zxe=t=>{const{resizable:e,resizing:n,classes:r,side:i}=t,o={root:["columnSeparator",e&&"columnSeparator--resizable",n&&"columnSeparator--resizing",i&&`columnSeparator--side${Ge(i)}`],icon:["iconSeparator"]};return Qe(o,ln,r)};function Qxe(t){const{height:e,side:n=TD.Right}=t,r=Be(t,Yxe),i=mt(),o=O({},t,{side:n,classes:i.classes}),s=Zxe(o),a=E.useCallback(l=>{l.preventDefault(),l.stopPropagation()},[]);return D.jsx("div",O({className:s.root,style:{minHeight:e,opacity:i.showColumnRightBorder?0:1}},r,{onClick:a,children:D.jsx(i.components.ColumnResizeIcon,{className:s.icon})}))}const Jxe=E.memo(Qxe),ewe=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","disableHeaderSeparator"],Xj=E.forwardRef(function(e,n){const{classes:r,columnMenuOpen:i,colIndex:o,height:s,isResizing:a,sortDirection:l,hasFocus:u,tabIndex:c,separatorSide:d,isDraggable:f,headerComponent:h,description:p,width:g,columnMenuIconButton:b=null,columnMenu:m=null,columnTitleIconButtons:w=null,headerClassName:x,label:_,resizable:C,draggableContainerProps:S,columnHeaderSeparatorProps:M,disableHeaderSeparator:P}=e,A=Be(e,ewe),R=Lt(),F=mt(),$=E.useRef(null),[j,k]=E.useState(i),U=An($,n);let G="none";return l!=null&&(G=l==="asc"?"ascending":"descending"),E.useEffect(()=>{j||k(i)},[j,i]),E.useLayoutEffect(()=>{const B=R.current.state.columnMenu;if(u&&!B.open){const N=$.current.querySelector('[tabindex="0"]')||$.current;N==null||N.focus(),R.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[R,u]),D.jsxs("div",O({ref:U,className:vn(r.root,x),style:{height:s,width:g,minWidth:g,maxWidth:g},role:"columnheader",tabIndex:c,"aria-colindex":o+1,"aria-sort":G,"aria-label":h==null?_:void 0},A,{children:[D.jsxs("div",O({className:r.draggableContainer,draggable:f},S,{children:[D.jsxs("div",{className:r.titleContainer,children:[D.jsx("div",{className:r.titleContainerContent,children:h!==void 0?h:D.jsx(Kxe,{label:_,description:p,columnWidth:g})}),w]}),b]})),!P&&D.jsx(Jxe,O({resizable:!F.disableColumnResize&&!!C,resizing:a,height:s,side:d},M)),m]}))}),twe=t=>{const{column:e,classes:n,isDragging:r,sortDirection:i,showRightBorder:o,filterItemsCounter:s}=t,a=i!=null,l=s!=null&&s>0,u=e.type==="number",c={root:["columnHeader",e.headerAlign==="left"&&"columnHeader--alignLeft",e.headerAlign==="center"&&"columnHeader--alignCenter",e.headerAlign==="right"&&"columnHeader--alignRight",e.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",a&&"columnHeader--sorted",l&&"columnHeader--filtered",u&&"columnHeader--numeric",o&&"withBorder"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Qe(c,ln,n)};function nwe(t){var e,n,r,i,o;const{column:s,columnMenuOpen:a,colIndex:l,headerHeight:u,isResizing:c,isLastColumn:d,sortDirection:f,sortIndex:h,filterItemsCounter:p,hasFocus:g,tabIndex:b,extendRowFullWidth:m,disableReorder:w,separatorSide:x}=t,_=Lt(),C=mt(),S=E.useRef(null),M=jn(),P=jn(),A=E.useRef(null),[R,F]=E.useState(a),{hasScrollX:$,hasScrollY:j}=(e=_.current.getRootDimensions())!=null?e:{hasScrollX:!1,hasScrollY:!1},k=E.useMemo(()=>!C.disableColumnReorder&&!w&&!s.disableReorder,[C.disableColumnReorder,w,s.disableReorder]);let U;s.renderHeader&&(U=s.renderHeader(_.current.getColumnHeaderParams(s.field)));const B=d?!(d&&$&&!j)&&!m:C.showColumnRightBorder,L=O({},t,{classes:C.classes,showRightBorder:B}),N=twe(L),W=E.useCallback(Oe=>re=>{re.currentTarget.contains(re.target)&&_.current.publishEvent(Oe,_.current.getColumnHeaderParams(s.field),re)},[_,s.field]),K=E.useMemo(()=>({onClick:W("columnHeaderClick"),onDoubleClick:W("columnHeaderDoubleClick"),onMouseOver:W("columnHeaderOver"),onMouseOut:W("columnHeaderOut"),onMouseEnter:W("columnHeaderEnter"),onMouseLeave:W("columnHeaderLeave"),onKeyDown:W("columnHeaderKeyDown"),onFocus:W("columnHeaderFocus"),onBlur:W("columnHeaderBlur")}),[W]),Q=E.useMemo(()=>k?{onDragStart:W("columnHeaderDragStart"),onDragEnter:W("columnHeaderDragEnter"),onDragOver:W("columnHeaderDragOver"),onDragEnd:W("columnHeaderDragEnd")}:{},[k,W]),J=E.useMemo(()=>({onMouseDown:W("columnSeparatorMouseDown")}),[W]);E.useEffect(()=>{R||F(a)},[R,a]);const ae=E.useCallback(()=>{F(!1)},[]),ve=!C.disableColumnMenu&&!s.disableColumnMenu&&D.jsx(Bxe,{column:s,columnMenuId:M,columnMenuButtonId:P,open:R,iconButtonRef:A}),fe=D.jsx($xe,{columnMenuId:M,columnMenuButtonId:P,field:s.field,open:a,target:A.current,ContentComponent:C.components.ColumnMenu,contentComponentProps:(n=C.componentsProps)==null?void 0:n.columnMenu,onExited:ae}),Me=(r=s.sortingOrder)!=null?r:C.sortingOrder,ye=D.jsxs(E.Fragment,{children:[!C.disableColumnFilter&&D.jsx(C.components.ColumnHeaderFilterIconButton,O({field:s.field,counter:p},(i=C.componentsProps)==null?void 0:i.columnHeaderFilterIconButton)),s.sortable&&!s.hideSortIcons&&D.jsx(kxe,{direction:f,index:h,sortingOrder:Me})]});E.useLayoutEffect(()=>{const Oe=_.current.state.columnMenu;if(g&&!Oe.open){const _e=S.current.querySelector('[tabindex="0"]')||S.current;_e==null||_e.focus(),_.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[_,g]);const we=typeof s.headerClassName=="function"?s.headerClassName({field:s.field,colDef:s}):s.headerClassName,Fe=(o=s.headerName)!=null?o:s.field;return D.jsx(Xj,O({ref:S,classes:N,columnMenuOpen:a,colIndex:l,height:u,isResizing:c,sortDirection:f,hasFocus:g,tabIndex:b,separatorSide:x,isDraggable:k,headerComponent:U,description:s.description,elementId:s.field,width:s.computedWidth,columnMenuIconButton:ve,columnTitleIconButtons:ye,headerClassName:we,label:Fe,resizable:!C.disableColumnResize&&!!s.resizable,"data-field":s.field,columnMenu:fe,draggableContainerProps:Q,columnHeaderSeparatorProps:J},K))}const qm=t=>t.preferencePanel;var Za;(function(t){t.filters="filters",t.columns="columns"})(Za||(Za={}));const rwe=t=>{const{classes:e}=t;return Qe({icon:["filterIcon"]},ln,e)};function iwe(t){var e;const{counter:n,field:r,onClick:i}=t,o=Lt(),s=mt(),a=O({},t,{classes:s.classes}),l=rwe(a),u=E.useCallback(d=>{d.preventDefault(),d.stopPropagation();const{open:f,openedPanelValue:h}=qm(o.current.state);f&&h===Za.filters?o.current.hideFilterPanel():o.current.showFilterPanel(),i&&i(o.current.getColumnHeaderParams(r),d)},[o,r,i]);if(!n)return null;const c=D.jsx(io,{onClick:u,color:"default","aria-label":o.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,children:D.jsx(s.components.ColumnFilteredIcon,{className:l.icon,fontSize:"small"})});return D.jsx(s.components.BaseTooltip,O({title:o.current.getLocaleText("columnHeaderFiltersTooltipActive")(n),enterDelay:1e3},(e=s.componentsProps)==null?void 0:e.baseTooltip,{children:D.jsxs(Wj,{children:[n>1&&D.jsx(VI,{badgeContent:n,color:"default",children:c}),n===1&&c]})}))}const owe=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","getValue","api"],swe=t=>{const{classes:e}=t;return Qe({root:["checkboxInput"]},ln,e)},awe=E.forwardRef(function(e,n){var r;const{field:i,id:o,value:s,rowNode:a,hasFocus:l,tabIndex:u}=e,c=Be(e,owe),d=Lt(),f=mt(),h={classes:f.classes},p=swe(h),g=E.useRef(null),b=E.useRef(),m=An(g,n),w=d.current.getCellElement(o,i),x=M=>{const P={value:M.target.checked,id:o};d.current.publishEvent("rowSelectionCheckboxChange",P,M)};E.useLayoutEffect(()=>{u===0&&w&&(w.tabIndex=-1)},[w,u]),E.useEffect(()=>{if(l){var M;const P=(M=g.current)==null?void 0:M.querySelector("input");P==null||P.focus({preventScroll:!0})}else b.current&&b.current.stop({})},[l]);const _=E.useCallback(M=>{jj(M.key)&&M.stopPropagation(),xb(M.key)&&!M.shiftKey&&d.current.publishEvent("cellNavigationKeyDown",e,M)},[d,e]);if(a.position==="footer")return null;const C=d.current.isRowSelectable(o),S=d.current.getLocaleText(s?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return a.isPinned?null:D.jsx(f.components.BaseCheckbox,O({ref:m,tabIndex:u,checked:s,onChange:x,className:p.root,inputProps:{"aria-label":S},onKeyDown:_,disabled:!C,touchRippleRef:b},(r=f.componentsProps)==null?void 0:r.baseCheckbox,c))}),lwe=awe,Qs=t=>t.selection,uwe=wt(Qs,t=>t.length),cwe=wt(Qs,ym,(t,e)=>new Map(t.map(n=>[n,e[n]]))),mS=wt(Qs,t=>t.reduce((e,n)=>(e[n]=n,e),{})),vg=t=>t.pagination,X0=wt(vg,t=>t.page),xv=wt(vg,t=>t.pageSize);wt(vg,t=>t.pageCount);const EN=wt(vg,$c,mN,Ku,Pj,(t,e,n,r,i)=>{const o=i.length,s=Math.min(t.pageSize*t.page,o-1),a=Math.min(s+t.pageSize-1,o-1);if(s===-1||a===-1)return null;if(n<2)return{firstRowIndex:s,lastRowIndex:a};const l=i[s],u=a-s+1,c=r.findIndex(h=>h.id===l.id);let d=c,f=0;for(;d0)&&(d+=1),p===0&&(f+=1)}return{firstRowIndex:c,lastRowIndex:d-1}}),dwe=wt(Ku,EN,(t,e)=>e?t.slice(e.firstRowIndex,e.lastRowIndex+1):[]),Kj=wt(bv,EN,(t,e)=>e?t.slice(e.firstRowIndex,e.lastRowIndex+1):[]),fwe=["field","colDef"],hwe=t=>{const{classes:e}=t;return Qe({root:["checkboxInput"]},ln,e)},pwe=E.forwardRef(function(e,n){var r;const i=Be(e,fwe),[,o]=E.useState(!1),s=Lt(),a=mt(),l={classes:a.classes},u=hwe(l),c=gt(s,$j),d=gt(s,Qs),f=gt(s,bv),h=gt(s,Kj),p=E.useMemo(()=>typeof a.isRowSelectable!="function"?d:d.filter(P=>s.current.getRow(P)?a.isRowSelectable(s.current.getRowParams(P)):!1),[s,a.isRowSelectable,d]),g=E.useMemo(()=>(!a.pagination||!a.checkboxSelectionVisibleOnly?f:h).reduce((A,R)=>(A[R]=!0,A),{}),[a.pagination,a.checkboxSelectionVisibleOnly,h,f]),b=E.useMemo(()=>p.filter(P=>g[P]).length,[p,g]),m=b>0&&b0,x=P=>{const A={value:P.target.checked};s.current.publishEvent("headerSelectionCheckboxChange",A)},_=c!==null&&c.field===e.field?0:-1;E.useLayoutEffect(()=>{const P=s.current.getColumnHeaderElement(e.field);_===0&&P&&(P.tabIndex=-1)},[_,s,e.field]);const C=E.useCallback(P=>{P.key===" "&&s.current.publishEvent("headerSelectionCheckboxChange",{value:!w}),xb(P.key)&&!P.shiftKey&&s.current.publishEvent("columnHeaderNavigationKeyDown",e,P)},[s,e,w]),S=E.useCallback(()=>{o(P=>!P)},[]);E.useEffect(()=>s.current.subscribeEvent("selectionChange",S),[s,S]);const M=s.current.getLocaleText(w?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return D.jsx(a.components.BaseCheckbox,O({ref:n,indeterminate:m,checked:w,onChange:x,className:u.root,inputProps:{"aria-label":M},tabIndex:_,onKeyDown:C},(r=a.componentsProps)==null?void 0:r.baseCheckbox,i))}),mwe=t=>{const{onClick:e}=t,n=Lt(),r=mt(),i=E.useCallback(o=>{e(o),n.current.showPreferences(Za.columns)},[n,e]);return r.disableColumnSelector?null:D.jsx(wn,{onClick:i,children:n.current.getLocaleText("columnMenuShowColumns")})},gwe=t=>{const{column:e,onClick:n}=t,r=Lt(),i=mt(),o=E.useCallback(s=>{n(s),r.current.showFilterPanel(e==null?void 0:e.field)},[r,e==null?void 0:e.field,n]);return i.disableColumnFilter||!(e!=null&&e.filterable)?null:D.jsx(wn,{onClick:o,children:r.current.getLocaleText("columnMenuFilter")})},vwe=["hideMenu","currentColumn","open","id","labelledby","className","children"],ywe=E.forwardRef(function(e,n){const{hideMenu:r,open:i,id:o,labelledby:s,className:a,children:l}=e,u=Be(e,vwe),c=E.useCallback(d=>{xE(d.key)&&d.preventDefault(),SN(d.key)&&r(d)},[r]);return D.jsx(ub,O({id:o,ref:n,className:vn(Ie.menuList,a),"aria-labelledby":s,onKeyDown:c,autoFocus:i},u,{children:l}))}),bwe=Ja(["MUI: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),Yj=(t,e)=>e&&t.length>1?(bwe(),[t[0]]):t,c8=(t,e)=>n=>O({},n,{sorting:O({},n.sorting,{sortModel:Yj(t,e)})}),xwe=t=>t==="desc",wwe=(t,e)=>{const n=e.current.getColumn(t.field);if(!n)return null;const r=xwe(t.sort)?(...o)=>-1*n.sortComparator(...o):n.sortComparator;return{getSortCellParams:o=>({id:o,field:n.field,rowNode:e.current.getRowNode(o),value:e.current.getCellValue(o,n.field),api:e.current}),comparator:r}},_we=(t,e,n)=>t.reduce((r,i,o)=>{if(r!==0)return r;const s=e.params[o],a=n.params[o];return r=i.comparator(s.value,a.value,s,a),r},0),Swe=(t,e)=>{const n=t.map(r=>wwe(r,e)).filter(r=>!!r);return n.length===0?null:r=>r.map(i=>({node:i,params:n.map(o=>o.getSortCellParams(i.id))})).sort((i,o)=>_we(n,i,o)).map(i=>i.node.id)},d8=(t,e)=>{const n=t.indexOf(e);return!e||n===-1||n+1===t.length?t[0]:t[n+1]},MN=(t,e)=>t==null&&e!=null?-1:e==null&&t!=null?1:t==null&&e==null?0:null,Cwe=new Intl.Collator,Ewe=(t,e)=>{const n=MN(t,e);return n!==null?n:typeof t=="string"?Cwe.compare(t.toString(),e.toString()):t-e},Zj=(t,e)=>{const n=MN(t,e);return n!==null?n:Number(t)-Number(e)},Qj=(t,e)=>{const n=MN(t,e);return n!==null?n:t>e?1:tMath.max(e,Math.min(n,t));function Xa(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)){const i=t.length;if(i!==e.length)return!1;for(let o=0;o{let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function Pwe(t,e,n){const r=Awe(t);return()=>e+(n-e)*r()}function eW(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}const Dwe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"];function tW(t){const{item:e,applyValue:n,type:r,apiRef:i,focusElementRef:o,color:s,error:a,helperText:l,size:u,variant:c}=t,d=Be(t,Dwe),f={color:s,error:a,helperText:l,size:u,variant:c},[h,p]=E.useState(e.value||[]),g=jn(),b=mt();E.useEffect(()=>{var w;const x=(w=e.value)!=null?w:[];p(x.map(String))},[e.value]);const m=E.useCallback((w,x)=>{p(x.map(String)),n(O({},e,{value:[...x]}))},[n,e]);return D.jsx(ly,O({multiple:!0,freeSolo:!0,options:[],filterOptions:(w,x)=>{const{inputValue:_}=x;return _==null||_===""?[]:[_]},id:g,value:h,onChange:m,renderTags:(w,x)=>w.map((_,C)=>D.jsx(HI,O({variant:"outlined",size:"small",label:_},x({index:C})))),renderInput:w=>{var x;return D.jsx(b.components.BaseTextField,O({},w,{label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:O({},w.InputLabelProps,{shrink:!0}),inputRef:o,type:r||"text"},f,(x=b.componentsProps)==null?void 0:x.baseTextField))}},d))}const Rwe=t=>{if(!t)return null;const e=new RegExp(t_(t),"i");return({value:n})=>n!=null?e.test(n.toString()):!1},Iwe=(t=!1)=>[{value:"contains",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new RegExp(t_(n),"i");return({value:i})=>i!=null?r.test(i.toString()):!1},InputComponent:Sl},{value:"equals",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return({value:i})=>i!=null?r.compare(n,i.toString())===0:!1},InputComponent:Sl},{value:"startsWith",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new RegExp(`^${t_(n)}.*$`,"i");return({value:i})=>i!=null?r.test(i.toString()):!1},InputComponent:Sl},{value:"endsWith",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new RegExp(`.*${t_(n)}$`,"i");return({value:i})=>i!=null?r.test(i.toString()):!1},InputComponent:Sl},{value:"isEmpty",getApplyFilterFn:()=>({value:e})=>e===""||e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:e})=>e!==""&&e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const n=t?e.value:e.value.map(i=>i.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return({value:i})=>i!=null?n.some(o=>r.compare(o,i.toString()||"")===0):!1},InputComponent:tW}],sd={width:100,minWidth:50,maxWidth:1/0,hide:!1,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:Ewe,type:"string",align:"left",filterOperators:Iwe(),renderEditCell:j1e,getApplyQuickFilterFn:Rwe},TN="actions",Nwe=O({},sd,{sortable:!1,filterable:!1,aggregable:!1,width:100,align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:dxe,getApplyQuickFilterFn:void 0}),Fwe=["item","applyValue","apiRef","focusElementRef"];function Owe(t){var e,n,r,i;const{item:o,applyValue:s,apiRef:a,focusElementRef:l}=t,u=Be(t,Fwe),[c,d]=E.useState(o.value||""),f=mt(),p=(n=(((e=f.componentsProps)==null?void 0:e.baseSelect)||{}).native)!=null?n:!0,g=p?"option":wn,b=E.useCallback(m=>{const w=m.target.value;d(w),s(O({},o,{value:w}))},[s,o]);return E.useEffect(()=>{d(o.value||"")},[o.value]),D.jsxs(f.components.BaseTextField,O({label:a.current.getLocaleText("filterPanelInputLabel"),value:c,onChange:b,select:!0,variant:"standard",SelectProps:O({native:p,displayEmpty:!0},(r=f.componentsProps)==null?void 0:r.baseSelect),InputLabelProps:{shrink:!0},inputRef:l},u,(i=f.componentsProps)==null?void 0:i.baseTextField,{children:[D.jsx(g,{value:"",children:a.current.getLocaleText("filterValueAny")}),D.jsx(g,{value:"true",children:a.current.getLocaleText("filterValueTrue")}),D.jsx(g,{value:"false",children:a.current.getLocaleText("filterValueFalse")})]}))}const kwe=()=>[{value:"is",getApplyFilterFn:t=>{if(!t.value)return null;const e=t.value==="true";return({value:n})=>!!n===e},InputComponent:Owe}];function Lwe({value:t,api:e}){return t?e.getLocaleText("booleanCellTrueLabel"):e.getLocaleText("booleanCellFalseLabel")}const nW=O({},sd,{type:"boolean",align:"center",headerAlign:"center",renderCell:m1e,renderEditCell:b1e,sortComparator:Zj,valueFormatter:Lwe,filterOperators:kwe(),getApplyQuickFilterFn:void 0,aggregable:!1}),yc="__check__",wb=O({},nW,{field:yc,type:"checkboxSelection",width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,valueGetter:t=>mS(t.api.state,t.api.instanceId)[t.id]!==void 0,renderHeader:t=>D.jsx(pwe,O({},t)),renderCell:t=>D.jsx(lwe,O({},t))}),Bwe=["item","applyValue","type","apiRef","focusElementRef","InputProps"],$we=500;function zh(t){var e,n;const{item:r,applyValue:i,type:o,apiRef:s,focusElementRef:a,InputProps:l}=t,u=Be(t,Bwe),c=E.useRef(),[d,f]=E.useState((e=r.value)!=null?e:""),[h,p]=E.useState(!1),g=jn(),b=mt(),m=E.useCallback(w=>{const x=w.target.value;clearTimeout(c.current),f(String(x)),p(!0),c.current=setTimeout(()=>{i(O({},r,{value:x})),p(!1)},$we)},[i,r]);return E.useEffect(()=>()=>{clearTimeout(c.current)},[]),E.useEffect(()=>{var w;const x=(w=r.value)!=null?w:"";f(String(x))},[r.value]),D.jsx(b.components.BaseTextField,O({id:g,label:s.current.getLocaleText("filterPanelInputLabel"),placeholder:s.current.getLocaleText("filterPanelInputPlaceholder"),value:d,onChange:m,variant:"standard",type:o||"text",InputLabelProps:{shrink:!0},inputRef:a,InputProps:O({},h?{endAdornment:D.jsx(wN,{})}:{},l,{inputProps:O({max:o==="datetime-local"?"9999-12-31T23:59":"9999-12-31"},l==null?void 0:l.inputProps)})},u,(n=b.componentsProps)==null?void 0:n.baseTextField))}const zwe=/(\d+)-(\d+)-(\d+)/,Uwe=/(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;function Uh(t,e,n,r){if(!t.value)return null;const[i,o,s,a,l]=t.value.match(n?Uwe:zwe).slice(1).map(Number),u=new Date(i,o-1,s,a||0,l||0).getTime();return({value:c})=>{if(!c)return!1;const d=c instanceof Date?c:new Date(c.toString());if(r)return e(d.getTime(),u);const h=(c instanceof Date?new Date(d):d).setHours(n?d.getHours():0,n?d.getMinutes():0,0,0);return e(h,u)}}const rW=t=>[{value:"is",getApplyFilterFn:e=>Uh(e,(n,r)=>n===r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"not",getApplyFilterFn:e=>Uh(e,(n,r)=>n!==r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"after",getApplyFilterFn:e=>Uh(e,(n,r)=>n>r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:e=>Uh(e,(n,r)=>n>=r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"before",getApplyFilterFn:e=>Uh(e,(n,r)=>nUh(e,(n,r)=>n<=r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>({value:e})=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:e})=>e!=null,requiresFilterValue:!1}];function Hwe({value:t}){return t instanceof Date?t.toLocaleDateString():t??""}function Vwe({value:t}){return t instanceof Date?t.toLocaleString():t??""}const Gwe=O({},sd,{type:"date",sortComparator:Qj,valueFormatter:Hwe,filterOperators:rW(),renderEditCell:zj,getApplyQuickFilterFn:void 0}),jwe=O({},sd,{type:"dateTime",sortComparator:Qj,valueFormatter:Vwe,filterOperators:rW(!0),renderEditCell:zj,getApplyQuickFilterFn:void 0}),Cc=t=>t==null?null:Number(t),Wwe=t=>t==null||Number.isNaN(t)||t===""?null:({value:e})=>Cc(e)===Cc(t),qwe=()=>[{label:"=",value:"=",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>Cc(e)===t.value,InputComponent:Sl,InputComponentProps:{type:"number"}},{label:"!=",value:"!=",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>Cc(e)!==t.value,InputComponent:Sl,InputComponentProps:{type:"number"}},{label:">",value:">",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)>t.value,InputComponent:Sl,InputComponentProps:{type:"number"}},{label:">=",value:">=",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)>=t.value,InputComponent:Sl,InputComponentProps:{type:"number"}},{label:"<",value:"<",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)<=t.value,InputComponent:Sl,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>({value:t})=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:t})=>t!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>!Array.isArray(t.value)||t.value.length===0?null:({value:e})=>e!=null&&t.value.includes(Number(e)),InputComponent:tW,InputComponentProps:{type:"number"}}],Xwe=O({},sd,{type:"number",align:"right",headerAlign:"right",sortComparator:Zj,valueParser:t=>t===""?null:Number(t),valueFormatter:({value:t})=>Mwe(t)?t.toLocaleString():t||"",filterOperators:qwe(),getApplyQuickFilterFn:Wwe}),Kwe=["item","applyValue","type","apiRef","focusElementRef"],Ywe=({valueOptions:t,valueFormatter:e,field:n},r,i)=>(typeof t=="function"?["",...t({field:n})]:["",...t||[]]).map(s=>{const a=typeof s=="object",l=a?s.value:s,u=a?s.value:s,c=e&&s!==""?e({value:s,field:n,api:r}):s,d=a?s.label:c;return D.jsx(i,{value:u,children:d},l)});function f8(t){var e,n,r,i,o;const{item:s,applyValue:a,type:l,apiRef:u,focusElementRef:c}=t,d=Be(t,Kwe),[f,h]=E.useState((e=s.value)!=null?e:""),p=jn(),g=mt(),m=(r=(((n=g.componentsProps)==null?void 0:n.baseSelect)||{}).native)!=null?r:!0,w=s.columnField?u.current.getColumn(s.columnField):null,x=E.useMemo(()=>{if(w!==null)return typeof w.valueOptions=="function"?w.valueOptions({field:w.field}):w.valueOptions},[w]),_=E.useCallback(C=>{let S=C.target.value;S=pS(S,x),h(String(S)),a(O({},s,{value:S}))},[a,s,x]);return E.useEffect(()=>{var C;let S;if(x!==void 0){if(S=pS(s.value,x),S!==s.value){a(O({},s,{value:S}));return}}else S=s.value;S=(C=S)!=null?C:"",h(String(S))},[s,x,a]),D.jsx(g.components.BaseTextField,O({id:p,label:u.current.getLocaleText("filterPanelInputLabel"),placeholder:u.current.getLocaleText("filterPanelInputPlaceholder"),value:f,onChange:_,variant:"standard",type:l||"text",InputLabelProps:{shrink:!0},inputRef:c,select:!0,SelectProps:O({native:m},(i=g.componentsProps)==null?void 0:i.baseSelect)},d,(o=g.componentsProps)==null?void 0:o.baseTextField,{children:Ywe(u.current.getColumn(s.columnField),u.current,m?"option":wn)}))}const Zwe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],Qwe=(t,e)=>zc(t)===zc(e),Jwe=qV();function e_e(t){const{item:e,applyValue:n,apiRef:r,focusElementRef:i,color:o,error:s,helperText:a,size:l,variant:u="standard"}=t,c=Be(t,Zwe),d={color:o,error:s,helperText:a,size:l,variant:u},f=jn(),h=mt(),p=e.columnField?r.current.getColumn(e.columnField):null,g=E.useMemo(()=>p!=null&&p.valueOptions?typeof p.valueOptions=="function"?p.valueOptions({field:p.field}):p.valueOptions:[],[p]),b=E.useMemo(()=>g==null?void 0:g.map(zc),[g]),{valueFormatter:m,field:w}=r.current.getColumn(e.columnField),x=S=>typeof S=="object"?S.label:m&&S!==""?m({value:S,field:w,api:r.current}):S,_=E.useMemo(()=>Array.isArray(e.value)?g!==void 0?e.value.map(M=>{const P=zc(M);return(b==null?void 0:b.findIndex(R=>R===P))||0}).filter(M=>M>=0).map(M=>g[M]):e.value:[],[e.value,g,b]);E.useEffect(()=>{(!Array.isArray(e.value)||_.length!==e.value.length)&&n(O({},e,{value:_.map(zc)}))},[e,_,n]);const C=E.useCallback((S,M)=>{n(O({},e,{value:[...M.map(zc)]}))},[n,e]);return D.jsx(ly,O({multiple:!0,options:g,isOptionEqualToValue:Qwe,filterOptions:Jwe,id:f,value:_,onChange:C,renderTags:(S,M)=>S.map((P,A)=>D.jsx(HI,O({variant:"outlined",size:"small",label:x(P)},M({index:A})))),renderInput:S=>{var M;return D.jsx(h.components.BaseTextField,O({},S,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:O({},S.InputLabelProps,{shrink:!0}),inputRef:i,type:"singleSelect"},d,(M=h.componentsProps)==null?void 0:M.baseTextField))}},c))}const Ec=t=>t==null||typeof t!="object"?t:t.value,t_e=(t,e,n)=>{if(!t)return null;const{valueOptions:r,valueFormatter:i,field:o}=e,s=[Ec(t).toString()],a=typeof r=="function"?r({field:o}):r||[];return a&&a.forEach(l=>{let u,c;typeof l=="object"?(u=l.value,c=l.label):(u=l,i?c=i({value:l,field:o,api:n.current}):c=l),c.slice(0,t.length).toLowerCase()===t.toLowerCase()&&(s.includes(u)||s.push(u.toString()))}),({value:l})=>l!=null?s.includes(Ec(l).toString()):!1},n_e=()=>[{value:"is",getApplyFilterFn:t=>t.value==null||t.value===""?null:({value:e})=>Ec(e)===Ec(t.value),InputComponent:f8},{value:"not",getApplyFilterFn:t=>t.value==null||t.value===""?null:({value:e})=>Ec(e)!==Ec(t.value),InputComponent:f8},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const e=t.value.map(Ec);return({value:n})=>e.includes(Ec(n))},InputComponent:e_e}],r_e=O({},sd,{type:"singleSelect",renderEditCell:rxe,filterOperators:n_e(),getApplyQuickFilterFn:t_e}),gS="__default__",i_e=()=>({string:sd,number:Xwe,date:Gwe,dateTime:jwe,boolean:nW,singleSelect:r_e,[TN]:Nwe,[gS]:sd}),iW=["maxWidth","minWidth","width","flex"],oW=(t={})=>{const e=O({},i_e());return Object.entries(t).forEach(([n,r])=>{e[n]?e[n]=O({},e[n],r):e[n]=O({},e[r.extendType||gS],r)}),e};function o_e({initialFreeSpace:t,totalFlexUnits:e,flexColumns:n}){const r={all:{},frozenFields:[],freeze:o=>{const s=r.all[o];s&&s.frozen!==!0&&(r.all[o].frozen=!0,r.frozenFields.push(o))}};function i(){if(r.frozenFields.length===n.length)return;const o={min:{},max:{}};let s=t,a=e,l=0;r.frozenFields.forEach(u=>{s-=r.all[u].computedWidth,a-=r.all[u].flex});for(let u=0;uc.maxWidth&&(l+=c.maxWidth-f,f=c.maxWidth,o.max[c.field]=!0),r.all[c.field]={frozen:!1,computedWidth:f,flex:c.flex}}l<0?Object.keys(o.max).forEach(u=>{r.freeze(u)}):l>0?Object.keys(o.min).forEach(u=>{r.freeze(u)}):n.forEach(({field:u})=>{r.freeze(u)}),i()}return i(),r.all}const sW=(t,e)=>{const n={};let r=0,i=0;const o=[];t.all.forEach(a=>{const l=O({},t.lookup[a]);if(t.columnVisibilityModel[a]===!1)l.computedWidth=0;else{let u;l.flex&&l.flex>0?(r+=l.flex,u=0,o.push(l)):u=Xm(l.width,l.minWidth,l.maxWidth),i+=u,l.computedWidth=u}n[a]=l});const s=Math.max(e-i,0);if(r>0&&e>0){const a=o_e({initialFreeSpace:s,totalFlexUnits:r,flexColumns:o});Object.keys(a).forEach(l=>{n[l].computedWidth=a[l].computedWidth})}return O({},t,{lookup:n})},s_e=(t,e)=>{if(!e)return t;const{orderedFields:n=[],dimensions:r={}}=e,i=Object.keys(r);if(i.length===0&&n.length===0)return t;const o={},s=[];for(let c=0;c!o[c])],l=O({},t.lookup);for(let c=0;c{f[h]=p===-1?1/0:p}),l[d]=f}return{all:a,lookup:l}},a_e=(t,e)=>!e||!t[e]?t[gS]:t[e],gp=({apiRef:t,columnsToUpsert:e,initialState:n,columnTypes:r,currentColumnVisibilityModel:i=Tu(t),shouldRegenColumnVisibilityModelFromColumns:o,keepOnlyColumnsToUpsert:s=!1})=>{var a,l,u,c;const d=!t.current.state.columns;let f;if(d)f={all:[],lookup:{}};else{const _=$f(t.current.state);f={all:s?[]:[..._.all],lookup:O({},_.lookup)}}let h={};s&&!d&&(h=Object.keys(f.lookup).reduce((_,C)=>O({},_,{[C]:!1}),{}));const p={};e.forEach(_=>{const{field:C}=_;p[C]=!0,h[C]=!0;let S=f.lookup[C];S==null?(S=O({},a_e(r,_.type),{field:C,hasBeenResized:!1}),f.all.push(C)):s&&f.all.push(C);let M=S.hasBeenResized;iW.forEach(P=>{_[P]!==void 0&&(M=!0,_[P]===-1&&(_[P]=1/0))}),f.lookup[C]=O({},S,{hide:_.hide==null?!1:_.hide},_,{hasBeenResized:M})}),s&&!d&&Object.keys(f.lookup).forEach(_=>{h[_]||delete f.lookup[_]});const g=O({},f.lookup),b=t.current.unstable_applyPipeProcessors("hydrateColumns",f);let m={};if(o){let _=!1;const C=O({},i);d?b.all.forEach(S=>{C[S]=!f.lookup[S].hide}):s&&Object.keys(C).forEach(S=>{b.lookup[S]||(delete C[S],_=!0)}),b.all.forEach(S=>{if(!p[S]&&g[S]===b.lookup[S])return;let M=i[S];M===void 0&&(d?M=!0:M=!!$f(t.current.state).lookup[S]);const P=!b.lookup[S].hide;P!==M&&(_=!0,C[S]=P)}),_||d?m=C:m=i}else m=i;const w=s_e(b,n),x=O({},w,{columnVisibilityModel:m});return sW(x,(a=(l=(u=t.current).getRootDimensions)==null||(c=l.call(u))==null?void 0:c.viewportInnerSize.width)!=null?a:0)},h8=t=>e=>O({},e,{columns:t});function AD({firstColumnToRender:t,apiRef:e,firstRowToRender:n,lastRowToRender:r,visibleRows:i}){let o=t;for(let s=n;s{const{column:e,onClick:n}=t,r=Lt(),i=mt(),o=E.useRef(),l=lo(r).filter(c=>c.disableColumnMenu!==!0).length===1,u=E.useCallback(c=>{l||(n(c),o.current=setTimeout(()=>{r.current.setColumnVisibility(e==null?void 0:e.field,!1)},100))},[r,e==null?void 0:e.field,n,l]);return E.useEffect(()=>()=>clearTimeout(o.current),[]),i.disableColumnSelector||e.hideable===!1?null:D.jsx(wn,{onClick:u,disabled:l,children:r.current.getLocaleText("columnMenuHideColumn")})};function c_e(t){var e;const{column:n,onClick:r}=t,i=Lt(),o=gt(i,Ra),s=mt(),a=(e=n.sortingOrder)!=null?e:s.sortingOrder,l=E.useMemo(()=>{if(!n)return null;const c=o.find(d=>d.field===n.field);return c==null?void 0:c.sort},[n,o]),u=E.useCallback(c=>{r(c);const d=c.currentTarget.getAttribute("data-value")||null;i.current.sortColumn(n,d)},[i,n,r]);return!n||!n.sortable?null:D.jsxs(E.Fragment,{children:[a.includes(null)?D.jsx(wn,{onClick:u,disabled:l==null,children:i.current.getLocaleText("columnMenuUnsort")}):null,a.includes("asc")?D.jsx(wn,{onClick:u,"data-value":"asc",disabled:l==="asc",children:i.current.getLocaleText("columnMenuSortAsc")}):null,a.includes("desc")?D.jsx(wn,{onClick:u,"data-value":"desc",disabled:l==="desc",children:i.current.getLocaleText("columnMenuSortDesc")}):null]})}const d_e=E.forwardRef(function(e,n){const{hideMenu:r,currentColumn:i}=e,o=Lt(),s=[D.jsx(c_e,{onClick:r,column:i}),D.jsx(gwe,{onClick:r,column:i}),D.jsx(u_e,{onClick:r,column:i}),D.jsx(mwe,{onClick:r,column:i})],a=o.current.unstable_applyPipeProcessors("columnMenu",s,i);return D.jsx(ywe,O({ref:n},e,{children:a.map((l,u)=>E.cloneElement(l,{key:u,onClick:r,column:i}))}))}),f_e=["className"],h_e=t=>{const{classes:e}=t;return Qe({root:["panelContent"]},ln,e)},p_e=ze("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(t,e)=>e.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function aW(t){const{className:e}=t,n=Be(t,f_e),r=mt(),i=h_e(r);return D.jsx(p_e,O({className:vn(e,i.root),ownerState:r},n))}const m_e=["className"],g_e=t=>{const{classes:e}=t;return Qe({root:["panelFooter"]},ln,e)},v_e=ze("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(t,e)=>e.panelFooter})(({theme:t})=>({padding:t.spacing(.5),display:"flex",justifyContent:"space-between"}));function lW(t){const{className:e}=t,n=Be(t,m_e),r=mt(),i=g_e(r);return D.jsx(v_e,O({className:vn(e,i.root),ownerState:r},n))}const y_e=["className"],b_e=t=>{const{classes:e}=t;return Qe({root:["panelHeader"]},ln,e)},x_e=ze("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(t,e)=>e.panelHeader})(({theme:t})=>({padding:t.spacing(1)}));function w_e(t){const{className:e}=t,n=Be(t,y_e),r=mt(),i=b_e(r);return D.jsx(x_e,O({className:vn(e,i.root),ownerState:r},n))}const __e=["className","slotProps"],S_e=t=>{const{classes:e}=t;return Qe({root:["panelWrapper"]},ln,e)},C_e=ze("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(t,e)=>e.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),E_e=()=>!0,uW=E.forwardRef(function(e,n){const{className:r,slotProps:i={}}=e,o=Be(e,__e),s=mt(),a=S_e(s);return D.jsx(OV,O({open:!0,disableEnforceFocus:!0,isEnabled:E_e},i.TrapFocus,{children:D.jsx(C_e,O({ref:n,tabIndex:-1,className:vn(r,a.root),ownerState:s},o))}))}),M_e=!1,T_e=["sort","searchPredicate","autoFocusSearchField"],A_e=t=>{const{classes:e}=t;return Qe({root:["columnsPanel"],columnsPanelRow:["columnsPanelRow"]},ln,e)},P_e=ze("div",{name:"MuiDataGrid",slot:"ColumnsPanel",overridesResolver:(t,e)=>e.columnsPanel})({padding:"8px 0px 8px 8px"}),D_e=ze("div",{name:"MuiDataGrid",slot:"ColumnsPanelRow",overridesResolver:(t,e)=>e.columnsPanelRow})(({theme:t})=>({display:"flex",justifyContent:"space-between",padding:"1px 8px 1px 7px",[`& .${no.root}`]:{marginRight:t.spacing(.5)}})),R_e=ze(io)({justifyContent:"flex-end"}),p8=new Intl.Collator,I_e=(t,e)=>(t.headerName||t.field).toLowerCase().indexOf(e)>-1;function N_e(t){var e,n,r;const i=Lt(),o=E.useRef(null),s=gt(i,qa),a=gt(i,Tu),l=mt(),[u,c]=E.useState(""),d=A_e(l),{sort:f,searchPredicate:h=I_e,autoFocusSearchField:p=!0}=t,g=Be(t,T_e),b=E.useMemo(()=>{switch(f){case"asc":return[...s].sort((P,A)=>p8.compare(P.headerName||P.field,A.headerName||A.field));case"desc":return[...s].sort((P,A)=>-p8.compare(P.headerName||P.field,A.headerName||A.field));default:return s}},[s,f]),m=P=>{const{name:A}=P.target;i.current.setColumnVisibility(A,a[A]===!1)},w=E.useCallback(P=>{if(i.current.unstable_caches.columns.isUsingColumnVisibilityModel){const A=Tu(i),R=O({},A);return s.forEach(F=>{F.hideable&&(P?delete R[F.field]:R[F.field]=!1)}),i.current.setColumnVisibilityModel(R)}return i.current.updateColumns(s.map(A=>A.hideable!==!1?{field:A.field,hide:!P}:A))},[i,s]),x=E.useCallback(P=>{c(P.target.value)},[]),_=E.useMemo(()=>{if(!u)return b;const P=u.toLowerCase();return b.filter(A=>h(A,P))},[b,u,h]),C=E.useRef(null);E.useEffect(()=>{p?o.current.focus():C.current&&typeof C.current.focus=="function"&&C.current.focus()},[p]);let S=!1;const M=P=>S===!1&&P.hideable!==!1?(S=!0,!0):!1;return D.jsxs(uW,O({},g,{children:[D.jsx(w_e,{children:D.jsx(l.components.BaseTextField,O({label:i.current.getLocaleText("columnsPanelTextFieldLabel"),placeholder:i.current.getLocaleText("columnsPanelTextFieldPlaceholder"),inputRef:o,value:u,onChange:x,variant:"standard",fullWidth:!0},(e=l.componentsProps)==null?void 0:e.baseTextField))}),D.jsx(aW,{children:D.jsx(P_e,{className:d.root,ownerState:l,children:_.map(P=>{var A;return D.jsxs(D_e,{className:d.columnsPanelRow,ownerState:l,children:[D.jsx(Bo,{control:D.jsx(l.components.BaseSwitch,O({disabled:P.hideable===!1,checked:a[P.field]!==!1,onClick:m,name:P.field,size:"small",inputRef:M(P)?C:void 0},(A=l.componentsProps)==null?void 0:A.baseSwitch)),label:P.headerName||P.field}),!l.disableColumnReorder&&M_e&&D.jsx(R_e,{draggable:!0,"aria-label":i.current.getLocaleText("columnsPanelDragIconLabel"),title:i.current.getLocaleText("columnsPanelDragIconLabel"),size:"small",disabled:!0,children:D.jsx(Hj,{})})]},P.field)})})}),D.jsxs(lW,{children:[D.jsx(l.components.BaseButton,O({onClick:()=>w(!1)},(n=l.componentsProps)==null?void 0:n.baseButton,{children:i.current.getLocaleText("columnsPanelHideAllButton")})),D.jsx(l.components.BaseButton,O({onClick:()=>w(!0)},(r=l.componentsProps)==null?void 0:r.baseButton,{children:i.current.getLocaleText("columnsPanelShowAllButton")}))]})]}))}const F_e=["children","className","classes"],O_e=At("MuiDataGrid",["panel","paper"]),k_e=ze(Yf,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(t,e)=>e.panel})(({theme:t})=>({zIndex:t.zIndex.modal})),L_e=ze(Xu,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>({backgroundColor:t.palette.background.paper,minWidth:300,maxHeight:450,display:"flex"})),B_e=E.forwardRef((t,e)=>{var n;const{children:r,className:i}=t,o=Be(t,F_e),s=Lt(),a=mt(),l=O_e,[u,c]=E.useState(!1),d=E.useCallback(()=>{s.current.hidePreferences()},[s]),f=E.useCallback(g=>{_N(g.key)&&s.current.hidePreferences()},[s]),h=E.useMemo(()=>[{name:"flip",enabled:!1},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{c(!0)},effect:()=>()=>{c(!1)}}],[]),p=(n=s.current.columnHeadersContainerElementRef)==null?void 0:n.current;return p?D.jsx(k_e,O({ref:e,placement:"bottom-start",className:vn(i,l.panel),ownerState:a,anchorEl:p,modifiers:h},o,{children:D.jsx(FV,{mouseEvent:"onMouseUp",onClickAway:d,children:D.jsx(L_e,{className:l.paper,ownerState:a,elevation:8,onKeyDown:f,children:u&&r})})})):null}),$_e=E.forwardRef(function(e,n){var r,i,o;const s=Lt(),a=gt(s,qa),l=mt(),u=gt(s,qm),c=s.current.unstable_applyPipeProcessors("preferencePanel",null,(r=u.openedPanelValue)!=null?r:Za.filters);return D.jsx(l.components.Panel,O({ref:n,as:l.components.BasePopper,open:a.length>0&&u.open},(i=l.componentsProps)==null?void 0:i.panel,e,(o=l.componentsProps)==null?void 0:o.basePopper,{children:c}))}),z_e=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","multiFilterOperator","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","linkOperators","columnsSort","deleteIconProps","linkOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","children"],U_e=["InputComponentProps"],H_e=t=>{const{classes:e}=t;return Qe({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],linkOperatorInput:["filterFormLinkOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},ln,e)},V_e=ze("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(t,e)=>e.filterForm})(({theme:t})=>({display:"flex",padding:t.spacing(1)})),G_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(t,e)=>e.filterFormDeleteIcon})(({theme:t})=>({flexShrink:0,justifyContent:"flex-end",marginRight:t.spacing(.5),marginBottom:t.spacing(.2)})),j_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormLinkOperatorInput",overridesResolver:(t,e)=>e.filterFormLinkOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),W_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(t,e)=>e.filterFormColumnInput})({width:150}),q_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(t,e)=>e.filterFormOperatorInput})({width:120}),X_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(t,e)=>e.filterFormValueInput})({width:190}),K_e=t=>{switch(t){case So.And:return"filterPanelOperatorAnd";case So.Or:return"filterPanelOperatorOr";default:throw new Error("MUI: Invalid `linkOperator` property in the `GridFilterPanel`.")}},g0=t=>t.headerName||t.field,m8=new Intl.Collator,Y_e=E.forwardRef(function(e,n){var r,i,o,s,a,l,u;const{item:c,hasMultipleFilters:d,deleteFilter:f,applyFilterChanges:h,multiFilterOperator:p,showMultiFilterOperators:g,disableMultiFilterOperator:b,applyMultiFilterOperatorChanges:m,focusElementRef:w,linkOperators:x=[So.And,So.Or],columnsSort:_,deleteIconProps:C={},linkOperatorInputProps:S={},operatorInputProps:M={},columnInputProps:P={},valueInputProps:A={}}=e,R=Be(e,z_e),F=Lt(),$=gt(F,bN),j=jn(),k=jn(),U=jn(),G=jn(),B=mt(),L=H_e(B),N=E.useRef(null),W=E.useRef(null),K=d&&x.length>0,Q=((r=B.componentsProps)==null?void 0:r.baseFormControl)||{},ae=(o=(((i=B.componentsProps)==null?void 0:i.baseSelect)||{}).native)!=null?o:!0,ve=ae?"option":wn,{InputComponentProps:fe}=A,Me=Be(A,U_e),ye=E.useMemo(()=>{switch(_){case"asc":return $.sort((X,Z)=>m8.compare(g0(X),g0(Z)));case"desc":return $.sort((X,Z)=>-m8.compare(g0(X),g0(Z)));default:return $}},[$,_]),we=c.columnField?F.current.getColumn(c.columnField):null,Fe=E.useMemo(()=>{var X;return!c.operatorValue||!we?null:(X=we.filterOperators)==null?void 0:X.find(Z=>Z.value===c.operatorValue)},[c,we]),Oe=E.useCallback(X=>{const Z=X.target.value,he=F.current.getColumn(Z);if(he.field===we.field)return;const Y=he.filterOperators.find(se=>se.value===c.operatorValue)||he.filterOperators[0],ne=!Y.InputComponent||Y.InputComponent!==(Fe==null?void 0:Fe.InputComponent);h(O({},c,{columnField:Z,operatorValue:Y.value,value:ne?void 0:c.value}))},[F,h,c,we,Fe]),re=E.useCallback(X=>{const Z=X.target.value,he=we==null?void 0:we.filterOperators.find(ne=>ne.value===Z),Y=!(he!=null&&he.InputComponent)||(he==null?void 0:he.InputComponent)!==(Fe==null?void 0:Fe.InputComponent);h(O({},c,{operatorValue:Z,value:Y?void 0:c.value}))},[h,c,we,Fe]),_e=E.useCallback(X=>{const Z=X.target.value===So.And.toString()?So.And:So.Or;m(Z)},[m]),Ce=()=>{B.disableMultipleColumnsFiltering?c.value===void 0?f(c):h(O({},c,{value:void 0})):f(c)};return E.useImperativeHandle(w,()=>({focus:()=>{if(Fe!=null&&Fe.InputComponent){var X;N==null||(X=N.current)==null||X.focus()}else W.current.focus()}}),[Fe]),D.jsxs(V_e,O({ref:n,className:L.root,ownerState:B},R,{children:[D.jsx(G_e,O({variant:"standard",as:B.components.BaseFormControl},Q,C,{className:vn(L.deleteIcon,Q.className,C.className),ownerState:B,children:D.jsx(io,{"aria-label":F.current.getLocaleText("filterPanelDeleteIconLabel"),title:F.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:Ce,size:"small",children:D.jsx(B.components.FilterPanelDeleteIcon,{fontSize:"small"})})})),D.jsx(j_e,O({variant:"standard",as:B.components.BaseFormControl},Q,S,{sx:O({display:K?"flex":"none",visibility:g?"visible":"hidden"},Q.sx||{},S.sx||{}),className:vn(L.linkOperatorInput,Q.className,S.className),ownerState:B,children:D.jsx(B.components.BaseSelect,O({inputProps:{"aria-label":F.current.getLocaleText("filterPanelLinkOperator")},value:p,onChange:_e,disabled:!!b||x.length===1,native:ae},(s=B.componentsProps)==null?void 0:s.baseSelect,{children:x.map(X=>D.jsx(ve,{value:X.toString(),children:F.current.getLocaleText(K_e(X))},X.toString()))}))})),D.jsxs(W_e,O({variant:"standard",as:B.components.BaseFormControl},Q,P,{className:vn(L.columnInput,Q.className,P.className),ownerState:B,children:[D.jsx(da,{htmlFor:j,id:k,children:F.current.getLocaleText("filterPanelColumns")}),D.jsx(B.components.BaseSelect,O({labelId:k,id:j,label:F.current.getLocaleText("filterPanelColumns"),value:c.columnField||"",onChange:Oe,native:ae},(a=B.componentsProps)==null?void 0:a.baseSelect,{children:ye.map(X=>D.jsx(ve,{value:X.field,children:g0(X)},X.field))}))]})),D.jsxs(q_e,O({variant:"standard",as:B.components.BaseFormControl},Q,M,{className:vn(L.operatorInput,Q.className,M.className),ownerState:B,children:[D.jsx(da,{htmlFor:U,id:G,children:F.current.getLocaleText("filterPanelOperators")}),D.jsx(B.components.BaseSelect,O({labelId:G,label:F.current.getLocaleText("filterPanelOperators"),id:U,value:c.operatorValue,onChange:re,native:ae,inputRef:W},(l=B.componentsProps)==null?void 0:l.baseSelect,{children:we==null||(u=we.filterOperators)==null?void 0:u.map(X=>D.jsx(ve,{value:X.value,children:X.label||F.current.getLocaleText(`filterOperator${Ge(X.value)}`)},X.value))}))]})),D.jsx(X_e,O({variant:"standard",as:B.components.BaseFormControl},Q,Me,{className:vn(L.valueInput,Q.className,Me.className),ownerState:B,children:Fe!=null&&Fe.InputComponent?D.jsx(Fe.InputComponent,O({apiRef:F,item:c,applyValue:h,focusElementRef:N},Fe.InputComponentProps,fe)):null}))]}))}),Z_e=["linkOperators","columnsSort","filterFormProps","children"],Q_e=E.forwardRef(function(e,n){var r;const i=Lt(),o=mt(),s=gt(i,Lo),a=gt(i,bN),l=E.useRef(null),{linkOperators:u=[So.And,So.Or],columnsSort:c,filterFormProps:d}=e,f=Be(e,Z_e),h=E.useCallback(_=>{i.current.upsertFilterItem(_)},[i]),p=E.useCallback(_=>{i.current.setFilterLinkOperator(_)},[i]),g=E.useCallback(()=>{const _=a.find(C=>{var S;return(S=C.filterOperators)==null?void 0:S.length});return _?{columnField:_.field,operatorValue:_.filterOperators[0].value,id:Math.round(Math.random()*1e5)}:null},[a]),b=E.useMemo(()=>{if(s.items.length)return s.items;const _=g();return _?[_]:[]},[s.items,g]),m=b.length>1,w=()=>{const _=g();_&&i.current.upsertFilterItems([...b,_])},x=E.useCallback(_=>{const C=b.length===1;i.current.deleteFilterItem(_),C&&i.current.hideFilterPanel()},[i,b.length]);return E.useEffect(()=>{u.length>0&&s.linkOperator&&!u.includes(s.linkOperator)&&p(u[0])},[u,p,s.linkOperator]),E.useEffect(()=>{b.length>0&&l.current.focus()},[b.length]),D.jsxs(uW,O({ref:n},f,{children:[D.jsx(aW,{children:b.map((_,C)=>D.jsx(Y_e,O({item:_,applyFilterChanges:h,deleteFilter:x,hasMultipleFilters:m,showMultiFilterOperators:C>0,multiFilterOperator:s.linkOperator,disableMultiFilterOperator:C!==1,applyMultiFilterOperatorChanges:p,focusElementRef:C===b.length-1?l:null,linkOperators:u,columnsSort:c},d),_.id==null?C:_.id))}),!o.disableMultipleColumnsFiltering&&D.jsx(lW,{children:D.jsx(o.components.BaseButton,O({onClick:w,startIcon:D.jsx(Uj,{})},(r=o.componentsProps)==null?void 0:r.baseButton,{children:i.current.getLocaleText("filterPanelAddFilter")}))})]}))}),J_e=["onClick"],eSe=E.forwardRef(function(e,n){var r;const{onClick:i}=e,o=Be(e,J_e),s=Lt(),a=mt(),{open:l,openedPanelValue:u}=gt(s,qm),c=d=>{l&&u===Za.columns?s.current.hidePreferences():s.current.showPreferences(Za.columns),i==null||i(d)};return a.disableColumnSelector?null:D.jsx(a.components.BaseButton,O({ref:n,size:"small","aria-label":s.current.getLocaleText("toolbarColumnsLabel"),startIcon:D.jsx(a.components.ColumnSelectorIcon,{})},o,{onClick:c},(r=a.componentsProps)==null?void 0:r.baseButton,{children:s.current.getLocaleText("toolbarColumns")}))}),tSe=["onClick"],nSe=E.forwardRef(function(e,n){var r;const{onClick:i}=e,o=Be(e,tSe),s=Lt(),a=mt(),l=gt(s,Nj),u=jn(),c=jn(),[d,f]=E.useState(!1),h=E.useRef(null),p=An(n,h),g=[{icon:D.jsx(a.components.DensityCompactIcon,{}),label:s.current.getLocaleText("toolbarDensityCompact"),value:El.Compact},{icon:D.jsx(a.components.DensityStandardIcon,{}),label:s.current.getLocaleText("toolbarDensityStandard"),value:El.Standard},{icon:D.jsx(a.components.DensityComfortableIcon,{}),label:s.current.getLocaleText("toolbarDensityComfortable"),value:El.Comfortable}],b=E.useMemo(()=>{switch(l){case El.Compact:return D.jsx(a.components.DensityCompactIcon,{});case El.Comfortable:return D.jsx(a.components.DensityComfortableIcon,{});default:return D.jsx(a.components.DensityStandardIcon,{})}},[l,a]),m=S=>{f(M=>!M),i==null||i(S)},w=S=>{var M;h.current===S.target||(M=h.current)!=null&&M.contains(S.target)||f(!1)},x=S=>{s.current.setDensity(S),f(!1)},_=S=>{xE(S.key)&&S.preventDefault(),SN(S.key)&&f(!1)};if(a.disableDensitySelector)return null;const C=g.map((S,M)=>D.jsxs(wn,{onClick:()=>x(S.value),selected:S.value===l,children:[D.jsx(Ude,{children:S.icon}),S.label]},M));return D.jsxs(E.Fragment,{children:[D.jsx(a.components.BaseButton,O({ref:p,size:"small",startIcon:b,"aria-label":s.current.getLocaleText("toolbarDensityLabel"),"aria-expanded":d?"true":void 0,"aria-haspopup":"menu","aria-controls":c,id:u},o,{onClick:m},(r=a.componentsProps)==null?void 0:r.baseButton,{children:s.current.getLocaleText("toolbarDensity")})),D.jsx(_E,{open:d,target:h.current,onClickAway:w,position:"bottom-start",children:D.jsx(ub,{id:c,className:Ie.menuList,"aria-labelledby":u,onKeyDown:_,autoFocusItem:d,children:C})})]})}),rSe=["componentsProps"],iSe=t=>{const{classes:e}=t;return Qe({root:["toolbarFilterList"]},ln,e)},oSe=ze("ul",{name:"MuiDataGrid",slot:"ToolbarFilterList",overridesResolver:(t,e)=>e.toolbarFilterList})(({theme:t})=>({margin:t.spacing(1,1,.5),padding:t.spacing(0,1)})),sSe=E.forwardRef(function(e,n){var r,i;const{componentsProps:o={}}=e,s=Be(e,rSe),a=o.button||{},l=Lt(),u=mt(),c=gt(l,Ij),d=gt(l,th),f=gt(l,qm),h=iSe(u),p=E.useMemo(()=>{if(f.open)return l.current.getLocaleText("toolbarFiltersTooltipHide");if(c.length===0)return l.current.getLocaleText("toolbarFiltersTooltipShow");const b=w=>d[w.columnField].filterOperators.find(x=>x.value===w.operatorValue).label||l.current.getLocaleText(`filterOperator${Ge(w.operatorValue)}`).toString(),m=w=>{const{getValueAsString:x}=d[w.columnField].filterOperators.find(_=>_.value===w.operatorValue);return x?x(w.value):w.value};return D.jsxs("div",{children:[l.current.getLocaleText("toolbarFiltersTooltipActive")(c.length),D.jsx(oSe,{className:h.root,ownerState:u,children:c.map((w,x)=>O({},d[w.columnField]&&D.jsx("li",{children:`${d[w.columnField].headerName||w.columnField} + */var mE=E,ebe=Jye;function tbe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var nbe=typeof Object.is=="function"?Object.is:tbe,rbe=ebe.useSyncExternalStore,ibe=mE.useRef,obe=mE.useEffect,sbe=mE.useMemo,abe=mE.useDebugValue;yj.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=ibe(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=sbe(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&s.hasValue){var p=s.value;if(i(p,h))return d=p}return d=h}if(p=d,nbe(c,h))return p;var g=r(h);return i!==void 0&&i(p,g)?p:(c=h,d=g)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,i]);var a=rbe(t,o[0],o[1]);return obe(function(){s.hasValue=!0,s.value=a},[a]),abe(a),a};vj.exports=yj;var lbe=vj.exports;const ube=va(lbe);var wj={BASE_URL:"https://diamondlightsource.github.io/dedi-web/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:cbe}=ie,{useSyncExternalStoreWithSelector:dbe}=ube;let i8=!1;const fbe=t=>t;function hbe(t,e=fbe,n){(wj?"production":void 0)!=="production"&&n&&!i8&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),i8=!0);const r=dbe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return cbe(r),r}const o8=t=>{(wj?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?Vye(t):t,n=(r,i)=>hbe(e,r,i);return Object.assign(n,e),n},eh=t=>t?o8(t):o8,pbe={resolution:{width:2527,height:2463},pixelSize:{width:.172,height:.172}},mbe={resolution:{width:619,height:487},pixelSize:{width:.172,height:.172}},gbe={"Pilatus P3-2M":{resolution:{width:1475,height:1679},pixelSize:{width:.172,height:.172}},"Pilatus P3-2M-DLS (for WAXS)":{resolution:{width:1475,height:1679},pixelSize:{width:.172,height:.172}},Pilatus6m:pbe,Pilatus100k:mbe,"Pilatus300k-W":{resolution:{width:195,height:1495},pixelSize:{width:.172,height:.172}},"Eiger 500k":{resolution:{width:1030,height:514},pixelSize:{width:.075,height:.075}},"Eiger 1M":{resolution:{width:1030,height:1065},pixelSize:{width:.075,height:.075}},"Eiger 4M":{resolution:{width:2070,height:2167},pixelSize:{width:.075,height:.075}},"Eiger 9M":{resolution:{width:3110,height:3269},pixelSize:{width:.075,height:.075}},"Eiger 16M":{resolution:{width:4150,height:4371},pixelSize:{width:.075,height:.075}}},vbe={"I22 SAXS Isotropic":{detector:"Pilatus P3-2M",beamline:"I22",beamstop:{centre:{x:738,y:100},clearance:10},cameraTube:{centre:{x:738,y:840}}},"I22 SAXS Anisotropic":{detector:"Pilatus P3-2M",beamline:"I22",beamstop:{centre:{x:738,y:840},clearance:10},cameraTube:{centre:{x:738,y:840}}}},ybe={beamstopDiameter:4,cameratubeDiameter:310,minWavelength:.062,maxWavelength:.335,minCameraLength:1.9,maxCameraLength:9.9,cameraLengthStep:.25},bbe={beamstopDiameter:10,cameratubeDiameter:345,minWavelength:.05,maxWavelength:.05,minCameraLength:0,maxCameraLength:10,cameraLengthStep:1},xbe={I22:ybe,test:bbe};function _j(t){return{...t,pixelSize:{height:Rt(t.pixelSize.height,"mm"),width:Rt(t.pixelSize.height,"mm")}}}const s8=Object.fromEntries(Object.entries(gbe).map(([t,e])=>[t,_j(e)]));function Sj(t){return{cameratubeDiameter:t.cameratubeDiameter,beamstopDiameter:t.beamstopDiameter,minWavelength:Rt(t.minWavelength,"nm").to("nm"),maxWavelength:Rt(t.maxWavelength,"nm").to("nm"),minCameraLength:Rt(t.minCameraLength,"m"),maxCameraLength:Rt(t.maxCameraLength,"m"),cameraLengthStep:Rt(t.cameraLengthStep,"m")}}const vv=Object.fromEntries(Object.entries(xbe).map(([t,e])=>[t,Sj(e)]));function wbe(t){return{...t,beamstop:{...t.beamstop,diameter:Rt(vv[t.beamline].beamstopDiameter,"mm")},cameraTube:{...t.cameraTube,diameter:Rt(vv[t.beamline].cameratubeDiameter,"mm")},wavelength:Rt(NaN,"nm"),angle:Rt(90,"deg"),cameraLength:vv[t.beamline].minCameraLength.toNumber("m")}}const yv=Object.fromEntries(Object.entries(vbe).map(([t,e])=>[t,wbe(e)])),ps=yv[Object.keys(yv)[0]],gE=eh(t=>({beamstop:ps.beamstop,updateCentre:e=>t(n=>({beamstop:{...n.beamstop,centre:{...n.beamstop.centre,...e}}})),updateDiameter:(e,n)=>t(r=>({beamstop:{...r.beamstop,diameter:Rt(e,n)}})),updateDiameterUnits:e=>t(n=>({beamstop:{...n.beamstop,diameter:n.beamstop.diameter.to(e)}})),updateClearance:e=>t(n=>({beamstop:{...n.beamstop,clearance:e}})),updateBeamstop:e=>t({beamstop:e})})),mg=eh(t=>({name:ps.detector,detector:s8[ps.detector],detectorRecord:s8,updateDetector:e=>t(n=>({detector:n.detectorRecord[e],name:e})),updatePixelUnits:e=>t(n=>({detector:{...n.detector,pixelSize:{height:n.detector.pixelSize.height.to(e),width:n.detector.pixelSize.width.to(e)}}})),addNewDetector:(e,n)=>{t(r=>({detectorRecord:{...r.detectorRecord,[e]:n}}))}}));function _be(){const t=gE(),e=a=>{t.updateCentre({x:parseFloat(a.target.value)})},n=a=>{t.updateCentre({y:parseFloat(a.target.value)})},r=a=>{t.updateClearance(parseFloat(a.target.value))},i=mg(a=>a.detector),o=()=>{t.updateCentre({x:i.resolution.width/2,y:i.resolution.height/2})},s=()=>{t.updateCentre({x:i.resolution.width/2,y:0})};return D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" Beamstop "}),D.jsx($l,{}),D.jsxs(cn,{direction:"row",alignItems:"center",children:[D.jsxs(xn,{flexGrow:1,children:[" ","Diameter: ",t.beamstop.diameter.toNumber().toFixed(2)," "]}),D.jsxs(Ai,{children:[D.jsx(ca,{children:"units "}),D.jsxs(Ps,{size:"small",label:"units",value:t.beamstop.diameter.formatUnits(),onChange:a=>t.updateDiameterUnits(a.target.value),children:[D.jsx(wn,{value:bs.millimetre,children:"mm"}),D.jsx(wn,{value:bs.micrometre,children:"μm"})]})]})]}),D.jsx(xn,{children:"Position:"}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"x",value:t.beamstop.centre.x,onChange:e,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx(Bf,{size:"small",variant:"outlined",onClick:o,children:"Centre detector"})]}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"y",value:t.beamstop.centre.y,onChange:n,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx(Bf,{size:"small",variant:"outlined",onClick:s,children:"Centre top edge"})]}),D.jsx(cn,{direction:"row",children:D.jsx($n,{type:"number",size:"small",label:"clearance",value:t.beamstop.clearance,onChange:r,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}})})]})}const vE=eh(t=>({cameraTube:ps.cameraTube,updateCentre:e=>t(n=>({cameraTube:{...n.cameraTube,centre:{...n.cameraTube.centre,...e}}})),updateDiameterUnits:e=>t(n=>({cameraTube:{...n.cameraTube,diameter:n.cameraTube.diameter.to(e)}})),updateCameraTube:e=>t({cameraTube:e}),updateDiameter:(e,n)=>t(r=>({cameraTube:{...r.cameraTube,diameter:Rt(e,n)}}))}));function Sbe(){const t=vE(),e=r=>{t.updateCentre({x:parseFloat(r.target.value)})},n=r=>{t.updateCentre({y:parseFloat(r.target.value)})};return D.jsxs(Y4,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" CameraTube "}),D.jsx($l,{}),D.jsxs(Y4,{direction:"row",alignItems:"center",children:[D.jsxs(xn,{flexGrow:1,children:[" ","Diameter: ",t.cameraTube.diameter.toNumber()," "]}),D.jsxs(Ai,{children:[D.jsx(ca,{children:"units "}),D.jsxs(Ps,{size:"small",label:"units",value:t.cameraTube.diameter.formatUnits(),onChange:r=>t.updateDiameterUnits(r.target.value),children:[D.jsx(wn,{value:bs.millimetre,children:"mm"}),D.jsx(wn,{value:bs.micrometre,children:"μm"})]})]})]}),D.jsx(xn,{children:"Position:"}),D.jsx($n,{type:"number",size:"small",label:"x",value:t.cameraTube.centre.x,onChange:e,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx($n,{type:"number",size:"small",label:"y",value:t.cameraTube.centre.y,onChange:n,InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}})]})}const gg=eh(t=>({beamline:vv[ps.beamline],beamlineName:ps.beamline,beamlineRecord:vv,energy:CD(ps.wavelength).to("keV"),userEnergy:CD(ps.wavelength).to("keV").toNumber(),wavelength:ps.wavelength,userWavelength:ps.wavelength.toNumber(),angle:ps.angle,userAngle:ps.angle.toNumber(),cameraLength:ps.cameraLength,updateBeamline:e=>t(n=>({beamline:n.beamlineRecord[e],beamlineName:e})),addNewBeamline:(e,n)=>{t(r=>({beamlineRecord:{...r.beamlineRecord,[e]:n}}))},updateAngle:(e,n)=>t({angle:Rt(e??NaN,n),userAngle:e}),updateAngleUnits:e=>t(n=>({angle:n.angle.to(e),userAngle:n.angle.to(e).toNumber()})),updateCameraLength:e=>t({cameraLength:e}),updateWavelength:(e,n)=>t(r=>({wavelength:Rt(e??NaN,n),userWavelength:e,beamline:{...r.beamline,minWavelength:r.beamline.minWavelength.to(n),maxWavelength:r.beamline.maxWavelength.to(n)}})),updateWavelengthUnits:e=>t(n=>({wavelength:n.wavelength.to(e),userWavelength:n.wavelength.to(e).toNumber(),beamline:{...n.beamline,minWavelength:n.beamline.minWavelength.to(e),maxWavelength:n.beamline.maxWavelength.to(e)}})),updateEnergy:(e,n)=>t({energy:Rt(e??NaN,n),userEnergy:e}),updateEnergyUnits:e=>t(n=>({energy:n.energy.to(e),userEnergy:n.energy.to(e).toNumber()})),update:e=>t({...e})}));function Cbe(){const t=gg(),e=l=>{t.updateAngleUnits(l.target.value)},n=l=>{t.updateAngle(Qp(l.target.value),t.angle.formatUnits())},r=l=>{const u=Qp(l.target.value);t.updateWavelength(u,t.wavelength.formatUnits());const c=CD(Rt(u??NaN,t.wavelength.formatUnits()));t.updateEnergy(c.to(t.energy.formatUnits()).toNumber(),t.energy.formatUnits())},i=l=>{t.updateWavelengthUnits(l.target.value)},o=l=>{const u=Qp(l.target.value);t.updateEnergy(u,t.energy.formatUnits());const c=Uye(Rt(u??NaN,t.energy.formatUnits()));t.updateWavelength(c.to(t.wavelength.formatUnits()).toNumber(),t.wavelength.formatUnits())},s=l=>{t.updateEnergyUnits(l.target.value)},a=l=>{t.updateCameraLength(Qp(l.target.value))};return D.jsxs(cn,{spacing:2,children:[D.jsx(xn,{variant:"h6",children:"Beam properties"}),D.jsx($l,{}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"energy",value:t.userEnergy,onChange:o}),D.jsxs(Ai,{children:[D.jsx(ca,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.energy.formatUnits(),onChange:s,children:[D.jsx(wn,{value:W0.electronVolts,children:W0.electronVolts}),D.jsx(wn,{value:W0.kiloElectronVolts,children:W0.kiloElectronVolts})]})]})]}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"wavelength",value:t.userWavelength,onChange:r}),D.jsxs(Ai,{children:[D.jsx(ca,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.wavelength.formatUnits(),onChange:i,children:[D.jsx(wn,{value:ia.nanometres,children:ia.nanometres}),D.jsx(wn,{value:ia.angstroms,children:"Å"})]})]})]}),D.jsxs(xn,{children:["Minimum allowed wavelength:"," "+t.beamline.minWavelength.toString()]}),D.jsxs(xn,{children:["Maximum allowed wavelength:"," "+t.beamline.maxWavelength.toString()]}),D.jsx(cn,{direction:"row",spacing:1,children:D.jsx($n,{type:"number",size:"small",label:"camera length",value:t.cameraLength??"",InputProps:{inputProps:{max:t.beamline.maxCameraLength.toNumber(),min:t.beamline.minCameraLength.toNumber(),step:t.beamline.cameraLengthStep.toNumber()},endAdornment:D.jsx(si,{position:"end",children:"m"})},onChange:a})}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx($n,{type:"number",size:"small",label:"angle",defaultValue:"",value:t.userAngle??"",onChange:n}),D.jsxs(Ai,{children:[D.jsx(ca,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.angle.formatUnits(),onChange:e,children:[D.jsx(wn,{value:q0.radians,children:q0.radians}),D.jsx(wn,{value:q0.degrees,children:q0.degrees})]})]})]})]})}const Cj=E.createContext(void 0);function Lt(){const t=E.useContext(Cj);if(t===void 0)throw new Error(["MUI: Could not find the data grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the data grid."].join(` +`));return t}const Ej=E.createContext(void 0),mt=()=>{const t=E.useContext(Ej);if(!t)throw new Error("MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return t};function ln(t){return It("MuiDataGrid",t)}const Ie=At("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","autoHeight","booleanCell","cell--editable","cell--editing","cell--textCenter","cell--textLeft","cell--textRight","cell--withRenderer","cell","cellContent","cellCheckbox","cellSkeleton","checkboxInput","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderDropZone","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnGroupHeader","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeader--showColumnBorder","columnHeaders","columnHeadersInner","columnHeadersInner--scrollable","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsPanel","columnsPanelRow","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filterForm","filterFormDeleteIcon","filterFormLinkOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","iconButtonContainer","iconSeparator","main","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","root","root--densityStandard","root--densityComfortable","root--densityCompact","row","row--editable","row--editing","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","scrollArea--left","scrollArea--right","scrollArea","selectedRowCount","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","pinnedColumns--left","pinnedColumns--right","pinnedColumnHeaders","pinnedColumnHeaders--left","pinnedColumnHeaders--right","withBorder","treeDataGroupingCell","treeDataGroupingCellToggle","groupingCriteriaCell","groupingCriteriaCellToggle","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"]),Ebe=t=>{const{classes:e}=t;return Qe({root:["main"]},ln,e)},Mbe=ze("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(t,e)=>e.main})(()=>({position:"relative",flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden"}));function Mj(t){const e=mt(),n=Ebe(e);return D.jsx(Mbe,{className:n.root,ownerState:e,children:t.children})}function Tbe(t,e){var n=function(_){var C=_.__resizeTriggers__,S=C.firstElementChild,M=C.lastElementChild,P=S.firstElementChild;M.scrollLeft=M.scrollWidth,M.scrollTop=M.scrollHeight,P.style.width=S.offsetWidth+1+"px",P.style.height=S.offsetHeight+1+"px",S.scrollLeft=S.scrollWidth,S.scrollTop=S.scrollHeight},r=function(_){return _.offsetWidth!=_.__resizeLast__.width||_.offsetHeight!=_.__resizeLast__.height},i=function(_){if(!(_.target.className.indexOf("contract-trigger")<0&&_.target.className.indexOf("expand-trigger")<0)){var C=this;n(this),this.__resizeRAF__&&e.cancelAnimationFrame(this.__resizeRAF__),this.__resizeRAF__=e.requestAnimationFrame(function(){r(C)&&(C.__resizeLast__.width=C.offsetWidth,C.__resizeLast__.height=C.offsetHeight,C.__resizeListeners__.forEach(function(S){S.call(C,_)}))})}},o=!1,s="",a="animationstart",l="Webkit Moz O ms".split(" "),u="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),c="";{var d=document.createElement("fakeelement");if(d.style.animationName!==void 0&&(o=!0),o===!1){for(var f=0;f div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .Mui-resizeTriggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',M=C.constructor.name==="ShadowRoot"?C:_.head||_.getElementsByTagName("head")[0],P=_.createElement("style");P.id="muiDetectElementResize",P.type="text/css",t!=null&&P.setAttribute("nonce",t),P.styleSheet?P.styleSheet.cssText=S:P.appendChild(_.createTextNode(S)),M.appendChild(P)}},m=function(_,C){if(!_.__resizeTriggers__){var S=_.ownerDocument,M=e.getComputedStyle(_);M&&M.position=="static"&&(_.style.position="relative"),b(S,_.getRootNode()),_.__resizeLast__={},_.__resizeListeners__=[],(_.__resizeTriggers__=S.createElement("div")).className="Mui-resizeTriggers",_.__resizeTriggers__.innerHTML='
',_.appendChild(_.__resizeTriggers__),n(_),_.addEventListener("scroll",i,!0),a&&(_.__resizeTriggers__.__animationListener__=function(A){A.animationName==h&&n(_)},_.__resizeTriggers__.addEventListener(a,_.__resizeTriggers__.__animationListener__))}_.__resizeListeners__.push(C)},w=function(_,C){if(_.__resizeListeners__.splice(_.__resizeListeners__.indexOf(C),1),!_.__resizeListeners__.length){_.removeEventListener("scroll",i,!0),_.__resizeTriggers__.__animationListener__&&(_.__resizeTriggers__.removeEventListener(a,_.__resizeTriggers__.__animationListener__),_.__resizeTriggers__.__animationListener__=null);try{_.__resizeTriggers__=!_.removeChild(_.__resizeTriggers__)}catch{}}};return{addResizeListener:m,removeResizeListener:w}}const Abe=["children","defaultHeight","defaultWidth","disableHeight","disableWidth","nonce","onResize","style"],Pbe=E.forwardRef(function(e,n){const{children:r,defaultHeight:i=null,defaultWidth:o=null,disableHeight:s=!1,disableWidth:a=!1,nonce:l,onResize:u,style:c}=e,d=Be(e,Abe),[f,h]=E.useState({height:i,width:o}),p=E.useRef(null),g=E.useRef(null),b=ar(()=>{if(g.current){const _=g.current.offsetHeight||0,C=g.current.offsetWidth||0,M=Ll(g.current).getComputedStyle(g.current),P=parseInt(M.paddingLeft,10)||0,A=parseInt(M.paddingRight,10)||0,R=parseInt(M.paddingTop,10)||0,F=parseInt(M.paddingBottom,10)||0,$=_-R-F,j=C-P-A;(!s&&f.height!==$||!a&&f.width!==j)&&(h({height:$,width:j}),u&&u({height:$,width:j}))}});_r(()=>{var _;if(g.current=p.current.parentElement,!g)return;const C=Ll((_=g.current)!=null?_:void 0),S=Tbe(l,C);return S.addResizeListener(g.current,b),b(),()=>{S.removeResizeListener(g.current,b)}},[l,b]);const m={overflow:"visible"},w={};s||(m.height=0,w.height=f.height),a||(m.width=0,w.width=f.width);const x=An(p,n);return D.jsx("div",O({ref:x,style:O({},m,c)},d,{children:f.height===null&&f.width===null?null:r(w)}))}),Qa=(t,e="warning")=>{let n=!1;const r=Array.isArray(t)?t.join(` +`):t;return()=>{n||(n=!0,e==="error"?console.error(r):console.warn(r))}},hN=(t,e)=>t;function Dbe(t){return t.acceptsApiRef}Qa(["MUI: `useGridSelector` has been called before the initialization of the state.","This hook can only be used inside the context of the grid."]);const gt=(t,e)=>Dbe(e)?e(t):e(t.current.state);var fS="NOT_FOUND";function Rbe(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:fS},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function Ibe(t,e){var n=[];function r(a){var l=n.findIndex(function(c){return e(a,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return fS}function i(a,l){r(a)===fS&&(n.unshift({key:a,value:l}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var Nbe=function(e,n){return e===n};function Fbe(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r{wu.cache===null&&(wu.cache={});const e=(...n)=>{const[r,i]=n,o=!!r.current,s=o?r.current.instanceId:i??"default",a=o?r.current.state:r;wu.cache===null&&(wu.cache={});const{cache:l}=wu;if(l[s]&&l[s].get(t))return l[s].get(t)(a,s);const u=Lbe(...t);return l[s]||(l[s]=new Map),l[s].set(t,u),u(a,s)};return e.acceptsApiRef=!0,e},Bbe=t=>{typeof t<"u"?wu.cache&&wu.cache[t]&&delete wu.cache[t]:wu.cache=null},Kl=t=>t.rows,yE=wt(Kl,t=>t.totalRowCount),$be=wt(Kl,t=>t.loading),zbe=wt(Kl,t=>t.totalTopLevelRowCount),ym=wt(Kl,t=>t.idRowsLookup),pN=wt(Kl,t=>t.idToIdLookup),$c=wt(Kl,t=>t.tree),Ube=wt(Kl,t=>t.groupingName),mN=wt(Kl,t=>t.treeDepth),df=wt(Kl,t=>t.ids),Hbe=wt(Kl,t=>t==null?void 0:t.additionalRowGroups),gb=wt(Hbe,t=>t==null?void 0:t.pinnedRows),Vbe=wt(gb,t=>{var e,n;return((t==null||(e=t.top)==null?void 0:e.length)||0)+((t==null||(n=t.bottom)==null?void 0:n.length)||0)}),gN=t=>t.sorting,vN=wt(gN,t=>t.sortedRows),yN=wt(vN,ym,(t,e)=>t.map(n=>({id:n,model:e[n]}))),Da=wt(gN,t=>t.sortModel),Gbe=wt(Da,t=>t.reduce((n,r,i)=>(n[r.field]={sortDirection:r.sort,sortIndex:t.length>1?i+1:void 0},n),{})),$f=t=>t.columns,Wm=wt($f,t=>t.all),th=wt($f,t=>t.lookup),Wa=wt(Wm,th,(t,e)=>t.map(n=>e[n])),Tu=wt($f,t=>t.columnVisibilityModel),lo=wt(Wa,Tu,(t,e)=>t.filter(n=>e[n.field]!==!1));wt(lo,t=>t.map(e=>e.field));const zf=wt(lo,t=>{const e=[];let n=0;for(let r=0;r{const n=t.length;return n===0?0:e[n-1]+t[n-1].computedWidth}),bN=wt(Wa,t=>t.filter(e=>e.filterable)),jbe=wt(Wa,t=>t.reduce((e,n)=>(n.filterable&&(e[n.field]=n),e),{}));hN(wt(bN,t=>t.map(e=>e.field)));hN(wt(lo,t=>t.length));const Wbe=hN(wt(zf,bE,(t,e)=>({totalWidth:e,positions:t}))),vb=t=>t.filter,Lo=wt(vb,t=>t.filterModel),qbe=wt(Lo,t=>t.quickFilterValues),Xbe=wt(vb,t=>t.visibleRowsLookup),Aj=wt(vb,t=>t.filteredRowsLookup);wt(vb,t=>t.filteredDescendantCountLookup);const Ku=wt(Xbe,yN,(t,e)=>e.filter(n=>t[n.id]!==!1)),bv=wt(Ku,t=>t.map(e=>e.id)),Kbe=wt(Aj,yN,(t,e)=>e.filter(n=>t[n.id]!==!1)),Ybe=wt(Kbe,t=>t.map(e=>e.id)),Pj=wt(Ku,$c,mN,(t,e,n)=>n<2?t:t.filter(r=>{var i;return((i=e[r.id])==null?void 0:i.depth)===0})),Dj=wt(Ku,t=>t.length),Rj=wt(Pj,t=>t.length),Ij=wt(Lo,th,(t,e)=>{var n;return(n=t.items)==null?void 0:n.filter(r=>{var i,o;if(!r.columnField)return!1;const s=e[r.columnField];if(!(s!=null&&s.filterOperators)||(s==null||(i=s.filterOperators)==null?void 0:i.length)===0)return!1;const a=s.filterOperators.find(l=>l.value===r.operatorValue);return a?!a.InputComponent||r.value!=null&&((o=r.value)==null?void 0:o.toString())!=="":!1})}),Zbe=wt(Ij,t=>t.reduce((n,r)=>(n[r.columnField]?n[r.columnField].push(r):n[r.columnField]=[r],n),{})),nh=t=>t.density,Nj=wt(nh,t=>t.value),yb=wt(nh,t=>t.rowHeight),Fj=wt(nh,t=>t.headerHeight),xN=wt(nh,t=>t.headerGroupingMaxDepth),Qbe=wt(nh,t=>t.factor),bb=wt(nh,t=>t.headerHeight*(1+t.headerGroupingMaxDepth));function Jbe(t){var e,n;const r=Lt(),i=mt(),o=gt(r,bb),[s,a]=E.useState(()=>{var c,d;return(c=(d=r.current.getRootDimensions())==null?void 0:d.viewportInnerSize)!=null?c:null}),l=E.useCallback(()=>{var c,d;a((c=(d=r.current.getRootDimensions())==null?void 0:d.viewportInnerSize)!=null?c:null)},[r]);_r(()=>r.current.subscribeEvent("viewportInnerSizeChange",l),[r,l]);let u=(e=s==null?void 0:s.height)!=null?e:0;return i.autoHeight&&u===0&&(u="auto"),s?D.jsx("div",O({style:{height:u,width:(n=s==null?void 0:s.width)!=null?n:0,position:"absolute",top:o,bottom:u==="auto"?0:void 0}},t)):null}function e1e(){const t=Lt(),e=mt(),n=gt(t,yE),r=gt(t,Dj),i=gt(t,$be),o=!i&&n===0,s=!i&&n>0&&r===0;let a=null;if(o){var l;a=D.jsx(e.components.NoRowsOverlay,O({},(l=e.componentsProps)==null?void 0:l.noRowsOverlay))}if(s){var u;a=D.jsx(e.components.NoResultsOverlay,O({},(u=e.componentsProps)==null?void 0:u.noResultsOverlay))}if(i){var c;a=D.jsx(e.components.LoadingOverlay,O({},(c=e.componentsProps)==null?void 0:c.loadingOverlay))}return a===null?null:D.jsx(Jbe,{children:a})}function t1e(t){const{children:e,VirtualScrollerComponent:n,ColumnHeadersComponent:r}=t,i=Lt(),o=mt(),s=gt(i,bb),[a,l]=E.useState(o.disableVirtualization),u=E.useCallback(()=>{l(!0)},[]),c=E.useCallback(()=>{l(!1)},[]);E.useEffect(()=>{l(o.disableVirtualization)},[o.disableVirtualization]),i.current.unstable_disableVirtualization=u,i.current.unstable_enableVirtualization=c;const d=E.useRef(null),f=E.useRef(null),h=E.useRef(null),p=E.useRef(null);i.current.columnHeadersContainerElementRef=f,i.current.columnHeadersElementRef=d,i.current.windowRef=h,i.current.renderingZoneRef=p;const g=E.useCallback(b=>{i.current.publishEvent("resize",b)},[i]);return D.jsxs(Mj,{children:[D.jsx(e1e,{}),D.jsx(r,{ref:f,innerRef:d}),D.jsx(Pbe,{nonce:o.nonce,disableHeight:o.autoHeight,onResize:g,children:b=>{const m={width:b.width,height:b.height?b.height-s:"auto",marginTop:s};return D.jsx(n,{ref:h,style:m,disableVirtualization:a})}}),e]})}function Jr(t,e){const n=E.useRef(null);if(n.current)return n.current;const r=t.current.getLogger(e);return n.current=r,r}let n1e=class extends E.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){this.props.api.current&&(this.logError(e),this.props.api.current.showError({error:e,errorInfo:n}))}logError(e,n){this.props.logger.error(`An unexpected error occurred. Error: ${e&&e.message}. `,e,n)}render(){var e;return this.props.hasError||(e=this.state)!=null&&e.hasError?this.props.render(this.state):this.props.children}};function r1e(t){const{children:e}=t,n=Lt(),r=Jr(n,"GridErrorHandler"),i=mt(),o=n.current.state.error;return D.jsx(n1e,{hasError:o!=null,api:n,logger:r,render:s=>{var a;return D.jsx(Mj,{children:D.jsx(i.components.ErrorOverlay,O({},s,o,(a=i.componentsProps)==null?void 0:a.errorOverlay))})},children:e})}function i1e(){var t;const e=Lt(),n=mt(),r=E.useRef(null);return e.current.footerRef=r,n.hideFooter?null:D.jsx("div",{ref:r,children:D.jsx(n.components.Footer,O({},(t=n.componentsProps)==null?void 0:t.footer))})}function o1e(){var t;const e=Lt(),n=mt(),r=E.useRef(null);return e.current.headerRef=r,D.jsx("div",{ref:r,children:D.jsx(n.components.Header,O({},(t=n.componentsProps)==null?void 0:t.header))})}function Oj(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;et.focus,Oa=wt(Lj,t=>t.cell),s1e=wt(Lj,t=>t.columnHeader),Bj=t=>t.tabIndex,hS=wt(Bj,t=>t.cell),$j=wt(Bj,t=>t.columnHeader),a1e=["align","children","colIndex","colDef","cellMode","field","formattedValue","hasFocus","height","isEditable","rowId","tabIndex","value","width","className","showRightBorder","extendRowFullWidth","row","colSpan","disableDragEvents","onClick","onDoubleClick","onMouseDown","onMouseUp","onKeyDown","onDragEnter","onDragOver"];let MT;function l1e(){return MT===void 0&&document.createElement("div").focus({get preventScroll(){return MT=!0,!1}}),MT}const u1e=t=>{const{align:e,showRightBorder:n,isEditable:r,classes:i}=t,o={root:["cell",`cell--text${Ge(e)}`,r&&"cell--editable",n&&"withBorder"],content:["cellContent"]};return Qe(o,ln,i)};function c1e(t){const{align:e,children:n,colIndex:r,cellMode:i,field:o,formattedValue:s,hasFocus:a,height:l,isEditable:u,rowId:c,tabIndex:d,value:f,width:h,className:p,showRightBorder:g,colSpan:b,disableDragEvents:m,onClick:w,onDoubleClick:x,onMouseDown:_,onMouseUp:C,onKeyDown:S,onDragEnter:M,onDragOver:P}=t,A=Be(t,a1e),R=s??f,F=E.useRef(null),$=E.useRef(null),j=Lt(),k=mt(),U={align:e,showRightBorder:g,isEditable:u,classes:k.classes},G=u1e(U),B=E.useCallback(fe=>Me=>{const ye=j.current.getCellParams(c,o||"");j.current.publishEvent(fe,ye,Me),C&&C(Me)},[j,o,C,c]),L=E.useCallback(fe=>Me=>{const ye=j.current.getCellParams(c,o||"");j.current.publishEvent(fe,ye,Me),_&&_(Me)},[j,o,_,c]),N=E.useCallback((fe,Me)=>ye=>{if(!ye.currentTarget.contains(ye.target)||!j.current.getRow(c))return;const we=j.current.getCellParams(c,o||"");j.current.publishEvent(fe,we,ye),Me&&Me(ye)},[j,o,c]),W={minWidth:h,maxWidth:h,minHeight:l,maxHeight:l==="auto"?"none":l};E.useEffect(()=>{if(!a||i===an.Edit)return;const fe=Sr(j.current.rootElementRef.current);if(F.current&&!F.current.contains(fe.activeElement)){const Me=F.current.querySelector('[tabindex="0"]'),ye=$.current||Me||F.current;if(l1e())ye.focus({preventScroll:!0});else{const we=j.current.getScrollPosition();ye.focus(),j.current.scroll(we)}}},[a,i,j]);let K=A.onFocus;const J=j.current.getColumn(o).type==="actions",ae=()=>{if(n==null){const fe=R==null?void 0:R.toString();return D.jsx("div",{title:fe,className:G.content,children:fe})}return E.isValidElement(n)&&J?E.cloneElement(n,{focusElementRef:$}):n},ve=m?null:{onDragEnter:N("cellDragEnter",M),onDragOver:N("cellDragOver",P)};return D.jsx("div",O({ref:F,className:vn(p,G.root),role:"cell","data-field":o,"data-colindex":r,"aria-colindex":r+1,"aria-colspan":b,style:W,tabIndex:(i==="view"||!u)&&!J?d:-1,onClick:N("cellClick",w),onDoubleClick:N("cellDoubleClick",x),onMouseDown:L("cellMouseDown"),onMouseUp:B("cellMouseUp"),onKeyDown:N("cellKeyDown",S)},ve,A,{onFocus:K,children:ae()}))}const d1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","getValue"],f1e=t=>{const{classes:e}=t;return Qe({root:["booleanCell"]},ln,e)},h1e=t=>{const{value:e}=t,n=Be(t,d1e),r=Lt(),i=mt(),o={classes:i.classes},s=f1e(o),a=E.useMemo(()=>e?i.components.BooleanCellTrueIcon:i.components.BooleanCellFalseIcon,[i.components.BooleanCellFalseIcon,i.components.BooleanCellTrueIcon,e]);return D.jsx(a,O({fontSize:"small",className:s.root,titleAccess:r.current.getLocaleText(e?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!e},n))},p1e=E.memo(h1e),m1e=t=>t.rowNode.isAutoGenerated?"":D.jsx(p1e,O({},t)),g1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","getValue","hasFocus","isValidating","isProcessingProps","error","onValueChange"],v1e=t=>{const{classes:e}=t;return Qe({root:["editBooleanCell"]},ln,e)};function y1e(t){var e;const{id:n,value:r,field:i,className:o,hasFocus:s,onValueChange:a}=t,l=Be(t,g1e),u=Lt(),c=E.useRef(null),d=jn(),[f,h]=E.useState(r),p=mt(),g={classes:p.classes},b=v1e(g),m=E.useCallback(async w=>{const x=w.target.checked;a&&await a(w,x),h(x),await u.current.setEditCellValue({id:n,field:i,value:x},w)},[u,i,n,a]);return E.useEffect(()=>{h(r)},[r]),_r(()=>{s&&c.current.focus()},[s]),D.jsx("label",O({htmlFor:d,className:vn(b.root,o)},l,{children:D.jsx(p.components.BaseCheckbox,O({id:d,inputRef:c,checked:!!f,onChange:m,size:"small"},(e=p.componentsProps)==null?void 0:e.baseCheckbox))}))}const b1e=t=>D.jsx(y1e,O({},t)),x1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","getValue","inputProps","isValidating","isProcessingProps","onValueChange"],w1e=ze(fg)({fontSize:"inherit"}),_1e=t=>{const{classes:e}=t;return Qe({root:["editInputCell"]},ln,e)};function S1e(t){const{id:e,value:n,field:r,colDef:i,hasFocus:o,inputProps:s,onValueChange:a}=t,l=Be(t,x1e),u=i.type==="dateTime",c=Lt(),d=E.useRef(),f=E.useMemo(()=>{let x;n==null?x=null:n instanceof Date?x=n:x=new Date((n??"").toString());let _;return x==null||Number.isNaN(x.getTime())?_="":_=new Date(x.getTime()-x.getTimezoneOffset()*60*1e3).toISOString().substr(0,u?16:10),{parsed:x,formatted:_}},[n,u]),[h,p]=E.useState(f),b={classes:mt().classes},m=_1e(b),w=E.useCallback(async x=>{const _=x.target.value;let C;if(_==="")C=null;else{const[S,M]=_.split("T"),[P,A,R]=S.split("-");if(C=new Date,C.setFullYear(Number(P),Number(A)-1,Number(R)),C.setHours(0,0,0,0),M){const[F,$]=M.split(":");C.setHours(Number(F),Number($),0,0)}}a&&await a(x,C),p({parsed:C,formatted:_}),c.current.setEditCellValue({id:e,field:r,value:C},x)},[c,r,e,a]);return E.useEffect(()=>{p(x=>{var _,C;return f.parsed!==x.parsed&&((_=f.parsed)==null?void 0:_.getTime())!==((C=x.parsed)==null?void 0:C.getTime())?f:x})},[f]),_r(()=>{o&&d.current.focus()},[o]),D.jsx(w1e,O({inputRef:d,fullWidth:!0,className:m.root,type:u?"datetime-local":"date",inputProps:O({max:u?"9999-12-31T23:59":"9999-12-31"},s),value:h.formatted,onChange:w},l))}const zj=t=>D.jsx(S1e,O({},t)),C1e=mn(D.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),E1e=mn(D.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),a8=mn(D.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),l8=mn(D.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),M1e=mn(D.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),T1e=mn(D.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),A1e=mn(D.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");mn(D.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");mn(D.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");const P1e=mn(D.jsx("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),D1e=mn(D.jsx("path",{d:"M11 19V5h2v14z"}),"Separator"),R1e=mn(D.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),I1e=mn(D.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),N1e=mn(D.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),F1e=mn(D.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),TT=mn(D.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Uj=mn(D.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),O1e=mn(D.jsx("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),wN=mn(D.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),Hj=mn(D.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),k1e=mn(D.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),L1e=mn(D.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),B1e=mn(D.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");function zc(t){return typeof t=="object"&&t!==null?t.value:t}function pS(t,e){if(e===void 0)return;const n=e.find(r=>{const i=zc(r);return String(i)===String(t)});return zc(n)}const $1e=["item","applyValue","type","apiRef","focusElementRef"],z1e=({valueOptions:t,valueFormatter:e,field:n},r,i)=>(typeof t=="function"?["",...t({field:n})]:["",...t||[]]).map(s=>{const a=typeof s=="object",l=a?s.value:s,u=a?s.value:s,c=e&&s!==""?e({value:s,field:n,api:r}):s,d=a?s.label:c;return D.jsx(i,{value:u,children:d},l)}),Vj=500;function _l(t){var e,n,r,i,o;const{item:s,applyValue:a,type:l,apiRef:u,focusElementRef:c}=t,d=Be(t,$1e),f=E.useRef(),[h,p]=E.useState((e=s.value)!=null?e:""),[g,b]=E.useState(!1),m=jn(),w=mt(),_=(r=(((n=w.componentsProps)==null?void 0:n.baseSelect)||{}).native)!=null?r:!0,C=l==="singleSelect"?{select:!0,SelectProps:O({native:_},(i=w.componentsProps)==null?void 0:i.baseSelect),children:z1e(u.current.getColumn(s.columnField),u.current,_?"option":wn)}:{},S=E.useCallback(P=>{let A=P.target.value;if(l==="singleSelect"){const R=u.current.getColumn(s.columnField),F=typeof R.valueOptions=="function"?R.valueOptions({field:R.field}):R.valueOptions;A=pS(A,F)}clearTimeout(f.current),p(String(A)),b(!0),f.current=setTimeout(()=>{a(O({},s,{value:A})),b(!1)},Vj)},[u,a,s,l]);E.useEffect(()=>()=>{clearTimeout(f.current)},[]),E.useEffect(()=>{var P;const A=(P=s.value)!=null?P:"";p(String(A))},[s.value]);const M=g?{endAdornment:D.jsx(wN,{})}:d.InputProps;return D.jsx(w.components.BaseTextField,O({id:m,label:u.current.getLocaleText("filterPanelInputLabel"),placeholder:u.current.getLocaleText("filterPanelInputPlaceholder"),value:h,onChange:S,variant:"standard",type:l||"text",InputProps:M,InputLabelProps:{shrink:!0},inputRef:c},C,d,(o=w.componentsProps)==null?void 0:o.baseTextField))}const U1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","getValue","isValidating","debounceMs","isProcessingProps","onValueChange"],H1e=t=>{const{classes:e}=t;return Qe({root:["editInputCell"]},ln,e)},V1e=ze(fg,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(t,e)=>e.editInputCell})(({theme:t})=>O({},t.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),G1e=E.forwardRef((t,e)=>{var n,r;const i=mt(),{id:o,value:s,field:a,colDef:l,hasFocus:u,debounceMs:c=(n=i.experimentalFeatures)!=null&&n.newEditingApi?200:Vj,isProcessingProps:d,onValueChange:f}=t,h=Be(t,U1e),p=Lt(),g=E.useRef(),[b,m]=E.useState(s),w=H1e(i),x=E.useCallback(async C=>{var S;const M=C.target.value;f&&await f(C,M);const P=p.current.getColumn(a);let A=M;P.valueParser&&(S=i.experimentalFeatures)!=null&&S.newEditingApi&&(A=P.valueParser(M,p.current.getCellParams(o,a))),m(A),p.current.setEditCellValue({id:o,field:a,value:A,debounceMs:c,unstable_skipValueParser:!0},C)},[p,c,a,o,f,(r=i.experimentalFeatures)==null?void 0:r.newEditingApi]),_=p.current.unstable_getEditCellMeta?p.current.unstable_getEditCellMeta(o,a):{};return E.useEffect(()=>{_.changeReason!=="debouncedSetEditCellValue"&&m(s)},[_.changeReason,s]),_r(()=>{u&&g.current.focus()},[u]),D.jsx(V1e,O({ref:e,inputRef:g,className:w.root,ownerState:i,fullWidth:!0,type:l.type==="number"?l.type:"text",value:b??"",onChange:x,endAdornment:d?D.jsx(wN,{}):void 0},h))}),j1e=t=>D.jsx(G1e,O({},t)),_N=t=>t==="Escape",Gj=t=>t==="Enter",xE=t=>t==="Tab",jj=t=>t===" ",W1e=t=>t.indexOf("Arrow")===0,q1e=t=>t==="Home"||t==="End",X1e=t=>t.indexOf("Page")===0,ED=t=>t==="Delete"||t==="Backspace";function wE(t){return t.key.length===1&&t.ctrlKey===!1&&t.metaKey===!1}const K1e=["Enter","Escape","Tab"],Y1e=["Enter","Tab"],Z1e=t=>Gj(t.key)||ED(t.key)||wE(t),Q1e=t=>K1e.indexOf(t)>-1,u8=t=>Y1e.indexOf(t)>-1,xb=t=>q1e(t)||W1e(t)||X1e(t)||jj(t),MD=t=>!!t.key,SN=t=>xE(t)||_N(t),J1e=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","getValue","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen"],exe=(t,e)=>{const n=typeof t=="object",r=n?t.value:t,i=n?t.value:t,o=n?t.label:t;return D.jsx(e,{value:i,children:o},r)};function txe(t){return!!t.key}function nxe(t){var e,n,r;const i=mt(),{id:o,value:s,api:a,field:l,row:u,colDef:c,hasFocus:d,error:f,onValueChange:h,initialOpen:p=i.editMode===oo.Cell}=t,g=Be(t,J1e),b=Lt(),m=E.useRef(),w=E.useRef(),[x,_]=E.useState(p),S=(n=(((e=i.componentsProps)==null?void 0:e.baseSelect)||{}).native)!=null?n:!1;let M;typeof c.valueOptions=="function"?M=c.valueOptions({id:o,row:u,field:l}):M=c.valueOptions,c.valueFormatter&&(M=M.map(F=>{if(typeof F=="object")return F;const $={field:l,api:a,value:F};return{value:F,label:String(c.valueFormatter($))}}));const P=async F=>{var $;_(!1);const j=F.target,k=pS(j.value,M);h&&await h(F,k);const U=await b.current.setEditCellValue({id:o,field:l,value:k},F);if(($=i.experimentalFeatures)!=null&&$.newEditingApi||i.editMode===oo.Row||U===!1)return;if(await Promise.resolve(b.current.commitCellChange({id:o,field:l},F))&&(b.current.setCellMode(o,l,"view"),F.key)){const B=b.current.getCellParams(o,l);b.current.publishEvent("cellNavigationKeyDown",B,F)}},A=(F,$)=>{if(i.editMode===oo.Row){_(!1);return}if($==="backdropClick"||_N(F.key)){var j;(j=i.experimentalFeatures)!=null&&j.newEditingApi?b.current.stopCellEditMode({id:o,field:l,ignoreModifications:!0}):b.current.setCellMode(o,l,"view")}},R=F=>{txe(F)&&F.key==="Enter"||_(!0)};return _r(()=>{d&&w.current.focus()},[d]),D.jsx(i.components.BaseSelect,O({ref:m,inputRef:w,value:s,onChange:P,open:x,onOpen:R,MenuProps:{onClose:A},error:f,native:S,fullWidth:!0},g,(r=i.componentsProps)==null?void 0:r.baseSelect,{children:M.map(F=>exe(F,S?"option":wn))}))}const rxe=t=>D.jsx(nxe,O({},t)),ixe=["open","target","onClickAway","children","position","className","onExited"],oxe=t=>{const{classes:e}=t;return Qe({root:["menu"]},ln,e)},sxe=ze(Yf,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(t,e)=>e.menu})(({theme:t})=>({zIndex:t.zIndex.modal,[`& .${Ie.menuList}`]:{outline:0}})),axe={"bottom-start":"top left","bottom-end":"top right"},_E=t=>{var e;const{open:n,target:r,onClickAway:i,children:o,position:s,className:a,onExited:l}=t,u=Be(t,ixe),c=Lt(),d=E.useRef(r),f=E.useRef(n),h=mt(),p=oxe(h);E.useEffect(()=>{f.current&&d.current&&d.current.focus();const b=n?"menuOpen":"menuClose";c.current.publishEvent(b,{target:r}),f.current=n,d.current=r},[c,n,r]);const g=b=>m=>{b&&b(),l&&l(m)};return D.jsx(sxe,O({as:h.components.BasePopper,className:vn(a,p.root),ownerState:h,open:n,anchorEl:r,transition:!0,placement:s},u,(e=h.componentsProps)==null?void 0:e.basePopper,{children:({TransitionProps:b,placement:m})=>D.jsx(FV,{onClickAway:i,mouseEvent:"onMouseDown",children:D.jsx(cy,O({},b,{style:{transformOrigin:axe[m]},onExited:g(b==null?void 0:b.onExited),children:D.jsx(Xu,{children:o})}))})}))},lxe=["colDef","id","api","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","getValue","tabIndex","position","focusElementRef"],uxe=t=>typeof t.getActions=="function",cxe=t=>{const{colDef:e,id:n,hasFocus:r,tabIndex:i,position:o="bottom-end",focusElementRef:s}=t,a=Be(t,lxe),[l,u]=E.useState(-1),[c,d]=E.useState(!1),f=Lt(),h=E.useRef(null),p=E.useRef(null),g=E.useRef(!1),b=E.useRef({}),m=jn(),w=jn(),x=mt();if(E.useLayoutEffect(()=>{r||Object.entries(b.current).forEach(([k,U])=>{U==null||U.stop({},()=>{delete b.current[k]})})},[r]),E.useEffect(()=>{if(l<0||!h.current||l>=h.current.children.length)return;h.current.children[l].focus({preventScroll:!0})},[l]),E.useEffect(()=>{r||(u(-1),g.current=!1)},[r]),E.useImperativeHandle(s,()=>({focus(){g.current||u(0)}}),[]),!uxe(e))throw new Error("MUI: Missing the `getActions` property in the `GridColDef`.");const _=e.getActions(f.current.getRowParams(n)),C=_.filter(k=>!k.props.showInMenu),S=_.filter(k=>k.props.showInMenu),M=C.length+(S.length?1:0);E.useEffect(()=>{l>=M&&u(M-1)},[l,M]);const P=()=>{d(!0),u(M-1),g.current=!0},A=()=>{d(!1)},R=k=>U=>{b.current[k]=U},F=(k,U)=>G=>{u(k),g.current=!0,U&&U(G)},$=k=>{if(M<=1)return;let U=l;k.key==="ArrowRight"?U+=1:k.key==="ArrowLeft"&&(U-=1),!(U<0||U>=M)&&U!==l&&(k.preventDefault(),k.stopPropagation(),u(U))},j=k=>{k.key==="Tab"&&k.preventDefault(),["Tab","Enter","Escape"].includes(k.key)&&A()};return D.jsxs("div",O({role:"menu",ref:h,tabIndex:-1,className:Ie.actionsCell,onKeyDown:$},a,{children:[C.map((k,U)=>E.cloneElement(k,{key:U,touchRippleRef:R(U),onClick:F(U,k.props.onClick),tabIndex:l===U?i:-1})),S.length>0&&w&&D.jsx(io,{ref:p,id:w,"aria-label":f.current.getLocaleText("actionsCellMore"),"aria-controls":m,"aria-expanded":c?"true":void 0,"aria-haspopup":"true",role:"menuitem",size:"small",onClick:P,touchRippleRef:R(w),tabIndex:l===C.length?i:-1,children:D.jsx(x.components.MoreActionsIcon,{fontSize:"small"})}),S.length>0&&D.jsx(_E,{onClickAway:A,onClick:A,open:c,target:p.current,position:o,children:D.jsx(ub,{id:m,className:Ie.menuList,onKeyDown:j,"aria-labelledby":w,variant:"menu",autoFocusItem:!0,children:S.map((k,U)=>E.cloneElement(k,{key:U}))})})]}))},dxe=t=>D.jsx(cxe,O({},t)),fxe=["field","align","width","contentWidth"],hxe=t=>{const{align:e,classes:n}=t,r={root:["cell","cellSkeleton",`cell--text${Ge(e)}`]};return Qe(r,ln,n)};function pxe(t){const{align:e,width:n,contentWidth:r}=t,i=Be(t,fxe),s={classes:mt().classes,align:e},a=hxe(s);return D.jsx("div",O({className:a.root,style:{width:n}},i,{children:D.jsx(ahe,{width:`${r}%`})}))}const mxe=ze("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(t,e)=>[{[`&.${Ie.autoHeight}`]:e.autoHeight},{[`&.${Ie.aggregationColumnHeader}`]:e.aggregationColumnHeader},{[`&.${Ie["aggregationColumnHeader--alignLeft"]}`]:e["aggregationColumnHeader--alignLeft"]},{[`&.${Ie["aggregationColumnHeader--alignCenter"]}`]:e["aggregationColumnHeader--alignCenter"]},{[`&.${Ie["aggregationColumnHeader--alignRight"]}`]:e["aggregationColumnHeader--alignRight"]},{[`&.${Ie.aggregationColumnHeaderLabel}`]:e.aggregationColumnHeaderLabel},{[`& .${Ie.editBooleanCell}`]:e.editBooleanCell},{[`& .${Ie["cell--editing"]}`]:e["cell--editing"]},{[`& .${Ie["cell--textCenter"]}`]:e["cell--textCenter"]},{[`& .${Ie["cell--textLeft"]}`]:e["cell--textLeft"]},{[`& .${Ie["cell--textRight"]}`]:e["cell--textRight"]},{[`& .${Ie["cell--withRenderer"]}`]:e["cell--withRenderer"]},{[`& .${Ie.cell}`]:e.cell},{[`& .${Ie.cellContent}`]:e.cellContent},{[`& .${Ie.cellCheckbox}`]:e.cellCheckbox},{[`& .${Ie.cellSkeleton}`]:e.cellSkeleton},{[`& .${Ie.checkboxInput}`]:e.checkboxInput},{[`& .${Ie["columnHeader--alignCenter"]}`]:e["columnHeader--alignCenter"]},{[`& .${Ie["columnHeader--alignLeft"]}`]:e["columnHeader--alignLeft"]},{[`& .${Ie["columnHeader--alignRight"]}`]:e["columnHeader--alignRight"]},{[`& .${Ie["columnHeader--dragging"]}`]:e["columnHeader--dragging"]},{[`& .${Ie["columnHeader--moving"]}`]:e["columnHeader--moving"]},{[`& .${Ie["columnHeader--numeric"]}`]:e["columnHeader--numeric"]},{[`& .${Ie["columnHeader--sortable"]}`]:e["columnHeader--sortable"]},{[`& .${Ie["columnHeader--sorted"]}`]:e["columnHeader--sorted"]},{[`& .${Ie.columnHeader}`]:e.columnHeader},{[`& .${Ie.columnHeaderCheckbox}`]:e.columnHeaderCheckbox},{[`& .${Ie.columnHeaderDraggableContainer}`]:e.columnHeaderDraggableContainer},{[`& .${Ie.columnHeaderTitleContainer}`]:e.columnHeaderTitleContainer},{[`& .${Ie["columnSeparator--resizable"]}`]:e["columnSeparator--resizable"]},{[`& .${Ie["columnSeparator--resizing"]}`]:e["columnSeparator--resizing"]},{[`& .${Ie.columnSeparator}`]:e.columnSeparator},{[`& .${Ie.filterIcon}`]:e.filterIcon},{[`& .${Ie.iconSeparator}`]:e.iconSeparator},{[`& .${Ie.menuIcon}`]:e.menuIcon},{[`& .${Ie.menuIconButton}`]:e.menuIconButton},{[`& .${Ie.menuOpen}`]:e.menuOpen},{[`& .${Ie.menuList}`]:e.menuList},{[`& .${Ie["row--editable"]}`]:e["row--editable"]},{[`& .${Ie["row--editing"]}`]:e["row--editing"]},{[`& .${Ie["row--dragging"]}`]:e["row--dragging"]},{[`& .${Ie.row}`]:e.row},{[`& .${Ie.rowReorderCellPlaceholder}`]:e.rowReorderCellPlaceholder},{[`& .${Ie.rowReorderCell}`]:e.rowReorderCell},{[`& .${Ie["rowReorderCell--draggable"]}`]:e["rowReorderCell--draggable"]},{[`& .${Ie.sortIcon}`]:e.sortIcon},{[`& .${Ie.withBorder}`]:e.withBorder},{[`& .${Ie.treeDataGroupingCell}`]:e.treeDataGroupingCell},{[`& .${Ie.treeDataGroupingCellToggle}`]:e.treeDataGroupingCellToggle},{[`& .${Ie.detailPanelToggleCell}`]:e.detailPanelToggleCell},{[`& .${Ie["detailPanelToggleCell--expanded"]}`]:e["detailPanelToggleCell--expanded"]},e.root]})(({theme:t})=>{const e=t.palette.mode==="light"?wI(ra(t.palette.divider,1),.88):xI(ra(t.palette.divider,1),.68);return O({flex:1,boxSizing:"border-box",position:"relative",border:`1px solid ${e}`,borderRadius:t.shape.borderRadius,color:t.palette.text.primary},t.typography.body2,{outline:"none",height:"100%",display:"flex",flexDirection:"column",[`&.${Ie.autoHeight}`]:{height:"auto",[`& .${Ie["row--lastVisible"]} .${Ie.cell}`]:{borderBottomColor:"transparent"}},[`& .${Ie["virtualScrollerContent--overflowed"]} .${Ie["row--lastVisible"]} .${Ie.cell}`]:{borderBottomColor:"transparent"},[`& .${Ie.columnHeader}, & .${Ie.cell}`]:{WebkitTapHighlightColor:"transparent",lineHeight:null,padding:"0 10px",boxSizing:"border-box"},[`& .${Ie.columnHeader}:focus-within, & .${Ie.cell}:focus-within`]:{outline:`solid ${ra(t.palette.primary.main,.5)} 1px`,outlineWidth:1,outlineOffset:-1},[`& .${Ie.columnHeader}:focus, & .${Ie.cell}:focus`]:{outline:`solid ${t.palette.primary.main} 1px`},[`& .${Ie.columnHeaderCheckbox}, & .${Ie.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${Ie.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${Ie["columnHeader--sorted"]} .${Ie.iconButtonContainer}, & .${Ie["columnHeader--filtered"]} .${Ie.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${Ie.columnHeader}:not(.${Ie["columnHeader--sorted"]}) .${Ie.sortIcon}`]:{opacity:0,transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.shorter})},[`& .${Ie.columnHeader}:not(.${Ie["columnHeader--sorted"]}):hover .${Ie.sortIcon}`]:{opacity:.5},[`& .${Ie.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${Ie.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${Ie["columnHeader--filledGroup"]} .${Ie.columnHeaderTitleContainer}`]:{borderBottom:`solid ${e} 1px`,boxSizing:"border-box"},[`& .${Ie["columnHeader--filledGroup"]}.${Ie["columnHeader--showColumnBorder"]} .${Ie.columnHeaderTitleContainer}`]:{borderBottom:"none"},[`& .${Ie["columnHeader--filledGroup"]}.${Ie["columnHeader--showColumnBorder"]}`]:{borderBottom:`solid ${e} 1px`,boxSizing:"border-box"},[`& .${Ie.sortIcon}, & .${Ie.filterIcon}`]:{fontSize:"inherit"},[`& .${Ie["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${Ie["columnHeader--alignCenter"]} .${Ie.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${Ie["columnHeader--alignRight"]} .${Ie.columnHeaderDraggableContainer}, & .${Ie["columnHeader--alignRight"]} .${Ie.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${Ie["columnHeader--alignCenter"]} .${Ie.menuIcon}, & .${Ie["columnHeader--alignRight"]} .${Ie.menuIcon}`]:{marginRight:"auto",marginLeft:-6},[`& .${Ie["columnHeader--alignRight"]} .${Ie.menuIcon}, & .${Ie["columnHeader--alignRight"]} .${Ie.menuIcon}`]:{marginRight:"auto",marginLeft:-10},[`& .${Ie["columnHeader--moving"]}`]:{backgroundColor:t.palette.action.hover},[`& .${Ie.columnSeparator}`]:{position:"absolute",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"center",color:e},[`& .${Ie["columnSeparator--sideLeft"]}`]:{left:-12},[`& .${Ie["columnSeparator--sideRight"]}`]:{right:-12},[`& .${Ie["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none","&:hover":{color:t.palette.text.primary,"@media (hover: none)":{color:e}},[`&.${Ie["columnSeparator--resizing"]}`]:{color:t.palette.text.primary},"& svg":{pointerEvents:"none"}},[`& .${Ie.iconSeparator}`]:{color:"inherit"},[`& .${Ie.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-10,display:"flex",alignItems:"center"},[`& .${Ie.columnHeader}:hover`]:{[`& .${Ie.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${Ie.menuIcon}`]:{width:"auto",visibility:"visible"}},[`.${Ie.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${Ie.row}`]:{display:"flex",width:"fit-content",breakInside:"avoid","&:hover, &.Mui-hovered":{backgroundColor:t.palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&.Mui-selected":{backgroundColor:ra(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:ra(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:ra(t.palette.primary.main,t.palette.action.selectedOpacity)}}}},[`& .${Ie.cell}`]:{display:"flex",alignItems:"center",borderBottom:`1px solid ${e}`},[`& .${Ie.row}:not(.${Ie["row--dynamicHeight"]}) > .${Ie.cell}`]:{overflow:"hidden",whiteSpace:"nowrap"},[`& .${Ie.cellContent}`]:{overflow:"hidden",textOverflow:"ellipsis"},[`& .${Ie.cell}.${Ie["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:t.shadows[2],backgroundColor:t.palette.background.paper,"&:focus-within":{outline:`solid ${t.palette.primary.main} 1px`,outlineOffset:"-1px"}},[`& .${Ie["row--editing"]}`]:{boxShadow:t.shadows[2]},[`& .${Ie["row--editing"]} .${Ie.cell}`]:{boxShadow:t.shadows[0],backgroundColor:t.palette.background.paper},[`& .${Ie.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${Ie.booleanCell}[data-value="true"]`]:{color:t.palette.text.secondary},[`& .${Ie.booleanCell}[data-value="false"]`]:{color:t.palette.text.disabled},[`& .${Ie.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:t.spacing(1)},[`& .${Ie.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:t.palette.action.disabledOpacity},[`& .${Ie["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${Ie.rowReorderCellContainer}`]:{padding:0,alignItems:"stretch"},[`& .${Ie.withBorder}`]:{borderRight:`1px solid ${e}`},[`& .${Ie["cell--textLeft"]}`]:{justifyContent:"flex-start"},[`& .${Ie["cell--textRight"]}`]:{justifyContent:"flex-end"},[`& .${Ie["cell--textCenter"]}`]:{justifyContent:"center"},[`& .${Ie.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${Ie.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${Ie["columnHeader--dragging"]}, & .${Ie["row--dragging"]}`]:{background:t.palette.background.paper,padding:"0 12px",borderRadius:t.shape.borderRadius,opacity:t.palette.action.disabledOpacity},[`& .${Ie["row--dragging"]}`]:{background:t.palette.background.paper,padding:"0 12px",borderRadius:t.shape.borderRadius,opacity:t.palette.action.disabledOpacity,[`& .${Ie.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${Ie.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Ie.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:t.spacing(2)},[`& .${Ie.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Ie.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:t.spacing(2)}})}),gxe=["children","className"],vxe=t=>{const{autoHeight:e,density:n,classes:r}=t,i={root:["root",e&&"autoHeight",`root--density${Ge(n)}`]};return Qe(i,ln,r)},yxe=E.forwardRef(function(e,n){const r=mt(),{children:i,className:o}=e,s=Be(e,gxe),a=Lt(),l=gt(a,lo),u=gt(a,yE),c=gt(a,Nj),d=gt(a,xN),f=E.useRef(null),h=An(f,n),p=gt(a,Vbe),g=O({},r,{density:c}),b=vxe(g);a.current.rootElementRef=f;const[m,w]=E.useState(!1);return _r(()=>{w(!0)},[]),_r(()=>{m&&a.current.unstable_updateGridDimensionsRef()},[a,m]),m?D.jsx(mxe,O({ref:h,className:vn(o,b.root),ownerState:g,role:"grid","aria-colcount":l.length,"aria-rowcount":d+1+p+u,"aria-multiselectable":!r.disableMultipleSelection,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"]},s,{children:i})):null}),bxe=["className"],xxe=t=>{const{classes:e}=t;return Qe({root:["footerContainer"]},ln,e)},wxe=ze("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(t,e)=>e.footerContainer})(({theme:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:`1px solid ${t.palette.mode==="light"?wI(ra(t.palette.divider,1),.88):xI(ra(t.palette.divider,1),.68)}`})),_xe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,bxe),o=mt(),s=xxe(o);return D.jsx(wxe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),Sxe=["className"],Cxe=t=>{const{classes:e}=t;return Qe({root:["overlay"]},ln,e)},Exe=ze("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(t,e)=>e.overlay})(({theme:t})=>({position:"absolute",top:0,zIndex:4,width:"100%",height:"100%",pointerEvents:"none",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:ra(t.palette.background.default,t.palette.action.disabledOpacity)})),SE=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,Sxe),o=mt(),s=Cxe(o);return D.jsx(Exe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),Mxe=["className","children"],Txe=t=>{const{classes:e}=t;return Qe({root:["toolbarContainer"]},ln,e)},Axe=ze("div",{name:"MuiDataGrid",slot:"ToolbarContainer",overridesResolver:(t,e)=>e.toolbarContainer})(({theme:t})=>({display:"flex",alignItems:"center",flexWrap:"wrap",padding:t.spacing(.5,.5,0)})),Pxe=E.forwardRef(function(e,n){const{className:r,children:i}=e,o=Be(e,Mxe),s=mt(),a=Txe(s);return i?D.jsx(Axe,O({ref:n,className:vn(r,a.root),ownerState:s},o,{children:i})):null}),Dxe=["className"],Rxe=t=>{const{classes:e}=t;return Qe({root:["iconButtonContainer"]},ln,e)},Ixe=ze("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(t,e)=>e.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),Wj=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,Dxe),o=mt(),s=Rxe(o);return D.jsx(Ixe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),Nxe=t=>{const{classes:e}=t;return Qe({icon:["sortIcon"]},ln,e)};function Fxe(t,e,n,r){let i;const o={};return e==="asc"?i=t.ColumnSortedAscendingIcon:e==="desc"?i=t.ColumnSortedDescendingIcon:(i=t.ColumnUnsortedIcon,o.sortingOrder=r),i?D.jsx(i,O({fontSize:"small",className:n},o)):null}function Oxe(t){const{direction:e,index:n,sortingOrder:r}=t,i=Lt(),o=mt(),s=O({},t,{classes:o.classes}),a=Nxe(s),l=Fxe(o.components,e,a.icon,r);if(!l)return null;const u=D.jsx(io,{tabIndex:-1,"aria-label":i.current.getLocaleText("columnHeaderSortIconLabel"),title:i.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",children:l});return D.jsxs(Wj,{children:[n!=null&&D.jsx(VI,{badgeContent:n,color:"default",children:u}),n==null&&u]})}const kxe=E.memo(Oxe),Lxe=t=>{const{classes:e,open:n}=t;return Qe({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},ln,e)},Bxe=E.memo(t=>{const{column:e,open:n,columnMenuId:r,columnMenuButtonId:i,iconButtonRef:o}=t,s=Lt(),a=mt(),l=O({},t,{classes:a.classes}),u=Lxe(l),c=E.useCallback(d=>{d.preventDefault(),d.stopPropagation(),s.current.toggleColumnMenu(e.field)},[s,e.field]);return D.jsx("div",{className:u.root,children:D.jsx(io,{ref:o,tabIndex:-1,className:u.button,"aria-label":s.current.getLocaleText("columnMenuLabel"),title:s.current.getLocaleText("columnMenuLabel"),size:"small",onClick:c,"aria-expanded":n?"true":void 0,"aria-haspopup":"true","aria-controls":r,id:i,children:D.jsx(a.components.ColumnMenuIcon,{fontSize:"small"})})})});function $xe({columnMenuId:t,columnMenuButtonId:e,ContentComponent:n,contentComponentProps:r,field:i,open:o,target:s,onExited:a}){const l=Lt(),u=l.current.getColumn(i),c=E.useCallback(d=>{d.stopPropagation(),l.current.hideColumnMenu()},[l]);return s?D.jsx(_E,{placement:`bottom-${u.align==="right"?"start":"end"}`,open:o,target:s,onClickAway:c,onExited:a,children:D.jsx(n,O({currentColumn:u,hideMenu:c,open:o,id:t,labelledby:e},r))}):null}function zxe(t){return t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth}function Uxe(t,e){return t.closest(`.${e}`)}function CN(t){return t.replace(/["\\]/g,"\\$&")}function Hxe(t,e){return t.querySelector(`[role="columnheader"][data-field="${CN(e)}"]`)}function qj(t){return`.${Ie.row}[data-id="${CN(String(t))}"]`}function Vxe(t,e){return t.querySelector(qj(e))}function Gxe(t,{id:e,field:n}){const r=qj(e),i=`.${Ie.cell}[data-field="${CN(n)}"]`,o=`${r} ${i}`;return t.querySelector(o)}const jxe=["className"],Wxe=t=>{const{classes:e}=t;return Qe({root:["columnHeaderTitle"]},ln,e)},qxe=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(t,e)=>e.columnHeaderTitle})(({theme:t})=>({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:t.typography.fontWeightMedium})),Xxe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,jxe),o=mt(),s=Wxe(o);return D.jsx(qxe,O({ref:n,className:vn(s.root,r),ownerState:o},i))});function Kxe(t){var e;const{label:n,description:r,columnWidth:i}=t,o=mt(),s=E.useRef(null),[a,l]=E.useState("");return E.useEffect(()=>{if(!r&&s&&s.current){const u=zxe(s.current);l(u?n:"")}},[s,i,r,n]),D.jsx(o.components.BaseTooltip,O({title:r||a},(e=o.componentsProps)==null?void 0:e.baseTooltip,{children:D.jsx(Xxe,{ref:s,children:n})}))}const Yxe=["resizable","resizing","height","side"];var TD;(function(t){t.Left="left",t.Right="right"})(TD||(TD={}));const Zxe=t=>{const{resizable:e,resizing:n,classes:r,side:i}=t,o={root:["columnSeparator",e&&"columnSeparator--resizable",n&&"columnSeparator--resizing",i&&`columnSeparator--side${Ge(i)}`],icon:["iconSeparator"]};return Qe(o,ln,r)};function Qxe(t){const{height:e,side:n=TD.Right}=t,r=Be(t,Yxe),i=mt(),o=O({},t,{side:n,classes:i.classes}),s=Zxe(o),a=E.useCallback(l=>{l.preventDefault(),l.stopPropagation()},[]);return D.jsx("div",O({className:s.root,style:{minHeight:e,opacity:i.showColumnRightBorder?0:1}},r,{onClick:a,children:D.jsx(i.components.ColumnResizeIcon,{className:s.icon})}))}const Jxe=E.memo(Qxe),ewe=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","disableHeaderSeparator"],Xj=E.forwardRef(function(e,n){const{classes:r,columnMenuOpen:i,colIndex:o,height:s,isResizing:a,sortDirection:l,hasFocus:u,tabIndex:c,separatorSide:d,isDraggable:f,headerComponent:h,description:p,width:g,columnMenuIconButton:b=null,columnMenu:m=null,columnTitleIconButtons:w=null,headerClassName:x,label:_,resizable:C,draggableContainerProps:S,columnHeaderSeparatorProps:M,disableHeaderSeparator:P}=e,A=Be(e,ewe),R=Lt(),F=mt(),$=E.useRef(null),[j,k]=E.useState(i),U=An($,n);let G="none";return l!=null&&(G=l==="asc"?"ascending":"descending"),E.useEffect(()=>{j||k(i)},[j,i]),E.useLayoutEffect(()=>{const B=R.current.state.columnMenu;if(u&&!B.open){const N=$.current.querySelector('[tabindex="0"]')||$.current;N==null||N.focus(),R.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[R,u]),D.jsxs("div",O({ref:U,className:vn(r.root,x),style:{height:s,width:g,minWidth:g,maxWidth:g},role:"columnheader",tabIndex:c,"aria-colindex":o+1,"aria-sort":G,"aria-label":h==null?_:void 0},A,{children:[D.jsxs("div",O({className:r.draggableContainer,draggable:f},S,{children:[D.jsxs("div",{className:r.titleContainer,children:[D.jsx("div",{className:r.titleContainerContent,children:h!==void 0?h:D.jsx(Kxe,{label:_,description:p,columnWidth:g})}),w]}),b]})),!P&&D.jsx(Jxe,O({resizable:!F.disableColumnResize&&!!C,resizing:a,height:s,side:d},M)),m]}))}),twe=t=>{const{column:e,classes:n,isDragging:r,sortDirection:i,showRightBorder:o,filterItemsCounter:s}=t,a=i!=null,l=s!=null&&s>0,u=e.type==="number",c={root:["columnHeader",e.headerAlign==="left"&&"columnHeader--alignLeft",e.headerAlign==="center"&&"columnHeader--alignCenter",e.headerAlign==="right"&&"columnHeader--alignRight",e.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",a&&"columnHeader--sorted",l&&"columnHeader--filtered",u&&"columnHeader--numeric",o&&"withBorder"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Qe(c,ln,n)};function nwe(t){var e,n,r,i,o;const{column:s,columnMenuOpen:a,colIndex:l,headerHeight:u,isResizing:c,isLastColumn:d,sortDirection:f,sortIndex:h,filterItemsCounter:p,hasFocus:g,tabIndex:b,extendRowFullWidth:m,disableReorder:w,separatorSide:x}=t,_=Lt(),C=mt(),S=E.useRef(null),M=jn(),P=jn(),A=E.useRef(null),[R,F]=E.useState(a),{hasScrollX:$,hasScrollY:j}=(e=_.current.getRootDimensions())!=null?e:{hasScrollX:!1,hasScrollY:!1},k=E.useMemo(()=>!C.disableColumnReorder&&!w&&!s.disableReorder,[C.disableColumnReorder,w,s.disableReorder]);let U;s.renderHeader&&(U=s.renderHeader(_.current.getColumnHeaderParams(s.field)));const B=d?!(d&&$&&!j)&&!m:C.showColumnRightBorder,L=O({},t,{classes:C.classes,showRightBorder:B}),N=twe(L),W=E.useCallback(Oe=>re=>{re.currentTarget.contains(re.target)&&_.current.publishEvent(Oe,_.current.getColumnHeaderParams(s.field),re)},[_,s.field]),K=E.useMemo(()=>({onClick:W("columnHeaderClick"),onDoubleClick:W("columnHeaderDoubleClick"),onMouseOver:W("columnHeaderOver"),onMouseOut:W("columnHeaderOut"),onMouseEnter:W("columnHeaderEnter"),onMouseLeave:W("columnHeaderLeave"),onKeyDown:W("columnHeaderKeyDown"),onFocus:W("columnHeaderFocus"),onBlur:W("columnHeaderBlur")}),[W]),Q=E.useMemo(()=>k?{onDragStart:W("columnHeaderDragStart"),onDragEnter:W("columnHeaderDragEnter"),onDragOver:W("columnHeaderDragOver"),onDragEnd:W("columnHeaderDragEnd")}:{},[k,W]),J=E.useMemo(()=>({onMouseDown:W("columnSeparatorMouseDown")}),[W]);E.useEffect(()=>{R||F(a)},[R,a]);const ae=E.useCallback(()=>{F(!1)},[]),ve=!C.disableColumnMenu&&!s.disableColumnMenu&&D.jsx(Bxe,{column:s,columnMenuId:M,columnMenuButtonId:P,open:R,iconButtonRef:A}),fe=D.jsx($xe,{columnMenuId:M,columnMenuButtonId:P,field:s.field,open:a,target:A.current,ContentComponent:C.components.ColumnMenu,contentComponentProps:(n=C.componentsProps)==null?void 0:n.columnMenu,onExited:ae}),Me=(r=s.sortingOrder)!=null?r:C.sortingOrder,ye=D.jsxs(E.Fragment,{children:[!C.disableColumnFilter&&D.jsx(C.components.ColumnHeaderFilterIconButton,O({field:s.field,counter:p},(i=C.componentsProps)==null?void 0:i.columnHeaderFilterIconButton)),s.sortable&&!s.hideSortIcons&&D.jsx(kxe,{direction:f,index:h,sortingOrder:Me})]});E.useLayoutEffect(()=>{const Oe=_.current.state.columnMenu;if(g&&!Oe.open){const _e=S.current.querySelector('[tabindex="0"]')||S.current;_e==null||_e.focus(),_.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[_,g]);const we=typeof s.headerClassName=="function"?s.headerClassName({field:s.field,colDef:s}):s.headerClassName,Fe=(o=s.headerName)!=null?o:s.field;return D.jsx(Xj,O({ref:S,classes:N,columnMenuOpen:a,colIndex:l,height:u,isResizing:c,sortDirection:f,hasFocus:g,tabIndex:b,separatorSide:x,isDraggable:k,headerComponent:U,description:s.description,elementId:s.field,width:s.computedWidth,columnMenuIconButton:ve,columnTitleIconButtons:ye,headerClassName:we,label:Fe,resizable:!C.disableColumnResize&&!!s.resizable,"data-field":s.field,columnMenu:fe,draggableContainerProps:Q,columnHeaderSeparatorProps:J},K))}const qm=t=>t.preferencePanel;var Ya;(function(t){t.filters="filters",t.columns="columns"})(Ya||(Ya={}));const rwe=t=>{const{classes:e}=t;return Qe({icon:["filterIcon"]},ln,e)};function iwe(t){var e;const{counter:n,field:r,onClick:i}=t,o=Lt(),s=mt(),a=O({},t,{classes:s.classes}),l=rwe(a),u=E.useCallback(d=>{d.preventDefault(),d.stopPropagation();const{open:f,openedPanelValue:h}=qm(o.current.state);f&&h===Ya.filters?o.current.hideFilterPanel():o.current.showFilterPanel(),i&&i(o.current.getColumnHeaderParams(r),d)},[o,r,i]);if(!n)return null;const c=D.jsx(io,{onClick:u,color:"default","aria-label":o.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,children:D.jsx(s.components.ColumnFilteredIcon,{className:l.icon,fontSize:"small"})});return D.jsx(s.components.BaseTooltip,O({title:o.current.getLocaleText("columnHeaderFiltersTooltipActive")(n),enterDelay:1e3},(e=s.componentsProps)==null?void 0:e.baseTooltip,{children:D.jsxs(Wj,{children:[n>1&&D.jsx(VI,{badgeContent:n,color:"default",children:c}),n===1&&c]})}))}const owe=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","getValue","api"],swe=t=>{const{classes:e}=t;return Qe({root:["checkboxInput"]},ln,e)},awe=E.forwardRef(function(e,n){var r;const{field:i,id:o,value:s,rowNode:a,hasFocus:l,tabIndex:u}=e,c=Be(e,owe),d=Lt(),f=mt(),h={classes:f.classes},p=swe(h),g=E.useRef(null),b=E.useRef(),m=An(g,n),w=d.current.getCellElement(o,i),x=M=>{const P={value:M.target.checked,id:o};d.current.publishEvent("rowSelectionCheckboxChange",P,M)};E.useLayoutEffect(()=>{u===0&&w&&(w.tabIndex=-1)},[w,u]),E.useEffect(()=>{if(l){var M;const P=(M=g.current)==null?void 0:M.querySelector("input");P==null||P.focus({preventScroll:!0})}else b.current&&b.current.stop({})},[l]);const _=E.useCallback(M=>{jj(M.key)&&M.stopPropagation(),xb(M.key)&&!M.shiftKey&&d.current.publishEvent("cellNavigationKeyDown",e,M)},[d,e]);if(a.position==="footer")return null;const C=d.current.isRowSelectable(o),S=d.current.getLocaleText(s?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return a.isPinned?null:D.jsx(f.components.BaseCheckbox,O({ref:m,tabIndex:u,checked:s,onChange:x,className:p.root,inputProps:{"aria-label":S},onKeyDown:_,disabled:!C,touchRippleRef:b},(r=f.componentsProps)==null?void 0:r.baseCheckbox,c))}),lwe=awe,Qs=t=>t.selection,uwe=wt(Qs,t=>t.length),cwe=wt(Qs,ym,(t,e)=>new Map(t.map(n=>[n,e[n]]))),mS=wt(Qs,t=>t.reduce((e,n)=>(e[n]=n,e),{})),vg=t=>t.pagination,X0=wt(vg,t=>t.page),xv=wt(vg,t=>t.pageSize);wt(vg,t=>t.pageCount);const EN=wt(vg,$c,mN,Ku,Pj,(t,e,n,r,i)=>{const o=i.length,s=Math.min(t.pageSize*t.page,o-1),a=Math.min(s+t.pageSize-1,o-1);if(s===-1||a===-1)return null;if(n<2)return{firstRowIndex:s,lastRowIndex:a};const l=i[s],u=a-s+1,c=r.findIndex(h=>h.id===l.id);let d=c,f=0;for(;d0)&&(d+=1),p===0&&(f+=1)}return{firstRowIndex:c,lastRowIndex:d-1}}),dwe=wt(Ku,EN,(t,e)=>e?t.slice(e.firstRowIndex,e.lastRowIndex+1):[]),Kj=wt(bv,EN,(t,e)=>e?t.slice(e.firstRowIndex,e.lastRowIndex+1):[]),fwe=["field","colDef"],hwe=t=>{const{classes:e}=t;return Qe({root:["checkboxInput"]},ln,e)},pwe=E.forwardRef(function(e,n){var r;const i=Be(e,fwe),[,o]=E.useState(!1),s=Lt(),a=mt(),l={classes:a.classes},u=hwe(l),c=gt(s,$j),d=gt(s,Qs),f=gt(s,bv),h=gt(s,Kj),p=E.useMemo(()=>typeof a.isRowSelectable!="function"?d:d.filter(P=>s.current.getRow(P)?a.isRowSelectable(s.current.getRowParams(P)):!1),[s,a.isRowSelectable,d]),g=E.useMemo(()=>(!a.pagination||!a.checkboxSelectionVisibleOnly?f:h).reduce((A,R)=>(A[R]=!0,A),{}),[a.pagination,a.checkboxSelectionVisibleOnly,h,f]),b=E.useMemo(()=>p.filter(P=>g[P]).length,[p,g]),m=b>0&&b0,x=P=>{const A={value:P.target.checked};s.current.publishEvent("headerSelectionCheckboxChange",A)},_=c!==null&&c.field===e.field?0:-1;E.useLayoutEffect(()=>{const P=s.current.getColumnHeaderElement(e.field);_===0&&P&&(P.tabIndex=-1)},[_,s,e.field]);const C=E.useCallback(P=>{P.key===" "&&s.current.publishEvent("headerSelectionCheckboxChange",{value:!w}),xb(P.key)&&!P.shiftKey&&s.current.publishEvent("columnHeaderNavigationKeyDown",e,P)},[s,e,w]),S=E.useCallback(()=>{o(P=>!P)},[]);E.useEffect(()=>s.current.subscribeEvent("selectionChange",S),[s,S]);const M=s.current.getLocaleText(w?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return D.jsx(a.components.BaseCheckbox,O({ref:n,indeterminate:m,checked:w,onChange:x,className:u.root,inputProps:{"aria-label":M},tabIndex:_,onKeyDown:C},(r=a.componentsProps)==null?void 0:r.baseCheckbox,i))}),mwe=t=>{const{onClick:e}=t,n=Lt(),r=mt(),i=E.useCallback(o=>{e(o),n.current.showPreferences(Ya.columns)},[n,e]);return r.disableColumnSelector?null:D.jsx(wn,{onClick:i,children:n.current.getLocaleText("columnMenuShowColumns")})},gwe=t=>{const{column:e,onClick:n}=t,r=Lt(),i=mt(),o=E.useCallback(s=>{n(s),r.current.showFilterPanel(e==null?void 0:e.field)},[r,e==null?void 0:e.field,n]);return i.disableColumnFilter||!(e!=null&&e.filterable)?null:D.jsx(wn,{onClick:o,children:r.current.getLocaleText("columnMenuFilter")})},vwe=["hideMenu","currentColumn","open","id","labelledby","className","children"],ywe=E.forwardRef(function(e,n){const{hideMenu:r,open:i,id:o,labelledby:s,className:a,children:l}=e,u=Be(e,vwe),c=E.useCallback(d=>{xE(d.key)&&d.preventDefault(),SN(d.key)&&r(d)},[r]);return D.jsx(ub,O({id:o,ref:n,className:vn(Ie.menuList,a),"aria-labelledby":s,onKeyDown:c,autoFocus:i},u,{children:l}))}),bwe=Qa(["MUI: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),Yj=(t,e)=>e&&t.length>1?(bwe(),[t[0]]):t,c8=(t,e)=>n=>O({},n,{sorting:O({},n.sorting,{sortModel:Yj(t,e)})}),xwe=t=>t==="desc",wwe=(t,e)=>{const n=e.current.getColumn(t.field);if(!n)return null;const r=xwe(t.sort)?(...o)=>-1*n.sortComparator(...o):n.sortComparator;return{getSortCellParams:o=>({id:o,field:n.field,rowNode:e.current.getRowNode(o),value:e.current.getCellValue(o,n.field),api:e.current}),comparator:r}},_we=(t,e,n)=>t.reduce((r,i,o)=>{if(r!==0)return r;const s=e.params[o],a=n.params[o];return r=i.comparator(s.value,a.value,s,a),r},0),Swe=(t,e)=>{const n=t.map(r=>wwe(r,e)).filter(r=>!!r);return n.length===0?null:r=>r.map(i=>({node:i,params:n.map(o=>o.getSortCellParams(i.id))})).sort((i,o)=>_we(n,i,o)).map(i=>i.node.id)},d8=(t,e)=>{const n=t.indexOf(e);return!e||n===-1||n+1===t.length?t[0]:t[n+1]},MN=(t,e)=>t==null&&e!=null?-1:e==null&&t!=null?1:t==null&&e==null?0:null,Cwe=new Intl.Collator,Ewe=(t,e)=>{const n=MN(t,e);return n!==null?n:typeof t=="string"?Cwe.compare(t.toString(),e.toString()):t-e},Zj=(t,e)=>{const n=MN(t,e);return n!==null?n:Number(t)-Number(e)},Qj=(t,e)=>{const n=MN(t,e);return n!==null?n:t>e?1:tMath.max(e,Math.min(n,t));function qa(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;if(Array.isArray(t)){const i=t.length;if(i!==e.length)return!1;for(let o=0;o{let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function Pwe(t,e,n){const r=Awe(t);return()=>e+(n-e)*r()}function eW(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))}const Dwe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"];function tW(t){const{item:e,applyValue:n,type:r,apiRef:i,focusElementRef:o,color:s,error:a,helperText:l,size:u,variant:c}=t,d=Be(t,Dwe),f={color:s,error:a,helperText:l,size:u,variant:c},[h,p]=E.useState(e.value||[]),g=jn(),b=mt();E.useEffect(()=>{var w;const x=(w=e.value)!=null?w:[];p(x.map(String))},[e.value]);const m=E.useCallback((w,x)=>{p(x.map(String)),n(O({},e,{value:[...x]}))},[n,e]);return D.jsx(ly,O({multiple:!0,freeSolo:!0,options:[],filterOptions:(w,x)=>{const{inputValue:_}=x;return _==null||_===""?[]:[_]},id:g,value:h,onChange:m,renderTags:(w,x)=>w.map((_,C)=>D.jsx(HI,O({variant:"outlined",size:"small",label:_},x({index:C})))),renderInput:w=>{var x;return D.jsx(b.components.BaseTextField,O({},w,{label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:O({},w.InputLabelProps,{shrink:!0}),inputRef:o,type:r||"text"},f,(x=b.componentsProps)==null?void 0:x.baseTextField))}},d))}const Rwe=t=>{if(!t)return null;const e=new RegExp(t_(t),"i");return({value:n})=>n!=null?e.test(n.toString()):!1},Iwe=(t=!1)=>[{value:"contains",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new RegExp(t_(n),"i");return({value:i})=>i!=null?r.test(i.toString()):!1},InputComponent:_l},{value:"equals",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return({value:i})=>i!=null?r.compare(n,i.toString())===0:!1},InputComponent:_l},{value:"startsWith",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new RegExp(`^${t_(n)}.*$`,"i");return({value:i})=>i!=null?r.test(i.toString()):!1},InputComponent:_l},{value:"endsWith",getApplyFilterFn:e=>{if(!e.value)return null;const n=t?e.value:e.value.trim(),r=new RegExp(`.*${t_(n)}$`,"i");return({value:i})=>i!=null?r.test(i.toString()):!1},InputComponent:_l},{value:"isEmpty",getApplyFilterFn:()=>({value:e})=>e===""||e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:e})=>e!==""&&e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const n=t?e.value:e.value.map(i=>i.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return({value:i})=>i!=null?n.some(o=>r.compare(o,i.toString()||"")===0):!1},InputComponent:tW}],sd={width:100,minWidth:50,maxWidth:1/0,hide:!1,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:Ewe,type:"string",align:"left",filterOperators:Iwe(),renderEditCell:j1e,getApplyQuickFilterFn:Rwe},TN="actions",Nwe=O({},sd,{sortable:!1,filterable:!1,aggregable:!1,width:100,align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:dxe,getApplyQuickFilterFn:void 0}),Fwe=["item","applyValue","apiRef","focusElementRef"];function Owe(t){var e,n,r,i;const{item:o,applyValue:s,apiRef:a,focusElementRef:l}=t,u=Be(t,Fwe),[c,d]=E.useState(o.value||""),f=mt(),p=(n=(((e=f.componentsProps)==null?void 0:e.baseSelect)||{}).native)!=null?n:!0,g=p?"option":wn,b=E.useCallback(m=>{const w=m.target.value;d(w),s(O({},o,{value:w}))},[s,o]);return E.useEffect(()=>{d(o.value||"")},[o.value]),D.jsxs(f.components.BaseTextField,O({label:a.current.getLocaleText("filterPanelInputLabel"),value:c,onChange:b,select:!0,variant:"standard",SelectProps:O({native:p,displayEmpty:!0},(r=f.componentsProps)==null?void 0:r.baseSelect),InputLabelProps:{shrink:!0},inputRef:l},u,(i=f.componentsProps)==null?void 0:i.baseTextField,{children:[D.jsx(g,{value:"",children:a.current.getLocaleText("filterValueAny")}),D.jsx(g,{value:"true",children:a.current.getLocaleText("filterValueTrue")}),D.jsx(g,{value:"false",children:a.current.getLocaleText("filterValueFalse")})]}))}const kwe=()=>[{value:"is",getApplyFilterFn:t=>{if(!t.value)return null;const e=t.value==="true";return({value:n})=>!!n===e},InputComponent:Owe}];function Lwe({value:t,api:e}){return t?e.getLocaleText("booleanCellTrueLabel"):e.getLocaleText("booleanCellFalseLabel")}const nW=O({},sd,{type:"boolean",align:"center",headerAlign:"center",renderCell:m1e,renderEditCell:b1e,sortComparator:Zj,valueFormatter:Lwe,filterOperators:kwe(),getApplyQuickFilterFn:void 0,aggregable:!1}),yc="__check__",wb=O({},nW,{field:yc,type:"checkboxSelection",width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,valueGetter:t=>mS(t.api.state,t.api.instanceId)[t.id]!==void 0,renderHeader:t=>D.jsx(pwe,O({},t)),renderCell:t=>D.jsx(lwe,O({},t))}),Bwe=["item","applyValue","type","apiRef","focusElementRef","InputProps"],$we=500;function zh(t){var e,n;const{item:r,applyValue:i,type:o,apiRef:s,focusElementRef:a,InputProps:l}=t,u=Be(t,Bwe),c=E.useRef(),[d,f]=E.useState((e=r.value)!=null?e:""),[h,p]=E.useState(!1),g=jn(),b=mt(),m=E.useCallback(w=>{const x=w.target.value;clearTimeout(c.current),f(String(x)),p(!0),c.current=setTimeout(()=>{i(O({},r,{value:x})),p(!1)},$we)},[i,r]);return E.useEffect(()=>()=>{clearTimeout(c.current)},[]),E.useEffect(()=>{var w;const x=(w=r.value)!=null?w:"";f(String(x))},[r.value]),D.jsx(b.components.BaseTextField,O({id:g,label:s.current.getLocaleText("filterPanelInputLabel"),placeholder:s.current.getLocaleText("filterPanelInputPlaceholder"),value:d,onChange:m,variant:"standard",type:o||"text",InputLabelProps:{shrink:!0},inputRef:a,InputProps:O({},h?{endAdornment:D.jsx(wN,{})}:{},l,{inputProps:O({max:o==="datetime-local"?"9999-12-31T23:59":"9999-12-31"},l==null?void 0:l.inputProps)})},u,(n=b.componentsProps)==null?void 0:n.baseTextField))}const zwe=/(\d+)-(\d+)-(\d+)/,Uwe=/(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;function Uh(t,e,n,r){if(!t.value)return null;const[i,o,s,a,l]=t.value.match(n?Uwe:zwe).slice(1).map(Number),u=new Date(i,o-1,s,a||0,l||0).getTime();return({value:c})=>{if(!c)return!1;const d=c instanceof Date?c:new Date(c.toString());if(r)return e(d.getTime(),u);const h=(c instanceof Date?new Date(d):d).setHours(n?d.getHours():0,n?d.getMinutes():0,0,0);return e(h,u)}}const rW=t=>[{value:"is",getApplyFilterFn:e=>Uh(e,(n,r)=>n===r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"not",getApplyFilterFn:e=>Uh(e,(n,r)=>n!==r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"after",getApplyFilterFn:e=>Uh(e,(n,r)=>n>r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:e=>Uh(e,(n,r)=>n>=r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"before",getApplyFilterFn:e=>Uh(e,(n,r)=>nUh(e,(n,r)=>n<=r,t),InputComponent:zh,InputComponentProps:{type:t?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>({value:e})=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:e})=>e!=null,requiresFilterValue:!1}];function Hwe({value:t}){return t instanceof Date?t.toLocaleDateString():t??""}function Vwe({value:t}){return t instanceof Date?t.toLocaleString():t??""}const Gwe=O({},sd,{type:"date",sortComparator:Qj,valueFormatter:Hwe,filterOperators:rW(),renderEditCell:zj,getApplyQuickFilterFn:void 0}),jwe=O({},sd,{type:"dateTime",sortComparator:Qj,valueFormatter:Vwe,filterOperators:rW(!0),renderEditCell:zj,getApplyQuickFilterFn:void 0}),Cc=t=>t==null?null:Number(t),Wwe=t=>t==null||Number.isNaN(t)||t===""?null:({value:e})=>Cc(e)===Cc(t),qwe=()=>[{label:"=",value:"=",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>Cc(e)===t.value,InputComponent:_l,InputComponentProps:{type:"number"}},{label:"!=",value:"!=",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>Cc(e)!==t.value,InputComponent:_l,InputComponentProps:{type:"number"}},{label:">",value:">",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)>t.value,InputComponent:_l,InputComponentProps:{type:"number"}},{label:">=",value:">=",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)>=t.value,InputComponent:_l,InputComponentProps:{type:"number"}},{label:"<",value:"<",getApplyFilterFn:t=>t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)t.value==null||Number.isNaN(t.value)?null:({value:e})=>e==null?!1:Cc(e)<=t.value,InputComponent:_l,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>({value:t})=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>({value:t})=>t!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>!Array.isArray(t.value)||t.value.length===0?null:({value:e})=>e!=null&&t.value.includes(Number(e)),InputComponent:tW,InputComponentProps:{type:"number"}}],Xwe=O({},sd,{type:"number",align:"right",headerAlign:"right",sortComparator:Zj,valueParser:t=>t===""?null:Number(t),valueFormatter:({value:t})=>Mwe(t)?t.toLocaleString():t||"",filterOperators:qwe(),getApplyQuickFilterFn:Wwe}),Kwe=["item","applyValue","type","apiRef","focusElementRef"],Ywe=({valueOptions:t,valueFormatter:e,field:n},r,i)=>(typeof t=="function"?["",...t({field:n})]:["",...t||[]]).map(s=>{const a=typeof s=="object",l=a?s.value:s,u=a?s.value:s,c=e&&s!==""?e({value:s,field:n,api:r}):s,d=a?s.label:c;return D.jsx(i,{value:u,children:d},l)});function f8(t){var e,n,r,i,o;const{item:s,applyValue:a,type:l,apiRef:u,focusElementRef:c}=t,d=Be(t,Kwe),[f,h]=E.useState((e=s.value)!=null?e:""),p=jn(),g=mt(),m=(r=(((n=g.componentsProps)==null?void 0:n.baseSelect)||{}).native)!=null?r:!0,w=s.columnField?u.current.getColumn(s.columnField):null,x=E.useMemo(()=>{if(w!==null)return typeof w.valueOptions=="function"?w.valueOptions({field:w.field}):w.valueOptions},[w]),_=E.useCallback(C=>{let S=C.target.value;S=pS(S,x),h(String(S)),a(O({},s,{value:S}))},[a,s,x]);return E.useEffect(()=>{var C;let S;if(x!==void 0){if(S=pS(s.value,x),S!==s.value){a(O({},s,{value:S}));return}}else S=s.value;S=(C=S)!=null?C:"",h(String(S))},[s,x,a]),D.jsx(g.components.BaseTextField,O({id:p,label:u.current.getLocaleText("filterPanelInputLabel"),placeholder:u.current.getLocaleText("filterPanelInputPlaceholder"),value:f,onChange:_,variant:"standard",type:l||"text",InputLabelProps:{shrink:!0},inputRef:c,select:!0,SelectProps:O({native:m},(i=g.componentsProps)==null?void 0:i.baseSelect)},d,(o=g.componentsProps)==null?void 0:o.baseTextField,{children:Ywe(u.current.getColumn(s.columnField),u.current,m?"option":wn)}))}const Zwe=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"],Qwe=(t,e)=>zc(t)===zc(e),Jwe=qV();function e_e(t){const{item:e,applyValue:n,apiRef:r,focusElementRef:i,color:o,error:s,helperText:a,size:l,variant:u="standard"}=t,c=Be(t,Zwe),d={color:o,error:s,helperText:a,size:l,variant:u},f=jn(),h=mt(),p=e.columnField?r.current.getColumn(e.columnField):null,g=E.useMemo(()=>p!=null&&p.valueOptions?typeof p.valueOptions=="function"?p.valueOptions({field:p.field}):p.valueOptions:[],[p]),b=E.useMemo(()=>g==null?void 0:g.map(zc),[g]),{valueFormatter:m,field:w}=r.current.getColumn(e.columnField),x=S=>typeof S=="object"?S.label:m&&S!==""?m({value:S,field:w,api:r.current}):S,_=E.useMemo(()=>Array.isArray(e.value)?g!==void 0?e.value.map(M=>{const P=zc(M);return(b==null?void 0:b.findIndex(R=>R===P))||0}).filter(M=>M>=0).map(M=>g[M]):e.value:[],[e.value,g,b]);E.useEffect(()=>{(!Array.isArray(e.value)||_.length!==e.value.length)&&n(O({},e,{value:_.map(zc)}))},[e,_,n]);const C=E.useCallback((S,M)=>{n(O({},e,{value:[...M.map(zc)]}))},[n,e]);return D.jsx(ly,O({multiple:!0,options:g,isOptionEqualToValue:Qwe,filterOptions:Jwe,id:f,value:_,onChange:C,renderTags:(S,M)=>S.map((P,A)=>D.jsx(HI,O({variant:"outlined",size:"small",label:x(P)},M({index:A})))),renderInput:S=>{var M;return D.jsx(h.components.BaseTextField,O({},S,{label:r.current.getLocaleText("filterPanelInputLabel"),placeholder:r.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:O({},S.InputLabelProps,{shrink:!0}),inputRef:i,type:"singleSelect"},d,(M=h.componentsProps)==null?void 0:M.baseTextField))}},c))}const Ec=t=>t==null||typeof t!="object"?t:t.value,t_e=(t,e,n)=>{if(!t)return null;const{valueOptions:r,valueFormatter:i,field:o}=e,s=[Ec(t).toString()],a=typeof r=="function"?r({field:o}):r||[];return a&&a.forEach(l=>{let u,c;typeof l=="object"?(u=l.value,c=l.label):(u=l,i?c=i({value:l,field:o,api:n.current}):c=l),c.slice(0,t.length).toLowerCase()===t.toLowerCase()&&(s.includes(u)||s.push(u.toString()))}),({value:l})=>l!=null?s.includes(Ec(l).toString()):!1},n_e=()=>[{value:"is",getApplyFilterFn:t=>t.value==null||t.value===""?null:({value:e})=>Ec(e)===Ec(t.value),InputComponent:f8},{value:"not",getApplyFilterFn:t=>t.value==null||t.value===""?null:({value:e})=>Ec(e)!==Ec(t.value),InputComponent:f8},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const e=t.value.map(Ec);return({value:n})=>e.includes(Ec(n))},InputComponent:e_e}],r_e=O({},sd,{type:"singleSelect",renderEditCell:rxe,filterOperators:n_e(),getApplyQuickFilterFn:t_e}),gS="__default__",i_e=()=>({string:sd,number:Xwe,date:Gwe,dateTime:jwe,boolean:nW,singleSelect:r_e,[TN]:Nwe,[gS]:sd}),iW=["maxWidth","minWidth","width","flex"],oW=(t={})=>{const e=O({},i_e());return Object.entries(t).forEach(([n,r])=>{e[n]?e[n]=O({},e[n],r):e[n]=O({},e[r.extendType||gS],r)}),e};function o_e({initialFreeSpace:t,totalFlexUnits:e,flexColumns:n}){const r={all:{},frozenFields:[],freeze:o=>{const s=r.all[o];s&&s.frozen!==!0&&(r.all[o].frozen=!0,r.frozenFields.push(o))}};function i(){if(r.frozenFields.length===n.length)return;const o={min:{},max:{}};let s=t,a=e,l=0;r.frozenFields.forEach(u=>{s-=r.all[u].computedWidth,a-=r.all[u].flex});for(let u=0;uc.maxWidth&&(l+=c.maxWidth-f,f=c.maxWidth,o.max[c.field]=!0),r.all[c.field]={frozen:!1,computedWidth:f,flex:c.flex}}l<0?Object.keys(o.max).forEach(u=>{r.freeze(u)}):l>0?Object.keys(o.min).forEach(u=>{r.freeze(u)}):n.forEach(({field:u})=>{r.freeze(u)}),i()}return i(),r.all}const sW=(t,e)=>{const n={};let r=0,i=0;const o=[];t.all.forEach(a=>{const l=O({},t.lookup[a]);if(t.columnVisibilityModel[a]===!1)l.computedWidth=0;else{let u;l.flex&&l.flex>0?(r+=l.flex,u=0,o.push(l)):u=Xm(l.width,l.minWidth,l.maxWidth),i+=u,l.computedWidth=u}n[a]=l});const s=Math.max(e-i,0);if(r>0&&e>0){const a=o_e({initialFreeSpace:s,totalFlexUnits:r,flexColumns:o});Object.keys(a).forEach(l=>{n[l].computedWidth=a[l].computedWidth})}return O({},t,{lookup:n})},s_e=(t,e)=>{if(!e)return t;const{orderedFields:n=[],dimensions:r={}}=e,i=Object.keys(r);if(i.length===0&&n.length===0)return t;const o={},s=[];for(let c=0;c!o[c])],l=O({},t.lookup);for(let c=0;c{f[h]=p===-1?1/0:p}),l[d]=f}return{all:a,lookup:l}},a_e=(t,e)=>!e||!t[e]?t[gS]:t[e],gp=({apiRef:t,columnsToUpsert:e,initialState:n,columnTypes:r,currentColumnVisibilityModel:i=Tu(t),shouldRegenColumnVisibilityModelFromColumns:o,keepOnlyColumnsToUpsert:s=!1})=>{var a,l,u,c;const d=!t.current.state.columns;let f;if(d)f={all:[],lookup:{}};else{const _=$f(t.current.state);f={all:s?[]:[..._.all],lookup:O({},_.lookup)}}let h={};s&&!d&&(h=Object.keys(f.lookup).reduce((_,C)=>O({},_,{[C]:!1}),{}));const p={};e.forEach(_=>{const{field:C}=_;p[C]=!0,h[C]=!0;let S=f.lookup[C];S==null?(S=O({},a_e(r,_.type),{field:C,hasBeenResized:!1}),f.all.push(C)):s&&f.all.push(C);let M=S.hasBeenResized;iW.forEach(P=>{_[P]!==void 0&&(M=!0,_[P]===-1&&(_[P]=1/0))}),f.lookup[C]=O({},S,{hide:_.hide==null?!1:_.hide},_,{hasBeenResized:M})}),s&&!d&&Object.keys(f.lookup).forEach(_=>{h[_]||delete f.lookup[_]});const g=O({},f.lookup),b=t.current.unstable_applyPipeProcessors("hydrateColumns",f);let m={};if(o){let _=!1;const C=O({},i);d?b.all.forEach(S=>{C[S]=!f.lookup[S].hide}):s&&Object.keys(C).forEach(S=>{b.lookup[S]||(delete C[S],_=!0)}),b.all.forEach(S=>{if(!p[S]&&g[S]===b.lookup[S])return;let M=i[S];M===void 0&&(d?M=!0:M=!!$f(t.current.state).lookup[S]);const P=!b.lookup[S].hide;P!==M&&(_=!0,C[S]=P)}),_||d?m=C:m=i}else m=i;const w=s_e(b,n),x=O({},w,{columnVisibilityModel:m});return sW(x,(a=(l=(u=t.current).getRootDimensions)==null||(c=l.call(u))==null?void 0:c.viewportInnerSize.width)!=null?a:0)},h8=t=>e=>O({},e,{columns:t});function AD({firstColumnToRender:t,apiRef:e,firstRowToRender:n,lastRowToRender:r,visibleRows:i}){let o=t;for(let s=n;s{const{column:e,onClick:n}=t,r=Lt(),i=mt(),o=E.useRef(),l=lo(r).filter(c=>c.disableColumnMenu!==!0).length===1,u=E.useCallback(c=>{l||(n(c),o.current=setTimeout(()=>{r.current.setColumnVisibility(e==null?void 0:e.field,!1)},100))},[r,e==null?void 0:e.field,n,l]);return E.useEffect(()=>()=>clearTimeout(o.current),[]),i.disableColumnSelector||e.hideable===!1?null:D.jsx(wn,{onClick:u,disabled:l,children:r.current.getLocaleText("columnMenuHideColumn")})};function c_e(t){var e;const{column:n,onClick:r}=t,i=Lt(),o=gt(i,Da),s=mt(),a=(e=n.sortingOrder)!=null?e:s.sortingOrder,l=E.useMemo(()=>{if(!n)return null;const c=o.find(d=>d.field===n.field);return c==null?void 0:c.sort},[n,o]),u=E.useCallback(c=>{r(c);const d=c.currentTarget.getAttribute("data-value")||null;i.current.sortColumn(n,d)},[i,n,r]);return!n||!n.sortable?null:D.jsxs(E.Fragment,{children:[a.includes(null)?D.jsx(wn,{onClick:u,disabled:l==null,children:i.current.getLocaleText("columnMenuUnsort")}):null,a.includes("asc")?D.jsx(wn,{onClick:u,"data-value":"asc",disabled:l==="asc",children:i.current.getLocaleText("columnMenuSortAsc")}):null,a.includes("desc")?D.jsx(wn,{onClick:u,"data-value":"desc",disabled:l==="desc",children:i.current.getLocaleText("columnMenuSortDesc")}):null]})}const d_e=E.forwardRef(function(e,n){const{hideMenu:r,currentColumn:i}=e,o=Lt(),s=[D.jsx(c_e,{onClick:r,column:i}),D.jsx(gwe,{onClick:r,column:i}),D.jsx(u_e,{onClick:r,column:i}),D.jsx(mwe,{onClick:r,column:i})],a=o.current.unstable_applyPipeProcessors("columnMenu",s,i);return D.jsx(ywe,O({ref:n},e,{children:a.map((l,u)=>E.cloneElement(l,{key:u,onClick:r,column:i}))}))}),f_e=["className"],h_e=t=>{const{classes:e}=t;return Qe({root:["panelContent"]},ln,e)},p_e=ze("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(t,e)=>e.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function aW(t){const{className:e}=t,n=Be(t,f_e),r=mt(),i=h_e(r);return D.jsx(p_e,O({className:vn(e,i.root),ownerState:r},n))}const m_e=["className"],g_e=t=>{const{classes:e}=t;return Qe({root:["panelFooter"]},ln,e)},v_e=ze("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(t,e)=>e.panelFooter})(({theme:t})=>({padding:t.spacing(.5),display:"flex",justifyContent:"space-between"}));function lW(t){const{className:e}=t,n=Be(t,m_e),r=mt(),i=g_e(r);return D.jsx(v_e,O({className:vn(e,i.root),ownerState:r},n))}const y_e=["className"],b_e=t=>{const{classes:e}=t;return Qe({root:["panelHeader"]},ln,e)},x_e=ze("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(t,e)=>e.panelHeader})(({theme:t})=>({padding:t.spacing(1)}));function w_e(t){const{className:e}=t,n=Be(t,y_e),r=mt(),i=b_e(r);return D.jsx(x_e,O({className:vn(e,i.root),ownerState:r},n))}const __e=["className","slotProps"],S_e=t=>{const{classes:e}=t;return Qe({root:["panelWrapper"]},ln,e)},C_e=ze("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(t,e)=>e.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),E_e=()=>!0,uW=E.forwardRef(function(e,n){const{className:r,slotProps:i={}}=e,o=Be(e,__e),s=mt(),a=S_e(s);return D.jsx(OV,O({open:!0,disableEnforceFocus:!0,isEnabled:E_e},i.TrapFocus,{children:D.jsx(C_e,O({ref:n,tabIndex:-1,className:vn(r,a.root),ownerState:s},o))}))}),M_e=!1,T_e=["sort","searchPredicate","autoFocusSearchField"],A_e=t=>{const{classes:e}=t;return Qe({root:["columnsPanel"],columnsPanelRow:["columnsPanelRow"]},ln,e)},P_e=ze("div",{name:"MuiDataGrid",slot:"ColumnsPanel",overridesResolver:(t,e)=>e.columnsPanel})({padding:"8px 0px 8px 8px"}),D_e=ze("div",{name:"MuiDataGrid",slot:"ColumnsPanelRow",overridesResolver:(t,e)=>e.columnsPanelRow})(({theme:t})=>({display:"flex",justifyContent:"space-between",padding:"1px 8px 1px 7px",[`& .${no.root}`]:{marginRight:t.spacing(.5)}})),R_e=ze(io)({justifyContent:"flex-end"}),p8=new Intl.Collator,I_e=(t,e)=>(t.headerName||t.field).toLowerCase().indexOf(e)>-1;function N_e(t){var e,n,r;const i=Lt(),o=E.useRef(null),s=gt(i,Wa),a=gt(i,Tu),l=mt(),[u,c]=E.useState(""),d=A_e(l),{sort:f,searchPredicate:h=I_e,autoFocusSearchField:p=!0}=t,g=Be(t,T_e),b=E.useMemo(()=>{switch(f){case"asc":return[...s].sort((P,A)=>p8.compare(P.headerName||P.field,A.headerName||A.field));case"desc":return[...s].sort((P,A)=>-p8.compare(P.headerName||P.field,A.headerName||A.field));default:return s}},[s,f]),m=P=>{const{name:A}=P.target;i.current.setColumnVisibility(A,a[A]===!1)},w=E.useCallback(P=>{if(i.current.unstable_caches.columns.isUsingColumnVisibilityModel){const A=Tu(i),R=O({},A);return s.forEach(F=>{F.hideable&&(P?delete R[F.field]:R[F.field]=!1)}),i.current.setColumnVisibilityModel(R)}return i.current.updateColumns(s.map(A=>A.hideable!==!1?{field:A.field,hide:!P}:A))},[i,s]),x=E.useCallback(P=>{c(P.target.value)},[]),_=E.useMemo(()=>{if(!u)return b;const P=u.toLowerCase();return b.filter(A=>h(A,P))},[b,u,h]),C=E.useRef(null);E.useEffect(()=>{p?o.current.focus():C.current&&typeof C.current.focus=="function"&&C.current.focus()},[p]);let S=!1;const M=P=>S===!1&&P.hideable!==!1?(S=!0,!0):!1;return D.jsxs(uW,O({},g,{children:[D.jsx(w_e,{children:D.jsx(l.components.BaseTextField,O({label:i.current.getLocaleText("columnsPanelTextFieldLabel"),placeholder:i.current.getLocaleText("columnsPanelTextFieldPlaceholder"),inputRef:o,value:u,onChange:x,variant:"standard",fullWidth:!0},(e=l.componentsProps)==null?void 0:e.baseTextField))}),D.jsx(aW,{children:D.jsx(P_e,{className:d.root,ownerState:l,children:_.map(P=>{var A;return D.jsxs(D_e,{className:d.columnsPanelRow,ownerState:l,children:[D.jsx(Bo,{control:D.jsx(l.components.BaseSwitch,O({disabled:P.hideable===!1,checked:a[P.field]!==!1,onClick:m,name:P.field,size:"small",inputRef:M(P)?C:void 0},(A=l.componentsProps)==null?void 0:A.baseSwitch)),label:P.headerName||P.field}),!l.disableColumnReorder&&M_e&&D.jsx(R_e,{draggable:!0,"aria-label":i.current.getLocaleText("columnsPanelDragIconLabel"),title:i.current.getLocaleText("columnsPanelDragIconLabel"),size:"small",disabled:!0,children:D.jsx(Hj,{})})]},P.field)})})}),D.jsxs(lW,{children:[D.jsx(l.components.BaseButton,O({onClick:()=>w(!1)},(n=l.componentsProps)==null?void 0:n.baseButton,{children:i.current.getLocaleText("columnsPanelHideAllButton")})),D.jsx(l.components.BaseButton,O({onClick:()=>w(!0)},(r=l.componentsProps)==null?void 0:r.baseButton,{children:i.current.getLocaleText("columnsPanelShowAllButton")}))]})]}))}const F_e=["children","className","classes"],O_e=At("MuiDataGrid",["panel","paper"]),k_e=ze(Yf,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(t,e)=>e.panel})(({theme:t})=>({zIndex:t.zIndex.modal})),L_e=ze(Xu,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>({backgroundColor:t.palette.background.paper,minWidth:300,maxHeight:450,display:"flex"})),B_e=E.forwardRef((t,e)=>{var n;const{children:r,className:i}=t,o=Be(t,F_e),s=Lt(),a=mt(),l=O_e,[u,c]=E.useState(!1),d=E.useCallback(()=>{s.current.hidePreferences()},[s]),f=E.useCallback(g=>{_N(g.key)&&s.current.hidePreferences()},[s]),h=E.useMemo(()=>[{name:"flip",enabled:!1},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{c(!0)},effect:()=>()=>{c(!1)}}],[]),p=(n=s.current.columnHeadersContainerElementRef)==null?void 0:n.current;return p?D.jsx(k_e,O({ref:e,placement:"bottom-start",className:vn(i,l.panel),ownerState:a,anchorEl:p,modifiers:h},o,{children:D.jsx(FV,{mouseEvent:"onMouseUp",onClickAway:d,children:D.jsx(L_e,{className:l.paper,ownerState:a,elevation:8,onKeyDown:f,children:u&&r})})})):null}),$_e=E.forwardRef(function(e,n){var r,i,o;const s=Lt(),a=gt(s,Wa),l=mt(),u=gt(s,qm),c=s.current.unstable_applyPipeProcessors("preferencePanel",null,(r=u.openedPanelValue)!=null?r:Ya.filters);return D.jsx(l.components.Panel,O({ref:n,as:l.components.BasePopper,open:a.length>0&&u.open},(i=l.componentsProps)==null?void 0:i.panel,e,(o=l.componentsProps)==null?void 0:o.basePopper,{children:c}))}),z_e=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","multiFilterOperator","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","linkOperators","columnsSort","deleteIconProps","linkOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","children"],U_e=["InputComponentProps"],H_e=t=>{const{classes:e}=t;return Qe({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],linkOperatorInput:["filterFormLinkOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},ln,e)},V_e=ze("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(t,e)=>e.filterForm})(({theme:t})=>({display:"flex",padding:t.spacing(1)})),G_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(t,e)=>e.filterFormDeleteIcon})(({theme:t})=>({flexShrink:0,justifyContent:"flex-end",marginRight:t.spacing(.5),marginBottom:t.spacing(.2)})),j_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormLinkOperatorInput",overridesResolver:(t,e)=>e.filterFormLinkOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),W_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(t,e)=>e.filterFormColumnInput})({width:150}),q_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(t,e)=>e.filterFormOperatorInput})({width:120}),X_e=ze(Ai,{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(t,e)=>e.filterFormValueInput})({width:190}),K_e=t=>{switch(t){case So.And:return"filterPanelOperatorAnd";case So.Or:return"filterPanelOperatorOr";default:throw new Error("MUI: Invalid `linkOperator` property in the `GridFilterPanel`.")}},g0=t=>t.headerName||t.field,m8=new Intl.Collator,Y_e=E.forwardRef(function(e,n){var r,i,o,s,a,l,u;const{item:c,hasMultipleFilters:d,deleteFilter:f,applyFilterChanges:h,multiFilterOperator:p,showMultiFilterOperators:g,disableMultiFilterOperator:b,applyMultiFilterOperatorChanges:m,focusElementRef:w,linkOperators:x=[So.And,So.Or],columnsSort:_,deleteIconProps:C={},linkOperatorInputProps:S={},operatorInputProps:M={},columnInputProps:P={},valueInputProps:A={}}=e,R=Be(e,z_e),F=Lt(),$=gt(F,bN),j=jn(),k=jn(),U=jn(),G=jn(),B=mt(),L=H_e(B),N=E.useRef(null),W=E.useRef(null),K=d&&x.length>0,Q=((r=B.componentsProps)==null?void 0:r.baseFormControl)||{},ae=(o=(((i=B.componentsProps)==null?void 0:i.baseSelect)||{}).native)!=null?o:!0,ve=ae?"option":wn,{InputComponentProps:fe}=A,Me=Be(A,U_e),ye=E.useMemo(()=>{switch(_){case"asc":return $.sort((X,Z)=>m8.compare(g0(X),g0(Z)));case"desc":return $.sort((X,Z)=>-m8.compare(g0(X),g0(Z)));default:return $}},[$,_]),we=c.columnField?F.current.getColumn(c.columnField):null,Fe=E.useMemo(()=>{var X;return!c.operatorValue||!we?null:(X=we.filterOperators)==null?void 0:X.find(Z=>Z.value===c.operatorValue)},[c,we]),Oe=E.useCallback(X=>{const Z=X.target.value,he=F.current.getColumn(Z);if(he.field===we.field)return;const Y=he.filterOperators.find(se=>se.value===c.operatorValue)||he.filterOperators[0],ne=!Y.InputComponent||Y.InputComponent!==(Fe==null?void 0:Fe.InputComponent);h(O({},c,{columnField:Z,operatorValue:Y.value,value:ne?void 0:c.value}))},[F,h,c,we,Fe]),re=E.useCallback(X=>{const Z=X.target.value,he=we==null?void 0:we.filterOperators.find(ne=>ne.value===Z),Y=!(he!=null&&he.InputComponent)||(he==null?void 0:he.InputComponent)!==(Fe==null?void 0:Fe.InputComponent);h(O({},c,{operatorValue:Z,value:Y?void 0:c.value}))},[h,c,we,Fe]),_e=E.useCallback(X=>{const Z=X.target.value===So.And.toString()?So.And:So.Or;m(Z)},[m]),Ce=()=>{B.disableMultipleColumnsFiltering?c.value===void 0?f(c):h(O({},c,{value:void 0})):f(c)};return E.useImperativeHandle(w,()=>({focus:()=>{if(Fe!=null&&Fe.InputComponent){var X;N==null||(X=N.current)==null||X.focus()}else W.current.focus()}}),[Fe]),D.jsxs(V_e,O({ref:n,className:L.root,ownerState:B},R,{children:[D.jsx(G_e,O({variant:"standard",as:B.components.BaseFormControl},Q,C,{className:vn(L.deleteIcon,Q.className,C.className),ownerState:B,children:D.jsx(io,{"aria-label":F.current.getLocaleText("filterPanelDeleteIconLabel"),title:F.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:Ce,size:"small",children:D.jsx(B.components.FilterPanelDeleteIcon,{fontSize:"small"})})})),D.jsx(j_e,O({variant:"standard",as:B.components.BaseFormControl},Q,S,{sx:O({display:K?"flex":"none",visibility:g?"visible":"hidden"},Q.sx||{},S.sx||{}),className:vn(L.linkOperatorInput,Q.className,S.className),ownerState:B,children:D.jsx(B.components.BaseSelect,O({inputProps:{"aria-label":F.current.getLocaleText("filterPanelLinkOperator")},value:p,onChange:_e,disabled:!!b||x.length===1,native:ae},(s=B.componentsProps)==null?void 0:s.baseSelect,{children:x.map(X=>D.jsx(ve,{value:X.toString(),children:F.current.getLocaleText(K_e(X))},X.toString()))}))})),D.jsxs(W_e,O({variant:"standard",as:B.components.BaseFormControl},Q,P,{className:vn(L.columnInput,Q.className,P.className),ownerState:B,children:[D.jsx(ca,{htmlFor:j,id:k,children:F.current.getLocaleText("filterPanelColumns")}),D.jsx(B.components.BaseSelect,O({labelId:k,id:j,label:F.current.getLocaleText("filterPanelColumns"),value:c.columnField||"",onChange:Oe,native:ae},(a=B.componentsProps)==null?void 0:a.baseSelect,{children:ye.map(X=>D.jsx(ve,{value:X.field,children:g0(X)},X.field))}))]})),D.jsxs(q_e,O({variant:"standard",as:B.components.BaseFormControl},Q,M,{className:vn(L.operatorInput,Q.className,M.className),ownerState:B,children:[D.jsx(ca,{htmlFor:U,id:G,children:F.current.getLocaleText("filterPanelOperators")}),D.jsx(B.components.BaseSelect,O({labelId:G,label:F.current.getLocaleText("filterPanelOperators"),id:U,value:c.operatorValue,onChange:re,native:ae,inputRef:W},(l=B.componentsProps)==null?void 0:l.baseSelect,{children:we==null||(u=we.filterOperators)==null?void 0:u.map(X=>D.jsx(ve,{value:X.value,children:X.label||F.current.getLocaleText(`filterOperator${Ge(X.value)}`)},X.value))}))]})),D.jsx(X_e,O({variant:"standard",as:B.components.BaseFormControl},Q,Me,{className:vn(L.valueInput,Q.className,Me.className),ownerState:B,children:Fe!=null&&Fe.InputComponent?D.jsx(Fe.InputComponent,O({apiRef:F,item:c,applyValue:h,focusElementRef:N},Fe.InputComponentProps,fe)):null}))]}))}),Z_e=["linkOperators","columnsSort","filterFormProps","children"],Q_e=E.forwardRef(function(e,n){var r;const i=Lt(),o=mt(),s=gt(i,Lo),a=gt(i,bN),l=E.useRef(null),{linkOperators:u=[So.And,So.Or],columnsSort:c,filterFormProps:d}=e,f=Be(e,Z_e),h=E.useCallback(_=>{i.current.upsertFilterItem(_)},[i]),p=E.useCallback(_=>{i.current.setFilterLinkOperator(_)},[i]),g=E.useCallback(()=>{const _=a.find(C=>{var S;return(S=C.filterOperators)==null?void 0:S.length});return _?{columnField:_.field,operatorValue:_.filterOperators[0].value,id:Math.round(Math.random()*1e5)}:null},[a]),b=E.useMemo(()=>{if(s.items.length)return s.items;const _=g();return _?[_]:[]},[s.items,g]),m=b.length>1,w=()=>{const _=g();_&&i.current.upsertFilterItems([...b,_])},x=E.useCallback(_=>{const C=b.length===1;i.current.deleteFilterItem(_),C&&i.current.hideFilterPanel()},[i,b.length]);return E.useEffect(()=>{u.length>0&&s.linkOperator&&!u.includes(s.linkOperator)&&p(u[0])},[u,p,s.linkOperator]),E.useEffect(()=>{b.length>0&&l.current.focus()},[b.length]),D.jsxs(uW,O({ref:n},f,{children:[D.jsx(aW,{children:b.map((_,C)=>D.jsx(Y_e,O({item:_,applyFilterChanges:h,deleteFilter:x,hasMultipleFilters:m,showMultiFilterOperators:C>0,multiFilterOperator:s.linkOperator,disableMultiFilterOperator:C!==1,applyMultiFilterOperatorChanges:p,focusElementRef:C===b.length-1?l:null,linkOperators:u,columnsSort:c},d),_.id==null?C:_.id))}),!o.disableMultipleColumnsFiltering&&D.jsx(lW,{children:D.jsx(o.components.BaseButton,O({onClick:w,startIcon:D.jsx(Uj,{})},(r=o.componentsProps)==null?void 0:r.baseButton,{children:i.current.getLocaleText("filterPanelAddFilter")}))})]}))}),J_e=["onClick"],eSe=E.forwardRef(function(e,n){var r;const{onClick:i}=e,o=Be(e,J_e),s=Lt(),a=mt(),{open:l,openedPanelValue:u}=gt(s,qm),c=d=>{l&&u===Ya.columns?s.current.hidePreferences():s.current.showPreferences(Ya.columns),i==null||i(d)};return a.disableColumnSelector?null:D.jsx(a.components.BaseButton,O({ref:n,size:"small","aria-label":s.current.getLocaleText("toolbarColumnsLabel"),startIcon:D.jsx(a.components.ColumnSelectorIcon,{})},o,{onClick:c},(r=a.componentsProps)==null?void 0:r.baseButton,{children:s.current.getLocaleText("toolbarColumns")}))}),tSe=["onClick"],nSe=E.forwardRef(function(e,n){var r;const{onClick:i}=e,o=Be(e,tSe),s=Lt(),a=mt(),l=gt(s,Nj),u=jn(),c=jn(),[d,f]=E.useState(!1),h=E.useRef(null),p=An(n,h),g=[{icon:D.jsx(a.components.DensityCompactIcon,{}),label:s.current.getLocaleText("toolbarDensityCompact"),value:Cl.Compact},{icon:D.jsx(a.components.DensityStandardIcon,{}),label:s.current.getLocaleText("toolbarDensityStandard"),value:Cl.Standard},{icon:D.jsx(a.components.DensityComfortableIcon,{}),label:s.current.getLocaleText("toolbarDensityComfortable"),value:Cl.Comfortable}],b=E.useMemo(()=>{switch(l){case Cl.Compact:return D.jsx(a.components.DensityCompactIcon,{});case Cl.Comfortable:return D.jsx(a.components.DensityComfortableIcon,{});default:return D.jsx(a.components.DensityStandardIcon,{})}},[l,a]),m=S=>{f(M=>!M),i==null||i(S)},w=S=>{var M;h.current===S.target||(M=h.current)!=null&&M.contains(S.target)||f(!1)},x=S=>{s.current.setDensity(S),f(!1)},_=S=>{xE(S.key)&&S.preventDefault(),SN(S.key)&&f(!1)};if(a.disableDensitySelector)return null;const C=g.map((S,M)=>D.jsxs(wn,{onClick:()=>x(S.value),selected:S.value===l,children:[D.jsx(Ude,{children:S.icon}),S.label]},M));return D.jsxs(E.Fragment,{children:[D.jsx(a.components.BaseButton,O({ref:p,size:"small",startIcon:b,"aria-label":s.current.getLocaleText("toolbarDensityLabel"),"aria-expanded":d?"true":void 0,"aria-haspopup":"menu","aria-controls":c,id:u},o,{onClick:m},(r=a.componentsProps)==null?void 0:r.baseButton,{children:s.current.getLocaleText("toolbarDensity")})),D.jsx(_E,{open:d,target:h.current,onClickAway:w,position:"bottom-start",children:D.jsx(ub,{id:c,className:Ie.menuList,"aria-labelledby":u,onKeyDown:_,autoFocusItem:d,children:C})})]})}),rSe=["componentsProps"],iSe=t=>{const{classes:e}=t;return Qe({root:["toolbarFilterList"]},ln,e)},oSe=ze("ul",{name:"MuiDataGrid",slot:"ToolbarFilterList",overridesResolver:(t,e)=>e.toolbarFilterList})(({theme:t})=>({margin:t.spacing(1,1,.5),padding:t.spacing(0,1)})),sSe=E.forwardRef(function(e,n){var r,i;const{componentsProps:o={}}=e,s=Be(e,rSe),a=o.button||{},l=Lt(),u=mt(),c=gt(l,Ij),d=gt(l,th),f=gt(l,qm),h=iSe(u),p=E.useMemo(()=>{if(f.open)return l.current.getLocaleText("toolbarFiltersTooltipHide");if(c.length===0)return l.current.getLocaleText("toolbarFiltersTooltipShow");const b=w=>d[w.columnField].filterOperators.find(x=>x.value===w.operatorValue).label||l.current.getLocaleText(`filterOperator${Ge(w.operatorValue)}`).toString(),m=w=>{const{getValueAsString:x}=d[w.columnField].filterOperators.find(_=>_.value===w.operatorValue);return x?x(w.value):w.value};return D.jsxs("div",{children:[l.current.getLocaleText("toolbarFiltersTooltipActive")(c.length),D.jsx(oSe,{className:h.root,ownerState:u,children:c.map((w,x)=>O({},d[w.columnField]&&D.jsx("li",{children:`${d[w.columnField].headerName||w.columnField} ${b(w)} - ${w.value?m(w):""}`},x)))})]})},[l,u,f.open,c,d,h]),g=b=>{var m;const{open:w,openedPanelValue:x}=f;w&&x===Za.filters?l.current.hideFilterPanel():l.current.showFilterPanel(),(m=a.onClick)==null||m.call(a,b)};return u.disableColumnFilter?null:D.jsx(u.components.BaseTooltip,O({title:p,enterDelay:1e3},s,(r=u.componentsProps)==null?void 0:r.baseTooltip,{children:D.jsx(u.components.BaseButton,O({ref:n,size:"small","aria-label":l.current.getLocaleText("toolbarFiltersLabel"),startIcon:D.jsx(VI,{badgeContent:c.length,color:"primary",children:D.jsx(u.components.OpenFilterButtonIcon,{})})},a,{onClick:g},(i=u.componentsProps)==null?void 0:i.baseButton,{children:l.current.getLocaleText("toolbarFilters")}))}))}),aSe=["children","onClick"],lSe=E.forwardRef(function(e,n){var r;const{children:i,onClick:o}=e,s=Be(e,aSe),a=Lt(),l=mt(),u=jn(),c=jn(),[d,f]=E.useState(!1),h=E.useRef(null),p=An(n,h),g=x=>{f(_=>!_),o==null||o(x)},b=()=>f(!1),m=x=>{xE(x.key)&&x.preventDefault(),SN(x.key)&&b()},w=x=>{var _;h.current===x.target||(_=h.current)!=null&&_.contains(x.target)||f(!1)};return i==null?null:D.jsxs(E.Fragment,{children:[D.jsx(l.components.BaseButton,O({ref:p,size:"small",startIcon:D.jsx(l.components.ExportIcon,{}),"aria-expanded":d?"true":void 0,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-labelledby":c,id:u},s,{onClick:g},(r=l.componentsProps)==null?void 0:r.baseButton,{children:a.current.getLocaleText("toolbarExport")})),D.jsx(_E,{open:d,target:h.current,onClickAway:w,position:"bottom-start",children:D.jsx(ub,{id:c,className:Ie.menuList,"aria-labelledby":u,onKeyDown:m,autoFocusItem:d,children:E.Children.map(i,x=>E.isValidElement(x)?E.cloneElement(x,{hideMenu:b}):x)})})]})}),uSe=["hideMenu","options"],cSe=["hideMenu","options"],dSe=["csvOptions","printOptions","excelOptions"],fSe=t=>{const e=Lt(),{hideMenu:n,options:r}=t,i=Be(t,uSe);return D.jsx(wn,O({onClick:()=>{e.current.exportDataAsCsv(r),n==null||n()}},i,{children:e.current.getLocaleText("toolbarExportCSV")}))},hSe=t=>{const e=Lt(),{hideMenu:n,options:r}=t,i=Be(t,cSe);return D.jsx(wn,O({onClick:()=>{e.current.exportDataAsPrint(r),n==null||n()}},i,{children:e.current.getLocaleText("toolbarExportPrint")}))},pSe=E.forwardRef(function(e,n){const{csvOptions:r={},printOptions:i={},excelOptions:o}=e,s=Be(e,dSe),l=Lt().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:o,csvOptions:r,printOptions:i}).sort((u,c)=>u.componentName>c.componentName?1:-1);return l.length===0?null:D.jsx(lSe,O({},s,{ref:n,children:l.map((u,c)=>E.cloneElement(u.component,{key:c}))}))}),hy=()=>({items:[],linkOperator:So.And,quickFilterValues:[],quickFilterLogicOperator:So.And}),mSe=["quickFilterParser","quickFilterFormatter","debounceMs"],gSe=ze($n,{name:"MuiDataGrid",slot:"ToolbarQuickFilter",overridesResolver:(t,e)=>e.toolbarQuickFilter})(({theme:t})=>({width:"auto",paddingBottom:t.spacing(.5),"& input":{marginLeft:t.spacing(.5)},"& .MuiInput-underline:before":{borderBottom:`1px solid ${t.palette.divider}`},"& input[type=search]::-ms-clear,\n& input[type=search]::-ms-reveal":{display:"none",width:0,height:0},'& input[type="search"]::-webkit-search-decoration,\n & input[type="search"]::-webkit-search-cancel-button,\n & input[type="search"]::-webkit-search-results-button,\n & input[type="search"]::-webkit-search-results-decoration':{display:"none"}})),vSe=t=>t.split(" ").filter(e=>e!==""),ySe=t=>t.join(" ");function bSe(t){var e;const{quickFilterParser:n=vSe,quickFilterFormatter:r=ySe,debounceMs:i=500}=t,o=Be(t,mSe),s=Lt(),a=mt(),l=gt(s,qbe),[u,c]=E.useState(()=>r(l??[])),[d,f]=E.useState(l);E.useEffect(()=>{Xa(d,l)||(f(l),c(m=>Xa(n(m),l)?m:r(l??[])))},[d,l,r,n]);const h=E.useCallback(m=>{s.current.setQuickFilterValues(n(m))},[s,n]),p=E.useMemo(()=>ug(h,i),[h,i]),g=E.useCallback(m=>{const w=m.target.value;c(w),p(w)},[p]),b=E.useCallback(()=>{c(""),h("")},[h]);return D.jsx(gSe,O({as:a.components.BaseTextField,ownerState:a,variant:"standard",value:u,onChange:g,placeholder:s.current.getLocaleText("toolbarQuickFilterPlaceholder"),"aria-label":s.current.getLocaleText("toolbarQuickFilterLabel"),type:"search",InputProps:{startAdornment:D.jsx(a.components.QuickFilterIcon,{fontSize:"small"}),endAdornment:D.jsx(io,{"aria-label":s.current.getLocaleText("toolbarQuickFilterDeleteIconLabel"),size:"small",sx:{visibility:u?"visible":"hidden"},onClick:b,children:D.jsx(a.components.QuickFilterClearIcon,{fontSize:"small"})})}},o,(e=a.componentsProps)==null?void 0:e.baseTextField))}const xSe=["className","csvOptions","printOptions","excelOptions","showQuickFilter","quickFilterProps"],cW=E.forwardRef(function(e,n){const{csvOptions:r,printOptions:i,excelOptions:o,showQuickFilter:s=!1,quickFilterProps:a={}}=e,l=Be(e,xSe),u=mt();return u.disableColumnFilter&&u.disableColumnSelector&&u.disableDensitySelector&&!s?null:D.jsxs(Pxe,O({ref:n},l,{children:[D.jsx(eSe,{}),D.jsx(sSe,{}),D.jsx(nSe,{}),D.jsx(pSe,{csvOptions:r,printOptions:i,excelOptions:o}),D.jsx(pue,{sx:{flex:1}}),s&&D.jsx(bSe,O({},a))]}))}),wSe=["className","rowCount","visibleRowCount"],_Se=t=>{const{classes:e}=t;return Qe({root:["rowCount"]},ln,e)},SSe=ze("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(t,e)=>e.rowCount})(({theme:t})=>({alignItems:"center",display:"flex",margin:t.spacing(0,2)})),CSe=E.forwardRef(function(e,n){const{className:r,rowCount:i,visibleRowCount:o}=e,s=Be(e,wSe),a=Lt(),l=mt(),u=_Se(l);if(i===0)return null;const c=o{const{classes:e}=t;return Qe({root:["selectedRowCount"]},ln,e)},TSe=ze("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(t,e)=>e.selectedRowCount})(({theme:t})=>({alignItems:"center",display:"flex",margin:t.spacing(0,2),visibility:"hidden",width:0,height:0,[t.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),ASe=E.forwardRef(function(e,n){const{className:r,selectedRowCount:i}=e,o=Be(e,ESe),s=Lt(),a=mt(),l=MSe(a),u=s.current.getLocaleText("footerRowSelected")(i);return D.jsx(TSe,O({ref:n,className:vn(l.root,r),ownerState:a},o,{children:u}))}),PSe=E.forwardRef(function(e,n){var r;const i=Lt(),o=mt(),s=gt(i,zbe),a=gt(i,uwe),l=gt(i,Rj),u=!o.hideFooterSelectedRowCount&&a>0?D.jsx(ASe,{selectedRowCount:a}):D.jsx("div",{}),c=!o.hideFooterRowCount&&!o.pagination?D.jsx(CSe,{rowCount:s,visibleRowCount:l}):null,d=o.pagination&&!o.hideFooterPagination&&o.components.Pagination&&D.jsx(o.components.Pagination,O({},(r=o.componentsProps)==null?void 0:r.pagination));return D.jsxs(_xe,O({ref:n},e,{children:[u,c,d]}))}),DSe=E.forwardRef(function(e,n){var r,i;const o=mt();return D.jsxs("div",O({ref:n},e,{children:[D.jsx(o.components.PreferencesPanel,O({},(r=o.componentsProps)==null?void 0:r.preferencesPanel)),o.components.Toolbar&&D.jsx(o.components.Toolbar,O({},(i=o.componentsProps)==null?void 0:i.toolbar))]}))}),RSe=E.forwardRef(function(e,n){return D.jsx(SE,O({ref:n},e,{children:D.jsx(ece,{})}))}),ISe=E.forwardRef(function(e,n){const i=Lt().current.getLocaleText("noRowsLabel");return D.jsx(SE,O({ref:n},e,{children:i}))}),NSe=ze(fpe)(({theme:t})=>({[`& .${Sf.selectLabel}`]:{display:"none",[t.breakpoints.up("sm")]:{display:"block"}},[`& .${Sf.input}`]:{display:"none",[t.breakpoints.up("sm")]:{display:"inline-flex"}}})),FSe=E.forwardRef(function(e,n){var r;const i=Lt(),o=mt(),s=gt(i,vg),a=E.useMemo(()=>Math.floor(s.rowCount/(s.pageSize||1)),[s.rowCount,s.pageSize]),l=E.useCallback(c=>{const d=Number(c.target.value);i.current.setPageSize(d)},[i]),u=E.useCallback((c,d)=>{i.current.setPage(d)},[i]);return D.jsx(NSe,O({ref:n,component:"div",count:s.rowCount,page:s.page<=a?s.page:a,rowsPerPageOptions:(r=o.rowsPerPageOptions)!=null&&r.includes(s.pageSize)?o.rowsPerPageOptions:[],rowsPerPage:s.pageSize,onPageChange:u,onRowsPerPageChange:l},i.current.getLocaleText("MuiTablePagination"),e))}),CE=(t,e)=>{let n,r;return e.pagination&&e.paginationMode==="client"?(r=EN(t),n=dwe(t)):(n=Ku(t),n.length===0?r=null:r={firstRowIndex:0,lastRowIndex:n.length-1}),{rows:n,range:r}},rh=(t,e)=>{const n=CE(t,e);return E.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},AN="__detail_panel_toggle__",OSe=["selected","rowId","row","index","style","position","rowHeight","className","visibleColumns","renderedColumns","containerWidth","firstColumnToRender","lastColumnToRender","cellFocus","cellTabIndex","editRowsState","isLastVisible","onClick","onDoubleClick","onMouseEnter","onMouseLeave"],kSe=["changeReason"],LSe=t=>{const{editable:e,editing:n,selected:r,isLastVisible:i,rowHeight:o,classes:s}=t;return Qe({root:["row",r&&"selected",e&&"row--editable",n&&"row--editing",i&&"row--lastVisible",o==="auto"&&"row--dynamicHeight"]},ln,s)},BSe=({width:t})=>{if(!t)return null;const e={width:t};return D.jsx("div",{className:"MuiDataGrid-cell",style:e})},$Se=E.forwardRef(function(e,n){var r;const{selected:i,rowId:o,row:s,index:a,style:l,position:u,rowHeight:c,className:d,visibleColumns:f,renderedColumns:h,containerWidth:p,firstColumnToRender:g,cellFocus:b,cellTabIndex:m,editRowsState:w,isLastVisible:x=!1,onClick:_,onDoubleClick:C,onMouseEnter:S,onMouseLeave:M}=e,P=Be(e,OSe),A=Lt(),R=E.useRef(null),F=mt(),$=rh(A,F),j=gt(A,bE),k=gt(A,Ra),U=gt(A,mN),G=gt(A,xN),B=An(R,n),L=a+G+2,{hasScrollX:N,hasScrollY:W}=(r=A.current.getRootDimensions())!=null?r:{hasScrollX:!1,hasScrollY:!1},K={selected:i,isLastVisible:x,classes:F.classes,editing:A.current.getRowMode(o)===yn.Edit,editable:F.editMode===oo.Row,rowHeight:c},Q=LSe(K);E.useLayoutEffect(()=>{c==="auto"&&R.current&&typeof ResizeObserver>"u"&&A.current.unstable_storeRowHeightMeasurement(o,R.current.clientHeight,u)},[A,c,o,u]),E.useLayoutEffect(()=>{if($.range){const Y=A.current.getRowIndexRelativeToVisibleRows(o);Y!=null&&A.current.unstable_setLastMeasuredRowIndex(Y)}const X=R.current;if(!X||c!=="auto"||typeof ResizeObserver>"u")return;const he=new ResizeObserver(Y=>{const[ne]=Y,se=ne.borderBoxSize&&ne.borderBoxSize.length>0?ne.borderBoxSize[0].blockSize:ne.contentRect.height;A.current.unstable_storeRowHeightMeasurement(o,se,u)});return he.observe(X),()=>he.disconnect()},[A,$.range,a,c,o,u]);const J=E.useCallback((X,Z)=>he=>{he.target.nodeType===1&&!he.currentTarget.contains(he.target)||A.current.getRow(o)&&(A.current.publishEvent(X,A.current.getRowParams(o),he),Z&&Z(he))},[A,o]),ae=E.useCallback(X=>{const Z=Uxe(X.target,Ie.cell),he=Z==null?void 0:Z.getAttribute("data-field");he&&(he===wb.field||he===AN||he==="__reorder__"||A.current.getCellMode(o,he)===an.Edit||A.current.getColumn(he).type===TN)||J("rowClick",_)(X)},[A,_,J,o]),ve=E.useCallback((X,Z)=>{var he;const Y=A.current.getCellParams(o,X.field),ne=[],se=F.disableColumnReorder&&X.disableReorder||!F.rowReordering&&!!k.length&&U>1&&Object.keys(w).length>0;X.cellClassName&&ne.push(vn(typeof X.cellClassName=="function"?X.cellClassName(Y):X.cellClassName));const xe=w[o]?w[o][X.field]:null;let Pe=null;if(xe==null&&X.renderCell){var z;Pe=X.renderCell(O({},Y,{api:A.current})),ne.push(vn(Ie["cell--withRenderer"],(z=F.classes)==null?void 0:z["cell--withRenderer"]))}if(xe!=null&&X.renderEditCell){var H;let de=s;A.current.unstable_getRowWithUpdatedValues&&(de=A.current.unstable_getRowWithUpdatedValues(o,X.field));const ue=Be(xe,kSe),ge=O({},Y,{row:de},ue,{api:A.current});Pe=X.renderEditCell(ge),ne.push(vn(Ie["cell--editing"],(H=F.classes)==null?void 0:H["cell--editing"]))}F.getCellClassName&&ne.push(F.getCellClassName(Y));const te=b!==null&&b.id===o&&b.field===X.field,le=m!==null&&m.id===o&&m.field===X.field&&Y.cellMode==="view"?0:-1;return D.jsx(F.components.Cell,O({value:Y.value,field:X.field,width:Z.width,rowId:o,height:c,showRightBorder:Z.showRightBorder,formattedValue:Y.formattedValue,align:X.align||"left",cellMode:Y.cellMode,colIndex:Z.indexRelativeToAllColumns,isEditable:Y.isEditable,hasFocus:te,tabIndex:le,className:vn(ne),colSpan:Z.colSpan,disableDragEvents:se},(he=F.componentsProps)==null?void 0:he.cell,{children:Pe}),X.field)},[A,m,w,b,F,s,c,o,U,k.length]),fe=A.current.unstable_getRowInternalSizes(o);let Me=c;if(Me==="auto"&&fe){let X=0;const Z=Object.entries(fe).reduce((he,[Y,ne])=>/^base[A-Z]/.test(Y)?(X+=1,ne>he?ne:he):he,0);Z>0&&X>1&&(Me=Z)}const ye=O({},l,{maxHeight:c==="auto"?"none":c,minHeight:Me});if(fe!=null&&fe.spacingTop){const X=F.rowSpacingType==="border"?"borderTopWidth":"marginTop";ye[X]=fe.spacingTop}if(fe!=null&&fe.spacingBottom){const X=F.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let Z=ye[X];typeof Z!="number"&&(Z=parseInt(Z||"0",10)),Z+=fe.spacingBottom,ye[X]=Z}const we=A.current.unstable_applyPipeProcessors("rowClassName",[],o);if(typeof F.getRowClassName=="function"){var Fe;const X=a-(((Fe=$.range)==null?void 0:Fe.firstRowIndex)||0),Z=O({},A.current.getRowParams(o),{isFirstVisible:X===0,isLastVisible:X===$.rows.length-1,indexRelativeToCurrentPage:X});we.push(F.getRowClassName(Z))}const Oe=Pwe(1e4,20,80),re=[];for(let X=0;X0&&D.jsx(BSe,{width:_e})]}))}),g8=1e3;class zSe{constructor(e=g8){this.timeouts=new Map,this.cleanupTimeout=g8,this.cleanupTimeout=e}register(e,n,r){this.timeouts||(this.timeouts=new Map);const i=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,i)}unregister(e){const n=this.timeouts.get(e.cleanupToken);n&&(this.timeouts.delete(e.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((e,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class USe{constructor(){this.registry=new FinalizationRegistry(e=>{typeof e=="function"&&e()})}register(e,n,r){this.registry.register(e,n,r)}unregister(e){this.registry.unregister(e)}reset(){}}var ad;(function(t){t.DataGrid="DataGrid",t.DataGridPro="DataGridPro"})(ad||(ad={}));class HSe{}function VSe(t){let e=0;return function(r,i,o,s){t.registry===null&&(t.registry=typeof FinalizationRegistry<"u"?new USe:new zSe);const[a]=E.useState(new HSe),l=E.useRef(null),u=E.useRef();u.current=o;const c=E.useRef(null);if(!l.current&&u.current){const d=(f,h,p)=>{if(!h.defaultMuiPrevented){var g;(g=u.current)==null||g.call(u,f,h,p)}};l.current=r.current.subscribeEvent(i,d,s),e+=1,c.current={cleanupToken:e},t.registry.register(a,()=>{var f;(f=l.current)==null||f.call(l),l.current=null,c.current=null},c.current)}else!u.current&&l.current&&(l.current(),l.current=null,c.current&&(t.registry.unregister(c.current),c.current=null));E.useEffect(()=>{if(!l.current&&u.current){const d=(f,h,p)=>{if(!h.defaultMuiPrevented){var g;(g=u.current)==null||g.call(u,f,h,p)}};l.current=r.current.subscribeEvent(i,d,s)}return c.current&&t.registry&&(t.registry.unregister(c.current),c.current=null),()=>{var d;(d=l.current)==null||d.call(l),l.current=null}},[r,i,s])}}const GSe={registry:null},ct=VSe(GSe),jSe={isFirst:!0};function dn(t,e,n){ct(t,e,n,jSe)}const v8=1,WSe=1.5,qSe=t=>{const{scrollDirection:e,classes:n}=t,r={root:["scrollArea",`scrollArea--${e}`]};return Qe(r,ln,n)},XSe=ze("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(t,e)=>[{[`&.${Ie["scrollArea--left"]}`]:e["scrollArea--left"]},{[`&.${Ie["scrollArea--right"]}`]:e["scrollArea--right"]},e.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${Ie["scrollArea--left"]}`]:{left:0},[`&.${Ie["scrollArea--right"]}`]:{right:0}}));function KSe(t){const{scrollDirection:e}=t,n=E.useRef(null),r=Lt(),i=E.useRef(),[o,s]=E.useState(!1),a=gt(r,Fj),l=E.useRef({left:0,top:0}),u=mt(),c=O({},u,{scrollDirection:e}),d=qSe(c),f=E.useCallback(g=>{l.current=g},[]),h=E.useCallback(g=>{let b;if(e==="left")b=g.clientX-n.current.getBoundingClientRect().right;else if(e==="right")b=Math.max(1,g.clientX-n.current.getBoundingClientRect().left);else throw new Error("MUI: Wrong drag direction");b=(b-v8)*WSe+v8,clearTimeout(i.current),i.current=setTimeout(()=>{r.current.scroll({left:l.current.left+b,top:l.current.top})})},[e,r]);E.useEffect(()=>()=>{clearTimeout(i.current)},[]);const p=E.useCallback(()=>{s(g=>!g)},[]);return ct(r,"rowsScroll",f),ct(r,"columnHeaderDragStart",p),ct(r,"columnHeaderDragEnd",p),o?D.jsx(XSe,{ref:n,className:vn(d.root),ownerState:c,onDragOver:h,style:{height:a}}):null}const y8=E.memo(KSe),YSe=({apiRef:t,props:e,children:n})=>D.jsx(Ej.Provider,{value:e,children:D.jsx(Cj.Provider,{value:t,children:n})}),ZSe=Twe()&&window.localStorage.getItem("DEBUG")!=null,K0=()=>{},QSe={debug:K0,info:K0,warn:K0,error:K0},b8=["debug","info","warn","error"];function x8(t,e,n=console){const r=b8.indexOf(e);if(r===-1)throw new Error(`MUI: Log level ${e} not recognized.`);return b8.reduce((o,s,a)=>(a>=r?o[s]=(...l)=>{const[u,...c]=l;n[s](`MUI: ${t} - ${u}`,...c)}:o[s]=K0,o),{})}const JSe=(t,e)=>{t.current.getLogger=E.useCallback(n=>ZSe?x8(n,"debug",e.logger):e.logLevel?x8(n,e.logLevel.toString(),e.logger):QSe,[e.logLevel,e.logger])};function In(t,e,n){const r=E.useRef(e),[i]=E.useState(Object.keys(e)),o=E.useCallback(()=>{t.current&&i.forEach(s=>{t.current.hasOwnProperty(s)||(t.current[s]=(...a)=>r.current[s](...a))})},[i,t]);E.useEffect(()=>{r.current=e},[e]),E.useEffect(()=>{o()},[o]),o()}class eCe{constructor(){this.maxListeners=10,this.warnOnce=!1,this.events={}}on(e,n,r={}){let i=this.events[e];i||(i={highPriority:new Map,regular:new Map},this.events[e]=i),r.isFirst?i.highPriority.set(n,!0):i.regular.set(n,!0)}removeListener(e,n){this.events[e]&&(this.events[e].regular.delete(n),this.events[e].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(e,...n){const r=this.events[e];if(!r)return;const i=Array.from(r.highPriority.keys()),o=Array.from(r.regular.keys());for(let s=i.length-1;s>=0;s-=1){const a=i[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;st.isPropagationStopped!==void 0;let w8=0;function nCe(t,e){const n=E.useRef();n.current||(n.current={unstable_eventManager:new eCe,unstable_caches:{},state:{},instanceId:w8},w8+=1),E.useImperativeHandle(t,()=>n.current,[n]);const r=E.useCallback((...s)=>{const[a,l,u={}]=s;if(u.defaultMuiPrevented=!1,tCe(u)&&u.isPropagationStopped())return;const c=e.signature===ad.DataGridPro?{api:n.current}:{};n.current.unstable_eventManager.emit(a,l,u,c)},[n,e.signature]),i=E.useCallback((s,a,l)=>{n.current.unstable_eventManager.on(s,a,l);const u=n.current;return()=>{u.unstable_eventManager.removeListener(s,a)}},[n]),o=E.useCallback(s=>{n.current.publishEvent("componentError",s)},[n]);return In(n,{subscribeEvent:i,publishEvent:r,showError:o}),E.useEffect(()=>{const s=n.current;return()=>{Bbe(s.instanceId),s.publishEvent("unmount")}},[n]),n}function rCe(t,e){const n=E.useCallback(r=>{t.current.setState(i=>O({},i,{error:r}))},[t]);E.useEffect(()=>{e.error?n({error:e.error}):n(null)},[n,e.error]),ct(t,"componentError",n)}const iCe=(t,e)=>{const n=E.useCallback(r=>{if(e.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return e.localeText[r]},[e.localeText]);t.current.getLocaleText=n},oCe=t=>{const e=E.useRef({}),n=E.useCallback(l=>{l&&Object.values(l.appliers).forEach(u=>{u()})},[]),r=E.useCallback((l,u,c)=>{e.current[l]||(e.current[l]={processors:new Map,appliers:{}});const d=e.current[l];return d.processors.get(u)!==c&&(d.processors.set(u,c),n(d)),()=>{e.current[l].processors.set(u,null)}},[n]),i=E.useCallback((l,u,c)=>(e.current[l]||(e.current[l]={processors:new Map,appliers:{}}),e.current[l].appliers[u]=c,()=>{const d=e.current[l].appliers,f=Be(d,[u].map(Lm));e.current[l].appliers=f}),[]),o=E.useCallback(l=>{const u=e.current[l];n(u)},[n]),s=E.useCallback((...l)=>{const[u,c,d]=l;return e.current[u]?Array.from(e.current[u].processors.values()).reduce((h,p)=>p?p(h,d):h,c):c},[]);In(t,{unstable_registerPipeProcessor:r,unstable_registerPipeApplier:i,unstable_requestPipeProcessorsApplication:o,unstable_applyPipeProcessors:s})},_b=t=>{const e=E.useRef(!0);e.current&&(e.current=!1,t())},Pi=(t,e,n)=>{const r=E.useRef(),i=E.useRef(`mui-${Math.round(Math.random()*1e9)}`),o=E.useCallback(()=>{r.current=t.current.unstable_registerPipeProcessor(e,i.current,n)},[t,n,e]);_b(()=>{o()});const s=E.useRef(!0);E.useEffect(()=>(s.current?s.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])},PN=(t,e,n)=>{const r=E.useRef(),i=E.useRef(`mui-${Math.round(Math.random()*1e9)}`),o=E.useCallback(()=>{r.current=t.current.unstable_registerPipeApplier(e,i.current,n)},[t,n,e]);_b(()=>{o()});const s=E.useRef(!0);E.useEffect(()=>(s.current?s.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])},DN=(t,e,n,r)=>{const i=E.useCallback(()=>{t.current.unstable_registerStrategyProcessor(e,n,r)},[t,r,n,e]);_b(()=>{i()});const o=E.useRef(!0);E.useEffect(()=>{o.current?o.current=!1:i()},[i])},Sb="none",_8={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree"},sCe=t=>{const e=E.useRef(new Map),n=E.useRef({}),r=E.useCallback((l,u,c)=>{const d=()=>{const p=n.current[u],g=Be(p,[l].map(Lm));n.current[u]=g};n.current[u]||(n.current[u]={});const f=n.current[u],h=f[l];return f[l]=c,!h||h===c||l===t.current.unstable_getActiveStrategy(_8[u])&&t.current.publishEvent("activeStrategyProcessorChange",u),d},[t]),i=E.useCallback((l,u)=>{const c=t.current.unstable_getActiveStrategy(_8[l]);if(c==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const d=n.current[l];if(!d||!d[c])throw new Error(`No processor found for processor "${l}" on strategy "${c}"`);const f=d[c];return f(u)},[t]),o=E.useCallback(l=>{var u;const d=Array.from(e.current.entries()).find(([,f])=>f.group!==l?!1:f.isAvailable());return(u=d==null?void 0:d[0])!=null?u:Sb},[]),s=E.useCallback((l,u,c)=>{e.current.set(u,{group:l,isAvailable:c}),t.current.publishEvent("strategyAvailabilityChange")},[t]);In(t,{unstable_registerStrategyProcessor:r,unstable_applyStrategyProcessor:i,unstable_getActiveStrategy:o,unstable_setStrategyAvailability:s})},aCe=(t,e,n,r,i)=>{const o=Jr(t,"useNativeEventListener"),[s,a]=E.useState(!1),l=E.useRef(r),u=E.useCallback(c=>l.current&&l.current(c),[]);E.useEffect(()=>{l.current=r},[r]),E.useEffect(()=>{let c;if(Jj(e)?c=e():c=e&&e.current?e.current:null,c&&n&&!s){o.debug(`Binding native ${n} event`),c.addEventListener(n,u,i);const d=c;a(!0);const f=()=>{o.debug(`Clearing native ${n} event`),d.removeEventListener(n,u,i)};t.current.subscribeEvent("unmount",f)}},[e,u,n,s,o,i,t])},lCe=["stateId"],uCe=(t,e)=>{const n=E.useRef({}),[,r]=E.useState(),i=E.useCallback(u=>{const{stateId:c}=u,d=Be(u,lCe);n.current[c]=O({},d,{stateId:c})},[]),o=E.useCallback((u,c)=>{let d;if(Jj(u)?d=u(t.current.state):d=u,t.current.state===d)return!1;let f=!1;const h=[];if(Object.keys(n.current).forEach(p=>{const g=n.current[p],b=g.stateSelector(t.current.state,t.current.instanceId),m=g.stateSelector(d,t.current.instanceId);m!==b&&(h.push({stateId:g.stateId,hasPropChanged:m!==g.propModel}),g.propModel!==void 0&&m!==g.propModel&&(f=!0))}),h.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${h[0].stateId}, therefore, you're not allowed to update ${h.map(p=>p.stateId).join(", ")} in the same transaction.`);if(f||(t.current.state=d,t.current.publishEvent&&t.current.publishEvent("stateChange",d)),h.length===1){const{stateId:p,hasPropChanged:g}=h[0],b=n.current[p],m=b.stateSelector(d,t.current.instanceId);if(b.propOnChange&&g){const w=e.signature===ad.DataGridPro?{api:t.current,reason:c}:{reason:c};b.propOnChange(m,w)}f||t.current.publishEvent(b.changeEvent,m,{reason:c})}return!f},[t,e.signature]),s=E.useCallback((u,c,d)=>t.current.setState(f=>O({},f,{[u]:c(f[u])}),d),[t]),a=E.useCallback(()=>r(()=>t.current.state),[t]);In(t,{setState:o,forceUpdate:a,unstable_updateControlState:s,unstable_registerControlState:i})},cCe=(t,e)=>{const n=nCe(t,e);return JSe(n,e),rCe(n,e),uCe(n,e),oCe(n),sCe(n),iCe(n,e),n},cs=(t,e,n)=>{const r=E.useRef(!1);r.current||(e.current.state=t(e.current.state,n,e),r.current=!0)};function S8(t){const e=document.createElement("span");e.style.whiteSpace="pre",e.style.userSelect="all",e.style.opacity="0px",e.textContent=t,document.body.appendChild(e);const n=document.createRange();n.selectNode(e);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(e)}}function dCe(t){var e;return((e=window.getSelection())==null?void 0:e.toString())!==""?!0:t?(t.selectionEnd||0)-(t.selectionStart||0)>0:!1}const fCe=t=>{const e=E.useCallback((i=!1)=>{if(t.current.getSelectedRows().size===0)return;const o=t.current.getDataAsCsv({includeHeaders:i,delimiter:" "});navigator.clipboard?navigator.clipboard.writeText(o).catch(()=>{S8(o)}):S8(o)},[t]),n=E.useCallback(i=>{const o=i.ctrlKey||i.metaKey||i.altKey;String.fromCharCode(i.keyCode)!=="C"||!o||dCe(i.target)||t.current.unstable_copySelectedRowsToClipboard(i.altKey)},[t]);aCe(t,t.current.rootElementRef,"keydown",n),In(t,{unstable_copySelectedRowsToClipboard:e})},dW=t=>t.columnMenu,hCe=t=>O({},t,{columnMenu:{open:!1}}),pCe=t=>{const e=Jr(t,"useGridColumnMenu"),n=E.useCallback(a=>{t.current.setState(u=>u.columnMenu.open&&u.columnMenu.field===a?u:(e.debug("Opening Column Menu"),O({},u,{columnMenu:{open:!0,field:a}})))&&(t.current.hidePreferences(),t.current.forceUpdate())},[t,e]),r=E.useCallback(()=>{t.current.setState(l=>!l.columnMenu.open&&l.columnMenu.field===void 0?l:(e.debug("Hiding Column Menu"),O({},l,{columnMenu:O({},l.columnMenu,{open:!1,field:void 0})})))&&t.current.forceUpdate()},[t,e]),i=E.useCallback(a=>{e.debug("Toggle Column Menu");const l=dW(t.current.state);!l.open||l.field!==a?n(a):r()},[t,e,n,r]);In(t,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:i});const s=E.useCallback((a,l)=>{if(!l.target.classList.contains(Ie.menuIconButton)||!l.relatedTarget)return;const u=l.relatedTarget.classList.contains(Ie.menuList),c=l.relatedTarget.getAttribute("role")==="menuitem";(u||c)&&t.current.setColumnHeaderFocus(a.field)},[t]);ct(t,"columnResizeStart",r),ct(t,"columnHeaderFocus",s),ct(t,"virtualScrollerWheel",t.current.hideColumnMenu),ct(t,"virtualScrollerTouchMove",t.current.hideColumnMenu)},mCe=(t,e,n)=>{var r,i,o,s,a,l,u;const c=!!e.columnVisibilityModel||!!((r=e.initialState)!=null&&(i=r.columns)!=null&&i.columnVisibilityModel);n.current.unstable_caches.columns={isUsingColumnVisibilityModel:c};const d=oW(e.columnTypes),f=gp({apiRef:n,columnTypes:d,columnsToUpsert:e.columns,initialState:(o=e.initialState)==null?void 0:o.columns,shouldRegenColumnVisibilityModelFromColumns:!c,currentColumnVisibilityModel:(s=(a=e.columnVisibilityModel)!=null?a:(l=e.initialState)==null||(u=l.columns)==null?void 0:u.columnVisibilityModel)!=null?s:{},keepOnlyColumnsToUpsert:!0});return O({},t,{columns:f})};function gCe(t,e){var n,r;const i=Jr(t,"useGridColumns"),o=E.useMemo(()=>oW(e.columnTypes),[e.columnTypes]),s=E.useRef(e.columns),a=E.useRef(o);t.current.unstable_registerControlState({stateId:"visibleColumns",propModel:e.columnVisibilityModel,propOnChange:e.onColumnVisibilityModelChange,stateSelector:Tu,changeEvent:"columnVisibilityModelChange"});const l=E.useCallback(j=>{i.debug("Updating columns state."),t.current.setState(h8(j)),t.current.forceUpdate(),t.current.publishEvent("columnsChange",j.all)},[i,t]),u=E.useCallback(j=>th(t)[j],[t]),c=E.useCallback(()=>qa(t),[t]),d=E.useCallback(()=>lo(t),[t]),f=E.useCallback(()=>Wbe(t),[t]),h=E.useCallback((j,k=!0)=>(k?lo(t):qa(t)).findIndex(G=>G.field===j),[t]),p=E.useCallback(j=>{const k=h(j);return zf(t)[k]},[t,h]),g=E.useCallback(j=>{Tu(t)!==j&&(t.current.setState(U=>O({},U,{columns:gp({apiRef:t,columnTypes:o,columnsToUpsert:[],initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!1,currentColumnVisibilityModel:j,keepOnlyColumnsToUpsert:!1})})),t.current.forceUpdate())},[t,o]),b=E.useCallback(j=>{const k=gp({apiRef:t,columnTypes:o,columnsToUpsert:j,initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!0,keepOnlyColumnsToUpsert:!1});l(k)},[t,l,o]),m=E.useCallback(j=>t.current.updateColumns([j]),[t]),w=E.useCallback((j,k)=>{if(t.current.unstable_caches.columns.isUsingColumnVisibilityModel){var U;const G=Tu(t),B=(U=G[j])!=null?U:!0;if(k!==B){const L=O({},G,{[j]:k});t.current.setColumnVisibilityModel(L)}}else{const G=t.current.getColumn(j),B=O({},G,{hide:!k});t.current.updateColumns([B]);const L={field:j,colDef:B,isVisible:k};t.current.publishEvent("columnVisibilityChange",L)}},[t]),x=E.useCallback((j,k)=>{const U=Wm(t),G=U.findIndex(W=>W===j);if(G===k)return;i.debug(`Moving column ${j} to index ${k}`);const B=[...U],L=B.splice(G,1)[0];B.splice(k,0,L),l(O({},$f(t.current.state),{all:B}));const N={field:j,element:t.current.getColumnHeaderElement(j),colDef:t.current.getColumn(j),targetIndex:k,oldIndex:G};t.current.publishEvent("columnOrderChange",N)},[t,i,l]),_=E.useCallback((j,k)=>{i.debug(`Updating column ${j} width to ${k}`);const U=t.current.getColumn(j),G=O({},U,{width:k});t.current.updateColumns([G]),t.current.publishEvent("columnWidthChange",{element:t.current.getColumnHeaderElement(j),colDef:G,width:k})},[t,i]);In(t,{getColumn:u,getAllColumns:c,getColumnIndex:h,getColumnPosition:p,getVisibleColumns:d,getColumnsMeta:f,updateColumn:m,updateColumns:b,setColumnVisibilityModel:g,setColumnVisibility:w,setColumnIndex:x,setColumnWidth:_});const S=E.useCallback((j,k)=>{const U={};if(t.current.unstable_caches.columns.isUsingColumnVisibilityModel){var G,B,L;const K=Tu(t);(!k.exportOnlyDirtyModels||e.columnVisibilityModel!=null||Object.keys((G=(B=e.initialState)==null||(L=B.columns)==null?void 0:L.columnVisibilityModel)!=null?G:{}).length>0||Object.keys(K).length>0)&&(U.columnVisibilityModel=K)}U.orderedFields=Wm(t);const N=qa(t),W={};return N.forEach(K=>{if(K.hasBeenResized){const Q={};iW.forEach(J=>{let ae=K[J];ae===1/0&&(ae=-1),Q[J]=ae}),W[K.field]=Q}}),Object.keys(W).length>0&&(U.dimensions=W),O({},j,{columns:U})},[t,e.columnVisibilityModel,(n=e.initialState)==null?void 0:n.columns]),M=E.useCallback((j,k)=>{var U;const G=t.current.unstable_caches.columns.isUsingColumnVisibilityModel?(U=k.stateToRestore.columns)==null?void 0:U.columnVisibilityModel:void 0,B=k.stateToRestore.columns;if(G==null&&B==null)return j;const L=gp({apiRef:t,columnTypes:o,columnsToUpsert:[],initialState:B,shouldRegenColumnVisibilityModelFromColumns:!t.current.unstable_caches.columns.isUsingColumnVisibilityModel,currentColumnVisibilityModel:G,keepOnlyColumnsToUpsert:!1});return t.current.setState(h8(L)),B!=null&&t.current.publishEvent("columnsChange",L.all),j},[t,o]),P=E.useCallback((j,k)=>{if(k===Za.columns){var U;const G=e.components.ColumnsPanel;return D.jsx(G,O({},(U=e.componentsProps)==null?void 0:U.columnsPanel))}return j},[e.components.ColumnsPanel,(r=e.componentsProps)==null?void 0:r.columnsPanel]);Pi(t,"exportState",S),Pi(t,"restoreState",M),Pi(t,"preferencePanel",P);const A=E.useRef(null);ct(t,"viewportInnerSizeChange",j=>{A.current!==j.width&&(A.current=j.width,l(sW($f(t.current.state),j.width)))}),dn(t,"columnVisibilityChange",e.onColumnVisibilityChange);const F=E.useCallback(()=>{i.info("Columns pipe processing have changed, regenerating the columns");const j=gp({apiRef:t,columnTypes:o,columnsToUpsert:[],initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!t.current.unstable_caches.columns.isUsingColumnVisibilityModel,keepOnlyColumnsToUpsert:!1});l(j)},[t,i,l,o]);PN(t,"hydrateColumns",F);const $=E.useRef(!0);E.useEffect(()=>{if($.current){$.current=!1;return}if(i.info(`GridColumns have changed, new length ${e.columns.length}`),s.current===e.columns&&a.current===o)return;const j=gp({apiRef:t,columnTypes:o,initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!t.current.unstable_caches.columns.isUsingColumnVisibilityModel,columnsToUpsert:e.columns,keepOnlyColumnsToUpsert:!0});s.current=e.columns,a.current=o,l(j)},[i,t,l,e.columns,o]),E.useEffect(()=>{e.columnVisibilityModel!==void 0&&t.current.setColumnVisibilityModel(e.columnVisibilityModel)},[t,i,e.columnVisibilityModel])}const vCe=t=>t.columnGrouping,fW=wt(vCe,t=>t.lookup),yCe=["groupId","children"];function bCe(t){return t.groupPath!==void 0}const hW=(t,e,n)=>{if(kj(t)){if(n[t.field]!==void 0)throw new Error(["MUI: columnGroupingModel contains duplicated field",`column field ${t.field} occurrs two times in the grouping model:`,`- ${n[t.field].join(" > ")}`,`- ${e.join(" > ")}`].join(` -`));n[t.field]=e;return}const{groupId:r,children:i}=t;i.forEach(o=>{hW(o,[...e,r],n)})},pW=t=>{if(!t)return{};const e={};return t.forEach(n=>{hW(n,[],e)}),e},RN=t=>{let e={};return t.forEach(n=>{if(kj(n))return;const{groupId:r,children:i}=n,o=Be(n,yCe);if(!r)throw new Error("MUI: An element of the columnGroupingModel does not have either `field` or `groupId`.");i||console.warn(`MUI: group groupId=${r} has no children.`);const s=O({},o,{groupId:r}),a=RN(i);if(a[r]!==void 0||e[r]!==void 0)throw new Error(`MUI: The groupId ${r} is used multiple times in the columnGroupingModel.`);e=O({},e,a,{[r]:s})}),O({},e)},xCe=(t,e)=>{var n;const r=RN((n=e.columnGroupingModel)!=null?n:[]);return O({},t,{columnGrouping:{lookup:r,groupCollapsedModel:{}}})},wCe=(t,e)=>{var n;const r=E.useCallback(a=>{var l,u;return(l=(u=th(t)[a])==null?void 0:u.groupPath)!=null?l:[]},[t]),i=E.useCallback(()=>fW(t),[t]);In(t,{unstable_getColumnGroupPath:r,unstable_getAllGroupDetails:i});const s=E.useRef(!0);E.useEffect(()=>{var a,l;if(s.current){s.current=!1;return}if(!((a=e.experimentalFeatures)!=null&&a.columnGrouping))return;const u=RN((l=e.columnGroupingModel)!=null?l:[]);t.current.setState(c=>O({},c,{columnGrouping:O({},c.columnGrouping,{lookup:u})}))},[t,e.columnGroupingModel,(n=e.experimentalFeatures)==null?void 0:n.columnGrouping])},AT=.7,PT=1.3,mW=(t,e,n,r)=>{switch(t){case El.Compact:return{value:t,headerHeight:Math.floor(e*AT),rowHeight:Math.floor(n*AT),headerGroupingMaxDepth:r,factor:AT};case El.Comfortable:return{value:t,headerHeight:Math.floor(e*PT),rowHeight:Math.floor(n*PT),headerGroupingMaxDepth:r,factor:PT};default:return{value:t,headerHeight:e,rowHeight:n,headerGroupingMaxDepth:r,factor:1}}},_Ce=(t,e)=>{let n;if(e.columnGroupingModel==null||Object.keys(e.columnGroupingModel).length===0)n=0;else{const r=pW(e.columnGroupingModel),i=t.columns,o=i.all.filter(s=>i.columnVisibilityModel[s]!==!1);o.length===0?n=0:n=Math.max(...o.map(s=>{var a,l;return(a=(l=r[s])==null?void 0:l.length)!=null?a:0}))}return O({},t,{density:mW(e.density,e.headerHeight,e.rowHeight,n)})},SCe=(t,e)=>{const n=gt(t,lo),r=n.length>0?Math.max(...n.map(a=>{var l,u;return(l=(u=a.groupPath)==null?void 0:u.length)!=null?l:0})):0,i=Jr(t,"useDensity"),o=E.useCallback((a,l=e.headerHeight,u=e.rowHeight,c=r)=>{i.debug(`Set grid density to ${a}`),t.current.setState(d=>{const f=nh(d),h=mW(a,l,u,c);return Xa(f,h)?d:O({},d,{density:h})}),t.current.forceUpdate()},[i,t,e.headerHeight,e.rowHeight,r]);E.useEffect(()=>{t.current.setDensity(e.density,e.headerHeight,e.rowHeight,r)},[t,e.density,e.rowHeight,e.headerHeight,r]),In(t,{setDensity:o})};function CCe(t,e="csv",n=document.title||"untitled"){const r=`${n}.${e}`;if("download"in HTMLAnchorElement.prototype){const i=URL.createObjectURL(t),o=document.createElement("a");o.href=i,o.download=r,o.click(),setTimeout(()=>{URL.revokeObjectURL(i)});return}throw new Error("MUI: exportAs not supported")}const gW=(t,e)=>{if(typeof t=="string"){const n=t.replace(/"/g,'""');return[e,` -`,"\r"].some(r=>n.includes(r))?`"${n}"`:n}return t};Ja(["MUI: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.","You can provide a `valueFormatter` with a string representation to be used."]);const ECe=(t,e,n,r)=>e.map(i=>{const o=n(t,i.field);return gW(o.formattedValue,r)});function MCe(t){const{columns:e,rowIds:n,getCellParams:r,delimiterCharacter:i,includeHeaders:o}=t,s=n.reduce((l,u)=>`${l}${ECe(u,e,r,i).join(i)}\r + ${w.value?m(w):""}`},x)))})]})},[l,u,f.open,c,d,h]),g=b=>{var m;const{open:w,openedPanelValue:x}=f;w&&x===Ya.filters?l.current.hideFilterPanel():l.current.showFilterPanel(),(m=a.onClick)==null||m.call(a,b)};return u.disableColumnFilter?null:D.jsx(u.components.BaseTooltip,O({title:p,enterDelay:1e3},s,(r=u.componentsProps)==null?void 0:r.baseTooltip,{children:D.jsx(u.components.BaseButton,O({ref:n,size:"small","aria-label":l.current.getLocaleText("toolbarFiltersLabel"),startIcon:D.jsx(VI,{badgeContent:c.length,color:"primary",children:D.jsx(u.components.OpenFilterButtonIcon,{})})},a,{onClick:g},(i=u.componentsProps)==null?void 0:i.baseButton,{children:l.current.getLocaleText("toolbarFilters")}))}))}),aSe=["children","onClick"],lSe=E.forwardRef(function(e,n){var r;const{children:i,onClick:o}=e,s=Be(e,aSe),a=Lt(),l=mt(),u=jn(),c=jn(),[d,f]=E.useState(!1),h=E.useRef(null),p=An(n,h),g=x=>{f(_=>!_),o==null||o(x)},b=()=>f(!1),m=x=>{xE(x.key)&&x.preventDefault(),SN(x.key)&&b()},w=x=>{var _;h.current===x.target||(_=h.current)!=null&&_.contains(x.target)||f(!1)};return i==null?null:D.jsxs(E.Fragment,{children:[D.jsx(l.components.BaseButton,O({ref:p,size:"small",startIcon:D.jsx(l.components.ExportIcon,{}),"aria-expanded":d?"true":void 0,"aria-label":a.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-labelledby":c,id:u},s,{onClick:g},(r=l.componentsProps)==null?void 0:r.baseButton,{children:a.current.getLocaleText("toolbarExport")})),D.jsx(_E,{open:d,target:h.current,onClickAway:w,position:"bottom-start",children:D.jsx(ub,{id:c,className:Ie.menuList,"aria-labelledby":u,onKeyDown:m,autoFocusItem:d,children:E.Children.map(i,x=>E.isValidElement(x)?E.cloneElement(x,{hideMenu:b}):x)})})]})}),uSe=["hideMenu","options"],cSe=["hideMenu","options"],dSe=["csvOptions","printOptions","excelOptions"],fSe=t=>{const e=Lt(),{hideMenu:n,options:r}=t,i=Be(t,uSe);return D.jsx(wn,O({onClick:()=>{e.current.exportDataAsCsv(r),n==null||n()}},i,{children:e.current.getLocaleText("toolbarExportCSV")}))},hSe=t=>{const e=Lt(),{hideMenu:n,options:r}=t,i=Be(t,cSe);return D.jsx(wn,O({onClick:()=>{e.current.exportDataAsPrint(r),n==null||n()}},i,{children:e.current.getLocaleText("toolbarExportPrint")}))},pSe=E.forwardRef(function(e,n){const{csvOptions:r={},printOptions:i={},excelOptions:o}=e,s=Be(e,dSe),l=Lt().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:o,csvOptions:r,printOptions:i}).sort((u,c)=>u.componentName>c.componentName?1:-1);return l.length===0?null:D.jsx(lSe,O({},s,{ref:n,children:l.map((u,c)=>E.cloneElement(u.component,{key:c}))}))}),hy=()=>({items:[],linkOperator:So.And,quickFilterValues:[],quickFilterLogicOperator:So.And}),mSe=["quickFilterParser","quickFilterFormatter","debounceMs"],gSe=ze($n,{name:"MuiDataGrid",slot:"ToolbarQuickFilter",overridesResolver:(t,e)=>e.toolbarQuickFilter})(({theme:t})=>({width:"auto",paddingBottom:t.spacing(.5),"& input":{marginLeft:t.spacing(.5)},"& .MuiInput-underline:before":{borderBottom:`1px solid ${t.palette.divider}`},"& input[type=search]::-ms-clear,\n& input[type=search]::-ms-reveal":{display:"none",width:0,height:0},'& input[type="search"]::-webkit-search-decoration,\n & input[type="search"]::-webkit-search-cancel-button,\n & input[type="search"]::-webkit-search-results-button,\n & input[type="search"]::-webkit-search-results-decoration':{display:"none"}})),vSe=t=>t.split(" ").filter(e=>e!==""),ySe=t=>t.join(" ");function bSe(t){var e;const{quickFilterParser:n=vSe,quickFilterFormatter:r=ySe,debounceMs:i=500}=t,o=Be(t,mSe),s=Lt(),a=mt(),l=gt(s,qbe),[u,c]=E.useState(()=>r(l??[])),[d,f]=E.useState(l);E.useEffect(()=>{qa(d,l)||(f(l),c(m=>qa(n(m),l)?m:r(l??[])))},[d,l,r,n]);const h=E.useCallback(m=>{s.current.setQuickFilterValues(n(m))},[s,n]),p=E.useMemo(()=>ug(h,i),[h,i]),g=E.useCallback(m=>{const w=m.target.value;c(w),p(w)},[p]),b=E.useCallback(()=>{c(""),h("")},[h]);return D.jsx(gSe,O({as:a.components.BaseTextField,ownerState:a,variant:"standard",value:u,onChange:g,placeholder:s.current.getLocaleText("toolbarQuickFilterPlaceholder"),"aria-label":s.current.getLocaleText("toolbarQuickFilterLabel"),type:"search",InputProps:{startAdornment:D.jsx(a.components.QuickFilterIcon,{fontSize:"small"}),endAdornment:D.jsx(io,{"aria-label":s.current.getLocaleText("toolbarQuickFilterDeleteIconLabel"),size:"small",sx:{visibility:u?"visible":"hidden"},onClick:b,children:D.jsx(a.components.QuickFilterClearIcon,{fontSize:"small"})})}},o,(e=a.componentsProps)==null?void 0:e.baseTextField))}const xSe=["className","csvOptions","printOptions","excelOptions","showQuickFilter","quickFilterProps"],cW=E.forwardRef(function(e,n){const{csvOptions:r,printOptions:i,excelOptions:o,showQuickFilter:s=!1,quickFilterProps:a={}}=e,l=Be(e,xSe),u=mt();return u.disableColumnFilter&&u.disableColumnSelector&&u.disableDensitySelector&&!s?null:D.jsxs(Pxe,O({ref:n},l,{children:[D.jsx(eSe,{}),D.jsx(sSe,{}),D.jsx(nSe,{}),D.jsx(pSe,{csvOptions:r,printOptions:i,excelOptions:o}),D.jsx(pue,{sx:{flex:1}}),s&&D.jsx(bSe,O({},a))]}))}),wSe=["className","rowCount","visibleRowCount"],_Se=t=>{const{classes:e}=t;return Qe({root:["rowCount"]},ln,e)},SSe=ze("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(t,e)=>e.rowCount})(({theme:t})=>({alignItems:"center",display:"flex",margin:t.spacing(0,2)})),CSe=E.forwardRef(function(e,n){const{className:r,rowCount:i,visibleRowCount:o}=e,s=Be(e,wSe),a=Lt(),l=mt(),u=_Se(l);if(i===0)return null;const c=o{const{classes:e}=t;return Qe({root:["selectedRowCount"]},ln,e)},TSe=ze("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(t,e)=>e.selectedRowCount})(({theme:t})=>({alignItems:"center",display:"flex",margin:t.spacing(0,2),visibility:"hidden",width:0,height:0,[t.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),ASe=E.forwardRef(function(e,n){const{className:r,selectedRowCount:i}=e,o=Be(e,ESe),s=Lt(),a=mt(),l=MSe(a),u=s.current.getLocaleText("footerRowSelected")(i);return D.jsx(TSe,O({ref:n,className:vn(l.root,r),ownerState:a},o,{children:u}))}),PSe=E.forwardRef(function(e,n){var r;const i=Lt(),o=mt(),s=gt(i,zbe),a=gt(i,uwe),l=gt(i,Rj),u=!o.hideFooterSelectedRowCount&&a>0?D.jsx(ASe,{selectedRowCount:a}):D.jsx("div",{}),c=!o.hideFooterRowCount&&!o.pagination?D.jsx(CSe,{rowCount:s,visibleRowCount:l}):null,d=o.pagination&&!o.hideFooterPagination&&o.components.Pagination&&D.jsx(o.components.Pagination,O({},(r=o.componentsProps)==null?void 0:r.pagination));return D.jsxs(_xe,O({ref:n},e,{children:[u,c,d]}))}),DSe=E.forwardRef(function(e,n){var r,i;const o=mt();return D.jsxs("div",O({ref:n},e,{children:[D.jsx(o.components.PreferencesPanel,O({},(r=o.componentsProps)==null?void 0:r.preferencesPanel)),o.components.Toolbar&&D.jsx(o.components.Toolbar,O({},(i=o.componentsProps)==null?void 0:i.toolbar))]}))}),RSe=E.forwardRef(function(e,n){return D.jsx(SE,O({ref:n},e,{children:D.jsx(ece,{})}))}),ISe=E.forwardRef(function(e,n){const i=Lt().current.getLocaleText("noRowsLabel");return D.jsx(SE,O({ref:n},e,{children:i}))}),NSe=ze(fpe)(({theme:t})=>({[`& .${Sf.selectLabel}`]:{display:"none",[t.breakpoints.up("sm")]:{display:"block"}},[`& .${Sf.input}`]:{display:"none",[t.breakpoints.up("sm")]:{display:"inline-flex"}}})),FSe=E.forwardRef(function(e,n){var r;const i=Lt(),o=mt(),s=gt(i,vg),a=E.useMemo(()=>Math.floor(s.rowCount/(s.pageSize||1)),[s.rowCount,s.pageSize]),l=E.useCallback(c=>{const d=Number(c.target.value);i.current.setPageSize(d)},[i]),u=E.useCallback((c,d)=>{i.current.setPage(d)},[i]);return D.jsx(NSe,O({ref:n,component:"div",count:s.rowCount,page:s.page<=a?s.page:a,rowsPerPageOptions:(r=o.rowsPerPageOptions)!=null&&r.includes(s.pageSize)?o.rowsPerPageOptions:[],rowsPerPage:s.pageSize,onPageChange:u,onRowsPerPageChange:l},i.current.getLocaleText("MuiTablePagination"),e))}),CE=(t,e)=>{let n,r;return e.pagination&&e.paginationMode==="client"?(r=EN(t),n=dwe(t)):(n=Ku(t),n.length===0?r=null:r={firstRowIndex:0,lastRowIndex:n.length-1}),{rows:n,range:r}},rh=(t,e)=>{const n=CE(t,e);return E.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},AN="__detail_panel_toggle__",OSe=["selected","rowId","row","index","style","position","rowHeight","className","visibleColumns","renderedColumns","containerWidth","firstColumnToRender","lastColumnToRender","cellFocus","cellTabIndex","editRowsState","isLastVisible","onClick","onDoubleClick","onMouseEnter","onMouseLeave"],kSe=["changeReason"],LSe=t=>{const{editable:e,editing:n,selected:r,isLastVisible:i,rowHeight:o,classes:s}=t;return Qe({root:["row",r&&"selected",e&&"row--editable",n&&"row--editing",i&&"row--lastVisible",o==="auto"&&"row--dynamicHeight"]},ln,s)},BSe=({width:t})=>{if(!t)return null;const e={width:t};return D.jsx("div",{className:"MuiDataGrid-cell",style:e})},$Se=E.forwardRef(function(e,n){var r;const{selected:i,rowId:o,row:s,index:a,style:l,position:u,rowHeight:c,className:d,visibleColumns:f,renderedColumns:h,containerWidth:p,firstColumnToRender:g,cellFocus:b,cellTabIndex:m,editRowsState:w,isLastVisible:x=!1,onClick:_,onDoubleClick:C,onMouseEnter:S,onMouseLeave:M}=e,P=Be(e,OSe),A=Lt(),R=E.useRef(null),F=mt(),$=rh(A,F),j=gt(A,bE),k=gt(A,Da),U=gt(A,mN),G=gt(A,xN),B=An(R,n),L=a+G+2,{hasScrollX:N,hasScrollY:W}=(r=A.current.getRootDimensions())!=null?r:{hasScrollX:!1,hasScrollY:!1},K={selected:i,isLastVisible:x,classes:F.classes,editing:A.current.getRowMode(o)===yn.Edit,editable:F.editMode===oo.Row,rowHeight:c},Q=LSe(K);E.useLayoutEffect(()=>{c==="auto"&&R.current&&typeof ResizeObserver>"u"&&A.current.unstable_storeRowHeightMeasurement(o,R.current.clientHeight,u)},[A,c,o,u]),E.useLayoutEffect(()=>{if($.range){const Y=A.current.getRowIndexRelativeToVisibleRows(o);Y!=null&&A.current.unstable_setLastMeasuredRowIndex(Y)}const X=R.current;if(!X||c!=="auto"||typeof ResizeObserver>"u")return;const he=new ResizeObserver(Y=>{const[ne]=Y,se=ne.borderBoxSize&&ne.borderBoxSize.length>0?ne.borderBoxSize[0].blockSize:ne.contentRect.height;A.current.unstable_storeRowHeightMeasurement(o,se,u)});return he.observe(X),()=>he.disconnect()},[A,$.range,a,c,o,u]);const J=E.useCallback((X,Z)=>he=>{he.target.nodeType===1&&!he.currentTarget.contains(he.target)||A.current.getRow(o)&&(A.current.publishEvent(X,A.current.getRowParams(o),he),Z&&Z(he))},[A,o]),ae=E.useCallback(X=>{const Z=Uxe(X.target,Ie.cell),he=Z==null?void 0:Z.getAttribute("data-field");he&&(he===wb.field||he===AN||he==="__reorder__"||A.current.getCellMode(o,he)===an.Edit||A.current.getColumn(he).type===TN)||J("rowClick",_)(X)},[A,_,J,o]),ve=E.useCallback((X,Z)=>{var he;const Y=A.current.getCellParams(o,X.field),ne=[],se=F.disableColumnReorder&&X.disableReorder||!F.rowReordering&&!!k.length&&U>1&&Object.keys(w).length>0;X.cellClassName&&ne.push(vn(typeof X.cellClassName=="function"?X.cellClassName(Y):X.cellClassName));const xe=w[o]?w[o][X.field]:null;let Pe=null;if(xe==null&&X.renderCell){var z;Pe=X.renderCell(O({},Y,{api:A.current})),ne.push(vn(Ie["cell--withRenderer"],(z=F.classes)==null?void 0:z["cell--withRenderer"]))}if(xe!=null&&X.renderEditCell){var H;let de=s;A.current.unstable_getRowWithUpdatedValues&&(de=A.current.unstable_getRowWithUpdatedValues(o,X.field));const ue=Be(xe,kSe),ge=O({},Y,{row:de},ue,{api:A.current});Pe=X.renderEditCell(ge),ne.push(vn(Ie["cell--editing"],(H=F.classes)==null?void 0:H["cell--editing"]))}F.getCellClassName&&ne.push(F.getCellClassName(Y));const te=b!==null&&b.id===o&&b.field===X.field,le=m!==null&&m.id===o&&m.field===X.field&&Y.cellMode==="view"?0:-1;return D.jsx(F.components.Cell,O({value:Y.value,field:X.field,width:Z.width,rowId:o,height:c,showRightBorder:Z.showRightBorder,formattedValue:Y.formattedValue,align:X.align||"left",cellMode:Y.cellMode,colIndex:Z.indexRelativeToAllColumns,isEditable:Y.isEditable,hasFocus:te,tabIndex:le,className:vn(ne),colSpan:Z.colSpan,disableDragEvents:se},(he=F.componentsProps)==null?void 0:he.cell,{children:Pe}),X.field)},[A,m,w,b,F,s,c,o,U,k.length]),fe=A.current.unstable_getRowInternalSizes(o);let Me=c;if(Me==="auto"&&fe){let X=0;const Z=Object.entries(fe).reduce((he,[Y,ne])=>/^base[A-Z]/.test(Y)?(X+=1,ne>he?ne:he):he,0);Z>0&&X>1&&(Me=Z)}const ye=O({},l,{maxHeight:c==="auto"?"none":c,minHeight:Me});if(fe!=null&&fe.spacingTop){const X=F.rowSpacingType==="border"?"borderTopWidth":"marginTop";ye[X]=fe.spacingTop}if(fe!=null&&fe.spacingBottom){const X=F.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let Z=ye[X];typeof Z!="number"&&(Z=parseInt(Z||"0",10)),Z+=fe.spacingBottom,ye[X]=Z}const we=A.current.unstable_applyPipeProcessors("rowClassName",[],o);if(typeof F.getRowClassName=="function"){var Fe;const X=a-(((Fe=$.range)==null?void 0:Fe.firstRowIndex)||0),Z=O({},A.current.getRowParams(o),{isFirstVisible:X===0,isLastVisible:X===$.rows.length-1,indexRelativeToCurrentPage:X});we.push(F.getRowClassName(Z))}const Oe=Pwe(1e4,20,80),re=[];for(let X=0;X0&&D.jsx(BSe,{width:_e})]}))}),g8=1e3;class zSe{constructor(e=g8){this.timeouts=new Map,this.cleanupTimeout=g8,this.cleanupTimeout=e}register(e,n,r){this.timeouts||(this.timeouts=new Map);const i=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,i)}unregister(e){const n=this.timeouts.get(e.cleanupToken);n&&(this.timeouts.delete(e.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((e,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class USe{constructor(){this.registry=new FinalizationRegistry(e=>{typeof e=="function"&&e()})}register(e,n,r){this.registry.register(e,n,r)}unregister(e){this.registry.unregister(e)}reset(){}}var ad;(function(t){t.DataGrid="DataGrid",t.DataGridPro="DataGridPro"})(ad||(ad={}));class HSe{}function VSe(t){let e=0;return function(r,i,o,s){t.registry===null&&(t.registry=typeof FinalizationRegistry<"u"?new USe:new zSe);const[a]=E.useState(new HSe),l=E.useRef(null),u=E.useRef();u.current=o;const c=E.useRef(null);if(!l.current&&u.current){const d=(f,h,p)=>{if(!h.defaultMuiPrevented){var g;(g=u.current)==null||g.call(u,f,h,p)}};l.current=r.current.subscribeEvent(i,d,s),e+=1,c.current={cleanupToken:e},t.registry.register(a,()=>{var f;(f=l.current)==null||f.call(l),l.current=null,c.current=null},c.current)}else!u.current&&l.current&&(l.current(),l.current=null,c.current&&(t.registry.unregister(c.current),c.current=null));E.useEffect(()=>{if(!l.current&&u.current){const d=(f,h,p)=>{if(!h.defaultMuiPrevented){var g;(g=u.current)==null||g.call(u,f,h,p)}};l.current=r.current.subscribeEvent(i,d,s)}return c.current&&t.registry&&(t.registry.unregister(c.current),c.current=null),()=>{var d;(d=l.current)==null||d.call(l),l.current=null}},[r,i,s])}}const GSe={registry:null},ct=VSe(GSe),jSe={isFirst:!0};function dn(t,e,n){ct(t,e,n,jSe)}const v8=1,WSe=1.5,qSe=t=>{const{scrollDirection:e,classes:n}=t,r={root:["scrollArea",`scrollArea--${e}`]};return Qe(r,ln,n)},XSe=ze("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(t,e)=>[{[`&.${Ie["scrollArea--left"]}`]:e["scrollArea--left"]},{[`&.${Ie["scrollArea--right"]}`]:e["scrollArea--right"]},e.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${Ie["scrollArea--left"]}`]:{left:0},[`&.${Ie["scrollArea--right"]}`]:{right:0}}));function KSe(t){const{scrollDirection:e}=t,n=E.useRef(null),r=Lt(),i=E.useRef(),[o,s]=E.useState(!1),a=gt(r,Fj),l=E.useRef({left:0,top:0}),u=mt(),c=O({},u,{scrollDirection:e}),d=qSe(c),f=E.useCallback(g=>{l.current=g},[]),h=E.useCallback(g=>{let b;if(e==="left")b=g.clientX-n.current.getBoundingClientRect().right;else if(e==="right")b=Math.max(1,g.clientX-n.current.getBoundingClientRect().left);else throw new Error("MUI: Wrong drag direction");b=(b-v8)*WSe+v8,clearTimeout(i.current),i.current=setTimeout(()=>{r.current.scroll({left:l.current.left+b,top:l.current.top})})},[e,r]);E.useEffect(()=>()=>{clearTimeout(i.current)},[]);const p=E.useCallback(()=>{s(g=>!g)},[]);return ct(r,"rowsScroll",f),ct(r,"columnHeaderDragStart",p),ct(r,"columnHeaderDragEnd",p),o?D.jsx(XSe,{ref:n,className:vn(d.root),ownerState:c,onDragOver:h,style:{height:a}}):null}const y8=E.memo(KSe),YSe=({apiRef:t,props:e,children:n})=>D.jsx(Ej.Provider,{value:e,children:D.jsx(Cj.Provider,{value:t,children:n})}),ZSe=Twe()&&window.localStorage.getItem("DEBUG")!=null,K0=()=>{},QSe={debug:K0,info:K0,warn:K0,error:K0},b8=["debug","info","warn","error"];function x8(t,e,n=console){const r=b8.indexOf(e);if(r===-1)throw new Error(`MUI: Log level ${e} not recognized.`);return b8.reduce((o,s,a)=>(a>=r?o[s]=(...l)=>{const[u,...c]=l;n[s](`MUI: ${t} - ${u}`,...c)}:o[s]=K0,o),{})}const JSe=(t,e)=>{t.current.getLogger=E.useCallback(n=>ZSe?x8(n,"debug",e.logger):e.logLevel?x8(n,e.logLevel.toString(),e.logger):QSe,[e.logLevel,e.logger])};function In(t,e,n){const r=E.useRef(e),[i]=E.useState(Object.keys(e)),o=E.useCallback(()=>{t.current&&i.forEach(s=>{t.current.hasOwnProperty(s)||(t.current[s]=(...a)=>r.current[s](...a))})},[i,t]);E.useEffect(()=>{r.current=e},[e]),E.useEffect(()=>{o()},[o]),o()}class eCe{constructor(){this.maxListeners=10,this.warnOnce=!1,this.events={}}on(e,n,r={}){let i=this.events[e];i||(i={highPriority:new Map,regular:new Map},this.events[e]=i),r.isFirst?i.highPriority.set(n,!0):i.regular.set(n,!0)}removeListener(e,n){this.events[e]&&(this.events[e].regular.delete(n),this.events[e].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(e,...n){const r=this.events[e];if(!r)return;const i=Array.from(r.highPriority.keys()),o=Array.from(r.regular.keys());for(let s=i.length-1;s>=0;s-=1){const a=i[s];r.highPriority.has(a)&&a.apply(this,n)}for(let s=0;st.isPropagationStopped!==void 0;let w8=0;function nCe(t,e){const n=E.useRef();n.current||(n.current={unstable_eventManager:new eCe,unstable_caches:{},state:{},instanceId:w8},w8+=1),E.useImperativeHandle(t,()=>n.current,[n]);const r=E.useCallback((...s)=>{const[a,l,u={}]=s;if(u.defaultMuiPrevented=!1,tCe(u)&&u.isPropagationStopped())return;const c=e.signature===ad.DataGridPro?{api:n.current}:{};n.current.unstable_eventManager.emit(a,l,u,c)},[n,e.signature]),i=E.useCallback((s,a,l)=>{n.current.unstable_eventManager.on(s,a,l);const u=n.current;return()=>{u.unstable_eventManager.removeListener(s,a)}},[n]),o=E.useCallback(s=>{n.current.publishEvent("componentError",s)},[n]);return In(n,{subscribeEvent:i,publishEvent:r,showError:o}),E.useEffect(()=>{const s=n.current;return()=>{Bbe(s.instanceId),s.publishEvent("unmount")}},[n]),n}function rCe(t,e){const n=E.useCallback(r=>{t.current.setState(i=>O({},i,{error:r}))},[t]);E.useEffect(()=>{e.error?n({error:e.error}):n(null)},[n,e.error]),ct(t,"componentError",n)}const iCe=(t,e)=>{const n=E.useCallback(r=>{if(e.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return e.localeText[r]},[e.localeText]);t.current.getLocaleText=n},oCe=t=>{const e=E.useRef({}),n=E.useCallback(l=>{l&&Object.values(l.appliers).forEach(u=>{u()})},[]),r=E.useCallback((l,u,c)=>{e.current[l]||(e.current[l]={processors:new Map,appliers:{}});const d=e.current[l];return d.processors.get(u)!==c&&(d.processors.set(u,c),n(d)),()=>{e.current[l].processors.set(u,null)}},[n]),i=E.useCallback((l,u,c)=>(e.current[l]||(e.current[l]={processors:new Map,appliers:{}}),e.current[l].appliers[u]=c,()=>{const d=e.current[l].appliers,f=Be(d,[u].map(Lm));e.current[l].appliers=f}),[]),o=E.useCallback(l=>{const u=e.current[l];n(u)},[n]),s=E.useCallback((...l)=>{const[u,c,d]=l;return e.current[u]?Array.from(e.current[u].processors.values()).reduce((h,p)=>p?p(h,d):h,c):c},[]);In(t,{unstable_registerPipeProcessor:r,unstable_registerPipeApplier:i,unstable_requestPipeProcessorsApplication:o,unstable_applyPipeProcessors:s})},_b=t=>{const e=E.useRef(!0);e.current&&(e.current=!1,t())},Pi=(t,e,n)=>{const r=E.useRef(),i=E.useRef(`mui-${Math.round(Math.random()*1e9)}`),o=E.useCallback(()=>{r.current=t.current.unstable_registerPipeProcessor(e,i.current,n)},[t,n,e]);_b(()=>{o()});const s=E.useRef(!0);E.useEffect(()=>(s.current?s.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])},PN=(t,e,n)=>{const r=E.useRef(),i=E.useRef(`mui-${Math.round(Math.random()*1e9)}`),o=E.useCallback(()=>{r.current=t.current.unstable_registerPipeApplier(e,i.current,n)},[t,n,e]);_b(()=>{o()});const s=E.useRef(!0);E.useEffect(()=>(s.current?s.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])},DN=(t,e,n,r)=>{const i=E.useCallback(()=>{t.current.unstable_registerStrategyProcessor(e,n,r)},[t,r,n,e]);_b(()=>{i()});const o=E.useRef(!0);E.useEffect(()=>{o.current?o.current=!1:i()},[i])},Sb="none",_8={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree"},sCe=t=>{const e=E.useRef(new Map),n=E.useRef({}),r=E.useCallback((l,u,c)=>{const d=()=>{const p=n.current[u],g=Be(p,[l].map(Lm));n.current[u]=g};n.current[u]||(n.current[u]={});const f=n.current[u],h=f[l];return f[l]=c,!h||h===c||l===t.current.unstable_getActiveStrategy(_8[u])&&t.current.publishEvent("activeStrategyProcessorChange",u),d},[t]),i=E.useCallback((l,u)=>{const c=t.current.unstable_getActiveStrategy(_8[l]);if(c==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const d=n.current[l];if(!d||!d[c])throw new Error(`No processor found for processor "${l}" on strategy "${c}"`);const f=d[c];return f(u)},[t]),o=E.useCallback(l=>{var u;const d=Array.from(e.current.entries()).find(([,f])=>f.group!==l?!1:f.isAvailable());return(u=d==null?void 0:d[0])!=null?u:Sb},[]),s=E.useCallback((l,u,c)=>{e.current.set(u,{group:l,isAvailable:c}),t.current.publishEvent("strategyAvailabilityChange")},[t]);In(t,{unstable_registerStrategyProcessor:r,unstable_applyStrategyProcessor:i,unstable_getActiveStrategy:o,unstable_setStrategyAvailability:s})},aCe=(t,e,n,r,i)=>{const o=Jr(t,"useNativeEventListener"),[s,a]=E.useState(!1),l=E.useRef(r),u=E.useCallback(c=>l.current&&l.current(c),[]);E.useEffect(()=>{l.current=r},[r]),E.useEffect(()=>{let c;if(Jj(e)?c=e():c=e&&e.current?e.current:null,c&&n&&!s){o.debug(`Binding native ${n} event`),c.addEventListener(n,u,i);const d=c;a(!0);const f=()=>{o.debug(`Clearing native ${n} event`),d.removeEventListener(n,u,i)};t.current.subscribeEvent("unmount",f)}},[e,u,n,s,o,i,t])},lCe=["stateId"],uCe=(t,e)=>{const n=E.useRef({}),[,r]=E.useState(),i=E.useCallback(u=>{const{stateId:c}=u,d=Be(u,lCe);n.current[c]=O({},d,{stateId:c})},[]),o=E.useCallback((u,c)=>{let d;if(Jj(u)?d=u(t.current.state):d=u,t.current.state===d)return!1;let f=!1;const h=[];if(Object.keys(n.current).forEach(p=>{const g=n.current[p],b=g.stateSelector(t.current.state,t.current.instanceId),m=g.stateSelector(d,t.current.instanceId);m!==b&&(h.push({stateId:g.stateId,hasPropChanged:m!==g.propModel}),g.propModel!==void 0&&m!==g.propModel&&(f=!0))}),h.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${h[0].stateId}, therefore, you're not allowed to update ${h.map(p=>p.stateId).join(", ")} in the same transaction.`);if(f||(t.current.state=d,t.current.publishEvent&&t.current.publishEvent("stateChange",d)),h.length===1){const{stateId:p,hasPropChanged:g}=h[0],b=n.current[p],m=b.stateSelector(d,t.current.instanceId);if(b.propOnChange&&g){const w=e.signature===ad.DataGridPro?{api:t.current,reason:c}:{reason:c};b.propOnChange(m,w)}f||t.current.publishEvent(b.changeEvent,m,{reason:c})}return!f},[t,e.signature]),s=E.useCallback((u,c,d)=>t.current.setState(f=>O({},f,{[u]:c(f[u])}),d),[t]),a=E.useCallback(()=>r(()=>t.current.state),[t]);In(t,{setState:o,forceUpdate:a,unstable_updateControlState:s,unstable_registerControlState:i})},cCe=(t,e)=>{const n=nCe(t,e);return JSe(n,e),rCe(n,e),uCe(n,e),oCe(n),sCe(n),iCe(n,e),n},cs=(t,e,n)=>{const r=E.useRef(!1);r.current||(e.current.state=t(e.current.state,n,e),r.current=!0)};function S8(t){const e=document.createElement("span");e.style.whiteSpace="pre",e.style.userSelect="all",e.style.opacity="0px",e.textContent=t,document.body.appendChild(e);const n=document.createRange();n.selectNode(e);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(e)}}function dCe(t){var e;return((e=window.getSelection())==null?void 0:e.toString())!==""?!0:t?(t.selectionEnd||0)-(t.selectionStart||0)>0:!1}const fCe=t=>{const e=E.useCallback((i=!1)=>{if(t.current.getSelectedRows().size===0)return;const o=t.current.getDataAsCsv({includeHeaders:i,delimiter:" "});navigator.clipboard?navigator.clipboard.writeText(o).catch(()=>{S8(o)}):S8(o)},[t]),n=E.useCallback(i=>{const o=i.ctrlKey||i.metaKey||i.altKey;String.fromCharCode(i.keyCode)!=="C"||!o||dCe(i.target)||t.current.unstable_copySelectedRowsToClipboard(i.altKey)},[t]);aCe(t,t.current.rootElementRef,"keydown",n),In(t,{unstable_copySelectedRowsToClipboard:e})},dW=t=>t.columnMenu,hCe=t=>O({},t,{columnMenu:{open:!1}}),pCe=t=>{const e=Jr(t,"useGridColumnMenu"),n=E.useCallback(a=>{t.current.setState(u=>u.columnMenu.open&&u.columnMenu.field===a?u:(e.debug("Opening Column Menu"),O({},u,{columnMenu:{open:!0,field:a}})))&&(t.current.hidePreferences(),t.current.forceUpdate())},[t,e]),r=E.useCallback(()=>{t.current.setState(l=>!l.columnMenu.open&&l.columnMenu.field===void 0?l:(e.debug("Hiding Column Menu"),O({},l,{columnMenu:O({},l.columnMenu,{open:!1,field:void 0})})))&&t.current.forceUpdate()},[t,e]),i=E.useCallback(a=>{e.debug("Toggle Column Menu");const l=dW(t.current.state);!l.open||l.field!==a?n(a):r()},[t,e,n,r]);In(t,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:i});const s=E.useCallback((a,l)=>{if(!l.target.classList.contains(Ie.menuIconButton)||!l.relatedTarget)return;const u=l.relatedTarget.classList.contains(Ie.menuList),c=l.relatedTarget.getAttribute("role")==="menuitem";(u||c)&&t.current.setColumnHeaderFocus(a.field)},[t]);ct(t,"columnResizeStart",r),ct(t,"columnHeaderFocus",s),ct(t,"virtualScrollerWheel",t.current.hideColumnMenu),ct(t,"virtualScrollerTouchMove",t.current.hideColumnMenu)},mCe=(t,e,n)=>{var r,i,o,s,a,l,u;const c=!!e.columnVisibilityModel||!!((r=e.initialState)!=null&&(i=r.columns)!=null&&i.columnVisibilityModel);n.current.unstable_caches.columns={isUsingColumnVisibilityModel:c};const d=oW(e.columnTypes),f=gp({apiRef:n,columnTypes:d,columnsToUpsert:e.columns,initialState:(o=e.initialState)==null?void 0:o.columns,shouldRegenColumnVisibilityModelFromColumns:!c,currentColumnVisibilityModel:(s=(a=e.columnVisibilityModel)!=null?a:(l=e.initialState)==null||(u=l.columns)==null?void 0:u.columnVisibilityModel)!=null?s:{},keepOnlyColumnsToUpsert:!0});return O({},t,{columns:f})};function gCe(t,e){var n,r;const i=Jr(t,"useGridColumns"),o=E.useMemo(()=>oW(e.columnTypes),[e.columnTypes]),s=E.useRef(e.columns),a=E.useRef(o);t.current.unstable_registerControlState({stateId:"visibleColumns",propModel:e.columnVisibilityModel,propOnChange:e.onColumnVisibilityModelChange,stateSelector:Tu,changeEvent:"columnVisibilityModelChange"});const l=E.useCallback(j=>{i.debug("Updating columns state."),t.current.setState(h8(j)),t.current.forceUpdate(),t.current.publishEvent("columnsChange",j.all)},[i,t]),u=E.useCallback(j=>th(t)[j],[t]),c=E.useCallback(()=>Wa(t),[t]),d=E.useCallback(()=>lo(t),[t]),f=E.useCallback(()=>Wbe(t),[t]),h=E.useCallback((j,k=!0)=>(k?lo(t):Wa(t)).findIndex(G=>G.field===j),[t]),p=E.useCallback(j=>{const k=h(j);return zf(t)[k]},[t,h]),g=E.useCallback(j=>{Tu(t)!==j&&(t.current.setState(U=>O({},U,{columns:gp({apiRef:t,columnTypes:o,columnsToUpsert:[],initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!1,currentColumnVisibilityModel:j,keepOnlyColumnsToUpsert:!1})})),t.current.forceUpdate())},[t,o]),b=E.useCallback(j=>{const k=gp({apiRef:t,columnTypes:o,columnsToUpsert:j,initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!0,keepOnlyColumnsToUpsert:!1});l(k)},[t,l,o]),m=E.useCallback(j=>t.current.updateColumns([j]),[t]),w=E.useCallback((j,k)=>{if(t.current.unstable_caches.columns.isUsingColumnVisibilityModel){var U;const G=Tu(t),B=(U=G[j])!=null?U:!0;if(k!==B){const L=O({},G,{[j]:k});t.current.setColumnVisibilityModel(L)}}else{const G=t.current.getColumn(j),B=O({},G,{hide:!k});t.current.updateColumns([B]);const L={field:j,colDef:B,isVisible:k};t.current.publishEvent("columnVisibilityChange",L)}},[t]),x=E.useCallback((j,k)=>{const U=Wm(t),G=U.findIndex(W=>W===j);if(G===k)return;i.debug(`Moving column ${j} to index ${k}`);const B=[...U],L=B.splice(G,1)[0];B.splice(k,0,L),l(O({},$f(t.current.state),{all:B}));const N={field:j,element:t.current.getColumnHeaderElement(j),colDef:t.current.getColumn(j),targetIndex:k,oldIndex:G};t.current.publishEvent("columnOrderChange",N)},[t,i,l]),_=E.useCallback((j,k)=>{i.debug(`Updating column ${j} width to ${k}`);const U=t.current.getColumn(j),G=O({},U,{width:k});t.current.updateColumns([G]),t.current.publishEvent("columnWidthChange",{element:t.current.getColumnHeaderElement(j),colDef:G,width:k})},[t,i]);In(t,{getColumn:u,getAllColumns:c,getColumnIndex:h,getColumnPosition:p,getVisibleColumns:d,getColumnsMeta:f,updateColumn:m,updateColumns:b,setColumnVisibilityModel:g,setColumnVisibility:w,setColumnIndex:x,setColumnWidth:_});const S=E.useCallback((j,k)=>{const U={};if(t.current.unstable_caches.columns.isUsingColumnVisibilityModel){var G,B,L;const K=Tu(t);(!k.exportOnlyDirtyModels||e.columnVisibilityModel!=null||Object.keys((G=(B=e.initialState)==null||(L=B.columns)==null?void 0:L.columnVisibilityModel)!=null?G:{}).length>0||Object.keys(K).length>0)&&(U.columnVisibilityModel=K)}U.orderedFields=Wm(t);const N=Wa(t),W={};return N.forEach(K=>{if(K.hasBeenResized){const Q={};iW.forEach(J=>{let ae=K[J];ae===1/0&&(ae=-1),Q[J]=ae}),W[K.field]=Q}}),Object.keys(W).length>0&&(U.dimensions=W),O({},j,{columns:U})},[t,e.columnVisibilityModel,(n=e.initialState)==null?void 0:n.columns]),M=E.useCallback((j,k)=>{var U;const G=t.current.unstable_caches.columns.isUsingColumnVisibilityModel?(U=k.stateToRestore.columns)==null?void 0:U.columnVisibilityModel:void 0,B=k.stateToRestore.columns;if(G==null&&B==null)return j;const L=gp({apiRef:t,columnTypes:o,columnsToUpsert:[],initialState:B,shouldRegenColumnVisibilityModelFromColumns:!t.current.unstable_caches.columns.isUsingColumnVisibilityModel,currentColumnVisibilityModel:G,keepOnlyColumnsToUpsert:!1});return t.current.setState(h8(L)),B!=null&&t.current.publishEvent("columnsChange",L.all),j},[t,o]),P=E.useCallback((j,k)=>{if(k===Ya.columns){var U;const G=e.components.ColumnsPanel;return D.jsx(G,O({},(U=e.componentsProps)==null?void 0:U.columnsPanel))}return j},[e.components.ColumnsPanel,(r=e.componentsProps)==null?void 0:r.columnsPanel]);Pi(t,"exportState",S),Pi(t,"restoreState",M),Pi(t,"preferencePanel",P);const A=E.useRef(null);ct(t,"viewportInnerSizeChange",j=>{A.current!==j.width&&(A.current=j.width,l(sW($f(t.current.state),j.width)))}),dn(t,"columnVisibilityChange",e.onColumnVisibilityChange);const F=E.useCallback(()=>{i.info("Columns pipe processing have changed, regenerating the columns");const j=gp({apiRef:t,columnTypes:o,columnsToUpsert:[],initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!t.current.unstable_caches.columns.isUsingColumnVisibilityModel,keepOnlyColumnsToUpsert:!1});l(j)},[t,i,l,o]);PN(t,"hydrateColumns",F);const $=E.useRef(!0);E.useEffect(()=>{if($.current){$.current=!1;return}if(i.info(`GridColumns have changed, new length ${e.columns.length}`),s.current===e.columns&&a.current===o)return;const j=gp({apiRef:t,columnTypes:o,initialState:void 0,shouldRegenColumnVisibilityModelFromColumns:!t.current.unstable_caches.columns.isUsingColumnVisibilityModel,columnsToUpsert:e.columns,keepOnlyColumnsToUpsert:!0});s.current=e.columns,a.current=o,l(j)},[i,t,l,e.columns,o]),E.useEffect(()=>{e.columnVisibilityModel!==void 0&&t.current.setColumnVisibilityModel(e.columnVisibilityModel)},[t,i,e.columnVisibilityModel])}const vCe=t=>t.columnGrouping,fW=wt(vCe,t=>t.lookup),yCe=["groupId","children"];function bCe(t){return t.groupPath!==void 0}const hW=(t,e,n)=>{if(kj(t)){if(n[t.field]!==void 0)throw new Error(["MUI: columnGroupingModel contains duplicated field",`column field ${t.field} occurrs two times in the grouping model:`,`- ${n[t.field].join(" > ")}`,`- ${e.join(" > ")}`].join(` +`));n[t.field]=e;return}const{groupId:r,children:i}=t;i.forEach(o=>{hW(o,[...e,r],n)})},pW=t=>{if(!t)return{};const e={};return t.forEach(n=>{hW(n,[],e)}),e},RN=t=>{let e={};return t.forEach(n=>{if(kj(n))return;const{groupId:r,children:i}=n,o=Be(n,yCe);if(!r)throw new Error("MUI: An element of the columnGroupingModel does not have either `field` or `groupId`.");i||console.warn(`MUI: group groupId=${r} has no children.`);const s=O({},o,{groupId:r}),a=RN(i);if(a[r]!==void 0||e[r]!==void 0)throw new Error(`MUI: The groupId ${r} is used multiple times in the columnGroupingModel.`);e=O({},e,a,{[r]:s})}),O({},e)},xCe=(t,e)=>{var n;const r=RN((n=e.columnGroupingModel)!=null?n:[]);return O({},t,{columnGrouping:{lookup:r,groupCollapsedModel:{}}})},wCe=(t,e)=>{var n;const r=E.useCallback(a=>{var l,u;return(l=(u=th(t)[a])==null?void 0:u.groupPath)!=null?l:[]},[t]),i=E.useCallback(()=>fW(t),[t]);In(t,{unstable_getColumnGroupPath:r,unstable_getAllGroupDetails:i});const s=E.useRef(!0);E.useEffect(()=>{var a,l;if(s.current){s.current=!1;return}if(!((a=e.experimentalFeatures)!=null&&a.columnGrouping))return;const u=RN((l=e.columnGroupingModel)!=null?l:[]);t.current.setState(c=>O({},c,{columnGrouping:O({},c.columnGrouping,{lookup:u})}))},[t,e.columnGroupingModel,(n=e.experimentalFeatures)==null?void 0:n.columnGrouping])},AT=.7,PT=1.3,mW=(t,e,n,r)=>{switch(t){case Cl.Compact:return{value:t,headerHeight:Math.floor(e*AT),rowHeight:Math.floor(n*AT),headerGroupingMaxDepth:r,factor:AT};case Cl.Comfortable:return{value:t,headerHeight:Math.floor(e*PT),rowHeight:Math.floor(n*PT),headerGroupingMaxDepth:r,factor:PT};default:return{value:t,headerHeight:e,rowHeight:n,headerGroupingMaxDepth:r,factor:1}}},_Ce=(t,e)=>{let n;if(e.columnGroupingModel==null||Object.keys(e.columnGroupingModel).length===0)n=0;else{const r=pW(e.columnGroupingModel),i=t.columns,o=i.all.filter(s=>i.columnVisibilityModel[s]!==!1);o.length===0?n=0:n=Math.max(...o.map(s=>{var a,l;return(a=(l=r[s])==null?void 0:l.length)!=null?a:0}))}return O({},t,{density:mW(e.density,e.headerHeight,e.rowHeight,n)})},SCe=(t,e)=>{const n=gt(t,lo),r=n.length>0?Math.max(...n.map(a=>{var l,u;return(l=(u=a.groupPath)==null?void 0:u.length)!=null?l:0})):0,i=Jr(t,"useDensity"),o=E.useCallback((a,l=e.headerHeight,u=e.rowHeight,c=r)=>{i.debug(`Set grid density to ${a}`),t.current.setState(d=>{const f=nh(d),h=mW(a,l,u,c);return qa(f,h)?d:O({},d,{density:h})}),t.current.forceUpdate()},[i,t,e.headerHeight,e.rowHeight,r]);E.useEffect(()=>{t.current.setDensity(e.density,e.headerHeight,e.rowHeight,r)},[t,e.density,e.rowHeight,e.headerHeight,r]),In(t,{setDensity:o})};function CCe(t,e="csv",n=document.title||"untitled"){const r=`${n}.${e}`;if("download"in HTMLAnchorElement.prototype){const i=URL.createObjectURL(t),o=document.createElement("a");o.href=i,o.download=r,o.click(),setTimeout(()=>{URL.revokeObjectURL(i)});return}throw new Error("MUI: exportAs not supported")}const gW=(t,e)=>{if(typeof t=="string"){const n=t.replace(/"/g,'""');return[e,` +`,"\r"].some(r=>n.includes(r))?`"${n}"`:n}return t};Qa(["MUI: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.","You can provide a `valueFormatter` with a string representation to be used."]);const ECe=(t,e,n,r)=>e.map(i=>{const o=n(t,i.field);return gW(o.formattedValue,r)});function MCe(t){const{columns:e,rowIds:n,getCellParams:r,delimiterCharacter:i,includeHeaders:o}=t,s=n.reduce((l,u)=>`${l}${ECe(u,e,r,i).join(i)}\r `,"").trim();return o?`${`${e.filter(l=>l.field!==wb.field).map(l=>gW(l.headerName||l.field,i)).join(i)}\r -`}${s}`.trim():s}const vW=({apiRef:t,options:e})=>{const n=qa(t);return e.fields?e.fields.map(i=>n.find(o=>o.field===i)).filter(i=>!!i):(e.allColumns?n:lo(t)).filter(i=>!i.disableExport)},TCe=({apiRef:t})=>{var e,n;const r=Ybe(t),i=$c(t),o=t.current.getSelectedRows(),s=r.filter(c=>{var d;return((d=i[c].position)!=null?d:"body")==="body"}),a=gb(t),l=(a==null||(e=a.top)==null?void 0:e.map(c=>c.id))||[],u=(a==null||(n=a.bottom)==null?void 0:n.map(c=>c.id))||[];return s.unshift(...l),s.push(...u),o.size>0?s.filter(c=>o.has(c)):s},ACe=t=>{const e=Jr(t,"useGridCsvExport"),n=E.useCallback((s={})=>{var a,l;e.debug("Get data as CSV");const u=vW({apiRef:t,options:s}),d=((a=s.getRowsToExport)!=null?a:TCe)({apiRef:t});return MCe({columns:u,rowIds:d,getCellParams:t.current.getCellParams,delimiterCharacter:s.delimiter||",",includeHeaders:(l=s.includeHeaders)!=null?l:!0})},[e,t]),r=E.useCallback(s=>{e.debug("Export data as CSV");const a=n(s),l=new Blob([s!=null&&s.utf8WithBom?new Uint8Array([239,187,191]):"",a],{type:"text/csv"});CCe(l,"csv",s==null?void 0:s.fileName)},[e,n]);In(t,{getDataAsCsv:n,exportDataAsCsv:r});const o=E.useCallback((s,a)=>{var l;return(l=a.csvOptions)!=null&&l.disableToolbarButton?s:[...s,{component:D.jsx(fSe,{options:a.csvOptions}),componentName:"csvExport"}]},[]);Pi(t,"exportMenu",o)},py=t=>t.rowsMeta;function PCe(){return new Promise(t=>{requestAnimationFrame(()=>{t()})})}function DCe(){const t=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return t?parseInt(t[2],10):null}const RCe=(t,e)=>{const n=Jr(t,"useGridPrintExport"),r=E.useRef(null),i=E.useRef(null),o=E.useRef({});E.useEffect(()=>{r.current=Sr(t.current.rootElementRef.current)},[t]);const s=E.useCallback((h,p)=>new Promise(g=>{if(!h&&!p){g();return}const b=vW({apiRef:t,options:{fields:h,allColumns:p}}).map(x=>x.field),m=qa(t),w={};m.forEach(x=>{w[x.field]=b.includes(x.field)}),t.current.setColumnVisibilityModel(w),g()}),[t]),a=E.useCallback(h=>{const p=document.createElement("iframe");return p.style.position="absolute",p.style.width="0px",p.style.height="0px",p.title=h||document.title,p},[]),l=E.useCallback((h,p)=>{var g,b;const m=O({copyStyles:!0,hideToolbar:!1,hideFooter:!1},p),w=h.contentDocument;if(!w)return;const x=bb(t),_=py(t.current.state),C=t.current.rootElementRef.current,S=C.cloneNode(!0),M=S.querySelector(`.${Ie.virtualScroller}`);M.style.height="auto",M.style.width="auto",M.parentElement.style.width="auto",M.parentElement.style.height="auto";const P=S.querySelector(`.${Ie.main}`);P.style.overflow="visible";const A=DCe();A&&A>=108&&(S.style.contain="size");const F=S.querySelector(`.${Ie.columnHeaders}`).querySelector(`.${Ie.columnHeadersInner}`);F.style.width="100%";let $=((g=C.querySelector(`.${Ie.toolbarContainer}`))==null?void 0:g.clientHeight)||0,j=((b=C.querySelector(`.${Ie.footerContainer}`))==null?void 0:b.clientHeight)||0;if(m.hideToolbar){var k;(k=S.querySelector(`.${Ie.toolbarContainer}`))==null||k.remove(),$=0}if(m.hideFooter){var U;(U=S.querySelector(`.${Ie.footerContainer}`))==null||U.remove(),j=0}S.style.height=`${_.currentPageTotalHeight+x+$+j}px`;const G=document.createElement("div");G.appendChild(S),w.body.innerHTML=G.innerHTML;const B=typeof m.pageStyle=="function"?m.pageStyle():m.pageStyle;if(typeof B=="string"){const L=w.createElement("style");L.appendChild(w.createTextNode(B)),w.head.appendChild(L)}if(m.bodyClassName&&w.body.classList.add(...m.bodyClassName.split(" ")),m.copyStyles){const L=r.current.querySelectorAll("style, link[rel='stylesheet']");for(let N=0;N{const n=Wa(t);return e.fields?e.fields.map(i=>n.find(o=>o.field===i)).filter(i=>!!i):(e.allColumns?n:lo(t)).filter(i=>!i.disableExport)},TCe=({apiRef:t})=>{var e,n;const r=Ybe(t),i=$c(t),o=t.current.getSelectedRows(),s=r.filter(c=>{var d;return((d=i[c].position)!=null?d:"body")==="body"}),a=gb(t),l=(a==null||(e=a.top)==null?void 0:e.map(c=>c.id))||[],u=(a==null||(n=a.bottom)==null?void 0:n.map(c=>c.id))||[];return s.unshift(...l),s.push(...u),o.size>0?s.filter(c=>o.has(c)):s},ACe=t=>{const e=Jr(t,"useGridCsvExport"),n=E.useCallback((s={})=>{var a,l;e.debug("Get data as CSV");const u=vW({apiRef:t,options:s}),d=((a=s.getRowsToExport)!=null?a:TCe)({apiRef:t});return MCe({columns:u,rowIds:d,getCellParams:t.current.getCellParams,delimiterCharacter:s.delimiter||",",includeHeaders:(l=s.includeHeaders)!=null?l:!0})},[e,t]),r=E.useCallback(s=>{e.debug("Export data as CSV");const a=n(s),l=new Blob([s!=null&&s.utf8WithBom?new Uint8Array([239,187,191]):"",a],{type:"text/csv"});CCe(l,"csv",s==null?void 0:s.fileName)},[e,n]);In(t,{getDataAsCsv:n,exportDataAsCsv:r});const o=E.useCallback((s,a)=>{var l;return(l=a.csvOptions)!=null&&l.disableToolbarButton?s:[...s,{component:D.jsx(fSe,{options:a.csvOptions}),componentName:"csvExport"}]},[]);Pi(t,"exportMenu",o)},py=t=>t.rowsMeta;function PCe(){return new Promise(t=>{requestAnimationFrame(()=>{t()})})}function DCe(){const t=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return t?parseInt(t[2],10):null}const RCe=(t,e)=>{const n=Jr(t,"useGridPrintExport"),r=E.useRef(null),i=E.useRef(null),o=E.useRef({});E.useEffect(()=>{r.current=Sr(t.current.rootElementRef.current)},[t]);const s=E.useCallback((h,p)=>new Promise(g=>{if(!h&&!p){g();return}const b=vW({apiRef:t,options:{fields:h,allColumns:p}}).map(x=>x.field),m=Wa(t),w={};m.forEach(x=>{w[x.field]=b.includes(x.field)}),t.current.setColumnVisibilityModel(w),g()}),[t]),a=E.useCallback(h=>{const p=document.createElement("iframe");return p.style.position="absolute",p.style.width="0px",p.style.height="0px",p.title=h||document.title,p},[]),l=E.useCallback((h,p)=>{var g,b;const m=O({copyStyles:!0,hideToolbar:!1,hideFooter:!1},p),w=h.contentDocument;if(!w)return;const x=bb(t),_=py(t.current.state),C=t.current.rootElementRef.current,S=C.cloneNode(!0),M=S.querySelector(`.${Ie.virtualScroller}`);M.style.height="auto",M.style.width="auto",M.parentElement.style.width="auto",M.parentElement.style.height="auto";const P=S.querySelector(`.${Ie.main}`);P.style.overflow="visible";const A=DCe();A&&A>=108&&(S.style.contain="size");const F=S.querySelector(`.${Ie.columnHeaders}`).querySelector(`.${Ie.columnHeadersInner}`);F.style.width="100%";let $=((g=C.querySelector(`.${Ie.toolbarContainer}`))==null?void 0:g.clientHeight)||0,j=((b=C.querySelector(`.${Ie.footerContainer}`))==null?void 0:b.clientHeight)||0;if(m.hideToolbar){var k;(k=S.querySelector(`.${Ie.toolbarContainer}`))==null||k.remove(),$=0}if(m.hideFooter){var U;(U=S.querySelector(`.${Ie.footerContainer}`))==null||U.remove(),j=0}S.style.height=`${_.currentPageTotalHeight+x+$+j}px`;const G=document.createElement("div");G.appendChild(S),w.body.innerHTML=G.innerHTML;const B=typeof m.pageStyle=="function"?m.pageStyle():m.pageStyle;if(typeof B=="string"){const L=w.createElement("style");L.appendChild(w.createTextNode(B)),w.head.appendChild(L)}if(m.bodyClassName&&w.body.classList.add(...m.bodyClassName.split(" ")),m.copyStyles){const L=r.current.querySelectorAll("style, link[rel='stylesheet']");for(let N=0;N{var p,g;r.current.body.removeChild(h),t.current.restoreState(i.current||{}),(p=i.current)!=null&&(g=p.columns)!=null&&g.columnVisibilityModel||t.current.setColumnVisibilityModel(o.current),t.current.unstable_enableVirtualization(),i.current=null,o.current={}},[t]),d={exportDataAsPrint:E.useCallback(async h=>{if(n.debug("Export data as Print"),!t.current.rootElementRef.current)throw new Error("MUI: No grid root element available.");if(i.current=t.current.exportState(),o.current=Tu(t),e.pagination){const g=Dj(t);t.current.setPageSize(g)}await s(h==null?void 0:h.fields,h==null?void 0:h.allColumns),t.current.unstable_disableVirtualization(),await PCe();const p=a(h==null?void 0:h.fileName);p.onload=()=>{l(p,h),p.contentWindow.matchMedia("print").addEventListener("change",b=>{b.matches===!1&&u(p)})},r.current.body.appendChild(p)},[e,n,t,a,l,u,s])};In(t,d);const f=E.useCallback((h,p)=>{var g;return(g=p.printOptions)!=null&&g.disableToolbarButton?h:[...h,{component:D.jsx(hSe,{options:p.printOptions}),componentName:"printExport"}]},[]);Pi(t,"exportMenu",f)},ICe=["rowsBeforePartialUpdates"];function NCe(t,e,n="A row was provided without id in the rows prop:"){if(t==null)throw new Error(["MUI: The data grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(e)].join(` -`))}const PD=(t,e,n)=>{const r=e?e(t):t.id;return NCe(r,t,n),r},n_=({rows:t,getRowId:e,loading:n,rowCount:r})=>{const i={rowsBeforePartialUpdates:t,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,idRowsLookup:{},idToIdLookup:{},ids:[]};for(let o=0;o{const i=t.current.unstable_caches.rows,o=Be(i,ICe),s=n??0,a=t.current.unstable_applyStrategyProcessor("rowTreeCreation",O({},o,{previousTree:e})),l=t.current.unstable_applyPipeProcessors("hydrateRows",a),u=l.treeDepth===1?l.ids.length:Object.values(l.tree).filter(c=>c.parent==null&&!c.isPinned).length;return O({},l,{groupingResponseBeforeRowHydration:a,loading:r,totalRowCount:Math.max(s,l.ids.length),totalTopLevelRowCount:Math.max(s,u)})},bW=(t,e,n)=>{var r;const i=(r=t[e])==null?void 0:r.children;if(i==null)return[];const o=[];for(let s=0;s(s+=t.current.unstable_getRowHeight(a.id),s),0))||0,o=(r==null||(n=r.bottom)==null?void 0:n.reduce((s,a)=>(s+=t.current.unstable_getRowHeight(a.id),s),0))||0;return{top:i,bottom:o}}const DD=(t,e)=>{const n=O({},t);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operatorValue==null){const r=th(e)[n.columnField];n.operatorValue=r&&r.filterOperators[0].value}return n},FCe=Ja(["MUI: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),OCe=Ja("MUI: The 'id' field is required on `filterModel.items` when you use multiple filters.","error"),kCe=Ja(["MUI: One of your filtering item have no `operatorValue` provided.","This property will become required on `@mui/x-data-grid@6.X`."]),wW=(t,e,n)=>{const r=t.items.length>1;let i;r&&e?(FCe(),i=[t.items[0]]):i=t.items;const o=r&&i.some(a=>a.id==null),s=i.some(a=>a.operatorValue==null);return o&&OCe(),s&&kCe(),s||o?O({},t,{items:i.map(a=>DD(a,n))}):t.items!==i?O({},t,{items:i}):t},C8=(t,e,n)=>r=>O({},r,{filterModel:wW(t,e,n)}),_W=(t,e)=>{if(!t.columnField||!t.operatorValue)return null;const n=e.current.getColumn(t.columnField);if(!n)return null;let r;if(n.valueParser){var i;const c=n.valueParser;r=Array.isArray(t.value)?(i=t.value)==null?void 0:i.map(d=>c(d)):c(t.value)}else r=t.value;const o=O({},t,{value:r}),s=n.filterOperators;if(!(s!=null&&s.length))throw new Error(`MUI: No filter operators found for column '${n.field}'.`);const a=s.find(c=>c.value===o.operatorValue);if(!a)throw new Error(`MUI: No filter operator found for column '${n.field}' and operator value '${o.operatorValue}'.`);const l=a.getApplyFilterFn(o,n);return typeof l!="function"?null:{fn:c=>{const d=e.current.getCellParams(c,o.columnField);return l(d)},item:o}},LCe=(t,e)=>{const{items:n}=t,r=n.map(i=>_W(i,e)).filter(i=>!!i);return r.length===0?null:(i,o)=>{const s={};return(o?r.filter(l=>o(l.item.columnField)):r).forEach(l=>{s[l.item.id]=l.fn(i)}),s}},BCe=(t,e)=>{const{quickFilterValues:n=[]}=t;if(n.length===0)return null;const r=Wm(e),i={};r.forEach(s=>{const a=e.current.getColumn(s),l=a==null?void 0:a.getApplyQuickFilterFn;l&&(i[s]=n.map(u=>l(u,a,e)))});const o=n.filter((s,a)=>Object.keys(i).some(l=>i[l][a]!=null));return o.length===0?null:(s,a)=>{const l={},u=[];Object.keys(i).forEach(d=>{(!a||a(d))&&(l[d]=e.current.getCellParams(s,d),u.push(d))});const c={};return o.forEach((d,f)=>{const h=u.some(p=>{var g,b;return i[p][f]==null?!1:(g=(b=i[p])[f])==null?void 0:g.call(b,l[p])});c[d]=h}),c}},$Ce=(t,e)=>{const n=LCe(t,e),r=BCe(t,e);return(i,o)=>({passingFilterItems:n&&n(i,o),passingQuickFilterValues:r&&r(i,o)})},zCe=(t,e,n,r)=>{var i,o;const s=n.items.filter(d=>_W(d,r)!==null),a=t.filter(d=>d!=null),l=e.filter(d=>d!=null),u=(i=n.quickFilterLogicOperator)!=null?i:hy().quickFilterLogicOperator,c=(o=n.linkOperator)!=null?o:hy().linkOperator;if(a.length>0){const d=f=>a.some(h=>h[f.id]);if(c===So.And){if(!s.every(d))return!1}else if(!s.some(d))return!1}if(l.length>0&&n.quickFilterValues!=null){const d=f=>l.some(h=>h[f]);if(u===So.And){if(!n.quickFilterValues.every(d))return!1}else if(!n.quickFilterValues.some(d))return!1}return!0},UCe=(t,e,n)=>{var r,i,o,s;const a=(r=(i=e.filterModel)!=null?i:(o=e.initialState)==null||(s=o.filter)==null?void 0:s.filterModel)!=null?r:hy();return O({},t,{filter:{filterModel:wW(a,e.disableMultipleColumnsFiltering,n),visibleRowsLookup:{},filteredDescendantCountLookup:{}}})},HCe=(t,e)=>{var n,r,i;const o=Jr(t,"useGridFilter");t.current.unstable_registerControlState({stateId:"filter",propModel:e.filterModel,propOnChange:e.onFilterModelChange,stateSelector:Lo,changeEvent:"filterModelChange"});const s=E.useCallback(()=>{t.current.setState(P=>{const A=Lo(P,t.current.instanceId),R=e.filterMode===bm.client?$Ce(A,t):null,F=t.current.unstable_applyStrategyProcessor("filtering",{isRowMatchingFilters:R,filterModel:A??hy()});return O({},P,{filter:O({},P.filter,F)})}),t.current.publishEvent("filteredRowsSet")},[e.filterMode,t]),a=E.useCallback(()=>{s(),t.current.forceUpdate()},[t,s]),l=E.useCallback(P=>{const A=Lo(t),R=[...A.items],F=R.findIndex($=>$.id===P.id);F===-1?R.push(P):R[F]=P,t.current.setFilterModel(O({},A,{items:R}),"upsertFilterItem")},[t]),u=E.useCallback(P=>{const A=Lo(t),R=[...A.items];P.forEach(F=>{const $=P.findIndex(j=>j.id===F.id);$===-1?R.push(F):R[$]=F}),t.current.setFilterModel(O({},A,{items:P}),"upsertFilterItems")},[t]),c=E.useCallback(P=>{const A=Lo(t),R=A.items.filter(F=>F.id!==P.id);R.length!==A.items.length&&t.current.setFilterModel(O({},A,{items:R}),"deleteFilterItem")},[t]),d=E.useCallback(P=>{if(o.debug("Displaying filter panel"),P){const A=Lo(t),R=A.items.filter(j=>{var k;if(j.value!==void 0)return!0;const G=(k=t.current.getColumn(j.columnField).filterOperators)==null?void 0:k.find(L=>L.value===j.operatorValue);return!(typeof(G==null?void 0:G.requiresFilterValue)>"u"?!0:G==null?void 0:G.requiresFilterValue)});let F;R.find(j=>j.columnField===P)?F=R:e.disableMultipleColumnsFiltering?F=[DD({columnField:P},t)]:F=[...R,DD({columnField:P},t)],t.current.setFilterModel(O({},A,{items:F}))}t.current.showPreferences(Za.filters)},[t,o,e.disableMultipleColumnsFiltering]),f=E.useCallback(()=>{o.debug("Hiding filter panel"),t.current.hidePreferences()},[t,o]),h=E.useCallback(P=>{const A=Lo(t);A.linkOperator!==P&&t.current.setFilterModel(O({},A,{linkOperator:P}),"changeLogicOperator")},[t]),p=E.useCallback(P=>{const A=Lo(t);Xa(A.quickFilterValues,P)||t.current.setFilterModel(O({},A,{quickFilterValues:[...P]}))},[t]),g=E.useCallback((P,A)=>{Lo(t)!==P&&(o.debug("Setting filter model"),t.current.unstable_updateControlState("filter",C8(P,e.disableMultipleColumnsFiltering,t),A),t.current.unstable_applyFilters())},[t,o,e.disableMultipleColumnsFiltering]),b=E.useCallback(()=>{const P=Ku(t);return new Map(P.map(A=>[A.id,A.model]))},[t]);In(t,{setFilterLinkOperator:h,unstable_applyFilters:a,deleteFilterItem:c,upsertFilterItem:l,upsertFilterItems:u,setFilterModel:g,showFilterPanel:d,hideFilterPanel:f,getVisibleRowModels:b,setQuickFilterValues:p});const w=E.useCallback((P,A)=>{var R,F;const $=Lo(t);return!A.exportOnlyDirtyModels||e.filterModel!=null||((R=e.initialState)==null||(F=R.filter)==null?void 0:F.filterModel)!=null||!Xa($,hy())?O({},P,{filter:{filterModel:$}}):P},[t,e.filterModel,(n=e.initialState)==null||(r=n.filter)==null?void 0:r.filterModel]),x=E.useCallback((P,A)=>{var R;const F=(R=A.stateToRestore.filter)==null?void 0:R.filterModel;return F==null?P:(t.current.unstable_updateControlState("filter",C8(F,e.disableMultipleColumnsFiltering,t),"restoreState"),O({},P,{callbacks:[...P.callbacks,t.current.unstable_applyFilters]}))},[t,e.disableMultipleColumnsFiltering]),_=E.useCallback((P,A)=>{if(A===Za.filters){var R;const F=e.components.FilterPanel;return D.jsx(F,O({},(R=e.componentsProps)==null?void 0:R.filterPanel))}return P},[e.components.FilterPanel,(i=e.componentsProps)==null?void 0:i.filterPanel]),C=E.useCallback(P=>{if(e.filterMode===bm.client&&P.isRowMatchingFilters){const A=df(t),R={};for(let F=0;F{o.debug("onColUpdated - GridColumns changed, applying filters");const P=Lo(t),A=jbe(t),R=P.items.filter(F=>F.columnField&&A[F.columnField]);R.length{P==="filtering"&&t.current.unstable_applyFilters()},[t]);ct(t,"rowsSet",s),ct(t,"rowExpansionChange",t.current.unstable_applyFilters),ct(t,"columnsChange",S),ct(t,"activeStrategyProcessorChange",M),_b(()=>{t.current.unstable_applyFilters()}),E.useEffect(()=>{e.filterModel!==void 0&&t.current.setFilterModel(e.filterModel)},[t,o,e.filterModel])},VCe=t=>O({},t,{focus:{cell:null,columnHeader:null},tabIndex:{cell:null,columnHeader:null}}),GCe=(t,e)=>{const n=Jr(t,"useGridFocus"),r=E.useRef(null),i=E.useCallback((b,m)=>{b&&t.current.getRow(b.id)&&t.current.publishEvent("cellFocusOut",t.current.getCellParams(b.id,b.field),m)},[t]),o=E.useCallback((b,m)=>{const w=ka(t);(w==null?void 0:w.id)===b&&(w==null?void 0:w.field)===m||(t.current.setState(x=>(n.debug(`Focusing on cell with id=${b} and field=${m}`),O({},x,{tabIndex:{cell:{id:b,field:m},columnHeader:null},focus:{cell:{id:b,field:m},columnHeader:null}}))),t.current.forceUpdate(),t.current.getRow(b)&&(w&&i(w,{}),t.current.publishEvent("cellFocusIn",t.current.getCellParams(b,m))))},[t,n,i]),s=E.useCallback((b,m={})=>{const w=ka(t);i(w,m),t.current.setState(x=>(n.debug(`Focusing on column header with colIndex=${b}`),O({},x,{tabIndex:{columnHeader:{field:b},cell:null},focus:{columnHeader:{field:b},cell:null}}))),t.current.forceUpdate()},[t,n,i]),a=E.useCallback((b,m,w)=>{let x=t.current.getColumnIndex(m),_=t.current.getRowIndexRelativeToVisibleRows(b);const C=lo(t);w==="right"?x+=1:w==="left"?x-=1:_+=1;const S=CE(t,{pagination:e.pagination,paginationMode:e.paginationMode});x>=C.length?(_+=1,_=0&&(x=C.length-1)),_=Xm(_,0,S.rows.length-1);const M=S.rows[_],P=t.current.unstable_getCellColSpanInfo(M.id,x);P&&P.spannedByColSpan&&(w==="left"||w==="below"?x=P.leftVisibleCellIndex:w==="right"&&(x=P.rightVisibleCellIndex)),x=Xm(x,0,C.length-1);const A=C[x];t.current.setCellFocus(M.id,A.field)},[t,e.pagination,e.paginationMode]),l=E.useCallback(({id:b,field:m})=>{t.current.setCellFocus(b,m)},[t]),u=E.useCallback((b,m)=>{m.key==="Enter"||m.key==="Tab"||xb(m.key)||t.current.setCellFocus(b.id,b.field)},[t]),c=E.useCallback(({field:b},m)=>{m.target===m.currentTarget&&t.current.setColumnHeaderFocus(b,m)},[t]),d=E.useCallback(()=>{n.debug("Clearing focus"),t.current.setState(b=>O({},b,{focus:{cell:null,columnHeader:null}}))},[n,t]),f=E.useCallback(b=>{r.current=b},[]),h=E.useCallback(b=>{const m=r.current;r.current=null;const w=ka(t);if(!w){m&&t.current.setCellFocus(m.id,m.field);return}if((m==null?void 0:m.id)===w.id&&(m==null?void 0:m.field)===w.field)return;const x=t.current.getCellElement(w.id,w.field);x!=null&&x.contains(b.target)||(m?t.current.setCellFocus(m.id,m.field):(t.current.setState(_=>O({},_,{focus:{cell:null,columnHeader:null}})),t.current.forceUpdate(),i(w,b)))},[t,i]),p=E.useCallback(b=>{if(b.cellMode==="view")return;const m=ka(t);((m==null?void 0:m.id)!==b.id||(m==null?void 0:m.field)!==b.field)&&t.current.setCellFocus(b.id,b.field)},[t]),g=E.useCallback(()=>{const b=ka(t);b&&!t.current.getRow(b.id)&&t.current.setState(m=>O({},m,{focus:{cell:null,columnHeader:null}}))},[t]);In(t,{setCellFocus:o,setColumnHeaderFocus:s,unstable_moveFocusToRelativeCell:a}),E.useEffect(()=>{const b=Sr(t.current.rootElementRef.current);return b.addEventListener("click",h),()=>{b.removeEventListener("click",h)}},[t,h]),ct(t,"columnHeaderBlur",d),ct(t,"cellDoubleClick",l),ct(t,"cellMouseDown",f),ct(t,"cellKeyDown",u),ct(t,"cellModeChange",p),ct(t,"columnHeaderFocus",c),ct(t,"rowsSet",g)};function jCe(t,e){const n=gb(t)||{};return[...n.top||[],...e,...n.bottom||[]]}const WCe=(t,e)=>{const n=Jr(t,"useGridKeyboardNavigation"),r=rh(t,e).rows,i=E.useMemo(()=>jCe(t,r),[t,r]),o=E.useCallback((d,f,h="left")=>{const p=Ku(t),g=t.current.unstable_getCellColSpanInfo(f,d);g&&g.spannedByColSpan&&(h==="left"?d=g.leftVisibleCellIndex:h==="right"&&(d=g.rightVisibleCellIndex));const b=p.findIndex(w=>w.id===f);n.debug(`Navigating to cell row ${b}, col ${d}`),t.current.scrollToIndexes({colIndex:d,rowIndex:b});const m=t.current.getVisibleColumns()[d].field;t.current.setCellFocus(f,m)},[t,n]),s=E.useCallback((d,f)=>{n.debug(`Navigating to header col ${d}`),t.current.scrollToIndexes({colIndex:d});const h=t.current.getVisibleColumns()[d].field;t.current.setColumnHeaderFocus(h,f)},[t,n]),a=E.useCallback(d=>i[d].id,[i]),l=E.useCallback((d,f)=>{const h=t.current.getRootDimensions();if(i.length===0||!h)return;const p=t.current.unstable_getViewportPageSize(),g=d.field?t.current.getColumnIndex(d.field):0,b=i.findIndex(S=>S.id===d.id),m=0,w=i.length-1,x=0,_=lo(t).length-1;let C=!0;switch(f.key){case"ArrowDown":case"Enter":{bm?o(g,a(b-1)):s(g,f);break}case"ArrowRight":{g<_&&o(g+1,a(b),"right");break}case"ArrowLeft":{g>x&&o(g-1,a(b));break}case"Tab":{f.shiftKey&&g>x?o(g-1,a(b),"left"):!f.shiftKey&&g<_&&o(g+1,a(b),"right");break}case" ":{if(d.field===AN)break;const M=d.colDef;if(M&&M.type==="treeDataGroup")break;!f.shiftKey&&b=m?o(g,a(S)):s(g,f);break}case"Home":{f.ctrlKey||f.metaKey||f.shiftKey?o(x,a(m)):o(x,a(b));break}case"End":{f.ctrlKey||f.metaKey||f.shiftKey?o(_,a(w)):o(_,a(b));break}default:C=!1}C&&f.preventDefault()},[t,i,o,s,a]),u=E.useCallback((d,f)=>{const h=f.currentTarget.querySelector(`.${Ie.columnHeaderTitleContainerContent}`);if(!!h&&h.contains(f.target)&&d.field!==wb.field||!t.current.getRootDimensions())return;const b=t.current.unstable_getViewportPageSize(),m=d.field?t.current.getColumnIndex(d.field):0,w=0,x=i.length-1,_=0,C=lo(t).length-1;let S=!0;switch(f.key){case"ArrowDown":{o(m,a(w));break}case"ArrowRight":{m_&&s(m-1,f);break}case"PageDown":{x!==null&&o(m,a(Math.min(w+b,x)));break}case"Home":{s(_,f);break}case"End":{s(C,f);break}case"Enter":{(f.ctrlKey||f.metaKey)&&t.current.toggleColumnMenu(d.field);break}case" ":break;default:S=!1}S&&f.preventDefault()},[t,i,o,s,a]),c=E.useCallback((d,f)=>{if(!f.currentTarget.contains(f.target))return;const h=t.current.getCellParams(d.id,d.field);h.cellMode!==an.Edit&&xb(f.key)&&t.current.publishEvent("cellNavigationKeyDown",h,f)},[t]);ct(t,"cellNavigationKeyDown",l),ct(t,"columnHeaderKeyDown",u),ct(t,"cellKeyDown",c)},SW=t=>t?0:100,E8=t=>e=>O({},e,{pagination:O({},e.pagination,{pageSize:t})}),qCe=(t,e)=>{var n,r;const i=Jr(t,"useGridPageSize"),o=gt(t,yb);t.current.unstable_registerControlState({stateId:"pageSize",propModel:e.pageSize,propOnChange:e.onPageSizeChange,stateSelector:xv,changeEvent:"pageSizeChange"});const a={setPageSize:E.useCallback(d=>{d!==xv(t)&&(i.debug(`Setting page size to ${d}`),t.current.setState(E8(d)),t.current.forceUpdate())},[t,i])};In(t,a);const l=E.useCallback((d,f)=>{var h,p;const g=xv(t);return!f.exportOnlyDirtyModels||e.pageSize!=null||((h=e.initialState)==null||(p=h.pagination)==null?void 0:p.pageSize)!=null||g!==SW(e.autoPageSize)?O({},d,{pagination:O({},d.pagination,{pageSize:g})}):d},[t,e.pageSize,(n=e.initialState)==null||(r=n.pagination)==null?void 0:r.pageSize,e.autoPageSize]),u=E.useCallback((d,f)=>{var h;const p=(h=f.stateToRestore.pagination)==null?void 0:h.pageSize;return p!=null&&t.current.setState(E8(p)),d},[t]);Pi(t,"exportState",l),Pi(t,"restoreState",u);const c=E.useCallback(()=>{const d=t.current.getRootDimensions();if(!e.autoPageSize||!d)return;const f=xW(t),h=Math.floor((d.viewportInnerSize.height-f.top-f.bottom)/o);t.current.setPageSize(h)},[t,e.autoPageSize,o]);ct(t,"viewportInnerSizeChange",c),E.useEffect(()=>{e.pageSize!=null&&!e.autoPageSize&&t.current.setPageSize(e.pageSize)},[t,e.autoPageSize,e.pageSize]),E.useEffect(()=>{c()},[c])},RD=(t,e)=>e>0&&t>0?Math.ceil(t/e):0,ID=t=>t.pageCount?O({},t,{page:Math.max(Math.min(t.page,t.pageCount-1),0)}):t,M8=t=>e=>O({},e,{pagination:ID(O({},e.pagination,{page:t}))});Ja(["MUI: the 'rowCount' prop is undefined while using paginationMode='server'","For more detail, see http://mui.com/components/data-grid/pagination/#basic-implementation"],"error");const XCe=(t,e)=>{var n,r;const i=Jr(t,"useGridPage"),o=gt(t,Rj);t.current.unstable_registerControlState({stateId:"page",propModel:e.page,propOnChange:e.onPageChange,stateSelector:X0,changeEvent:"pageChange"});const a={setPage:E.useCallback(f=>{i.debug(`Setting page to ${f}`),t.current.setState(M8(f)),t.current.forceUpdate()},[t,i])};In(t,a);const l=E.useCallback((f,h)=>{var p,g;const b=X0(t);return!h.exportOnlyDirtyModels||e.page!=null||((p=e.initialState)==null||(g=p.pagination)==null?void 0:g.page)!=null||b!==0?O({},f,{pagination:O({},f.pagination,{page:b})}):f},[t,e.page,(n=e.initialState)==null||(r=n.pagination)==null?void 0:r.page]),u=E.useCallback((f,h)=>{var p,g;const b=(p=(g=h.stateToRestore.pagination)==null?void 0:g.page)!=null?p:X0(t);return t.current.setState(M8(b)),f},[t]);Pi(t,"exportState",l),Pi(t,"restoreState",u);const c=f=>{t.current.setState(h=>{const p=RD(h.pagination.rowCount,f);return O({},h,{pagination:ID(O({},h.pagination,{pageCount:p,page:h.pagination.page}))})}),t.current.forceUpdate()},d=()=>t.current.scrollToIndexes({rowIndex:X0(t)*xv(t)});ct(t,"pageSizeChange",c),ct(t,"pageChange",d),E.useEffect(()=>{},[e.rowCount,e.paginationMode]),E.useEffect(()=>{t.current.setState(f=>{const h=e.rowCount!==void 0?e.rowCount:o,p=RD(h,f.pagination.pageSize),g=e.page==null?f.pagination.page:e.page;return O({},f,{pagination:ID(O({},f.pagination,{page:g,rowCount:h,pageCount:p}))})}),t.current.forceUpdate()},[o,e.rowCount,e.page,e.paginationMode,t])},KCe=(t,e)=>{var n,r,i,o,s,a,l,u;let c;return e.pageSize!=null?c=e.pageSize:((n=e.initialState)==null||(r=n.pagination)==null?void 0:r.pageSize)!=null?c=e.initialState.pagination.pageSize:c=SW(e.autoPageSize),O({},t,{pagination:{pageSize:c,page:(i=(o=e.page)!=null?o:(s=e.initialState)==null||(a=s.pagination)==null?void 0:a.page)!=null?i:0,pageCount:RD((l=e.rowCount)!=null?l:0,c),rowCount:(u=e.rowCount)!=null?u:0}})},YCe=(t,e)=>{qCe(t,e),XCe(t,e)},ZCe=(t,e)=>{var n,r;return O({},t,{preferencePanel:(n=(r=e.initialState)==null?void 0:r.preferencePanel)!=null?n:{open:!1}})},QCe=(t,e)=>{var n;const r=Jr(t,"useGridPreferencesPanel"),i=E.useRef(),o=E.useRef(),s=E.useCallback(()=>{r.debug("Hiding Preferences Panel");const f=qm(t.current.state);f.openedPanelValue&&t.current.publishEvent("preferencePanelClose",{openedPanelValue:f.openedPanelValue}),t.current.setState(h=>O({},h,{preferencePanel:{open:!1}})),t.current.forceUpdate()},[t,r]),a=E.useCallback(()=>{o.current=setTimeout(()=>clearTimeout(i.current),0)},[]),l=E.useCallback(()=>{i.current=setTimeout(s,100)},[s]),u=E.useCallback(f=>{r.debug("Opening Preferences Panel"),a(),t.current.setState(h=>O({},h,{preferencePanel:O({},h.preferencePanel,{open:!0,openedPanelValue:f})})),t.current.publishEvent("preferencePanelOpen",{openedPanelValue:f}),t.current.forceUpdate()},[r,a,t]);In(t,{showPreferences:u,hidePreferences:l});const c=E.useCallback((f,h)=>{var p;const g=qm(t.current.state);return!h.exportOnlyDirtyModels||((p=e.initialState)==null?void 0:p.preferencePanel)!=null||g.open?O({},f,{preferencePanel:g}):f},[t,(n=e.initialState)==null?void 0:n.preferencePanel]),d=E.useCallback((f,h)=>{const p=h.stateToRestore.preferencePanel;return p!=null&&t.current.setState(g=>O({},g,{preferencePanel:p})),f},[t]);Pi(t,"exportState",c),Pi(t,"restoreState",d),E.useEffect(()=>()=>{clearTimeout(i.current),clearTimeout(o.current)},[])},br=t=>t.editRows;function T8(t){return typeof t.then=="function"}const JCe=(t,e)=>{var n;const r=Jr(t,"useGridEditRows"),i=x=>(..._)=>{e.editMode===oo.Cell&&x(..._)},o=E.useCallback((x,_,C)=>{t.current.getCellMode(x,_)!==C&&(r.debug(`Switching cell id: ${x} field: ${_} to mode: ${C}`),t.current.setState(S=>{const M=O({},S.editRows);return M[x]=O({},M[x]),C===an.Edit?M[x][_]={value:t.current.getCellValue(x,_)}:(delete M[x][_],Object.keys(M[x]).length||delete M[x]),O({},S,{editRows:M})}),t.current.forceUpdate(),t.current.publishEvent("cellModeChange",t.current.getCellParams(x,_)))},[t,r]),s=E.useCallback((x,_)=>{const C=br(t.current.state);return C[x]&&C[x][_]?an.Edit:an.View},[t]),a=E.useCallback((x,_={})=>{var C;const{id:S,field:M}=x;t.current.unstable_runPendingEditCellValueMutation(S,M);const P=t.current.getEditRowsModel();if(!P[S]||!P[S][M])throw new Error(`MUI: Cell at id: ${S} and field: ${M} is not in edit mode.`);const A=P[S][M],R=t.current.getColumn(M),F=t.current.getRow(S);if((C=e.experimentalFeatures)!=null&&C.preventCommitWhileValidating){const k=P[S][M];if(k.isValidating||k.error)return!1}const $=O({},x,{value:A.value});let j=!!A.error;if(!j&&typeof R.preProcessEditCellProps=="function"){const k=R.preProcessEditCellProps({id:S,row:F,props:A});if(T8(k))return k.then(U=>(t.current.unstable_setEditCellProps({id:S,field:M,props:U}),U.error?!1:(t.current.publishEvent("cellEditCommit",$,_),!0)));t.current.unstable_setEditCellProps({id:S,field:M,props:k}),j=!!k.error}return j?!1:(t.current.publishEvent("cellEditCommit",$,_),!0)},[t,(n=e.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),l=E.useCallback(x=>{const _=t.current.getColumn(x.field),C=t.current.getRow(x.id);return new Promise(S=>{let M={value:x.value};const A=t.current.getEditRowsModel()[x.id][x.field];if(typeof _.preProcessEditCellProps!="function"){t.current.unstable_setEditCellProps(O({},x,{props:M})),S(!0);return}M=t.current.unstable_setEditCellProps(O({},x,{props:O({},A,{isValidating:!0})})),Promise.resolve(_.preProcessEditCellProps({id:x.id,row:C,props:O({},M,{value:t.current.unstable_parseValue(x.id,x.field,x.value)})})).then(R=>{t.current.unstable_setEditCellProps(O({},x,{props:O({},R,{isValidating:!1})})),S(!R.error)})})},[t]);In(t,{setCellMode:o,getCellMode:s,commitCellChange:a,unstable_setCellEditingEditCellValue:l});const c=E.useCallback(async(x,_)=>{if(_.which===229)return;const{id:C,field:S,cellMode:M,isEditable:P}=x;if(!P)return;const A=M===an.Edit,R=_.ctrlKey||_.metaKey||_.altKey;if(!A&&Z1e(_)&&!R&&!(_.key===" "&&_.shiftKey)&&t.current.publishEvent("cellEditStart",x,_),!A&&ED(_.key)&&(t.current.setEditCellValue({id:C,field:S,value:""}),t.current.commitCellChange({id:C,field:S},_),t.current.publishEvent("cellEditStop",x,_)),A&&u8(_.key)){const F={id:C,field:S};if(!await t.current.commitCellChange(F,_))return}A&&Q1e(_.key)&&t.current.publishEvent("cellEditStop",x,_)},[t]),d=E.useCallback((x,_)=>{x.isEditable&&t.current.publishEvent("cellEditStart",x,_)},[t]),f=async(x,_)=>{x.cellMode!==an.View&&(await t.current.commitCellChange(x,_),t.current.publishEvent("cellEditStop",x,_))},h=ar((x,_)=>{f(x,_)}),p=ar(()=>{const x=ka(t);if(!x)return;const _=t.current.getCellParams(x.id,x.field);f(_,{})}),g=E.useCallback((x,_)=>{x.isEditable&&(t.current.setCellMode(x.id,x.field,an.Edit),MD(_)&&wE(_)&&t.current.unstable_setEditCellProps({id:x.id,field:x.field,props:{value:""}}))},[t]),b=E.useCallback((x,_)=>{if(t.current.setCellMode(x.id,x.field,an.View),!!MD(_)){if(u8(_.key)){t.current.publishEvent("cellNavigationKeyDown",x,_);return}(_.key==="Escape"||ED(_.key))&&t.current.setCellFocus(x.id,x.field)}},[t]),m=E.useCallback(x=>{const{id:_,field:C}=x,S=t.current.getEditRowsModel(),{value:M}=S[_][C];r.debug(`Setting cell id: ${_} field: ${C} to value: ${M==null?void 0:M.toString()}`);const P=t.current.getRow(_);if(P){const A=t.current.getColumn(x.field);let R=O({},P,{[C]:M});A.valueSetter&&(R=A.valueSetter({row:P,value:M})),t.current.updateRows([R])}},[t,r]),w=E.useCallback(x=>{const _=t.current.getRow(x.id),C=t.current.getColumn(x.field),S=C.preProcessEditCellProps?C.preProcessEditCellProps({id:x.id,row:_,props:x.props}):x.props;T8(S)?S.then(M=>{t.current.unstable_setEditCellProps(O({},x,{props:M}))}):t.current.unstable_setEditCellProps(O({},x,{props:S}))},[t]);ct(t,"cellKeyDown",i(c)),ct(t,"cellDoubleClick",i(d)),ct(t,"cellFocusOut",i(h)),ct(t,"columnHeaderDragStart",i(p)),ct(t,"cellEditStart",i(g)),ct(t,"cellEditStop",i(b)),ct(t,"cellEditCommit",i(m)),ct(t,"editCellPropsChange",i(w)),dn(t,"cellEditCommit",e.onCellEditCommit),dn(t,"cellEditStart",e.onCellEditStart),dn(t,"cellEditStop",e.onCellEditStop)},eEe=(t,e)=>{var n,r;const i=E.useRef(null),o=E.useRef(null),s=gt(t,qa),a=M=>(...P)=>{e.editMode===oo.Row&&M(...P)},l=E.useCallback((M,P)=>{P!==t.current.getRowMode(M)&&(t.current.setState(A=>{const R=O({},A.editRows);return P===yn.Edit?(R[M]={},s.forEach(F=>{const $=t.current.getCellParams(M,F.field);$.isEditable&&(R[M][F.field]={value:$.value})})):delete R[M],O({},A,{editRows:R})}),t.current.forceUpdate())},[t,s]),u=E.useCallback(M=>e.editMode===oo.Cell?yn.View:br(t.current.state)[M]?yn.Edit:yn.View,[t,e.editMode]),c=E.useCallback((M,P={})=>{var A;if(e.editMode===oo.Cell)throw new Error("MUI: You can't commit changes when the edit mode is 'cell'.");t.current.unstable_runPendingEditCellValueMutation(M);const F=t.current.getEditRowsModel()[M];if(!F)throw new Error(`MUI: Row at id: ${M} is not being edited.`);if((A=e.experimentalFeatures)!=null&&A.preventCommitWhileValidating&&!Object.keys(F).reduce((U,G)=>U&&!F[G].isValidating&&!F[G].error,!0)||Object.values(F).some(k=>!!k.error))return!1;const j=Object.keys(F).filter(k=>typeof t.current.getColumn(k).preProcessEditCellProps=="function");if(j.length>0){const k=t.current.getRow(M),U=j.map(async G=>{const B=t.current.getColumn(G),L=await Promise.resolve(B.preProcessEditCellProps({id:M,row:k,props:F[G]}));return t.current.unstable_setEditCellProps({id:M,field:G,props:L}),L.error});return Promise.all(U).then(G=>G.some(B=>!!B)?!1:(t.current.publishEvent("rowEditCommit",M,P),!0))}return t.current.publishEvent("rowEditCommit",M,P),!0},[t,e.editMode,(n=e.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),d=E.useCallback(M=>{const A=t.current.getEditRowsModel()[M.id],R=t.current.getRow(M.id);let F=!0;return new Promise($=>{Object.keys(A).forEach(async j=>{const k=t.current.getColumn(j);let U=j===M.field?{value:M.value}:A[j];U=t.current.unstable_setEditCellProps({id:M.id,field:j,props:O({},U,{isValidating:!0})}),k.preProcessEditCellProps&&(U=await Promise.resolve(k.preProcessEditCellProps({id:M.id,row:R,props:O({},U,{value:j===M.field?t.current.unstable_parseValue(M.id,j,M.value):U.value})}))),U.error&&(F=!1),t.current.unstable_setEditCellProps({id:M.id,field:j,props:O({},U,{isValidating:!1})})}),$(F)})},[t]);In(t,{setRowMode:l,getRowMode:u,commitRowChange:c,unstable_setRowEditingEditCellValue:d});const h=E.useCallback(async(M,P)=>{if(P.which===229)return;const{cellMode:A,isEditable:R}=M;if(!R)return;const F=A===an.Edit,$=t.current.getRowParams(M.id);if(F)if(P.key==="Enter"){var j;if(!await t.current.commitRowChange(M.id)&&(j=e.experimentalFeatures)!=null&&j.preventCommitWhileValidating)return;t.current.publishEvent("rowEditStop",$,P)}else P.key==="Escape"&&t.current.publishEvent("rowEditStop",$,P);else P.key==="Enter"&&t.current.publishEvent("rowEditStart",$,P)},[t,(r=e.experimentalFeatures)==null?void 0:r.preventCommitWhileValidating]),p=E.useCallback((M,P)=>{if(!M.isEditable)return;const A=t.current.getRowParams(M.id);t.current.publishEvent("rowEditStart",A,P)},[t]),g=E.useCallback(M=>{const P=t.current.getRow(M.id),R=t.current.getEditRowsModel()[M.id];Object.keys(R).forEach(async F=>{const $=t.current.getColumn(F);if($.preProcessEditCellProps){const j=F===M.field?M.props:R[F],k=await Promise.resolve($.preProcessEditCellProps({id:M.id,row:P,props:j}));t.current.unstable_setEditCellProps({id:M.id,field:F,props:k})}else F===M.field&&t.current.unstable_setEditCellProps(M)})},[t]),b=E.useCallback(M=>{t.current.setRowMode(M.id,yn.Edit)},[t]),m=E.useCallback((M,P)=>{t.current.setRowMode(M.id,yn.View),P.key==="Enter"&&t.current.publishEvent("cellNavigationKeyDown",M,P)},[t]),w=E.useCallback(M=>{const A=t.current.getEditRowsModel()[M];if(!A)throw new Error(`MUI: Row at id: ${M} is not being edited.`);const R=t.current.getRow(M);if(R){let F=O({},R);Object.keys(A).forEach($=>{const j=t.current.getColumn($),k=A[$].value;j.valueSetter?F=j.valueSetter({row:F,value:k}):F[$]=k}),t.current.updateRows([F])}},[t]),x=E.useCallback(M=>{o.current=M},[]),_=async(M,P)=>{M.cellMode!==an.View&&(o.current=null,i.current=setTimeout(async()=>{var A;if(((A=o.current)==null?void 0:A.id)!==M.id){await t.current.commitRowChange(M.id,P);const R=t.current.getRowParams(M.id);t.current.publishEvent("rowEditStop",R,P)}}))},C=ar((M,P)=>{_(M,P)}),S=ar(()=>{const M=ka(t);if(!M)return;const P=t.current.getCellParams(M.id,M.field);_(P,{})});ct(t,"cellKeyDown",a(h)),ct(t,"cellDoubleClick",a(p)),ct(t,"editCellPropsChange",a(g)),ct(t,"rowEditStart",a(b)),ct(t,"rowEditStop",a(m)),ct(t,"rowEditCommit",a(w)),ct(t,"cellFocusIn",a(x)),ct(t,"cellFocusOut",a(C)),ct(t,"columnHeaderDragStart",a(S)),dn(t,"rowEditCommit",e.onRowEditCommit),dn(t,"rowEditStart",e.onRowEditStart),dn(t,"rowEditStop",e.onRowEditStop)},tEe=t=>O({},t,{editRows:{}});function nEe(t,e){var n;const r=Jr(t,"useGridEditRows");JCe(t,e),eEe(t,e);const i=E.useRef({});t.current.unstable_registerControlState({stateId:"editRows",propModel:e.editRowsModel,propOnChange:e.onEditRowsModelChange,stateSelector:br,changeEvent:"editRowsModelChange"});const o=E.useCallback(g=>!g.rowNode.isAutoGenerated&&!g.rowNode.isPinned&&!!g.colDef.editable&&!!g.colDef.renderEditCell&&(!e.isCellEditable||e.isCellEditable(g)),[e.isCellEditable]),s=(g,b,m,w)=>{if(!m){w();return}if(i.current[g]||(i.current[g]={}),i.current[g][b]){const[C]=i.current[g][b];clearTimeout(C)}const x=()=>{w();const[C]=i.current[g][b];clearTimeout(C),delete i.current[g][b]},_=setTimeout(()=>{w(),delete i.current[g][b]},m);i.current[g][b]=[_,x]},a=E.useCallback((g,b)=>{if(i.current[g]){if(!b)Object.keys(i.current[g]).forEach(m=>{const[,w]=i.current[g][m];w()});else if(i.current[g][b]){const[,m]=i.current[g][b];m()}}},[]),l=E.useCallback((g,b={})=>{s(g.id,g.field,g.debounceMs,()=>{var m;if((m=e.experimentalFeatures)!=null&&m.preventCommitWhileValidating)return e.editMode==="row"?t.current.unstable_setRowEditingEditCellValue(g):t.current.unstable_setCellEditingEditCellValue(g);const w={id:g.id,field:g.field,props:{value:g.value}};return t.current.publishEvent("editCellPropsChange",w,b)})},[t,e.editMode,(n=e.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),u=E.useCallback((g,b,m)=>{const w=t.current.getColumn(b);return w.valueParser?w.valueParser(m,t.current.getCellParams(g,b)):m},[t]),c=E.useCallback(g=>{const{id:b,field:m,props:w}=g;return r.debug(`Setting cell props on id: ${b} field: ${m}`),t.current.setState(_=>{const C=O({},_.editRows);return C[b]=O({},_.editRows[b]),C[b][m]=O({},w,{value:u(b,m,w.value)}),O({},_,{editRows:C})}),t.current.forceUpdate(),br(t.current.state)[b][m]},[t,r,u]),d=E.useCallback(g=>{br(t.current.state)!==g&&(r.debug("Setting editRows model"),t.current.setState(m=>O({},m,{editRows:g})),t.current.forceUpdate())},[t,r]),f=E.useCallback(()=>br(t.current.state),[t]),h=E.useCallback((g,b)=>{const m=b.detail>1;g.isEditable&&g.cellMode===an.View&&m&&b.preventDefault()},[]);ct(t,"cellMouseDown",h),dn(t,"editCellPropsChange",e.onEditCellPropsChange),In(t,{isCellEditable:o,setEditRowsModel:d,getEditRowsModel:f,setEditCellValue:l,unstable_setEditCellProps:c,unstable_parseValue:u,unstable_runPendingEditCellValueMutation:a}),E.useEffect(()=>{e.editRowsModel!==void 0&&t.current.setEditRowsModel(e.editRowsModel)},[t,e.editRowsModel])}const rEe=["id","field"],iEe=["id","field"],oEe=Ja(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. ` ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#persistence."],"error"),sEe=(t,e)=>{const[n,r]=E.useState({}),i=E.useRef(n),o=E.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:l,onCellModesModelChange:u,signature:c}=e,d=k=>(...U)=>{e.editMode===oo.Cell&&k(...U)},f=E.useCallback((k,U)=>{const G=t.current.getCellParams(k,U);if(!t.current.isCellEditable(G))throw new Error(`MUI: The cell with id=${k} and field=${U} is not editable.`)},[t]),h=E.useCallback((k,U,G)=>{if(t.current.getCellMode(k,U)!==G)throw new Error(`MUI: The cell with id=${k} and field=${U} is not in ${G} mode.`)},[t]),p=E.useCallback((k,U)=>{if(!k.isEditable||k.cellMode===an.Edit)return;const G=O({},k,{reason:mu.cellDoubleClick});t.current.publishEvent("cellEditStart",G,U)},[t]),g=E.useCallback((k,U)=>{if(k.cellMode===an.View||t.current.getCellMode(k.id,k.field)===an.View)return;const G=O({},k,{reason:yl.cellFocusOut});t.current.publishEvent("cellEditStop",G,U)},[t]),b=E.useCallback((k,U)=>{if(k.cellMode===an.Edit){if(U.which===229)return;let G;if(U.key==="Escape"?G=yl.escapeKeyDown:U.key==="Enter"?G=yl.enterKeyDown:U.key==="Tab"&&(G=U.shiftKey?yl.shiftTabKeyDown:yl.tabKeyDown,U.preventDefault()),G){const B=O({},k,{reason:G});t.current.publishEvent("cellEditStop",B,U)}}else if(k.isEditable){let G;if(U.key===" "&&U.shiftKey)return;if(wE(U)||(U.ctrlKey||U.metaKey)&&U.key==="v"?G=mu.printableKeyDown:U.key==="Enter"?G=mu.enterKeyDown:(U.key==="Delete"||U.key==="Backspace")&&(G=mu.deleteKeyDown),G){const B=O({},k,{reason:G,key:U.key});t.current.publishEvent("cellEditStart",B,U)}}},[t]),m=E.useCallback(k=>{const{id:U,field:G,reason:B,key:L}=k,N={id:U,field:G};B===mu.printableKeyDown?E.version.startsWith("18")?N.initialValue=L:N.deleteValue=!0:B===mu.deleteKeyDown&&(N.deleteValue=!0),t.current.startCellEditMode(N)},[t]),w=E.useCallback(k=>{const{id:U,field:G,reason:B}=k;t.current.unstable_runPendingEditCellValueMutation(U,G);let L;B===yl.enterKeyDown?L="below":B===yl.tabKeyDown?L="right":B===yl.shiftTabKeyDown&&(L="left");let N=B==="escapeKeyDown";br(t.current.state)[U][G].isProcessingProps&&!e.disableIgnoreModificationsIfProcessingProps&&(N=!0),t.current.stopCellEditMode({id:U,field:G,ignoreModifications:N,cellToFocusAfter:L})},[t,e.disableIgnoreModificationsIfProcessingProps]);ct(t,"cellDoubleClick",d(p)),ct(t,"cellFocusOut",d(g)),ct(t,"cellKeyDown",d(b)),ct(t,"cellEditStart",d(m)),ct(t,"cellEditStop",d(w)),dn(t,"cellEditStart",e.onCellEditStart),dn(t,"cellEditStop",e.onCellEditStop);const x=E.useCallback((k,U)=>{const G=br(t.current.state);return G[k]&&G[k][U]?an.Edit:an.View},[t]),_=ar(k=>{const U=k!==e.cellModesModel;if(u&&U){const G=c===ad.DataGridPro?{api:t.current}:{};u(k,G)}e.cellModesModel&&U||(r(k),i.current=k,t.current.publishEvent("cellModesModelChange",k))}),C=E.useCallback((k,U,G)=>{const B=O({},i.current);if(G!==null)B[k]=O({},B[k],{[U]:O({},G)});else{const L=B[k],N=Be(L,[U].map(Lm));B[k]=N,Object.keys(B[k]).length===0&&delete B[k]}_(B)},[_]),S=E.useCallback((k,U,G)=>{t.current.setState(B=>{const L=O({},B.editRows);return G!==null?L[k]=O({},L[k],{[U]:O({},G)}):(delete L[k][U],Object.keys(L[k]).length===0&&delete L[k]),O({},B,{editRows:L})}),t.current.forceUpdate()},[t]),M=E.useCallback(k=>{const{id:U,field:G}=k,B=Be(k,rEe);f(U,G),h(U,G,an.View),C(U,G,O({mode:an.Edit},B))},[f,h,C]),P=ar(k=>{const{id:U,field:G,deleteValue:B,initialValue:L}=k;let N=t.current.getCellValue(U,G);(B||L)&&(N=B?"":L),S(U,G,{value:N,error:!1,isProcessingProps:!1}),t.current.setCellFocus(U,G)}),A=E.useCallback(k=>{const{id:U,field:G}=k,B=Be(k,iEe);h(U,G,an.Edit),C(U,G,O({mode:an.View},B))},[h,C]),R=ar(async k=>{const{id:U,field:G,ignoreModifications:B,cellToFocusAfter:L="none"}=k;h(U,G,an.Edit),t.current.unstable_runPendingEditCellValueMutation(U,G);const N=()=>{S(U,G,null),C(U,G,null),L!=="none"&&t.current.unstable_moveFocusToRelativeCell(U,G,L)};if(B){N();return}const W=br(t.current.state),{error:K,isProcessingProps:Q}=W[U][G];if(K||Q){o.current[U][G].mode=an.Edit,C(U,G,{mode:an.Edit});return}const J=t.current.unstable_getRowWithUpdatedValuesFromCellEditing(U,G);if(s){const ae=ve=>{o.current[U][G].mode=an.Edit,C(U,G,{mode:an.Edit}),a?a(ve):oEe()};try{const ve=t.current.getRow(U);Promise.resolve(s(J,ve)).then(fe=>{t.current.updateRows([fe]),N()}).catch(ae)}catch(ve){ae(ve)}}else t.current.updateRows([J]),N()}),F=E.useCallback(async k=>{var U,G;const{id:B,field:L,value:N,debounceMs:W,unstable_skipValueParser:K}=k;f(B,L),h(B,L,an.Edit);const Q=t.current.getColumn(L),J=t.current.getRow(B);let ae=N;Q.valueParser&&!K&&(ae=Q.valueParser(N,t.current.getCellParams(B,L)));let ve=br(t.current.state),fe=O({},ve[B][L],{value:ae,changeReason:W?"debouncedSetEditCellValue":"setEditCellValue"});if(Q.preProcessEditCellProps){const Me=N!==ve[B][L].value;fe=O({},fe,{isProcessingProps:!0}),S(B,L,fe),fe=await Promise.resolve(Q.preProcessEditCellProps({id:B,row:J,props:fe,hasChanged:Me}))}return t.current.getCellMode(B,L)===an.View?!1:(ve=br(t.current.state),fe=O({},fe,{isProcessingProps:!1}),fe.value=Q.preProcessEditCellProps?ve[B][L].value:ae,S(B,L,fe),ve=br(t.current.state),!((U=ve[B])!=null&&(G=U[L])!=null&&G.error))},[t,f,h,S]),$=E.useCallback((k,U)=>{const G=t.current.getColumn(U),B=br(t.current.state),{value:L}=B[k][U],N=t.current.getRow(k);return G.valueSetter?G.valueSetter({value:L,row:N}):O({},N,{[U]:L})},[t]);In(t,{getCellMode:x,startCellEditMode:M,stopCellEditMode:A,unstable_setCellEditingEditCellValue:F,unstable_getRowWithUpdatedValuesFromCellEditing:$}),E.useEffect(()=>{l&&_(l)},[l,_]),E.useEffect(()=>{const k=pN(t),U=o.current;o.current=eW(n),Object.entries(n).forEach(([G,B])=>{Object.entries(B).forEach(([L,N])=>{var W,K,Q;const J=((W=U[G])==null||(K=W[L])==null?void 0:K.mode)||an.View,ae=(Q=k[G])!=null?Q:G;N.mode===an.Edit&&J===an.View?P(O({id:ae,field:L},N)):N.mode===an.View&&J===an.Edit&&R(O({id:ae,field:L},N))})})},[t,n,P,R])},aEe=["id"],lEe=["id"],uEe=Ja(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. ` ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#persistence."],"error"),cEe=(t,e)=>{const[n,r]=E.useState({}),i=E.useRef(n),o=E.useRef({}),s=E.useRef(null),a=E.useRef(null),{processRowUpdate:l,onProcessRowUpdateError:u,rowModesModel:c,onRowModesModelChange:d,signature:f}=e,h=L=>(...N)=>{e.editMode===oo.Row&&L(...N)},p=E.useCallback((L,N)=>{const W=t.current.getCellParams(L,N);if(!t.current.isCellEditable(W))throw new Error(`MUI: The cell with id=${L} and field=${N} is not editable.`)},[t]),g=E.useCallback((L,N)=>{if(t.current.getRowMode(L)!==N)throw new Error(`MUI: The row with id=${L} is not in ${N} mode.`)},[t]),b=E.useCallback((L,N)=>{if(!L.isEditable||t.current.getRowMode(L.id)===yn.Edit)return;const W=t.current.getRowParams(L.id),K=O({},W,{field:L.field,reason:gu.cellDoubleClick});t.current.publishEvent("rowEditStart",K,N)},[t]),m=E.useCallback(L=>{a.current=L},[]),w=E.useCallback((L,N)=>{L.isEditable&&t.current.getRowMode(L.id)!==yn.View&&(a.current=null,s.current=setTimeout(()=>{var W;if(s.current=null,((W=a.current)==null?void 0:W.id)!==L.id){if(!t.current.getRow(L.id)||t.current.getRowMode(L.id)===yn.View)return;const K=t.current.getRowParams(L.id),Q=O({},K,{field:L.field,reason:bl.rowFocusOut});t.current.publishEvent("rowEditStop",Q,N)}}))},[t]);E.useEffect(()=>()=>{clearTimeout(s.current)},[]);const x=E.useCallback((L,N)=>{if(L.cellMode===yn.Edit){if(N.which===229)return;let W;if(N.key==="Escape")W=bl.escapeKeyDown;else if(N.key==="Enter")W=bl.enterKeyDown;else if(N.key==="Tab"){const K=Wm(t).filter(Q=>t.current.isCellEditable(t.current.getCellParams(L.id,Q)));N.shiftKey?L.field===K[0]&&(W=bl.shiftTabKeyDown):L.field===K[K.length-1]&&(W=bl.tabKeyDown),W&&N.preventDefault()}if(W){const K=t.current.getRowParams(L.id),Q=O({},K,{reason:W,field:L.field});t.current.publishEvent("rowEditStop",Q,N)}}else if(L.isEditable){let W;if(N.key===" "&&N.shiftKey)return;if(wE(N)||(N.ctrlKey||N.metaKey)&&N.key==="v"?W=gu.printableKeyDown:N.key==="Enter"?W=gu.enterKeyDown:(N.key==="Delete"||N.key==="Backspace")&&(W=gu.deleteKeyDown),W){const K=t.current.getRowParams(L.id),Q=O({},K,{field:L.field,key:N.key,reason:W});t.current.publishEvent("rowEditStart",Q,N)}}},[t]),_=E.useCallback(L=>{const{id:N,field:W,reason:K,key:Q}=L,J={id:N,fieldToFocus:W};K===gu.printableKeyDown?E.version.startsWith("18")?J.initialValue=Q:J.deleteValue=!!W:K===gu.deleteKeyDown&&(J.deleteValue=!!W),t.current.startRowEditMode(J)},[t]),C=E.useCallback(L=>{const{id:N,reason:W,field:K}=L;t.current.unstable_runPendingEditCellValueMutation(N);let Q;W===bl.enterKeyDown?Q="below":W===bl.tabKeyDown?Q="right":W===bl.shiftTabKeyDown&&(Q="left");let J=W==="escapeKeyDown";const ae=br(t.current.state);!J&&!e.disableIgnoreModificationsIfProcessingProps&&(J=Object.values(ae[N]).some(ve=>ve.isProcessingProps)),t.current.stopRowEditMode({id:N,ignoreModifications:J,field:K,cellToFocusAfter:Q})},[t,e.disableIgnoreModificationsIfProcessingProps]);ct(t,"cellDoubleClick",h(b)),ct(t,"cellFocusIn",h(m)),ct(t,"cellFocusOut",h(w)),ct(t,"cellKeyDown",h(x)),ct(t,"rowEditStart",h(_)),ct(t,"rowEditStop",h(C)),dn(t,"rowEditStart",e.onRowEditStart),dn(t,"rowEditStop",e.onRowEditStop);const S=E.useCallback(L=>{if(e.editMode===oo.Cell)return yn.View;const N=br(t.current.state);return N[L]&&Object.keys(N[L]).length>0?yn.Edit:yn.View},[t,e.editMode]),M=ar(L=>{const N=L!==e.rowModesModel;if(d&&N){const W=f===ad.DataGridPro?{api:t.current}:{};d(L,W)}e.rowModesModel&&N||(r(L),i.current=L,t.current.publishEvent("rowModesModelChange",L))}),P=E.useCallback((L,N)=>{const W=O({},i.current);N!==null?W[L]=O({},N):delete W[L],M(W)},[M]),A=E.useCallback((L,N)=>{t.current.setState(W=>{const K=O({},W.editRows);return N!==null?K[L]=N:delete K[L],O({},W,{editRows:K})}),t.current.forceUpdate()},[t]),R=E.useCallback((L,N,W)=>{t.current.setState(K=>{const Q=O({},K.editRows);return W!==null?Q[L]=O({},Q[L],{[N]:O({},W)}):(delete Q[L][N],Object.keys(Q[L]).length===0&&delete Q[L]),O({},K,{editRows:Q})}),t.current.forceUpdate()},[t]),F=E.useCallback(L=>{const{id:N}=L,W=Be(L,aEe);g(N,yn.View),P(N,O({mode:yn.Edit},W))},[g,P]),$=ar(L=>{const{id:N,fieldToFocus:W,deleteValue:K,initialValue:Q}=L,ae=Wm(t).reduce((ve,fe)=>{if(!t.current.getCellParams(N,fe).isEditable)return ve;let ye=t.current.getCellValue(N,fe);return W===fe&&(K||Q)&&(ye=K?"":Q),ve[fe]={value:ye,error:!1,isProcessingProps:!1},ve},{});A(N,ae),W&&t.current.setCellFocus(N,W)}),j=E.useCallback(L=>{const{id:N}=L,W=Be(L,lEe);g(N,yn.Edit),P(N,O({mode:yn.View},W))},[g,P]),k=ar(L=>{const{id:N,ignoreModifications:W,field:K,cellToFocusAfter:Q="none"}=L;t.current.unstable_runPendingEditCellValueMutation(N);const J=()=>{Q!=="none"&&K&&t.current.unstable_moveFocusToRelativeCell(N,K,Q),A(N,null),P(N,null)};if(W){J();return}const ae=br(t.current.state),ve=t.current.getRow(N);if(Object.values(ae[N]).some(we=>we.isProcessingProps)){o.current[N].mode=yn.Edit;return}if(Object.values(ae[N]).some(we=>we.error)){o.current[N].mode=yn.Edit,P(N,{mode:yn.Edit});return}const ye=t.current.unstable_getRowWithUpdatedValuesFromRowEditing(N);if(l){const we=Fe=>{o.current[N].mode=yn.Edit,P(N,{mode:yn.Edit}),u?u(Fe):uEe()};try{Promise.resolve(l(ye,ve)).then(Fe=>{t.current.updateRows([Fe]),J()}).catch(we)}catch(Fe){we(Fe)}}else t.current.updateRows([ye]),J()}),U=E.useCallback(L=>{const{id:N,field:W,value:K,debounceMs:Q,unstable_skipValueParser:J}=L;p(N,W);const ae=t.current.getColumn(W),ve=t.current.getRow(N);let fe=K;ae.valueParser&&!J&&(fe=ae.valueParser(K,t.current.getCellParams(N,W)));let Me=br(t.current.state),ye=O({},Me[N][W],{value:fe,changeReason:Q?"debouncedSetEditCellValue":"setEditCellValue"});return ae.preProcessEditCellProps||R(N,W,ye),new Promise(we=>{const Fe=[];if(ae.preProcessEditCellProps){const Oe=ye.value!==Me[N][W].value;ye=O({},ye,{isProcessingProps:!0}),R(N,W,ye);const re=Me[N],_e=Be(re,[W].map(Lm)),Ce=Promise.resolve(ae.preProcessEditCellProps({id:N,row:ve,props:ye,hasChanged:Oe,otherFieldsProps:_e})).then(X=>{if(t.current.getRowMode(N)===yn.View){we(!1);return}Me=br(t.current.state),X=O({},X,{isProcessingProps:!1}),X.value=ae.preProcessEditCellProps?Me[N][W].value:fe,R(N,W,X)});Fe.push(Ce)}Object.entries(Me[N]).forEach(([Oe,re])=>{if(Oe===W)return;const _e=t.current.getColumn(Oe);if(!_e.preProcessEditCellProps)return;re=O({},re,{isProcessingProps:!0}),R(N,Oe,re),Me=br(t.current.state);const Ce=Me[N],X=Be(Ce,[Oe].map(Lm)),Z=Promise.resolve(_e.preProcessEditCellProps({id:N,row:ve,props:re,hasChanged:!1,otherFieldsProps:X})).then(he=>{if(t.current.getRowMode(N)===yn.View){we(!1);return}he=O({},he,{isProcessingProps:!1}),R(N,Oe,he)});Fe.push(Z)}),Promise.all(Fe).then(()=>{t.current.getRowMode(N)===yn.Edit?(Me=br(t.current.state),we(!Me[N][W].error)):we(!1)})})},[t,p,R]),G=E.useCallback(L=>{const N=br(t.current.state),W=t.current.getRow(L);let K=O({},W);return Object.entries(N[L]).forEach(([Q,J])=>{const ae=t.current.getColumn(Q);ae.valueSetter?K=ae.valueSetter({value:J.value,row:K}):K[Q]=J.value}),K},[t]);In(t,{getRowMode:S,startRowEditMode:F,stopRowEditMode:j,unstable_setRowEditingEditCellValue:U,unstable_getRowWithUpdatedValuesFromRowEditing:G}),E.useEffect(()=>{c&&M(c)},[c,M]),E.useEffect(()=>{const L=pN(t),N=o.current;o.current=eW(n),Object.entries(n).forEach(([W,K])=>{var Q,J;const ae=((Q=N[W])==null?void 0:Q.mode)||yn.View,ve=(J=L[W])!=null?J:W;K.mode===yn.Edit&&ae===yn.View?$(O({id:ve},K)):K.mode===yn.View&&ae===yn.Edit&&k(O({id:ve},K))})},[t,n,$,k])},dEe=t=>O({},t,{editRows:{}}),fEe=(t,e)=>{sEe(t,e),cEe(t,e);const n=E.useRef({}),{isCellEditable:r}=e,i=E.useCallback(d=>d.rowNode.isAutoGenerated||!d.colDef.editable||!d.colDef.renderEditCell?!1:r?r(d):!d.rowNode.isPinned,[r]),o=(d,f,h,p)=>{if(!h){p();return}if(n.current[d]||(n.current[d]={}),n.current[d][f]){const[m]=n.current[d][f];clearTimeout(m)}const g=()=>{const[m]=n.current[d][f];clearTimeout(m),p(),delete n.current[d][f]},b=setTimeout(()=>{p(),delete n.current[d][f]},h);n.current[d][f]=[b,g]};E.useEffect(()=>{const d=n.current;return()=>{Object.entries(d).forEach(([f,h])=>{Object.keys(h).forEach(p=>{const[g]=d[f][p];clearTimeout(g),delete d[f][p]})})}},[]);const s=E.useCallback((d,f)=>{if(n.current[d]){if(!f)Object.keys(n.current[d]).forEach(h=>{const[,p]=n.current[d][h];p()});else if(n.current[d][f]){const[,h]=n.current[d][f];h()}}},[]),a=E.useCallback(d=>{const{id:f,field:h,debounceMs:p}=d;return new Promise(g=>{o(f,h,p,async()=>{const b=e.editMode===oo.Row?t.current.unstable_setRowEditingEditCellValue:t.current.unstable_setCellEditingEditCellValue;if(t.current.getCellMode(f,h)===an.Edit){const m=await b(d);g(m)}})})},[t,e.editMode]),l=E.useCallback((d,f)=>e.editMode===oo.Cell?t.current.unstable_getRowWithUpdatedValuesFromCellEditing(d,f):t.current.unstable_getRowWithUpdatedValuesFromRowEditing(d),[t,e.editMode]),u=E.useCallback((d,f)=>({changeReason:br(t.current.state)[d][f].changeReason}),[t]);In(t,{isCellEditable:i,setEditCellValue:a,unstable_runPendingEditCellValueMutation:s,unstable_getRowWithUpdatedValues:l,unstable_getEditCellMeta:u})},hEe=(t,e,n)=>(n.current.unstable_caches.rows=n_({rows:e.rows,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),O({},t,{rows:yW({apiRef:n,previousTree:null,rowCountProp:e.rowCount,loadingProp:e.loading})})),pEe=(t,e)=>{const n=Jr(t,"useGridRows"),r=rh(t,e),i=E.useRef(Date.now()),o=E.useRef(null),s=E.useCallback(R=>{var F;return(F=ym(t)[R])!=null?F:null},[t]),a=E.useMemo(()=>r.rows.reduce((R,{id:F},$)=>(R[F]=$,R),{}),[r.rows]),l=E.useCallback((R,F)=>{const $=()=>{o.current=null,i.current=Date.now(),t.current.setState(k=>O({},k,{rows:yW({apiRef:t,previousTree:$c(t),rowCountProp:e.rowCount,loadingProp:e.loading})})),t.current.publishEvent("rowsSet"),t.current.forceUpdate()};if(o.current&&(clearTimeout(o.current),o.current=null),t.current.unstable_caches.rows=R,!F){$();return}const j=e.throttleRowsMs-(Date.now()-i.current);if(j>0){o.current=setTimeout($,j);return}$()},[e.throttleRowsMs,e.rowCount,e.loading,t]),u=E.useCallback(R=>{n.debug(`Updating all rows, new length ${R.length}`);const F=n_({rows:R,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),$=t.current.unstable_caches.rows;F.rowsBeforePartialUpdates=$.rowsBeforePartialUpdates,l(F,!0)},[n,e.getRowId,e.loading,e.rowCount,l,t]),c=E.useCallback(R=>{if(e.signature===ad.DataGrid&&R.length>1)throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` +`))}const PD=(t,e,n)=>{const r=e?e(t):t.id;return NCe(r,t,n),r},n_=({rows:t,getRowId:e,loading:n,rowCount:r})=>{const i={rowsBeforePartialUpdates:t,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,idRowsLookup:{},idToIdLookup:{},ids:[]};for(let o=0;o{const i=t.current.unstable_caches.rows,o=Be(i,ICe),s=n??0,a=t.current.unstable_applyStrategyProcessor("rowTreeCreation",O({},o,{previousTree:e})),l=t.current.unstable_applyPipeProcessors("hydrateRows",a),u=l.treeDepth===1?l.ids.length:Object.values(l.tree).filter(c=>c.parent==null&&!c.isPinned).length;return O({},l,{groupingResponseBeforeRowHydration:a,loading:r,totalRowCount:Math.max(s,l.ids.length),totalTopLevelRowCount:Math.max(s,u)})},bW=(t,e,n)=>{var r;const i=(r=t[e])==null?void 0:r.children;if(i==null)return[];const o=[];for(let s=0;s(s+=t.current.unstable_getRowHeight(a.id),s),0))||0,o=(r==null||(n=r.bottom)==null?void 0:n.reduce((s,a)=>(s+=t.current.unstable_getRowHeight(a.id),s),0))||0;return{top:i,bottom:o}}const DD=(t,e)=>{const n=O({},t);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operatorValue==null){const r=th(e)[n.columnField];n.operatorValue=r&&r.filterOperators[0].value}return n},FCe=Qa(["MUI: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),OCe=Qa("MUI: The 'id' field is required on `filterModel.items` when you use multiple filters.","error"),kCe=Qa(["MUI: One of your filtering item have no `operatorValue` provided.","This property will become required on `@mui/x-data-grid@6.X`."]),wW=(t,e,n)=>{const r=t.items.length>1;let i;r&&e?(FCe(),i=[t.items[0]]):i=t.items;const o=r&&i.some(a=>a.id==null),s=i.some(a=>a.operatorValue==null);return o&&OCe(),s&&kCe(),s||o?O({},t,{items:i.map(a=>DD(a,n))}):t.items!==i?O({},t,{items:i}):t},C8=(t,e,n)=>r=>O({},r,{filterModel:wW(t,e,n)}),_W=(t,e)=>{if(!t.columnField||!t.operatorValue)return null;const n=e.current.getColumn(t.columnField);if(!n)return null;let r;if(n.valueParser){var i;const c=n.valueParser;r=Array.isArray(t.value)?(i=t.value)==null?void 0:i.map(d=>c(d)):c(t.value)}else r=t.value;const o=O({},t,{value:r}),s=n.filterOperators;if(!(s!=null&&s.length))throw new Error(`MUI: No filter operators found for column '${n.field}'.`);const a=s.find(c=>c.value===o.operatorValue);if(!a)throw new Error(`MUI: No filter operator found for column '${n.field}' and operator value '${o.operatorValue}'.`);const l=a.getApplyFilterFn(o,n);return typeof l!="function"?null:{fn:c=>{const d=e.current.getCellParams(c,o.columnField);return l(d)},item:o}},LCe=(t,e)=>{const{items:n}=t,r=n.map(i=>_W(i,e)).filter(i=>!!i);return r.length===0?null:(i,o)=>{const s={};return(o?r.filter(l=>o(l.item.columnField)):r).forEach(l=>{s[l.item.id]=l.fn(i)}),s}},BCe=(t,e)=>{const{quickFilterValues:n=[]}=t;if(n.length===0)return null;const r=Wm(e),i={};r.forEach(s=>{const a=e.current.getColumn(s),l=a==null?void 0:a.getApplyQuickFilterFn;l&&(i[s]=n.map(u=>l(u,a,e)))});const o=n.filter((s,a)=>Object.keys(i).some(l=>i[l][a]!=null));return o.length===0?null:(s,a)=>{const l={},u=[];Object.keys(i).forEach(d=>{(!a||a(d))&&(l[d]=e.current.getCellParams(s,d),u.push(d))});const c={};return o.forEach((d,f)=>{const h=u.some(p=>{var g,b;return i[p][f]==null?!1:(g=(b=i[p])[f])==null?void 0:g.call(b,l[p])});c[d]=h}),c}},$Ce=(t,e)=>{const n=LCe(t,e),r=BCe(t,e);return(i,o)=>({passingFilterItems:n&&n(i,o),passingQuickFilterValues:r&&r(i,o)})},zCe=(t,e,n,r)=>{var i,o;const s=n.items.filter(d=>_W(d,r)!==null),a=t.filter(d=>d!=null),l=e.filter(d=>d!=null),u=(i=n.quickFilterLogicOperator)!=null?i:hy().quickFilterLogicOperator,c=(o=n.linkOperator)!=null?o:hy().linkOperator;if(a.length>0){const d=f=>a.some(h=>h[f.id]);if(c===So.And){if(!s.every(d))return!1}else if(!s.some(d))return!1}if(l.length>0&&n.quickFilterValues!=null){const d=f=>l.some(h=>h[f]);if(u===So.And){if(!n.quickFilterValues.every(d))return!1}else if(!n.quickFilterValues.some(d))return!1}return!0},UCe=(t,e,n)=>{var r,i,o,s;const a=(r=(i=e.filterModel)!=null?i:(o=e.initialState)==null||(s=o.filter)==null?void 0:s.filterModel)!=null?r:hy();return O({},t,{filter:{filterModel:wW(a,e.disableMultipleColumnsFiltering,n),visibleRowsLookup:{},filteredDescendantCountLookup:{}}})},HCe=(t,e)=>{var n,r,i;const o=Jr(t,"useGridFilter");t.current.unstable_registerControlState({stateId:"filter",propModel:e.filterModel,propOnChange:e.onFilterModelChange,stateSelector:Lo,changeEvent:"filterModelChange"});const s=E.useCallback(()=>{t.current.setState(P=>{const A=Lo(P,t.current.instanceId),R=e.filterMode===bm.client?$Ce(A,t):null,F=t.current.unstable_applyStrategyProcessor("filtering",{isRowMatchingFilters:R,filterModel:A??hy()});return O({},P,{filter:O({},P.filter,F)})}),t.current.publishEvent("filteredRowsSet")},[e.filterMode,t]),a=E.useCallback(()=>{s(),t.current.forceUpdate()},[t,s]),l=E.useCallback(P=>{const A=Lo(t),R=[...A.items],F=R.findIndex($=>$.id===P.id);F===-1?R.push(P):R[F]=P,t.current.setFilterModel(O({},A,{items:R}),"upsertFilterItem")},[t]),u=E.useCallback(P=>{const A=Lo(t),R=[...A.items];P.forEach(F=>{const $=P.findIndex(j=>j.id===F.id);$===-1?R.push(F):R[$]=F}),t.current.setFilterModel(O({},A,{items:P}),"upsertFilterItems")},[t]),c=E.useCallback(P=>{const A=Lo(t),R=A.items.filter(F=>F.id!==P.id);R.length!==A.items.length&&t.current.setFilterModel(O({},A,{items:R}),"deleteFilterItem")},[t]),d=E.useCallback(P=>{if(o.debug("Displaying filter panel"),P){const A=Lo(t),R=A.items.filter(j=>{var k;if(j.value!==void 0)return!0;const G=(k=t.current.getColumn(j.columnField).filterOperators)==null?void 0:k.find(L=>L.value===j.operatorValue);return!(typeof(G==null?void 0:G.requiresFilterValue)>"u"?!0:G==null?void 0:G.requiresFilterValue)});let F;R.find(j=>j.columnField===P)?F=R:e.disableMultipleColumnsFiltering?F=[DD({columnField:P},t)]:F=[...R,DD({columnField:P},t)],t.current.setFilterModel(O({},A,{items:F}))}t.current.showPreferences(Ya.filters)},[t,o,e.disableMultipleColumnsFiltering]),f=E.useCallback(()=>{o.debug("Hiding filter panel"),t.current.hidePreferences()},[t,o]),h=E.useCallback(P=>{const A=Lo(t);A.linkOperator!==P&&t.current.setFilterModel(O({},A,{linkOperator:P}),"changeLogicOperator")},[t]),p=E.useCallback(P=>{const A=Lo(t);qa(A.quickFilterValues,P)||t.current.setFilterModel(O({},A,{quickFilterValues:[...P]}))},[t]),g=E.useCallback((P,A)=>{Lo(t)!==P&&(o.debug("Setting filter model"),t.current.unstable_updateControlState("filter",C8(P,e.disableMultipleColumnsFiltering,t),A),t.current.unstable_applyFilters())},[t,o,e.disableMultipleColumnsFiltering]),b=E.useCallback(()=>{const P=Ku(t);return new Map(P.map(A=>[A.id,A.model]))},[t]);In(t,{setFilterLinkOperator:h,unstable_applyFilters:a,deleteFilterItem:c,upsertFilterItem:l,upsertFilterItems:u,setFilterModel:g,showFilterPanel:d,hideFilterPanel:f,getVisibleRowModels:b,setQuickFilterValues:p});const w=E.useCallback((P,A)=>{var R,F;const $=Lo(t);return!A.exportOnlyDirtyModels||e.filterModel!=null||((R=e.initialState)==null||(F=R.filter)==null?void 0:F.filterModel)!=null||!qa($,hy())?O({},P,{filter:{filterModel:$}}):P},[t,e.filterModel,(n=e.initialState)==null||(r=n.filter)==null?void 0:r.filterModel]),x=E.useCallback((P,A)=>{var R;const F=(R=A.stateToRestore.filter)==null?void 0:R.filterModel;return F==null?P:(t.current.unstable_updateControlState("filter",C8(F,e.disableMultipleColumnsFiltering,t),"restoreState"),O({},P,{callbacks:[...P.callbacks,t.current.unstable_applyFilters]}))},[t,e.disableMultipleColumnsFiltering]),_=E.useCallback((P,A)=>{if(A===Ya.filters){var R;const F=e.components.FilterPanel;return D.jsx(F,O({},(R=e.componentsProps)==null?void 0:R.filterPanel))}return P},[e.components.FilterPanel,(i=e.componentsProps)==null?void 0:i.filterPanel]),C=E.useCallback(P=>{if(e.filterMode===bm.client&&P.isRowMatchingFilters){const A=df(t),R={};for(let F=0;F{o.debug("onColUpdated - GridColumns changed, applying filters");const P=Lo(t),A=jbe(t),R=P.items.filter(F=>F.columnField&&A[F.columnField]);R.length{P==="filtering"&&t.current.unstable_applyFilters()},[t]);ct(t,"rowsSet",s),ct(t,"rowExpansionChange",t.current.unstable_applyFilters),ct(t,"columnsChange",S),ct(t,"activeStrategyProcessorChange",M),_b(()=>{t.current.unstable_applyFilters()}),E.useEffect(()=>{e.filterModel!==void 0&&t.current.setFilterModel(e.filterModel)},[t,o,e.filterModel])},VCe=t=>O({},t,{focus:{cell:null,columnHeader:null},tabIndex:{cell:null,columnHeader:null}}),GCe=(t,e)=>{const n=Jr(t,"useGridFocus"),r=E.useRef(null),i=E.useCallback((b,m)=>{b&&t.current.getRow(b.id)&&t.current.publishEvent("cellFocusOut",t.current.getCellParams(b.id,b.field),m)},[t]),o=E.useCallback((b,m)=>{const w=Oa(t);(w==null?void 0:w.id)===b&&(w==null?void 0:w.field)===m||(t.current.setState(x=>(n.debug(`Focusing on cell with id=${b} and field=${m}`),O({},x,{tabIndex:{cell:{id:b,field:m},columnHeader:null},focus:{cell:{id:b,field:m},columnHeader:null}}))),t.current.forceUpdate(),t.current.getRow(b)&&(w&&i(w,{}),t.current.publishEvent("cellFocusIn",t.current.getCellParams(b,m))))},[t,n,i]),s=E.useCallback((b,m={})=>{const w=Oa(t);i(w,m),t.current.setState(x=>(n.debug(`Focusing on column header with colIndex=${b}`),O({},x,{tabIndex:{columnHeader:{field:b},cell:null},focus:{columnHeader:{field:b},cell:null}}))),t.current.forceUpdate()},[t,n,i]),a=E.useCallback((b,m,w)=>{let x=t.current.getColumnIndex(m),_=t.current.getRowIndexRelativeToVisibleRows(b);const C=lo(t);w==="right"?x+=1:w==="left"?x-=1:_+=1;const S=CE(t,{pagination:e.pagination,paginationMode:e.paginationMode});x>=C.length?(_+=1,_=0&&(x=C.length-1)),_=Xm(_,0,S.rows.length-1);const M=S.rows[_],P=t.current.unstable_getCellColSpanInfo(M.id,x);P&&P.spannedByColSpan&&(w==="left"||w==="below"?x=P.leftVisibleCellIndex:w==="right"&&(x=P.rightVisibleCellIndex)),x=Xm(x,0,C.length-1);const A=C[x];t.current.setCellFocus(M.id,A.field)},[t,e.pagination,e.paginationMode]),l=E.useCallback(({id:b,field:m})=>{t.current.setCellFocus(b,m)},[t]),u=E.useCallback((b,m)=>{m.key==="Enter"||m.key==="Tab"||xb(m.key)||t.current.setCellFocus(b.id,b.field)},[t]),c=E.useCallback(({field:b},m)=>{m.target===m.currentTarget&&t.current.setColumnHeaderFocus(b,m)},[t]),d=E.useCallback(()=>{n.debug("Clearing focus"),t.current.setState(b=>O({},b,{focus:{cell:null,columnHeader:null}}))},[n,t]),f=E.useCallback(b=>{r.current=b},[]),h=E.useCallback(b=>{const m=r.current;r.current=null;const w=Oa(t);if(!w){m&&t.current.setCellFocus(m.id,m.field);return}if((m==null?void 0:m.id)===w.id&&(m==null?void 0:m.field)===w.field)return;const x=t.current.getCellElement(w.id,w.field);x!=null&&x.contains(b.target)||(m?t.current.setCellFocus(m.id,m.field):(t.current.setState(_=>O({},_,{focus:{cell:null,columnHeader:null}})),t.current.forceUpdate(),i(w,b)))},[t,i]),p=E.useCallback(b=>{if(b.cellMode==="view")return;const m=Oa(t);((m==null?void 0:m.id)!==b.id||(m==null?void 0:m.field)!==b.field)&&t.current.setCellFocus(b.id,b.field)},[t]),g=E.useCallback(()=>{const b=Oa(t);b&&!t.current.getRow(b.id)&&t.current.setState(m=>O({},m,{focus:{cell:null,columnHeader:null}}))},[t]);In(t,{setCellFocus:o,setColumnHeaderFocus:s,unstable_moveFocusToRelativeCell:a}),E.useEffect(()=>{const b=Sr(t.current.rootElementRef.current);return b.addEventListener("click",h),()=>{b.removeEventListener("click",h)}},[t,h]),ct(t,"columnHeaderBlur",d),ct(t,"cellDoubleClick",l),ct(t,"cellMouseDown",f),ct(t,"cellKeyDown",u),ct(t,"cellModeChange",p),ct(t,"columnHeaderFocus",c),ct(t,"rowsSet",g)};function jCe(t,e){const n=gb(t)||{};return[...n.top||[],...e,...n.bottom||[]]}const WCe=(t,e)=>{const n=Jr(t,"useGridKeyboardNavigation"),r=rh(t,e).rows,i=E.useMemo(()=>jCe(t,r),[t,r]),o=E.useCallback((d,f,h="left")=>{const p=Ku(t),g=t.current.unstable_getCellColSpanInfo(f,d);g&&g.spannedByColSpan&&(h==="left"?d=g.leftVisibleCellIndex:h==="right"&&(d=g.rightVisibleCellIndex));const b=p.findIndex(w=>w.id===f);n.debug(`Navigating to cell row ${b}, col ${d}`),t.current.scrollToIndexes({colIndex:d,rowIndex:b});const m=t.current.getVisibleColumns()[d].field;t.current.setCellFocus(f,m)},[t,n]),s=E.useCallback((d,f)=>{n.debug(`Navigating to header col ${d}`),t.current.scrollToIndexes({colIndex:d});const h=t.current.getVisibleColumns()[d].field;t.current.setColumnHeaderFocus(h,f)},[t,n]),a=E.useCallback(d=>i[d].id,[i]),l=E.useCallback((d,f)=>{const h=t.current.getRootDimensions();if(i.length===0||!h)return;const p=t.current.unstable_getViewportPageSize(),g=d.field?t.current.getColumnIndex(d.field):0,b=i.findIndex(S=>S.id===d.id),m=0,w=i.length-1,x=0,_=lo(t).length-1;let C=!0;switch(f.key){case"ArrowDown":case"Enter":{bm?o(g,a(b-1)):s(g,f);break}case"ArrowRight":{g<_&&o(g+1,a(b),"right");break}case"ArrowLeft":{g>x&&o(g-1,a(b));break}case"Tab":{f.shiftKey&&g>x?o(g-1,a(b),"left"):!f.shiftKey&&g<_&&o(g+1,a(b),"right");break}case" ":{if(d.field===AN)break;const M=d.colDef;if(M&&M.type==="treeDataGroup")break;!f.shiftKey&&b=m?o(g,a(S)):s(g,f);break}case"Home":{f.ctrlKey||f.metaKey||f.shiftKey?o(x,a(m)):o(x,a(b));break}case"End":{f.ctrlKey||f.metaKey||f.shiftKey?o(_,a(w)):o(_,a(b));break}default:C=!1}C&&f.preventDefault()},[t,i,o,s,a]),u=E.useCallback((d,f)=>{const h=f.currentTarget.querySelector(`.${Ie.columnHeaderTitleContainerContent}`);if(!!h&&h.contains(f.target)&&d.field!==wb.field||!t.current.getRootDimensions())return;const b=t.current.unstable_getViewportPageSize(),m=d.field?t.current.getColumnIndex(d.field):0,w=0,x=i.length-1,_=0,C=lo(t).length-1;let S=!0;switch(f.key){case"ArrowDown":{o(m,a(w));break}case"ArrowRight":{m_&&s(m-1,f);break}case"PageDown":{x!==null&&o(m,a(Math.min(w+b,x)));break}case"Home":{s(_,f);break}case"End":{s(C,f);break}case"Enter":{(f.ctrlKey||f.metaKey)&&t.current.toggleColumnMenu(d.field);break}case" ":break;default:S=!1}S&&f.preventDefault()},[t,i,o,s,a]),c=E.useCallback((d,f)=>{if(!f.currentTarget.contains(f.target))return;const h=t.current.getCellParams(d.id,d.field);h.cellMode!==an.Edit&&xb(f.key)&&t.current.publishEvent("cellNavigationKeyDown",h,f)},[t]);ct(t,"cellNavigationKeyDown",l),ct(t,"columnHeaderKeyDown",u),ct(t,"cellKeyDown",c)},SW=t=>t?0:100,E8=t=>e=>O({},e,{pagination:O({},e.pagination,{pageSize:t})}),qCe=(t,e)=>{var n,r;const i=Jr(t,"useGridPageSize"),o=gt(t,yb);t.current.unstable_registerControlState({stateId:"pageSize",propModel:e.pageSize,propOnChange:e.onPageSizeChange,stateSelector:xv,changeEvent:"pageSizeChange"});const a={setPageSize:E.useCallback(d=>{d!==xv(t)&&(i.debug(`Setting page size to ${d}`),t.current.setState(E8(d)),t.current.forceUpdate())},[t,i])};In(t,a);const l=E.useCallback((d,f)=>{var h,p;const g=xv(t);return!f.exportOnlyDirtyModels||e.pageSize!=null||((h=e.initialState)==null||(p=h.pagination)==null?void 0:p.pageSize)!=null||g!==SW(e.autoPageSize)?O({},d,{pagination:O({},d.pagination,{pageSize:g})}):d},[t,e.pageSize,(n=e.initialState)==null||(r=n.pagination)==null?void 0:r.pageSize,e.autoPageSize]),u=E.useCallback((d,f)=>{var h;const p=(h=f.stateToRestore.pagination)==null?void 0:h.pageSize;return p!=null&&t.current.setState(E8(p)),d},[t]);Pi(t,"exportState",l),Pi(t,"restoreState",u);const c=E.useCallback(()=>{const d=t.current.getRootDimensions();if(!e.autoPageSize||!d)return;const f=xW(t),h=Math.floor((d.viewportInnerSize.height-f.top-f.bottom)/o);t.current.setPageSize(h)},[t,e.autoPageSize,o]);ct(t,"viewportInnerSizeChange",c),E.useEffect(()=>{e.pageSize!=null&&!e.autoPageSize&&t.current.setPageSize(e.pageSize)},[t,e.autoPageSize,e.pageSize]),E.useEffect(()=>{c()},[c])},RD=(t,e)=>e>0&&t>0?Math.ceil(t/e):0,ID=t=>t.pageCount?O({},t,{page:Math.max(Math.min(t.page,t.pageCount-1),0)}):t,M8=t=>e=>O({},e,{pagination:ID(O({},e.pagination,{page:t}))});Qa(["MUI: the 'rowCount' prop is undefined while using paginationMode='server'","For more detail, see http://mui.com/components/data-grid/pagination/#basic-implementation"],"error");const XCe=(t,e)=>{var n,r;const i=Jr(t,"useGridPage"),o=gt(t,Rj);t.current.unstable_registerControlState({stateId:"page",propModel:e.page,propOnChange:e.onPageChange,stateSelector:X0,changeEvent:"pageChange"});const a={setPage:E.useCallback(f=>{i.debug(`Setting page to ${f}`),t.current.setState(M8(f)),t.current.forceUpdate()},[t,i])};In(t,a);const l=E.useCallback((f,h)=>{var p,g;const b=X0(t);return!h.exportOnlyDirtyModels||e.page!=null||((p=e.initialState)==null||(g=p.pagination)==null?void 0:g.page)!=null||b!==0?O({},f,{pagination:O({},f.pagination,{page:b})}):f},[t,e.page,(n=e.initialState)==null||(r=n.pagination)==null?void 0:r.page]),u=E.useCallback((f,h)=>{var p,g;const b=(p=(g=h.stateToRestore.pagination)==null?void 0:g.page)!=null?p:X0(t);return t.current.setState(M8(b)),f},[t]);Pi(t,"exportState",l),Pi(t,"restoreState",u);const c=f=>{t.current.setState(h=>{const p=RD(h.pagination.rowCount,f);return O({},h,{pagination:ID(O({},h.pagination,{pageCount:p,page:h.pagination.page}))})}),t.current.forceUpdate()},d=()=>t.current.scrollToIndexes({rowIndex:X0(t)*xv(t)});ct(t,"pageSizeChange",c),ct(t,"pageChange",d),E.useEffect(()=>{},[e.rowCount,e.paginationMode]),E.useEffect(()=>{t.current.setState(f=>{const h=e.rowCount!==void 0?e.rowCount:o,p=RD(h,f.pagination.pageSize),g=e.page==null?f.pagination.page:e.page;return O({},f,{pagination:ID(O({},f.pagination,{page:g,rowCount:h,pageCount:p}))})}),t.current.forceUpdate()},[o,e.rowCount,e.page,e.paginationMode,t])},KCe=(t,e)=>{var n,r,i,o,s,a,l,u;let c;return e.pageSize!=null?c=e.pageSize:((n=e.initialState)==null||(r=n.pagination)==null?void 0:r.pageSize)!=null?c=e.initialState.pagination.pageSize:c=SW(e.autoPageSize),O({},t,{pagination:{pageSize:c,page:(i=(o=e.page)!=null?o:(s=e.initialState)==null||(a=s.pagination)==null?void 0:a.page)!=null?i:0,pageCount:RD((l=e.rowCount)!=null?l:0,c),rowCount:(u=e.rowCount)!=null?u:0}})},YCe=(t,e)=>{qCe(t,e),XCe(t,e)},ZCe=(t,e)=>{var n,r;return O({},t,{preferencePanel:(n=(r=e.initialState)==null?void 0:r.preferencePanel)!=null?n:{open:!1}})},QCe=(t,e)=>{var n;const r=Jr(t,"useGridPreferencesPanel"),i=E.useRef(),o=E.useRef(),s=E.useCallback(()=>{r.debug("Hiding Preferences Panel");const f=qm(t.current.state);f.openedPanelValue&&t.current.publishEvent("preferencePanelClose",{openedPanelValue:f.openedPanelValue}),t.current.setState(h=>O({},h,{preferencePanel:{open:!1}})),t.current.forceUpdate()},[t,r]),a=E.useCallback(()=>{o.current=setTimeout(()=>clearTimeout(i.current),0)},[]),l=E.useCallback(()=>{i.current=setTimeout(s,100)},[s]),u=E.useCallback(f=>{r.debug("Opening Preferences Panel"),a(),t.current.setState(h=>O({},h,{preferencePanel:O({},h.preferencePanel,{open:!0,openedPanelValue:f})})),t.current.publishEvent("preferencePanelOpen",{openedPanelValue:f}),t.current.forceUpdate()},[r,a,t]);In(t,{showPreferences:u,hidePreferences:l});const c=E.useCallback((f,h)=>{var p;const g=qm(t.current.state);return!h.exportOnlyDirtyModels||((p=e.initialState)==null?void 0:p.preferencePanel)!=null||g.open?O({},f,{preferencePanel:g}):f},[t,(n=e.initialState)==null?void 0:n.preferencePanel]),d=E.useCallback((f,h)=>{const p=h.stateToRestore.preferencePanel;return p!=null&&t.current.setState(g=>O({},g,{preferencePanel:p})),f},[t]);Pi(t,"exportState",c),Pi(t,"restoreState",d),E.useEffect(()=>()=>{clearTimeout(i.current),clearTimeout(o.current)},[])},br=t=>t.editRows;function T8(t){return typeof t.then=="function"}const JCe=(t,e)=>{var n;const r=Jr(t,"useGridEditRows"),i=x=>(..._)=>{e.editMode===oo.Cell&&x(..._)},o=E.useCallback((x,_,C)=>{t.current.getCellMode(x,_)!==C&&(r.debug(`Switching cell id: ${x} field: ${_} to mode: ${C}`),t.current.setState(S=>{const M=O({},S.editRows);return M[x]=O({},M[x]),C===an.Edit?M[x][_]={value:t.current.getCellValue(x,_)}:(delete M[x][_],Object.keys(M[x]).length||delete M[x]),O({},S,{editRows:M})}),t.current.forceUpdate(),t.current.publishEvent("cellModeChange",t.current.getCellParams(x,_)))},[t,r]),s=E.useCallback((x,_)=>{const C=br(t.current.state);return C[x]&&C[x][_]?an.Edit:an.View},[t]),a=E.useCallback((x,_={})=>{var C;const{id:S,field:M}=x;t.current.unstable_runPendingEditCellValueMutation(S,M);const P=t.current.getEditRowsModel();if(!P[S]||!P[S][M])throw new Error(`MUI: Cell at id: ${S} and field: ${M} is not in edit mode.`);const A=P[S][M],R=t.current.getColumn(M),F=t.current.getRow(S);if((C=e.experimentalFeatures)!=null&&C.preventCommitWhileValidating){const k=P[S][M];if(k.isValidating||k.error)return!1}const $=O({},x,{value:A.value});let j=!!A.error;if(!j&&typeof R.preProcessEditCellProps=="function"){const k=R.preProcessEditCellProps({id:S,row:F,props:A});if(T8(k))return k.then(U=>(t.current.unstable_setEditCellProps({id:S,field:M,props:U}),U.error?!1:(t.current.publishEvent("cellEditCommit",$,_),!0)));t.current.unstable_setEditCellProps({id:S,field:M,props:k}),j=!!k.error}return j?!1:(t.current.publishEvent("cellEditCommit",$,_),!0)},[t,(n=e.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),l=E.useCallback(x=>{const _=t.current.getColumn(x.field),C=t.current.getRow(x.id);return new Promise(S=>{let M={value:x.value};const A=t.current.getEditRowsModel()[x.id][x.field];if(typeof _.preProcessEditCellProps!="function"){t.current.unstable_setEditCellProps(O({},x,{props:M})),S(!0);return}M=t.current.unstable_setEditCellProps(O({},x,{props:O({},A,{isValidating:!0})})),Promise.resolve(_.preProcessEditCellProps({id:x.id,row:C,props:O({},M,{value:t.current.unstable_parseValue(x.id,x.field,x.value)})})).then(R=>{t.current.unstable_setEditCellProps(O({},x,{props:O({},R,{isValidating:!1})})),S(!R.error)})})},[t]);In(t,{setCellMode:o,getCellMode:s,commitCellChange:a,unstable_setCellEditingEditCellValue:l});const c=E.useCallback(async(x,_)=>{if(_.which===229)return;const{id:C,field:S,cellMode:M,isEditable:P}=x;if(!P)return;const A=M===an.Edit,R=_.ctrlKey||_.metaKey||_.altKey;if(!A&&Z1e(_)&&!R&&!(_.key===" "&&_.shiftKey)&&t.current.publishEvent("cellEditStart",x,_),!A&&ED(_.key)&&(t.current.setEditCellValue({id:C,field:S,value:""}),t.current.commitCellChange({id:C,field:S},_),t.current.publishEvent("cellEditStop",x,_)),A&&u8(_.key)){const F={id:C,field:S};if(!await t.current.commitCellChange(F,_))return}A&&Q1e(_.key)&&t.current.publishEvent("cellEditStop",x,_)},[t]),d=E.useCallback((x,_)=>{x.isEditable&&t.current.publishEvent("cellEditStart",x,_)},[t]),f=async(x,_)=>{x.cellMode!==an.View&&(await t.current.commitCellChange(x,_),t.current.publishEvent("cellEditStop",x,_))},h=ar((x,_)=>{f(x,_)}),p=ar(()=>{const x=Oa(t);if(!x)return;const _=t.current.getCellParams(x.id,x.field);f(_,{})}),g=E.useCallback((x,_)=>{x.isEditable&&(t.current.setCellMode(x.id,x.field,an.Edit),MD(_)&&wE(_)&&t.current.unstable_setEditCellProps({id:x.id,field:x.field,props:{value:""}}))},[t]),b=E.useCallback((x,_)=>{if(t.current.setCellMode(x.id,x.field,an.View),!!MD(_)){if(u8(_.key)){t.current.publishEvent("cellNavigationKeyDown",x,_);return}(_.key==="Escape"||ED(_.key))&&t.current.setCellFocus(x.id,x.field)}},[t]),m=E.useCallback(x=>{const{id:_,field:C}=x,S=t.current.getEditRowsModel(),{value:M}=S[_][C];r.debug(`Setting cell id: ${_} field: ${C} to value: ${M==null?void 0:M.toString()}`);const P=t.current.getRow(_);if(P){const A=t.current.getColumn(x.field);let R=O({},P,{[C]:M});A.valueSetter&&(R=A.valueSetter({row:P,value:M})),t.current.updateRows([R])}},[t,r]),w=E.useCallback(x=>{const _=t.current.getRow(x.id),C=t.current.getColumn(x.field),S=C.preProcessEditCellProps?C.preProcessEditCellProps({id:x.id,row:_,props:x.props}):x.props;T8(S)?S.then(M=>{t.current.unstable_setEditCellProps(O({},x,{props:M}))}):t.current.unstable_setEditCellProps(O({},x,{props:S}))},[t]);ct(t,"cellKeyDown",i(c)),ct(t,"cellDoubleClick",i(d)),ct(t,"cellFocusOut",i(h)),ct(t,"columnHeaderDragStart",i(p)),ct(t,"cellEditStart",i(g)),ct(t,"cellEditStop",i(b)),ct(t,"cellEditCommit",i(m)),ct(t,"editCellPropsChange",i(w)),dn(t,"cellEditCommit",e.onCellEditCommit),dn(t,"cellEditStart",e.onCellEditStart),dn(t,"cellEditStop",e.onCellEditStop)},eEe=(t,e)=>{var n,r;const i=E.useRef(null),o=E.useRef(null),s=gt(t,Wa),a=M=>(...P)=>{e.editMode===oo.Row&&M(...P)},l=E.useCallback((M,P)=>{P!==t.current.getRowMode(M)&&(t.current.setState(A=>{const R=O({},A.editRows);return P===yn.Edit?(R[M]={},s.forEach(F=>{const $=t.current.getCellParams(M,F.field);$.isEditable&&(R[M][F.field]={value:$.value})})):delete R[M],O({},A,{editRows:R})}),t.current.forceUpdate())},[t,s]),u=E.useCallback(M=>e.editMode===oo.Cell?yn.View:br(t.current.state)[M]?yn.Edit:yn.View,[t,e.editMode]),c=E.useCallback((M,P={})=>{var A;if(e.editMode===oo.Cell)throw new Error("MUI: You can't commit changes when the edit mode is 'cell'.");t.current.unstable_runPendingEditCellValueMutation(M);const F=t.current.getEditRowsModel()[M];if(!F)throw new Error(`MUI: Row at id: ${M} is not being edited.`);if((A=e.experimentalFeatures)!=null&&A.preventCommitWhileValidating&&!Object.keys(F).reduce((U,G)=>U&&!F[G].isValidating&&!F[G].error,!0)||Object.values(F).some(k=>!!k.error))return!1;const j=Object.keys(F).filter(k=>typeof t.current.getColumn(k).preProcessEditCellProps=="function");if(j.length>0){const k=t.current.getRow(M),U=j.map(async G=>{const B=t.current.getColumn(G),L=await Promise.resolve(B.preProcessEditCellProps({id:M,row:k,props:F[G]}));return t.current.unstable_setEditCellProps({id:M,field:G,props:L}),L.error});return Promise.all(U).then(G=>G.some(B=>!!B)?!1:(t.current.publishEvent("rowEditCommit",M,P),!0))}return t.current.publishEvent("rowEditCommit",M,P),!0},[t,e.editMode,(n=e.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),d=E.useCallback(M=>{const A=t.current.getEditRowsModel()[M.id],R=t.current.getRow(M.id);let F=!0;return new Promise($=>{Object.keys(A).forEach(async j=>{const k=t.current.getColumn(j);let U=j===M.field?{value:M.value}:A[j];U=t.current.unstable_setEditCellProps({id:M.id,field:j,props:O({},U,{isValidating:!0})}),k.preProcessEditCellProps&&(U=await Promise.resolve(k.preProcessEditCellProps({id:M.id,row:R,props:O({},U,{value:j===M.field?t.current.unstable_parseValue(M.id,j,M.value):U.value})}))),U.error&&(F=!1),t.current.unstable_setEditCellProps({id:M.id,field:j,props:O({},U,{isValidating:!1})})}),$(F)})},[t]);In(t,{setRowMode:l,getRowMode:u,commitRowChange:c,unstable_setRowEditingEditCellValue:d});const h=E.useCallback(async(M,P)=>{if(P.which===229)return;const{cellMode:A,isEditable:R}=M;if(!R)return;const F=A===an.Edit,$=t.current.getRowParams(M.id);if(F)if(P.key==="Enter"){var j;if(!await t.current.commitRowChange(M.id)&&(j=e.experimentalFeatures)!=null&&j.preventCommitWhileValidating)return;t.current.publishEvent("rowEditStop",$,P)}else P.key==="Escape"&&t.current.publishEvent("rowEditStop",$,P);else P.key==="Enter"&&t.current.publishEvent("rowEditStart",$,P)},[t,(r=e.experimentalFeatures)==null?void 0:r.preventCommitWhileValidating]),p=E.useCallback((M,P)=>{if(!M.isEditable)return;const A=t.current.getRowParams(M.id);t.current.publishEvent("rowEditStart",A,P)},[t]),g=E.useCallback(M=>{const P=t.current.getRow(M.id),R=t.current.getEditRowsModel()[M.id];Object.keys(R).forEach(async F=>{const $=t.current.getColumn(F);if($.preProcessEditCellProps){const j=F===M.field?M.props:R[F],k=await Promise.resolve($.preProcessEditCellProps({id:M.id,row:P,props:j}));t.current.unstable_setEditCellProps({id:M.id,field:F,props:k})}else F===M.field&&t.current.unstable_setEditCellProps(M)})},[t]),b=E.useCallback(M=>{t.current.setRowMode(M.id,yn.Edit)},[t]),m=E.useCallback((M,P)=>{t.current.setRowMode(M.id,yn.View),P.key==="Enter"&&t.current.publishEvent("cellNavigationKeyDown",M,P)},[t]),w=E.useCallback(M=>{const A=t.current.getEditRowsModel()[M];if(!A)throw new Error(`MUI: Row at id: ${M} is not being edited.`);const R=t.current.getRow(M);if(R){let F=O({},R);Object.keys(A).forEach($=>{const j=t.current.getColumn($),k=A[$].value;j.valueSetter?F=j.valueSetter({row:F,value:k}):F[$]=k}),t.current.updateRows([F])}},[t]),x=E.useCallback(M=>{o.current=M},[]),_=async(M,P)=>{M.cellMode!==an.View&&(o.current=null,i.current=setTimeout(async()=>{var A;if(((A=o.current)==null?void 0:A.id)!==M.id){await t.current.commitRowChange(M.id,P);const R=t.current.getRowParams(M.id);t.current.publishEvent("rowEditStop",R,P)}}))},C=ar((M,P)=>{_(M,P)}),S=ar(()=>{const M=Oa(t);if(!M)return;const P=t.current.getCellParams(M.id,M.field);_(P,{})});ct(t,"cellKeyDown",a(h)),ct(t,"cellDoubleClick",a(p)),ct(t,"editCellPropsChange",a(g)),ct(t,"rowEditStart",a(b)),ct(t,"rowEditStop",a(m)),ct(t,"rowEditCommit",a(w)),ct(t,"cellFocusIn",a(x)),ct(t,"cellFocusOut",a(C)),ct(t,"columnHeaderDragStart",a(S)),dn(t,"rowEditCommit",e.onRowEditCommit),dn(t,"rowEditStart",e.onRowEditStart),dn(t,"rowEditStop",e.onRowEditStop)},tEe=t=>O({},t,{editRows:{}});function nEe(t,e){var n;const r=Jr(t,"useGridEditRows");JCe(t,e),eEe(t,e);const i=E.useRef({});t.current.unstable_registerControlState({stateId:"editRows",propModel:e.editRowsModel,propOnChange:e.onEditRowsModelChange,stateSelector:br,changeEvent:"editRowsModelChange"});const o=E.useCallback(g=>!g.rowNode.isAutoGenerated&&!g.rowNode.isPinned&&!!g.colDef.editable&&!!g.colDef.renderEditCell&&(!e.isCellEditable||e.isCellEditable(g)),[e.isCellEditable]),s=(g,b,m,w)=>{if(!m){w();return}if(i.current[g]||(i.current[g]={}),i.current[g][b]){const[C]=i.current[g][b];clearTimeout(C)}const x=()=>{w();const[C]=i.current[g][b];clearTimeout(C),delete i.current[g][b]},_=setTimeout(()=>{w(),delete i.current[g][b]},m);i.current[g][b]=[_,x]},a=E.useCallback((g,b)=>{if(i.current[g]){if(!b)Object.keys(i.current[g]).forEach(m=>{const[,w]=i.current[g][m];w()});else if(i.current[g][b]){const[,m]=i.current[g][b];m()}}},[]),l=E.useCallback((g,b={})=>{s(g.id,g.field,g.debounceMs,()=>{var m;if((m=e.experimentalFeatures)!=null&&m.preventCommitWhileValidating)return e.editMode==="row"?t.current.unstable_setRowEditingEditCellValue(g):t.current.unstable_setCellEditingEditCellValue(g);const w={id:g.id,field:g.field,props:{value:g.value}};return t.current.publishEvent("editCellPropsChange",w,b)})},[t,e.editMode,(n=e.experimentalFeatures)==null?void 0:n.preventCommitWhileValidating]),u=E.useCallback((g,b,m)=>{const w=t.current.getColumn(b);return w.valueParser?w.valueParser(m,t.current.getCellParams(g,b)):m},[t]),c=E.useCallback(g=>{const{id:b,field:m,props:w}=g;return r.debug(`Setting cell props on id: ${b} field: ${m}`),t.current.setState(_=>{const C=O({},_.editRows);return C[b]=O({},_.editRows[b]),C[b][m]=O({},w,{value:u(b,m,w.value)}),O({},_,{editRows:C})}),t.current.forceUpdate(),br(t.current.state)[b][m]},[t,r,u]),d=E.useCallback(g=>{br(t.current.state)!==g&&(r.debug("Setting editRows model"),t.current.setState(m=>O({},m,{editRows:g})),t.current.forceUpdate())},[t,r]),f=E.useCallback(()=>br(t.current.state),[t]),h=E.useCallback((g,b)=>{const m=b.detail>1;g.isEditable&&g.cellMode===an.View&&m&&b.preventDefault()},[]);ct(t,"cellMouseDown",h),dn(t,"editCellPropsChange",e.onEditCellPropsChange),In(t,{isCellEditable:o,setEditRowsModel:d,getEditRowsModel:f,setEditCellValue:l,unstable_setEditCellProps:c,unstable_parseValue:u,unstable_runPendingEditCellValueMutation:a}),E.useEffect(()=>{e.editRowsModel!==void 0&&t.current.setEditRowsModel(e.editRowsModel)},[t,e.editRowsModel])}const rEe=["id","field"],iEe=["id","field"],oEe=Qa(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. ` ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#persistence."],"error"),sEe=(t,e)=>{const[n,r]=E.useState({}),i=E.useRef(n),o=E.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:a,cellModesModel:l,onCellModesModelChange:u,signature:c}=e,d=k=>(...U)=>{e.editMode===oo.Cell&&k(...U)},f=E.useCallback((k,U)=>{const G=t.current.getCellParams(k,U);if(!t.current.isCellEditable(G))throw new Error(`MUI: The cell with id=${k} and field=${U} is not editable.`)},[t]),h=E.useCallback((k,U,G)=>{if(t.current.getCellMode(k,U)!==G)throw new Error(`MUI: The cell with id=${k} and field=${U} is not in ${G} mode.`)},[t]),p=E.useCallback((k,U)=>{if(!k.isEditable||k.cellMode===an.Edit)return;const G=O({},k,{reason:mu.cellDoubleClick});t.current.publishEvent("cellEditStart",G,U)},[t]),g=E.useCallback((k,U)=>{if(k.cellMode===an.View||t.current.getCellMode(k.id,k.field)===an.View)return;const G=O({},k,{reason:vl.cellFocusOut});t.current.publishEvent("cellEditStop",G,U)},[t]),b=E.useCallback((k,U)=>{if(k.cellMode===an.Edit){if(U.which===229)return;let G;if(U.key==="Escape"?G=vl.escapeKeyDown:U.key==="Enter"?G=vl.enterKeyDown:U.key==="Tab"&&(G=U.shiftKey?vl.shiftTabKeyDown:vl.tabKeyDown,U.preventDefault()),G){const B=O({},k,{reason:G});t.current.publishEvent("cellEditStop",B,U)}}else if(k.isEditable){let G;if(U.key===" "&&U.shiftKey)return;if(wE(U)||(U.ctrlKey||U.metaKey)&&U.key==="v"?G=mu.printableKeyDown:U.key==="Enter"?G=mu.enterKeyDown:(U.key==="Delete"||U.key==="Backspace")&&(G=mu.deleteKeyDown),G){const B=O({},k,{reason:G,key:U.key});t.current.publishEvent("cellEditStart",B,U)}}},[t]),m=E.useCallback(k=>{const{id:U,field:G,reason:B,key:L}=k,N={id:U,field:G};B===mu.printableKeyDown?E.version.startsWith("18")?N.initialValue=L:N.deleteValue=!0:B===mu.deleteKeyDown&&(N.deleteValue=!0),t.current.startCellEditMode(N)},[t]),w=E.useCallback(k=>{const{id:U,field:G,reason:B}=k;t.current.unstable_runPendingEditCellValueMutation(U,G);let L;B===vl.enterKeyDown?L="below":B===vl.tabKeyDown?L="right":B===vl.shiftTabKeyDown&&(L="left");let N=B==="escapeKeyDown";br(t.current.state)[U][G].isProcessingProps&&!e.disableIgnoreModificationsIfProcessingProps&&(N=!0),t.current.stopCellEditMode({id:U,field:G,ignoreModifications:N,cellToFocusAfter:L})},[t,e.disableIgnoreModificationsIfProcessingProps]);ct(t,"cellDoubleClick",d(p)),ct(t,"cellFocusOut",d(g)),ct(t,"cellKeyDown",d(b)),ct(t,"cellEditStart",d(m)),ct(t,"cellEditStop",d(w)),dn(t,"cellEditStart",e.onCellEditStart),dn(t,"cellEditStop",e.onCellEditStop);const x=E.useCallback((k,U)=>{const G=br(t.current.state);return G[k]&&G[k][U]?an.Edit:an.View},[t]),_=ar(k=>{const U=k!==e.cellModesModel;if(u&&U){const G=c===ad.DataGridPro?{api:t.current}:{};u(k,G)}e.cellModesModel&&U||(r(k),i.current=k,t.current.publishEvent("cellModesModelChange",k))}),C=E.useCallback((k,U,G)=>{const B=O({},i.current);if(G!==null)B[k]=O({},B[k],{[U]:O({},G)});else{const L=B[k],N=Be(L,[U].map(Lm));B[k]=N,Object.keys(B[k]).length===0&&delete B[k]}_(B)},[_]),S=E.useCallback((k,U,G)=>{t.current.setState(B=>{const L=O({},B.editRows);return G!==null?L[k]=O({},L[k],{[U]:O({},G)}):(delete L[k][U],Object.keys(L[k]).length===0&&delete L[k]),O({},B,{editRows:L})}),t.current.forceUpdate()},[t]),M=E.useCallback(k=>{const{id:U,field:G}=k,B=Be(k,rEe);f(U,G),h(U,G,an.View),C(U,G,O({mode:an.Edit},B))},[f,h,C]),P=ar(k=>{const{id:U,field:G,deleteValue:B,initialValue:L}=k;let N=t.current.getCellValue(U,G);(B||L)&&(N=B?"":L),S(U,G,{value:N,error:!1,isProcessingProps:!1}),t.current.setCellFocus(U,G)}),A=E.useCallback(k=>{const{id:U,field:G}=k,B=Be(k,iEe);h(U,G,an.Edit),C(U,G,O({mode:an.View},B))},[h,C]),R=ar(async k=>{const{id:U,field:G,ignoreModifications:B,cellToFocusAfter:L="none"}=k;h(U,G,an.Edit),t.current.unstable_runPendingEditCellValueMutation(U,G);const N=()=>{S(U,G,null),C(U,G,null),L!=="none"&&t.current.unstable_moveFocusToRelativeCell(U,G,L)};if(B){N();return}const W=br(t.current.state),{error:K,isProcessingProps:Q}=W[U][G];if(K||Q){o.current[U][G].mode=an.Edit,C(U,G,{mode:an.Edit});return}const J=t.current.unstable_getRowWithUpdatedValuesFromCellEditing(U,G);if(s){const ae=ve=>{o.current[U][G].mode=an.Edit,C(U,G,{mode:an.Edit}),a?a(ve):oEe()};try{const ve=t.current.getRow(U);Promise.resolve(s(J,ve)).then(fe=>{t.current.updateRows([fe]),N()}).catch(ae)}catch(ve){ae(ve)}}else t.current.updateRows([J]),N()}),F=E.useCallback(async k=>{var U,G;const{id:B,field:L,value:N,debounceMs:W,unstable_skipValueParser:K}=k;f(B,L),h(B,L,an.Edit);const Q=t.current.getColumn(L),J=t.current.getRow(B);let ae=N;Q.valueParser&&!K&&(ae=Q.valueParser(N,t.current.getCellParams(B,L)));let ve=br(t.current.state),fe=O({},ve[B][L],{value:ae,changeReason:W?"debouncedSetEditCellValue":"setEditCellValue"});if(Q.preProcessEditCellProps){const Me=N!==ve[B][L].value;fe=O({},fe,{isProcessingProps:!0}),S(B,L,fe),fe=await Promise.resolve(Q.preProcessEditCellProps({id:B,row:J,props:fe,hasChanged:Me}))}return t.current.getCellMode(B,L)===an.View?!1:(ve=br(t.current.state),fe=O({},fe,{isProcessingProps:!1}),fe.value=Q.preProcessEditCellProps?ve[B][L].value:ae,S(B,L,fe),ve=br(t.current.state),!((U=ve[B])!=null&&(G=U[L])!=null&&G.error))},[t,f,h,S]),$=E.useCallback((k,U)=>{const G=t.current.getColumn(U),B=br(t.current.state),{value:L}=B[k][U],N=t.current.getRow(k);return G.valueSetter?G.valueSetter({value:L,row:N}):O({},N,{[U]:L})},[t]);In(t,{getCellMode:x,startCellEditMode:M,stopCellEditMode:A,unstable_setCellEditingEditCellValue:F,unstable_getRowWithUpdatedValuesFromCellEditing:$}),E.useEffect(()=>{l&&_(l)},[l,_]),E.useEffect(()=>{const k=pN(t),U=o.current;o.current=eW(n),Object.entries(n).forEach(([G,B])=>{Object.entries(B).forEach(([L,N])=>{var W,K,Q;const J=((W=U[G])==null||(K=W[L])==null?void 0:K.mode)||an.View,ae=(Q=k[G])!=null?Q:G;N.mode===an.Edit&&J===an.View?P(O({id:ae,field:L},N)):N.mode===an.View&&J===an.Edit&&R(O({id:ae,field:L},N))})})},[t,n,P,R])},aEe=["id"],lEe=["id"],uEe=Qa(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. ` ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#persistence."],"error"),cEe=(t,e)=>{const[n,r]=E.useState({}),i=E.useRef(n),o=E.useRef({}),s=E.useRef(null),a=E.useRef(null),{processRowUpdate:l,onProcessRowUpdateError:u,rowModesModel:c,onRowModesModelChange:d,signature:f}=e,h=L=>(...N)=>{e.editMode===oo.Row&&L(...N)},p=E.useCallback((L,N)=>{const W=t.current.getCellParams(L,N);if(!t.current.isCellEditable(W))throw new Error(`MUI: The cell with id=${L} and field=${N} is not editable.`)},[t]),g=E.useCallback((L,N)=>{if(t.current.getRowMode(L)!==N)throw new Error(`MUI: The row with id=${L} is not in ${N} mode.`)},[t]),b=E.useCallback((L,N)=>{if(!L.isEditable||t.current.getRowMode(L.id)===yn.Edit)return;const W=t.current.getRowParams(L.id),K=O({},W,{field:L.field,reason:gu.cellDoubleClick});t.current.publishEvent("rowEditStart",K,N)},[t]),m=E.useCallback(L=>{a.current=L},[]),w=E.useCallback((L,N)=>{L.isEditable&&t.current.getRowMode(L.id)!==yn.View&&(a.current=null,s.current=setTimeout(()=>{var W;if(s.current=null,((W=a.current)==null?void 0:W.id)!==L.id){if(!t.current.getRow(L.id)||t.current.getRowMode(L.id)===yn.View)return;const K=t.current.getRowParams(L.id),Q=O({},K,{field:L.field,reason:yl.rowFocusOut});t.current.publishEvent("rowEditStop",Q,N)}}))},[t]);E.useEffect(()=>()=>{clearTimeout(s.current)},[]);const x=E.useCallback((L,N)=>{if(L.cellMode===yn.Edit){if(N.which===229)return;let W;if(N.key==="Escape")W=yl.escapeKeyDown;else if(N.key==="Enter")W=yl.enterKeyDown;else if(N.key==="Tab"){const K=Wm(t).filter(Q=>t.current.isCellEditable(t.current.getCellParams(L.id,Q)));N.shiftKey?L.field===K[0]&&(W=yl.shiftTabKeyDown):L.field===K[K.length-1]&&(W=yl.tabKeyDown),W&&N.preventDefault()}if(W){const K=t.current.getRowParams(L.id),Q=O({},K,{reason:W,field:L.field});t.current.publishEvent("rowEditStop",Q,N)}}else if(L.isEditable){let W;if(N.key===" "&&N.shiftKey)return;if(wE(N)||(N.ctrlKey||N.metaKey)&&N.key==="v"?W=gu.printableKeyDown:N.key==="Enter"?W=gu.enterKeyDown:(N.key==="Delete"||N.key==="Backspace")&&(W=gu.deleteKeyDown),W){const K=t.current.getRowParams(L.id),Q=O({},K,{field:L.field,key:N.key,reason:W});t.current.publishEvent("rowEditStart",Q,N)}}},[t]),_=E.useCallback(L=>{const{id:N,field:W,reason:K,key:Q}=L,J={id:N,fieldToFocus:W};K===gu.printableKeyDown?E.version.startsWith("18")?J.initialValue=Q:J.deleteValue=!!W:K===gu.deleteKeyDown&&(J.deleteValue=!!W),t.current.startRowEditMode(J)},[t]),C=E.useCallback(L=>{const{id:N,reason:W,field:K}=L;t.current.unstable_runPendingEditCellValueMutation(N);let Q;W===yl.enterKeyDown?Q="below":W===yl.tabKeyDown?Q="right":W===yl.shiftTabKeyDown&&(Q="left");let J=W==="escapeKeyDown";const ae=br(t.current.state);!J&&!e.disableIgnoreModificationsIfProcessingProps&&(J=Object.values(ae[N]).some(ve=>ve.isProcessingProps)),t.current.stopRowEditMode({id:N,ignoreModifications:J,field:K,cellToFocusAfter:Q})},[t,e.disableIgnoreModificationsIfProcessingProps]);ct(t,"cellDoubleClick",h(b)),ct(t,"cellFocusIn",h(m)),ct(t,"cellFocusOut",h(w)),ct(t,"cellKeyDown",h(x)),ct(t,"rowEditStart",h(_)),ct(t,"rowEditStop",h(C)),dn(t,"rowEditStart",e.onRowEditStart),dn(t,"rowEditStop",e.onRowEditStop);const S=E.useCallback(L=>{if(e.editMode===oo.Cell)return yn.View;const N=br(t.current.state);return N[L]&&Object.keys(N[L]).length>0?yn.Edit:yn.View},[t,e.editMode]),M=ar(L=>{const N=L!==e.rowModesModel;if(d&&N){const W=f===ad.DataGridPro?{api:t.current}:{};d(L,W)}e.rowModesModel&&N||(r(L),i.current=L,t.current.publishEvent("rowModesModelChange",L))}),P=E.useCallback((L,N)=>{const W=O({},i.current);N!==null?W[L]=O({},N):delete W[L],M(W)},[M]),A=E.useCallback((L,N)=>{t.current.setState(W=>{const K=O({},W.editRows);return N!==null?K[L]=N:delete K[L],O({},W,{editRows:K})}),t.current.forceUpdate()},[t]),R=E.useCallback((L,N,W)=>{t.current.setState(K=>{const Q=O({},K.editRows);return W!==null?Q[L]=O({},Q[L],{[N]:O({},W)}):(delete Q[L][N],Object.keys(Q[L]).length===0&&delete Q[L]),O({},K,{editRows:Q})}),t.current.forceUpdate()},[t]),F=E.useCallback(L=>{const{id:N}=L,W=Be(L,aEe);g(N,yn.View),P(N,O({mode:yn.Edit},W))},[g,P]),$=ar(L=>{const{id:N,fieldToFocus:W,deleteValue:K,initialValue:Q}=L,ae=Wm(t).reduce((ve,fe)=>{if(!t.current.getCellParams(N,fe).isEditable)return ve;let ye=t.current.getCellValue(N,fe);return W===fe&&(K||Q)&&(ye=K?"":Q),ve[fe]={value:ye,error:!1,isProcessingProps:!1},ve},{});A(N,ae),W&&t.current.setCellFocus(N,W)}),j=E.useCallback(L=>{const{id:N}=L,W=Be(L,lEe);g(N,yn.Edit),P(N,O({mode:yn.View},W))},[g,P]),k=ar(L=>{const{id:N,ignoreModifications:W,field:K,cellToFocusAfter:Q="none"}=L;t.current.unstable_runPendingEditCellValueMutation(N);const J=()=>{Q!=="none"&&K&&t.current.unstable_moveFocusToRelativeCell(N,K,Q),A(N,null),P(N,null)};if(W){J();return}const ae=br(t.current.state),ve=t.current.getRow(N);if(Object.values(ae[N]).some(we=>we.isProcessingProps)){o.current[N].mode=yn.Edit;return}if(Object.values(ae[N]).some(we=>we.error)){o.current[N].mode=yn.Edit,P(N,{mode:yn.Edit});return}const ye=t.current.unstable_getRowWithUpdatedValuesFromRowEditing(N);if(l){const we=Fe=>{o.current[N].mode=yn.Edit,P(N,{mode:yn.Edit}),u?u(Fe):uEe()};try{Promise.resolve(l(ye,ve)).then(Fe=>{t.current.updateRows([Fe]),J()}).catch(we)}catch(Fe){we(Fe)}}else t.current.updateRows([ye]),J()}),U=E.useCallback(L=>{const{id:N,field:W,value:K,debounceMs:Q,unstable_skipValueParser:J}=L;p(N,W);const ae=t.current.getColumn(W),ve=t.current.getRow(N);let fe=K;ae.valueParser&&!J&&(fe=ae.valueParser(K,t.current.getCellParams(N,W)));let Me=br(t.current.state),ye=O({},Me[N][W],{value:fe,changeReason:Q?"debouncedSetEditCellValue":"setEditCellValue"});return ae.preProcessEditCellProps||R(N,W,ye),new Promise(we=>{const Fe=[];if(ae.preProcessEditCellProps){const Oe=ye.value!==Me[N][W].value;ye=O({},ye,{isProcessingProps:!0}),R(N,W,ye);const re=Me[N],_e=Be(re,[W].map(Lm)),Ce=Promise.resolve(ae.preProcessEditCellProps({id:N,row:ve,props:ye,hasChanged:Oe,otherFieldsProps:_e})).then(X=>{if(t.current.getRowMode(N)===yn.View){we(!1);return}Me=br(t.current.state),X=O({},X,{isProcessingProps:!1}),X.value=ae.preProcessEditCellProps?Me[N][W].value:fe,R(N,W,X)});Fe.push(Ce)}Object.entries(Me[N]).forEach(([Oe,re])=>{if(Oe===W)return;const _e=t.current.getColumn(Oe);if(!_e.preProcessEditCellProps)return;re=O({},re,{isProcessingProps:!0}),R(N,Oe,re),Me=br(t.current.state);const Ce=Me[N],X=Be(Ce,[Oe].map(Lm)),Z=Promise.resolve(_e.preProcessEditCellProps({id:N,row:ve,props:re,hasChanged:!1,otherFieldsProps:X})).then(he=>{if(t.current.getRowMode(N)===yn.View){we(!1);return}he=O({},he,{isProcessingProps:!1}),R(N,Oe,he)});Fe.push(Z)}),Promise.all(Fe).then(()=>{t.current.getRowMode(N)===yn.Edit?(Me=br(t.current.state),we(!Me[N][W].error)):we(!1)})})},[t,p,R]),G=E.useCallback(L=>{const N=br(t.current.state),W=t.current.getRow(L);let K=O({},W);return Object.entries(N[L]).forEach(([Q,J])=>{const ae=t.current.getColumn(Q);ae.valueSetter?K=ae.valueSetter({value:J.value,row:K}):K[Q]=J.value}),K},[t]);In(t,{getRowMode:S,startRowEditMode:F,stopRowEditMode:j,unstable_setRowEditingEditCellValue:U,unstable_getRowWithUpdatedValuesFromRowEditing:G}),E.useEffect(()=>{c&&M(c)},[c,M]),E.useEffect(()=>{const L=pN(t),N=o.current;o.current=eW(n),Object.entries(n).forEach(([W,K])=>{var Q,J;const ae=((Q=N[W])==null?void 0:Q.mode)||yn.View,ve=(J=L[W])!=null?J:W;K.mode===yn.Edit&&ae===yn.View?$(O({id:ve},K)):K.mode===yn.View&&ae===yn.Edit&&k(O({id:ve},K))})},[t,n,$,k])},dEe=t=>O({},t,{editRows:{}}),fEe=(t,e)=>{sEe(t,e),cEe(t,e);const n=E.useRef({}),{isCellEditable:r}=e,i=E.useCallback(d=>d.rowNode.isAutoGenerated||!d.colDef.editable||!d.colDef.renderEditCell?!1:r?r(d):!d.rowNode.isPinned,[r]),o=(d,f,h,p)=>{if(!h){p();return}if(n.current[d]||(n.current[d]={}),n.current[d][f]){const[m]=n.current[d][f];clearTimeout(m)}const g=()=>{const[m]=n.current[d][f];clearTimeout(m),p(),delete n.current[d][f]},b=setTimeout(()=>{p(),delete n.current[d][f]},h);n.current[d][f]=[b,g]};E.useEffect(()=>{const d=n.current;return()=>{Object.entries(d).forEach(([f,h])=>{Object.keys(h).forEach(p=>{const[g]=d[f][p];clearTimeout(g),delete d[f][p]})})}},[]);const s=E.useCallback((d,f)=>{if(n.current[d]){if(!f)Object.keys(n.current[d]).forEach(h=>{const[,p]=n.current[d][h];p()});else if(n.current[d][f]){const[,h]=n.current[d][f];h()}}},[]),a=E.useCallback(d=>{const{id:f,field:h,debounceMs:p}=d;return new Promise(g=>{o(f,h,p,async()=>{const b=e.editMode===oo.Row?t.current.unstable_setRowEditingEditCellValue:t.current.unstable_setCellEditingEditCellValue;if(t.current.getCellMode(f,h)===an.Edit){const m=await b(d);g(m)}})})},[t,e.editMode]),l=E.useCallback((d,f)=>e.editMode===oo.Cell?t.current.unstable_getRowWithUpdatedValuesFromCellEditing(d,f):t.current.unstable_getRowWithUpdatedValuesFromRowEditing(d),[t,e.editMode]),u=E.useCallback((d,f)=>({changeReason:br(t.current.state)[d][f].changeReason}),[t]);In(t,{isCellEditable:i,setEditCellValue:a,unstable_runPendingEditCellValueMutation:s,unstable_getRowWithUpdatedValues:l,unstable_getEditCellMeta:u})},hEe=(t,e,n)=>(n.current.unstable_caches.rows=n_({rows:e.rows,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),O({},t,{rows:yW({apiRef:n,previousTree:null,rowCountProp:e.rowCount,loadingProp:e.loading})})),pEe=(t,e)=>{const n=Jr(t,"useGridRows"),r=rh(t,e),i=E.useRef(Date.now()),o=E.useRef(null),s=E.useCallback(R=>{var F;return(F=ym(t)[R])!=null?F:null},[t]),a=E.useMemo(()=>r.rows.reduce((R,{id:F},$)=>(R[F]=$,R),{}),[r.rows]),l=E.useCallback((R,F)=>{const $=()=>{o.current=null,i.current=Date.now(),t.current.setState(k=>O({},k,{rows:yW({apiRef:t,previousTree:$c(t),rowCountProp:e.rowCount,loadingProp:e.loading})})),t.current.publishEvent("rowsSet"),t.current.forceUpdate()};if(o.current&&(clearTimeout(o.current),o.current=null),t.current.unstable_caches.rows=R,!F){$();return}const j=e.throttleRowsMs-(Date.now()-i.current);if(j>0){o.current=setTimeout($,j);return}$()},[e.throttleRowsMs,e.rowCount,e.loading,t]),u=E.useCallback(R=>{n.debug(`Updating all rows, new length ${R.length}`);const F=n_({rows:R,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),$=t.current.unstable_caches.rows;F.rowsBeforePartialUpdates=$.rowsBeforePartialUpdates,l(F,!0)},[n,e.getRowId,e.loading,e.rowCount,l,t]),c=E.useCallback(R=>{if(e.signature===ad.DataGrid&&R.length>1)throw new Error(["MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` `));const F=new Map;R.forEach(U=>{const G=PD(U,e.getRowId,"A row was provided without id when calling updateRows():");F.has(G)?F.set(G,O({},F.get(G),U)):F.set(G,U)});const $=[],j=t.current.unstable_caches.rows,k={rowsBeforePartialUpdates:j.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:j.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:j.rowCountPropBeforePartialUpdates,idRowsLookup:O({},j.idRowsLookup),idToIdLookup:O({},j.idToIdLookup),ids:[...j.ids]};F.forEach((U,G)=>{if(U._action==="delete"){delete k.idRowsLookup[G],delete k.idToIdLookup[G],$.push(G);return}if(!t.current.getRow(G)){k.idRowsLookup[G]=U,k.idToIdLookup[G]=G,k.ids.push(G);return}k.idRowsLookup[G]=O({},t.current.getRow(G),U)}),$.length>0&&(k.ids=k.ids.filter(U=>!$.includes(U))),l(k,!0)},[e.signature,e.getRowId,l,t]),d=E.useCallback(()=>{const R=df(t),F=ym(t);return new Map(R.map($=>[$,F[$]]))},[t]),f=E.useCallback(()=>yE(t),[t]),h=E.useCallback(()=>df(t),[t]),p=E.useCallback(R=>a[R],[a]),g=E.useCallback((R,F)=>{const $=t.current.getRowNode(R);if(!$)throw new Error(`MUI: No row with id #${R} found`);const j=O({},$,{childrenExpanded:F});t.current.setState(k=>O({},k,{rows:O({},k.rows,{tree:O({},k.rows.tree,{[R]:j})})})),t.current.forceUpdate(),t.current.publishEvent("rowExpansionChange",j)},[t]),b=E.useCallback(R=>{var F;return(F=$c(t)[R])!=null?F:null},[t]),m=E.useCallback(({skipAutoGeneratedRows:R=!0,groupId:F,applySorting:$,applyFiltering:j})=>{const k=$c(t);let U;if($){const G=k[F];if(!G)return[];const B=vN(t);U=[];const L=B.findIndex(N=>N===F)+1;for(let N=L;NG.depth;N+=1){const W=B[N],K=k[W];(!R||!K.isAutoGenerated)&&U.push(W)}}else U=bW(k,F,R);if(j){const G=Aj(t);U=U.filter(B=>G[B]!==!1)}return U},[t]),w=E.useCallback((R,F)=>{const $=df(t),j=$.findIndex(U=>U===R);if(j===-1||j===F)return;n.debug(`Moving row ${R} to index ${F}`);const k=[...$];k.splice(F,0,k.splice(j,1)[0]),t.current.setState(U=>O({},U,{rows:O({},U.rows,{ids:k})})),t.current.unstable_caches.rows.ids=k,t.current.publishEvent("rowsSet")},[t,n]),x=E.useCallback((R,F)=>{if(e.signature===ad.DataGrid&&F.length>1)throw new Error(["MUI: You can't replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` -`));if(F.length===0)return;const j=[...df(t)],k=ym(t),U=pN(t),G=$c(t),B=O({},k),L=O({},U),N=O({},G),W=F.map(K=>({id:PD(K,e.getRowId,"A row was provided without id when calling replaceRows()."),model:K}));W.forEach((K,Q)=>{const[J]=j.splice(R+Q,1,K.id);delete B[J],delete L[J],delete N[J]}),W.forEach(K=>{const Q={id:K.id,parent:null,depth:0,groupingKey:null,groupingField:null};B[K.id]=K.model,L[K.id]=K.id,N[K.id]=Q}),t.current.unstable_caches.rows.idRowsLookup=B,t.current.unstable_caches.rows.idToIdLookup=L,t.current.unstable_caches.rows.ids=j,t.current.setState(K=>{const Q={idRowsLookup:B,idToIdLookup:L,tree:N,ids:j};return O({},K,{rows:O({},K.rows,Q,{groupingResponseBeforeRowHydration:O({},K.rows.groupingResponseBeforeRowHydration,Q)})})}),t.current.publishEvent("rowsSet")},[t,e.signature,e.getRowId]),_={getRow:s,getRowModels:d,getRowsCount:f,getAllRowIds:h,setRows:u,setRowIndex:w,updateRows:c,setRowChildrenExpansion:g,getRowNode:b,getRowIndexRelativeToVisibleRows:p,getRowGroupChildren:m,unstable_replaceRows:x},C=E.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let R;t.current.unstable_caches.rows.rowsBeforePartialUpdates===e.rows?R=t.current.unstable_caches.rows:R=n_({rows:e.rows,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),l(R,!1)},[n,t,e.rows,e.getRowId,e.loading,e.rowCount,l]),S=E.useCallback(R=>{R==="rowTreeCreation"&&C()},[C]),M=E.useCallback(()=>{t.current.unstable_getActiveStrategy("rowTree")!==Ube(t)&&C()},[t,C]);ct(t,"activeStrategyProcessorChange",S),ct(t,"strategyAvailabilityChange",M);const P=E.useCallback(()=>{t.current.setState(R=>O({},R,{rows:O({},R.rows,t.current.unstable_applyPipeProcessors("hydrateRows",R.rows.groupingResponseBeforeRowHydration))})),t.current.publishEvent("rowsSet"),t.current.forceUpdate()},[t]);PN(t,"hydrateRows",P),In(t,_),E.useEffect(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);const A=E.useRef(!0);E.useEffect(()=>{if(A.current){A.current=!1;return}const R=t.current.unstable_caches.rows.rowsBeforePartialUpdates===e.rows,F=t.current.unstable_caches.rows.loadingPropBeforePartialUpdates===e.loading,$=t.current.unstable_caches.rows.rowCountPropBeforePartialUpdates===e.rowCount;if(R){F||(t.current.setState(j=>O({},j,{rows:O({},j.rows,{loading:e.loading})})),t.current.unstable_caches.rows.loadingPropBeforePartialUpdates=e.loading,t.current.forceUpdate()),$||(t.current.setState(j=>O({},j,{rows:O({},j.rows,{totalRowCount:Math.max(e.rowCount||0,j.rows.totalRowCount),totalTopLevelRowCount:Math.max(e.rowCount||0,j.rows.totalTopLevelRowCount)})})),t.current.unstable_caches.rows.rowCountPropBeforePartialUpdates=e.rowCount,t.current.forceUpdate());return}n.debug(`Updating all rows, new length ${e.rows.length}`),l(n_({rows:e.rows,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),!1)},[e.rows,e.rowCount,e.getRowId,e.loading,n,l,t])},mEe=({ids:t,idRowsLookup:e,idToIdLookup:n,previousTree:r})=>{const i={};for(let o=0;o{DN(t,Sb,"rowTreeCreation",mEe)};Ja(["MUI: You are calling getValue. This method is deprecated and will be removed in the next major version.","Instead, you can access the data from `params.row`."]);function vEe(t){const e=E.useCallback(d=>({field:d,colDef:t.current.getColumn(d)}),[t]),n=E.useCallback((...d)=>t.current.getCellValue(...d),[t]),r=E.useCallback(d=>{const f=t.current.getRow(d);if(!f)throw new Error(`No row with id #${d} found`);return{id:d,columns:t.current.getAllColumns(),row:f,getValue:n}},[t,n]),i=E.useCallback((d,f)=>{const h=t.current.getRow(d),p=t.current.getRowNode(d);if(!h||!p)throw new Error(`No row with id #${d} found`);const g=ka(t),b=hS(t);return{id:d,field:f,row:h,rowNode:p,value:h[f],colDef:t.current.getColumn(f),cellMode:t.current.getCellMode(d,f),getValue:n,api:t.current,hasFocus:g!==null&&g.field===f&&g.id===d,tabIndex:b&&b.field===f&&b.id===d?0:-1}},[t,n]),o=E.useCallback((d,f)=>{const h=t.current.getColumn(f),p=t.current.getCellValue(d,f),g=t.current.getRow(d),b=t.current.getRowNode(d);if(!g||!b)throw new Error(`No row with id #${d} found`);const m=ka(t),w=hS(t),x={id:d,field:f,row:g,rowNode:b,colDef:h,cellMode:t.current.getCellMode(d,f),getValue:n,hasFocus:m!==null&&m.field===f&&m.id===d,tabIndex:w&&w.field===f&&w.id===d?0:-1,value:p,formattedValue:p};return h&&h.valueFormatter&&(x.formattedValue=h.valueFormatter({id:d,field:x.field,value:x.value,api:t.current})),x.isEditable=h&&t.current.isCellEditable(x),x},[t,n]),s=E.useCallback((d,f)=>{const h=t.current.getColumn(f);if(!h||!h.valueGetter){const p=t.current.getRow(d);if(!p)throw new Error(`No row with id #${d} found`);return p[f]}return h.valueGetter(i(d,f))},[t,i]),a=E.useCallback(d=>t.current.rootElementRef.current?Hxe(t.current.rootElementRef.current,d):null,[t]),l=E.useCallback(d=>t.current.rootElementRef.current?Vxe(t.current.rootElementRef.current,d):null,[t]),u=E.useCallback((d,f)=>t.current.rootElementRef.current?Gxe(t.current.rootElementRef.current,{id:d,field:f}):null,[t]);In(t,{getCellValue:s,getCellParams:o,getCellElement:u,getRowParams:r,getRowElement:l,getColumnHeaderParams:e,getColumnHeaderElement:a})}const CW=(t,e)=>t==null||Array.isArray(t)?t:e&&e[0]===t?e:[t],yEe=(t,e)=>{var n;return O({},t,{selection:(n=CW(e.selectionModel))!=null?n:[]})},bEe=(t,e)=>{const n=Jr(t,"useGridSelection"),r=E.useMemo(()=>CW(e.selectionModel,Qs(t.current.state)),[t,e.selectionModel]),i=E.useRef(null);t.current.unstable_registerControlState({stateId:"selection",propModel:r,propOnChange:e.onSelectionModelChange,stateSelector:Qs,changeEvent:"selectionChange"});const{checkboxSelection:o,disableMultipleSelection:s,disableSelectionOnClick:a,pagination:l,paginationMode:u,isRowSelectable:c}=e,d=!s||o,f=rh(t,e),h=E.useCallback(k=>{var U;let G=k;const B=(U=i.current)!=null?U:k,L=t.current.isRowSelected(k);if(L){const N=bv(t),W=N.findIndex(Q=>Q===B),K=N.findIndex(Q=>Q===G);if(W===K)return;W>K?G=N[K+1]:G=N[K-1]}i.current=k,t.current.selectRowRange({startId:B,endId:G},!L)},[t]),p=E.useCallback(k=>{Qs(t.current.state)!==k&&(n.debug("Setting selection model"),t.current.setState(G=>O({},G,{selection:k})),t.current.forceUpdate())},[t,n]),g=E.useCallback(k=>Qs(t.current.state).includes(k),[t]),b=E.useCallback(k=>{if(c&&!c(t.current.getRowParams(k)))return!1;const U=t.current.getRowNode(k);return!((U==null?void 0:U.position)==="footer"||U!=null&&U.isPinned)},[t,c]),m=E.useCallback(()=>cwe(t),[t]),w=E.useCallback((k,U=!0,G=!1)=>{if(t.current.isRowSelectable(k))if(i.current=k,G)n.debug(`Setting selection for row ${k}`),t.current.setSelectionModel(U?[k]:[]);else{n.debug(`Toggling selection for row ${k}`);const L=Qs(t.current.state).filter(W=>W!==k);U&&L.push(k),(L.length<2||d)&&t.current.setSelectionModel(L)}},[t,n,d]),x=E.useCallback((k,U=!0,G=!1)=>{n.debug("Setting selection for several rows");const B=k.filter(W=>t.current.isRowSelectable(W));let L;if(G)L=U?B:[];else{const W=O({},mS(t));B.forEach(K=>{U?W[K]=K:delete W[K]}),L=Object.values(W)}(L.length<2||d)&&t.current.setSelectionModel(L)},[t,n,d]),_=E.useCallback(({startId:k,endId:U},G=!0,B)=>{if(!t.current.getRow(k)||!t.current.getRow(U))return;n.debug(`Expanding selection from row ${k} to row ${U}`);const L=bv(t),N=L.indexOf(k),W=L.indexOf(U),[K,Q]=N>W?[W,N]:[N,W],J=L.slice(K,Q+1);t.current.selectRows(J,G,B)},[t,n]);In(t,{selectRow:w,selectRows:x,selectRowRange:_,setSelectionModel:p,getSelectedRows:m,isRowSelected:g,isRowSelectable:b});const S=E.useCallback(()=>{if(e.keepNonExistentRowsSelected)return;const k=Qs(t.current.state),U=ym(t),G=O({},mS(t));let B=!1;k.forEach(L=>{U[L]||(delete G[L],B=!0)}),B&&t.current.setSelectionModel(Object.values(G))},[t,e.keepNonExistentRowsSelected]),M=E.useCallback((k,U)=>{const G=U.metaKey||U.ctrlKey,B=!o&&!G&&!MD(U),L=!d||B,N=t.current.isRowSelected(k);L?t.current.selectRow(k,B?!0:!N,!0):t.current.selectRow(k,!N,!1)},[t,d,o]),P=E.useCallback((k,U)=>{var G;if(a)return;const B=(G=U.target.closest(`.${Ie.cell}`))==null?void 0:G.getAttribute("data-field");B===wb.field||B===AN||B&&t.current.getColumn(B).type===TN||t.current.getRowNode(k.id).isPinned||(U.shiftKey&&(d||o)?h(k.id):M(k.id,U))},[a,d,o,t,h,M]),A=E.useCallback((k,U)=>{if(d&&U.shiftKey){var G;(G=window.getSelection())==null||G.removeAllRanges()}},[d]),R=E.useCallback((k,U)=>{U.nativeEvent.shiftKey?h(k.id):t.current.selectRow(k.id,k.value)},[t,h]),F=E.useCallback(k=>{const G=e.checkboxSelectionVisibleOnly&&e.pagination?Kj(t):bv(t);t.current.selectRows(G,k.value)},[t,e.checkboxSelectionVisibleOnly,e.pagination]),$=E.useCallback((k,U)=>{if(t.current.getCellMode(k.id,k.field)!==an.Edit&&U.currentTarget.contains(U.target)){if(xb(U.key)&&U.shiftKey){const G=ka(t);if(G&&G.id!==k.id){U.preventDefault();const B=t.current.isRowSelected(G.id);if(!d){t.current.selectRow(G.id,!B,!0);return}const L=t.current.getRowIndexRelativeToVisibleRows(G.id),N=t.current.getRowIndexRelativeToVisibleRows(k.id);let W,K;L>N?B?(W=N,K=L-1):(W=N,K=L):B?(W=L+1,K=N):(W=L,K=N);const Q=f.rows.slice(W,K+1).map(J=>J.id);t.current.selectRows(Q,!B);return}}if(U.key===" "&&U.shiftKey){U.preventDefault(),M(k.id,U);return}U.key.toLowerCase()==="a"&&(U.ctrlKey||U.metaKey)&&(U.preventDefault(),x(t.current.getAllRowIds(),!0))}},[t,M,x,f.rows,d]);ct(t,"sortedRowsSet",S),ct(t,"rowClick",P),ct(t,"rowSelectionCheckboxChange",R),ct(t,"headerSelectionCheckboxChange",F),ct(t,"cellMouseDown",A),ct(t,"cellKeyDown",$),E.useEffect(()=>{r!==void 0&&t.current.setSelectionModel(r)},[t,r]);const j=r!=null;E.useEffect(()=>{if(j)return;const k=Qs(t.current.state);if(b){const U=k.filter(G=>b(G));U.length{const k=Qs(t.current.state);if(!d&&k.length>1){const{rows:U}=CE(t,{pagination:l,paginationMode:u}),G=U.reduce((L,{id:N})=>(L[N]=!0,L),{}),B=k.find(L=>{let N=!0;return b&&(N=b(L)),N&&G[L]});t.current.setSelectionModel(B!==void 0?[B]:[])}},[t,d,o,s,b,l,u])},xEe={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",errorOverlayDefaultLabel:"An error occurred.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:t=>t!==1?`${t} active filters`:`${t} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsPanelTextFieldLabel:"Find column",columnsPanelTextFieldPlaceholder:"Column title",columnsPanelDragIconLabel:"Reorder column",columnsPanelShowAllButton:"Show all",columnsPanelHideAllButton:"Hide all",filterPanelAddFilter:"Add filter",filterPanelDeleteIconLabel:"Delete",filterPanelLinkOperator:"Logic operator",filterPanelOperators:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorEquals:"equals",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:t=>t!==1?`${t} active filters`:`${t} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:t=>t!==1?`${t.toLocaleString()} rows selected`:`${t.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(t,e)=>`${t.toLocaleString()} of ${e.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:t=>`Group by ${t}`,unGroupColumn:t=>`Stop grouping by ${t}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"},wEe=["sortingOrder"],_Ee=E.memo(function(e){const{sortingOrder:n}=e,r=Be(e,wEe),i=mt(),[o]=n,s=o==="asc"?i.components.ColumnSortedAscendingIcon:i.components.ColumnSortedDescendingIcon;return s?D.jsx(s,O({},r)):null}),SEe=["error","hasError","errorInfo"],CEe=E.forwardRef(function(e,n){const{error:r}=e,i=Be(e,SEe),o=Lt(),s=o.current.getLocaleText("errorOverlayDefaultLabel"),a=gt(o,yb);return D.jsx(SE,O({ref:n,sx:{width:"100%",minHeight:2*a}},i,{children:(r==null?void 0:r.message)||s}))}),EEe=E.forwardRef(function(e,n){const i=Lt().current.getLocaleText("noResultsOverlayLabel");return D.jsx(SE,O({ref:n},e,{children:i}))}),MEe={BooleanCellTrueIcon:L1e,BooleanCellFalseIcon:TT,ColumnMenuIcon:F1e,OpenFilterButtonIcon:M1e,FilterPanelDeleteIcon:TT,ColumnFilteredIcon:T1e,ColumnSelectorIcon:P1e,ColumnUnsortedIcon:_Ee,ColumnSortedAscendingIcon:C1e,ColumnSortedDescendingIcon:E1e,ColumnResizeIcon:D1e,DensityCompactIcon:R1e,DensityStandardIcon:I1e,DensityComfortableIcon:N1e,ExportIcon:k1e,MoreActionsIcon:B1e,TreeDataCollapseIcon:l8,TreeDataExpandIcon:a8,GroupingCriteriaCollapseIcon:l8,GroupingCriteriaExpandIcon:a8,DetailPanelExpandIcon:Uj,DetailPanelCollapseIcon:O1e,RowReorderIcon:Hj,QuickFilterIcon:A1e,QuickFilterClearIcon:TT},A8=O({},MEe,{BaseCheckbox:vc,BaseTextField:$n,BaseFormControl:Ai,BaseSelect:Ps,BaseSwitch:Che,BaseButton:Bf,BaseTooltip:mhe,BasePopper:Yf,Cell:c1e,SkeletonCell:pxe,ColumnHeaderFilterIconButton:iwe,ColumnMenu:d_e,ErrorOverlay:CEe,Footer:PSe,Header:DSe,Toolbar:null,PreferencesPanel:$_e,LoadingOverlay:RSe,NoResultsOverlay:EEe,NoRowsOverlay:ISe,Pagination:FSe,FilterPanel:Q_e,ColumnsPanel:N_e,Panel:B_e,Row:$Se}),TEe=t=>{const{classes:e}=t;return E.useMemo(()=>Qe({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},ln,e),[e])},AEe=(t,e)=>{const n={classes:e.classes},r=TEe(n),i=E.useCallback(o=>{const s=O({},wb,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:t.current.getLocaleText("checkboxSelectionHeaderName")}),a=e.checkboxSelection,l=o.lookup[yc]!=null;return a&&!l?(o.lookup[yc]=s,o.all=[yc,...o.all]):!a&&l?(delete o.lookup[yc],o.all=o.all.filter(u=>u!==yc)):a&&l&&(o.lookup[yc]=O({},s,o.lookup[yc])),o},[t,r,e.checkboxSelection]);Pi(t,"hydrateColumns",i)},PEe=(t,e)=>{var n,r,i,o;const s=(n=(r=e.sortModel)!=null?r:(i=e.initialState)==null||(o=i.sorting)==null?void 0:o.sortModel)!=null?n:[];return O({},t,{sorting:{sortModel:Yj(s,e.disableMultipleColumnsSorting),sortedRows:[]}})},DEe=(t,e)=>{var n,r;const i=Jr(t,"useGridSorting");t.current.unstable_registerControlState({stateId:"sortModel",propModel:e.sortModel,propOnChange:e.onSortModelChange,stateSelector:Ra,changeEvent:"sortModelChange"});const o=E.useCallback((M,P)=>{const A=Ra(t),R=A.findIndex($=>$.field===M);let F=[...A];return R>-1?P?F.splice(R,1,P):F.splice(R,1):F=[...A,P],F},[t]),s=E.useCallback((M,P)=>{var A;const F=Ra(t).find(j=>j.field===M.field);if(F){var $;const j=P===void 0?d8(($=M.sortingOrder)!=null?$:e.sortingOrder,F.sort):P;return j==null?void 0:O({},F,{sort:j})}return{field:M.field,sort:P===void 0?d8((A=M.sortingOrder)!=null?A:e.sortingOrder):P}},[t,e.sortingOrder]),a=E.useCallback(()=>{t.current.setState(M=>{if(e.sortingMode===bm.server)return i.debug("Skipping sorting rows as sortingMode = server"),O({},M,{sorting:O({},M.sorting,{sortedRows:df(M,t.current.instanceId)})});const P=Ra(M,t.current.instanceId),A=Swe(P,t),R=t.current.unstable_applyStrategyProcessor("sorting",{sortRowList:A});return O({},M,{sorting:O({},M.sorting,{sortedRows:R})})}),t.current.publishEvent("sortedRowsSet"),t.current.forceUpdate()},[t,i,e.sortingMode]),l=E.useCallback(M=>{Ra(t)!==M&&(i.debug("Setting sort model"),t.current.setState(c8(M,e.disableMultipleColumnsSorting)),t.current.forceUpdate(),t.current.applySorting())},[t,i,e.disableMultipleColumnsSorting]),u=E.useCallback((M,P,A)=>{if(!M.sortable)return;const R=s(M,P);let F;!A||e.disableMultipleColumnsSorting?F=R?[R]:[]:F=o(M.field,R),t.current.setSortModel(F)},[t,o,s,e.disableMultipleColumnsSorting]),c=E.useCallback(()=>Ra(t),[t]),d=E.useCallback(()=>yN(t).map(P=>P.model),[t]),f=E.useCallback(()=>vN(t),[t]),h=E.useCallback(M=>t.current.getSortedRowIds().indexOf(M),[t]),p=E.useCallback(M=>t.current.getSortedRowIds()[M],[t]);In(t,{getSortModel:c,getSortedRows:d,getSortedRowIds:f,getRowIndex:h,getRowIdFromRowIndex:p,setSortModel:l,sortColumn:u,applySorting:a});const b=E.useCallback((M,P)=>{var A,R;const F=Ra(t);return!P.exportOnlyDirtyModels||e.sortModel!=null||((A=e.initialState)==null||(R=A.sorting)==null?void 0:R.sortModel)!=null||F.length>0?O({},M,{sorting:{sortModel:F}}):M},[t,e.sortModel,(n=e.initialState)==null||(r=n.sorting)==null?void 0:r.sortModel]),m=E.useCallback((M,P)=>{var A;const R=(A=P.stateToRestore.sorting)==null?void 0:A.sortModel;return R==null?M:(t.current.setState(c8(R,e.disableMultipleColumnsSorting)),O({},M,{callbacks:[...M.callbacks,t.current.applySorting]}))},[t,e.disableMultipleColumnsSorting]),w=E.useCallback(M=>{const P=$c(t);if(!M.sortRowList){const F=[],$=[];return df(t).forEach(j=>{P[j].isPinned||(P[j].position==="footer"?$.push(j):F.push(j))}),[...F,...$]}const A=[],R=[];return Object.values(P).forEach(F=>{F.isPinned||(F.position==="footer"?R.push(F.id):A.push(F))}),[...M.sortRowList(A),...R]},[t]);Pi(t,"exportState",b),Pi(t,"restoreState",m),DN(t,Sb,"sorting",w);const x=E.useCallback(({colDef:M},P)=>{const A=P.shiftKey||P.metaKey||P.ctrlKey;u(M,void 0,A)},[u]),_=E.useCallback(({colDef:M},P)=>{Gj(P.key)&&!P.ctrlKey&&!P.metaKey&&u(M,void 0,P.shiftKey)},[u]),C=E.useCallback(()=>{const M=Ra(t),P=th(t);if(M.length>0){const A=M.filter(R=>P[R.field]);A.length{M==="sorting"&&t.current.applySorting()},[t]);ct(t,"columnHeaderClick",x),ct(t,"columnHeaderKeyDown",_),ct(t,"rowsSet",t.current.applySorting),ct(t,"columnsChange",C),ct(t,"activeStrategyProcessorChange",S),_b(()=>{t.current.applySorting()}),E.useEffect(()=>{e.sortModel!==void 0&&t.current.setSortModel(e.sortModel)},[t,e.sortModel])};function P8(t){const{clientHeight:e,scrollTop:n,offsetHeight:r,offsetTop:i}=t,o=i+r;if(r>e)return i;if(o-e>n)return o-e;if(i{const n=Jr(t,"useGridScroll"),r=t.current.columnHeadersElementRef,i=t.current.windowRef,o=gt(t,Ku),s=E.useCallback(c=>{const d=yE(t),f=lo(t);if(!(c.rowIndex==null)&&d===0||f.length===0)return!1;n.debug(`Scrolling to cell at row ${c.rowIndex}, col: ${c.colIndex} `);let p={};if(c.colIndex!=null){const w=zf(t);let x;if(typeof c.rowIndex<"u"){var g;const _=(g=o[c.rowIndex])==null?void 0:g.id,C=t.current.unstable_getCellColSpanInfo(_,c.colIndex);C&&!C.spannedByColSpan&&(x=C.cellProps.width)}typeof x>"u"&&(x=f[c.colIndex].computedWidth),p.left=P8({clientHeight:i.current.clientWidth,scrollTop:i.current.scrollLeft,offsetHeight:x,offsetTop:w[c.colIndex]})}if(c.rowIndex!=null){var b,m;const w=py(t.current.state),x=X0(t),_=xv(t),C=e.pagination?c.rowIndex-x*_:c.rowIndex,S=w.positions[C+1]?w.positions[C+1]-w.positions[C]:w.currentPageTotalHeight-w.positions[C],M=((b=i.current.querySelector(`.${Ie["pinnedRows--top"]}`))==null?void 0:b.clientHeight)||0,P=((m=i.current.querySelector(`.${Ie["pinnedRows--bottom"]}`))==null?void 0:m.clientHeight)||0;p.top=P8({clientHeight:i.current.clientHeight-M-P,scrollTop:i.current.scrollTop,offsetHeight:S,offsetTop:w.positions[C]})}return p=t.current.unstable_applyPipeProcessors("scrollToIndexes",p,c),typeof p.left!==void 0||typeof p.top!==void 0?(t.current.scroll(p),!0):!1},[n,t,i,e.pagination,o]),a=E.useCallback(c=>{i.current&&c.left!=null&&r.current&&(r.current.scrollLeft=c.left,i.current.scrollLeft=c.left,n.debug(`Scrolling left: ${c.left}`)),i.current&&c.top!=null&&(i.current.scrollTop=c.top,n.debug(`Scrolling top: ${c.top}`)),n.debug("Scrolling, updating container, and viewport")},[i,r,n]),l=E.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);In(t,{scroll:a,scrollToIndexes:s,getScrollPosition:l})};function IEe(t,e){dn(t,"columnHeaderClick",e.onColumnHeaderClick),dn(t,"columnHeaderDoubleClick",e.onColumnHeaderDoubleClick),dn(t,"columnHeaderOver",e.onColumnHeaderOver),dn(t,"columnHeaderOut",e.onColumnHeaderOut),dn(t,"columnHeaderEnter",e.onColumnHeaderEnter),dn(t,"columnHeaderLeave",e.onColumnHeaderLeave),dn(t,"columnOrderChange",e.onColumnOrderChange),dn(t,"cellClick",e.onCellClick),dn(t,"cellDoubleClick",e.onCellDoubleClick),dn(t,"cellKeyDown",e.onCellKeyDown),dn(t,"cellFocusOut",e.onCellFocusOut),dn(t,"preferencePanelClose",e.onPreferencePanelClose),dn(t,"preferencePanelOpen",e.onPreferencePanelOpen),dn(t,"menuOpen",e.onMenuOpen),dn(t,"menuClose",e.onMenuClose),dn(t,"rowDoubleClick",e.onRowDoubleClick),dn(t,"rowClick",e.onRowClick),dn(t,"componentError",e.onError),dn(t,"stateChange",e.onStateChange)}const NEe=({content:t,container:e,scrollBarSize:n})=>{const r=t.width>e.width,i=t.height>e.height;let o=!1,s=!1;return(r||i)&&(o=r,s=t.height+(o?n:0)>e.height,s&&(o=t.width+n>e.width)),{hasScrollX:o,hasScrollY:s}};function FEe(t,e){const n=Jr(t,"useResizeContainer"),r=E.useRef(!1),i=E.useRef(null),o=E.useRef(null),s=gt(t,py),a=gt(t,bb),l=E.useCallback(()=>{var b;const m=(b=t.current.rootElementRef)==null?void 0:b.current,w=bE(t),x=xW(t);if(!i.current)return;let _;if(e.scrollbarSize!=null)_=e.scrollbarSize;else if(!w||!m)_=0;else{const $=Sr(m).createElement("div");$.style.width="99px",$.style.height="99px",$.style.position="absolute",$.style.overflow="scroll",$.className="scrollDiv",m.appendChild($),_=$.offsetWidth-$.clientWidth,m.removeChild($)}let C,S,M;if(e.autoHeight)M=!1,S=Math.round(w)>i.current.width,C={width:i.current.width,height:s.currentPageTotalHeight+(S?_:0)};else{C={width:i.current.width,height:i.current.height-a};const F=NEe({content:{width:Math.round(w),height:s.currentPageTotalHeight},container:{width:C.width,height:C.height-x.top-x.bottom},scrollBarSize:_});M=F.hasScrollY,S=F.hasScrollX}const P={width:C.width-(M?_:0),height:C.height-(S?_:0)},A={viewportOuterSize:C,viewportInnerSize:P,hasScrollX:S,hasScrollY:M,scrollBarSize:_},R=o.current;o.current=A,(A.viewportInnerSize.width!==(R==null?void 0:R.viewportInnerSize.width)||A.viewportInnerSize.height!==(R==null?void 0:R.viewportInnerSize.height))&&t.current.publishEvent("viewportInnerSizeChange",A.viewportInnerSize)},[t,e.scrollbarSize,e.autoHeight,a,s.currentPageTotalHeight]),u=E.useCallback(()=>{l(),t.current.publishEvent("debouncedResize",i.current)},[t,l]),c=E.useCallback(()=>o.current,[]),d=E.useCallback(()=>{const b=t.current.getRootDimensions();if(!b)return 0;const m=CE(t,{pagination:e.pagination,paginationMode:e.paginationMode});if(e.getRowHeight){const x=t.current.unstable_getRenderContext(),_=x.lastRowIndex-x.firstRowIndex;return Math.min(_-1,m.rows.length)}const w=Math.floor(b.viewportInnerSize.height/yb(t));return Math.min(w,m.rows.length)},[t,e.pagination,e.paginationMode,e.getRowHeight]);In(t,{resize:u,getRootDimensions:c,unstable_getViewportPageSize:d,unstable_updateGridDimensionsRef:l});const h=E.useMemo(()=>ug(u,60),[u]),p=E.useRef(!0),g=E.useCallback(b=>{i.current=b;const m=/jsdom/.test(window.navigator.userAgent);if(b.height===0&&!r.current&&!e.autoHeight&&!m&&(n.error(["The parent DOM element of the data grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` +`));if(F.length===0)return;const j=[...df(t)],k=ym(t),U=pN(t),G=$c(t),B=O({},k),L=O({},U),N=O({},G),W=F.map(K=>({id:PD(K,e.getRowId,"A row was provided without id when calling replaceRows()."),model:K}));W.forEach((K,Q)=>{const[J]=j.splice(R+Q,1,K.id);delete B[J],delete L[J],delete N[J]}),W.forEach(K=>{const Q={id:K.id,parent:null,depth:0,groupingKey:null,groupingField:null};B[K.id]=K.model,L[K.id]=K.id,N[K.id]=Q}),t.current.unstable_caches.rows.idRowsLookup=B,t.current.unstable_caches.rows.idToIdLookup=L,t.current.unstable_caches.rows.ids=j,t.current.setState(K=>{const Q={idRowsLookup:B,idToIdLookup:L,tree:N,ids:j};return O({},K,{rows:O({},K.rows,Q,{groupingResponseBeforeRowHydration:O({},K.rows.groupingResponseBeforeRowHydration,Q)})})}),t.current.publishEvent("rowsSet")},[t,e.signature,e.getRowId]),_={getRow:s,getRowModels:d,getRowsCount:f,getAllRowIds:h,setRows:u,setRowIndex:w,updateRows:c,setRowChildrenExpansion:g,getRowNode:b,getRowIndexRelativeToVisibleRows:p,getRowGroupChildren:m,unstable_replaceRows:x},C=E.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree");let R;t.current.unstable_caches.rows.rowsBeforePartialUpdates===e.rows?R=t.current.unstable_caches.rows:R=n_({rows:e.rows,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),l(R,!1)},[n,t,e.rows,e.getRowId,e.loading,e.rowCount,l]),S=E.useCallback(R=>{R==="rowTreeCreation"&&C()},[C]),M=E.useCallback(()=>{t.current.unstable_getActiveStrategy("rowTree")!==Ube(t)&&C()},[t,C]);ct(t,"activeStrategyProcessorChange",S),ct(t,"strategyAvailabilityChange",M);const P=E.useCallback(()=>{t.current.setState(R=>O({},R,{rows:O({},R.rows,t.current.unstable_applyPipeProcessors("hydrateRows",R.rows.groupingResponseBeforeRowHydration))})),t.current.publishEvent("rowsSet"),t.current.forceUpdate()},[t]);PN(t,"hydrateRows",P),In(t,_),E.useEffect(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);const A=E.useRef(!0);E.useEffect(()=>{if(A.current){A.current=!1;return}const R=t.current.unstable_caches.rows.rowsBeforePartialUpdates===e.rows,F=t.current.unstable_caches.rows.loadingPropBeforePartialUpdates===e.loading,$=t.current.unstable_caches.rows.rowCountPropBeforePartialUpdates===e.rowCount;if(R){F||(t.current.setState(j=>O({},j,{rows:O({},j.rows,{loading:e.loading})})),t.current.unstable_caches.rows.loadingPropBeforePartialUpdates=e.loading,t.current.forceUpdate()),$||(t.current.setState(j=>O({},j,{rows:O({},j.rows,{totalRowCount:Math.max(e.rowCount||0,j.rows.totalRowCount),totalTopLevelRowCount:Math.max(e.rowCount||0,j.rows.totalTopLevelRowCount)})})),t.current.unstable_caches.rows.rowCountPropBeforePartialUpdates=e.rowCount,t.current.forceUpdate());return}n.debug(`Updating all rows, new length ${e.rows.length}`),l(n_({rows:e.rows,getRowId:e.getRowId,loading:e.loading,rowCount:e.rowCount}),!1)},[e.rows,e.rowCount,e.getRowId,e.loading,n,l,t])},mEe=({ids:t,idRowsLookup:e,idToIdLookup:n,previousTree:r})=>{const i={};for(let o=0;o{DN(t,Sb,"rowTreeCreation",mEe)};Qa(["MUI: You are calling getValue. This method is deprecated and will be removed in the next major version.","Instead, you can access the data from `params.row`."]);function vEe(t){const e=E.useCallback(d=>({field:d,colDef:t.current.getColumn(d)}),[t]),n=E.useCallback((...d)=>t.current.getCellValue(...d),[t]),r=E.useCallback(d=>{const f=t.current.getRow(d);if(!f)throw new Error(`No row with id #${d} found`);return{id:d,columns:t.current.getAllColumns(),row:f,getValue:n}},[t,n]),i=E.useCallback((d,f)=>{const h=t.current.getRow(d),p=t.current.getRowNode(d);if(!h||!p)throw new Error(`No row with id #${d} found`);const g=Oa(t),b=hS(t);return{id:d,field:f,row:h,rowNode:p,value:h[f],colDef:t.current.getColumn(f),cellMode:t.current.getCellMode(d,f),getValue:n,api:t.current,hasFocus:g!==null&&g.field===f&&g.id===d,tabIndex:b&&b.field===f&&b.id===d?0:-1}},[t,n]),o=E.useCallback((d,f)=>{const h=t.current.getColumn(f),p=t.current.getCellValue(d,f),g=t.current.getRow(d),b=t.current.getRowNode(d);if(!g||!b)throw new Error(`No row with id #${d} found`);const m=Oa(t),w=hS(t),x={id:d,field:f,row:g,rowNode:b,colDef:h,cellMode:t.current.getCellMode(d,f),getValue:n,hasFocus:m!==null&&m.field===f&&m.id===d,tabIndex:w&&w.field===f&&w.id===d?0:-1,value:p,formattedValue:p};return h&&h.valueFormatter&&(x.formattedValue=h.valueFormatter({id:d,field:x.field,value:x.value,api:t.current})),x.isEditable=h&&t.current.isCellEditable(x),x},[t,n]),s=E.useCallback((d,f)=>{const h=t.current.getColumn(f);if(!h||!h.valueGetter){const p=t.current.getRow(d);if(!p)throw new Error(`No row with id #${d} found`);return p[f]}return h.valueGetter(i(d,f))},[t,i]),a=E.useCallback(d=>t.current.rootElementRef.current?Hxe(t.current.rootElementRef.current,d):null,[t]),l=E.useCallback(d=>t.current.rootElementRef.current?Vxe(t.current.rootElementRef.current,d):null,[t]),u=E.useCallback((d,f)=>t.current.rootElementRef.current?Gxe(t.current.rootElementRef.current,{id:d,field:f}):null,[t]);In(t,{getCellValue:s,getCellParams:o,getCellElement:u,getRowParams:r,getRowElement:l,getColumnHeaderParams:e,getColumnHeaderElement:a})}const CW=(t,e)=>t==null||Array.isArray(t)?t:e&&e[0]===t?e:[t],yEe=(t,e)=>{var n;return O({},t,{selection:(n=CW(e.selectionModel))!=null?n:[]})},bEe=(t,e)=>{const n=Jr(t,"useGridSelection"),r=E.useMemo(()=>CW(e.selectionModel,Qs(t.current.state)),[t,e.selectionModel]),i=E.useRef(null);t.current.unstable_registerControlState({stateId:"selection",propModel:r,propOnChange:e.onSelectionModelChange,stateSelector:Qs,changeEvent:"selectionChange"});const{checkboxSelection:o,disableMultipleSelection:s,disableSelectionOnClick:a,pagination:l,paginationMode:u,isRowSelectable:c}=e,d=!s||o,f=rh(t,e),h=E.useCallback(k=>{var U;let G=k;const B=(U=i.current)!=null?U:k,L=t.current.isRowSelected(k);if(L){const N=bv(t),W=N.findIndex(Q=>Q===B),K=N.findIndex(Q=>Q===G);if(W===K)return;W>K?G=N[K+1]:G=N[K-1]}i.current=k,t.current.selectRowRange({startId:B,endId:G},!L)},[t]),p=E.useCallback(k=>{Qs(t.current.state)!==k&&(n.debug("Setting selection model"),t.current.setState(G=>O({},G,{selection:k})),t.current.forceUpdate())},[t,n]),g=E.useCallback(k=>Qs(t.current.state).includes(k),[t]),b=E.useCallback(k=>{if(c&&!c(t.current.getRowParams(k)))return!1;const U=t.current.getRowNode(k);return!((U==null?void 0:U.position)==="footer"||U!=null&&U.isPinned)},[t,c]),m=E.useCallback(()=>cwe(t),[t]),w=E.useCallback((k,U=!0,G=!1)=>{if(t.current.isRowSelectable(k))if(i.current=k,G)n.debug(`Setting selection for row ${k}`),t.current.setSelectionModel(U?[k]:[]);else{n.debug(`Toggling selection for row ${k}`);const L=Qs(t.current.state).filter(W=>W!==k);U&&L.push(k),(L.length<2||d)&&t.current.setSelectionModel(L)}},[t,n,d]),x=E.useCallback((k,U=!0,G=!1)=>{n.debug("Setting selection for several rows");const B=k.filter(W=>t.current.isRowSelectable(W));let L;if(G)L=U?B:[];else{const W=O({},mS(t));B.forEach(K=>{U?W[K]=K:delete W[K]}),L=Object.values(W)}(L.length<2||d)&&t.current.setSelectionModel(L)},[t,n,d]),_=E.useCallback(({startId:k,endId:U},G=!0,B)=>{if(!t.current.getRow(k)||!t.current.getRow(U))return;n.debug(`Expanding selection from row ${k} to row ${U}`);const L=bv(t),N=L.indexOf(k),W=L.indexOf(U),[K,Q]=N>W?[W,N]:[N,W],J=L.slice(K,Q+1);t.current.selectRows(J,G,B)},[t,n]);In(t,{selectRow:w,selectRows:x,selectRowRange:_,setSelectionModel:p,getSelectedRows:m,isRowSelected:g,isRowSelectable:b});const S=E.useCallback(()=>{if(e.keepNonExistentRowsSelected)return;const k=Qs(t.current.state),U=ym(t),G=O({},mS(t));let B=!1;k.forEach(L=>{U[L]||(delete G[L],B=!0)}),B&&t.current.setSelectionModel(Object.values(G))},[t,e.keepNonExistentRowsSelected]),M=E.useCallback((k,U)=>{const G=U.metaKey||U.ctrlKey,B=!o&&!G&&!MD(U),L=!d||B,N=t.current.isRowSelected(k);L?t.current.selectRow(k,B?!0:!N,!0):t.current.selectRow(k,!N,!1)},[t,d,o]),P=E.useCallback((k,U)=>{var G;if(a)return;const B=(G=U.target.closest(`.${Ie.cell}`))==null?void 0:G.getAttribute("data-field");B===wb.field||B===AN||B&&t.current.getColumn(B).type===TN||t.current.getRowNode(k.id).isPinned||(U.shiftKey&&(d||o)?h(k.id):M(k.id,U))},[a,d,o,t,h,M]),A=E.useCallback((k,U)=>{if(d&&U.shiftKey){var G;(G=window.getSelection())==null||G.removeAllRanges()}},[d]),R=E.useCallback((k,U)=>{U.nativeEvent.shiftKey?h(k.id):t.current.selectRow(k.id,k.value)},[t,h]),F=E.useCallback(k=>{const G=e.checkboxSelectionVisibleOnly&&e.pagination?Kj(t):bv(t);t.current.selectRows(G,k.value)},[t,e.checkboxSelectionVisibleOnly,e.pagination]),$=E.useCallback((k,U)=>{if(t.current.getCellMode(k.id,k.field)!==an.Edit&&U.currentTarget.contains(U.target)){if(xb(U.key)&&U.shiftKey){const G=Oa(t);if(G&&G.id!==k.id){U.preventDefault();const B=t.current.isRowSelected(G.id);if(!d){t.current.selectRow(G.id,!B,!0);return}const L=t.current.getRowIndexRelativeToVisibleRows(G.id),N=t.current.getRowIndexRelativeToVisibleRows(k.id);let W,K;L>N?B?(W=N,K=L-1):(W=N,K=L):B?(W=L+1,K=N):(W=L,K=N);const Q=f.rows.slice(W,K+1).map(J=>J.id);t.current.selectRows(Q,!B);return}}if(U.key===" "&&U.shiftKey){U.preventDefault(),M(k.id,U);return}U.key.toLowerCase()==="a"&&(U.ctrlKey||U.metaKey)&&(U.preventDefault(),x(t.current.getAllRowIds(),!0))}},[t,M,x,f.rows,d]);ct(t,"sortedRowsSet",S),ct(t,"rowClick",P),ct(t,"rowSelectionCheckboxChange",R),ct(t,"headerSelectionCheckboxChange",F),ct(t,"cellMouseDown",A),ct(t,"cellKeyDown",$),E.useEffect(()=>{r!==void 0&&t.current.setSelectionModel(r)},[t,r]);const j=r!=null;E.useEffect(()=>{if(j)return;const k=Qs(t.current.state);if(b){const U=k.filter(G=>b(G));U.length{const k=Qs(t.current.state);if(!d&&k.length>1){const{rows:U}=CE(t,{pagination:l,paginationMode:u}),G=U.reduce((L,{id:N})=>(L[N]=!0,L),{}),B=k.find(L=>{let N=!0;return b&&(N=b(L)),N&&G[L]});t.current.setSelectionModel(B!==void 0?[B]:[])}},[t,d,o,s,b,l,u])},xEe={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",errorOverlayDefaultLabel:"An error occurred.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:t=>t!==1?`${t} active filters`:`${t} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsPanelTextFieldLabel:"Find column",columnsPanelTextFieldPlaceholder:"Column title",columnsPanelDragIconLabel:"Reorder column",columnsPanelShowAllButton:"Show all",columnsPanelHideAllButton:"Hide all",filterPanelAddFilter:"Add filter",filterPanelDeleteIconLabel:"Delete",filterPanelLinkOperator:"Logic operator",filterPanelOperators:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorEquals:"equals",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:t=>t!==1?`${t} active filters`:`${t} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:t=>t!==1?`${t.toLocaleString()} rows selected`:`${t.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(t,e)=>`${t.toLocaleString()} of ${e.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:t=>`Group by ${t}`,unGroupColumn:t=>`Stop grouping by ${t}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"},wEe=["sortingOrder"],_Ee=E.memo(function(e){const{sortingOrder:n}=e,r=Be(e,wEe),i=mt(),[o]=n,s=o==="asc"?i.components.ColumnSortedAscendingIcon:i.components.ColumnSortedDescendingIcon;return s?D.jsx(s,O({},r)):null}),SEe=["error","hasError","errorInfo"],CEe=E.forwardRef(function(e,n){const{error:r}=e,i=Be(e,SEe),o=Lt(),s=o.current.getLocaleText("errorOverlayDefaultLabel"),a=gt(o,yb);return D.jsx(SE,O({ref:n,sx:{width:"100%",minHeight:2*a}},i,{children:(r==null?void 0:r.message)||s}))}),EEe=E.forwardRef(function(e,n){const i=Lt().current.getLocaleText("noResultsOverlayLabel");return D.jsx(SE,O({ref:n},e,{children:i}))}),MEe={BooleanCellTrueIcon:L1e,BooleanCellFalseIcon:TT,ColumnMenuIcon:F1e,OpenFilterButtonIcon:M1e,FilterPanelDeleteIcon:TT,ColumnFilteredIcon:T1e,ColumnSelectorIcon:P1e,ColumnUnsortedIcon:_Ee,ColumnSortedAscendingIcon:C1e,ColumnSortedDescendingIcon:E1e,ColumnResizeIcon:D1e,DensityCompactIcon:R1e,DensityStandardIcon:I1e,DensityComfortableIcon:N1e,ExportIcon:k1e,MoreActionsIcon:B1e,TreeDataCollapseIcon:l8,TreeDataExpandIcon:a8,GroupingCriteriaCollapseIcon:l8,GroupingCriteriaExpandIcon:a8,DetailPanelExpandIcon:Uj,DetailPanelCollapseIcon:O1e,RowReorderIcon:Hj,QuickFilterIcon:A1e,QuickFilterClearIcon:TT},A8=O({},MEe,{BaseCheckbox:vc,BaseTextField:$n,BaseFormControl:Ai,BaseSelect:Ps,BaseSwitch:Che,BaseButton:Bf,BaseTooltip:mhe,BasePopper:Yf,Cell:c1e,SkeletonCell:pxe,ColumnHeaderFilterIconButton:iwe,ColumnMenu:d_e,ErrorOverlay:CEe,Footer:PSe,Header:DSe,Toolbar:null,PreferencesPanel:$_e,LoadingOverlay:RSe,NoResultsOverlay:EEe,NoRowsOverlay:ISe,Pagination:FSe,FilterPanel:Q_e,ColumnsPanel:N_e,Panel:B_e,Row:$Se}),TEe=t=>{const{classes:e}=t;return E.useMemo(()=>Qe({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},ln,e),[e])},AEe=(t,e)=>{const n={classes:e.classes},r=TEe(n),i=E.useCallback(o=>{const s=O({},wb,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:t.current.getLocaleText("checkboxSelectionHeaderName")}),a=e.checkboxSelection,l=o.lookup[yc]!=null;return a&&!l?(o.lookup[yc]=s,o.all=[yc,...o.all]):!a&&l?(delete o.lookup[yc],o.all=o.all.filter(u=>u!==yc)):a&&l&&(o.lookup[yc]=O({},s,o.lookup[yc])),o},[t,r,e.checkboxSelection]);Pi(t,"hydrateColumns",i)},PEe=(t,e)=>{var n,r,i,o;const s=(n=(r=e.sortModel)!=null?r:(i=e.initialState)==null||(o=i.sorting)==null?void 0:o.sortModel)!=null?n:[];return O({},t,{sorting:{sortModel:Yj(s,e.disableMultipleColumnsSorting),sortedRows:[]}})},DEe=(t,e)=>{var n,r;const i=Jr(t,"useGridSorting");t.current.unstable_registerControlState({stateId:"sortModel",propModel:e.sortModel,propOnChange:e.onSortModelChange,stateSelector:Da,changeEvent:"sortModelChange"});const o=E.useCallback((M,P)=>{const A=Da(t),R=A.findIndex($=>$.field===M);let F=[...A];return R>-1?P?F.splice(R,1,P):F.splice(R,1):F=[...A,P],F},[t]),s=E.useCallback((M,P)=>{var A;const F=Da(t).find(j=>j.field===M.field);if(F){var $;const j=P===void 0?d8(($=M.sortingOrder)!=null?$:e.sortingOrder,F.sort):P;return j==null?void 0:O({},F,{sort:j})}return{field:M.field,sort:P===void 0?d8((A=M.sortingOrder)!=null?A:e.sortingOrder):P}},[t,e.sortingOrder]),a=E.useCallback(()=>{t.current.setState(M=>{if(e.sortingMode===bm.server)return i.debug("Skipping sorting rows as sortingMode = server"),O({},M,{sorting:O({},M.sorting,{sortedRows:df(M,t.current.instanceId)})});const P=Da(M,t.current.instanceId),A=Swe(P,t),R=t.current.unstable_applyStrategyProcessor("sorting",{sortRowList:A});return O({},M,{sorting:O({},M.sorting,{sortedRows:R})})}),t.current.publishEvent("sortedRowsSet"),t.current.forceUpdate()},[t,i,e.sortingMode]),l=E.useCallback(M=>{Da(t)!==M&&(i.debug("Setting sort model"),t.current.setState(c8(M,e.disableMultipleColumnsSorting)),t.current.forceUpdate(),t.current.applySorting())},[t,i,e.disableMultipleColumnsSorting]),u=E.useCallback((M,P,A)=>{if(!M.sortable)return;const R=s(M,P);let F;!A||e.disableMultipleColumnsSorting?F=R?[R]:[]:F=o(M.field,R),t.current.setSortModel(F)},[t,o,s,e.disableMultipleColumnsSorting]),c=E.useCallback(()=>Da(t),[t]),d=E.useCallback(()=>yN(t).map(P=>P.model),[t]),f=E.useCallback(()=>vN(t),[t]),h=E.useCallback(M=>t.current.getSortedRowIds().indexOf(M),[t]),p=E.useCallback(M=>t.current.getSortedRowIds()[M],[t]);In(t,{getSortModel:c,getSortedRows:d,getSortedRowIds:f,getRowIndex:h,getRowIdFromRowIndex:p,setSortModel:l,sortColumn:u,applySorting:a});const b=E.useCallback((M,P)=>{var A,R;const F=Da(t);return!P.exportOnlyDirtyModels||e.sortModel!=null||((A=e.initialState)==null||(R=A.sorting)==null?void 0:R.sortModel)!=null||F.length>0?O({},M,{sorting:{sortModel:F}}):M},[t,e.sortModel,(n=e.initialState)==null||(r=n.sorting)==null?void 0:r.sortModel]),m=E.useCallback((M,P)=>{var A;const R=(A=P.stateToRestore.sorting)==null?void 0:A.sortModel;return R==null?M:(t.current.setState(c8(R,e.disableMultipleColumnsSorting)),O({},M,{callbacks:[...M.callbacks,t.current.applySorting]}))},[t,e.disableMultipleColumnsSorting]),w=E.useCallback(M=>{const P=$c(t);if(!M.sortRowList){const F=[],$=[];return df(t).forEach(j=>{P[j].isPinned||(P[j].position==="footer"?$.push(j):F.push(j))}),[...F,...$]}const A=[],R=[];return Object.values(P).forEach(F=>{F.isPinned||(F.position==="footer"?R.push(F.id):A.push(F))}),[...M.sortRowList(A),...R]},[t]);Pi(t,"exportState",b),Pi(t,"restoreState",m),DN(t,Sb,"sorting",w);const x=E.useCallback(({colDef:M},P)=>{const A=P.shiftKey||P.metaKey||P.ctrlKey;u(M,void 0,A)},[u]),_=E.useCallback(({colDef:M},P)=>{Gj(P.key)&&!P.ctrlKey&&!P.metaKey&&u(M,void 0,P.shiftKey)},[u]),C=E.useCallback(()=>{const M=Da(t),P=th(t);if(M.length>0){const A=M.filter(R=>P[R.field]);A.length{M==="sorting"&&t.current.applySorting()},[t]);ct(t,"columnHeaderClick",x),ct(t,"columnHeaderKeyDown",_),ct(t,"rowsSet",t.current.applySorting),ct(t,"columnsChange",C),ct(t,"activeStrategyProcessorChange",S),_b(()=>{t.current.applySorting()}),E.useEffect(()=>{e.sortModel!==void 0&&t.current.setSortModel(e.sortModel)},[t,e.sortModel])};function P8(t){const{clientHeight:e,scrollTop:n,offsetHeight:r,offsetTop:i}=t,o=i+r;if(r>e)return i;if(o-e>n)return o-e;if(i{const n=Jr(t,"useGridScroll"),r=t.current.columnHeadersElementRef,i=t.current.windowRef,o=gt(t,Ku),s=E.useCallback(c=>{const d=yE(t),f=lo(t);if(!(c.rowIndex==null)&&d===0||f.length===0)return!1;n.debug(`Scrolling to cell at row ${c.rowIndex}, col: ${c.colIndex} `);let p={};if(c.colIndex!=null){const w=zf(t);let x;if(typeof c.rowIndex<"u"){var g;const _=(g=o[c.rowIndex])==null?void 0:g.id,C=t.current.unstable_getCellColSpanInfo(_,c.colIndex);C&&!C.spannedByColSpan&&(x=C.cellProps.width)}typeof x>"u"&&(x=f[c.colIndex].computedWidth),p.left=P8({clientHeight:i.current.clientWidth,scrollTop:i.current.scrollLeft,offsetHeight:x,offsetTop:w[c.colIndex]})}if(c.rowIndex!=null){var b,m;const w=py(t.current.state),x=X0(t),_=xv(t),C=e.pagination?c.rowIndex-x*_:c.rowIndex,S=w.positions[C+1]?w.positions[C+1]-w.positions[C]:w.currentPageTotalHeight-w.positions[C],M=((b=i.current.querySelector(`.${Ie["pinnedRows--top"]}`))==null?void 0:b.clientHeight)||0,P=((m=i.current.querySelector(`.${Ie["pinnedRows--bottom"]}`))==null?void 0:m.clientHeight)||0;p.top=P8({clientHeight:i.current.clientHeight-M-P,scrollTop:i.current.scrollTop,offsetHeight:S,offsetTop:w.positions[C]})}return p=t.current.unstable_applyPipeProcessors("scrollToIndexes",p,c),typeof p.left!==void 0||typeof p.top!==void 0?(t.current.scroll(p),!0):!1},[n,t,i,e.pagination,o]),a=E.useCallback(c=>{i.current&&c.left!=null&&r.current&&(r.current.scrollLeft=c.left,i.current.scrollLeft=c.left,n.debug(`Scrolling left: ${c.left}`)),i.current&&c.top!=null&&(i.current.scrollTop=c.top,n.debug(`Scrolling top: ${c.top}`)),n.debug("Scrolling, updating container, and viewport")},[i,r,n]),l=E.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);In(t,{scroll:a,scrollToIndexes:s,getScrollPosition:l})};function IEe(t,e){dn(t,"columnHeaderClick",e.onColumnHeaderClick),dn(t,"columnHeaderDoubleClick",e.onColumnHeaderDoubleClick),dn(t,"columnHeaderOver",e.onColumnHeaderOver),dn(t,"columnHeaderOut",e.onColumnHeaderOut),dn(t,"columnHeaderEnter",e.onColumnHeaderEnter),dn(t,"columnHeaderLeave",e.onColumnHeaderLeave),dn(t,"columnOrderChange",e.onColumnOrderChange),dn(t,"cellClick",e.onCellClick),dn(t,"cellDoubleClick",e.onCellDoubleClick),dn(t,"cellKeyDown",e.onCellKeyDown),dn(t,"cellFocusOut",e.onCellFocusOut),dn(t,"preferencePanelClose",e.onPreferencePanelClose),dn(t,"preferencePanelOpen",e.onPreferencePanelOpen),dn(t,"menuOpen",e.onMenuOpen),dn(t,"menuClose",e.onMenuClose),dn(t,"rowDoubleClick",e.onRowDoubleClick),dn(t,"rowClick",e.onRowClick),dn(t,"componentError",e.onError),dn(t,"stateChange",e.onStateChange)}const NEe=({content:t,container:e,scrollBarSize:n})=>{const r=t.width>e.width,i=t.height>e.height;let o=!1,s=!1;return(r||i)&&(o=r,s=t.height+(o?n:0)>e.height,s&&(o=t.width+n>e.width)),{hasScrollX:o,hasScrollY:s}};function FEe(t,e){const n=Jr(t,"useResizeContainer"),r=E.useRef(!1),i=E.useRef(null),o=E.useRef(null),s=gt(t,py),a=gt(t,bb),l=E.useCallback(()=>{var b;const m=(b=t.current.rootElementRef)==null?void 0:b.current,w=bE(t),x=xW(t);if(!i.current)return;let _;if(e.scrollbarSize!=null)_=e.scrollbarSize;else if(!w||!m)_=0;else{const $=Sr(m).createElement("div");$.style.width="99px",$.style.height="99px",$.style.position="absolute",$.style.overflow="scroll",$.className="scrollDiv",m.appendChild($),_=$.offsetWidth-$.clientWidth,m.removeChild($)}let C,S,M;if(e.autoHeight)M=!1,S=Math.round(w)>i.current.width,C={width:i.current.width,height:s.currentPageTotalHeight+(S?_:0)};else{C={width:i.current.width,height:i.current.height-a};const F=NEe({content:{width:Math.round(w),height:s.currentPageTotalHeight},container:{width:C.width,height:C.height-x.top-x.bottom},scrollBarSize:_});M=F.hasScrollY,S=F.hasScrollX}const P={width:C.width-(M?_:0),height:C.height-(S?_:0)},A={viewportOuterSize:C,viewportInnerSize:P,hasScrollX:S,hasScrollY:M,scrollBarSize:_},R=o.current;o.current=A,(A.viewportInnerSize.width!==(R==null?void 0:R.viewportInnerSize.width)||A.viewportInnerSize.height!==(R==null?void 0:R.viewportInnerSize.height))&&t.current.publishEvent("viewportInnerSizeChange",A.viewportInnerSize)},[t,e.scrollbarSize,e.autoHeight,a,s.currentPageTotalHeight]),u=E.useCallback(()=>{l(),t.current.publishEvent("debouncedResize",i.current)},[t,l]),c=E.useCallback(()=>o.current,[]),d=E.useCallback(()=>{const b=t.current.getRootDimensions();if(!b)return 0;const m=CE(t,{pagination:e.pagination,paginationMode:e.paginationMode});if(e.getRowHeight){const x=t.current.unstable_getRenderContext(),_=x.lastRowIndex-x.firstRowIndex;return Math.min(_-1,m.rows.length)}const w=Math.floor(b.viewportInnerSize.height/yb(t));return Math.min(w,m.rows.length)},[t,e.pagination,e.paginationMode,e.getRowHeight]);In(t,{resize:u,getRootDimensions:c,unstable_getViewportPageSize:d,unstable_updateGridDimensionsRef:l});const h=E.useMemo(()=>ug(u,60),[u]),p=E.useRef(!0),g=E.useCallback(b=>{i.current=b;const m=/jsdom/.test(window.navigator.userAgent);if(b.height===0&&!r.current&&!e.autoHeight&&!m&&(n.error(["The parent DOM element of the data grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` `)),r.current=!0),b.width===0&&!r.current&&!m&&(n.error(["The parent DOM element of the data grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(` -`)),r.current=!0),p.current){u(),p.current=!1;return}h()},[e.autoHeight,h,n,u]);_r(()=>l(),[l]),dn(t,"sortedRowsSet",l),dn(t,"pageChange",l),dn(t,"pageSizeChange",l),dn(t,"columnsChange",l),ct(t,"resize",g),dn(t,"debouncedResize",e.onResize)}const OEe=t=>O({},t,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),kEe=(t,e)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:i}=e,o=E.useRef({}),s=E.useRef(-1),a=E.useRef(!1),l=gt(t,yb),u=gt(t,vb),c=gt(t,vg),d=gt(t,gN),f=rh(t,e),h=gt(t,gb),p=E.useCallback(()=>{var A,R;a.current=!1;const F=Qbe(t.current.state,t.current.instanceId),$=U=>{o.current[U.id]||(o.current[U.id]={sizes:{baseCenter:l},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});const{isResized:G,needsFirstMeasurement:B,sizes:L}=o.current[U.id];let N=l;const W=L.baseCenter;if(G)N=W;else if(n){const fe=n(O({},U,{densityFactor:F}));if(fe==="auto"){if(B){const Me=i?i(O({},U,{densityFactor:F})):l;N=Me??l}else N=W;a.current=!0,o.current[U.id].autoHeight=!0}else N=fe??l,o.current[U.id].needsFirstMeasurement=!1,o.current[U.id].autoHeight=!1}else o.current[U.id].needsFirstMeasurement=!1;const K=Object.entries(L).reduce((fe,[Me,ye])=>(/^base[A-Z]/.test(Me)&&(fe[Me]=ye),fe),{}),Q=O({},K,{baseCenter:N});if(r){var J,ae;const fe=t.current.getRowIndexRelativeToVisibleRows(U.id),Me=r(O({},U,{isFirstVisible:fe===0,isLastVisible:fe===f.rows.length-1,indexRelativeToCurrentPage:fe}));Q.spacingTop=(J=Me.top)!=null?J:0,Q.spacingBottom=(ae=Me.bottom)!=null?ae:0}const ve=t.current.unstable_applyPipeProcessors("rowHeight",Q,U);return o.current[U.id].sizes=ve,ve},j=[],k=f.rows.reduce((U,G)=>{j.push(U);let B=0,L=0;const N=$(G);return Object.entries(N).forEach(([W,K])=>{/^base[A-Z]/.test(W)?B=K>B?K:B:L+=K}),U+B+L},0);h==null||(A=h.top)==null||A.forEach(U=>{$(U)}),h==null||(R=h.bottom)==null||R.forEach(U=>{$(U)}),t.current.setState(U=>O({},U,{rowsMeta:{currentPageTotalHeight:k,positions:j}})),a.current||(s.current=1/0),t.current.forceUpdate()},[t,f.rows,l,n,r,i,h]),g=E.useCallback(A=>{const R=o.current[A];return R?R.sizes.baseCenter:l},[l]),b=A=>{var R;return(R=o.current[A])==null?void 0:R.sizes},m=E.useCallback((A,R)=>{o.current[A].sizes.baseCenter=R,o.current[A].isResized=!0,o.current[A].needsFirstMeasurement=!1,p()},[p]),w=E.useMemo(()=>ug(p),[p]),x=E.useCallback((A,R,F)=>{if(!o.current[A]||!o.current[A].autoHeight)return;const $=o.current[A].sizes[`base${Ge(F)}`]!==R;o.current[A].needsFirstMeasurement=!1,o.current[A].sizes[`base${Ge(F)}`]=R,$&&w()},[w]),_=E.useCallback(A=>{var R;return((R=o.current[A])==null?void 0:R.autoHeight)||!1},[]),C=E.useCallback(()=>s.current,[]),S=E.useCallback(A=>{a.current&&A>s.current&&(s.current=A)},[]),M=E.useCallback(()=>{o.current={},p()},[p]);E.useEffect(()=>{p()},[l,u,c,d,p]),PN(t,"rowHeight",p),In(t,{unstable_getLastMeasuredRowIndex:C,unstable_setLastMeasuredRowIndex:S,unstable_rowHasAutoHeight:_,unstable_getRowHeight:g,unstable_getRowInternalSizes:b,unstable_setRowHeight:m,unstable_storeRowHeightMeasurement:x,resetRowHeights:M})},LEe=t=>{const e=E.useCallback((i={})=>t.current.unstable_applyPipeProcessors("exportState",{},i),[t]),n=E.useCallback(i=>{t.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:i}).callbacks.forEach(s=>{s()}),t.current.forceUpdate()},[t]);In(t,{exportState:e,restoreState:n})},BEe=t=>{const e=E.useRef({}),n=E.useCallback((l,u,c)=>{const d=e.current;d[l]||(d[l]={}),d[l][u]=c},[]),r=E.useCallback((l,u)=>{var c;return(c=e.current[l])==null?void 0:c[u]},[]),i=E.useCallback(l=>{const{columnIndex:u,rowId:c,minFirstColumnIndex:d,maxLastColumnIndex:f,columns:h}=l,p=h.length,g=h[u],b=typeof g.colSpan=="function"?g.colSpan(t.current.getCellParams(c,g.field)):g.colSpan;if(!b||b===1)return n(c,u,{spannedByColSpan:!1,cellProps:{colSpan:1,width:g.computedWidth}}),{colSpan:1};let m=g.computedWidth;for(let w=1;w=d&&x{for(let f=u;f1&&(f+=h.colSpan-1)}},[i]);In(t,{unstable_getCellColSpanInfo:r,unstable_calculateColSpan:o});const a=E.useCallback(()=>{e.current={}},[]);ct(t,"columnOrderChange",a)},$Ee=(t,e)=>{var n;const r=E.useCallback(i=>{var o;if(!((o=e.experimentalFeatures)!=null&&o.columnGrouping))return i;const s=pW(e.columnGroupingModel);return i.all.forEach(a=>{var l,u;const c=(l=s[a])!=null?l:[],d=i.lookup[a];bCe(d)&&Xa(c,d==null?void 0:d.groupPath)||(i.lookup[a]=O({},i.lookup[a],{groupPath:(u=s[a])!=null?u:[]}))}),i},[e.columnGroupingModel,(n=e.experimentalFeatures)==null?void 0:n.columnGrouping]);Pi(t,"hydrateColumns",r)},zEe=t=>{var e,n;const r=cCe(void 0,t);return $Ee(r,t),AEe(r,t),gEe(r),cs(yEe,r,t),cs(mCe,r,t),cs(xCe,r,t),cs(hEe,r,t),cs((e=t.experimentalFeatures)!=null&&e.newEditingApi?dEe:tEe,r,t),cs(VCe,r,t),cs(PEe,r,t),cs(ZCe,r,t),cs(UCe,r,t),cs(_Ce,r,t),cs(KCe,r,t),cs(OEe,r,t),cs(hCe,r,t),WCe(r,t),bEe(r,t),gCe(r,t),pEe(r,t),vEe(r),BEe(r),wCe(r,t),((n=t.experimentalFeatures)!=null&&n.newEditingApi?fEe:nEe)(r,t),GCe(r,t),QCe(r,t),HCe(r,t),DEe(r,t),SCe(r,t),YCe(r,t),kEe(r,t),REe(r,t),pCe(r),ACe(r),RCe(r,t),fCe(r),FEe(r,t),IEe(r,t),LEe(r),r},UEe={apiRef:void 0,disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,disableMultipleSelection:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,disableColumnResize:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid"},HEe=100,VEe={autoHeight:!1,autoPageSize:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,columnBuffer:3,rowBuffer:3,columnThreshold:3,rowThreshold:3,density:El.Standard,disableExtendRowFullWidth:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnSelector:!1,disableDensitySelector:!1,disableMultipleColumnsFiltering:!1,disableMultipleSelection:!1,disableMultipleColumnsSorting:!1,disableSelectionOnClick:!1,disableVirtualization:!1,disableIgnoreModificationsIfProcessingProps:!1,editMode:oo.Cell,filterMode:bm.client,headerHeight:56,hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,logger:console,logLevel:"error",pagination:!1,paginationMode:bm.client,rowHeight:52,rowsPerPageOptions:[25,50,100],rowSpacingType:"margin",showCellRightBorder:!1,showColumnRightBorder:!1,sortingOrder:["asc","desc",null],sortingMode:bm.client,throttleRowsMs:0,disableColumnReorder:!1,disableColumnResize:!1,keepNonExistentRowsSelected:!1,keepColumnPositionIfDraggedOutside:!1},GEe=t=>{if(t.pageSize>HEe)throw new Error("'props.pageSize' cannot exceed 100 in DataGrid.");const e=kt({props:t,name:"MuiDataGrid"}),n=E.useMemo(()=>O({},xEe,e.localeText),[e.localeText]),r=E.useMemo(()=>{const i=e.components;if(!i)return O({},A8);const o={};return Object.entries(A8).forEach(([s,a])=>{o[s]=i[s]===void 0?a:i[s]}),o},[e.components]);return E.useMemo(()=>O({},VEe,e,{localeText:n,components:r},UEe),[e,n,r])},jEe=["className"],WEe=t=>{const{classes:e}=t;return Qe({root:["virtualScroller"]},ln,e)},qEe=ze("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(t,e)=>e.virtualScroller})({overflow:"auto",position:"relative","@media print":{overflow:"hidden"}}),XEe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,jEe),o=mt(),s=WEe(o);return D.jsx(qEe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),KEe=["className","style"],YEe=t=>{const{classes:e,overflowedContent:n}=t;return Qe({root:["virtualScrollerContent",n&&"virtualScrollerContent--overflowed"]},ln,e)},ZEe=ze("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(t,e)=>e.virtualScrollerContent})({}),QEe=E.forwardRef(function(e,n){const{className:r,style:i}=e,o=Be(e,KEe),s=mt(),a=O({},s,{overflowedContent:!s.autoHeight&&(i==null?void 0:i.minHeight)==="auto"}),l=YEe(a);return D.jsx(ZEe,O({ref:n,className:vn(l.root,r),ownerState:a,style:i},o))}),JEe=["className"],eMe=t=>{const{classes:e}=t;return Qe({root:["virtualScrollerRenderZone"]},ln,e)},tMe=ze("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(t,e)=>e.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),nMe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,JEe),o=mt(),s=eMe(o);return D.jsx(tMe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),rMe=["style"];function xm(t,e,n=0,r=e.length){if(e.length<=0)return-1;if(n>=r)return n;const i=n+Math.floor((r-n)/2),o=e[i];return t<=o?xm(t,e,n,i):xm(t,e,i+1,r)}function iMe(t,e,n){let r=1;for(;n[Xm(t-n,r,i),Xm(e+n,r,i)],oMe=(t,e)=>t===e?!0:t.firstRowIndex===e.firstRowIndex&&t.lastRowIndex===e.lastRowIndex&&t.firstColumnIndex===e.firstColumnIndex&&t.lastColumnIndex===e.lastColumnIndex,sMe=t=>{var e,n;const r=Lt(),i=mt(),o=gt(r,lo),{ref:s,disableVirtualization:a,onRenderZonePositioning:l,renderZoneMinColumnIndex:u=0,renderZoneMaxColumnIndex:c=o.length,getRowProps:d}=t,f=gt(r,zf),h=gt(r,bE),p=gt(r,yb),g=gt(r,ka),b=gt(r,hS),m=gt(r,py),w=gt(r,br),x=gt(r,mS),_=rh(r,i),C=E.useRef(null),S=E.useRef(null),M=An(s,S),[P,A]=E.useState(null),R=E.useRef(P),F=E.useRef({top:0,left:0}),[$,j]=E.useState({width:null,height:null}),k=E.useRef(h),U=E.useCallback(ye=>{var we,Fe;const Oe=r.current.unstable_getLastMeasuredRowIndex();let re=Oe===1/0;(we=_.range)!=null&&we.lastRowIndex&&!re&&(re=Oe>=_.range.lastRowIndex);const _e=Xm(Oe-(((Fe=_.range)==null?void 0:Fe.firstRowIndex)||0),0,m.positions.length);return re||m.positions[_e]>=ye?xm(ye,m.positions):iMe(ye,m.positions,_e)},[r,(e=_.range)==null?void 0:e.firstRowIndex,(n=_.range)==null?void 0:n.lastRowIndex,m.positions]),G=E.useCallback(()=>{if(a)return{firstRowIndex:0,lastRowIndex:_.rows.length,firstColumnIndex:0,lastColumnIndex:o.length};const{top:ye,left:we}=F.current,Fe=Math.min(U(ye),m.positions.length-1),Oe=i.autoHeight?Fe+_.rows.length:U(ye+$.height);let re=!1,_e=0,Ce=f.length;const[X,Z]=Mc({firstIndex:Fe,lastIndex:Oe,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:i.rowBuffer});for(let he=X;he{a?C.current.style.transform="translate3d(0px, 0px, 0px)":(S.current.scrollLeft=0,S.current.scrollTop=0)},[a]),_r(()=>{j({width:S.current.clientWidth,height:S.current.clientHeight})},[m.currentPageTotalHeight]);const B=E.useCallback(ye=>{j({width:ye.width,height:ye.height})},[]);ct(r,"resize",B);const L=E.useCallback(ye=>{const[we,Fe]=Mc({firstIndex:ye.firstRowIndex,lastIndex:ye.lastRowIndex,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:i.rowBuffer}),[Oe]=Mc({firstIndex:ye.firstColumnIndex,lastIndex:ye.lastColumnIndex,minFirstIndex:u,maxLastIndex:c,buffer:i.columnBuffer}),re=AD({firstColumnToRender:Oe,apiRef:r,firstRowToRender:we,lastRowToRender:Fe,visibleRows:_.rows}),_e=py(r.current.state).positions[we],Ce=zf(r)[re];C.current.style.transform=`translate3d(${Ce}px, ${_e}px, 0px)`,typeof l=="function"&&l({top:_e,left:Ce})},[r,_.rows,l,u,c,i.columnBuffer,i.rowBuffer]),N=E.useCallback(ye=>{if(R.current&&oMe(ye,R.current)){L(ye);return}A(ye),L(ye);const[we,Fe]=Mc({firstIndex:ye.firstRowIndex,lastIndex:ye.lastRowIndex,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:i.rowBuffer});r.current.publishEvent("renderedRowsIntervalChange",{firstRowToRender:we,lastRowToRender:Fe}),R.current=ye},[r,A,R,_.rows.length,i.rowBuffer,L]);_r(()=>{if($.width==null)return;const ye=G();N(ye);const{top:we,left:Fe}=F.current,Oe={top:we,left:Fe,renderContext:ye};r.current.publishEvent("rowsScroll",Oe)},[r,G,$.width,N]);const W=ye=>{const{scrollTop:we,scrollLeft:Fe}=ye.currentTarget;if(F.current.top=we,F.current.left=Fe,Fe<0||we<0||!R.current)return;const Oe=a?R.current:G(),re=Math.abs(Oe.firstRowIndex-R.current.firstRowIndex),_e=Math.abs(Oe.lastRowIndex-R.current.lastRowIndex),Ce=Math.abs(Oe.firstColumnIndex-R.current.firstColumnIndex),X=Math.abs(Oe.lastColumnIndex-R.current.lastColumnIndex),Z=re>=i.rowThreshold||_e>=i.rowThreshold||Ce>=i.columnThreshold||X>=i.columnThreshold||k.current!==h;r.current.publishEvent("rowsScroll",{top:we,left:Fe,renderContext:Z?Oe:R.current},ye),Z&&(qu.flushSync(()=>{N(Oe)}),k.current=h)},K=ye=>{r.current.publishEvent("virtualScrollerWheel",{},ye)},Q=ye=>{r.current.publishEvent("virtualScrollerTouchMove",{},ye)},J=(ye={renderContext:P})=>{const{renderContext:we,minFirstColumn:Fe=u,maxLastColumn:Oe=c,availableSpace:re=$.width,rowIndexOffset:_e=0,position:Ce="center"}=ye;if(!we||re==null)return null;const X=a?0:i.rowBuffer,Z=a?0:i.columnBuffer,[he,Y]=Mc({firstIndex:we.firstRowIndex,lastIndex:we.lastRowIndex,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:X}),ne=[];if(ye.rows)ye.rows.forEach(de=>{ne.push(de),r.current.unstable_calculateColSpan({rowId:de.id,minFirstColumn:Fe,maxLastColumn:Oe,columns:o})});else{if(!_.range)return null;for(let de=he;de$.width,ve=E.useMemo(()=>{const ye=Math.max(m.currentPageTotalHeight,1);let we=!1;S!=null&&S.current&&ye<=(S==null?void 0:S.current.clientHeight)&&(we=!0);const Fe={width:ae?h:"auto",height:ye,minHeight:we?"100%":"auto"};return i.autoHeight&&_.rows.length===0&&(Fe.height=2*p),Fe},[S,h,m.currentPageTotalHeight,_.rows.length,ae,i.autoHeight,p]);E.useEffect(()=>{r.current.publishEvent("virtualScrollerContentSizeChange")},[r,ve]),i.autoHeight&&_.rows.length===0&&(ve.height=2*p);const fe={};ae||(fe.overflowX="hidden"),i.autoHeight&&(fe.overflowY="hidden");const Me=E.useCallback(()=>R.current,[]);return r.current.unstable_getRenderContext=Me,{renderContext:P,updateRenderZonePosition:L,getRows:J,getRootProps:(ye={})=>{let{style:we={}}=ye,Fe=Be(ye,rMe);return O({ref:M,onScroll:W,onWheel:K,onTouchMove:Q,style:O({},we,fe)},Fe)},getContentProps:({style:ye={}}={})=>({style:O({},ye,ve)}),getRenderZoneProps:()=>({ref:C})}},aMe=["className","disableVirtualization"],lMe=E.forwardRef(function(e,n){const{className:r,disableVirtualization:i}=e,o=Be(e,aMe),{getRootProps:s,getContentProps:a,getRenderZoneProps:l,getRows:u}=sMe({ref:n,disableVirtualization:i});return D.jsx(XEe,O({className:r},s(o),{children:D.jsx(QEe,O({},a(),{children:D.jsx(nMe,O({},l(),{children:u()}))}))}))}),uMe=t=>{const{classes:e,headerAlign:n,isDragging:r,showRightBorder:i,showColumnBorder:o,groupId:s}=t;return Qe({root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",i&&"withBorder",o&&"columnHeader--showColumnBorder",s===null?"columnHeader--emptyGroup":"columnHeader--filledGroup"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]},ln,e)};function cMe(t){var e,n;const{groupId:r,width:i,depth:o,maxDepth:s,fields:a,height:l,colIndex:u,isLastColumn:c,extendRowFullWidth:d}=t,f=mt(),h=Lt(),p=gt(h,fW),{hasScrollX:g,hasScrollY:b}=(e=h.current.getRootDimensions())!=null?e:{hasScrollX:!1,hasScrollY:!1},m=r?p[r]:{},{headerName:w=r??"",description:x="",headerAlign:_=void 0}=m;let C;const S=r&&((n=p[r])==null?void 0:n.renderHeaderGroup),M={groupId:r,headerName:w,description:x,depth:o,maxDepth:s,fields:a,colIndex:u,isLastColumn:c};r&&S&&(C=S(M));const A=c?!(c&&g&&!b)&&!d:f.showColumnRightBorder,R=f.showColumnRightBorder,F=O({},t,{classes:f.classes,showRightBorder:A,showColumnBorder:R,headerAlign:_,depth:o,isDragging:!1}),$=w??r,j=jn(),k=r===null?`empty-group-cell-${j}`:r,U=uMe(F),G=typeof m.headerClassName=="function"?m.headerClassName(M):m.headerClassName;return D.jsx(Xj,{classes:U,columnMenuOpen:!1,colIndex:u,height:l,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:-1,isDraggable:!1,headerComponent:C,headerClassName:G,description:x,elementId:k,width:i,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:$,"aria-colspan":a.length,"data-fields":`|-${a.join("-|-")}-|`,disableHeaderSeparator:!0})}const D8=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(t,e)=>e.columnHeaderRow})(()=>({display:"flex"}));function dMe(t){return!!t.target}const fMe=t=>{const{innerRef:e,minColumnIndex:n=0}=t,[r,i]=E.useState(""),[o,s]=E.useState(""),a=Lt(),l=gt(a,lo),u=gt(a,zf),c=gt(a,$j),d=gt(a,hS),f=gt(a,s1e),h=gt(a,Fj),p=gt(a,xN),g=gt(a,bb),b=gt(a,Zbe),m=gt(a,Gbe),w=gt(a,dW),x=mt(),_=E.useRef(null),C=An(e,_),[S,M]=E.useState(null),P=E.useRef(S),A=E.useRef(0),R=rh(a,x);E.useEffect(()=>{a.current.columnHeadersContainerElementRef.current.scrollLeft=0},[a]);const F=E.useRef(Tj(l_e,{equalityCheck:(J,ae)=>["firstColumnIndex","minColumnIndex","columnBuffer"].every(ve=>J[ve]===ae[ve])})),$=E.useCallback(J=>{const[ae,ve]=Mc({firstIndex:J.firstRowIndex,lastIndex:J.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:x.rowBuffer}),fe=F.current({firstColumnIndex:J.firstColumnIndex,minColumnIndex:n,columnBuffer:x.columnBuffer,firstRowToRender:ae,lastRowToRender:ve,apiRef:a,visibleRows:R.rows}),Me=fe>0?A.current-u[fe]:A.current;_.current.style.transform=`translate3d(${-Me}px, 0px, 0px)`},[u,n,x.columnBuffer,a,R.rows,x.rowBuffer]);E.useLayoutEffect(()=>{S&&$(S)},[S,$]);const j=E.useCallback(({left:J,renderContext:ae=null},ve)=>{var fe,Me;if(!_.current||A.current===J&&((fe=P.current)==null?void 0:fe.firstColumnIndex)===(ae==null?void 0:ae.firstColumnIndex)&&((Me=P.current)==null?void 0:Me.lastColumnIndex)===(ae==null?void 0:ae.lastColumnIndex))return;A.current=J;let ye=!1;ae!==P.current||!P.current?(dMe(ve)?(qu.flushSync(()=>{M(ae)}),ye=!0):M(ae),P.current=ae):ye=!0,ae&&ye&&$(ae)},[$]),k=E.useCallback(J=>s(J.field),[]),U=E.useCallback(()=>s(""),[]),G=E.useCallback(J=>i(J.field),[]),B=E.useCallback(()=>i(""),[]);ct(a,"columnResizeStart",k),ct(a,"columnResizeStop",U),ct(a,"columnHeaderDragStart",G),ct(a,"columnHeaderDragEnd",B),ct(a,"rowsScroll",j);const L=J=>{const{renderContext:ae=S,minFirstColumn:ve=n,maxLastColumn:fe=l.length}=J||{};if(!ae)return null;const[Me,ye]=Mc({firstIndex:ae.firstRowIndex,lastIndex:ae.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:x.rowBuffer}),we=F.current({firstColumnIndex:ae.firstColumnIndex,minColumnIndex:ve,columnBuffer:x.columnBuffer,apiRef:a,firstRowToRender:Me,lastRowToRender:ye,visibleRows:R.rows}),Fe=Math.min(ae.lastColumnIndex+x.columnBuffer,fe);return{renderedColumns:l.slice(we,Fe),firstColumnToRender:we,lastColumnToRender:Fe,minFirstColumn:ve,maxLastColumn:fe}},N=(J,ae={})=>{const ve=L(J);if(ve==null)return null;const{renderedColumns:fe,firstColumnToRender:Me}=ve,ye=[];for(let we=0;weJ.slice(0,ae+1),K=J=>{if(p===0)return null;const ae=L(J);if(ae==null||ae.renderedColumns.length===0)return null;const{renderedColumns:ve,firstColumnToRender:fe,lastColumnToRender:Me,maxLastColumn:ye}=ae,we=[],Fe=[];for(let z=0;z=n&&(Ce=l[le])!=null&&Ce.groupPath&&Xa(W((X=l[le])==null?void 0:X.groupPath,z),ue);){var Ce,X,Z;const Te=l[le];if(te+=(Z=Te.computedWidth)!=null?Z:0,H.length===0){var he;H.push({width:(he=Te.computedWidth)!=null?he:0,fields:[Te.field],groupId:de,groupParents:ue,colIndex:le})}else{var Y;H[0].width+=(Y=Te.computedWidth)!=null?Y:0,H[0].fields.push(Te.field),H[0].colIndex=le}le-=1}const ge=ve.reduce((Te,Re,Ve)=>{var Le;const Ye=Te[Te.length-1];if(Re.groupPath&&Re.groupPath.length>z){var it;if(Ye&&Ye.groupId===Re.groupPath[z]){var ot;return[...Te.slice(0,Te.length-1),O({},Ye,{width:Ye.width+((ot=Re.computedWidth)!=null?ot:0),fields:[...Ye.fields,Re.field]})]}return[...Te,{groupId:Re.groupPath[z],groupParents:W(Re.groupPath,z),width:(it=Re.computedWidth)!=null?it:0,fields:[Re.field],colIndex:fe+Ve}]}if(Ye&&Ye.groupId===null&&Xa(W(Re.groupPath,z),Ye.groupParents)){var ht;return[...Te.slice(0,Te.length-1),O({},Ye,{width:Ye.width+((ht=Re.computedWidth)!=null?ht:0),fields:[...Ye.fields,Re.field]})]}return[...Te,{groupId:null,groupParents:W(Re.groupPath,z),width:(Le=Re.computedWidth)!=null?Le:0,fields:[Re.field],colIndex:fe+Ve}]},H);le=Me;const be=ge[ge.length-1].groupId;for(;be!==null&&le{we.push(D.jsx(D8,{style:{height:`${h}px`,transform:`translateX(-${z.leftOverflow}px)`},role:"row","aria-rowindex":H+1,ownerState:x,children:z.elements.map(({groupId:te,width:le,fields:de,colIndex:ue},ge)=>D.jsx(cMe,{groupId:te,width:le,fields:de,colIndex:ue,depth:H,isLastColumn:ue===l.length-de.length,extendRowFullWidth:!x.disableExtendRowFullWidth,maxDepth:Fe.length,height:h},ge))},H))}),we},Q={minHeight:g,maxHeight:g,lineHeight:`${h}px`};return{renderContext:S,getColumnHeaders:N,getColumnGroupHeaders:K,isDragging:!!r,getRootProps:(J={})=>O({style:Q},J),getInnerProps:()=>({ref:C,role:"rowgroup"})}},hMe=["className"],pMe=t=>{const{classes:e}=t;return Qe({root:["columnHeaders"]},ln,e)},mMe=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(t,e)=>e.columnHeaders})(({theme:t})=>({position:"absolute",top:0,left:0,right:0,overflow:"hidden",display:"flex",alignItems:"center",boxSizing:"border-box",borderBottom:`1px solid ${t.palette.mode==="light"?wI(ra(t.palette.divider,1),.88):xI(ra(t.palette.divider,1),.68)}`,borderTopLeftRadius:t.shape.borderRadius,borderTopRightRadius:t.shape.borderRadius})),gMe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,hMe),o=mt(),s=pMe(o);return D.jsx(mMe,O({ref:n,className:vn(r,s.root),ownerState:o},i))}),vMe=["isDragging","className"],yMe=t=>{const{isDragging:e,hasScrollX:n,classes:r}=t;return Qe({root:["columnHeadersInner",e&&"columnHeaderDropZone",n&&"columnHeadersInner--scrollable"]},ln,r)},bMe=ze("div",{name:"MuiDataGrid",slot:"columnHeadersInner",overridesResolver:(t,e)=>[{[`&.${Ie.columnHeaderDropZone}`]:e.columnHeaderDropZone},e.columnHeadersInner]})(()=>({display:"flex",alignItems:"flex-start",flexDirection:"column",[`&.${Ie.columnHeaderDropZone} .${Ie.columnHeaderDraggableContainer}`]:{cursor:"move"},[`&.${Ie["columnHeadersInner--scrollable"]} .${Ie.columnHeader}:last-child`]:{borderRight:"none"}})),xMe=E.forwardRef(function(e,n){var r,i;const{isDragging:o,className:s}=e,a=Be(e,vMe),l=Lt(),u=mt(),c=O({},u,{isDragging:o,hasScrollX:(r=(i=l.current.getRootDimensions())==null?void 0:i.hasScrollX)!=null?r:!1}),d=yMe(c);return D.jsx(bMe,O({ref:n,className:vn(s,d.root),ownerState:c},a))}),wMe=["innerRef","className"],_Me=E.forwardRef(function(e,n){const{innerRef:r}=e,i=Be(e,wMe),{isDragging:o,getRootProps:s,getInnerProps:a,getColumnHeaders:l,getColumnGroupHeaders:u}=fMe({innerRef:r});return D.jsxs(gMe,O({ref:n},s(i),{children:[D.jsx(y8,{scrollDirection:"left"}),D.jsxs(xMe,O({isDragging:o},a(),{children:[u(),l()]})),D.jsx(y8,{scrollDirection:"right"})]}))}),EW=E.forwardRef(function(e,n){const r=GEe(e),i=zEe(r);return D.jsx(YSe,{apiRef:i,props:r,children:D.jsx(yxe,{className:r.className,style:r.style,sx:r.sx,ref:n,children:D.jsxs(r1e,{children:[D.jsx(o1e,{}),D.jsx(t1e,{ColumnHeadersComponent:_Me,VirtualScrollerComponent:lMe}),D.jsx(i1e,{})]})})})}),MW=E.memo(EW);EW.propTypes={"aria-label":me.string,"aria-labelledby":me.string,autoHeight:me.bool,autoPageSize:me.bool,cellModesModel:me.object,checkboxSelection:me.bool,classes:me.object,columnBuffer:me.number,columnGroupingModel:me.arrayOf(me.object),columns:aT(me.array.isRequired),columnThreshold:me.number,columnTypes:me.object,columnVisibilityModel:me.object,components:me.object,componentsProps:me.object,density:me.oneOf(["comfortable","compact","standard"]),disableColumnFilter:me.bool,disableColumnMenu:me.bool,disableColumnSelector:me.bool,disableDensitySelector:me.bool,disableExtendRowFullWidth:me.bool,disableIgnoreModificationsIfProcessingProps:me.bool,disableSelectionOnClick:me.bool,disableVirtualization:me.bool,editMode:me.oneOf(["cell","row"]),editRowsModel:me.object,error:me.any,experimentalFeatures:me.shape({columnGrouping:me.bool,newEditingApi:me.bool,preventCommitWhileValidating:me.bool,warnIfFocusStateIsNotSynced:me.bool}),filterMode:me.oneOf(["client","server"]),filterModel:me.shape({items:me.arrayOf(me.shape({columnField:me.string.isRequired,id:me.oneOfType([me.number,me.string]),operatorValue:me.string,value:me.any})).isRequired,linkOperator:me.oneOf(["and","or"]),quickFilterLogicOperator:me.oneOf(["and","or"]),quickFilterValues:me.array}),getCellClassName:me.func,getDetailPanelContent:me.func,getEstimatedRowHeight:me.func,getRowClassName:me.func,getRowHeight:me.func,getRowId:me.func,getRowSpacing:me.func,headerHeight:me.number,hideFooter:me.bool,hideFooterPagination:me.bool,hideFooterSelectedRowCount:me.bool,initialState:me.object,isCellEditable:me.func,isRowSelectable:me.func,keepNonExistentRowsSelected:me.bool,loading:me.bool,localeText:me.object,logger:me.shape({debug:me.func.isRequired,error:me.func.isRequired,info:me.func.isRequired,warn:me.func.isRequired}),logLevel:me.oneOf(["debug","error","info","warn",!1]),nonce:me.string,onCellClick:me.func,onCellDoubleClick:me.func,onCellEditCommit:me.func,onCellEditStart:me.func,onCellEditStop:me.func,onCellFocusOut:me.func,onCellKeyDown:me.func,onCellModesModelChange:me.func,onColumnHeaderClick:me.func,onColumnHeaderDoubleClick:me.func,onColumnHeaderEnter:me.func,onColumnHeaderLeave:me.func,onColumnHeaderOut:me.func,onColumnHeaderOver:me.func,onColumnOrderChange:me.func,onColumnVisibilityChange:me.func,onColumnVisibilityModelChange:me.func,onEditCellPropsChange:me.func,onEditRowsModelChange:me.func,onError:me.func,onFilterModelChange:me.func,onMenuClose:me.func,onMenuOpen:me.func,onPageChange:me.func,onPageSizeChange:me.func,onPreferencePanelClose:me.func,onPreferencePanelOpen:me.func,onProcessRowUpdateError:me.func,onResize:me.func,onRowClick:me.func,onRowDoubleClick:me.func,onRowEditCommit:me.func,onRowEditStart:me.func,onRowEditStop:me.func,onRowModesModelChange:me.func,onSelectionModelChange:me.func,onSortModelChange:me.func,onStateChange:me.func,page:me.number,pageSize:aT(me.number),pagination:t=>t.pagination===!1?new Error(["MUI: `` is not a valid prop.","Infinite scrolling is not available in the MIT version.","","You need to upgrade to DataGridPro or DataGridPremium component to disable the pagination."].join(` -`)):null,paginationMode:me.oneOf(["client","server"]),processRowUpdate:me.func,rowBuffer:me.number,rowCount:me.number,rowHeight:me.number,rowModesModel:me.object,rows:me.arrayOf(me.object).isRequired,rowSpacingType:me.oneOf(["border","margin"]),rowsPerPageOptions:me.arrayOf(me.number),rowThreshold:me.number,scrollbarSize:me.number,selectionModel:aT(me.oneOfType([me.number,me.string,me.array])),showCellRightBorder:me.bool,showColumnRightBorder:me.bool,sortingMode:me.oneOf(["client","server"]),sortingOrder:me.arrayOf(me.oneOf(["asc","desc"])),sortModel:me.arrayOf(me.shape({field:me.string.isRequired,sort:me.oneOf(["asc","desc"])})),sx:me.oneOfType([me.arrayOf(me.oneOfType([me.func,me.object,me.bool])),me.func,me.object])};function SMe(t,e){return{name:t,resolution_height:e.resolution.height,resolution_width:e.resolution.width,pixel_height:e.pixelSize.height.toNumber("mm"),pixel_width:e.pixelSize.width.toNumber("mm")}}function CMe(){const t=mg(),e=[];for(const[r,i]of Object.entries(t.detectorRecord))e.push(SMe(r,i));const n=[{field:"name",headerName:"name",flex:1},{field:"resolution_height",headerName:"resolution height (px)",flex:1},{field:"resolution_width",headerName:"resolution width (px)",flex:1},{field:"pixel_height",headerName:"pixel height (mm)",flex:1},{field:"pixel_width",headerName:"pixel width (mm)",flex:1}];return D.jsx(MW,{autoHeight:!0,rows:e,getRowId:r=>r.name,columns:n,components:{Toolbar:cW},sx:{border:0},disableSelectionOnClick:!0})}var IN={},DT={};const EMe=ju(Aoe);var R8;function TW(){return R8||(R8=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=EMe}(DT)),DT}var MMe=YC;Object.defineProperty(IN,"__esModule",{value:!0});var NN=IN.default=void 0,TMe=MMe(TW()),AMe=D;NN=IN.default=(0,TMe.default)((0,AMe.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var Cb=t=>t.type==="checkbox",Jp=t=>t instanceof Date,xo=t=>t==null;const AW=t=>typeof t=="object";var ci=t=>!xo(t)&&!Array.isArray(t)&&AW(t)&&!Jp(t),PMe=t=>ci(t)&&t.target?Cb(t.target)?t.target.checked:t.target.value:t,DMe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,RMe=(t,e)=>t.has(DMe(e)),IMe=t=>{const e=t.constructor&&t.constructor.prototype;return ci(e)&&e.hasOwnProperty("isPrototypeOf")},FN=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ys(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(FN&&(t instanceof Blob||t instanceof FileList))&&(n||ci(t)))if(e=n?[]:{},!n&&!IMe(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=Ys(t[r]));else return t;return e}var Eb=t=>Array.isArray(t)?t.filter(Boolean):[],zr=t=>t===void 0,St=(t,e,n)=>{if(!e||!ci(t))return n;const r=Eb(e.split(/[,[\].]+?/)).reduce((i,o)=>xo(i)?i:i[o],t);return zr(r)||r===t?zr(t[e])?n:t[e]:r},yu=t=>typeof t=="boolean";const I8={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},La={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},su={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};ie.createContext(null);var NMe=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const o in t)Object.defineProperty(i,o,{get:()=>{const s=o;return e._proxyFormState[s]!==La.all&&(e._proxyFormState[s]=!r||La.all),t[s]}});return i},ms=t=>ci(t)&&!Object.keys(t).length,FMe=(t,e,n,r)=>{n(t);const{name:i,...o}=t;return ms(o)||Object.keys(o).length>=Object.keys(e).length||Object.keys(o).find(s=>e[s]===La.all)},RT=t=>Array.isArray(t)?t:[t];function OMe(t){const e=ie.useRef(t);e.current=t,ie.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}var Ml=t=>typeof t=="string",kMe=(t,e,n,r,i)=>Ml(t)?(r&&e.watch.add(t),St(n,t,i)):Array.isArray(t)?t.map(o=>(r&&e.watch.add(o),St(n,o))):(r&&(e.watchAll=!0),n),ON=t=>/^\w*$/.test(t),PW=t=>Eb(t.replace(/["|']|\]/g,"").split(/\.|\[/)),nr=(t,e,n)=>{let r=-1;const i=ON(e)?[e]:PW(e),o=i.length,s=o-1;for(;++re?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},N8=t=>({isOnSubmit:!t||t===La.onSubmit,isOnBlur:t===La.onBlur,isOnChange:t===La.onChange,isOnAll:t===La.all,isOnTouch:t===La.onTouched}),F8=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const wv=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const o=St(t,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],i)&&!r)break;if(s.ref&&e(s.ref,s.name)&&!r)break;wv(a,e)}else ci(a)&&wv(a,e)}}};var BMe=(t,e,n)=>{const r=Eb(St(t,n));return nr(r,"root",e[n]),nr(t,n,r),t},kN=t=>t.type==="file",Uc=t=>typeof t=="function",vS=t=>{if(!FN)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},r_=t=>Ml(t),LN=t=>t.type==="radio",yS=t=>t instanceof RegExp;const O8={value:!1,isValid:!1},k8={value:!0,isValid:!0};var DW=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!zr(t[0].attributes.value)?zr(t[0].value)||t[0].value===""?k8:{value:t[0].value,isValid:!0}:k8:O8}return O8};const L8={isValid:!1,value:null};var RW=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,L8):L8;function B8(t,e,n="validate"){if(r_(t)||Array.isArray(t)&&t.every(r_)||yu(t)&&!t)return{type:n,message:r_(t)?t:"",ref:e}}var Hh=t=>ci(t)&&!yS(t)?t:{value:t,message:""},$8=async(t,e,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:u,min:c,max:d,pattern:f,validate:h,name:p,valueAsNumber:g,mount:b,disabled:m}=t._f,w=St(e,p);if(!b||m)return{};const x=s?s[0]:o,_=$=>{r&&x.reportValidity&&(x.setCustomValidity(yu($)?"":$||""),x.reportValidity())},C={},S=LN(o),M=Cb(o),P=S||M,A=(g||kN(o))&&zr(o.value)&&zr(w)||vS(o)&&o.value===""||w===""||Array.isArray(w)&&!w.length,R=LMe.bind(null,p,n,C),F=($,j,k,U=su.maxLength,G=su.minLength)=>{const B=$?j:k;C[p]={type:$?U:G,message:B,ref:o,...R($?U:G,B)}};if(i?!Array.isArray(w)||!w.length:a&&(!P&&(A||xo(w))||yu(w)&&!w||M&&!DW(s).isValid||S&&!RW(s).isValid)){const{value:$,message:j}=r_(a)?{value:!!a,message:a}:Hh(a);if($&&(C[p]={type:su.required,message:j,ref:x,...R(su.required,j)},!n))return _(j),C}if(!A&&(!xo(c)||!xo(d))){let $,j;const k=Hh(d),U=Hh(c);if(!xo(w)&&!isNaN(w)){const G=o.valueAsNumber||w&&+w;xo(k.value)||($=G>k.value),xo(U.value)||(j=Gnew Date(new Date().toDateString()+" "+W),L=o.type=="time",N=o.type=="week";Ml(k.value)&&w&&($=L?B(w)>B(k.value):N?w>k.value:G>new Date(k.value)),Ml(U.value)&&w&&(j=L?B(w)+$.value,U=!xo(j.value)&&w.length<+j.value;if((k||U)&&(F(k,$.message,j.message),!n))return _(C[p].message),C}if(f&&!A&&Ml(w)){const{value:$,message:j}=Hh(f);if(yS($)&&!w.match($)&&(C[p]={type:su.pattern,message:j,ref:o,...R(su.pattern,j)},!n))return _(j),C}if(h){if(Uc(h)){const $=await h(w,e),j=B8($,x);if(j&&(C[p]={...j,...R(su.validate,j.message)},!n))return _(j.message),C}else if(ci(h)){let $={};for(const j in h){if(!ms($)&&!n)break;const k=B8(await h[j](w,e),x,j);k&&($={...k,...R(j,k.message)},_(k.message),n&&(C[p]=$))}if(!ms($)&&(C[p]={ref:x,...$},!n))return C}}return _(!0),C};function $Me(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{let t=[];return{get observers(){return t},next:i=>{for(const o of t)o.next&&o.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(o=>o!==i)}}),unsubscribe:()=>{t=[]}}},bS=t=>xo(t)||!AW(t);function ff(t,e){if(bS(t)||bS(e))return t===e;if(Jp(t)&&Jp(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const o=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=e[i];if(Jp(o)&&Jp(s)||ci(o)&&ci(s)||Array.isArray(o)&&Array.isArray(s)?!ff(o,s):o!==s)return!1}}return!0}var IW=t=>t.type==="select-multiple",UMe=t=>LN(t)||Cb(t),NT=t=>vS(t)&&t.isConnected,NW=t=>{for(const e in t)if(Uc(t[e]))return!0;return!1};function xS(t,e={}){const n=Array.isArray(t);if(ci(t)||n)for(const r in t)Array.isArray(t[r])||ci(t[r])&&!NW(t[r])?(e[r]=Array.isArray(t[r])?[]:{},xS(t[r],e[r])):xo(t[r])||(e[r]=!0);return e}function FW(t,e,n){const r=Array.isArray(t);if(ci(t)||r)for(const i in t)Array.isArray(t[i])||ci(t[i])&&!NW(t[i])?zr(e)||bS(n[i])?n[i]=Array.isArray(t[i])?xS(t[i],[]):{...xS(t[i])}:FW(t[i],xo(e)?{}:e[i],n[i]):n[i]=!ff(t[i],e[i]);return n}var Sx=(t,e)=>FW(t,e,xS(e)),OW=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>zr(t)?t:e?t===""?NaN:t&&+t:n&&Ml(t)?new Date(t):r?r(t):t;function FT(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return kN(e)?e.files:LN(e)?RW(t.refs).value:IW(e)?[...e.selectedOptions].map(({value:n})=>n):Cb(e)?DW(t.refs).value:OW(zr(e.value)?t.ref.value:e.value,t)}var HMe=(t,e,n,r)=>{const i={};for(const o of t){const s=St(e,o);s&&nr(i,o,s._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},v0=t=>zr(t)?t:yS(t)?t.source:ci(t)?yS(t.value)?t.value.source:t.value:t,VMe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function z8(t,e,n){const r=St(t,n);if(r||ON(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=St(e,o),a=St(t,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var GMe=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,jMe=(t,e)=>!Eb(St(t,e)).length&&ni(t,e);const WMe={mode:La.onSubmit,reValidateMode:La.onChange,shouldFocusError:!0};function qMe(t={}){let e={...WMe,...t},n={submitCount:0,isDirty:!1,isLoading:Uc(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=ci(e.defaultValues)||ci(e.values)?Ys(e.defaultValues||e.values)||{}:{},o=e.shouldUnregister?{}:Ys(i),s={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:IT(),array:IT(),state:IT()},f=N8(e.mode),h=N8(e.reValidateMode),p=e.criteriaMode===La.all,g=Y=>ne=>{clearTimeout(u),u=setTimeout(Y,ne)},b=async Y=>{if(c.isValid||Y){const ne=e.resolver?ms((await P()).errors):await R(r,!0);ne!==n.isValid&&d.state.next({isValid:ne})}},m=(Y,ne)=>{(c.isValidating||c.validatingFields)&&((Y||Array.from(a.mount)).forEach(se=>{se&&(ne?nr(n.validatingFields,se,ne):ni(n.validatingFields,se))}),d.state.next({validatingFields:n.validatingFields,isValidating:!ms(n.validatingFields)}))},w=(Y,ne=[],se,xe,Pe=!0,z=!0)=>{if(xe&&se){if(s.action=!0,z&&Array.isArray(St(r,Y))){const H=se(St(r,Y),xe.argA,xe.argB);Pe&&nr(r,Y,H)}if(z&&Array.isArray(St(n.errors,Y))){const H=se(St(n.errors,Y),xe.argA,xe.argB);Pe&&nr(n.errors,Y,H),jMe(n.errors,Y)}if(c.touchedFields&&z&&Array.isArray(St(n.touchedFields,Y))){const H=se(St(n.touchedFields,Y),xe.argA,xe.argB);Pe&&nr(n.touchedFields,Y,H)}c.dirtyFields&&(n.dirtyFields=Sx(i,o)),d.state.next({name:Y,isDirty:$(Y,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else nr(o,Y,ne)},x=(Y,ne)=>{nr(n.errors,Y,ne),d.state.next({errors:n.errors})},_=Y=>{n.errors=Y,d.state.next({errors:n.errors,isValid:!1})},C=(Y,ne,se,xe)=>{const Pe=St(r,Y);if(Pe){const z=St(o,Y,zr(se)?St(i,Y):se);zr(z)||xe&&xe.defaultChecked||ne?nr(o,Y,ne?z:FT(Pe._f)):U(Y,z),s.mount&&b()}},S=(Y,ne,se,xe,Pe)=>{let z=!1,H=!1;const te={name:Y},le=!!(St(r,Y)&&St(r,Y)._f.disabled);if(!se||xe){c.isDirty&&(H=n.isDirty,n.isDirty=te.isDirty=$(),z=H!==te.isDirty);const de=le||ff(St(i,Y),ne);H=!!(!le&&St(n.dirtyFields,Y)),de||le?ni(n.dirtyFields,Y):nr(n.dirtyFields,Y,!0),te.dirtyFields=n.dirtyFields,z=z||c.dirtyFields&&H!==!de}if(se){const de=St(n.touchedFields,Y);de||(nr(n.touchedFields,Y,se),te.touchedFields=n.touchedFields,z=z||c.touchedFields&&de!==se)}return z&&Pe&&d.state.next(te),z?te:{}},M=(Y,ne,se,xe)=>{const Pe=St(n.errors,Y),z=c.isValid&&yu(ne)&&n.isValid!==ne;if(t.delayError&&se?(l=g(()=>x(Y,se)),l(t.delayError)):(clearTimeout(u),l=null,se?nr(n.errors,Y,se):ni(n.errors,Y)),(se?!ff(Pe,se):Pe)||!ms(xe)||z){const H={...xe,...z&&yu(ne)?{isValid:ne}:{},errors:n.errors,name:Y};n={...n,...H},d.state.next(H)}},P=async Y=>{m(Y,!0);const ne=await e.resolver(o,e.context,HMe(Y||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return m(Y),ne},A=async Y=>{const{errors:ne}=await P(Y);if(Y)for(const se of Y){const xe=St(ne,se);xe?nr(n.errors,se,xe):ni(n.errors,se)}else n.errors=ne;return ne},R=async(Y,ne,se={valid:!0})=>{for(const xe in Y){const Pe=Y[xe];if(Pe){const{_f:z,...H}=Pe;if(z){const te=a.array.has(z.name);m([xe],!0);const le=await $8(Pe,o,p,e.shouldUseNativeValidation&&!ne,te);if(m([xe]),le[z.name]&&(se.valid=!1,ne))break;!ne&&(St(le,z.name)?te?BMe(n.errors,le,z.name):nr(n.errors,z.name,le[z.name]):ni(n.errors,z.name))}H&&await R(H,ne,se)}}return se.valid},F=()=>{for(const Y of a.unMount){const ne=St(r,Y);ne&&(ne._f.refs?ne._f.refs.every(se=>!NT(se)):!NT(ne._f.ref))&&fe(Y)}a.unMount=new Set},$=(Y,ne)=>(Y&&ne&&nr(o,Y,ne),!ff(K(),i)),j=(Y,ne,se)=>kMe(Y,a,{...s.mount?o:zr(ne)?i:Ml(Y)?{[Y]:ne}:ne},se,ne),k=Y=>Eb(St(s.mount?o:i,Y,t.shouldUnregister?St(i,Y,[]):[])),U=(Y,ne,se={})=>{const xe=St(r,Y);let Pe=ne;if(xe){const z=xe._f;z&&(!z.disabled&&nr(o,Y,OW(ne,z)),Pe=vS(z.ref)&&xo(ne)?"":ne,IW(z.ref)?[...z.ref.options].forEach(H=>H.selected=Pe.includes(H.value)):z.refs?Cb(z.ref)?z.refs.length>1?z.refs.forEach(H=>(!H.defaultChecked||!H.disabled)&&(H.checked=Array.isArray(Pe)?!!Pe.find(te=>te===H.value):Pe===H.value)):z.refs[0]&&(z.refs[0].checked=!!Pe):z.refs.forEach(H=>H.checked=H.value===Pe):kN(z.ref)?z.ref.value="":(z.ref.value=Pe,z.ref.type||d.values.next({name:Y,values:{...o}})))}(se.shouldDirty||se.shouldTouch)&&S(Y,Pe,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&W(Y)},G=(Y,ne,se)=>{for(const xe in ne){const Pe=ne[xe],z=`${Y}.${xe}`,H=St(r,z);(a.array.has(Y)||!bS(Pe)||H&&!H._f)&&!Jp(Pe)?G(z,Pe,se):U(z,Pe,se)}},B=(Y,ne,se={})=>{const xe=St(r,Y),Pe=a.array.has(Y),z=Ys(ne);nr(o,Y,z),Pe?(d.array.next({name:Y,values:{...o}}),(c.isDirty||c.dirtyFields)&&se.shouldDirty&&d.state.next({name:Y,dirtyFields:Sx(i,o),isDirty:$(Y,z)})):xe&&!xe._f&&!xo(z)?G(Y,z,se):U(Y,z,se),F8(Y,a)&&d.state.next({...n}),d.values.next({name:s.mount?Y:void 0,values:{...o}})},L=async Y=>{s.mount=!0;const ne=Y.target;let se=ne.name,xe=!0;const Pe=St(r,se),z=()=>ne.type?FT(Pe._f):PMe(Y),H=te=>{xe=Number.isNaN(te)||te===St(o,se,te)};if(Pe){let te,le;const de=z(),ue=Y.type===I8.BLUR||Y.type===I8.FOCUS_OUT,ge=!VMe(Pe._f)&&!e.resolver&&!St(n.errors,se)&&!Pe._f.deps||GMe(ue,St(n.touchedFields,se),n.isSubmitted,h,f),be=F8(se,a,ue);nr(o,se,de),ue?(Pe._f.onBlur&&Pe._f.onBlur(Y),l&&l(0)):Pe._f.onChange&&Pe._f.onChange(Y);const Te=S(se,de,ue,!1),Re=!ms(Te)||be;if(!ue&&d.values.next({name:se,type:Y.type,values:{...o}}),ge)return c.isValid&&b(),Re&&d.state.next({name:se,...be?{}:Te});if(!ue&&be&&d.state.next({...n}),e.resolver){const{errors:Ve}=await P([se]);if(H(de),xe){const Le=z8(n.errors,r,se),Ye=z8(Ve,r,Le.name||se);te=Ye.error,se=Ye.name,le=ms(Ve)}}else m([se],!0),te=(await $8(Pe,o,p,e.shouldUseNativeValidation))[se],m([se]),H(de),xe&&(te?le=!1:c.isValid&&(le=await R(r,!0)));xe&&(Pe._f.deps&&W(Pe._f.deps),M(se,le,te,Te))}},N=(Y,ne)=>{if(St(n.errors,ne)&&Y.focus)return Y.focus(),1},W=async(Y,ne={})=>{let se,xe;const Pe=RT(Y);if(e.resolver){const z=await A(zr(Y)?Y:Pe);se=ms(z),xe=Y?!Pe.some(H=>St(z,H)):se}else Y?(xe=(await Promise.all(Pe.map(async z=>{const H=St(r,z);return await R(H&&H._f?{[z]:H}:H)}))).every(Boolean),!(!xe&&!n.isValid)&&b()):xe=se=await R(r);return d.state.next({...!Ml(Y)||c.isValid&&se!==n.isValid?{}:{name:Y},...e.resolver||!Y?{isValid:se}:{},errors:n.errors}),ne.shouldFocus&&!xe&&wv(r,N,Y?Pe:a.mount),xe},K=Y=>{const ne={...s.mount?o:i};return zr(Y)?ne:Ml(Y)?St(ne,Y):Y.map(se=>St(ne,se))},Q=(Y,ne)=>({invalid:!!St((ne||n).errors,Y),isDirty:!!St((ne||n).dirtyFields,Y),isTouched:!!St((ne||n).touchedFields,Y),isValidating:!!St((ne||n).validatingFields,Y),error:St((ne||n).errors,Y)}),J=Y=>{Y&&RT(Y).forEach(ne=>ni(n.errors,ne)),d.state.next({errors:Y?n.errors:{}})},ae=(Y,ne,se)=>{const xe=(St(r,Y,{_f:{}})._f||{}).ref;nr(n.errors,Y,{...ne,ref:xe}),d.state.next({name:Y,errors:n.errors,isValid:!1}),se&&se.shouldFocus&&xe&&xe.focus&&xe.focus()},ve=(Y,ne)=>Uc(Y)?d.values.subscribe({next:se=>Y(j(void 0,ne),se)}):j(Y,ne,!0),fe=(Y,ne={})=>{for(const se of Y?RT(Y):a.mount)a.mount.delete(se),a.array.delete(se),ne.keepValue||(ni(r,se),ni(o,se)),!ne.keepError&&ni(n.errors,se),!ne.keepDirty&&ni(n.dirtyFields,se),!ne.keepTouched&&ni(n.touchedFields,se),!ne.keepIsValidating&&ni(n.validatingFields,se),!e.shouldUnregister&&!ne.keepDefaultValue&&ni(i,se);d.values.next({values:{...o}}),d.state.next({...n,...ne.keepDirty?{isDirty:$()}:{}}),!ne.keepIsValid&&b()},Me=({disabled:Y,name:ne,field:se,fields:xe,value:Pe})=>{if(yu(Y)){const z=Y?void 0:zr(Pe)?FT(se?se._f:St(xe,ne)._f):Pe;nr(o,ne,z),S(ne,z,!1,!1,!0)}},ye=(Y,ne={})=>{let se=St(r,Y);const xe=yu(ne.disabled);return nr(r,Y,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:Y}},name:Y,mount:!0,...ne}}),a.mount.add(Y),se?Me({field:se,disabled:ne.disabled,name:Y,value:ne.value}):C(Y,!0,ne.value),{...xe?{disabled:ne.disabled}:{},...e.progressive?{required:!!ne.required,min:v0(ne.min),max:v0(ne.max),minLength:v0(ne.minLength),maxLength:v0(ne.maxLength),pattern:v0(ne.pattern)}:{},name:Y,onChange:L,onBlur:L,ref:Pe=>{if(Pe){ye(Y,ne),se=St(r,Y);const z=zr(Pe.value)&&Pe.querySelectorAll&&Pe.querySelectorAll("input,select,textarea")[0]||Pe,H=UMe(z),te=se._f.refs||[];if(H?te.find(le=>le===z):z===se._f.ref)return;nr(r,Y,{_f:{...se._f,...H?{refs:[...te.filter(NT),z,...Array.isArray(St(i,Y))?[{}]:[]],ref:{type:z.type,name:Y}}:{ref:z}}}),C(Y,!1,void 0,z)}else se=St(r,Y,{}),se._f&&(se._f.mount=!1),(e.shouldUnregister||ne.shouldUnregister)&&!(RMe(a.array,Y)&&s.action)&&a.unMount.add(Y)}}},we=()=>e.shouldFocusError&&wv(r,N,a.mount),Fe=Y=>{yu(Y)&&(d.state.next({disabled:Y}),wv(r,(ne,se)=>{let xe=Y;const Pe=St(r,se);Pe&&yu(Pe._f.disabled)&&(xe||(xe=Pe._f.disabled)),ne.disabled=xe},0,!1))},Oe=(Y,ne)=>async se=>{let xe;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let Pe=Ys(o);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:z,values:H}=await P();n.errors=z,Pe=H}else await R(r);if(ni(n.errors,"root"),ms(n.errors)){d.state.next({errors:{}});try{await Y(Pe,se)}catch(z){xe=z}}else ne&&await ne({...n.errors},se),we(),setTimeout(we);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ms(n.errors)&&!xe,submitCount:n.submitCount+1,errors:n.errors}),xe)throw xe},re=(Y,ne={})=>{St(r,Y)&&(zr(ne.defaultValue)?B(Y,Ys(St(i,Y))):(B(Y,ne.defaultValue),nr(i,Y,Ys(ne.defaultValue))),ne.keepTouched||ni(n.touchedFields,Y),ne.keepDirty||(ni(n.dirtyFields,Y),n.isDirty=ne.defaultValue?$(Y,Ys(St(i,Y))):$()),ne.keepError||(ni(n.errors,Y),c.isValid&&b()),d.state.next({...n}))},_e=(Y,ne={})=>{const se=Y?Ys(Y):i,xe=Ys(se),Pe=ms(Y),z=Pe?i:xe;if(ne.keepDefaultValues||(i=se),!ne.keepValues){if(ne.keepDirtyValues)for(const H of a.mount)St(n.dirtyFields,H)?nr(z,H,St(o,H)):B(H,St(z,H));else{if(FN&&zr(Y))for(const H of a.mount){const te=St(r,H);if(te&&te._f){const le=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(vS(le)){const de=le.closest("form");if(de){de.reset();break}}}}r={}}o=t.shouldUnregister?ne.keepDefaultValues?Ys(i):{}:Ys(z),d.array.next({values:{...z}}),d.values.next({values:{...z}})}a={mount:ne.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!c.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues,s.watch=!!t.shouldUnregister,d.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Pe?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!ff(Y,i)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Pe?[]:ne.keepDirtyValues?ne.keepDefaultValues&&o?Sx(i,o):n.dirtyFields:ne.keepDefaultValues&&Y?Sx(i,Y):{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ce=(Y,ne)=>_e(Uc(Y)?Y(o):Y,ne);return{control:{register:ye,unregister:fe,getFieldState:Q,handleSubmit:Oe,setError:ae,_executeSchema:P,_getWatch:j,_getDirty:$,_updateValid:b,_removeUnmounted:F,_updateFieldArray:w,_updateDisabledField:Me,_getFieldArray:k,_reset:_e,_resetDefaultValues:()=>Uc(e.defaultValues)&&e.defaultValues().then(Y=>{Ce(Y,e.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:Y=>{n={...n,...Y}},_disableForm:Fe,_subjects:d,_proxyFormState:c,_setErrors:_,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state(Y){s=Y},get _defaultValues(){return i},get _names(){return a},set _names(Y){a=Y},get _formState(){return n},set _formState(Y){n=Y},get _options(){return e},set _options(Y){e={...e,...Y}}},trigger:W,register:ye,handleSubmit:Oe,watch:ve,setValue:B,getValues:K,reset:Ce,resetField:re,clearErrors:J,unregister:fe,setError:ae,setFocus:(Y,ne={})=>{const se=St(r,Y),xe=se&&se._f;if(xe){const Pe=xe.refs?xe.refs[0]:xe.ref;Pe.focus&&(Pe.focus(),ne.shouldSelect&&Pe.select())}},getFieldState:Q}}function kW(t={}){const e=ie.useRef(),n=ie.useRef(),[r,i]=ie.useState({isDirty:!1,isValidating:!1,isLoading:Uc(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Uc(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...qMe(t),formState:r});const o=e.current.control;return o._options=t,OMe({subject:o._subjects.state,next:s=>{FMe(s,o._proxyFormState,o._updateFormState)&&i({...o._formState})}}),ie.useEffect(()=>o._disableForm(t.disabled),[o,t.disabled]),ie.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),ie.useEffect(()=>{t.values&&!ff(t.values,n.current)?(o._reset(t.values,o._options.resetOptions),n.current=t.values,i(s=>({...s}))):o._resetDefaultValues()},[t.values,o]),ie.useEffect(()=>{t.errors&&o._setErrors(t.errors)},[t.errors,o]),ie.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),ie.useEffect(()=>{t.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[t.shouldUnregister,o]),e.current.formState=NMe(r,o),e.current}function XMe(t){const e=mg(),{register:n,reset:r,handleSubmit:i}=kW(),o=s=>{e.addNewDetector(s.name,_j(s.detector)),console.log(s),t.handleClose(),r()};return D.jsx(iG,{open:t.open,keepMounted:!0,onClose:t.handleClose,maxWidth:"xl",children:D.jsxs("form",{onSubmit:i(o),children:[D.jsxs(sG,{sx:{display:"flex",alignItems:"center"},children:[D.jsx(xn,{variant:"h5",children:" Detectors "}),D.jsx(io,{onClick:t.handleClose,sx:{ml:"auto"},children:D.jsx(NN,{})})]}),D.jsx(oG,{children:D.jsxs(kc,{container:!0,spacing:4,children:[D.jsx(kc,{item:!0,xs:8,children:D.jsx(CMe,{})}),D.jsx(kc,{item:!0,xs:1,children:D.jsx(ca,{orientation:"vertical"})}),D.jsx(kc,{item:!0,xs:3,children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{children:"Add new Detector:"}),D.jsx($n,{label:"name",...n("name",{required:!0}),variant:"outlined",size:"small"}),D.jsx(xn,{children:"Resolution:"}),D.jsx($n,{type:"number",label:"width",...n("detector.resolution.width",{required:!0}),size:"small",InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx($n,{type:"number",label:"height",...n("detector.resolution.height",{required:!0}),size:"small",InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx(xn,{children:" Pixel Size:"}),D.jsx($n,{type:"number",label:"width",...n("detector.pixelSize.width",{required:!0}),size:"small",inputProps:{step:1e-6},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx($n,{type:"number",label:"height",...n("detector.pixelSize.height",{required:!0}),size:"small",inputProps:{step:1e-6},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx(Bf,{variant:"outlined",type:"submit",children:"Submit"})]})})]})})]})})}function KMe(t,e){return{name:t,cameraTubeDiameter:e.cameratubeDiameter,beamstopDiameter:e.beamstopDiameter,minWavelength:e.minWavelength.toNumber("nm"),maxWavelength:e.maxWavelength.toNumber("nm"),minCameraLength:e.minCameraLength.toNumber("m"),maxCameraLength:e.maxCameraLength.toNumber("m"),cameraLengthStep:e.cameraLengthStep.toNumber("m")}}function YMe(){const t=gg(),e=[];for(const[r,i]of Object.entries(t.beamlineRecord))e.push(KMe(r,i));const n=[{field:"name",headerName:"name",flex:1},{field:"beamstopDiameter",headerName:"Beamstop Diameter (mm)",flex:1},{field:"cameraTubeDiameter",headerName:"CameraTube Diameter (mm)",flex:1},{field:"minWavelength",headerName:"Min wavelength (nm)",flex:1},{field:"maxWavelength",headerName:"Max wavelength (nm)",flex:1},{field:"minCameraLength",headerName:"Min camera length (m)",flex:1},{field:"maxCameraLength",headerName:"Max camera length (m)",flex:1},{field:"cameraLengthStep",headerName:"Camera length step (m)",flex:1}];return D.jsx(MW,{autoHeight:!0,rows:e,getRowId:r=>r.name,columns:n,components:{Toolbar:cW},sx:{border:0},disableSelectionOnClick:!0})}const $d=1e-6;function ZMe(t){const e=gg(),{register:n,reset:r,handleSubmit:i}=kW(),o=s=>{e.addNewBeamline(s.name,Sj(s.beamline)),console.log(s),t.handleClose(),r()};return D.jsx(iG,{fullWidth:!0,maxWidth:"xl",open:t.open,keepMounted:!0,onClose:t.handleClose,children:D.jsxs("form",{onSubmit:i(o),children:[D.jsxs(sG,{sx:{display:"flex",alignItems:"center"},children:[D.jsx(xn,{variant:"h5",children:" Beamlines "}),D.jsx(ca,{}),D.jsx(io,{onClick:t.handleClose,sx:{ml:"auto"},children:D.jsx(NN,{})})]}),D.jsx(oG,{children:D.jsxs(kc,{container:!0,spacing:4,children:[D.jsx(kc,{item:!0,xs:8,children:D.jsx(YMe,{})}),D.jsx(kc,{item:!0,xs:1,children:D.jsx(ca,{orientation:"vertical"})}),D.jsx(kc,{item:!0,xs:3,children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{children:"Add New Beamline:"}),D.jsx(ca,{}),D.jsx($n,{label:"name",...n("name",{required:!0}),variant:"outlined",size:"small"}),D.jsx($n,{type:"number",label:"min wavelength",...n("beamline.minWavelength",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"nm"})}}),D.jsx($n,{type:"number",label:"max wavelength ",variant:"outlined",size:"small",...n("beamline.maxWavelength",{required:!0}),inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"nm"})}}),D.jsx($n,{type:"number",label:"min camera length",...n("beamline.minCameraLength",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"m"})}}),D.jsx($n,{type:"number",label:"max camera length",variant:"outlined",size:"small",...n("beamline.maxCameraLength",{required:!0}),inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"m"})}}),D.jsx($n,{type:"number",label:"camera length step",...n("beamline.cameraLengthStep",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"m"})}}),D.jsx($n,{type:"number",label:"camera tube diameter",variant:"outlined",...n("beamline.cameratubeDiameter",{required:!0}),size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx($n,{type:"number",label:"beamstop diamter",...n("beamline.beamstopDiameter",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx(Bf,{type:"submit",variant:"outlined",children:"Submit"})]})})]})})]})})}function QMe(){const t=mg(),e=gE(),n=vE(),r=gg(),[i,o]=ie.useState(!1),s=()=>{o(!0)},a=()=>{o(!1)},[l,u]=ie.useState(!1),c=()=>{u(!0)},d=()=>{u(!1)},f=(h,p)=>{p&&(r.updateBeamline(p),e.updateDiameter(r.beamlineRecord[p].beamstopDiameter,bs.millimetre),n.updateDiameter(r.beamlineRecord[p].cameratubeDiameter,bs.millimetre))};return D.jsx(cn,{maxHeight:{lg:"91vh"},overflow:{lg:"scroll"},children:D.jsxs(cn,{spacing:1,children:[D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:"Beamline"}),D.jsx(ca,{}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx(ly,{size:"small",options:Object.keys(r.beamlineRecord),value:r.beamlineName,sx:{width:300,color:"white"},renderInput:h=>D.jsx($n,{...h,label:"choose beamline",sx:{color:"white"}}),onChange:f}),D.jsx(Bf,{variant:"outlined",onClick:c,children:"Beamlines"}),D.jsx(ZMe,{open:l,handleClose:d,handleOpen:c})]})]})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:"Detector"}),D.jsx(ca,{}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx(ly,{size:"small",options:Object.keys(t.detectorRecord),sx:{width:300},renderInput:h=>D.jsx($n,{...h,label:"choose detector"}),value:t.name,onChange:(h,p)=>{p&&t.updateDetector(p)}}),D.jsxs(Bf,{variant:"outlined",onClick:s,children:[" ","Detectors"]}),D.jsx(XMe,{open:i,handleClose:a,handleOpen:s})]}),D.jsxs(xn,{children:["Resolution (hxw):",t.detector.resolution.height," x"," ",t.detector.resolution.width]}),D.jsxs(cn,{direction:"row",alignItems:"center",children:[D.jsxs(xn,{flexGrow:2,children:["Pixel size:"," ",t.detector.pixelSize.height.toNumber().toFixed(2)," x ",t.detector.pixelSize.width.toNumber().toFixed(2)]}),D.jsxs(Ai,{children:[D.jsx(da,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.detector.pixelSize.height.formatUnits(),onChange:h=>t.updatePixelUnits(h.target.value),children:[D.jsxs(wn,{value:bs.millimetre,children:[bs.millimetre," x ",bs.millimetre]}),D.jsxs(wn,{value:bs.micrometre,children:["μm"," x ","μm"]})]})]})]})]})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsx(_be,{})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsx(Sbe,{})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsx(Cbe,{})})]})})}function xs(t){const e=E.useRef(t);return e.current=t,E.useMemo(()=>Object.freeze({get current(){return e.current}}),[])}function BN(t){const e=xs(t);E.useEffect(()=>()=>{e.current()},[])}const ND=typeof window<"u"&&typeof navigator<"u"&&typeof document<"u";function JMe(t){const e=xs(t),n=E.useRef(0),r=E.useCallback(()=>{ND&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return BN(r),[E.useMemo(()=>{const i=(...o)=>{ND&&(r(),n.current=requestAnimationFrame(()=>{e.current(...o),n.current=0}))};return Object.defineProperties(i,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__raf`}}),i},[]),r]}function e2e(t,e,n,r=!1){const i=E.useRef(),o=E.useRef();return BN(()=>{i.current&&(clearTimeout(i.current),i.current=void 0)}),E.useMemo(()=>{const s=(l,u)=>{o.current=void 0,t.apply(l,u),i.current=setTimeout(()=>{i.current=void 0,!r&&o.current&&(s(o.current.this,o.current.args),o.current=void 0)},n)},a=function(...l){if(i.current){o.current={args:l,this:this};return}s(this,l)};return Object.defineProperties(a,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__throttled__${n}`}}),a},[n,r,...e])}function t2e(t,...e){var n;(n=t==null?void 0:t.addEventListener)==null||n.call(t,...e)}function n2e(t,...e){var n;(n=t==null?void 0:t.removeEventListener)==null||n.call(t,...e)}const r2e=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function i2e(t=!1){const e=E.useRef(t),n=E.useCallback(()=>e.current,[]);return E.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),n}const o2e=t=>(t+1)%Number.MAX_SAFE_INTEGER;function s2e(){const[,t]=E.useState(0);return E.useCallback(()=>{t(o2e)},[])}function a2e(t,e){return typeof t=="function"?t(e):t}function U8(t){const e=E.useRef();return E.useEffect(()=>{e.current=t}),e.current}function l2e(t){const[e,n]=E.useState(t),[r,i]=JMe(n);return BN(i),[e,r]}function u2e(t=!1,e=!0){const[n,r]=E.useState(t),i=xs(e);return[n,E.useCallback(o=>{r(s=>o===void 0||i.current&&typeof o=="object"&&(o.constructor.name==="SyntheticBaseEvent"||typeof o._reactName=="string")?!s:!!a2e(o,s))},[])]}function Cf(t,...e){const n=i2e(),r=xs(e[1]),i=E.useMemo(()=>function(...o){n()&&(typeof r.current=="function"?r.current.apply(this,o):typeof r.current.handleEvent=="function"&&r.current.handleEvent.apply(this,o))},[]);E.useEffect(()=>{const o=c2e(t)?t.current:t;if(!o)return;const s=e.slice(2);return t2e(o,e[0],i,...s),()=>{n2e(o,e[0],i,...s)}},[t,e[0]])}function c2e(t){return t!==null&&typeof t=="object"&&r2e(t,"current")}const d2e=t=>e=>e.key===t,f2e=ND?window:null;function h2e(t,e,n=[],r={}){const{event:i="keydown",target:o=f2e,eventOptions:s}=r,a=xs(e),l=E.useMemo(()=>{const u=d2e(t);return function(c){u(c)&&a.current.call(this,c)}},n);Cf(o,i,l,s)}function i_(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function p2e(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function LW(t){let e,n,r;t.length!==2?(e=i_,n=(a,l)=>i_(t(a),l),r=(a,l)=>t(a)-l):(e=t===i_||t===p2e?t:m2e,n=t,r=t);function i(a,l,u=0,c=a.length){if(u>>1;n(a[d],l)<0?u=d+1:c=d}while(u>>1;n(a[d],l)<=0?u=d+1:c=d}while(uu&&r(a[d-1],l)>-r(a[d],l)?d-1:d}return{left:i,center:s,right:o}}function m2e(){return 0}function g2e(t){return t===null?NaN:+t}const v2e=LW(i_),y2e=v2e.right;LW(g2e).center;const b2e=Math.sqrt(50),x2e=Math.sqrt(10),w2e=Math.sqrt(2);function wS(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=b2e?10:o>=x2e?5:o>=w2e?2:1;let a,l,u;return i<0?(u=Math.pow(10,-i)/s,a=Math.round(t*u),l=Math.round(e*u),a/ue&&--l,u=-u):(u=Math.pow(10,i)*s,a=Math.round(t/u),l=Math.round(e/u),a*ue&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let u=0;u=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function _S(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Km(t){return t=_S(Math.abs(t)),t?t[1]:NaN}function S2e(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function C2e(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var E2e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function my(t){if(!(e=E2e.exec(t)))throw new Error("invalid format: "+t);var e;return new $N({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}my.prototype=$N.prototype;function $N(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}$N.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function M2e(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var zW;function T2e(t,e){var n=_S(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(zW=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_S(t,Math.max(0,e+o-1))[0]}function H8(t,e){var n=_S(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const V8={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:_2e,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>H8(t*100,e),r:H8,s:T2e,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function G8(t){return t}var j8=Array.prototype.map,W8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function A2e(t){var e=t.grouping===void 0||t.thousands===void 0?G8:S2e(j8.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?G8:C2e(j8.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d){d=my(d);var f=d.fill,h=d.align,p=d.sign,g=d.symbol,b=d.zero,m=d.width,w=d.comma,x=d.precision,_=d.trim,C=d.type;C==="n"?(w=!0,C="g"):V8[C]||(x===void 0&&(x=12),_=!0,C="g"),(b||f==="0"&&h==="=")&&(b=!0,f="0",h="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",M=g==="$"?r:/[%p]/.test(C)?s:"",P=V8[C],A=/[defgprs%]/.test(C);x=x===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function R(F){var $=S,j=M,k,U,G;if(C==="c")j=P(F)+j,F="";else{F=+F;var B=F<0||1/F<0;if(F=isNaN(F)?l:P(Math.abs(F),x),_&&(F=M2e(F)),B&&+F==0&&p!=="+"&&(B=!1),$=(B?p==="("?p:a:p==="-"||p==="("?"":p)+$,j=(C==="s"?W8[8+zW/3]:"")+j+(B&&p==="("?")":""),A){for(k=-1,U=F.length;++kG||G>57){j=(G===46?i+F.slice(k+1):F.slice(k))+j,F=F.slice(0,k);break}}}w&&!b&&(F=e(F,1/0));var L=$.length+F.length+j.length,N=L>1)+$+F+j+N.slice(L);break;default:F=N+$+F+j;break}return o(F)}return R.toString=function(){return d+""},R}function c(d,f){var h=u((d=my(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Km(f)/3)))*3,g=Math.pow(10,-p),b=W8[8+p/3];return function(m){return h(g*m)+b}}return{format:u,formatPrefix:c}}var Cx,Yl,UW;P2e({thousands:",",grouping:[3],currency:["$",""]});function P2e(t){return Cx=A2e(t),Yl=Cx.format,UW=Cx.formatPrefix,Cx}function D2e(t){return Math.max(0,-Km(Math.abs(t)))}function R2e(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Km(e)/3)))*3-Km(Math.abs(t)))}function I2e(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Km(e)-Km(t))+1}var N2e={};function F2e(t,e){for(var n=1,r=t.length,i=t[0],o=t[0],s=1;s0,s=[],a=[],l=0,u=0,c,d;for(c=0;c0&&s.push("var "+a.join(",")),c=r-1;c>=0;--c)l=t[c],s.push(["for(i",c,"=0;i",c,"0&&s.push(["index[",u,"]-=s",u].join("")),s.push(["++index[",l,"]"].join(""))),s.push("}")}return s.join(` +`)),r.current=!0),p.current){u(),p.current=!1;return}h()},[e.autoHeight,h,n,u]);_r(()=>l(),[l]),dn(t,"sortedRowsSet",l),dn(t,"pageChange",l),dn(t,"pageSizeChange",l),dn(t,"columnsChange",l),ct(t,"resize",g),dn(t,"debouncedResize",e.onResize)}const OEe=t=>O({},t,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),kEe=(t,e)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:i}=e,o=E.useRef({}),s=E.useRef(-1),a=E.useRef(!1),l=gt(t,yb),u=gt(t,vb),c=gt(t,vg),d=gt(t,gN),f=rh(t,e),h=gt(t,gb),p=E.useCallback(()=>{var A,R;a.current=!1;const F=Qbe(t.current.state,t.current.instanceId),$=U=>{o.current[U.id]||(o.current[U.id]={sizes:{baseCenter:l},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});const{isResized:G,needsFirstMeasurement:B,sizes:L}=o.current[U.id];let N=l;const W=L.baseCenter;if(G)N=W;else if(n){const fe=n(O({},U,{densityFactor:F}));if(fe==="auto"){if(B){const Me=i?i(O({},U,{densityFactor:F})):l;N=Me??l}else N=W;a.current=!0,o.current[U.id].autoHeight=!0}else N=fe??l,o.current[U.id].needsFirstMeasurement=!1,o.current[U.id].autoHeight=!1}else o.current[U.id].needsFirstMeasurement=!1;const K=Object.entries(L).reduce((fe,[Me,ye])=>(/^base[A-Z]/.test(Me)&&(fe[Me]=ye),fe),{}),Q=O({},K,{baseCenter:N});if(r){var J,ae;const fe=t.current.getRowIndexRelativeToVisibleRows(U.id),Me=r(O({},U,{isFirstVisible:fe===0,isLastVisible:fe===f.rows.length-1,indexRelativeToCurrentPage:fe}));Q.spacingTop=(J=Me.top)!=null?J:0,Q.spacingBottom=(ae=Me.bottom)!=null?ae:0}const ve=t.current.unstable_applyPipeProcessors("rowHeight",Q,U);return o.current[U.id].sizes=ve,ve},j=[],k=f.rows.reduce((U,G)=>{j.push(U);let B=0,L=0;const N=$(G);return Object.entries(N).forEach(([W,K])=>{/^base[A-Z]/.test(W)?B=K>B?K:B:L+=K}),U+B+L},0);h==null||(A=h.top)==null||A.forEach(U=>{$(U)}),h==null||(R=h.bottom)==null||R.forEach(U=>{$(U)}),t.current.setState(U=>O({},U,{rowsMeta:{currentPageTotalHeight:k,positions:j}})),a.current||(s.current=1/0),t.current.forceUpdate()},[t,f.rows,l,n,r,i,h]),g=E.useCallback(A=>{const R=o.current[A];return R?R.sizes.baseCenter:l},[l]),b=A=>{var R;return(R=o.current[A])==null?void 0:R.sizes},m=E.useCallback((A,R)=>{o.current[A].sizes.baseCenter=R,o.current[A].isResized=!0,o.current[A].needsFirstMeasurement=!1,p()},[p]),w=E.useMemo(()=>ug(p),[p]),x=E.useCallback((A,R,F)=>{if(!o.current[A]||!o.current[A].autoHeight)return;const $=o.current[A].sizes[`base${Ge(F)}`]!==R;o.current[A].needsFirstMeasurement=!1,o.current[A].sizes[`base${Ge(F)}`]=R,$&&w()},[w]),_=E.useCallback(A=>{var R;return((R=o.current[A])==null?void 0:R.autoHeight)||!1},[]),C=E.useCallback(()=>s.current,[]),S=E.useCallback(A=>{a.current&&A>s.current&&(s.current=A)},[]),M=E.useCallback(()=>{o.current={},p()},[p]);E.useEffect(()=>{p()},[l,u,c,d,p]),PN(t,"rowHeight",p),In(t,{unstable_getLastMeasuredRowIndex:C,unstable_setLastMeasuredRowIndex:S,unstable_rowHasAutoHeight:_,unstable_getRowHeight:g,unstable_getRowInternalSizes:b,unstable_setRowHeight:m,unstable_storeRowHeightMeasurement:x,resetRowHeights:M})},LEe=t=>{const e=E.useCallback((i={})=>t.current.unstable_applyPipeProcessors("exportState",{},i),[t]),n=E.useCallback(i=>{t.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:i}).callbacks.forEach(s=>{s()}),t.current.forceUpdate()},[t]);In(t,{exportState:e,restoreState:n})},BEe=t=>{const e=E.useRef({}),n=E.useCallback((l,u,c)=>{const d=e.current;d[l]||(d[l]={}),d[l][u]=c},[]),r=E.useCallback((l,u)=>{var c;return(c=e.current[l])==null?void 0:c[u]},[]),i=E.useCallback(l=>{const{columnIndex:u,rowId:c,minFirstColumnIndex:d,maxLastColumnIndex:f,columns:h}=l,p=h.length,g=h[u],b=typeof g.colSpan=="function"?g.colSpan(t.current.getCellParams(c,g.field)):g.colSpan;if(!b||b===1)return n(c,u,{spannedByColSpan:!1,cellProps:{colSpan:1,width:g.computedWidth}}),{colSpan:1};let m=g.computedWidth;for(let w=1;w=d&&x{for(let f=u;f1&&(f+=h.colSpan-1)}},[i]);In(t,{unstable_getCellColSpanInfo:r,unstable_calculateColSpan:o});const a=E.useCallback(()=>{e.current={}},[]);ct(t,"columnOrderChange",a)},$Ee=(t,e)=>{var n;const r=E.useCallback(i=>{var o;if(!((o=e.experimentalFeatures)!=null&&o.columnGrouping))return i;const s=pW(e.columnGroupingModel);return i.all.forEach(a=>{var l,u;const c=(l=s[a])!=null?l:[],d=i.lookup[a];bCe(d)&&qa(c,d==null?void 0:d.groupPath)||(i.lookup[a]=O({},i.lookup[a],{groupPath:(u=s[a])!=null?u:[]}))}),i},[e.columnGroupingModel,(n=e.experimentalFeatures)==null?void 0:n.columnGrouping]);Pi(t,"hydrateColumns",r)},zEe=t=>{var e,n;const r=cCe(void 0,t);return $Ee(r,t),AEe(r,t),gEe(r),cs(yEe,r,t),cs(mCe,r,t),cs(xCe,r,t),cs(hEe,r,t),cs((e=t.experimentalFeatures)!=null&&e.newEditingApi?dEe:tEe,r,t),cs(VCe,r,t),cs(PEe,r,t),cs(ZCe,r,t),cs(UCe,r,t),cs(_Ce,r,t),cs(KCe,r,t),cs(OEe,r,t),cs(hCe,r,t),WCe(r,t),bEe(r,t),gCe(r,t),pEe(r,t),vEe(r),BEe(r),wCe(r,t),((n=t.experimentalFeatures)!=null&&n.newEditingApi?fEe:nEe)(r,t),GCe(r,t),QCe(r,t),HCe(r,t),DEe(r,t),SCe(r,t),YCe(r,t),kEe(r,t),REe(r,t),pCe(r),ACe(r),RCe(r,t),fCe(r),FEe(r,t),IEe(r,t),LEe(r),r},UEe={apiRef:void 0,disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,disableMultipleSelection:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,disableColumnResize:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid"},HEe=100,VEe={autoHeight:!1,autoPageSize:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,columnBuffer:3,rowBuffer:3,columnThreshold:3,rowThreshold:3,density:Cl.Standard,disableExtendRowFullWidth:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnSelector:!1,disableDensitySelector:!1,disableMultipleColumnsFiltering:!1,disableMultipleSelection:!1,disableMultipleColumnsSorting:!1,disableSelectionOnClick:!1,disableVirtualization:!1,disableIgnoreModificationsIfProcessingProps:!1,editMode:oo.Cell,filterMode:bm.client,headerHeight:56,hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,logger:console,logLevel:"error",pagination:!1,paginationMode:bm.client,rowHeight:52,rowsPerPageOptions:[25,50,100],rowSpacingType:"margin",showCellRightBorder:!1,showColumnRightBorder:!1,sortingOrder:["asc","desc",null],sortingMode:bm.client,throttleRowsMs:0,disableColumnReorder:!1,disableColumnResize:!1,keepNonExistentRowsSelected:!1,keepColumnPositionIfDraggedOutside:!1},GEe=t=>{if(t.pageSize>HEe)throw new Error("'props.pageSize' cannot exceed 100 in DataGrid.");const e=kt({props:t,name:"MuiDataGrid"}),n=E.useMemo(()=>O({},xEe,e.localeText),[e.localeText]),r=E.useMemo(()=>{const i=e.components;if(!i)return O({},A8);const o={};return Object.entries(A8).forEach(([s,a])=>{o[s]=i[s]===void 0?a:i[s]}),o},[e.components]);return E.useMemo(()=>O({},VEe,e,{localeText:n,components:r},UEe),[e,n,r])},jEe=["className"],WEe=t=>{const{classes:e}=t;return Qe({root:["virtualScroller"]},ln,e)},qEe=ze("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(t,e)=>e.virtualScroller})({overflow:"auto",position:"relative","@media print":{overflow:"hidden"}}),XEe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,jEe),o=mt(),s=WEe(o);return D.jsx(qEe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),KEe=["className","style"],YEe=t=>{const{classes:e,overflowedContent:n}=t;return Qe({root:["virtualScrollerContent",n&&"virtualScrollerContent--overflowed"]},ln,e)},ZEe=ze("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(t,e)=>e.virtualScrollerContent})({}),QEe=E.forwardRef(function(e,n){const{className:r,style:i}=e,o=Be(e,KEe),s=mt(),a=O({},s,{overflowedContent:!s.autoHeight&&(i==null?void 0:i.minHeight)==="auto"}),l=YEe(a);return D.jsx(ZEe,O({ref:n,className:vn(l.root,r),ownerState:a,style:i},o))}),JEe=["className"],eMe=t=>{const{classes:e}=t;return Qe({root:["virtualScrollerRenderZone"]},ln,e)},tMe=ze("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(t,e)=>e.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),nMe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,JEe),o=mt(),s=eMe(o);return D.jsx(tMe,O({ref:n,className:vn(s.root,r),ownerState:o},i))}),rMe=["style"];function xm(t,e,n=0,r=e.length){if(e.length<=0)return-1;if(n>=r)return n;const i=n+Math.floor((r-n)/2),o=e[i];return t<=o?xm(t,e,n,i):xm(t,e,i+1,r)}function iMe(t,e,n){let r=1;for(;n[Xm(t-n,r,i),Xm(e+n,r,i)],oMe=(t,e)=>t===e?!0:t.firstRowIndex===e.firstRowIndex&&t.lastRowIndex===e.lastRowIndex&&t.firstColumnIndex===e.firstColumnIndex&&t.lastColumnIndex===e.lastColumnIndex,sMe=t=>{var e,n;const r=Lt(),i=mt(),o=gt(r,lo),{ref:s,disableVirtualization:a,onRenderZonePositioning:l,renderZoneMinColumnIndex:u=0,renderZoneMaxColumnIndex:c=o.length,getRowProps:d}=t,f=gt(r,zf),h=gt(r,bE),p=gt(r,yb),g=gt(r,Oa),b=gt(r,hS),m=gt(r,py),w=gt(r,br),x=gt(r,mS),_=rh(r,i),C=E.useRef(null),S=E.useRef(null),M=An(s,S),[P,A]=E.useState(null),R=E.useRef(P),F=E.useRef({top:0,left:0}),[$,j]=E.useState({width:null,height:null}),k=E.useRef(h),U=E.useCallback(ye=>{var we,Fe;const Oe=r.current.unstable_getLastMeasuredRowIndex();let re=Oe===1/0;(we=_.range)!=null&&we.lastRowIndex&&!re&&(re=Oe>=_.range.lastRowIndex);const _e=Xm(Oe-(((Fe=_.range)==null?void 0:Fe.firstRowIndex)||0),0,m.positions.length);return re||m.positions[_e]>=ye?xm(ye,m.positions):iMe(ye,m.positions,_e)},[r,(e=_.range)==null?void 0:e.firstRowIndex,(n=_.range)==null?void 0:n.lastRowIndex,m.positions]),G=E.useCallback(()=>{if(a)return{firstRowIndex:0,lastRowIndex:_.rows.length,firstColumnIndex:0,lastColumnIndex:o.length};const{top:ye,left:we}=F.current,Fe=Math.min(U(ye),m.positions.length-1),Oe=i.autoHeight?Fe+_.rows.length:U(ye+$.height);let re=!1,_e=0,Ce=f.length;const[X,Z]=Mc({firstIndex:Fe,lastIndex:Oe,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:i.rowBuffer});for(let he=X;he{a?C.current.style.transform="translate3d(0px, 0px, 0px)":(S.current.scrollLeft=0,S.current.scrollTop=0)},[a]),_r(()=>{j({width:S.current.clientWidth,height:S.current.clientHeight})},[m.currentPageTotalHeight]);const B=E.useCallback(ye=>{j({width:ye.width,height:ye.height})},[]);ct(r,"resize",B);const L=E.useCallback(ye=>{const[we,Fe]=Mc({firstIndex:ye.firstRowIndex,lastIndex:ye.lastRowIndex,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:i.rowBuffer}),[Oe]=Mc({firstIndex:ye.firstColumnIndex,lastIndex:ye.lastColumnIndex,minFirstIndex:u,maxLastIndex:c,buffer:i.columnBuffer}),re=AD({firstColumnToRender:Oe,apiRef:r,firstRowToRender:we,lastRowToRender:Fe,visibleRows:_.rows}),_e=py(r.current.state).positions[we],Ce=zf(r)[re];C.current.style.transform=`translate3d(${Ce}px, ${_e}px, 0px)`,typeof l=="function"&&l({top:_e,left:Ce})},[r,_.rows,l,u,c,i.columnBuffer,i.rowBuffer]),N=E.useCallback(ye=>{if(R.current&&oMe(ye,R.current)){L(ye);return}A(ye),L(ye);const[we,Fe]=Mc({firstIndex:ye.firstRowIndex,lastIndex:ye.lastRowIndex,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:i.rowBuffer});r.current.publishEvent("renderedRowsIntervalChange",{firstRowToRender:we,lastRowToRender:Fe}),R.current=ye},[r,A,R,_.rows.length,i.rowBuffer,L]);_r(()=>{if($.width==null)return;const ye=G();N(ye);const{top:we,left:Fe}=F.current,Oe={top:we,left:Fe,renderContext:ye};r.current.publishEvent("rowsScroll",Oe)},[r,G,$.width,N]);const W=ye=>{const{scrollTop:we,scrollLeft:Fe}=ye.currentTarget;if(F.current.top=we,F.current.left=Fe,Fe<0||we<0||!R.current)return;const Oe=a?R.current:G(),re=Math.abs(Oe.firstRowIndex-R.current.firstRowIndex),_e=Math.abs(Oe.lastRowIndex-R.current.lastRowIndex),Ce=Math.abs(Oe.firstColumnIndex-R.current.firstColumnIndex),X=Math.abs(Oe.lastColumnIndex-R.current.lastColumnIndex),Z=re>=i.rowThreshold||_e>=i.rowThreshold||Ce>=i.columnThreshold||X>=i.columnThreshold||k.current!==h;r.current.publishEvent("rowsScroll",{top:we,left:Fe,renderContext:Z?Oe:R.current},ye),Z&&(qu.flushSync(()=>{N(Oe)}),k.current=h)},K=ye=>{r.current.publishEvent("virtualScrollerWheel",{},ye)},Q=ye=>{r.current.publishEvent("virtualScrollerTouchMove",{},ye)},J=(ye={renderContext:P})=>{const{renderContext:we,minFirstColumn:Fe=u,maxLastColumn:Oe=c,availableSpace:re=$.width,rowIndexOffset:_e=0,position:Ce="center"}=ye;if(!we||re==null)return null;const X=a?0:i.rowBuffer,Z=a?0:i.columnBuffer,[he,Y]=Mc({firstIndex:we.firstRowIndex,lastIndex:we.lastRowIndex,minFirstIndex:0,maxLastIndex:_.rows.length,buffer:X}),ne=[];if(ye.rows)ye.rows.forEach(de=>{ne.push(de),r.current.unstable_calculateColSpan({rowId:de.id,minFirstColumn:Fe,maxLastColumn:Oe,columns:o})});else{if(!_.range)return null;for(let de=he;de$.width,ve=E.useMemo(()=>{const ye=Math.max(m.currentPageTotalHeight,1);let we=!1;S!=null&&S.current&&ye<=(S==null?void 0:S.current.clientHeight)&&(we=!0);const Fe={width:ae?h:"auto",height:ye,minHeight:we?"100%":"auto"};return i.autoHeight&&_.rows.length===0&&(Fe.height=2*p),Fe},[S,h,m.currentPageTotalHeight,_.rows.length,ae,i.autoHeight,p]);E.useEffect(()=>{r.current.publishEvent("virtualScrollerContentSizeChange")},[r,ve]),i.autoHeight&&_.rows.length===0&&(ve.height=2*p);const fe={};ae||(fe.overflowX="hidden"),i.autoHeight&&(fe.overflowY="hidden");const Me=E.useCallback(()=>R.current,[]);return r.current.unstable_getRenderContext=Me,{renderContext:P,updateRenderZonePosition:L,getRows:J,getRootProps:(ye={})=>{let{style:we={}}=ye,Fe=Be(ye,rMe);return O({ref:M,onScroll:W,onWheel:K,onTouchMove:Q,style:O({},we,fe)},Fe)},getContentProps:({style:ye={}}={})=>({style:O({},ye,ve)}),getRenderZoneProps:()=>({ref:C})}},aMe=["className","disableVirtualization"],lMe=E.forwardRef(function(e,n){const{className:r,disableVirtualization:i}=e,o=Be(e,aMe),{getRootProps:s,getContentProps:a,getRenderZoneProps:l,getRows:u}=sMe({ref:n,disableVirtualization:i});return D.jsx(XEe,O({className:r},s(o),{children:D.jsx(QEe,O({},a(),{children:D.jsx(nMe,O({},l(),{children:u()}))}))}))}),uMe=t=>{const{classes:e,headerAlign:n,isDragging:r,showRightBorder:i,showColumnBorder:o,groupId:s}=t;return Qe({root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",i&&"withBorder",o&&"columnHeader--showColumnBorder",s===null?"columnHeader--emptyGroup":"columnHeader--filledGroup"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]},ln,e)};function cMe(t){var e,n;const{groupId:r,width:i,depth:o,maxDepth:s,fields:a,height:l,colIndex:u,isLastColumn:c,extendRowFullWidth:d}=t,f=mt(),h=Lt(),p=gt(h,fW),{hasScrollX:g,hasScrollY:b}=(e=h.current.getRootDimensions())!=null?e:{hasScrollX:!1,hasScrollY:!1},m=r?p[r]:{},{headerName:w=r??"",description:x="",headerAlign:_=void 0}=m;let C;const S=r&&((n=p[r])==null?void 0:n.renderHeaderGroup),M={groupId:r,headerName:w,description:x,depth:o,maxDepth:s,fields:a,colIndex:u,isLastColumn:c};r&&S&&(C=S(M));const A=c?!(c&&g&&!b)&&!d:f.showColumnRightBorder,R=f.showColumnRightBorder,F=O({},t,{classes:f.classes,showRightBorder:A,showColumnBorder:R,headerAlign:_,depth:o,isDragging:!1}),$=w??r,j=jn(),k=r===null?`empty-group-cell-${j}`:r,U=uMe(F),G=typeof m.headerClassName=="function"?m.headerClassName(M):m.headerClassName;return D.jsx(Xj,{classes:U,columnMenuOpen:!1,colIndex:u,height:l,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:-1,isDraggable:!1,headerComponent:C,headerClassName:G,description:x,elementId:k,width:i,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:$,"aria-colspan":a.length,"data-fields":`|-${a.join("-|-")}-|`,disableHeaderSeparator:!0})}const D8=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(t,e)=>e.columnHeaderRow})(()=>({display:"flex"}));function dMe(t){return!!t.target}const fMe=t=>{const{innerRef:e,minColumnIndex:n=0}=t,[r,i]=E.useState(""),[o,s]=E.useState(""),a=Lt(),l=gt(a,lo),u=gt(a,zf),c=gt(a,$j),d=gt(a,hS),f=gt(a,s1e),h=gt(a,Fj),p=gt(a,xN),g=gt(a,bb),b=gt(a,Zbe),m=gt(a,Gbe),w=gt(a,dW),x=mt(),_=E.useRef(null),C=An(e,_),[S,M]=E.useState(null),P=E.useRef(S),A=E.useRef(0),R=rh(a,x);E.useEffect(()=>{a.current.columnHeadersContainerElementRef.current.scrollLeft=0},[a]);const F=E.useRef(Tj(l_e,{equalityCheck:(J,ae)=>["firstColumnIndex","minColumnIndex","columnBuffer"].every(ve=>J[ve]===ae[ve])})),$=E.useCallback(J=>{const[ae,ve]=Mc({firstIndex:J.firstRowIndex,lastIndex:J.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:x.rowBuffer}),fe=F.current({firstColumnIndex:J.firstColumnIndex,minColumnIndex:n,columnBuffer:x.columnBuffer,firstRowToRender:ae,lastRowToRender:ve,apiRef:a,visibleRows:R.rows}),Me=fe>0?A.current-u[fe]:A.current;_.current.style.transform=`translate3d(${-Me}px, 0px, 0px)`},[u,n,x.columnBuffer,a,R.rows,x.rowBuffer]);E.useLayoutEffect(()=>{S&&$(S)},[S,$]);const j=E.useCallback(({left:J,renderContext:ae=null},ve)=>{var fe,Me;if(!_.current||A.current===J&&((fe=P.current)==null?void 0:fe.firstColumnIndex)===(ae==null?void 0:ae.firstColumnIndex)&&((Me=P.current)==null?void 0:Me.lastColumnIndex)===(ae==null?void 0:ae.lastColumnIndex))return;A.current=J;let ye=!1;ae!==P.current||!P.current?(dMe(ve)?(qu.flushSync(()=>{M(ae)}),ye=!0):M(ae),P.current=ae):ye=!0,ae&&ye&&$(ae)},[$]),k=E.useCallback(J=>s(J.field),[]),U=E.useCallback(()=>s(""),[]),G=E.useCallback(J=>i(J.field),[]),B=E.useCallback(()=>i(""),[]);ct(a,"columnResizeStart",k),ct(a,"columnResizeStop",U),ct(a,"columnHeaderDragStart",G),ct(a,"columnHeaderDragEnd",B),ct(a,"rowsScroll",j);const L=J=>{const{renderContext:ae=S,minFirstColumn:ve=n,maxLastColumn:fe=l.length}=J||{};if(!ae)return null;const[Me,ye]=Mc({firstIndex:ae.firstRowIndex,lastIndex:ae.lastRowIndex,minFirstIndex:0,maxLastIndex:R.rows.length,buffer:x.rowBuffer}),we=F.current({firstColumnIndex:ae.firstColumnIndex,minColumnIndex:ve,columnBuffer:x.columnBuffer,apiRef:a,firstRowToRender:Me,lastRowToRender:ye,visibleRows:R.rows}),Fe=Math.min(ae.lastColumnIndex+x.columnBuffer,fe);return{renderedColumns:l.slice(we,Fe),firstColumnToRender:we,lastColumnToRender:Fe,minFirstColumn:ve,maxLastColumn:fe}},N=(J,ae={})=>{const ve=L(J);if(ve==null)return null;const{renderedColumns:fe,firstColumnToRender:Me}=ve,ye=[];for(let we=0;weJ.slice(0,ae+1),K=J=>{if(p===0)return null;const ae=L(J);if(ae==null||ae.renderedColumns.length===0)return null;const{renderedColumns:ve,firstColumnToRender:fe,lastColumnToRender:Me,maxLastColumn:ye}=ae,we=[],Fe=[];for(let z=0;z=n&&(Ce=l[le])!=null&&Ce.groupPath&&qa(W((X=l[le])==null?void 0:X.groupPath,z),ue);){var Ce,X,Z;const Te=l[le];if(te+=(Z=Te.computedWidth)!=null?Z:0,H.length===0){var he;H.push({width:(he=Te.computedWidth)!=null?he:0,fields:[Te.field],groupId:de,groupParents:ue,colIndex:le})}else{var Y;H[0].width+=(Y=Te.computedWidth)!=null?Y:0,H[0].fields.push(Te.field),H[0].colIndex=le}le-=1}const ge=ve.reduce((Te,Re,Ve)=>{var Le;const Ye=Te[Te.length-1];if(Re.groupPath&&Re.groupPath.length>z){var it;if(Ye&&Ye.groupId===Re.groupPath[z]){var ot;return[...Te.slice(0,Te.length-1),O({},Ye,{width:Ye.width+((ot=Re.computedWidth)!=null?ot:0),fields:[...Ye.fields,Re.field]})]}return[...Te,{groupId:Re.groupPath[z],groupParents:W(Re.groupPath,z),width:(it=Re.computedWidth)!=null?it:0,fields:[Re.field],colIndex:fe+Ve}]}if(Ye&&Ye.groupId===null&&qa(W(Re.groupPath,z),Ye.groupParents)){var ht;return[...Te.slice(0,Te.length-1),O({},Ye,{width:Ye.width+((ht=Re.computedWidth)!=null?ht:0),fields:[...Ye.fields,Re.field]})]}return[...Te,{groupId:null,groupParents:W(Re.groupPath,z),width:(Le=Re.computedWidth)!=null?Le:0,fields:[Re.field],colIndex:fe+Ve}]},H);le=Me;const be=ge[ge.length-1].groupId;for(;be!==null&&le{we.push(D.jsx(D8,{style:{height:`${h}px`,transform:`translateX(-${z.leftOverflow}px)`},role:"row","aria-rowindex":H+1,ownerState:x,children:z.elements.map(({groupId:te,width:le,fields:de,colIndex:ue},ge)=>D.jsx(cMe,{groupId:te,width:le,fields:de,colIndex:ue,depth:H,isLastColumn:ue===l.length-de.length,extendRowFullWidth:!x.disableExtendRowFullWidth,maxDepth:Fe.length,height:h},ge))},H))}),we},Q={minHeight:g,maxHeight:g,lineHeight:`${h}px`};return{renderContext:S,getColumnHeaders:N,getColumnGroupHeaders:K,isDragging:!!r,getRootProps:(J={})=>O({style:Q},J),getInnerProps:()=>({ref:C,role:"rowgroup"})}},hMe=["className"],pMe=t=>{const{classes:e}=t;return Qe({root:["columnHeaders"]},ln,e)},mMe=ze("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(t,e)=>e.columnHeaders})(({theme:t})=>({position:"absolute",top:0,left:0,right:0,overflow:"hidden",display:"flex",alignItems:"center",boxSizing:"border-box",borderBottom:`1px solid ${t.palette.mode==="light"?wI(ra(t.palette.divider,1),.88):xI(ra(t.palette.divider,1),.68)}`,borderTopLeftRadius:t.shape.borderRadius,borderTopRightRadius:t.shape.borderRadius})),gMe=E.forwardRef(function(e,n){const{className:r}=e,i=Be(e,hMe),o=mt(),s=pMe(o);return D.jsx(mMe,O({ref:n,className:vn(r,s.root),ownerState:o},i))}),vMe=["isDragging","className"],yMe=t=>{const{isDragging:e,hasScrollX:n,classes:r}=t;return Qe({root:["columnHeadersInner",e&&"columnHeaderDropZone",n&&"columnHeadersInner--scrollable"]},ln,r)},bMe=ze("div",{name:"MuiDataGrid",slot:"columnHeadersInner",overridesResolver:(t,e)=>[{[`&.${Ie.columnHeaderDropZone}`]:e.columnHeaderDropZone},e.columnHeadersInner]})(()=>({display:"flex",alignItems:"flex-start",flexDirection:"column",[`&.${Ie.columnHeaderDropZone} .${Ie.columnHeaderDraggableContainer}`]:{cursor:"move"},[`&.${Ie["columnHeadersInner--scrollable"]} .${Ie.columnHeader}:last-child`]:{borderRight:"none"}})),xMe=E.forwardRef(function(e,n){var r,i;const{isDragging:o,className:s}=e,a=Be(e,vMe),l=Lt(),u=mt(),c=O({},u,{isDragging:o,hasScrollX:(r=(i=l.current.getRootDimensions())==null?void 0:i.hasScrollX)!=null?r:!1}),d=yMe(c);return D.jsx(bMe,O({ref:n,className:vn(s,d.root),ownerState:c},a))}),wMe=["innerRef","className"],_Me=E.forwardRef(function(e,n){const{innerRef:r}=e,i=Be(e,wMe),{isDragging:o,getRootProps:s,getInnerProps:a,getColumnHeaders:l,getColumnGroupHeaders:u}=fMe({innerRef:r});return D.jsxs(gMe,O({ref:n},s(i),{children:[D.jsx(y8,{scrollDirection:"left"}),D.jsxs(xMe,O({isDragging:o},a(),{children:[u(),l()]})),D.jsx(y8,{scrollDirection:"right"})]}))}),EW=E.forwardRef(function(e,n){const r=GEe(e),i=zEe(r);return D.jsx(YSe,{apiRef:i,props:r,children:D.jsx(yxe,{className:r.className,style:r.style,sx:r.sx,ref:n,children:D.jsxs(r1e,{children:[D.jsx(o1e,{}),D.jsx(t1e,{ColumnHeadersComponent:_Me,VirtualScrollerComponent:lMe}),D.jsx(i1e,{})]})})})}),MW=E.memo(EW);EW.propTypes={"aria-label":me.string,"aria-labelledby":me.string,autoHeight:me.bool,autoPageSize:me.bool,cellModesModel:me.object,checkboxSelection:me.bool,classes:me.object,columnBuffer:me.number,columnGroupingModel:me.arrayOf(me.object),columns:aT(me.array.isRequired),columnThreshold:me.number,columnTypes:me.object,columnVisibilityModel:me.object,components:me.object,componentsProps:me.object,density:me.oneOf(["comfortable","compact","standard"]),disableColumnFilter:me.bool,disableColumnMenu:me.bool,disableColumnSelector:me.bool,disableDensitySelector:me.bool,disableExtendRowFullWidth:me.bool,disableIgnoreModificationsIfProcessingProps:me.bool,disableSelectionOnClick:me.bool,disableVirtualization:me.bool,editMode:me.oneOf(["cell","row"]),editRowsModel:me.object,error:me.any,experimentalFeatures:me.shape({columnGrouping:me.bool,newEditingApi:me.bool,preventCommitWhileValidating:me.bool,warnIfFocusStateIsNotSynced:me.bool}),filterMode:me.oneOf(["client","server"]),filterModel:me.shape({items:me.arrayOf(me.shape({columnField:me.string.isRequired,id:me.oneOfType([me.number,me.string]),operatorValue:me.string,value:me.any})).isRequired,linkOperator:me.oneOf(["and","or"]),quickFilterLogicOperator:me.oneOf(["and","or"]),quickFilterValues:me.array}),getCellClassName:me.func,getDetailPanelContent:me.func,getEstimatedRowHeight:me.func,getRowClassName:me.func,getRowHeight:me.func,getRowId:me.func,getRowSpacing:me.func,headerHeight:me.number,hideFooter:me.bool,hideFooterPagination:me.bool,hideFooterSelectedRowCount:me.bool,initialState:me.object,isCellEditable:me.func,isRowSelectable:me.func,keepNonExistentRowsSelected:me.bool,loading:me.bool,localeText:me.object,logger:me.shape({debug:me.func.isRequired,error:me.func.isRequired,info:me.func.isRequired,warn:me.func.isRequired}),logLevel:me.oneOf(["debug","error","info","warn",!1]),nonce:me.string,onCellClick:me.func,onCellDoubleClick:me.func,onCellEditCommit:me.func,onCellEditStart:me.func,onCellEditStop:me.func,onCellFocusOut:me.func,onCellKeyDown:me.func,onCellModesModelChange:me.func,onColumnHeaderClick:me.func,onColumnHeaderDoubleClick:me.func,onColumnHeaderEnter:me.func,onColumnHeaderLeave:me.func,onColumnHeaderOut:me.func,onColumnHeaderOver:me.func,onColumnOrderChange:me.func,onColumnVisibilityChange:me.func,onColumnVisibilityModelChange:me.func,onEditCellPropsChange:me.func,onEditRowsModelChange:me.func,onError:me.func,onFilterModelChange:me.func,onMenuClose:me.func,onMenuOpen:me.func,onPageChange:me.func,onPageSizeChange:me.func,onPreferencePanelClose:me.func,onPreferencePanelOpen:me.func,onProcessRowUpdateError:me.func,onResize:me.func,onRowClick:me.func,onRowDoubleClick:me.func,onRowEditCommit:me.func,onRowEditStart:me.func,onRowEditStop:me.func,onRowModesModelChange:me.func,onSelectionModelChange:me.func,onSortModelChange:me.func,onStateChange:me.func,page:me.number,pageSize:aT(me.number),pagination:t=>t.pagination===!1?new Error(["MUI: `` is not a valid prop.","Infinite scrolling is not available in the MIT version.","","You need to upgrade to DataGridPro or DataGridPremium component to disable the pagination."].join(` +`)):null,paginationMode:me.oneOf(["client","server"]),processRowUpdate:me.func,rowBuffer:me.number,rowCount:me.number,rowHeight:me.number,rowModesModel:me.object,rows:me.arrayOf(me.object).isRequired,rowSpacingType:me.oneOf(["border","margin"]),rowsPerPageOptions:me.arrayOf(me.number),rowThreshold:me.number,scrollbarSize:me.number,selectionModel:aT(me.oneOfType([me.number,me.string,me.array])),showCellRightBorder:me.bool,showColumnRightBorder:me.bool,sortingMode:me.oneOf(["client","server"]),sortingOrder:me.arrayOf(me.oneOf(["asc","desc"])),sortModel:me.arrayOf(me.shape({field:me.string.isRequired,sort:me.oneOf(["asc","desc"])})),sx:me.oneOfType([me.arrayOf(me.oneOfType([me.func,me.object,me.bool])),me.func,me.object])};function SMe(t,e){return{name:t,resolution_height:e.resolution.height,resolution_width:e.resolution.width,pixel_height:e.pixelSize.height.toNumber("mm"),pixel_width:e.pixelSize.width.toNumber("mm")}}function CMe(){const t=mg(),e=[];for(const[r,i]of Object.entries(t.detectorRecord))e.push(SMe(r,i));const n=[{field:"name",headerName:"name",flex:1},{field:"resolution_height",headerName:"resolution height (px)",flex:1},{field:"resolution_width",headerName:"resolution width (px)",flex:1},{field:"pixel_height",headerName:"pixel height (mm)",flex:1},{field:"pixel_width",headerName:"pixel width (mm)",flex:1}];return D.jsx(MW,{autoHeight:!0,rows:e,getRowId:r=>r.name,columns:n,components:{Toolbar:cW},sx:{border:0},disableSelectionOnClick:!0})}var IN={},DT={};const EMe=ju(Aoe);var R8;function TW(){return R8||(R8=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e.createSvgIcon}});var e=EMe}(DT)),DT}var MMe=YC;Object.defineProperty(IN,"__esModule",{value:!0});var NN=IN.default=void 0,TMe=MMe(TW()),AMe=D;NN=IN.default=(0,TMe.default)((0,AMe.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var Cb=t=>t.type==="checkbox",Jp=t=>t instanceof Date,xo=t=>t==null;const AW=t=>typeof t=="object";var ci=t=>!xo(t)&&!Array.isArray(t)&&AW(t)&&!Jp(t),PMe=t=>ci(t)&&t.target?Cb(t.target)?t.target.checked:t.target.value:t,DMe=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,RMe=(t,e)=>t.has(DMe(e)),IMe=t=>{const e=t.constructor&&t.constructor.prototype;return ci(e)&&e.hasOwnProperty("isPrototypeOf")},FN=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ys(t){let e;const n=Array.isArray(t);if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(FN&&(t instanceof Blob||t instanceof FileList))&&(n||ci(t)))if(e=n?[]:{},!n&&!IMe(t))e=t;else for(const r in t)t.hasOwnProperty(r)&&(e[r]=Ys(t[r]));else return t;return e}var Eb=t=>Array.isArray(t)?t.filter(Boolean):[],zr=t=>t===void 0,St=(t,e,n)=>{if(!e||!ci(t))return n;const r=Eb(e.split(/[,[\].]+?/)).reduce((i,o)=>xo(i)?i:i[o],t);return zr(r)||r===t?zr(t[e])?n:t[e]:r},yu=t=>typeof t=="boolean";const I8={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ka={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},su={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};ie.createContext(null);var NMe=(t,e,n,r=!0)=>{const i={defaultValues:e._defaultValues};for(const o in t)Object.defineProperty(i,o,{get:()=>{const s=o;return e._proxyFormState[s]!==ka.all&&(e._proxyFormState[s]=!r||ka.all),t[s]}});return i},ms=t=>ci(t)&&!Object.keys(t).length,FMe=(t,e,n,r)=>{n(t);const{name:i,...o}=t;return ms(o)||Object.keys(o).length>=Object.keys(e).length||Object.keys(o).find(s=>e[s]===ka.all)},RT=t=>Array.isArray(t)?t:[t];function OMe(t){const e=ie.useRef(t);e.current=t,ie.useEffect(()=>{const n=!t.disabled&&e.current.subject&&e.current.subject.subscribe({next:e.current.next});return()=>{n&&n.unsubscribe()}},[t.disabled])}var El=t=>typeof t=="string",kMe=(t,e,n,r,i)=>El(t)?(r&&e.watch.add(t),St(n,t,i)):Array.isArray(t)?t.map(o=>(r&&e.watch.add(o),St(n,o))):(r&&(e.watchAll=!0),n),ON=t=>/^\w*$/.test(t),PW=t=>Eb(t.replace(/["|']|\]/g,"").split(/\.|\[/)),nr=(t,e,n)=>{let r=-1;const i=ON(e)?[e]:PW(e),o=i.length,s=o-1;for(;++re?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:i||!0}}:{},N8=t=>({isOnSubmit:!t||t===ka.onSubmit,isOnBlur:t===ka.onBlur,isOnChange:t===ka.onChange,isOnAll:t===ka.all,isOnTouch:t===ka.onTouched}),F8=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const wv=(t,e,n,r)=>{for(const i of n||Object.keys(t)){const o=St(t,i);if(o){const{_f:s,...a}=o;if(s){if(s.refs&&s.refs[0]&&e(s.refs[0],i)&&!r)break;if(s.ref&&e(s.ref,s.name)&&!r)break;wv(a,e)}else ci(a)&&wv(a,e)}}};var BMe=(t,e,n)=>{const r=Eb(St(t,n));return nr(r,"root",e[n]),nr(t,n,r),t},kN=t=>t.type==="file",Uc=t=>typeof t=="function",vS=t=>{if(!FN)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},r_=t=>El(t),LN=t=>t.type==="radio",yS=t=>t instanceof RegExp;const O8={value:!1,isValid:!1},k8={value:!0,isValid:!0};var DW=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!zr(t[0].attributes.value)?zr(t[0].value)||t[0].value===""?k8:{value:t[0].value,isValid:!0}:k8:O8}return O8};const L8={isValid:!1,value:null};var RW=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,L8):L8;function B8(t,e,n="validate"){if(r_(t)||Array.isArray(t)&&t.every(r_)||yu(t)&&!t)return{type:n,message:r_(t)?t:"",ref:e}}var Hh=t=>ci(t)&&!yS(t)?t:{value:t,message:""},$8=async(t,e,n,r,i)=>{const{ref:o,refs:s,required:a,maxLength:l,minLength:u,min:c,max:d,pattern:f,validate:h,name:p,valueAsNumber:g,mount:b,disabled:m}=t._f,w=St(e,p);if(!b||m)return{};const x=s?s[0]:o,_=$=>{r&&x.reportValidity&&(x.setCustomValidity(yu($)?"":$||""),x.reportValidity())},C={},S=LN(o),M=Cb(o),P=S||M,A=(g||kN(o))&&zr(o.value)&&zr(w)||vS(o)&&o.value===""||w===""||Array.isArray(w)&&!w.length,R=LMe.bind(null,p,n,C),F=($,j,k,U=su.maxLength,G=su.minLength)=>{const B=$?j:k;C[p]={type:$?U:G,message:B,ref:o,...R($?U:G,B)}};if(i?!Array.isArray(w)||!w.length:a&&(!P&&(A||xo(w))||yu(w)&&!w||M&&!DW(s).isValid||S&&!RW(s).isValid)){const{value:$,message:j}=r_(a)?{value:!!a,message:a}:Hh(a);if($&&(C[p]={type:su.required,message:j,ref:x,...R(su.required,j)},!n))return _(j),C}if(!A&&(!xo(c)||!xo(d))){let $,j;const k=Hh(d),U=Hh(c);if(!xo(w)&&!isNaN(w)){const G=o.valueAsNumber||w&&+w;xo(k.value)||($=G>k.value),xo(U.value)||(j=Gnew Date(new Date().toDateString()+" "+W),L=o.type=="time",N=o.type=="week";El(k.value)&&w&&($=L?B(w)>B(k.value):N?w>k.value:G>new Date(k.value)),El(U.value)&&w&&(j=L?B(w)+$.value,U=!xo(j.value)&&w.length<+j.value;if((k||U)&&(F(k,$.message,j.message),!n))return _(C[p].message),C}if(f&&!A&&El(w)){const{value:$,message:j}=Hh(f);if(yS($)&&!w.match($)&&(C[p]={type:su.pattern,message:j,ref:o,...R(su.pattern,j)},!n))return _(j),C}if(h){if(Uc(h)){const $=await h(w,e),j=B8($,x);if(j&&(C[p]={...j,...R(su.validate,j.message)},!n))return _(j.message),C}else if(ci(h)){let $={};for(const j in h){if(!ms($)&&!n)break;const k=B8(await h[j](w,e),x,j);k&&($={...k,...R(j,k.message)},_(k.message),n&&(C[p]=$))}if(!ms($)&&(C[p]={ref:x,...$},!n))return C}}return _(!0),C};function $Me(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{let t=[];return{get observers(){return t},next:i=>{for(const o of t)o.next&&o.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(o=>o!==i)}}),unsubscribe:()=>{t=[]}}},bS=t=>xo(t)||!AW(t);function ff(t,e){if(bS(t)||bS(e))return t===e;if(Jp(t)&&Jp(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n){const o=t[i];if(!r.includes(i))return!1;if(i!=="ref"){const s=e[i];if(Jp(o)&&Jp(s)||ci(o)&&ci(s)||Array.isArray(o)&&Array.isArray(s)?!ff(o,s):o!==s)return!1}}return!0}var IW=t=>t.type==="select-multiple",UMe=t=>LN(t)||Cb(t),NT=t=>vS(t)&&t.isConnected,NW=t=>{for(const e in t)if(Uc(t[e]))return!0;return!1};function xS(t,e={}){const n=Array.isArray(t);if(ci(t)||n)for(const r in t)Array.isArray(t[r])||ci(t[r])&&!NW(t[r])?(e[r]=Array.isArray(t[r])?[]:{},xS(t[r],e[r])):xo(t[r])||(e[r]=!0);return e}function FW(t,e,n){const r=Array.isArray(t);if(ci(t)||r)for(const i in t)Array.isArray(t[i])||ci(t[i])&&!NW(t[i])?zr(e)||bS(n[i])?n[i]=Array.isArray(t[i])?xS(t[i],[]):{...xS(t[i])}:FW(t[i],xo(e)?{}:e[i],n[i]):n[i]=!ff(t[i],e[i]);return n}var Sx=(t,e)=>FW(t,e,xS(e)),OW=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>zr(t)?t:e?t===""?NaN:t&&+t:n&&El(t)?new Date(t):r?r(t):t;function FT(t){const e=t.ref;if(!(t.refs?t.refs.every(n=>n.disabled):e.disabled))return kN(e)?e.files:LN(e)?RW(t.refs).value:IW(e)?[...e.selectedOptions].map(({value:n})=>n):Cb(e)?DW(t.refs).value:OW(zr(e.value)?t.ref.value:e.value,t)}var HMe=(t,e,n,r)=>{const i={};for(const o of t){const s=St(e,o);s&&nr(i,o,s._f)}return{criteriaMode:n,names:[...t],fields:i,shouldUseNativeValidation:r}},v0=t=>zr(t)?t:yS(t)?t.source:ci(t)?yS(t.value)?t.value.source:t.value:t,VMe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate);function z8(t,e,n){const r=St(t,n);if(r||ON(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),s=St(e,o),a=St(t,o);if(s&&!Array.isArray(s)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};i.pop()}return{name:n}}var GMe=(t,e,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(e||t):(n?r.isOnBlur:i.isOnBlur)?!t:(n?r.isOnChange:i.isOnChange)?t:!0,jMe=(t,e)=>!Eb(St(t,e)).length&&ni(t,e);const WMe={mode:ka.onSubmit,reValidateMode:ka.onChange,shouldFocusError:!0};function qMe(t={}){let e={...WMe,...t},n={submitCount:0,isDirty:!1,isLoading:Uc(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},r={},i=ci(e.defaultValues)||ci(e.values)?Ys(e.defaultValues||e.values)||{}:{},o=e.shouldUnregister?{}:Ys(i),s={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:IT(),array:IT(),state:IT()},f=N8(e.mode),h=N8(e.reValidateMode),p=e.criteriaMode===ka.all,g=Y=>ne=>{clearTimeout(u),u=setTimeout(Y,ne)},b=async Y=>{if(c.isValid||Y){const ne=e.resolver?ms((await P()).errors):await R(r,!0);ne!==n.isValid&&d.state.next({isValid:ne})}},m=(Y,ne)=>{(c.isValidating||c.validatingFields)&&((Y||Array.from(a.mount)).forEach(se=>{se&&(ne?nr(n.validatingFields,se,ne):ni(n.validatingFields,se))}),d.state.next({validatingFields:n.validatingFields,isValidating:!ms(n.validatingFields)}))},w=(Y,ne=[],se,xe,Pe=!0,z=!0)=>{if(xe&&se){if(s.action=!0,z&&Array.isArray(St(r,Y))){const H=se(St(r,Y),xe.argA,xe.argB);Pe&&nr(r,Y,H)}if(z&&Array.isArray(St(n.errors,Y))){const H=se(St(n.errors,Y),xe.argA,xe.argB);Pe&&nr(n.errors,Y,H),jMe(n.errors,Y)}if(c.touchedFields&&z&&Array.isArray(St(n.touchedFields,Y))){const H=se(St(n.touchedFields,Y),xe.argA,xe.argB);Pe&&nr(n.touchedFields,Y,H)}c.dirtyFields&&(n.dirtyFields=Sx(i,o)),d.state.next({name:Y,isDirty:$(Y,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else nr(o,Y,ne)},x=(Y,ne)=>{nr(n.errors,Y,ne),d.state.next({errors:n.errors})},_=Y=>{n.errors=Y,d.state.next({errors:n.errors,isValid:!1})},C=(Y,ne,se,xe)=>{const Pe=St(r,Y);if(Pe){const z=St(o,Y,zr(se)?St(i,Y):se);zr(z)||xe&&xe.defaultChecked||ne?nr(o,Y,ne?z:FT(Pe._f)):U(Y,z),s.mount&&b()}},S=(Y,ne,se,xe,Pe)=>{let z=!1,H=!1;const te={name:Y},le=!!(St(r,Y)&&St(r,Y)._f.disabled);if(!se||xe){c.isDirty&&(H=n.isDirty,n.isDirty=te.isDirty=$(),z=H!==te.isDirty);const de=le||ff(St(i,Y),ne);H=!!(!le&&St(n.dirtyFields,Y)),de||le?ni(n.dirtyFields,Y):nr(n.dirtyFields,Y,!0),te.dirtyFields=n.dirtyFields,z=z||c.dirtyFields&&H!==!de}if(se){const de=St(n.touchedFields,Y);de||(nr(n.touchedFields,Y,se),te.touchedFields=n.touchedFields,z=z||c.touchedFields&&de!==se)}return z&&Pe&&d.state.next(te),z?te:{}},M=(Y,ne,se,xe)=>{const Pe=St(n.errors,Y),z=c.isValid&&yu(ne)&&n.isValid!==ne;if(t.delayError&&se?(l=g(()=>x(Y,se)),l(t.delayError)):(clearTimeout(u),l=null,se?nr(n.errors,Y,se):ni(n.errors,Y)),(se?!ff(Pe,se):Pe)||!ms(xe)||z){const H={...xe,...z&&yu(ne)?{isValid:ne}:{},errors:n.errors,name:Y};n={...n,...H},d.state.next(H)}},P=async Y=>{m(Y,!0);const ne=await e.resolver(o,e.context,HMe(Y||a.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return m(Y),ne},A=async Y=>{const{errors:ne}=await P(Y);if(Y)for(const se of Y){const xe=St(ne,se);xe?nr(n.errors,se,xe):ni(n.errors,se)}else n.errors=ne;return ne},R=async(Y,ne,se={valid:!0})=>{for(const xe in Y){const Pe=Y[xe];if(Pe){const{_f:z,...H}=Pe;if(z){const te=a.array.has(z.name);m([xe],!0);const le=await $8(Pe,o,p,e.shouldUseNativeValidation&&!ne,te);if(m([xe]),le[z.name]&&(se.valid=!1,ne))break;!ne&&(St(le,z.name)?te?BMe(n.errors,le,z.name):nr(n.errors,z.name,le[z.name]):ni(n.errors,z.name))}H&&await R(H,ne,se)}}return se.valid},F=()=>{for(const Y of a.unMount){const ne=St(r,Y);ne&&(ne._f.refs?ne._f.refs.every(se=>!NT(se)):!NT(ne._f.ref))&&fe(Y)}a.unMount=new Set},$=(Y,ne)=>(Y&&ne&&nr(o,Y,ne),!ff(K(),i)),j=(Y,ne,se)=>kMe(Y,a,{...s.mount?o:zr(ne)?i:El(Y)?{[Y]:ne}:ne},se,ne),k=Y=>Eb(St(s.mount?o:i,Y,t.shouldUnregister?St(i,Y,[]):[])),U=(Y,ne,se={})=>{const xe=St(r,Y);let Pe=ne;if(xe){const z=xe._f;z&&(!z.disabled&&nr(o,Y,OW(ne,z)),Pe=vS(z.ref)&&xo(ne)?"":ne,IW(z.ref)?[...z.ref.options].forEach(H=>H.selected=Pe.includes(H.value)):z.refs?Cb(z.ref)?z.refs.length>1?z.refs.forEach(H=>(!H.defaultChecked||!H.disabled)&&(H.checked=Array.isArray(Pe)?!!Pe.find(te=>te===H.value):Pe===H.value)):z.refs[0]&&(z.refs[0].checked=!!Pe):z.refs.forEach(H=>H.checked=H.value===Pe):kN(z.ref)?z.ref.value="":(z.ref.value=Pe,z.ref.type||d.values.next({name:Y,values:{...o}})))}(se.shouldDirty||se.shouldTouch)&&S(Y,Pe,se.shouldTouch,se.shouldDirty,!0),se.shouldValidate&&W(Y)},G=(Y,ne,se)=>{for(const xe in ne){const Pe=ne[xe],z=`${Y}.${xe}`,H=St(r,z);(a.array.has(Y)||!bS(Pe)||H&&!H._f)&&!Jp(Pe)?G(z,Pe,se):U(z,Pe,se)}},B=(Y,ne,se={})=>{const xe=St(r,Y),Pe=a.array.has(Y),z=Ys(ne);nr(o,Y,z),Pe?(d.array.next({name:Y,values:{...o}}),(c.isDirty||c.dirtyFields)&&se.shouldDirty&&d.state.next({name:Y,dirtyFields:Sx(i,o),isDirty:$(Y,z)})):xe&&!xe._f&&!xo(z)?G(Y,z,se):U(Y,z,se),F8(Y,a)&&d.state.next({...n}),d.values.next({name:s.mount?Y:void 0,values:{...o}})},L=async Y=>{s.mount=!0;const ne=Y.target;let se=ne.name,xe=!0;const Pe=St(r,se),z=()=>ne.type?FT(Pe._f):PMe(Y),H=te=>{xe=Number.isNaN(te)||te===St(o,se,te)};if(Pe){let te,le;const de=z(),ue=Y.type===I8.BLUR||Y.type===I8.FOCUS_OUT,ge=!VMe(Pe._f)&&!e.resolver&&!St(n.errors,se)&&!Pe._f.deps||GMe(ue,St(n.touchedFields,se),n.isSubmitted,h,f),be=F8(se,a,ue);nr(o,se,de),ue?(Pe._f.onBlur&&Pe._f.onBlur(Y),l&&l(0)):Pe._f.onChange&&Pe._f.onChange(Y);const Te=S(se,de,ue,!1),Re=!ms(Te)||be;if(!ue&&d.values.next({name:se,type:Y.type,values:{...o}}),ge)return c.isValid&&b(),Re&&d.state.next({name:se,...be?{}:Te});if(!ue&&be&&d.state.next({...n}),e.resolver){const{errors:Ve}=await P([se]);if(H(de),xe){const Le=z8(n.errors,r,se),Ye=z8(Ve,r,Le.name||se);te=Ye.error,se=Ye.name,le=ms(Ve)}}else m([se],!0),te=(await $8(Pe,o,p,e.shouldUseNativeValidation))[se],m([se]),H(de),xe&&(te?le=!1:c.isValid&&(le=await R(r,!0)));xe&&(Pe._f.deps&&W(Pe._f.deps),M(se,le,te,Te))}},N=(Y,ne)=>{if(St(n.errors,ne)&&Y.focus)return Y.focus(),1},W=async(Y,ne={})=>{let se,xe;const Pe=RT(Y);if(e.resolver){const z=await A(zr(Y)?Y:Pe);se=ms(z),xe=Y?!Pe.some(H=>St(z,H)):se}else Y?(xe=(await Promise.all(Pe.map(async z=>{const H=St(r,z);return await R(H&&H._f?{[z]:H}:H)}))).every(Boolean),!(!xe&&!n.isValid)&&b()):xe=se=await R(r);return d.state.next({...!El(Y)||c.isValid&&se!==n.isValid?{}:{name:Y},...e.resolver||!Y?{isValid:se}:{},errors:n.errors}),ne.shouldFocus&&!xe&&wv(r,N,Y?Pe:a.mount),xe},K=Y=>{const ne={...s.mount?o:i};return zr(Y)?ne:El(Y)?St(ne,Y):Y.map(se=>St(ne,se))},Q=(Y,ne)=>({invalid:!!St((ne||n).errors,Y),isDirty:!!St((ne||n).dirtyFields,Y),isTouched:!!St((ne||n).touchedFields,Y),isValidating:!!St((ne||n).validatingFields,Y),error:St((ne||n).errors,Y)}),J=Y=>{Y&&RT(Y).forEach(ne=>ni(n.errors,ne)),d.state.next({errors:Y?n.errors:{}})},ae=(Y,ne,se)=>{const xe=(St(r,Y,{_f:{}})._f||{}).ref;nr(n.errors,Y,{...ne,ref:xe}),d.state.next({name:Y,errors:n.errors,isValid:!1}),se&&se.shouldFocus&&xe&&xe.focus&&xe.focus()},ve=(Y,ne)=>Uc(Y)?d.values.subscribe({next:se=>Y(j(void 0,ne),se)}):j(Y,ne,!0),fe=(Y,ne={})=>{for(const se of Y?RT(Y):a.mount)a.mount.delete(se),a.array.delete(se),ne.keepValue||(ni(r,se),ni(o,se)),!ne.keepError&&ni(n.errors,se),!ne.keepDirty&&ni(n.dirtyFields,se),!ne.keepTouched&&ni(n.touchedFields,se),!ne.keepIsValidating&&ni(n.validatingFields,se),!e.shouldUnregister&&!ne.keepDefaultValue&&ni(i,se);d.values.next({values:{...o}}),d.state.next({...n,...ne.keepDirty?{isDirty:$()}:{}}),!ne.keepIsValid&&b()},Me=({disabled:Y,name:ne,field:se,fields:xe,value:Pe})=>{if(yu(Y)){const z=Y?void 0:zr(Pe)?FT(se?se._f:St(xe,ne)._f):Pe;nr(o,ne,z),S(ne,z,!1,!1,!0)}},ye=(Y,ne={})=>{let se=St(r,Y);const xe=yu(ne.disabled);return nr(r,Y,{...se||{},_f:{...se&&se._f?se._f:{ref:{name:Y}},name:Y,mount:!0,...ne}}),a.mount.add(Y),se?Me({field:se,disabled:ne.disabled,name:Y,value:ne.value}):C(Y,!0,ne.value),{...xe?{disabled:ne.disabled}:{},...e.progressive?{required:!!ne.required,min:v0(ne.min),max:v0(ne.max),minLength:v0(ne.minLength),maxLength:v0(ne.maxLength),pattern:v0(ne.pattern)}:{},name:Y,onChange:L,onBlur:L,ref:Pe=>{if(Pe){ye(Y,ne),se=St(r,Y);const z=zr(Pe.value)&&Pe.querySelectorAll&&Pe.querySelectorAll("input,select,textarea")[0]||Pe,H=UMe(z),te=se._f.refs||[];if(H?te.find(le=>le===z):z===se._f.ref)return;nr(r,Y,{_f:{...se._f,...H?{refs:[...te.filter(NT),z,...Array.isArray(St(i,Y))?[{}]:[]],ref:{type:z.type,name:Y}}:{ref:z}}}),C(Y,!1,void 0,z)}else se=St(r,Y,{}),se._f&&(se._f.mount=!1),(e.shouldUnregister||ne.shouldUnregister)&&!(RMe(a.array,Y)&&s.action)&&a.unMount.add(Y)}}},we=()=>e.shouldFocusError&&wv(r,N,a.mount),Fe=Y=>{yu(Y)&&(d.state.next({disabled:Y}),wv(r,(ne,se)=>{let xe=Y;const Pe=St(r,se);Pe&&yu(Pe._f.disabled)&&(xe||(xe=Pe._f.disabled)),ne.disabled=xe},0,!1))},Oe=(Y,ne)=>async se=>{let xe;se&&(se.preventDefault&&se.preventDefault(),se.persist&&se.persist());let Pe=Ys(o);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:z,values:H}=await P();n.errors=z,Pe=H}else await R(r);if(ni(n.errors,"root"),ms(n.errors)){d.state.next({errors:{}});try{await Y(Pe,se)}catch(z){xe=z}}else ne&&await ne({...n.errors},se),we(),setTimeout(we);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ms(n.errors)&&!xe,submitCount:n.submitCount+1,errors:n.errors}),xe)throw xe},re=(Y,ne={})=>{St(r,Y)&&(zr(ne.defaultValue)?B(Y,Ys(St(i,Y))):(B(Y,ne.defaultValue),nr(i,Y,Ys(ne.defaultValue))),ne.keepTouched||ni(n.touchedFields,Y),ne.keepDirty||(ni(n.dirtyFields,Y),n.isDirty=ne.defaultValue?$(Y,Ys(St(i,Y))):$()),ne.keepError||(ni(n.errors,Y),c.isValid&&b()),d.state.next({...n}))},_e=(Y,ne={})=>{const se=Y?Ys(Y):i,xe=Ys(se),Pe=ms(Y),z=Pe?i:xe;if(ne.keepDefaultValues||(i=se),!ne.keepValues){if(ne.keepDirtyValues)for(const H of a.mount)St(n.dirtyFields,H)?nr(z,H,St(o,H)):B(H,St(z,H));else{if(FN&&zr(Y))for(const H of a.mount){const te=St(r,H);if(te&&te._f){const le=Array.isArray(te._f.refs)?te._f.refs[0]:te._f.ref;if(vS(le)){const de=le.closest("form");if(de){de.reset();break}}}}r={}}o=t.shouldUnregister?ne.keepDefaultValues?Ys(i):{}:Ys(z),d.array.next({values:{...z}}),d.values.next({values:{...z}})}a={mount:ne.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!c.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues,s.watch=!!t.shouldUnregister,d.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Pe?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!ff(Y,i)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Pe?[]:ne.keepDirtyValues?ne.keepDefaultValues&&o?Sx(i,o):n.dirtyFields:ne.keepDefaultValues&&Y?Sx(i,Y):{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ce=(Y,ne)=>_e(Uc(Y)?Y(o):Y,ne);return{control:{register:ye,unregister:fe,getFieldState:Q,handleSubmit:Oe,setError:ae,_executeSchema:P,_getWatch:j,_getDirty:$,_updateValid:b,_removeUnmounted:F,_updateFieldArray:w,_updateDisabledField:Me,_getFieldArray:k,_reset:_e,_resetDefaultValues:()=>Uc(e.defaultValues)&&e.defaultValues().then(Y=>{Ce(Y,e.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:Y=>{n={...n,...Y}},_disableForm:Fe,_subjects:d,_proxyFormState:c,_setErrors:_,get _fields(){return r},get _formValues(){return o},get _state(){return s},set _state(Y){s=Y},get _defaultValues(){return i},get _names(){return a},set _names(Y){a=Y},get _formState(){return n},set _formState(Y){n=Y},get _options(){return e},set _options(Y){e={...e,...Y}}},trigger:W,register:ye,handleSubmit:Oe,watch:ve,setValue:B,getValues:K,reset:Ce,resetField:re,clearErrors:J,unregister:fe,setError:ae,setFocus:(Y,ne={})=>{const se=St(r,Y),xe=se&&se._f;if(xe){const Pe=xe.refs?xe.refs[0]:xe.ref;Pe.focus&&(Pe.focus(),ne.shouldSelect&&Pe.select())}},getFieldState:Q}}function kW(t={}){const e=ie.useRef(),n=ie.useRef(),[r,i]=ie.useState({isDirty:!1,isValidating:!1,isLoading:Uc(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:Uc(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...qMe(t),formState:r});const o=e.current.control;return o._options=t,OMe({subject:o._subjects.state,next:s=>{FMe(s,o._proxyFormState,o._updateFormState)&&i({...o._formState})}}),ie.useEffect(()=>o._disableForm(t.disabled),[o,t.disabled]),ie.useEffect(()=>{if(o._proxyFormState.isDirty){const s=o._getDirty();s!==r.isDirty&&o._subjects.state.next({isDirty:s})}},[o,r.isDirty]),ie.useEffect(()=>{t.values&&!ff(t.values,n.current)?(o._reset(t.values,o._options.resetOptions),n.current=t.values,i(s=>({...s}))):o._resetDefaultValues()},[t.values,o]),ie.useEffect(()=>{t.errors&&o._setErrors(t.errors)},[t.errors,o]),ie.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),ie.useEffect(()=>{t.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[t.shouldUnregister,o]),e.current.formState=NMe(r,o),e.current}function XMe(t){const e=mg(),{register:n,reset:r,handleSubmit:i}=kW(),o=s=>{e.addNewDetector(s.name,_j(s.detector)),console.log(s),t.handleClose(),r()};return D.jsx(iG,{open:t.open,keepMounted:!0,onClose:t.handleClose,maxWidth:"xl",children:D.jsxs("form",{onSubmit:i(o),children:[D.jsxs(sG,{sx:{display:"flex",alignItems:"center"},children:[D.jsx(xn,{variant:"h5",children:" Detectors "}),D.jsx(io,{onClick:t.handleClose,sx:{ml:"auto"},children:D.jsx(NN,{})})]}),D.jsx(oG,{children:D.jsxs(kc,{container:!0,spacing:4,children:[D.jsx(kc,{item:!0,xs:12,sm:12,md:12,lg:8,children:D.jsx(CMe,{})}),D.jsx(kc,{item:!0,md:0,lg:1}),D.jsx(kc,{item:!0,xs:12,sm:12,md:12,lg:3,children:D.jsxs(cn,{spacing:1,width:"100%",children:[D.jsx(xn,{children:"Add new Detector:"}),D.jsx($n,{label:"name",...n("name",{required:!0}),variant:"outlined",size:"small"}),D.jsx(xn,{children:"Resolution:"}),D.jsx($n,{type:"number",label:"width",...n("detector.resolution.width",{required:!0}),size:"small",InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx($n,{type:"number",label:"height",...n("detector.resolution.height",{required:!0}),size:"small",InputProps:{endAdornment:D.jsx(si,{position:"end",children:"px"})}}),D.jsx(xn,{children:" Pixel Size:"}),D.jsx($n,{type:"number",label:"width",...n("detector.pixelSize.width",{required:!0}),size:"small",inputProps:{step:1e-6},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx($n,{type:"number",label:"height",...n("detector.pixelSize.height",{required:!0}),size:"small",inputProps:{step:1e-6},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx(Bf,{variant:"outlined",type:"submit",children:"Submit"})]})})]})})]})})}function KMe(t,e){return{name:t,cameraTubeDiameter:e.cameratubeDiameter,beamstopDiameter:e.beamstopDiameter,minWavelength:e.minWavelength.toNumber("nm"),maxWavelength:e.maxWavelength.toNumber("nm"),minCameraLength:e.minCameraLength.toNumber("m"),maxCameraLength:e.maxCameraLength.toNumber("m"),cameraLengthStep:e.cameraLengthStep.toNumber("m")}}function YMe(){const t=gg(),e=[];for(const[r,i]of Object.entries(t.beamlineRecord))e.push(KMe(r,i));const n=[{field:"name",headerName:"name",flex:1},{field:"beamstopDiameter",headerName:"Beamstop Diameter (mm)",flex:1},{field:"cameraTubeDiameter",headerName:"CameraTube Diameter (mm)",flex:1},{field:"minWavelength",headerName:"Min wavelength (nm)",flex:1},{field:"maxWavelength",headerName:"Max wavelength (nm)",flex:1},{field:"minCameraLength",headerName:"Min camera length (m)",flex:1},{field:"maxCameraLength",headerName:"Max camera length (m)",flex:1},{field:"cameraLengthStep",headerName:"Camera length step (m)",flex:1}];return D.jsx(MW,{autoHeight:!0,rows:e,getRowId:r=>r.name,columns:n,components:{Toolbar:cW},sx:{border:0},disableSelectionOnClick:!0})}const $d=1e-6;function ZMe(t){const e=gg(),{register:n,reset:r,handleSubmit:i}=kW(),o=s=>{e.addNewBeamline(s.name,Sj(s.beamline)),console.log(s),t.handleClose(),r()};return D.jsx(iG,{fullWidth:!0,maxWidth:"xl",open:t.open,keepMounted:!0,onClose:t.handleClose,children:D.jsxs("form",{onSubmit:i(o),children:[D.jsxs(sG,{sx:{display:"flex",alignItems:"center"},children:[D.jsx(xn,{variant:"h5",children:" Beamlines "}),D.jsx($l,{}),D.jsx(io,{onClick:t.handleClose,sx:{ml:"auto"},children:D.jsx(NN,{})})]}),D.jsx(oG,{children:D.jsxs(kc,{container:!0,spacing:4,children:[D.jsx(kc,{item:!0,xs:12,sm:12,md:12,lg:8,children:D.jsx(YMe,{})}),D.jsx(kc,{item:!0,md:0,lg:1}),D.jsx(kc,{item:!0,xs:12,sm:12,md:12,lg:3,children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{children:"Add New Beamline:"}),D.jsx($l,{}),D.jsx($n,{label:"name",...n("name",{required:!0}),variant:"outlined",size:"small"}),D.jsx($n,{type:"number",label:"min wavelength",...n("beamline.minWavelength",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"nm"})}}),D.jsx($n,{type:"number",label:"max wavelength ",variant:"outlined",size:"small",...n("beamline.maxWavelength",{required:!0}),inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"nm"})}}),D.jsx($n,{type:"number",label:"min camera length",...n("beamline.minCameraLength",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"m"})}}),D.jsx($n,{type:"number",label:"max camera length",variant:"outlined",size:"small",...n("beamline.maxCameraLength",{required:!0}),inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"m"})}}),D.jsx($n,{type:"number",label:"camera length step",...n("beamline.cameraLengthStep",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"m"})}}),D.jsx($n,{type:"number",label:"camera tube diameter",variant:"outlined",...n("beamline.cameratubeDiameter",{required:!0}),size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx($n,{type:"number",label:"beamstop diamter",...n("beamline.beamstopDiameter",{required:!0}),variant:"outlined",size:"small",inputProps:{step:$d},InputProps:{endAdornment:D.jsx(si,{position:"end",children:"mm"})}}),D.jsx(Bf,{type:"submit",variant:"outlined",children:"Submit"})]})})]})})]})})}function QMe(){const t=mg(),e=gE(),n=vE(),r=gg(),[i,o]=ie.useState(!1),s=()=>{o(!0)},a=()=>{o(!1)},[l,u]=ie.useState(!1),c=()=>{u(!0)},d=()=>{u(!1)},f=(h,p)=>{p&&(r.updateBeamline(p),e.updateDiameter(r.beamlineRecord[p].beamstopDiameter,bs.millimetre),n.updateDiameter(r.beamlineRecord[p].cameratubeDiameter,bs.millimetre))};return D.jsx(cn,{maxHeight:{lg:"91vh"},overflow:{lg:"scroll"},children:D.jsxs(cn,{spacing:1,children:[D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:"Beamline"}),D.jsx($l,{}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx(ly,{size:"small",options:Object.keys(r.beamlineRecord),value:r.beamlineName,sx:{width:300,color:"white"},renderInput:h=>D.jsx($n,{...h,label:"choose beamline",sx:{color:"white"}}),onChange:f}),D.jsx(Bf,{variant:"outlined",onClick:c,children:"Beamlines"}),D.jsx(ZMe,{open:l,handleClose:d,handleOpen:c})]})]})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:"Detector"}),D.jsx($l,{}),D.jsxs(cn,{direction:"row",spacing:1,children:[D.jsx(ly,{size:"small",options:Object.keys(t.detectorRecord),sx:{width:300},renderInput:h=>D.jsx($n,{...h,label:"choose detector"}),value:t.name,onChange:(h,p)=>{p&&t.updateDetector(p)}}),D.jsxs(Bf,{variant:"outlined",onClick:s,children:[" ","Detectors"]}),D.jsx(XMe,{open:i,handleClose:a,handleOpen:s})]}),D.jsxs(xn,{children:["Resolution (hxw):",t.detector.resolution.height," x"," ",t.detector.resolution.width]}),D.jsxs(cn,{direction:"row",alignItems:"center",children:[D.jsxs(xn,{flexGrow:2,children:["Pixel size:"," ",t.detector.pixelSize.height.toNumber().toFixed(2)," x ",t.detector.pixelSize.width.toNumber().toFixed(2)]}),D.jsxs(Ai,{children:[D.jsx(ca,{children:"units"}),D.jsxs(Ps,{size:"small",label:"units",value:t.detector.pixelSize.height.formatUnits(),onChange:h=>t.updatePixelUnits(h.target.value),children:[D.jsxs(wn,{value:bs.millimetre,children:[bs.millimetre," x ",bs.millimetre]}),D.jsxs(wn,{value:bs.micrometre,children:["μm"," x ","μm"]})]})]})]})]})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsx(_be,{})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsx(Sbe,{})}),D.jsx(xu,{sx:{p:2},variant:"outlined",children:D.jsx(Cbe,{})})]})})}function xs(t){const e=E.useRef(t);return e.current=t,E.useMemo(()=>Object.freeze({get current(){return e.current}}),[])}function BN(t){const e=xs(t);E.useEffect(()=>()=>{e.current()},[])}const ND=typeof window<"u"&&typeof navigator<"u"&&typeof document<"u";function JMe(t){const e=xs(t),n=E.useRef(0),r=E.useCallback(()=>{ND&&n.current&&(cancelAnimationFrame(n.current),n.current=0)},[]);return BN(r),[E.useMemo(()=>{const i=(...o)=>{ND&&(r(),n.current=requestAnimationFrame(()=>{e.current(...o),n.current=0}))};return Object.defineProperties(i,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__raf`}}),i},[]),r]}function e2e(t,e,n,r=!1){const i=E.useRef(),o=E.useRef();return BN(()=>{i.current&&(clearTimeout(i.current),i.current=void 0)}),E.useMemo(()=>{const s=(l,u)=>{o.current=void 0,t.apply(l,u),i.current=setTimeout(()=>{i.current=void 0,!r&&o.current&&(s(o.current.this,o.current.args),o.current=void 0)},n)},a=function(...l){if(i.current){o.current={args:l,this:this};return}s(this,l)};return Object.defineProperties(a,{length:{value:t.length},name:{value:`${t.name||"anonymous"}__throttled__${n}`}}),a},[n,r,...e])}function t2e(t,...e){var n;(n=t==null?void 0:t.addEventListener)==null||n.call(t,...e)}function n2e(t,...e){var n;(n=t==null?void 0:t.removeEventListener)==null||n.call(t,...e)}const r2e=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);function i2e(t=!1){const e=E.useRef(t),n=E.useCallback(()=>e.current,[]);return E.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),n}const o2e=t=>(t+1)%Number.MAX_SAFE_INTEGER;function s2e(){const[,t]=E.useState(0);return E.useCallback(()=>{t(o2e)},[])}function a2e(t,e){return typeof t=="function"?t(e):t}function U8(t){const e=E.useRef();return E.useEffect(()=>{e.current=t}),e.current}function l2e(t){const[e,n]=E.useState(t),[r,i]=JMe(n);return BN(i),[e,r]}function u2e(t=!1,e=!0){const[n,r]=E.useState(t),i=xs(e);return[n,E.useCallback(o=>{r(s=>o===void 0||i.current&&typeof o=="object"&&(o.constructor.name==="SyntheticBaseEvent"||typeof o._reactName=="string")?!s:!!a2e(o,s))},[])]}function Cf(t,...e){const n=i2e(),r=xs(e[1]),i=E.useMemo(()=>function(...o){n()&&(typeof r.current=="function"?r.current.apply(this,o):typeof r.current.handleEvent=="function"&&r.current.handleEvent.apply(this,o))},[]);E.useEffect(()=>{const o=c2e(t)?t.current:t;if(!o)return;const s=e.slice(2);return t2e(o,e[0],i,...s),()=>{n2e(o,e[0],i,...s)}},[t,e[0]])}function c2e(t){return t!==null&&typeof t=="object"&&r2e(t,"current")}const d2e=t=>e=>e.key===t,f2e=ND?window:null;function h2e(t,e,n=[],r={}){const{event:i="keydown",target:o=f2e,eventOptions:s}=r,a=xs(e),l=E.useMemo(()=>{const u=d2e(t);return function(c){u(c)&&a.current.call(this,c)}},n);Cf(o,i,l,s)}function i_(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function p2e(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function LW(t){let e,n,r;t.length!==2?(e=i_,n=(a,l)=>i_(t(a),l),r=(a,l)=>t(a)-l):(e=t===i_||t===p2e?t:m2e,n=t,r=t);function i(a,l,u=0,c=a.length){if(u>>1;n(a[d],l)<0?u=d+1:c=d}while(u>>1;n(a[d],l)<=0?u=d+1:c=d}while(uu&&r(a[d-1],l)>-r(a[d],l)?d-1:d}return{left:i,center:s,right:o}}function m2e(){return 0}function g2e(t){return t===null?NaN:+t}const v2e=LW(i_),y2e=v2e.right;LW(g2e).center;const b2e=Math.sqrt(50),x2e=Math.sqrt(10),w2e=Math.sqrt(2);function wS(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=b2e?10:o>=x2e?5:o>=w2e?2:1;let a,l,u;return i<0?(u=Math.pow(10,-i)/s,a=Math.round(t*u),l=Math.round(e*u),a/ue&&--l,u=-u):(u=Math.pow(10,i)*s,a=Math.round(t/u),l=Math.round(e/u),a*ue&&--l),l0))return[];if(t===e)return[t];const r=e=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let u=0;u=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function _S(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Km(t){return t=_S(Math.abs(t)),t?t[1]:NaN}function S2e(t,e){return function(n,r){for(var i=n.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(n.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(e)}}function C2e(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var E2e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function my(t){if(!(e=E2e.exec(t)))throw new Error("invalid format: "+t);var e;return new $N({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}my.prototype=$N.prototype;function $N(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}$N.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function M2e(t){e:for(var e=t.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var zW;function T2e(t,e){var n=_S(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(zW=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+_S(t,Math.max(0,e+o-1))[0]}function H8(t,e){var n=_S(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const V8={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:_2e,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>H8(t*100,e),r:H8,s:T2e,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function G8(t){return t}var j8=Array.prototype.map,W8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function A2e(t){var e=t.grouping===void 0||t.thousands===void 0?G8:S2e(j8.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?G8:C2e(j8.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(d){d=my(d);var f=d.fill,h=d.align,p=d.sign,g=d.symbol,b=d.zero,m=d.width,w=d.comma,x=d.precision,_=d.trim,C=d.type;C==="n"?(w=!0,C="g"):V8[C]||(x===void 0&&(x=12),_=!0,C="g"),(b||f==="0"&&h==="=")&&(b=!0,f="0",h="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",M=g==="$"?r:/[%p]/.test(C)?s:"",P=V8[C],A=/[defgprs%]/.test(C);x=x===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function R(F){var $=S,j=M,k,U,G;if(C==="c")j=P(F)+j,F="";else{F=+F;var B=F<0||1/F<0;if(F=isNaN(F)?l:P(Math.abs(F),x),_&&(F=M2e(F)),B&&+F==0&&p!=="+"&&(B=!1),$=(B?p==="("?p:a:p==="-"||p==="("?"":p)+$,j=(C==="s"?W8[8+zW/3]:"")+j+(B&&p==="("?")":""),A){for(k=-1,U=F.length;++kG||G>57){j=(G===46?i+F.slice(k+1):F.slice(k))+j,F=F.slice(0,k);break}}}w&&!b&&(F=e(F,1/0));var L=$.length+F.length+j.length,N=L>1)+$+F+j+N.slice(L);break;default:F=N+$+F+j;break}return o(F)}return R.toString=function(){return d+""},R}function c(d,f){var h=u((d=my(d),d.type="f",d)),p=Math.max(-8,Math.min(8,Math.floor(Km(f)/3)))*3,g=Math.pow(10,-p),b=W8[8+p/3];return function(m){return h(g*m)+b}}return{format:u,formatPrefix:c}}var Cx,Yl,UW;P2e({thousands:",",grouping:[3],currency:["$",""]});function P2e(t){return Cx=A2e(t),Yl=Cx.format,UW=Cx.formatPrefix,Cx}function D2e(t){return Math.max(0,-Km(Math.abs(t)))}function R2e(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Km(e)/3)))*3-Km(Math.abs(t)))}function I2e(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Km(e)-Km(t))+1}var N2e={};function F2e(t,e){for(var n=1,r=t.length,i=t[0],o=t[0],s=1;s0,s=[],a=[],l=0,u=0,c,d;for(c=0;c0&&s.push("var "+a.join(",")),c=r-1;c>=0;--c)l=t[c],s.push(["for(i",c,"=0;i",c,"0&&s.push(["index[",u,"]-=s",u].join("")),s.push(["++index[",l,"]"].join(""))),s.push("}")}return s.join(` `)}function $2e(t,e,n,r){for(var i=e.length,o=n.arrayArgs.length,s=n.blockSize,a=n.indexArgs.length>0,l=[],u=0;u0;){"].join("")),l.push(["if(j",u,"<",s,"){"].join("")),l.push(["s",e[u],"=j",u].join("")),l.push(["j",u,"=0"].join("")),l.push(["}else{s",e[u],"=",s].join("")),l.push(["j",u,"-=",s,"}"].join("")),a&&l.push(["index[",e[u],"]=j",u].join(""));for(var u=0;u>8&255]+Ji[t>>16&255]+Ji[t>>24&255]+"-"+Ji[e&255]+Ji[e>>8&255]+"-"+Ji[e>>16&15|64]+Ji[e>>24&255]+"-"+Ji[n&63|128]+Ji[n>>8&255]+"-"+Ji[n>>16&255]+Ji[n>>24&255]+Ji[r&255]+Ji[r>>8&255]+Ji[r>>16&255]+Ji[r>>24&255]).toLowerCase()}function Fr(t,e,n){return Math.max(e,Math.min(n,t))}function ZN(t,e){return(t%e+e)%e}function RTe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function ITe(t,e,n){return t!==e?(n-t)/(e-t):0}function Cv(t,e,n){return(1-n)*t+n*e}function NTe(t,e,n,r){return Cv(t,e,1-Math.exp(-n*r))}function FTe(t,e=1){return e-Math.abs(ZN(t,e*2)-e)}function OTe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function kTe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function LTe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function BTe(t,e){return t+Math.random()*(e-t)}function $Te(t){return t*(.5-Math.random())}function zTe(t){t!==void 0&&(q8=t);let e=q8+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function UTe(t){return t*Mf}function HTe(t){return t*Ym}function gR(t){return(t&t-1)===0&&t!==0}function Gq(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function TS(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function VTe(t,e,n,r,i){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),u=o((e+r)/2),c=s((e+r)/2),d=o((e-r)/2),f=s((e-r)/2),h=o((r-e)/2),p=s((r-e)/2);switch(i){case"XYX":t.set(a*c,l*d,l*f,a*u);break;case"YZY":t.set(l*f,a*c,l*d,a*u);break;case"ZXZ":t.set(l*d,l*f,a*c,a*u);break;case"XZX":t.set(a*c,l*p,l*h,a*u);break;case"YXY":t.set(l*h,a*c,l*p,a*u);break;case"ZYZ":t.set(l*p,l*h,a*c,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Vo(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function en(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const jq={DEG2RAD:Mf,RAD2DEG:Ym,generateUUID:Rs,clamp:Fr,euclideanModulo:ZN,mapLinear:RTe,inverseLerp:ITe,lerp:Cv,damp:NTe,pingpong:FTe,smoothstep:OTe,smootherstep:kTe,randInt:LTe,randFloat:BTe,randFloatSpread:$Te,seededRandom:zTe,degToRad:UTe,radToDeg:HTe,isPowerOfTwo:gR,ceilPowerOfTwo:Gq,floorPowerOfTwo:TS,setQuaternionFromProperEuler:VTe,normalize:en,denormalize:Vo};class Xe{constructor(e=0,n=0){Xe.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Fr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class nn{constructor(e,n,r,i,o,s,a,l,u){nn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,s,a,l,u)}set(e,n,r,i,o,s,a,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=a,c[3]=n,c[4]=o,c[5]=l,c[6]=r,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],u=r[1],c=r[4],d=r[7],f=r[2],h=r[5],p=r[8],g=i[0],b=i[3],m=i[6],w=i[1],x=i[4],_=i[7],C=i[2],S=i[5],M=i[8];return o[0]=s*g+a*w+l*C,o[3]=s*b+a*x+l*S,o[6]=s*m+a*_+l*M,o[1]=u*g+c*w+d*C,o[4]=u*b+c*x+d*S,o[7]=u*m+c*_+d*M,o[2]=f*g+h*w+p*C,o[5]=f*b+h*x+p*S,o[8]=f*m+h*_+p*M,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*a*u-r*o*c+r*a*l+i*o*u-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=c*s-a*u,f=a*l-c*o,h=u*o-s*l,p=n*d+r*f+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=d*g,e[1]=(i*u-c*r)*g,e[2]=(a*r-i*s)*g,e[3]=f*g,e[4]=(c*n-i*l)*g,e[5]=(i*o-a*n)*g,e[6]=h*g,e[7]=(r*l-u*n)*g,e[8]=(s*n-r*o)*g,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,s,a){const l=Math.cos(o),u=Math.sin(o);return this.set(r*l,r*u,-r*(l*s+u*a)+s+e,-i*u,i*l,-i*(-u*s+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(kT.makeScale(e,n)),this}rotate(e){return this.premultiply(kT.makeRotation(-e)),this}translate(e,n){return this.premultiply(kT.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const kT=new nn;function Wq(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const GTe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function em(t,e){return new GTe[t](e)}function Py(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function qq(){const t=Py("canvas");return t.style.display="block",t}const X8={};function Ev(t){t in X8||(X8[t]=!0,console.warn(t))}const K8=new nn().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Y8=new nn().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ex={[Ul]:{transfer:Cy,primaries:Ey,toReference:t=>t,fromReference:t=>t},[ai]:{transfer:Zn,primaries:Ey,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Ab]:{transfer:Cy,primaries:My,toReference:t=>t.applyMatrix3(Y8),fromReference:t=>t.applyMatrix3(K8)},[PE]:{transfer:Zn,primaries:My,toReference:t=>t.convertSRGBToLinear().applyMatrix3(Y8),fromReference:t=>t.applyMatrix3(K8).convertLinearToSRGB()}},jTe=new Set([Ul,Ab]),Bn={enabled:!0,_workingColorSpace:Ul,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!jTe.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const r=Ex[e].toReference,i=Ex[n].fromReference;return i(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Ex[t].primaries},getTransfer:function(t){return t===_s?Cy:Ex[t].transfer}};function wm(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function LT(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Vh;class QN{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Vh===void 0&&(Vh=Py("canvas")),Vh.width=e.width,Vh.height=e.height;const r=Vh.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=Vh}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Py("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let s=0;s0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Tb)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case by:e.x=e.x-Math.floor(e.x);break;case Ci:e.x=e.x<0?0:1;break;case xy:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case by:e.y=e.y-Math.floor(e.y);break;case Ci:e.y=e.y<0?0:1;break;case xy:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Ev("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===ai?Qc:YN}set encoding(e){Ev("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Qc?ai:_s}}Lr.DEFAULT_IMAGE=null;Lr.DEFAULT_MAPPING=Tb;Lr.DEFAULT_ANISOTROPY=1;class kn{constructor(e=0,n=0,r=0,i=1){kn.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,u=l[0],c=l[4],d=l[8],f=l[1],h=l[5],p=l[9],g=l[2],b=l[6],m=l[10];if(Math.abs(c-f)<.01&&Math.abs(d-g)<.01&&Math.abs(p-b)<.01){if(Math.abs(c+f)<.1&&Math.abs(d+g)<.1&&Math.abs(p+b)<.1&&Math.abs(u+h+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(u+1)/2,_=(h+1)/2,C=(m+1)/2,S=(c+f)/4,M=(d+g)/4,P=(p+b)/4;return x>_&&x>C?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=S/r,o=M/r):_>C?_<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(_),r=S/i,o=P/i):C<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(C),r=M/o,i=P/o),this.set(r,i,o,n),this}let w=Math.sqrt((b-p)*(b-p)+(d-g)*(d-g)+(f-c)*(f-c));return Math.abs(w)<.001&&(w=1),this.x=(b-p)/w,this.y=(d-g)/w,this.z=(f-c)/w,this.w=Math.acos((u+h+m-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Xq extends Yu{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new kn(0,0,e,n),this.scissorTest=!1,this.viewport=new kn(0,0,e,n);const i={width:e,height:n,depth:1};r.encoding!==void 0&&(Ev("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Qc?ai:_s),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Hr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new Lr(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new mf(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Qa extends Xq{constructor(e=1,n=1,r={}){super(e,n,r),this.isWebGLRenderTarget=!0}}class DE extends Lr{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Nr,this.minFilter=Nr,this.wrapR=Ci,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class XTe extends Qa{constructor(e=1,n=1,r=1){super(e,n),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new DE(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class JN extends Lr{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Nr,this.minFilter=Nr,this.wrapR=Ci,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class KTe extends Qa{constructor(e=1,n=1,r=1){super(e,n),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new JN(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class YTe extends Qa{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGLMultipleRenderTargets=!0;const o=this.texture;this.texture=[];for(let s=0;s=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const C=Math.sqrt(x),S=Math.atan2(C,m*w);b=Math.sin(b*S)/C,a=Math.sin(a*S)/C}const _=a*w;if(l=l*b+f*_,u=u*b+h*_,c=c*b+p*_,d=d*b+g*_,b===1-a){const C=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=C,u*=C,c*=C,d*=C}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],u=r[i+2],c=r[i+3],d=o[s],f=o[s+1],h=o[s+2],p=o[s+3];return e[n]=a*p+c*d+l*h-u*f,e[n+1]=l*p+c*f+u*d-a*h,e[n+2]=u*p+c*h+a*f-l*d,e[n+3]=c*p-a*d-l*f-u*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const r=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,u=a(r/2),c=a(i/2),d=a(o/2),f=l(r/2),h=l(i/2),p=l(o/2);switch(s){case"XYZ":this._x=f*c*d+u*h*p,this._y=u*h*d-f*c*p,this._z=u*c*p+f*h*d,this._w=u*c*d-f*h*p;break;case"YXZ":this._x=f*c*d+u*h*p,this._y=u*h*d-f*c*p,this._z=u*c*p-f*h*d,this._w=u*c*d+f*h*p;break;case"ZXY":this._x=f*c*d-u*h*p,this._y=u*h*d+f*c*p,this._z=u*c*p+f*h*d,this._w=u*c*d-f*h*p;break;case"ZYX":this._x=f*c*d-u*h*p,this._y=u*h*d+f*c*p,this._z=u*c*p-f*h*d,this._w=u*c*d+f*h*p;break;case"YZX":this._x=f*c*d+u*h*p,this._y=u*h*d+f*c*p,this._z=u*c*p-f*h*d,this._w=u*c*d-f*h*p;break;case"XZY":this._x=f*c*d-u*h*p,this._y=u*h*d-f*c*p,this._z=u*c*p+f*h*d,this._w=u*c*d+f*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],u=n[2],c=n[6],d=n[10],f=r+a+d;if(f>0){const h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(c-l)*h,this._y=(o-u)*h,this._z=(s-i)*h}else if(r>a&&r>d){const h=2*Math.sqrt(1+r-a-d);this._w=(c-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+u)/h}else if(a>d){const h=2*Math.sqrt(1+a-r-d);this._w=(o-u)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+c)/h}else{const h=2*Math.sqrt(1+d-r-a);this._w=(s-i)/h,this._x=(o+u)/h,this._y=(l+c)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Fr(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,s=e._w,a=n._x,l=n._y,u=n._z,c=n._w;return this._x=r*c+s*a+i*u-o*l,this._y=i*c+s*l+o*a-r*u,this._z=o*c+s*u+r*l-i*a,this._w=s*c-r*a-i*l-o*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),c=Math.atan2(u,a),d=Math.sin((1-n)*c)/u,f=Math.sin(n*c)/u;return this._w=s*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class oe{constructor(e=0,n=0,r=0){oe.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(Z8.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(Z8.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,u=2*(s*i-a*r),c=2*(a*n-o*i),d=2*(o*r-s*n);return this.x=n+l*u+s*d-a*c,this.y=r+l*c+a*u-o*d,this.z=i+l*d+o*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return $T.copy(this).projectOnVector(e),this.sub($T)}reflect(e){return this.sub($T.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Fr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const $T=new oe,Z8=new Yo;class wa{constructor(e=new oe(1/0,1/0,1/0),n=new oe(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ea),Ea.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(y0),Tx.subVectors(this.max,y0),Gh.subVectors(e.a,y0),jh.subVectors(e.b,y0),Wh.subVectors(e.c,y0),dc.subVectors(jh,Gh),fc.subVectors(Wh,jh),zd.subVectors(Gh,Wh);let n=[0,-dc.z,dc.y,0,-fc.z,fc.y,0,-zd.z,zd.y,dc.z,0,-dc.x,fc.z,0,-fc.x,zd.z,0,-zd.x,-dc.y,dc.x,0,-fc.y,fc.x,0,-zd.y,zd.x,0];return!zT(n,Gh,jh,Wh,Tx)||(n=[1,0,0,0,1,0,0,0,1],!zT(n,Gh,jh,Wh,Tx))?!1:(Ax.crossVectors(dc,fc),n=[Ax.x,Ax.y,Ax.z],zT(n,Gh,jh,Wh,Tx))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ea).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ea).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(au[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),au[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),au[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),au[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),au[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),au[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),au[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),au[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(au),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const au=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe],Ea=new oe,Mx=new wa,Gh=new oe,jh=new oe,Wh=new oe,dc=new oe,fc=new oe,zd=new oe,y0=new oe,Tx=new oe,Ax=new oe,Ud=new oe;function zT(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){Ud.fromArray(t,o);const a=i.x*Math.abs(Ud.x)+i.y*Math.abs(Ud.y)+i.z*Math.abs(Ud.z),l=e.dot(Ud),u=n.dot(Ud),c=r.dot(Ud);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>a)return!1}return!0}const ZTe=new wa,b0=new oe,UT=new oe;class el{constructor(e=new oe,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):ZTe.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;b0.subVectors(e,this.center);const n=b0.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(b0,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(UT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(b0.copy(e.center).add(UT)),this.expandByPoint(b0.copy(e.center).sub(UT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const lu=new oe,HT=new oe,Px=new oe,hc=new oe,VT=new oe,Dx=new oe,GT=new oe;let bg=class{constructor(e=new oe,n=new oe(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,lu)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=lu.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(lu.copy(this.origin).addScaledVector(this.direction,n),lu.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){HT.copy(e).add(n).multiplyScalar(.5),Px.copy(n).sub(e).normalize(),hc.copy(this.origin).sub(HT);const o=e.distanceTo(n)*.5,s=-this.direction.dot(Px),a=hc.dot(this.direction),l=-hc.dot(Px),u=hc.lengthSq(),c=Math.abs(1-s*s);let d,f,h,p;if(c>0)if(d=s*l-a,f=s*a-l,p=o*c,d>=0)if(f>=-p)if(f<=p){const g=1/c;d*=g,f*=g,h=d*(d+s*f+2*a)+f*(s*d+f+2*l)+u}else f=o,d=Math.max(0,-(s*f+a)),h=-d*d+f*(f+2*l)+u;else f=-o,d=Math.max(0,-(s*f+a)),h=-d*d+f*(f+2*l)+u;else f<=-p?(d=Math.max(0,-(-s*o+a)),f=d>0?-o:Math.min(Math.max(-o,-l),o),h=-d*d+f*(f+2*l)+u):f<=p?(d=0,f=Math.min(Math.max(-o,-l),o),h=f*(f+2*l)+u):(d=Math.max(0,-(s*o+a)),f=d>0?o:Math.min(Math.max(-o,-l),o),h=-d*d+f*(f+2*l)+u);else f=s>0?-o:o,d=Math.max(0,-(s*f+a)),h=-d*d+f*(f+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(HT).addScaledVector(Px,f),h}intersectSphere(e,n){lu.subVectors(e.center,this.origin);const r=lu.dot(this.direction),i=lu.dot(lu)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,s,a,l;const u=1/this.direction.x,c=1/this.direction.y,d=1/this.direction.z,f=this.origin;return u>=0?(r=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(r=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(o=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(o=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),r>s||o>i||((o>r||isNaN(r))&&(r=o),(s=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,lu)!==null}intersectTriangle(e,n,r,i,o){VT.subVectors(n,e),Dx.subVectors(r,e),GT.crossVectors(VT,Dx);let s=this.direction.dot(GT),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;hc.subVectors(this.origin,e);const l=a*this.direction.dot(Dx.crossVectors(hc,Dx));if(l<0)return null;const u=a*this.direction.dot(VT.cross(hc));if(u<0||l+u>s)return null;const c=-a*hc.dot(GT);return c<0?null:this.at(c/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class qt{constructor(e,n,r,i,o,s,a,l,u,c,d,f,h,p,g,b){qt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,s,a,l,u,c,d,f,h,p,g,b)}set(e,n,r,i,o,s,a,l,u,c,d,f,h,p,g,b){const m=this.elements;return m[0]=e,m[4]=n,m[8]=r,m[12]=i,m[1]=o,m[5]=s,m[9]=a,m[13]=l,m[2]=u,m[6]=c,m[10]=d,m[14]=f,m[3]=h,m[7]=p,m[11]=g,m[15]=b,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new qt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/qh.setFromMatrixColumn(e,0).length(),o=1/qh.setFromMatrixColumn(e,1).length(),s=1/qh.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=s*c,h=s*d,p=a*c,g=a*d;n[0]=l*c,n[4]=-l*d,n[8]=u,n[1]=h+p*u,n[5]=f-g*u,n[9]=-a*l,n[2]=g-f*u,n[6]=p+h*u,n[10]=s*l}else if(e.order==="YXZ"){const f=l*c,h=l*d,p=u*c,g=u*d;n[0]=f+g*a,n[4]=p*a-h,n[8]=s*u,n[1]=s*d,n[5]=s*c,n[9]=-a,n[2]=h*a-p,n[6]=g+f*a,n[10]=s*l}else if(e.order==="ZXY"){const f=l*c,h=l*d,p=u*c,g=u*d;n[0]=f-g*a,n[4]=-s*d,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*c,n[9]=g-f*a,n[2]=-s*u,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const f=s*c,h=s*d,p=a*c,g=a*d;n[0]=l*c,n[4]=p*u-h,n[8]=f*u+g,n[1]=l*d,n[5]=g*u+f,n[9]=h*u-p,n[2]=-u,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const f=s*l,h=s*u,p=a*l,g=a*u;n[0]=l*c,n[4]=g-f*d,n[8]=p*d+h,n[1]=d,n[5]=s*c,n[9]=-a*c,n[2]=-u*c,n[6]=h*d+p,n[10]=f-g*d}else if(e.order==="XZY"){const f=s*l,h=s*u,p=a*l,g=a*u;n[0]=l*c,n[4]=-d,n[8]=u*c,n[1]=f*d+g,n[5]=s*c,n[9]=h*d-p,n[2]=p*d-h,n[6]=a*c,n[10]=g*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(QTe,e,JTe)}lookAt(e,n,r){const i=this.elements;return ds.subVectors(e,n),ds.lengthSq()===0&&(ds.z=1),ds.normalize(),pc.crossVectors(r,ds),pc.lengthSq()===0&&(Math.abs(r.z)===1?ds.x+=1e-4:ds.z+=1e-4,ds.normalize(),pc.crossVectors(r,ds)),pc.normalize(),Rx.crossVectors(ds,pc),i[0]=pc.x,i[4]=Rx.x,i[8]=ds.x,i[1]=pc.y,i[5]=Rx.y,i[9]=ds.y,i[2]=pc.z,i[6]=Rx.z,i[10]=ds.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],u=r[12],c=r[1],d=r[5],f=r[9],h=r[13],p=r[2],g=r[6],b=r[10],m=r[14],w=r[3],x=r[7],_=r[11],C=r[15],S=i[0],M=i[4],P=i[8],A=i[12],R=i[1],F=i[5],$=i[9],j=i[13],k=i[2],U=i[6],G=i[10],B=i[14],L=i[3],N=i[7],W=i[11],K=i[15];return o[0]=s*S+a*R+l*k+u*L,o[4]=s*M+a*F+l*U+u*N,o[8]=s*P+a*$+l*G+u*W,o[12]=s*A+a*j+l*B+u*K,o[1]=c*S+d*R+f*k+h*L,o[5]=c*M+d*F+f*U+h*N,o[9]=c*P+d*$+f*G+h*W,o[13]=c*A+d*j+f*B+h*K,o[2]=p*S+g*R+b*k+m*L,o[6]=p*M+g*F+b*U+m*N,o[10]=p*P+g*$+b*G+m*W,o[14]=p*A+g*j+b*B+m*K,o[3]=w*S+x*R+_*k+C*L,o[7]=w*M+x*F+_*U+C*N,o[11]=w*P+x*$+_*G+C*W,o[15]=w*A+x*j+_*B+C*K,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],u=e[13],c=e[2],d=e[6],f=e[10],h=e[14],p=e[3],g=e[7],b=e[11],m=e[15];return p*(+o*l*d-i*u*d-o*a*f+r*u*f+i*a*h-r*l*h)+g*(+n*l*h-n*u*f+o*s*f-i*s*h+i*u*c-o*l*c)+b*(+n*u*d-n*a*h-o*s*d+r*s*h+o*a*c-r*u*c)+m*(-i*a*c-n*l*d+n*a*f+i*s*d-r*s*f+r*l*c)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],h=e[11],p=e[12],g=e[13],b=e[14],m=e[15],w=d*b*u-g*f*u+g*l*h-a*b*h-d*l*m+a*f*m,x=p*f*u-c*b*u-p*l*h+s*b*h+c*l*m-s*f*m,_=c*g*u-p*d*u+p*a*h-s*g*h-c*a*m+s*d*m,C=p*d*l-c*g*l-p*a*f+s*g*f+c*a*b-s*d*b,S=n*w+r*x+i*_+o*C;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/S;return e[0]=w*M,e[1]=(g*f*o-d*b*o-g*i*h+r*b*h+d*i*m-r*f*m)*M,e[2]=(a*b*o-g*l*o+g*i*u-r*b*u-a*i*m+r*l*m)*M,e[3]=(d*l*o-a*f*o-d*i*u+r*f*u+a*i*h-r*l*h)*M,e[4]=x*M,e[5]=(c*b*o-p*f*o+p*i*h-n*b*h-c*i*m+n*f*m)*M,e[6]=(p*l*o-s*b*o-p*i*u+n*b*u+s*i*m-n*l*m)*M,e[7]=(s*f*o-c*l*o+c*i*u-n*f*u-s*i*h+n*l*h)*M,e[8]=_*M,e[9]=(p*d*o-c*g*o-p*r*h+n*g*h+c*r*m-n*d*m)*M,e[10]=(s*g*o-p*a*o+p*r*u-n*g*u-s*r*m+n*a*m)*M,e[11]=(c*a*o-s*d*o-c*r*u+n*d*u+s*r*h-n*a*h)*M,e[12]=C*M,e[13]=(c*g*i-p*d*i+p*r*f-n*g*f-c*r*b+n*d*b)*M,e[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*b-n*a*b)*M,e[15]=(s*d*i-c*a*i+c*r*l-n*d*l-s*r*f+n*a*f)*M,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=e.x,a=e.y,l=e.z,u=o*s,c=o*a;return this.set(u*s+r,u*a-i*l,u*l+i*a,0,u*a+i*l,c*a+r,c*l-i*s,0,u*l-i*a,c*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,u=o+o,c=s+s,d=a+a,f=o*u,h=o*c,p=o*d,g=s*c,b=s*d,m=a*d,w=l*u,x=l*c,_=l*d,C=r.x,S=r.y,M=r.z;return i[0]=(1-(g+m))*C,i[1]=(h+_)*C,i[2]=(p-x)*C,i[3]=0,i[4]=(h-_)*S,i[5]=(1-(f+m))*S,i[6]=(b+w)*S,i[7]=0,i[8]=(p+x)*M,i[9]=(b-w)*M,i[10]=(1-(f+g))*M,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=qh.set(i[0],i[1],i[2]).length();const s=qh.set(i[4],i[5],i[6]).length(),a=qh.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],Ma.copy(this);const u=1/o,c=1/s,d=1/a;return Ma.elements[0]*=u,Ma.elements[1]*=u,Ma.elements[2]*=u,Ma.elements[4]*=c,Ma.elements[5]*=c,Ma.elements[6]*=c,Ma.elements[8]*=d,Ma.elements[9]*=d,Ma.elements[10]*=d,n.setFromRotationMatrix(Ma),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s,a=Tl){const l=this.elements,u=2*o/(n-e),c=2*o/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let h,p;if(a===Tl)h=-(s+o)/(s-o),p=-2*s*o/(s-o);else if(a===Ay)h=-s/(s-o),p=-s*o/(s-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=h,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,s,a=Tl){const l=this.elements,u=1/(n-e),c=1/(r-i),d=1/(s-o),f=(n+e)*u,h=(r+i)*c;let p,g;if(a===Tl)p=(s+o)*d,g=-2*d;else if(a===Ay)p=o*d,g=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-h,l[2]=0,l[6]=0,l[10]=g,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const qh=new oe,Ma=new qt,QTe=new oe(0,0,0),JTe=new oe(1,1,1),pc=new oe,Rx=new oe,ds=new oe,Q8=new qt,J8=new Yo;class Pb{constructor(e=0,n=0,r=0,i=Pb.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],u=i[5],c=i[9],d=i[2],f=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Fr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Fr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(Fr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Fr(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Fr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Fr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return Q8.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Q8,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return J8.setFromEuler(this),this.setFromQuaternion(J8,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Pb.DEFAULT_ORDER="XYZ";class Tf{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(r=r.concat(s))}return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(x0,e,tAe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(x0,nAe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let r=0,i=n.length;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON()));function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(a){const l=[];for(const u in a){const c=a[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){Ta.subVectors(i,n),cu.subVectors(r,n),jT.subVectors(e,n);const s=Ta.dot(Ta),a=Ta.dot(cu),l=Ta.dot(jT),u=cu.dot(cu),c=cu.dot(jT),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const f=1/d,h=(u*l-a*c)*f,p=(s*c-a*l)*f;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,du),du.x>=0&&du.y>=0&&du.x+du.y<=1}static getUV(e,n,r,i,o,s,a,l){return Nx===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Nx=!0),this.getInterpolation(e,n,r,i,o,s,a,l)}static getInterpolation(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,du),l.setScalar(0),l.addScaledVector(o,du.x),l.addScaledVector(s,du.y),l.addScaledVector(a,du.z),l}static isFrontFacing(e,n,r,i){return Ta.subVectors(r,n),cu.subVectors(e,n),Ta.cross(cu).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ta.subVectors(this.c,this.b),cu.subVectors(this.a,this.b),Ta.cross(cu).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Uo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Uo.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Nx===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Nx=!0),Uo.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}getInterpolation(e,n,r,i,o){return Uo.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Uo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Uo.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let s,a;Kh.subVectors(i,r),Yh.subVectors(o,r),WT.subVectors(e,r);const l=Kh.dot(WT),u=Yh.dot(WT);if(l<=0&&u<=0)return n.copy(r);qT.subVectors(e,i);const c=Kh.dot(qT),d=Yh.dot(qT);if(c>=0&&d<=c)return n.copy(i);const f=l*d-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),n.copy(r).addScaledVector(Kh,s);XT.subVectors(e,o);const h=Kh.dot(XT),p=Yh.dot(XT);if(p>=0&&h<=p)return n.copy(o);const g=h*u-l*p;if(g<=0&&u>=0&&p<=0)return a=u/(u-p),n.copy(r).addScaledVector(Yh,a);const b=c*p-h*d;if(b<=0&&d-c>=0&&h-p>=0)return i6.subVectors(o,i),a=(d-c)/(d-c+(h-p)),n.copy(i).addScaledVector(i6,a);const m=1/(b+g+f);return s=g*m,a=f*m,n.copy(r).addScaledVector(Kh,s).addScaledVector(Yh,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Kq={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},mc={h:0,s:0,l:0},Fx={h:0,s:0,l:0};function KT(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let vt=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ai){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Bn.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Bn.workingColorSpace){return this.r=e,this.g=n,this.b=r,Bn.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Bn.workingColorSpace){if(e=ZN(e,1),n=Fr(n,0,1),r=Fr(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=KT(s,o,e+1/3),this.g=KT(s,o,e),this.b=KT(s,o,e-1/3)}return Bn.toWorkingColorSpace(this,i),this}setStyle(e,n=ai){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],s=o.length;if(s===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ai){const r=Kq[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=wm(e.r),this.g=wm(e.g),this.b=wm(e.b),this}copyLinearToSRGB(e){return this.r=LT(e.r),this.g=LT(e.g),this.b=LT(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ai){return Bn.fromWorkingColorSpace(eo.copy(this),e),Math.round(Fr(eo.r*255,0,255))*65536+Math.round(Fr(eo.g*255,0,255))*256+Math.round(Fr(eo.b*255,0,255))}getHexString(e=ai){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Bn.workingColorSpace){Bn.fromWorkingColorSpace(eo.copy(this),n);const r=eo.r,i=eo.g,o=eo.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,u;const c=(a+s)/2;if(a===s)l=0,u=0;else{const d=s-a;switch(u=c<=.5?d/(s+a):d/(2-s-a),s){case r:l=(i-o)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Ef&&(r.blending=this.blending),this.side!==Uu&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==SS&&(r.blendSrc=this.blendSrc),this.blendDst!==CS&&(r.blendDst=this.blendDst),this.blendEquation!==Nc&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==gy&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==pR&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ef&&(r.stencilFail=this.stencilFail),this.stencilZFail!==ef&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==ef&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};class Cd extends ji{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const _u=sAe();function sAe(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,c=0;for(;!(u&8388608);)u<<=1,c-=8388608;u&=-8388609,c+=947912704,o[l]=u|c}for(let l=1024;l<2048;++l)o[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:o,exponentTable:s,offsetTable:a}}function ko(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Fr(t,-65504,65504),_u.floatView[0]=t;const e=_u.uint32View[0],n=e>>23&511;return _u.baseTable[n]+((e&8388607)>>_u.shiftTable[n])}function Y0(t){const e=t>>10;return _u.uint32View[0]=_u.mantissaTable[_u.offsetTable[e]+(t&1023)]+_u.exponentTable[e],_u.floatView[0]}const aAe={toHalfFloat:ko,fromHalfFloat:Y0},Kr=new oe,Ox=new Xe;class Xn{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=Ty,this.updateRange={offset:0,count:-1},this.gpuType=Ua,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let d=0,f=u.length;d0&&(i[l]=c,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(n))}const o=e.morphAttributes;for(const u in o){const c=[],d=o[u];for(let f=0,h=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o(e.far-e.near)**2))&&(o6.copy(o).invert(),Hd.copy(e.ray).applyMatrix4(o6),!(r.boundingBox!==null&&Hd.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Hd)))}_computeIntersections(e,n,r){let i;const o=this.geometry,s=this.material,a=o.index,l=o.attributes.position,u=o.attributes.uv,c=o.attributes.uv1,d=o.attributes.normal,f=o.groups,h=o.drawRange;if(a!==null)if(Array.isArray(s))for(let p=0,g=f.length;pn.far?null:{distance:u,point:Hx.clone(),object:t}}function Vx(t,e,n,r,i,o,s,a,l,u){t.getVertexPosition(a,Qh),t.getVertexPosition(l,Jh),t.getVertexPosition(u,ep);const c=gAe(t,e,n,r,Qh,Jh,ep,Ux);if(c){i&&(Bx.fromBufferAttribute(i,a),$x.fromBufferAttribute(i,l),zx.fromBufferAttribute(i,u),c.uv=Uo.getInterpolation(Ux,Qh,Jh,ep,Bx,$x,zx,new Xe)),o&&(Bx.fromBufferAttribute(o,a),$x.fromBufferAttribute(o,l),zx.fromBufferAttribute(o,u),c.uv1=Uo.getInterpolation(Ux,Qh,Jh,ep,Bx,$x,zx,new Xe),c.uv2=c.uv1),s&&(a6.fromBufferAttribute(s,a),l6.fromBufferAttribute(s,l),u6.fromBufferAttribute(s,u),c.normal=Uo.getInterpolation(Ux,Qh,Jh,ep,a6,l6,u6,new oe),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const d={a,b:l,c:u,normal:new oe,materialIndex:0};Uo.getNormal(Qh,Jh,ep,d.normal),c.face=d}return c}class ih extends rn{constructor(e=1,n=1,r=1,i=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:s};const a=this;i=Math.floor(i),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],c=[],d=[];let f=0,h=0;p("z","y","x",-1,-1,r,n,e,s,o,0),p("z","y","x",1,-1,r,n,-e,s,o,1),p("x","z","y",1,1,e,r,n,i,s,2),p("x","z","y",1,-1,e,r,-n,i,s,3),p("x","y","z",1,-1,e,n,r,i,o,4),p("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Ct(u,3)),this.setAttribute("normal",new Ct(c,3)),this.setAttribute("uv",new Ct(d,2));function p(g,b,m,w,x,_,C,S,M,P,A){const R=_/M,F=C/P,$=_/2,j=C/2,k=S/2,U=M+1,G=P+1;let B=0,L=0;const N=new oe;for(let W=0;W0?1:-1,c.push(N.x,N.y,N.z),d.push(Q/M),d.push(1-W/P),B+=1}}for(let W=0;W>8&255]+Ji[t>>16&255]+Ji[t>>24&255]+"-"+Ji[e&255]+Ji[e>>8&255]+"-"+Ji[e>>16&15|64]+Ji[e>>24&255]+"-"+Ji[n&63|128]+Ji[n>>8&255]+"-"+Ji[n>>16&255]+Ji[n>>24&255]+Ji[r&255]+Ji[r>>8&255]+Ji[r>>16&255]+Ji[r>>24&255]).toLowerCase()}function Fr(t,e,n){return Math.max(e,Math.min(n,t))}function ZN(t,e){return(t%e+e)%e}function RTe(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)}function ITe(t,e,n){return t!==e?(n-t)/(e-t):0}function Cv(t,e,n){return(1-n)*t+n*e}function NTe(t,e,n,r){return Cv(t,e,1-Math.exp(-n*r))}function FTe(t,e=1){return e-Math.abs(ZN(t,e*2)-e)}function OTe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function kTe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function LTe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function BTe(t,e){return t+Math.random()*(e-t)}function $Te(t){return t*(.5-Math.random())}function zTe(t){t!==void 0&&(q8=t);let e=q8+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function UTe(t){return t*Mf}function HTe(t){return t*Ym}function gR(t){return(t&t-1)===0&&t!==0}function Gq(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function TS(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function VTe(t,e,n,r,i){const o=Math.cos,s=Math.sin,a=o(n/2),l=s(n/2),u=o((e+r)/2),c=s((e+r)/2),d=o((e-r)/2),f=s((e-r)/2),h=o((r-e)/2),p=s((r-e)/2);switch(i){case"XYX":t.set(a*c,l*d,l*f,a*u);break;case"YZY":t.set(l*f,a*c,l*d,a*u);break;case"ZXZ":t.set(l*d,l*f,a*c,a*u);break;case"XZX":t.set(a*c,l*p,l*h,a*u);break;case"YXY":t.set(l*h,a*c,l*p,a*u);break;case"ZYZ":t.set(l*p,l*h,a*c,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Vo(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function en(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const jq={DEG2RAD:Mf,RAD2DEG:Ym,generateUUID:Rs,clamp:Fr,euclideanModulo:ZN,mapLinear:RTe,inverseLerp:ITe,lerp:Cv,damp:NTe,pingpong:FTe,smoothstep:OTe,smootherstep:kTe,randInt:LTe,randFloat:BTe,randFloatSpread:$Te,seededRandom:zTe,degToRad:UTe,radToDeg:HTe,isPowerOfTwo:gR,ceilPowerOfTwo:Gq,floorPowerOfTwo:TS,setQuaternionFromProperEuler:VTe,normalize:en,denormalize:Vo};class Xe{constructor(e=0,n=0){Xe.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,r=this.y,i=e.elements;return this.x=i[0]*n+i[3]*r+i[6],this.y=i[1]*n+i[4]*r+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Fr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const r=Math.cos(n),i=Math.sin(n),o=this.x-e.x,s=this.y-e.y;return this.x=o*r-s*i+e.x,this.y=o*i+s*r+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class nn{constructor(e,n,r,i,o,s,a,l,u){nn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,s,a,l,u)}set(e,n,r,i,o,s,a,l,u){const c=this.elements;return c[0]=e,c[1]=i,c[2]=a,c[3]=n,c[4]=o,c[5]=l,c[6]=r,c[7]=s,c[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],this}extractBasis(e,n,r){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[3],l=r[6],u=r[1],c=r[4],d=r[7],f=r[2],h=r[5],p=r[8],g=i[0],b=i[3],m=i[6],w=i[1],x=i[4],_=i[7],C=i[2],S=i[5],M=i[8];return o[0]=s*g+a*w+l*C,o[3]=s*b+a*x+l*S,o[6]=s*m+a*_+l*M,o[1]=u*g+c*w+d*C,o[4]=u*b+c*x+d*S,o[7]=u*m+c*_+d*M,o[2]=f*g+h*w+p*C,o[5]=f*b+h*x+p*S,o[8]=f*m+h*_+p*M,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8];return n*s*c-n*a*u-r*o*c+r*a*l+i*o*u-i*s*l}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=c*s-a*u,f=a*l-c*o,h=u*o-s*l,p=n*d+r*f+i*h;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return e[0]=d*g,e[1]=(i*u-c*r)*g,e[2]=(a*r-i*s)*g,e[3]=f*g,e[4]=(c*n-i*l)*g,e[5]=(i*o-a*n)*g,e[6]=h*g,e[7]=(r*l-u*n)*g,e[8]=(s*n-r*o)*g,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,r,i,o,s,a){const l=Math.cos(o),u=Math.sin(o);return this.set(r*l,r*u,-r*(l*s+u*a)+s+e,-i*u,i*l,-i*(-u*s+l*a)+a+n,0,0,1),this}scale(e,n){return this.premultiply(kT.makeScale(e,n)),this}rotate(e){return this.premultiply(kT.makeRotation(-e)),this}translate(e,n){return this.premultiply(kT.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,r,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<9;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<9;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const kT=new nn;function Wq(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const GTe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function em(t,e){return new GTe[t](e)}function Py(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function qq(){const t=Py("canvas");return t.style.display="block",t}const X8={};function Ev(t){t in X8||(X8[t]=!0,console.warn(t))}const K8=new nn().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Y8=new nn().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Ex={[Ul]:{transfer:Cy,primaries:Ey,toReference:t=>t,fromReference:t=>t},[ai]:{transfer:Zn,primaries:Ey,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[Ab]:{transfer:Cy,primaries:My,toReference:t=>t.applyMatrix3(Y8),fromReference:t=>t.applyMatrix3(K8)},[PE]:{transfer:Zn,primaries:My,toReference:t=>t.convertSRGBToLinear().applyMatrix3(Y8),fromReference:t=>t.applyMatrix3(K8).convertLinearToSRGB()}},jTe=new Set([Ul,Ab]),Bn={enabled:!0,_workingColorSpace:Ul,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!jTe.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(this.enabled===!1||e===n||!e||!n)return t;const r=Ex[e].toReference,i=Ex[n].fromReference;return i(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return Ex[t].primaries},getTransfer:function(t){return t===_s?Cy:Ex[t].transfer}};function wm(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function LT(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let Vh;class QN{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{Vh===void 0&&(Vh=Py("canvas")),Vh.width=e.width,Vh.height=e.height;const r=Vh.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=Vh}return n.width>2048||n.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),n.toDataURL("image/jpeg",.6)):n.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=Py("canvas");n.width=e.width,n.height=e.height;const r=n.getContext("2d");r.drawImage(e,0,0,e.width,e.height);const i=r.getImageData(0,0,e.width,e.height),o=i.data;for(let s=0;s0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Tb)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case by:e.x=e.x-Math.floor(e.x);break;case Ci:e.x=e.x<0?0:1;break;case xy:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case by:e.y=e.y-Math.floor(e.y);break;case Ci:e.y=e.y<0?0:1;break;case xy:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Ev("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===ai?Qc:YN}set encoding(e){Ev("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===Qc?ai:_s}}Lr.DEFAULT_IMAGE=null;Lr.DEFAULT_MAPPING=Tb;Lr.DEFAULT_ANISOTROPY=1;class kn{constructor(e=0,n=0,r=0,i=1){kn.prototype.isVector4=!0,this.x=e,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,r,i){return this.x=e,this.y=n,this.z=r,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*n+s[4]*r+s[8]*i+s[12]*o,this.y=s[1]*n+s[5]*r+s[9]*i+s[13]*o,this.z=s[2]*n+s[6]*r+s[10]*i+s[14]*o,this.w=s[3]*n+s[7]*r+s[11]*i+s[15]*o,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,r,i,o;const l=e.elements,u=l[0],c=l[4],d=l[8],f=l[1],h=l[5],p=l[9],g=l[2],b=l[6],m=l[10];if(Math.abs(c-f)<.01&&Math.abs(d-g)<.01&&Math.abs(p-b)<.01){if(Math.abs(c+f)<.1&&Math.abs(d+g)<.1&&Math.abs(p+b)<.1&&Math.abs(u+h+m-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const x=(u+1)/2,_=(h+1)/2,C=(m+1)/2,S=(c+f)/4,M=(d+g)/4,P=(p+b)/4;return x>_&&x>C?x<.01?(r=0,i=.707106781,o=.707106781):(r=Math.sqrt(x),i=S/r,o=M/r):_>C?_<.01?(r=.707106781,i=0,o=.707106781):(i=Math.sqrt(_),r=S/i,o=P/i):C<.01?(r=.707106781,i=.707106781,o=0):(o=Math.sqrt(C),r=M/o,i=P/o),this.set(r,i,o,n),this}let w=Math.sqrt((b-p)*(b-p)+(d-g)*(d-g)+(f-c)*(f-c));return Math.abs(w)<.001&&(w=1),this.x=(b-p)/w,this.y=(d-g)/w,this.z=(f-c)/w,this.w=Math.acos((u+h+m-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this.w=Math.max(e.w,Math.min(n.w,this.w)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this.w=Math.max(e,Math.min(n,this.w)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this.w=e.w+(n.w-e.w)*r,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Xq extends Yu{constructor(e=1,n=1,r={}){super(),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=1,this.scissor=new kn(0,0,e,n),this.scissorTest=!1,this.viewport=new kn(0,0,e,n);const i={width:e,height:n,depth:1};r.encoding!==void 0&&(Ev("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Qc?ai:_s),r=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Hr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},r),this.texture=new Lr(i,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps,this.texture.internalFormat=r.internalFormat,this.depthBuffer=r.depthBuffer,this.stencilBuffer=r.stencilBuffer,this.depthTexture=r.depthTexture,this.samples=r.samples}setSize(e,n,r=1){(this.width!==e||this.height!==n||this.depth!==r)&&(this.width=e,this.height=n,this.depth=r,this.texture.image.width=e,this.texture.image.height=n,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const n=Object.assign({},e.texture.image);return this.texture.source=new mf(n),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Za extends Xq{constructor(e=1,n=1,r={}){super(e,n,r),this.isWebGLRenderTarget=!0}}class DE extends Lr{constructor(e=null,n=1,r=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Nr,this.minFilter=Nr,this.wrapR=Ci,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class XTe extends Za{constructor(e=1,n=1,r=1){super(e,n),this.isWebGLArrayRenderTarget=!0,this.depth=r,this.texture=new DE(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class JN extends Lr{constructor(e=null,n=1,r=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:r,depth:i},this.magFilter=Nr,this.minFilter=Nr,this.wrapR=Ci,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class KTe extends Za{constructor(e=1,n=1,r=1){super(e,n),this.isWebGL3DRenderTarget=!0,this.depth=r,this.texture=new JN(null,e,n,r),this.texture.isRenderTargetTexture=!0}}class YTe extends Za{constructor(e=1,n=1,r=1,i={}){super(e,n,i),this.isWebGLMultipleRenderTargets=!0;const o=this.texture;this.texture=[];for(let s=0;s=0?1:-1,x=1-m*m;if(x>Number.EPSILON){const C=Math.sqrt(x),S=Math.atan2(C,m*w);b=Math.sin(b*S)/C,a=Math.sin(a*S)/C}const _=a*w;if(l=l*b+f*_,u=u*b+h*_,c=c*b+p*_,d=d*b+g*_,b===1-a){const C=1/Math.sqrt(l*l+u*u+c*c+d*d);l*=C,u*=C,c*=C,d*=C}}e[n]=l,e[n+1]=u,e[n+2]=c,e[n+3]=d}static multiplyQuaternionsFlat(e,n,r,i,o,s){const a=r[i],l=r[i+1],u=r[i+2],c=r[i+3],d=o[s],f=o[s+1],h=o[s+2],p=o[s+3];return e[n]=a*p+c*d+l*h-u*f,e[n+1]=l*p+c*f+u*d-a*h,e[n+2]=u*p+c*h+a*f-l*d,e[n+3]=c*p-a*d-l*f-u*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,r,i){return this._x=e,this._y=n,this._z=r,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n){const r=e._x,i=e._y,o=e._z,s=e._order,a=Math.cos,l=Math.sin,u=a(r/2),c=a(i/2),d=a(o/2),f=l(r/2),h=l(i/2),p=l(o/2);switch(s){case"XYZ":this._x=f*c*d+u*h*p,this._y=u*h*d-f*c*p,this._z=u*c*p+f*h*d,this._w=u*c*d-f*h*p;break;case"YXZ":this._x=f*c*d+u*h*p,this._y=u*h*d-f*c*p,this._z=u*c*p-f*h*d,this._w=u*c*d+f*h*p;break;case"ZXY":this._x=f*c*d-u*h*p,this._y=u*h*d+f*c*p,this._z=u*c*p+f*h*d,this._w=u*c*d-f*h*p;break;case"ZYX":this._x=f*c*d-u*h*p,this._y=u*h*d+f*c*p,this._z=u*c*p-f*h*d,this._w=u*c*d+f*h*p;break;case"YZX":this._x=f*c*d+u*h*p,this._y=u*h*d+f*c*p,this._z=u*c*p-f*h*d,this._w=u*c*d-f*h*p;break;case"XZY":this._x=f*c*d-u*h*p,this._y=u*h*d-f*c*p,this._z=u*c*p+f*h*d,this._w=u*c*d+f*h*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return n!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const r=n/2,i=Math.sin(r);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,r=n[0],i=n[4],o=n[8],s=n[1],a=n[5],l=n[9],u=n[2],c=n[6],d=n[10],f=r+a+d;if(f>0){const h=.5/Math.sqrt(f+1);this._w=.25/h,this._x=(c-l)*h,this._y=(o-u)*h,this._z=(s-i)*h}else if(r>a&&r>d){const h=2*Math.sqrt(1+r-a-d);this._w=(c-l)/h,this._x=.25*h,this._y=(i+s)/h,this._z=(o+u)/h}else if(a>d){const h=2*Math.sqrt(1+a-r-d);this._w=(o-u)/h,this._x=(i+s)/h,this._y=.25*h,this._z=(l+c)/h}else{const h=2*Math.sqrt(1+d-r-a);this._w=(s-i)/h,this._x=(o+u)/h,this._y=(l+c)/h,this._z=.25*h}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let r=e.dot(n)+1;return rMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=r):(this._x=0,this._y=-e.z,this._z=e.y,this._w=r)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=r),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Fr(this.dot(e),-1,1)))}rotateTowards(e,n){const r=this.angleTo(e);if(r===0)return this;const i=Math.min(1,n/r);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const r=e._x,i=e._y,o=e._z,s=e._w,a=n._x,l=n._y,u=n._z,c=n._w;return this._x=r*c+s*a+i*u-o*l,this._y=i*c+s*l+o*a-r*u,this._z=o*c+s*u+r*l-i*a,this._w=s*c-r*a-i*l-o*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const r=this._x,i=this._y,o=this._z,s=this._w;let a=s*e._w+r*e._x+i*e._y+o*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=r,this._y=i,this._z=o,this;const l=1-a*a;if(l<=Number.EPSILON){const h=1-n;return this._w=h*s+n*this._w,this._x=h*r+n*this._x,this._y=h*i+n*this._y,this._z=h*o+n*this._z,this.normalize(),this._onChangeCallback(),this}const u=Math.sqrt(l),c=Math.atan2(u,a),d=Math.sin((1-n)*c)/u,f=Math.sin(n*c)/u;return this._w=s*d+this._w*f,this._x=r*d+this._x*f,this._y=i*d+this._y*f,this._z=o*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(e,n,r){return this.copy(e).slerp(n,r)}random(){const e=Math.random(),n=Math.sqrt(1-e),r=Math.sqrt(e),i=2*Math.PI*Math.random(),o=2*Math.PI*Math.random();return this.set(n*Math.cos(i),r*Math.sin(o),r*Math.cos(o),n*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class oe{constructor(e=0,n=0,r=0){oe.prototype.isVector3=!0,this.x=e,this.y=n,this.z=r}set(e,n,r){return r===void 0&&(r=this.z),this.x=e,this.y=n,this.z=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(Z8.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(Z8.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[3]*r+o[6]*i,this.y=o[1]*n+o[4]*r+o[7]*i,this.z=o[2]*n+o[5]*r+o[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,r=this.y,i=this.z,o=e.elements,s=1/(o[3]*n+o[7]*r+o[11]*i+o[15]);return this.x=(o[0]*n+o[4]*r+o[8]*i+o[12])*s,this.y=(o[1]*n+o[5]*r+o[9]*i+o[13])*s,this.z=(o[2]*n+o[6]*r+o[10]*i+o[14])*s,this}applyQuaternion(e){const n=this.x,r=this.y,i=this.z,o=e.x,s=e.y,a=e.z,l=e.w,u=2*(s*i-a*r),c=2*(a*n-o*i),d=2*(o*r-s*n);return this.x=n+l*u+s*d-a*c,this.y=r+l*c+a*u-o*d,this.z=i+l*d+o*c-s*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,r=this.y,i=this.z,o=e.elements;return this.x=o[0]*n+o[4]*r+o[8]*i,this.y=o[1]*n+o[5]*r+o[9]*i,this.z=o[2]*n+o[6]*r+o[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=Math.max(e.x,Math.min(n.x,this.x)),this.y=Math.max(e.y,Math.min(n.y,this.y)),this.z=Math.max(e.z,Math.min(n.z,this.z)),this}clampScalar(e,n){return this.x=Math.max(e,Math.min(n,this.x)),this.y=Math.max(e,Math.min(n,this.y)),this.z=Math.max(e,Math.min(n,this.z)),this}clampLength(e,n){const r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(n,r)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,r){return this.x=e.x+(n.x-e.x)*r,this.y=e.y+(n.y-e.y)*r,this.z=e.z+(n.z-e.z)*r,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const r=e.x,i=e.y,o=e.z,s=n.x,a=n.y,l=n.z;return this.x=i*l-o*a,this.y=o*s-r*l,this.z=r*a-i*s,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const r=e.dot(this)/n;return this.copy(e).multiplyScalar(r)}projectOnPlane(e){return $T.copy(this).projectOnVector(e),this.sub($T)}reflect(e){return this.sub($T.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const r=this.dot(e)/n;return Math.acos(Fr(r,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y,i=this.z-e.z;return n*n+r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,r){const i=Math.sin(n)*e;return this.x=i*Math.sin(r),this.y=Math.cos(n)*e,this.z=i*Math.cos(r),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,r){return this.x=e*Math.sin(n),this.y=r,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=r,this.z=i,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,n=Math.random()*Math.PI*2,r=Math.sqrt(1-e**2);return this.x=r*Math.cos(n),this.y=r*Math.sin(n),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const $T=new oe,Z8=new Yo;class xa{constructor(e=new oe(1/0,1/0,1/0),n=new oe(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,r=e.length;nthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ca),Ca.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,r;return e.normal.x>0?(n=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),n<=-e.constant&&r>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(y0),Tx.subVectors(this.max,y0),Gh.subVectors(e.a,y0),jh.subVectors(e.b,y0),Wh.subVectors(e.c,y0),dc.subVectors(jh,Gh),fc.subVectors(Wh,jh),zd.subVectors(Gh,Wh);let n=[0,-dc.z,dc.y,0,-fc.z,fc.y,0,-zd.z,zd.y,dc.z,0,-dc.x,fc.z,0,-fc.x,zd.z,0,-zd.x,-dc.y,dc.x,0,-fc.y,fc.x,0,-zd.y,zd.x,0];return!zT(n,Gh,jh,Wh,Tx)||(n=[1,0,0,0,1,0,0,0,1],!zT(n,Gh,jh,Wh,Tx))?!1:(Ax.crossVectors(dc,fc),n=[Ax.x,Ax.y,Ax.z],zT(n,Gh,jh,Wh,Tx))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ca).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ca).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(au[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),au[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),au[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),au[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),au[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),au[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),au[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),au[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(au),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const au=[new oe,new oe,new oe,new oe,new oe,new oe,new oe,new oe],Ca=new oe,Mx=new xa,Gh=new oe,jh=new oe,Wh=new oe,dc=new oe,fc=new oe,zd=new oe,y0=new oe,Tx=new oe,Ax=new oe,Ud=new oe;function zT(t,e,n,r,i){for(let o=0,s=t.length-3;o<=s;o+=3){Ud.fromArray(t,o);const a=i.x*Math.abs(Ud.x)+i.y*Math.abs(Ud.y)+i.z*Math.abs(Ud.z),l=e.dot(Ud),u=n.dot(Ud),c=r.dot(Ud);if(Math.max(-Math.max(l,u,c),Math.min(l,u,c))>a)return!1}return!0}const ZTe=new xa,b0=new oe,UT=new oe;class Ja{constructor(e=new oe,n=-1){this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const r=this.center;n!==void 0?r.copy(n):ZTe.setFromPoints(e).getCenter(r);let i=0;for(let o=0,s=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;b0.subVectors(e,this.center);const n=b0.lengthSq();if(n>this.radius*this.radius){const r=Math.sqrt(n),i=(r-this.radius)*.5;this.center.addScaledVector(b0,i/r),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(UT.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(b0.copy(e.center).add(UT)),this.expandByPoint(b0.copy(e.center).sub(UT))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const lu=new oe,HT=new oe,Px=new oe,hc=new oe,VT=new oe,Dx=new oe,GT=new oe;let bg=class{constructor(e=new oe,n=new oe(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,lu)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const r=n.dot(this.direction);return r<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,r)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=lu.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(lu.copy(this.origin).addScaledVector(this.direction,n),lu.distanceToSquared(e))}distanceSqToSegment(e,n,r,i){HT.copy(e).add(n).multiplyScalar(.5),Px.copy(n).sub(e).normalize(),hc.copy(this.origin).sub(HT);const o=e.distanceTo(n)*.5,s=-this.direction.dot(Px),a=hc.dot(this.direction),l=-hc.dot(Px),u=hc.lengthSq(),c=Math.abs(1-s*s);let d,f,h,p;if(c>0)if(d=s*l-a,f=s*a-l,p=o*c,d>=0)if(f>=-p)if(f<=p){const g=1/c;d*=g,f*=g,h=d*(d+s*f+2*a)+f*(s*d+f+2*l)+u}else f=o,d=Math.max(0,-(s*f+a)),h=-d*d+f*(f+2*l)+u;else f=-o,d=Math.max(0,-(s*f+a)),h=-d*d+f*(f+2*l)+u;else f<=-p?(d=Math.max(0,-(-s*o+a)),f=d>0?-o:Math.min(Math.max(-o,-l),o),h=-d*d+f*(f+2*l)+u):f<=p?(d=0,f=Math.min(Math.max(-o,-l),o),h=f*(f+2*l)+u):(d=Math.max(0,-(s*o+a)),f=d>0?o:Math.min(Math.max(-o,-l),o),h=-d*d+f*(f+2*l)+u);else f=s>0?-o:o,d=Math.max(0,-(s*f+a)),h=-d*d+f*(f+2*l)+u;return r&&r.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(HT).addScaledVector(Px,f),h}intersectSphere(e,n){lu.subVectors(e.center,this.origin);const r=lu.dot(this.direction),i=lu.dot(lu)-r*r,o=e.radius*e.radius;if(i>o)return null;const s=Math.sqrt(o-i),a=r-s,l=r+s;return l<0?null:a<0?this.at(l,n):this.at(a,n)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const r=-(this.origin.dot(e.normal)+e.constant)/n;return r>=0?r:null}intersectPlane(e,n){const r=this.distanceToPlane(e);return r===null?null:this.at(r,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let r,i,o,s,a,l;const u=1/this.direction.x,c=1/this.direction.y,d=1/this.direction.z,f=this.origin;return u>=0?(r=(e.min.x-f.x)*u,i=(e.max.x-f.x)*u):(r=(e.max.x-f.x)*u,i=(e.min.x-f.x)*u),c>=0?(o=(e.min.y-f.y)*c,s=(e.max.y-f.y)*c):(o=(e.max.y-f.y)*c,s=(e.min.y-f.y)*c),r>s||o>i||((o>r||isNaN(r))&&(r=o),(s=0?(a=(e.min.z-f.z)*d,l=(e.max.z-f.z)*d):(a=(e.max.z-f.z)*d,l=(e.min.z-f.z)*d),r>l||a>i)||((a>r||r!==r)&&(r=a),(l=0?r:i,n)}intersectsBox(e){return this.intersectBox(e,lu)!==null}intersectTriangle(e,n,r,i,o){VT.subVectors(n,e),Dx.subVectors(r,e),GT.crossVectors(VT,Dx);let s=this.direction.dot(GT),a;if(s>0){if(i)return null;a=1}else if(s<0)a=-1,s=-s;else return null;hc.subVectors(this.origin,e);const l=a*this.direction.dot(Dx.crossVectors(hc,Dx));if(l<0)return null;const u=a*this.direction.dot(VT.cross(hc));if(u<0||l+u>s)return null;const c=-a*hc.dot(GT);return c<0?null:this.at(c/s,o)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}};class qt{constructor(e,n,r,i,o,s,a,l,u,c,d,f,h,p,g,b){qt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,r,i,o,s,a,l,u,c,d,f,h,p,g,b)}set(e,n,r,i,o,s,a,l,u,c,d,f,h,p,g,b){const m=this.elements;return m[0]=e,m[4]=n,m[8]=r,m[12]=i,m[1]=o,m[5]=s,m[9]=a,m[13]=l,m[2]=u,m[6]=c,m[10]=d,m[14]=f,m[3]=h,m[7]=p,m[11]=g,m[15]=b,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new qt().fromArray(this.elements)}copy(e){const n=this.elements,r=e.elements;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n[4]=r[4],n[5]=r[5],n[6]=r[6],n[7]=r[7],n[8]=r[8],n[9]=r[9],n[10]=r[10],n[11]=r[11],n[12]=r[12],n[13]=r[13],n[14]=r[14],n[15]=r[15],this}copyPosition(e){const n=this.elements,r=e.elements;return n[12]=r[12],n[13]=r[13],n[14]=r[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,r){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(e,n,r){return this.set(e.x,n.x,r.x,0,e.y,n.y,r.y,0,e.z,n.z,r.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,r=e.elements,i=1/qh.setFromMatrixColumn(e,0).length(),o=1/qh.setFromMatrixColumn(e,1).length(),s=1/qh.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[3]=0,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[7]=0,n[8]=r[8]*s,n[9]=r[9]*s,n[10]=r[10]*s,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,r=e.x,i=e.y,o=e.z,s=Math.cos(r),a=Math.sin(r),l=Math.cos(i),u=Math.sin(i),c=Math.cos(o),d=Math.sin(o);if(e.order==="XYZ"){const f=s*c,h=s*d,p=a*c,g=a*d;n[0]=l*c,n[4]=-l*d,n[8]=u,n[1]=h+p*u,n[5]=f-g*u,n[9]=-a*l,n[2]=g-f*u,n[6]=p+h*u,n[10]=s*l}else if(e.order==="YXZ"){const f=l*c,h=l*d,p=u*c,g=u*d;n[0]=f+g*a,n[4]=p*a-h,n[8]=s*u,n[1]=s*d,n[5]=s*c,n[9]=-a,n[2]=h*a-p,n[6]=g+f*a,n[10]=s*l}else if(e.order==="ZXY"){const f=l*c,h=l*d,p=u*c,g=u*d;n[0]=f-g*a,n[4]=-s*d,n[8]=p+h*a,n[1]=h+p*a,n[5]=s*c,n[9]=g-f*a,n[2]=-s*u,n[6]=a,n[10]=s*l}else if(e.order==="ZYX"){const f=s*c,h=s*d,p=a*c,g=a*d;n[0]=l*c,n[4]=p*u-h,n[8]=f*u+g,n[1]=l*d,n[5]=g*u+f,n[9]=h*u-p,n[2]=-u,n[6]=a*l,n[10]=s*l}else if(e.order==="YZX"){const f=s*l,h=s*u,p=a*l,g=a*u;n[0]=l*c,n[4]=g-f*d,n[8]=p*d+h,n[1]=d,n[5]=s*c,n[9]=-a*c,n[2]=-u*c,n[6]=h*d+p,n[10]=f-g*d}else if(e.order==="XZY"){const f=s*l,h=s*u,p=a*l,g=a*u;n[0]=l*c,n[4]=-d,n[8]=u*c,n[1]=f*d+g,n[5]=s*c,n[9]=h*d-p,n[2]=p*d-h,n[6]=a*c,n[10]=g*d+f}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(QTe,e,JTe)}lookAt(e,n,r){const i=this.elements;return ds.subVectors(e,n),ds.lengthSq()===0&&(ds.z=1),ds.normalize(),pc.crossVectors(r,ds),pc.lengthSq()===0&&(Math.abs(r.z)===1?ds.x+=1e-4:ds.z+=1e-4,ds.normalize(),pc.crossVectors(r,ds)),pc.normalize(),Rx.crossVectors(ds,pc),i[0]=pc.x,i[4]=Rx.x,i[8]=ds.x,i[1]=pc.y,i[5]=Rx.y,i[9]=ds.y,i[2]=pc.z,i[6]=Rx.z,i[10]=ds.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const r=e.elements,i=n.elements,o=this.elements,s=r[0],a=r[4],l=r[8],u=r[12],c=r[1],d=r[5],f=r[9],h=r[13],p=r[2],g=r[6],b=r[10],m=r[14],w=r[3],x=r[7],_=r[11],C=r[15],S=i[0],M=i[4],P=i[8],A=i[12],R=i[1],F=i[5],$=i[9],j=i[13],k=i[2],U=i[6],G=i[10],B=i[14],L=i[3],N=i[7],W=i[11],K=i[15];return o[0]=s*S+a*R+l*k+u*L,o[4]=s*M+a*F+l*U+u*N,o[8]=s*P+a*$+l*G+u*W,o[12]=s*A+a*j+l*B+u*K,o[1]=c*S+d*R+f*k+h*L,o[5]=c*M+d*F+f*U+h*N,o[9]=c*P+d*$+f*G+h*W,o[13]=c*A+d*j+f*B+h*K,o[2]=p*S+g*R+b*k+m*L,o[6]=p*M+g*F+b*U+m*N,o[10]=p*P+g*$+b*G+m*W,o[14]=p*A+g*j+b*B+m*K,o[3]=w*S+x*R+_*k+C*L,o[7]=w*M+x*F+_*U+C*N,o[11]=w*P+x*$+_*G+C*W,o[15]=w*A+x*j+_*B+C*K,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],r=e[4],i=e[8],o=e[12],s=e[1],a=e[5],l=e[9],u=e[13],c=e[2],d=e[6],f=e[10],h=e[14],p=e[3],g=e[7],b=e[11],m=e[15];return p*(+o*l*d-i*u*d-o*a*f+r*u*f+i*a*h-r*l*h)+g*(+n*l*h-n*u*f+o*s*f-i*s*h+i*u*c-o*l*c)+b*(+n*u*d-n*a*h-o*s*d+r*s*h+o*a*c-r*u*c)+m*(-i*a*c-n*l*d+n*a*f+i*s*d-r*s*f+r*l*c)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,r){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=n,i[14]=r),this}invert(){const e=this.elements,n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],a=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],h=e[11],p=e[12],g=e[13],b=e[14],m=e[15],w=d*b*u-g*f*u+g*l*h-a*b*h-d*l*m+a*f*m,x=p*f*u-c*b*u-p*l*h+s*b*h+c*l*m-s*f*m,_=c*g*u-p*d*u+p*a*h-s*g*h-c*a*m+s*d*m,C=p*d*l-c*g*l-p*a*f+s*g*f+c*a*b-s*d*b,S=n*w+r*x+i*_+o*C;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/S;return e[0]=w*M,e[1]=(g*f*o-d*b*o-g*i*h+r*b*h+d*i*m-r*f*m)*M,e[2]=(a*b*o-g*l*o+g*i*u-r*b*u-a*i*m+r*l*m)*M,e[3]=(d*l*o-a*f*o-d*i*u+r*f*u+a*i*h-r*l*h)*M,e[4]=x*M,e[5]=(c*b*o-p*f*o+p*i*h-n*b*h-c*i*m+n*f*m)*M,e[6]=(p*l*o-s*b*o-p*i*u+n*b*u+s*i*m-n*l*m)*M,e[7]=(s*f*o-c*l*o+c*i*u-n*f*u-s*i*h+n*l*h)*M,e[8]=_*M,e[9]=(p*d*o-c*g*o-p*r*h+n*g*h+c*r*m-n*d*m)*M,e[10]=(s*g*o-p*a*o+p*r*u-n*g*u-s*r*m+n*a*m)*M,e[11]=(c*a*o-s*d*o-c*r*u+n*d*u+s*r*h-n*a*h)*M,e[12]=C*M,e[13]=(c*g*i-p*d*i+p*r*f-n*g*f-c*r*b+n*d*b)*M,e[14]=(p*a*i-s*g*i-p*r*l+n*g*l+s*r*b-n*a*b)*M,e[15]=(s*d*i-c*a*i+c*r*l-n*d*l-s*r*f+n*a*f)*M,this}scale(e){const n=this.elements,r=e.x,i=e.y,o=e.z;return n[0]*=r,n[4]*=i,n[8]*=o,n[1]*=r,n[5]*=i,n[9]*=o,n[2]*=r,n[6]*=i,n[10]*=o,n[3]*=r,n[7]*=i,n[11]*=o,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,r,i))}makeTranslation(e,n,r){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,r,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,n,-r,0,0,r,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,0,r,0,0,1,0,0,-r,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),r=Math.sin(e);return this.set(n,-r,0,0,r,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const r=Math.cos(n),i=Math.sin(n),o=1-r,s=e.x,a=e.y,l=e.z,u=o*s,c=o*a;return this.set(u*s+r,u*a-i*l,u*l+i*a,0,u*a+i*l,c*a+r,c*l-i*s,0,u*l-i*a,c*l+i*s,o*l*l+r,0,0,0,0,1),this}makeScale(e,n,r){return this.set(e,0,0,0,0,n,0,0,0,0,r,0,0,0,0,1),this}makeShear(e,n,r,i,o,s){return this.set(1,r,o,0,e,1,s,0,n,i,1,0,0,0,0,1),this}compose(e,n,r){const i=this.elements,o=n._x,s=n._y,a=n._z,l=n._w,u=o+o,c=s+s,d=a+a,f=o*u,h=o*c,p=o*d,g=s*c,b=s*d,m=a*d,w=l*u,x=l*c,_=l*d,C=r.x,S=r.y,M=r.z;return i[0]=(1-(g+m))*C,i[1]=(h+_)*C,i[2]=(p-x)*C,i[3]=0,i[4]=(h-_)*S,i[5]=(1-(f+m))*S,i[6]=(b+w)*S,i[7]=0,i[8]=(p+x)*M,i[9]=(b-w)*M,i[10]=(1-(f+g))*M,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,n,r){const i=this.elements;let o=qh.set(i[0],i[1],i[2]).length();const s=qh.set(i[4],i[5],i[6]).length(),a=qh.set(i[8],i[9],i[10]).length();this.determinant()<0&&(o=-o),e.x=i[12],e.y=i[13],e.z=i[14],Ea.copy(this);const u=1/o,c=1/s,d=1/a;return Ea.elements[0]*=u,Ea.elements[1]*=u,Ea.elements[2]*=u,Ea.elements[4]*=c,Ea.elements[5]*=c,Ea.elements[6]*=c,Ea.elements[8]*=d,Ea.elements[9]*=d,Ea.elements[10]*=d,n.setFromRotationMatrix(Ea),r.x=o,r.y=s,r.z=a,this}makePerspective(e,n,r,i,o,s,a=Ml){const l=this.elements,u=2*o/(n-e),c=2*o/(r-i),d=(n+e)/(n-e),f=(r+i)/(r-i);let h,p;if(a===Ml)h=-(s+o)/(s-o),p=-2*s*o/(s-o);else if(a===Ay)h=-s/(s-o),p=-s*o/(s-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=c,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=h,l[14]=p,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,n,r,i,o,s,a=Ml){const l=this.elements,u=1/(n-e),c=1/(r-i),d=1/(s-o),f=(n+e)*u,h=(r+i)*c;let p,g;if(a===Ml)p=(s+o)*d,g=-2*d;else if(a===Ay)p=o*d,g=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*u,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*c,l[9]=0,l[13]=-h,l[2]=0,l[6]=0,l[10]=g,l[14]=-p,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const n=this.elements,r=e.elements;for(let i=0;i<16;i++)if(n[i]!==r[i])return!1;return!0}fromArray(e,n=0){for(let r=0;r<16;r++)this.elements[r]=e[r+n];return this}toArray(e=[],n=0){const r=this.elements;return e[n]=r[0],e[n+1]=r[1],e[n+2]=r[2],e[n+3]=r[3],e[n+4]=r[4],e[n+5]=r[5],e[n+6]=r[6],e[n+7]=r[7],e[n+8]=r[8],e[n+9]=r[9],e[n+10]=r[10],e[n+11]=r[11],e[n+12]=r[12],e[n+13]=r[13],e[n+14]=r[14],e[n+15]=r[15],e}}const qh=new oe,Ea=new qt,QTe=new oe(0,0,0),JTe=new oe(1,1,1),pc=new oe,Rx=new oe,ds=new oe,Q8=new qt,J8=new Yo;class Pb{constructor(e=0,n=0,r=0,i=Pb.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,i=this._order){return this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){const i=e.elements,o=i[0],s=i[4],a=i[8],l=i[1],u=i[5],c=i[9],d=i[2],f=i[6],h=i[10];switch(n){case"XYZ":this._y=Math.asin(Fr(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,h),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(f,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Fr(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-d,o),this._z=0);break;case"ZXY":this._x=Math.asin(Fr(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-s,u)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-Fr(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,h),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,u));break;case"YZX":this._z=Math.asin(Fr(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,u),this._y=Math.atan2(-d,o)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-Fr(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,u),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return Q8.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Q8,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return J8.setFromEuler(this),this.setFromQuaternion(J8,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Pb.DEFAULT_ORDER="XYZ";class Tf{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let n=0;n1){for(let r=0;r0&&(r=r.concat(s))}return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(x0,e,tAe),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(x0,nAe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let r=0,i=n.length;r0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON()));function o(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=o(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let u=0,c=l.length;u0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(r.geometries=a),l.length>0&&(r.materials=l),u.length>0&&(r.textures=u),c.length>0&&(r.images=c),d.length>0&&(r.shapes=d),f.length>0&&(r.skeletons=f),h.length>0&&(r.animations=h),p.length>0&&(r.nodes=p)}return r.object=i,r;function s(a){const l=[];for(const u in a){const c=a[u];delete c.metadata,l.push(c)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}static getBarycoord(e,n,r,i,o){Ma.subVectors(i,n),cu.subVectors(r,n),jT.subVectors(e,n);const s=Ma.dot(Ma),a=Ma.dot(cu),l=Ma.dot(jT),u=cu.dot(cu),c=cu.dot(jT),d=s*u-a*a;if(d===0)return o.set(-2,-1,-1);const f=1/d,h=(u*l-a*c)*f,p=(s*c-a*l)*f;return o.set(1-h-p,p,h)}static containsPoint(e,n,r,i){return this.getBarycoord(e,n,r,i,du),du.x>=0&&du.y>=0&&du.x+du.y<=1}static getUV(e,n,r,i,o,s,a,l){return Nx===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Nx=!0),this.getInterpolation(e,n,r,i,o,s,a,l)}static getInterpolation(e,n,r,i,o,s,a,l){return this.getBarycoord(e,n,r,i,du),l.setScalar(0),l.addScaledVector(o,du.x),l.addScaledVector(s,du.y),l.addScaledVector(a,du.z),l}static isFrontFacing(e,n,r,i){return Ma.subVectors(r,n),cu.subVectors(e,n),Ma.cross(cu).dot(i)<0}set(e,n,r){return this.a.copy(e),this.b.copy(n),this.c.copy(r),this}setFromPointsAndIndices(e,n,r,i){return this.a.copy(e[n]),this.b.copy(e[r]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,n,r,i){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,r),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ma.subVectors(this.c,this.b),cu.subVectors(this.a,this.b),Ma.cross(cu).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Uo.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return Uo.getBarycoord(e,this.a,this.b,this.c,n)}getUV(e,n,r,i,o){return Nx===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),Nx=!0),Uo.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}getInterpolation(e,n,r,i,o){return Uo.getInterpolation(e,this.a,this.b,this.c,n,r,i,o)}containsPoint(e){return Uo.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Uo.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const r=this.a,i=this.b,o=this.c;let s,a;Kh.subVectors(i,r),Yh.subVectors(o,r),WT.subVectors(e,r);const l=Kh.dot(WT),u=Yh.dot(WT);if(l<=0&&u<=0)return n.copy(r);qT.subVectors(e,i);const c=Kh.dot(qT),d=Yh.dot(qT);if(c>=0&&d<=c)return n.copy(i);const f=l*d-c*u;if(f<=0&&l>=0&&c<=0)return s=l/(l-c),n.copy(r).addScaledVector(Kh,s);XT.subVectors(e,o);const h=Kh.dot(XT),p=Yh.dot(XT);if(p>=0&&h<=p)return n.copy(o);const g=h*u-l*p;if(g<=0&&u>=0&&p<=0)return a=u/(u-p),n.copy(r).addScaledVector(Yh,a);const b=c*p-h*d;if(b<=0&&d-c>=0&&h-p>=0)return i6.subVectors(o,i),a=(d-c)/(d-c+(h-p)),n.copy(i).addScaledVector(i6,a);const m=1/(b+g+f);return s=g*m,a=f*m,n.copy(r).addScaledVector(Kh,s).addScaledVector(Yh,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Kq={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},mc={h:0,s:0,l:0},Fx={h:0,s:0,l:0};function KT(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}let vt=class{constructor(e,n,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,r)}set(e,n,r){if(n===void 0&&r===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,n,r);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=ai){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Bn.toWorkingColorSpace(this,n),this}setRGB(e,n,r,i=Bn.workingColorSpace){return this.r=e,this.g=n,this.b=r,Bn.toWorkingColorSpace(this,i),this}setHSL(e,n,r,i=Bn.workingColorSpace){if(e=ZN(e,1),n=Fr(n,0,1),r=Fr(r,0,1),n===0)this.r=this.g=this.b=r;else{const o=r<=.5?r*(1+n):r+n-r*n,s=2*r-o;this.r=KT(s,o,e+1/3),this.g=KT(s,o,e),this.b=KT(s,o,e-1/3)}return Bn.toWorkingColorSpace(this,i),this}setStyle(e,n=ai){function r(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let o;const s=i[1],a=i[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,n);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,n);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return r(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const o=i[1],s=o.length;if(s===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,n);if(s===6)return this.setHex(parseInt(o,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=ai){const r=Kq[e.toLowerCase()];return r!==void 0?this.setHex(r,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=wm(e.r),this.g=wm(e.g),this.b=wm(e.b),this}copyLinearToSRGB(e){return this.r=LT(e.r),this.g=LT(e.g),this.b=LT(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=ai){return Bn.fromWorkingColorSpace(eo.copy(this),e),Math.round(Fr(eo.r*255,0,255))*65536+Math.round(Fr(eo.g*255,0,255))*256+Math.round(Fr(eo.b*255,0,255))}getHexString(e=ai){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=Bn.workingColorSpace){Bn.fromWorkingColorSpace(eo.copy(this),n);const r=eo.r,i=eo.g,o=eo.b,s=Math.max(r,i,o),a=Math.min(r,i,o);let l,u;const c=(a+s)/2;if(a===s)l=0,u=0;else{const d=s-a;switch(u=c<=.5?d/(s+a):d/(2-s-a),s){case r:l=(i-o)/d+(i0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const r=e[n];if(r===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const i=this[n];if(i===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(r):i&&i.isVector3&&r&&r.isVector3?i.copy(r):this[n]=r}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const r={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(r.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(r.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(r.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Ef&&(r.blending=this.blending),this.side!==Uu&&(r.side=this.side),this.vertexColors===!0&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=!0),this.blendSrc!==SS&&(r.blendSrc=this.blendSrc),this.blendDst!==CS&&(r.blendDst=this.blendDst),this.blendEquation!==Nc&&(r.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(r.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(r.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(r.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(r.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(r.blendAlpha=this.blendAlpha),this.depthFunc!==gy&&(r.depthFunc=this.depthFunc),this.depthTest===!1&&(r.depthTest=this.depthTest),this.depthWrite===!1&&(r.depthWrite=this.depthWrite),this.colorWrite===!1&&(r.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(r.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==pR&&(r.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(r.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(r.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ef&&(r.stencilFail=this.stencilFail),this.stencilZFail!==ef&&(r.stencilZFail=this.stencilZFail),this.stencilZPass!==ef&&(r.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(r.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaHash===!0&&(r.alphaHash=!0),this.alphaToCoverage===!0&&(r.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=!0),this.forceSinglePass===!0&&(r.forceSinglePass=!0),this.wireframe===!0&&(r.wireframe=!0),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=!0),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function i(o){const s=[];for(const a in o){const l=o[a];delete l.metadata,s.push(l)}return s}if(n){const o=i(e.textures),s=i(e.images);o.length>0&&(r.textures=o),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let r=null;if(n!==null){const i=n.length;r=new Array(i);for(let o=0;o!==i;++o)r[o]=n[o].clone()}return this.clippingPlanes=r,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}};class Cd extends ji{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const _u=sAe();function sAe(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),r=new Uint32Array(512),i=new Uint32Array(512);for(let l=0;l<256;++l){const u=l-127;u<-27?(r[l]=0,r[l|256]=32768,i[l]=24,i[l|256]=24):u<-14?(r[l]=1024>>-u-14,r[l|256]=1024>>-u-14|32768,i[l]=-u-1,i[l|256]=-u-1):u<=15?(r[l]=u+15<<10,r[l|256]=u+15<<10|32768,i[l]=13,i[l|256]=13):u<128?(r[l]=31744,r[l|256]=64512,i[l]=24,i[l|256]=24):(r[l]=31744,r[l|256]=64512,i[l]=13,i[l|256]=13)}const o=new Uint32Array(2048),s=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let u=l<<13,c=0;for(;!(u&8388608);)u<<=1,c-=8388608;u&=-8388609,c+=947912704,o[l]=u|c}for(let l=1024;l<2048;++l)o[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)s[l]=l<<23;s[31]=1199570944,s[32]=2147483648;for(let l=33;l<63;++l)s[l]=2147483648+(l-32<<23);s[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:o,exponentTable:s,offsetTable:a}}function ko(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Fr(t,-65504,65504),_u.floatView[0]=t;const e=_u.uint32View[0],n=e>>23&511;return _u.baseTable[n]+((e&8388607)>>_u.shiftTable[n])}function Y0(t){const e=t>>10;return _u.uint32View[0]=_u.mantissaTable[_u.offsetTable[e]+(t&1023)]+_u.exponentTable[e],_u.floatView[0]}const aAe={toHalfFloat:ko,fromHalfFloat:Y0},Kr=new oe,Ox=new Xe;class Xn{constructor(e,n,r=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=r,this.usage=Ty,this.updateRange={offset:0,count:-1},this.gpuType=za,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,r){e*=this.itemSize,r*=n.itemSize;for(let i=0,o=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const u in l)l[u]!==void 0&&(e[u]=l[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const r=this.attributes;for(const l in r){const u=r[l];e.data.attributes[l]=u.toJSON(e.data)}const i={};let o=!1;for(const l in this.morphAttributes){const u=this.morphAttributes[l],c=[];for(let d=0,f=u.length;d0&&(i[l]=c,o=!0)}o&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const r=e.index;r!==null&&this.setIndex(r.clone(n));const i=e.attributes;for(const u in i){const c=i[u];this.setAttribute(u,c.clone(n))}const o=e.morphAttributes;for(const u in o){const c=[],d=o[u];for(let f=0,h=d.length;f0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o(e.far-e.near)**2))&&(o6.copy(o).invert(),Hd.copy(e.ray).applyMatrix4(o6),!(r.boundingBox!==null&&Hd.intersectsBox(r.boundingBox)===!1)&&this._computeIntersections(e,n,Hd)))}_computeIntersections(e,n,r){let i;const o=this.geometry,s=this.material,a=o.index,l=o.attributes.position,u=o.attributes.uv,c=o.attributes.uv1,d=o.attributes.normal,f=o.groups,h=o.drawRange;if(a!==null)if(Array.isArray(s))for(let p=0,g=f.length;pn.far?null:{distance:u,point:Hx.clone(),object:t}}function Vx(t,e,n,r,i,o,s,a,l,u){t.getVertexPosition(a,Qh),t.getVertexPosition(l,Jh),t.getVertexPosition(u,ep);const c=gAe(t,e,n,r,Qh,Jh,ep,Ux);if(c){i&&(Bx.fromBufferAttribute(i,a),$x.fromBufferAttribute(i,l),zx.fromBufferAttribute(i,u),c.uv=Uo.getInterpolation(Ux,Qh,Jh,ep,Bx,$x,zx,new Xe)),o&&(Bx.fromBufferAttribute(o,a),$x.fromBufferAttribute(o,l),zx.fromBufferAttribute(o,u),c.uv1=Uo.getInterpolation(Ux,Qh,Jh,ep,Bx,$x,zx,new Xe),c.uv2=c.uv1),s&&(a6.fromBufferAttribute(s,a),l6.fromBufferAttribute(s,l),u6.fromBufferAttribute(s,u),c.normal=Uo.getInterpolation(Ux,Qh,Jh,ep,a6,l6,u6,new oe),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const d={a,b:l,c:u,normal:new oe,materialIndex:0};Uo.getNormal(Qh,Jh,ep,d.normal),c.face=d}return c}class ih extends rn{constructor(e=1,n=1,r=1,i=1,o=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:r,widthSegments:i,heightSegments:o,depthSegments:s};const a=this;i=Math.floor(i),o=Math.floor(o),s=Math.floor(s);const l=[],u=[],c=[],d=[];let f=0,h=0;p("z","y","x",-1,-1,r,n,e,s,o,0),p("z","y","x",1,-1,r,n,-e,s,o,1),p("x","z","y",1,1,e,r,n,i,s,2),p("x","z","y",1,-1,e,r,-n,i,s,3),p("x","y","z",1,-1,e,n,r,i,o,4),p("x","y","z",-1,-1,e,n,-r,i,o,5),this.setIndex(l),this.setAttribute("position",new Ct(u,3)),this.setAttribute("normal",new Ct(c,3)),this.setAttribute("uv",new Ct(d,2));function p(g,b,m,w,x,_,C,S,M,P,A){const R=_/M,F=C/P,$=_/2,j=C/2,k=S/2,U=M+1,G=P+1;let B=0,L=0;const N=new oe;for(let W=0;W0?1:-1,c.push(N.x,N.y,N.z),d.push(Q/M),d.push(1-W/P),B+=1}}for(let W=0;W0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Db extends Tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qt,this.projectionMatrix=new qt,this.projectionMatrixInverse=new qt,this.coordinateSystem=Tl}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Si extends Db{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Ym*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Mf*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ym*2*Math.atan(Math.tan(Mf*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,s){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Mf*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,u=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/u,i*=s.width/l,r*=s.height/u}const a=this.filmOffset;a!==0&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const tp=-90,np=1;class Qq extends Tn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Si(tp,np,e,n);i.layers=this.layers,this.add(i);const o=new Si(tp,np,e,n);o.layers=this.layers,this.add(o);const s=new Si(tp,np,e,n);s.layers=this.layers,this.add(s);const a=new Si(tp,np,e,n);a.layers=this.layers,this.add(a);const l=new Si(tp,np,e,n);l.layers=this.layers,this.add(l);const u=new Si(tp,np,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,s,a,l]=n;for(const u of n)this.remove(u);if(e===Tl)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ay)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,s,a,l,u,c]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const g=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,s),e.setRenderTarget(r,2,i),e.render(n,a),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,u),r.texture.generateMipmaps=g,e.setRenderTarget(r,5,i),e.render(n,c),e.setRenderTarget(d,f,h),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class Rb extends Lr{constructor(e,n,r,i,o,s,a,l,u,c){e=e!==void 0?e:[],n=n!==void 0?n:Hu,super(e,n,r,i,o,s,a,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Jq extends Qa{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];n.encoding!==void 0&&(Ev("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Qc?ai:_s),this.texture=new Rb(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Hr}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` +}`;class Hl extends ji{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=yAe,this.fragmentShader=bAe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Zm(e.uniforms),this.uniformsGroups=vAe(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const i in this.uniforms){const s=this.uniforms[i].value;s&&s.isTexture?n.uniforms[i]={type:"t",value:s.toJSON(e).uuid}:s&&s.isColor?n.uniforms[i]={type:"c",value:s.getHex()}:s&&s.isVector2?n.uniforms[i]={type:"v2",value:s.toArray()}:s&&s.isVector3?n.uniforms[i]={type:"v3",value:s.toArray()}:s&&s.isVector4?n.uniforms[i]={type:"v4",value:s.toArray()}:s&&s.isMatrix3?n.uniforms[i]={type:"m3",value:s.toArray()}:s&&s.isMatrix4?n.uniforms[i]={type:"m4",value:s.toArray()}:n.uniforms[i]={value:s}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const r={};for(const i in this.extensions)this.extensions[i]===!0&&(r[i]=!0);return Object.keys(r).length>0&&(n.extensions=r),n}}class Db extends Tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qt,this.projectionMatrix=new qt,this.projectionMatrixInverse=new qt,this.coordinateSystem=Ml}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Si extends Db{constructor(e=50,n=1,r=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=r,this.far=i,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=Ym*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Mf*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Ym*2*Math.atan(Math.tan(Mf*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,n,r,i,o,s){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Mf*.5*this.fov)/this.zoom,r=2*n,i=this.aspect*r,o=-.5*i;const s=this.view;if(this.view!==null&&this.view.enabled){const l=s.fullWidth,u=s.fullHeight;o+=s.offsetX*i/l,n-=s.offsetY*r/u,i*=s.width/l,r*=s.height/u}const a=this.filmOffset;a!==0&&(o+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,n,n-r,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}const tp=-90,np=1;class Qq extends Tn{constructor(e,n,r){super(),this.type="CubeCamera",this.renderTarget=r,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new Si(tp,np,e,n);i.layers=this.layers,this.add(i);const o=new Si(tp,np,e,n);o.layers=this.layers,this.add(o);const s=new Si(tp,np,e,n);s.layers=this.layers,this.add(s);const a=new Si(tp,np,e,n);a.layers=this.layers,this.add(a);const l=new Si(tp,np,e,n);l.layers=this.layers,this.add(l);const u=new Si(tp,np,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[r,i,o,s,a,l]=n;for(const u of n)this.remove(u);if(e===Ml)r.up.set(0,1,0),r.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),o.up.set(0,0,-1),o.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ay)r.up.set(0,-1,0),r.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),o.up.set(0,0,1),o.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:r,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[o,s,a,l,u,c]=this.children,d=e.getRenderTarget(),f=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const g=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0,i),e.render(n,o),e.setRenderTarget(r,1,i),e.render(n,s),e.setRenderTarget(r,2,i),e.render(n,a),e.setRenderTarget(r,3,i),e.render(n,l),e.setRenderTarget(r,4,i),e.render(n,u),r.texture.generateMipmaps=g,e.setRenderTarget(r,5,i),e.render(n,c),e.setRenderTarget(d,f,h),e.xr.enabled=p,r.texture.needsPMREMUpdate=!0}}class Rb extends Lr{constructor(e,n,r,i,o,s,a,l,u,c){e=e!==void 0?e:[],n=n!==void 0?n:Hu,super(e,n,r,i,o,s,a,l,u,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Jq extends Za{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const r={width:e,height:e,depth:1},i=[r,r,r,r,r,r];n.encoding!==void 0&&(Ev("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===Qc?ai:_s),this.texture=new Rb(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:Hr}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const r={uniforms:{tEquirect:{value:null}},vertexShader:` varying vec3 vWorldDirection; @@ -318,7 +318,7 @@ Example: gl_FragColor = texture2D( tEquirect, sampleUV ); } - `},i=new ih(5,5,5),o=new Hl({name:"CubemapFromEquirect",uniforms:Zm(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Ao,blending:Iu});o.uniforms.tEquirect.value=n;const s=new zi(i,o),a=n.minFilter;return n.minFilter===ud&&(n.minFilter=Hr),new Qq(1,10,this).update(e,s),n.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(e,n,r,i){const o=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(n,r,i);e.setRenderTarget(o)}}const QT=new oe,xAe=new oe,wAe=new nn;class Tc{constructor(e=new oe(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,r,i){return this.normal.set(e,n,r),this.constant=i,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,r){const i=QT.subVectors(r,n).cross(xAe.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const r=e.delta(QT),i=this.normal.dot(r);if(i===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||wAe.getNormalMatrix(e),i=this.coplanarPoint(QT).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Vd=new el,Gx=new oe;class RE{constructor(e=new Tc,n=new Tc,r=new Tc,i=new Tc,o=new Tc,s=new Tc){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=Tl){const r=this.planes,i=e.elements,o=i[0],s=i[1],a=i[2],l=i[3],u=i[4],c=i[5],d=i[6],f=i[7],h=i[8],p=i[9],g=i[10],b=i[11],m=i[12],w=i[13],x=i[14],_=i[15];if(r[0].setComponents(l-o,f-u,b-h,_-m).normalize(),r[1].setComponents(l+o,f+u,b+h,_+m).normalize(),r[2].setComponents(l+s,f+c,b+p,_+w).normalize(),r[3].setComponents(l-s,f-c,b-p,_-w).normalize(),r[4].setComponents(l-a,f-d,b-g,_-x).normalize(),n===Tl)r[5].setComponents(l+a,f+d,b+g,_+x).normalize();else if(n===Ay)r[5].setComponents(a,d,g,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Vd.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Vd.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vd)}intersectsSprite(e){return Vd.center.set(0,0,0),Vd.radius=.7071067811865476,Vd.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vd)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Gx.y=i.normal.y>0?e.max.y:e.min.y,Gx.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Gx)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function eX(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function _Ae(t,e){const n=e.isWebGL2,r=new WeakMap;function i(u,c){const d=u.array,f=u.usage,h=t.createBuffer();t.bindBuffer(c,h),t.bufferData(c,d,f),u.onUploadCallback();let p;if(d instanceof Float32Array)p=t.FLOAT;else if(d instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(n)p=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=t.UNSIGNED_SHORT;else if(d instanceof Int16Array)p=t.SHORT;else if(d instanceof Uint32Array)p=t.UNSIGNED_INT;else if(d instanceof Int32Array)p=t.INT;else if(d instanceof Int8Array)p=t.BYTE;else if(d instanceof Uint8Array)p=t.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)p=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:h,type:p,bytesPerElement:d.BYTES_PER_ELEMENT,version:u.version}}function o(u,c,d){const f=c.array,h=c.updateRange;t.bindBuffer(d,u),h.count===-1?t.bufferSubData(d,0,f):(n?t.bufferSubData(d,h.offset*f.BYTES_PER_ELEMENT,f,h.offset,h.count):t.bufferSubData(d,h.offset*f.BYTES_PER_ELEMENT,f.subarray(h.offset,h.offset+h.count)),h.count=-1),c.onUploadCallback()}function s(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function a(u){u.isInterleavedBufferAttribute&&(u=u.data);const c=r.get(u);c&&(t.deleteBuffer(c.buffer),r.delete(u))}function l(u,c){if(u.isGLBufferAttribute){const f=r.get(u);(!f||f.version1?null:n.copy(e.start).addScaledVector(r,o)}intersectsLine(e){const n=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return n<0&&r>0||r<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const r=n||wAe.getNormalMatrix(e),i=this.coplanarPoint(QT).applyMatrix4(e),o=this.normal.applyMatrix3(r).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Vd=new Ja,Gx=new oe;class RE{constructor(e=new Tc,n=new Tc,r=new Tc,i=new Tc,o=new Tc,s=new Tc){this.planes=[e,n,r,i,o,s]}set(e,n,r,i,o,s){const a=this.planes;return a[0].copy(e),a[1].copy(n),a[2].copy(r),a[3].copy(i),a[4].copy(o),a[5].copy(s),this}copy(e){const n=this.planes;for(let r=0;r<6;r++)n[r].copy(e.planes[r]);return this}setFromProjectionMatrix(e,n=Ml){const r=this.planes,i=e.elements,o=i[0],s=i[1],a=i[2],l=i[3],u=i[4],c=i[5],d=i[6],f=i[7],h=i[8],p=i[9],g=i[10],b=i[11],m=i[12],w=i[13],x=i[14],_=i[15];if(r[0].setComponents(l-o,f-u,b-h,_-m).normalize(),r[1].setComponents(l+o,f+u,b+h,_+m).normalize(),r[2].setComponents(l+s,f+c,b+p,_+w).normalize(),r[3].setComponents(l-s,f-c,b-p,_-w).normalize(),r[4].setComponents(l-a,f-d,b-g,_-x).normalize(),n===Ml)r[5].setComponents(l+a,f+d,b+g,_+x).normalize();else if(n===Ay)r[5].setComponents(a,d,g,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Vd.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),Vd.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Vd)}intersectsSprite(e){return Vd.center.set(0,0,0),Vd.radius=.7071067811865476,Vd.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vd)}intersectsSphere(e){const n=this.planes,r=e.center,i=-e.radius;for(let o=0;o<6;o++)if(n[o].distanceToPoint(r)0?e.max.x:e.min.x,Gx.y=i.normal.y>0?e.max.y:e.min.y,Gx.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Gx)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let r=0;r<6;r++)if(n[r].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function eX(){let t=null,e=!1,n=null,r=null;function i(o,s){n(o,s),r=t.requestAnimationFrame(i)}return{start:function(){e!==!0&&n!==null&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(o){n=o},setContext:function(o){t=o}}}function _Ae(t,e){const n=e.isWebGL2,r=new WeakMap;function i(u,c){const d=u.array,f=u.usage,h=t.createBuffer();t.bindBuffer(c,h),t.bufferData(c,d,f),u.onUploadCallback();let p;if(d instanceof Float32Array)p=t.FLOAT;else if(d instanceof Uint16Array)if(u.isFloat16BufferAttribute)if(n)p=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else p=t.UNSIGNED_SHORT;else if(d instanceof Int16Array)p=t.SHORT;else if(d instanceof Uint32Array)p=t.UNSIGNED_INT;else if(d instanceof Int32Array)p=t.INT;else if(d instanceof Int8Array)p=t.BYTE;else if(d instanceof Uint8Array)p=t.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)p=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:h,type:p,bytesPerElement:d.BYTES_PER_ELEMENT,version:u.version}}function o(u,c,d){const f=c.array,h=c.updateRange;t.bindBuffer(d,u),h.count===-1?t.bufferSubData(d,0,f):(n?t.bufferSubData(d,h.offset*f.BYTES_PER_ELEMENT,f,h.offset,h.count):t.bufferSubData(d,h.offset*f.BYTES_PER_ELEMENT,f.subarray(h.offset,h.offset+h.count)),h.count=-1),c.onUploadCallback()}function s(u){return u.isInterleavedBufferAttribute&&(u=u.data),r.get(u)}function a(u){u.isInterleavedBufferAttribute&&(u=u.data);const c=r.get(u);c&&(t.deleteBuffer(c.buffer),r.delete(u))}function l(u,c){if(u.isGLBufferAttribute){const f=r.get(u);(!f||f.version #include #include -}`,Jt={alphahash_fragment:SAe,alphahash_pars_fragment:CAe,alphamap_fragment:EAe,alphamap_pars_fragment:MAe,alphatest_fragment:TAe,alphatest_pars_fragment:AAe,aomap_fragment:PAe,aomap_pars_fragment:DAe,begin_vertex:RAe,beginnormal_vertex:IAe,bsdfs:NAe,iridescence_fragment:FAe,bumpmap_pars_fragment:OAe,clipping_planes_fragment:kAe,clipping_planes_pars_fragment:LAe,clipping_planes_pars_vertex:BAe,clipping_planes_vertex:$Ae,color_fragment:zAe,color_pars_fragment:UAe,color_pars_vertex:HAe,color_vertex:VAe,common:GAe,cube_uv_reflection_fragment:jAe,defaultnormal_vertex:WAe,displacementmap_pars_vertex:qAe,displacementmap_vertex:XAe,emissivemap_fragment:KAe,emissivemap_pars_fragment:YAe,colorspace_fragment:ZAe,colorspace_pars_fragment:QAe,envmap_fragment:JAe,envmap_common_pars_fragment:ePe,envmap_pars_fragment:tPe,envmap_pars_vertex:nPe,envmap_physical_pars_fragment:pPe,envmap_vertex:rPe,fog_vertex:iPe,fog_pars_vertex:oPe,fog_fragment:sPe,fog_pars_fragment:aPe,gradientmap_pars_fragment:lPe,lightmap_fragment:uPe,lightmap_pars_fragment:cPe,lights_lambert_fragment:dPe,lights_lambert_pars_fragment:fPe,lights_pars_begin:hPe,lights_toon_fragment:mPe,lights_toon_pars_fragment:gPe,lights_phong_fragment:vPe,lights_phong_pars_fragment:yPe,lights_physical_fragment:bPe,lights_physical_pars_fragment:xPe,lights_fragment_begin:wPe,lights_fragment_maps:_Pe,lights_fragment_end:SPe,logdepthbuf_fragment:CPe,logdepthbuf_pars_fragment:EPe,logdepthbuf_pars_vertex:MPe,logdepthbuf_vertex:TPe,map_fragment:APe,map_pars_fragment:PPe,map_particle_fragment:DPe,map_particle_pars_fragment:RPe,metalnessmap_fragment:IPe,metalnessmap_pars_fragment:NPe,morphcolor_vertex:FPe,morphnormal_vertex:OPe,morphtarget_pars_vertex:kPe,morphtarget_vertex:LPe,normal_fragment_begin:BPe,normal_fragment_maps:$Pe,normal_pars_fragment:zPe,normal_pars_vertex:UPe,normal_vertex:HPe,normalmap_pars_fragment:VPe,clearcoat_normal_fragment_begin:GPe,clearcoat_normal_fragment_maps:jPe,clearcoat_pars_fragment:WPe,iridescence_pars_fragment:qPe,opaque_fragment:XPe,packing:KPe,premultiplied_alpha_fragment:YPe,project_vertex:ZPe,dithering_fragment:QPe,dithering_pars_fragment:JPe,roughnessmap_fragment:eDe,roughnessmap_pars_fragment:tDe,shadowmap_pars_fragment:nDe,shadowmap_pars_vertex:rDe,shadowmap_vertex:iDe,shadowmask_pars_fragment:oDe,skinbase_vertex:sDe,skinning_pars_vertex:aDe,skinning_vertex:lDe,skinnormal_vertex:uDe,specularmap_fragment:cDe,specularmap_pars_fragment:dDe,tonemapping_fragment:fDe,tonemapping_pars_fragment:hDe,transmission_fragment:pDe,transmission_pars_fragment:mDe,uv_pars_fragment:gDe,uv_pars_vertex:vDe,uv_vertex:yDe,worldpos_vertex:bDe,background_vert:xDe,background_frag:wDe,backgroundCube_vert:_De,backgroundCube_frag:SDe,cube_vert:CDe,cube_frag:EDe,depth_vert:MDe,depth_frag:TDe,distanceRGBA_vert:ADe,distanceRGBA_frag:PDe,equirect_vert:DDe,equirect_frag:RDe,linedashed_vert:IDe,linedashed_frag:NDe,meshbasic_vert:FDe,meshbasic_frag:ODe,meshlambert_vert:kDe,meshlambert_frag:LDe,meshmatcap_vert:BDe,meshmatcap_frag:$De,meshnormal_vert:zDe,meshnormal_frag:UDe,meshphong_vert:HDe,meshphong_frag:VDe,meshphysical_vert:GDe,meshphysical_frag:jDe,meshtoon_vert:WDe,meshtoon_frag:qDe,points_vert:XDe,points_frag:KDe,shadow_vert:YDe,shadow_frag:ZDe,sprite_vert:QDe,sprite_frag:JDe},ut={common:{diffuse:{value:new vt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nn},normalScale:{value:new Xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new vt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new vt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0},uvTransform:{value:new nn}},sprite:{diffuse:{value:new vt(16777215)},opacity:{value:1},center:{value:new Xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}}},Oa={basic:{uniforms:vo([ut.common,ut.specularmap,ut.envmap,ut.aomap,ut.lightmap,ut.fog]),vertexShader:Jt.meshbasic_vert,fragmentShader:Jt.meshbasic_frag},lambert:{uniforms:vo([ut.common,ut.specularmap,ut.envmap,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.fog,ut.lights,{emissive:{value:new vt(0)}}]),vertexShader:Jt.meshlambert_vert,fragmentShader:Jt.meshlambert_frag},phong:{uniforms:vo([ut.common,ut.specularmap,ut.envmap,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.fog,ut.lights,{emissive:{value:new vt(0)},specular:{value:new vt(1118481)},shininess:{value:30}}]),vertexShader:Jt.meshphong_vert,fragmentShader:Jt.meshphong_frag},standard:{uniforms:vo([ut.common,ut.envmap,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.roughnessmap,ut.metalnessmap,ut.fog,ut.lights,{emissive:{value:new vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag},toon:{uniforms:vo([ut.common,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.gradientmap,ut.fog,ut.lights,{emissive:{value:new vt(0)}}]),vertexShader:Jt.meshtoon_vert,fragmentShader:Jt.meshtoon_frag},matcap:{uniforms:vo([ut.common,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.fog,{matcap:{value:null}}]),vertexShader:Jt.meshmatcap_vert,fragmentShader:Jt.meshmatcap_frag},points:{uniforms:vo([ut.points,ut.fog]),vertexShader:Jt.points_vert,fragmentShader:Jt.points_frag},dashed:{uniforms:vo([ut.common,ut.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Jt.linedashed_vert,fragmentShader:Jt.linedashed_frag},depth:{uniforms:vo([ut.common,ut.displacementmap]),vertexShader:Jt.depth_vert,fragmentShader:Jt.depth_frag},normal:{uniforms:vo([ut.common,ut.bumpmap,ut.normalmap,ut.displacementmap,{opacity:{value:1}}]),vertexShader:Jt.meshnormal_vert,fragmentShader:Jt.meshnormal_frag},sprite:{uniforms:vo([ut.sprite,ut.fog]),vertexShader:Jt.sprite_vert,fragmentShader:Jt.sprite_frag},background:{uniforms:{uvTransform:{value:new nn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Jt.background_vert,fragmentShader:Jt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Jt.backgroundCube_vert,fragmentShader:Jt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Jt.cube_vert,fragmentShader:Jt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Jt.equirect_vert,fragmentShader:Jt.equirect_frag},distanceRGBA:{uniforms:vo([ut.common,ut.displacementmap,{referencePosition:{value:new oe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Jt.distanceRGBA_vert,fragmentShader:Jt.distanceRGBA_frag},shadow:{uniforms:vo([ut.lights,ut.fog,{color:{value:new vt(0)},opacity:{value:1}}]),vertexShader:Jt.shadow_vert,fragmentShader:Jt.shadow_frag}};Oa.physical={uniforms:vo([Oa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nn},clearcoatNormalScale:{value:new Xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nn},sheen:{value:0},sheenColor:{value:new vt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nn},transmissionSamplerSize:{value:new Xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nn},attenuationDistance:{value:0},attenuationColor:{value:new vt(0)},specularColor:{value:new vt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nn},anisotropyVector:{value:new Xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nn}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag};const jx={r:0,b:0,g:0};function eRe(t,e,n,r,i,o,s){const a=new vt(0);let l=o===!0?0:1,u,c,d=null,f=0,h=null;function p(b,m){let w=!1,x=m.isScene===!0?m.background:null;x&&x.isTexture&&(x=(m.backgroundBlurriness>0?n:e).get(x)),x===null?g(a,l):x&&x.isColor&&(g(x,1),w=!0);const _=t.xr.getEnvironmentBlendMode();_==="additive"?r.buffers.color.setClear(0,0,0,1,s):_==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(t.autoClear||w)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),x&&(x.isCubeTexture||x.mapping===yg)?(c===void 0&&(c=new zi(new ih(1,1,1),new Hl({name:"BackgroundCubeMaterial",uniforms:Zm(Oa.backgroundCube.uniforms),vertexShader:Oa.backgroundCube.vertexShader,fragmentShader:Oa.backgroundCube.fragmentShader,side:Ao,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(C,S,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=x,c.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,c.material.toneMapped=Bn.getTransfer(x.colorSpace)!==Zn,(d!==x||f!==x.version||h!==t.toneMapping)&&(c.material.needsUpdate=!0,d=x,f=x.version,h=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new zi(new Ib(2,2),new Hl({name:"BackgroundMaterial",uniforms:Zm(Oa.background.uniforms),vertexShader:Oa.background.vertexShader,fragmentShader:Oa.background.fragmentShader,side:Uu,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,u.material.toneMapped=Bn.getTransfer(x.colorSpace)!==Zn,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(d!==x||f!==x.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,d=x,f=x.version,h=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null))}function g(b,m){b.getRGB(jx,Yq(t)),r.buffers.color.setClear(jx.r,jx.g,jx.b,m,s)}return{getClearColor:function(){return a},setClearColor:function(b,m=1){a.set(b),l=m,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:p}}function tRe(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=b(null);let u=l,c=!1;function d(k,U,G,B,L){let N=!1;if(s){const W=g(B,G,U);u!==W&&(u=W,h(u.object)),N=m(k,B,G,L),N&&w(k,B,G,L)}else{const W=U.wireframe===!0;(u.geometry!==B.id||u.program!==G.id||u.wireframe!==W)&&(u.geometry=B.id,u.program=G.id,u.wireframe=W,N=!0)}L!==null&&n.update(L,t.ELEMENT_ARRAY_BUFFER),(N||c)&&(c=!1,P(k,U,G,B),L!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(L).buffer))}function f(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function h(k){return r.isWebGL2?t.bindVertexArray(k):o.bindVertexArrayOES(k)}function p(k){return r.isWebGL2?t.deleteVertexArray(k):o.deleteVertexArrayOES(k)}function g(k,U,G){const B=G.wireframe===!0;let L=a[k.id];L===void 0&&(L={},a[k.id]=L);let N=L[U.id];N===void 0&&(N={},L[U.id]=N);let W=N[B];return W===void 0&&(W=b(f()),N[B]=W),W}function b(k){const U=[],G=[],B=[];for(let L=0;L=0){const ae=L[Q];let ve=N[Q];if(ve===void 0&&(Q==="instanceMatrix"&&k.instanceMatrix&&(ve=k.instanceMatrix),Q==="instanceColor"&&k.instanceColor&&(ve=k.instanceColor)),ae===void 0||ae.attribute!==ve||ve&&ae.data!==ve.data)return!0;W++}return u.attributesNum!==W||u.index!==B}function w(k,U,G,B){const L={},N=U.attributes;let W=0;const K=G.getAttributes();for(const Q in K)if(K[Q].location>=0){let ae=N[Q];ae===void 0&&(Q==="instanceMatrix"&&k.instanceMatrix&&(ae=k.instanceMatrix),Q==="instanceColor"&&k.instanceColor&&(ae=k.instanceColor));const ve={};ve.attribute=ae,ae&&ae.data&&(ve.data=ae.data),L[Q]=ve,W++}u.attributes=L,u.attributesNum=W,u.index=B}function x(){const k=u.newAttributes;for(let U=0,G=k.length;U=0){let J=L[K];if(J===void 0&&(K==="instanceMatrix"&&k.instanceMatrix&&(J=k.instanceMatrix),K==="instanceColor"&&k.instanceColor&&(J=k.instanceColor)),J!==void 0){const ae=J.normalized,ve=J.itemSize,fe=n.get(J);if(fe===void 0)continue;const Me=fe.buffer,ye=fe.type,we=fe.bytesPerElement,Fe=r.isWebGL2===!0&&(ye===t.INT||ye===t.UNSIGNED_INT||J.gpuType===HN);if(J.isInterleavedBufferAttribute){const Oe=J.data,re=Oe.stride,_e=J.offset;if(Oe.isInstancedInterleavedBuffer){for(let Ce=0;Ce0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=s||e.has("WEBGL_draw_buffers"),c=n.logarithmicDepthBuffer===!0,d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),g=t.getParameter(t.MAX_VERTEX_ATTRIBS),b=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),w=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),x=f>0,_=s||e.has("OES_texture_float"),C=x&&_,S=s?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:c,maxTextures:d,maxVertexTextures:f,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:b,maxVaryings:m,maxFragmentUniforms:w,vertexTextures:x,floatFragmentTextures:_,floatVertexTextures:C,maxSamples:S}}function iRe(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new Tc,a=new nn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const h=d.length!==0||f||r!==0||i;return i=f,r=d.length,h},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,f){n=c(d,f,0)},this.setState=function(d,f,h){const p=d.clippingPlanes,g=d.clipIntersection,b=d.clipShadows,m=t.get(d);if(!i||p===null||p.length===0||o&&!b)o?c(null):u();else{const w=o?0:r,x=w*4;let _=m.clippingState||null;l.value=_,_=c(p,f,x,h);for(let C=0;C!==x;++C)_[C]=n[C];m.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=w}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(d,f,h,p){const g=d!==null?d.length:0;let b=null;if(g!==0){if(b=l.value,p!==!0||b===null){const m=h+g*4,w=f.matrixWorldInverse;a.getNormalMatrix(w),(b===null||b.length0){const u=new Jq(l.height/2);return u.fromEquirectangularTexture(t,s),e.set(s,u),s.addEventListener("dispose",i),n(u.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class Nb extends Db{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,s=r+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const tm=4,c6=[.125,.215,.35,.446,.526,.582],of=20,JT=new Nb,d6=new vt;let eA=null,tA=0,nA=0;const tf=(1+Math.sqrt(5))/2,rp=1/tf,f6=[new oe(1,1,1),new oe(-1,1,1),new oe(1,1,-1),new oe(-1,1,-1),new oe(0,tf,rp),new oe(0,tf,-rp),new oe(rp,0,tf),new oe(-rp,0,tf),new oe(tf,rp,0),new oe(-tf,rp,0)];class vR{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){eA=this._renderer.getRenderTarget(),tA=this._renderer.getActiveCubeFace(),nA=this._renderer.getActiveMipmapLevel(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=m6(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=p6(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),c.setRenderTarget(i),g&&c.render(p,a),c.render(e,a)}p.geometry.dispose(),p.material.dispose(),c.toneMapping=f,c.autoClear=d,e.background=b}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Hu||e.mapping===ld;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=m6()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=p6());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new zi(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;Wx(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,JT)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iof&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${of}`);const m=[];let w=0;for(let M=0;Mx-tm?i-x+tm:0),S=4*(this._cubeSize-_);Wx(n,C,S,3*_,2*_),l.setRenderTarget(n),l.render(d,JT)}}function sRe(t){const e=[],n=[],r=[];let i=t;const o=t-tm+1+c6.length;for(let s=0;st-tm?l=c6[s-t+tm-1]:s===0&&(l=0),r.push(l);const u=1/(a-2),c=-u,d=1+u,f=[c,c,d,c,d,d,c,c,d,d,c,d],h=6,p=6,g=3,b=2,m=1,w=new Float32Array(g*p*h),x=new Float32Array(b*p*h),_=new Float32Array(m*p*h);for(let S=0;S2?0:-1,A=[M,P,0,M+2/3,P,0,M+2/3,P+1,0,M,P,0,M+2/3,P+1,0,M,P+1,0];w.set(A,g*p*S),x.set(f,b*p*S);const R=[S,S,S,S,S,S];_.set(R,m*p*S)}const C=new rn;C.setAttribute("position",new Xn(w,g)),C.setAttribute("uv",new Xn(x,b)),C.setAttribute("faceIndex",new Xn(_,m)),e.push(C),i>tm&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function h6(t,e,n){const r=new Qa(t,e,n);return r.texture.mapping=yg,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Wx(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function aRe(t,e,n){const r=new Float32Array(of),i=new oe(0,1,0);return new Hl({name:"SphericalGaussianBlur",defines:{n:of,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:nF(),fragmentShader:` +}`,Jt={alphahash_fragment:SAe,alphahash_pars_fragment:CAe,alphamap_fragment:EAe,alphamap_pars_fragment:MAe,alphatest_fragment:TAe,alphatest_pars_fragment:AAe,aomap_fragment:PAe,aomap_pars_fragment:DAe,begin_vertex:RAe,beginnormal_vertex:IAe,bsdfs:NAe,iridescence_fragment:FAe,bumpmap_pars_fragment:OAe,clipping_planes_fragment:kAe,clipping_planes_pars_fragment:LAe,clipping_planes_pars_vertex:BAe,clipping_planes_vertex:$Ae,color_fragment:zAe,color_pars_fragment:UAe,color_pars_vertex:HAe,color_vertex:VAe,common:GAe,cube_uv_reflection_fragment:jAe,defaultnormal_vertex:WAe,displacementmap_pars_vertex:qAe,displacementmap_vertex:XAe,emissivemap_fragment:KAe,emissivemap_pars_fragment:YAe,colorspace_fragment:ZAe,colorspace_pars_fragment:QAe,envmap_fragment:JAe,envmap_common_pars_fragment:ePe,envmap_pars_fragment:tPe,envmap_pars_vertex:nPe,envmap_physical_pars_fragment:pPe,envmap_vertex:rPe,fog_vertex:iPe,fog_pars_vertex:oPe,fog_fragment:sPe,fog_pars_fragment:aPe,gradientmap_pars_fragment:lPe,lightmap_fragment:uPe,lightmap_pars_fragment:cPe,lights_lambert_fragment:dPe,lights_lambert_pars_fragment:fPe,lights_pars_begin:hPe,lights_toon_fragment:mPe,lights_toon_pars_fragment:gPe,lights_phong_fragment:vPe,lights_phong_pars_fragment:yPe,lights_physical_fragment:bPe,lights_physical_pars_fragment:xPe,lights_fragment_begin:wPe,lights_fragment_maps:_Pe,lights_fragment_end:SPe,logdepthbuf_fragment:CPe,logdepthbuf_pars_fragment:EPe,logdepthbuf_pars_vertex:MPe,logdepthbuf_vertex:TPe,map_fragment:APe,map_pars_fragment:PPe,map_particle_fragment:DPe,map_particle_pars_fragment:RPe,metalnessmap_fragment:IPe,metalnessmap_pars_fragment:NPe,morphcolor_vertex:FPe,morphnormal_vertex:OPe,morphtarget_pars_vertex:kPe,morphtarget_vertex:LPe,normal_fragment_begin:BPe,normal_fragment_maps:$Pe,normal_pars_fragment:zPe,normal_pars_vertex:UPe,normal_vertex:HPe,normalmap_pars_fragment:VPe,clearcoat_normal_fragment_begin:GPe,clearcoat_normal_fragment_maps:jPe,clearcoat_pars_fragment:WPe,iridescence_pars_fragment:qPe,opaque_fragment:XPe,packing:KPe,premultiplied_alpha_fragment:YPe,project_vertex:ZPe,dithering_fragment:QPe,dithering_pars_fragment:JPe,roughnessmap_fragment:eDe,roughnessmap_pars_fragment:tDe,shadowmap_pars_fragment:nDe,shadowmap_pars_vertex:rDe,shadowmap_vertex:iDe,shadowmask_pars_fragment:oDe,skinbase_vertex:sDe,skinning_pars_vertex:aDe,skinning_vertex:lDe,skinnormal_vertex:uDe,specularmap_fragment:cDe,specularmap_pars_fragment:dDe,tonemapping_fragment:fDe,tonemapping_pars_fragment:hDe,transmission_fragment:pDe,transmission_pars_fragment:mDe,uv_pars_fragment:gDe,uv_pars_vertex:vDe,uv_vertex:yDe,worldpos_vertex:bDe,background_vert:xDe,background_frag:wDe,backgroundCube_vert:_De,backgroundCube_frag:SDe,cube_vert:CDe,cube_frag:EDe,depth_vert:MDe,depth_frag:TDe,distanceRGBA_vert:ADe,distanceRGBA_frag:PDe,equirect_vert:DDe,equirect_frag:RDe,linedashed_vert:IDe,linedashed_frag:NDe,meshbasic_vert:FDe,meshbasic_frag:ODe,meshlambert_vert:kDe,meshlambert_frag:LDe,meshmatcap_vert:BDe,meshmatcap_frag:$De,meshnormal_vert:zDe,meshnormal_frag:UDe,meshphong_vert:HDe,meshphong_frag:VDe,meshphysical_vert:GDe,meshphysical_frag:jDe,meshtoon_vert:WDe,meshtoon_frag:qDe,points_vert:XDe,points_frag:KDe,shadow_vert:YDe,shadow_frag:ZDe,sprite_vert:QDe,sprite_frag:JDe},ut={common:{diffuse:{value:new vt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new nn}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new nn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new nn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new nn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new nn},normalScale:{value:new Xe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new nn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new nn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new nn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new nn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new vt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new vt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0},uvTransform:{value:new nn}},sprite:{diffuse:{value:new vt(16777215)},opacity:{value:1},center:{value:new Xe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new nn},alphaMap:{value:null},alphaMapTransform:{value:new nn},alphaTest:{value:0}}},Fa={basic:{uniforms:vo([ut.common,ut.specularmap,ut.envmap,ut.aomap,ut.lightmap,ut.fog]),vertexShader:Jt.meshbasic_vert,fragmentShader:Jt.meshbasic_frag},lambert:{uniforms:vo([ut.common,ut.specularmap,ut.envmap,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.fog,ut.lights,{emissive:{value:new vt(0)}}]),vertexShader:Jt.meshlambert_vert,fragmentShader:Jt.meshlambert_frag},phong:{uniforms:vo([ut.common,ut.specularmap,ut.envmap,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.fog,ut.lights,{emissive:{value:new vt(0)},specular:{value:new vt(1118481)},shininess:{value:30}}]),vertexShader:Jt.meshphong_vert,fragmentShader:Jt.meshphong_frag},standard:{uniforms:vo([ut.common,ut.envmap,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.roughnessmap,ut.metalnessmap,ut.fog,ut.lights,{emissive:{value:new vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag},toon:{uniforms:vo([ut.common,ut.aomap,ut.lightmap,ut.emissivemap,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.gradientmap,ut.fog,ut.lights,{emissive:{value:new vt(0)}}]),vertexShader:Jt.meshtoon_vert,fragmentShader:Jt.meshtoon_frag},matcap:{uniforms:vo([ut.common,ut.bumpmap,ut.normalmap,ut.displacementmap,ut.fog,{matcap:{value:null}}]),vertexShader:Jt.meshmatcap_vert,fragmentShader:Jt.meshmatcap_frag},points:{uniforms:vo([ut.points,ut.fog]),vertexShader:Jt.points_vert,fragmentShader:Jt.points_frag},dashed:{uniforms:vo([ut.common,ut.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Jt.linedashed_vert,fragmentShader:Jt.linedashed_frag},depth:{uniforms:vo([ut.common,ut.displacementmap]),vertexShader:Jt.depth_vert,fragmentShader:Jt.depth_frag},normal:{uniforms:vo([ut.common,ut.bumpmap,ut.normalmap,ut.displacementmap,{opacity:{value:1}}]),vertexShader:Jt.meshnormal_vert,fragmentShader:Jt.meshnormal_frag},sprite:{uniforms:vo([ut.sprite,ut.fog]),vertexShader:Jt.sprite_vert,fragmentShader:Jt.sprite_frag},background:{uniforms:{uvTransform:{value:new nn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Jt.background_vert,fragmentShader:Jt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Jt.backgroundCube_vert,fragmentShader:Jt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Jt.cube_vert,fragmentShader:Jt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Jt.equirect_vert,fragmentShader:Jt.equirect_frag},distanceRGBA:{uniforms:vo([ut.common,ut.displacementmap,{referencePosition:{value:new oe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Jt.distanceRGBA_vert,fragmentShader:Jt.distanceRGBA_frag},shadow:{uniforms:vo([ut.lights,ut.fog,{color:{value:new vt(0)},opacity:{value:1}}]),vertexShader:Jt.shadow_vert,fragmentShader:Jt.shadow_frag}};Fa.physical={uniforms:vo([Fa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new nn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new nn},clearcoatNormalScale:{value:new Xe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new nn},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new nn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new nn},sheen:{value:0},sheenColor:{value:new vt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new nn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new nn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new nn},transmissionSamplerSize:{value:new Xe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new nn},attenuationDistance:{value:0},attenuationColor:{value:new vt(0)},specularColor:{value:new vt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new nn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new nn},anisotropyVector:{value:new Xe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new nn}}]),vertexShader:Jt.meshphysical_vert,fragmentShader:Jt.meshphysical_frag};const jx={r:0,b:0,g:0};function eRe(t,e,n,r,i,o,s){const a=new vt(0);let l=o===!0?0:1,u,c,d=null,f=0,h=null;function p(b,m){let w=!1,x=m.isScene===!0?m.background:null;x&&x.isTexture&&(x=(m.backgroundBlurriness>0?n:e).get(x)),x===null?g(a,l):x&&x.isColor&&(g(x,1),w=!0);const _=t.xr.getEnvironmentBlendMode();_==="additive"?r.buffers.color.setClear(0,0,0,1,s):_==="alpha-blend"&&r.buffers.color.setClear(0,0,0,0,s),(t.autoClear||w)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),x&&(x.isCubeTexture||x.mapping===yg)?(c===void 0&&(c=new zi(new ih(1,1,1),new Hl({name:"BackgroundCubeMaterial",uniforms:Zm(Fa.backgroundCube.uniforms),vertexShader:Fa.backgroundCube.vertexShader,fragmentShader:Fa.backgroundCube.fragmentShader,side:Ao,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(C,S,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(c)),c.material.uniforms.envMap.value=x,c.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,c.material.uniforms.backgroundBlurriness.value=m.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,c.material.toneMapped=Bn.getTransfer(x.colorSpace)!==Zn,(d!==x||f!==x.version||h!==t.toneMapping)&&(c.material.needsUpdate=!0,d=x,f=x.version,h=t.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new zi(new Ib(2,2),new Hl({name:"BackgroundMaterial",uniforms:Zm(Fa.background.uniforms),vertexShader:Fa.background.vertexShader,fragmentShader:Fa.background.fragmentShader,side:Uu,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=m.backgroundIntensity,u.material.toneMapped=Bn.getTransfer(x.colorSpace)!==Zn,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(d!==x||f!==x.version||h!==t.toneMapping)&&(u.material.needsUpdate=!0,d=x,f=x.version,h=t.toneMapping),u.layers.enableAll(),b.unshift(u,u.geometry,u.material,0,0,null))}function g(b,m){b.getRGB(jx,Yq(t)),r.buffers.color.setClear(jx.r,jx.g,jx.b,m,s)}return{getClearColor:function(){return a},setClearColor:function(b,m=1){a.set(b),l=m,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:p}}function tRe(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=r.isWebGL2?null:e.get("OES_vertex_array_object"),s=r.isWebGL2||o!==null,a={},l=b(null);let u=l,c=!1;function d(k,U,G,B,L){let N=!1;if(s){const W=g(B,G,U);u!==W&&(u=W,h(u.object)),N=m(k,B,G,L),N&&w(k,B,G,L)}else{const W=U.wireframe===!0;(u.geometry!==B.id||u.program!==G.id||u.wireframe!==W)&&(u.geometry=B.id,u.program=G.id,u.wireframe=W,N=!0)}L!==null&&n.update(L,t.ELEMENT_ARRAY_BUFFER),(N||c)&&(c=!1,P(k,U,G,B),L!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(L).buffer))}function f(){return r.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function h(k){return r.isWebGL2?t.bindVertexArray(k):o.bindVertexArrayOES(k)}function p(k){return r.isWebGL2?t.deleteVertexArray(k):o.deleteVertexArrayOES(k)}function g(k,U,G){const B=G.wireframe===!0;let L=a[k.id];L===void 0&&(L={},a[k.id]=L);let N=L[U.id];N===void 0&&(N={},L[U.id]=N);let W=N[B];return W===void 0&&(W=b(f()),N[B]=W),W}function b(k){const U=[],G=[],B=[];for(let L=0;L=0){const ae=L[Q];let ve=N[Q];if(ve===void 0&&(Q==="instanceMatrix"&&k.instanceMatrix&&(ve=k.instanceMatrix),Q==="instanceColor"&&k.instanceColor&&(ve=k.instanceColor)),ae===void 0||ae.attribute!==ve||ve&&ae.data!==ve.data)return!0;W++}return u.attributesNum!==W||u.index!==B}function w(k,U,G,B){const L={},N=U.attributes;let W=0;const K=G.getAttributes();for(const Q in K)if(K[Q].location>=0){let ae=N[Q];ae===void 0&&(Q==="instanceMatrix"&&k.instanceMatrix&&(ae=k.instanceMatrix),Q==="instanceColor"&&k.instanceColor&&(ae=k.instanceColor));const ve={};ve.attribute=ae,ae&&ae.data&&(ve.data=ae.data),L[Q]=ve,W++}u.attributes=L,u.attributesNum=W,u.index=B}function x(){const k=u.newAttributes;for(let U=0,G=k.length;U=0){let J=L[K];if(J===void 0&&(K==="instanceMatrix"&&k.instanceMatrix&&(J=k.instanceMatrix),K==="instanceColor"&&k.instanceColor&&(J=k.instanceColor)),J!==void 0){const ae=J.normalized,ve=J.itemSize,fe=n.get(J);if(fe===void 0)continue;const Me=fe.buffer,ye=fe.type,we=fe.bytesPerElement,Fe=r.isWebGL2===!0&&(ye===t.INT||ye===t.UNSIGNED_INT||J.gpuType===HN);if(J.isInterleavedBufferAttribute){const Oe=J.data,re=Oe.stride,_e=J.offset;if(Oe.isInstancedInterleavedBuffer){for(let Ce=0;Ce0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let a=n.precision!==void 0?n.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const u=s||e.has("WEBGL_draw_buffers"),c=n.logarithmicDepthBuffer===!0,d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),p=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),g=t.getParameter(t.MAX_VERTEX_ATTRIBS),b=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),w=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),x=f>0,_=s||e.has("OES_texture_float"),C=x&&_,S=s?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:u,getMaxAnisotropy:i,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:c,maxTextures:d,maxVertexTextures:f,maxTextureSize:h,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:b,maxVaryings:m,maxFragmentUniforms:w,vertexTextures:x,floatFragmentTextures:_,floatVertexTextures:C,maxSamples:S}}function iRe(t){const e=this;let n=null,r=0,i=!1,o=!1;const s=new Tc,a=new nn,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){const h=d.length!==0||f||r!==0||i;return i=f,r=d.length,h},this.beginShadows=function(){o=!0,c(null)},this.endShadows=function(){o=!1},this.setGlobalState=function(d,f){n=c(d,f,0)},this.setState=function(d,f,h){const p=d.clippingPlanes,g=d.clipIntersection,b=d.clipShadows,m=t.get(d);if(!i||p===null||p.length===0||o&&!b)o?c(null):u();else{const w=o?0:r,x=w*4;let _=m.clippingState||null;l.value=_,_=c(p,f,x,h);for(let C=0;C!==x;++C)_[C]=n[C];m.clippingState=_,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=w}};function u(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),e.numPlanes=r,e.numIntersection=0}function c(d,f,h,p){const g=d!==null?d.length:0;let b=null;if(g!==0){if(b=l.value,p!==!0||b===null){const m=h+g*4,w=f.matrixWorldInverse;a.getNormalMatrix(w),(b===null||b.length0){const u=new Jq(l.height/2);return u.fromEquirectangularTexture(t,s),e.set(s,u),s.addEventListener("dispose",i),n(u.texture,s.mapping)}else return null}}return s}function i(s){const a=s.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function o(){e=new WeakMap}return{get:r,dispose:o}}class Nb extends Db{constructor(e=-1,n=1,r=1,i=-1,o=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=r,this.bottom=i,this.near=o,this.far=s,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,r,i,o,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let o=r-e,s=r+e,a=i+n,l=i-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o+=u*this.view.offsetX,s=o+u*this.view.width,a-=c*this.view.offsetY,l=a-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}const tm=4,c6=[.125,.215,.35,.446,.526,.582],of=20,JT=new Nb,d6=new vt;let eA=null,tA=0,nA=0;const tf=(1+Math.sqrt(5))/2,rp=1/tf,f6=[new oe(1,1,1),new oe(-1,1,1),new oe(1,1,-1),new oe(-1,1,-1),new oe(0,tf,rp),new oe(0,tf,-rp),new oe(rp,0,tf),new oe(-rp,0,tf),new oe(tf,rp,0),new oe(-tf,rp,0)];class vR{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,r=.1,i=100){eA=this._renderer.getRenderTarget(),tA=this._renderer.getActiveCubeFace(),nA=this._renderer.getActiveMipmapLevel(),this._setSize(256);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,r,i,o),n>0&&this._blur(o,0,0,n),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=m6(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=p6(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?x:0,x,x),c.setRenderTarget(i),g&&c.render(p,a),c.render(e,a)}p.geometry.dispose(),p.material.dispose(),c.toneMapping=f,c.autoClear=d,e.background=b}_textureToCubeUV(e,n){const r=this._renderer,i=e.mapping===Hu||e.mapping===ld;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=m6()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=p6());const o=i?this._cubemapMaterial:this._equirectMaterial,s=new zi(this._lodPlanes[0],o),a=o.uniforms;a.envMap.value=e;const l=this._cubeSize;Wx(n,0,0,3*l,2*l),r.setRenderTarget(n),r.render(s,JT)}_applyPMREM(e){const n=this._renderer,r=n.autoClear;n.autoClear=!1;for(let i=1;iof&&console.warn(`sigmaRadians, ${o}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${of}`);const m=[];let w=0;for(let M=0;Mx-tm?i-x+tm:0),S=4*(this._cubeSize-_);Wx(n,C,S,3*_,2*_),l.setRenderTarget(n),l.render(d,JT)}}function sRe(t){const e=[],n=[],r=[];let i=t;const o=t-tm+1+c6.length;for(let s=0;st-tm?l=c6[s-t+tm-1]:s===0&&(l=0),r.push(l);const u=1/(a-2),c=-u,d=1+u,f=[c,c,d,c,d,d,c,c,d,d,c,d],h=6,p=6,g=3,b=2,m=1,w=new Float32Array(g*p*h),x=new Float32Array(b*p*h),_=new Float32Array(m*p*h);for(let S=0;S2?0:-1,A=[M,P,0,M+2/3,P,0,M+2/3,P+1,0,M,P,0,M+2/3,P+1,0,M,P+1,0];w.set(A,g*p*S),x.set(f,b*p*S);const R=[S,S,S,S,S,S];_.set(R,m*p*S)}const C=new rn;C.setAttribute("position",new Xn(w,g)),C.setAttribute("uv",new Xn(x,b)),C.setAttribute("faceIndex",new Xn(_,m)),e.push(C),i>tm&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}function h6(t,e,n){const r=new Za(t,e,n);return r.texture.mapping=yg,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Wx(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function aRe(t,e,n){const r=new Float32Array(of),i=new oe(0,1,0);return new Hl({name:"SphericalGaussianBlur",defines:{n:of,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:nF(),fragmentShader:` precision mediump float; precision mediump int; @@ -3805,7 +3805,7 @@ void main() { gl_Position = vec4( position, 1.0 ); } - `}function lRe(t){let e=new WeakMap,n=null;function r(a){if(a&&a.isTexture){const l=a.mapping,u=l===vy||l===yy,c=l===Hu||l===ld;if(u||c)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let d=e.get(a);return n===null&&(n=new vR(t)),d=u?n.fromEquirectangular(a,d):n.fromCubemap(a,d),e.set(a,d),d.texture}else{if(e.has(a))return e.get(a).texture;{const d=a.image;if(u&&d&&d.height>0||c&&d&&i(d)){n===null&&(n=new vR(t));const f=u?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",o),f.texture}else return null}}}return a}function i(a){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(F=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const $=new Float32Array(R*F*4*g),j=new DE($,R,F,g);j.type=Ua,j.needsUpdate=!0;const k=A*4;for(let G=0;G0)return t;const i=e*n;let o=g6[i];if(o===void 0&&(o=new Float32Array(i),g6[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function di(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n0||c&&d&&i(d)){n===null&&(n=new vR(t));const f=u?n.fromEquirectangular(a):n.fromCubemap(a);return e.set(a,f),a.addEventListener("dispose",o),f.texture}else return null}}}return a}function i(a){let l=0;const u=6;for(let c=0;ce.maxTextureSize&&(F=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const $=new Float32Array(R*F*4*g),j=new DE($,R,F,g);j.type=za,j.needsUpdate=!0;const k=A*4;for(let G=0;G0)return t;const i=e*n;let o=g6[i];if(o===void 0&&(o=new Float32Array(i),g6[i]=o),e!==0){r.toArray(o,0);for(let s=1,a=0;s!==e;++s)a+=n,t[s].toArray(o,a)}return o}function di(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n":" "} ${a}: ${n[s]}`)}return r.join(` `)}function c3e(t){const e=Bn.getPrimaries(Bn.workingColorSpace),n=Bn.getPrimaries(t);let r;switch(e===n?r="":e===My&&n===Ey?r="LinearDisplayP3ToLinearSRGB":e===Ey&&n===My&&(r="LinearSRGBToLinearDisplayP3"),t){case Ul:case Ab:return[r,"LinearTransferOETF"];case ai:case PE:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}function S6(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&i==="")return"";const o=/ERROR: 0:(\d+)/.exec(i);if(o){const s=parseInt(o[1]);return n.toUpperCase()+` @@ -3817,14 +3817,14 @@ void main() { precision `+t.precision+" int;";return t.precision==="highp"?e+=` #define HIGH_PRECISION`:t.precision==="mediump"?e+=` #define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=` -#define LOW_PRECISION`),e}function w3e(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===ME?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===_v?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Ia&&(e="SHADOWMAP_TYPE_VSM"),e}function _3e(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Hu:case ld:e="ENVMAP_TYPE_CUBE";break;case yg:e="ENVMAP_TYPE_CUBE_UV";break}return e}function S3e(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case ld:e="ENVMAP_MODE_REFRACTION";break}return e}function C3e(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case Mb:e="ENVMAP_BLENDING_MULTIPLY";break;case mq:e="ENVMAP_BLENDING_MIX";break;case gq:e="ENVMAP_BLENDING_ADD";break}return e}function E3e(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:r,maxMip:n}}function M3e(t,e,n,r){const i=t.getContext(),o=n.defines;let s=n.vertexShader,a=n.fragmentShader;const l=w3e(n),u=_3e(n),c=S3e(n),d=C3e(n),f=E3e(n),h=n.isWebGL2?"":h3e(n),p=p3e(o),g=i.createProgram();let b,m,w=n.glslVersion?"#version "+n.glslVersion+` +#define LOW_PRECISION`),e}function w3e(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===ME?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===_v?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Ra&&(e="SHADOWMAP_TYPE_VSM"),e}function _3e(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Hu:case ld:e="ENVMAP_TYPE_CUBE";break;case yg:e="ENVMAP_TYPE_CUBE_UV";break}return e}function S3e(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case ld:e="ENVMAP_MODE_REFRACTION";break}return e}function C3e(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case Mb:e="ENVMAP_BLENDING_MULTIPLY";break;case mq:e="ENVMAP_BLENDING_MIX";break;case gq:e="ENVMAP_BLENDING_ADD";break}return e}function E3e(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),7*16)),texelHeight:r,maxMip:n}}function M3e(t,e,n,r){const i=t.getContext(),o=n.defines;let s=n.vertexShader,a=n.fragmentShader;const l=w3e(n),u=_3e(n),c=S3e(n),d=C3e(n),f=E3e(n),h=n.isWebGL2?"":h3e(n),p=p3e(o),g=i.createProgram();let b,m,w=n.glslVersion?"#version "+n.glslVersion+` `:"";n.isRawShaderMaterial?(b=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Z0).join(` `),b.length>0&&(b+=` `),m=[h,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p].filter(Z0).join(` `),m.length>0&&(m+=` `)):(b=[T6(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` `].filter(Z0).join(` -`),m=[h,T6(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+c:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Nl?"#define TONE_MAPPING":"",n.toneMapping!==Nl?Jt.tonemapping_pars_fragment:"",n.toneMapping!==Nl?f3e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Jt.colorspace_pars_fragment,d3e("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` +`),m=[h,T6(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+c:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Il?"#define TONE_MAPPING":"",n.toneMapping!==Il?Jt.tonemapping_pars_fragment:"",n.toneMapping!==Il?f3e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Jt.colorspace_pars_fragment,d3e("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",` `].filter(Z0).join(` `)),s=yR(s),s=C6(s,n),s=E6(s,n),a=yR(a),a=C6(a,n),a=E6(a,n),s=M6(s),a=M6(a),n.isWebGL2&&n.isRawShaderMaterial!==!0&&(w=`#version 300 es `,b=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` @@ -3835,7 +3835,7 @@ precision `+t.precision+" int;";return t.precision==="highp"?e+=` Program Info Log: `+$+` `+B+` -`+L)}else $!==""?console.warn("THREE.WebGLProgram: Program Info Log:",$):(j===""||k==="")&&(G=!1);G&&(F.diagnostics={runnable:U,programLog:$,vertexShader:{log:j,prefix:b},fragmentShader:{log:k,prefix:m}})}i.deleteShader(C),i.deleteShader(S),P=new d_(i,g),A=m3e(i,g)}let P;this.getUniforms=function(){return P===void 0&&M(this),P};let A;this.getAttributes=function(){return A===void 0&&M(this),A};let R=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return R===!1&&(R=i.getProgramParameter(g,a3e)),R},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=l3e++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=C,this.fragmentShader=S,this}let T3e=0;class A3e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new P3e(e),n.set(e,r)),r}}class P3e{constructor(e){this.id=T3e++,this.code=e,this.usedTimes=0}}function D3e(t,e,n,r,i,o,s){const a=new Tf,l=new A3e,u=[],c=i.isWebGL2,d=i.logarithmicDepthBuffer,f=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(A){return A===0?"uv":`uv${A}`}function b(A,R,F,$,j){const k=$.fog,U=j.geometry,G=A.isMeshStandardMaterial?$.environment:null,B=(A.isMeshStandardMaterial?n:e).get(A.envMap||G),L=B&&B.mapping===yg?B.image.height:null,N=p[A.type];A.precision!==null&&(h=i.getMaxPrecision(A.precision),h!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",h,"instead."));const W=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,K=W!==void 0?W.length:0;let Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let J,ae,ve,fe;if(N){const Fn=Oa[N];J=Fn.vertexShader,ae=Fn.fragmentShader}else J=A.vertexShader,ae=A.fragmentShader,l.update(A),ve=l.getVertexShaderID(A),fe=l.getFragmentShaderID(A);const Me=t.getRenderTarget(),ye=j.isInstancedMesh===!0,we=!!A.map,Fe=!!A.matcap,Oe=!!B,re=!!A.aoMap,_e=!!A.lightMap,Ce=!!A.bumpMap,X=!!A.normalMap,Z=!!A.displacementMap,he=!!A.emissiveMap,Y=!!A.metalnessMap,ne=!!A.roughnessMap,se=A.anisotropy>0,xe=A.clearcoat>0,Pe=A.iridescence>0,z=A.sheen>0,H=A.transmission>0,te=se&&!!A.anisotropyMap,le=xe&&!!A.clearcoatMap,de=xe&&!!A.clearcoatNormalMap,ue=xe&&!!A.clearcoatRoughnessMap,ge=Pe&&!!A.iridescenceMap,be=Pe&&!!A.iridescenceThicknessMap,Te=z&&!!A.sheenColorMap,Re=z&&!!A.sheenRoughnessMap,Ve=!!A.specularMap,Le=!!A.specularColorMap,Ye=!!A.specularIntensityMap,it=H&&!!A.transmissionMap,ot=H&&!!A.thicknessMap,ht=!!A.gradientMap,Je=!!A.alphaMap,Ot=A.alphaTest>0,Se=!!A.alphaHash,st=!!A.extensions,Ze=!!U.attributes.uv1,je=!!U.attributes.uv2,et=!!U.attributes.uv3;let Tt=Nl;return A.toneMapped&&(Me===null||Me.isXRRenderTarget===!0)&&(Tt=t.toneMapping),{isWebGL2:c,shaderID:N,shaderType:A.type,shaderName:A.name,vertexShader:J,fragmentShader:ae,defines:A.defines,customVertexShaderID:ve,customFragmentShaderID:fe,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:h,instancing:ye,instancingColor:ye&&j.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:Me===null?t.outputColorSpace:Me.isXRRenderTarget===!0?Me.texture.colorSpace:Ul,map:we,matcap:Fe,envMap:Oe,envMapMode:Oe&&B.mapping,envMapCubeUVHeight:L,aoMap:re,lightMap:_e,bumpMap:Ce,normalMap:X,displacementMap:f&&Z,emissiveMap:he,normalMapObjectSpace:X&&A.normalMapType===Oq,normalMapTangentSpace:X&&A.normalMapType===Sd,metalnessMap:Y,roughnessMap:ne,anisotropy:se,anisotropyMap:te,clearcoat:xe,clearcoatMap:le,clearcoatNormalMap:de,clearcoatRoughnessMap:ue,iridescence:Pe,iridescenceMap:ge,iridescenceThicknessMap:be,sheen:z,sheenColorMap:Te,sheenRoughnessMap:Re,specularMap:Ve,specularColorMap:Le,specularIntensityMap:Ye,transmission:H,transmissionMap:it,thicknessMap:ot,gradientMap:ht,opaque:A.transparent===!1&&A.blending===Ef,alphaMap:Je,alphaTest:Ot,alphaHash:Se,combine:A.combine,mapUv:we&&g(A.map.channel),aoMapUv:re&&g(A.aoMap.channel),lightMapUv:_e&&g(A.lightMap.channel),bumpMapUv:Ce&&g(A.bumpMap.channel),normalMapUv:X&&g(A.normalMap.channel),displacementMapUv:Z&&g(A.displacementMap.channel),emissiveMapUv:he&&g(A.emissiveMap.channel),metalnessMapUv:Y&&g(A.metalnessMap.channel),roughnessMapUv:ne&&g(A.roughnessMap.channel),anisotropyMapUv:te&&g(A.anisotropyMap.channel),clearcoatMapUv:le&&g(A.clearcoatMap.channel),clearcoatNormalMapUv:de&&g(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ue&&g(A.clearcoatRoughnessMap.channel),iridescenceMapUv:ge&&g(A.iridescenceMap.channel),iridescenceThicknessMapUv:be&&g(A.iridescenceThicknessMap.channel),sheenColorMapUv:Te&&g(A.sheenColorMap.channel),sheenRoughnessMapUv:Re&&g(A.sheenRoughnessMap.channel),specularMapUv:Ve&&g(A.specularMap.channel),specularColorMapUv:Le&&g(A.specularColorMap.channel),specularIntensityMapUv:Ye&&g(A.specularIntensityMap.channel),transmissionMapUv:it&&g(A.transmissionMap.channel),thicknessMapUv:ot&&g(A.thicknessMap.channel),alphaMapUv:Je&&g(A.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(X||se),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,vertexUv1s:Ze,vertexUv2s:je,vertexUv3s:et,pointsUvs:j.isPoints===!0&&!!U.attributes.uv&&(we||Je),fog:!!k,useFog:A.fog===!0,fogExp2:k&&k.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:j.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:Q,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:A.dithering,shadowMapEnabled:t.shadowMap.enabled&&F.length>0,shadowMapType:t.shadowMap.type,toneMapping:Tt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:we&&A.map.isVideoTexture===!0&&Bn.getTransfer(A.map.colorSpace)===Zn,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===Ba,flipSided:A.side===Ao,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionDerivatives:st&&A.extensions.derivatives===!0,extensionFragDepth:st&&A.extensions.fragDepth===!0,extensionDrawBuffers:st&&A.extensions.drawBuffers===!0,extensionShaderTextureLOD:st&&A.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:c||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()}}function m(A){const R=[];if(A.shaderID?R.push(A.shaderID):(R.push(A.customVertexShaderID),R.push(A.customFragmentShaderID)),A.defines!==void 0)for(const F in A.defines)R.push(F),R.push(A.defines[F]);return A.isRawShaderMaterial===!1&&(w(R,A),x(R,A),R.push(t.outputColorSpace)),R.push(A.customProgramCacheKey),R.join()}function w(A,R){A.push(R.precision),A.push(R.outputColorSpace),A.push(R.envMapMode),A.push(R.envMapCubeUVHeight),A.push(R.mapUv),A.push(R.alphaMapUv),A.push(R.lightMapUv),A.push(R.aoMapUv),A.push(R.bumpMapUv),A.push(R.normalMapUv),A.push(R.displacementMapUv),A.push(R.emissiveMapUv),A.push(R.metalnessMapUv),A.push(R.roughnessMapUv),A.push(R.anisotropyMapUv),A.push(R.clearcoatMapUv),A.push(R.clearcoatNormalMapUv),A.push(R.clearcoatRoughnessMapUv),A.push(R.iridescenceMapUv),A.push(R.iridescenceThicknessMapUv),A.push(R.sheenColorMapUv),A.push(R.sheenRoughnessMapUv),A.push(R.specularMapUv),A.push(R.specularColorMapUv),A.push(R.specularIntensityMapUv),A.push(R.transmissionMapUv),A.push(R.thicknessMapUv),A.push(R.combine),A.push(R.fogExp2),A.push(R.sizeAttenuation),A.push(R.morphTargetsCount),A.push(R.morphAttributeCount),A.push(R.numDirLights),A.push(R.numPointLights),A.push(R.numSpotLights),A.push(R.numSpotLightMaps),A.push(R.numHemiLights),A.push(R.numRectAreaLights),A.push(R.numDirLightShadows),A.push(R.numPointLightShadows),A.push(R.numSpotLightShadows),A.push(R.numSpotLightShadowsWithMaps),A.push(R.numLightProbes),A.push(R.shadowMapType),A.push(R.toneMapping),A.push(R.numClippingPlanes),A.push(R.numClipIntersection),A.push(R.depthPacking)}function x(A,R){a.disableAll(),R.isWebGL2&&a.enable(0),R.supportsVertexTextures&&a.enable(1),R.instancing&&a.enable(2),R.instancingColor&&a.enable(3),R.matcap&&a.enable(4),R.envMap&&a.enable(5),R.normalMapObjectSpace&&a.enable(6),R.normalMapTangentSpace&&a.enable(7),R.clearcoat&&a.enable(8),R.iridescence&&a.enable(9),R.alphaTest&&a.enable(10),R.vertexColors&&a.enable(11),R.vertexAlphas&&a.enable(12),R.vertexUv1s&&a.enable(13),R.vertexUv2s&&a.enable(14),R.vertexUv3s&&a.enable(15),R.vertexTangents&&a.enable(16),R.anisotropy&&a.enable(17),R.alphaHash&&a.enable(18),A.push(a.mask),a.disableAll(),R.fog&&a.enable(0),R.useFog&&a.enable(1),R.flatShading&&a.enable(2),R.logarithmicDepthBuffer&&a.enable(3),R.skinning&&a.enable(4),R.morphTargets&&a.enable(5),R.morphNormals&&a.enable(6),R.morphColors&&a.enable(7),R.premultipliedAlpha&&a.enable(8),R.shadowMapEnabled&&a.enable(9),R.useLegacyLights&&a.enable(10),R.doubleSided&&a.enable(11),R.flipSided&&a.enable(12),R.useDepthPacking&&a.enable(13),R.dithering&&a.enable(14),R.transmission&&a.enable(15),R.sheen&&a.enable(16),R.opaque&&a.enable(17),R.pointsUvs&&a.enable(18),R.decodeVideoTexture&&a.enable(19),A.push(a.mask)}function _(A){const R=p[A.type];let F;if(R){const $=Oa[R];F=Zq.clone($.uniforms)}else F=A.uniforms;return F}function C(A,R){let F;for(let $=0,j=u.length;$0?r.push(m):h.transparent===!0?i.push(m):n.push(m)}function l(d,f,h,p,g,b){const m=s(d,f,h,p,g,b);h.transmission>0?r.unshift(m):h.transparent===!0?i.unshift(m):n.unshift(m)}function u(d,f){n.length>1&&n.sort(d||I3e),r.length>1&&r.sort(f||A6),i.length>1&&i.sort(f||A6)}function c(){for(let d=e,f=t.length;d=o.length?(s=new P6,o.push(s)):s=o[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function F3e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new oe,color:new vt};break;case"SpotLight":n={position:new oe,direction:new oe,color:new vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new oe,color:new vt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new oe,skyColor:new vt,groundColor:new vt};break;case"RectAreaLight":n={color:new vt,position:new oe,halfWidth:new oe,halfHeight:new oe};break}return t[e.id]=n,n}}}function O3e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let k3e=0;function L3e(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function B3e(t,e){const n=new F3e,r=O3e(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new oe);const o=new oe,s=new qt,a=new qt;function l(c,d){let f=0,h=0,p=0;for(let $=0;$<9;$++)i.probe[$].set(0,0,0);let g=0,b=0,m=0,w=0,x=0,_=0,C=0,S=0,M=0,P=0,A=0;c.sort(L3e);const R=d===!0?Math.PI:1;for(let $=0,j=c.length;$0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=ut.LTC_FLOAT_1,i.rectAreaLTC2=ut.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=ut.LTC_HALF_1,i.rectAreaLTC2=ut.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=f,i.ambient[1]=h,i.ambient[2]=p;const F=i.hash;(F.directionalLength!==g||F.pointLength!==b||F.spotLength!==m||F.rectAreaLength!==w||F.hemiLength!==x||F.numDirectionalShadows!==_||F.numPointShadows!==C||F.numSpotShadows!==S||F.numSpotMaps!==M||F.numLightProbes!==A)&&(i.directional.length=g,i.spot.length=m,i.rectArea.length=w,i.point.length=b,i.hemi.length=x,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=C,i.pointShadowMap.length=C,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=C,i.spotLightMatrix.length=S+M-P,i.spotLightMap.length=M,i.numSpotLightShadowsWithMaps=P,i.numLightProbes=A,F.directionalLength=g,F.pointLength=b,F.spotLength=m,F.rectAreaLength=w,F.hemiLength=x,F.numDirectionalShadows=_,F.numPointShadows=C,F.numSpotShadows=S,F.numSpotMaps=M,F.numLightProbes=A,i.version=k3e++)}function u(c,d){let f=0,h=0,p=0,g=0,b=0;const m=d.matrixWorldInverse;for(let w=0,x=c.length;w=a.length?(l=new D6(t,e),a.push(l)):l=a[s],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class rF extends ji{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Nq,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class iF extends ji{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const z3e=`void main() { +`+L)}else $!==""?console.warn("THREE.WebGLProgram: Program Info Log:",$):(j===""||k==="")&&(G=!1);G&&(F.diagnostics={runnable:U,programLog:$,vertexShader:{log:j,prefix:b},fragmentShader:{log:k,prefix:m}})}i.deleteShader(C),i.deleteShader(S),P=new d_(i,g),A=m3e(i,g)}let P;this.getUniforms=function(){return P===void 0&&M(this),P};let A;this.getAttributes=function(){return A===void 0&&M(this),A};let R=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return R===!1&&(R=i.getProgramParameter(g,a3e)),R},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(g),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=l3e++,this.cacheKey=e,this.usedTimes=1,this.program=g,this.vertexShader=C,this.fragmentShader=S,this}let T3e=0;class A3e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,r=e.fragmentShader,i=this._getShaderStage(n),o=this._getShaderStage(r),s=this._getShaderCacheForMaterial(e);return s.has(i)===!1&&(s.add(i),i.usedTimes++),s.has(o)===!1&&(s.add(o),o.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const r of n)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let r=n.get(e);return r===void 0&&(r=new Set,n.set(e,r)),r}_getShaderStage(e){const n=this.shaderCache;let r=n.get(e);return r===void 0&&(r=new P3e(e),n.set(e,r)),r}}class P3e{constructor(e){this.id=T3e++,this.code=e,this.usedTimes=0}}function D3e(t,e,n,r,i,o,s){const a=new Tf,l=new A3e,u=[],c=i.isWebGL2,d=i.logarithmicDepthBuffer,f=i.vertexTextures;let h=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function g(A){return A===0?"uv":`uv${A}`}function b(A,R,F,$,j){const k=$.fog,U=j.geometry,G=A.isMeshStandardMaterial?$.environment:null,B=(A.isMeshStandardMaterial?n:e).get(A.envMap||G),L=B&&B.mapping===yg?B.image.height:null,N=p[A.type];A.precision!==null&&(h=i.getMaxPrecision(A.precision),h!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",h,"instead."));const W=U.morphAttributes.position||U.morphAttributes.normal||U.morphAttributes.color,K=W!==void 0?W.length:0;let Q=0;U.morphAttributes.position!==void 0&&(Q=1),U.morphAttributes.normal!==void 0&&(Q=2),U.morphAttributes.color!==void 0&&(Q=3);let J,ae,ve,fe;if(N){const Fn=Fa[N];J=Fn.vertexShader,ae=Fn.fragmentShader}else J=A.vertexShader,ae=A.fragmentShader,l.update(A),ve=l.getVertexShaderID(A),fe=l.getFragmentShaderID(A);const Me=t.getRenderTarget(),ye=j.isInstancedMesh===!0,we=!!A.map,Fe=!!A.matcap,Oe=!!B,re=!!A.aoMap,_e=!!A.lightMap,Ce=!!A.bumpMap,X=!!A.normalMap,Z=!!A.displacementMap,he=!!A.emissiveMap,Y=!!A.metalnessMap,ne=!!A.roughnessMap,se=A.anisotropy>0,xe=A.clearcoat>0,Pe=A.iridescence>0,z=A.sheen>0,H=A.transmission>0,te=se&&!!A.anisotropyMap,le=xe&&!!A.clearcoatMap,de=xe&&!!A.clearcoatNormalMap,ue=xe&&!!A.clearcoatRoughnessMap,ge=Pe&&!!A.iridescenceMap,be=Pe&&!!A.iridescenceThicknessMap,Te=z&&!!A.sheenColorMap,Re=z&&!!A.sheenRoughnessMap,Ve=!!A.specularMap,Le=!!A.specularColorMap,Ye=!!A.specularIntensityMap,it=H&&!!A.transmissionMap,ot=H&&!!A.thicknessMap,ht=!!A.gradientMap,Je=!!A.alphaMap,Ot=A.alphaTest>0,Se=!!A.alphaHash,st=!!A.extensions,Ze=!!U.attributes.uv1,je=!!U.attributes.uv2,et=!!U.attributes.uv3;let Tt=Il;return A.toneMapped&&(Me===null||Me.isXRRenderTarget===!0)&&(Tt=t.toneMapping),{isWebGL2:c,shaderID:N,shaderType:A.type,shaderName:A.name,vertexShader:J,fragmentShader:ae,defines:A.defines,customVertexShaderID:ve,customFragmentShaderID:fe,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:h,instancing:ye,instancingColor:ye&&j.instanceColor!==null,supportsVertexTextures:f,outputColorSpace:Me===null?t.outputColorSpace:Me.isXRRenderTarget===!0?Me.texture.colorSpace:Ul,map:we,matcap:Fe,envMap:Oe,envMapMode:Oe&&B.mapping,envMapCubeUVHeight:L,aoMap:re,lightMap:_e,bumpMap:Ce,normalMap:X,displacementMap:f&&Z,emissiveMap:he,normalMapObjectSpace:X&&A.normalMapType===Oq,normalMapTangentSpace:X&&A.normalMapType===Sd,metalnessMap:Y,roughnessMap:ne,anisotropy:se,anisotropyMap:te,clearcoat:xe,clearcoatMap:le,clearcoatNormalMap:de,clearcoatRoughnessMap:ue,iridescence:Pe,iridescenceMap:ge,iridescenceThicknessMap:be,sheen:z,sheenColorMap:Te,sheenRoughnessMap:Re,specularMap:Ve,specularColorMap:Le,specularIntensityMap:Ye,transmission:H,transmissionMap:it,thicknessMap:ot,gradientMap:ht,opaque:A.transparent===!1&&A.blending===Ef,alphaMap:Je,alphaTest:Ot,alphaHash:Se,combine:A.combine,mapUv:we&&g(A.map.channel),aoMapUv:re&&g(A.aoMap.channel),lightMapUv:_e&&g(A.lightMap.channel),bumpMapUv:Ce&&g(A.bumpMap.channel),normalMapUv:X&&g(A.normalMap.channel),displacementMapUv:Z&&g(A.displacementMap.channel),emissiveMapUv:he&&g(A.emissiveMap.channel),metalnessMapUv:Y&&g(A.metalnessMap.channel),roughnessMapUv:ne&&g(A.roughnessMap.channel),anisotropyMapUv:te&&g(A.anisotropyMap.channel),clearcoatMapUv:le&&g(A.clearcoatMap.channel),clearcoatNormalMapUv:de&&g(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ue&&g(A.clearcoatRoughnessMap.channel),iridescenceMapUv:ge&&g(A.iridescenceMap.channel),iridescenceThicknessMapUv:be&&g(A.iridescenceThicknessMap.channel),sheenColorMapUv:Te&&g(A.sheenColorMap.channel),sheenRoughnessMapUv:Re&&g(A.sheenRoughnessMap.channel),specularMapUv:Ve&&g(A.specularMap.channel),specularColorMapUv:Le&&g(A.specularColorMap.channel),specularIntensityMapUv:Ye&&g(A.specularIntensityMap.channel),transmissionMapUv:it&&g(A.transmissionMap.channel),thicknessMapUv:ot&&g(A.thicknessMap.channel),alphaMapUv:Je&&g(A.alphaMap.channel),vertexTangents:!!U.attributes.tangent&&(X||se),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!U.attributes.color&&U.attributes.color.itemSize===4,vertexUv1s:Ze,vertexUv2s:je,vertexUv3s:et,pointsUvs:j.isPoints===!0&&!!U.attributes.uv&&(we||Je),fog:!!k,useFog:A.fog===!0,fogExp2:k&&k.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:j.isSkinnedMesh===!0,morphTargets:U.morphAttributes.position!==void 0,morphNormals:U.morphAttributes.normal!==void 0,morphColors:U.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:Q,numDirLights:R.directional.length,numPointLights:R.point.length,numSpotLights:R.spot.length,numSpotLightMaps:R.spotLightMap.length,numRectAreaLights:R.rectArea.length,numHemiLights:R.hemi.length,numDirLightShadows:R.directionalShadowMap.length,numPointLightShadows:R.pointShadowMap.length,numSpotLightShadows:R.spotShadowMap.length,numSpotLightShadowsWithMaps:R.numSpotLightShadowsWithMaps,numLightProbes:R.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:A.dithering,shadowMapEnabled:t.shadowMap.enabled&&F.length>0,shadowMapType:t.shadowMap.type,toneMapping:Tt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:we&&A.map.isVideoTexture===!0&&Bn.getTransfer(A.map.colorSpace)===Zn,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===La,flipSided:A.side===Ao,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionDerivatives:st&&A.extensions.derivatives===!0,extensionFragDepth:st&&A.extensions.fragDepth===!0,extensionDrawBuffers:st&&A.extensions.drawBuffers===!0,extensionShaderTextureLOD:st&&A.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:c||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()}}function m(A){const R=[];if(A.shaderID?R.push(A.shaderID):(R.push(A.customVertexShaderID),R.push(A.customFragmentShaderID)),A.defines!==void 0)for(const F in A.defines)R.push(F),R.push(A.defines[F]);return A.isRawShaderMaterial===!1&&(w(R,A),x(R,A),R.push(t.outputColorSpace)),R.push(A.customProgramCacheKey),R.join()}function w(A,R){A.push(R.precision),A.push(R.outputColorSpace),A.push(R.envMapMode),A.push(R.envMapCubeUVHeight),A.push(R.mapUv),A.push(R.alphaMapUv),A.push(R.lightMapUv),A.push(R.aoMapUv),A.push(R.bumpMapUv),A.push(R.normalMapUv),A.push(R.displacementMapUv),A.push(R.emissiveMapUv),A.push(R.metalnessMapUv),A.push(R.roughnessMapUv),A.push(R.anisotropyMapUv),A.push(R.clearcoatMapUv),A.push(R.clearcoatNormalMapUv),A.push(R.clearcoatRoughnessMapUv),A.push(R.iridescenceMapUv),A.push(R.iridescenceThicknessMapUv),A.push(R.sheenColorMapUv),A.push(R.sheenRoughnessMapUv),A.push(R.specularMapUv),A.push(R.specularColorMapUv),A.push(R.specularIntensityMapUv),A.push(R.transmissionMapUv),A.push(R.thicknessMapUv),A.push(R.combine),A.push(R.fogExp2),A.push(R.sizeAttenuation),A.push(R.morphTargetsCount),A.push(R.morphAttributeCount),A.push(R.numDirLights),A.push(R.numPointLights),A.push(R.numSpotLights),A.push(R.numSpotLightMaps),A.push(R.numHemiLights),A.push(R.numRectAreaLights),A.push(R.numDirLightShadows),A.push(R.numPointLightShadows),A.push(R.numSpotLightShadows),A.push(R.numSpotLightShadowsWithMaps),A.push(R.numLightProbes),A.push(R.shadowMapType),A.push(R.toneMapping),A.push(R.numClippingPlanes),A.push(R.numClipIntersection),A.push(R.depthPacking)}function x(A,R){a.disableAll(),R.isWebGL2&&a.enable(0),R.supportsVertexTextures&&a.enable(1),R.instancing&&a.enable(2),R.instancingColor&&a.enable(3),R.matcap&&a.enable(4),R.envMap&&a.enable(5),R.normalMapObjectSpace&&a.enable(6),R.normalMapTangentSpace&&a.enable(7),R.clearcoat&&a.enable(8),R.iridescence&&a.enable(9),R.alphaTest&&a.enable(10),R.vertexColors&&a.enable(11),R.vertexAlphas&&a.enable(12),R.vertexUv1s&&a.enable(13),R.vertexUv2s&&a.enable(14),R.vertexUv3s&&a.enable(15),R.vertexTangents&&a.enable(16),R.anisotropy&&a.enable(17),R.alphaHash&&a.enable(18),A.push(a.mask),a.disableAll(),R.fog&&a.enable(0),R.useFog&&a.enable(1),R.flatShading&&a.enable(2),R.logarithmicDepthBuffer&&a.enable(3),R.skinning&&a.enable(4),R.morphTargets&&a.enable(5),R.morphNormals&&a.enable(6),R.morphColors&&a.enable(7),R.premultipliedAlpha&&a.enable(8),R.shadowMapEnabled&&a.enable(9),R.useLegacyLights&&a.enable(10),R.doubleSided&&a.enable(11),R.flipSided&&a.enable(12),R.useDepthPacking&&a.enable(13),R.dithering&&a.enable(14),R.transmission&&a.enable(15),R.sheen&&a.enable(16),R.opaque&&a.enable(17),R.pointsUvs&&a.enable(18),R.decodeVideoTexture&&a.enable(19),A.push(a.mask)}function _(A){const R=p[A.type];let F;if(R){const $=Fa[R];F=Zq.clone($.uniforms)}else F=A.uniforms;return F}function C(A,R){let F;for(let $=0,j=u.length;$0?r.push(m):h.transparent===!0?i.push(m):n.push(m)}function l(d,f,h,p,g,b){const m=s(d,f,h,p,g,b);h.transmission>0?r.unshift(m):h.transparent===!0?i.unshift(m):n.unshift(m)}function u(d,f){n.length>1&&n.sort(d||I3e),r.length>1&&r.sort(f||A6),i.length>1&&i.sort(f||A6)}function c(){for(let d=e,f=t.length;d=o.length?(s=new P6,o.push(s)):s=o[i],s}function n(){t=new WeakMap}return{get:e,dispose:n}}function F3e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new oe,color:new vt};break;case"SpotLight":n={position:new oe,direction:new oe,color:new vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new oe,color:new vt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new oe,skyColor:new vt,groundColor:new vt};break;case"RectAreaLight":n={color:new vt,position:new oe,halfWidth:new oe,halfHeight:new oe};break}return t[e.id]=n,n}}}function O3e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Xe,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let k3e=0;function L3e(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function B3e(t,e){const n=new F3e,r=O3e(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)i.probe.push(new oe);const o=new oe,s=new qt,a=new qt;function l(c,d){let f=0,h=0,p=0;for(let $=0;$<9;$++)i.probe[$].set(0,0,0);let g=0,b=0,m=0,w=0,x=0,_=0,C=0,S=0,M=0,P=0,A=0;c.sort(L3e);const R=d===!0?Math.PI:1;for(let $=0,j=c.length;$0&&(e.isWebGL2||t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=ut.LTC_FLOAT_1,i.rectAreaLTC2=ut.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=ut.LTC_HALF_1,i.rectAreaLTC2=ut.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=f,i.ambient[1]=h,i.ambient[2]=p;const F=i.hash;(F.directionalLength!==g||F.pointLength!==b||F.spotLength!==m||F.rectAreaLength!==w||F.hemiLength!==x||F.numDirectionalShadows!==_||F.numPointShadows!==C||F.numSpotShadows!==S||F.numSpotMaps!==M||F.numLightProbes!==A)&&(i.directional.length=g,i.spot.length=m,i.rectArea.length=w,i.point.length=b,i.hemi.length=x,i.directionalShadow.length=_,i.directionalShadowMap.length=_,i.pointShadow.length=C,i.pointShadowMap.length=C,i.spotShadow.length=S,i.spotShadowMap.length=S,i.directionalShadowMatrix.length=_,i.pointShadowMatrix.length=C,i.spotLightMatrix.length=S+M-P,i.spotLightMap.length=M,i.numSpotLightShadowsWithMaps=P,i.numLightProbes=A,F.directionalLength=g,F.pointLength=b,F.spotLength=m,F.rectAreaLength=w,F.hemiLength=x,F.numDirectionalShadows=_,F.numPointShadows=C,F.numSpotShadows=S,F.numSpotMaps=M,F.numLightProbes=A,i.version=k3e++)}function u(c,d){let f=0,h=0,p=0,g=0,b=0;const m=d.matrixWorldInverse;for(let w=0,x=c.length;w=a.length?(l=new D6(t,e),a.push(l)):l=a[s],l}function i(){n=new WeakMap}return{get:r,dispose:i}}class rF extends ji{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Nq,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class iF extends ji{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const z3e=`void main() { gl_Position = vec4( position, 1.0 ); }`,U3e=`uniform sampler2D shadow_pass; uniform vec2 resolution; @@ -3863,7 +3863,7 @@ void main() { squared_mean = squared_mean / samples; float std_dev = sqrt( squared_mean - mean * mean ); gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function H3e(t,e,n){let r=new RE;const i=new Xe,o=new Xe,s=new kn,a=new rF({depthPacking:Fq}),l=new iF,u={},c=n.maxTextureSize,d={[Uu]:Ao,[Ao]:Uu,[Ba]:Ba},f=new Hl({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Xe},radius:{value:4}},vertexShader:z3e,fragmentShader:U3e}),h=f.clone();h.defines.HORIZONTAL_PASS=1;const p=new rn;p.setAttribute("position",new Xn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new zi(p,f),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ME;let m=this.type;this.render=function(C,S,M){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||C.length===0)return;const P=t.getRenderTarget(),A=t.getActiveCubeFace(),R=t.getActiveMipmapLevel(),F=t.state;F.setBlending(Iu),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const $=m!==Ia&&this.type===Ia,j=m===Ia&&this.type!==Ia;for(let k=0,U=C.length;kc||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/L.x),i.x=o.x*L.x,B.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/L.y),i.y=o.y*L.y,B.mapSize.y=o.y)),B.map===null||$===!0||j===!0){const W=this.type!==Ia?{minFilter:Nr,magFilter:Nr}:{};B.map!==null&&B.map.dispose(),B.map=new Qa(i.x,i.y,W),B.map.texture.name=G.name+".shadowMap",B.camera.updateProjectionMatrix()}t.setRenderTarget(B.map),t.clear();const N=B.getViewportCount();for(let W=0;W0||S.map&&S.alphaTest>0){const F=A.uuid,$=S.uuid;let j=u[F];j===void 0&&(j={},u[F]=j);let k=j[$];k===void 0&&(k=A.clone(),j[$]=k),A=k}if(A.visible=S.visible,A.wireframe=S.wireframe,P===Ia?A.side=S.shadowSide!==null?S.shadowSide:S.side:A.side=S.shadowSide!==null?S.shadowSide:d[S.side],A.alphaMap=S.alphaMap,A.alphaTest=S.alphaTest,A.map=S.map,A.clipShadows=S.clipShadows,A.clippingPlanes=S.clippingPlanes,A.clipIntersection=S.clipIntersection,A.displacementMap=S.displacementMap,A.displacementScale=S.displacementScale,A.displacementBias=S.displacementBias,A.wireframeLinewidth=S.wireframeLinewidth,A.linewidth=S.linewidth,M.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const F=t.properties.get(A);F.light=M}return A}function _(C,S,M,P,A){if(C.visible===!1)return;if(C.layers.test(S.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&A===Ia)&&(!C.frustumCulled||r.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,C.matrixWorld);const $=e.update(C),j=C.material;if(Array.isArray(j)){const k=$.groups;for(let U=0,G=k.length;U=1):W.indexOf("OpenGL ES")!==-1&&(N=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),L=N>=2);let K=null,Q={};const J=t.getParameter(t.SCISSOR_BOX),ae=t.getParameter(t.VIEWPORT),ve=new kn().fromArray(J),fe=new kn().fromArray(ae);function Me(Se,st,Ze,je){const et=new Uint8Array(4),Tt=t.createTexture();t.bindTexture(Se,Tt),t.texParameteri(Se,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Se,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Qt=0;Qt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap;let g;const b=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function w(z,H){return m?new OffscreenCanvas(z,H):Py("canvas")}function x(z,H,te,le){let de=1;if((z.width>le||z.height>le)&&(de=le/Math.max(z.width,z.height)),de<1||H===!0)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap){const ue=H?TS:Math.floor,ge=ue(de*z.width),be=ue(de*z.height);g===void 0&&(g=w(ge,be));const Te=te?w(ge,be):g;return Te.width=ge,Te.height=be,Te.getContext("2d").drawImage(z,0,0,ge,be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+z.width+"x"+z.height+") to ("+ge+"x"+be+")."),Te}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+z.width+"x"+z.height+")."),z;return z}function _(z){return gR(z.width)&&gR(z.height)}function C(z){return a?!1:z.wrapS!==Ci||z.wrapT!==Ci||z.minFilter!==Nr&&z.minFilter!==Hr}function S(z,H){return z.generateMipmaps&&H&&z.minFilter!==Nr&&z.minFilter!==Hr}function M(z){t.generateMipmap(z)}function P(z,H,te,le,de=!1){if(a===!1)return H;if(z!==null){if(t[z]!==void 0)return t[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let ue=H;if(H===t.RED&&(te===t.FLOAT&&(ue=t.R32F),te===t.HALF_FLOAT&&(ue=t.R16F),te===t.UNSIGNED_BYTE&&(ue=t.R8)),H===t.RED_INTEGER&&(te===t.UNSIGNED_BYTE&&(ue=t.R8UI),te===t.UNSIGNED_SHORT&&(ue=t.R16UI),te===t.UNSIGNED_INT&&(ue=t.R32UI),te===t.BYTE&&(ue=t.R8I),te===t.SHORT&&(ue=t.R16I),te===t.INT&&(ue=t.R32I)),H===t.RG&&(te===t.FLOAT&&(ue=t.RG32F),te===t.HALF_FLOAT&&(ue=t.RG16F),te===t.UNSIGNED_BYTE&&(ue=t.RG8)),H===t.RGBA){const ge=de?Cy:Bn.getTransfer(le);te===t.FLOAT&&(ue=t.RGBA32F),te===t.HALF_FLOAT&&(ue=t.RGBA16F),te===t.UNSIGNED_BYTE&&(ue=ge===Zn?t.SRGB8_ALPHA8:t.RGBA8),te===t.UNSIGNED_SHORT_4_4_4_4&&(ue=t.RGBA4),te===t.UNSIGNED_SHORT_5_5_5_1&&(ue=t.RGB5_A1)}return(ue===t.R16F||ue===t.R32F||ue===t.RG16F||ue===t.RG32F||ue===t.RGBA16F||ue===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ue}function A(z,H,te){return S(z,te)===!0||z.isFramebufferTexture&&z.minFilter!==Nr&&z.minFilter!==Hr?Math.log2(Math.max(H.width,H.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?H.mipmaps.length:1}function R(z){return z===Nr||z===ES||z===Sv?t.NEAREST:t.LINEAR}function F(z){const H=z.target;H.removeEventListener("dispose",F),j(H),H.isVideoTexture&&p.delete(H)}function $(z){const H=z.target;H.removeEventListener("dispose",$),U(H)}function j(z){const H=r.get(z);if(H.__webglInit===void 0)return;const te=z.source,le=b.get(te);if(le){const de=le[H.__cacheKey];de.usedTimes--,de.usedTimes===0&&k(z),Object.keys(le).length===0&&b.delete(te)}r.remove(z)}function k(z){const H=r.get(z);t.deleteTexture(H.__webglTexture);const te=z.source,le=b.get(te);delete le[H.__cacheKey],s.memory.textures--}function U(z){const H=z.texture,te=r.get(z),le=r.get(H);if(le.__webglTexture!==void 0&&(t.deleteTexture(le.__webglTexture),s.memory.textures--),z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let de=0;de<6;de++){if(Array.isArray(te.__webglFramebuffer[de]))for(let ue=0;ue=l&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+l),G+=1,z}function N(z){const H=[];return H.push(z.wrapS),H.push(z.wrapT),H.push(z.wrapR||0),H.push(z.magFilter),H.push(z.minFilter),H.push(z.anisotropy),H.push(z.internalFormat),H.push(z.format),H.push(z.type),H.push(z.generateMipmaps),H.push(z.premultiplyAlpha),H.push(z.flipY),H.push(z.unpackAlignment),H.push(z.colorSpace),H.join()}function W(z,H){const te=r.get(z);if(z.isVideoTexture&&xe(z),z.isRenderTargetTexture===!1&&z.version>0&&te.__version!==z.version){const le=z.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{we(te,z,H);return}}n.bindTexture(t.TEXTURE_2D,te.__webglTexture,t.TEXTURE0+H)}function K(z,H){const te=r.get(z);if(z.version>0&&te.__version!==z.version){we(te,z,H);return}n.bindTexture(t.TEXTURE_2D_ARRAY,te.__webglTexture,t.TEXTURE0+H)}function Q(z,H){const te=r.get(z);if(z.version>0&&te.__version!==z.version){we(te,z,H);return}n.bindTexture(t.TEXTURE_3D,te.__webglTexture,t.TEXTURE0+H)}function J(z,H){const te=r.get(z);if(z.version>0&&te.__version!==z.version){Fe(te,z,H);return}n.bindTexture(t.TEXTURE_CUBE_MAP,te.__webglTexture,t.TEXTURE0+H)}const ae={[by]:t.REPEAT,[Ci]:t.CLAMP_TO_EDGE,[xy]:t.MIRRORED_REPEAT},ve={[Nr]:t.NEAREST,[ES]:t.NEAREST_MIPMAP_NEAREST,[Sv]:t.NEAREST_MIPMAP_LINEAR,[Hr]:t.LINEAR,[UN]:t.LINEAR_MIPMAP_NEAREST,[ud]:t.LINEAR_MIPMAP_LINEAR},fe={[kq]:t.NEVER,[Vq]:t.ALWAYS,[Lq]:t.LESS,[$q]:t.LEQUAL,[Bq]:t.EQUAL,[Hq]:t.GEQUAL,[zq]:t.GREATER,[Uq]:t.NOTEQUAL};function Me(z,H,te){if(te?(t.texParameteri(z,t.TEXTURE_WRAP_S,ae[H.wrapS]),t.texParameteri(z,t.TEXTURE_WRAP_T,ae[H.wrapT]),(z===t.TEXTURE_3D||z===t.TEXTURE_2D_ARRAY)&&t.texParameteri(z,t.TEXTURE_WRAP_R,ae[H.wrapR]),t.texParameteri(z,t.TEXTURE_MAG_FILTER,ve[H.magFilter]),t.texParameteri(z,t.TEXTURE_MIN_FILTER,ve[H.minFilter])):(t.texParameteri(z,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(z,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(z===t.TEXTURE_3D||z===t.TEXTURE_2D_ARRAY)&&t.texParameteri(z,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(H.wrapS!==Ci||H.wrapT!==Ci)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(z,t.TEXTURE_MAG_FILTER,R(H.magFilter)),t.texParameteri(z,t.TEXTURE_MIN_FILTER,R(H.minFilter)),H.minFilter!==Nr&&H.minFilter!==Hr&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),H.compareFunction&&(t.texParameteri(z,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(z,t.TEXTURE_COMPARE_FUNC,fe[H.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const le=e.get("EXT_texture_filter_anisotropic");if(H.magFilter===Nr||H.minFilter!==Sv&&H.minFilter!==ud||H.type===Ua&&e.has("OES_texture_float_linear")===!1||a===!1&&H.type===Uf&&e.has("OES_texture_half_float_linear")===!1)return;(H.anisotropy>1||r.get(H).__currentAnisotropy)&&(t.texParameterf(z,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(H.anisotropy,i.getMaxAnisotropy())),r.get(H).__currentAnisotropy=H.anisotropy)}}function ye(z,H){let te=!1;z.__webglInit===void 0&&(z.__webglInit=!0,H.addEventListener("dispose",F));const le=H.source;let de=b.get(le);de===void 0&&(de={},b.set(le,de));const ue=N(H);if(ue!==z.__cacheKey){de[ue]===void 0&&(de[ue]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,te=!0),de[ue].usedTimes++;const ge=de[z.__cacheKey];ge!==void 0&&(de[z.__cacheKey].usedTimes--,ge.usedTimes===0&&k(H)),z.__cacheKey=ue,z.__webglTexture=de[ue].texture}return te}function we(z,H,te){let le=t.TEXTURE_2D;(H.isDataArrayTexture||H.isCompressedArrayTexture)&&(le=t.TEXTURE_2D_ARRAY),H.isData3DTexture&&(le=t.TEXTURE_3D);const de=ye(z,H),ue=H.source;n.bindTexture(le,z.__webglTexture,t.TEXTURE0+te);const ge=r.get(ue);if(ue.version!==ge.__version||de===!0){n.activeTexture(t.TEXTURE0+te);const be=Bn.getPrimaries(Bn.workingColorSpace),Te=H.colorSpace===_s?null:Bn.getPrimaries(H.colorSpace),Re=H.colorSpace===_s||be===Te?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,H.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,H.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Re);const Ve=C(H)&&_(H.image)===!1;let Le=x(H.image,Ve,!1,c);Le=Pe(H,Le);const Ye=_(Le)||a,it=o.convert(H.format,H.colorSpace);let ot=o.convert(H.type),ht=P(H.internalFormat,it,ot,H.colorSpace,H.isVideoTexture);Me(le,H,Ye);let Je;const Ot=H.mipmaps,Se=a&&H.isVideoTexture!==!0,st=ge.__version===void 0||de===!0,Ze=A(H,Le,Ye);if(H.isDepthTexture)ht=t.DEPTH_COMPONENT,a?H.type===Ua?ht=t.DEPTH_COMPONENT32F:H.type===Au?ht=t.DEPTH_COMPONENT24:H.type===Yc?ht=t.DEPTH24_STENCIL8:ht=t.DEPTH_COMPONENT16:H.type===Ua&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),H.format===Zc&&ht===t.DEPTH_COMPONENT&&H.type!==TE&&H.type!==Au&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),H.type=Au,ot=o.convert(H.type)),H.format===Hf&&ht===t.DEPTH_COMPONENT&&(ht=t.DEPTH_STENCIL,H.type!==Yc&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),H.type=Yc,ot=o.convert(H.type))),st&&(Se?n.texStorage2D(t.TEXTURE_2D,1,ht,Le.width,Le.height):n.texImage2D(t.TEXTURE_2D,0,ht,Le.width,Le.height,0,it,ot,null));else if(H.isDataTexture)if(Ot.length>0&&Ye){Se&&st&&n.texStorage2D(t.TEXTURE_2D,Ze,ht,Ot[0].width,Ot[0].height);for(let je=0,et=Ot.length;je>=1,et>>=1}}else if(Ot.length>0&&Ye){Se&&st&&n.texStorage2D(t.TEXTURE_2D,Ze,ht,Ot[0].width,Ot[0].height);for(let je=0,et=Ot.length;je0&&st++,n.texStorage2D(t.TEXTURE_CUBE_MAP,st,Je,Le[0].width,Le[0].height));for(let je=0;je<6;je++)if(Ve){Ot?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+je,0,0,0,Le[je].width,Le[je].height,ot,ht,Le[je].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+je,0,Je,Le[je].width,Le[je].height,0,ot,ht,Le[je].data);for(let et=0;et>ue),Le=Math.max(1,H.height>>ue);de===t.TEXTURE_3D||de===t.TEXTURE_2D_ARRAY?n.texImage3D(de,ue,Te,Ve,Le,H.depth,0,ge,be,null):n.texImage2D(de,ue,Te,Ve,Le,0,ge,be,null)}n.bindFramebuffer(t.FRAMEBUFFER,z),se(H)?f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,le,de,r.get(te).__webglTexture,0,ne(H)):(de===t.TEXTURE_2D||de>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&de<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,le,de,r.get(te).__webglTexture,ue),n.bindFramebuffer(t.FRAMEBUFFER,null)}function re(z,H,te){if(t.bindRenderbuffer(t.RENDERBUFFER,z),H.depthBuffer&&!H.stencilBuffer){let le=a===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(te||se(H)){const de=H.depthTexture;de&&de.isDepthTexture&&(de.type===Ua?le=t.DEPTH_COMPONENT32F:de.type===Au&&(le=t.DEPTH_COMPONENT24));const ue=ne(H);se(H)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ue,le,H.width,H.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,ue,le,H.width,H.height)}else t.renderbufferStorage(t.RENDERBUFFER,le,H.width,H.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,z)}else if(H.depthBuffer&&H.stencilBuffer){const le=ne(H);te&&se(H)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,le,t.DEPTH24_STENCIL8,H.width,H.height):se(H)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,le,t.DEPTH24_STENCIL8,H.width,H.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,H.width,H.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,z)}else{const le=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let de=0;de0){te.__webglFramebuffer[be]=[];for(let Te=0;Te0){te.__webglFramebuffer=[];for(let be=0;be0&&se(z)===!1){const be=ue?H:[H];te.__webglMultisampledFramebuffer=t.createFramebuffer(),te.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,te.__webglMultisampledFramebuffer);for(let Te=0;Te0)for(let Te=0;Te0)for(let Te=0;Te0&&se(z)===!1){const H=z.isWebGLMultipleRenderTargets?z.texture:[z.texture],te=z.width,le=z.height;let de=t.COLOR_BUFFER_BIT;const ue=[],ge=z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,be=r.get(z),Te=z.isWebGLMultipleRenderTargets===!0;if(Te)for(let Re=0;Re0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&H.__useRenderToTexture!==!1}function xe(z){const H=s.render.frame;p.get(z)!==H&&(p.set(z,H),z.update())}function Pe(z,H){const te=z.colorSpace,le=z.format,de=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||z.format===MS||te!==Ul&&te!==_s&&(Bn.getTransfer(te)===Zn?a===!1?e.has("EXT_sRGB")===!0&&le===Co?(z.format=MS,z.minFilter=Hr,z.generateMipmaps=!1):H=QN.sRGBToLinear(H):(le!==Co||de!==Ds)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",te)),H}this.allocateTextureUnit=L,this.resetTextureUnits=B,this.setTexture2D=W,this.setTexture2DArray=K,this.setTexture3D=Q,this.setTextureCube=J,this.rebindTextures=X,this.setupRenderTarget=Z,this.updateRenderTargetMipmap=he,this.updateMultisampleRenderTarget=Y,this.setupDepthRenderbuffer=Ce,this.setupFrameBufferTexture=Oe,this.useMultisampledRTT=se}function oX(t,e,n){const r=n.isWebGL2;function i(o,s=_s){let a;const l=Bn.getTransfer(s);if(o===Ds)return t.UNSIGNED_BYTE;if(o===VN)return t.UNSIGNED_SHORT_4_4_4_4;if(o===GN)return t.UNSIGNED_SHORT_5_5_5_1;if(o===_q)return t.BYTE;if(o===Sq)return t.SHORT;if(o===TE)return t.UNSIGNED_SHORT;if(o===HN)return t.INT;if(o===Au)return t.UNSIGNED_INT;if(o===Ua)return t.FLOAT;if(o===Uf)return r?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===Cq)return t.ALPHA;if(o===Co)return t.RGBA;if(o===Eq)return t.LUMINANCE;if(o===Mq)return t.LUMINANCE_ALPHA;if(o===Zc)return t.DEPTH_COMPONENT;if(o===Hf)return t.DEPTH_STENCIL;if(o===MS)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===jN)return t.RED;if(o===WN)return t.RED_INTEGER;if(o===Tq)return t.RG;if(o===qN)return t.RG_INTEGER;if(o===XN)return t.RGBA_INTEGER;if(o===o_||o===s_||o===a_||o===l_)if(l===Zn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===o_)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===s_)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===a_)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===l_)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===o_)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===s_)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===a_)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===l_)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===VD||o===GD||o===jD||o===WD)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===VD)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===GD)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===jD)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===WD)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===Aq)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===qD||o===XD)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(o===qD)return l===Zn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===XD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===KD||o===YD||o===ZD||o===QD||o===JD||o===eR||o===tR||o===nR||o===rR||o===iR||o===oR||o===sR||o===aR||o===lR)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(o===KD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===YD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===ZD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===QD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===JD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===eR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===tR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===nR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===rR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===iR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===oR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===sR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===aR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===lR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===u_||o===uR||o===cR)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(o===u_)return l===Zn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===uR)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===cR)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===Pq||o===dR||o===fR||o===hR)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(o===u_)return a.COMPRESSED_RED_RGTC1_EXT;if(o===dR)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===fR)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===hR)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return o===Yc?r?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class sX extends Si{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let nm=class extends Tn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const j3e={type:"move"};class iA{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new nm,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new nm,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new oe,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new oe),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new nm,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new oe,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new oe),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const g of e.hand.values()){const b=n.getJointPose(g,r),m=this._getHandJoint(u,g);b!==null&&(m.matrix.fromArray(b.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=b.radius),m.visible=b!==null}const c=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],f=c.position.distanceTo(d.position),h=.02,p=.005;u.inputState.pinching&&f>h+p?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=h-p&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(j3e)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new nm;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class aX extends Lr{constructor(e,n,r,i,o,s,a,l,u,c){if(c=c!==void 0?c:Zc,c!==Zc&&c!==Hf)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&c===Zc&&(r=Au),r===void 0&&c===Hf&&(r=Yc),super(null,i,o,s,a,l,c,r,u),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=a!==void 0?a:Nr,this.minFilter=l!==void 0?l:Nr,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class W3e extends Yu{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=1,u=null,c=null,d=null,f=null,h=null,p=null;const g=n.getContextAttributes();let b=null,m=null;const w=[],x=[],_=new Si;_.layers.enable(1),_.viewport=new kn;const C=new Si;C.layers.enable(2),C.viewport=new kn;const S=[_,C],M=new sX;M.layers.enable(1),M.layers.enable(2);let P=null,A=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let Q=w[K];return Q===void 0&&(Q=new iA,w[K]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(K){let Q=w[K];return Q===void 0&&(Q=new iA,w[K]=Q),Q.getGripSpace()},this.getHand=function(K){let Q=w[K];return Q===void 0&&(Q=new iA,w[K]=Q),Q.getHandSpace()};function R(K){const Q=x.indexOf(K.inputSource);if(Q===-1)return;const J=w[Q];J!==void 0&&(J.update(K.inputSource,K.frame,u||s),J.dispatchEvent({type:K.type,data:K.inputSource}))}function F(){i.removeEventListener("select",R),i.removeEventListener("selectstart",R),i.removeEventListener("selectend",R),i.removeEventListener("squeeze",R),i.removeEventListener("squeezestart",R),i.removeEventListener("squeezeend",R),i.removeEventListener("end",F),i.removeEventListener("inputsourceschange",$);for(let K=0;K=0&&(x[ae]=null,w[ae].disconnect(J))}for(let Q=0;Q=x.length){x.push(J),ae=fe;break}else if(x[fe]===null){x[fe]=J,ae=fe;break}if(ae===-1)break}const ve=w[ae];ve&&ve.connect(J)}}const j=new oe,k=new oe;function U(K,Q,J){j.setFromMatrixPosition(Q.matrixWorld),k.setFromMatrixPosition(J.matrixWorld);const ae=j.distanceTo(k),ve=Q.projectionMatrix.elements,fe=J.projectionMatrix.elements,Me=ve[14]/(ve[10]-1),ye=ve[14]/(ve[10]+1),we=(ve[9]+1)/ve[5],Fe=(ve[9]-1)/ve[5],Oe=(ve[8]-1)/ve[0],re=(fe[8]+1)/fe[0],_e=Me*Oe,Ce=Me*re,X=ae/(-Oe+re),Z=X*-Oe;Q.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(Z),K.translateZ(X),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();const he=Me+X,Y=ye+X,ne=_e-Z,se=Ce+(ae-Z),xe=we*ye/Y*he,Pe=Fe*ye/Y*he;K.projectionMatrix.makePerspective(ne,se,xe,Pe,he,Y),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function G(K,Q){Q===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(Q.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(i===null)return;M.near=C.near=_.near=K.near,M.far=C.far=_.far=K.far,(P!==M.near||A!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),P=M.near,A=M.far);const Q=K.parent,J=M.cameras;G(M,Q);for(let ae=0;ae0&&(b.alphaTest.value=m.alphaTest);const w=e.get(m).envMap;if(w&&(b.envMap.value=w,b.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=m.reflectivity,b.ior.value=m.ior,b.refractionRatio.value=m.refractionRatio),m.lightMap){b.lightMap.value=m.lightMap;const x=t._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=m.lightMapIntensity*x,n(m.lightMap,b.lightMapTransform)}m.aoMap&&(b.aoMap.value=m.aoMap,b.aoMapIntensity.value=m.aoMapIntensity,n(m.aoMap,b.aoMapTransform))}function s(b,m){b.diffuse.value.copy(m.color),b.opacity.value=m.opacity,m.map&&(b.map.value=m.map,n(m.map,b.mapTransform))}function a(b,m){b.dashSize.value=m.dashSize,b.totalSize.value=m.dashSize+m.gapSize,b.scale.value=m.scale}function l(b,m,w,x){b.diffuse.value.copy(m.color),b.opacity.value=m.opacity,b.size.value=m.size*w,b.scale.value=x*.5,m.map&&(b.map.value=m.map,n(m.map,b.uvTransform)),m.alphaMap&&(b.alphaMap.value=m.alphaMap,n(m.alphaMap,b.alphaMapTransform)),m.alphaTest>0&&(b.alphaTest.value=m.alphaTest)}function u(b,m){b.diffuse.value.copy(m.color),b.opacity.value=m.opacity,b.rotation.value=m.rotation,m.map&&(b.map.value=m.map,n(m.map,b.mapTransform)),m.alphaMap&&(b.alphaMap.value=m.alphaMap,n(m.alphaMap,b.alphaMapTransform)),m.alphaTest>0&&(b.alphaTest.value=m.alphaTest)}function c(b,m){b.specular.value.copy(m.specular),b.shininess.value=Math.max(m.shininess,1e-4)}function d(b,m){m.gradientMap&&(b.gradientMap.value=m.gradientMap)}function f(b,m){b.metalness.value=m.metalness,m.metalnessMap&&(b.metalnessMap.value=m.metalnessMap,n(m.metalnessMap,b.metalnessMapTransform)),b.roughness.value=m.roughness,m.roughnessMap&&(b.roughnessMap.value=m.roughnessMap,n(m.roughnessMap,b.roughnessMapTransform)),e.get(m).envMap&&(b.envMapIntensity.value=m.envMapIntensity)}function h(b,m,w){b.ior.value=m.ior,m.sheen>0&&(b.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),b.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(b.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,b.sheenColorMapTransform)),m.sheenRoughnessMap&&(b.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,b.sheenRoughnessMapTransform))),m.clearcoat>0&&(b.clearcoat.value=m.clearcoat,b.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(b.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,b.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(b.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Ao&&b.clearcoatNormalScale.value.negate())),m.iridescence>0&&(b.iridescence.value=m.iridescence,b.iridescenceIOR.value=m.iridescenceIOR,b.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(b.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,b.iridescenceMapTransform)),m.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),m.transmission>0&&(b.transmission.value=m.transmission,b.transmissionSamplerMap.value=w.texture,b.transmissionSamplerSize.value.set(w.width,w.height),m.transmissionMap&&(b.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,b.transmissionMapTransform)),b.thickness.value=m.thickness,m.thicknessMap&&(b.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=m.attenuationDistance,b.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(b.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(b.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=m.specularIntensity,b.specularColor.value.copy(m.specularColor),m.specularColorMap&&(b.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,b.specularColorMapTransform)),m.specularIntensityMap&&(b.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,b.specularIntensityMapTransform))}function p(b,m){m.matcap&&(b.matcap.value=m.matcap)}function g(b,m){const w=e.get(m).light;b.referencePosition.value.setFromMatrixPosition(w.matrixWorld),b.nearDistance.value=w.shadow.camera.near,b.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function X3e(t,e,n,r){let i={},o={},s=[];const a=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(w,x){const _=x.program;r.uniformBlockBinding(w,_)}function u(w,x){let _=i[w.id];_===void 0&&(p(w),_=c(w),i[w.id]=_,w.addEventListener("dispose",b));const C=x.program;r.updateUBOMapping(w,C);const S=e.render.frame;o[w.id]!==S&&(f(w),o[w.id]=S)}function c(w){const x=d();w.__bindingPointIndex=x;const _=t.createBuffer(),C=w.__size,S=w.usage;return t.bindBuffer(t.UNIFORM_BUFFER,_),t.bufferData(t.UNIFORM_BUFFER,C,S),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,x,_),_}function d(){for(let w=0;w0){S=_%C;const $=C-S;S!==0&&$-R.boundary<0&&(_+=C-S,A.__offset=_)}_+=R.storage}return S=_%C,S>0&&(_+=C-S),w.__size=_,w.__cache={},this}function g(w){const x={boundary:0,storage:0};return typeof w=="number"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function b(w){const x=w.target;x.removeEventListener("dispose",b);const _=s.indexOf(x.__bindingPointIndex);s.splice(_,1),t.deleteBuffer(i[x.id]),delete i[x.id],delete o[x.id]}function m(){for(const w in i)t.deleteBuffer(i[w]);s=[],i={},o={}}return{bind:l,update:u,dispose:m}}class oF{constructor(e={}){const{canvas:n=qq(),context:r=null,depth:i=!0,stencil:o=!0,alpha:s=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let f;r!==null?f=r.getContextAttributes().alpha:f=s;const h=new Uint32Array(4),p=new Int32Array(4);let g=null,b=null;const m=[],w=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ai,this._useLegacyLights=!1,this.toneMapping=Nl,this.toneMappingExposure=1;const x=this;let _=!1,C=0,S=0,M=null,P=-1,A=null;const R=new kn,F=new kn;let $=null;const j=new vt(0);let k=0,U=n.width,G=n.height,B=1,L=null,N=null;const W=new kn(0,0,U,G),K=new kn(0,0,U,G);let Q=!1;const J=new RE;let ae=!1,ve=!1,fe=null;const Me=new qt,ye=new Xe,we=new oe,Fe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Oe(){return M===null?B:1}let re=r;function _e(ee,pe){for(let Ae=0;Ae{function at(){if(Ee.forEach(function(_t){Y.get(_t).currentProgram.isReady()&&Ee.delete(_t)}),Ee.size===0){ke(ee);return}setTimeout(at,10)}Ce.get("KHR_parallel_shader_compile")!==null?at():setTimeout(at,10)})};let Qt=null;function Fn(ee){Qt&&Qt(ee)}function Vn(){Wt.stop()}function Ut(){Wt.start()}const Wt=new eX;Wt.setAnimationLoop(Fn),typeof self<"u"&&Wt.setContext(self),this.setAnimationLoop=function(ee){Qt=ee,Je.setAnimationLoop(ee),ee===null?Wt.stop():Wt.start()},Je.addEventListener("sessionstart",Vn),Je.addEventListener("sessionend",Ut),this.render=function(ee,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(_===!0)return;ee.matrixWorldAutoUpdate===!0&&ee.updateMatrixWorld(),pe.parent===null&&pe.matrixWorldAutoUpdate===!0&&pe.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(pe),pe=Je.getCamera()),ee.isScene===!0&&ee.onBeforeRender(x,ee,pe,M),b=ue.get(ee,w.length),b.init(),w.push(b),Me.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),J.setFromProjectionMatrix(Me),ve=this.localClippingEnabled,ae=ge.init(this.clippingPlanes,ve),g=de.get(ee,m.length),g.init(),m.push(g),On(ee,pe,0,x.sortObjects),g.finish(),x.sortObjects===!0&&g.sort(L,N),this.info.render.frame++,ae===!0&&ge.beginShadows();const Ae=b.state.shadowsArray;if(be.render(Ae,ee,pe),ae===!0&&ge.endShadows(),this.info.autoReset===!0&&this.info.reset(),Te.render(g,ee),b.setupLights(x._useLegacyLights),pe.isArrayCamera){const Ee=pe.cameras;for(let ke=0,at=Ee.length;ke0?b=w[w.length-1]:b=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function On(ee,pe,Ae,Ee){if(ee.visible===!1)return;if(ee.layers.test(pe.layers)){if(ee.isGroup)Ae=ee.renderOrder;else if(ee.isLOD)ee.autoUpdate===!0&&ee.update(pe);else if(ee.isLight)b.pushLight(ee),ee.castShadow&&b.pushShadow(ee);else if(ee.isSprite){if(!ee.frustumCulled||J.intersectsSprite(ee)){Ee&&we.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(Me);const _t=H.update(ee),Nt=ee.material;Nt.visible&&g.push(ee,_t,Nt,Ae,we.z,null)}}else if((ee.isMesh||ee.isLine||ee.isPoints)&&(!ee.frustumCulled||J.intersectsObject(ee))){const _t=H.update(ee),Nt=ee.material;if(Ee&&(ee.boundingSphere!==void 0?(ee.boundingSphere===null&&ee.computeBoundingSphere(),we.copy(ee.boundingSphere.center)):(_t.boundingSphere===null&&_t.computeBoundingSphere(),we.copy(_t.boundingSphere.center)),we.applyMatrix4(ee.matrixWorld).applyMatrix4(Me)),Array.isArray(Nt)){const lt=_t.groups;for(let Et=0,Ht=lt.length;Et0&&Ii(ke,at,pe,Ae),Ee&&Z.viewport(R.copy(Ee)),ke.length>0&&Io(ke,pe,Ae),at.length>0&&Io(at,pe,Ae),_t.length>0&&Io(_t,pe,Ae),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Ii(ee,pe,Ae,Ee){if((Ae.isScene===!0?Ae.overrideMaterial:null)!==null)return;const at=X.isWebGL2;fe===null&&(fe=new Qa(1,1,{generateMipmaps:!0,type:Ce.has("EXT_color_buffer_half_float")?Uf:Ds,minFilter:ud,samples:at?4:0})),x.getDrawingBufferSize(ye),at?fe.setSize(ye.x,ye.y):fe.setSize(TS(ye.x),TS(ye.y));const _t=x.getRenderTarget();x.setRenderTarget(fe),x.getClearColor(j),k=x.getClearAlpha(),k<1&&x.setClearColor(16777215,.5),x.clear();const Nt=x.toneMapping;x.toneMapping=Nl,Io(ee,Ae,Ee),ne.updateMultisampleRenderTarget(fe),ne.updateRenderTargetMipmap(fe);let lt=!1;for(let Et=0,Ht=pe.length;Et0),zt=!!Ae.morphAttributes.position,Ln=!!Ae.morphAttributes.normal,ei=!!Ae.morphAttributes.color;let er=Nl;Ee.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(er=x.toneMapping);const hi=Ae.morphAttributes.position||Ae.morphAttributes.normal||Ae.morphAttributes.color,Vt=hi!==void 0?hi.length:0,xt=Y.get(Ee),Bs=b.state.lights;if(ae===!0&&(ve===!0||ee!==A)){const mi=ee===A&&Ee.id===P;ge.setState(Ee,ee,mi)}let un=!1;Ee.version===xt.__version?(xt.needsLights&&xt.lightsStateVersion!==Bs.state.version||xt.outputColorSpace!==Nt||ke.isInstancedMesh&&xt.instancing===!1||!ke.isInstancedMesh&&xt.instancing===!0||ke.isSkinnedMesh&&xt.skinning===!1||!ke.isSkinnedMesh&&xt.skinning===!0||ke.isInstancedMesh&&xt.instancingColor===!0&&ke.instanceColor===null||ke.isInstancedMesh&&xt.instancingColor===!1&&ke.instanceColor!==null||xt.envMap!==lt||Ee.fog===!0&&xt.fog!==at||xt.numClippingPlanes!==void 0&&(xt.numClippingPlanes!==ge.numPlanes||xt.numIntersection!==ge.numIntersection)||xt.vertexAlphas!==Et||xt.vertexTangents!==Ht||xt.morphTargets!==zt||xt.morphNormals!==Ln||xt.morphColors!==ei||xt.toneMapping!==er||X.isWebGL2===!0&&xt.morphTargetsCount!==Vt)&&(un=!0):(un=!0,xt.__version=Ee.version);let Mr=xt.currentProgram;un===!0&&(Mr=Ni(Ee,pe,ke));let ol=!1,$s=!1,pi=!1;const Wr=Mr.getUniforms(),sl=xt.uniforms;if(Z.useProgram(Mr.program)&&(ol=!0,$s=!0,pi=!0),Ee.id!==P&&(P=Ee.id,$s=!0),ol||A!==ee){Wr.setValue(re,"projectionMatrix",ee.projectionMatrix),Wr.setValue(re,"viewMatrix",ee.matrixWorldInverse);const mi=Wr.map.cameraPosition;mi!==void 0&&mi.setValue(re,we.setFromMatrixPosition(ee.matrixWorld)),X.logarithmicDepthBuffer&&Wr.setValue(re,"logDepthBufFC",2/(Math.log(ee.far+1)/Math.LN2)),(Ee.isMeshPhongMaterial||Ee.isMeshToonMaterial||Ee.isMeshLambertMaterial||Ee.isMeshBasicMaterial||Ee.isMeshStandardMaterial||Ee.isShaderMaterial)&&Wr.setValue(re,"isOrthographic",ee.isOrthographicCamera===!0),A!==ee&&(A=ee,$s=!0,pi=!0)}if(ke.isSkinnedMesh){Wr.setOptional(re,ke,"bindMatrix"),Wr.setOptional(re,ke,"bindMatrixInverse");const mi=ke.skeleton;mi&&(X.floatVertexTextures?(mi.boneTexture===null&&mi.computeBoneTexture(),Wr.setValue(re,"boneTexture",mi.boneTexture,ne),Wr.setValue(re,"boneTextureSize",mi.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const vh=Ae.morphAttributes;if((vh.position!==void 0||vh.normal!==void 0||vh.color!==void 0&&X.isWebGL2===!0)&&Re.update(ke,Ae,Mr),($s||xt.receiveShadow!==ke.receiveShadow)&&(xt.receiveShadow=ke.receiveShadow,Wr.setValue(re,"receiveShadow",ke.receiveShadow)),Ee.isMeshGouraudMaterial&&Ee.envMap!==null&&(sl.envMap.value=lt,sl.flipEnvMap.value=lt.isCubeTexture&<.isRenderTargetTexture===!1?-1:1),$s&&(Wr.setValue(re,"toneMappingExposure",x.toneMappingExposure),xt.needsLights&&qe(sl,pi),at&&Ee.fog===!0&&le.refreshFogUniforms(sl,at),le.refreshMaterialUniforms(sl,Ee,B,G,fe),d_.upload(re,co(xt),sl,ne)),Ee.isShaderMaterial&&Ee.uniformsNeedUpdate===!0&&(d_.upload(re,co(xt),sl,ne),Ee.uniformsNeedUpdate=!1),Ee.isSpriteMaterial&&Wr.setValue(re,"center",ke.center),Wr.setValue(re,"modelViewMatrix",ke.modelViewMatrix),Wr.setValue(re,"normalMatrix",ke.normalMatrix),Wr.setValue(re,"modelMatrix",ke.matrixWorld),Ee.isShaderMaterial||Ee.isRawShaderMaterial){const mi=Ee.uniformsGroups;for(let yh=0,os=mi.length;yh0&&ne.useMultisampledRTT(ee)===!1?ke=Y.get(ee).__webglMultisampledFramebuffer:Array.isArray(Ht)?ke=Ht[Ae]:ke=Ht,R.copy(ee.viewport),F.copy(ee.scissor),$=ee.scissorTest}else R.copy(W).multiplyScalar(B).floor(),F.copy(K).multiplyScalar(B).floor(),$=Q;if(Z.bindFramebuffer(re.FRAMEBUFFER,ke)&&X.drawBuffers&&Ee&&Z.drawBuffers(ee,ke),Z.viewport(R),Z.scissor(F),Z.setScissorTest($),at){const lt=Y.get(ee.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+pe,lt.__webglTexture,Ae)}else if(_t){const lt=Y.get(ee.texture),Et=pe||0;re.framebufferTextureLayer(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,lt.__webglTexture,Ae||0,Et)}P=-1},this.readRenderTargetPixels=function(ee,pe,Ae,Ee,ke,at,_t){if(!(ee&&ee.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Nt=Y.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&_t!==void 0&&(Nt=Nt[_t]),Nt){Z.bindFramebuffer(re.FRAMEBUFFER,Nt);try{const lt=ee.texture,Et=lt.format,Ht=lt.type;if(Et!==Co&&Ye.convert(Et)!==re.getParameter(re.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const zt=Ht===Uf&&(Ce.has("EXT_color_buffer_half_float")||X.isWebGL2&&Ce.has("EXT_color_buffer_float"));if(Ht!==Ds&&Ye.convert(Ht)!==re.getParameter(re.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ht===Ua&&(X.isWebGL2||Ce.has("OES_texture_float")||Ce.has("WEBGL_color_buffer_float")))&&!zt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}pe>=0&&pe<=ee.width-Ee&&Ae>=0&&Ae<=ee.height-ke&&re.readPixels(pe,Ae,Ee,ke,Ye.convert(Et),Ye.convert(Ht),at)}finally{const lt=M!==null?Y.get(M).__webglFramebuffer:null;Z.bindFramebuffer(re.FRAMEBUFFER,lt)}}},this.copyFramebufferToTexture=function(ee,pe,Ae=0){const Ee=Math.pow(2,-Ae),ke=Math.floor(pe.image.width*Ee),at=Math.floor(pe.image.height*Ee);ne.setTexture2D(pe,0),re.copyTexSubImage2D(re.TEXTURE_2D,Ae,0,0,ee.x,ee.y,ke,at),Z.unbindTexture()},this.copyTextureToTexture=function(ee,pe,Ae,Ee=0){const ke=pe.image.width,at=pe.image.height,_t=Ye.convert(Ae.format),Nt=Ye.convert(Ae.type);ne.setTexture2D(Ae,0),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,Ae.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ae.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,Ae.unpackAlignment),pe.isDataTexture?re.texSubImage2D(re.TEXTURE_2D,Ee,ee.x,ee.y,ke,at,_t,Nt,pe.image.data):pe.isCompressedTexture?re.compressedTexSubImage2D(re.TEXTURE_2D,Ee,ee.x,ee.y,pe.mipmaps[0].width,pe.mipmaps[0].height,_t,pe.mipmaps[0].data):re.texSubImage2D(re.TEXTURE_2D,Ee,ee.x,ee.y,_t,Nt,pe.image),Ee===0&&Ae.generateMipmaps&&re.generateMipmap(re.TEXTURE_2D),Z.unbindTexture()},this.copyTextureToTexture3D=function(ee,pe,Ae,Ee,ke=0){if(x.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const at=ee.max.x-ee.min.x+1,_t=ee.max.y-ee.min.y+1,Nt=ee.max.z-ee.min.z+1,lt=Ye.convert(Ee.format),Et=Ye.convert(Ee.type);let Ht;if(Ee.isData3DTexture)ne.setTexture3D(Ee,0),Ht=re.TEXTURE_3D;else if(Ee.isDataArrayTexture)ne.setTexture2DArray(Ee,0),Ht=re.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,Ee.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ee.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,Ee.unpackAlignment);const zt=re.getParameter(re.UNPACK_ROW_LENGTH),Ln=re.getParameter(re.UNPACK_IMAGE_HEIGHT),ei=re.getParameter(re.UNPACK_SKIP_PIXELS),er=re.getParameter(re.UNPACK_SKIP_ROWS),hi=re.getParameter(re.UNPACK_SKIP_IMAGES),Vt=Ae.isCompressedTexture?Ae.mipmaps[0]:Ae.image;re.pixelStorei(re.UNPACK_ROW_LENGTH,Vt.width),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,Vt.height),re.pixelStorei(re.UNPACK_SKIP_PIXELS,ee.min.x),re.pixelStorei(re.UNPACK_SKIP_ROWS,ee.min.y),re.pixelStorei(re.UNPACK_SKIP_IMAGES,ee.min.z),Ae.isDataTexture||Ae.isData3DTexture?re.texSubImage3D(Ht,ke,pe.x,pe.y,pe.z,at,_t,Nt,lt,Et,Vt.data):Ae.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),re.compressedTexSubImage3D(Ht,ke,pe.x,pe.y,pe.z,at,_t,Nt,lt,Vt.data)):re.texSubImage3D(Ht,ke,pe.x,pe.y,pe.z,at,_t,Nt,lt,Et,Vt),re.pixelStorei(re.UNPACK_ROW_LENGTH,zt),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,Ln),re.pixelStorei(re.UNPACK_SKIP_PIXELS,ei),re.pixelStorei(re.UNPACK_SKIP_ROWS,er),re.pixelStorei(re.UNPACK_SKIP_IMAGES,hi),ke===0&&Ee.generateMipmaps&&re.generateMipmap(Ht),Z.unbindTexture()},this.initTexture=function(ee){ee.isCubeTexture?ne.setTextureCube(ee,0):ee.isData3DTexture?ne.setTexture3D(ee,0):ee.isDataArrayTexture||ee.isCompressedArrayTexture?ne.setTexture2DArray(ee,0):ne.setTexture2D(ee,0),Z.unbindTexture()},this.resetState=function(){C=0,S=0,M=null,Z.reset(),it.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Tl}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===PE?"display-p3":"srgb",n.unpackColorSpace=Bn.workingColorSpace===Ab?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===ai?Qc:YN}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Qc?ai:Ul}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class lX extends oF{}lX.prototype.isWebGL1Renderer=!0;class NE{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new vt(e),this.density=n}clone(){return new NE(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class FE{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new vt(e),this.near=n,this.far=r}clone(){return new FE(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class AS extends Tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}}class OE{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Ty,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Rs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;ie.far||n.push({distance:l,point:_0.clone(),uv:Uo.getInterpolation(_0,qx,C0,Xx,R6,oA,I6,new Xe),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Kx(t,e,n,r,i,o){ap.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(S0.x=o*ap.x-i*ap.y,S0.y=i*ap.x+o*ap.y):S0.copy(ap),t.copy(e),t.x+=S0.x,t.y+=S0.y,t.applyMatrix4(uX)}const Yx=new oe,N6=new oe;class dX extends Tn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const n=e.levels;for(let r=0,i=n.length;r0){let r,i;for(r=1,i=n.length;r0){Yx.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Yx);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Yx.setFromMatrixPosition(e.matrixWorld),N6.setFromMatrixPosition(this.matrixWorld);const r=Yx.distanceTo(N6)/e.zoom;n[0].object.visible=!0;let i,o;for(i=1,o=n.length;i=s)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;il)continue;f.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(f);Pe.far||n.push({distance:P,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,s.start),w=Math.min(b.count,s.start+s.count);for(let x=m,_=w-1;x<_;x+=h){if(u.fromBufferAttribute(b,x),c.fromBufferAttribute(b,x+1),lA.distanceSqToSegment(u,c,f,d)>l)continue;f.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(f);Se.far||n.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;oi.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:s})}}class Q3e extends Lr{constructor(e,n,r,i,o,s,a,l,u){super(e,n,r,i,o,s,a,l,u),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:Hr,this.magFilter=o!==void 0?o:Hr,this.generateMipmaps=!1;const c=this;function d(){c.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class J3e extends Lr{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=Nr,this.minFilter=Nr,this.generateMipmaps=!1,this.needsUpdate=!0}}class LE extends Lr{constructor(e,n,r,i,o,s,a,l,u,c,d,f){super(null,s,a,l,u,c,i,o,d,f),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class eIe extends LE{constructor(e,n,r,i,o,s){super(e,n,r,o,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ci}}class tIe extends LE{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,Hu),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class nIe extends Lr{constructor(e,n,r,i,o,s,a,l,u){super(e,n,r,i,o,s,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class tl{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const n=[];let r,i=this.getPoint(0),o=0;n.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),o+=r.distanceTo(i),n.push(o),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const r=this.getLengths();let i=0;const o=r.length;let s;n?s=n:s=e*r[o-1];let a=0,l=o-1,u;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),u=r[i]-s,u<0)a=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(o-1);const c=r[i],f=r[i+1]-c,h=(s-c)/f;return(i+h)/(o-1)}getTangent(e,n){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const s=this.getPoint(i),a=this.getPoint(o),l=n||(s.isVector2?new Xe:new oe);return l.copy(a).sub(s).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new oe,i=[],o=[],s=[],a=new oe,l=new qt;for(let h=0;h<=e;h++){const p=h/e;i[h]=this.getTangentAt(p,new oe)}o[0]=new oe,s[0]=new oe;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),d=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),d<=u&&(u=d,r.set(0,1,0)),f<=u&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),o[0].crossVectors(i[0],a),s[0].crossVectors(i[0],o[0]);for(let h=1;h<=e;h++){if(o[h]=o[h-1].clone(),s[h]=s[h-1].clone(),a.crossVectors(i[h-1],i[h]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(Fr(i[h-1].dot(i[h]),-1,1));o[h].applyMatrix4(l.makeRotationAxis(a,p))}s[h].crossVectors(i[h],o[h])}if(n===!0){let h=Math.acos(Fr(o[0].dot(o[e]),-1,1));h/=e,i[0].dot(a.crossVectors(o[0],o[e]))>0&&(h=-h);for(let p=1;p<=e;p++)o[p].applyMatrix4(l.makeRotationAxis(i[p],h*p)),s[p].crossVectors(i[p],o[p])}return{tangents:i,normals:o,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class BE extends tl{constructor(e=0,n=0,r=1,i=1,o=0,s=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,n){const r=n||new Xe,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)i;)o-=i;o0?0:(Math.floor(Math.abs(a)/o)+1)*o:l===0&&a===o-1&&(a=o-2,l=1);let u,c;this.closed||a>0?u=i[(a-1)%o]:(nw.subVectors(i[0],i[1]).add(i[0]),u=nw);const d=i[a%o],f=i[(a+1)%o];if(this.closed||a+2i.length-2?i.length-1:s+1],d=i[s>i.length-3?i.length-1:s+2];return r.set(K6(a,l.x,u.x,c.x,d.x),K6(a,l.y,u.y,c.y,d.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const s=i[o]-r,a=this.curves[o],l=a.getLength(),u=l===0?0:1-s/l;return a.getPointAt(u,n)}o++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let r=0,i=this.curves.length;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Fb extends rn{constructor(e=[new Xe(0,-.5),new Xe(.5,0),new Xe(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=Fr(i,0,Math.PI*2);const o=[],s=[],a=[],l=[],u=[],c=1/n,d=new oe,f=new Xe,h=new oe,p=new oe,g=new oe;let b=0,m=0;for(let w=0;w<=e.length-1;w++)switch(w){case 0:b=e[w+1].x-e[w].x,m=e[w+1].y-e[w].y,h.x=m*1,h.y=-b,h.z=m*0,g.copy(h),h.normalize(),l.push(h.x,h.y,h.z);break;case e.length-1:l.push(g.x,g.y,g.z);break;default:b=e[w+1].x-e[w].x,m=e[w+1].y-e[w].y,h.x=m*1,h.y=-b,h.z=m*0,p.copy(h),h.x+=g.x,h.y+=g.y,h.z+=g.z,h.normalize(),l.push(h.x,h.y,h.z),g.copy(p)}for(let w=0;w<=n;w++){const x=r+w*c*i,_=Math.sin(x),C=Math.cos(x);for(let S=0;S<=e.length-1;S++){d.x=e[S].x*_,d.y=e[S].y,d.z=e[S].x*C,s.push(d.x,d.y,d.z),f.x=w/n,f.y=S/(e.length-1),a.push(f.x,f.y);const M=l[3*S+0]*_,P=l[3*S+1],A=l[3*S+0]*C;u.push(M,P,A)}}for(let w=0;w0&&x(!0),n>0&&x(!1)),this.setIndex(c),this.setAttribute("position",new Ct(d,3)),this.setAttribute("normal",new Ct(f,3)),this.setAttribute("uv",new Ct(h,2));function w(){const _=new oe,C=new oe;let S=0;const M=(n-e)/r;for(let P=0;P<=o;P++){const A=[],R=P/o,F=R*(n-e)+e;for(let $=0;$<=i;$++){const j=$/i,k=j*l+a,U=Math.sin(k),G=Math.cos(k);C.x=F*U,C.y=-R*r+b,C.z=F*G,d.push(C.x,C.y,C.z),_.set(U,M,G).normalize(),f.push(_.x,_.y,_.z),h.push(j,1-R),A.push(p++)}g.push(A)}for(let P=0;P.9&&M<.1&&(x<.2&&(s[w+0]+=1),_<.2&&(s[w+2]+=1),C<.2&&(s[w+4]+=1))}}function f(w){o.push(w.x,w.y,w.z)}function h(w,x){const _=w*3;x.x=e[_+0],x.y=e[_+1],x.z=e[_+2]}function p(){const w=new oe,x=new oe,_=new oe,C=new oe,S=new Xe,M=new Xe,P=new Xe;for(let A=0,R=0;A80*n){a=u=t[0],l=c=t[1];for(let p=n;pu&&(u=d),f>c&&(c=f);h=Math.max(u-a,c-l),h=h!==0?32767/h:0}return Ry(o,s,n,a,l,h,0),s}};function _X(t,e,n,r,i){let o,s;if(i===MIe(t,e,n,r)>0)for(o=e;o=e;o-=r)s=Y6(o,t[o],t[o+1],s);return s&&VE(s,s.next)&&(Ny(s),s=s.next),s}function Gf(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(VE(n,n.next)||xr(n.prev,n,n.next)===0)){if(Ny(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function Ry(t,e,n,r,i,o,s){if(!t)return;!s&&o&&xIe(t,r,i,o);let a=t,l,u;for(;t.prev!==t.next;){if(l=t.prev,u=t.next,o?fIe(t,r,i,o):dIe(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Ny(t),t=u.next,a=u.next;continue}if(t=u,t===a){s?s===1?(t=hIe(Gf(t),e,n),Ry(t,e,n,r,i,o,2)):s===2&&pIe(t,e,n,r,i,o):Ry(Gf(t),e,n,r,i,o,1);break}}}function dIe(t){const e=t.prev,n=t,r=t.next;if(xr(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,c=io?i>s?i:s:o>s?o:s,h=a>l?a>u?a:u:l>u?l:u;let p=r.next;for(;p!==e;){if(p.x>=c&&p.x<=f&&p.y>=d&&p.y<=h&&rm(i,a,o,l,s,u,p.x,p.y)&&xr(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function fIe(t,e,n,r){const i=t.prev,o=t,s=t.next;if(xr(i,o,s)>=0)return!1;const a=i.x,l=o.x,u=s.x,c=i.y,d=o.y,f=s.y,h=al?a>u?a:u:l>u?l:u,b=c>d?c>f?c:f:d>f?d:f,m=xR(h,p,e,n,r),w=xR(g,b,e,n,r);let x=t.prevZ,_=t.nextZ;for(;x&&x.z>=m&&_&&_.z<=w;){if(x.x>=h&&x.x<=g&&x.y>=p&&x.y<=b&&x!==i&&x!==s&&rm(a,c,l,d,u,f,x.x,x.y)&&xr(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=h&&_.x<=g&&_.y>=p&&_.y<=b&&_!==i&&_!==s&&rm(a,c,l,d,u,f,_.x,_.y)&&xr(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;x&&x.z>=m;){if(x.x>=h&&x.x<=g&&x.y>=p&&x.y<=b&&x!==i&&x!==s&&rm(a,c,l,d,u,f,x.x,x.y)&&xr(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=w;){if(_.x>=h&&_.x<=g&&_.y>=p&&_.y<=b&&_!==i&&_!==s&&rm(a,c,l,d,u,f,_.x,_.y)&&xr(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function hIe(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!VE(i,o)&&SX(i,r,r.next,o)&&Iy(i,o)&&Iy(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Ny(r),Ny(r.next),r=t=o),r=r.next}while(r!==t);return Gf(r)}function pIe(t,e,n,r,i,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&SIe(s,a)){let l=CX(s,a);s=Gf(s,s.next),l=Gf(l,l.next),Ry(s,e,n,r,i,o,0),Ry(l,e,n,r,i,o,0);return}a=a.next}s=s.next}while(s!==t)}function mIe(t,e,n,r){const i=[];let o,s,a,l,u;for(o=0,s=e.length;o=n.next.y&&n.next.y!==n.y){const f=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=o&&f>r&&(r=f,i=n.x=n.x&&n.x>=l&&o!==n.x&&rm(si.x||n.x===i.x&&bIe(i,n)))&&(i=n,c=d)),n=n.next;while(n!==a);return i}function bIe(t,e){return xr(t.prev,t,e.prev)<0&&xr(e.next,t,t.next)<0}function xIe(t,e,n,r){let i=t;do i.z===0&&(i.z=xR(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,wIe(i)}function wIe(t){let e,n,r,i,o,s,a,l,u=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||l>0&&r;)a!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(s>1);return t}function xR(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function _Ie(t){let e=t,n=t;do(e.x=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function SIe(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!CIe(t,e)&&(Iy(t,e)&&Iy(e,t)&&EIe(t,e)&&(xr(t.prev,t,e.prev)||xr(t,e.prev,e))||VE(t,e)&&xr(t.prev,t,t.next)>0&&xr(e.prev,e,e.next)>0)}function xr(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function VE(t,e){return t.x===e.x&&t.y===e.y}function SX(t,e,n,r){const i=aw(xr(t,e,n)),o=aw(xr(t,e,r)),s=aw(xr(n,r,t)),a=aw(xr(n,r,e));return!!(i!==o&&s!==a||i===0&&sw(t,n,e)||o===0&&sw(t,r,e)||s===0&&sw(n,t,r)||a===0&&sw(n,e,r))}function sw(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function aw(t){return t>0?1:t<0?-1:0}function CIe(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&SX(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Iy(t,e){return xr(t.prev,t,t.next)<0?xr(t,e,t.next)>=0&&xr(t,t.prev,e)>=0:xr(t,e,t.prev)<0||xr(t,t.next,e)<0}function EIe(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function CX(t,e){const n=new wR(t.i,t.x,t.y),r=new wR(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Y6(t,e,n,r){const i=new wR(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ny(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function wR(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function MIe(t,e,n,r){let i=0;for(let o=e,s=n-r;o2&&t[e-1].equals(t[0])&&t.pop()}function Q6(t,e){for(let n=0;nNumber.EPSILON){const H=Math.sqrt(Pe),te=Math.sqrt(se*se+xe*xe),le=_e.x-ne/H,de=_e.y+Y/H,ue=Ce.x-xe/te,ge=Ce.y+se/te,be=((ue-le)*xe-(ge-de)*se)/(Y*xe-ne*se);X=le+Y*be-re.x,Z=de+ne*be-re.y;const Te=X*X+Z*Z;if(Te<=2)return new Xe(X,Z);he=Math.sqrt(Te/2)}else{let H=!1;Y>Number.EPSILON?se>Number.EPSILON&&(H=!0):Y<-Number.EPSILON?se<-Number.EPSILON&&(H=!0):Math.sign(ne)===Math.sign(xe)&&(H=!0),H?(X=-ne,Z=Y,he=Math.sqrt(Pe)):(X=Y,Z=ne,he=Math.sqrt(Pe/2))}return new Xe(X/he,Z/he)}const N=[];for(let re=0,_e=k.length,Ce=_e-1,X=re+1;re<_e;re++,Ce++,X++)Ce===_e&&(Ce=0),X===_e&&(X=0),N[re]=L(k[re],k[Ce],k[X]);const W=[];let K,Q=N.concat();for(let re=0,_e=F.length;re<_e;re++){const Ce=F[re];K=[];for(let X=0,Z=Ce.length,he=Z-1,Y=X+1;X=0;re--){const _e=re/b,Ce=h*Math.cos(_e*Math.PI/2),X=p*Math.sin(_e*Math.PI/2)+g;for(let Z=0,he=k.length;Z=0;){const X=Ce;let Z=Ce-1;Z<0&&(Z=re.length-1);for(let he=0,Y=c+b*2;he0)&&h.push(x,_,S),(m!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PX extends ji{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new vt(16777215),this.specular=new vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class DX extends ji{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new vt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class RX extends ji{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class IX extends ji{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class NX extends ji{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new vt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class FX extends Ro{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function gf(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function OX(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function kX(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function _R(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,s=0;s!==r;++o){const a=n[o]*e;for(let l=0;l!==e;++l)i[s++]=t[a+l]}return i}function gF(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let s=o[r];if(s!==void 0)if(Array.isArray(s))do s=o[r],s!==void 0&&(e.push(o.time),n.push.apply(n,s)),o=t[i++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[r],s!==void 0&&(e.push(o.time),s.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do s=o[r],s!==void 0&&(e.push(o.time),n.push(s)),o=t[i++];while(o!==void 0)}function DIe(t,e,n,r,i=30){const o=t.clone();o.name=e;const s=[];for(let l=0;l=r)){d.push(u.times[h]);for(let g=0;go.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*d+c,w=m+d-c;g=a.values.slice(m,w)}else{const m=a.createInterpolant(),w=c,x=d-c;m.evaluate(o),g=m.resultBuffer.slice(w,x)}l==="quaternion"&&new Yo().fromArray(g).normalize().conjugate().toArray(g);const b=u.times.length;for(let m=0;m=o)){const a=n[1];e=o)break t}s=r,r=0;break n}break e}for(;r>>1;en;)--s;if(++s,o!==0||s!==i){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=r.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==o;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),e=!1;break}s=l}if(i!==void 0&&OX(i))for(let a=0,l=i.length;a!==l;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===c_,o=e.length-1;let s=1;for(let a=1;a0){e[s]=e[o];for(let a=o*r,l=s*r,u=0;u!==r;++u)n[l+u]=n[a+u];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}nl.prototype.TimeBufferType=Float32Array;nl.prototype.ValueBufferType=Float32Array;nl.prototype.DefaultInterpolation=_y;class oh extends nl{}oh.prototype.ValueTypeName="bool";oh.prototype.ValueBufferType=Array;oh.prototype.DefaultInterpolation=wy;oh.prototype.InterpolantFactoryMethodLinear=void 0;oh.prototype.InterpolantFactoryMethodSmooth=void 0;class yF extends nl{}yF.prototype.ValueTypeName="color";class Fy extends nl{}Fy.prototype.ValueTypeName="number";class $X extends Lb{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(r-n)/(i-n);let u=e*a;for(let c=u+a;u!==c;u+=4)Yo.slerpFlat(o,0,s,u-a,s,u,l);return o}}class _g extends nl{InterpolantFactoryMethodLinear(e){return new $X(this.times,this.values,this.getValueSize(),e)}}_g.prototype.ValueTypeName="quaternion";_g.prototype.DefaultInterpolation=_y;_g.prototype.InterpolantFactoryMethodSmooth=void 0;class sh extends nl{}sh.prototype.ValueTypeName="string";sh.prototype.ValueBufferType=Array;sh.prototype.DefaultInterpolation=wy;sh.prototype.InterpolantFactoryMethodLinear=void 0;sh.prototype.InterpolantFactoryMethodSmooth=void 0;class Oy extends nl{}Oy.prototype.ValueTypeName="vector";class ky{constructor(e,n=-1,r,i=AE){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Rs(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,a=r.length;s!==a;++s)n.push(FIe(r[s]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,s=r.length;o!==s;++o)n.push(nl.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,s=[];for(let a=0;a1){const d=c[1];let f=i[d];f||(i[d]=f=[]),f.push(u)}}const s=[];for(const a in i)s.push(this.CreateFromMorphTargetSequence(a,i[a],n,r));return s}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,h,p,g){if(h.length!==0){const b=[],m=[];gF(h,b,m,p),b.length!==0&&g.push(new d(f,b,m))}},i=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let d=0;d{n&&n(o),this.manager.itemEnd(e)},0),o;if(fu[e]!==void 0){fu[e].push({onLoad:n,onProgress:r,onError:i});return}fu[e]=[],fu[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const c=fu[e],d=u.body.getReader(),f=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),h=f?parseInt(f):0,p=h!==0;let g=0;const b=new ReadableStream({start(m){w();function w(){d.read().then(({done:x,value:_})=>{if(x)m.close();else{g+=_.byteLength;const C=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let S=0,M=c.length;S{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,a));case"json":return u.json();default:if(a===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),f=d&&d[1]?d[1].toLowerCase():void 0,h=new TextDecoder(f);return u.arrayBuffer().then(p=>h.decode(p))}}}).then(u=>{jf.add(e,u);const c=fu[e];delete fu[e];for(let d=0,f=c.length;d{const c=fu[e];if(c===void 0)throw this.manager.itemError(e),u;delete fu[e];for(let d=0,f=c.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class kIe extends ns{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new Gu(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{n(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(i.uniforms[o]={},s.type){case"t":i.uniforms[o].value=r(s.value);break;case"c":i.uniforms[o].value=new vt().setHex(s.value);break;case"v2":i.uniforms[o].value=new Xe().fromArray(s.value);break;case"v3":i.uniforms[o].value=new oe().fromArray(s.value);break;case"v4":i.uniforms[o].value=new kn().fromArray(s.value);break;case"m3":i.uniforms[o].value=new nn().fromArray(s.value);break;case"m4":i.uniforms[o].value=new qt().fromArray(s.value);break;default:i.uniforms[o].value=s.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new Xe().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Xe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const n={ShadowMaterial:MX,SpriteMaterial:sF,RawShaderMaterial:TX,ShaderMaterial:Hl,PointsMaterial:lF,MeshPhysicalMaterial:AX,MeshStandardMaterial:mF,MeshPhongMaterial:PX,MeshToonMaterial:DX,MeshNormalMaterial:RX,MeshLambertMaterial:IX,MeshDepthMaterial:rF,MeshDistanceMaterial:iF,MeshBasicMaterial:Cd,MeshMatcapMaterial:NX,LineDashedMaterial:FX,LineBasicMaterial:Ro,Material:ji};return new n[e]}}class SR{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new bF(n);o=new Ly(l),o.setCrossOrigin(this.crossOrigin);for(let u=0,c=e.length;u0){i=new Ly(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,a=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=jf.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){jf.add(e,l),n&&n(l),o.manager.itemEnd(e)}).catch(function(l){i&&i(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}let lw;class wF{static getContext(){return lw===void 0&&(lw=new(window.AudioContext||window.webkitAudioContext)),lw}static setContext(e){lw=e}}class qIe extends ns{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new Gu(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const u=l.slice(0);wF.getContext().decodeAudioData(u,function(d){n(d)},a)}catch(u){a(u)}},r,i);function a(l){i?i(l):console.error(l),o.manager.itemError(e)}}}const s$=new qt,a$=new qt,Gd=new qt;class XIe{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Si,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Si,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,Gd.copy(e.projectionMatrix);const i=n.eyeSep/2,o=i*n.near/n.focus,s=n.near*Math.tan(Mf*n.fov*.5)/n.zoom;let a,l;a$.elements[12]=-i,s$.elements[12]=i,a=-s*n.aspect+o,l=s*n.aspect+o,Gd.elements[0]=2*n.near/(l-a),Gd.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Gd),a=-s*n.aspect-o,l=s*n.aspect-o,Gd.elements[0]=2*n.near/(l-a),Gd.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Gd)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(a$),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(s$)}}class _F{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=l$(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=l$();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function l$(){return(typeof performance>"u"?Date:performance).now()}const jd=new oe,u$=new Yo,KIe=new oe,Wd=new oe;class YIe extends Tn{constructor(){super(),this.type="AudioListener",this.context=wF.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new _F}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(jd,u$,KIe),Wd.set(0,0,-1).applyQuaternion(u$),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(jd.x,i),n.positionY.linearRampToValueAtTime(jd.y,i),n.positionZ.linearRampToValueAtTime(jd.z,i),n.forwardX.linearRampToValueAtTime(Wd.x,i),n.forwardY.linearRampToValueAtTime(Wd.y,i),n.forwardZ.linearRampToValueAtTime(Wd.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(jd.x,jd.y,jd.z),n.setOrientation(Wd.x,Wd.y,Wd.z,r.x,r.y,r.z)}}class ZX extends Tn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let l=n,u=n+n;l!==u;++l)if(r[l]!==r[l+n]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let o=r,s=i;o!==s;++o)n[o]=n[i+o%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,n=e+this.valueSize;for(let r=e;r=.5)for(let s=0;s!==o;++s)e[n+s]=e[r+s]}_slerp(e,n,r,i){Yo.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,o){const s=this._workIndex*o;Yo.multiplyQuaternionsFlat(e,s,e,n,e,r),Yo.slerpFlat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,o){const s=1-i;for(let a=0;a!==o;++a){const l=n+a;e[l]=e[l]*s+e[r+a]*i}}_lerpAdditive(e,n,r,i,o){for(let s=0;s!==o;++s){const a=n+s;e[a]=e[a]+e[r+s]*i}}}const SF="\\[\\]\\.:\\/",eNe=new RegExp("["+SF+"]","g"),CF="[^"+SF+"]",tNe="[^"+SF.replace("\\.","")+"]",nNe=/((?:WC+[\/:])*)/.source.replace("WC",CF),rNe=/(WCOD+)?/.source.replace("WCOD",tNe),iNe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",CF),oNe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",CF),sNe=new RegExp("^"+nNe+rNe+iNe+oNe+"$"),aNe=["material","materials","bones","map"];class lNe{constructor(e,n,r){const i=r||bn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class bn{constructor(e,n,r){this.path=n,this.parsedPath=r||bn.parseTrackName(n),this.node=bn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new bn.Composite(e,n,r):new bn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(eNe,"")}static parseTrackName(e){const n=sNe.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);aNe.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let s=0;s=o){const d=o++,f=e[d];n[f.uuid]=c,e[c]=f,n[u]=d,e[d]=l;for(let h=0,p=i;h!==p;++h){const g=r[h],b=g[d],m=g[c];g[c]=b,g[d]=m}}}this.nCachedObjects_=o}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],c=u.uuid,d=n[c];if(d!==void 0)if(delete n[c],d0&&(n[h.uuid]=d),e[d]=h,e.pop();for(let p=0,g=i;p!==g;++p){const b=r[p];b[d]=b[f],b.pop()}}}this.nCachedObjects_=o}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const o=this._bindings;if(i!==void 0)return o[i];const s=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,d=new Array(u);i=o.length,r[e]=i,s.push(e),a.push(n),o.push(d);for(let f=c,h=l.length;f!==h;++f){const p=l[f];d[f]=new bn(p,e,n)}return d}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length-1,l=s[a],u=e[a];n[u]=r,s[r]=l,s.pop(),o[r]=o[a],o.pop(),i[r]=i[a],i.pop()}}}class JX{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const o=n.tracks,s=o.length,a=new Array(s),l={endingStart:hf,endingEnd:hf};for(let u=0;u!==s;++u){const c=o[u].createInterpolant(null);a[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Rq,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,n){return this.loop=e,this.repetitions=n,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,n,r){if(e.fadeOut(n),this.fadeIn(n),r){const i=this._clip.duration,o=e._clip.duration,s=o/i,a=i/o;e.warp(1,s,n),this.warp(a,1,n)}return this}crossFadeTo(e,n,r){return e.crossFadeFrom(this,n,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,n,r){const i=this._mixer,o=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=o,l[1]=o+r,u[0]=e/s,u[1]=n/s,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,n,r,i){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const l=(e-o)*r;l<0||r===0?n=0:(this._startTime=null,n=r*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case KN:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulateAdditive(a);break;case AE:default:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulate(i,a)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,o=this._loopCount;const s=r===Iq;if(e===0)return o===-1?i:s&&(o&1)===1?n-i:i;if(r===Dq){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=n||i<0){const a=Math.floor(i/n);i-=n*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(s&&(o&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=pf,i.endingEnd=pf):(e?i.endingStart=this.zeroSlopeAtStart?pf:hf:i.endingStart=Sy,n?i.endingEnd=this.zeroSlopeAtEnd?pf:hf:i.endingEnd=Sy)}_scheduleFading(e,n,r){const i=this._mixer,o=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=o,l[0]=n,a[1]=o+e,l[1]=r,this}}const cNe=new Float32Array(1);class dNe extends Yu{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,o=i.length,s=e._propertyBindings,a=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let d=0;d!==o;++d){const f=i[d],h=f.name;let p=c[h];if(p!==void 0)++p.referenceCount,s[d]=p;else{if(p=s[d],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,h));continue}const g=n&&n._propertyBindings[d].binding.parsedPath;p=new QX(bn.create(r,h,g),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,h),s[d]=p}a[d].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const n=e._cacheIndex;return n!==null&&n=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==r;++u)n[u]._update(i,e,o,s);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(s);return this}setTime(e){this.time=0;for(let n=0;nthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,f$).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const h$=new oe,uw=new oe;class bNe{constructor(e=new oe,n=new oe){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){h$.subVectors(e,this.start),uw.subVectors(this.end,this.start);const r=uw.dot(uw);let o=uw.dot(h$)/r;return n&&(o=Fr(o,0,1)),o}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const p$=new oe;class xNe extends Tn{constructor(e,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new rn,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,l=32;s1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{b$.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(b$,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class NNe extends Zl{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new rn;i.setAttribute("position",new Ct(n,3)),i.setAttribute("color",new Ct(r,3));const o=new Ro({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,n,r){const i=new vt,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(n),i.toArray(o,6),i.toArray(o,9),i.set(r),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class FNe{constructor(){this.type="ShapePath",this.color=new vt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new Dy,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,o,s){return this.currentPath.bezierCurveTo(e,n,r,i,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(m){const w=[];for(let x=0,_=m.length;x<_;x++){const C=m[x],S=new Af;S.curves=C.curves,w.push(S)}return w}function r(m,w){const x=w.length;let _=!1;for(let C=x-1,S=0;SNumber.EPSILON){if(R<0&&(M=w[S],A=-A,P=w[C],R=-R),m.yP.y)continue;if(m.y===M.y){if(m.x===M.x)return!0}else{const F=R*(m.x-M.x)-A*(m.y-M.y);if(F===0)return!0;if(F<0)continue;_=!_}}else{if(m.y!==M.y)continue;if(P.x<=m.x&&m.x<=M.x||M.x<=m.x&&m.x<=P.x)return!0}}return _}const i=Fl.isClockWise,o=this.subPaths;if(o.length===0)return[];let s,a,l;const u=[];if(o.length===1)return a=o[0],l=new Af,l.curves=a.curves,u.push(l),u;let c=!i(o[0].getPoints());c=e?!c:c;const d=[],f=[];let h=[],p=0,g;f[p]=void 0,h[p]=[];for(let m=0,w=o.length;m1){let m=!1,w=0;for(let x=0,_=f.length;x<_;x++)d[x]=[];for(let x=0,_=f.length;x<_;x++){const C=h[x];for(let S=0;S0&&m===!1&&(h=d)}let b;for(let m=0,w=f.length;mc||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/L.x),i.x=o.x*L.x,B.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/L.y),i.y=o.y*L.y,B.mapSize.y=o.y)),B.map===null||$===!0||j===!0){const W=this.type!==Ra?{minFilter:Nr,magFilter:Nr}:{};B.map!==null&&B.map.dispose(),B.map=new Za(i.x,i.y,W),B.map.texture.name=G.name+".shadowMap",B.camera.updateProjectionMatrix()}t.setRenderTarget(B.map),t.clear();const N=B.getViewportCount();for(let W=0;W0||S.map&&S.alphaTest>0){const F=A.uuid,$=S.uuid;let j=u[F];j===void 0&&(j={},u[F]=j);let k=j[$];k===void 0&&(k=A.clone(),j[$]=k),A=k}if(A.visible=S.visible,A.wireframe=S.wireframe,P===Ra?A.side=S.shadowSide!==null?S.shadowSide:S.side:A.side=S.shadowSide!==null?S.shadowSide:d[S.side],A.alphaMap=S.alphaMap,A.alphaTest=S.alphaTest,A.map=S.map,A.clipShadows=S.clipShadows,A.clippingPlanes=S.clippingPlanes,A.clipIntersection=S.clipIntersection,A.displacementMap=S.displacementMap,A.displacementScale=S.displacementScale,A.displacementBias=S.displacementBias,A.wireframeLinewidth=S.wireframeLinewidth,A.linewidth=S.linewidth,M.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const F=t.properties.get(A);F.light=M}return A}function _(C,S,M,P,A){if(C.visible===!1)return;if(C.layers.test(S.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&A===Ra)&&(!C.frustumCulled||r.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,C.matrixWorld);const $=e.update(C),j=C.material;if(Array.isArray(j)){const k=$.groups;for(let U=0,G=k.length;U=1):W.indexOf("OpenGL ES")!==-1&&(N=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),L=N>=2);let K=null,Q={};const J=t.getParameter(t.SCISSOR_BOX),ae=t.getParameter(t.VIEWPORT),ve=new kn().fromArray(J),fe=new kn().fromArray(ae);function Me(Se,st,Ze,je){const et=new Uint8Array(4),Tt=t.createTexture();t.bindTexture(Se,Tt),t.texParameteri(Se,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Se,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Qt=0;Qt"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap;let g;const b=new WeakMap;let m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function w(z,H){return m?new OffscreenCanvas(z,H):Py("canvas")}function x(z,H,te,le){let de=1;if((z.width>le||z.height>le)&&(de=le/Math.max(z.width,z.height)),de<1||H===!0)if(typeof HTMLImageElement<"u"&&z instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&z instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&z instanceof ImageBitmap){const ue=H?TS:Math.floor,ge=ue(de*z.width),be=ue(de*z.height);g===void 0&&(g=w(ge,be));const Te=te?w(ge,be):g;return Te.width=ge,Te.height=be,Te.getContext("2d").drawImage(z,0,0,ge,be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+z.width+"x"+z.height+") to ("+ge+"x"+be+")."),Te}else return"data"in z&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+z.width+"x"+z.height+")."),z;return z}function _(z){return gR(z.width)&&gR(z.height)}function C(z){return a?!1:z.wrapS!==Ci||z.wrapT!==Ci||z.minFilter!==Nr&&z.minFilter!==Hr}function S(z,H){return z.generateMipmaps&&H&&z.minFilter!==Nr&&z.minFilter!==Hr}function M(z){t.generateMipmap(z)}function P(z,H,te,le,de=!1){if(a===!1)return H;if(z!==null){if(t[z]!==void 0)return t[z];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+z+"'")}let ue=H;if(H===t.RED&&(te===t.FLOAT&&(ue=t.R32F),te===t.HALF_FLOAT&&(ue=t.R16F),te===t.UNSIGNED_BYTE&&(ue=t.R8)),H===t.RED_INTEGER&&(te===t.UNSIGNED_BYTE&&(ue=t.R8UI),te===t.UNSIGNED_SHORT&&(ue=t.R16UI),te===t.UNSIGNED_INT&&(ue=t.R32UI),te===t.BYTE&&(ue=t.R8I),te===t.SHORT&&(ue=t.R16I),te===t.INT&&(ue=t.R32I)),H===t.RG&&(te===t.FLOAT&&(ue=t.RG32F),te===t.HALF_FLOAT&&(ue=t.RG16F),te===t.UNSIGNED_BYTE&&(ue=t.RG8)),H===t.RGBA){const ge=de?Cy:Bn.getTransfer(le);te===t.FLOAT&&(ue=t.RGBA32F),te===t.HALF_FLOAT&&(ue=t.RGBA16F),te===t.UNSIGNED_BYTE&&(ue=ge===Zn?t.SRGB8_ALPHA8:t.RGBA8),te===t.UNSIGNED_SHORT_4_4_4_4&&(ue=t.RGBA4),te===t.UNSIGNED_SHORT_5_5_5_1&&(ue=t.RGB5_A1)}return(ue===t.R16F||ue===t.R32F||ue===t.RG16F||ue===t.RG32F||ue===t.RGBA16F||ue===t.RGBA32F)&&e.get("EXT_color_buffer_float"),ue}function A(z,H,te){return S(z,te)===!0||z.isFramebufferTexture&&z.minFilter!==Nr&&z.minFilter!==Hr?Math.log2(Math.max(H.width,H.height))+1:z.mipmaps!==void 0&&z.mipmaps.length>0?z.mipmaps.length:z.isCompressedTexture&&Array.isArray(z.image)?H.mipmaps.length:1}function R(z){return z===Nr||z===ES||z===Sv?t.NEAREST:t.LINEAR}function F(z){const H=z.target;H.removeEventListener("dispose",F),j(H),H.isVideoTexture&&p.delete(H)}function $(z){const H=z.target;H.removeEventListener("dispose",$),U(H)}function j(z){const H=r.get(z);if(H.__webglInit===void 0)return;const te=z.source,le=b.get(te);if(le){const de=le[H.__cacheKey];de.usedTimes--,de.usedTimes===0&&k(z),Object.keys(le).length===0&&b.delete(te)}r.remove(z)}function k(z){const H=r.get(z);t.deleteTexture(H.__webglTexture);const te=z.source,le=b.get(te);delete le[H.__cacheKey],s.memory.textures--}function U(z){const H=z.texture,te=r.get(z),le=r.get(H);if(le.__webglTexture!==void 0&&(t.deleteTexture(le.__webglTexture),s.memory.textures--),z.depthTexture&&z.depthTexture.dispose(),z.isWebGLCubeRenderTarget)for(let de=0;de<6;de++){if(Array.isArray(te.__webglFramebuffer[de]))for(let ue=0;ue=l&&console.warn("THREE.WebGLTextures: Trying to use "+z+" texture units while this GPU supports only "+l),G+=1,z}function N(z){const H=[];return H.push(z.wrapS),H.push(z.wrapT),H.push(z.wrapR||0),H.push(z.magFilter),H.push(z.minFilter),H.push(z.anisotropy),H.push(z.internalFormat),H.push(z.format),H.push(z.type),H.push(z.generateMipmaps),H.push(z.premultiplyAlpha),H.push(z.flipY),H.push(z.unpackAlignment),H.push(z.colorSpace),H.join()}function W(z,H){const te=r.get(z);if(z.isVideoTexture&&xe(z),z.isRenderTargetTexture===!1&&z.version>0&&te.__version!==z.version){const le=z.image;if(le===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(le.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{we(te,z,H);return}}n.bindTexture(t.TEXTURE_2D,te.__webglTexture,t.TEXTURE0+H)}function K(z,H){const te=r.get(z);if(z.version>0&&te.__version!==z.version){we(te,z,H);return}n.bindTexture(t.TEXTURE_2D_ARRAY,te.__webglTexture,t.TEXTURE0+H)}function Q(z,H){const te=r.get(z);if(z.version>0&&te.__version!==z.version){we(te,z,H);return}n.bindTexture(t.TEXTURE_3D,te.__webglTexture,t.TEXTURE0+H)}function J(z,H){const te=r.get(z);if(z.version>0&&te.__version!==z.version){Fe(te,z,H);return}n.bindTexture(t.TEXTURE_CUBE_MAP,te.__webglTexture,t.TEXTURE0+H)}const ae={[by]:t.REPEAT,[Ci]:t.CLAMP_TO_EDGE,[xy]:t.MIRRORED_REPEAT},ve={[Nr]:t.NEAREST,[ES]:t.NEAREST_MIPMAP_NEAREST,[Sv]:t.NEAREST_MIPMAP_LINEAR,[Hr]:t.LINEAR,[UN]:t.LINEAR_MIPMAP_NEAREST,[ud]:t.LINEAR_MIPMAP_LINEAR},fe={[kq]:t.NEVER,[Vq]:t.ALWAYS,[Lq]:t.LESS,[$q]:t.LEQUAL,[Bq]:t.EQUAL,[Hq]:t.GEQUAL,[zq]:t.GREATER,[Uq]:t.NOTEQUAL};function Me(z,H,te){if(te?(t.texParameteri(z,t.TEXTURE_WRAP_S,ae[H.wrapS]),t.texParameteri(z,t.TEXTURE_WRAP_T,ae[H.wrapT]),(z===t.TEXTURE_3D||z===t.TEXTURE_2D_ARRAY)&&t.texParameteri(z,t.TEXTURE_WRAP_R,ae[H.wrapR]),t.texParameteri(z,t.TEXTURE_MAG_FILTER,ve[H.magFilter]),t.texParameteri(z,t.TEXTURE_MIN_FILTER,ve[H.minFilter])):(t.texParameteri(z,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(z,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(z===t.TEXTURE_3D||z===t.TEXTURE_2D_ARRAY)&&t.texParameteri(z,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(H.wrapS!==Ci||H.wrapT!==Ci)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(z,t.TEXTURE_MAG_FILTER,R(H.magFilter)),t.texParameteri(z,t.TEXTURE_MIN_FILTER,R(H.minFilter)),H.minFilter!==Nr&&H.minFilter!==Hr&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),H.compareFunction&&(t.texParameteri(z,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(z,t.TEXTURE_COMPARE_FUNC,fe[H.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const le=e.get("EXT_texture_filter_anisotropic");if(H.magFilter===Nr||H.minFilter!==Sv&&H.minFilter!==ud||H.type===za&&e.has("OES_texture_float_linear")===!1||a===!1&&H.type===Uf&&e.has("OES_texture_half_float_linear")===!1)return;(H.anisotropy>1||r.get(H).__currentAnisotropy)&&(t.texParameterf(z,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(H.anisotropy,i.getMaxAnisotropy())),r.get(H).__currentAnisotropy=H.anisotropy)}}function ye(z,H){let te=!1;z.__webglInit===void 0&&(z.__webglInit=!0,H.addEventListener("dispose",F));const le=H.source;let de=b.get(le);de===void 0&&(de={},b.set(le,de));const ue=N(H);if(ue!==z.__cacheKey){de[ue]===void 0&&(de[ue]={texture:t.createTexture(),usedTimes:0},s.memory.textures++,te=!0),de[ue].usedTimes++;const ge=de[z.__cacheKey];ge!==void 0&&(de[z.__cacheKey].usedTimes--,ge.usedTimes===0&&k(H)),z.__cacheKey=ue,z.__webglTexture=de[ue].texture}return te}function we(z,H,te){let le=t.TEXTURE_2D;(H.isDataArrayTexture||H.isCompressedArrayTexture)&&(le=t.TEXTURE_2D_ARRAY),H.isData3DTexture&&(le=t.TEXTURE_3D);const de=ye(z,H),ue=H.source;n.bindTexture(le,z.__webglTexture,t.TEXTURE0+te);const ge=r.get(ue);if(ue.version!==ge.__version||de===!0){n.activeTexture(t.TEXTURE0+te);const be=Bn.getPrimaries(Bn.workingColorSpace),Te=H.colorSpace===_s?null:Bn.getPrimaries(H.colorSpace),Re=H.colorSpace===_s||be===Te?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,H.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,H.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Re);const Ve=C(H)&&_(H.image)===!1;let Le=x(H.image,Ve,!1,c);Le=Pe(H,Le);const Ye=_(Le)||a,it=o.convert(H.format,H.colorSpace);let ot=o.convert(H.type),ht=P(H.internalFormat,it,ot,H.colorSpace,H.isVideoTexture);Me(le,H,Ye);let Je;const Ot=H.mipmaps,Se=a&&H.isVideoTexture!==!0,st=ge.__version===void 0||de===!0,Ze=A(H,Le,Ye);if(H.isDepthTexture)ht=t.DEPTH_COMPONENT,a?H.type===za?ht=t.DEPTH_COMPONENT32F:H.type===Au?ht=t.DEPTH_COMPONENT24:H.type===Yc?ht=t.DEPTH24_STENCIL8:ht=t.DEPTH_COMPONENT16:H.type===za&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),H.format===Zc&&ht===t.DEPTH_COMPONENT&&H.type!==TE&&H.type!==Au&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),H.type=Au,ot=o.convert(H.type)),H.format===Hf&&ht===t.DEPTH_COMPONENT&&(ht=t.DEPTH_STENCIL,H.type!==Yc&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),H.type=Yc,ot=o.convert(H.type))),st&&(Se?n.texStorage2D(t.TEXTURE_2D,1,ht,Le.width,Le.height):n.texImage2D(t.TEXTURE_2D,0,ht,Le.width,Le.height,0,it,ot,null));else if(H.isDataTexture)if(Ot.length>0&&Ye){Se&&st&&n.texStorage2D(t.TEXTURE_2D,Ze,ht,Ot[0].width,Ot[0].height);for(let je=0,et=Ot.length;je>=1,et>>=1}}else if(Ot.length>0&&Ye){Se&&st&&n.texStorage2D(t.TEXTURE_2D,Ze,ht,Ot[0].width,Ot[0].height);for(let je=0,et=Ot.length;je0&&st++,n.texStorage2D(t.TEXTURE_CUBE_MAP,st,Je,Le[0].width,Le[0].height));for(let je=0;je<6;je++)if(Ve){Ot?n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+je,0,0,0,Le[je].width,Le[je].height,ot,ht,Le[je].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+je,0,Je,Le[je].width,Le[je].height,0,ot,ht,Le[je].data);for(let et=0;et>ue),Le=Math.max(1,H.height>>ue);de===t.TEXTURE_3D||de===t.TEXTURE_2D_ARRAY?n.texImage3D(de,ue,Te,Ve,Le,H.depth,0,ge,be,null):n.texImage2D(de,ue,Te,Ve,Le,0,ge,be,null)}n.bindFramebuffer(t.FRAMEBUFFER,z),se(H)?f.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,le,de,r.get(te).__webglTexture,0,ne(H)):(de===t.TEXTURE_2D||de>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&de<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,le,de,r.get(te).__webglTexture,ue),n.bindFramebuffer(t.FRAMEBUFFER,null)}function re(z,H,te){if(t.bindRenderbuffer(t.RENDERBUFFER,z),H.depthBuffer&&!H.stencilBuffer){let le=a===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(te||se(H)){const de=H.depthTexture;de&&de.isDepthTexture&&(de.type===za?le=t.DEPTH_COMPONENT32F:de.type===Au&&(le=t.DEPTH_COMPONENT24));const ue=ne(H);se(H)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,ue,le,H.width,H.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,ue,le,H.width,H.height)}else t.renderbufferStorage(t.RENDERBUFFER,le,H.width,H.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,z)}else if(H.depthBuffer&&H.stencilBuffer){const le=ne(H);te&&se(H)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,le,t.DEPTH24_STENCIL8,H.width,H.height):se(H)?f.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,le,t.DEPTH24_STENCIL8,H.width,H.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,H.width,H.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,z)}else{const le=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let de=0;de0){te.__webglFramebuffer[be]=[];for(let Te=0;Te0){te.__webglFramebuffer=[];for(let be=0;be0&&se(z)===!1){const be=ue?H:[H];te.__webglMultisampledFramebuffer=t.createFramebuffer(),te.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,te.__webglMultisampledFramebuffer);for(let Te=0;Te0)for(let Te=0;Te0)for(let Te=0;Te0&&se(z)===!1){const H=z.isWebGLMultipleRenderTargets?z.texture:[z.texture],te=z.width,le=z.height;let de=t.COLOR_BUFFER_BIT;const ue=[],ge=z.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,be=r.get(z),Te=z.isWebGLMultipleRenderTargets===!0;if(Te)for(let Re=0;Re0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&H.__useRenderToTexture!==!1}function xe(z){const H=s.render.frame;p.get(z)!==H&&(p.set(z,H),z.update())}function Pe(z,H){const te=z.colorSpace,le=z.format,de=z.type;return z.isCompressedTexture===!0||z.isVideoTexture===!0||z.format===MS||te!==Ul&&te!==_s&&(Bn.getTransfer(te)===Zn?a===!1?e.has("EXT_sRGB")===!0&&le===Co?(z.format=MS,z.minFilter=Hr,z.generateMipmaps=!1):H=QN.sRGBToLinear(H):(le!==Co||de!==Ds)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",te)),H}this.allocateTextureUnit=L,this.resetTextureUnits=B,this.setTexture2D=W,this.setTexture2DArray=K,this.setTexture3D=Q,this.setTextureCube=J,this.rebindTextures=X,this.setupRenderTarget=Z,this.updateRenderTargetMipmap=he,this.updateMultisampleRenderTarget=Y,this.setupDepthRenderbuffer=Ce,this.setupFrameBufferTexture=Oe,this.useMultisampledRTT=se}function oX(t,e,n){const r=n.isWebGL2;function i(o,s=_s){let a;const l=Bn.getTransfer(s);if(o===Ds)return t.UNSIGNED_BYTE;if(o===VN)return t.UNSIGNED_SHORT_4_4_4_4;if(o===GN)return t.UNSIGNED_SHORT_5_5_5_1;if(o===_q)return t.BYTE;if(o===Sq)return t.SHORT;if(o===TE)return t.UNSIGNED_SHORT;if(o===HN)return t.INT;if(o===Au)return t.UNSIGNED_INT;if(o===za)return t.FLOAT;if(o===Uf)return r?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(o===Cq)return t.ALPHA;if(o===Co)return t.RGBA;if(o===Eq)return t.LUMINANCE;if(o===Mq)return t.LUMINANCE_ALPHA;if(o===Zc)return t.DEPTH_COMPONENT;if(o===Hf)return t.DEPTH_STENCIL;if(o===MS)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(o===jN)return t.RED;if(o===WN)return t.RED_INTEGER;if(o===Tq)return t.RG;if(o===qN)return t.RG_INTEGER;if(o===XN)return t.RGBA_INTEGER;if(o===o_||o===s_||o===a_||o===l_)if(l===Zn)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(o===o_)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(o===s_)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(o===a_)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(o===l_)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(o===o_)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(o===s_)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(o===a_)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(o===l_)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(o===VD||o===GD||o===jD||o===WD)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(o===VD)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(o===GD)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(o===jD)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(o===WD)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(o===Aq)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(o===qD||o===XD)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(o===qD)return l===Zn?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(o===XD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(o===KD||o===YD||o===ZD||o===QD||o===JD||o===eR||o===tR||o===nR||o===rR||o===iR||o===oR||o===sR||o===aR||o===lR)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(o===KD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(o===YD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(o===ZD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(o===QD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(o===JD)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(o===eR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(o===tR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(o===nR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(o===rR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(o===iR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(o===oR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(o===sR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(o===aR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(o===lR)return l===Zn?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(o===u_||o===uR||o===cR)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(o===u_)return l===Zn?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(o===uR)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(o===cR)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(o===Pq||o===dR||o===fR||o===hR)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(o===u_)return a.COMPRESSED_RED_RGTC1_EXT;if(o===dR)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(o===fR)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(o===hR)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return o===Yc?r?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):t[o]!==void 0?t[o]:null}return{convert:i}}class sX extends Si{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}let nm=class extends Tn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const j3e={type:"move"};class iA{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new nm,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new nm,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new oe,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new oe),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new nm,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new oe,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new oe),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const r of e.hand.values())this._getHandJoint(n,r)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,r){let i=null,o=null,s=null;const a=this._targetRay,l=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){s=!0;for(const g of e.hand.values()){const b=n.getJointPose(g,r),m=this._getHandJoint(u,g);b!==null&&(m.matrix.fromArray(b.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=b.radius),m.visible=b!==null}const c=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],f=c.position.distanceTo(d.position),h=.02,p=.005;u.inputState.pinching&&f>h+p?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&f<=h-p&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(o=n.getPose(e.gripSpace,r),o!==null&&(l.matrix.fromArray(o.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,o.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(o.linearVelocity)):l.hasLinearVelocity=!1,o.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(o.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=n.getPose(e.targetRaySpace,r),i===null&&o!==null&&(i=o),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(j3e)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=o!==null),u!==null&&(u.visible=s!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const r=new nm;r.matrixAutoUpdate=!1,r.visible=!1,e.joints[n.jointName]=r,e.add(r)}return e.joints[n.jointName]}}class aX extends Lr{constructor(e,n,r,i,o,s,a,l,u,c){if(c=c!==void 0?c:Zc,c!==Zc&&c!==Hf)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&c===Zc&&(r=Au),r===void 0&&c===Hf&&(r=Yc),super(null,i,o,s,a,l,c,r,u),this.isDepthTexture=!0,this.image={width:e,height:n},this.magFilter=a!==void 0?a:Nr,this.minFilter=l!==void 0?l:Nr,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class W3e extends Yu{constructor(e,n){super();const r=this;let i=null,o=1,s=null,a="local-floor",l=1,u=null,c=null,d=null,f=null,h=null,p=null;const g=n.getContextAttributes();let b=null,m=null;const w=[],x=[],_=new Si;_.layers.enable(1),_.viewport=new kn;const C=new Si;C.layers.enable(2),C.viewport=new kn;const S=[_,C],M=new sX;M.layers.enable(1),M.layers.enable(2);let P=null,A=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let Q=w[K];return Q===void 0&&(Q=new iA,w[K]=Q),Q.getTargetRaySpace()},this.getControllerGrip=function(K){let Q=w[K];return Q===void 0&&(Q=new iA,w[K]=Q),Q.getGripSpace()},this.getHand=function(K){let Q=w[K];return Q===void 0&&(Q=new iA,w[K]=Q),Q.getHandSpace()};function R(K){const Q=x.indexOf(K.inputSource);if(Q===-1)return;const J=w[Q];J!==void 0&&(J.update(K.inputSource,K.frame,u||s),J.dispatchEvent({type:K.type,data:K.inputSource}))}function F(){i.removeEventListener("select",R),i.removeEventListener("selectstart",R),i.removeEventListener("selectend",R),i.removeEventListener("squeeze",R),i.removeEventListener("squeezestart",R),i.removeEventListener("squeezeend",R),i.removeEventListener("end",F),i.removeEventListener("inputsourceschange",$);for(let K=0;K=0&&(x[ae]=null,w[ae].disconnect(J))}for(let Q=0;Q=x.length){x.push(J),ae=fe;break}else if(x[fe]===null){x[fe]=J,ae=fe;break}if(ae===-1)break}const ve=w[ae];ve&&ve.connect(J)}}const j=new oe,k=new oe;function U(K,Q,J){j.setFromMatrixPosition(Q.matrixWorld),k.setFromMatrixPosition(J.matrixWorld);const ae=j.distanceTo(k),ve=Q.projectionMatrix.elements,fe=J.projectionMatrix.elements,Me=ve[14]/(ve[10]-1),ye=ve[14]/(ve[10]+1),we=(ve[9]+1)/ve[5],Fe=(ve[9]-1)/ve[5],Oe=(ve[8]-1)/ve[0],re=(fe[8]+1)/fe[0],_e=Me*Oe,Ce=Me*re,X=ae/(-Oe+re),Z=X*-Oe;Q.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(Z),K.translateZ(X),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();const he=Me+X,Y=ye+X,ne=_e-Z,se=Ce+(ae-Z),xe=we*ye/Y*he,Pe=Fe*ye/Y*he;K.projectionMatrix.makePerspective(ne,se,xe,Pe,he,Y),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function G(K,Q){Q===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(Q.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(i===null)return;M.near=C.near=_.near=K.near,M.far=C.far=_.far=K.far,(P!==M.near||A!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),P=M.near,A=M.far);const Q=K.parent,J=M.cameras;G(M,Q);for(let ae=0;ae0&&(b.alphaTest.value=m.alphaTest);const w=e.get(m).envMap;if(w&&(b.envMap.value=w,b.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,b.reflectivity.value=m.reflectivity,b.ior.value=m.ior,b.refractionRatio.value=m.refractionRatio),m.lightMap){b.lightMap.value=m.lightMap;const x=t._useLegacyLights===!0?Math.PI:1;b.lightMapIntensity.value=m.lightMapIntensity*x,n(m.lightMap,b.lightMapTransform)}m.aoMap&&(b.aoMap.value=m.aoMap,b.aoMapIntensity.value=m.aoMapIntensity,n(m.aoMap,b.aoMapTransform))}function s(b,m){b.diffuse.value.copy(m.color),b.opacity.value=m.opacity,m.map&&(b.map.value=m.map,n(m.map,b.mapTransform))}function a(b,m){b.dashSize.value=m.dashSize,b.totalSize.value=m.dashSize+m.gapSize,b.scale.value=m.scale}function l(b,m,w,x){b.diffuse.value.copy(m.color),b.opacity.value=m.opacity,b.size.value=m.size*w,b.scale.value=x*.5,m.map&&(b.map.value=m.map,n(m.map,b.uvTransform)),m.alphaMap&&(b.alphaMap.value=m.alphaMap,n(m.alphaMap,b.alphaMapTransform)),m.alphaTest>0&&(b.alphaTest.value=m.alphaTest)}function u(b,m){b.diffuse.value.copy(m.color),b.opacity.value=m.opacity,b.rotation.value=m.rotation,m.map&&(b.map.value=m.map,n(m.map,b.mapTransform)),m.alphaMap&&(b.alphaMap.value=m.alphaMap,n(m.alphaMap,b.alphaMapTransform)),m.alphaTest>0&&(b.alphaTest.value=m.alphaTest)}function c(b,m){b.specular.value.copy(m.specular),b.shininess.value=Math.max(m.shininess,1e-4)}function d(b,m){m.gradientMap&&(b.gradientMap.value=m.gradientMap)}function f(b,m){b.metalness.value=m.metalness,m.metalnessMap&&(b.metalnessMap.value=m.metalnessMap,n(m.metalnessMap,b.metalnessMapTransform)),b.roughness.value=m.roughness,m.roughnessMap&&(b.roughnessMap.value=m.roughnessMap,n(m.roughnessMap,b.roughnessMapTransform)),e.get(m).envMap&&(b.envMapIntensity.value=m.envMapIntensity)}function h(b,m,w){b.ior.value=m.ior,m.sheen>0&&(b.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),b.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(b.sheenColorMap.value=m.sheenColorMap,n(m.sheenColorMap,b.sheenColorMapTransform)),m.sheenRoughnessMap&&(b.sheenRoughnessMap.value=m.sheenRoughnessMap,n(m.sheenRoughnessMap,b.sheenRoughnessMapTransform))),m.clearcoat>0&&(b.clearcoat.value=m.clearcoat,b.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(b.clearcoatMap.value=m.clearcoatMap,n(m.clearcoatMap,b.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,n(m.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(b.clearcoatNormalMap.value=m.clearcoatNormalMap,n(m.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===Ao&&b.clearcoatNormalScale.value.negate())),m.iridescence>0&&(b.iridescence.value=m.iridescence,b.iridescenceIOR.value=m.iridescenceIOR,b.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(b.iridescenceMap.value=m.iridescenceMap,n(m.iridescenceMap,b.iridescenceMapTransform)),m.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=m.iridescenceThicknessMap,n(m.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),m.transmission>0&&(b.transmission.value=m.transmission,b.transmissionSamplerMap.value=w.texture,b.transmissionSamplerSize.value.set(w.width,w.height),m.transmissionMap&&(b.transmissionMap.value=m.transmissionMap,n(m.transmissionMap,b.transmissionMapTransform)),b.thickness.value=m.thickness,m.thicknessMap&&(b.thicknessMap.value=m.thicknessMap,n(m.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=m.attenuationDistance,b.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(b.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(b.anisotropyMap.value=m.anisotropyMap,n(m.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=m.specularIntensity,b.specularColor.value.copy(m.specularColor),m.specularColorMap&&(b.specularColorMap.value=m.specularColorMap,n(m.specularColorMap,b.specularColorMapTransform)),m.specularIntensityMap&&(b.specularIntensityMap.value=m.specularIntensityMap,n(m.specularIntensityMap,b.specularIntensityMapTransform))}function p(b,m){m.matcap&&(b.matcap.value=m.matcap)}function g(b,m){const w=e.get(m).light;b.referencePosition.value.setFromMatrixPosition(w.matrixWorld),b.nearDistance.value=w.shadow.camera.near,b.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:r,refreshMaterialUniforms:i}}function X3e(t,e,n,r){let i={},o={},s=[];const a=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(w,x){const _=x.program;r.uniformBlockBinding(w,_)}function u(w,x){let _=i[w.id];_===void 0&&(p(w),_=c(w),i[w.id]=_,w.addEventListener("dispose",b));const C=x.program;r.updateUBOMapping(w,C);const S=e.render.frame;o[w.id]!==S&&(f(w),o[w.id]=S)}function c(w){const x=d();w.__bindingPointIndex=x;const _=t.createBuffer(),C=w.__size,S=w.usage;return t.bindBuffer(t.UNIFORM_BUFFER,_),t.bufferData(t.UNIFORM_BUFFER,C,S),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,x,_),_}function d(){for(let w=0;w0){S=_%C;const $=C-S;S!==0&&$-R.boundary<0&&(_+=C-S,A.__offset=_)}_+=R.storage}return S=_%C,S>0&&(_+=C-S),w.__size=_,w.__cache={},this}function g(w){const x={boundary:0,storage:0};return typeof w=="number"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function b(w){const x=w.target;x.removeEventListener("dispose",b);const _=s.indexOf(x.__bindingPointIndex);s.splice(_,1),t.deleteBuffer(i[x.id]),delete i[x.id],delete o[x.id]}function m(){for(const w in i)t.deleteBuffer(i[w]);s=[],i={},o={}}return{bind:l,update:u,dispose:m}}class oF{constructor(e={}){const{canvas:n=qq(),context:r=null,depth:i=!0,stencil:o=!0,alpha:s=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:u=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:d=!1}=e;this.isWebGLRenderer=!0;let f;r!==null?f=r.getContextAttributes().alpha:f=s;const h=new Uint32Array(4),p=new Int32Array(4);let g=null,b=null;const m=[],w=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ai,this._useLegacyLights=!1,this.toneMapping=Il,this.toneMappingExposure=1;const x=this;let _=!1,C=0,S=0,M=null,P=-1,A=null;const R=new kn,F=new kn;let $=null;const j=new vt(0);let k=0,U=n.width,G=n.height,B=1,L=null,N=null;const W=new kn(0,0,U,G),K=new kn(0,0,U,G);let Q=!1;const J=new RE;let ae=!1,ve=!1,fe=null;const Me=new qt,ye=new Xe,we=new oe,Fe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Oe(){return M===null?B:1}let re=r;function _e(ee,pe){for(let Ae=0;Ae{function at(){if(Ee.forEach(function(_t){Y.get(_t).currentProgram.isReady()&&Ee.delete(_t)}),Ee.size===0){ke(ee);return}setTimeout(at,10)}Ce.get("KHR_parallel_shader_compile")!==null?at():setTimeout(at,10)})};let Qt=null;function Fn(ee){Qt&&Qt(ee)}function Vn(){Wt.stop()}function Ut(){Wt.start()}const Wt=new eX;Wt.setAnimationLoop(Fn),typeof self<"u"&&Wt.setContext(self),this.setAnimationLoop=function(ee){Qt=ee,Je.setAnimationLoop(ee),ee===null?Wt.stop():Wt.start()},Je.addEventListener("sessionstart",Vn),Je.addEventListener("sessionend",Ut),this.render=function(ee,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(_===!0)return;ee.matrixWorldAutoUpdate===!0&&ee.updateMatrixWorld(),pe.parent===null&&pe.matrixWorldAutoUpdate===!0&&pe.updateMatrixWorld(),Je.enabled===!0&&Je.isPresenting===!0&&(Je.cameraAutoUpdate===!0&&Je.updateCamera(pe),pe=Je.getCamera()),ee.isScene===!0&&ee.onBeforeRender(x,ee,pe,M),b=ue.get(ee,w.length),b.init(),w.push(b),Me.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),J.setFromProjectionMatrix(Me),ve=this.localClippingEnabled,ae=ge.init(this.clippingPlanes,ve),g=de.get(ee,m.length),g.init(),m.push(g),On(ee,pe,0,x.sortObjects),g.finish(),x.sortObjects===!0&&g.sort(L,N),this.info.render.frame++,ae===!0&&ge.beginShadows();const Ae=b.state.shadowsArray;if(be.render(Ae,ee,pe),ae===!0&&ge.endShadows(),this.info.autoReset===!0&&this.info.reset(),Te.render(g,ee),b.setupLights(x._useLegacyLights),pe.isArrayCamera){const Ee=pe.cameras;for(let ke=0,at=Ee.length;ke0?b=w[w.length-1]:b=null,m.pop(),m.length>0?g=m[m.length-1]:g=null};function On(ee,pe,Ae,Ee){if(ee.visible===!1)return;if(ee.layers.test(pe.layers)){if(ee.isGroup)Ae=ee.renderOrder;else if(ee.isLOD)ee.autoUpdate===!0&&ee.update(pe);else if(ee.isLight)b.pushLight(ee),ee.castShadow&&b.pushShadow(ee);else if(ee.isSprite){if(!ee.frustumCulled||J.intersectsSprite(ee)){Ee&&we.setFromMatrixPosition(ee.matrixWorld).applyMatrix4(Me);const _t=H.update(ee),Nt=ee.material;Nt.visible&&g.push(ee,_t,Nt,Ae,we.z,null)}}else if((ee.isMesh||ee.isLine||ee.isPoints)&&(!ee.frustumCulled||J.intersectsObject(ee))){const _t=H.update(ee),Nt=ee.material;if(Ee&&(ee.boundingSphere!==void 0?(ee.boundingSphere===null&&ee.computeBoundingSphere(),we.copy(ee.boundingSphere.center)):(_t.boundingSphere===null&&_t.computeBoundingSphere(),we.copy(_t.boundingSphere.center)),we.applyMatrix4(ee.matrixWorld).applyMatrix4(Me)),Array.isArray(Nt)){const lt=_t.groups;for(let Et=0,Ht=lt.length;Et0&&Ii(ke,at,pe,Ae),Ee&&Z.viewport(R.copy(Ee)),ke.length>0&&Io(ke,pe,Ae),at.length>0&&Io(at,pe,Ae),_t.length>0&&Io(_t,pe,Ae),Z.buffers.depth.setTest(!0),Z.buffers.depth.setMask(!0),Z.buffers.color.setMask(!0),Z.setPolygonOffset(!1)}function Ii(ee,pe,Ae,Ee){if((Ae.isScene===!0?Ae.overrideMaterial:null)!==null)return;const at=X.isWebGL2;fe===null&&(fe=new Za(1,1,{generateMipmaps:!0,type:Ce.has("EXT_color_buffer_half_float")?Uf:Ds,minFilter:ud,samples:at?4:0})),x.getDrawingBufferSize(ye),at?fe.setSize(ye.x,ye.y):fe.setSize(TS(ye.x),TS(ye.y));const _t=x.getRenderTarget();x.setRenderTarget(fe),x.getClearColor(j),k=x.getClearAlpha(),k<1&&x.setClearColor(16777215,.5),x.clear();const Nt=x.toneMapping;x.toneMapping=Il,Io(ee,Ae,Ee),ne.updateMultisampleRenderTarget(fe),ne.updateRenderTargetMipmap(fe);let lt=!1;for(let Et=0,Ht=pe.length;Et0),zt=!!Ae.morphAttributes.position,Ln=!!Ae.morphAttributes.normal,ei=!!Ae.morphAttributes.color;let er=Il;Ee.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(er=x.toneMapping);const hi=Ae.morphAttributes.position||Ae.morphAttributes.normal||Ae.morphAttributes.color,Vt=hi!==void 0?hi.length:0,xt=Y.get(Ee),Bs=b.state.lights;if(ae===!0&&(ve===!0||ee!==A)){const mi=ee===A&&Ee.id===P;ge.setState(Ee,ee,mi)}let un=!1;Ee.version===xt.__version?(xt.needsLights&&xt.lightsStateVersion!==Bs.state.version||xt.outputColorSpace!==Nt||ke.isInstancedMesh&&xt.instancing===!1||!ke.isInstancedMesh&&xt.instancing===!0||ke.isSkinnedMesh&&xt.skinning===!1||!ke.isSkinnedMesh&&xt.skinning===!0||ke.isInstancedMesh&&xt.instancingColor===!0&&ke.instanceColor===null||ke.isInstancedMesh&&xt.instancingColor===!1&&ke.instanceColor!==null||xt.envMap!==lt||Ee.fog===!0&&xt.fog!==at||xt.numClippingPlanes!==void 0&&(xt.numClippingPlanes!==ge.numPlanes||xt.numIntersection!==ge.numIntersection)||xt.vertexAlphas!==Et||xt.vertexTangents!==Ht||xt.morphTargets!==zt||xt.morphNormals!==Ln||xt.morphColors!==ei||xt.toneMapping!==er||X.isWebGL2===!0&&xt.morphTargetsCount!==Vt)&&(un=!0):(un=!0,xt.__version=Ee.version);let Mr=xt.currentProgram;un===!0&&(Mr=Ni(Ee,pe,ke));let il=!1,$s=!1,pi=!1;const Wr=Mr.getUniforms(),ol=xt.uniforms;if(Z.useProgram(Mr.program)&&(il=!0,$s=!0,pi=!0),Ee.id!==P&&(P=Ee.id,$s=!0),il||A!==ee){Wr.setValue(re,"projectionMatrix",ee.projectionMatrix),Wr.setValue(re,"viewMatrix",ee.matrixWorldInverse);const mi=Wr.map.cameraPosition;mi!==void 0&&mi.setValue(re,we.setFromMatrixPosition(ee.matrixWorld)),X.logarithmicDepthBuffer&&Wr.setValue(re,"logDepthBufFC",2/(Math.log(ee.far+1)/Math.LN2)),(Ee.isMeshPhongMaterial||Ee.isMeshToonMaterial||Ee.isMeshLambertMaterial||Ee.isMeshBasicMaterial||Ee.isMeshStandardMaterial||Ee.isShaderMaterial)&&Wr.setValue(re,"isOrthographic",ee.isOrthographicCamera===!0),A!==ee&&(A=ee,$s=!0,pi=!0)}if(ke.isSkinnedMesh){Wr.setOptional(re,ke,"bindMatrix"),Wr.setOptional(re,ke,"bindMatrixInverse");const mi=ke.skeleton;mi&&(X.floatVertexTextures?(mi.boneTexture===null&&mi.computeBoneTexture(),Wr.setValue(re,"boneTexture",mi.boneTexture,ne),Wr.setValue(re,"boneTextureSize",mi.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const vh=Ae.morphAttributes;if((vh.position!==void 0||vh.normal!==void 0||vh.color!==void 0&&X.isWebGL2===!0)&&Re.update(ke,Ae,Mr),($s||xt.receiveShadow!==ke.receiveShadow)&&(xt.receiveShadow=ke.receiveShadow,Wr.setValue(re,"receiveShadow",ke.receiveShadow)),Ee.isMeshGouraudMaterial&&Ee.envMap!==null&&(ol.envMap.value=lt,ol.flipEnvMap.value=lt.isCubeTexture&<.isRenderTargetTexture===!1?-1:1),$s&&(Wr.setValue(re,"toneMappingExposure",x.toneMappingExposure),xt.needsLights&&qe(ol,pi),at&&Ee.fog===!0&&le.refreshFogUniforms(ol,at),le.refreshMaterialUniforms(ol,Ee,B,G,fe),d_.upload(re,co(xt),ol,ne)),Ee.isShaderMaterial&&Ee.uniformsNeedUpdate===!0&&(d_.upload(re,co(xt),ol,ne),Ee.uniformsNeedUpdate=!1),Ee.isSpriteMaterial&&Wr.setValue(re,"center",ke.center),Wr.setValue(re,"modelViewMatrix",ke.modelViewMatrix),Wr.setValue(re,"normalMatrix",ke.normalMatrix),Wr.setValue(re,"modelMatrix",ke.matrixWorld),Ee.isShaderMaterial||Ee.isRawShaderMaterial){const mi=Ee.uniformsGroups;for(let yh=0,os=mi.length;yh0&&ne.useMultisampledRTT(ee)===!1?ke=Y.get(ee).__webglMultisampledFramebuffer:Array.isArray(Ht)?ke=Ht[Ae]:ke=Ht,R.copy(ee.viewport),F.copy(ee.scissor),$=ee.scissorTest}else R.copy(W).multiplyScalar(B).floor(),F.copy(K).multiplyScalar(B).floor(),$=Q;if(Z.bindFramebuffer(re.FRAMEBUFFER,ke)&&X.drawBuffers&&Ee&&Z.drawBuffers(ee,ke),Z.viewport(R),Z.scissor(F),Z.setScissorTest($),at){const lt=Y.get(ee.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+pe,lt.__webglTexture,Ae)}else if(_t){const lt=Y.get(ee.texture),Et=pe||0;re.framebufferTextureLayer(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,lt.__webglTexture,Ae||0,Et)}P=-1},this.readRenderTargetPixels=function(ee,pe,Ae,Ee,ke,at,_t){if(!(ee&&ee.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Nt=Y.get(ee).__webglFramebuffer;if(ee.isWebGLCubeRenderTarget&&_t!==void 0&&(Nt=Nt[_t]),Nt){Z.bindFramebuffer(re.FRAMEBUFFER,Nt);try{const lt=ee.texture,Et=lt.format,Ht=lt.type;if(Et!==Co&&Ye.convert(Et)!==re.getParameter(re.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const zt=Ht===Uf&&(Ce.has("EXT_color_buffer_half_float")||X.isWebGL2&&Ce.has("EXT_color_buffer_float"));if(Ht!==Ds&&Ye.convert(Ht)!==re.getParameter(re.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ht===za&&(X.isWebGL2||Ce.has("OES_texture_float")||Ce.has("WEBGL_color_buffer_float")))&&!zt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}pe>=0&&pe<=ee.width-Ee&&Ae>=0&&Ae<=ee.height-ke&&re.readPixels(pe,Ae,Ee,ke,Ye.convert(Et),Ye.convert(Ht),at)}finally{const lt=M!==null?Y.get(M).__webglFramebuffer:null;Z.bindFramebuffer(re.FRAMEBUFFER,lt)}}},this.copyFramebufferToTexture=function(ee,pe,Ae=0){const Ee=Math.pow(2,-Ae),ke=Math.floor(pe.image.width*Ee),at=Math.floor(pe.image.height*Ee);ne.setTexture2D(pe,0),re.copyTexSubImage2D(re.TEXTURE_2D,Ae,0,0,ee.x,ee.y,ke,at),Z.unbindTexture()},this.copyTextureToTexture=function(ee,pe,Ae,Ee=0){const ke=pe.image.width,at=pe.image.height,_t=Ye.convert(Ae.format),Nt=Ye.convert(Ae.type);ne.setTexture2D(Ae,0),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,Ae.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ae.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,Ae.unpackAlignment),pe.isDataTexture?re.texSubImage2D(re.TEXTURE_2D,Ee,ee.x,ee.y,ke,at,_t,Nt,pe.image.data):pe.isCompressedTexture?re.compressedTexSubImage2D(re.TEXTURE_2D,Ee,ee.x,ee.y,pe.mipmaps[0].width,pe.mipmaps[0].height,_t,pe.mipmaps[0].data):re.texSubImage2D(re.TEXTURE_2D,Ee,ee.x,ee.y,_t,Nt,pe.image),Ee===0&&Ae.generateMipmaps&&re.generateMipmap(re.TEXTURE_2D),Z.unbindTexture()},this.copyTextureToTexture3D=function(ee,pe,Ae,Ee,ke=0){if(x.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const at=ee.max.x-ee.min.x+1,_t=ee.max.y-ee.min.y+1,Nt=ee.max.z-ee.min.z+1,lt=Ye.convert(Ee.format),Et=Ye.convert(Ee.type);let Ht;if(Ee.isData3DTexture)ne.setTexture3D(Ee,0),Ht=re.TEXTURE_3D;else if(Ee.isDataArrayTexture)ne.setTexture2DArray(Ee,0),Ht=re.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,Ee.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Ee.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,Ee.unpackAlignment);const zt=re.getParameter(re.UNPACK_ROW_LENGTH),Ln=re.getParameter(re.UNPACK_IMAGE_HEIGHT),ei=re.getParameter(re.UNPACK_SKIP_PIXELS),er=re.getParameter(re.UNPACK_SKIP_ROWS),hi=re.getParameter(re.UNPACK_SKIP_IMAGES),Vt=Ae.isCompressedTexture?Ae.mipmaps[0]:Ae.image;re.pixelStorei(re.UNPACK_ROW_LENGTH,Vt.width),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,Vt.height),re.pixelStorei(re.UNPACK_SKIP_PIXELS,ee.min.x),re.pixelStorei(re.UNPACK_SKIP_ROWS,ee.min.y),re.pixelStorei(re.UNPACK_SKIP_IMAGES,ee.min.z),Ae.isDataTexture||Ae.isData3DTexture?re.texSubImage3D(Ht,ke,pe.x,pe.y,pe.z,at,_t,Nt,lt,Et,Vt.data):Ae.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),re.compressedTexSubImage3D(Ht,ke,pe.x,pe.y,pe.z,at,_t,Nt,lt,Vt.data)):re.texSubImage3D(Ht,ke,pe.x,pe.y,pe.z,at,_t,Nt,lt,Et,Vt),re.pixelStorei(re.UNPACK_ROW_LENGTH,zt),re.pixelStorei(re.UNPACK_IMAGE_HEIGHT,Ln),re.pixelStorei(re.UNPACK_SKIP_PIXELS,ei),re.pixelStorei(re.UNPACK_SKIP_ROWS,er),re.pixelStorei(re.UNPACK_SKIP_IMAGES,hi),ke===0&&Ee.generateMipmaps&&re.generateMipmap(Ht),Z.unbindTexture()},this.initTexture=function(ee){ee.isCubeTexture?ne.setTextureCube(ee,0):ee.isData3DTexture?ne.setTexture3D(ee,0):ee.isDataArrayTexture||ee.isCompressedArrayTexture?ne.setTexture2DArray(ee,0):ne.setTexture2D(ee,0),Z.unbindTexture()},this.resetState=function(){C=0,S=0,M=null,Z.reset(),it.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Ml}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=e===PE?"display-p3":"srgb",n.unpackColorSpace=Bn.workingColorSpace===Ab?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===ai?Qc:YN}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===Qc?ai:Ul}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class lX extends oF{}lX.prototype.isWebGL1Renderer=!0;class NE{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new vt(e),this.density=n}clone(){return new NE(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class FE{constructor(e,n=1,r=1e3){this.isFog=!0,this.name="",this.color=new vt(e),this.near=n,this.far=r}clone(){return new FE(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class AS extends Tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n}}class OE{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=Ty,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Rs()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,r){e*=this.stride,r*=n.stride;for(let i=0,o=this.stride;ie.far||n.push({distance:l,point:_0.clone(),uv:Uo.getInterpolation(_0,qx,C0,Xx,R6,oA,I6,new Xe),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Kx(t,e,n,r,i,o){ap.subVectors(t,n).addScalar(.5).multiply(r),i!==void 0?(S0.x=o*ap.x-i*ap.y,S0.y=i*ap.x+o*ap.y):S0.copy(ap),t.copy(e),t.x+=S0.x,t.y+=S0.y,t.applyMatrix4(uX)}const Yx=new oe,N6=new oe;class dX extends Tn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const n=e.levels;for(let r=0,i=n.length;r0){let r,i;for(r=1,i=n.length;r0){Yx.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Yx);this.getObjectForDistance(i).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){Yx.setFromMatrixPosition(e.matrixWorld),N6.setFromMatrixPosition(this.matrixWorld);const r=Yx.distanceTo(N6)/e.zoom;n[0].object.visible=!0;let i,o;for(i=1,o=n.length;i=s)n[i-1].object.visible=!1,n[i].object.visible=!0;else break}for(this._currentLevel=i-1;il)continue;f.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(f);Pe.far||n.push({distance:P,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,s.start),w=Math.min(b.count,s.start+s.count);for(let x=m,_=w-1;x<_;x+=h){if(u.fromBufferAttribute(b,x),c.fromBufferAttribute(b,x+1),lA.distanceSqToSegment(u,c,f,d)>l)continue;f.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(f);Se.far||n.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const n=this.geometry.morphAttributes,r=Object.keys(n);if(r.length>0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;o0){const i=n[r[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,s=i.length;oi.far)return;o.push({distance:u,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:s})}}class Q3e extends Lr{constructor(e,n,r,i,o,s,a,l,u){super(e,n,r,i,o,s,a,l,u),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:Hr,this.magFilter=o!==void 0?o:Hr,this.generateMipmaps=!1;const c=this;function d(){c.needsUpdate=!0,e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(d)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class J3e extends Lr{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=Nr,this.minFilter=Nr,this.generateMipmaps=!1,this.needsUpdate=!0}}class LE extends Lr{constructor(e,n,r,i,o,s,a,l,u,c,d,f){super(null,s,a,l,u,c,i,o,d,f),this.isCompressedTexture=!0,this.image={width:n,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class eIe extends LE{constructor(e,n,r,i,o,s){super(e,n,r,o,s),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ci}}class tIe extends LE{constructor(e,n,r){super(void 0,e[0].width,e[0].height,n,r,Hu),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class nIe extends Lr{constructor(e,n,r,i,o,s,a,l,u){super(e,n,r,i,o,s,a,l,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class el{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,n){const r=this.getUtoTmapping(e);return this.getPoint(r,n)}getPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPoint(r/e));return n}getSpacedPoints(e=5){const n=[];for(let r=0;r<=e;r++)n.push(this.getPointAt(r/e));return n}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const n=[];let r,i=this.getPoint(0),o=0;n.push(0);for(let s=1;s<=e;s++)r=this.getPoint(s/e),o+=r.distanceTo(i),n.push(o),i=r;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n){const r=this.getLengths();let i=0;const o=r.length;let s;n?s=n:s=e*r[o-1];let a=0,l=o-1,u;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),u=r[i]-s,u<0)a=i+1;else if(u>0)l=i-1;else{l=i;break}if(i=l,r[i]===s)return i/(o-1);const c=r[i],f=r[i+1]-c,h=(s-c)/f;return(i+h)/(o-1)}getTangent(e,n){let i=e-1e-4,o=e+1e-4;i<0&&(i=0),o>1&&(o=1);const s=this.getPoint(i),a=this.getPoint(o),l=n||(s.isVector2?new Xe:new oe);return l.copy(a).sub(s).normalize(),l}getTangentAt(e,n){const r=this.getUtoTmapping(e);return this.getTangent(r,n)}computeFrenetFrames(e,n){const r=new oe,i=[],o=[],s=[],a=new oe,l=new qt;for(let h=0;h<=e;h++){const p=h/e;i[h]=this.getTangentAt(p,new oe)}o[0]=new oe,s[0]=new oe;let u=Number.MAX_VALUE;const c=Math.abs(i[0].x),d=Math.abs(i[0].y),f=Math.abs(i[0].z);c<=u&&(u=c,r.set(1,0,0)),d<=u&&(u=d,r.set(0,1,0)),f<=u&&r.set(0,0,1),a.crossVectors(i[0],r).normalize(),o[0].crossVectors(i[0],a),s[0].crossVectors(i[0],o[0]);for(let h=1;h<=e;h++){if(o[h]=o[h-1].clone(),s[h]=s[h-1].clone(),a.crossVectors(i[h-1],i[h]),a.length()>Number.EPSILON){a.normalize();const p=Math.acos(Fr(i[h-1].dot(i[h]),-1,1));o[h].applyMatrix4(l.makeRotationAxis(a,p))}s[h].crossVectors(i[h],o[h])}if(n===!0){let h=Math.acos(Fr(o[0].dot(o[e]),-1,1));h/=e,i[0].dot(a.crossVectors(o[0],o[e]))>0&&(h=-h);for(let p=1;p<=e;p++)o[p].applyMatrix4(l.makeRotationAxis(i[p],h*p)),s[p].crossVectors(i[p],o[p])}return{tangents:i,normals:o,binormals:s}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class BE extends el{constructor(e=0,n=0,r=1,i=1,o=0,s=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=r,this.yRadius=i,this.aStartAngle=o,this.aEndAngle=s,this.aClockwise=a,this.aRotation=l}getPoint(e,n){const r=n||new Xe,i=Math.PI*2;let o=this.aEndAngle-this.aStartAngle;const s=Math.abs(o)i;)o-=i;o0?0:(Math.floor(Math.abs(a)/o)+1)*o:l===0&&a===o-1&&(a=o-2,l=1);let u,c;this.closed||a>0?u=i[(a-1)%o]:(nw.subVectors(i[0],i[1]).add(i[0]),u=nw);const d=i[a%o],f=i[(a+1)%o];if(this.closed||a+2i.length-2?i.length-1:s+1],d=i[s>i.length-3?i.length-1:s+2];return r.set(K6(a,l.x,u.x,c.x,d.x),K6(a,l.y,u.y,c.y,d.y)),r}copy(e){super.copy(e),this.points=[];for(let n=0,r=e.points.length;n=r){const s=i[o]-r,a=this.curves[o],l=a.getLength(),u=l===0?0:1-s/l;return a.getPointAt(u,n)}o++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let r=0,i=this.curves.length;r1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,r=e.curves.length;n0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const c=u.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Fb extends rn{constructor(e=[new Xe(0,-.5),new Xe(.5,0),new Xe(0,.5)],n=12,r=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n),i=Fr(i,0,Math.PI*2);const o=[],s=[],a=[],l=[],u=[],c=1/n,d=new oe,f=new Xe,h=new oe,p=new oe,g=new oe;let b=0,m=0;for(let w=0;w<=e.length-1;w++)switch(w){case 0:b=e[w+1].x-e[w].x,m=e[w+1].y-e[w].y,h.x=m*1,h.y=-b,h.z=m*0,g.copy(h),h.normalize(),l.push(h.x,h.y,h.z);break;case e.length-1:l.push(g.x,g.y,g.z);break;default:b=e[w+1].x-e[w].x,m=e[w+1].y-e[w].y,h.x=m*1,h.y=-b,h.z=m*0,p.copy(h),h.x+=g.x,h.y+=g.y,h.z+=g.z,h.normalize(),l.push(h.x,h.y,h.z),g.copy(p)}for(let w=0;w<=n;w++){const x=r+w*c*i,_=Math.sin(x),C=Math.cos(x);for(let S=0;S<=e.length-1;S++){d.x=e[S].x*_,d.y=e[S].y,d.z=e[S].x*C,s.push(d.x,d.y,d.z),f.x=w/n,f.y=S/(e.length-1),a.push(f.x,f.y);const M=l[3*S+0]*_,P=l[3*S+1],A=l[3*S+0]*C;u.push(M,P,A)}}for(let w=0;w0&&x(!0),n>0&&x(!1)),this.setIndex(c),this.setAttribute("position",new Ct(d,3)),this.setAttribute("normal",new Ct(f,3)),this.setAttribute("uv",new Ct(h,2));function w(){const _=new oe,C=new oe;let S=0;const M=(n-e)/r;for(let P=0;P<=o;P++){const A=[],R=P/o,F=R*(n-e)+e;for(let $=0;$<=i;$++){const j=$/i,k=j*l+a,U=Math.sin(k),G=Math.cos(k);C.x=F*U,C.y=-R*r+b,C.z=F*G,d.push(C.x,C.y,C.z),_.set(U,M,G).normalize(),f.push(_.x,_.y,_.z),h.push(j,1-R),A.push(p++)}g.push(A)}for(let P=0;P.9&&M<.1&&(x<.2&&(s[w+0]+=1),_<.2&&(s[w+2]+=1),C<.2&&(s[w+4]+=1))}}function f(w){o.push(w.x,w.y,w.z)}function h(w,x){const _=w*3;x.x=e[_+0],x.y=e[_+1],x.z=e[_+2]}function p(){const w=new oe,x=new oe,_=new oe,C=new oe,S=new Xe,M=new Xe,P=new Xe;for(let A=0,R=0;A80*n){a=u=t[0],l=c=t[1];for(let p=n;pu&&(u=d),f>c&&(c=f);h=Math.max(u-a,c-l),h=h!==0?32767/h:0}return Ry(o,s,n,a,l,h,0),s}};function _X(t,e,n,r,i){let o,s;if(i===MIe(t,e,n,r)>0)for(o=e;o=e;o-=r)s=Y6(o,t[o],t[o+1],s);return s&&VE(s,s.next)&&(Ny(s),s=s.next),s}function Gf(t,e){if(!t)return t;e||(e=t);let n=t,r;do if(r=!1,!n.steiner&&(VE(n,n.next)||xr(n.prev,n,n.next)===0)){if(Ny(n),n=e=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==e);return e}function Ry(t,e,n,r,i,o,s){if(!t)return;!s&&o&&xIe(t,r,i,o);let a=t,l,u;for(;t.prev!==t.next;){if(l=t.prev,u=t.next,o?fIe(t,r,i,o):dIe(t)){e.push(l.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Ny(t),t=u.next,a=u.next;continue}if(t=u,t===a){s?s===1?(t=hIe(Gf(t),e,n),Ry(t,e,n,r,i,o,2)):s===2&&pIe(t,e,n,r,i,o):Ry(Gf(t),e,n,r,i,o,1);break}}}function dIe(t){const e=t.prev,n=t,r=t.next;if(xr(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,c=io?i>s?i:s:o>s?o:s,h=a>l?a>u?a:u:l>u?l:u;let p=r.next;for(;p!==e;){if(p.x>=c&&p.x<=f&&p.y>=d&&p.y<=h&&rm(i,a,o,l,s,u,p.x,p.y)&&xr(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function fIe(t,e,n,r){const i=t.prev,o=t,s=t.next;if(xr(i,o,s)>=0)return!1;const a=i.x,l=o.x,u=s.x,c=i.y,d=o.y,f=s.y,h=al?a>u?a:u:l>u?l:u,b=c>d?c>f?c:f:d>f?d:f,m=xR(h,p,e,n,r),w=xR(g,b,e,n,r);let x=t.prevZ,_=t.nextZ;for(;x&&x.z>=m&&_&&_.z<=w;){if(x.x>=h&&x.x<=g&&x.y>=p&&x.y<=b&&x!==i&&x!==s&&rm(a,c,l,d,u,f,x.x,x.y)&&xr(x.prev,x,x.next)>=0||(x=x.prevZ,_.x>=h&&_.x<=g&&_.y>=p&&_.y<=b&&_!==i&&_!==s&&rm(a,c,l,d,u,f,_.x,_.y)&&xr(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;x&&x.z>=m;){if(x.x>=h&&x.x<=g&&x.y>=p&&x.y<=b&&x!==i&&x!==s&&rm(a,c,l,d,u,f,x.x,x.y)&&xr(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;_&&_.z<=w;){if(_.x>=h&&_.x<=g&&_.y>=p&&_.y<=b&&_!==i&&_!==s&&rm(a,c,l,d,u,f,_.x,_.y)&&xr(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function hIe(t,e,n){let r=t;do{const i=r.prev,o=r.next.next;!VE(i,o)&&SX(i,r,r.next,o)&&Iy(i,o)&&Iy(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Ny(r),Ny(r.next),r=t=o),r=r.next}while(r!==t);return Gf(r)}function pIe(t,e,n,r,i,o){let s=t;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&SIe(s,a)){let l=CX(s,a);s=Gf(s,s.next),l=Gf(l,l.next),Ry(s,e,n,r,i,o,0),Ry(l,e,n,r,i,o,0);return}a=a.next}s=s.next}while(s!==t)}function mIe(t,e,n,r){const i=[];let o,s,a,l,u;for(o=0,s=e.length;o=n.next.y&&n.next.y!==n.y){const f=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=o&&f>r&&(r=f,i=n.x=n.x&&n.x>=l&&o!==n.x&&rm(si.x||n.x===i.x&&bIe(i,n)))&&(i=n,c=d)),n=n.next;while(n!==a);return i}function bIe(t,e){return xr(t.prev,t,e.prev)<0&&xr(e.next,t,t.next)<0}function xIe(t,e,n,r){let i=t;do i.z===0&&(i.z=xR(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,wIe(i)}function wIe(t){let e,n,r,i,o,s,a,l,u=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e0||l>0&&r;)a!==0&&(l===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(s>1);return t}function xR(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function _Ie(t){let e=t,n=t;do(e.x=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function SIe(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!CIe(t,e)&&(Iy(t,e)&&Iy(e,t)&&EIe(t,e)&&(xr(t.prev,t,e.prev)||xr(t,e.prev,e))||VE(t,e)&&xr(t.prev,t,t.next)>0&&xr(e.prev,e,e.next)>0)}function xr(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function VE(t,e){return t.x===e.x&&t.y===e.y}function SX(t,e,n,r){const i=aw(xr(t,e,n)),o=aw(xr(t,e,r)),s=aw(xr(n,r,t)),a=aw(xr(n,r,e));return!!(i!==o&&s!==a||i===0&&sw(t,n,e)||o===0&&sw(t,r,e)||s===0&&sw(n,t,r)||a===0&&sw(n,e,r))}function sw(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function aw(t){return t>0?1:t<0?-1:0}function CIe(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&SX(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Iy(t,e){return xr(t.prev,t,t.next)<0?xr(t,e,t.next)>=0&&xr(t,t.prev,e)>=0:xr(t,e,t.prev)<0||xr(t,t.next,e)<0}function EIe(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==t);return r}function CX(t,e){const n=new wR(t.i,t.x,t.y),r=new wR(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Y6(t,e,n,r){const i=new wR(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ny(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function wR(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function MIe(t,e,n,r){let i=0;for(let o=e,s=n-r;o2&&t[e-1].equals(t[0])&&t.pop()}function Q6(t,e){for(let n=0;nNumber.EPSILON){const H=Math.sqrt(Pe),te=Math.sqrt(se*se+xe*xe),le=_e.x-ne/H,de=_e.y+Y/H,ue=Ce.x-xe/te,ge=Ce.y+se/te,be=((ue-le)*xe-(ge-de)*se)/(Y*xe-ne*se);X=le+Y*be-re.x,Z=de+ne*be-re.y;const Te=X*X+Z*Z;if(Te<=2)return new Xe(X,Z);he=Math.sqrt(Te/2)}else{let H=!1;Y>Number.EPSILON?se>Number.EPSILON&&(H=!0):Y<-Number.EPSILON?se<-Number.EPSILON&&(H=!0):Math.sign(ne)===Math.sign(xe)&&(H=!0),H?(X=-ne,Z=Y,he=Math.sqrt(Pe)):(X=Y,Z=ne,he=Math.sqrt(Pe/2))}return new Xe(X/he,Z/he)}const N=[];for(let re=0,_e=k.length,Ce=_e-1,X=re+1;re<_e;re++,Ce++,X++)Ce===_e&&(Ce=0),X===_e&&(X=0),N[re]=L(k[re],k[Ce],k[X]);const W=[];let K,Q=N.concat();for(let re=0,_e=F.length;re<_e;re++){const Ce=F[re];K=[];for(let X=0,Z=Ce.length,he=Z-1,Y=X+1;X=0;re--){const _e=re/b,Ce=h*Math.cos(_e*Math.PI/2),X=p*Math.sin(_e*Math.PI/2)+g;for(let Z=0,he=k.length;Z=0;){const X=Ce;let Z=Ce-1;Z<0&&(Z=re.length-1);for(let he=0,Y=c+b*2;he0)&&h.push(x,_,S),(m!==r-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class PX extends ji{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new vt(16777215),this.specular=new vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class DX extends ji{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new vt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class RX extends ji{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class IX extends ji{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Mb,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class NX extends ji{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new vt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sd,this.normalScale=new Xe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class FX extends Ro{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function gf(t,e,n){return!t||!n&&t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function OX(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function kX(t){function e(i,o){return t[i]-t[o]}const n=t.length,r=new Array(n);for(let i=0;i!==n;++i)r[i]=i;return r.sort(e),r}function _R(t,e,n){const r=t.length,i=new t.constructor(r);for(let o=0,s=0;s!==r;++o){const a=n[o]*e;for(let l=0;l!==e;++l)i[s++]=t[a+l]}return i}function gF(t,e,n,r){let i=1,o=t[0];for(;o!==void 0&&o[r]===void 0;)o=t[i++];if(o===void 0)return;let s=o[r];if(s!==void 0)if(Array.isArray(s))do s=o[r],s!==void 0&&(e.push(o.time),n.push.apply(n,s)),o=t[i++];while(o!==void 0);else if(s.toArray!==void 0)do s=o[r],s!==void 0&&(e.push(o.time),s.toArray(n,n.length)),o=t[i++];while(o!==void 0);else do s=o[r],s!==void 0&&(e.push(o.time),n.push(s)),o=t[i++];while(o!==void 0)}function DIe(t,e,n,r,i=30){const o=t.clone();o.name=e;const s=[];for(let l=0;l=r)){d.push(u.times[h]);for(let g=0;go.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l=a.times[p]){const m=p*d+c,w=m+d-c;g=a.values.slice(m,w)}else{const m=a.createInterpolant(),w=c,x=d-c;m.evaluate(o),g=m.resultBuffer.slice(w,x)}l==="quaternion"&&new Yo().fromArray(g).normalize().conjugate().toArray(g);const b=u.times.length;for(let m=0;m=o)){const a=n[1];e=o)break t}s=r,r=0;break n}break e}for(;r>>1;en;)--s;if(++s,o!==0||s!==i){o>=s&&(s=Math.max(s,1),o=s-1);const a=this.getValueSize();this.times=r.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const r=this.times,i=this.values,o=r.length;o===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let a=0;a!==o;a++){const l=r[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,s),e=!1;break}s=l}if(i!==void 0&&OX(i))for(let a=0,l=i.length;a!==l;++a){const u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),r=this.getValueSize(),i=this.getInterpolation()===c_,o=e.length-1;let s=1;for(let a=1;a0){e[s]=e[o];for(let a=o*r,l=s*r,u=0;u!==r;++u)n[l+u]=n[a+u];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=n.slice(0,s*r)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),r=this.constructor,i=new r(this.name,e,n);return i.createInterpolant=this.createInterpolant,i}}tl.prototype.TimeBufferType=Float32Array;tl.prototype.ValueBufferType=Float32Array;tl.prototype.DefaultInterpolation=_y;class oh extends tl{}oh.prototype.ValueTypeName="bool";oh.prototype.ValueBufferType=Array;oh.prototype.DefaultInterpolation=wy;oh.prototype.InterpolantFactoryMethodLinear=void 0;oh.prototype.InterpolantFactoryMethodSmooth=void 0;class yF extends tl{}yF.prototype.ValueTypeName="color";class Fy extends tl{}Fy.prototype.ValueTypeName="number";class $X extends Lb{constructor(e,n,r,i){super(e,n,r,i)}interpolate_(e,n,r,i){const o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,l=(r-n)/(i-n);let u=e*a;for(let c=u+a;u!==c;u+=4)Yo.slerpFlat(o,0,s,u-a,s,u,l);return o}}class _g extends tl{InterpolantFactoryMethodLinear(e){return new $X(this.times,this.values,this.getValueSize(),e)}}_g.prototype.ValueTypeName="quaternion";_g.prototype.DefaultInterpolation=_y;_g.prototype.InterpolantFactoryMethodSmooth=void 0;class sh extends tl{}sh.prototype.ValueTypeName="string";sh.prototype.ValueBufferType=Array;sh.prototype.DefaultInterpolation=wy;sh.prototype.InterpolantFactoryMethodLinear=void 0;sh.prototype.InterpolantFactoryMethodSmooth=void 0;class Oy extends tl{}Oy.prototype.ValueTypeName="vector";class ky{constructor(e,n=-1,r,i=AE){this.name=e,this.tracks=r,this.duration=n,this.blendMode=i,this.uuid=Rs(),this.duration<0&&this.resetDuration()}static parse(e){const n=[],r=e.tracks,i=1/(e.fps||1);for(let s=0,a=r.length;s!==a;++s)n.push(FIe(r[s]).scale(i));const o=new this(e.name,e.duration,n,e.blendMode);return o.uuid=e.uuid,o}static toJSON(e){const n=[],r=e.tracks,i={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode};for(let o=0,s=r.length;o!==s;++o)n.push(tl.toJSON(r[o]));return i}static CreateFromMorphTargetSequence(e,n,r,i){const o=n.length,s=[];for(let a=0;a1){const d=c[1];let f=i[d];f||(i[d]=f=[]),f.push(u)}}const s=[];for(const a in i)s.push(this.CreateFromMorphTargetSequence(a,i[a],n,r));return s}static parseAnimation(e,n){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const r=function(d,f,h,p,g){if(h.length!==0){const b=[],m=[];gF(h,b,m,p),b.length!==0&&g.push(new d(f,b,m))}},i=[],o=e.name||"default",s=e.fps||30,a=e.blendMode;let l=e.length||-1;const u=e.hierarchy||[];for(let d=0;d{n&&n(o),this.manager.itemEnd(e)},0),o;if(fu[e]!==void 0){fu[e].push({onLoad:n,onProgress:r,onError:i});return}fu[e]=[],fu[e].push({onLoad:n,onProgress:r,onError:i});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(s).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const c=fu[e],d=u.body.getReader(),f=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),h=f?parseInt(f):0,p=h!==0;let g=0;const b=new ReadableStream({start(m){w();function w(){d.read().then(({done:x,value:_})=>{if(x)m.close();else{g+=_.byteLength;const C=new ProgressEvent("progress",{lengthComputable:p,loaded:g,total:h});for(let S=0,M=c.length;S{switch(l){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(c=>new DOMParser().parseFromString(c,a));case"json":return u.json();default:if(a===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(a),f=d&&d[1]?d[1].toLowerCase():void 0,h=new TextDecoder(f);return u.arrayBuffer().then(p=>h.decode(p))}}}).then(u=>{jf.add(e,u);const c=fu[e];delete fu[e];for(let d=0,f=c.length;d{const c=fu[e];if(c===void 0)throw this.manager.itemError(e),u;delete fu[e];for(let d=0,f=c.length;d{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class kIe extends ns{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new Gu(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(a){try{n(o.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),o.manager.itemError(e)}},r,i)}parse(e){const n=[];for(let r=0;r0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const o in e.uniforms){const s=e.uniforms[o];switch(i.uniforms[o]={},s.type){case"t":i.uniforms[o].value=r(s.value);break;case"c":i.uniforms[o].value=new vt().setHex(s.value);break;case"v2":i.uniforms[o].value=new Xe().fromArray(s.value);break;case"v3":i.uniforms[o].value=new oe().fromArray(s.value);break;case"v4":i.uniforms[o].value=new kn().fromArray(s.value);break;case"m3":i.uniforms[o].value=new nn().fromArray(s.value);break;case"m4":i.uniforms[o].value=new qt().fromArray(s.value);break;default:i.uniforms[o].value=s.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const o in e.extensions)i.extensions[o]=e.extensions[o];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=r(e.map)),e.matcap!==void 0&&(i.matcap=r(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=r(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=r(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=r(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),i.normalScale=new Xe().fromArray(o)}return e.displacementMap!==void 0&&(i.displacementMap=r(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=r(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=r(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=r(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=r(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=r(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=r(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=r(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=r(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=r(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=r(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=r(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=r(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new Xe().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=r(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=r(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=r(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=r(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=r(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=r(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=r(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const n={ShadowMaterial:MX,SpriteMaterial:sF,RawShaderMaterial:TX,ShaderMaterial:Hl,PointsMaterial:lF,MeshPhysicalMaterial:AX,MeshStandardMaterial:mF,MeshPhongMaterial:PX,MeshToonMaterial:DX,MeshNormalMaterial:RX,MeshLambertMaterial:IX,MeshDepthMaterial:rF,MeshDistanceMaterial:iF,MeshBasicMaterial:Cd,MeshMatcapMaterial:NX,LineDashedMaterial:FX,LineBasicMaterial:Ro,Material:ji};return new n[e]}}class SR{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let n="";for(let r=0,i=e.length;r0){const l=new bF(n);o=new Ly(l),o.setCrossOrigin(this.crossOrigin);for(let u=0,c=e.length;u0){i=new Ly(this.manager),i.setCrossOrigin(this.crossOrigin);for(let s=0,a=e.length;s"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,n,r,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const o=this,s=jf.get(e);if(s!==void 0)return o.manager.itemStart(e),setTimeout(function(){n&&n(s),o.manager.itemEnd(e)},0),s;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(o.options,{colorSpaceConversion:"none"}))}).then(function(l){jf.add(e,l),n&&n(l),o.manager.itemEnd(e)}).catch(function(l){i&&i(l),o.manager.itemError(e),o.manager.itemEnd(e)}),o.manager.itemStart(e)}}let lw;class wF{static getContext(){return lw===void 0&&(lw=new(window.AudioContext||window.webkitAudioContext)),lw}static setContext(e){lw=e}}class qIe extends ns{constructor(e){super(e)}load(e,n,r,i){const o=this,s=new Gu(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,function(l){try{const u=l.slice(0);wF.getContext().decodeAudioData(u,function(d){n(d)},a)}catch(u){a(u)}},r,i);function a(l){i?i(l):console.error(l),o.manager.itemError(e)}}}const s$=new qt,a$=new qt,Gd=new qt;class XIe{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Si,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Si,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,Gd.copy(e.projectionMatrix);const i=n.eyeSep/2,o=i*n.near/n.focus,s=n.near*Math.tan(Mf*n.fov*.5)/n.zoom;let a,l;a$.elements[12]=-i,s$.elements[12]=i,a=-s*n.aspect+o,l=s*n.aspect+o,Gd.elements[0]=2*n.near/(l-a),Gd.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Gd),a=-s*n.aspect-o,l=s*n.aspect-o,Gd.elements[0]=2*n.near/(l-a),Gd.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Gd)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(a$),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(s$)}}class _F{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=l$(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=l$();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}function l$(){return(typeof performance>"u"?Date:performance).now()}const jd=new oe,u$=new Yo,KIe=new oe,Wd=new oe;class YIe extends Tn{constructor(){super(),this.type="AudioListener",this.context=wF.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new _F}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const n=this.context.listener,r=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(jd,u$,KIe),Wd.set(0,0,-1).applyQuaternion(u$),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(jd.x,i),n.positionY.linearRampToValueAtTime(jd.y,i),n.positionZ.linearRampToValueAtTime(jd.z,i),n.forwardX.linearRampToValueAtTime(Wd.x,i),n.forwardY.linearRampToValueAtTime(Wd.y,i),n.forwardZ.linearRampToValueAtTime(Wd.z,i),n.upX.linearRampToValueAtTime(r.x,i),n.upY.linearRampToValueAtTime(r.y,i),n.upZ.linearRampToValueAtTime(r.z,i)}else n.setPosition(jd.x,jd.y,jd.z),n.setOrientation(Wd.x,Wd.y,Wd.z,r.x,r.y,r.z)}}class ZX extends Tn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e0&&this._mixBufferRegionAdditive(r,i,this._addIndex*n,1,n);for(let l=n,u=n+n;l!==u;++l)if(r[l]!==r[l+n]){a.setValue(r,i);break}}saveOriginalState(){const e=this.binding,n=this.buffer,r=this.valueSize,i=r*this._origIndex;e.getValue(n,i);for(let o=r,s=i;o!==s;++o)n[o]=n[i+o%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,n=e+this.valueSize;for(let r=e;r=.5)for(let s=0;s!==o;++s)e[n+s]=e[r+s]}_slerp(e,n,r,i){Yo.slerpFlat(e,n,e,n,e,r,i)}_slerpAdditive(e,n,r,i,o){const s=this._workIndex*o;Yo.multiplyQuaternionsFlat(e,s,e,n,e,r),Yo.slerpFlat(e,n,e,n,e,s,i)}_lerp(e,n,r,i,o){const s=1-i;for(let a=0;a!==o;++a){const l=n+a;e[l]=e[l]*s+e[r+a]*i}}_lerpAdditive(e,n,r,i,o){for(let s=0;s!==o;++s){const a=n+s;e[a]=e[a]+e[r+s]*i}}}const SF="\\[\\]\\.:\\/",eNe=new RegExp("["+SF+"]","g"),CF="[^"+SF+"]",tNe="[^"+SF.replace("\\.","")+"]",nNe=/((?:WC+[\/:])*)/.source.replace("WC",CF),rNe=/(WCOD+)?/.source.replace("WCOD",tNe),iNe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",CF),oNe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",CF),sNe=new RegExp("^"+nNe+rNe+iNe+oNe+"$"),aNe=["material","materials","bones","map"];class lNe{constructor(e,n,r){const i=r||bn.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,i)}getValue(e,n){this.bind();const r=this._targetGroup.nCachedObjects_,i=this._bindings[r];i!==void 0&&i.getValue(e,n)}setValue(e,n){const r=this._bindings;for(let i=this._targetGroup.nCachedObjects_,o=r.length;i!==o;++i)r[i].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=e.length;n!==r;++n)e[n].unbind()}}class bn{constructor(e,n,r){this.path=n,this.parsedPath=r||bn.parseTrackName(n),this.node=bn.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,r){return e&&e.isAnimationObjectGroup?new bn.Composite(e,n,r):new bn(e,n,r)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(eNe,"")}static parseTrackName(e){const n=sNe.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const r={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},i=r.nodeName&&r.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const o=r.nodeName.substring(i+1);aNe.indexOf(o)!==-1&&(r.nodeName=r.nodeName.substring(0,i),r.objectName=o)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return r}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const r=e.skeleton.getBoneByName(n);if(r!==void 0)return r}if(e.children){const r=function(o){for(let s=0;s=o){const d=o++,f=e[d];n[f.uuid]=c,e[c]=f,n[u]=d,e[d]=l;for(let h=0,p=i;h!==p;++h){const g=r[h],b=g[d],m=g[c];g[c]=b,g[d]=m}}}this.nCachedObjects_=o}uncache(){const e=this._objects,n=this._indicesByUUID,r=this._bindings,i=r.length;let o=this.nCachedObjects_,s=e.length;for(let a=0,l=arguments.length;a!==l;++a){const u=arguments[a],c=u.uuid,d=n[c];if(d!==void 0)if(delete n[c],d0&&(n[h.uuid]=d),e[d]=h,e.pop();for(let p=0,g=i;p!==g;++p){const b=r[p];b[d]=b[f],b.pop()}}}this.nCachedObjects_=o}subscribe_(e,n){const r=this._bindingsIndicesByPath;let i=r[e];const o=this._bindings;if(i!==void 0)return o[i];const s=this._paths,a=this._parsedPaths,l=this._objects,u=l.length,c=this.nCachedObjects_,d=new Array(u);i=o.length,r[e]=i,s.push(e),a.push(n),o.push(d);for(let f=c,h=l.length;f!==h;++f){const p=l[f];d[f]=new bn(p,e,n)}return d}unsubscribe_(e){const n=this._bindingsIndicesByPath,r=n[e];if(r!==void 0){const i=this._paths,o=this._parsedPaths,s=this._bindings,a=s.length-1,l=s[a],u=e[a];n[u]=r,s[r]=l,s.pop(),o[r]=o[a],o.pop(),i[r]=i[a],i.pop()}}}class JX{constructor(e,n,r=null,i=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=r,this.blendMode=i;const o=n.tracks,s=o.length,a=new Array(s),l={endingStart:hf,endingEnd:hf};for(let u=0;u!==s;++u){const c=o[u].createInterpolant(null);a[u]=c,c.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Rq,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,n){return this.loop=e,this.repetitions=n,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,n,r){if(e.fadeOut(n),this.fadeIn(n),r){const i=this._clip.duration,o=e._clip.duration,s=o/i,a=i/o;e.warp(1,s,n),this.warp(a,1,n)}return this}crossFadeTo(e,n,r){return e.crossFadeFrom(this,n,r)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,n,r){const i=this._mixer,o=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,u=a.sampleValues;return l[0]=o,l[1]=o+r,u[0]=e/s,u[1]=n/s,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,n,r,i){if(!this.enabled){this._updateWeight(e);return}const o=this._startTime;if(o!==null){const l=(e-o)*r;l<0||r===0?n=0:(this._startTime=null,n=r*l)}n*=this._updateTimeScale(e);const s=this._updateTime(n),a=this._updateWeight(e);if(a>0){const l=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case KN:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulateAdditive(a);break;case AE:default:for(let c=0,d=l.length;c!==d;++c)l[c].evaluate(s),u[c].accumulate(i,a)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const r=this._weightInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const r=this._timeScaleInterpolant;if(r!==null){const i=r.evaluate(e)[0];n*=i,e>r.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,r=this.loop;let i=this.time+e,o=this._loopCount;const s=r===Iq;if(e===0)return o===-1?i:s&&(o&1)===1?n-i:i;if(r===Dq){o===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=n)i=n;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(o===-1&&(e>=0?(o=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),i>=n||i<0){const a=Math.floor(i/n);i-=n*a,o+=Math.abs(a);const l=this.repetitions-o;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?n:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const u=e<0;this._setEndings(u,!u,s)}else this._setEndings(!1,!1,s);this._loopCount=o,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(s&&(o&1)===1)return n-i}return i}_setEndings(e,n,r){const i=this._interpolantSettings;r?(i.endingStart=pf,i.endingEnd=pf):(e?i.endingStart=this.zeroSlopeAtStart?pf:hf:i.endingStart=Sy,n?i.endingEnd=this.zeroSlopeAtEnd?pf:hf:i.endingEnd=Sy)}_scheduleFading(e,n,r){const i=this._mixer,o=i.time;let s=this._weightInterpolant;s===null&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=o,l[0]=n,a[1]=o+e,l[1]=r,this}}const cNe=new Float32Array(1);class dNe extends Yu{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const r=e._localRoot||this._root,i=e._clip.tracks,o=i.length,s=e._propertyBindings,a=e._interpolants,l=r.uuid,u=this._bindingsByRootAndName;let c=u[l];c===void 0&&(c={},u[l]=c);for(let d=0;d!==o;++d){const f=i[d],h=f.name;let p=c[h];if(p!==void 0)++p.referenceCount,s[d]=p;else{if(p=s[d],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,h));continue}const g=n&&n._propertyBindings[d].binding.parsedPath;p=new QX(bn.create(r,h,g),f.ValueTypeName,f.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,h),s[d]=p}a[d].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const r=(e._localRoot||this._root).uuid,i=e._clip.uuid,o=this._actionsByClip[i];this._bindAction(e,o&&o.knownActions[0]),this._addInactiveAction(e,i,r)}const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];o.useCount++===0&&(this._lendBinding(o),o.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let r=0,i=n.length;r!==i;++r){const o=n[r];--o.useCount===0&&(o.restoreOriginalState(),this._takeBackBinding(o))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const n=e._cacheIndex;return n!==null&&n=0;--r)e[r].stop();return this}update(e){e*=this.timeScale;const n=this._actions,r=this._nActiveActions,i=this.time+=e,o=Math.sign(e),s=this._accuIndex^=1;for(let u=0;u!==r;++u)n[u]._update(i,e,o,s);const a=this._bindings,l=this._nActiveBindings;for(let u=0;u!==l;++u)a[u].apply(s);return this}setTime(e){this.time=0;for(let n=0;nthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,f$).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const h$=new oe,uw=new oe;class bNe{constructor(e=new oe,n=new oe){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){h$.subVectors(e,this.start),uw.subVectors(this.end,this.start);const r=uw.dot(uw);let o=uw.dot(h$)/r;return n&&(o=Fr(o,0,1)),o}closestPointToPoint(e,n,r){const i=this.closestPointToPointParameter(e,n);return this.delta(r).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const p$=new oe;class xNe extends Tn{constructor(e,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const r=new rn,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,a=1,l=32;s1)for(let d=0;d.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{b$.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(b$,n)}}setLength(e,n=e*.2,r=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(r,n,r),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class NNe extends Zl{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new rn;i.setAttribute("position",new Ct(n,3)),i.setAttribute("color",new Ct(r,3));const o=new Ro({vertexColors:!0,toneMapped:!1});super(i,o),this.type="AxesHelper"}setColors(e,n,r){const i=new vt,o=this.geometry.attributes.color.array;return i.set(e),i.toArray(o,0),i.toArray(o,3),i.set(n),i.toArray(o,6),i.toArray(o,9),i.set(r),i.toArray(o,12),i.toArray(o,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class FNe{constructor(){this.type="ShapePath",this.color=new vt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new Dy,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,r,i){return this.currentPath.quadraticCurveTo(e,n,r,i),this}bezierCurveTo(e,n,r,i,o,s){return this.currentPath.bezierCurveTo(e,n,r,i,o,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(m){const w=[];for(let x=0,_=m.length;x<_;x++){const C=m[x],S=new Af;S.curves=C.curves,w.push(S)}return w}function r(m,w){const x=w.length;let _=!1;for(let C=x-1,S=0;SNumber.EPSILON){if(R<0&&(M=w[S],A=-A,P=w[C],R=-R),m.yP.y)continue;if(m.y===M.y){if(m.x===M.x)return!0}else{const F=R*(m.x-M.x)-A*(m.y-M.y);if(F===0)return!0;if(F<0)continue;_=!_}}else{if(m.y!==M.y)continue;if(P.x<=m.x&&m.x<=M.x||M.x<=m.x&&m.x<=P.x)return!0}}return _}const i=Nl.isClockWise,o=this.subPaths;if(o.length===0)return[];let s,a,l;const u=[];if(o.length===1)return a=o[0],l=new Af,l.curves=a.curves,u.push(l),u;let c=!i(o[0].getPoints());c=e?!c:c;const d=[],f=[];let h=[],p=0,g;f[p]=void 0,h[p]=[];for(let m=0,w=o.length;m1){let m=!1,w=0;for(let x=0,_=f.length;x<_;x++)d[x]=[];for(let x=0,_=f.length;x<_;x++){const C=h[x];for(let S=0;S0&&m===!1&&(h=d)}let b;for(let m=0,w=f.length;mDe||V[ce]!==q[De]){var We=` -`+V[ce].replace(" at new "," at ");return v.displayName&&We.includes("")&&(We=We.replace("",v.displayName)),We}while(1<=ce&&0<=De);break}}}finally{Ht=!1,Error.prepareStackTrace=T}return(v=v?v.displayName||v.name:"")?Et(v):""}var Ln=Object.prototype.hasOwnProperty,ei=[],er=-1;function hi(v){return{current:v}}function Vt(v){0>er||(v.current=ei[er],ei[er]=null,er--)}function xt(v,y){er++,ei[er]=v.current,v.current=y}var Bs={},un=hi(Bs),Mr=hi(!1),ol=Bs;function $s(v,y){var T=v.type.contextTypes;if(!T)return Bs;var I=v.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===y)return I.__reactInternalMemoizedMaskedChildContext;var V={},q;for(q in T)V[q]=y[q];return I&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=y,v.__reactInternalMemoizedMaskedChildContext=V),V}function pi(v){return v=v.childContextTypes,v!=null}function Wr(){Vt(Mr),Vt(un)}function sl(v,y,T){if(un.current!==Bs)throw Error(s(168));xt(un,y),xt(Mr,T)}function vh(v,y,T){var I=v.stateNode;if(y=y.childContextTypes,typeof I.getChildContext!="function")return T;I=I.getChildContext();for(var V in I)if(!(V in y))throw Error(s(108,P(v)||"Unknown",V));return o({},T,I)}function mi(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||Bs,ol=un.current,xt(un,v),xt(Mr,Mr.current),!0}function yh(v,y,T){var I=v.stateNode;if(!I)throw Error(s(169));T?(v=vh(v,y,ol),I.__reactInternalMemoizedMergedChildContext=v,Vt(Mr),Vt(un),xt(un,v)):Vt(Mr),xt(Mr,T)}var os=Math.clz32?Math.clz32:tQ,Jb=Math.log,eQ=Math.LN2;function tQ(v){return v>>>=0,v===0?32:31-(Jb(v)/eQ|0)|0}var e1=64,t1=4194304;function Fg(v){switch(v&-v){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return v&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return v&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return v}}function n1(v,y){var T=v.pendingLanes;if(T===0)return 0;var I=0,V=v.suspendedLanes,q=v.pingedLanes,ce=T&268435455;if(ce!==0){var De=ce&~V;De!==0?I=Fg(De):(q&=ce,q!==0&&(I=Fg(q)))}else ce=T&~V,ce!==0?I=Fg(ce):q!==0&&(I=Fg(q));if(I===0)return 0;if(y!==0&&y!==I&&!(y&V)&&(V=I&-I,q=y&-y,V>=q||V===16&&(q&4194240)!==0))return y;if(I&4&&(I|=T&16),y=v.entangledLanes,y!==0)for(v=v.entanglements,y&=I;0T;T++)y.push(v);return y}function Og(v,y,T){v.pendingLanes|=y,y!==536870912&&(v.suspendedLanes=0,v.pingedLanes=0),v=v.eventTimes,y=31-os(y),v[y]=T}function iQ(v,y){var T=v.pendingLanes&~y;v.pendingLanes=y,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=y,v.mutableReadLanes&=y,v.entangledLanes&=y,y=v.entanglements;var I=v.eventTimes;for(v=v.expirationTimes;0>=ce,V-=ce,tu=1<<32-os(y)+V|T<Cn?(yi=Yt,Yt=null):yi=Yt.sibling;var En=Bt($e,Yt,He[Cn],pt);if(En===null){Yt===null&&(Yt=yi);break}v&&Yt&&En.alternate===null&&y($e,Yt),Ne=q(En,Ne,Cn),tn===null?Pt=En:tn.sibling=En,tn=En,Yt=yi}if(Cn===He.length)return T($e,Yt),lr&&Rd($e,Cn),Pt;if(Yt===null){for(;CnCn?(yi=Yt,Yt=null):yi=Yt.sibling;var ac=Bt($e,Yt,En.value,pt);if(ac===null){Yt===null&&(Yt=yi);break}v&&Yt&&ac.alternate===null&&y($e,Yt),Ne=q(ac,Ne,Cn),tn===null?Pt=ac:tn.sibling=ac,tn=ac,Yt=yi}if(En.done)return T($e,Yt),lr&&Rd($e,Cn),Pt;if(Yt===null){for(;!En.done;Cn++,En=He.next())En=Kt($e,En.value,pt),En!==null&&(Ne=q(En,Ne,Cn),tn===null?Pt=En:tn.sibling=En,tn=En);return lr&&Rd($e,Cn),Pt}for(Yt=I($e,Yt);!En.done;Cn++,En=He.next())En=Wn(Yt,$e,Cn,En.value,pt),En!==null&&(v&&En.alternate!==null&&Yt.delete(En.key===null?Cn:En.key),Ne=q(En,Ne,Cn),tn===null?Pt=En:tn.sibling=En,tn=En);return v&&Yt.forEach(function(VQ){return y($e,VQ)}),lr&&Rd($e,Cn),Pt}function qs($e,Ne,He,pt){if(typeof He=="object"&&He!==null&&He.type===c&&He.key===null&&(He=He.props.children),typeof He=="object"&&He!==null){switch(He.$$typeof){case l:e:{for(var Pt=He.key,tn=Ne;tn!==null;){if(tn.key===Pt){if(Pt=He.type,Pt===c){if(tn.tag===7){T($e,tn.sibling),Ne=V(tn,He.props.children),Ne.return=$e,$e=Ne;break e}}else if(tn.elementType===Pt||typeof Pt=="object"&&Pt!==null&&Pt.$$typeof===x&&ak(Pt)===tn.type){T($e,tn.sibling),Ne=V(tn,He.props),Ne.ref=Bg($e,tn,He),Ne.return=$e,$e=Ne;break e}T($e,tn);break}else y($e,tn);tn=tn.sibling}He.type===c?(Ne=Bd(He.props.children,$e.mode,pt,He.key),Ne.return=$e,$e=Ne):(pt=G1(He.type,He.key,He.props,null,$e.mode,pt),pt.ref=Bg($e,Ne,He),pt.return=$e,$e=pt)}return ce($e);case u:e:{for(tn=He.key;Ne!==null;){if(Ne.key===tn)if(Ne.tag===4&&Ne.stateNode.containerInfo===He.containerInfo&&Ne.stateNode.implementation===He.implementation){T($e,Ne.sibling),Ne=V(Ne,He.children||[]),Ne.return=$e,$e=Ne;break e}else{T($e,Ne);break}else y($e,Ne);Ne=Ne.sibling}Ne=D2(He,$e.mode,pt),Ne.return=$e,$e=Ne}return ce($e);case x:return tn=He._init,qs($e,Ne,tn(He._payload),pt)}if(U(He))return Dt($e,Ne,He,pt);if(S(He))return Yi($e,Ne,He,pt);h1($e,He)}return typeof He=="string"&&He!==""||typeof He=="number"?(He=""+He,Ne!==null&&Ne.tag===6?(T($e,Ne.sibling),Ne=V(Ne,He),Ne.return=$e,$e=Ne):(T($e,Ne),Ne=P2(He,$e.mode,pt),Ne.return=$e,$e=Ne),ce($e)):T($e,Ne)}return qs}var Ch=lk(!0),uk=lk(!1),$g={},Vs=hi($g),zg=hi($g),Eh=hi($g);function dl(v){if(v===$g)throw Error(s(174));return v}function qM(v,y){xt(Eh,y),xt(zg,v),xt(Vs,$g),v=B(y),Vt(Vs),xt(Vs,v)}function Mh(){Vt(Vs),Vt(zg),Vt(Eh)}function ck(v){var y=dl(Eh.current),T=dl(Vs.current);y=L(T,v.type,y),T!==y&&(xt(zg,v),xt(Vs,y))}function XM(v){zg.current===v&&(Vt(Vs),Vt(zg))}var mr=hi(0);function p1(v){for(var y=v;y!==null;){if(y.tag===13){var T=y.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||Er(T)||Ii(T)))return y}else if(y.tag===19&&y.memoizedProps.revealOrder!==void 0){if(y.flags&128)return y}else if(y.child!==null){y.child.return=y,y=y.child;continue}if(y===v)break;for(;y.sibling===null;){if(y.return===null||y.return===v)return null;y=y.return}y.sibling.return=y.return,y=y.sibling}return null}var KM=[];function YM(){for(var v=0;vT?T:4,v(!0);var I=Gs.transition;Gs.transition={};try{v(!1),y()}finally{Sn=T,Gs.transition=I}}function Ck(){return fl().memoizedState}function gQ(v,y,T){var I=ic(v);T={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null},Ek(v)?Mk(y,T):(Tk(v,y,T),T=po(),v=js(v,I,T),v!==null&&Ak(v,y,I))}function vQ(v,y,T){var I=ic(v),V={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null};if(Ek(v))Mk(y,V);else{Tk(v,y,V);var q=v.alternate;if(v.lanes===0&&(q===null||q.lanes===0)&&(q=y.lastRenderedReducer,q!==null))try{var ce=y.lastRenderedState,De=q(ce,T);if(V.hasEagerState=!0,V.eagerState=De,ll(De,ce))return}catch{}finally{}T=po(),v=js(v,I,T),v!==null&&Ak(v,y,I)}}function Ek(v){var y=v.alternate;return v===Tr||y!==null&&y===Tr}function Mk(v,y){Ug=g1=!0;var T=v.pending;T===null?y.next=y:(y.next=T.next,T.next=y),v.pending=y}function Tk(v,y,T){qr!==null&&v.mode&1&&!(on&2)?(v=y.interleaved,v===null?(T.next=T,cl===null?cl=[y]:cl.push(y)):(T.next=v.next,v.next=T),y.interleaved=T):(v=y.pending,v===null?T.next=T:(T.next=v.next,v.next=T),y.pending=T)}function Ak(v,y,T){if(T&4194240){var I=y.lanes;I&=v.pendingLanes,T|=I,y.lanes=T,DM(v,T)}}var w1={readContext:zs,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useInsertionEffect:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useSyncExternalStore:Xi,useId:Xi,unstable_isNewReconciler:!1},yQ={readContext:zs,useCallback:function(v,y){return ru().memoizedState=[v,y===void 0?null:y],v},useContext:zs,useEffect:t2,useImperativeHandle:function(v,y,T){return T=T!=null?T.concat([v]):null,b1(4194308,4,xk.bind(null,y,v),T)},useLayoutEffect:function(v,y){return b1(4194308,4,v,y)},useInsertionEffect:function(v,y){return b1(4,2,v,y)},useMemo:function(v,y){var T=ru();return y=y===void 0?null:y,v=v(),T.memoizedState=[v,y],v},useReducer:function(v,y,T){var I=ru();return y=T!==void 0?T(y):y,I.memoizedState=I.baseState=y,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:v,lastRenderedState:y},I.queue=v,v=v.dispatch=gQ.bind(null,Tr,v),[I.memoizedState,v]},useRef:function(v){var y=ru();return v={current:v},y.memoizedState=v},useState:e2,useDebugValue:n2,useDeferredValue:function(v){var y=e2(v),T=y[0],I=y[1];return t2(function(){var V=Gs.transition;Gs.transition={};try{I(v)}finally{Gs.transition=V}},[v]),T},useTransition:function(){var v=e2(!1),y=v[0];return v=mQ.bind(null,v[1]),ru().memoizedState=v,[y,v]},useMutableSource:function(){},useSyncExternalStore:function(v,y,T){var I=Tr,V=ru();if(lr){if(T===void 0)throw Error(s(407));T=T()}else{if(T=y(),qr===null)throw Error(s(349));Th&30||hk(I,y,T)}V.memoizedState=T;var q={value:T,getSnapshot:y};return V.queue=q,t2(mk.bind(null,I,q,v),[v]),I.flags|=2048,Vg(9,pk.bind(null,I,q,T,y),void 0,null),T},useId:function(){var v=ru(),y=qr.identifierPrefix;if(lr){var T=nu,I=tu;T=(I&~(1<<32-os(I)-1)).toString(32)+T,y=":"+y+"R"+T,T=Hg++,0")&&(We=We.replace("",v.displayName)),We}while(1<=ce&&0<=De);break}}}finally{Ht=!1,Error.prepareStackTrace=T}return(v=v?v.displayName||v.name:"")?Et(v):""}var Ln=Object.prototype.hasOwnProperty,ei=[],er=-1;function hi(v){return{current:v}}function Vt(v){0>er||(v.current=ei[er],ei[er]=null,er--)}function xt(v,y){er++,ei[er]=v.current,v.current=y}var Bs={},un=hi(Bs),Mr=hi(!1),il=Bs;function $s(v,y){var T=v.type.contextTypes;if(!T)return Bs;var I=v.stateNode;if(I&&I.__reactInternalMemoizedUnmaskedChildContext===y)return I.__reactInternalMemoizedMaskedChildContext;var V={},q;for(q in T)V[q]=y[q];return I&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=y,v.__reactInternalMemoizedMaskedChildContext=V),V}function pi(v){return v=v.childContextTypes,v!=null}function Wr(){Vt(Mr),Vt(un)}function ol(v,y,T){if(un.current!==Bs)throw Error(s(168));xt(un,y),xt(Mr,T)}function vh(v,y,T){var I=v.stateNode;if(y=y.childContextTypes,typeof I.getChildContext!="function")return T;I=I.getChildContext();for(var V in I)if(!(V in y))throw Error(s(108,P(v)||"Unknown",V));return o({},T,I)}function mi(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||Bs,il=un.current,xt(un,v),xt(Mr,Mr.current),!0}function yh(v,y,T){var I=v.stateNode;if(!I)throw Error(s(169));T?(v=vh(v,y,il),I.__reactInternalMemoizedMergedChildContext=v,Vt(Mr),Vt(un),xt(un,v)):Vt(Mr),xt(Mr,T)}var os=Math.clz32?Math.clz32:tQ,Jb=Math.log,eQ=Math.LN2;function tQ(v){return v>>>=0,v===0?32:31-(Jb(v)/eQ|0)|0}var e1=64,t1=4194304;function Fg(v){switch(v&-v){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return v&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return v&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return v}}function n1(v,y){var T=v.pendingLanes;if(T===0)return 0;var I=0,V=v.suspendedLanes,q=v.pingedLanes,ce=T&268435455;if(ce!==0){var De=ce&~V;De!==0?I=Fg(De):(q&=ce,q!==0&&(I=Fg(q)))}else ce=T&~V,ce!==0?I=Fg(ce):q!==0&&(I=Fg(q));if(I===0)return 0;if(y!==0&&y!==I&&!(y&V)&&(V=I&-I,q=y&-y,V>=q||V===16&&(q&4194240)!==0))return y;if(I&4&&(I|=T&16),y=v.entangledLanes,y!==0)for(v=v.entanglements,y&=I;0T;T++)y.push(v);return y}function Og(v,y,T){v.pendingLanes|=y,y!==536870912&&(v.suspendedLanes=0,v.pingedLanes=0),v=v.eventTimes,y=31-os(y),v[y]=T}function iQ(v,y){var T=v.pendingLanes&~y;v.pendingLanes=y,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=y,v.mutableReadLanes&=y,v.entangledLanes&=y,y=v.entanglements;var I=v.eventTimes;for(v=v.expirationTimes;0>=ce,V-=ce,tu=1<<32-os(y)+V|T<Cn?(yi=Yt,Yt=null):yi=Yt.sibling;var En=Bt($e,Yt,He[Cn],pt);if(En===null){Yt===null&&(Yt=yi);break}v&&Yt&&En.alternate===null&&y($e,Yt),Ne=q(En,Ne,Cn),tn===null?Pt=En:tn.sibling=En,tn=En,Yt=yi}if(Cn===He.length)return T($e,Yt),lr&&Rd($e,Cn),Pt;if(Yt===null){for(;CnCn?(yi=Yt,Yt=null):yi=Yt.sibling;var ac=Bt($e,Yt,En.value,pt);if(ac===null){Yt===null&&(Yt=yi);break}v&&Yt&&ac.alternate===null&&y($e,Yt),Ne=q(ac,Ne,Cn),tn===null?Pt=ac:tn.sibling=ac,tn=ac,Yt=yi}if(En.done)return T($e,Yt),lr&&Rd($e,Cn),Pt;if(Yt===null){for(;!En.done;Cn++,En=He.next())En=Kt($e,En.value,pt),En!==null&&(Ne=q(En,Ne,Cn),tn===null?Pt=En:tn.sibling=En,tn=En);return lr&&Rd($e,Cn),Pt}for(Yt=I($e,Yt);!En.done;Cn++,En=He.next())En=Wn(Yt,$e,Cn,En.value,pt),En!==null&&(v&&En.alternate!==null&&Yt.delete(En.key===null?Cn:En.key),Ne=q(En,Ne,Cn),tn===null?Pt=En:tn.sibling=En,tn=En);return v&&Yt.forEach(function(VQ){return y($e,VQ)}),lr&&Rd($e,Cn),Pt}function qs($e,Ne,He,pt){if(typeof He=="object"&&He!==null&&He.type===c&&He.key===null&&(He=He.props.children),typeof He=="object"&&He!==null){switch(He.$$typeof){case l:e:{for(var Pt=He.key,tn=Ne;tn!==null;){if(tn.key===Pt){if(Pt=He.type,Pt===c){if(tn.tag===7){T($e,tn.sibling),Ne=V(tn,He.props.children),Ne.return=$e,$e=Ne;break e}}else if(tn.elementType===Pt||typeof Pt=="object"&&Pt!==null&&Pt.$$typeof===x&&ak(Pt)===tn.type){T($e,tn.sibling),Ne=V(tn,He.props),Ne.ref=Bg($e,tn,He),Ne.return=$e,$e=Ne;break e}T($e,tn);break}else y($e,tn);tn=tn.sibling}He.type===c?(Ne=Bd(He.props.children,$e.mode,pt,He.key),Ne.return=$e,$e=Ne):(pt=G1(He.type,He.key,He.props,null,$e.mode,pt),pt.ref=Bg($e,Ne,He),pt.return=$e,$e=pt)}return ce($e);case u:e:{for(tn=He.key;Ne!==null;){if(Ne.key===tn)if(Ne.tag===4&&Ne.stateNode.containerInfo===He.containerInfo&&Ne.stateNode.implementation===He.implementation){T($e,Ne.sibling),Ne=V(Ne,He.children||[]),Ne.return=$e,$e=Ne;break e}else{T($e,Ne);break}else y($e,Ne);Ne=Ne.sibling}Ne=D2(He,$e.mode,pt),Ne.return=$e,$e=Ne}return ce($e);case x:return tn=He._init,qs($e,Ne,tn(He._payload),pt)}if(U(He))return Dt($e,Ne,He,pt);if(S(He))return Yi($e,Ne,He,pt);h1($e,He)}return typeof He=="string"&&He!==""||typeof He=="number"?(He=""+He,Ne!==null&&Ne.tag===6?(T($e,Ne.sibling),Ne=V(Ne,He),Ne.return=$e,$e=Ne):(T($e,Ne),Ne=P2(He,$e.mode,pt),Ne.return=$e,$e=Ne),ce($e)):T($e,Ne)}return qs}var Ch=lk(!0),uk=lk(!1),$g={},Vs=hi($g),zg=hi($g),Eh=hi($g);function cl(v){if(v===$g)throw Error(s(174));return v}function qM(v,y){xt(Eh,y),xt(zg,v),xt(Vs,$g),v=B(y),Vt(Vs),xt(Vs,v)}function Mh(){Vt(Vs),Vt(zg),Vt(Eh)}function ck(v){var y=cl(Eh.current),T=cl(Vs.current);y=L(T,v.type,y),T!==y&&(xt(zg,v),xt(Vs,y))}function XM(v){zg.current===v&&(Vt(Vs),Vt(zg))}var mr=hi(0);function p1(v){for(var y=v;y!==null;){if(y.tag===13){var T=y.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||Er(T)||Ii(T)))return y}else if(y.tag===19&&y.memoizedProps.revealOrder!==void 0){if(y.flags&128)return y}else if(y.child!==null){y.child.return=y,y=y.child;continue}if(y===v)break;for(;y.sibling===null;){if(y.return===null||y.return===v)return null;y=y.return}y.sibling.return=y.return,y=y.sibling}return null}var KM=[];function YM(){for(var v=0;vT?T:4,v(!0);var I=Gs.transition;Gs.transition={};try{v(!1),y()}finally{Sn=T,Gs.transition=I}}function Ck(){return dl().memoizedState}function gQ(v,y,T){var I=ic(v);T={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null},Ek(v)?Mk(y,T):(Tk(v,y,T),T=po(),v=js(v,I,T),v!==null&&Ak(v,y,I))}function vQ(v,y,T){var I=ic(v),V={lane:I,action:T,hasEagerState:!1,eagerState:null,next:null};if(Ek(v))Mk(y,V);else{Tk(v,y,V);var q=v.alternate;if(v.lanes===0&&(q===null||q.lanes===0)&&(q=y.lastRenderedReducer,q!==null))try{var ce=y.lastRenderedState,De=q(ce,T);if(V.hasEagerState=!0,V.eagerState=De,al(De,ce))return}catch{}finally{}T=po(),v=js(v,I,T),v!==null&&Ak(v,y,I)}}function Ek(v){var y=v.alternate;return v===Tr||y!==null&&y===Tr}function Mk(v,y){Ug=g1=!0;var T=v.pending;T===null?y.next=y:(y.next=T.next,T.next=y),v.pending=y}function Tk(v,y,T){qr!==null&&v.mode&1&&!(on&2)?(v=y.interleaved,v===null?(T.next=T,ul===null?ul=[y]:ul.push(y)):(T.next=v.next,v.next=T),y.interleaved=T):(v=y.pending,v===null?T.next=T:(T.next=v.next,v.next=T),y.pending=T)}function Ak(v,y,T){if(T&4194240){var I=y.lanes;I&=v.pendingLanes,T|=I,y.lanes=T,DM(v,T)}}var w1={readContext:zs,useCallback:Xi,useContext:Xi,useEffect:Xi,useImperativeHandle:Xi,useInsertionEffect:Xi,useLayoutEffect:Xi,useMemo:Xi,useReducer:Xi,useRef:Xi,useState:Xi,useDebugValue:Xi,useDeferredValue:Xi,useTransition:Xi,useMutableSource:Xi,useSyncExternalStore:Xi,useId:Xi,unstable_isNewReconciler:!1},yQ={readContext:zs,useCallback:function(v,y){return ru().memoizedState=[v,y===void 0?null:y],v},useContext:zs,useEffect:t2,useImperativeHandle:function(v,y,T){return T=T!=null?T.concat([v]):null,b1(4194308,4,xk.bind(null,y,v),T)},useLayoutEffect:function(v,y){return b1(4194308,4,v,y)},useInsertionEffect:function(v,y){return b1(4,2,v,y)},useMemo:function(v,y){var T=ru();return y=y===void 0?null:y,v=v(),T.memoizedState=[v,y],v},useReducer:function(v,y,T){var I=ru();return y=T!==void 0?T(y):y,I.memoizedState=I.baseState=y,v={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:v,lastRenderedState:y},I.queue=v,v=v.dispatch=gQ.bind(null,Tr,v),[I.memoizedState,v]},useRef:function(v){var y=ru();return v={current:v},y.memoizedState=v},useState:e2,useDebugValue:n2,useDeferredValue:function(v){var y=e2(v),T=y[0],I=y[1];return t2(function(){var V=Gs.transition;Gs.transition={};try{I(v)}finally{Gs.transition=V}},[v]),T},useTransition:function(){var v=e2(!1),y=v[0];return v=mQ.bind(null,v[1]),ru().memoizedState=v,[y,v]},useMutableSource:function(){},useSyncExternalStore:function(v,y,T){var I=Tr,V=ru();if(lr){if(T===void 0)throw Error(s(407));T=T()}else{if(T=y(),qr===null)throw Error(s(349));Th&30||hk(I,y,T)}V.memoizedState=T;var q={value:T,getSnapshot:y};return V.queue=q,t2(mk.bind(null,I,q,v),[v]),I.flags|=2048,Vg(9,pk.bind(null,I,q,T,y),void 0,null),T},useId:function(){var v=ru(),y=qr.identifierPrefix;if(lr){var T=nu,I=tu;T=(I&~(1<<32-os(I)-1)).toString(32)+T,y=":"+y+"R"+T,T=Hg++,0w2&&(y.flags|=128,I=!0,qg(V,!1),y.lanes=4194304)}else{if(!I)if(v=p1(q),v!==null){if(y.flags|=128,I=!0,v=v.updateQueue,v!==null&&(y.updateQueue=v,y.flags|=4),qg(V,!0),V.tail===null&&V.tailMode==="hidden"&&!q.alternate&&!lr)return Ki(y),null}else 2*gi()-V.renderingStartTime>w2&&T!==1073741824&&(y.flags|=128,I=!0,qg(V,!1),y.lanes=4194304);V.isBackwards?(q.sibling=y.child,y.child=q):(v=V.last,v!==null?v.sibling=q:y.child=q,V.last=q)}return V.tail!==null?(y=V.tail,V.rendering=y,V.tail=y.sibling,V.renderingStartTime=gi(),y.sibling=null,v=mr.current,xt(mr,I?v&1|2:v&1),y):(Ki(y),null);case 22:case 23:return M2(),I=y.memoizedState!==null,v!==null&&v.memoizedState!==null!==I&&(y.flags|=8192),I&&y.mode&1?us&1073741824&&(Ki(y),Oe&&y.subtreeFlags&6&&(y.flags|=8192)):Ki(y),null;case 24:return null;case 25:return null}throw Error(s(156,y.tag))}var SQ=a.ReactCurrentOwner,ls=!1;function ho(v,y,T,I){y.child=v===null?uk(y,null,T,I):Ch(y,v.child,T,I)}function kk(v,y,T,I,V){T=T.render;var q=y.ref;return xh(y,V),I=QM(v,y,T,I,q,V),T=JM(),v!==null&&!ls?(y.updateQueue=v.updateQueue,y.flags&=-2053,v.lanes&=~V,iu(v,y,V)):(lr&&T&&HM(y),y.flags|=1,ho(v,y,I,V),y.child)}function Lk(v,y,T,I,V){if(v===null){var q=T.type;return typeof q=="function"&&!A2(q)&&q.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(y.tag=15,y.type=q,Bk(v,y,q,I,V)):(v=G1(T.type,null,I,y,y.mode,V),v.ref=y.ref,v.return=y,y.child=v)}if(q=v.child,!(v.lanes&V)){var ce=q.memoizedProps;if(T=T.compare,T=T!==null?T:o1,T(ce,I)&&v.ref===y.ref)return iu(v,y,V)}return y.flags|=1,v=sc(q,I),v.ref=y.ref,v.return=y,y.child=v}function Bk(v,y,T,I,V){if(v!==null&&o1(v.memoizedProps,I)&&v.ref===y.ref)if(ls=!1,(v.lanes&V)!==0)v.flags&131072&&(ls=!0);else return y.lanes=v.lanes,iu(v,y,V);return o2(v,y,T,I,V)}function $k(v,y,T){var I=y.pendingProps,V=I.children,q=v!==null?v.memoizedState:null;if(I.mode==="hidden")if(!(y.mode&1))y.memoizedState={baseLanes:0,cachePool:null},xt(Ah,us),us|=T;else if(T&1073741824)y.memoizedState={baseLanes:0,cachePool:null},I=q!==null?q.baseLanes:T,xt(Ah,us),us|=I;else return v=q!==null?q.baseLanes|T:T,y.lanes=y.childLanes=1073741824,y.memoizedState={baseLanes:v,cachePool:null},y.updateQueue=null,xt(Ah,us),us|=v,null;else q!==null?(I=q.baseLanes|T,y.memoizedState=null):I=T,xt(Ah,us),us|=I;return ho(v,y,V,T),y.child}function zk(v,y){var T=y.ref;(v===null&&T!==null||v!==null&&v.ref!==T)&&(y.flags|=512,y.flags|=2097152)}function o2(v,y,T,I,V){var q=pi(T)?ol:un.current;return q=$s(y,q),xh(y,V),T=QM(v,y,T,I,q,V),I=JM(),v!==null&&!ls?(y.updateQueue=v.updateQueue,y.flags&=-2053,v.lanes&=~V,iu(v,y,V)):(lr&&I&&HM(y),y.flags|=1,ho(v,y,T,V),y.child)}function Uk(v,y,T,I,V){if(pi(T)){var q=!0;mi(y)}else q=!1;if(xh(y,V),y.stateNode===null)v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),tk(y,T,I),UM(y,T,I,V),I=!0;else if(v===null){var ce=y.stateNode,De=y.memoizedProps;ce.props=De;var We=ce.context,rt=T.contextType;typeof rt=="object"&&rt!==null?rt=zs(rt):(rt=pi(T)?ol:un.current,rt=$s(y,rt));var bt=T.getDerivedStateFromProps,Kt=typeof bt=="function"||typeof ce.getSnapshotBeforeUpdate=="function";Kt||typeof ce.UNSAFE_componentWillReceiveProps!="function"&&typeof ce.componentWillReceiveProps!="function"||(De!==I||We!==rt)&&nk(y,ce,I,rt),ec=!1;var Bt=y.memoizedState;ce.state=Bt,u1(y,I,ce,V),We=y.memoizedState,De!==I||Bt!==We||Mr.current||ec?(typeof bt=="function"&&(zM(y,T,bt,I),We=y.memoizedState),(De=ec||ek(y,T,De,I,Bt,We,rt))?(Kt||typeof ce.UNSAFE_componentWillMount!="function"&&typeof ce.componentWillMount!="function"||(typeof ce.componentWillMount=="function"&&ce.componentWillMount(),typeof ce.UNSAFE_componentWillMount=="function"&&ce.UNSAFE_componentWillMount()),typeof ce.componentDidMount=="function"&&(y.flags|=4194308)):(typeof ce.componentDidMount=="function"&&(y.flags|=4194308),y.memoizedProps=I,y.memoizedState=We),ce.props=I,ce.state=We,ce.context=rt,I=De):(typeof ce.componentDidMount=="function"&&(y.flags|=4194308),I=!1)}else{ce=y.stateNode,YO(v,y),De=y.memoizedProps,rt=y.type===y.elementType?De:_a(y.type,De),ce.props=rt,Kt=y.pendingProps,Bt=ce.context,We=T.contextType,typeof We=="object"&&We!==null?We=zs(We):(We=pi(T)?ol:un.current,We=$s(y,We));var Wn=T.getDerivedStateFromProps;(bt=typeof Wn=="function"||typeof ce.getSnapshotBeforeUpdate=="function")||typeof ce.UNSAFE_componentWillReceiveProps!="function"&&typeof ce.componentWillReceiveProps!="function"||(De!==Kt||Bt!==We)&&nk(y,ce,I,We),ec=!1,Bt=y.memoizedState,ce.state=Bt,u1(y,I,ce,V);var Dt=y.memoizedState;De!==Kt||Bt!==Dt||Mr.current||ec?(typeof Wn=="function"&&(zM(y,T,Wn,I),Dt=y.memoizedState),(rt=ec||ek(y,T,rt,I,Bt,Dt,We)||!1)?(bt||typeof ce.UNSAFE_componentWillUpdate!="function"&&typeof ce.componentWillUpdate!="function"||(typeof ce.componentWillUpdate=="function"&&ce.componentWillUpdate(I,Dt,We),typeof ce.UNSAFE_componentWillUpdate=="function"&&ce.UNSAFE_componentWillUpdate(I,Dt,We)),typeof ce.componentDidUpdate=="function"&&(y.flags|=4),typeof ce.getSnapshotBeforeUpdate=="function"&&(y.flags|=1024)):(typeof ce.componentDidUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=4),typeof ce.getSnapshotBeforeUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=1024),y.memoizedProps=I,y.memoizedState=Dt),ce.props=I,ce.state=Dt,ce.context=We,I=rt):(typeof ce.componentDidUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=4),typeof ce.getSnapshotBeforeUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=1024),I=!1)}return s2(v,y,T,I,q,V)}function s2(v,y,T,I,V,q){zk(v,y);var ce=(y.flags&128)!==0;if(!I&&!ce)return V&&yh(y,T,!1),iu(v,y,q);I=y.stateNode,SQ.current=y;var De=ce&&typeof T.getDerivedStateFromError!="function"?null:I.render();return y.flags|=1,v!==null&&ce?(y.child=Ch(y,v.child,null,q),y.child=Ch(y,null,De,q)):ho(v,y,De,q),y.memoizedState=I.state,V&&yh(y,T,!0),y.child}function Hk(v){var y=v.stateNode;y.pendingContext?sl(v,y.pendingContext,y.pendingContext!==y.context):y.context&&sl(v,y.context,!1),qM(v,y.containerInfo)}function Vk(v,y,T,I,V){return Sh(),WM(V),y.flags|=256,ho(v,y,T,I),y.child}var C1={dehydrated:null,treeContext:null,retryLane:0};function E1(v){return{baseLanes:v,cachePool:null}}function Gk(v,y,T){var I=y.pendingProps,V=mr.current,q=!1,ce=(y.flags&128)!==0,De;if((De=ce)||(De=v!==null&&v.memoizedState===null?!1:(V&2)!==0),De?(q=!0,y.flags&=-129):(v===null||v.memoizedState!==null)&&(V|=1),xt(mr,V&1),v===null)return jM(y),v=y.memoizedState,v!==null&&(v=v.dehydrated,v!==null)?(y.mode&1?Ii(v)?y.lanes=8:y.lanes=1073741824:y.lanes=1,null):(V=I.children,v=I.fallback,q?(I=y.mode,q=y.child,V={mode:"hidden",children:V},!(I&1)&&q!==null?(q.childLanes=0,q.pendingProps=V):q=j1(V,I,0,null),v=Bd(v,I,T,null),q.return=y,v.return=y,q.sibling=v,y.child=q,y.child.memoizedState=E1(T),y.memoizedState=C1,v):a2(y,V));if(V=v.memoizedState,V!==null){if(De=V.dehydrated,De!==null){if(ce)return y.flags&256?(y.flags&=-257,M1(v,y,T,Error(s(422)))):y.memoizedState!==null?(y.child=v.child,y.flags|=128,null):(q=I.fallback,V=y.mode,I=j1({mode:"visible",children:I.children},V,0,null),q=Bd(q,V,T,null),q.flags|=2,I.return=y,q.return=y,I.sibling=q,y.child=I,y.mode&1&&Ch(y,v.child,null,T),y.child.memoizedState=E1(T),y.memoizedState=C1,q);if(!(y.mode&1))y=M1(v,y,T,null);else if(Ii(De))y=M1(v,y,T,Error(s(419)));else if(I=(T&v.childLanes)!==0,ls||I){if(I=qr,I!==null){switch(T&-T){case 4:q=2;break;case 16:q=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:q=32;break;case 536870912:q=268435456;break;default:q=0}I=q&(I.suspendedLanes|T)?0:q,I!==0&&I!==V.retryLane&&(V.retryLane=I,js(v,I,-1))}T2(),y=M1(v,y,T,Error(s(421)))}else Er(De)?(y.flags|=128,y.child=v.child,y=kQ.bind(null,v),Io(De,y),y=null):(T=V.treeContext,_e&&(as=Fi(De),ss=y,lr=!0,Sa=null,kg=!1,T!==null&&(Us[Hs++]=tu,Us[Hs++]=nu,Us[Hs++]=Dd,tu=T.id,nu=T.overflow,Dd=y)),y=a2(y,y.pendingProps.children),y.flags|=4096);return y}return q?(I=Wk(v,y,I.children,I.fallback,T),q=y.child,V=v.child.memoizedState,q.memoizedState=V===null?E1(T):{baseLanes:V.baseLanes|T,cachePool:null},q.childLanes=v.childLanes&~T,y.memoizedState=C1,I):(T=jk(v,y,I.children,T),y.memoizedState=null,T)}return q?(I=Wk(v,y,I.children,I.fallback,T),q=y.child,V=v.child.memoizedState,q.memoizedState=V===null?E1(T):{baseLanes:V.baseLanes|T,cachePool:null},q.childLanes=v.childLanes&~T,y.memoizedState=C1,I):(T=jk(v,y,I.children,T),y.memoizedState=null,T)}function a2(v,y){return y=j1({mode:"visible",children:y},v.mode,0,null),y.return=v,v.child=y}function jk(v,y,T,I){var V=v.child;return v=V.sibling,T=sc(V,{mode:"visible",children:T}),!(y.mode&1)&&(T.lanes=I),T.return=y,T.sibling=null,v!==null&&(I=y.deletions,I===null?(y.deletions=[v],y.flags|=16):I.push(v)),y.child=T}function Wk(v,y,T,I,V){var q=y.mode;v=v.child;var ce=v.sibling,De={mode:"hidden",children:T};return!(q&1)&&y.child!==v?(T=y.child,T.childLanes=0,T.pendingProps=De,y.deletions=null):(T=sc(v,De),T.subtreeFlags=v.subtreeFlags&14680064),ce!==null?I=sc(ce,I):(I=Bd(I,q,V,null),I.flags|=2),I.return=y,T.return=y,T.sibling=I,y.child=T,I}function M1(v,y,T,I){return I!==null&&WM(I),Ch(y,v.child,null,T),v=a2(y,y.pendingProps.children),v.flags|=2,y.memoizedState=null,v}function qk(v,y,T){v.lanes|=y;var I=v.alternate;I!==null&&(I.lanes|=y),BM(v.return,y,T)}function l2(v,y,T,I,V){var q=v.memoizedState;q===null?v.memoizedState={isBackwards:y,rendering:null,renderingStartTime:0,last:I,tail:T,tailMode:V}:(q.isBackwards=y,q.rendering=null,q.renderingStartTime=0,q.last=I,q.tail=T,q.tailMode=V)}function Xk(v,y,T){var I=y.pendingProps,V=I.revealOrder,q=I.tail;if(ho(v,y,I.children,T),I=mr.current,I&2)I=I&1|2,y.flags|=128;else{if(v!==null&&v.flags&128)e:for(v=y.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&qk(v,T,y);else if(v.tag===19)qk(v,T,y);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===y)break e;for(;v.sibling===null;){if(v.return===null||v.return===y)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}I&=1}if(xt(mr,I),!(y.mode&1))y.memoizedState=null;else switch(V){case"forwards":for(T=y.child,V=null;T!==null;)v=T.alternate,v!==null&&p1(v)===null&&(V=T),T=T.sibling;T=V,T===null?(V=y.child,y.child=null):(V=T.sibling,T.sibling=null),l2(y,!1,V,T,q);break;case"backwards":for(T=null,V=y.child,y.child=null;V!==null;){if(v=V.alternate,v!==null&&p1(v)===null){y.child=V;break}v=V.sibling,V.sibling=T,T=V,V=v}l2(y,!0,T,null,q);break;case"together":l2(y,!1,null,null,void 0);break;default:y.memoizedState=null}return y.child}function iu(v,y,T){if(v!==null&&(y.dependencies=v.dependencies),Ph|=y.lanes,!(T&y.childLanes))return null;if(v!==null&&y.child!==v.child)throw Error(s(153));if(y.child!==null){for(v=y.child,T=sc(v,v.pendingProps),y.child=T,T.return=y;v.sibling!==null;)v=v.sibling,T=T.sibling=sc(v,v.pendingProps),T.return=y;T.sibling=null}return y.child}function CQ(v,y,T){switch(y.tag){case 3:Hk(y),Sh();break;case 5:ck(y);break;case 1:pi(y.type)&&mi(y);break;case 4:qM(y,y.stateNode.containerInfo);break;case 10:KO(y,y.type._context,y.memoizedProps.value);break;case 13:var I=y.memoizedState;if(I!==null)return I.dehydrated!==null?(xt(mr,mr.current&1),y.flags|=128,null):T&y.child.childLanes?Gk(v,y,T):(xt(mr,mr.current&1),v=iu(v,y,T),v!==null?v.sibling:null);xt(mr,mr.current&1);break;case 19:if(I=(T&y.childLanes)!==0,v.flags&128){if(I)return Xk(v,y,T);y.flags|=128}var V=y.memoizedState;if(V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),xt(mr,mr.current),I)break;return null;case 22:case 23:return y.lanes=0,$k(v,y,T)}return iu(v,y,T)}function EQ(v,y){switch(VM(y),y.tag){case 1:return pi(y.type)&&Wr(),v=y.flags,v&65536?(y.flags=v&-65537|128,y):null;case 3:return Mh(),Vt(Mr),Vt(un),YM(),v=y.flags,v&65536&&!(v&128)?(y.flags=v&-65537|128,y):null;case 5:return XM(y),null;case 13:if(Vt(mr),v=y.memoizedState,v!==null&&v.dehydrated!==null){if(y.alternate===null)throw Error(s(340));Sh()}return v=y.flags,v&65536?(y.flags=v&-65537|128,y):null;case 19:return Vt(mr),null;case 4:return Mh(),null;case 10:return LM(y.type._context),null;case 22:case 23:return M2(),null;case 24:return null;default:return null}}var T1=!1,Nd=!1,MQ=typeof WeakSet=="function"?WeakSet:Set,ft=null;function A1(v,y){var T=v.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(I){Oo(v,y,I)}else T.current=null}function u2(v,y,T){try{T()}catch(I){Oo(v,y,I)}}var Kk=!1;function TQ(v,y){for(N(v.containerInfo),ft=y;ft!==null;)if(v=ft,y=v.child,(v.subtreeFlags&1028)!==0&&y!==null)y.return=v,ft=y;else for(;ft!==null;){v=ft;try{var T=v.alternate;if(v.flags&1024)switch(v.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var I=T.memoizedProps,V=T.memoizedState,q=v.stateNode,ce=q.getSnapshotBeforeUpdate(v.elementType===v.type?I:_a(v.type,I),V);q.__reactInternalSnapshotBeforeUpdate=ce}break;case 3:Oe&&st(v.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(De){Oo(v,v.return,De)}if(y=v.sibling,y!==null){y.return=v.return,ft=y;break}ft=v.return}return T=Kk,Kk=!1,T}function Fd(v,y,T){var I=y.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var V=I=I.next;do{if((V.tag&v)===v){var q=V.destroy;V.destroy=void 0,q!==void 0&&u2(y,T,q)}V=V.next}while(V!==I)}}function Xg(v,y){if(y=y.updateQueue,y=y!==null?y.lastEffect:null,y!==null){var T=y=y.next;do{if((T.tag&v)===v){var I=T.create;T.destroy=I()}T=T.next}while(T!==y)}}function c2(v){var y=v.ref;if(y!==null){var T=v.stateNode;switch(v.tag){case 5:v=G(T);break;default:v=T}typeof y=="function"?y(v):y.current=v}}function Yk(v,y,T){if(al&&typeof al.onCommitFiberUnmount=="function")try{al.onCommitFiberUnmount(r1,y)}catch{}switch(y.tag){case 0:case 11:case 14:case 15:if(v=y.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var I=v=v.next;do{var V=I,q=V.destroy;V=V.tag,q!==void 0&&(V&2||V&4)&&u2(y,T,q),I=I.next}while(I!==v)}break;case 1:if(A1(y,T),v=y.stateNode,typeof v.componentWillUnmount=="function")try{v.props=y.memoizedProps,v.state=y.memoizedState,v.componentWillUnmount()}catch(ce){Oo(y,T,ce)}break;case 5:A1(y,T);break;case 4:Oe?nL(v,y,T):re&&re&&(y=y.stateNode.containerInfo,T=je(y),Qt(y,T))}}function Zk(v,y,T){for(var I=y;;)if(Yk(v,I,T),I.child===null||Oe&&I.tag===4){if(I===y)break;for(;I.sibling===null;){if(I.return===null||I.return===y)return;I=I.return}I.sibling.return=I.return,I=I.sibling}else I.child.return=I,I=I.child}function Qk(v){var y=v.alternate;y!==null&&(v.alternate=null,Qk(y)),v.child=null,v.deletions=null,v.sibling=null,v.tag===5&&(y=v.stateNode,y!==null&&he(y)),v.stateNode=null,v.return=null,v.dependencies=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.stateNode=null,v.updateQueue=null}function Jk(v){return v.tag===5||v.tag===3||v.tag===4}function eL(v){e:for(;;){for(;v.sibling===null;){if(v.return===null||Jk(v.return))return null;v=v.return}for(v.sibling.return=v.return,v=v.sibling;v.tag!==5&&v.tag!==6&&v.tag!==18;){if(v.flags&2||v.child===null||v.tag===4)continue e;v.child.return=v,v=v.child}if(!(v.flags&2))return v.stateNode}}function tL(v){if(Oe){e:{for(var y=v.return;y!==null;){if(Jk(y))break e;y=y.return}throw Error(s(160))}var T=y;switch(T.tag){case 5:y=T.stateNode,T.flags&32&&(ot(y),T.flags&=-33),T=eL(v),f2(v,T,y);break;case 3:case 4:y=T.stateNode.containerInfo,T=eL(v),d2(v,T,y);break;default:throw Error(s(161))}}}function d2(v,y,T){var I=v.tag;if(I===5||I===6)v=v.stateNode,y?Le(T,v,y):ge(T,v);else if(I!==4&&(v=v.child,v!==null))for(d2(v,y,T),v=v.sibling;v!==null;)d2(v,y,T),v=v.sibling}function f2(v,y,T){var I=v.tag;if(I===5||I===6)v=v.stateNode,y?Ve(T,v,y):ue(T,v);else if(I!==4&&(v=v.child,v!==null))for(f2(v,y,T),v=v.sibling;v!==null;)f2(v,y,T),v=v.sibling}function nL(v,y,T){for(var I=y,V=!1,q,ce;;){if(!V){V=I.return;e:for(;;){if(V===null)throw Error(s(160));switch(q=V.stateNode,V.tag){case 5:ce=!1;break e;case 3:q=q.containerInfo,ce=!0;break e;case 4:q=q.containerInfo,ce=!0;break e}V=V.return}V=!0}if(I.tag===5||I.tag===6)Zk(v,I,T),ce?it(q,I.stateNode):Ye(q,I.stateNode);else if(I.tag===18)ce?ke(q,I.stateNode):Ee(q,I.stateNode);else if(I.tag===4){if(I.child!==null){q=I.stateNode.containerInfo,ce=!0,I.child.return=I,I=I.child;continue}}else if(Yk(v,I,T),I.child!==null){I.child.return=I,I=I.child;continue}if(I===y)break;for(;I.sibling===null;){if(I.return===null||I.return===y)return;I=I.return,I.tag===4&&(V=!1)}I.sibling.return=I.return,I=I.sibling}}function h2(v,y){if(Oe){switch(y.tag){case 0:case 11:case 14:case 15:Fd(3,y,y.return),Xg(3,y),Fd(5,y,y.return);return;case 1:return;case 5:var T=y.stateNode;if(T!=null){var I=y.memoizedProps;v=v!==null?v.memoizedProps:I;var V=y.type,q=y.updateQueue;y.updateQueue=null,q!==null&&Re(T,q,V,v,I,y)}return;case 6:if(y.stateNode===null)throw Error(s(162));T=y.memoizedProps,be(y.stateNode,v!==null?v.memoizedProps:T,T);return;case 3:_e&&v!==null&&v.memoizedState.isDehydrated&&pe(y.stateNode.containerInfo);return;case 12:return;case 13:P1(y);return;case 19:P1(y);return;case 17:return}throw Error(s(163))}switch(y.tag){case 0:case 11:case 14:case 15:Fd(3,y,y.return),Xg(3,y),Fd(5,y,y.return);return;case 12:return;case 13:P1(y);return;case 19:P1(y);return;case 3:_e&&v!==null&&v.memoizedState.isDehydrated&&pe(y.stateNode.containerInfo);break;case 22:case 23:return}e:if(re){switch(y.tag){case 1:case 5:case 6:break e;case 3:case 4:y=y.stateNode,Qt(y.containerInfo,y.pendingChildren);break e}throw Error(s(163))}}function P1(v){var y=v.updateQueue;if(y!==null){v.updateQueue=null;var T=v.stateNode;T===null&&(T=v.stateNode=new MQ),y.forEach(function(I){var V=LQ.bind(null,v,I);T.has(I)||(T.add(I),I.then(V,V))})}}function AQ(v,y){for(ft=y;ft!==null;){y=ft;var T=y.deletions;if(T!==null)for(var I=0;I";case R1:return":has("+(g2(v)||"")+")";case I1:return'[role="'+v.value+'"]';case F1:return'"'+v.value+'"';case N1:return'[data-testname="'+v.value+'"]';default:throw Error(s(365))}}function aL(v,y){var T=[];v=[v,0];for(var I=0;IV&&(V=ce),I&=~q}if(I=V,I=gi()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*DQ(I/1960))-I,10v?16:v,rc===null)var I=!1;else{if(v=rc,rc=null,$1=0,on&6)throw Error(s(331));var V=on;for(on|=4,ft=v.current;ft!==null;){var q=ft,ce=q.child;if(ft.flags&16){var De=q.deletions;if(De!==null){for(var We=0;Wegi()-x2?Od(v,0):b2|=T),Fo(v,y)}function gL(v,y){y===0&&(v.mode&1?(y=t1,t1<<=1,!(t1&130023424)&&(t1=4194304)):y=1);var T=po();v=H1(v,y),v!==null&&(Og(v,y,T),Fo(v,T))}function kQ(v){var y=v.memoizedState,T=0;y!==null&&(T=y.retryLane),gL(v,T)}function LQ(v,y){var T=0;switch(v.tag){case 13:var I=v.stateNode,V=v.memoizedState;V!==null&&(T=V.retryLane);break;case 19:I=v.stateNode;break;default:throw Error(s(314))}I!==null&&I.delete(y),gL(v,T)}var vL;vL=function(v,y,T){if(v!==null)if(v.memoizedProps!==y.pendingProps||Mr.current)ls=!0;else{if(!(v.lanes&T)&&!(y.flags&128))return ls=!1,CQ(v,y,T);ls=!!(v.flags&131072)}else ls=!1,lr&&y.flags&1048576&&rk(y,f1,y.index);switch(y.lanes=0,y.tag){case 2:var I=y.type;v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),v=y.pendingProps;var V=$s(y,un.current);xh(y,T),V=QM(null,y,I,v,V,T);var q=JM();return y.flags|=1,typeof V=="object"&&V!==null&&typeof V.render=="function"&&V.$$typeof===void 0?(y.tag=1,y.memoizedState=null,y.updateQueue=null,pi(I)?(q=!0,mi(y)):q=!1,y.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,$M(y),V.updater=c1,y.stateNode=V,V._reactInternals=y,UM(y,I,v,T),y=s2(null,y,I,!0,q,T)):(y.tag=0,lr&&q&&HM(y),ho(null,y,V,T),y=y.child),y;case 16:I=y.elementType;e:{switch(v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),v=y.pendingProps,V=I._init,I=V(I._payload),y.type=I,V=y.tag=$Q(I),v=_a(I,v),V){case 0:y=o2(null,y,I,v,T);break e;case 1:y=Uk(null,y,I,v,T);break e;case 11:y=kk(null,y,I,v,T);break e;case 14:y=Lk(null,y,I,_a(I.type,v),T);break e}throw Error(s(306,I,""))}return y;case 0:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:_a(I,V),o2(v,y,I,V,T);case 1:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:_a(I,V),Uk(v,y,I,V,T);case 3:e:{if(Hk(y),v===null)throw Error(s(387));I=y.pendingProps,q=y.memoizedState,V=q.element,YO(v,y),u1(y,I,null,T);var ce=y.memoizedState;if(I=ce.element,_e&&q.isDehydrated)if(q={element:I,isDehydrated:!1,cache:ce.cache,transitions:ce.transitions},y.updateQueue.baseState=q,y.memoizedState=q,y.flags&256){V=Error(s(423)),y=Vk(v,y,I,T,V);break e}else if(I!==V){V=Error(s(424)),y=Vk(v,y,I,T,V);break e}else for(_e&&(as=co(y.stateNode.containerInfo),ss=y,lr=!0,Sa=null,kg=!1),T=uk(y,null,I,T),y.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(Sh(),I===V){y=iu(v,y,T);break e}ho(v,y,I,T)}y=y.child}return y;case 5:return ck(y),v===null&&jM(y),I=y.type,V=y.pendingProps,q=v!==null?v.memoizedProps:null,ce=V.children,ve(I,V)?ce=null:q!==null&&ve(I,q)&&(y.flags|=32),zk(v,y),ho(v,y,ce,T),y.child;case 6:return v===null&&jM(y),null;case 13:return Gk(v,y,T);case 4:return qM(y,y.stateNode.containerInfo),I=y.pendingProps,v===null?y.child=Ch(y,null,I,T):ho(v,y,I,T),y.child;case 11:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:_a(I,V),kk(v,y,I,V,T);case 7:return ho(v,y,y.pendingProps,T),y.child;case 8:return ho(v,y,y.pendingProps.children,T),y.child;case 12:return ho(v,y,y.pendingProps.children,T),y.child;case 10:e:{if(I=y.type._context,V=y.pendingProps,q=y.memoizedProps,ce=V.value,KO(y,I,ce),q!==null)if(ll(q.value,ce)){if(q.children===V.children&&!Mr.current){y=iu(v,y,T);break e}}else for(q=y.child,q!==null&&(q.return=y);q!==null;){var De=q.dependencies;if(De!==null){ce=q.child;for(var We=De.firstContext;We!==null;){if(We.context===I){if(q.tag===1){We=eu(-1,T&-T),We.tag=2;var rt=q.updateQueue;if(rt!==null){rt=rt.shared;var bt=rt.pending;bt===null?We.next=We:(We.next=bt.next,bt.next=We),rt.pending=We}}q.lanes|=T,We=q.alternate,We!==null&&(We.lanes|=T),BM(q.return,T,y),De.lanes|=T;break}We=We.next}}else if(q.tag===10)ce=q.type===y.type?null:q.child;else if(q.tag===18){if(ce=q.return,ce===null)throw Error(s(341));ce.lanes|=T,De=ce.alternate,De!==null&&(De.lanes|=T),BM(ce,T,y),ce=q.sibling}else ce=q.child;if(ce!==null)ce.return=q;else for(ce=q;ce!==null;){if(ce===y){ce=null;break}if(q=ce.sibling,q!==null){q.return=ce.return,ce=q;break}ce=ce.return}q=ce}ho(v,y,V.children,T),y=y.child}return y;case 9:return V=y.type,I=y.pendingProps.children,xh(y,T),V=zs(V),I=I(V),y.flags|=1,ho(v,y,I,T),y.child;case 14:return I=y.type,V=_a(I,y.pendingProps),V=_a(I.type,V),Lk(v,y,I,V,T);case 15:return Bk(v,y,y.type,y.pendingProps,T);case 17:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:_a(I,V),v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),y.tag=1,pi(I)?(v=!0,mi(y)):v=!1,xh(y,T),tk(y,I,V),UM(y,I,V,T),s2(null,y,I,!0,v,T);case 19:return Xk(v,y,T);case 22:return $k(v,y,T)}throw Error(s(156,y.tag))};function yL(v,y){return RM(v,y)}function BQ(v,y,T,I){this.tag=v,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=y,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ws(v,y,T,I){return new BQ(v,y,T,I)}function A2(v){return v=v.prototype,!(!v||!v.isReactComponent)}function $Q(v){if(typeof v=="function")return A2(v)?1:0;if(v!=null){if(v=v.$$typeof,v===g)return 11;if(v===w)return 14}return 2}function sc(v,y){var T=v.alternate;return T===null?(T=Ws(v.tag,y,v.key,v.mode),T.elementType=v.elementType,T.type=v.type,T.stateNode=v.stateNode,T.alternate=v,v.alternate=T):(T.pendingProps=y,T.type=v.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=v.flags&14680064,T.childLanes=v.childLanes,T.lanes=v.lanes,T.child=v.child,T.memoizedProps=v.memoizedProps,T.memoizedState=v.memoizedState,T.updateQueue=v.updateQueue,y=v.dependencies,T.dependencies=y===null?null:{lanes:y.lanes,firstContext:y.firstContext},T.sibling=v.sibling,T.index=v.index,T.ref=v.ref,T}function G1(v,y,T,I,V,q){var ce=2;if(I=v,typeof v=="function")A2(v)&&(ce=1);else if(typeof v=="string")ce=5;else e:switch(v){case c:return Bd(T.children,V,q,y);case d:ce=8,V|=8;break;case f:return v=Ws(12,T,y,V|2),v.elementType=f,v.lanes=q,v;case b:return v=Ws(13,T,y,V),v.elementType=b,v.lanes=q,v;case m:return v=Ws(19,T,y,V),v.elementType=m,v.lanes=q,v;case _:return j1(T,V,q,y);default:if(typeof v=="object"&&v!==null)switch(v.$$typeof){case h:ce=10;break e;case p:ce=9;break e;case g:ce=11;break e;case w:ce=14;break e;case x:ce=16,I=null;break e}throw Error(s(130,v==null?v:typeof v,""))}return y=Ws(ce,T,y,V),y.elementType=v,y.type=I,y.lanes=q,y}function Bd(v,y,T,I){return v=Ws(7,v,I,y),v.lanes=T,v}function j1(v,y,T,I){return v=Ws(22,v,I,y),v.elementType=_,v.lanes=T,v.stateNode={},v}function P2(v,y,T){return v=Ws(6,v,null,y),v.lanes=T,v}function D2(v,y,T){return y=Ws(4,v.children!==null?v.children:[],v.key,y),y.lanes=T,y.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},y}function zQ(v,y,T,I,V){this.tag=y,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=we,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=PM(0),this.expirationTimes=PM(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=PM(0),this.identifierPrefix=I,this.onRecoverableError=V,_e&&(this.mutableSourceEagerHydrationData=null)}function bL(v,y,T,I,V,q,ce,De,We){return v=new zQ(v,y,T,De,We),y===1?(y=1,q===!0&&(y|=8)):y=0,q=Ws(3,null,null,y),v.current=q,q.stateNode=v,q.memoizedState={element:I,isDehydrated:T,cache:null,transitions:null},$M(q),v}function xL(v){if(!v)return Bs;v=v._reactInternals;e:{if(A(v)!==v||v.tag!==1)throw Error(s(170));var y=v;do{switch(y.tag){case 3:y=y.stateNode.context;break e;case 1:if(pi(y.type)){y=y.stateNode.__reactInternalMemoizedMergedChildContext;break e}}y=y.return}while(y!==null);throw Error(s(171))}if(v.tag===1){var T=v.type;if(pi(T))return vh(v,T,y)}return y}function wL(v){var y=v._reactInternals;if(y===void 0)throw typeof v.render=="function"?Error(s(188)):(v=Object.keys(v).join(","),Error(s(268,v)));return v=$(y),v===null?null:v.stateNode}function _L(v,y){if(v=v.memoizedState,v!==null&&v.dehydrated!==null){var T=v.retryLane;v.retryLane=T!==0&&T=rt&&q>=Kt&&V<=bt&&ce<=Bt){v.splice(y,1);break}else if(I!==rt||T.width!==We.width||Btce){if(!(q!==Kt||T.height!==We.height||btV)){rt>I&&(We.width+=rt-I,We.x=I),btq&&(We.height+=Kt-q,We.y=q),BtT&&(T=ce)),cew2&&(y.flags|=128,I=!0,qg(V,!1),y.lanes=4194304)}else{if(!I)if(v=p1(q),v!==null){if(y.flags|=128,I=!0,v=v.updateQueue,v!==null&&(y.updateQueue=v,y.flags|=4),qg(V,!0),V.tail===null&&V.tailMode==="hidden"&&!q.alternate&&!lr)return Ki(y),null}else 2*gi()-V.renderingStartTime>w2&&T!==1073741824&&(y.flags|=128,I=!0,qg(V,!1),y.lanes=4194304);V.isBackwards?(q.sibling=y.child,y.child=q):(v=V.last,v!==null?v.sibling=q:y.child=q,V.last=q)}return V.tail!==null?(y=V.tail,V.rendering=y,V.tail=y.sibling,V.renderingStartTime=gi(),y.sibling=null,v=mr.current,xt(mr,I?v&1|2:v&1),y):(Ki(y),null);case 22:case 23:return M2(),I=y.memoizedState!==null,v!==null&&v.memoizedState!==null!==I&&(y.flags|=8192),I&&y.mode&1?us&1073741824&&(Ki(y),Oe&&y.subtreeFlags&6&&(y.flags|=8192)):Ki(y),null;case 24:return null;case 25:return null}throw Error(s(156,y.tag))}var SQ=a.ReactCurrentOwner,ls=!1;function ho(v,y,T,I){y.child=v===null?uk(y,null,T,I):Ch(y,v.child,T,I)}function kk(v,y,T,I,V){T=T.render;var q=y.ref;return xh(y,V),I=QM(v,y,T,I,q,V),T=JM(),v!==null&&!ls?(y.updateQueue=v.updateQueue,y.flags&=-2053,v.lanes&=~V,iu(v,y,V)):(lr&&T&&HM(y),y.flags|=1,ho(v,y,I,V),y.child)}function Lk(v,y,T,I,V){if(v===null){var q=T.type;return typeof q=="function"&&!A2(q)&&q.defaultProps===void 0&&T.compare===null&&T.defaultProps===void 0?(y.tag=15,y.type=q,Bk(v,y,q,I,V)):(v=G1(T.type,null,I,y,y.mode,V),v.ref=y.ref,v.return=y,y.child=v)}if(q=v.child,!(v.lanes&V)){var ce=q.memoizedProps;if(T=T.compare,T=T!==null?T:o1,T(ce,I)&&v.ref===y.ref)return iu(v,y,V)}return y.flags|=1,v=sc(q,I),v.ref=y.ref,v.return=y,y.child=v}function Bk(v,y,T,I,V){if(v!==null&&o1(v.memoizedProps,I)&&v.ref===y.ref)if(ls=!1,(v.lanes&V)!==0)v.flags&131072&&(ls=!0);else return y.lanes=v.lanes,iu(v,y,V);return o2(v,y,T,I,V)}function $k(v,y,T){var I=y.pendingProps,V=I.children,q=v!==null?v.memoizedState:null;if(I.mode==="hidden")if(!(y.mode&1))y.memoizedState={baseLanes:0,cachePool:null},xt(Ah,us),us|=T;else if(T&1073741824)y.memoizedState={baseLanes:0,cachePool:null},I=q!==null?q.baseLanes:T,xt(Ah,us),us|=I;else return v=q!==null?q.baseLanes|T:T,y.lanes=y.childLanes=1073741824,y.memoizedState={baseLanes:v,cachePool:null},y.updateQueue=null,xt(Ah,us),us|=v,null;else q!==null?(I=q.baseLanes|T,y.memoizedState=null):I=T,xt(Ah,us),us|=I;return ho(v,y,V,T),y.child}function zk(v,y){var T=y.ref;(v===null&&T!==null||v!==null&&v.ref!==T)&&(y.flags|=512,y.flags|=2097152)}function o2(v,y,T,I,V){var q=pi(T)?il:un.current;return q=$s(y,q),xh(y,V),T=QM(v,y,T,I,q,V),I=JM(),v!==null&&!ls?(y.updateQueue=v.updateQueue,y.flags&=-2053,v.lanes&=~V,iu(v,y,V)):(lr&&I&&HM(y),y.flags|=1,ho(v,y,T,V),y.child)}function Uk(v,y,T,I,V){if(pi(T)){var q=!0;mi(y)}else q=!1;if(xh(y,V),y.stateNode===null)v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),tk(y,T,I),UM(y,T,I,V),I=!0;else if(v===null){var ce=y.stateNode,De=y.memoizedProps;ce.props=De;var We=ce.context,rt=T.contextType;typeof rt=="object"&&rt!==null?rt=zs(rt):(rt=pi(T)?il:un.current,rt=$s(y,rt));var bt=T.getDerivedStateFromProps,Kt=typeof bt=="function"||typeof ce.getSnapshotBeforeUpdate=="function";Kt||typeof ce.UNSAFE_componentWillReceiveProps!="function"&&typeof ce.componentWillReceiveProps!="function"||(De!==I||We!==rt)&&nk(y,ce,I,rt),ec=!1;var Bt=y.memoizedState;ce.state=Bt,u1(y,I,ce,V),We=y.memoizedState,De!==I||Bt!==We||Mr.current||ec?(typeof bt=="function"&&(zM(y,T,bt,I),We=y.memoizedState),(De=ec||ek(y,T,De,I,Bt,We,rt))?(Kt||typeof ce.UNSAFE_componentWillMount!="function"&&typeof ce.componentWillMount!="function"||(typeof ce.componentWillMount=="function"&&ce.componentWillMount(),typeof ce.UNSAFE_componentWillMount=="function"&&ce.UNSAFE_componentWillMount()),typeof ce.componentDidMount=="function"&&(y.flags|=4194308)):(typeof ce.componentDidMount=="function"&&(y.flags|=4194308),y.memoizedProps=I,y.memoizedState=We),ce.props=I,ce.state=We,ce.context=rt,I=De):(typeof ce.componentDidMount=="function"&&(y.flags|=4194308),I=!1)}else{ce=y.stateNode,YO(v,y),De=y.memoizedProps,rt=y.type===y.elementType?De:wa(y.type,De),ce.props=rt,Kt=y.pendingProps,Bt=ce.context,We=T.contextType,typeof We=="object"&&We!==null?We=zs(We):(We=pi(T)?il:un.current,We=$s(y,We));var Wn=T.getDerivedStateFromProps;(bt=typeof Wn=="function"||typeof ce.getSnapshotBeforeUpdate=="function")||typeof ce.UNSAFE_componentWillReceiveProps!="function"&&typeof ce.componentWillReceiveProps!="function"||(De!==Kt||Bt!==We)&&nk(y,ce,I,We),ec=!1,Bt=y.memoizedState,ce.state=Bt,u1(y,I,ce,V);var Dt=y.memoizedState;De!==Kt||Bt!==Dt||Mr.current||ec?(typeof Wn=="function"&&(zM(y,T,Wn,I),Dt=y.memoizedState),(rt=ec||ek(y,T,rt,I,Bt,Dt,We)||!1)?(bt||typeof ce.UNSAFE_componentWillUpdate!="function"&&typeof ce.componentWillUpdate!="function"||(typeof ce.componentWillUpdate=="function"&&ce.componentWillUpdate(I,Dt,We),typeof ce.UNSAFE_componentWillUpdate=="function"&&ce.UNSAFE_componentWillUpdate(I,Dt,We)),typeof ce.componentDidUpdate=="function"&&(y.flags|=4),typeof ce.getSnapshotBeforeUpdate=="function"&&(y.flags|=1024)):(typeof ce.componentDidUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=4),typeof ce.getSnapshotBeforeUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=1024),y.memoizedProps=I,y.memoizedState=Dt),ce.props=I,ce.state=Dt,ce.context=We,I=rt):(typeof ce.componentDidUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=4),typeof ce.getSnapshotBeforeUpdate!="function"||De===v.memoizedProps&&Bt===v.memoizedState||(y.flags|=1024),I=!1)}return s2(v,y,T,I,q,V)}function s2(v,y,T,I,V,q){zk(v,y);var ce=(y.flags&128)!==0;if(!I&&!ce)return V&&yh(y,T,!1),iu(v,y,q);I=y.stateNode,SQ.current=y;var De=ce&&typeof T.getDerivedStateFromError!="function"?null:I.render();return y.flags|=1,v!==null&&ce?(y.child=Ch(y,v.child,null,q),y.child=Ch(y,null,De,q)):ho(v,y,De,q),y.memoizedState=I.state,V&&yh(y,T,!0),y.child}function Hk(v){var y=v.stateNode;y.pendingContext?ol(v,y.pendingContext,y.pendingContext!==y.context):y.context&&ol(v,y.context,!1),qM(v,y.containerInfo)}function Vk(v,y,T,I,V){return Sh(),WM(V),y.flags|=256,ho(v,y,T,I),y.child}var C1={dehydrated:null,treeContext:null,retryLane:0};function E1(v){return{baseLanes:v,cachePool:null}}function Gk(v,y,T){var I=y.pendingProps,V=mr.current,q=!1,ce=(y.flags&128)!==0,De;if((De=ce)||(De=v!==null&&v.memoizedState===null?!1:(V&2)!==0),De?(q=!0,y.flags&=-129):(v===null||v.memoizedState!==null)&&(V|=1),xt(mr,V&1),v===null)return jM(y),v=y.memoizedState,v!==null&&(v=v.dehydrated,v!==null)?(y.mode&1?Ii(v)?y.lanes=8:y.lanes=1073741824:y.lanes=1,null):(V=I.children,v=I.fallback,q?(I=y.mode,q=y.child,V={mode:"hidden",children:V},!(I&1)&&q!==null?(q.childLanes=0,q.pendingProps=V):q=j1(V,I,0,null),v=Bd(v,I,T,null),q.return=y,v.return=y,q.sibling=v,y.child=q,y.child.memoizedState=E1(T),y.memoizedState=C1,v):a2(y,V));if(V=v.memoizedState,V!==null){if(De=V.dehydrated,De!==null){if(ce)return y.flags&256?(y.flags&=-257,M1(v,y,T,Error(s(422)))):y.memoizedState!==null?(y.child=v.child,y.flags|=128,null):(q=I.fallback,V=y.mode,I=j1({mode:"visible",children:I.children},V,0,null),q=Bd(q,V,T,null),q.flags|=2,I.return=y,q.return=y,I.sibling=q,y.child=I,y.mode&1&&Ch(y,v.child,null,T),y.child.memoizedState=E1(T),y.memoizedState=C1,q);if(!(y.mode&1))y=M1(v,y,T,null);else if(Ii(De))y=M1(v,y,T,Error(s(419)));else if(I=(T&v.childLanes)!==0,ls||I){if(I=qr,I!==null){switch(T&-T){case 4:q=2;break;case 16:q=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:q=32;break;case 536870912:q=268435456;break;default:q=0}I=q&(I.suspendedLanes|T)?0:q,I!==0&&I!==V.retryLane&&(V.retryLane=I,js(v,I,-1))}T2(),y=M1(v,y,T,Error(s(421)))}else Er(De)?(y.flags|=128,y.child=v.child,y=kQ.bind(null,v),Io(De,y),y=null):(T=V.treeContext,_e&&(as=Fi(De),ss=y,lr=!0,_a=null,kg=!1,T!==null&&(Us[Hs++]=tu,Us[Hs++]=nu,Us[Hs++]=Dd,tu=T.id,nu=T.overflow,Dd=y)),y=a2(y,y.pendingProps.children),y.flags|=4096);return y}return q?(I=Wk(v,y,I.children,I.fallback,T),q=y.child,V=v.child.memoizedState,q.memoizedState=V===null?E1(T):{baseLanes:V.baseLanes|T,cachePool:null},q.childLanes=v.childLanes&~T,y.memoizedState=C1,I):(T=jk(v,y,I.children,T),y.memoizedState=null,T)}return q?(I=Wk(v,y,I.children,I.fallback,T),q=y.child,V=v.child.memoizedState,q.memoizedState=V===null?E1(T):{baseLanes:V.baseLanes|T,cachePool:null},q.childLanes=v.childLanes&~T,y.memoizedState=C1,I):(T=jk(v,y,I.children,T),y.memoizedState=null,T)}function a2(v,y){return y=j1({mode:"visible",children:y},v.mode,0,null),y.return=v,v.child=y}function jk(v,y,T,I){var V=v.child;return v=V.sibling,T=sc(V,{mode:"visible",children:T}),!(y.mode&1)&&(T.lanes=I),T.return=y,T.sibling=null,v!==null&&(I=y.deletions,I===null?(y.deletions=[v],y.flags|=16):I.push(v)),y.child=T}function Wk(v,y,T,I,V){var q=y.mode;v=v.child;var ce=v.sibling,De={mode:"hidden",children:T};return!(q&1)&&y.child!==v?(T=y.child,T.childLanes=0,T.pendingProps=De,y.deletions=null):(T=sc(v,De),T.subtreeFlags=v.subtreeFlags&14680064),ce!==null?I=sc(ce,I):(I=Bd(I,q,V,null),I.flags|=2),I.return=y,T.return=y,T.sibling=I,y.child=T,I}function M1(v,y,T,I){return I!==null&&WM(I),Ch(y,v.child,null,T),v=a2(y,y.pendingProps.children),v.flags|=2,y.memoizedState=null,v}function qk(v,y,T){v.lanes|=y;var I=v.alternate;I!==null&&(I.lanes|=y),BM(v.return,y,T)}function l2(v,y,T,I,V){var q=v.memoizedState;q===null?v.memoizedState={isBackwards:y,rendering:null,renderingStartTime:0,last:I,tail:T,tailMode:V}:(q.isBackwards=y,q.rendering=null,q.renderingStartTime=0,q.last=I,q.tail=T,q.tailMode=V)}function Xk(v,y,T){var I=y.pendingProps,V=I.revealOrder,q=I.tail;if(ho(v,y,I.children,T),I=mr.current,I&2)I=I&1|2,y.flags|=128;else{if(v!==null&&v.flags&128)e:for(v=y.child;v!==null;){if(v.tag===13)v.memoizedState!==null&&qk(v,T,y);else if(v.tag===19)qk(v,T,y);else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===y)break e;for(;v.sibling===null;){if(v.return===null||v.return===y)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}I&=1}if(xt(mr,I),!(y.mode&1))y.memoizedState=null;else switch(V){case"forwards":for(T=y.child,V=null;T!==null;)v=T.alternate,v!==null&&p1(v)===null&&(V=T),T=T.sibling;T=V,T===null?(V=y.child,y.child=null):(V=T.sibling,T.sibling=null),l2(y,!1,V,T,q);break;case"backwards":for(T=null,V=y.child,y.child=null;V!==null;){if(v=V.alternate,v!==null&&p1(v)===null){y.child=V;break}v=V.sibling,V.sibling=T,T=V,V=v}l2(y,!0,T,null,q);break;case"together":l2(y,!1,null,null,void 0);break;default:y.memoizedState=null}return y.child}function iu(v,y,T){if(v!==null&&(y.dependencies=v.dependencies),Ph|=y.lanes,!(T&y.childLanes))return null;if(v!==null&&y.child!==v.child)throw Error(s(153));if(y.child!==null){for(v=y.child,T=sc(v,v.pendingProps),y.child=T,T.return=y;v.sibling!==null;)v=v.sibling,T=T.sibling=sc(v,v.pendingProps),T.return=y;T.sibling=null}return y.child}function CQ(v,y,T){switch(y.tag){case 3:Hk(y),Sh();break;case 5:ck(y);break;case 1:pi(y.type)&&mi(y);break;case 4:qM(y,y.stateNode.containerInfo);break;case 10:KO(y,y.type._context,y.memoizedProps.value);break;case 13:var I=y.memoizedState;if(I!==null)return I.dehydrated!==null?(xt(mr,mr.current&1),y.flags|=128,null):T&y.child.childLanes?Gk(v,y,T):(xt(mr,mr.current&1),v=iu(v,y,T),v!==null?v.sibling:null);xt(mr,mr.current&1);break;case 19:if(I=(T&y.childLanes)!==0,v.flags&128){if(I)return Xk(v,y,T);y.flags|=128}var V=y.memoizedState;if(V!==null&&(V.rendering=null,V.tail=null,V.lastEffect=null),xt(mr,mr.current),I)break;return null;case 22:case 23:return y.lanes=0,$k(v,y,T)}return iu(v,y,T)}function EQ(v,y){switch(VM(y),y.tag){case 1:return pi(y.type)&&Wr(),v=y.flags,v&65536?(y.flags=v&-65537|128,y):null;case 3:return Mh(),Vt(Mr),Vt(un),YM(),v=y.flags,v&65536&&!(v&128)?(y.flags=v&-65537|128,y):null;case 5:return XM(y),null;case 13:if(Vt(mr),v=y.memoizedState,v!==null&&v.dehydrated!==null){if(y.alternate===null)throw Error(s(340));Sh()}return v=y.flags,v&65536?(y.flags=v&-65537|128,y):null;case 19:return Vt(mr),null;case 4:return Mh(),null;case 10:return LM(y.type._context),null;case 22:case 23:return M2(),null;case 24:return null;default:return null}}var T1=!1,Nd=!1,MQ=typeof WeakSet=="function"?WeakSet:Set,ft=null;function A1(v,y){var T=v.ref;if(T!==null)if(typeof T=="function")try{T(null)}catch(I){Oo(v,y,I)}else T.current=null}function u2(v,y,T){try{T()}catch(I){Oo(v,y,I)}}var Kk=!1;function TQ(v,y){for(N(v.containerInfo),ft=y;ft!==null;)if(v=ft,y=v.child,(v.subtreeFlags&1028)!==0&&y!==null)y.return=v,ft=y;else for(;ft!==null;){v=ft;try{var T=v.alternate;if(v.flags&1024)switch(v.tag){case 0:case 11:case 15:break;case 1:if(T!==null){var I=T.memoizedProps,V=T.memoizedState,q=v.stateNode,ce=q.getSnapshotBeforeUpdate(v.elementType===v.type?I:wa(v.type,I),V);q.__reactInternalSnapshotBeforeUpdate=ce}break;case 3:Oe&&st(v.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(De){Oo(v,v.return,De)}if(y=v.sibling,y!==null){y.return=v.return,ft=y;break}ft=v.return}return T=Kk,Kk=!1,T}function Fd(v,y,T){var I=y.updateQueue;if(I=I!==null?I.lastEffect:null,I!==null){var V=I=I.next;do{if((V.tag&v)===v){var q=V.destroy;V.destroy=void 0,q!==void 0&&u2(y,T,q)}V=V.next}while(V!==I)}}function Xg(v,y){if(y=y.updateQueue,y=y!==null?y.lastEffect:null,y!==null){var T=y=y.next;do{if((T.tag&v)===v){var I=T.create;T.destroy=I()}T=T.next}while(T!==y)}}function c2(v){var y=v.ref;if(y!==null){var T=v.stateNode;switch(v.tag){case 5:v=G(T);break;default:v=T}typeof y=="function"?y(v):y.current=v}}function Yk(v,y,T){if(sl&&typeof sl.onCommitFiberUnmount=="function")try{sl.onCommitFiberUnmount(r1,y)}catch{}switch(y.tag){case 0:case 11:case 14:case 15:if(v=y.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var I=v=v.next;do{var V=I,q=V.destroy;V=V.tag,q!==void 0&&(V&2||V&4)&&u2(y,T,q),I=I.next}while(I!==v)}break;case 1:if(A1(y,T),v=y.stateNode,typeof v.componentWillUnmount=="function")try{v.props=y.memoizedProps,v.state=y.memoizedState,v.componentWillUnmount()}catch(ce){Oo(y,T,ce)}break;case 5:A1(y,T);break;case 4:Oe?nL(v,y,T):re&&re&&(y=y.stateNode.containerInfo,T=je(y),Qt(y,T))}}function Zk(v,y,T){for(var I=y;;)if(Yk(v,I,T),I.child===null||Oe&&I.tag===4){if(I===y)break;for(;I.sibling===null;){if(I.return===null||I.return===y)return;I=I.return}I.sibling.return=I.return,I=I.sibling}else I.child.return=I,I=I.child}function Qk(v){var y=v.alternate;y!==null&&(v.alternate=null,Qk(y)),v.child=null,v.deletions=null,v.sibling=null,v.tag===5&&(y=v.stateNode,y!==null&&he(y)),v.stateNode=null,v.return=null,v.dependencies=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.stateNode=null,v.updateQueue=null}function Jk(v){return v.tag===5||v.tag===3||v.tag===4}function eL(v){e:for(;;){for(;v.sibling===null;){if(v.return===null||Jk(v.return))return null;v=v.return}for(v.sibling.return=v.return,v=v.sibling;v.tag!==5&&v.tag!==6&&v.tag!==18;){if(v.flags&2||v.child===null||v.tag===4)continue e;v.child.return=v,v=v.child}if(!(v.flags&2))return v.stateNode}}function tL(v){if(Oe){e:{for(var y=v.return;y!==null;){if(Jk(y))break e;y=y.return}throw Error(s(160))}var T=y;switch(T.tag){case 5:y=T.stateNode,T.flags&32&&(ot(y),T.flags&=-33),T=eL(v),f2(v,T,y);break;case 3:case 4:y=T.stateNode.containerInfo,T=eL(v),d2(v,T,y);break;default:throw Error(s(161))}}}function d2(v,y,T){var I=v.tag;if(I===5||I===6)v=v.stateNode,y?Le(T,v,y):ge(T,v);else if(I!==4&&(v=v.child,v!==null))for(d2(v,y,T),v=v.sibling;v!==null;)d2(v,y,T),v=v.sibling}function f2(v,y,T){var I=v.tag;if(I===5||I===6)v=v.stateNode,y?Ve(T,v,y):ue(T,v);else if(I!==4&&(v=v.child,v!==null))for(f2(v,y,T),v=v.sibling;v!==null;)f2(v,y,T),v=v.sibling}function nL(v,y,T){for(var I=y,V=!1,q,ce;;){if(!V){V=I.return;e:for(;;){if(V===null)throw Error(s(160));switch(q=V.stateNode,V.tag){case 5:ce=!1;break e;case 3:q=q.containerInfo,ce=!0;break e;case 4:q=q.containerInfo,ce=!0;break e}V=V.return}V=!0}if(I.tag===5||I.tag===6)Zk(v,I,T),ce?it(q,I.stateNode):Ye(q,I.stateNode);else if(I.tag===18)ce?ke(q,I.stateNode):Ee(q,I.stateNode);else if(I.tag===4){if(I.child!==null){q=I.stateNode.containerInfo,ce=!0,I.child.return=I,I=I.child;continue}}else if(Yk(v,I,T),I.child!==null){I.child.return=I,I=I.child;continue}if(I===y)break;for(;I.sibling===null;){if(I.return===null||I.return===y)return;I=I.return,I.tag===4&&(V=!1)}I.sibling.return=I.return,I=I.sibling}}function h2(v,y){if(Oe){switch(y.tag){case 0:case 11:case 14:case 15:Fd(3,y,y.return),Xg(3,y),Fd(5,y,y.return);return;case 1:return;case 5:var T=y.stateNode;if(T!=null){var I=y.memoizedProps;v=v!==null?v.memoizedProps:I;var V=y.type,q=y.updateQueue;y.updateQueue=null,q!==null&&Re(T,q,V,v,I,y)}return;case 6:if(y.stateNode===null)throw Error(s(162));T=y.memoizedProps,be(y.stateNode,v!==null?v.memoizedProps:T,T);return;case 3:_e&&v!==null&&v.memoizedState.isDehydrated&&pe(y.stateNode.containerInfo);return;case 12:return;case 13:P1(y);return;case 19:P1(y);return;case 17:return}throw Error(s(163))}switch(y.tag){case 0:case 11:case 14:case 15:Fd(3,y,y.return),Xg(3,y),Fd(5,y,y.return);return;case 12:return;case 13:P1(y);return;case 19:P1(y);return;case 3:_e&&v!==null&&v.memoizedState.isDehydrated&&pe(y.stateNode.containerInfo);break;case 22:case 23:return}e:if(re){switch(y.tag){case 1:case 5:case 6:break e;case 3:case 4:y=y.stateNode,Qt(y.containerInfo,y.pendingChildren);break e}throw Error(s(163))}}function P1(v){var y=v.updateQueue;if(y!==null){v.updateQueue=null;var T=v.stateNode;T===null&&(T=v.stateNode=new MQ),y.forEach(function(I){var V=LQ.bind(null,v,I);T.has(I)||(T.add(I),I.then(V,V))})}}function AQ(v,y){for(ft=y;ft!==null;){y=ft;var T=y.deletions;if(T!==null)for(var I=0;I";case R1:return":has("+(g2(v)||"")+")";case I1:return'[role="'+v.value+'"]';case F1:return'"'+v.value+'"';case N1:return'[data-testname="'+v.value+'"]';default:throw Error(s(365))}}function aL(v,y){var T=[];v=[v,0];for(var I=0;IV&&(V=ce),I&=~q}if(I=V,I=gi()-I,I=(120>I?120:480>I?480:1080>I?1080:1920>I?1920:3e3>I?3e3:4320>I?4320:1960*DQ(I/1960))-I,10v?16:v,rc===null)var I=!1;else{if(v=rc,rc=null,$1=0,on&6)throw Error(s(331));var V=on;for(on|=4,ft=v.current;ft!==null;){var q=ft,ce=q.child;if(ft.flags&16){var De=q.deletions;if(De!==null){for(var We=0;Wegi()-x2?Od(v,0):b2|=T),Fo(v,y)}function gL(v,y){y===0&&(v.mode&1?(y=t1,t1<<=1,!(t1&130023424)&&(t1=4194304)):y=1);var T=po();v=H1(v,y),v!==null&&(Og(v,y,T),Fo(v,T))}function kQ(v){var y=v.memoizedState,T=0;y!==null&&(T=y.retryLane),gL(v,T)}function LQ(v,y){var T=0;switch(v.tag){case 13:var I=v.stateNode,V=v.memoizedState;V!==null&&(T=V.retryLane);break;case 19:I=v.stateNode;break;default:throw Error(s(314))}I!==null&&I.delete(y),gL(v,T)}var vL;vL=function(v,y,T){if(v!==null)if(v.memoizedProps!==y.pendingProps||Mr.current)ls=!0;else{if(!(v.lanes&T)&&!(y.flags&128))return ls=!1,CQ(v,y,T);ls=!!(v.flags&131072)}else ls=!1,lr&&y.flags&1048576&&rk(y,f1,y.index);switch(y.lanes=0,y.tag){case 2:var I=y.type;v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),v=y.pendingProps;var V=$s(y,un.current);xh(y,T),V=QM(null,y,I,v,V,T);var q=JM();return y.flags|=1,typeof V=="object"&&V!==null&&typeof V.render=="function"&&V.$$typeof===void 0?(y.tag=1,y.memoizedState=null,y.updateQueue=null,pi(I)?(q=!0,mi(y)):q=!1,y.memoizedState=V.state!==null&&V.state!==void 0?V.state:null,$M(y),V.updater=c1,y.stateNode=V,V._reactInternals=y,UM(y,I,v,T),y=s2(null,y,I,!0,q,T)):(y.tag=0,lr&&q&&HM(y),ho(null,y,V,T),y=y.child),y;case 16:I=y.elementType;e:{switch(v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),v=y.pendingProps,V=I._init,I=V(I._payload),y.type=I,V=y.tag=$Q(I),v=wa(I,v),V){case 0:y=o2(null,y,I,v,T);break e;case 1:y=Uk(null,y,I,v,T);break e;case 11:y=kk(null,y,I,v,T);break e;case 14:y=Lk(null,y,I,wa(I.type,v),T);break e}throw Error(s(306,I,""))}return y;case 0:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:wa(I,V),o2(v,y,I,V,T);case 1:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:wa(I,V),Uk(v,y,I,V,T);case 3:e:{if(Hk(y),v===null)throw Error(s(387));I=y.pendingProps,q=y.memoizedState,V=q.element,YO(v,y),u1(y,I,null,T);var ce=y.memoizedState;if(I=ce.element,_e&&q.isDehydrated)if(q={element:I,isDehydrated:!1,cache:ce.cache,transitions:ce.transitions},y.updateQueue.baseState=q,y.memoizedState=q,y.flags&256){V=Error(s(423)),y=Vk(v,y,I,T,V);break e}else if(I!==V){V=Error(s(424)),y=Vk(v,y,I,T,V);break e}else for(_e&&(as=co(y.stateNode.containerInfo),ss=y,lr=!0,_a=null,kg=!1),T=uk(y,null,I,T),y.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(Sh(),I===V){y=iu(v,y,T);break e}ho(v,y,I,T)}y=y.child}return y;case 5:return ck(y),v===null&&jM(y),I=y.type,V=y.pendingProps,q=v!==null?v.memoizedProps:null,ce=V.children,ve(I,V)?ce=null:q!==null&&ve(I,q)&&(y.flags|=32),zk(v,y),ho(v,y,ce,T),y.child;case 6:return v===null&&jM(y),null;case 13:return Gk(v,y,T);case 4:return qM(y,y.stateNode.containerInfo),I=y.pendingProps,v===null?y.child=Ch(y,null,I,T):ho(v,y,I,T),y.child;case 11:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:wa(I,V),kk(v,y,I,V,T);case 7:return ho(v,y,y.pendingProps,T),y.child;case 8:return ho(v,y,y.pendingProps.children,T),y.child;case 12:return ho(v,y,y.pendingProps.children,T),y.child;case 10:e:{if(I=y.type._context,V=y.pendingProps,q=y.memoizedProps,ce=V.value,KO(y,I,ce),q!==null)if(al(q.value,ce)){if(q.children===V.children&&!Mr.current){y=iu(v,y,T);break e}}else for(q=y.child,q!==null&&(q.return=y);q!==null;){var De=q.dependencies;if(De!==null){ce=q.child;for(var We=De.firstContext;We!==null;){if(We.context===I){if(q.tag===1){We=eu(-1,T&-T),We.tag=2;var rt=q.updateQueue;if(rt!==null){rt=rt.shared;var bt=rt.pending;bt===null?We.next=We:(We.next=bt.next,bt.next=We),rt.pending=We}}q.lanes|=T,We=q.alternate,We!==null&&(We.lanes|=T),BM(q.return,T,y),De.lanes|=T;break}We=We.next}}else if(q.tag===10)ce=q.type===y.type?null:q.child;else if(q.tag===18){if(ce=q.return,ce===null)throw Error(s(341));ce.lanes|=T,De=ce.alternate,De!==null&&(De.lanes|=T),BM(ce,T,y),ce=q.sibling}else ce=q.child;if(ce!==null)ce.return=q;else for(ce=q;ce!==null;){if(ce===y){ce=null;break}if(q=ce.sibling,q!==null){q.return=ce.return,ce=q;break}ce=ce.return}q=ce}ho(v,y,V.children,T),y=y.child}return y;case 9:return V=y.type,I=y.pendingProps.children,xh(y,T),V=zs(V),I=I(V),y.flags|=1,ho(v,y,I,T),y.child;case 14:return I=y.type,V=wa(I,y.pendingProps),V=wa(I.type,V),Lk(v,y,I,V,T);case 15:return Bk(v,y,y.type,y.pendingProps,T);case 17:return I=y.type,V=y.pendingProps,V=y.elementType===I?V:wa(I,V),v!==null&&(v.alternate=null,y.alternate=null,y.flags|=2),y.tag=1,pi(I)?(v=!0,mi(y)):v=!1,xh(y,T),tk(y,I,V),UM(y,I,V,T),s2(null,y,I,!0,v,T);case 19:return Xk(v,y,T);case 22:return $k(v,y,T)}throw Error(s(156,y.tag))};function yL(v,y){return RM(v,y)}function BQ(v,y,T,I){this.tag=v,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=y,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=I,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ws(v,y,T,I){return new BQ(v,y,T,I)}function A2(v){return v=v.prototype,!(!v||!v.isReactComponent)}function $Q(v){if(typeof v=="function")return A2(v)?1:0;if(v!=null){if(v=v.$$typeof,v===g)return 11;if(v===w)return 14}return 2}function sc(v,y){var T=v.alternate;return T===null?(T=Ws(v.tag,y,v.key,v.mode),T.elementType=v.elementType,T.type=v.type,T.stateNode=v.stateNode,T.alternate=v,v.alternate=T):(T.pendingProps=y,T.type=v.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=v.flags&14680064,T.childLanes=v.childLanes,T.lanes=v.lanes,T.child=v.child,T.memoizedProps=v.memoizedProps,T.memoizedState=v.memoizedState,T.updateQueue=v.updateQueue,y=v.dependencies,T.dependencies=y===null?null:{lanes:y.lanes,firstContext:y.firstContext},T.sibling=v.sibling,T.index=v.index,T.ref=v.ref,T}function G1(v,y,T,I,V,q){var ce=2;if(I=v,typeof v=="function")A2(v)&&(ce=1);else if(typeof v=="string")ce=5;else e:switch(v){case c:return Bd(T.children,V,q,y);case d:ce=8,V|=8;break;case f:return v=Ws(12,T,y,V|2),v.elementType=f,v.lanes=q,v;case b:return v=Ws(13,T,y,V),v.elementType=b,v.lanes=q,v;case m:return v=Ws(19,T,y,V),v.elementType=m,v.lanes=q,v;case _:return j1(T,V,q,y);default:if(typeof v=="object"&&v!==null)switch(v.$$typeof){case h:ce=10;break e;case p:ce=9;break e;case g:ce=11;break e;case w:ce=14;break e;case x:ce=16,I=null;break e}throw Error(s(130,v==null?v:typeof v,""))}return y=Ws(ce,T,y,V),y.elementType=v,y.type=I,y.lanes=q,y}function Bd(v,y,T,I){return v=Ws(7,v,I,y),v.lanes=T,v}function j1(v,y,T,I){return v=Ws(22,v,I,y),v.elementType=_,v.lanes=T,v.stateNode={},v}function P2(v,y,T){return v=Ws(6,v,null,y),v.lanes=T,v}function D2(v,y,T){return y=Ws(4,v.children!==null?v.children:[],v.key,y),y.lanes=T,y.stateNode={containerInfo:v.containerInfo,pendingChildren:null,implementation:v.implementation},y}function zQ(v,y,T,I,V){this.tag=y,this.containerInfo=v,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=we,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=PM(0),this.expirationTimes=PM(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=PM(0),this.identifierPrefix=I,this.onRecoverableError=V,_e&&(this.mutableSourceEagerHydrationData=null)}function bL(v,y,T,I,V,q,ce,De,We){return v=new zQ(v,y,T,De,We),y===1?(y=1,q===!0&&(y|=8)):y=0,q=Ws(3,null,null,y),v.current=q,q.stateNode=v,q.memoizedState={element:I,isDehydrated:T,cache:null,transitions:null},$M(q),v}function xL(v){if(!v)return Bs;v=v._reactInternals;e:{if(A(v)!==v||v.tag!==1)throw Error(s(170));var y=v;do{switch(y.tag){case 3:y=y.stateNode.context;break e;case 1:if(pi(y.type)){y=y.stateNode.__reactInternalMemoizedMergedChildContext;break e}}y=y.return}while(y!==null);throw Error(s(171))}if(v.tag===1){var T=v.type;if(pi(T))return vh(v,T,y)}return y}function wL(v){var y=v._reactInternals;if(y===void 0)throw typeof v.render=="function"?Error(s(188)):(v=Object.keys(v).join(","),Error(s(268,v)));return v=$(y),v===null?null:v.stateNode}function _L(v,y){if(v=v.memoizedState,v!==null&&v.dehydrated!==null){var T=v.retryLane;v.retryLane=T!==0&&T=rt&&q>=Kt&&V<=bt&&ce<=Bt){v.splice(y,1);break}else if(I!==rt||T.width!==We.width||Btce){if(!(q!==Kt||T.height!==We.height||btV)){rt>I&&(We.width+=rt-I,We.x=I),btq&&(We.height+=Kt-q,We.y=q),BtT&&(T=ce)),ce ")+` No matching component was found for: - `)+v.join(" > ")}return null},n.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return G(v.child.stateNode);default:return v.child.stateNode}},n.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:UQ,findFiberByHostInstance:v.findFiberByHostInstance||HQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")v=!1;else{var y=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(y.isDisabled||!y.supportsFiber)v=!0;else{try{r1=y.inject(v),al=y}catch{}v=!!y.checkDCE}}return v},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(v,y,T,I){if(!se)throw Error(s(363));v=v2(v,y);var V=de(v,T,I).disconnect;return{disconnect:function(){V()}}},n.registerMutableSourceForHydration=function(v,y){var T=y._getVersion;T=T(y._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[y,T]:v.mutableSourceEagerHydrationData.push(y,T)},n.runWithPriority=function(v,y){var T=Sn;try{return Sn=v,y()}finally{Sn=T}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(v,y,T,I){var V=y.current,q=po(),ce=ic(V);return T=xL(T),y.context===null?y.context=T:y.pendingContext=T,y=eu(q,ce),y.payload={element:v},I=I===void 0?null:I,I!==null&&(y.callback=I),tc(V,y),v=js(V,ce,q),v!==null&&l1(v,V,ce),ce},n};rK.exports=UNe;var HNe=rK.exports;const VNe=ya(HNe);var iK={exports:{}},oK={};/** + `)+v.join(" > ")}return null},n.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return G(v.child.stateNode);default:return v.child.stateNode}},n.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:UQ,findFiberByHostInstance:v.findFiberByHostInstance||HQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")v=!1;else{var y=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(y.isDisabled||!y.supportsFiber)v=!0;else{try{r1=y.inject(v),sl=y}catch{}v=!!y.checkDCE}}return v},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(v,y,T,I){if(!se)throw Error(s(363));v=v2(v,y);var V=de(v,T,I).disconnect;return{disconnect:function(){V()}}},n.registerMutableSourceForHydration=function(v,y){var T=y._getVersion;T=T(y._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[y,T]:v.mutableSourceEagerHydrationData.push(y,T)},n.runWithPriority=function(v,y){var T=Sn;try{return Sn=v,y()}finally{Sn=T}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(v,y,T,I){var V=y.current,q=po(),ce=ic(V);return T=xL(T),y.context===null?y.context=T:y.pendingContext=T,y=eu(q,ce),y.payload={element:v},I=I===void 0?null:I,I!==null&&(y.callback=I),tc(V,y),v=js(V,ce,q),v!==null&&l1(v,V,ce),ce},n};rK.exports=UNe;var HNe=rK.exports;const VNe=va(HNe);var iK={exports:{}},oK={};/** * @license React * scheduler.production.min.js * @@ -3905,18 +3905,18 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(L,N){var W=L.length;L.push(N);e:for(;0>>1,Q=L[K];if(0>>1;Ki(ve,W))fei(Me,ve)?(L[K]=Me,L[fe]=W,K=fe):(L[K]=ve,L[ae]=W,K=ae);else if(fei(Me,W))L[K]=Me,L[fe]=W,K=fe;else break e}}return N}function i(L,N){var W=L.sortIndex-N.sortIndex;return W!==0?W:L.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(L){for(var N=n(u);N!==null;){if(N.callback===null)r(u);else if(N.startTime<=L)r(u),N.sortIndex=N.expirationTime,e(l,N);else break;N=n(u)}}function _(L){if(g=!1,x(L),!p)if(n(l)!==null)p=!0,G(C);else{var N=n(u);N!==null&&B(_,N.startTime-L)}}function C(L,N){p=!1,g&&(g=!1,m(P),P=-1),h=!0;var W=f;try{for(x(N),d=n(l);d!==null&&(!(d.expirationTime>N)||L&&!F());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var Q=K(d.expirationTime<=N);N=t.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(l)&&r(l),x(N)}else r(l);d=n(l)}if(d!==null)var J=!0;else{var ae=n(u);ae!==null&&B(_,ae.startTime-N),J=!1}return J}finally{d=null,f=W,h=!1}}var S=!1,M=null,P=-1,A=5,R=-1;function F(){return!(t.unstable_now()-RL||125K?(L.sortIndex=W,e(u,L),n(l)===null&&L===n(u)&&(g?(m(P),P=-1):g=!0,B(_,W-K))):(L.sortIndex=Q,e(l,L),p||h||(p=!0,G(C))),L},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(L){var N=f;return function(){var W=f;f=N;try{return L.apply(this,arguments)}finally{f=W}}}})(oK);iK.exports=oK;var S$=iK.exports;const MF={},sK=t=>void Object.assign(MF,t);function GNe(t,e){function n(c,{args:d=[],attach:f,...h},p){let g=`${c[0].toUpperCase()}${c.slice(1)}`,b;if(c==="primitive"){if(h.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=h.object;b=vp(m,{type:c,root:p,attach:f,primitive:!0})}else{const m=MF[g];if(!m)throw new Error(`R3F: ${g} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");b=vp(new m(...d),{type:c,root:p,attach:f,memoizedProps:{args:d}})}return b.__r3f.attach===void 0&&(b instanceof rn?b.__r3f.attach="geometry":b instanceof ji&&(b.__r3f.attach="material")),g!=="inject"&&wA(b,h),b}function r(c,d){let f=!1;if(d){var h,p;(h=d.__r3f)!=null&&h.attach?xA(c,d,d.__r3f.attach):d.isObject3D&&c.isObject3D&&(c.add(d),f=!0),f||(p=c.__r3f)==null||p.objects.push(d),d.__r3f||vp(d,{}),d.__r3f.parent=c,MR(d),yp(d)}}function i(c,d,f){let h=!1;if(d){var p,g;if((p=d.__r3f)!=null&&p.attach)xA(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){d.parent=c,d.dispatchEvent({type:"added"}),c.dispatchEvent({type:"childadded",child:d});const b=c.children.filter(w=>w!==d),m=b.indexOf(f);c.children=[...b.slice(0,m),d,...b.slice(m)],h=!0}h||(g=c.__r3f)==null||g.objects.push(d),d.__r3f||vp(d,{}),d.__r3f.parent=c,MR(d),yp(d)}}function o(c,d,f=!1){c&&[...c].forEach(h=>s(d,h,f))}function s(c,d,f){if(d){var h,p,g;if(d.__r3f&&(d.__r3f.parent=null),(h=c.__r3f)!=null&&h.objects&&(c.__r3f.objects=c.__r3f.objects.filter(_=>_!==d)),(p=d.__r3f)!=null&&p.attach)A$(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){var b;c.remove(d),(b=d.__r3f)!=null&&b.root&&QNe(f_(d),d)}const w=(g=d.__r3f)==null?void 0:g.primitive,x=!w&&(f===void 0?d.dispose!==null:f);if(!w){var m;o((m=d.__r3f)==null?void 0:m.objects,d,x),o(d.children,d,x)}if(delete d.__r3f,x&&d.dispose&&d.type!=="Scene"){const _=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?S$.unstable_scheduleCallback(S$.unstable_IdlePriority,_):_()}yp(c)}}function a(c,d,f,h){var p;const g=(p=c.__r3f)==null?void 0:p.parent;if(!g)return;const b=n(d,f,c.__r3f.root);if(c.children){for(const m of c.children)m.__r3f&&r(b,m);c.children=c.children.filter(m=>!m.__r3f)}c.__r3f.objects.forEach(m=>r(b,m)),c.__r3f.objects=[],c.__r3f.autoRemovedBeforeAppend||s(g,c),b.parent&&(b.__r3f.autoRemovedBeforeAppend=!0),r(g,b),b.raycast&&b.__r3f.eventCount&&f_(b).getState().internal.interaction.push(b),[h,h.alternate].forEach(m=>{m!==null&&(m.stateNode=b,m.ref&&(typeof m.ref=="function"?m.ref(b):m.ref.current=b))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:VNe({createInstance:n,removeChild:s,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(c,d)=>{if(!d)return;const f=c.getState().scene;f.__r3f&&(f.__r3f.root=c,r(f,d))},removeChildFromContainer:(c,d)=>{d&&s(c.getState().scene,d)},insertInContainerBefore:(c,d,f)=>{if(!d||!f)return;const h=c.getState().scene;h.__r3f&&i(h,d,f)},getRootHostContext:()=>null,getChildHostContext:c=>c,finalizeInitialChildren(c){var d;return!!((d=c==null?void 0:c.__r3f)!=null?d:{}).handlers},prepareUpdate(c,d,f,h){var p;if(((p=c==null?void 0:c.__r3f)!=null?p:{}).primitive&&h.object&&h.object!==c)return[!0];{const{args:b=[],children:m,...w}=h,{args:x=[],children:_,...C}=f;if(!Array.isArray(b))throw new Error("R3F: the args prop must be an array!");if(b.some((M,P)=>M!==x[P]))return[!0];const S=hK(c,w,C,!0);return S.changes.length?[!1,S]:null}},commitUpdate(c,[d,f],h,p,g,b){d?a(c,h,g,b):wA(c,f)},commitMount(c,d,f,h){var p;const g=(p=c.__r3f)!=null?p:{};c.raycast&&g.handlers&&g.eventCount&&f_(c).getState().internal.interaction.push(c)},getPublicInstance:c=>c,prepareForCommit:()=>null,preparePortalMount:c=>vp(c.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(c){var d;const{attach:f,parent:h}=(d=c.__r3f)!=null?d:{};f&&h&&A$(h,c,f),c.isObject3D&&(c.visible=!1),yp(c)},unhideInstance(c,d){var f;const{attach:h,parent:p}=(f=c.__r3f)!=null?f:{};h&&p&&xA(p,c,h),(c.isObject3D&&d.visible==null||d.visible)&&(c.visible=!0),yp(c)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():im.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&cr.fun(performance.now)?performance.now:cr.fun(Date.now)?Date.now:()=>0,scheduleTimeout:cr.fun(setTimeout)?setTimeout:void 0,cancelTimeout:cr.fun(clearTimeout)?clearTimeout:void 0}),applyProps:wA}}var C$,E$;const bA=t=>"colorSpace"in t||"outputColorSpace"in t,aK=()=>{var t;return(t=MF.ColorManagement)!=null?t:null},lK=t=>t&&t.isOrthographicCamera,jNe=t=>t&&t.hasOwnProperty("current"),Bb=typeof window<"u"&&((C$=window.document)!=null&&C$.createElement||((E$=window.navigator)==null?void 0:E$.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function uK(t){const e=E.useRef(t);return Bb(()=>void(e.current=t),[t]),e}function WNe({set:t}){return Bb(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class cK extends E.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}cK.getDerivedStateFromError=()=>({error:!0});const dK="__default",M$=new Map,qNe=t=>t&&!!t.memoized&&!!t.changes;function fK(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const A0=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()};function f_(t){let e=t.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const cr={obj:t=>t===Object(t)&&!cr.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(cr.str(t)||cr.num(t))return t===e;const o=cr.obj(t);if(o&&r==="reference")return t===e;const s=cr.arr(t);if(s&&n==="reference")return t===e;if((s||o)&&t===e)return!0;let a;for(a in t)if(!(a in e))return!1;if(o&&n==="shallow"&&r==="shallow"){for(a in i?e:t)if(!cr.equ(t[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:t)if(t[a]!==e[a])return!1;if(cr.und(a)){if(s&&t.length===0&&e.length===0||o&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function XNe(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function vp(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function ER(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((o,s)=>o[s],t),{target:n,key:i}}else return{target:n,key:e}}const T$=/-\d+$/;function xA(t,e,n){if(cr.str(n)){if(T$.test(n)){const o=n.replace(T$,""),{target:s,key:a}=ER(t,o);Array.isArray(s[a])||(s[a]=[])}const{target:r,key:i}=ER(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function A$(t,e,n){var r,i;if(cr.str(n)){const{target:o,key:s}=ER(t,n),a=e.__r3f.previousAttach;a===void 0?delete o[s]:o[s]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function hK(t,{children:e,key:n,ref:r,...i},{children:o,key:s,ref:a,...l}={},u=!1){var c;const d=(c=t==null?void 0:t.__r3f)!=null?c:{},f=Object.entries(i),h=[];if(u){const g=Object.keys(l);for(let b=0;b{var m;if((m=t.__r3f)!=null&&m.primitive&&g==="object"||cr.equ(b,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return h.push([g,b,!0,[]]);let w=[];g.includes("-")&&(w=g.split("-")),h.push([g,b,!1,w]);for(const x in i){const _=i[x];x.startsWith(`${g}-`)&&h.push([x,_,!1,x.split("-")])}});const p={...i};return d.memoizedProps&&d.memoizedProps.args&&(p.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(p.attach=d.memoizedProps.attach),{memoized:p,changes:h}}const KNe=typeof process<"u"&&!1;function wA(t,e){var n,r,i;const o=(n=t.__r3f)!=null?n:{},s=o.root,a=(r=s==null||s.getState==null?void 0:s.getState())!=null?r:{},{memoized:l,changes:u}=qNe(e)?e:hK(t,e),c=o.eventCount;t.__r3f&&(t.__r3f.memoizedProps=l);for(let f=0;fx[_],t),!(w&&w.set))){const[x,..._]=b.reverse();m=_.reverse().reduce((C,S)=>C[S],t),h=x}if(p===dK+"remove")if(m.constructor){let x=M$.get(m.constructor);x||(x=new m.constructor,M$.set(m.constructor,x)),p=x[h]}else p=0;if(g)p?o.handlers[h]=p:delete o.handlers[h],o.eventCount=Object.keys(o.handlers).length;else if(w&&w.set&&(w.copy||w instanceof Tf)){if(Array.isArray(p))w.fromArray?w.fromArray(p):w.set(...p);else if(w.copy&&p&&p.constructor&&(KNe?w.constructor.name===p.constructor.name:w.constructor===p.constructor))w.copy(p);else if(p!==void 0){const x=w instanceof vt;!x&&w.setScalar?w.setScalar(p):w instanceof Tf&&p instanceof Tf?w.mask=p.mask:w.set(p),!aK()&&!a.linear&&x&&w.convertSRGBToLinear()}}else if(m[h]=p,m[h]instanceof Lr&&m[h].format===Co&&m[h].type===Ds){const x=m[h];bA(x)&&bA(a.gl)?x.colorSpace=a.gl.outputColorSpace:x.encoding=a.gl.outputEncoding}yp(t)}if(o.parent&&t.raycast&&c!==o.eventCount){const f=f_(t).getState().internal,h=f.interaction.indexOf(t);h>-1&&f.interaction.splice(h,1),o.eventCount&&f.interaction.push(t)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(i=t.__r3f)!=null&&i.parent&&MR(t),t}function yp(t){var e,n;const r=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();r&&r.internal.frames===0&&r.invalidate()}function MR(t){t.onUpdate==null||t.onUpdate(t)}function YNe(t,e){t.manual||(lK(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function mw(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function ZNe(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return im.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return im.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return im.ContinuousEventPriority;default:return im.DefaultEventPriority}}function pK(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function QNe(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{pK(n.capturedMap,e,r,i)})}function JNe(t){function e(l){const{internal:u}=t.getState(),c=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(c*c+d*d))}function n(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(c=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+c]}))}function r(l,u){const c=t.getState(),d=new Set,f=[],h=u?u(c.internal.interaction):c.internal.interaction;for(let m=0;m{const x=A0(m.object),_=A0(w.object);return!x||!_?m.distance-w.distance:_.events.priority-x.events.priority||m.distance-w.distance}).filter(m=>{const w=mw(m);return d.has(w)?!1:(d.add(w),!0)});c.events.filter&&(g=c.events.filter(g,c));for(const m of g){let w=m.object;for(;w;){var b;(b=w.__r3f)!=null&&b.eventCount&&f.push({...m,eventObject:w}),w=w.parent}}if("pointerId"in l&&c.internal.capturedMap.has(l.pointerId))for(let m of c.internal.capturedMap.get(l.pointerId).values())d.has(mw(m.intersection))||f.push(m.intersection);return f}function i(l,u,c,d){const f=t.getState();if(l.length){const h={stopped:!1};for(const p of l){const g=A0(p.object)||f,{raycaster:b,pointer:m,camera:w,internal:x}=g,_=new oe(m.x,m.y,0).unproject(w),C=R=>{var F,$;return(F=($=x.capturedMap.get(R))==null?void 0:$.has(p.eventObject))!=null?F:!1},S=R=>{const F={intersection:p,target:u.target};x.capturedMap.has(R)?x.capturedMap.get(R).set(p.eventObject,F):x.capturedMap.set(R,new Map([[p.eventObject,F]])),u.target.setPointerCapture(R)},M=R=>{const F=x.capturedMap.get(R);F&&pK(x.capturedMap,p.eventObject,F,R)};let P={};for(let R in u){let F=u[R];typeof F!="function"&&(P[R]=F)}let A={...p,...P,pointer:m,intersections:l,stopped:h.stopped,delta:c,unprojectedPoint:_,ray:b.ray,camera:w,stopPropagation(){const R="pointerId"in u&&x.capturedMap.get(u.pointerId);if((!R||R.has(p.eventObject))&&(A.stopped=h.stopped=!0,x.hovered.size&&Array.from(x.hovered.values()).find(F=>F.eventObject===p.eventObject))){const F=l.slice(0,l.indexOf(p));o([...F,p])}},target:{hasPointerCapture:C,setPointerCapture:S,releasePointerCapture:M},currentTarget:{hasPointerCapture:C,setPointerCapture:S,releasePointerCapture:M},nativeEvent:u};if(d(A),h.stopped===!0)break}}return l}function o(l){const{internal:u}=t.getState();for(const c of u.hovered.values())if(!l.length||!l.find(d=>d.object===c.object&&d.index===c.index&&d.instanceId===c.instanceId)){const f=c.eventObject.__r3f,h=f==null?void 0:f.handlers;if(u.hovered.delete(mw(c)),f!=null&&f.eventCount){const p={...c,intersections:l};h.onPointerOut==null||h.onPointerOut(p),h.onPointerLeave==null||h.onPointerLeave(p)}}}function s(l,u){for(let c=0;co([]);case"onLostPointerCapture":return u=>{const{internal:c}=t.getState();"pointerId"in u&&c.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{c.capturedMap.has(u.pointerId)&&(c.capturedMap.delete(u.pointerId),o([]))})}}return function(c){const{onPointerMissed:d,internal:f}=t.getState();f.lastEvent.current=c;const h=l==="onPointerMove",p=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",b=r(c,h?n:void 0),m=p?e(c):0;l==="onPointerDown"&&(f.initialClick=[c.offsetX,c.offsetY],f.initialHits=b.map(x=>x.eventObject)),p&&!b.length&&m<=2&&(s(c,f.interaction),d&&d(c)),h&&o(b);function w(x){const _=x.eventObject,C=_.__r3f,S=C==null?void 0:C.handlers;if(C!=null&&C.eventCount)if(h){if(S.onPointerOver||S.onPointerEnter||S.onPointerOut||S.onPointerLeave){const M=mw(x),P=f.hovered.get(M);P?P.stopped&&x.stopPropagation():(f.hovered.set(M,x),S.onPointerOver==null||S.onPointerOver(x),S.onPointerEnter==null||S.onPointerEnter(x))}S.onPointerMove==null||S.onPointerMove(x)}else{const M=S[l];M?(!p||f.initialHits.includes(_))&&(s(c,f.interaction.filter(P=>!f.initialHits.includes(P))),M(x)):p&&f.initialHits.includes(_)&&s(c,f.interaction.filter(P=>!f.initialHits.includes(P)))}}i(b,c,m,w)}}return{handlePointer:a}}const mK=t=>!!(t!=null&&t.render),gK=E.createContext(null),eFe=(t,e)=>{const n=BNe((a,l)=>{const u=new oe,c=new oe,d=new oe;function f(m=l().camera,w=c,x=l().size){const{width:_,height:C,top:S,left:M}=x,P=_/C;w instanceof oe?d.copy(w):d.set(...w);const A=m.getWorldPosition(u).distanceTo(d);if(lK(m))return{width:_/m.zoom,height:C/m.zoom,top:S,left:M,factor:1,distance:A,aspect:P};{const R=m.fov*Math.PI/180,F=2*Math.tan(R/2)*A,$=F*(_/C);return{width:$,height:F,top:S,left:M,factor:_/$,distance:A,aspect:P}}}let h;const p=m=>a(w=>({performance:{...w.performance,current:m}})),g=new Xe;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>t(l(),m),advance:(m,w)=>e(m,w,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new _F,pointer:g,mouse:g,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();h&&clearTimeout(h),m.performance.current!==m.performance.min&&p(m.performance.min),h=setTimeout(()=>p(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:f},setEvents:m=>a(w=>({...w,events:{...w.events,...m}})),setSize:(m,w,x,_,C)=>{const S=l().camera,M={width:m,height:w,top:_||0,left:C||0,updateStyle:x};a(P=>({size:M,viewport:{...P.viewport,...f(S,c,M)}}))},setDpr:m=>a(w=>{const x=fK(m);return{viewport:{...w.viewport,dpr:x,initialDpr:w.viewport.initialDpr||x}}}),setFrameloop:(m="always")=>{const w=l().clock;w.stop(),w.elapsedTime=0,m!=="never"&&(w.start(),w.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:E.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,w,x)=>{const _=l().internal;return _.priority=_.priority+(w>0?1:0),_.subscribers.push({ref:m,priority:w,store:x}),_.subscribers=_.subscribers.sort((C,S)=>C.priority-S.priority),()=>{const C=l().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(w>0?1:0),C.subscribers=C.subscribers.filter(S=>S.ref!==m))}}}}}),r=n.getState();let i=r.size,o=r.viewport.dpr,s=r.camera;return n.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:c,set:d}=n.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==o){var f;i=l,o=u.dpr,YNe(a,l),c.setPixelRatio(u.dpr);const h=(f=l.updateStyle)!=null?f:typeof HTMLCanvasElement<"u"&&c.domElement instanceof HTMLCanvasElement;c.setSize(l.width,l.height,h)}a!==s&&(s=a,d(h=>({viewport:{...h.viewport,...h.viewport.getCurrentViewport(a)}})))}),n.subscribe(a=>t(a)),n};let gw,tFe=new Set,nFe=new Set,rFe=new Set;function _A(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function P0(t,e){switch(t){case"before":return _A(tFe,e);case"after":return _A(nFe,e);case"tail":return _A(rFe,e)}}let SA,CA;function EA(t,e,n){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),SA=e.internal.subscribers,gw=0;gw0)&&!((c=o.gl.xr)!=null&&c.isPresenting)&&(r+=EA(u,o))}if(n=!1,P0("after",u),r===0)return P0("tail",u),e=!1,cancelAnimationFrame(i)}function a(u,c=1){var d;if(!u)return t.forEach(f=>a(f.store.getState(),c));(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(c>1?u.internal.frames=Math.min(60,u.internal.frames+c):n?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(s)))}function l(u,c=!0,d,f){if(c&&P0("before",u),d)EA(u,d,f);else for(const h of t.values())EA(u,h.store.getState());c&&P0("after",u)}return{loop:s,invalidate:a,advance:l}}function vK(){const t=E.useContext(gK);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function Vi(t=n=>n,e){return vK()(t,e)}function TF(t,e=0){const n=vK(),r=n.getState().internal.subscribe,i=uK(t);return Bb(()=>r(i,e,n),[e,r,n]),null}const Jm=new Map,{invalidate:P$,advance:D$}=iFe(Jm),{reconciler:DS,applyProps:up}=GNe(Jm,ZNe),cp={objects:"shallow",strict:!1},oFe=(t,e)=>{const n=typeof t=="function"?t(e):t;return mK(n)?n:new oF({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function sFe(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:o,left:s,updateStyle:a=n}=e;return{width:r,height:i,top:o,left:s,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:o,left:s}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:o,left:s,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function aFe(t){const e=Jm.get(t),n=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,o=r||eFe(P$,D$),s=n||DS.createContainer(o,im.ConcurrentRoot,null,!1,null,"",i,null);e||Jm.set(t,{fiber:s,store:o});let a,l=!1,u;return{configure(c={}){let{gl:d,size:f,scene:h,events:p,onCreated:g,shadows:b=!1,linear:m=!1,flat:w=!1,legacy:x=!1,orthographic:_=!1,frameloop:C="always",dpr:S=[1,2],performance:M,raycaster:P,camera:A,onPointerMissed:R}=c,F=o.getState(),$=F.gl;F.gl||F.set({gl:$=oFe(d,t)});let j=F.raycaster;j||F.set({raycaster:j=new eK});const{params:k,...U}=P||{};if(cr.equ(U,j,cp)||up(j,{...U}),cr.equ(k,j.params,cp)||up(j,{params:{...j.params,...k}}),!F.camera||F.camera===u&&!cr.equ(u,A,cp)){u=A;const W=A instanceof Db,K=W?A:_?new Nb(0,0,0,0,.1,1e3):new Si(75,0,.1,1e3);W||(K.position.z=5,A&&up(K,A),!F.camera&&!(A!=null&&A.rotation)&&K.lookAt(0,0,0)),F.set({camera:K}),j.camera=K}if(!F.scene){let W;h instanceof AS?W=h:(W=new AS,h&&up(W,h)),F.set({scene:vp(W)})}if(!F.xr){var G;const W=(J,ae)=>{const ve=o.getState();ve.frameloop!=="never"&&D$(J,!0,ve,ae)},K=()=>{const J=o.getState();J.gl.xr.enabled=J.gl.xr.isPresenting,J.gl.xr.setAnimationLoop(J.gl.xr.isPresenting?W:null),J.gl.xr.isPresenting||P$(J)},Q={connect(){const J=o.getState().gl;J.xr.addEventListener("sessionstart",K),J.xr.addEventListener("sessionend",K)},disconnect(){const J=o.getState().gl;J.xr.removeEventListener("sessionstart",K),J.xr.removeEventListener("sessionend",K)}};typeof((G=$.xr)==null?void 0:G.addEventListener)=="function"&&Q.connect(),F.set({xr:Q})}if($.shadowMap){const W=$.shadowMap.enabled,K=$.shadowMap.type;if($.shadowMap.enabled=!!b,cr.boo(b))$.shadowMap.type=_v;else if(cr.str(b)){var B;const Q={basic:jW,percentage:ME,soft:_v,variance:Ia};$.shadowMap.type=(B=Q[b])!=null?B:_v}else cr.obj(b)&&Object.assign($.shadowMap,b);(W!==$.shadowMap.enabled||K!==$.shadowMap.type)&&($.shadowMap.needsUpdate=!0)}const L=aK();L&&("enabled"in L?L.enabled=!x:"legacyMode"in L&&(L.legacyMode=x)),l||up($,{outputEncoding:m?3e3:3001,toneMapping:w?Nl:zN}),F.legacy!==x&&F.set(()=>({legacy:x})),F.linear!==m&&F.set(()=>({linear:m})),F.flat!==w&&F.set(()=>({flat:w})),d&&!cr.fun(d)&&!mK(d)&&!cr.equ(d,$,cp)&&up($,d),p&&!F.events.handlers&&F.set({events:p(o)});const N=sFe(t,f);return cr.equ(N,F.size,cp)||F.setSize(N.width,N.height,N.updateStyle,N.top,N.left),S&&F.viewport.dpr!==fK(S)&&F.setDpr(S),F.frameloop!==C&&F.setFrameloop(C),F.onPointerMissed||F.set({onPointerMissed:R}),M&&!cr.equ(M,F.performance,cp)&&F.set(W=>({performance:{...W.performance,...M}})),a=g,l=!0,this},render(c){return l||this.configure(),DS.updateContainer(E.createElement(lFe,{store:o,children:c,onCreated:a,rootElement:t}),s,null,()=>{}),o},unmount(){yK(t)}}}function lFe({store:t,children:e,onCreated:n,rootElement:r}){return Bb(()=>{const i=t.getState();i.set(o=>({internal:{...o.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),E.createElement(gK.Provider,{value:t},e)}function yK(t,e){const n=Jm.get(t),r=n==null?void 0:n.fiber;if(r){const i=n==null?void 0:n.store.getState();i&&(i.internal.active=!1),DS.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var o,s,a,l;i.events.disconnect==null||i.events.disconnect(),(o=i.gl)==null||(s=o.renderLists)==null||s.dispose==null||s.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),XNe(i),Jm.delete(t)}catch{}},500)})}}DS.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:E.version});function TR(t,e,n){var r,i,o,s,a;e==null&&(e=100);function l(){var c=Date.now()-s;c=0?r=setTimeout(l,e-c):(r=null,n||(a=t.apply(o,i),o=i=null))}var u=function(){o=this,i=arguments,s=Date.now();var c=n&&!r;return r||(r=setTimeout(l,e)),c&&(a=t.apply(o,i),o=i=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},u}TR.debounce=TR;var uFe=TR;const R$=ya(uFe);function cFe(t){let{debounce:e,scroll:n,polyfill:r,offsetSize:i}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const o=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!o)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=E.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=E.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),u=e?typeof e=="number"?e:e.scroll:null,c=e?typeof e=="number"?e:e.resize:null,d=E.useRef(!1);E.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,h,p]=E.useMemo(()=>{const w=()=>{if(!l.current.element)return;const{left:x,top:_,width:C,height:S,bottom:M,right:P,x:A,y:R}=l.current.element.getBoundingClientRect(),F={left:x,top:_,width:C,height:S,bottom:M,right:P,x:A,y:R};l.current.element instanceof HTMLElement&&i&&(F.height=l.current.element.offsetHeight,F.width=l.current.element.offsetWidth),Object.freeze(F),d.current&&!pFe(l.current.lastBounds,F)&&a(l.current.lastBounds=F)};return[w,c?R$(w,c):w,u?R$(w,u):w]},[a,i,u,c]);function g(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",p,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function b(){l.current.element&&(l.current.resizeObserver=new o(p),l.current.resizeObserver.observe(l.current.element),n&&l.current.scrollContainers&&l.current.scrollContainers.forEach(w=>w.addEventListener("scroll",p,{capture:!0,passive:!0})))}const m=w=>{!w||w===l.current.element||(g(),l.current.element=w,l.current.scrollContainers=bK(w),b())};return fFe(p,!!n),dFe(h),E.useEffect(()=>{g(),b()},[n,p,h]),E.useEffect(()=>g,[]),[m,s,f]}function dFe(t){E.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function fFe(t,e){E.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function bK(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(o=>o==="auto"||o==="scroll")&&e.push(t),[...e,...bK(t.parentElement)]}const hFe=["x","y","top","bottom","left","right","width","height"],pFe=(t,e)=>hFe.every(n=>t[n]===e[n]);var mFe=Object.defineProperty,gFe=Object.defineProperties,vFe=Object.getOwnPropertyDescriptors,I$=Object.getOwnPropertySymbols,yFe=Object.prototype.hasOwnProperty,bFe=Object.prototype.propertyIsEnumerable,N$=(t,e,n)=>e in t?mFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,F$=(t,e)=>{for(var n in e||(e={}))yFe.call(e,n)&&N$(t,n,e[n]);if(I$)for(var n of I$(e))bFe.call(e,n)&&N$(t,n,e[n]);return t},xFe=(t,e)=>gFe(t,vFe(e)),O$,k$;typeof window<"u"&&((O$=window.document)!=null&&O$.createElement||((k$=window.navigator)==null?void 0:k$.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function xK(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=xK(r,e,n);if(i)return i;r=r.sibling}}function wK(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const L$=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=L$;return}return L$.apply(this,arguments)};const AF=wK(E.createContext(null));class _K extends E.Component{render(){return E.createElement(AF.Provider,{value:this._reactInternals},this.props.children)}}function wFe(){const t=E.useContext(AF);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=E.useId();return E.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=xK(r,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}function _Fe(){const t=wFe(),[e]=E.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==AF&&!e.has(i)&&e.set(i,E.useContext(wK(i)))}n=n.return}return e}function SFe(){const t=_Fe();return E.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>E.createElement(e,null,E.createElement(n.Provider,xFe(F$({},r),{value:t.get(n)}))),e=>E.createElement(_K,F$({},e))),[t])}const MA={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function CFe(t){const{handlePointer:e}=JNe(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(MA).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{var r;const{set:i,events:o}=t.getState();o.disconnect==null||o.disconnect(),i(s=>({events:{...s.events,connected:n}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([s,a])=>{const[l,u]=MA[s];n.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,s])=>{if(r&&r.connected instanceof HTMLElement){const[a]=MA[o];r.connected.removeEventListener(a,s)}}),n(o=>({events:{...o.events,connected:void 0}}))}}}}const EFe=E.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:o,events:s=CFe,eventSource:a,eventPrefix:l,shadows:u,linear:c,flat:d,legacy:f,orthographic:h,frameloop:p,dpr:g,performance:b,raycaster:m,camera:w,scene:x,onPointerMissed:_,onCreated:C,...S},M){E.useMemo(()=>sK(ONe),[]);const P=SFe(),[A,R]=cFe({scroll:!0,debounce:{scroll:50,resize:0},...r}),F=E.useRef(null),$=E.useRef(null);E.useImperativeHandle(M,()=>F.current);const j=uK(_),[k,U]=E.useState(!1),[G,B]=E.useState(!1);if(k)throw k;if(G)throw G;const L=E.useRef(null);Bb(()=>{const W=F.current;R.width>0&&R.height>0&&W&&(L.current||(L.current=aFe(W)),L.current.configure({gl:o,events:s,shadows:u,linear:c,flat:d,legacy:f,orthographic:h,frameloop:p,dpr:g,performance:b,raycaster:m,camera:w,scene:x,size:R,onPointerMissed:(...K)=>j.current==null?void 0:j.current(...K),onCreated:K=>{K.events.connect==null||K.events.connect(a?jNe(a)?a.current:a:$.current),l&&K.setEvents({compute:(Q,J)=>{const ae=Q[l+"X"],ve=Q[l+"Y"];J.pointer.set(ae/J.size.width*2-1,-(ve/J.size.height)*2+1),J.raycaster.setFromCamera(J.pointer,J.camera)}}),C==null||C(K)}}),L.current.render(E.createElement(P,null,E.createElement(cK,{set:B},E.createElement(E.Suspense,{fallback:E.createElement(WNe,{set:U})},e)))))}),E.useEffect(()=>{const W=F.current;if(W)return()=>yK(W)},[]);const N=a?"none":"auto";return E.createElement("div",O({ref:$,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...i}},S),E.createElement("div",{ref:A,style:{width:"100%",height:"100%"}},E.createElement("canvas",{ref:F,style:{display:"block"}},n)))}),MFe=E.forwardRef(function(e,n){return E.createElement(_K,null,E.createElement(EFe,O({},e,{ref:n})))});function JE(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Sg(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $b(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Td(){}var Wf=.7,eg=1/Wf,_m="\\s*([+-]?\\d+)\\s*",By="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ol="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TFe=/^#([0-9a-f]{3,8})$/,AFe=new RegExp(`^rgb\\(${_m},${_m},${_m}\\)$`),PFe=new RegExp(`^rgb\\(${Ol},${Ol},${Ol}\\)$`),DFe=new RegExp(`^rgba\\(${_m},${_m},${_m},${By}\\)$`),RFe=new RegExp(`^rgba\\(${Ol},${Ol},${Ol},${By}\\)$`),IFe=new RegExp(`^hsl\\(${By},${Ol},${Ol}\\)$`),NFe=new RegExp(`^hsla\\(${By},${Ol},${Ol},${By}\\)$`),B$={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Sg(Td,$y,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$$,formatHex:$$,formatHex8:FFe,formatHsl:OFe,formatRgb:z$,toString:z$});function $$(){return this.rgb().formatHex()}function FFe(){return this.rgb().formatHex8()}function OFe(){return SK(this).formatHsl()}function z$(){return this.rgb().formatRgb()}function $y(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=TFe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?U$(e):n===3?new Ei(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?vw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?vw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=AFe.exec(t))?new Ei(e[1],e[2],e[3],1):(e=PFe.exec(t))?new Ei(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=DFe.exec(t))?vw(e[1],e[2],e[3],e[4]):(e=RFe.exec(t))?vw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=IFe.exec(t))?G$(e[1],e[2]/100,e[3]/100,1):(e=NFe.exec(t))?G$(e[1],e[2]/100,e[3]/100,e[4]):B$.hasOwnProperty(t)?U$(B$[t]):t==="transparent"?new Ei(NaN,NaN,NaN,0):null}function U$(t){return new Ei(t>>16&255,t>>8&255,t&255,1)}function vw(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ei(t,e,n,r)}function PF(t){return t instanceof Td||(t=$y(t)),t?(t=t.rgb(),new Ei(t.r,t.g,t.b,t.opacity)):new Ei}function cd(t,e,n,r){return arguments.length===1?PF(t):new Ei(t,e,n,r??1)}function Ei(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Sg(Ei,cd,$b(Td,{brighter(t){return t=t==null?eg:Math.pow(eg,t),new Ei(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wf:Math.pow(Wf,t),new Ei(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ei(Pf(this.r),Pf(this.g),Pf(this.b),RS(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:H$,formatHex:H$,formatHex8:kFe,formatRgb:V$,toString:V$}));function H$(){return`#${vf(this.r)}${vf(this.g)}${vf(this.b)}`}function kFe(){return`#${vf(this.r)}${vf(this.g)}${vf(this.b)}${vf((isNaN(this.opacity)?1:this.opacity)*255)}`}function V$(){const t=RS(this.opacity);return`${t===1?"rgb(":"rgba("}${Pf(this.r)}, ${Pf(this.g)}, ${Pf(this.b)}${t===1?")":`, ${t})`}`}function RS(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vf(t){return t=Pf(t),(t<16?"0":"")+t.toString(16)}function G$(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $a(t,e,n,r)}function SK(t){if(t instanceof $a)return new $a(t.h,t.s,t.l,t.opacity);if(t instanceof Td||(t=$y(t)),!t)return new $a;if(t instanceof $a)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new $a(s,a,l,t.opacity)}function IS(t,e,n,r){return arguments.length===1?SK(t):new $a(t,e,n,r??1)}function $a(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Sg($a,IS,$b(Td,{brighter(t){return t=t==null?eg:Math.pow(eg,t),new $a(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wf:Math.pow(Wf,t),new $a(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ei(TA(t>=240?t-240:t+120,i,r),TA(t,i,r),TA(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new $a(j$(this.h),yw(this.s),yw(this.l),RS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=RS(this.opacity);return`${t===1?"hsl(":"hsla("}${j$(this.h)}, ${yw(this.s)*100}%, ${yw(this.l)*100}%${t===1?")":`, ${t})`}`}}));function j$(t){return t=(t||0)%360,t<0?t+360:t}function yw(t){return Math.max(0,Math.min(1,t||0))}function TA(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const CK=Math.PI/180,EK=180/Math.PI,NS=18,MK=.96422,TK=1,AK=.82521,PK=4/29,Sm=6/29,DK=3*Sm*Sm,LFe=Sm*Sm*Sm;function RK(t){if(t instanceof kl)return new kl(t.l,t.a,t.b,t.opacity);if(t instanceof Pu)return IK(t);t instanceof Ei||(t=PF(t));var e=RA(t.r),n=RA(t.g),r=RA(t.b),i=AA((.2225045*e+.7168786*n+.0606169*r)/TK),o,s;return e===n&&n===r?o=s=i:(o=AA((.4360747*e+.3850649*n+.1430804*r)/MK),s=AA((.0139322*e+.0971045*n+.7141733*r)/AK)),new kl(116*i-16,500*(o-i),200*(i-s),t.opacity)}function AR(t,e,n,r){return arguments.length===1?RK(t):new kl(t,e,n,r??1)}function kl(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Sg(kl,AR,$b(Td,{brighter(t){return new kl(this.l+NS*(t??1),this.a,this.b,this.opacity)},darker(t){return new kl(this.l-NS*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=MK*PA(e),t=TK*PA(t),n=AK*PA(n),new Ei(DA(3.1338561*e-1.6168667*t-.4906146*n),DA(-.9787684*e+1.9161415*t+.033454*n),DA(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function AA(t){return t>LFe?Math.pow(t,1/3):t/DK+PK}function PA(t){return t>Sm?t*t*t:DK*(t-PK)}function DA(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function RA(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function BFe(t){if(t instanceof Pu)return new Pu(t.h,t.c,t.l,t.opacity);if(t instanceof kl||(t=RK(t)),t.a===0&&t.b===0)return new Pu(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function FK(t,e){return function(n){return t+n*e}}function HFe(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function IF(t,e){var n=e-t;return n?FK(t,n>180||n<-180?n-360*Math.round(n/360):n):tM(isNaN(t)?e:t)}function VFe(t){return(t=+t)==1?Mi:function(e,n){return n-e?HFe(e,n,t):tM(isNaN(e)?n:e)}}function Mi(t,e){var n=e-t;return n?FK(t,n):tM(isNaN(t)?e:t)}const DR=function t(e){var n=VFe(e);function r(i,o){var s=n((i=cd(i)).r,(o=cd(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=Mi(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=t,r}(1);function GFe(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:tg(r,i)})),n=IA.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function uOe(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?cOe:uOe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=a(t.map(r),e,n)))(r(s(f)))}return d.invert=function(f){return s(i((u||(u=a(e,t.map(r),tg)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,aOe),c()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),c()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=FF,c()},d.clamp=function(f){return arguments.length?(s=f?!0:Al,c()):s!==Al},d.interpolate=function(f){return arguments.length?(n=f,c()):n},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,h){return r=f,i=h,c()}}function dOe(){return iM()(Al,Al)}function fOe(t,e,n,r){var i=BW(t,e,n),o;switch(r=my(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=R2e(i,s))&&(r.precision=o),UW(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=I2e(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=D2e(i))&&(r.precision=o-(r.type==="%")*2);break}}return Yl(r)}function OF(t){var e=t.domain;return t.ticks=function(n){var r=e();return FD(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return fOe(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,s=r[i],a=r[o],l,u,c=10;for(a0;){if(u=OD(s,a,n),u===l)return r[i]=s,r[o]=a,e(r);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return t},t}function BK(){var t=dOe();return t.copy=function(){return rM(t,BK())},JE.apply(t,arguments),OF(t)}function hOe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function yOe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Q$(t){return(e,n)=>-t(-e,n)}function bOe(t){const e=t(Y$,Z$),n=e.domain;let r=10,i,o;function s(){return i=yOe(r),o=vOe(r),n()[0]<0?(i=Q$(i),o=Q$(o),t(pOe,mOe)):t(Y$,Z$),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const d=c0){for(;f<=h;++f)for(p=1;pc)break;m.push(g)}}else for(;f<=h;++f)for(p=r-1;p>=1;--p)if(g=f>0?p/o(-f):p*o(f),!(gc)break;m.push(g)}m.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=my(l)).precision==null&&(l.trim=!0),l=Yl(l)),a===1/0)return l;const u=Math.max(1,r*a/e.ticks().length);return c=>{let d=c/o(Math.round(i(c)));return d*rn(hOe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function $K(){const t=bOe(iM()).domain([1,10]);return t.copy=()=>rM(t,$K()).base(t.base()),JE.apply(t,arguments),t}function J$(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function ez(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function xOe(t){var e=1,n=t(J$(e),ez(e));return n.constant=function(r){return arguments.length?t(J$(e=+r),ez(e)):e},OF(n)}function zK(){var t=xOe(iM());return t.copy=function(){return rM(t,zK()).constant(t.constant())},JE.apply(t,arguments)}function tz(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function wOe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function _Oe(t){return t<0?-t*t:t*t}function SOe(t){var e=t(Al,Al),n=1;function r(){return n===1?t(Al,Al):n===.5?t(wOe,_Oe):t(tz(n),tz(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},OF(e)}function kF(){var t=SOe(iM());return t.copy=function(){return rM(t,kF()).exponent(t.exponent())},JE.apply(t,arguments),t}function COe(){return kF.apply(null,arguments).exponent(.5)}const NA=new Date,FA=new Date;function Wi(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let u;do l.push(u=new Date(+o)),e(o,a),t(o);while(uWi(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>(NA.setTime(+o),FA.setTime(+s),t(NA),t(FA),Math.floor(n(NA,FA))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Uy=1e3,dd=Uy*60,Hy=dd*60,Vy=Hy*24,UK=Vy*7,LF=Wi(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Uy)},(t,e)=>(e-t)/Uy,t=>t.getUTCSeconds());LF.range;const HK=Wi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Uy)},(t,e)=>{t.setTime(+t+e*dd)},(t,e)=>(e-t)/dd,t=>t.getMinutes());HK.range;const VK=Wi(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*dd)},(t,e)=>(e-t)/dd,t=>t.getUTCMinutes());VK.range;const GK=Wi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Uy-t.getMinutes()*dd)},(t,e)=>{t.setTime(+t+e*Hy)},(t,e)=>(e-t)/Hy,t=>t.getHours());GK.range;const jK=Wi(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Hy)},(t,e)=>(e-t)/Hy,t=>t.getUTCHours());jK.range;const WK=Wi(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*dd)/Vy,t=>t.getDate()-1);WK.range;const qK=Wi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Vy,t=>t.getUTCDate()-1);qK.range;const EOe=Wi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Vy,t=>Math.floor(t/Vy));EOe.range;function lh(t){return Wi(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*dd)/UK)}const XK=lh(0),MOe=lh(1),TOe=lh(2),AOe=lh(3),POe=lh(4),DOe=lh(5),ROe=lh(6);XK.range;MOe.range;TOe.range;AOe.range;POe.range;DOe.range;ROe.range;function uh(t){return Wi(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/UK)}const KK=uh(0),IOe=uh(1),NOe=uh(2),FOe=uh(3),OOe=uh(4),kOe=uh(5),LOe=uh(6);KK.range;IOe.range;NOe.range;FOe.range;OOe.range;kOe.range;LOe.range;const YK=Wi(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());YK.range;const ZK=Wi(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());ZK.range;const BF=Wi(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());BF.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wi(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});BF.range;const $F=Wi(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());$F.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wi(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});$F.range;function BOe(t,e){e.domain&&("nice"in t||"quantiles"in t||"padding"in t,t.domain(e.domain))}function $Oe(t,e){e.range&&("padding"in t,t.range(e.range))}function zOe(t,e){"align"in t&&"align"in e&&typeof e.align<"u"&&t.align(e.align)}function UOe(t,e){"base"in t&&"base"in e&&typeof e.base<"u"&&t.base(e.base)}function HOe(t,e){"clamp"in t&&"clamp"in e&&typeof e.clamp<"u"&&t.clamp(e.clamp)}function VOe(t,e){"constant"in t&&"constant"in e&&typeof e.constant<"u"&&t.constant(e.constant)}function GOe(t,e){"exponent"in t&&"exponent"in e&&typeof e.exponent<"u"&&t.exponent(e.exponent)}var nz={lab:nOe,hcl:rOe,"hcl-long":iOe,hsl:eOe,"hsl-long":tOe,cubehelix:oOe,"cubehelix-long":nM,rgb:DR};function jOe(t){switch(t){case"lab":case"hcl":case"hcl-long":case"hsl":case"hsl-long":case"cubehelix":case"cubehelix-long":case"rgb":return nz[t]}var e=t.type,n=t.gamma,r=nz[e];return typeof n>"u"?r:r.gamma(n)}function WOe(t,e){if("interpolate"in e&&"interpolate"in t&&typeof e.interpolate<"u"){var n=jOe(e.interpolate);t.interpolate(n)}}var qOe=new Date(Date.UTC(2020,1,2,3,4,5)),XOe="%Y-%m-%d %H:%M";function KOe(t){var e=t.tickFormat(1,XOe)(qOe);return e==="2020-02-02 03:04"}var rz={day:WK,hour:GK,minute:HK,month:YK,second:LF,week:XK,year:BF},iz={day:qK,hour:jK,minute:VK,month:ZK,second:LF,week:KK,year:$F};function YOe(t,e){if("nice"in e&&typeof e.nice<"u"&&"nice"in t){var n=e.nice;if(typeof n=="boolean")n&&t.nice();else if(typeof n=="number")t.nice(n);else{var r=t,i=KOe(r);if(typeof n=="string")r.nice(i?iz[n]:rz[n]);else{var o=n.interval,s=n.step,a=(i?iz[o]:rz[o]).every(s);a!=null&&r.nice(a)}}}}function ZOe(t,e){"padding"in t&&"padding"in e&&typeof e.padding<"u"&&t.padding(e.padding),"paddingInner"in t&&"paddingInner"in e&&typeof e.paddingInner<"u"&&t.paddingInner(e.paddingInner),"paddingOuter"in t&&"paddingOuter"in e&&typeof e.paddingOuter<"u"&&t.paddingOuter(e.paddingOuter)}function QOe(t,e){if(e.reverse){var n=t.range().slice().reverse();"padding"in t,t.range(n)}}function JOe(t,e){"round"in e&&typeof e.round<"u"&&(e.round&&"interpolate"in e&&typeof e.interpolate<"u"?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",e):"round"in t?t.round(e.round):"interpolate"in t&&e.round&&t.interpolate(FF))}function eke(t,e){"unknown"in t&&"unknown"in e&&typeof e.unknown<"u"&&t.unknown(e.unknown)}function tke(t,e){if("zero"in e&&e.zero===!0){var n=t.domain(),r=n[0],i=n[1],o=i>>1,Q=L[K];if(0>>1;Ki(ve,W))fei(Me,ve)?(L[K]=Me,L[fe]=W,K=fe):(L[K]=ve,L[ae]=W,K=ae);else if(fei(Me,W))L[K]=Me,L[fe]=W,K=fe;else break e}}return N}function i(L,N){var W=L.sortIndex-N.sortIndex;return W!==0?W:L.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(L){for(var N=n(u);N!==null;){if(N.callback===null)r(u);else if(N.startTime<=L)r(u),N.sortIndex=N.expirationTime,e(l,N);else break;N=n(u)}}function _(L){if(g=!1,x(L),!p)if(n(l)!==null)p=!0,G(C);else{var N=n(u);N!==null&&B(_,N.startTime-L)}}function C(L,N){p=!1,g&&(g=!1,m(P),P=-1),h=!0;var W=f;try{for(x(N),d=n(l);d!==null&&(!(d.expirationTime>N)||L&&!F());){var K=d.callback;if(typeof K=="function"){d.callback=null,f=d.priorityLevel;var Q=K(d.expirationTime<=N);N=t.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(l)&&r(l),x(N)}else r(l);d=n(l)}if(d!==null)var J=!0;else{var ae=n(u);ae!==null&&B(_,ae.startTime-N),J=!1}return J}finally{d=null,f=W,h=!1}}var S=!1,M=null,P=-1,A=5,R=-1;function F(){return!(t.unstable_now()-RL||125K?(L.sortIndex=W,e(u,L),n(l)===null&&L===n(u)&&(g?(m(P),P=-1):g=!0,B(_,W-K))):(L.sortIndex=Q,e(l,L),p||h||(p=!0,G(C))),L},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(L){var N=f;return function(){var W=f;f=N;try{return L.apply(this,arguments)}finally{f=W}}}})(oK);iK.exports=oK;var S$=iK.exports;const MF={},sK=t=>void Object.assign(MF,t);function GNe(t,e){function n(c,{args:d=[],attach:f,...h},p){let g=`${c[0].toUpperCase()}${c.slice(1)}`,b;if(c==="primitive"){if(h.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=h.object;b=vp(m,{type:c,root:p,attach:f,primitive:!0})}else{const m=MF[g];if(!m)throw new Error(`R3F: ${g} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");b=vp(new m(...d),{type:c,root:p,attach:f,memoizedProps:{args:d}})}return b.__r3f.attach===void 0&&(b instanceof rn?b.__r3f.attach="geometry":b instanceof ji&&(b.__r3f.attach="material")),g!=="inject"&&wA(b,h),b}function r(c,d){let f=!1;if(d){var h,p;(h=d.__r3f)!=null&&h.attach?xA(c,d,d.__r3f.attach):d.isObject3D&&c.isObject3D&&(c.add(d),f=!0),f||(p=c.__r3f)==null||p.objects.push(d),d.__r3f||vp(d,{}),d.__r3f.parent=c,MR(d),yp(d)}}function i(c,d,f){let h=!1;if(d){var p,g;if((p=d.__r3f)!=null&&p.attach)xA(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){d.parent=c,d.dispatchEvent({type:"added"}),c.dispatchEvent({type:"childadded",child:d});const b=c.children.filter(w=>w!==d),m=b.indexOf(f);c.children=[...b.slice(0,m),d,...b.slice(m)],h=!0}h||(g=c.__r3f)==null||g.objects.push(d),d.__r3f||vp(d,{}),d.__r3f.parent=c,MR(d),yp(d)}}function o(c,d,f=!1){c&&[...c].forEach(h=>s(d,h,f))}function s(c,d,f){if(d){var h,p,g;if(d.__r3f&&(d.__r3f.parent=null),(h=c.__r3f)!=null&&h.objects&&(c.__r3f.objects=c.__r3f.objects.filter(_=>_!==d)),(p=d.__r3f)!=null&&p.attach)A$(c,d,d.__r3f.attach);else if(d.isObject3D&&c.isObject3D){var b;c.remove(d),(b=d.__r3f)!=null&&b.root&&QNe(f_(d),d)}const w=(g=d.__r3f)==null?void 0:g.primitive,x=!w&&(f===void 0?d.dispose!==null:f);if(!w){var m;o((m=d.__r3f)==null?void 0:m.objects,d,x),o(d.children,d,x)}if(delete d.__r3f,x&&d.dispose&&d.type!=="Scene"){const _=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?S$.unstable_scheduleCallback(S$.unstable_IdlePriority,_):_()}yp(c)}}function a(c,d,f,h){var p;const g=(p=c.__r3f)==null?void 0:p.parent;if(!g)return;const b=n(d,f,c.__r3f.root);if(c.children){for(const m of c.children)m.__r3f&&r(b,m);c.children=c.children.filter(m=>!m.__r3f)}c.__r3f.objects.forEach(m=>r(b,m)),c.__r3f.objects=[],c.__r3f.autoRemovedBeforeAppend||s(g,c),b.parent&&(b.__r3f.autoRemovedBeforeAppend=!0),r(g,b),b.raycast&&b.__r3f.eventCount&&f_(b).getState().internal.interaction.push(b),[h,h.alternate].forEach(m=>{m!==null&&(m.stateNode=b,m.ref&&(typeof m.ref=="function"?m.ref(b):m.ref.current=b))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:VNe({createInstance:n,removeChild:s,appendChild:r,appendInitialChild:r,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(c,d)=>{if(!d)return;const f=c.getState().scene;f.__r3f&&(f.__r3f.root=c,r(f,d))},removeChildFromContainer:(c,d)=>{d&&s(c.getState().scene,d)},insertInContainerBefore:(c,d,f)=>{if(!d||!f)return;const h=c.getState().scene;h.__r3f&&i(h,d,f)},getRootHostContext:()=>null,getChildHostContext:c=>c,finalizeInitialChildren(c){var d;return!!((d=c==null?void 0:c.__r3f)!=null?d:{}).handlers},prepareUpdate(c,d,f,h){var p;if(((p=c==null?void 0:c.__r3f)!=null?p:{}).primitive&&h.object&&h.object!==c)return[!0];{const{args:b=[],children:m,...w}=h,{args:x=[],children:_,...C}=f;if(!Array.isArray(b))throw new Error("R3F: the args prop must be an array!");if(b.some((M,P)=>M!==x[P]))return[!0];const S=hK(c,w,C,!0);return S.changes.length?[!1,S]:null}},commitUpdate(c,[d,f],h,p,g,b){d?a(c,h,g,b):wA(c,f)},commitMount(c,d,f,h){var p;const g=(p=c.__r3f)!=null?p:{};c.raycast&&g.handlers&&g.eventCount&&f_(c).getState().internal.interaction.push(c)},getPublicInstance:c=>c,prepareForCommit:()=>null,preparePortalMount:c=>vp(c.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(c){var d;const{attach:f,parent:h}=(d=c.__r3f)!=null?d:{};f&&h&&A$(h,c,f),c.isObject3D&&(c.visible=!1),yp(c)},unhideInstance(c,d){var f;const{attach:h,parent:p}=(f=c.__r3f)!=null?f:{};h&&p&&xA(p,c,h),(c.isObject3D&&d.visible==null||d.visible)&&(c.visible=!0),yp(c)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():im.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&cr.fun(performance.now)?performance.now:cr.fun(Date.now)?Date.now:()=>0,scheduleTimeout:cr.fun(setTimeout)?setTimeout:void 0,cancelTimeout:cr.fun(clearTimeout)?clearTimeout:void 0}),applyProps:wA}}var C$,E$;const bA=t=>"colorSpace"in t||"outputColorSpace"in t,aK=()=>{var t;return(t=MF.ColorManagement)!=null?t:null},lK=t=>t&&t.isOrthographicCamera,jNe=t=>t&&t.hasOwnProperty("current"),Bb=typeof window<"u"&&((C$=window.document)!=null&&C$.createElement||((E$=window.navigator)==null?void 0:E$.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function uK(t){const e=E.useRef(t);return Bb(()=>void(e.current=t),[t]),e}function WNe({set:t}){return Bb(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}class cK extends E.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}cK.getDerivedStateFromError=()=>({error:!0});const dK="__default",M$=new Map,qNe=t=>t&&!!t.memoized&&!!t.changes;function fK(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}const A0=t=>{var e;return(e=t.__r3f)==null?void 0:e.root.getState()};function f_(t){let e=t.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const cr={obj:t=>t===Object(t)&&!cr.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:r="reference",strict:i=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(cr.str(t)||cr.num(t))return t===e;const o=cr.obj(t);if(o&&r==="reference")return t===e;const s=cr.arr(t);if(s&&n==="reference")return t===e;if((s||o)&&t===e)return!0;let a;for(a in t)if(!(a in e))return!1;if(o&&n==="shallow"&&r==="shallow"){for(a in i?e:t)if(!cr.equ(t[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:t)if(t[a]!==e[a])return!1;if(cr.und(a)){if(s&&t.length===0&&e.length===0||o&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function XNe(t){t.dispose&&t.type!=="Scene"&&t.dispose();for(const e in t)e.dispose==null||e.dispose(),delete t[e]}function vp(t,e){const n=t;return n.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},t}function ER(t,e){let n=t;if(e.includes("-")){const r=e.split("-"),i=r.pop();return n=r.reduce((o,s)=>o[s],t),{target:n,key:i}}else return{target:n,key:e}}const T$=/-\d+$/;function xA(t,e,n){if(cr.str(n)){if(T$.test(n)){const o=n.replace(T$,""),{target:s,key:a}=ER(t,o);Array.isArray(s[a])||(s[a]=[])}const{target:r,key:i}=ER(t,n);e.__r3f.previousAttach=r[i],r[i]=e}else e.__r3f.previousAttach=n(t,e)}function A$(t,e,n){var r,i;if(cr.str(n)){const{target:o,key:s}=ER(t,n),a=e.__r3f.previousAttach;a===void 0?delete o[s]:o[s]=a}else(r=e.__r3f)==null||r.previousAttach==null||r.previousAttach(t,e);(i=e.__r3f)==null||delete i.previousAttach}function hK(t,{children:e,key:n,ref:r,...i},{children:o,key:s,ref:a,...l}={},u=!1){var c;const d=(c=t==null?void 0:t.__r3f)!=null?c:{},f=Object.entries(i),h=[];if(u){const g=Object.keys(l);for(let b=0;b{var m;if((m=t.__r3f)!=null&&m.primitive&&g==="object"||cr.equ(b,l[g]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(g))return h.push([g,b,!0,[]]);let w=[];g.includes("-")&&(w=g.split("-")),h.push([g,b,!1,w]);for(const x in i){const _=i[x];x.startsWith(`${g}-`)&&h.push([x,_,!1,x.split("-")])}});const p={...i};return d.memoizedProps&&d.memoizedProps.args&&(p.args=d.memoizedProps.args),d.memoizedProps&&d.memoizedProps.attach&&(p.attach=d.memoizedProps.attach),{memoized:p,changes:h}}const KNe=typeof process<"u"&&!1;function wA(t,e){var n,r,i;const o=(n=t.__r3f)!=null?n:{},s=o.root,a=(r=s==null||s.getState==null?void 0:s.getState())!=null?r:{},{memoized:l,changes:u}=qNe(e)?e:hK(t,e),c=o.eventCount;t.__r3f&&(t.__r3f.memoizedProps=l);for(let f=0;fx[_],t),!(w&&w.set))){const[x,..._]=b.reverse();m=_.reverse().reduce((C,S)=>C[S],t),h=x}if(p===dK+"remove")if(m.constructor){let x=M$.get(m.constructor);x||(x=new m.constructor,M$.set(m.constructor,x)),p=x[h]}else p=0;if(g)p?o.handlers[h]=p:delete o.handlers[h],o.eventCount=Object.keys(o.handlers).length;else if(w&&w.set&&(w.copy||w instanceof Tf)){if(Array.isArray(p))w.fromArray?w.fromArray(p):w.set(...p);else if(w.copy&&p&&p.constructor&&(KNe?w.constructor.name===p.constructor.name:w.constructor===p.constructor))w.copy(p);else if(p!==void 0){const x=w instanceof vt;!x&&w.setScalar?w.setScalar(p):w instanceof Tf&&p instanceof Tf?w.mask=p.mask:w.set(p),!aK()&&!a.linear&&x&&w.convertSRGBToLinear()}}else if(m[h]=p,m[h]instanceof Lr&&m[h].format===Co&&m[h].type===Ds){const x=m[h];bA(x)&&bA(a.gl)?x.colorSpace=a.gl.outputColorSpace:x.encoding=a.gl.outputEncoding}yp(t)}if(o.parent&&t.raycast&&c!==o.eventCount){const f=f_(t).getState().internal,h=f.interaction.indexOf(t);h>-1&&f.interaction.splice(h,1),o.eventCount&&f.interaction.push(t)}return!(u.length===1&&u[0][0]==="onUpdate")&&u.length&&(i=t.__r3f)!=null&&i.parent&&MR(t),t}function yp(t){var e,n;const r=(e=t.__r3f)==null||(n=e.root)==null||n.getState==null?void 0:n.getState();r&&r.internal.frames===0&&r.invalidate()}function MR(t){t.onUpdate==null||t.onUpdate(t)}function YNe(t,e){t.manual||(lK(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix(),t.updateMatrixWorld())}function mw(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function ZNe(){var t;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return im.DefaultEventPriority;switch((t=e.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return im.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return im.ContinuousEventPriority;default:return im.DefaultEventPriority}}function pK(t,e,n,r){const i=n.get(e);i&&(n.delete(e),n.size===0&&(t.delete(r),i.target.releasePointerCapture(r)))}function QNe(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(r=>r!==e),n.initialHits=n.initialHits.filter(r=>r!==e),n.hovered.forEach((r,i)=>{(r.eventObject===e||r.object===e)&&n.hovered.delete(i)}),n.capturedMap.forEach((r,i)=>{pK(n.capturedMap,e,r,i)})}function JNe(t){function e(l){const{internal:u}=t.getState(),c=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(c*c+d*d))}function n(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(c=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+c]}))}function r(l,u){const c=t.getState(),d=new Set,f=[],h=u?u(c.internal.interaction):c.internal.interaction;for(let m=0;m{const x=A0(m.object),_=A0(w.object);return!x||!_?m.distance-w.distance:_.events.priority-x.events.priority||m.distance-w.distance}).filter(m=>{const w=mw(m);return d.has(w)?!1:(d.add(w),!0)});c.events.filter&&(g=c.events.filter(g,c));for(const m of g){let w=m.object;for(;w;){var b;(b=w.__r3f)!=null&&b.eventCount&&f.push({...m,eventObject:w}),w=w.parent}}if("pointerId"in l&&c.internal.capturedMap.has(l.pointerId))for(let m of c.internal.capturedMap.get(l.pointerId).values())d.has(mw(m.intersection))||f.push(m.intersection);return f}function i(l,u,c,d){const f=t.getState();if(l.length){const h={stopped:!1};for(const p of l){const g=A0(p.object)||f,{raycaster:b,pointer:m,camera:w,internal:x}=g,_=new oe(m.x,m.y,0).unproject(w),C=R=>{var F,$;return(F=($=x.capturedMap.get(R))==null?void 0:$.has(p.eventObject))!=null?F:!1},S=R=>{const F={intersection:p,target:u.target};x.capturedMap.has(R)?x.capturedMap.get(R).set(p.eventObject,F):x.capturedMap.set(R,new Map([[p.eventObject,F]])),u.target.setPointerCapture(R)},M=R=>{const F=x.capturedMap.get(R);F&&pK(x.capturedMap,p.eventObject,F,R)};let P={};for(let R in u){let F=u[R];typeof F!="function"&&(P[R]=F)}let A={...p,...P,pointer:m,intersections:l,stopped:h.stopped,delta:c,unprojectedPoint:_,ray:b.ray,camera:w,stopPropagation(){const R="pointerId"in u&&x.capturedMap.get(u.pointerId);if((!R||R.has(p.eventObject))&&(A.stopped=h.stopped=!0,x.hovered.size&&Array.from(x.hovered.values()).find(F=>F.eventObject===p.eventObject))){const F=l.slice(0,l.indexOf(p));o([...F,p])}},target:{hasPointerCapture:C,setPointerCapture:S,releasePointerCapture:M},currentTarget:{hasPointerCapture:C,setPointerCapture:S,releasePointerCapture:M},nativeEvent:u};if(d(A),h.stopped===!0)break}}return l}function o(l){const{internal:u}=t.getState();for(const c of u.hovered.values())if(!l.length||!l.find(d=>d.object===c.object&&d.index===c.index&&d.instanceId===c.instanceId)){const f=c.eventObject.__r3f,h=f==null?void 0:f.handlers;if(u.hovered.delete(mw(c)),f!=null&&f.eventCount){const p={...c,intersections:l};h.onPointerOut==null||h.onPointerOut(p),h.onPointerLeave==null||h.onPointerLeave(p)}}}function s(l,u){for(let c=0;co([]);case"onLostPointerCapture":return u=>{const{internal:c}=t.getState();"pointerId"in u&&c.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{c.capturedMap.has(u.pointerId)&&(c.capturedMap.delete(u.pointerId),o([]))})}}return function(c){const{onPointerMissed:d,internal:f}=t.getState();f.lastEvent.current=c;const h=l==="onPointerMove",p=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",b=r(c,h?n:void 0),m=p?e(c):0;l==="onPointerDown"&&(f.initialClick=[c.offsetX,c.offsetY],f.initialHits=b.map(x=>x.eventObject)),p&&!b.length&&m<=2&&(s(c,f.interaction),d&&d(c)),h&&o(b);function w(x){const _=x.eventObject,C=_.__r3f,S=C==null?void 0:C.handlers;if(C!=null&&C.eventCount)if(h){if(S.onPointerOver||S.onPointerEnter||S.onPointerOut||S.onPointerLeave){const M=mw(x),P=f.hovered.get(M);P?P.stopped&&x.stopPropagation():(f.hovered.set(M,x),S.onPointerOver==null||S.onPointerOver(x),S.onPointerEnter==null||S.onPointerEnter(x))}S.onPointerMove==null||S.onPointerMove(x)}else{const M=S[l];M?(!p||f.initialHits.includes(_))&&(s(c,f.interaction.filter(P=>!f.initialHits.includes(P))),M(x)):p&&f.initialHits.includes(_)&&s(c,f.interaction.filter(P=>!f.initialHits.includes(P)))}}i(b,c,m,w)}}return{handlePointer:a}}const mK=t=>!!(t!=null&&t.render),gK=E.createContext(null),eFe=(t,e)=>{const n=BNe((a,l)=>{const u=new oe,c=new oe,d=new oe;function f(m=l().camera,w=c,x=l().size){const{width:_,height:C,top:S,left:M}=x,P=_/C;w instanceof oe?d.copy(w):d.set(...w);const A=m.getWorldPosition(u).distanceTo(d);if(lK(m))return{width:_/m.zoom,height:C/m.zoom,top:S,left:M,factor:1,distance:A,aspect:P};{const R=m.fov*Math.PI/180,F=2*Math.tan(R/2)*A,$=F*(_/C);return{width:$,height:F,top:S,left:M,factor:_/$,distance:A,aspect:P}}}let h;const p=m=>a(w=>({performance:{...w.performance,current:m}})),g=new Xe;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>t(l(),m),advance:(m,w)=>e(m,w,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new _F,pointer:g,mouse:g,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();h&&clearTimeout(h),m.performance.current!==m.performance.min&&p(m.performance.min),h=setTimeout(()=>p(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:f},setEvents:m=>a(w=>({...w,events:{...w.events,...m}})),setSize:(m,w,x,_,C)=>{const S=l().camera,M={width:m,height:w,top:_||0,left:C||0,updateStyle:x};a(P=>({size:M,viewport:{...P.viewport,...f(S,c,M)}}))},setDpr:m=>a(w=>{const x=fK(m);return{viewport:{...w.viewport,dpr:x,initialDpr:w.viewport.initialDpr||x}}}),setFrameloop:(m="always")=>{const w=l().clock;w.stop(),w.elapsedTime=0,m!=="never"&&(w.start(),w.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:E.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,w,x)=>{const _=l().internal;return _.priority=_.priority+(w>0?1:0),_.subscribers.push({ref:m,priority:w,store:x}),_.subscribers=_.subscribers.sort((C,S)=>C.priority-S.priority),()=>{const C=l().internal;C!=null&&C.subscribers&&(C.priority=C.priority-(w>0?1:0),C.subscribers=C.subscribers.filter(S=>S.ref!==m))}}}}}),r=n.getState();let i=r.size,o=r.viewport.dpr,s=r.camera;return n.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:c,set:d}=n.getState();if(l.width!==i.width||l.height!==i.height||u.dpr!==o){var f;i=l,o=u.dpr,YNe(a,l),c.setPixelRatio(u.dpr);const h=(f=l.updateStyle)!=null?f:typeof HTMLCanvasElement<"u"&&c.domElement instanceof HTMLCanvasElement;c.setSize(l.width,l.height,h)}a!==s&&(s=a,d(h=>({viewport:{...h.viewport,...h.viewport.getCurrentViewport(a)}})))}),n.subscribe(a=>t(a)),n};let gw,tFe=new Set,nFe=new Set,rFe=new Set;function _A(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function P0(t,e){switch(t){case"before":return _A(tFe,e);case"after":return _A(nFe,e);case"tail":return _A(rFe,e)}}let SA,CA;function EA(t,e,n){let r=e.clock.getDelta();for(e.frameloop==="never"&&typeof t=="number"&&(r=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),SA=e.internal.subscribers,gw=0;gw0)&&!((c=o.gl.xr)!=null&&c.isPresenting)&&(r+=EA(u,o))}if(n=!1,P0("after",u),r===0)return P0("tail",u),e=!1,cancelAnimationFrame(i)}function a(u,c=1){var d;if(!u)return t.forEach(f=>a(f.store.getState(),c));(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(c>1?u.internal.frames=Math.min(60,u.internal.frames+c):n?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(s)))}function l(u,c=!0,d,f){if(c&&P0("before",u),d)EA(u,d,f);else for(const h of t.values())EA(u,h.store.getState());c&&P0("after",u)}return{loop:s,invalidate:a,advance:l}}function vK(){const t=E.useContext(gK);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function Vi(t=n=>n,e){return vK()(t,e)}function TF(t,e=0){const n=vK(),r=n.getState().internal.subscribe,i=uK(t);return Bb(()=>r(i,e,n),[e,r,n]),null}const Jm=new Map,{invalidate:P$,advance:D$}=iFe(Jm),{reconciler:DS,applyProps:up}=GNe(Jm,ZNe),cp={objects:"shallow",strict:!1},oFe=(t,e)=>{const n=typeof t=="function"?t(e):t;return mK(n)?n:new oF({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...t})};function sFe(t,e){const n=typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement;if(e){const{width:r,height:i,top:o,left:s,updateStyle:a=n}=e;return{width:r,height:i,top:o,left:s,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:r,height:i,top:o,left:s}=t.parentElement.getBoundingClientRect();return{width:r,height:i,top:o,left:s,updateStyle:n}}else if(typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0,updateStyle:n};return{width:0,height:0,top:0,left:0}}function aFe(t){const e=Jm.get(t),n=e==null?void 0:e.fiber,r=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,o=r||eFe(P$,D$),s=n||DS.createContainer(o,im.ConcurrentRoot,null,!1,null,"",i,null);e||Jm.set(t,{fiber:s,store:o});let a,l=!1,u;return{configure(c={}){let{gl:d,size:f,scene:h,events:p,onCreated:g,shadows:b=!1,linear:m=!1,flat:w=!1,legacy:x=!1,orthographic:_=!1,frameloop:C="always",dpr:S=[1,2],performance:M,raycaster:P,camera:A,onPointerMissed:R}=c,F=o.getState(),$=F.gl;F.gl||F.set({gl:$=oFe(d,t)});let j=F.raycaster;j||F.set({raycaster:j=new eK});const{params:k,...U}=P||{};if(cr.equ(U,j,cp)||up(j,{...U}),cr.equ(k,j.params,cp)||up(j,{params:{...j.params,...k}}),!F.camera||F.camera===u&&!cr.equ(u,A,cp)){u=A;const W=A instanceof Db,K=W?A:_?new Nb(0,0,0,0,.1,1e3):new Si(75,0,.1,1e3);W||(K.position.z=5,A&&up(K,A),!F.camera&&!(A!=null&&A.rotation)&&K.lookAt(0,0,0)),F.set({camera:K}),j.camera=K}if(!F.scene){let W;h instanceof AS?W=h:(W=new AS,h&&up(W,h)),F.set({scene:vp(W)})}if(!F.xr){var G;const W=(J,ae)=>{const ve=o.getState();ve.frameloop!=="never"&&D$(J,!0,ve,ae)},K=()=>{const J=o.getState();J.gl.xr.enabled=J.gl.xr.isPresenting,J.gl.xr.setAnimationLoop(J.gl.xr.isPresenting?W:null),J.gl.xr.isPresenting||P$(J)},Q={connect(){const J=o.getState().gl;J.xr.addEventListener("sessionstart",K),J.xr.addEventListener("sessionend",K)},disconnect(){const J=o.getState().gl;J.xr.removeEventListener("sessionstart",K),J.xr.removeEventListener("sessionend",K)}};typeof((G=$.xr)==null?void 0:G.addEventListener)=="function"&&Q.connect(),F.set({xr:Q})}if($.shadowMap){const W=$.shadowMap.enabled,K=$.shadowMap.type;if($.shadowMap.enabled=!!b,cr.boo(b))$.shadowMap.type=_v;else if(cr.str(b)){var B;const Q={basic:jW,percentage:ME,soft:_v,variance:Ra};$.shadowMap.type=(B=Q[b])!=null?B:_v}else cr.obj(b)&&Object.assign($.shadowMap,b);(W!==$.shadowMap.enabled||K!==$.shadowMap.type)&&($.shadowMap.needsUpdate=!0)}const L=aK();L&&("enabled"in L?L.enabled=!x:"legacyMode"in L&&(L.legacyMode=x)),l||up($,{outputEncoding:m?3e3:3001,toneMapping:w?Il:zN}),F.legacy!==x&&F.set(()=>({legacy:x})),F.linear!==m&&F.set(()=>({linear:m})),F.flat!==w&&F.set(()=>({flat:w})),d&&!cr.fun(d)&&!mK(d)&&!cr.equ(d,$,cp)&&up($,d),p&&!F.events.handlers&&F.set({events:p(o)});const N=sFe(t,f);return cr.equ(N,F.size,cp)||F.setSize(N.width,N.height,N.updateStyle,N.top,N.left),S&&F.viewport.dpr!==fK(S)&&F.setDpr(S),F.frameloop!==C&&F.setFrameloop(C),F.onPointerMissed||F.set({onPointerMissed:R}),M&&!cr.equ(M,F.performance,cp)&&F.set(W=>({performance:{...W.performance,...M}})),a=g,l=!0,this},render(c){return l||this.configure(),DS.updateContainer(E.createElement(lFe,{store:o,children:c,onCreated:a,rootElement:t}),s,null,()=>{}),o},unmount(){yK(t)}}}function lFe({store:t,children:e,onCreated:n,rootElement:r}){return Bb(()=>{const i=t.getState();i.set(o=>({internal:{...o.internal,active:!0}})),n&&n(i),t.getState().events.connected||i.events.connect==null||i.events.connect(r)},[]),E.createElement(gK.Provider,{value:t},e)}function yK(t,e){const n=Jm.get(t),r=n==null?void 0:n.fiber;if(r){const i=n==null?void 0:n.store.getState();i&&(i.internal.active=!1),DS.updateContainer(null,r,null,()=>{i&&setTimeout(()=>{try{var o,s,a,l;i.events.disconnect==null||i.events.disconnect(),(o=i.gl)==null||(s=o.renderLists)==null||s.dispose==null||s.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),XNe(i),Jm.delete(t)}catch{}},500)})}}DS.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:E.version});function TR(t,e,n){var r,i,o,s,a;e==null&&(e=100);function l(){var c=Date.now()-s;c=0?r=setTimeout(l,e-c):(r=null,n||(a=t.apply(o,i),o=i=null))}var u=function(){o=this,i=arguments,s=Date.now();var c=n&&!r;return r||(r=setTimeout(l,e)),c&&(a=t.apply(o,i),o=i=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},u}TR.debounce=TR;var uFe=TR;const R$=va(uFe);function cFe(t){let{debounce:e,scroll:n,polyfill:r,offsetSize:i}=t===void 0?{debounce:0,scroll:!1,offsetSize:!1}:t;const o=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!o)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,a]=E.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=E.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),u=e?typeof e=="number"?e:e.scroll:null,c=e?typeof e=="number"?e:e.resize:null,d=E.useRef(!1);E.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[f,h,p]=E.useMemo(()=>{const w=()=>{if(!l.current.element)return;const{left:x,top:_,width:C,height:S,bottom:M,right:P,x:A,y:R}=l.current.element.getBoundingClientRect(),F={left:x,top:_,width:C,height:S,bottom:M,right:P,x:A,y:R};l.current.element instanceof HTMLElement&&i&&(F.height=l.current.element.offsetHeight,F.width=l.current.element.offsetWidth),Object.freeze(F),d.current&&!pFe(l.current.lastBounds,F)&&a(l.current.lastBounds=F)};return[w,c?R$(w,c):w,u?R$(w,u):w]},[a,i,u,c]);function g(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",p,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function b(){l.current.element&&(l.current.resizeObserver=new o(p),l.current.resizeObserver.observe(l.current.element),n&&l.current.scrollContainers&&l.current.scrollContainers.forEach(w=>w.addEventListener("scroll",p,{capture:!0,passive:!0})))}const m=w=>{!w||w===l.current.element||(g(),l.current.element=w,l.current.scrollContainers=bK(w),b())};return fFe(p,!!n),dFe(h),E.useEffect(()=>{g(),b()},[n,p,h]),E.useEffect(()=>g,[]),[m,s,f]}function dFe(t){E.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function fFe(t,e){E.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function bK(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(o=>o==="auto"||o==="scroll")&&e.push(t),[...e,...bK(t.parentElement)]}const hFe=["x","y","top","bottom","left","right","width","height"],pFe=(t,e)=>hFe.every(n=>t[n]===e[n]);var mFe=Object.defineProperty,gFe=Object.defineProperties,vFe=Object.getOwnPropertyDescriptors,I$=Object.getOwnPropertySymbols,yFe=Object.prototype.hasOwnProperty,bFe=Object.prototype.propertyIsEnumerable,N$=(t,e,n)=>e in t?mFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,F$=(t,e)=>{for(var n in e||(e={}))yFe.call(e,n)&&N$(t,n,e[n]);if(I$)for(var n of I$(e))bFe.call(e,n)&&N$(t,n,e[n]);return t},xFe=(t,e)=>gFe(t,vFe(e)),O$,k$;typeof window<"u"&&((O$=window.document)!=null&&O$.createElement||((k$=window.navigator)==null?void 0:k$.product)==="ReactNative")?E.useLayoutEffect:E.useEffect;function xK(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=xK(r,e,n);if(i)return i;r=r.sibling}}function wK(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const L$=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=L$;return}return L$.apply(this,arguments)};const AF=wK(E.createContext(null));class _K extends E.Component{render(){return E.createElement(AF.Provider,{value:this._reactInternals},this.props.children)}}function wFe(){const t=E.useContext(AF);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=E.useId();return E.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=xK(r,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}function _Fe(){const t=wFe(),[e]=E.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==AF&&!e.has(i)&&e.set(i,E.useContext(wK(i)))}n=n.return}return e}function SFe(){const t=_Fe();return E.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>E.createElement(e,null,E.createElement(n.Provider,xFe(F$({},r),{value:t.get(n)}))),e=>E.createElement(_K,F$({},e))),[t])}const MA={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function CFe(t){const{handlePointer:e}=JNe(t);return{priority:1,enabled:!0,compute(n,r,i){r.pointer.set(n.offsetX/r.size.width*2-1,-(n.offsetY/r.size.height)*2+1),r.raycaster.setFromCamera(r.pointer,r.camera)},connected:void 0,handlers:Object.keys(MA).reduce((n,r)=>({...n,[r]:e(r)}),{}),update:()=>{var n;const{events:r,internal:i}=t.getState();(n=i.lastEvent)!=null&&n.current&&r.handlers&&r.handlers.onPointerMove(i.lastEvent.current)},connect:n=>{var r;const{set:i,events:o}=t.getState();o.disconnect==null||o.disconnect(),i(s=>({events:{...s.events,connected:n}})),Object.entries((r=o.handlers)!=null?r:[]).forEach(([s,a])=>{const[l,u]=MA[s];n.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:n,events:r}=t.getState();if(r.connected){var i;Object.entries((i=r.handlers)!=null?i:[]).forEach(([o,s])=>{if(r&&r.connected instanceof HTMLElement){const[a]=MA[o];r.connected.removeEventListener(a,s)}}),n(o=>({events:{...o.events,connected:void 0}}))}}}}const EFe=E.forwardRef(function({children:e,fallback:n,resize:r,style:i,gl:o,events:s=CFe,eventSource:a,eventPrefix:l,shadows:u,linear:c,flat:d,legacy:f,orthographic:h,frameloop:p,dpr:g,performance:b,raycaster:m,camera:w,scene:x,onPointerMissed:_,onCreated:C,...S},M){E.useMemo(()=>sK(ONe),[]);const P=SFe(),[A,R]=cFe({scroll:!0,debounce:{scroll:50,resize:0},...r}),F=E.useRef(null),$=E.useRef(null);E.useImperativeHandle(M,()=>F.current);const j=uK(_),[k,U]=E.useState(!1),[G,B]=E.useState(!1);if(k)throw k;if(G)throw G;const L=E.useRef(null);Bb(()=>{const W=F.current;R.width>0&&R.height>0&&W&&(L.current||(L.current=aFe(W)),L.current.configure({gl:o,events:s,shadows:u,linear:c,flat:d,legacy:f,orthographic:h,frameloop:p,dpr:g,performance:b,raycaster:m,camera:w,scene:x,size:R,onPointerMissed:(...K)=>j.current==null?void 0:j.current(...K),onCreated:K=>{K.events.connect==null||K.events.connect(a?jNe(a)?a.current:a:$.current),l&&K.setEvents({compute:(Q,J)=>{const ae=Q[l+"X"],ve=Q[l+"Y"];J.pointer.set(ae/J.size.width*2-1,-(ve/J.size.height)*2+1),J.raycaster.setFromCamera(J.pointer,J.camera)}}),C==null||C(K)}}),L.current.render(E.createElement(P,null,E.createElement(cK,{set:B},E.createElement(E.Suspense,{fallback:E.createElement(WNe,{set:U})},e)))))}),E.useEffect(()=>{const W=F.current;if(W)return()=>yK(W)},[]);const N=a?"none":"auto";return E.createElement("div",O({ref:$,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...i}},S),E.createElement("div",{ref:A,style:{width:"100%",height:"100%"}},E.createElement("canvas",{ref:F,style:{display:"block"}},n)))}),MFe=E.forwardRef(function(e,n){return E.createElement(_K,null,E.createElement(EFe,O({},e,{ref:n})))});function JE(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Sg(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $b(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Td(){}var Wf=.7,eg=1/Wf,_m="\\s*([+-]?\\d+)\\s*",By="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",TFe=/^#([0-9a-f]{3,8})$/,AFe=new RegExp(`^rgb\\(${_m},${_m},${_m}\\)$`),PFe=new RegExp(`^rgb\\(${Fl},${Fl},${Fl}\\)$`),DFe=new RegExp(`^rgba\\(${_m},${_m},${_m},${By}\\)$`),RFe=new RegExp(`^rgba\\(${Fl},${Fl},${Fl},${By}\\)$`),IFe=new RegExp(`^hsl\\(${By},${Fl},${Fl}\\)$`),NFe=new RegExp(`^hsla\\(${By},${Fl},${Fl},${By}\\)$`),B$={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Sg(Td,$y,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$$,formatHex:$$,formatHex8:FFe,formatHsl:OFe,formatRgb:z$,toString:z$});function $$(){return this.rgb().formatHex()}function FFe(){return this.rgb().formatHex8()}function OFe(){return SK(this).formatHsl()}function z$(){return this.rgb().formatRgb()}function $y(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=TFe.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?U$(e):n===3?new Ei(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?vw(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?vw(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=AFe.exec(t))?new Ei(e[1],e[2],e[3],1):(e=PFe.exec(t))?new Ei(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=DFe.exec(t))?vw(e[1],e[2],e[3],e[4]):(e=RFe.exec(t))?vw(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=IFe.exec(t))?G$(e[1],e[2]/100,e[3]/100,1):(e=NFe.exec(t))?G$(e[1],e[2]/100,e[3]/100,e[4]):B$.hasOwnProperty(t)?U$(B$[t]):t==="transparent"?new Ei(NaN,NaN,NaN,0):null}function U$(t){return new Ei(t>>16&255,t>>8&255,t&255,1)}function vw(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ei(t,e,n,r)}function PF(t){return t instanceof Td||(t=$y(t)),t?(t=t.rgb(),new Ei(t.r,t.g,t.b,t.opacity)):new Ei}function cd(t,e,n,r){return arguments.length===1?PF(t):new Ei(t,e,n,r??1)}function Ei(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Sg(Ei,cd,$b(Td,{brighter(t){return t=t==null?eg:Math.pow(eg,t),new Ei(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Wf:Math.pow(Wf,t),new Ei(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ei(Pf(this.r),Pf(this.g),Pf(this.b),RS(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:H$,formatHex:H$,formatHex8:kFe,formatRgb:V$,toString:V$}));function H$(){return`#${vf(this.r)}${vf(this.g)}${vf(this.b)}`}function kFe(){return`#${vf(this.r)}${vf(this.g)}${vf(this.b)}${vf((isNaN(this.opacity)?1:this.opacity)*255)}`}function V$(){const t=RS(this.opacity);return`${t===1?"rgb(":"rgba("}${Pf(this.r)}, ${Pf(this.g)}, ${Pf(this.b)}${t===1?")":`, ${t})`}`}function RS(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vf(t){return t=Pf(t),(t<16?"0":"")+t.toString(16)}function G$(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ba(t,e,n,r)}function SK(t){if(t instanceof Ba)return new Ba(t.h,t.s,t.l,t.opacity);if(t instanceof Td||(t=$y(t)),!t)return new Ba;if(t instanceof Ba)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(e===o?s=(n-r)/a+(n0&&l<1?0:s,new Ba(s,a,l,t.opacity)}function IS(t,e,n,r){return arguments.length===1?SK(t):new Ba(t,e,n,r??1)}function Ba(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Sg(Ba,IS,$b(Td,{brighter(t){return t=t==null?eg:Math.pow(eg,t),new Ba(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Wf:Math.pow(Wf,t),new Ba(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ei(TA(t>=240?t-240:t+120,i,r),TA(t,i,r),TA(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ba(j$(this.h),yw(this.s),yw(this.l),RS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=RS(this.opacity);return`${t===1?"hsl(":"hsla("}${j$(this.h)}, ${yw(this.s)*100}%, ${yw(this.l)*100}%${t===1?")":`, ${t})`}`}}));function j$(t){return t=(t||0)%360,t<0?t+360:t}function yw(t){return Math.max(0,Math.min(1,t||0))}function TA(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const CK=Math.PI/180,EK=180/Math.PI,NS=18,MK=.96422,TK=1,AK=.82521,PK=4/29,Sm=6/29,DK=3*Sm*Sm,LFe=Sm*Sm*Sm;function RK(t){if(t instanceof Ol)return new Ol(t.l,t.a,t.b,t.opacity);if(t instanceof Pu)return IK(t);t instanceof Ei||(t=PF(t));var e=RA(t.r),n=RA(t.g),r=RA(t.b),i=AA((.2225045*e+.7168786*n+.0606169*r)/TK),o,s;return e===n&&n===r?o=s=i:(o=AA((.4360747*e+.3850649*n+.1430804*r)/MK),s=AA((.0139322*e+.0971045*n+.7141733*r)/AK)),new Ol(116*i-16,500*(o-i),200*(i-s),t.opacity)}function AR(t,e,n,r){return arguments.length===1?RK(t):new Ol(t,e,n,r??1)}function Ol(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}Sg(Ol,AR,$b(Td,{brighter(t){return new Ol(this.l+NS*(t??1),this.a,this.b,this.opacity)},darker(t){return new Ol(this.l-NS*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=MK*PA(e),t=TK*PA(t),n=AK*PA(n),new Ei(DA(3.1338561*e-1.6168667*t-.4906146*n),DA(-.9787684*e+1.9161415*t+.033454*n),DA(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function AA(t){return t>LFe?Math.pow(t,1/3):t/DK+PK}function PA(t){return t>Sm?t*t*t:DK*(t-PK)}function DA(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function RA(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function BFe(t){if(t instanceof Pu)return new Pu(t.h,t.c,t.l,t.opacity);if(t instanceof Ol||(t=RK(t)),t.a===0&&t.b===0)return new Pu(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],s=r>0?t[r-1]:2*i-o,a=r()=>t;function FK(t,e){return function(n){return t+n*e}}function HFe(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function IF(t,e){var n=e-t;return n?FK(t,n>180||n<-180?n-360*Math.round(n/360):n):tM(isNaN(t)?e:t)}function VFe(t){return(t=+t)==1?Mi:function(e,n){return n-e?HFe(e,n,t):tM(isNaN(e)?n:e)}}function Mi(t,e){var n=e-t;return n?FK(t,n):tM(isNaN(t)?e:t)}const DR=function t(e){var n=VFe(e);function r(i,o){var s=n((i=cd(i)).r,(o=cd(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=Mi(i.opacity,o.opacity);return function(c){return i.r=s(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=t,r}(1);function GFe(t){return function(e){var n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),s,a;for(s=0;sn&&(o=e.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:tg(r,i)})),n=IA.lastIndex;return ne&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function uOe(t,e,n){var r=t[0],i=t[1],o=e[0],s=e[1];return i2?cOe:uOe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=a(t.map(r),e,n)))(r(s(f)))}return d.invert=function(f){return s(i((u||(u=a(e,t.map(r),tg)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,aOe),c()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),c()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=FF,c()},d.clamp=function(f){return arguments.length?(s=f?!0:Tl,c()):s!==Tl},d.interpolate=function(f){return arguments.length?(n=f,c()):n},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,h){return r=f,i=h,c()}}function dOe(){return iM()(Tl,Tl)}function fOe(t,e,n,r){var i=BW(t,e,n),o;switch(r=my(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=R2e(i,s))&&(r.precision=o),UW(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=I2e(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=D2e(i))&&(r.precision=o-(r.type==="%")*2);break}}return Yl(r)}function OF(t){var e=t.domain;return t.ticks=function(n){var r=e();return FD(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return fOe(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,s=r[i],a=r[o],l,u,c=10;for(a0;){if(u=OD(s,a,n),u===l)return r[i]=s,r[o]=a,e(r);if(u>0)s=Math.floor(s/u)*u,a=Math.ceil(a/u)*u;else if(u<0)s=Math.ceil(s*u)/u,a=Math.floor(a*u)/u;else break;l=u}return t},t}function BK(){var t=dOe();return t.copy=function(){return rM(t,BK())},JE.apply(t,arguments),OF(t)}function hOe(t,e){t=t.slice();var n=0,r=t.length-1,i=t[n],o=t[r],s;return oMath.pow(t,e)}function yOe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function Q$(t){return(e,n)=>-t(-e,n)}function bOe(t){const e=t(Y$,Z$),n=e.domain;let r=10,i,o;function s(){return i=yOe(r),o=vOe(r),n()[0]<0?(i=Q$(i),o=Q$(o),t(pOe,mOe)):t(Y$,Z$),e}return e.base=function(a){return arguments.length?(r=+a,s()):r},e.domain=function(a){return arguments.length?(n(a),s()):n()},e.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const d=c0){for(;f<=h;++f)for(p=1;pc)break;m.push(g)}}else for(;f<=h;++f)for(p=r-1;p>=1;--p)if(g=f>0?p/o(-f):p*o(f),!(gc)break;m.push(g)}m.length*2{if(a==null&&(a=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=my(l)).precision==null&&(l.trim=!0),l=Yl(l)),a===1/0)return l;const u=Math.max(1,r*a/e.ticks().length);return c=>{let d=c/o(Math.round(i(c)));return d*rn(hOe(n(),{floor:a=>o(Math.floor(i(a))),ceil:a=>o(Math.ceil(i(a)))})),e}function $K(){const t=bOe(iM()).domain([1,10]);return t.copy=()=>rM(t,$K()).base(t.base()),JE.apply(t,arguments),t}function J$(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function ez(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function xOe(t){var e=1,n=t(J$(e),ez(e));return n.constant=function(r){return arguments.length?t(J$(e=+r),ez(e)):e},OF(n)}function zK(){var t=xOe(iM());return t.copy=function(){return rM(t,zK()).constant(t.constant())},JE.apply(t,arguments)}function tz(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function wOe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function _Oe(t){return t<0?-t*t:t*t}function SOe(t){var e=t(Tl,Tl),n=1;function r(){return n===1?t(Tl,Tl):n===.5?t(wOe,_Oe):t(tz(n),tz(1/n))}return e.exponent=function(i){return arguments.length?(n=+i,r()):n},OF(e)}function kF(){var t=SOe(iM());return t.copy=function(){return rM(t,kF()).exponent(t.exponent())},JE.apply(t,arguments),t}function COe(){return kF.apply(null,arguments).exponent(.5)}const NA=new Date,FA=new Date;function Wi(t,e,n,r){function i(o){return t(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(t(o=new Date(+o)),o),i.ceil=o=>(t(o=new Date(o-1)),e(o,1),t(o),o),i.round=o=>{const s=i(o),a=i.ceil(o);return o-s(e(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,a)=>{const l=[];if(o=i.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let u;do l.push(u=new Date(+o)),e(o,a),t(o);while(uWi(s=>{if(s>=s)for(;t(s),!o(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!o(s););else for(;--a>=0;)for(;e(s,1),!o(s););}),n&&(i.count=(o,s)=>(NA.setTime(+o),FA.setTime(+s),t(NA),t(FA),Math.floor(n(NA,FA))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?s=>r(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Uy=1e3,dd=Uy*60,Hy=dd*60,Vy=Hy*24,UK=Vy*7,LF=Wi(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Uy)},(t,e)=>(e-t)/Uy,t=>t.getUTCSeconds());LF.range;const HK=Wi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Uy)},(t,e)=>{t.setTime(+t+e*dd)},(t,e)=>(e-t)/dd,t=>t.getMinutes());HK.range;const VK=Wi(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*dd)},(t,e)=>(e-t)/dd,t=>t.getUTCMinutes());VK.range;const GK=Wi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Uy-t.getMinutes()*dd)},(t,e)=>{t.setTime(+t+e*Hy)},(t,e)=>(e-t)/Hy,t=>t.getHours());GK.range;const jK=Wi(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Hy)},(t,e)=>(e-t)/Hy,t=>t.getUTCHours());jK.range;const WK=Wi(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*dd)/Vy,t=>t.getDate()-1);WK.range;const qK=Wi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Vy,t=>t.getUTCDate()-1);qK.range;const EOe=Wi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Vy,t=>Math.floor(t/Vy));EOe.range;function lh(t){return Wi(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*dd)/UK)}const XK=lh(0),MOe=lh(1),TOe=lh(2),AOe=lh(3),POe=lh(4),DOe=lh(5),ROe=lh(6);XK.range;MOe.range;TOe.range;AOe.range;POe.range;DOe.range;ROe.range;function uh(t){return Wi(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/UK)}const KK=uh(0),IOe=uh(1),NOe=uh(2),FOe=uh(3),OOe=uh(4),kOe=uh(5),LOe=uh(6);KK.range;IOe.range;NOe.range;FOe.range;OOe.range;kOe.range;LOe.range;const YK=Wi(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());YK.range;const ZK=Wi(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());ZK.range;const BF=Wi(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());BF.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wi(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});BF.range;const $F=Wi(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());$F.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Wi(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});$F.range;function BOe(t,e){e.domain&&("nice"in t||"quantiles"in t||"padding"in t,t.domain(e.domain))}function $Oe(t,e){e.range&&("padding"in t,t.range(e.range))}function zOe(t,e){"align"in t&&"align"in e&&typeof e.align<"u"&&t.align(e.align)}function UOe(t,e){"base"in t&&"base"in e&&typeof e.base<"u"&&t.base(e.base)}function HOe(t,e){"clamp"in t&&"clamp"in e&&typeof e.clamp<"u"&&t.clamp(e.clamp)}function VOe(t,e){"constant"in t&&"constant"in e&&typeof e.constant<"u"&&t.constant(e.constant)}function GOe(t,e){"exponent"in t&&"exponent"in e&&typeof e.exponent<"u"&&t.exponent(e.exponent)}var nz={lab:nOe,hcl:rOe,"hcl-long":iOe,hsl:eOe,"hsl-long":tOe,cubehelix:oOe,"cubehelix-long":nM,rgb:DR};function jOe(t){switch(t){case"lab":case"hcl":case"hcl-long":case"hsl":case"hsl-long":case"cubehelix":case"cubehelix-long":case"rgb":return nz[t]}var e=t.type,n=t.gamma,r=nz[e];return typeof n>"u"?r:r.gamma(n)}function WOe(t,e){if("interpolate"in e&&"interpolate"in t&&typeof e.interpolate<"u"){var n=jOe(e.interpolate);t.interpolate(n)}}var qOe=new Date(Date.UTC(2020,1,2,3,4,5)),XOe="%Y-%m-%d %H:%M";function KOe(t){var e=t.tickFormat(1,XOe)(qOe);return e==="2020-02-02 03:04"}var rz={day:WK,hour:GK,minute:HK,month:YK,second:LF,week:XK,year:BF},iz={day:qK,hour:jK,minute:VK,month:ZK,second:LF,week:KK,year:$F};function YOe(t,e){if("nice"in e&&typeof e.nice<"u"&&"nice"in t){var n=e.nice;if(typeof n=="boolean")n&&t.nice();else if(typeof n=="number")t.nice(n);else{var r=t,i=KOe(r);if(typeof n=="string")r.nice(i?iz[n]:rz[n]);else{var o=n.interval,s=n.step,a=(i?iz[o]:rz[o]).every(s);a!=null&&r.nice(a)}}}}function ZOe(t,e){"padding"in t&&"padding"in e&&typeof e.padding<"u"&&t.padding(e.padding),"paddingInner"in t&&"paddingInner"in e&&typeof e.paddingInner<"u"&&t.paddingInner(e.paddingInner),"paddingOuter"in t&&"paddingOuter"in e&&typeof e.paddingOuter<"u"&&t.paddingOuter(e.paddingOuter)}function QOe(t,e){if(e.reverse){var n=t.range().slice().reverse();"padding"in t,t.range(n)}}function JOe(t,e){"round"in e&&typeof e.round<"u"&&(e.round&&"interpolate"in e&&typeof e.interpolate<"u"?console.warn("[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:",e):"round"in t?t.round(e.round):"interpolate"in t&&e.round&&t.interpolate(FF))}function eke(t,e){"unknown"in t&&"unknown"in e&&typeof e.unknown<"u"&&t.unknown(e.unknown)}function tke(t,e){if("zero"in e&&e.zero===!0){var n=t.domain(),r=n[0],i=n[1],o=i=0)&&(n[i]=t[i]);return n}function Ub(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.transform,s=t.className,a=t.children,l=t.innerRef,u=mke(t,pke);return ie.createElement("g",NR({ref:l,className:Gl("visx-group",s),transform:o||"translate("+i+", "+n+")"},u),a)}Ub.propTypes={top:me.number,left:me.number,transform:me.string,className:me.string,children:me.node,innerRef:me.oneOfType([me.string,me.func,me.object])};var gke=["from","to","fill","className","innerRef"];function FR(){return FR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function eY(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,u=vke(t,gke),c=n.x===i.x||n.y===i.y;return ie.createElement("line",FR({ref:l,className:Gl("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:c?"crispEdges":"auto"},u))}var yke=tY;function tY(t,e,n){t instanceof RegExp&&(t=oz(t,n)),e instanceof RegExp&&(e=oz(e,n));var r=nY(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function oz(t,e){var n=e.match(t);return n?n[0]:null}tY.range=nY;function nY(t,e,n){var r,i,o,s,a,l=n.indexOf(t),u=n.indexOf(e,l+1),c=l;if(l>=0&&u>0){for(r=[],o=n.length;c>=0&&!a;)c==l?(r.push(c),l=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),u]:(i=r.pop(),i=0?l:u;r.length&&(a=[o,s])}return a}var bke=rY;function rY(t,e,n){t instanceof RegExp&&(t=sz(t,n)),e instanceof RegExp&&(e=sz(e,n));var r=iY(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function sz(t,e){var n=e.match(t);return n?n[0]:null}rY.range=iY;function iY(t,e,n){var r,i,o,s,a,l=n.indexOf(t),u=n.indexOf(e,l+1),c=l;if(l>=0&&u>0){if(t===e)return[l,u];for(r=[],o=n.length;c>=0&&!a;)c==l?(r.push(c),l=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),u]:(i=r.pop(),i=0?l:u;r.length&&(a=[o,s])}return a}var xke=bke,wke=oY;function oY(t,e,n){var r=t;return _ke(t,e).reduce(function(i,o){return i.replace(o.functionIdentifier+"("+o.matches.body+")",Ske(o.matches.body,o.functionIdentifier,n,r,e))},t)}function _ke(t,e){var n=[],r=typeof e=="string"?new RegExp("\\b("+e+")\\("):e;do{var i=r.exec(t);if(!i)return n;if(i[1]===void 0)throw new Error("Missing the first couple of parenthesis to get the function identifier in "+e);var o=i[1],s=i.index,a=xke("(",")",t.substring(s));if(!a||a.start!==i[0].length-1)throw new SyntaxError(o+"(): missing closing ')' in the value '"+t+"'");n.push({matches:a,functionIdentifier:o}),t=a.post}while(r.test(t));return n}function Ske(t,e,n,r,i){return n(oY(t,i,n),e,r)}var yo=function(t){this.value=t};yo.math={isDegree:!0,acos:function(t){return yo.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return yo.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return yo.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,e){var n=1,r=t-e,i=e;iwo.length-2?wo.length-1:t.length-s;i>0;i--)if(wo[i]!==void 0)for(o=0;o0&&ur)s.push(e);else{for(;r>=i&&!u||u&&i"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===7)typeof e[e.length-1].type>"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===8){for(var l=[],u=0;u"u"?(r.value=r.concat(n),r.value.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===2||o[a].type===9?(n=e.pop(),r=e.pop(),typeof r.type>"u"?(r=r.concat(n),r.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===12?(n=e.pop(),typeof n.type<"u"&&(n=[n]),r=e.pop(),i=e.pop(),e.push({type:1,value:o[a].value(i.value,r.value,new Av(n))})):o[a].type===13&&(s?e.push({value:t[o[a].value],type:3}):e.push([o[a]]));if(e.length>1)throw new Av.Exception("Uncaught Syntax error");return e[0].value>1e15?"Infinity":parseFloat(e[0].value.toFixed(15))};Av.eval=function(t,e,n){return typeof e>"u"?this.lex(t).toPostfix().postfixEval():typeof n>"u"?typeof e.length<"u"?this.lex(t,e).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(e):this.lex(t,e).toPostfix().postfixEval(n)};var Ike=Av,aY=Ike;aY.prototype.formulaEval=function(){for(var t,e,n,r=[],i=this.value,o=0;o"+e.value+""+i[o].show+""+t.value+"",type:10}):r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+""+t.value+"",type:1})):i[o].type===2||i[o].type===9?(t=r.pop(),e=r.pop(),r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+i[o].show+(t.type!=1?"(":"")+t.value+(t.type!=1?")":""),type:i[o].type})):i[o].type===12&&(t=r.pop(),e=r.pop(),n=r.pop(),r.push({value:i[o].show+"("+n.value+","+e.value+","+t.value+")",type:12}));return r[0].value};var Nke=aY,Fke=yke,Oke=wke,kke=Nke,Lke=100,Bke=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,OA,$ke=zke;function zke(t,e){OA=0,e=Math.pow(10,e===void 0?5:e),t=t.replace(/\n+/g," ");function n(i,o,s){if(OA++>Lke)throw OA=0,new Error("Call stack overflow for "+s);if(i==="")throw new Error(o+"(): '"+s+"' must contain a non-whitespace string");i=r(i,s);var a=Uke(i);if(a.length>1||i.indexOf("var(")>-1)return o+"("+i+")";var l=a[0]||"";l==="%"&&(i=i.replace(/\b[0-9\.]+%/g,function(d){return parseFloat(d.slice(0,-1))*.01}));var u=i.replace(new RegExp(l,"gi"),""),c;try{c=kke.eval(u)}catch{return o+"("+i+")"}return l==="%"&&(c*=100),(o.length||l==="%")&&(c=Math.round(c*e)/e),c+=l,c}function r(i,o){i=i.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var s="",a=i,l;l=Bke.exec(a);){l[0].index>0&&(s+=a.substring(0,l[0].index));var u=Fke("(",")",a.substring([0].index));if(u.body==="")throw new Error("'"+i+"' must contain a non-whitespace string");var c=n(u.body,"",o);s+=u.pre+c,a=u.post}return s+a}return Oke(t,/((?:\-[a-z]+\-)?calc)\(/,n)}function Uke(t){for(var e=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(t);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(e.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(t));return e}const kA=ya($ke);var Hke=typeof W1=="object"&&W1&&W1.Object===Object&&W1,lY=Hke,Vke=lY,Gke=typeof self=="object"&&self&&self.Object===Object&&self,jke=Vke||Gke||Function("return this")(),Ql=jke,Wke=Ql,qke=Wke.Symbol,Hb=qke,az=Hb,uY=Object.prototype,Xke=uY.hasOwnProperty,Kke=uY.toString,I0=az?az.toStringTag:void 0;function Yke(t){var e=Xke.call(t,I0),n=t[I0];try{t[I0]=void 0;var r=!0}catch{}var i=Kke.call(t);return r&&(e?t[I0]=n:delete t[I0]),i}var Zke=Yke,Qke=Object.prototype,Jke=Qke.toString;function eLe(t){return Jke.call(t)}var tLe=eLe,lz=Hb,nLe=Zke,rLe=tLe,iLe="[object Null]",oLe="[object Undefined]",uz=lz?lz.toStringTag:void 0;function sLe(t){return t==null?t===void 0?oLe:iLe:uz&&uz in Object(t)?nLe(t):rLe(t)}var ch=sLe;function aLe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Cg=aLe,lLe=ch,uLe=Cg,cLe="[object AsyncFunction]",dLe="[object Function]",fLe="[object GeneratorFunction]",hLe="[object Proxy]";function pLe(t){if(!uLe(t))return!1;var e=lLe(t);return e==dLe||e==fLe||e==cLe||e==hLe}var cY=pLe,mLe=Ql,gLe=mLe["__core-js_shared__"],vLe=gLe,LA=vLe,cz=function(){var t=/[^.]+$/.exec(LA&&LA.keys&&LA.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function yLe(t){return!!cz&&cz in t}var bLe=yLe,xLe=Function.prototype,wLe=xLe.toString;function _Le(t){if(t!=null){try{return wLe.call(t)}catch{}try{return t+""}catch{}}return""}var dY=_Le,SLe=cY,CLe=bLe,ELe=Cg,MLe=dY,TLe=/[\\^$.*+?()[\]{}|]/g,ALe=/^\[object .+?Constructor\]$/,PLe=Function.prototype,DLe=Object.prototype,RLe=PLe.toString,ILe=DLe.hasOwnProperty,NLe=RegExp("^"+RLe.call(ILe).replace(TLe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function FLe(t){if(!ELe(t)||CLe(t))return!1;var e=SLe(t)?NLe:ALe;return e.test(MLe(t))}var OLe=FLe;function kLe(t,e){return t==null?void 0:t[e]}var LLe=kLe,BLe=OLe,$Le=LLe;function zLe(t,e){var n=$Le(t,e);return BLe(n)?n:void 0}var dh=zLe,ULe=dh,HLe=ULe(Object,"create"),oM=HLe,dz=oM;function VLe(){this.__data__=dz?dz(null):{},this.size=0}var GLe=VLe;function jLe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var WLe=jLe,qLe=oM,XLe="__lodash_hash_undefined__",KLe=Object.prototype,YLe=KLe.hasOwnProperty;function ZLe(t){var e=this.__data__;if(qLe){var n=e[t];return n===XLe?void 0:n}return YLe.call(e,t)?e[t]:void 0}var QLe=ZLe,JLe=oM,e4e=Object.prototype,t4e=e4e.hasOwnProperty;function n4e(t){var e=this.__data__;return JLe?e[t]!==void 0:t4e.call(e,t)}var r4e=n4e,i4e=oM,o4e="__lodash_hash_undefined__";function s4e(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=i4e&&e===void 0?o4e:e,this}var a4e=s4e,l4e=GLe,u4e=WLe,c4e=QLe,d4e=r4e,f4e=a4e;function Eg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var P4e=A4e,D4e=sM;function R4e(t,e){var n=this.__data__,r=D4e(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var I4e=R4e,N4e=m4e,F4e=S4e,O4e=M4e,k4e=P4e,L4e=I4e;function Mg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e=0)&&(n[i]=t[i]);return n}function BA(t){return typeof t=="number"}function mz(t){return typeof t=="number"&&Number.isFinite(t)||typeof t=="string"}function v5e(t){var e=t.verticalAnchor,n=e===void 0?"end":e,r=t.scaleToFit,i=r===void 0?!1:r,o=t.angle,s=t.width,a=t.lineHeight,l=a===void 0?"1em":a,u=t.capHeight,c=u===void 0?"0.71em":u,d=t.children,f=t.style,h=g5e(t,m5e),p=h.x,g=p===void 0?0:p,b=h.y,m=b===void 0?0:b,w=!mz(g)||!mz(m),x=E.useMemo(function(){var A=d==null?[]:d.toString().split(/(?:(?!\u00A0+)\s+)/);return{wordsWithWidth:A.map(function(R){return{word:R,wordWidth:pz(R,f)||0}}),spaceWidth:pz(" ",f)||0}},[d,f]),_=x.wordsWithWidth,C=x.spaceWidth,S=E.useMemo(function(){return w?[]:s||i?_.reduce(function(A,R){var F=R.word,$=R.wordWidth,j=A[A.length-1];if(j&&(s==null||i||(j.width||0)+$+C0){var R=S[0].width||1,F=i==="shrink-only"?Math.min(s/R,1):s/R,$=F,j=g-F*g,k=m-$*m;A.push("matrix("+F+", 0, 0, "+$+", "+j+", "+k+")")}return o&&A.push("rotate("+o+", "+g+", "+m+")"),A.length>0?A.join(" "):""},[w,g,m,s,i,S,o]);return{wordsByLines:S,startDy:M,transform:P}}var y5e=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function LR(){return LR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var x5e={overflow:"visible"};function pY(t){var e=t.dx,n=e===void 0?0:e,r=t.dy,i=r===void 0?0:r,o=t.textAnchor,s=o===void 0?"start":o,a=t.innerRef,l=t.innerTextRef;t.verticalAnchor,t.angle;var u=t.lineHeight,c=u===void 0?"1em":u;t.scaleToFit,t.capHeight,t.width;var d=b5e(t,y5e),f=d.x,h=f===void 0?0:f,p=d.fontSize,g=v5e(t),b=g.wordsByLines,m=g.startDy,w=g.transform;return ie.createElement("svg",{ref:a,x:n,y:i,fontSize:p,style:x5e},b.length>0?ie.createElement("text",LR({ref:l,transform:w},d,{textAnchor:s}),b.map(function(x,_){return ie.createElement("tspan",{key:_,x:h,dy:_===0?m:c},x.words.join(" "))})):null)}var Ss={top:"top",left:"left",right:"right",bottom:"bottom"};function w5e(t){var e=t.labelOffset,n=t.labelProps,r=t.orientation,i=t.range,o=t.tickLabelFontSize,s=t.tickLength,a=r===Ss.left||r===Ss.top?-1:1,l,u,c;if(r===Ss.top||r===Ss.bottom){var d=r===Ss.bottom&&typeof n.fontSize=="number"?n.fontSize:0;l=(Number(i[0])+Number(i[i.length-1]))/2,u=a*(s+e+o+d)}else l=a*((Number(i[0])+Number(i[i.length-1]))/2),u=-(s+e),c="rotate("+a*90+")";return{x:l,y:u,transform:c}}function Pv(){return Pv=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function mY(t){var e=t.children,n=e===void 0?S5e:e,r=t.axisClassName,i=t.hideAxisLine,o=i===void 0?!1:i,s=t.hideTicks,a=s===void 0?!1:s,l=t.hideZero,u=l===void 0?!1:l,c=t.innerRef,d=t.left,f=d===void 0?0:d,h=t.numTicks,p=h===void 0?10:h,g=t.orientation,b=g===void 0?Ss.bottom:g,m=t.rangePadding,w=m===void 0?0:m,x=t.scale,_=t.tickFormat,C=t.tickLength,S=C===void 0?8:C,M=t.tickValues,P=t.top,A=P===void 0?0:P,R=A5e(t,T5e),F=_??E5e(x),$=b===Ss.left,j=b===Ss.top,k=j||b===Ss.bottom,U=C5e(x),G=$||j?-1:1,B=x.range(),L=M5e(w),N=ww({x:Number(B[0])+.5-L.start,y:0},k),W=ww({x:Number(B[B.length-1])+.5+L.end,y:0},k),K=(M??HF(x,p)).filter(function(J){return!u||J!==0&&J!=="0"}).map(function(J,ae){return{value:J,index:ae}}),Q=K.map(function(J){var ae=J.value,ve=J.index,fe=UF(U(ae));return{value:ae,index:ve,from:ww({x:fe,y:0},k),to:ww({x:fe,y:S*G},k),formattedValue:F(ae,ve,K)}});return ie.createElement(Ub,{className:Gl("visx-axis",r),innerRef:c,top:A,left:f},n($R({},R,{axisFromPoint:N,axisToPoint:W,hideAxisLine:o,hideTicks:a,hideZero:u,horizontal:k,numTicks:p,orientation:b,rangePadding:w,scale:x,tickFormat:F,tickLength:S,tickPosition:U,tickSign:G,ticks:Q})))}var P5e=["axisClassName","labelOffset","tickLength","tickLabelProps"];function FS(){return FS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var R5e={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function I5e(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?36:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=D5e(t,P5e),l=typeof s=="function"?s:FS({},R5e,s);return ie.createElement(mY,FS({axisClassName:Gl("visx-axis-left",e),labelOffset:r,orientation:Ss.left,tickLabelProps:l,tickLength:o},a))}var N5e=["axisClassName","labelOffset","tickLength","tickLabelProps"];function OS(){return OS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var O5e={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function k5e(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?8:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=F5e(t,N5e),l=typeof s=="function"?s:OS({},O5e,s);return ie.createElement(mY,OS({axisClassName:Gl("visx-axis-bottom",e),labelOffset:r,orientation:Ss.bottom,tickLabelProps:l,tickLength:o},a))}var gY=U5e,L5e=vY(E),B5e=vY(JK),$5e=["from","to","fill","className","innerRef"];function vY(t){return t&&t.__esModule?t:{default:t}}function zR(){return zR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function U5e(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,u=z5e(t,$5e),c=n.x===i.x||n.y===i.y;return L5e.default.createElement("line",zR({ref:l,className:(0,B5e.default)("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:c?"crispEdges":"auto"},u))}function yY(t){return"bandwidth"in t?t.bandwidth():0}var H5e=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function UR(){return UR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function bY(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.width,a=t.stroke,l=a===void 0?"#eaf0f6":a,u=t.strokeWidth,c=u===void 0?1:u,d=t.strokeDasharray,f=t.className,h=t.children,p=t.numTicks,g=p===void 0?10:p,b=t.lineStyle,m=t.offset,w=t.tickValues,x=V5e(t,H5e),_=w??HF(o,g),C=(m??0)+yY(o)/2,S=_.map(function(M,P){var A,R=((A=UF(o(M)))!=null?A:0)+C;return{index:P,from:new Gy({x:0,y:R}),to:new Gy({x:s,y:R})}});return ie.createElement(Ub,{className:Gl("visx-rows",f),top:n,left:i},h?h({lines:S}):S.map(function(M){var P=M.from,A=M.to,R=M.index;return ie.createElement(gY,UR({key:"row-line-"+R,from:P,to:A,stroke:l,strokeWidth:c,strokeDasharray:d,style:b},x))}))}bY.propTypes={tickValues:me.array,width:me.number.isRequired};var G5e=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function HR(){return HR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function xY(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.height,a=t.stroke,l=a===void 0?"#eaf0f6":a,u=t.strokeWidth,c=u===void 0?1:u,d=t.strokeDasharray,f=t.className,h=t.numTicks,p=h===void 0?10:h,g=t.lineStyle,b=t.offset,m=t.tickValues,w=t.children,x=j5e(t,G5e),_=m??HF(o,p),C=(b??0)+yY(o)/2,S=_.map(function(M,P){var A,R=((A=UF(o(M)))!=null?A:0)+C;return{index:P,from:new Gy({x:R,y:0}),to:new Gy({x:R,y:s})}});return ie.createElement(Ub,{className:Gl("visx-columns",f),top:n,left:i},w?w({lines:S}):S.map(function(M){var P=M.from,A=M.to,R=M.index;return ie.createElement(gY,HR({key:"column-line-"+R,from:P,to:A,stroke:l,strokeWidth:c,strokeDasharray:d,style:g},x))}))}xY.propTypes={tickValues:me.array,height:me.number.isRequired};function Nn(t){for(var e=t.length/6|0,n=new Array(e),r=0;rjFe(t[t.length-1]);var W5e=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Nn);const q5e=Kn(W5e);var X5e=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Nn);const K5e=Kn(X5e);var Y5e=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Nn);const Z5e=Kn(Y5e);var Q5e=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Nn);const J5e=Kn(Q5e);var eBe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Nn);const tBe=Kn(eBe);var nBe=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Nn);const rBe=Kn(nBe);var iBe=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Nn);const oBe=Kn(iBe);var sBe=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Nn);const aBe=Kn(sBe);var lBe=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Nn);const uBe=Kn(lBe);var cBe=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Nn);const dBe=Kn(cBe);var fBe=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Nn);const hBe=Kn(fBe);var pBe=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Nn);const mBe=Kn(pBe);var gBe=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Nn);const vBe=Kn(gBe);var yBe=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Nn);const bBe=Kn(yBe);var xBe=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Nn);const wBe=Kn(xBe);var _Be=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Nn);const SBe=Kn(_Be);var CBe=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Nn);const EBe=Kn(CBe);var MBe=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Nn);const TBe=Kn(MBe);var ABe=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Nn);const PBe=Kn(ABe);var DBe=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Nn);const RBe=Kn(DBe);var IBe=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Nn);const NBe=Kn(IBe);var FBe=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Nn);const OBe=Kn(FBe);var kBe=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Nn);const LBe=Kn(kBe);var BBe=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Nn);const $Be=Kn(BBe);var zBe=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Nn);const UBe=Kn(zBe);var HBe=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Nn);const VBe=Kn(HBe);var GBe=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Nn);const jBe=Kn(GBe);function WBe(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const qBe=nM(Vl(300,.5,0),Vl(-240,.5,1));var XBe=nM(Vl(-100,.75,.35),Vl(80,1.5,.8)),KBe=nM(Vl(260,.75,.35),Vl(80,1.5,.8)),_w=Vl();function YBe(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return _w.h=360*t-100,_w.s=1.5-1.5*e,_w.l=.8-.9*e,_w+""}var Sw=cd(),ZBe=Math.PI/3,QBe=Math.PI*2/3;function JBe(t){var e;return t=(.5-t)*Math.PI,Sw.r=255*(e=Math.sin(t))*e,Sw.g=255*(e=Math.sin(t+ZBe))*e,Sw.b=255*(e=Math.sin(t+QBe))*e,Sw+""}function e8e(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function uM(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const t8e=uM(Nn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var n8e=uM(Nn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),r8e=uM(Nn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),i8e=uM(Nn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),wY={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},vz=ie.createContext&&ie.createContext(wY),o8e=["attr","size","title"];function s8e(t,e){if(t==null)return{};var n=a8e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function a8e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function kS(){return kS=Object.assign?Object.assign.bind():function(t){for(var e=1;eie.createElement(e.tag,LS({key:n},e.attr),_Y(e.child)))}function Ad(t){return e=>ie.createElement(d8e,kS({attr:LS({},t.attr)},e),_Y(t.child))}function d8e(t){var e=n=>{var{attr:r,size:i,title:o}=t,s=s8e(t,o8e),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),ie.createElement("svg",kS({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:LS(LS({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&ie.createElement("title",null,o),t.children)};return vz!==void 0?ie.createElement(vz.Consumer,null,n=>e(n)):e(wY)}function f8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(t)}function h8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(t)}function p8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(t)}function m8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"},child:[]}]})(t)}var SY=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i0},t.prototype.connect_=function(){!VR||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),w8e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!VR||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=x8e.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),CY=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof ng(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new D8e(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ng(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new R8e(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),MY=typeof WeakMap<"u"?new WeakMap:new SY,TY=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=_8e.getInstance(),r=new I8e(e,n,this);MY.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){TY.prototype[t]=function(){var e;return(e=MY.get(this))[t].apply(e,arguments)}});var N8e=function(){return typeof BS.ResizeObserver<"u"?BS.ResizeObserver:TY}(),F8e=["client","offset","scroll","bounds","margin"];function xz(t){var e=[];return F8e.forEach(function(n){t[n]&&e.push(n)}),e}function wz(t,e){var n={};if(e.indexOf("client")>-1&&(n.client={top:t.clientTop,left:t.clientLeft,width:t.clientWidth,height:t.clientHeight}),e.indexOf("offset")>-1&&(n.offset={top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}),e.indexOf("scroll")>-1&&(n.scroll={top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}),e.indexOf("bounds")>-1){var r=t.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(e.indexOf("margin")>-1){var i=getComputedStyle(t);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function O8e(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||window}function k8e(t){return function(e){var n,r;return r=n=function(i){RI(o,i);function o(){for(var a,l=arguments.length,u=new Array(l),c=0;c0?e=t-1:this._settings.wrap?e=this._members.length-1:e=t,this.focusNodeAtIndex(e),e};pr.prototype.moveFocusToFirst=function(){this.focusNodeAtIndex(0)};pr.prototype.moveFocusToLast=function(){this.focusNodeAtIndex(this._members.length-1)};pr.prototype._handleUnboundKey=function(t){if(this._settings.stringSearch){if(this._searchString!==""&&(t.key===" "||t.keyCode===32))return t.preventDefault(),-1;if(!W8e(t.keyCode)||t.ctrlKey||t.metaKey||t.altKey)return-1;t.preventDefault(),this._addToSearchString(String.fromCharCode(t.keyCode)),this._runStringSearch()}};pr.prototype._clearSearchString=function(){this._searchString=""};pr.prototype._addToSearchString=function(t){this._searchString+=t.toLowerCase()};pr.prototype._startSearchStringRefreshTimer=function(){var t=this;this._clearSearchStringRefreshTimer(),this._stringSearchTimer=setTimeout(function(){t._clearSearchString()},this._settings.stringSearchDelay)};pr.prototype._clearSearchStringRefreshTimer=function(){clearTimeout(this._stringSearchTimer)};pr.prototype._runStringSearch=function(){this._startSearchStringRefreshTimer(),this.moveFocusByString(this._searchString)};pr.prototype.moveFocusByString=function(t){for(var e,n=0,r=this._members.length;n=65&&t<=90}function RY(t){!t||!t.focus||(t.focus(),t.tagName.toLowerCase()==="input"&&t.select())}var q8e=function(e){return new pr(e)},X8e=q8e,_z=DY,K8e={wrap:!0,stringSearch:!0},Y8e={init:function(e){this.updateOptions(e),this.handleBlur=Z8e.bind(this),this.handleSelection=Q8e.bind(this),this.handleMenuKey=J8e.bind(this),this.focusGroup=X8e(K8e),this.button=null,this.menu=null,this.isOpen=!1},updateOptions:function(e){var n=this.options;this.options=e||this.options||{},typeof this.options.closeOnSelection>"u"&&(this.options.closeOnSelection=!0),typeof this.options.closeOnBlur>"u"&&(this.options.closeOnBlur=!0),this.options.id&&_z.registerManager(this.options.id,this),n&&n.id&&n.id!==this.options.id&&_z.unregisterManager(this.options.id,this)},focusItem:function(e){this.focusGroup.focusNodeAtIndex(e)},addItem:function(e){this.focusGroup.addMember(e)},clearItems:function(){this.focusGroup.clearMembers()},handleButtonNonArrowKey:function(e){this.focusGroup._handleUnboundKey(e)},destroy:function(){this.button=null,this.menu=null,this.focusGroup.deactivate(),clearTimeout(this.blurTimer),clearTimeout(this.moveFocusTimer)},update:function(){this.menu.setState({isOpen:this.isOpen}),this.button.setState({menuOpen:this.isOpen}),this.options.onMenuToggle&&this.options.onMenuToggle({isOpen:this.isOpen})},openMenu:function(e){if(!this.isOpen&&(e=e||{},e.focusMenu===void 0&&(e.focusMenu=!0),this.isOpen=!0,this.update(),this.focusGroup.activate(),e.focusMenu)){var n=this;this.moveFocusTimer=setTimeout(function(){n.focusItem(0)},0)}},closeMenu:function(e){this.isOpen&&(e=e||{},this.isOpen=!1,this.update(),e.focusButton&&this.button.ref.current.focus())},toggleMenu:function(e,n){e=e||{},n=n||{},this.isOpen?this.closeMenu(e):this.openMenu(n)}};function Z8e(){var t=this;t.blurTimer=setTimeout(function(){if(t.button){var e=t.button.ref.current;if(e){var n=e.ownerDocument.activeElement;if(!(e&&n===e)){var r=t.menu.ref.current;if(r===n){t.focusItem(0);return}r&&r.contains(n)||t.isOpen&&t.closeMenu({focusButton:!1})}}}},0)}function Q8e(t,e){this.options.closeOnSelection&&this.closeMenu({focusButton:!0}),this.options.onSelection&&this.options.onSelection(t,e)}function J8e(t){if(this.isOpen)switch(t.key){case"Escape":t.preventDefault(),this.closeMenu({focusButton:!0});break;case"Home":t.preventDefault(),this.focusGroup.moveFocusToFirst();break;case"End":t.preventDefault(),this.focusGroup.moveFocusToLast();break}}var e6e=function(t){var e=Object.create(Y8e);return e.init(t),e},t6e=E,n6e=t6e.createContext(),fM=n6e,Cw=ag,hM={refType:Cw.oneOfType([Cw.func,Cw.shape({current:Cw.elementType})])},pM=function(t,e,n){n=n||{};for(var r in e)e.hasOwnProperty(r)&&(n[r]||(t[r]=e[r]))};function r6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i6e(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function o6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Rv=E,fp=ag,s6e=e6e,a6e=fM,l6e=hM,u6e=l6e.refType,GR=pM,zS={children:fp.node.isRequired,forwardedRef:u6e,onMenuToggle:fp.func,onSelection:fp.func,closeOnSelection:fp.bool,closeOnBlur:fp.bool,tag:fp.string},Sz=function(e){return{onMenuToggle:e.onMenuToggle,onSelection:e.onSelection,closeOnSelection:e.closeOnSelection,closeOnBlur:e.closeOnBlur,id:e.id}},qF=function(t){o6e(e,t);function e(n){r6e(this,e);var r=i6e(this,t.call(this,n));return r.manager=s6e(Sz(n)),r}return e.prototype.componentDidUpdate=function(){this.manager.updateOptions(Sz(this.props))},e.prototype.render=function(){var r={};return GR(r,this.props,zS),Rv.createElement(a6e.Provider,{value:this.manager},Rv.createElement(this.props.tag,r,this.props.children))},e}(Rv.Component);qF.propTypes=zS;qF.defaultProps={tag:"div"};var c6e=Rv.forwardRef(function(t,e){var n={forwardedRef:e};return GR(n,t,{children:zS.children,forwardedRef:zS.forwardedRef}),GR(n,{forwardedRef:e}),Rv.createElement(qF,n,t.children)});function d6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cz(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function f6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Cm=E,Ew=ag,h6e=fM,p6e=hM,m6e=p6e.refType,h_=pM,Iv={ambManager:Ew.object.isRequired,children:Ew.node.isRequired,disabled:Ew.bool,forwardedRef:m6e,tag:Ew.string},g6e=function(){return["button","fieldset","input","optgroup","option","select","textarea"]},XF=function(t){f6e(e,t);function e(){var n,r,i;d6e(this,e);for(var o=arguments.length,s=Array(o),a=0;a=0&&delete s.disabled,i.options.closeOnBlur&&(o.onBlur=i.handleBlur),h_(o,r,s),h_(o,{ref:this.setRef}),Cm.createElement(r.tag,o,r.children)},e}(Cm.Component);XF.propTypes=Iv;XF.defaultProps={tag:"span"};var v6e=Cm.forwardRef(function(t,e){return Cm.createElement(h6e.Consumer,null,function(n){var r={ambManager:n,forwardedRef:e};return h_(r,t,{ambManager:Iv.ambManager,children:Iv.children,forwardedRef:Iv.forwardedRef}),Cm.createElement(XF,r,t.children)})}),y6e=function(e,n,r){var i=0,o=0,s=!1,a=!1,l=!1;e.addEventListener("click",u,r),e.addEventListener("touchstart",c,r);function u(b){l||n(b)}function c(b){l=!0,!s&&(s=!0,e.addEventListener("touchmove",d,r),e.addEventListener("touchend",f,r),e.addEventListener("touchcancel",h,r),a=!1,i=b.touches[0].clientX,o=b.touches[0].clientY)}function d(b){a||Math.abs(b.touches[0].clientX-i)<=10&&Math.abs(b.touches[0].clientY-o)<=10||(a=!0)}function f(b){s=!1,p(),a||n(b)}function h(){s=!1,a=!1,i=0,o=0}function p(){e.removeEventListener("touchmove",d,r),e.removeEventListener("touchend",f,r),e.removeEventListener("touchcancel",h,r)}function g(){e.removeEventListener("click",u,r),e.removeEventListener("touchstart",c,r),p()}return{remove:g}};function b6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ez(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function x6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Em=E,N0=ag,w6e=y6e,_6e=fM,S6e=hM,C6e=S6e.refType,jR=pM,Nv={ambManager:N0.object.isRequired,children:N0.oneOfType([N0.func,N0.node]).isRequired,forwardedRef:C6e,tag:N0.string},KF=function(t){x6e(e,t);function e(){var n,r,i;b6e(this,e);for(var o=arguments.length,s=Array(o),a=0;ae in t?I6e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Mw=(t,e,n)=>(N6e(t,typeof e!="symbol"?e+"":e,n),n);const ZF=E.createContext({}),F6e=E.createContext(void 0),O6e="_wrapper_9665499",k6e="_grid_5146261",L6e="_innerContainer_27a3adb",B6e="_colHeaders_a985f35",$6e="_rowHeaders_63b4056",z6e="_indexCell_080a16e",U6e="_stickyGrid_33fa7fa",H6e="_cell_2658e21",V6e="_topLeftCell_e826718 _indexCell_080a16e",sf={wrapper:O6e,grid:k6e,innerContainer:L6e,colHeaders:B6e,rowHeaders:$6e,indexCell:z6e,stickyGrid:U6e,cell:H6e,topLeftCell:V6e};function G6e(t){const{rowIndex:e,columnIndex:n,style:r}=t,{rowHeaderCellsWidth:i,cellSize:o,cellFormatter:s}=E.useContext(ZF);return D.jsx("div",{className:sf.cell,style:{...r,left:r.left+i,top:r.top+o.height},role:"cell","aria-rowindex":e,"aria-colindex":n,"data-bg":(e+n)%2===1||void 0,children:s(e,n)})}E.memo(G6e);function Az(t){const{indexMin:e,indexMax:n,width:r,transform:i,headers:o}=t,{cellSize:s}=E.useContext(ZF);return D.jsx(D.Fragment,{children:$W(e,n+1).map(a=>D.jsx("div",{className:sf.indexCell,style:{width:r||s.width,height:s.height,transform:i},"data-bg":a%2===1?"":void 0,children:a>=0&&o?o[a]:a},a.toString()))})}const j6e=E.forwardRef((t,e)=>{const{children:n,style:r}=t,{rowCount:i,columnCount:o,cellSize:s,sticky:a,rowHeaderCellsWidth:l,columnHeaders:u}=E.useContext(ZF),c=E.useContext(F6e),{overscanColumnStartIndex:d=0,overscanColumnStopIndex:f=0,overscanRowStartIndex:h=0,overscanRowStopIndex:p=0}=c||{};return D.jsxs("div",{ref:e,className:sf.stickyGrid,style:{...r,width:r.width+l,height:r.height+s.height},role:"table","aria-rowcount":i,"aria-colcount":o,"data-sticky":a||void 0,children:[D.jsxs("div",{className:sf.colHeaders,children:[D.jsx("div",{className:sf.topLeftCell,style:{width:l,height:s.height},"data-bg":!0,"aria-hidden":"true"}),D.jsx(Az,{indexMin:d,indexMax:f,transform:`translateX(${s.width*d}px)`,headers:u})]}),D.jsxs("div",{className:sf.innerContainer,children:[D.jsx("div",{className:sf.rowHeaders,"aria-hidden":"true",children:D.jsx(Az,{indexMin:h,indexMax:p,transform:`translateY(${s.height*h}px)`,width:l})}),n]})]})});j6e.displayName="StickyGrid";var nf=(t=>(t.Bool="Boolean",t.Integer="Integer",t.Unsigned="Integer (unsigned)",t.Float="Float",t.Complex="Complex",t.String="String",t.Compound="Compound",t.Array="Array",t.VLen="Array (variable length)",t.Enum="Enumeration",t.Time="Time",t.Bitfield="Bitfield",t.Opaque="Opaque",t.Reference="Reference",t.Unknown="Unknown",t))(nf||{}),hn=(t=>(t.Linear="linear",t.Log="log",t.SymLog="symlog",t.Sqrt="sqrt",t.Gamma="gamma",t))(hn||{});hn.Linear,hn.Log,hn.SymLog;hn.Linear,hn.Log,hn.SymLog,hn.Sqrt;const Pz=Yl(".3~e"),zA=Yl(".5~e");Yl(".5~g");Yl(".3~g");K6e(".12~g");const QF=3,W6e=/0\.([0-9]+)$/u,q6e=Yl(`.${QF}~g`),X6e=Yl(`.${QF}~e`);function UA(t){const e=q6e(t),n=W6e.exec(e);return n&&n[1].length>QF?X6e(t):e}function K6e(t,e=!1){const n=Yl(t);return r=>{const[i,o]=r;if(o===0&&!e)return`${n(i)}`;if(i===0&&!e)return`${n(o)} i`;const s=Math.sign(o)>=0?" + ":" − ";return`${n(i)}${s}${n(Math.abs(o))} i`}}function Y6e(t){const[e,n]=t.shape;return{rows:e,cols:n}}function WR(t){return Array.isArray(t)?t:[t]}nf.Unsigned,nf.Integer,nf.Float,nf.String,nf.Bool,nf.Complex;function Z6e(t){return t!==void 0}function Q6e(t){return t!==null}function p_(t,e="Expected some value"){if(!Z6e(t))throw new TypeError(e)}function HA(t,e="Expected value to not be null"){if(!Q6e(t))throw new TypeError(e)}const J6e=new oe(0,0,0);class om extends wa{get size(){const{x:e,y:n}=this.getSize(new oe);return{width:e,height:n}}get center(){return this.getCenter(new oe)}static empty(e=J6e){return new om(e.clone(),e.clone())}static fromPoints(...e){return new om().setFromPoints(e)}static fromSize({width:e,height:n}){return om.empty().expandBySize(e,n)}clampPoint(e){return super.clampPoint(e,new oe)}expandBySize(e,n){const{size:r}=this,i=e<0?Math.max(e,-r.width):e,o=n<0?Math.max(n,-r.height):n;return this.expandByVector(new oe(i,o).divideScalar(2))}expandToRatio(e){if(e===void 0||e<=0)return this;const{width:n,height:r}=this.size,i=n/r;return e>i?this.expandBySize(r*e-n,0):this.expandBySize(0,n/e-r)}hasMinSize(e,n=e){const{width:r,height:i}=this.size;return r>=e&&i>=n}keepWithin(e){const{center:n,size:r}=this,{width:i,height:o}=e.size,s=om.empty(e.center).expandBySize(Math.max(i-r.width,0),Math.max(o-r.height,0)).clampPoint(n).sub(n).setZ(0);return this.translate(s)}toRect(){return[this.min,this.max]}}const fd=om;function Dz(t,e){const n=e-t;return r=>n!==0?(r-t)/n:.5}function NY(t){let e=(t==null?void 0:t.domain)||[0,1],n=(t==null?void 0:t.range)||[0,1],r=(t==null?void 0:t.exponent)??1,i=(t==null?void 0:t.clamp)||!1,o=tg,s;const a=function(M){const P=typeof M=="number"?M:M.valueOf();return Number.isNaN(P)?s:o(...n)(Dz(...e)(l(P))**r)};function l(M){if(!i)return M;const[P,A]=e;return Math.max(P,Math.min(A,M))}function u(M){return M?(e=M,S):[...e]}function c(M){return M?(n=M,S):[...n]}function d(M){return M?(n=M,o=FF,S):[...n]}function f(M){return M?(i=M,S):i}function h(){return s}function p(M){return M?(o=M,S):o}function g(M){return M?(r=M,S):r}function b(M){return l(tg(...e)(Dz(...n)(M)**(1/r)))}function m(){return lke({domain:e,range:n,exponent:r,clamp:i})}function w(M){return e=m().nice(M).domain(),S}function x(M){return m().ticks(M)}function _(M,P){return m().tickFormat(M,P)}function C(){return NY().domain(e).range(n).exponent(r).clamp(i).interpolate(o)}const S=Object.assign(a,{domain:u,range:c,rangeRound:d,clamp:f,interpolate:p,invert:b,unknown:h,exponent:g,nice:w,ticks:x,tickFormat:_,copy:C});return S}const e$e=[.1,1],t$e={left:80,right:24,top:16,bottom:34},n$e=28,Rz=24;hn.Linear+"",hn.Log+"",Number.MIN_VALUE,hn.SymLog+"",hn.Sqrt+"",hn.Gamma+"";const r$e=zF({domain:[300,900],range:[3,10],clamp:!0,round:!0}),i$e=zF({domain:[300,500],range:[.8,1.4]});function FY(t,e){if(Array.isArray(t)){const[,n]=t;return NY({...e,exponent:n})}switch(t){case hn.Linear:return zF(e);case hn.Log:return ske(e);case hn.SymLog:return cke(e);case hn.Sqrt:return fke(e)}throw new Error("Unknown scale type")}function o$e(t,e){const{width:n,height:r}=t;return e?n/r>e?{width:r*e,height:r}:{width:n,height:n/e}:{width:n,height:r}}function s$e(t,e=[-Number.MAX_VALUE/2,Number.MAX_VALUE/2]){const[n,r]=e;return jq.clamp(t,n,r)}function Iz(t,e){const{scaleType:n,visDomain:r,flip:i,nice:o=!1}=t;return FY(n??hn.Linear,{domain:r,range:[-e/2,e/2],reverse:i,nice:o})}function a$e(t,e){const n=Math.min(...t),r=Math.max(...t),i=Math.ceil(n),o=Math.floor(r),s=o-i+1,a=Math.min(s,e);if(a===0)return[];const l=Math.max(BW(i,o,a),1),u=Math.ceil(n/l),c=Math.floor(r/l)-u+1;return Array.from({length:c},(d,f)=>(u+f)*l)}function l$e(t,e,n){if(n!==hn.Log)return UA;const[r,i]=t[0]>0?t:[-t[1],-[t[0]]],o=i$e(e);return i/r<10**o?UA:s=>{const a=Math.log10(Math.abs(s.valueOf()));return a===Math.floor(a)?UA(s):""}}function OY(t,e,n){if(t==="auto")return;if(t==="equal")return OY(1,e,n);const[r,i]=e,[o,s]=n;return Math.abs(i-r)/Math.abs(s-o)/t}function u$e(t={}){const{left:e,right:n,top:r,bottom:i}=t$e;return{left:e+(t.left?Rz:0),right:n,top:r+(t.top?n$e:0),bottom:i+(t.bottom?Rz:0)}}const c$e=` +*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",s=0;s=0)&&(n[i]=t[i]);return n}function Ub(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.transform,s=t.className,a=t.children,l=t.innerRef,u=mke(t,pke);return ie.createElement("g",NR({ref:l,className:Gl("visx-group",s),transform:o||"translate("+i+", "+n+")"},u),a)}Ub.propTypes={top:me.number,left:me.number,transform:me.string,className:me.string,children:me.node,innerRef:me.oneOfType([me.string,me.func,me.object])};var gke=["from","to","fill","className","innerRef"];function FR(){return FR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function eY(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,u=vke(t,gke),c=n.x===i.x||n.y===i.y;return ie.createElement("line",FR({ref:l,className:Gl("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:c?"crispEdges":"auto"},u))}var yke=tY;function tY(t,e,n){t instanceof RegExp&&(t=oz(t,n)),e instanceof RegExp&&(e=oz(e,n));var r=nY(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function oz(t,e){var n=e.match(t);return n?n[0]:null}tY.range=nY;function nY(t,e,n){var r,i,o,s,a,l=n.indexOf(t),u=n.indexOf(e,l+1),c=l;if(l>=0&&u>0){for(r=[],o=n.length;c>=0&&!a;)c==l?(r.push(c),l=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),u]:(i=r.pop(),i=0?l:u;r.length&&(a=[o,s])}return a}var bke=rY;function rY(t,e,n){t instanceof RegExp&&(t=sz(t,n)),e instanceof RegExp&&(e=sz(e,n));var r=iY(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function sz(t,e){var n=e.match(t);return n?n[0]:null}rY.range=iY;function iY(t,e,n){var r,i,o,s,a,l=n.indexOf(t),u=n.indexOf(e,l+1),c=l;if(l>=0&&u>0){if(t===e)return[l,u];for(r=[],o=n.length;c>=0&&!a;)c==l?(r.push(c),l=n.indexOf(t,c+1)):r.length==1?a=[r.pop(),u]:(i=r.pop(),i=0?l:u;r.length&&(a=[o,s])}return a}var xke=bke,wke=oY;function oY(t,e,n){var r=t;return _ke(t,e).reduce(function(i,o){return i.replace(o.functionIdentifier+"("+o.matches.body+")",Ske(o.matches.body,o.functionIdentifier,n,r,e))},t)}function _ke(t,e){var n=[],r=typeof e=="string"?new RegExp("\\b("+e+")\\("):e;do{var i=r.exec(t);if(!i)return n;if(i[1]===void 0)throw new Error("Missing the first couple of parenthesis to get the function identifier in "+e);var o=i[1],s=i.index,a=xke("(",")",t.substring(s));if(!a||a.start!==i[0].length-1)throw new SyntaxError(o+"(): missing closing ')' in the value '"+t+"'");n.push({matches:a,functionIdentifier:o}),t=a.post}while(r.test(t));return n}function Ske(t,e,n,r,i){return n(oY(t,i,n),e,r)}var yo=function(t){this.value=t};yo.math={isDegree:!0,acos:function(t){return yo.math.isDegree?180/Math.PI*Math.acos(t):Math.acos(t)},add:function(t,e){return t+e},asin:function(t){return yo.math.isDegree?180/Math.PI*Math.asin(t):Math.asin(t)},atan:function(t){return yo.math.isDegree?180/Math.PI*Math.atan(t):Math.atan(t)},acosh:function(t){return Math.log(t+Math.sqrt(t*t-1))},asinh:function(t){return Math.log(t+Math.sqrt(t*t+1))},atanh:function(t){return Math.log((1+t)/(1-t))},C:function(t,e){var n=1,r=t-e,i=e;iwo.length-2?wo.length-1:t.length-s;i>0;i--)if(wo[i]!==void 0)for(o=0;o0&&ur)s.push(e);else{for(;r>=i&&!u||u&&i"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===7)typeof e[e.length-1].type>"u"?e[e.length-1].value.push(o[a]):e[e.length-1].value=o[a].value(e[e.length-1].value);else if(o[a].type===8){for(var l=[],u=0;u"u"?(r.value=r.concat(n),r.value.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===2||o[a].type===9?(n=e.pop(),r=e.pop(),typeof r.type>"u"?(r=r.concat(n),r.push(o[a]),e.push(r)):typeof n.type>"u"?(n.unshift(r),n.push(o[a]),e.push(n)):e.push({type:1,value:o[a].value(r.value,n.value)})):o[a].type===12?(n=e.pop(),typeof n.type<"u"&&(n=[n]),r=e.pop(),i=e.pop(),e.push({type:1,value:o[a].value(i.value,r.value,new Av(n))})):o[a].type===13&&(s?e.push({value:t[o[a].value],type:3}):e.push([o[a]]));if(e.length>1)throw new Av.Exception("Uncaught Syntax error");return e[0].value>1e15?"Infinity":parseFloat(e[0].value.toFixed(15))};Av.eval=function(t,e,n){return typeof e>"u"?this.lex(t).toPostfix().postfixEval():typeof n>"u"?typeof e.length<"u"?this.lex(t,e).toPostfix().postfixEval():this.lex(t).toPostfix().postfixEval(e):this.lex(t,e).toPostfix().postfixEval(n)};var Ike=Av,aY=Ike;aY.prototype.formulaEval=function(){for(var t,e,n,r=[],i=this.value,o=0;o"+e.value+""+i[o].show+""+t.value+"",type:10}):r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+""+t.value+"",type:1})):i[o].type===2||i[o].type===9?(t=r.pop(),e=r.pop(),r.push({value:(e.type!=1?"(":"")+e.value+(e.type!=1?")":"")+i[o].show+(t.type!=1?"(":"")+t.value+(t.type!=1?")":""),type:i[o].type})):i[o].type===12&&(t=r.pop(),e=r.pop(),n=r.pop(),r.push({value:i[o].show+"("+n.value+","+e.value+","+t.value+")",type:12}));return r[0].value};var Nke=aY,Fke=yke,Oke=wke,kke=Nke,Lke=100,Bke=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,OA,$ke=zke;function zke(t,e){OA=0,e=Math.pow(10,e===void 0?5:e),t=t.replace(/\n+/g," ");function n(i,o,s){if(OA++>Lke)throw OA=0,new Error("Call stack overflow for "+s);if(i==="")throw new Error(o+"(): '"+s+"' must contain a non-whitespace string");i=r(i,s);var a=Uke(i);if(a.length>1||i.indexOf("var(")>-1)return o+"("+i+")";var l=a[0]||"";l==="%"&&(i=i.replace(/\b[0-9\.]+%/g,function(d){return parseFloat(d.slice(0,-1))*.01}));var u=i.replace(new RegExp(l,"gi"),""),c;try{c=kke.eval(u)}catch{return o+"("+i+")"}return l==="%"&&(c*=100),(o.length||l==="%")&&(c=Math.round(c*e)/e),c+=l,c}function r(i,o){i=i.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var s="",a=i,l;l=Bke.exec(a);){l[0].index>0&&(s+=a.substring(0,l[0].index));var u=Fke("(",")",a.substring([0].index));if(u.body==="")throw new Error("'"+i+"' must contain a non-whitespace string");var c=n(u.body,"",o);s+=u.pre+c,a=u.post}return s+a}return Oke(t,/((?:\-[a-z]+\-)?calc)\(/,n)}function Uke(t){for(var e=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(t);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(e.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(t));return e}const kA=va($ke);var Hke=typeof W1=="object"&&W1&&W1.Object===Object&&W1,lY=Hke,Vke=lY,Gke=typeof self=="object"&&self&&self.Object===Object&&self,jke=Vke||Gke||Function("return this")(),Ql=jke,Wke=Ql,qke=Wke.Symbol,Hb=qke,az=Hb,uY=Object.prototype,Xke=uY.hasOwnProperty,Kke=uY.toString,I0=az?az.toStringTag:void 0;function Yke(t){var e=Xke.call(t,I0),n=t[I0];try{t[I0]=void 0;var r=!0}catch{}var i=Kke.call(t);return r&&(e?t[I0]=n:delete t[I0]),i}var Zke=Yke,Qke=Object.prototype,Jke=Qke.toString;function eLe(t){return Jke.call(t)}var tLe=eLe,lz=Hb,nLe=Zke,rLe=tLe,iLe="[object Null]",oLe="[object Undefined]",uz=lz?lz.toStringTag:void 0;function sLe(t){return t==null?t===void 0?oLe:iLe:uz&&uz in Object(t)?nLe(t):rLe(t)}var ch=sLe;function aLe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Cg=aLe,lLe=ch,uLe=Cg,cLe="[object AsyncFunction]",dLe="[object Function]",fLe="[object GeneratorFunction]",hLe="[object Proxy]";function pLe(t){if(!uLe(t))return!1;var e=lLe(t);return e==dLe||e==fLe||e==cLe||e==hLe}var cY=pLe,mLe=Ql,gLe=mLe["__core-js_shared__"],vLe=gLe,LA=vLe,cz=function(){var t=/[^.]+$/.exec(LA&&LA.keys&&LA.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function yLe(t){return!!cz&&cz in t}var bLe=yLe,xLe=Function.prototype,wLe=xLe.toString;function _Le(t){if(t!=null){try{return wLe.call(t)}catch{}try{return t+""}catch{}}return""}var dY=_Le,SLe=cY,CLe=bLe,ELe=Cg,MLe=dY,TLe=/[\\^$.*+?()[\]{}|]/g,ALe=/^\[object .+?Constructor\]$/,PLe=Function.prototype,DLe=Object.prototype,RLe=PLe.toString,ILe=DLe.hasOwnProperty,NLe=RegExp("^"+RLe.call(ILe).replace(TLe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function FLe(t){if(!ELe(t)||CLe(t))return!1;var e=SLe(t)?NLe:ALe;return e.test(MLe(t))}var OLe=FLe;function kLe(t,e){return t==null?void 0:t[e]}var LLe=kLe,BLe=OLe,$Le=LLe;function zLe(t,e){var n=$Le(t,e);return BLe(n)?n:void 0}var dh=zLe,ULe=dh,HLe=ULe(Object,"create"),oM=HLe,dz=oM;function VLe(){this.__data__=dz?dz(null):{},this.size=0}var GLe=VLe;function jLe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var WLe=jLe,qLe=oM,XLe="__lodash_hash_undefined__",KLe=Object.prototype,YLe=KLe.hasOwnProperty;function ZLe(t){var e=this.__data__;if(qLe){var n=e[t];return n===XLe?void 0:n}return YLe.call(e,t)?e[t]:void 0}var QLe=ZLe,JLe=oM,e4e=Object.prototype,t4e=e4e.hasOwnProperty;function n4e(t){var e=this.__data__;return JLe?e[t]!==void 0:t4e.call(e,t)}var r4e=n4e,i4e=oM,o4e="__lodash_hash_undefined__";function s4e(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=i4e&&e===void 0?o4e:e,this}var a4e=s4e,l4e=GLe,u4e=WLe,c4e=QLe,d4e=r4e,f4e=a4e;function Eg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var P4e=A4e,D4e=sM;function R4e(t,e){var n=this.__data__,r=D4e(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var I4e=R4e,N4e=m4e,F4e=S4e,O4e=M4e,k4e=P4e,L4e=I4e;function Mg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e=0)&&(n[i]=t[i]);return n}function BA(t){return typeof t=="number"}function mz(t){return typeof t=="number"&&Number.isFinite(t)||typeof t=="string"}function v5e(t){var e=t.verticalAnchor,n=e===void 0?"end":e,r=t.scaleToFit,i=r===void 0?!1:r,o=t.angle,s=t.width,a=t.lineHeight,l=a===void 0?"1em":a,u=t.capHeight,c=u===void 0?"0.71em":u,d=t.children,f=t.style,h=g5e(t,m5e),p=h.x,g=p===void 0?0:p,b=h.y,m=b===void 0?0:b,w=!mz(g)||!mz(m),x=E.useMemo(function(){var A=d==null?[]:d.toString().split(/(?:(?!\u00A0+)\s+)/);return{wordsWithWidth:A.map(function(R){return{word:R,wordWidth:pz(R,f)||0}}),spaceWidth:pz(" ",f)||0}},[d,f]),_=x.wordsWithWidth,C=x.spaceWidth,S=E.useMemo(function(){return w?[]:s||i?_.reduce(function(A,R){var F=R.word,$=R.wordWidth,j=A[A.length-1];if(j&&(s==null||i||(j.width||0)+$+C0){var R=S[0].width||1,F=i==="shrink-only"?Math.min(s/R,1):s/R,$=F,j=g-F*g,k=m-$*m;A.push("matrix("+F+", 0, 0, "+$+", "+j+", "+k+")")}return o&&A.push("rotate("+o+", "+g+", "+m+")"),A.length>0?A.join(" "):""},[w,g,m,s,i,S,o]);return{wordsByLines:S,startDy:M,transform:P}}var y5e=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function LR(){return LR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var x5e={overflow:"visible"};function pY(t){var e=t.dx,n=e===void 0?0:e,r=t.dy,i=r===void 0?0:r,o=t.textAnchor,s=o===void 0?"start":o,a=t.innerRef,l=t.innerTextRef;t.verticalAnchor,t.angle;var u=t.lineHeight,c=u===void 0?"1em":u;t.scaleToFit,t.capHeight,t.width;var d=b5e(t,y5e),f=d.x,h=f===void 0?0:f,p=d.fontSize,g=v5e(t),b=g.wordsByLines,m=g.startDy,w=g.transform;return ie.createElement("svg",{ref:a,x:n,y:i,fontSize:p,style:x5e},b.length>0?ie.createElement("text",LR({ref:l,transform:w},d,{textAnchor:s}),b.map(function(x,_){return ie.createElement("tspan",{key:_,x:h,dy:_===0?m:c},x.words.join(" "))})):null)}var Ss={top:"top",left:"left",right:"right",bottom:"bottom"};function w5e(t){var e=t.labelOffset,n=t.labelProps,r=t.orientation,i=t.range,o=t.tickLabelFontSize,s=t.tickLength,a=r===Ss.left||r===Ss.top?-1:1,l,u,c;if(r===Ss.top||r===Ss.bottom){var d=r===Ss.bottom&&typeof n.fontSize=="number"?n.fontSize:0;l=(Number(i[0])+Number(i[i.length-1]))/2,u=a*(s+e+o+d)}else l=a*((Number(i[0])+Number(i[i.length-1]))/2),u=-(s+e),c="rotate("+a*90+")";return{x:l,y:u,transform:c}}function Pv(){return Pv=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function mY(t){var e=t.children,n=e===void 0?S5e:e,r=t.axisClassName,i=t.hideAxisLine,o=i===void 0?!1:i,s=t.hideTicks,a=s===void 0?!1:s,l=t.hideZero,u=l===void 0?!1:l,c=t.innerRef,d=t.left,f=d===void 0?0:d,h=t.numTicks,p=h===void 0?10:h,g=t.orientation,b=g===void 0?Ss.bottom:g,m=t.rangePadding,w=m===void 0?0:m,x=t.scale,_=t.tickFormat,C=t.tickLength,S=C===void 0?8:C,M=t.tickValues,P=t.top,A=P===void 0?0:P,R=A5e(t,T5e),F=_??E5e(x),$=b===Ss.left,j=b===Ss.top,k=j||b===Ss.bottom,U=C5e(x),G=$||j?-1:1,B=x.range(),L=M5e(w),N=ww({x:Number(B[0])+.5-L.start,y:0},k),W=ww({x:Number(B[B.length-1])+.5+L.end,y:0},k),K=(M??HF(x,p)).filter(function(J){return!u||J!==0&&J!=="0"}).map(function(J,ae){return{value:J,index:ae}}),Q=K.map(function(J){var ae=J.value,ve=J.index,fe=UF(U(ae));return{value:ae,index:ve,from:ww({x:fe,y:0},k),to:ww({x:fe,y:S*G},k),formattedValue:F(ae,ve,K)}});return ie.createElement(Ub,{className:Gl("visx-axis",r),innerRef:c,top:A,left:f},n($R({},R,{axisFromPoint:N,axisToPoint:W,hideAxisLine:o,hideTicks:a,hideZero:u,horizontal:k,numTicks:p,orientation:b,rangePadding:w,scale:x,tickFormat:F,tickLength:S,tickPosition:U,tickSign:G,ticks:Q})))}var P5e=["axisClassName","labelOffset","tickLength","tickLabelProps"];function FS(){return FS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var R5e={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function I5e(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?36:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=D5e(t,P5e),l=typeof s=="function"?s:FS({},R5e,s);return ie.createElement(mY,FS({axisClassName:Gl("visx-axis-left",e),labelOffset:r,orientation:Ss.left,tickLabelProps:l,tickLength:o},a))}var N5e=["axisClassName","labelOffset","tickLength","tickLabelProps"];function OS(){return OS=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var O5e={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function k5e(t){var e=t.axisClassName,n=t.labelOffset,r=n===void 0?8:n,i=t.tickLength,o=i===void 0?8:i,s=t.tickLabelProps,a=F5e(t,N5e),l=typeof s=="function"?s:OS({},O5e,s);return ie.createElement(mY,OS({axisClassName:Gl("visx-axis-bottom",e),labelOffset:r,orientation:Ss.bottom,tickLabelProps:l,tickLength:o},a))}var gY=U5e,L5e=vY(E),B5e=vY(JK),$5e=["from","to","fill","className","innerRef"];function vY(t){return t&&t.__esModule?t:{default:t}}function zR(){return zR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function U5e(t){var e=t.from,n=e===void 0?{x:0,y:0}:e,r=t.to,i=r===void 0?{x:1,y:1}:r,o=t.fill,s=o===void 0?"transparent":o,a=t.className,l=t.innerRef,u=z5e(t,$5e),c=n.x===i.x||n.y===i.y;return L5e.default.createElement("line",zR({ref:l,className:(0,B5e.default)("visx-line",a),x1:n.x,y1:n.y,x2:i.x,y2:i.y,fill:s,shapeRendering:c?"crispEdges":"auto"},u))}function yY(t){return"bandwidth"in t?t.bandwidth():0}var H5e=["top","left","scale","width","stroke","strokeWidth","strokeDasharray","className","children","numTicks","lineStyle","offset","tickValues"];function UR(){return UR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function bY(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.width,a=t.stroke,l=a===void 0?"#eaf0f6":a,u=t.strokeWidth,c=u===void 0?1:u,d=t.strokeDasharray,f=t.className,h=t.children,p=t.numTicks,g=p===void 0?10:p,b=t.lineStyle,m=t.offset,w=t.tickValues,x=V5e(t,H5e),_=w??HF(o,g),C=(m??0)+yY(o)/2,S=_.map(function(M,P){var A,R=((A=UF(o(M)))!=null?A:0)+C;return{index:P,from:new Gy({x:0,y:R}),to:new Gy({x:s,y:R})}});return ie.createElement(Ub,{className:Gl("visx-rows",f),top:n,left:i},h?h({lines:S}):S.map(function(M){var P=M.from,A=M.to,R=M.index;return ie.createElement(gY,UR({key:"row-line-"+R,from:P,to:A,stroke:l,strokeWidth:c,strokeDasharray:d,style:b},x))}))}bY.propTypes={tickValues:me.array,width:me.number.isRequired};var G5e=["top","left","scale","height","stroke","strokeWidth","strokeDasharray","className","numTicks","lineStyle","offset","tickValues","children"];function HR(){return HR=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function xY(t){var e=t.top,n=e===void 0?0:e,r=t.left,i=r===void 0?0:r,o=t.scale,s=t.height,a=t.stroke,l=a===void 0?"#eaf0f6":a,u=t.strokeWidth,c=u===void 0?1:u,d=t.strokeDasharray,f=t.className,h=t.numTicks,p=h===void 0?10:h,g=t.lineStyle,b=t.offset,m=t.tickValues,w=t.children,x=j5e(t,G5e),_=m??HF(o,p),C=(b??0)+yY(o)/2,S=_.map(function(M,P){var A,R=((A=UF(o(M)))!=null?A:0)+C;return{index:P,from:new Gy({x:R,y:0}),to:new Gy({x:R,y:s})}});return ie.createElement(Ub,{className:Gl("visx-columns",f),top:n,left:i},w?w({lines:S}):S.map(function(M){var P=M.from,A=M.to,R=M.index;return ie.createElement(gY,HR({key:"column-line-"+R,from:P,to:A,stroke:l,strokeWidth:c,strokeDasharray:d,style:g},x))}))}xY.propTypes={tickValues:me.array,height:me.number.isRequired};function Nn(t){for(var e=t.length/6|0,n=new Array(e),r=0;rjFe(t[t.length-1]);var W5e=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Nn);const q5e=Kn(W5e);var X5e=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Nn);const K5e=Kn(X5e);var Y5e=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Nn);const Z5e=Kn(Y5e);var Q5e=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Nn);const J5e=Kn(Q5e);var eBe=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Nn);const tBe=Kn(eBe);var nBe=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Nn);const rBe=Kn(nBe);var iBe=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Nn);const oBe=Kn(iBe);var sBe=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Nn);const aBe=Kn(sBe);var lBe=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Nn);const uBe=Kn(lBe);var cBe=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Nn);const dBe=Kn(cBe);var fBe=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Nn);const hBe=Kn(fBe);var pBe=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Nn);const mBe=Kn(pBe);var gBe=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Nn);const vBe=Kn(gBe);var yBe=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Nn);const bBe=Kn(yBe);var xBe=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Nn);const wBe=Kn(xBe);var _Be=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Nn);const SBe=Kn(_Be);var CBe=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Nn);const EBe=Kn(CBe);var MBe=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Nn);const TBe=Kn(MBe);var ABe=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Nn);const PBe=Kn(ABe);var DBe=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Nn);const RBe=Kn(DBe);var IBe=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Nn);const NBe=Kn(IBe);var FBe=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Nn);const OBe=Kn(FBe);var kBe=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Nn);const LBe=Kn(kBe);var BBe=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Nn);const $Be=Kn(BBe);var zBe=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Nn);const UBe=Kn(zBe);var HBe=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Nn);const VBe=Kn(HBe);var GBe=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Nn);const jBe=Kn(GBe);function WBe(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-t*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-t*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-t*2475.67)))))))+")"}const qBe=nM(Vl(300,.5,0),Vl(-240,.5,1));var XBe=nM(Vl(-100,.75,.35),Vl(80,1.5,.8)),KBe=nM(Vl(260,.75,.35),Vl(80,1.5,.8)),_w=Vl();function YBe(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return _w.h=360*t-100,_w.s=1.5-1.5*e,_w.l=.8-.9*e,_w+""}var Sw=cd(),ZBe=Math.PI/3,QBe=Math.PI*2/3;function JBe(t){var e;return t=(.5-t)*Math.PI,Sw.r=255*(e=Math.sin(t))*e,Sw.g=255*(e=Math.sin(t+ZBe))*e,Sw.b=255*(e=Math.sin(t+QBe))*e,Sw+""}function e8e(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-t*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+t*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-t*6838.66)))))))+")"}function uM(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const t8e=uM(Nn("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var n8e=uM(Nn("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),r8e=uM(Nn("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),i8e=uM(Nn("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),wY={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},vz=ie.createContext&&ie.createContext(wY),o8e=["attr","size","title"];function s8e(t,e){if(t==null)return{};var n=a8e(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function a8e(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o=0)&&(n[i]=t[i]);return n}function kS(){return kS=Object.assign?Object.assign.bind():function(t){for(var e=1;eie.createElement(e.tag,LS({key:n},e.attr),_Y(e.child)))}function Ad(t){return e=>ie.createElement(d8e,kS({attr:LS({},t.attr)},e),_Y(t.child))}function d8e(t){var e=n=>{var{attr:r,size:i,title:o}=t,s=s8e(t,o8e),a=i||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),ie.createElement("svg",kS({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,s,{className:l,style:LS(LS({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&ie.createElement("title",null,o),t.children)};return vz!==void 0?ie.createElement(vz.Consumer,null,n=>e(n)):e(wY)}function f8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"12"},child:[]},{tag:"line",attr:{x1:"12",y1:"16",x2:"12.01",y2:"16"},child:[]}]})(t)}function h8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"20 6 9 17 4 12"},child:[]}]})(t)}function p8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"15 10 20 15 15 20"},child:[]},{tag:"path",attr:{d:"M4 4v7a4 4 0 0 0 4 4h12"},child:[]}]})(t)}function m8e(t){return Ad({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"line",attr:{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"},child:[]}]})(t)}var SY=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(i,o){return i[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},e.prototype.set=function(n,r){var i=t(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,i=t(r,n);~i&&r.splice(i,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,o=this.__entries__;i0},t.prototype.connect_=function(){!VR||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),w8e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!VR||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,i=x8e.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),CY=function(t,e){for(var n=0,r=Object.keys(e);n"u"||!(Element instanceof Object))){if(!(e instanceof ng(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new D8e(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ng(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new R8e(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),MY=typeof WeakMap<"u"?new WeakMap:new SY,TY=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=_8e.getInstance(),r=new I8e(e,n,this);MY.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){TY.prototype[t]=function(){var e;return(e=MY.get(this))[t].apply(e,arguments)}});var N8e=function(){return typeof BS.ResizeObserver<"u"?BS.ResizeObserver:TY}(),F8e=["client","offset","scroll","bounds","margin"];function xz(t){var e=[];return F8e.forEach(function(n){t[n]&&e.push(n)}),e}function wz(t,e){var n={};if(e.indexOf("client")>-1&&(n.client={top:t.clientTop,left:t.clientLeft,width:t.clientWidth,height:t.clientHeight}),e.indexOf("offset")>-1&&(n.offset={top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}),e.indexOf("scroll")>-1&&(n.scroll={top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}),e.indexOf("bounds")>-1){var r=t.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(e.indexOf("margin")>-1){var i=getComputedStyle(t);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function O8e(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||window}function k8e(t){return function(e){var n,r;return r=n=function(i){RI(o,i);function o(){for(var a,l=arguments.length,u=new Array(l),c=0;c0?e=t-1:this._settings.wrap?e=this._members.length-1:e=t,this.focusNodeAtIndex(e),e};pr.prototype.moveFocusToFirst=function(){this.focusNodeAtIndex(0)};pr.prototype.moveFocusToLast=function(){this.focusNodeAtIndex(this._members.length-1)};pr.prototype._handleUnboundKey=function(t){if(this._settings.stringSearch){if(this._searchString!==""&&(t.key===" "||t.keyCode===32))return t.preventDefault(),-1;if(!W8e(t.keyCode)||t.ctrlKey||t.metaKey||t.altKey)return-1;t.preventDefault(),this._addToSearchString(String.fromCharCode(t.keyCode)),this._runStringSearch()}};pr.prototype._clearSearchString=function(){this._searchString=""};pr.prototype._addToSearchString=function(t){this._searchString+=t.toLowerCase()};pr.prototype._startSearchStringRefreshTimer=function(){var t=this;this._clearSearchStringRefreshTimer(),this._stringSearchTimer=setTimeout(function(){t._clearSearchString()},this._settings.stringSearchDelay)};pr.prototype._clearSearchStringRefreshTimer=function(){clearTimeout(this._stringSearchTimer)};pr.prototype._runStringSearch=function(){this._startSearchStringRefreshTimer(),this.moveFocusByString(this._searchString)};pr.prototype.moveFocusByString=function(t){for(var e,n=0,r=this._members.length;n=65&&t<=90}function RY(t){!t||!t.focus||(t.focus(),t.tagName.toLowerCase()==="input"&&t.select())}var q8e=function(e){return new pr(e)},X8e=q8e,_z=DY,K8e={wrap:!0,stringSearch:!0},Y8e={init:function(e){this.updateOptions(e),this.handleBlur=Z8e.bind(this),this.handleSelection=Q8e.bind(this),this.handleMenuKey=J8e.bind(this),this.focusGroup=X8e(K8e),this.button=null,this.menu=null,this.isOpen=!1},updateOptions:function(e){var n=this.options;this.options=e||this.options||{},typeof this.options.closeOnSelection>"u"&&(this.options.closeOnSelection=!0),typeof this.options.closeOnBlur>"u"&&(this.options.closeOnBlur=!0),this.options.id&&_z.registerManager(this.options.id,this),n&&n.id&&n.id!==this.options.id&&_z.unregisterManager(this.options.id,this)},focusItem:function(e){this.focusGroup.focusNodeAtIndex(e)},addItem:function(e){this.focusGroup.addMember(e)},clearItems:function(){this.focusGroup.clearMembers()},handleButtonNonArrowKey:function(e){this.focusGroup._handleUnboundKey(e)},destroy:function(){this.button=null,this.menu=null,this.focusGroup.deactivate(),clearTimeout(this.blurTimer),clearTimeout(this.moveFocusTimer)},update:function(){this.menu.setState({isOpen:this.isOpen}),this.button.setState({menuOpen:this.isOpen}),this.options.onMenuToggle&&this.options.onMenuToggle({isOpen:this.isOpen})},openMenu:function(e){if(!this.isOpen&&(e=e||{},e.focusMenu===void 0&&(e.focusMenu=!0),this.isOpen=!0,this.update(),this.focusGroup.activate(),e.focusMenu)){var n=this;this.moveFocusTimer=setTimeout(function(){n.focusItem(0)},0)}},closeMenu:function(e){this.isOpen&&(e=e||{},this.isOpen=!1,this.update(),e.focusButton&&this.button.ref.current.focus())},toggleMenu:function(e,n){e=e||{},n=n||{},this.isOpen?this.closeMenu(e):this.openMenu(n)}};function Z8e(){var t=this;t.blurTimer=setTimeout(function(){if(t.button){var e=t.button.ref.current;if(e){var n=e.ownerDocument.activeElement;if(!(e&&n===e)){var r=t.menu.ref.current;if(r===n){t.focusItem(0);return}r&&r.contains(n)||t.isOpen&&t.closeMenu({focusButton:!1})}}}},0)}function Q8e(t,e){this.options.closeOnSelection&&this.closeMenu({focusButton:!0}),this.options.onSelection&&this.options.onSelection(t,e)}function J8e(t){if(this.isOpen)switch(t.key){case"Escape":t.preventDefault(),this.closeMenu({focusButton:!0});break;case"Home":t.preventDefault(),this.focusGroup.moveFocusToFirst();break;case"End":t.preventDefault(),this.focusGroup.moveFocusToLast();break}}var e6e=function(t){var e=Object.create(Y8e);return e.init(t),e},t6e=E,n6e=t6e.createContext(),fM=n6e,Cw=ag,hM={refType:Cw.oneOfType([Cw.func,Cw.shape({current:Cw.elementType})])},pM=function(t,e,n){n=n||{};for(var r in e)e.hasOwnProperty(r)&&(n[r]||(t[r]=e[r]))};function r6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i6e(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function o6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Rv=E,fp=ag,s6e=e6e,a6e=fM,l6e=hM,u6e=l6e.refType,GR=pM,zS={children:fp.node.isRequired,forwardedRef:u6e,onMenuToggle:fp.func,onSelection:fp.func,closeOnSelection:fp.bool,closeOnBlur:fp.bool,tag:fp.string},Sz=function(e){return{onMenuToggle:e.onMenuToggle,onSelection:e.onSelection,closeOnSelection:e.closeOnSelection,closeOnBlur:e.closeOnBlur,id:e.id}},qF=function(t){o6e(e,t);function e(n){r6e(this,e);var r=i6e(this,t.call(this,n));return r.manager=s6e(Sz(n)),r}return e.prototype.componentDidUpdate=function(){this.manager.updateOptions(Sz(this.props))},e.prototype.render=function(){var r={};return GR(r,this.props,zS),Rv.createElement(a6e.Provider,{value:this.manager},Rv.createElement(this.props.tag,r,this.props.children))},e}(Rv.Component);qF.propTypes=zS;qF.defaultProps={tag:"div"};var c6e=Rv.forwardRef(function(t,e){var n={forwardedRef:e};return GR(n,t,{children:zS.children,forwardedRef:zS.forwardedRef}),GR(n,{forwardedRef:e}),Rv.createElement(qF,n,t.children)});function d6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cz(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function f6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Cm=E,Ew=ag,h6e=fM,p6e=hM,m6e=p6e.refType,h_=pM,Iv={ambManager:Ew.object.isRequired,children:Ew.node.isRequired,disabled:Ew.bool,forwardedRef:m6e,tag:Ew.string},g6e=function(){return["button","fieldset","input","optgroup","option","select","textarea"]},XF=function(t){f6e(e,t);function e(){var n,r,i;d6e(this,e);for(var o=arguments.length,s=Array(o),a=0;a=0&&delete s.disabled,i.options.closeOnBlur&&(o.onBlur=i.handleBlur),h_(o,r,s),h_(o,{ref:this.setRef}),Cm.createElement(r.tag,o,r.children)},e}(Cm.Component);XF.propTypes=Iv;XF.defaultProps={tag:"span"};var v6e=Cm.forwardRef(function(t,e){return Cm.createElement(h6e.Consumer,null,function(n){var r={ambManager:n,forwardedRef:e};return h_(r,t,{ambManager:Iv.ambManager,children:Iv.children,forwardedRef:Iv.forwardedRef}),Cm.createElement(XF,r,t.children)})}),y6e=function(e,n,r){var i=0,o=0,s=!1,a=!1,l=!1;e.addEventListener("click",u,r),e.addEventListener("touchstart",c,r);function u(b){l||n(b)}function c(b){l=!0,!s&&(s=!0,e.addEventListener("touchmove",d,r),e.addEventListener("touchend",f,r),e.addEventListener("touchcancel",h,r),a=!1,i=b.touches[0].clientX,o=b.touches[0].clientY)}function d(b){a||Math.abs(b.touches[0].clientX-i)<=10&&Math.abs(b.touches[0].clientY-o)<=10||(a=!0)}function f(b){s=!1,p(),a||n(b)}function h(){s=!1,a=!1,i=0,o=0}function p(){e.removeEventListener("touchmove",d,r),e.removeEventListener("touchend",f,r),e.removeEventListener("touchcancel",h,r)}function g(){e.removeEventListener("click",u,r),e.removeEventListener("touchstart",c,r),p()}return{remove:g}};function b6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ez(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function x6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Em=E,N0=ag,w6e=y6e,_6e=fM,S6e=hM,C6e=S6e.refType,jR=pM,Nv={ambManager:N0.object.isRequired,children:N0.oneOfType([N0.func,N0.node]).isRequired,forwardedRef:C6e,tag:N0.string},KF=function(t){x6e(e,t);function e(){var n,r,i;b6e(this,e);for(var o=arguments.length,s=Array(o),a=0;ae in t?I6e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Mw=(t,e,n)=>(N6e(t,typeof e!="symbol"?e+"":e,n),n);const ZF=E.createContext({}),F6e=E.createContext(void 0),O6e="_wrapper_9665499",k6e="_grid_5146261",L6e="_innerContainer_27a3adb",B6e="_colHeaders_a985f35",$6e="_rowHeaders_63b4056",z6e="_indexCell_080a16e",U6e="_stickyGrid_33fa7fa",H6e="_cell_2658e21",V6e="_topLeftCell_e826718 _indexCell_080a16e",sf={wrapper:O6e,grid:k6e,innerContainer:L6e,colHeaders:B6e,rowHeaders:$6e,indexCell:z6e,stickyGrid:U6e,cell:H6e,topLeftCell:V6e};function G6e(t){const{rowIndex:e,columnIndex:n,style:r}=t,{rowHeaderCellsWidth:i,cellSize:o,cellFormatter:s}=E.useContext(ZF);return D.jsx("div",{className:sf.cell,style:{...r,left:r.left+i,top:r.top+o.height},role:"cell","aria-rowindex":e,"aria-colindex":n,"data-bg":(e+n)%2===1||void 0,children:s(e,n)})}E.memo(G6e);function Az(t){const{indexMin:e,indexMax:n,width:r,transform:i,headers:o}=t,{cellSize:s}=E.useContext(ZF);return D.jsx(D.Fragment,{children:$W(e,n+1).map(a=>D.jsx("div",{className:sf.indexCell,style:{width:r||s.width,height:s.height,transform:i},"data-bg":a%2===1?"":void 0,children:a>=0&&o?o[a]:a},a.toString()))})}const j6e=E.forwardRef((t,e)=>{const{children:n,style:r}=t,{rowCount:i,columnCount:o,cellSize:s,sticky:a,rowHeaderCellsWidth:l,columnHeaders:u}=E.useContext(ZF),c=E.useContext(F6e),{overscanColumnStartIndex:d=0,overscanColumnStopIndex:f=0,overscanRowStartIndex:h=0,overscanRowStopIndex:p=0}=c||{};return D.jsxs("div",{ref:e,className:sf.stickyGrid,style:{...r,width:r.width+l,height:r.height+s.height},role:"table","aria-rowcount":i,"aria-colcount":o,"data-sticky":a||void 0,children:[D.jsxs("div",{className:sf.colHeaders,children:[D.jsx("div",{className:sf.topLeftCell,style:{width:l,height:s.height},"data-bg":!0,"aria-hidden":"true"}),D.jsx(Az,{indexMin:d,indexMax:f,transform:`translateX(${s.width*d}px)`,headers:u})]}),D.jsxs("div",{className:sf.innerContainer,children:[D.jsx("div",{className:sf.rowHeaders,"aria-hidden":"true",children:D.jsx(Az,{indexMin:h,indexMax:p,transform:`translateY(${s.height*h}px)`,width:l})}),n]})]})});j6e.displayName="StickyGrid";var nf=(t=>(t.Bool="Boolean",t.Integer="Integer",t.Unsigned="Integer (unsigned)",t.Float="Float",t.Complex="Complex",t.String="String",t.Compound="Compound",t.Array="Array",t.VLen="Array (variable length)",t.Enum="Enumeration",t.Time="Time",t.Bitfield="Bitfield",t.Opaque="Opaque",t.Reference="Reference",t.Unknown="Unknown",t))(nf||{}),hn=(t=>(t.Linear="linear",t.Log="log",t.SymLog="symlog",t.Sqrt="sqrt",t.Gamma="gamma",t))(hn||{});hn.Linear,hn.Log,hn.SymLog;hn.Linear,hn.Log,hn.SymLog,hn.Sqrt;const Pz=Yl(".3~e"),zA=Yl(".5~e");Yl(".5~g");Yl(".3~g");K6e(".12~g");const QF=3,W6e=/0\.([0-9]+)$/u,q6e=Yl(`.${QF}~g`),X6e=Yl(`.${QF}~e`);function UA(t){const e=q6e(t),n=W6e.exec(e);return n&&n[1].length>QF?X6e(t):e}function K6e(t,e=!1){const n=Yl(t);return r=>{const[i,o]=r;if(o===0&&!e)return`${n(i)}`;if(i===0&&!e)return`${n(o)} i`;const s=Math.sign(o)>=0?" + ":" − ";return`${n(i)}${s}${n(Math.abs(o))} i`}}function Y6e(t){const[e,n]=t.shape;return{rows:e,cols:n}}function WR(t){return Array.isArray(t)?t:[t]}nf.Unsigned,nf.Integer,nf.Float,nf.String,nf.Bool,nf.Complex;function Z6e(t){return t!==void 0}function Q6e(t){return t!==null}function p_(t,e="Expected some value"){if(!Z6e(t))throw new TypeError(e)}function HA(t,e="Expected value to not be null"){if(!Q6e(t))throw new TypeError(e)}const J6e=new oe(0,0,0);class om extends xa{get size(){const{x:e,y:n}=this.getSize(new oe);return{width:e,height:n}}get center(){return this.getCenter(new oe)}static empty(e=J6e){return new om(e.clone(),e.clone())}static fromPoints(...e){return new om().setFromPoints(e)}static fromSize({width:e,height:n}){return om.empty().expandBySize(e,n)}clampPoint(e){return super.clampPoint(e,new oe)}expandBySize(e,n){const{size:r}=this,i=e<0?Math.max(e,-r.width):e,o=n<0?Math.max(n,-r.height):n;return this.expandByVector(new oe(i,o).divideScalar(2))}expandToRatio(e){if(e===void 0||e<=0)return this;const{width:n,height:r}=this.size,i=n/r;return e>i?this.expandBySize(r*e-n,0):this.expandBySize(0,n/e-r)}hasMinSize(e,n=e){const{width:r,height:i}=this.size;return r>=e&&i>=n}keepWithin(e){const{center:n,size:r}=this,{width:i,height:o}=e.size,s=om.empty(e.center).expandBySize(Math.max(i-r.width,0),Math.max(o-r.height,0)).clampPoint(n).sub(n).setZ(0);return this.translate(s)}toRect(){return[this.min,this.max]}}const fd=om;function Dz(t,e){const n=e-t;return r=>n!==0?(r-t)/n:.5}function NY(t){let e=(t==null?void 0:t.domain)||[0,1],n=(t==null?void 0:t.range)||[0,1],r=(t==null?void 0:t.exponent)??1,i=(t==null?void 0:t.clamp)||!1,o=tg,s;const a=function(M){const P=typeof M=="number"?M:M.valueOf();return Number.isNaN(P)?s:o(...n)(Dz(...e)(l(P))**r)};function l(M){if(!i)return M;const[P,A]=e;return Math.max(P,Math.min(A,M))}function u(M){return M?(e=M,S):[...e]}function c(M){return M?(n=M,S):[...n]}function d(M){return M?(n=M,o=FF,S):[...n]}function f(M){return M?(i=M,S):i}function h(){return s}function p(M){return M?(o=M,S):o}function g(M){return M?(r=M,S):r}function b(M){return l(tg(...e)(Dz(...n)(M)**(1/r)))}function m(){return lke({domain:e,range:n,exponent:r,clamp:i})}function w(M){return e=m().nice(M).domain(),S}function x(M){return m().ticks(M)}function _(M,P){return m().tickFormat(M,P)}function C(){return NY().domain(e).range(n).exponent(r).clamp(i).interpolate(o)}const S=Object.assign(a,{domain:u,range:c,rangeRound:d,clamp:f,interpolate:p,invert:b,unknown:h,exponent:g,nice:w,ticks:x,tickFormat:_,copy:C});return S}const e$e=[.1,1],t$e={left:80,right:24,top:16,bottom:34},n$e=28,Rz=24;hn.Linear+"",hn.Log+"",Number.MIN_VALUE,hn.SymLog+"",hn.Sqrt+"",hn.Gamma+"";const r$e=zF({domain:[300,900],range:[3,10],clamp:!0,round:!0}),i$e=zF({domain:[300,500],range:[.8,1.4]});function FY(t,e){if(Array.isArray(t)){const[,n]=t;return NY({...e,exponent:n})}switch(t){case hn.Linear:return zF(e);case hn.Log:return ske(e);case hn.SymLog:return cke(e);case hn.Sqrt:return fke(e)}throw new Error("Unknown scale type")}function o$e(t,e){const{width:n,height:r}=t;return e?n/r>e?{width:r*e,height:r}:{width:n,height:n/e}:{width:n,height:r}}function s$e(t,e=[-Number.MAX_VALUE/2,Number.MAX_VALUE/2]){const[n,r]=e;return jq.clamp(t,n,r)}function Iz(t,e){const{scaleType:n,visDomain:r,flip:i,nice:o=!1}=t;return FY(n??hn.Linear,{domain:r,range:[-e/2,e/2],reverse:i,nice:o})}function a$e(t,e){const n=Math.min(...t),r=Math.max(...t),i=Math.ceil(n),o=Math.floor(r),s=o-i+1,a=Math.min(s,e);if(a===0)return[];const l=Math.max(BW(i,o,a),1),u=Math.ceil(n/l),c=Math.floor(r/l)-u+1;return Array.from({length:c},(d,f)=>(u+f)*l)}function l$e(t,e,n){if(n!==hn.Log)return UA;const[r,i]=t[0]>0?t:[-t[1],-[t[0]]],o=i$e(e);return i/r<10**o?UA:s=>{const a=Math.log10(Math.abs(s.valueOf()));return a===Math.floor(a)?UA(s):""}}function OY(t,e,n){if(t==="auto")return;if(t==="equal")return OY(1,e,n);const[r,i]=e,[o,s]=n;return Math.abs(i-r)/Math.abs(s-o)/t}function u$e(t={}){const{left:e,right:n,top:r,bottom:i}=t$e;return{left:e+(t.left?Rz:0),right:n,top:r+(t.top?n$e:0),bottom:i+(t.bottom?Rz:0)}}const c$e=` varying vec2 coords; void main() { coords = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); } -`;function d$e(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{value:n}]))}const kY=E.createContext({});function Ri(){return E.useContext(kY)}function f$e(t){const{visRatio:e,abscissaConfig:n,ordinateConfig:r,svgOverlay:i,floatingToolbar:o,children:s}=t,{width:a,height:l}=Vi($=>$.size),u={width:a,height:l},c=a/l,d=o$e(u,e),f=E.useMemo(()=>fd.empty().expandByPoint(new oe(a,l)),[a,l]),h=Iz(n,d.width),p=Iz(r,d.height),g=E.useCallback($=>new oe(h($.x),p($.y)),[h,p]),b=E.useCallback($=>new oe(h.invert($.x),p.invert($.y)),[h,p]),m=E.useMemo(()=>new qt().makeScale(a/2,-l/2,1).setPosition(a/2,l/2,0),[a,l]),w=E.useMemo(()=>m.clone().invert(),[m]),x=E.useCallback(($,j)=>j.clone().project($).applyMatrix4(m),[m]),_=E.useCallback(($,j)=>j.clone().applyMatrix4(w).unproject($),[w]),C=E.useCallback(($,j)=>x($,g(j)),[g,x]),S=E.useCallback(($,j)=>b(_($,j)),[_,b]),M=E.useCallback(($,j=$.position)=>{const{scale:k}=$;return fd.empty(j).expandBySize(a*k.x,l*k.y)},[a,l]),P=E.useCallback($=>{const[j,k]=M($).toRect().map(b);return{xVisibleDomain:[j.x,k.x],yVisibleDomain:[j.y,k.y]}},[M,b]),A=Vi($=>{var j;return(j=$.gl.domElement.parentElement)==null?void 0:j.parentElement});p_(A),HA(A);const R=A.parentElement;HA(R);const F=R.parentElement;return HA(F),D.jsx(kY.Provider,{value:{canvasSize:u,canvasRatio:c,canvasBox:f,visRatio:e,visSize:d,abscissaConfig:n,ordinateConfig:r,abscissaScale:h,ordinateScale:p,dataToWorld:g,dataToHtml:C,worldToHtml:x,worldToData:b,htmlToWorld:_,htmlToData:S,getFovBox:M,getVisibleDomains:P,visCanvas:F,canvasArea:R,r3fRoot:A,svgOverlay:i,floatingToolbar:o},children:s})}var mM=(t=>(t[t.Left=0]="Left",t[t.Middle=1]="Middle",t))(mM||{});class h$e{constructor(e,n){Mw(this,"buttons"),Mw(this,"modifierKeys"),Mw(this,"isWheel"),Mw(this,"isEnabled"),this.id=e;const{button:r=mM.Left,modifierKey:i=[],disabled:o=!1}=n;r==="Wheel"?(this.buttons=[],this.isWheel=!0):(this.buttons=WR(r),this.isWheel=!1),this.modifierKeys=WR(i),this.isEnabled=!o}matches(e){return this.isEnabled&&(e instanceof WheelEvent?this.isWheel:this.buttons.includes(e.button))&&this.modifierKeys.every(n=>e.getModifierState(n))}}const LY=E.createContext({});function p$e(){return E.useContext(LY)}function m$e(t){const{children:e}=t,[n]=E.useState(new Map),r=E.useCallback((s,a)=>{n.has(s)?console.warn(`An interaction with ID "${s}" is already registered.`):n.set(s,new h$e(s,a))},[n]),i=E.useCallback(s=>{n.delete(s)},[n]),o=E.useCallback((s,a)=>{const l=[...n.values()];if(!n.has(s))throw new Error(`Interaction ${s} is not registered`);const u=l.filter(c=>c.matches(a));return u.length===0?!1:u.length===1?u[0].id===s:u.reduce((c,d)=>d.modifierKeys.length>c.modifierKeys.length?d:c).id===s},[n]);return D.jsx(LY.Provider,{value:{registerInteraction:r,unregisterInteraction:i,shouldInteract:o},children:e})}const Nz=.95,Fz=new oe(1,1,1),g$e=["Alt","Control","Shift"];function Vb(){const{visSize:t,getFovBox:e}=Ri(),n=Vi(i=>i.camera),r=Vi(i=>i.invalidate);return E.useCallback(i=>{const{position:o}=n,s=fd.fromSize(t),a=e(n,i).keepWithin(s);o.copy(a.center.setZ(o.z)),n.updateMatrixWorld(),r()},[n,t,e,r])}function BY(){const{canvasSize:t}=Ri(),e=Vi(r=>r.camera),n=Vb();return E.useCallback(({world:r})=>{const{width:i,height:o}=t,s=fd.fromPoints(...r),{width:a,height:l}=s.size;e.scale.set(Math.max(a,1)/i,Math.max(l,1)/o,1),n(s.center)},[e,t,n])}function JF(){const{canvasArea:t}=Ri();Cf(t,"wheel",e=>e.preventDefault(),{passive:!1})}function eO(t){const e=Vi(r=>r.camera),n=Vb();return function(r){const{sourceEvent:i,worldPt:o}=r,{x:s,y:a}=t(i);if(!s&&!a)return;const l=new oe(s?Nz:1,a?Nz:1,1);i.deltaY<0?e.scale.multiply(l).min(Fz):e.scale.divide(l).min(Fz);const u=e.position.clone().sub(o);i.deltaY<0?u.multiply(l):u.divide(l),n(o.clone().add(u))}}function Nu(t,e,n={}){const r=xs(e),i=Vi(u=>u.camera),{htmlToWorld:o,worldToData:s,canvasArea:a}=Ri();function l(u){const{offsetX:c,offsetY:d}=u,f=new oe(c,d),h=o(i,f),p=s(h);r.current({htmlPt:f,worldPt:h,dataPt:p,sourceEvent:u})}Cf(a,t,l,n)}function Gb(t,e){const{shouldInteract:n,registerInteraction:r,unregisterInteraction:i}=p$e();return E.useEffect(()=>(r(t,e),()=>i(t)),[t,r,i,e]),E.useCallback(o=>n(t,o),[t,n])}function $Y(t=[]){const{canvasArea:e}=Ri(),n=WR(t),[r]=E.useState(new Map),[i,o]=u2e(!1);function s(){const a=n.every(l=>r.get(l));i!==a&&o(a)}return Cf(window,"keyup",a=>{const{key:l}=a;r.set(l,!1),s()}),Cf(window,"keydown",a=>{const{key:l}=a;r.set(l,!0),s()}),Cf(e,"pointerdown",a=>{g$e.forEach(l=>{r.set(l,a.getModifierState(l))}),s()}),i}function v$e(t){const{id:e="Pan",button:n=mM.Left,modifierKey:r,disabled:i}=t,o=Gb(e,{button:n,modifierKey:r,disabled:i}),s=Vi(h=>h.camera),a=Vb(),l=E.useRef(),u=$Y(r);function c(h){const{worldPt:p,sourceEvent:g}=h,{target:b,pointerId:m}=g;o(g)&&(b.setPointerCapture(m),l.current=p.clone())}function d(h){if(!l.current||!u)return;const{worldPt:p}=h,g=l.current.clone().sub(p);a(s.position.clone().add(g))}function f(h){const{sourceEvent:p}=h,{target:g,pointerId:b}=p;g.releasePointerCapture(b),l.current=void 0}return Nu("pointerdown",c),Nu("pointermove",d),Nu("pointerup",f),null}function zY(t){const{id:e="Selection",modifierKey:n,disabled:r,transform:i=W=>W,validate:o=()=>!0,onSelectionStart:s,onSelectionChange:a,onSelectionEnd:l,onValidSelection:u,children:c}=t,d=xs(i),f=xs(o),h=xs(s),p=xs(a),g=xs(l),b=xs(u),m=Vi(W=>W.camera),w=Ri(),{canvasBox:x,htmlToWorld:_,worldToData:C}=w,[S,M]=l2e(),P=E.useRef(),A=E.useRef(!1),R=$Y(n),F=Gb(e,{button:mM.Left,modifierKey:n,disabled:r});function $(W){const{sourceEvent:K}=W;if(!F(K))return;const{target:Q,pointerId:J}=K;Q.setPointerCapture(J),P.current=W}function j(W){if(!P.current)return;const{htmlPt:K}=P.current,Q=[K,x.clampPoint(W.htmlPt)],J=Q.map(ve=>_(m,ve)),ae=J.map(C);M({html:Q,world:J,data:ae})}function k(W){if(!P.current)return;const{sourceEvent:K}=W,{target:Q,pointerId:J}=K;Q.releasePointerCapture(J),P.current=void 0,A.current=F(K),M(void 0)}Nu("pointerdown",$),Nu("pointermove",j),Nu("pointerup",k);function U(){P.current=void 0,M(void 0)}h2e("Escape",U,[],{event:"keydown"}),Cf(window,"contextmenu",W=>{P.current&&(W.preventDefault(),U())});const G=E.useMemo(()=>S&&d.current(S,m,w),[S,d,m,w]),B=E.useMemo(()=>!!G&&f.current(G),[G,f]),L=U8(G),N=U8(B);return E.useEffect(()=>{var W,K,Q,J;if(G){p_(S),L||(W=h.current)==null||W.call(h),(K=p.current)==null||K.call(p,R?G:void 0,S,B);return}L&&(p_(N),(Q=g.current)==null||Q.call(g,A.current?L:void 0,N),N&&A.current&&((J=b.current)==null||J.call(b,L)),A.current=!1)},[G,L,S,B,N,R,h,p,g,b]),!G||!R?null:(p_(S),D.jsx(D.Fragment,{children:c(G,S,B)}))}const y$e="_selection_0f4643e",qR={selection:y$e};function tO(t){const{overflowCanvas:e=!1,children:n}=t,{r3fRoot:r,canvasArea:i}=Ri(),o=e?i:r,[s]=E.useState(()=>{const l=document.createElement("div");return l.setAttribute("hidden",""),l}),[a]=E.useState(()=>DH(s));return E.useLayoutEffect(()=>{a.render(qu.createPortal(n,o))},[n,o,a]),E.useLayoutEffect(()=>(r.append(s),()=>{a.unmount(),s.remove()}),[r,a,s]),null}function nO(t){const{children:e}=t,{svgOverlay:n}=Ri();return n?D.jsx(tO,{children:qu.createPortal(e,n)}):null}function US(t){const{coords:e,strokePosition:n,...r}=t,{stroke:i,strokeWidth:o=1}=r,s=i&&n?o*(n==="outside"?1:-1):0,{min:a,max:l}=fd.fromPoints(...e).expandBySize(s,s);return D.jsx("path",{d:`M ${a.x},${a.y} H ${l.x} V ${l.y} H ${a.x} z`,...r})}const b$e=20;function x$e(t){const{minZoom:e=b$e,...n}=t,{canvasSize:r,canvasRatio:i,canvasBox:o,visRatio:s,visSize:a,htmlToWorld:l,worldToData:u}=Ri(),c=BY(),d=Vi(p=>p.camera),f=s!==void 0;function h(p){if(!f)return p;const{scale:g}=d,b=fd.empty(new oe(r.width/2,r.height/2)).expandBySize(a.width/g.x,a.height/g.y),m=fd.fromPoints(...p.html).expandToRatio(i).keepWithin(o).keepWithin(b).toRect(),w=m.map(_=>l(d,_)),x=w.map(u);return{html:m,world:w,data:x}}return D.jsx(zY,{id:"SelectToZoom",transform:h,validate:({html:p})=>p[0].manhattanDistanceTo(p[1])>=e,onValidSelection:c,...n,children:({html:p},{html:g},b)=>D.jsxs(nO,{children:[D.jsx(US,{className:qR.selection,coords:g,fill:"white",fillOpacity:!f&&b?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:f||!b?4:void 0}),f&&D.jsx(US,{className:qR.selection,coords:p,fill:"white",fillOpacity:b?.25:0,stroke:"black",strokePosition:"inside"})]})})}function w$e(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Ri(),i=Gb("XAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:i(s),y:!1});return JF(),Nu("wheel",eO(o)),null}function _$e(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Ri(),i=Gb("YAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:!1,y:i(s)});return JF(),Nu("wheel",eO(o)),null}function S$e(t){const{modifierKey:e,disabled:n}=t,r=Gb("Zoom",{button:"Wheel",modifierKey:e,disabled:n}),i=o=>{const s=r(o);return{x:s,y:s}};return JF(),Nu("wheel",eO(i)),null}function C$e(t){const{axis:e,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,children:o,...s}=t;function a(l,u,c){const{canvasSize:d,htmlToWorld:f,worldToData:h}=c,{width:p,height:g}=d,[b,m]=l.html,w=e==="x"?[new oe(b.x,0),new oe(m.x,g)]:[new oe(0,b.y),new oe(p,m.y)],x=w.map(C=>f(u,C)),_=x.map(h);return{html:w,world:x,data:_}}return D.jsx(zY,{transform:a,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,...s,children:o})}const E$e=20;function Oz(t){const{axis:e,modifierKey:n,disabled:r,minZoom:i=E$e}=t,{visRatio:o}=Ri(),s=BY();return D.jsx(C$e,{axis:e,id:`${e.toUpperCase()}SelectToZoom`,modifierKey:n,disabled:o!==void 0||r,validate:({html:a})=>fd.fromPoints(...a).hasMinSize(i),onValidSelection:s,children:({html:a},l,u)=>D.jsx(nO,{children:D.jsx(US,{className:qR.selection,coords:a,fill:"white",fillOpacity:u?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:u?void 0:4})})})}function M$e(t){const{...e}=t;return D.jsxs(D.Fragment,{children:[e.pan!==!1&&D.jsx(v$e,{...e.pan}),e.zoom!==!1&&D.jsx(S$e,{...e.zoom}),e.xAxisZoom!==!1&&D.jsx(w$e,{modifierKey:"Alt",...e.xAxisZoom}),e.yAxisZoom!==!1&&D.jsx(_$e,{modifierKey:"Shift",...e.yAxisZoom}),e.selectToZoom!==!1&&D.jsx(x$e,{modifierKey:"Control",...e.selectToZoom}),e.xSelectToZoom!==!1&&D.jsx(Oz,{axis:"x",modifierKey:["Control","Alt"],...e.xSelectToZoom}),e.ySelectToZoom!==!1&&D.jsx(Oz,{axis:"y",modifierKey:["Control","Shift"],...e.ySelectToZoom})]})}function T$e(t){return(...e)=>E.useMemo(()=>t(...e),e)}function rO(t,e,n=(r,i)=>Object.is(r,i)){const r=Vi(a=>a.camera),i=s2e(),o=E.useRef(),s=xs(t);return E.useMemo(()=>{o.current=s.current(r)},e),TF(()=>{const a=s.current(r);n(o.current,a)||(o.current=a,i())}),o.current}function A$e(t){const{children:e}=t,{floatingToolbar:n}=Ri();return n?D.jsx(tO,{children:qu.createPortal(e,n)}):null}const P$e="_btnLike_0154b53",D$e="_icon_bcb8f77",R$e="_label_5a75092",I$e="_popup_954b735",N$e="_popupInner_95eb7d8",F$e="_btn_f1cebe5 btnClean",UY={btnLike:P$e,icon:D$e,label:R$e,popup:I$e,popupInner:N$e,btn:F$e},{btn:O$e,btnLike:k$e}=UY,L$e=`_btn_579cee1 ${O$e}`,B$e=`_btnLike_5797793 ${k$e}`,kz={btn:L$e,btnLike:B$e};function $$e(){const t=Vi(i=>i.camera),e=Vi(i=>i.invalidate),n=rO(({scale:i})=>i.x<1||i.y<1,[]);function r(){t.scale.x=1,t.scale.y=1,t.position.x=0,t.position.y=0,t.updateMatrixWorld(),e()}return D.jsx(A$e,{children:D.jsx("button",{className:kz.btn,type:"button",hidden:!n,onClick:()=>r(),children:D.jsx("span",{className:kz.btnLike,children:"Reset zoom"})})})}function z$e(t){const{children:e,size:n,...r}=t,{visSize:i}=Ri(),{width:o,height:s}=n??i;return D.jsxs("mesh",{...r,children:[D.jsx("planeGeometry",{args:[o,s]}),e]})}const U$e="_axis_1002b06",H$e="_grid_a397f58",V$e="_tick_44c4d9c",G$e="_label_4a1d111",HS={axis:U$e,grid:H$e,tick:V$e,label:G$e};function j$e(t){const{formattedValue:e,...n}=t;return D.jsx("text",{...n,dy:"0.3125em",children:e})}const W$e={labelClassName:HS.label,labelProps:{fontSize:"inherit"},tickClassName:HS.tick,tickComponent:j$e},q$e={abscissa:[k5e,xY],ordinate:[I5e,bY]};function Lz(t){const{type:e,config:n,domain:r,canvasSize:i,offset:o,flipAxis:s,showAxis:a}=t,{width:l,height:u}=i,c=e==="abscissa",d=c?l:u,{scaleType:f=hn.Linear,isIndexAxis:h,showGrid:p,label:g,nice:b=!1}=n,m=FY(f,{domain:r,range:s?[d,0]:[0,d],nice:b}),[w,x]=q$e[e],_=r$e(d),C=h?{tickValues:a$e(r,_)}:{numTicks:_};return D.jsxs(D.Fragment,{children:[a&&D.jsx("svg",{className:HS.axis,"data-type":e,style:c?{width:l,height:o}:{width:o,height:u},children:D.jsx(w,{scale:m,tickFormat:l$e(r,d,f),label:g,labelOffset:o-(c?32:36),hideAxisLine:p,...C,...W$e})}),p&&D.jsx("svg",{className:HS.grid,...i,children:D.jsx(x,{scale:m,...i,...C})})]})}function X$e(t){const{axisOffsets:e,showAxes:n}=t,{canvasSize:r,visCanvas:i,abscissaConfig:o,ordinateConfig:s,getVisibleDomains:a}=Ri(),l=rO(a,[a]);return D.jsx(tO,{children:qu.createPortal(D.jsxs(D.Fragment,{children:[D.jsx(Lz,{type:"abscissa",config:o,domain:l.xVisibleDomain,canvasSize:r,offset:e.bottom,showAxis:n}),D.jsx(Lz,{type:"ordinate",config:s,domain:l.yVisibleDomain,canvasSize:r,offset:e.left,showAxis:n,flipAxis:!0})]}),i)})}function K$e(t){const{className:e,orthographic:n,children:r}=t;return D.jsxs(MFe,{className:e,orthographic:n,flat:!0,frameloop:"demand",dpr:[1,3],resize:{debounce:{scroll:20,resize:200},scroll:!1},gl:{preserveDrawingBuffer:!0},children:[D.jsx("ambientLight",{}),r]})}function Y$e(){const{visRatio:t}=Ri(),e=Vi(r=>r.camera),n=Vb();return E.useEffect(()=>{if(!t||e.scale.x===e.scale.y)return;const r=Math.max(e.scale.x,e.scale.y);e.scale.x=r,e.scale.y=r,n(e.position)},[e,n,t]),null}function Z$e(t){const{value:e}=t,n=Vi(i=>i.raycaster),r=Vi(i=>i.camera);return E.useEffect(()=>{const i=n.params.Points,o=i?i.threshold:1;return i&&(i.threshold=e),()=>{i&&(i.threshold=o)}},[n,e]),TF(()=>{const i=(r.scale.x+r.scale.y)/2;n.params.Points&&(n.params.Points.threshold=e*i/2)}),null}function Q$e(){const{dataToWorld:t,worldToData:e}=Ri(),n=E.useRef(),r=Vi(o=>o.camera),i=Vb();return TF(()=>{n.current=e(r.position)}),E.useEffect(()=>{n.current&&i(t(n.current))},[n,i,t,r]),null}const J$e="_visCanvas_2387375",eze="_title_313417a",tze="_canvasArea_6300bb7",nze="_r3fRoot_f557f0c",rze="_svgOverlay_3f84e2f",ize="_floatingToolbar_de4854e",hp={visCanvas:J$e,title:eze,canvasArea:tze,r3fRoot:nze,svgOverlay:rze,floatingToolbar:ize},oze={left:0,right:0,top:0,bottom:0};function sze(t){const{title:e,aspect:n="auto",abscissaConfig:r,ordinateConfig:i,raycasterThreshold:o,showAxes:s=!0,children:a}=t,l=OY(n,r.visDomain,i.visDomain),u=s?u$e({left:!!i.label,bottom:!!r.label,top:!!e}):oze,[c,d]=E.useState(null),[f,h]=E.useState(null);return D.jsxs("div",{className:hp.visCanvas,style:{gridTemplateColumns:`${u.left}px minmax(0, 1fr) ${u.right}px`,gridTemplateRows:`${u.top}px minmax(0, 1fr) ${u.bottom}px`},children:[s&&e&&D.jsx("p",{className:hp.title,children:e}),D.jsxs("div",{className:hp.canvasArea,children:[D.jsx(K$e,{className:hp.r3fRoot,orthographic:!0,children:D.jsxs(f$e,{visRatio:l,abscissaConfig:r,ordinateConfig:i,svgOverlay:c,floatingToolbar:f,children:[D.jsx(X$e,{axisOffsets:u,showAxes:s}),D.jsx(m$e,{children:a}),D.jsx(Q$e,{}),D.jsx(Y$e,{}),o!==void 0&&D.jsx(Z$e,{value:o})]})}),D.jsx("svg",{ref:d,className:hp.svgOverlay,overflow:"hidden"})]}),D.jsx("div",{ref:h,className:hp.floatingToolbar})]})}var Q0=(t=>(t.Circle="Circle",t.Cross="Cross",t.Square="Square",t.Cap="Cap",t))(Q0||{});Q0.Cross+"",Q0.Cap+"",Q0.Circle+"",Q0.Square+"";class aze extends Vu{}sK({Line_:aze});var sm=(t=>(t.MinGreater="min-greater",t.InvalidMinWithScale="invalid-min-with-scale",t.InvalidMaxWithScale="invalid-max-with-scale",t.CustomMaxFallback="custom-max-fallback",t))(sm||{});function lze(t){return IS(t*360,1,.5).formatRgb()}function pp(t){return e=>t(1-e)}const uze={Blues:pp(OBe),Greens:pp(LBe),Greys:pp($Be),Oranges:pp(jBe),Purples:pp(UBe),Reds:pp(VBe),Turbo:e8e,Viridis:t8e,Inferno:r8e,Magma:n8e,Plasma:i8e,Cividis:WBe,Warm:XBe,Cool:KBe,Cubehelix:qBe,BuGn:dBe,BuPu:hBe,GnBu:mBe,OrRd:vBe,PuBuGn:bBe,PuBu:wBe,PuRd:SBe,RdPu:EBe,YlGnBu:TBe,YlGn:PBe,YlOrBr:RBe,YlOrRd:NBe,Rainbow:YBe,Sinebow:JBe,HSL:lze,BrBG:q5e,PRGn:K5e,PiYG:Z5e,PuOr:J5e,RdBu:tBe,RdGy:rBe,RdYlBu:oBe,RdYlGn:aBe,Spectral:uBe},Bz=1/20;$W(0,1+Bz,Bz);const cze={[hn.Linear]:t=>t,[hn.Log]:Math.log10,[hn.SymLog]:t=>Math.sign(t)*Math.log10(1+Math.abs(t)),[hn.Sqrt]:Math.sqrt,[hn.Gamma]:t=>t},dze={float32:Ua,uint16:Uf,uint8:Ds,uint8_clamped:Ds};function fze(t,e){const n=uze[t];return e?r=>n(1-r):n}function hze(t,e=hn.Linear){const n=cze[e];return[n(t[0]),n(t[1])]}function pze(t,e=Nr){if(!t)return;const{rows:n,cols:r}=Y6e(t),i=new Jc(t.data,r,n,jN,dze[t.dtype],Tb,Ci,Ci,e);return i.needsUpdate=!0,i}const VA=T$e(pze),mze=cd(255,255,255,0),GA=256,gze={[hn.Log]:"log(value) * oneOverLog10",[hn.SymLog]:"sign(value) * log(1. + abs(value)) * oneOverLog10",[hn.Sqrt]:"sqrt(value)"},vze={[hn.Log]:"value > 0.",[hn.Sqrt]:"value >= 0."};function yze(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o=!1,magFilter:s,alphaValues:a,alphaDomain:l=e$e,badColor:u=mze,mask:c}=t,d=VA(e,s),f=VA(a),h=VA(c),p=E.useMemo(()=>{const _=fze(i,o),C=Array.from({length:GA}).flatMap((M,P)=>{const{r:A,g:R,b:F}=cd(_(P/(GA-1)));return[A,R,F,255]}),S=new Jc(Uint8Array.from(C),GA,1,Co,Ds);return S.needsUpdate=!0,S},[i,o]),[g,b]=Array.isArray(r)?r:[r,1],m=hze(n,g),w=typeof u=="string"?cd(u):u,x={uniforms:d$e({data:d,mask:h,colorMap:p,min:m[0],oneOverRange:1/(m[1]-m[0]),gammaExponent:b,normRevertFactor:e.dtype==="uint8"?255:1,alpha:f,withAlpha:a?1:0,alphaMin:l[0],oneOverAlphaRange:1/(l[1]-l[0]),badColor:new kn(w.r/255,w.g/255,w.b/255,w.opacity)}),vertexShader:c$e,fragmentShader:` +`;function d$e(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{value:n}]))}const kY=E.createContext({});function Ri(){return E.useContext(kY)}function f$e(t){const{visRatio:e,abscissaConfig:n,ordinateConfig:r,svgOverlay:i,floatingToolbar:o,children:s}=t,{width:a,height:l}=Vi($=>$.size),u={width:a,height:l},c=a/l,d=o$e(u,e),f=E.useMemo(()=>fd.empty().expandByPoint(new oe(a,l)),[a,l]),h=Iz(n,d.width),p=Iz(r,d.height),g=E.useCallback($=>new oe(h($.x),p($.y)),[h,p]),b=E.useCallback($=>new oe(h.invert($.x),p.invert($.y)),[h,p]),m=E.useMemo(()=>new qt().makeScale(a/2,-l/2,1).setPosition(a/2,l/2,0),[a,l]),w=E.useMemo(()=>m.clone().invert(),[m]),x=E.useCallback(($,j)=>j.clone().project($).applyMatrix4(m),[m]),_=E.useCallback(($,j)=>j.clone().applyMatrix4(w).unproject($),[w]),C=E.useCallback(($,j)=>x($,g(j)),[g,x]),S=E.useCallback(($,j)=>b(_($,j)),[_,b]),M=E.useCallback(($,j=$.position)=>{const{scale:k}=$;return fd.empty(j).expandBySize(a*k.x,l*k.y)},[a,l]),P=E.useCallback($=>{const[j,k]=M($).toRect().map(b);return{xVisibleDomain:[j.x,k.x],yVisibleDomain:[j.y,k.y]}},[M,b]),A=Vi($=>{var j;return(j=$.gl.domElement.parentElement)==null?void 0:j.parentElement});p_(A),HA(A);const R=A.parentElement;HA(R);const F=R.parentElement;return HA(F),D.jsx(kY.Provider,{value:{canvasSize:u,canvasRatio:c,canvasBox:f,visRatio:e,visSize:d,abscissaConfig:n,ordinateConfig:r,abscissaScale:h,ordinateScale:p,dataToWorld:g,dataToHtml:C,worldToHtml:x,worldToData:b,htmlToWorld:_,htmlToData:S,getFovBox:M,getVisibleDomains:P,visCanvas:F,canvasArea:R,r3fRoot:A,svgOverlay:i,floatingToolbar:o},children:s})}var mM=(t=>(t[t.Left=0]="Left",t[t.Middle=1]="Middle",t))(mM||{});class h$e{constructor(e,n){Mw(this,"buttons"),Mw(this,"modifierKeys"),Mw(this,"isWheel"),Mw(this,"isEnabled"),this.id=e;const{button:r=mM.Left,modifierKey:i=[],disabled:o=!1}=n;r==="Wheel"?(this.buttons=[],this.isWheel=!0):(this.buttons=WR(r),this.isWheel=!1),this.modifierKeys=WR(i),this.isEnabled=!o}matches(e){return this.isEnabled&&(e instanceof WheelEvent?this.isWheel:this.buttons.includes(e.button))&&this.modifierKeys.every(n=>e.getModifierState(n))}}const LY=E.createContext({});function p$e(){return E.useContext(LY)}function m$e(t){const{children:e}=t,[n]=E.useState(new Map),r=E.useCallback((s,a)=>{n.has(s)?console.warn(`An interaction with ID "${s}" is already registered.`):n.set(s,new h$e(s,a))},[n]),i=E.useCallback(s=>{n.delete(s)},[n]),o=E.useCallback((s,a)=>{const l=[...n.values()];if(!n.has(s))throw new Error(`Interaction ${s} is not registered`);const u=l.filter(c=>c.matches(a));return u.length===0?!1:u.length===1?u[0].id===s:u.reduce((c,d)=>d.modifierKeys.length>c.modifierKeys.length?d:c).id===s},[n]);return D.jsx(LY.Provider,{value:{registerInteraction:r,unregisterInteraction:i,shouldInteract:o},children:e})}const Nz=.95,Fz=new oe(1,1,1),g$e=["Alt","Control","Shift"];function Vb(){const{visSize:t,getFovBox:e}=Ri(),n=Vi(i=>i.camera),r=Vi(i=>i.invalidate);return E.useCallback(i=>{const{position:o}=n,s=fd.fromSize(t),a=e(n,i).keepWithin(s);o.copy(a.center.setZ(o.z)),n.updateMatrixWorld(),r()},[n,t,e,r])}function BY(){const{canvasSize:t}=Ri(),e=Vi(r=>r.camera),n=Vb();return E.useCallback(({world:r})=>{const{width:i,height:o}=t,s=fd.fromPoints(...r),{width:a,height:l}=s.size;e.scale.set(Math.max(a,1)/i,Math.max(l,1)/o,1),n(s.center)},[e,t,n])}function JF(){const{canvasArea:t}=Ri();Cf(t,"wheel",e=>e.preventDefault(),{passive:!1})}function eO(t){const e=Vi(r=>r.camera),n=Vb();return function(r){const{sourceEvent:i,worldPt:o}=r,{x:s,y:a}=t(i);if(!s&&!a)return;const l=new oe(s?Nz:1,a?Nz:1,1);i.deltaY<0?e.scale.multiply(l).min(Fz):e.scale.divide(l).min(Fz);const u=e.position.clone().sub(o);i.deltaY<0?u.multiply(l):u.divide(l),n(o.clone().add(u))}}function Nu(t,e,n={}){const r=xs(e),i=Vi(u=>u.camera),{htmlToWorld:o,worldToData:s,canvasArea:a}=Ri();function l(u){const{offsetX:c,offsetY:d}=u,f=new oe(c,d),h=o(i,f),p=s(h);r.current({htmlPt:f,worldPt:h,dataPt:p,sourceEvent:u})}Cf(a,t,l,n)}function Gb(t,e){const{shouldInteract:n,registerInteraction:r,unregisterInteraction:i}=p$e();return E.useEffect(()=>(r(t,e),()=>i(t)),[t,r,i,e]),E.useCallback(o=>n(t,o),[t,n])}function $Y(t=[]){const{canvasArea:e}=Ri(),n=WR(t),[r]=E.useState(new Map),[i,o]=u2e(!1);function s(){const a=n.every(l=>r.get(l));i!==a&&o(a)}return Cf(window,"keyup",a=>{const{key:l}=a;r.set(l,!1),s()}),Cf(window,"keydown",a=>{const{key:l}=a;r.set(l,!0),s()}),Cf(e,"pointerdown",a=>{g$e.forEach(l=>{r.set(l,a.getModifierState(l))}),s()}),i}function v$e(t){const{id:e="Pan",button:n=mM.Left,modifierKey:r,disabled:i}=t,o=Gb(e,{button:n,modifierKey:r,disabled:i}),s=Vi(h=>h.camera),a=Vb(),l=E.useRef(),u=$Y(r);function c(h){const{worldPt:p,sourceEvent:g}=h,{target:b,pointerId:m}=g;o(g)&&(b.setPointerCapture(m),l.current=p.clone())}function d(h){if(!l.current||!u)return;const{worldPt:p}=h,g=l.current.clone().sub(p);a(s.position.clone().add(g))}function f(h){const{sourceEvent:p}=h,{target:g,pointerId:b}=p;g.releasePointerCapture(b),l.current=void 0}return Nu("pointerdown",c),Nu("pointermove",d),Nu("pointerup",f),null}function zY(t){const{id:e="Selection",modifierKey:n,disabled:r,transform:i=W=>W,validate:o=()=>!0,onSelectionStart:s,onSelectionChange:a,onSelectionEnd:l,onValidSelection:u,children:c}=t,d=xs(i),f=xs(o),h=xs(s),p=xs(a),g=xs(l),b=xs(u),m=Vi(W=>W.camera),w=Ri(),{canvasBox:x,htmlToWorld:_,worldToData:C}=w,[S,M]=l2e(),P=E.useRef(),A=E.useRef(!1),R=$Y(n),F=Gb(e,{button:mM.Left,modifierKey:n,disabled:r});function $(W){const{sourceEvent:K}=W;if(!F(K))return;const{target:Q,pointerId:J}=K;Q.setPointerCapture(J),P.current=W}function j(W){if(!P.current)return;const{htmlPt:K}=P.current,Q=[K,x.clampPoint(W.htmlPt)],J=Q.map(ve=>_(m,ve)),ae=J.map(C);M({html:Q,world:J,data:ae})}function k(W){if(!P.current)return;const{sourceEvent:K}=W,{target:Q,pointerId:J}=K;Q.releasePointerCapture(J),P.current=void 0,A.current=F(K),M(void 0)}Nu("pointerdown",$),Nu("pointermove",j),Nu("pointerup",k);function U(){P.current=void 0,M(void 0)}h2e("Escape",U,[],{event:"keydown"}),Cf(window,"contextmenu",W=>{P.current&&(W.preventDefault(),U())});const G=E.useMemo(()=>S&&d.current(S,m,w),[S,d,m,w]),B=E.useMemo(()=>!!G&&f.current(G),[G,f]),L=U8(G),N=U8(B);return E.useEffect(()=>{var W,K,Q,J;if(G){p_(S),L||(W=h.current)==null||W.call(h),(K=p.current)==null||K.call(p,R?G:void 0,S,B);return}L&&(p_(N),(Q=g.current)==null||Q.call(g,A.current?L:void 0,N),N&&A.current&&((J=b.current)==null||J.call(b,L)),A.current=!1)},[G,L,S,B,N,R,h,p,g,b]),!G||!R?null:(p_(S),D.jsx(D.Fragment,{children:c(G,S,B)}))}const y$e="_selection_0f4643e",qR={selection:y$e};function tO(t){const{overflowCanvas:e=!1,children:n}=t,{r3fRoot:r,canvasArea:i}=Ri(),o=e?i:r,[s]=E.useState(()=>{const l=document.createElement("div");return l.setAttribute("hidden",""),l}),[a]=E.useState(()=>DH(s));return E.useLayoutEffect(()=>{a.render(qu.createPortal(n,o))},[n,o,a]),E.useLayoutEffect(()=>(r.append(s),()=>{a.unmount(),s.remove()}),[r,a,s]),null}function nO(t){const{children:e}=t,{svgOverlay:n}=Ri();return n?D.jsx(tO,{children:qu.createPortal(e,n)}):null}function US(t){const{coords:e,strokePosition:n,...r}=t,{stroke:i,strokeWidth:o=1}=r,s=i&&n?o*(n==="outside"?1:-1):0,{min:a,max:l}=fd.fromPoints(...e).expandBySize(s,s);return D.jsx("path",{d:`M ${a.x},${a.y} H ${l.x} V ${l.y} H ${a.x} z`,...r})}const b$e=20;function x$e(t){const{minZoom:e=b$e,...n}=t,{canvasSize:r,canvasRatio:i,canvasBox:o,visRatio:s,visSize:a,htmlToWorld:l,worldToData:u}=Ri(),c=BY(),d=Vi(p=>p.camera),f=s!==void 0;function h(p){if(!f)return p;const{scale:g}=d,b=fd.empty(new oe(r.width/2,r.height/2)).expandBySize(a.width/g.x,a.height/g.y),m=fd.fromPoints(...p.html).expandToRatio(i).keepWithin(o).keepWithin(b).toRect(),w=m.map(_=>l(d,_)),x=w.map(u);return{html:m,world:w,data:x}}return D.jsx(zY,{id:"SelectToZoom",transform:h,validate:({html:p})=>p[0].manhattanDistanceTo(p[1])>=e,onValidSelection:c,...n,children:({html:p},{html:g},b)=>D.jsxs(nO,{children:[D.jsx(US,{className:qR.selection,coords:g,fill:"white",fillOpacity:!f&&b?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:f||!b?4:void 0}),f&&D.jsx(US,{className:qR.selection,coords:p,fill:"white",fillOpacity:b?.25:0,stroke:"black",strokePosition:"inside"})]})})}function w$e(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Ri(),i=Gb("XAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:i(s),y:!1});return JF(),Nu("wheel",eO(o)),null}function _$e(t){const{modifierKey:e,disabled:n}=t,{visRatio:r}=Ri(),i=Gb("YAxisZoom",{button:"Wheel",modifierKey:e,disabled:r!==void 0||n}),o=s=>({x:!1,y:i(s)});return JF(),Nu("wheel",eO(o)),null}function S$e(t){const{modifierKey:e,disabled:n}=t,r=Gb("Zoom",{button:"Wheel",modifierKey:e,disabled:n}),i=o=>{const s=r(o);return{x:s,y:s}};return JF(),Nu("wheel",eO(i)),null}function C$e(t){const{axis:e,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,children:o,...s}=t;function a(l,u,c){const{canvasSize:d,htmlToWorld:f,worldToData:h}=c,{width:p,height:g}=d,[b,m]=l.html,w=e==="x"?[new oe(b.x,0),new oe(m.x,g)]:[new oe(0,b.y),new oe(p,m.y)],x=w.map(C=>f(u,C)),_=x.map(h);return{html:w,world:x,data:_}}return D.jsx(zY,{transform:a,onSelectionStart:n,onSelectionChange:r,onSelectionEnd:i,...s,children:o})}const E$e=20;function Oz(t){const{axis:e,modifierKey:n,disabled:r,minZoom:i=E$e}=t,{visRatio:o}=Ri(),s=BY();return D.jsx(C$e,{axis:e,id:`${e.toUpperCase()}SelectToZoom`,modifierKey:n,disabled:o!==void 0||r,validate:({html:a})=>fd.fromPoints(...a).hasMinSize(i),onValidSelection:s,children:({html:a},l,u)=>D.jsx(nO,{children:D.jsx(US,{className:qR.selection,coords:a,fill:"white",fillOpacity:u?.25:0,stroke:"black",strokePosition:"inside",strokeDasharray:u?void 0:4})})})}function M$e(t){const{...e}=t;return D.jsxs(D.Fragment,{children:[e.pan!==!1&&D.jsx(v$e,{...e.pan}),e.zoom!==!1&&D.jsx(S$e,{...e.zoom}),e.xAxisZoom!==!1&&D.jsx(w$e,{modifierKey:"Alt",...e.xAxisZoom}),e.yAxisZoom!==!1&&D.jsx(_$e,{modifierKey:"Shift",...e.yAxisZoom}),e.selectToZoom!==!1&&D.jsx(x$e,{modifierKey:"Control",...e.selectToZoom}),e.xSelectToZoom!==!1&&D.jsx(Oz,{axis:"x",modifierKey:["Control","Alt"],...e.xSelectToZoom}),e.ySelectToZoom!==!1&&D.jsx(Oz,{axis:"y",modifierKey:["Control","Shift"],...e.ySelectToZoom})]})}function T$e(t){return(...e)=>E.useMemo(()=>t(...e),e)}function rO(t,e,n=(r,i)=>Object.is(r,i)){const r=Vi(a=>a.camera),i=s2e(),o=E.useRef(),s=xs(t);return E.useMemo(()=>{o.current=s.current(r)},e),TF(()=>{const a=s.current(r);n(o.current,a)||(o.current=a,i())}),o.current}function A$e(t){const{children:e}=t,{floatingToolbar:n}=Ri();return n?D.jsx(tO,{children:qu.createPortal(e,n)}):null}const P$e="_btnLike_0154b53",D$e="_icon_bcb8f77",R$e="_label_5a75092",I$e="_popup_954b735",N$e="_popupInner_95eb7d8",F$e="_btn_f1cebe5 btnClean",UY={btnLike:P$e,icon:D$e,label:R$e,popup:I$e,popupInner:N$e,btn:F$e},{btn:O$e,btnLike:k$e}=UY,L$e=`_btn_579cee1 ${O$e}`,B$e=`_btnLike_5797793 ${k$e}`,kz={btn:L$e,btnLike:B$e};function $$e(){const t=Vi(i=>i.camera),e=Vi(i=>i.invalidate),n=rO(({scale:i})=>i.x<1||i.y<1,[]);function r(){t.scale.x=1,t.scale.y=1,t.position.x=0,t.position.y=0,t.updateMatrixWorld(),e()}return D.jsx(A$e,{children:D.jsx("button",{className:kz.btn,type:"button",hidden:!n,onClick:()=>r(),children:D.jsx("span",{className:kz.btnLike,children:"Reset zoom"})})})}function z$e(t){const{children:e,size:n,...r}=t,{visSize:i}=Ri(),{width:o,height:s}=n??i;return D.jsxs("mesh",{...r,children:[D.jsx("planeGeometry",{args:[o,s]}),e]})}const U$e="_axis_1002b06",H$e="_grid_a397f58",V$e="_tick_44c4d9c",G$e="_label_4a1d111",HS={axis:U$e,grid:H$e,tick:V$e,label:G$e};function j$e(t){const{formattedValue:e,...n}=t;return D.jsx("text",{...n,dy:"0.3125em",children:e})}const W$e={labelClassName:HS.label,labelProps:{fontSize:"inherit"},tickClassName:HS.tick,tickComponent:j$e},q$e={abscissa:[k5e,xY],ordinate:[I5e,bY]};function Lz(t){const{type:e,config:n,domain:r,canvasSize:i,offset:o,flipAxis:s,showAxis:a}=t,{width:l,height:u}=i,c=e==="abscissa",d=c?l:u,{scaleType:f=hn.Linear,isIndexAxis:h,showGrid:p,label:g,nice:b=!1}=n,m=FY(f,{domain:r,range:s?[d,0]:[0,d],nice:b}),[w,x]=q$e[e],_=r$e(d),C=h?{tickValues:a$e(r,_)}:{numTicks:_};return D.jsxs(D.Fragment,{children:[a&&D.jsx("svg",{className:HS.axis,"data-type":e,style:c?{width:l,height:o}:{width:o,height:u},children:D.jsx(w,{scale:m,tickFormat:l$e(r,d,f),label:g,labelOffset:o-(c?32:36),hideAxisLine:p,...C,...W$e})}),p&&D.jsx("svg",{className:HS.grid,...i,children:D.jsx(x,{scale:m,...i,...C})})]})}function X$e(t){const{axisOffsets:e,showAxes:n}=t,{canvasSize:r,visCanvas:i,abscissaConfig:o,ordinateConfig:s,getVisibleDomains:a}=Ri(),l=rO(a,[a]);return D.jsx(tO,{children:qu.createPortal(D.jsxs(D.Fragment,{children:[D.jsx(Lz,{type:"abscissa",config:o,domain:l.xVisibleDomain,canvasSize:r,offset:e.bottom,showAxis:n}),D.jsx(Lz,{type:"ordinate",config:s,domain:l.yVisibleDomain,canvasSize:r,offset:e.left,showAxis:n,flipAxis:!0})]}),i)})}function K$e(t){const{className:e,orthographic:n,children:r}=t;return D.jsxs(MFe,{className:e,orthographic:n,flat:!0,frameloop:"demand",dpr:[1,3],resize:{debounce:{scroll:20,resize:200},scroll:!1},gl:{preserveDrawingBuffer:!0},children:[D.jsx("ambientLight",{}),r]})}function Y$e(){const{visRatio:t}=Ri(),e=Vi(r=>r.camera),n=Vb();return E.useEffect(()=>{if(!t||e.scale.x===e.scale.y)return;const r=Math.max(e.scale.x,e.scale.y);e.scale.x=r,e.scale.y=r,n(e.position)},[e,n,t]),null}function Z$e(t){const{value:e}=t,n=Vi(i=>i.raycaster),r=Vi(i=>i.camera);return E.useEffect(()=>{const i=n.params.Points,o=i?i.threshold:1;return i&&(i.threshold=e),()=>{i&&(i.threshold=o)}},[n,e]),TF(()=>{const i=(r.scale.x+r.scale.y)/2;n.params.Points&&(n.params.Points.threshold=e*i/2)}),null}function Q$e(){const{dataToWorld:t,worldToData:e}=Ri(),n=E.useRef(),r=Vi(o=>o.camera),i=Vb();return TF(()=>{n.current=e(r.position)}),E.useEffect(()=>{n.current&&i(t(n.current))},[n,i,t,r]),null}const J$e="_visCanvas_2387375",eze="_title_313417a",tze="_canvasArea_6300bb7",nze="_r3fRoot_f557f0c",rze="_svgOverlay_3f84e2f",ize="_floatingToolbar_de4854e",hp={visCanvas:J$e,title:eze,canvasArea:tze,r3fRoot:nze,svgOverlay:rze,floatingToolbar:ize},oze={left:0,right:0,top:0,bottom:0};function sze(t){const{title:e,aspect:n="auto",abscissaConfig:r,ordinateConfig:i,raycasterThreshold:o,showAxes:s=!0,children:a}=t,l=OY(n,r.visDomain,i.visDomain),u=s?u$e({left:!!i.label,bottom:!!r.label,top:!!e}):oze,[c,d]=E.useState(null),[f,h]=E.useState(null);return D.jsxs("div",{className:hp.visCanvas,style:{gridTemplateColumns:`${u.left}px minmax(0, 1fr) ${u.right}px`,gridTemplateRows:`${u.top}px minmax(0, 1fr) ${u.bottom}px`},children:[s&&e&&D.jsx("p",{className:hp.title,children:e}),D.jsxs("div",{className:hp.canvasArea,children:[D.jsx(K$e,{className:hp.r3fRoot,orthographic:!0,children:D.jsxs(f$e,{visRatio:l,abscissaConfig:r,ordinateConfig:i,svgOverlay:c,floatingToolbar:f,children:[D.jsx(X$e,{axisOffsets:u,showAxes:s}),D.jsx(m$e,{children:a}),D.jsx(Q$e,{}),D.jsx(Y$e,{}),o!==void 0&&D.jsx(Z$e,{value:o})]})}),D.jsx("svg",{ref:d,className:hp.svgOverlay,overflow:"hidden"})]}),D.jsx("div",{ref:h,className:hp.floatingToolbar})]})}var Q0=(t=>(t.Circle="Circle",t.Cross="Cross",t.Square="Square",t.Cap="Cap",t))(Q0||{});Q0.Cross+"",Q0.Cap+"",Q0.Circle+"",Q0.Square+"";class aze extends Vu{}sK({Line_:aze});var sm=(t=>(t.MinGreater="min-greater",t.InvalidMinWithScale="invalid-min-with-scale",t.InvalidMaxWithScale="invalid-max-with-scale",t.CustomMaxFallback="custom-max-fallback",t))(sm||{});function lze(t){return IS(t*360,1,.5).formatRgb()}function pp(t){return e=>t(1-e)}const uze={Blues:pp(OBe),Greens:pp(LBe),Greys:pp($Be),Oranges:pp(jBe),Purples:pp(UBe),Reds:pp(VBe),Turbo:e8e,Viridis:t8e,Inferno:r8e,Magma:n8e,Plasma:i8e,Cividis:WBe,Warm:XBe,Cool:KBe,Cubehelix:qBe,BuGn:dBe,BuPu:hBe,GnBu:mBe,OrRd:vBe,PuBuGn:bBe,PuBu:wBe,PuRd:SBe,RdPu:EBe,YlGnBu:TBe,YlGn:PBe,YlOrBr:RBe,YlOrRd:NBe,Rainbow:YBe,Sinebow:JBe,HSL:lze,BrBG:q5e,PRGn:K5e,PiYG:Z5e,PuOr:J5e,RdBu:tBe,RdGy:rBe,RdYlBu:oBe,RdYlGn:aBe,Spectral:uBe},Bz=1/20;$W(0,1+Bz,Bz);const cze={[hn.Linear]:t=>t,[hn.Log]:Math.log10,[hn.SymLog]:t=>Math.sign(t)*Math.log10(1+Math.abs(t)),[hn.Sqrt]:Math.sqrt,[hn.Gamma]:t=>t},dze={float32:za,uint16:Uf,uint8:Ds,uint8_clamped:Ds};function fze(t,e){const n=uze[t];return e?r=>n(1-r):n}function hze(t,e=hn.Linear){const n=cze[e];return[n(t[0]),n(t[1])]}function pze(t,e=Nr){if(!t)return;const{rows:n,cols:r}=Y6e(t),i=new Jc(t.data,r,n,jN,dze[t.dtype],Tb,Ci,Ci,e);return i.needsUpdate=!0,i}const VA=T$e(pze),mze=cd(255,255,255,0),GA=256,gze={[hn.Log]:"log(value) * oneOverLog10",[hn.SymLog]:"sign(value) * log(1. + abs(value)) * oneOverLog10",[hn.Sqrt]:"sqrt(value)"},vze={[hn.Log]:"value > 0.",[hn.Sqrt]:"value >= 0."};function yze(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o=!1,magFilter:s,alphaValues:a,alphaDomain:l=e$e,badColor:u=mze,mask:c}=t,d=VA(e,s),f=VA(a),h=VA(c),p=E.useMemo(()=>{const _=fze(i,o),C=Array.from({length:GA}).flatMap((M,P)=>{const{r:A,g:R,b:F}=cd(_(P/(GA-1)));return[A,R,F,255]}),S=new Jc(Uint8Array.from(C),GA,1,Co,Ds);return S.needsUpdate=!0,S},[i,o]),[g,b]=Array.isArray(r)?r:[r,1],m=hze(n,g),w=typeof u=="string"?cd(u):u,x={uniforms:d$e({data:d,mask:h,colorMap:p,min:m[0],oneOverRange:1/(m[1]-m[0]),gammaExponent:b,normRevertFactor:e.dtype==="uint8"?255:1,alpha:f,withAlpha:a?1:0,alphaMin:l[0],oneOverAlphaRange:1/(l[1]-l[0]),badColor:new kn(w.r/255,w.g/255,w.b/255,w.opacity)}),vertexShader:c$e,fragmentShader:` uniform sampler2D data; uniform sampler2D colorMap; @@ -3962,7 +3962,7 @@ No matching component was found for: } } } - `};return D.jsx("shaderMaterial",{args:[x],side:Ba})}const bze=E.memo(yze);function xze(t){const{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:s,alphaValues:a,alphaDomain:l,badColor:u,mask:c,...d}=t;return D.jsx(z$e,{...d,children:D.jsx(bze,{values:e,domain:n,scaleType:r,colorMap:i,invertColorMap:o,magFilter:s,alphaValues:a,alphaDomain:l,badColor:u,mask:c})})}const{btn:wze,btnLike:_ze,icon:Sze,label:Cze,popup:Eze,popupInner:Mze}=UY,Tze="_toolbar_d77010c",Aze="_controls_6f2898a",Pze="_controlWrapper_c53184f",Dze="_control_72c50d3",Rze="_sep_9963159",Ize=`_btn_ea88005 ${wze}`,Nze=`_btnLike_059b9d6 ${_ze}`,Fze=`_icon_b73dfea ${Sze}`,Oze=`_label_917dfbf ${Cze}`,kze=`_popup_486e2ed ${Eze}`,Lze=`_popupInner_54ff1a6 ${Mze}`,Tw={toolbar:Tze,controls:Aze,controlWrapper:Pze,control:Dze,sep:Rze,btn:Ize,btnLike:Nze,icon:Fze,label:Oze,popup:kze,popupInner:Lze};function Bze(t){const{label:e,icon:n,iconOnly:r,small:i,raised:o,disabled:s,onClick:a,...l}=t;return D.jsx("button",{className:Tw.btn,type:"button",title:r?e:void 0,"aria-label":r?e:void 0,disabled:s,"data-small":i||void 0,"data-raised":o||void 0,onClick:()=>a(),...l,children:D.jsxs("span",{className:Tw.btnLike,children:[n&&D.jsx(n,{className:Tw.icon}),!r&&D.jsx("span",{className:Tw.label,children:e})]})})}function $z(t){const{value:e,onToggle:n,...r}=t;return D.jsx(Bze,{...r,"aria-pressed":e,onClick:()=>n()})}E.createContext(void 0);const $ze="_boundEditor_ce4a770",zze="_label_1e85446",Uze="_value_c7f465d",jA={boundEditor:$ze,label:zze,value:Uze},Hze="_root_86b0b1e",Vze="_dataRange_03d542e",Gze="_autoscale_8ea032e",jze="_error_841a0df",Wze="_errorMessage_a16acf6",qze="_actionBtn_18350cd btnClean",Xze="_swapBtn_2e22485 _actionBtn_18350cd btnClean",td={root:Hze,dataRange:Vze,autoscale:Gze,error:jze,errorMessage:Wze,actionBtn:qze,swapBtn:Xze},HY=E.forwardRef((t,e)=>{const{bound:n,value:r,isEditing:i,hasError:o,onEditToggle:s,onChange:a}=t,l=`${n}-bound`,u=E.useRef(null),[c,d]=E.useState("");function f(){s(!1),d(zA(r))}return E.useImperativeHandle(e,()=>({cancel:f})),E.useEffect(()=>{d(zA(r))},[r,d]),E.useEffect(()=>{var h,p;i||(h=u.current)==null||h.blur(),i&&n==="min"&&((p=u.current)==null||p.focus())},[i,n]),D.jsxs("form",{className:jA.boundEditor,"data-error":o||void 0,"data-editing":i,onSubmit:h=>{h.preventDefault();const p=Number.parseFloat(c.replace("−","-")),g=Number.isNaN(p)?r:s$e(p);d(zA(g)),a(g),s(!1)},children:[D.jsx("label",{id:`${l}-label`,className:jA.label,htmlFor:l,children:n}),D.jsx("input",{id:l,ref:u,className:jA.value,type:"text",name:"bound",value:c,title:i?void 0:r.toString(),"aria-labelledby":`${l}-label`,onChange:h=>d(h.target.value),onFocus:()=>{i||s(!0)}}),D.jsx("button",{className:td.actionBtn,type:"submit",disabled:!i,"aria-label":`Apply ${n}`,children:D.jsx(h8e,{})}),D.jsx("button",{className:td.actionBtn,type:"button",disabled:!i,"aria-label":`Cancel ${n}`,onClick:()=>f(),children:D.jsx(m8e,{})})]})});HY.displayName="BoundEditor";const zz=HY,Kze={[sm.MinGreater]:{message:"Min greater than max",fallback:"data range"},[sm.InvalidMinWithScale]:{message:"Custom min invalid with this scale",fallback:"data min"},[sm.InvalidMaxWithScale]:{message:"Custom max invalid with this scale",fallback:"data max"},[sm.CustomMaxFallback]:{message:"Custom min invalid with this scale",fallback:"custom max"}};function WA(t){const{error:e,showSwapBtn:n=!1,onSwap:r}=t,{message:i,fallback:o}=Kze[e];return D.jsxs("p",{className:td.error,children:[D.jsxs("span",{className:td.errorMessage,children:[i,D.jsx("br",{}),D.jsx(p8e,{})," falling back to ",D.jsx("strong",{children:o})]}),n&&r&&D.jsx("button",{className:td.swapBtn,type:"button","aria-label":"Swap min and max",onClick:()=>r(),children:D.jsx(L8e,{})})]})}const Yze=E.forwardRef((t,e)=>{const{sliderDomain:n,dataDomain:r,errors:i}=t,{isAutoMin:o,isAutoMax:s,isEditingMin:a,isEditingMax:l}=t,{onAutoMinToggle:u,onAutoMaxToggle:c,onEditMin:d,onEditMax:f,onChangeMin:h,onChangeMax:p,onSwap:g}=t,{minGreater:b,minError:m,maxError:w}=i,x=E.useRef(null),_=E.useRef(null);return E.useImperativeHandle(e,()=>({cancelEditing:()=>{var C,S;(C=x.current)==null||C.cancel(),(S=_.current)==null||S.cancel()}})),D.jsxs("div",{className:td.root,children:[b&&D.jsx(WA,{error:sm.MinGreater,showSwapBtn:!o&&!s,onSwap:g}),D.jsx(zz,{ref:x,bound:"min",value:n[0],isEditing:a,hasError:b||!!m,onEditToggle:d,onChange:h}),m&&D.jsx(WA,{error:m}),D.jsx(zz,{ref:_,bound:"max",value:n[1],isEditing:l,hasError:b||!!w,onEditToggle:f,onChange:p}),w&&D.jsx(WA,{error:w}),D.jsxs("p",{className:td.dataRange,children:["Data range"," ",D.jsxs("span",{children:["["," ",D.jsx("abbr",{title:r[0].toString(),children:Pz(r[0])})," ",","," ",D.jsx("abbr",{title:r[1].toString(),children:Pz(r[1])})," ","]"]})]}),D.jsxs("p",{className:td.autoscale,children:["Autoscale"," ",D.jsx($z,{label:"Min",raised:!0,value:o,onToggle:u}),D.jsx($z,{label:"Max",raised:!0,value:s,onToggle:c})]})]})});Yze.displayName="DomainControls";const Zze="_thumb_be15bc7",Qze="_thumbBtnLike_3744319",Jze="_icon_4b34f14",Aw={thumb:Zze,thumbBtnLike:Qze,icon:Jze},eUe=E.forwardRef((t,e)=>{const{bound:n,isAuto:r,hasError:i,disabled:o,AutoIcon:s,...a}=t;return D.jsx("div",{ref:e,...a,className:Aw.thumb,"aria-label":`Change ${n} limit`,"aria-disabled":o||void 0,tabIndex:o?-1:a.tabIndex,"data-auto":r,"data-error":i||void 0,children:D.jsxs("div",{className:Aw.thumbBtnLike,children:[r&&D.jsx(s,{className:Aw.icon}),!r&&i&&D.jsx(f8e,{className:Aw.icon,strokeWidth:"3"})]})})});eUe.displayName="Thumb";function tUe(t){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:D.jsx("path",{d:"M18 17v-2H6v2zm4-4v-2H2v2zm-8 8v-2h-4v2zm4-12V7H6v2zm-8-4h4V3h-4z",stroke:"none"})})}function nUe(t){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1em",width:"1em",...t,children:D.jsx("polyline",{points:"2 12 6 12 9 21 15 3 19 3"})})}hn.Linear+"",hn.Log+"",hn.SymLog+"",hn.Sqrt+"",hn.Gamma+"";function rUe(t){const{points:e,children:n}=t,{dataToHtml:r}=Ri(),i=rO(o=>e.map(s=>r(o,s)),[e,r]);return D.jsx(D.Fragment,{children:n(...i)})}function qA(t){const{coords:e,...n}=t,[r,i]=e;return D.jsx("line",{x1:r.x,y1:r.y,x2:i.x,y2:i.y,...n})}eh(t=>({val:void 0,setTooltipValue:(e,n,r)=>t(()=>({val:{x:e,y:n,v:r}}))}));function iUe(t){const{api:e,layer:n,x:r,y:i,magFilter:o,onPointerMove:s,...a}=t,l=e.get(n,new Xe(r,i)),[u,c]=l.shape,d=e2e(f=>{s==null||s(f,l)},[s],50);return D.jsx("group",{position:[r+c/2,i+u/2,0],children:D.jsx(xze,{values:l,...a,magFilter:o,size:{width:c,height:u},onPointerMove:s&&d})})}E.memo(iUe);new wa(new oe(-1,-1,-1),new oe(1,1,1));class oUe{constructor(e,n,r){bi(this,"detProps");bi(this,"kmod");bi(this,"qScale");bi(this,"mki");this.detProps=e,e.beamVector.normalize(),this.qScale=r,this.mki=e.beamVector.clone().negate(),this.kmod=this.qScale/n;const i=this.detProps.beamVector.clone();i.multiplyScalar(this.kmod),this.mki=i.negate()}qFromPixelPosition(e){const n=new oe;return n.set(-e.x,-e.y,0),n.add(this.detProps.origin),this._convertToQ(n)}setDiffractionCrystalEnviroment(e){this.kmod=this.qScale/e;const n=this.detProps.beamVector.clone();n.multiplyScalar(this.kmod),this.mki=n.negate()}_convertToQ(e){const n=e.length();return n>0?(e.multiplyScalar(this.kmod/n),e.add(this.mki)):e.add(this.mki),e}}class $o{constructor(e,n){bi(this,"min");bi(this,"max");if(this.min=e,this.max=n,e>n){const r=n;this.max=e,this.min=r}}containsValue(e){return e>=this.min&&e<=this.max}containsRange(e){return e.min>=this.min&&e.max<=this.max}intersect(e){return e===null||e.min>this.max||this.min>e.max?null:new $o(Math.max(e.min,this.min),Math.min(e.max,this.max))}apply(e){return new $o(e(this.min),e(this.max))}applyInPlace(e){if(this.min=e(this.min),this.max=e(this.max),this.min>this.max){const n=this.max;this.max=this.min,this.min=n}return this}toString(){return`(min:${this.min}, max:${this.max})`}equals(e){return this.min===e.min&&this.max===e.max}}class Tm{constructor(e,n){bi(this,"direction");bi(this,"initial_point");if(e.length()==0)throw TypeError("The direction vector of a ray cannot be the zero vector.");this.direction=e,this.initial_point=n}getPoint(e){const n=new Xe(this.direction.x,this.direction.y);return n.multiplyScalar(e),n.add(this.initial_point),n}getPointAtDistance(e){return this.getPoint(e/this.direction.length())}static getParameterRange(e,n){let r=Math.min(e,n);const i=Math.max(e,n);return r<0&&(r=0),new $o(r,i)}getCircleIntersectionParameterRange(e,n){const r=this.initial_point.clone().add(n.multiplyScalar(-1)),i=this.direction.dot(this.direction),o=2*r.dot(this.direction),s=r.dot(r)-Math.pow(e,2),a=Math.pow(o,2)-4*i*s;if(a<0)return null;let l,u;if(i==0){if(o==0)return s==0?new $o(0,Number.POSITIVE_INFINITY):null;l=-s/o,u=-s/o}else l=.5*(-o-Math.sqrt(a))/i,u=.5*(-o+Math.sqrt(a))/i;return Tm.getParameterRange(l,u)}getRectangleIntersectionParameterRange(e,n,r){let i;const o=e.x+n,s=e.x,a=e.y,l=e.y-r;if(this.direction.x===0){if(!new $o(s,o).containsValue(this.initial_point.x))return null;i=new $o(0,Number.POSITIVE_INFINITY)}else i=new $o((s-this.initial_point.x)/this.direction.x,(o-this.initial_point.x)/this.direction.x);return this.direction.y==0?new $o(l,a).containsValue(this.initial_point.y)?Tm.getParameterRange(i.min,i.max):null:(i=i.intersect(new $o((l-this.initial_point.y)/this.direction.y,(a-this.initial_point.y)/this.direction.y)),i==null?null:Tm.getParameterRange(i.min,i.max))}}const Pw={ptMin:new Xe(0,0),ptMax:new Xe(0,0),visibleQRange:null,fullQRange:null};function sUe(t,e,n,r){const{clearanceWidth:i,beamcentreX:o,clearanceHeight:s,beamcentreY:a,detectorHeight:l,detectorWidth:u,cameraTubeCentreX:c,cemeraTubeCentreY:d,cameraLength:f}=aUe(r,e,t,n),h=cS(wi(i,JB(r.angle)),o);if(typeof h=="number"||!("units"in h))return Pw;const p=cS(wi(s,e8(r.angle)),a);if(typeof p=="number"||!("units"in p))return Pw;const g=new Xe(h.toSI().toNumber(),p.toSI().toNumber()),b=new Xe(JB(r.angle),e8(r.angle)),m=new Tm(b,g);let w=m.getRectangleIntersectionParameterRange(new Xe(0,l.toSI().toNumber()),u.toSI().toNumber(),l.toSI().toNumber());if(w===null)return Pw;if(n!==null&&n.diameter.toSI().toNumber()!=0){const G=_o(n.diameter,2).toSI().toNumber(),B=new Xe(c.toSI().toNumber(),d.toSI().toNumber());w=w.intersect(m.getCircleIntersectionParameterRange(G,B))}if(w===null)return Pw;const _=m.getPoint(w.min),C=m.getPoint(w.max),S=new oe(o.toSI().toNumber(),a.toSI().toNumber(),f.toSI().toNumber()),M=new oe(0,0,1),P={...t,origin:S,beamVector:M},A=new oUe(P,r.wavelength.toSI().toNumber(),2*Math.PI),R=A.qFromPixelPosition(_),F=A.qFromPixelPosition(C);P.origin.z=r.beamline.minCameraLength.toSI().toNumber(),A.setDiffractionCrystalEnviroment(r.beamline.minWavelength.toSI().toNumber());const $=A.qFromPixelPosition(C);P.origin.z=r.beamline.maxCameraLength.toSI().toNumber(),A.setDiffractionCrystalEnviroment(r.beamline.maxWavelength.toSI().toNumber());const j=A.qFromPixelPosition(_),k=new $o(R.length(),F.length()),U=new $o($.length(),j.length());return{ptMin:_,ptMax:C,visibleQRange:k,fullQRange:U}}function aUe(t,e,n,r){const i=Rt(t.cameraLength??NaN,"m"),o=cS(Rt(e.clearance??NaN,"xpixel"),_o(e.diameter,2)),s=cS(Rt(e.clearance??NaN,"ypixel"),_o(e.diameter,2)),a=Rt(e.centre.x??NaN,"xpixel"),l=Rt(e.centre.y??NaN,"ypixel"),u=Rt(n.resolution.height,"ypixel"),c=Rt(n.resolution.width,"xpixel"),d=Rt(r.centre.x??NaN,"xpixel"),f=Rt(r.centre.y??NaN,"ypixel");return{clearanceWidth:o,beamcentreX:a,clearanceHeight:s,beamcentreY:l,detectorHeight:u,detectorWidth:c,cameraTubeCentreX:d,cemeraTubeCentreY:f,cameraLength:i}}const lUe=(t,e,n)=>{if(t<0||e<0||n<0)return null;const r=n*t/(4*Math.PI);return Math.abs(r)>=Math.sqrt(2)/2?null:Math.tan(2*Math.asin(r))*e},Uz=(t,e,n,r,i)=>{const[o,s,a,l,u,c]=[t,n,r,e,i.x,i.y].map(b=>b.toSI().toNumber()),d=new Tm(new Xe(Math.cos(l),Math.sin(l)),new Xe(u,c)),f=lUe(o,s,a)??0,h=d.getPointAtDistance(f),p=Rt(h.x,"m"),g=Rt(h.y,"m");return{x:p,y:g}};class Ha{constructor(e,n){bi(this,"min");bi(this,"max");if(this.min=e,this.max=n,!e.equalBase(n))throw new TypeError("min and max units must be same base length, mass, etc");if(j0(e,n)){const r=n;this.max=e,this.min=r}}to(e){return new Ha(this.min.to(e),this.max.to(e))}containsValue(e){const n=CT(e,this.min)&&CT(e,this.max);if(typeof n!="boolean")throw TypeError("Can only check one value at a time");return n}containsRange(e){const n=$ye(this.min,e.min)&&CT(this.max,e.max);if(typeof n!="boolean")throw TypeError("Can only check one value at a time");return n}intersect(e){return j0(e.min,this.max)||j0(this.min,e.max)?null:new Ha(Bye(e.min,this.min),Fye(e.max,this.max))}apply(e){return new Ha(e(this.min),e(this.max))}applyInPlace(e){if(this.min=e(this.min),this.max=e(this.max),j0(this.min,this.max)){const n=this.max;this.max=this.min,this.min=n}return this}static fromNumericRange(e,n){return new Ha(Rt((e==null?void 0:e.min)??NaN,n),Rt((e==null?void 0:e.max)??NaN,n))}toString(){return`(min:${this.min.toString()}, max:${this.max.toString()})`}equals(e){const n=SD(this.min,e.min)&&SD(this.max,e.max);if(typeof n!="boolean")throw TypeError("write this later");return n}}function uUe(t){return D.jsx("svg",{style:{display:"grid",maxHeight:"200px",width:"90%",border:"solid black"},children:D.jsx("text",{x:"40%",y:"50%",children:t.message})})}const Hz=t=>t<50?"start":"end";function cUe({visibleRange:t,requestedRange:e}){const n=t.max.toNumber()-t.min.toNumber(),r=e.max.toNumber()/n*100,i=e.min.toNumber()/n*100,o=t.containsRange(e)?"green":"red";return D.jsxs("svg",{style:{display:"grid",maxHeight:"200px",width:"90%",border:"solid black"},children:[D.jsx("rect",{y:"0",x:"0",width:"100%",height:"50%",fill:o}),D.jsx("line",{x1:`${i}%`,y1:0,x2:`${i}%`,y2:"50%",style:{stroke:"black",strokeWidth:2}}),D.jsx("line",{x1:`${r}%`,y1:0,x2:`${r}%`,y2:"60%",style:{stroke:"black",strokeWidth:2}}),D.jsxs("text",{y:"60%",x:`${i}%`,textAnchor:Hz(i),children:[" ","Requested min"]}),D.jsx("text",{y:"80%",x:`${r}%`,textAnchor:Hz(r),children:"Requested max"})]})}var Ho=(t=>(t.q="q",t.s="s",t.d="d",t))(Ho||{});const yf=eh(t=>({requested:"q",qUnits:dS.nanometres,sUnits:ia.nanometres,dUnits:ia.nanometres,requestedMin:null,requestedMax:null,updateRequested:e=>{t({requested:e})},updateRequestedRange:e=>{t({...e})},updateQUnits:e=>t({qUnits:e}),updateSUnits:e=>t({sUnits:e}),updateDUnits:e=>t({dUnits:e})})),VS=t=>{const e=_o(1,t);if(typeof e=="number"||!("units"in e))throw TypeError("name this error later ");return e},GS=t=>{const e=_o(2*Math.PI,t);if(typeof e=="number"||!("units"in e))throw TypeError("name this error later ");return e};function dUe(t){const e=yf(),n=yf(d=>d.updateQUnits),r=yf(d=>d.updateSUnits),i=yf(d=>d.updateDUnits),o=d=>{n(d.target.value)},s=d=>{r(d.target.value)},a=d=>{i(d.target.value)},l=t.qRange.to(e.qUnits),u=t.qRange.apply(VS).to(e.sUnits),c=t.qRange.apply(GS).to(e.dUnits);return D.jsx(xu,{variant:"outlined",children:D.jsx($he,{children:D.jsxs(Phe,{sx:{minWidth:50},"aria-label":"simple table",size:"small",children:[D.jsx(jhe,{children:D.jsxs(wx,{children:[D.jsx(ri,{align:"center",children:"Values"}),D.jsx(ri,{align:"center",children:"Min"}),D.jsx(ri,{align:"center",children:"Max"}),D.jsx(ri,{align:"center",children:"Units"})]})}),D.jsxs(wx,{children:[D.jsx(ri,{component:"th",scope:"row",align:"center",children:Ho.q}),D.jsx(ri,{align:"center",children:isNaN(l.min.toNumber())?"":l.min.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:isNaN(l.max.toNumber())?"":l.max.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:D.jsxs(Ai,{children:[D.jsx(da,{children:"q"}),D.jsxs(Ps,{size:"small",label:"units",value:e.qUnits,onChange:o,children:[D.jsx(wn,{value:dS.nanometres,children:"1 / nm"}),D.jsx(wn,{value:dS.angstroms,children:"1 / Å"})]})]})})]},"q"),D.jsxs(wx,{children:[D.jsx(ri,{component:"th",scope:"row",align:"center",children:Ho.s}),D.jsx(ri,{align:"center",children:isNaN(u.min.toNumber())?"":u.min.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:isNaN(u.max.toNumber())?"":u.max.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:D.jsxs(Ai,{children:[D.jsx(da,{children:"s"}),D.jsxs(Ps,{size:"small",label:"units",value:e.sUnits,onChange:s,children:[D.jsx(wn,{value:ia.nanometres,children:ia.nanometres}),D.jsx(wn,{value:ia.angstroms,children:"Å"})]})]})})]},"s"),D.jsxs(wx,{children:[D.jsx(ri,{component:"th",scope:"row",align:"center",children:Ho.d}),D.jsx(ri,{align:"center",children:isNaN(c.min.toNumber())?"":c.min.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:isNaN(c.max.toNumber())?"":c.max.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:D.jsxs(Ai,{children:[D.jsx(da,{children:"d"}),D.jsxs(Ps,{size:"small",label:"units",value:e.dUnits,onChange:a,children:[D.jsx(wn,{value:ia.nanometres,children:ia.nanometres}),D.jsx(wn,{value:ia.angstroms,children:"Å"})]})]})})]},"d")]})})})}function fUe(t,e,n,r){let i=null,o=null,s=null,a=null;if(!(t&&e&&n))return{textBoxUnits:a,diagramVisible:i,diagramFull:o,diagramRequested:s};switch(r.requested){case Ho.d:i=t.apply(GS).to("nm"),o=e.apply(GS).to("nm"),s=Ha.fromNumericRange(n,r.dUnits).to("nm"),a=r.dUnits;break;case Ho.s:i=t.apply(VS).to("nm"),o=e.apply(VS).to("nm"),s=Ha.fromNumericRange(n,r.sUnits).to("nm"),a=r.sUnits;break;default:i=t.to("nm^-1"),o=e.to("nm^-1"),s=Ha.fromNumericRange(n,r.qUnits).to("nm^-1"),a=r.qUnits}return{textBoxUnits:a,diagramVisible:i,diagramFull:o,diagramRequested:s}}function hUe({resultStore:t}){return D.jsxs(Ai,{children:[D.jsx(qI,{children:"Requested Quantiy"}),D.jsxs(gG,{row:!0,value:t.requested,onChange:e=>t.updateRequested(e.target.value),children:[D.jsx(Bo,{value:Ho.q,control:D.jsx(gm,{}),label:Ho.q}),D.jsx(Bo,{value:Ho.s,control:D.jsx(gm,{}),label:Ho.s}),D.jsx(Bo,{value:Ho.d,control:D.jsx(gm,{}),label:Ho.d})]})]})}const pUe=t=>{switch(t){case"angstrom":return"Å";case"angstrom^-1":return"Å^-1";case null:return"";default:return t}};function mUe({visableQRange:t,fullQrange:e}){const n=yf(),r=yf(d=>d.requestedMax&&d.requestedMin?new $o(d.requestedMin,d.requestedMax):null),i=d=>{n.updateRequestedRange({requestedMax:Qp(d.target.value)})},o=d=>{n.updateRequestedRange({requestedMin:Qp(d.target.value)})},{textBoxUnits:s,diagramVisible:a,diagramFull:l,diagramRequested:u}=fUe(t,e,r,n),c=pUe(s);return D.jsx(xu,{variant:"outlined",sx:{flexGrow:1},children:D.jsx(GI,{children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" Results"}),D.jsx(ca,{}),D.jsxs(cn,{direction:{md:"column",lg:"row"},spacing:2,sx:{direction:"column"},children:[D.jsx(dUe,{qRange:t}),D.jsxs(cn,{direction:"column",spacing:1,children:[D.jsx(hUe,{resultStore:n}),D.jsx($n,{type:"number",label:`Requested min ${n.requested} value`,size:"small",value:n.requestedMin,onChange:o,InputProps:{endAdornment:D.jsx(si,{position:"end",children:c})}}),D.jsx($n,{type:"number",label:`Requested max ${n.requested} value`,size:"small",value:n.requestedMax,onChange:i,InputProps:{endAdornment:D.jsx(si,{position:"end",children:c})}})]}),D.jsx(cn,{flexGrow:2,sx:{alignItems:"center"},children:a&&l&&u?D.jsx(cUe,{visibleRange:a,requestedRange:u}):D.jsx(uUe,{message:"No solution"})})]})]})})})}var Su=(t=>(t.milimeter="mm",t.pixel="pixel",t.reciprocal="nm^-1",t))(Su||{});const VY=eh(t=>({detector:!0,detectorColor:{r:144,g:19,b:254,a:.4},beamstop:!0,beamstopColor:{r:0,g:0,b:0,a:1},cameraTube:!0,cameraTubeColor:{r:80,g:227,b:194,a:.4},visibleRange:!0,visibleColor:{r:245,g:166,b:35,a:1},requestedRange:!0,requestedRangeColor:{r:65,g:117,b:5,a:1},clearance:!0,clearanceColor:{r:0,g:0,b:0,a:.2},inaccessibleRange:!0,inaccessibleRangeColor:{r:208,g:2,b:27,a:1},plotAxes:"mm",update:e=>{t({...e})}})),Pc=class Pc{constructor(e,n){bi(this,"plotAxes");bi(this,"xunit");bi(this,"yunit");bi(this,"scaleFactor");bi(this,"createPlotEllipseClearance",(e,n,r,i)=>{if(this.plotAxes!==Su.reciprocal){const u=this._getCentreVector(e),c=new oe(u.x+_o(n,2).to(this.xunit).toNumber()+Rt(r,"xpixel").to(this.xunit).toNumber(),u.y),d=new oe(u.x,u.y+_o(n,2).to(this.yunit).toNumber()+Rt(r,"ypixel").to(this.yunit).toNumber());return{centre:u,endPointX:c,endPointY:d}}if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");const o=Pc.convert2QSpace(e,this.scaleFactor,i),s=new oe(o.x.to(this.xunit).toNumber(),o.y.to(this.yunit).toNumber()),a=new oe(s.x+wi(_o(n,2),this.scaleFactor).to(this.xunit).toNumber()+wi(Rt(r,"xpixel"),this.scaleFactor).to(this.xunit).toNumber(),s.y),l=new oe(s.x,s.y+this._scale(n,this.yunit)+wi(Rt(r,"ypixel"),this.scaleFactor).to(this.yunit).toNumber());return{centre:s,endPointX:a,endPointY:l}});bi(this,"createPlotRange",(e,n,r)=>{if(this.plotAxes===Su.reciprocal){if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");e=Pc.convert2QSpace(e,this.scaleFactor,r),n=Pc.convert2QSpace(n,this.scaleFactor,r)}const i=new oe(e.x.to(this.xunit).toNumber(),e.y.to(this.yunit).toNumber()),o=new oe(n.x.to(this.xunit).toNumber(),n.y.to(this.yunit).toNumber());return{start:i,end:o}});this.xunit=e,this.yunit=e,this.plotAxes=e,this.scaleFactor=n,e===Su.pixel&&(this.xunit="xpixel",this.yunit="ypixel")}_getCentreVector(e){return new oe(e.x.to(this.xunit).toNumber(),e.y.to(this.yunit).toNumber())}createPlotEllipse(e,n,r){if(this.plotAxes!==Su.reciprocal){const l=this._getCentreVector(e),u=new oe(l.x+_o(n,2).to(this.xunit).toNumber(),l.y),c=new oe(l.x,l.y+_o(n,2).to(this.yunit).toNumber());return{centre:l,endPointX:u,endPointY:c}}if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");const i=Pc.convert2QSpace(e,this.scaleFactor,r),o=this._getCentreVector(i),s=new oe(o.x+wi(_o(n,2),this.scaleFactor).to(this.xunit).toNumber(),o.y),a=new oe(o.x,o.y+this._scale(n,this.yunit));return{centre:o,endPointX:s,endPointY:a}}_scale(e,n){return wi(_o(e,2),this.scaleFactor).to(n).toNumber()}createPlotRectangle(e,n){if(this.plotAxes!==Su.reciprocal){const o=new oe(0,0),s=new oe(Rt(e.width,"xpixel").to(this.xunit).toNumber(),Rt(e.height,"ypixel").to(this.yunit).toNumber());return{lowerBound:o,upperBound:s}}if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");const{lowerBoundVector:r,upperBoundVector:i}=this._getVectorBounds(n,e);return{lowerBound:r,upperBound:i}}_getVectorBounds(e,n){const r=Pc.convert2QSpace({x:Rt(0,"xpixel"),y:Rt(0,"ypixel")},this.scaleFactor,e),i=new oe(r.x.to(this.xunit).toNumber(),r.y.to(this.yunit).toNumber()),o=new oe(r.x.to(this.xunit).toNumber()+wi(Rt(n.width,"xpixel"),this.scaleFactor).to(this.xunit).toNumber(),r.y.to(this.yunit).toNumber()+wi(Rt(n.height,"ypixel"),this.scaleFactor).to(this.yunit).toNumber());return{lowerBoundVector:i,upperBoundVector:o}}};bi(Pc,"convert2QSpace",(e,n,r)=>({x:wi(n,t8(e.x,r.x)),y:wi(n,t8(e.y,r.y))}));let XR=Pc;var oa={},jb={},gUe=Array.isArray,rl=gUe;function vUe(t){return t!=null&&typeof t=="object"}var Zu=vUe,yUe=ch,bUe=rl,xUe=Zu,wUe="[object String]";function _Ue(t){return typeof t=="string"||!bUe(t)&&xUe(t)&&yUe(t)==wUe}var SUe=_Ue;function CUe(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var EUe=CUe,MUe=EUe,TUe=MUe(),AUe=TUe;function PUe(t,e){for(var n=-1,r=Array(t);++n-1&&t%1==0&&t-1&&t%1==0&&t<=jUe}var oO=WUe,qUe=ch,XUe=oO,KUe=Zu,YUe="[object Arguments]",ZUe="[object Array]",QUe="[object Boolean]",JUe="[object Date]",e9e="[object Error]",t9e="[object Function]",n9e="[object Map]",r9e="[object Number]",i9e="[object Object]",o9e="[object RegExp]",s9e="[object Set]",a9e="[object String]",l9e="[object WeakMap]",u9e="[object ArrayBuffer]",c9e="[object DataView]",d9e="[object Float32Array]",f9e="[object Float64Array]",h9e="[object Int8Array]",p9e="[object Int16Array]",m9e="[object Int32Array]",g9e="[object Uint8Array]",v9e="[object Uint8ClampedArray]",y9e="[object Uint16Array]",b9e="[object Uint32Array]",rr={};rr[d9e]=rr[f9e]=rr[h9e]=rr[p9e]=rr[m9e]=rr[g9e]=rr[v9e]=rr[y9e]=rr[b9e]=!0;rr[YUe]=rr[ZUe]=rr[u9e]=rr[QUe]=rr[c9e]=rr[JUe]=rr[e9e]=rr[t9e]=rr[n9e]=rr[r9e]=rr[i9e]=rr[o9e]=rr[s9e]=rr[a9e]=rr[l9e]=!1;function x9e(t){return KUe(t)&&XUe(t.length)&&!!rr[qUe(t)]}var w9e=x9e;function _9e(t){return function(e){return t(e)}}var sO=_9e,WS={exports:{}};WS.exports;(function(t,e){var n=lY,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a})(WS,WS.exports);var aO=WS.exports,S9e=w9e,C9e=sO,Gz=aO,jz=Gz&&Gz.isTypedArray,E9e=jz?C9e(jz):S9e,qY=E9e,M9e=DUe,T9e=jY,A9e=rl,P9e=iO,D9e=WY,R9e=qY,I9e=Object.prototype,N9e=I9e.hasOwnProperty;function F9e(t,e){var n=A9e(t),r=!n&&T9e(t),i=!n&&!r&&P9e(t),o=!n&&!r&&!i&&R9e(t),s=n||r||i||o,a=s?M9e(t.length,String):[],l=a.length;for(var u in t)(e||N9e.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||D9e(u,l)))&&a.push(u);return a}var XY=F9e,O9e=Object.prototype;function k9e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||O9e;return t===n}var lO=k9e;function L9e(t,e){return function(n){return t(e(n))}}var KY=L9e,B9e=KY,$9e=B9e(Object.keys,Object),z9e=$9e,U9e=lO,H9e=z9e,V9e=Object.prototype,G9e=V9e.hasOwnProperty;function j9e(t){if(!U9e(t))return H9e(t);var e=[];for(var n in Object(t))G9e.call(t,n)&&n!="constructor"&&e.push(n);return e}var W9e=j9e,q9e=cY,X9e=oO;function K9e(t){return t!=null&&X9e(t.length)&&!q9e(t)}var gM=K9e,Y9e=XY,Z9e=W9e,Q9e=gM;function J9e(t){return Q9e(t)?Y9e(t):Z9e(t)}var Wb=J9e,e7e=AUe,t7e=Wb;function n7e(t,e){return t&&e7e(t,e,t7e)}var YY=n7e;function r7e(t){return t}var ZY=r7e,i7e=ZY;function o7e(t){return typeof t=="function"?t:i7e}var s7e=o7e,a7e=YY,l7e=s7e;function u7e(t,e){return t&&a7e(t,l7e(e))}var uO=u7e,c7e=KY,d7e=c7e(Object.getPrototypeOf,Object),cO=d7e,f7e=ch,h7e=cO,p7e=Zu,m7e="[object Object]",g7e=Function.prototype,v7e=Object.prototype,QY=g7e.toString,y7e=v7e.hasOwnProperty,b7e=QY.call(Object);function x7e(t){if(!p7e(t)||f7e(t)!=m7e)return!1;var e=h7e(t);if(e===null)return!0;var n=y7e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&QY.call(n)==b7e}var w7e=x7e;function _7e(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++na))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&aHe?new rHe:void 0;for(o.set(t,e),o.set(e,t);++d0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,Kje.default)(e,function(r){Array.isArray(r)?t(r).map(function(i){return n.push(i)}):(0,qje.default)(r)?(0,jje.default)(r,function(i,o){i===!0&&n.push(o),n.push(o+"-"+i)}):(0,Vje.default)(r)&&n.push(r)}),n};jb.default=Yje;var qb={};function Zje(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,vKe.default)(e.default)||{};return n.map(function(i){var o=e[i];return o&&(0,mKe.default)(o,function(s,a){r[a]||(r[a]={}),r[a]=yKe({},r[a],o[a])}),i}),r};qb.default=bKe;var Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});Xb.autoprefix=void 0;var xKe=uO,_U=_Ke(xKe),wKe=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){PKe(i,r);function i(){var o,s,a,l;AKe(this,i);for(var u=arguments.length,c=Array(u),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){OKe(i,r);function i(){var o,s,a,l;FKe(this,i);for(var u=arguments.length,c=Array(u),d=0;d1&&arguments[1]!==void 0?arguments[1]:!0;r[s]=a};return e===0&&i("first-child"),e===n-1&&i("last-child"),(e===0||e%2===0)&&i("even"),Math.abs(e%2)===1&&i("odd"),i("nth-child",e),r};vO.default=LKe;Object.defineProperty(oa,"__esModule",{value:!0});oa.ReactCSS=oa.loop=oa.handleActive=yO=oa.handleHover=oa.hover=void 0;var BKe=jb,$Ke=Dg(BKe),zKe=qb,UKe=Dg(zKe),HKe=Xb,VKe=Dg(HKe),GKe=Kb,wZ=Dg(GKe),jKe=Yb,WKe=Dg(jKe),qKe=vO,XKe=Dg(qKe);function Dg(t){return t&&t.__esModule?t:{default:t}}oa.hover=wZ.default;var yO=oa.handleHover=wZ.default;oa.handleActive=WKe.default;oa.loop=XKe.default;var KKe=oa.ReactCSS=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;ia?f=1:f=Math.round(d*100/a)/100,n.a!==f)return{h:n.h,s:n.s,l:n.l,a:f,source:"rgb"}}else{var h=void 0;if(c<0?h=0:c>s?h=1:h=Math.round(c*100/s)/100,i!==h)return{h:n.h,s:n.s,l:n.l,a:h,source:"rgb"}}return null},QA={},ZKe=function(e,n,r,i){if(typeof document>"u"&&!i)return null;var o=i?new i:document.createElement("canvas");o.width=r*2,o.height=r*2;var s=o.getContext("2d");return s?(s.fillStyle=e,s.fillRect(0,0,o.width,o.height),s.fillStyle=n,s.fillRect(0,0,r,r),s.translate(r,r),s.fillRect(0,0,r,r),o.toDataURL()):null},QKe=function(e,n,r,i){var o=e+"-"+n+"-"+r+(i?"-server":"");if(QA[o])return QA[o];var s=ZKe(e,n,r,i);return QA[o]=s,s},EU=Object.assign||function(t){for(var e=1;ea(),...l,children:D.jsxs("span",{className:Tw.btnLike,children:[n&&D.jsx(n,{className:Tw.icon}),!r&&D.jsx("span",{className:Tw.label,children:e})]})})}function $z(t){const{value:e,onToggle:n,...r}=t;return D.jsx(Bze,{...r,"aria-pressed":e,onClick:()=>n()})}E.createContext(void 0);const $ze="_boundEditor_ce4a770",zze="_label_1e85446",Uze="_value_c7f465d",jA={boundEditor:$ze,label:zze,value:Uze},Hze="_root_86b0b1e",Vze="_dataRange_03d542e",Gze="_autoscale_8ea032e",jze="_error_841a0df",Wze="_errorMessage_a16acf6",qze="_actionBtn_18350cd btnClean",Xze="_swapBtn_2e22485 _actionBtn_18350cd btnClean",td={root:Hze,dataRange:Vze,autoscale:Gze,error:jze,errorMessage:Wze,actionBtn:qze,swapBtn:Xze},HY=E.forwardRef((t,e)=>{const{bound:n,value:r,isEditing:i,hasError:o,onEditToggle:s,onChange:a}=t,l=`${n}-bound`,u=E.useRef(null),[c,d]=E.useState("");function f(){s(!1),d(zA(r))}return E.useImperativeHandle(e,()=>({cancel:f})),E.useEffect(()=>{d(zA(r))},[r,d]),E.useEffect(()=>{var h,p;i||(h=u.current)==null||h.blur(),i&&n==="min"&&((p=u.current)==null||p.focus())},[i,n]),D.jsxs("form",{className:jA.boundEditor,"data-error":o||void 0,"data-editing":i,onSubmit:h=>{h.preventDefault();const p=Number.parseFloat(c.replace("−","-")),g=Number.isNaN(p)?r:s$e(p);d(zA(g)),a(g),s(!1)},children:[D.jsx("label",{id:`${l}-label`,className:jA.label,htmlFor:l,children:n}),D.jsx("input",{id:l,ref:u,className:jA.value,type:"text",name:"bound",value:c,title:i?void 0:r.toString(),"aria-labelledby":`${l}-label`,onChange:h=>d(h.target.value),onFocus:()=>{i||s(!0)}}),D.jsx("button",{className:td.actionBtn,type:"submit",disabled:!i,"aria-label":`Apply ${n}`,children:D.jsx(h8e,{})}),D.jsx("button",{className:td.actionBtn,type:"button",disabled:!i,"aria-label":`Cancel ${n}`,onClick:()=>f(),children:D.jsx(m8e,{})})]})});HY.displayName="BoundEditor";const zz=HY,Kze={[sm.MinGreater]:{message:"Min greater than max",fallback:"data range"},[sm.InvalidMinWithScale]:{message:"Custom min invalid with this scale",fallback:"data min"},[sm.InvalidMaxWithScale]:{message:"Custom max invalid with this scale",fallback:"data max"},[sm.CustomMaxFallback]:{message:"Custom min invalid with this scale",fallback:"custom max"}};function WA(t){const{error:e,showSwapBtn:n=!1,onSwap:r}=t,{message:i,fallback:o}=Kze[e];return D.jsxs("p",{className:td.error,children:[D.jsxs("span",{className:td.errorMessage,children:[i,D.jsx("br",{}),D.jsx(p8e,{})," falling back to ",D.jsx("strong",{children:o})]}),n&&r&&D.jsx("button",{className:td.swapBtn,type:"button","aria-label":"Swap min and max",onClick:()=>r(),children:D.jsx(L8e,{})})]})}const Yze=E.forwardRef((t,e)=>{const{sliderDomain:n,dataDomain:r,errors:i}=t,{isAutoMin:o,isAutoMax:s,isEditingMin:a,isEditingMax:l}=t,{onAutoMinToggle:u,onAutoMaxToggle:c,onEditMin:d,onEditMax:f,onChangeMin:h,onChangeMax:p,onSwap:g}=t,{minGreater:b,minError:m,maxError:w}=i,x=E.useRef(null),_=E.useRef(null);return E.useImperativeHandle(e,()=>({cancelEditing:()=>{var C,S;(C=x.current)==null||C.cancel(),(S=_.current)==null||S.cancel()}})),D.jsxs("div",{className:td.root,children:[b&&D.jsx(WA,{error:sm.MinGreater,showSwapBtn:!o&&!s,onSwap:g}),D.jsx(zz,{ref:x,bound:"min",value:n[0],isEditing:a,hasError:b||!!m,onEditToggle:d,onChange:h}),m&&D.jsx(WA,{error:m}),D.jsx(zz,{ref:_,bound:"max",value:n[1],isEditing:l,hasError:b||!!w,onEditToggle:f,onChange:p}),w&&D.jsx(WA,{error:w}),D.jsxs("p",{className:td.dataRange,children:["Data range"," ",D.jsxs("span",{children:["["," ",D.jsx("abbr",{title:r[0].toString(),children:Pz(r[0])})," ",","," ",D.jsx("abbr",{title:r[1].toString(),children:Pz(r[1])})," ","]"]})]}),D.jsxs("p",{className:td.autoscale,children:["Autoscale"," ",D.jsx($z,{label:"Min",raised:!0,value:o,onToggle:u}),D.jsx($z,{label:"Max",raised:!0,value:s,onToggle:c})]})]})});Yze.displayName="DomainControls";const Zze="_thumb_be15bc7",Qze="_thumbBtnLike_3744319",Jze="_icon_4b34f14",Aw={thumb:Zze,thumbBtnLike:Qze,icon:Jze},eUe=E.forwardRef((t,e)=>{const{bound:n,isAuto:r,hasError:i,disabled:o,AutoIcon:s,...a}=t;return D.jsx("div",{ref:e,...a,className:Aw.thumb,"aria-label":`Change ${n} limit`,"aria-disabled":o||void 0,tabIndex:o?-1:a.tabIndex,"data-auto":r,"data-error":i||void 0,children:D.jsxs("div",{className:Aw.thumbBtnLike,children:[r&&D.jsx(s,{className:Aw.icon}),!r&&i&&D.jsx(f8e,{className:Aw.icon,strokeWidth:"3"})]})})});eUe.displayName="Thumb";function tUe(t){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:D.jsx("path",{d:"M18 17v-2H6v2zm4-4v-2H2v2zm-8 8v-2h-4v2zm4-12V7H6v2zm-8-4h4V3h-4z",stroke:"none"})})}function nUe(t){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"1em",width:"1em",...t,children:D.jsx("polyline",{points:"2 12 6 12 9 21 15 3 19 3"})})}hn.Linear+"",hn.Log+"",hn.SymLog+"",hn.Sqrt+"",hn.Gamma+"";function rUe(t){const{points:e,children:n}=t,{dataToHtml:r}=Ri(),i=rO(o=>e.map(s=>r(o,s)),[e,r]);return D.jsx(D.Fragment,{children:n(...i)})}function qA(t){const{coords:e,...n}=t,[r,i]=e;return D.jsx("line",{x1:r.x,y1:r.y,x2:i.x,y2:i.y,...n})}eh(t=>({val:void 0,setTooltipValue:(e,n,r)=>t(()=>({val:{x:e,y:n,v:r}}))}));function iUe(t){const{api:e,layer:n,x:r,y:i,magFilter:o,onPointerMove:s,...a}=t,l=e.get(n,new Xe(r,i)),[u,c]=l.shape,d=e2e(f=>{s==null||s(f,l)},[s],50);return D.jsx("group",{position:[r+c/2,i+u/2,0],children:D.jsx(xze,{values:l,...a,magFilter:o,size:{width:c,height:u},onPointerMove:s&&d})})}E.memo(iUe);new xa(new oe(-1,-1,-1),new oe(1,1,1));class oUe{constructor(e,n,r){bi(this,"detProps");bi(this,"kmod");bi(this,"qScale");bi(this,"mki");this.detProps=e,e.beamVector.normalize(),this.qScale=r,this.mki=e.beamVector.clone().negate(),this.kmod=this.qScale/n;const i=this.detProps.beamVector.clone();i.multiplyScalar(this.kmod),this.mki=i.negate()}qFromPixelPosition(e){const n=new oe;return n.set(-e.x,-e.y,0),n.add(this.detProps.origin),this._convertToQ(n)}setDiffractionCrystalEnviroment(e){this.kmod=this.qScale/e;const n=this.detProps.beamVector.clone();n.multiplyScalar(this.kmod),this.mki=n.negate()}_convertToQ(e){const n=e.length();return n>0?(e.multiplyScalar(this.kmod/n),e.add(this.mki)):e.add(this.mki),e}}class $o{constructor(e,n){bi(this,"min");bi(this,"max");if(this.min=e,this.max=n,e>n){const r=n;this.max=e,this.min=r}}containsValue(e){return e>=this.min&&e<=this.max}containsRange(e){return e.min>=this.min&&e.max<=this.max}intersect(e){return e===null||e.min>this.max||this.min>e.max?null:new $o(Math.max(e.min,this.min),Math.min(e.max,this.max))}apply(e){return new $o(e(this.min),e(this.max))}applyInPlace(e){if(this.min=e(this.min),this.max=e(this.max),this.min>this.max){const n=this.max;this.max=this.min,this.min=n}return this}toString(){return`(min:${this.min}, max:${this.max})`}equals(e){return this.min===e.min&&this.max===e.max}}class Tm{constructor(e,n){bi(this,"direction");bi(this,"initial_point");if(e.length()==0)throw TypeError("The direction vector of a ray cannot be the zero vector.");this.direction=e,this.initial_point=n}getPoint(e){const n=new Xe(this.direction.x,this.direction.y);return n.multiplyScalar(e),n.add(this.initial_point),n}getPointAtDistance(e){return this.getPoint(e/this.direction.length())}static getParameterRange(e,n){let r=Math.min(e,n);const i=Math.max(e,n);return r<0&&(r=0),new $o(r,i)}getCircleIntersectionParameterRange(e,n){const r=this.initial_point.clone().add(n.multiplyScalar(-1)),i=this.direction.dot(this.direction),o=2*r.dot(this.direction),s=r.dot(r)-Math.pow(e,2),a=Math.pow(o,2)-4*i*s;if(a<0)return null;let l,u;if(i==0){if(o==0)return s==0?new $o(0,Number.POSITIVE_INFINITY):null;l=-s/o,u=-s/o}else l=.5*(-o-Math.sqrt(a))/i,u=.5*(-o+Math.sqrt(a))/i;return Tm.getParameterRange(l,u)}getRectangleIntersectionParameterRange(e,n,r){let i;const o=e.x+n,s=e.x,a=e.y,l=e.y-r;if(this.direction.x===0){if(!new $o(s,o).containsValue(this.initial_point.x))return null;i=new $o(0,Number.POSITIVE_INFINITY)}else i=new $o((s-this.initial_point.x)/this.direction.x,(o-this.initial_point.x)/this.direction.x);return this.direction.y==0?new $o(l,a).containsValue(this.initial_point.y)?Tm.getParameterRange(i.min,i.max):null:(i=i.intersect(new $o((l-this.initial_point.y)/this.direction.y,(a-this.initial_point.y)/this.direction.y)),i==null?null:Tm.getParameterRange(i.min,i.max))}}const Pw={ptMin:new Xe(0,0),ptMax:new Xe(0,0),visibleQRange:null,fullQRange:null};function sUe(t,e,n,r){const{clearanceWidth:i,beamcentreX:o,clearanceHeight:s,beamcentreY:a,detectorHeight:l,detectorWidth:u,cameraTubeCentreX:c,cemeraTubeCentreY:d,cameraLength:f}=aUe(r,e,t,n),h=cS(wi(i,JB(r.angle)),o);if(typeof h=="number"||!("units"in h))return Pw;const p=cS(wi(s,e8(r.angle)),a);if(typeof p=="number"||!("units"in p))return Pw;const g=new Xe(h.toSI().toNumber(),p.toSI().toNumber()),b=new Xe(JB(r.angle),e8(r.angle)),m=new Tm(b,g);let w=m.getRectangleIntersectionParameterRange(new Xe(0,l.toSI().toNumber()),u.toSI().toNumber(),l.toSI().toNumber());if(w===null)return Pw;if(n!==null&&n.diameter.toSI().toNumber()!=0){const G=_o(n.diameter,2).toSI().toNumber(),B=new Xe(c.toSI().toNumber(),d.toSI().toNumber());w=w.intersect(m.getCircleIntersectionParameterRange(G,B))}if(w===null)return Pw;const _=m.getPoint(w.min),C=m.getPoint(w.max),S=new oe(o.toSI().toNumber(),a.toSI().toNumber(),f.toSI().toNumber()),M=new oe(0,0,1),P={...t,origin:S,beamVector:M},A=new oUe(P,r.wavelength.toSI().toNumber(),2*Math.PI),R=A.qFromPixelPosition(_),F=A.qFromPixelPosition(C);P.origin.z=r.beamline.minCameraLength.toSI().toNumber(),A.setDiffractionCrystalEnviroment(r.beamline.minWavelength.toSI().toNumber());const $=A.qFromPixelPosition(C);P.origin.z=r.beamline.maxCameraLength.toSI().toNumber(),A.setDiffractionCrystalEnviroment(r.beamline.maxWavelength.toSI().toNumber());const j=A.qFromPixelPosition(_),k=new $o(R.length(),F.length()),U=new $o($.length(),j.length());return{ptMin:_,ptMax:C,visibleQRange:k,fullQRange:U}}function aUe(t,e,n,r){const i=Rt(t.cameraLength??NaN,"m"),o=cS(Rt(e.clearance??NaN,"xpixel"),_o(e.diameter,2)),s=cS(Rt(e.clearance??NaN,"ypixel"),_o(e.diameter,2)),a=Rt(e.centre.x??NaN,"xpixel"),l=Rt(e.centre.y??NaN,"ypixel"),u=Rt(n.resolution.height,"ypixel"),c=Rt(n.resolution.width,"xpixel"),d=Rt(r.centre.x??NaN,"xpixel"),f=Rt(r.centre.y??NaN,"ypixel");return{clearanceWidth:o,beamcentreX:a,clearanceHeight:s,beamcentreY:l,detectorHeight:u,detectorWidth:c,cameraTubeCentreX:d,cemeraTubeCentreY:f,cameraLength:i}}const lUe=(t,e,n)=>{if(t<0||e<0||n<0)return null;const r=n*t/(4*Math.PI);return Math.abs(r)>=Math.sqrt(2)/2?null:Math.tan(2*Math.asin(r))*e},Uz=(t,e,n,r,i)=>{const[o,s,a,l,u,c]=[t,n,r,e,i.x,i.y].map(b=>b.toSI().toNumber()),d=new Tm(new Xe(Math.cos(l),Math.sin(l)),new Xe(u,c)),f=lUe(o,s,a)??0,h=d.getPointAtDistance(f),p=Rt(h.x,"m"),g=Rt(h.y,"m");return{x:p,y:g}};class Ua{constructor(e,n){bi(this,"min");bi(this,"max");if(this.min=e,this.max=n,!e.equalBase(n))throw new TypeError("min and max units must be same base length, mass, etc");if(j0(e,n)){const r=n;this.max=e,this.min=r}}to(e){return new Ua(this.min.to(e),this.max.to(e))}containsValue(e){const n=CT(e,this.min)&&CT(e,this.max);if(typeof n!="boolean")throw TypeError("Can only check one value at a time");return n}containsRange(e){const n=$ye(this.min,e.min)&&CT(this.max,e.max);if(typeof n!="boolean")throw TypeError("Can only check one value at a time");return n}intersect(e){return j0(e.min,this.max)||j0(this.min,e.max)?null:new Ua(Bye(e.min,this.min),Fye(e.max,this.max))}apply(e){return new Ua(e(this.min),e(this.max))}applyInPlace(e){if(this.min=e(this.min),this.max=e(this.max),j0(this.min,this.max)){const n=this.max;this.max=this.min,this.min=n}return this}static fromNumericRange(e,n){return new Ua(Rt((e==null?void 0:e.min)??NaN,n),Rt((e==null?void 0:e.max)??NaN,n))}toString(){return`(min:${this.min.toString()}, max:${this.max.toString()})`}equals(e){const n=SD(this.min,e.min)&&SD(this.max,e.max);if(typeof n!="boolean")throw TypeError("write this later");return n}}function uUe(t){return D.jsx("svg",{style:{display:"grid",maxHeight:"200px",width:"90%",border:"solid black"},children:D.jsx("text",{x:"40%",y:"50%",children:t.message})})}const Hz=t=>t<50?"start":"end";function cUe({visibleRange:t,requestedRange:e}){const n=t.max.toNumber()-t.min.toNumber(),r=e.max.toNumber()/n*100,i=e.min.toNumber()/n*100,o=t.containsRange(e)?"green":"red";return D.jsxs("svg",{style:{display:"grid",maxHeight:"200px",width:"90%",border:"solid black"},children:[D.jsx("rect",{y:"0",x:"0",width:"100%",height:"50%",fill:o}),D.jsx("line",{x1:`${i}%`,y1:0,x2:`${i}%`,y2:"50%",style:{stroke:"black",strokeWidth:2}}),D.jsx("line",{x1:`${r}%`,y1:0,x2:`${r}%`,y2:"60%",style:{stroke:"black",strokeWidth:2}}),D.jsxs("text",{y:"60%",x:`${i}%`,textAnchor:Hz(i),children:[" ","Requested min"]}),D.jsx("text",{y:"80%",x:`${r}%`,textAnchor:Hz(r),children:"Requested max"})]})}var Ho=(t=>(t.q="q",t.s="s",t.d="d",t))(Ho||{});const yf=eh(t=>({requested:"q",qUnits:dS.nanometres,sUnits:ia.nanometres,dUnits:ia.nanometres,requestedMin:null,requestedMax:null,updateRequested:e=>{t({requested:e})},updateRequestedRange:e=>{t({...e})},updateQUnits:e=>t({qUnits:e}),updateSUnits:e=>t({sUnits:e}),updateDUnits:e=>t({dUnits:e})})),VS=t=>{const e=_o(1,t);if(typeof e=="number"||!("units"in e))throw TypeError("name this error later ");return e},GS=t=>{const e=_o(2*Math.PI,t);if(typeof e=="number"||!("units"in e))throw TypeError("name this error later ");return e};function dUe(t){const e=yf(),n=yf(d=>d.updateQUnits),r=yf(d=>d.updateSUnits),i=yf(d=>d.updateDUnits),o=d=>{n(d.target.value)},s=d=>{r(d.target.value)},a=d=>{i(d.target.value)},l=t.qRange.to(e.qUnits),u=t.qRange.apply(VS).to(e.sUnits),c=t.qRange.apply(GS).to(e.dUnits);return D.jsx(xu,{variant:"outlined",children:D.jsx($he,{children:D.jsxs(Phe,{sx:{minWidth:50},"aria-label":"simple table",size:"small",children:[D.jsx(jhe,{children:D.jsxs(wx,{children:[D.jsx(ri,{align:"center",children:"Values"}),D.jsx(ri,{align:"center",children:"Min"}),D.jsx(ri,{align:"center",children:"Max"}),D.jsx(ri,{align:"center",children:"Units"})]})}),D.jsxs(wx,{children:[D.jsx(ri,{component:"th",scope:"row",align:"center",children:Ho.q}),D.jsx(ri,{align:"center",children:isNaN(l.min.toNumber())?"":l.min.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:isNaN(l.max.toNumber())?"":l.max.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:D.jsxs(Ai,{children:[D.jsx(ca,{children:"q"}),D.jsxs(Ps,{size:"small",label:"units",value:e.qUnits,onChange:o,children:[D.jsx(wn,{value:dS.nanometres,children:"1 / nm"}),D.jsx(wn,{value:dS.angstroms,children:"1 / Å"})]})]})})]},"q"),D.jsxs(wx,{children:[D.jsx(ri,{component:"th",scope:"row",align:"center",children:Ho.s}),D.jsx(ri,{align:"center",children:isNaN(u.min.toNumber())?"":u.min.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:isNaN(u.max.toNumber())?"":u.max.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:D.jsxs(Ai,{children:[D.jsx(ca,{children:"s"}),D.jsxs(Ps,{size:"small",label:"units",value:e.sUnits,onChange:s,children:[D.jsx(wn,{value:ia.nanometres,children:ia.nanometres}),D.jsx(wn,{value:ia.angstroms,children:"Å"})]})]})})]},"s"),D.jsxs(wx,{children:[D.jsx(ri,{component:"th",scope:"row",align:"center",children:Ho.d}),D.jsx(ri,{align:"center",children:isNaN(c.min.toNumber())?"":c.min.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:isNaN(c.max.toNumber())?"":c.max.toNumber().toFixed(4)}),D.jsx(ri,{align:"center",children:D.jsxs(Ai,{children:[D.jsx(ca,{children:"d"}),D.jsxs(Ps,{size:"small",label:"units",value:e.dUnits,onChange:a,children:[D.jsx(wn,{value:ia.nanometres,children:ia.nanometres}),D.jsx(wn,{value:ia.angstroms,children:"Å"})]})]})})]},"d")]})})})}function fUe(t,e,n,r){let i=null,o=null,s=null,a=null;if(!(t&&e&&n))return{textBoxUnits:a,diagramVisible:i,diagramFull:o,diagramRequested:s};switch(r.requested){case Ho.d:i=t.apply(GS).to("nm"),o=e.apply(GS).to("nm"),s=Ua.fromNumericRange(n,r.dUnits).to("nm"),a=r.dUnits;break;case Ho.s:i=t.apply(VS).to("nm"),o=e.apply(VS).to("nm"),s=Ua.fromNumericRange(n,r.sUnits).to("nm"),a=r.sUnits;break;default:i=t.to("nm^-1"),o=e.to("nm^-1"),s=Ua.fromNumericRange(n,r.qUnits).to("nm^-1"),a=r.qUnits}return{textBoxUnits:a,diagramVisible:i,diagramFull:o,diagramRequested:s}}function hUe({resultStore:t}){return D.jsxs(Ai,{children:[D.jsx(qI,{children:"Requested Quantiy"}),D.jsxs(gG,{row:!0,value:t.requested,onChange:e=>t.updateRequested(e.target.value),children:[D.jsx(Bo,{value:Ho.q,control:D.jsx(gm,{}),label:Ho.q}),D.jsx(Bo,{value:Ho.s,control:D.jsx(gm,{}),label:Ho.s}),D.jsx(Bo,{value:Ho.d,control:D.jsx(gm,{}),label:Ho.d})]})]})}const pUe=t=>{switch(t){case"angstrom":return"Å";case"angstrom^-1":return"Å^-1";case null:return"";default:return t}};function mUe({visableQRange:t,fullQrange:e}){const n=yf(),r=yf(d=>d.requestedMax&&d.requestedMin?new $o(d.requestedMin,d.requestedMax):null),i=d=>{n.updateRequestedRange({requestedMax:Qp(d.target.value)})},o=d=>{n.updateRequestedRange({requestedMin:Qp(d.target.value)})},{textBoxUnits:s,diagramVisible:a,diagramFull:l,diagramRequested:u}=fUe(t,e,r,n),c=pUe(s);return D.jsx(xu,{variant:"outlined",sx:{flexGrow:1},children:D.jsx(GI,{children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" Results"}),D.jsx($l,{}),D.jsxs(cn,{direction:{md:"column",lg:"row"},spacing:2,sx:{direction:"column"},children:[D.jsx(dUe,{qRange:t}),D.jsxs(cn,{direction:"column",spacing:1,children:[D.jsx(hUe,{resultStore:n}),D.jsx($n,{type:"number",label:`Requested min ${n.requested} value`,size:"small",value:n.requestedMin,onChange:o,InputProps:{endAdornment:D.jsx(si,{position:"end",children:c})}}),D.jsx($n,{type:"number",label:`Requested max ${n.requested} value`,size:"small",value:n.requestedMax,onChange:i,InputProps:{endAdornment:D.jsx(si,{position:"end",children:c})}})]}),D.jsx(cn,{flexGrow:2,sx:{alignItems:"center"},children:a&&l&&u?D.jsx(cUe,{visibleRange:a,requestedRange:u}):D.jsx(uUe,{message:"No solution"})})]})]})})})}var Su=(t=>(t.milimeter="mm",t.pixel="pixel",t.reciprocal="nm^-1",t))(Su||{});const VY=eh(t=>({detector:!0,detectorColor:{r:144,g:19,b:254,a:.4},beamstop:!0,beamstopColor:{r:0,g:0,b:0,a:1},cameraTube:!0,cameraTubeColor:{r:80,g:227,b:194,a:.4},visibleRange:!0,visibleColor:{r:245,g:166,b:35,a:1},requestedRange:!0,requestedRangeColor:{r:65,g:117,b:5,a:1},clearance:!0,clearanceColor:{r:0,g:0,b:0,a:.2},inaccessibleRange:!0,inaccessibleRangeColor:{r:208,g:2,b:27,a:1},plotAxes:"mm",update:e=>{t({...e})}})),Pc=class Pc{constructor(e,n){bi(this,"plotAxes");bi(this,"xunit");bi(this,"yunit");bi(this,"scaleFactor");bi(this,"createPlotEllipseClearance",(e,n,r,i)=>{if(this.plotAxes!==Su.reciprocal){const u=this._getCentreVector(e),c=new oe(u.x+_o(n,2).to(this.xunit).toNumber()+Rt(r,"xpixel").to(this.xunit).toNumber(),u.y),d=new oe(u.x,u.y+_o(n,2).to(this.yunit).toNumber()+Rt(r,"ypixel").to(this.yunit).toNumber());return{centre:u,endPointX:c,endPointY:d}}if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");const o=Pc.convert2QSpace(e,this.scaleFactor,i),s=new oe(o.x.to(this.xunit).toNumber(),o.y.to(this.yunit).toNumber()),a=new oe(s.x+wi(_o(n,2),this.scaleFactor).to(this.xunit).toNumber()+wi(Rt(r,"xpixel"),this.scaleFactor).to(this.xunit).toNumber(),s.y),l=new oe(s.x,s.y+this._scale(n,this.yunit)+wi(Rt(r,"ypixel"),this.scaleFactor).to(this.yunit).toNumber());return{centre:s,endPointX:a,endPointY:l}});bi(this,"createPlotRange",(e,n,r)=>{if(this.plotAxes===Su.reciprocal){if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");e=Pc.convert2QSpace(e,this.scaleFactor,r),n=Pc.convert2QSpace(n,this.scaleFactor,r)}const i=new oe(e.x.to(this.xunit).toNumber(),e.y.to(this.yunit).toNumber()),o=new oe(n.x.to(this.xunit).toNumber(),n.y.to(this.yunit).toNumber());return{start:i,end:o}});this.xunit=e,this.yunit=e,this.plotAxes=e,this.scaleFactor=n,e===Su.pixel&&(this.xunit="xpixel",this.yunit="ypixel")}_getCentreVector(e){return new oe(e.x.to(this.xunit).toNumber(),e.y.to(this.yunit).toNumber())}createPlotEllipse(e,n,r){if(this.plotAxes!==Su.reciprocal){const l=this._getCentreVector(e),u=new oe(l.x+_o(n,2).to(this.xunit).toNumber(),l.y),c=new oe(l.x,l.y+_o(n,2).to(this.yunit).toNumber());return{centre:l,endPointX:u,endPointY:c}}if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");const i=Pc.convert2QSpace(e,this.scaleFactor,r),o=this._getCentreVector(i),s=new oe(o.x+wi(_o(n,2),this.scaleFactor).to(this.xunit).toNumber(),o.y),a=new oe(o.x,o.y+this._scale(n,this.yunit));return{centre:o,endPointX:s,endPointY:a}}_scale(e,n){return wi(_o(e,2),this.scaleFactor).to(n).toNumber()}createPlotRectangle(e,n){if(this.plotAxes!==Su.reciprocal){const o=new oe(0,0),s=new oe(Rt(e.width,"xpixel").to(this.xunit).toNumber(),Rt(e.height,"ypixel").to(this.yunit).toNumber());return{lowerBound:o,upperBound:s}}if(!this.scaleFactor)throw TypeError("reciprocal units need a scaleFactor");const{lowerBoundVector:r,upperBoundVector:i}=this._getVectorBounds(n,e);return{lowerBound:r,upperBound:i}}_getVectorBounds(e,n){const r=Pc.convert2QSpace({x:Rt(0,"xpixel"),y:Rt(0,"ypixel")},this.scaleFactor,e),i=new oe(r.x.to(this.xunit).toNumber(),r.y.to(this.yunit).toNumber()),o=new oe(r.x.to(this.xunit).toNumber()+wi(Rt(n.width,"xpixel"),this.scaleFactor).to(this.xunit).toNumber(),r.y.to(this.yunit).toNumber()+wi(Rt(n.height,"ypixel"),this.scaleFactor).to(this.yunit).toNumber());return{lowerBoundVector:i,upperBoundVector:o}}};bi(Pc,"convert2QSpace",(e,n,r)=>({x:wi(n,t8(e.x,r.x)),y:wi(n,t8(e.y,r.y))}));let XR=Pc;var oa={},jb={},gUe=Array.isArray,nl=gUe;function vUe(t){return t!=null&&typeof t=="object"}var Zu=vUe,yUe=ch,bUe=nl,xUe=Zu,wUe="[object String]";function _Ue(t){return typeof t=="string"||!bUe(t)&&xUe(t)&&yUe(t)==wUe}var SUe=_Ue;function CUe(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var EUe=CUe,MUe=EUe,TUe=MUe(),AUe=TUe;function PUe(t,e){for(var n=-1,r=Array(t);++n-1&&t%1==0&&t-1&&t%1==0&&t<=jUe}var oO=WUe,qUe=ch,XUe=oO,KUe=Zu,YUe="[object Arguments]",ZUe="[object Array]",QUe="[object Boolean]",JUe="[object Date]",e9e="[object Error]",t9e="[object Function]",n9e="[object Map]",r9e="[object Number]",i9e="[object Object]",o9e="[object RegExp]",s9e="[object Set]",a9e="[object String]",l9e="[object WeakMap]",u9e="[object ArrayBuffer]",c9e="[object DataView]",d9e="[object Float32Array]",f9e="[object Float64Array]",h9e="[object Int8Array]",p9e="[object Int16Array]",m9e="[object Int32Array]",g9e="[object Uint8Array]",v9e="[object Uint8ClampedArray]",y9e="[object Uint16Array]",b9e="[object Uint32Array]",rr={};rr[d9e]=rr[f9e]=rr[h9e]=rr[p9e]=rr[m9e]=rr[g9e]=rr[v9e]=rr[y9e]=rr[b9e]=!0;rr[YUe]=rr[ZUe]=rr[u9e]=rr[QUe]=rr[c9e]=rr[JUe]=rr[e9e]=rr[t9e]=rr[n9e]=rr[r9e]=rr[i9e]=rr[o9e]=rr[s9e]=rr[a9e]=rr[l9e]=!1;function x9e(t){return KUe(t)&&XUe(t.length)&&!!rr[qUe(t)]}var w9e=x9e;function _9e(t){return function(e){return t(e)}}var sO=_9e,WS={exports:{}};WS.exports;(function(t,e){var n=lY,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a})(WS,WS.exports);var aO=WS.exports,S9e=w9e,C9e=sO,Gz=aO,jz=Gz&&Gz.isTypedArray,E9e=jz?C9e(jz):S9e,qY=E9e,M9e=DUe,T9e=jY,A9e=nl,P9e=iO,D9e=WY,R9e=qY,I9e=Object.prototype,N9e=I9e.hasOwnProperty;function F9e(t,e){var n=A9e(t),r=!n&&T9e(t),i=!n&&!r&&P9e(t),o=!n&&!r&&!i&&R9e(t),s=n||r||i||o,a=s?M9e(t.length,String):[],l=a.length;for(var u in t)(e||N9e.call(t,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||D9e(u,l)))&&a.push(u);return a}var XY=F9e,O9e=Object.prototype;function k9e(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||O9e;return t===n}var lO=k9e;function L9e(t,e){return function(n){return t(e(n))}}var KY=L9e,B9e=KY,$9e=B9e(Object.keys,Object),z9e=$9e,U9e=lO,H9e=z9e,V9e=Object.prototype,G9e=V9e.hasOwnProperty;function j9e(t){if(!U9e(t))return H9e(t);var e=[];for(var n in Object(t))G9e.call(t,n)&&n!="constructor"&&e.push(n);return e}var W9e=j9e,q9e=cY,X9e=oO;function K9e(t){return t!=null&&X9e(t.length)&&!q9e(t)}var gM=K9e,Y9e=XY,Z9e=W9e,Q9e=gM;function J9e(t){return Q9e(t)?Y9e(t):Z9e(t)}var Wb=J9e,e7e=AUe,t7e=Wb;function n7e(t,e){return t&&e7e(t,e,t7e)}var YY=n7e;function r7e(t){return t}var ZY=r7e,i7e=ZY;function o7e(t){return typeof t=="function"?t:i7e}var s7e=o7e,a7e=YY,l7e=s7e;function u7e(t,e){return t&&a7e(t,l7e(e))}var uO=u7e,c7e=KY,d7e=c7e(Object.getPrototypeOf,Object),cO=d7e,f7e=ch,h7e=cO,p7e=Zu,m7e="[object Object]",g7e=Function.prototype,v7e=Object.prototype,QY=g7e.toString,y7e=v7e.hasOwnProperty,b7e=QY.call(Object);function x7e(t){if(!p7e(t)||f7e(t)!=m7e)return!1;var e=h7e(t);if(e===null)return!0;var n=y7e.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&QY.call(n)==b7e}var w7e=x7e;function _7e(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++na))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&aHe?new rHe:void 0;for(o.set(t,e),o.set(e,t);++d0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,Kje.default)(e,function(r){Array.isArray(r)?t(r).map(function(i){return n.push(i)}):(0,qje.default)(r)?(0,jje.default)(r,function(i,o){i===!0&&n.push(o),n.push(o+"-"+i)}):(0,Vje.default)(r)&&n.push(r)}),n};jb.default=Yje;var qb={};function Zje(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,vKe.default)(e.default)||{};return n.map(function(i){var o=e[i];return o&&(0,mKe.default)(o,function(s,a){r[a]||(r[a]={}),r[a]=yKe({},r[a],o[a])}),i}),r};qb.default=bKe;var Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});Xb.autoprefix=void 0;var xKe=uO,_U=_Ke(xKe),wKe=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){PKe(i,r);function i(){var o,s,a,l;AKe(this,i);for(var u=arguments.length,c=Array(u),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){OKe(i,r);function i(){var o,s,a,l;FKe(this,i);for(var u=arguments.length,c=Array(u),d=0;d1&&arguments[1]!==void 0?arguments[1]:!0;r[s]=a};return e===0&&i("first-child"),e===n-1&&i("last-child"),(e===0||e%2===0)&&i("even"),Math.abs(e%2)===1&&i("odd"),i("nth-child",e),r};vO.default=LKe;Object.defineProperty(oa,"__esModule",{value:!0});oa.ReactCSS=oa.loop=oa.handleActive=yO=oa.handleHover=oa.hover=void 0;var BKe=jb,$Ke=Dg(BKe),zKe=qb,UKe=Dg(zKe),HKe=Xb,VKe=Dg(HKe),GKe=Kb,wZ=Dg(GKe),jKe=Yb,WKe=Dg(jKe),qKe=vO,XKe=Dg(qKe);function Dg(t){return t&&t.__esModule?t:{default:t}}oa.hover=wZ.default;var yO=oa.handleHover=wZ.default;oa.handleActive=WKe.default;oa.loop=XKe.default;var KKe=oa.ReactCSS=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;ia?f=1:f=Math.round(d*100/a)/100,n.a!==f)return{h:n.h,s:n.s,l:n.l,a:f,source:"rgb"}}else{var h=void 0;if(c<0?h=0:c>s?h=1:h=Math.round(c*100/s)/100,i!==h)return{h:n.h,s:n.s,l:n.l,a:h,source:"rgb"}}return null},QA={},ZKe=function(e,n,r,i){if(typeof document>"u"&&!i)return null;var o=i?new i:document.createElement("canvas");o.width=r*2,o.height=r*2;var s=o.getContext("2d");return s?(s.fillStyle=e,s.fillRect(0,0,o.width,o.height),s.fillStyle=n,s.fillRect(0,0,r,r),s.translate(r,r),s.fillRect(0,0,r,r),o.toDataURL()):null},QKe=function(e,n,r,i){var o=e+"-"+n+"-"+r+(i?"-server":"");if(QA[o])return QA[o];var s=ZKe(e,n,r,i);return QA[o]=s,s},EU=Object.assign||function(t){for(var e=1;e-1},fYe=function(e){return Number(String(e).replace(/%/g,""))},hYe=1,gn=function(t){aYe(e,t);function e(n){oYe(this,e);var r=sYe(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(i){r.setUpdatedValue(i.target.value,i)},r.handleKeyDown=function(i){var o=fYe(i.target.value);if(!isNaN(o)&&dYe(i.keyCode)){var s=r.getArrowOffset(),a=i.keyCode===_Z?o+s:o-s;r.setUpdatedValue(a,i)}},r.handleDrag=function(i){if(r.props.dragLabel){var o=Math.round(r.props.value+i.movementX);o>=0&&o<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(o),i)}},r.handleMouseDown=function(i){r.props.dragLabel&&(i.preventDefault(),r.handleDrag(i),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+hYe++,r}return rYe(e,[{key:"componentDidUpdate",value:function(r,i){this.props.value!==this.state.value&&(r.value!==this.props.value||i.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return iYe({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||lYe}},{key:"setUpdatedValue",value:function(r,i){var o=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(o,i),this.setState({value:r})}},{key:"render",value:function(){var r=this,i=jt({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return ie.createElement("div",{style:i.wrap},ie.createElement("input",{id:this.inputId,style:i.input,ref:function(s){return r.input=s},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?ie.createElement("label",{htmlFor:this.inputId,style:i.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(E.PureComponent||E.Component),pYe=function(e,n,r,i){var o=i.clientWidth,s=i.clientHeight,a=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=a-(i.getBoundingClientRect().left+window.pageXOffset),c=l-(i.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(c<0)d=359;else if(c>s)d=0;else{var f=-(c*100/s)+100;d=360*f/100}if(r.h!==d)return{h:d,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var h=void 0;if(u<0)h=0;else if(u>o)h=359;else{var p=u*100/o;h=360*p/100}if(r.h!==h)return{h,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},mYe=function(){function t(e,n){for(var r=0;r-1}function CYe(t,e){var n=this.__data__,r=wM(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Qu(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=RZe}function Ng(t){return t!=null&&SO(t.length)&&!xO(t)}function IZe(t){return pd(t)&&Ng(t)}function NZe(){return!1}var DZ=typeof Es=="object"&&Es&&!Es.nodeType&&Es,FU=DZ&&typeof Ms=="object"&&Ms&&!Ms.nodeType&&Ms,FZe=FU&&FU.exports===DZ,OU=FZe?il.Buffer:void 0,OZe=OU?OU.isBuffer:void 0,QS=OZe||NZe,kZe="[object Object]",LZe=Function.prototype,BZe=Object.prototype,RZ=LZe.toString,$Ze=BZe.hasOwnProperty,zZe=RZ.call(Object);function UZe(t){if(!pd(t)||fh(t)!=kZe)return!1;var e=AZ(t);if(e===null)return!0;var n=$Ze.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&RZ.call(n)==zZe}var HZe="[object Arguments]",VZe="[object Array]",GZe="[object Boolean]",jZe="[object Date]",WZe="[object Error]",qZe="[object Function]",XZe="[object Map]",KZe="[object Number]",YZe="[object Object]",ZZe="[object RegExp]",QZe="[object Set]",JZe="[object String]",eQe="[object WeakMap]",tQe="[object ArrayBuffer]",nQe="[object DataView]",rQe="[object Float32Array]",iQe="[object Float64Array]",oQe="[object Int8Array]",sQe="[object Int16Array]",aQe="[object Int32Array]",lQe="[object Uint8Array]",uQe="[object Uint8ClampedArray]",cQe="[object Uint16Array]",dQe="[object Uint32Array]",ir={};ir[rQe]=ir[iQe]=ir[oQe]=ir[sQe]=ir[aQe]=ir[lQe]=ir[uQe]=ir[cQe]=ir[dQe]=!0;ir[HZe]=ir[VZe]=ir[tQe]=ir[GZe]=ir[nQe]=ir[jZe]=ir[WZe]=ir[qZe]=ir[XZe]=ir[KZe]=ir[YZe]=ir[ZZe]=ir[QZe]=ir[JZe]=ir[eQe]=!1;function fQe(t){return pd(t)&&SO(t.length)&&!!ir[fh(t)]}function hQe(t){return function(e){return t(e)}}var IZ=typeof Es=="object"&&Es&&!Es.nodeType&&Es,Ov=IZ&&typeof Ms=="object"&&Ms&&!Ms.nodeType&&Ms,pQe=Ov&&Ov.exports===IZ,eP=pQe&&SZ.process,kU=function(){try{var t=Ov&&Ov.require&&Ov.require("util").types;return t||eP&&eP.binding&&eP.binding("util")}catch{}}(),LU=kU&&kU.isTypedArray,CO=LU?hQe(LU):fQe;function t3(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var mQe=Object.prototype,gQe=mQe.hasOwnProperty;function vQe(t,e,n){var r=t[e];(!(gQe.call(t,e)&&Zb(r,n))||n===void 0&&!(e in t))&&wO(t,e,n)}function yQe(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o-1&&t%1==0&&t0){if(++e>=FQe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var BQe=LQe(NQe);function $Qe(t,e){return BQe(RQe(t,e,SM),t+"")}function zQe(t,e,n){if(!va(n))return!1;var r=typeof e;return(r=="number"?Ng(n)&&EO(e,n.length):r=="string"&&e in n)?Zb(n[e],t):!1}function UQe(t){return $Qe(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&zQe(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r=e||M<0||d&&P>=o}function m(){var S=tP();if(b(S))return w(S);a=setTimeout(m,g(S))}function w(S){return a=void 0,f&&r?h(S):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function _(){return a===void 0?s:w(tP())}function C(){var S=tP(),M=b(S);if(r=arguments,i=this,l=S,M){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(m,e),h(l)}return a===void 0&&(a=setTimeout(m,e)),s}return C.cancel=x,C.flush=_,C}var eJe="Expected a function";function tJe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(eJe);return va(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),kZ(t,e,{leading:r,maxWait:e,trailing:i})}var nJe=function(e,n,r){var i=r.getBoundingClientRect(),o=i.width,s=i.height,a=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=a-(r.getBoundingClientRect().left+window.pageXOffset),c=l-(r.getBoundingClientRect().top+window.pageYOffset);u<0?u=0:u>o&&(u=o),c<0?c=0:c>s&&(c=s);var d=u/o,f=1-c/s;return{h:n.h,s:d,v:f,a:n.a,source:"hsv"}},rJe=function(){function t(e,n){for(var r=0;r-1}function CYe(t,e){var n=this.__data__,r=wM(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Qu(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=RZe}function Ng(t){return t!=null&&SO(t.length)&&!xO(t)}function IZe(t){return pd(t)&&Ng(t)}function NZe(){return!1}var DZ=typeof Es=="object"&&Es&&!Es.nodeType&&Es,FU=DZ&&typeof Ms=="object"&&Ms&&!Ms.nodeType&&Ms,FZe=FU&&FU.exports===DZ,OU=FZe?rl.Buffer:void 0,OZe=OU?OU.isBuffer:void 0,QS=OZe||NZe,kZe="[object Object]",LZe=Function.prototype,BZe=Object.prototype,RZ=LZe.toString,$Ze=BZe.hasOwnProperty,zZe=RZ.call(Object);function UZe(t){if(!pd(t)||fh(t)!=kZe)return!1;var e=AZ(t);if(e===null)return!0;var n=$Ze.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&RZ.call(n)==zZe}var HZe="[object Arguments]",VZe="[object Array]",GZe="[object Boolean]",jZe="[object Date]",WZe="[object Error]",qZe="[object Function]",XZe="[object Map]",KZe="[object Number]",YZe="[object Object]",ZZe="[object RegExp]",QZe="[object Set]",JZe="[object String]",eQe="[object WeakMap]",tQe="[object ArrayBuffer]",nQe="[object DataView]",rQe="[object Float32Array]",iQe="[object Float64Array]",oQe="[object Int8Array]",sQe="[object Int16Array]",aQe="[object Int32Array]",lQe="[object Uint8Array]",uQe="[object Uint8ClampedArray]",cQe="[object Uint16Array]",dQe="[object Uint32Array]",ir={};ir[rQe]=ir[iQe]=ir[oQe]=ir[sQe]=ir[aQe]=ir[lQe]=ir[uQe]=ir[cQe]=ir[dQe]=!0;ir[HZe]=ir[VZe]=ir[tQe]=ir[GZe]=ir[nQe]=ir[jZe]=ir[WZe]=ir[qZe]=ir[XZe]=ir[KZe]=ir[YZe]=ir[ZZe]=ir[QZe]=ir[JZe]=ir[eQe]=!1;function fQe(t){return pd(t)&&SO(t.length)&&!!ir[fh(t)]}function hQe(t){return function(e){return t(e)}}var IZ=typeof Es=="object"&&Es&&!Es.nodeType&&Es,Ov=IZ&&typeof Ms=="object"&&Ms&&!Ms.nodeType&&Ms,pQe=Ov&&Ov.exports===IZ,eP=pQe&&SZ.process,kU=function(){try{var t=Ov&&Ov.require&&Ov.require("util").types;return t||eP&&eP.binding&&eP.binding("util")}catch{}}(),LU=kU&&kU.isTypedArray,CO=LU?hQe(LU):fQe;function t3(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var mQe=Object.prototype,gQe=mQe.hasOwnProperty;function vQe(t,e,n){var r=t[e];(!(gQe.call(t,e)&&Zb(r,n))||n===void 0&&!(e in t))&&wO(t,e,n)}function yQe(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o-1&&t%1==0&&t0){if(++e>=FQe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var BQe=LQe(NQe);function $Qe(t,e){return BQe(RQe(t,e,SM),t+"")}function zQe(t,e,n){if(!ga(n))return!1;var r=typeof e;return(r=="number"?Ng(n)&&EO(e,n.length):r=="string"&&e in n)?Zb(n[e],t):!1}function UQe(t){return $Qe(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&zQe(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r=e||M<0||d&&P>=o}function m(){var S=tP();if(b(S))return w(S);a=setTimeout(m,g(S))}function w(S){return a=void 0,f&&r?h(S):(r=i=void 0,s)}function x(){a!==void 0&&clearTimeout(a),u=0,r=l=i=a=void 0}function _(){return a===void 0?s:w(tP())}function C(){var S=tP(),M=b(S);if(r=arguments,i=this,l=S,M){if(a===void 0)return p(l);if(d)return clearTimeout(a),a=setTimeout(m,e),h(l)}return a===void 0&&(a=setTimeout(m,e)),s}return C.cancel=x,C.flush=_,C}var eJe="Expected a function";function tJe(t,e,n){var r=!0,i=!0;if(typeof t!="function")throw new TypeError(eJe);return ga(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),kZ(t,e,{leading:r,maxWait:e,trailing:i})}var nJe=function(e,n,r){var i=r.getBoundingClientRect(),o=i.width,s=i.height,a=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,u=a-(r.getBoundingClientRect().left+window.pageXOffset),c=l-(r.getBoundingClientRect().top+window.pageYOffset);u<0?u=0:u>o&&(u=o),c<0?c=0:c>s&&(c=s);var d=u/o,f=1-c/s;return{h:n.h,s:d,v:f,a:n.a,source:"hsv"}},rJe=function(){function t(e,n){for(var r=0;r=0,o=!n&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return Mt(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(MJe,arguments)},brighten:function(){return this._applyModification(TJe,arguments)},darken:function(){return this._applyModification(AJe,arguments)},desaturate:function(){return this._applyModification(SJe,arguments)},saturate:function(){return this._applyModification(CJe,arguments)},greyscale:function(){return this._applyModification(EJe,arguments)},spin:function(){return this._applyModification(PJe,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(IJe,arguments)},complement:function(){return this._applyCombination(DJe,arguments)},monochromatic:function(){return this._applyCombination(NJe,arguments)},splitcomplement:function(){return this._applyCombination(RJe,arguments)},triad:function(){return this._applyCombination(jU,[3])},tetrad:function(){return this._applyCombination(jU,[4])}};Mt.fromRatio=function(t,e){if(JS(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=J0(t[r]));t=n}return Mt(t,e)};function yJe(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,s=!1,a=!1;return typeof t=="string"&&(t=BJe(t)),JS(t)=="object"&&(hu(t.r)&&hu(t.g)&&hu(t.b)?(e=bJe(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):hu(t.h)&&hu(t.s)&&hu(t.v)?(r=J0(t.s),i=J0(t.v),e=wJe(t.h,r,i),s=!0,a="hsv"):hu(t.h)&&hu(t.s)&&hu(t.l)&&(r=J0(t.s),o=J0(t.l),e=xJe(t.h,r,o),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=BZ(n),{ok:s,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function bJe(t,e,n){return{r:fr(t,255)*255,g:fr(e,255)*255,b:fr(n,255)*255}}function UU(t,e,n){t=fr(t,255),e=fr(e,255),n=fr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,s,a=(r+i)/2;if(r==i)o=s=0;else{var l=r-i;switch(s=a>.5?l/(2-r-i):l/(r+i),r){case t:o=(e-n)/l+(e1&&(d-=1),d<1/6?u+(c-u)*6*d:d<1/2?c:d<2/3?u+(c-u)*(2/3-d)*6:u}if(e===0)r=i=o=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=s(l,a,t+1/3),i=s(l,a,t),o=s(l,a,t-1/3)}return{r:r*255,g:i*255,b:o*255}}function HU(t,e,n){t=fr(t,255),e=fr(e,255),n=fr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,s,a=r,l=r-i;if(s=r===0?0:l/r,r==i)o=0;else{switch(r){case t:o=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(Mt(r));return o}function NJe(t,e){e=e||6;for(var n=Mt(t).toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/e;e--;)s.push(Mt({h:r,s:i,v:o})),o=(o+a)%1;return s}Mt.mix=function(t,e,n){n=n===0?0:n||50;var r=Mt(t).toRgb(),i=Mt(e).toRgb(),o=n/100,s={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return Mt(s)};Mt.readability=function(t,e){var n=Mt(t),r=Mt(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};Mt.isReadable=function(t,e,n){var r=Mt.readability(t,e),i,o;switch(o=!1,i=$Je(n),i.level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};Mt.mostReadable=function(t,e,n){var r=null,i=0,o,s,a,l;n=n||{},s=n.includeFallbackColors,a=n.level,l=n.size;for(var u=0;ui&&(i=o,r=Mt(e[u]));return Mt.isReadable(t,r,{level:a,size:l})||!s?r:(n.includeFallbackColors=!1,Mt.mostReadable(t,["#fff","#000"],n))};var n3=Mt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},FJe=Mt.hexNames=OJe(n3);function OJe(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function BZ(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function fr(t,e){kJe(t)&&(t="100%");var n=LJe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function MM(t){return Math.min(1,Math.max(0,t))}function hs(t){return parseInt(t,16)}function kJe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function LJe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Va(t){return t.length==1?"0"+t:""+t}function J0(t){return t<=1&&(t=t*100+"%"),t}function $Z(t){return Math.round(parseFloat(t)*255).toString(16)}function WU(t){return hs(t)/255}var Pa=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function hu(t){return!!Pa.CSS_UNIT.exec(t)}function BJe(t){t=t.replace(gJe,"").replace(vJe,"").toLowerCase();var e=!1;if(n3[t])t=n3[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Pa.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=Pa.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Pa.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=Pa.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Pa.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=Pa.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Pa.hex8.exec(t))?{r:hs(n[1]),g:hs(n[2]),b:hs(n[3]),a:WU(n[4]),format:e?"name":"hex8"}:(n=Pa.hex6.exec(t))?{r:hs(n[1]),g:hs(n[2]),b:hs(n[3]),format:e?"name":"hex"}:(n=Pa.hex4.exec(t))?{r:hs(n[1]+""+n[1]),g:hs(n[2]+""+n[2]),b:hs(n[3]+""+n[3]),a:WU(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=Pa.hex3.exec(t))?{r:hs(n[1]+""+n[1]),g:hs(n[2]+""+n[2]),b:hs(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function $Je(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var qU=function(e){var n=["r","g","b","a","h","s","l","v"],r=0,i=0;return mJe(n,function(o){if(e[o]&&(r+=1,isNaN(e[o])||(i+=1),o==="s"||o==="l")){var s=/^\d+%$/;s.test(e[o])&&(i+=1)}}),r===i?e:!1},ev=function(e,n){var r=e.hex?Mt(e.hex):Mt(e),i=r.toHsl(),o=r.toHsv(),s=r.toRgb(),a=r.toHex();i.s===0&&(i.h=n||0,o.h=n||0);var l=a==="000000"&&s.a===0;return{hsl:i,hex:l?"transparent":"#"+a,rgb:s,hsv:o,oldHue:e.h||n||i.h,source:e.source}},Pd=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&Mt(e).isValid()},TO=function(e){if(!e)return"#fff";var n=ev(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},nP=function(e,n){var r=e.replace("°","");return Mt(n+" ("+r+")")._ok},k0=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){qJe(i,r);function i(){var o,s,a,l;WJe(this,i);for(var u=arguments.length,c=Array(u),d=0;da))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&oet?new eC:void 0;for(o.set(t,e),o.set(e,t);++d=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var Iw=24,Stt=KZ.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?Iw:r,o=t.height,s=o===void 0?Iw:o,a=t.style,l=a===void 0?{}:a,u=_tt(t,["fill","width","height","style"]);return d9.default.createElement("svg",c9({viewBox:"0 0 "+Iw+" "+Iw,style:c9({fill:n,width:i,height:s},l)},u),d9.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},Ctt=function(){function t(e,n){for(var r=0;r1&&(i.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(i.a*100)/100,source:"rgb"},o)):(i.h||i.s||i.l)&&(typeof i.s=="string"&&i.s.includes("%")&&(i.s=i.s.replace("%","")),typeof i.l=="string"&&i.l.includes("%")&&(i.l=i.l.replace("%","")),i.s==1?i.s=.01:i.l==1&&(i.l=.01),r.props.onChange({h:i.h||r.props.hsl.h,s:Number(u9(i.s)?r.props.hsl.s:i.s),l:Number(u9(i.l)?r.props.hsl.l:i.l),source:"hsl"},o))},r.showHighlight=function(i){i.currentTarget.style.background="#eee"},r.hideHighlight=function(i){i.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return Ctt(e,[{key:"render",value:function(){var r=this,i=jt({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),o=void 0;return this.state.view==="hex"?o=ie.createElement("div",{style:i.fields,className:"flexbox-fix"},ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?o=ie.createElement("div",{style:i.fields,className:"flexbox-fix"},ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),ie.createElement("div",{style:i.alpha},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(o=ie.createElement("div",{style:i.fields,className:"flexbox-fix"},ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),ie.createElement("div",{style:i.alpha},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),ie.createElement("div",{style:i.wrap,className:"flexbox-fix"},o,ie.createElement("div",{style:i.toggle},ie.createElement("div",{style:i.icon,onClick:this.toggleViews,ref:function(a){return r.icon=a}},ie.createElement(Stt,{style:i.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.hsl.a!==1&&i.view==="hex"?{view:"rgb"}:null}}]),e}(ie.Component);YZ.defaultProps={view:"hex"};var f9=function(){var e=jt({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return ie.createElement("div",{style:e.picker})},Att=function(){var e=jt({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return ie.createElement("div",{style:e.picker})},NO=function(e){var n=e.width,r=e.onChange,i=e.disableAlpha,o=e.rgb,s=e.hsl,a=e.hsv,l=e.hex,u=e.renderers,c=e.styles,d=c===void 0?{}:c,f=e.className,h=f===void 0?"":f,p=e.defaultView,g=jt(rs({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},d),{disableAlpha:i});return ie.createElement("div",{style:g.picker,className:"chrome-picker "+h},ie.createElement("div",{style:g.saturation},ie.createElement(EM,{style:g.Saturation,hsl:s,hsv:a,pointer:Att,onChange:r})),ie.createElement("div",{style:g.body},ie.createElement("div",{style:g.controls,className:"flexbox-fix"},ie.createElement("div",{style:g.color},ie.createElement("div",{style:g.swatch},ie.createElement("div",{style:g.active}),ie.createElement(Rg,{renderers:u}))),ie.createElement("div",{style:g.toggles},ie.createElement("div",{style:g.hue},ie.createElement(Ig,{style:g.Hue,hsl:s,pointer:f9,onChange:r})),ie.createElement("div",{style:g.alpha},ie.createElement(bO,{style:g.Alpha,rgb:o,hsl:s,pointer:f9,renderers:u,onChange:r})))),ie.createElement(YZ,{rgb:o,hsl:s,hex:l,view:p,onChange:r,disableAlpha:i})))};NO.propTypes={width:me.oneOfType([me.string,me.number]),disableAlpha:me.bool,styles:me.object,defaultView:me.oneOf(["hex","rgb","hsl"])};NO.defaultProps={width:225,disableAlpha:!1,styles:{}};is(NO);var Ptt=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,s=e.active,a=jt({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:TO(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:s,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return ie.createElement(mh,{style:a.color,color:n,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},ie.createElement("div",{style:a.dot}))},Dtt=function(e){var n=e.hex,r=e.rgb,i=e.onChange,o=jt({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),s=function(l,u){l.r||l.g||l.b?i({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},u):i({hex:l.hex,source:"hex"},u)};return ie.createElement("div",{style:o.fields,className:"flexbox-fix"},ie.createElement("div",{style:o.active}),ie.createElement(gn,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:n,onChange:s}),ie.createElement(gn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:r.r,onChange:s}),ie.createElement(gn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:r.g,onChange:s}),ie.createElement(gn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:r.b,onChange:s}))},FO=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.colors,o=e.hex,s=e.rgb,a=e.styles,l=a===void 0?{}:a,u=e.className,c=u===void 0?"":u,d=jt(rs({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),f=function(p,g){p.hex?Pd(p.hex)&&n({hex:p.hex,source:"hex"},g):n(p,g)};return ie.createElement(Qb,{style:d.Compact,styles:l},ie.createElement("div",{style:d.compact,className:"compact-picker "+c},ie.createElement("div",null,gh(i,function(h){return ie.createElement(Ptt,{key:h,color:h,active:h.toLowerCase()===o,onClick:f,onSwatchHover:r})}),ie.createElement("div",{style:d.clear})),ie.createElement(Dtt,{hex:o,rgb:s,onChange:f})))};FO.propTypes={colors:me.arrayOf(me.string),styles:me.object};FO.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};is(FO);var Rtt=function(e){var n=e.hover,r=e.color,i=e.onClick,o=e.onSwatchHover,s={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},a=jt({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:n});return ie.createElement("div",{style:a.swatch},ie.createElement(mh,{color:r,onClick:i,onHover:o,focusStyle:s}))};const Itt=yO(Rtt);var OO=function(e){var n=e.width,r=e.colors,i=e.onChange,o=e.onSwatchHover,s=e.triangle,a=e.styles,l=a===void 0?{}:a,u=e.className,c=u===void 0?"":u,d=jt(rs({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},l),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right","bottom-left-triangle":s==="bottom-left","bottom-right-triangle":s==="bottom-right"}),f=function(p,g){return i({hex:p,source:"hex"},g)};return ie.createElement("div",{style:d.card,className:"github-picker "+c},ie.createElement("div",{style:d.triangleShadow}),ie.createElement("div",{style:d.triangle}),gh(r,function(h){return ie.createElement(Itt,{color:h,key:h,onClick:f,onSwatchHover:o})}))};OO.propTypes={width:me.oneOfType([me.string,me.number]),colors:me.arrayOf(me.string),triangle:me.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:me.object};OO.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};is(OO);var Ntt=function(e){var n=e.direction,r=jt({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return ie.createElement("div",{style:r.picker})},Ftt=Object.assign||function(t){for(var e=1;e.5});return ie.createElement("div",{style:r.picker})},Btt=function(){var e=jt({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return ie.createElement("div",{style:e.pointer},ie.createElement("div",{style:e.left},ie.createElement("div",{style:e.leftInside})),ie.createElement("div",{style:e.right},ie.createElement("div",{style:e.rightInside})))},h9=function(e){var n=e.onClick,r=e.label,i=e.children,o=e.active,s=jt({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:o});return ie.createElement("div",{style:s.button,onClick:n},r||i)},$tt=function(e){var n=e.rgb,r=e.currentColor,i=jt({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return ie.createElement("div",null,ie.createElement("div",{style:i.label},"new"),ie.createElement("div",{style:i.swatches},ie.createElement("div",{style:i.new}),ie.createElement("div",{style:i.current})),ie.createElement("div",{style:i.label},"current"))},ztt=function(){function t(e,n){for(var r=0;r100&&(c.a=100),c.a/=100,n({h:i.h,s:i.s,l:i.l,a:c.a,source:"rgb"},d))};return ie.createElement("div",{style:a.fields,className:"flexbox-fix"},ie.createElement("div",{style:a.double},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"hex",value:o.replace("#",""),onChange:l})),ie.createElement("div",{style:a.single},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),ie.createElement("div",{style:a.single},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),ie.createElement("div",{style:a.single},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),ie.createElement("div",{style:a.alpha},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},jtt=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var Nw=24,Jtt=QZ.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?Nw:r,o=t.height,s=o===void 0?Nw:o,a=t.style,l=a===void 0?{}:a,u=Qtt(t,["fill","width","height","style"]);return m9.default.createElement("svg",p9({viewBox:"0 0 "+Nw+" "+Nw,style:p9({fill:n,width:i,height:s},l)},u),m9.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},ent=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,s=e.first,a=e.last,l=e.active,u=jt({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:TO(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:s,last:a,active:l,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return ie.createElement(mh,{color:n,style:u.color,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},ie.createElement("div",{style:u.check},ie.createElement(Jtt,null)))},tnt=function(e){var n=e.onClick,r=e.onSwatchHover,i=e.group,o=e.active,s=jt({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return ie.createElement("div",{style:s.group},gh(i,function(a,l){return ie.createElement(ent,{key:a,color:a,active:a.toLowerCase()===o,first:l===0,last:l===i.length-1,onClick:n,onSwatchHover:r})}))},zO=function(e){var n=e.width,r=e.height,i=e.onChange,o=e.onSwatchHover,s=e.colors,a=e.hex,l=e.styles,u=l===void 0?{}:l,c=e.className,d=c===void 0?"":c,f=jt(rs({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},u)),h=function(g,b){return i({hex:g,source:"hex"},b)};return ie.createElement("div",{style:f.picker,className:"swatches-picker "+d},ie.createElement(Qb,null,ie.createElement("div",{style:f.overflow},ie.createElement("div",{style:f.body},gh(s,function(p){return ie.createElement(tnt,{key:p.toString(),group:p,active:a,onClick:h,onSwatchHover:o})}),ie.createElement("div",{style:f.clear})))))};zO.propTypes={width:me.oneOfType([me.string,me.number]),height:me.oneOfType([me.string,me.number]),colors:me.arrayOf(me.arrayOf(me.string)),styles:me.object};zO.defaultProps={width:320,height:240,colors:[[bp[900],bp[700],bp[500],bp[300],bp[100]],[xp[900],xp[700],xp[500],xp[300],xp[100]],[wp[900],wp[700],wp[500],wp[300],wp[100]],[_p[900],_p[700],_p[500],_p[300],_p[100]],[Sp[900],Sp[700],Sp[500],Sp[300],Sp[100]],[Cp[900],Cp[700],Cp[500],Cp[300],Cp[100]],[Ep[900],Ep[700],Ep[500],Ep[300],Ep[100]],[Mp[900],Mp[700],Mp[500],Mp[300],Mp[100]],[Tp[900],Tp[700],Tp[500],Tp[300],Tp[100]],["#194D33",tv[700],tv[500],tv[300],tv[100]],[Ap[900],Ap[700],Ap[500],Ap[300],Ap[100]],[Pp[900],Pp[700],Pp[500],Pp[300],Pp[100]],[Dp[900],Dp[700],Dp[500],Dp[300],Dp[100]],[Rp[900],Rp[700],Rp[500],Rp[300],Rp[100]],[Ip[900],Ip[700],Ip[500],Ip[300],Ip[100]],[Np[900],Np[700],Np[500],Np[300],Np[100]],[Fp[900],Fp[700],Fp[500],Fp[300],Fp[100]],[Op[900],Op[700],Op[500],Op[300],Op[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};is(zO);var UO=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,s=e.width,a=e.triangle,l=e.styles,u=l===void 0?{}:l,c=e.className,d=c===void 0?"":c,f=jt(rs({default:{card:{width:s,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},u),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right"}),h=function(g,b){Pd(g)&&n({hex:g,source:"hex"},b)};return ie.createElement("div",{style:f.card,className:"twitter-picker "+d},ie.createElement("div",{style:f.triangleShadow}),ie.createElement("div",{style:f.triangle}),ie.createElement("div",{style:f.body},gh(o,function(p,g){return ie.createElement(mh,{key:g,color:p,hex:p,style:f.swatch,onClick:h,onHover:r,focusStyle:{boxShadow:"0 0 4px "+p}})}),ie.createElement("div",{style:f.hash},"#"),ie.createElement(gn,{label:null,style:{input:f.input},value:i.replace("#",""),onChange:h}),ie.createElement("div",{style:f.clear})))};UO.propTypes={width:me.oneOfType([me.string,me.number]),triangle:me.oneOf(["hide","top-left","top-right"]),colors:me.arrayOf(me.string),styles:me.object};UO.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};is(UO);var HO=function(e){var n=jt({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return ie.createElement("div",{style:n.picker})};HO.propTypes={hsl:me.shape({h:me.number,s:me.number,l:me.number,a:me.number})};HO.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var VO=function(e){var n=jt({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return ie.createElement("div",{style:n.picker})};VO.propTypes={hsl:me.shape({h:me.number,s:me.number,l:me.number,a:me.number})};VO.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var nnt=function(e){var n=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,s=e.hsv,a=function(h,p){if(h.hex)Pd(h.hex)&&n({hex:h.hex,source:"hex"},p);else if(h.rgb){var g=h.rgb.split(",");nP(h.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},p)}else if(h.hsv){var b=h.hsv.split(",");nP(h.hsv,"hsv")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),b[1]==1?b[1]=.01:b[2]==1&&(b[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsv"},p))}else if(h.hsl){var m=h.hsl.split(",");nP(h.hsl,"hsl")&&(m[2]=m[2].replace("%",""),m[1]=m[1].replace("%",""),m[0]=m[0].replace("°",""),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),n({h:Number(m[0]),s:Number(m[1]),v:Number(m[2]),source:"hsl"},p))}},l=jt({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),u=r.r+", "+r.g+", "+r.b,c=Math.round(i.h)+"°, "+Math.round(i.s*100)+"%, "+Math.round(i.l*100)+"%",d=Math.round(s.h)+"°, "+Math.round(s.s*100)+"%, "+Math.round(s.v*100)+"%";return ie.createElement("div",{style:l.wrap,className:"flexbox-fix"},ie.createElement("div",{style:l.fields},ie.createElement("div",{style:l.double},ie.createElement(gn,{style:{input:l.input,label:l.label},label:"hex",value:o,onChange:a})),ie.createElement("div",{style:l.column},ie.createElement("div",{style:l.single},ie.createElement(gn,{style:{input:l.input2,label:l.label2},label:"rgb",value:u,onChange:a})),ie.createElement("div",{style:l.single},ie.createElement(gn,{style:{input:l.input2,label:l.label2},label:"hsv",value:d,onChange:a})),ie.createElement("div",{style:l.single},ie.createElement(gn,{style:{input:l.input2,label:l.label2},label:"hsl",value:c,onChange:a})))))},GO=function(e){var n=e.width,r=e.onChange,i=e.rgb,o=e.hsl,s=e.hsv,a=e.hex,l=e.header,u=e.styles,c=u===void 0?{}:u,d=e.className,f=d===void 0?"":d,h=jt(rs({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+i.r+", "+i.g+", "+i.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},c));return ie.createElement("div",{style:h.picker,className:"google-picker "+f},ie.createElement("div",{style:h.head},l),ie.createElement("div",{style:h.swatch}),ie.createElement("div",{style:h.saturation},ie.createElement(EM,{hsl:o,hsv:s,pointer:HO,onChange:r})),ie.createElement("div",{style:h.body},ie.createElement("div",{style:h.controls,className:"flexbox-fix"},ie.createElement("div",{style:h.hue},ie.createElement(Ig,{style:h.Hue,hsl:o,radius:"4px",pointer:VO,onChange:r}))),ie.createElement(nnt,{rgb:i,hsl:o,hex:a,hsv:s,onChange:r})))};GO.propTypes={width:me.oneOfType([me.string,me.number]),styles:me.object,header:me.string};GO.defaultProps={width:652,styles:{},header:"Color picker"};is(GO);const rnt=t=>{const e=t.upperBound.x>t.upperBound.y?t.upperBound.x:t.upperBound.y,n=t.lowerBound.x`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`;var jO={},int=YC;Object.defineProperty(jO,"__esModule",{value:!0});var JZ=jO.default=void 0,ont=int(TW()),snt=D;JZ=jO.default=(0,ont.default)((0,snt.jsx)("path",{d:"M3 3h18v18H3z"}),"Square");function Kd(t){const[e,n]=ie.useState(null),r=s=>{n(s.currentTarget)},i=()=>{n(null)},o=!!e;return D.jsxs("div",{children:[D.jsx(io,{style:{color:bc(t.color)},onClick:r,children:D.jsx(JZ,{})}),D.jsx(dG,{open:o,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:D.jsx(qtt,{color:t.color,onChangeComplete:t.onChangeComplete})})]})}function ant(){const t=VY();return D.jsx(xu,{sx:{flexGrow:1,overflow:"scroll"},variant:"outlined",children:D.jsx(GI,{children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" Legend"}),D.jsx(ca,{}),D.jsxs(aG,{children:[D.jsx(Bo,{control:D.jsx(vc,{checked:t.detector,onChange:(e,n)=>t.update({detector:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.detectorColor,onChangeComplete:e=>t.update({detectorColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Detector"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.cameraTube,onChange:(e,n)=>t.update({cameraTube:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.cameraTubeColor,onChangeComplete:e=>t.update({cameraTubeColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Camera Tube"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.beamstop,onChange:(e,n)=>{t.update({beamstop:n})}}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.beamstopColor,onChangeComplete:e=>t.update({beamstopColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Beamstop"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.clearance,onChange:(e,n)=>{t.update({clearance:n})}}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.clearanceColor,onChangeComplete:e=>t.update({clearanceColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Clearance"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.visibleRange,onChange:(e,n)=>t.update({visibleRange:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.visibleColor,onChangeComplete:e=>t.update({visibleColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Visible Range"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.requestedRange,onChange:(e,n)=>t.update({requestedRange:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.requestedRangeColor,onChangeComplete:e=>t.update({requestedRangeColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Requested Range"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.inaccessibleRange,onChange:(e,n)=>t.update({inaccessibleRange:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.inaccessibleRangeColor,onChangeComplete:e=>t.update({inaccessibleRangeColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Inaccessible Range"})]})})]}),D.jsxs(Ai,{children:[D.jsx(qI,{id:"demo-radio-buttons-group-label",children:"Axes:"}),D.jsxs(gG,{"aria-labelledby":"demo-radio-buttons-group-label",value:t.plotAxes,name:"radio-buttons-group",onChange:e=>t.update({plotAxes:e.target.value}),children:[D.jsx(Bo,{value:Su.milimeter,control:D.jsx(gm,{}),label:"Axes in mm"}),D.jsx(Bo,{value:Su.pixel,control:D.jsx(gm,{}),label:"Axes in pixels"}),D.jsx(Bo,{value:Su.reciprocal,control:D.jsx(gm,{}),label:"Axes in q(nm^-1)"})]})]}),D.jsx(cn,{direction:"row",spacing:1})]})})})}function iP(t){const{coords:e,...n}=t,[r,i,o]=e,s=i.distanceTo(r),a=o.distanceTo(r);return D.jsx("ellipse",{cx:r.x,cy:r.y,rx:s,ry:a,...n})}function lnt(){const t=VY(),e=gg(),n=mg(),r=gE(),i=vE(),o=unt(e.wavelength,e.cameraLength),{ptMin:s,ptMax:a,visibleQRange:l,fullQRange:u}=E.useMemo(()=>{Zp.UNITS.xpixel&&delete Zp.UNITS.xpixel,Zp.UNITS.ypixel&&delete Zp.UNITS.ypixel,n8("xpixel",n.detector.pixelSize.width.toString()),n8("ypixel",n.detector.pixelSize.height.toString());const A=g9(e.angle,e.cameraLength,e.wavelength,e.beamline);return sUe(n.detector,r.beamstop,i.cameraTube,A)},[n.detector,r.beamstop,i.cameraTube,e.angle,e.cameraLength,e.wavelength,e.beamline]),c=Ha.fromNumericRange(l,"m^-1").to("nm^-1");console.log(l);const d=Ha.fromNumericRange(u,"m^-1").to("nm^-1"),{beamstopCentre:f,cameraTubeCentre:h,minPoint:p,maxPoint:g}=cnt(s,a,r.beamstop,i.cameraTube),b=new XR(t.plotAxes,o),{plotDetector:m,plotBeamstop:w,plotClearance:x,plotCameraTube:_,plotVisibleRange:C}=dnt(b,f,r.beamstop,h,i.cameraTube,n.detector,p,g),S=yf(hnt());let M={start:new oe(0,0),end:new oe(0,0)};S&&e.cameraLength&&e.wavelength&&(M=fnt(S,g9(e.angle,e.cameraLength,e.wavelength,e.beamline),f,M,b));const P=rnt(m);return D.jsxs(cn,{direction:"column",spacing:1,flexGrow:1,children:[D.jsxs(cn,{direction:{sm:"column",md:"row"},spacing:1,flexGrow:1,children:[D.jsx(xu,{variant:"outlined",sx:{aspectRatio:1.05/1},children:D.jsx(GI,{sx:{width:"100%",height:"100%"},children:D.jsx("div",{style:{display:"grid",width:"100%",height:"100%",border:"solid black"},children:D.jsxs(sze,{abscissaConfig:{visDomain:[P.xAxis.min,P.xAxis.max],showGrid:!0},ordinateConfig:{visDomain:[P.yAxis.max,P.yAxis.min],showGrid:!0},children:[D.jsx(M$e,{}),D.jsx($$e,{}),D.jsx(rUe,{points:[w.centre,w.endPointX,w.endPointY,x.centre,x.endPointX,x.endPointY,_.centre,_.endPointX,_.endPointY,m.lowerBound,m.upperBound,C.start,C.end,M.start,M.end],children:(A,R,F,$,j,k,U,G,B,L,N,W,K,Q,J)=>D.jsxs(nO,{children:[t.cameraTube&&D.jsx(iP,{coords:[U,G,B],fill:bc(t.cameraTubeColor),id:"camera tube"}),t.detector&&D.jsx(US,{coords:[L,N],fill:bc(t.detectorColor),id:"detector"}),t.inaccessibleRange&&D.jsx(qA,{coords:[A,W],stroke:bc(t.inaccessibleRangeColor),strokeWidth:3,id:"inaccessible"}),t.clearance&&D.jsx(iP,{coords:[$,j,k],fill:bc(t.clearanceColor),id:"clearance"}),t.visibleRange&&D.jsx(qA,{coords:[W,K],stroke:bc(t.visibleColor),strokeWidth:3,id:"visible"}),t.requestedRange&&D.jsx(qA,{coords:[Q,J],stroke:bc(t.requestedRangeColor),strokeWidth:3,id:"requested"}),t.beamstop&&D.jsx(iP,{coords:[A,R,F],fill:bc(t.beamstopColor),id:"beamstop"})]})})]})})})}),D.jsx(ant,{})]}),D.jsx(mUe,{visableQRange:c,fullQrange:d})]})}function unt(t,e){let n=null;if(e&&t&&(n=_o(2*Math.PI,wi(Rt(e,"m"),t.to("m")))),n==null)return n;if(typeof n=="number"||!("units"in n))throw TypeError("scaleFactor should be a unit not a number");return n}function g9(t,e,n,r){return{angle:t,cameraLength:e,beamline:r,wavelength:n}}function cnt(t,e,n,r){const i={x:Rt(t.x,"m"),y:Rt(t.y,"m")},o={x:Rt(e.x,"m"),y:Rt(e.y,"m")},s={x:Rt(n.centre.x??NaN,"xpixel"),y:Rt(n.centre.y??NaN,"ypixel")},a={x:Rt(r.centre.x??NaN,"xpixel"),y:Rt(r.centre.y??NaN,"ypixel")};return{beamstopCentre:s,cameraTubeCentre:a,minPoint:i,maxPoint:o}}function dnt(t,e,n,r,i,o,s,a){const l=t.createPlotEllipse(e,n.diameter,e),u=t.createPlotEllipse(r,i.diameter,e),c=t.createPlotEllipseClearance(e,n.diameter,n.clearance??0,e),d=t.createPlotRectangle(o.resolution,e),f=t.createPlotRange(s,a,e);return{plotDetector:d,plotBeamstop:l,plotClearance:c,plotCameraTube:u,plotVisibleRange:f}}function fnt(t,e,n,r,i){const o=Uz(t.max,e.angle,Rt(e.cameraLength??NaN,"m"),e.wavelength,n),s=Uz(t.min,e.angle,Rt(e.cameraLength??NaN,"m"),e.wavelength,n);return r=i.createPlotRange(s,o,n),r}function hnt(){return t=>{if(!t.requestedMax||!t.requestedMin)return null;const e=n=>{let r;switch(t.requested){case Ho.d:r=GS(Rt(n,t.dUnits));break;case Ho.s:r=VS(Rt(n,t.sUnits));break;default:r=Rt(n,t.qUnits)}return r};return new Ha(e(t.requestedMin),e(t.requestedMax))}}function pnt(){const[t,e]=E.useState(Object.keys(yv)[0]),n=mg(),r=gg(),i=gE(),o=vE(),s=a=>{const{beamstop:l,cameraTube:u,detector:c,beamline:d}=yv[a];n.updateDetector(c),i.updateBeamstop(l),o.updateCameraTube(u),r.updateBeamline(d),i.updateDiameter(r.beamlineRecord[d].beamstopDiameter,bs.millimetre),o.updateDiameter(r.beamlineRecord[d].cameratubeDiameter,bs.millimetre),e(a)};return D.jsx(_se,{style:{position:"static",width:"100%"},children:D.jsxs(yG,{children:[D.jsx(xn,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Dedi Web"}),D.jsx(ly,{size:"small",options:Object.keys(yv),value:t,sx:{width:250,color:"white"},renderInput:a=>D.jsx($n,{...a,label:"preset",sx:{color:"black"}}),onChange:(a,l)=>{l&&s(l)}})]})})}function mnt(){return D.jsx(D.Fragment,{children:D.jsx(ice,{children:D.jsxs(cn,{spacing:1,children:[D.jsx(pnt,{}),D.jsxs(cn,{direction:{md:"column",lg:"row"},spacing:1,justifyContent:"center",children:[D.jsx(QMe,{}),D.jsx(lnt,{})]})]})})})}sP.createRoot(document.getElementById("root")).render(D.jsx(ie.StrictMode,{children:D.jsx(mnt,{})}))});export default gnt(); + `),ie.createElement("div",{style:c.white,className:"saturation-white"},ie.createElement("div",{style:c.black,className:"saturation-black"}),ie.createElement("div",{style:c.pointer},this.props.pointer?ie.createElement(this.props.pointer,this.props):ie.createElement("div",{style:c.circle}))))}}]),e}(E.PureComponent||E.Component);function aJe(t,e){for(var n=-1,r=t==null?0:t.length;++n=0,o=!n&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return Mt(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(MJe,arguments)},brighten:function(){return this._applyModification(TJe,arguments)},darken:function(){return this._applyModification(AJe,arguments)},desaturate:function(){return this._applyModification(SJe,arguments)},saturate:function(){return this._applyModification(CJe,arguments)},greyscale:function(){return this._applyModification(EJe,arguments)},spin:function(){return this._applyModification(PJe,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(IJe,arguments)},complement:function(){return this._applyCombination(DJe,arguments)},monochromatic:function(){return this._applyCombination(NJe,arguments)},splitcomplement:function(){return this._applyCombination(RJe,arguments)},triad:function(){return this._applyCombination(jU,[3])},tetrad:function(){return this._applyCombination(jU,[4])}};Mt.fromRatio=function(t,e){if(JS(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=J0(t[r]));t=n}return Mt(t,e)};function yJe(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,o=null,s=!1,a=!1;return typeof t=="string"&&(t=BJe(t)),JS(t)=="object"&&(hu(t.r)&&hu(t.g)&&hu(t.b)?(e=bJe(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):hu(t.h)&&hu(t.s)&&hu(t.v)?(r=J0(t.s),i=J0(t.v),e=wJe(t.h,r,i),s=!0,a="hsv"):hu(t.h)&&hu(t.s)&&hu(t.l)&&(r=J0(t.s),o=J0(t.l),e=xJe(t.h,r,o),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=BZ(n),{ok:s,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function bJe(t,e,n){return{r:fr(t,255)*255,g:fr(e,255)*255,b:fr(n,255)*255}}function UU(t,e,n){t=fr(t,255),e=fr(e,255),n=fr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,s,a=(r+i)/2;if(r==i)o=s=0;else{var l=r-i;switch(s=a>.5?l/(2-r-i):l/(r+i),r){case t:o=(e-n)/l+(e1&&(d-=1),d<1/6?u+(c-u)*6*d:d<1/2?c:d<2/3?u+(c-u)*(2/3-d)*6:u}if(e===0)r=i=o=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=s(l,a,t+1/3),i=s(l,a,t),o=s(l,a,t-1/3)}return{r:r*255,g:i*255,b:o*255}}function HU(t,e,n){t=fr(t,255),e=fr(e,255),n=fr(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),o,s,a=r,l=r-i;if(s=r===0?0:l/r,r==i)o=0;else{switch(r){case t:o=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(Mt(r));return o}function NJe(t,e){e=e||6;for(var n=Mt(t).toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/e;e--;)s.push(Mt({h:r,s:i,v:o})),o=(o+a)%1;return s}Mt.mix=function(t,e,n){n=n===0?0:n||50;var r=Mt(t).toRgb(),i=Mt(e).toRgb(),o=n/100,s={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return Mt(s)};Mt.readability=function(t,e){var n=Mt(t),r=Mt(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};Mt.isReadable=function(t,e,n){var r=Mt.readability(t,e),i,o;switch(o=!1,i=$Je(n),i.level+i.size){case"AAsmall":case"AAAlarge":o=r>=4.5;break;case"AAlarge":o=r>=3;break;case"AAAsmall":o=r>=7;break}return o};Mt.mostReadable=function(t,e,n){var r=null,i=0,o,s,a,l;n=n||{},s=n.includeFallbackColors,a=n.level,l=n.size;for(var u=0;ui&&(i=o,r=Mt(e[u]));return Mt.isReadable(t,r,{level:a,size:l})||!s?r:(n.includeFallbackColors=!1,Mt.mostReadable(t,["#fff","#000"],n))};var n3=Mt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},FJe=Mt.hexNames=OJe(n3);function OJe(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function BZ(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function fr(t,e){kJe(t)&&(t="100%");var n=LJe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function MM(t){return Math.min(1,Math.max(0,t))}function hs(t){return parseInt(t,16)}function kJe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function LJe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Ha(t){return t.length==1?"0"+t:""+t}function J0(t){return t<=1&&(t=t*100+"%"),t}function $Z(t){return Math.round(parseFloat(t)*255).toString(16)}function WU(t){return hs(t)/255}var Aa=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",i="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function hu(t){return!!Aa.CSS_UNIT.exec(t)}function BJe(t){t=t.replace(gJe,"").replace(vJe,"").toLowerCase();var e=!1;if(n3[t])t=n3[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=Aa.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=Aa.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Aa.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=Aa.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Aa.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=Aa.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Aa.hex8.exec(t))?{r:hs(n[1]),g:hs(n[2]),b:hs(n[3]),a:WU(n[4]),format:e?"name":"hex8"}:(n=Aa.hex6.exec(t))?{r:hs(n[1]),g:hs(n[2]),b:hs(n[3]),format:e?"name":"hex"}:(n=Aa.hex4.exec(t))?{r:hs(n[1]+""+n[1]),g:hs(n[2]+""+n[2]),b:hs(n[3]+""+n[3]),a:WU(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=Aa.hex3.exec(t))?{r:hs(n[1]+""+n[1]),g:hs(n[2]+""+n[2]),b:hs(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function $Je(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var qU=function(e){var n=["r","g","b","a","h","s","l","v"],r=0,i=0;return mJe(n,function(o){if(e[o]&&(r+=1,isNaN(e[o])||(i+=1),o==="s"||o==="l")){var s=/^\d+%$/;s.test(e[o])&&(i+=1)}}),r===i?e:!1},ev=function(e,n){var r=e.hex?Mt(e.hex):Mt(e),i=r.toHsl(),o=r.toHsv(),s=r.toRgb(),a=r.toHex();i.s===0&&(i.h=n||0,o.h=n||0);var l=a==="000000"&&s.a===0;return{hsl:i,hex:l?"transparent":"#"+a,rgb:s,hsv:o,oldHue:e.h||n||i.h,source:e.source}},Pd=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&Mt(e).isValid()},TO=function(e){if(!e)return"#fff";var n=ev(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},nP=function(e,n){var r=e.replace("°","");return Mt(n+" ("+r+")")._ok},k0=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){qJe(i,r);function i(){var o,s,a,l;WJe(this,i);for(var u=arguments.length,c=Array(u),d=0;da))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var d=-1,f=!0,h=n&oet?new eC:void 0;for(o.set(t,e),o.set(e,t);++d=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var Iw=24,Stt=KZ.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?Iw:r,o=t.height,s=o===void 0?Iw:o,a=t.style,l=a===void 0?{}:a,u=_tt(t,["fill","width","height","style"]);return d9.default.createElement("svg",c9({viewBox:"0 0 "+Iw+" "+Iw,style:c9({fill:n,width:i,height:s},l)},u),d9.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},Ctt=function(){function t(e,n){for(var r=0;r1&&(i.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(i.a*100)/100,source:"rgb"},o)):(i.h||i.s||i.l)&&(typeof i.s=="string"&&i.s.includes("%")&&(i.s=i.s.replace("%","")),typeof i.l=="string"&&i.l.includes("%")&&(i.l=i.l.replace("%","")),i.s==1?i.s=.01:i.l==1&&(i.l=.01),r.props.onChange({h:i.h||r.props.hsl.h,s:Number(u9(i.s)?r.props.hsl.s:i.s),l:Number(u9(i.l)?r.props.hsl.l:i.l),source:"hsl"},o))},r.showHighlight=function(i){i.currentTarget.style.background="#eee"},r.hideHighlight=function(i){i.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return Ctt(e,[{key:"render",value:function(){var r=this,i=jt({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),o=void 0;return this.state.view==="hex"?o=ie.createElement("div",{style:i.fields,className:"flexbox-fix"},ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?o=ie.createElement("div",{style:i.fields,className:"flexbox-fix"},ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),ie.createElement("div",{style:i.alpha},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(o=ie.createElement("div",{style:i.fields,className:"flexbox-fix"},ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),ie.createElement("div",{style:i.field},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),ie.createElement("div",{style:i.alpha},ie.createElement(gn,{style:{input:i.input,label:i.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),ie.createElement("div",{style:i.wrap,className:"flexbox-fix"},o,ie.createElement("div",{style:i.toggle},ie.createElement("div",{style:i.icon,onClick:this.toggleViews,ref:function(a){return r.icon=a}},ie.createElement(Stt,{style:i.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.hsl.a!==1&&i.view==="hex"?{view:"rgb"}:null}}]),e}(ie.Component);YZ.defaultProps={view:"hex"};var f9=function(){var e=jt({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return ie.createElement("div",{style:e.picker})},Att=function(){var e=jt({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return ie.createElement("div",{style:e.picker})},NO=function(e){var n=e.width,r=e.onChange,i=e.disableAlpha,o=e.rgb,s=e.hsl,a=e.hsv,l=e.hex,u=e.renderers,c=e.styles,d=c===void 0?{}:c,f=e.className,h=f===void 0?"":f,p=e.defaultView,g=jt(rs({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+o.r+", "+o.g+", "+o.b+", "+o.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},d),{disableAlpha:i});return ie.createElement("div",{style:g.picker,className:"chrome-picker "+h},ie.createElement("div",{style:g.saturation},ie.createElement(EM,{style:g.Saturation,hsl:s,hsv:a,pointer:Att,onChange:r})),ie.createElement("div",{style:g.body},ie.createElement("div",{style:g.controls,className:"flexbox-fix"},ie.createElement("div",{style:g.color},ie.createElement("div",{style:g.swatch},ie.createElement("div",{style:g.active}),ie.createElement(Rg,{renderers:u}))),ie.createElement("div",{style:g.toggles},ie.createElement("div",{style:g.hue},ie.createElement(Ig,{style:g.Hue,hsl:s,pointer:f9,onChange:r})),ie.createElement("div",{style:g.alpha},ie.createElement(bO,{style:g.Alpha,rgb:o,hsl:s,pointer:f9,renderers:u,onChange:r})))),ie.createElement(YZ,{rgb:o,hsl:s,hex:l,view:p,onChange:r,disableAlpha:i})))};NO.propTypes={width:me.oneOfType([me.string,me.number]),disableAlpha:me.bool,styles:me.object,defaultView:me.oneOf(["hex","rgb","hsl"])};NO.defaultProps={width:225,disableAlpha:!1,styles:{}};is(NO);var Ptt=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,s=e.active,a=jt({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:TO(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:s,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return ie.createElement(mh,{style:a.color,color:n,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},ie.createElement("div",{style:a.dot}))},Dtt=function(e){var n=e.hex,r=e.rgb,i=e.onChange,o=jt({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),s=function(l,u){l.r||l.g||l.b?i({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},u):i({hex:l.hex,source:"hex"},u)};return ie.createElement("div",{style:o.fields,className:"flexbox-fix"},ie.createElement("div",{style:o.active}),ie.createElement(gn,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"hex",value:n,onChange:s}),ie.createElement(gn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:r.r,onChange:s}),ie.createElement(gn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:r.g,onChange:s}),ie.createElement(gn,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:r.b,onChange:s}))},FO=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.colors,o=e.hex,s=e.rgb,a=e.styles,l=a===void 0?{}:a,u=e.className,c=u===void 0?"":u,d=jt(rs({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),f=function(p,g){p.hex?Pd(p.hex)&&n({hex:p.hex,source:"hex"},g):n(p,g)};return ie.createElement(Qb,{style:d.Compact,styles:l},ie.createElement("div",{style:d.compact,className:"compact-picker "+c},ie.createElement("div",null,gh(i,function(h){return ie.createElement(Ptt,{key:h,color:h,active:h.toLowerCase()===o,onClick:f,onSwatchHover:r})}),ie.createElement("div",{style:d.clear})),ie.createElement(Dtt,{hex:o,rgb:s,onChange:f})))};FO.propTypes={colors:me.arrayOf(me.string),styles:me.object};FO.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};is(FO);var Rtt=function(e){var n=e.hover,r=e.color,i=e.onClick,o=e.onSwatchHover,s={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},a=jt({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:n});return ie.createElement("div",{style:a.swatch},ie.createElement(mh,{color:r,onClick:i,onHover:o,focusStyle:s}))};const Itt=yO(Rtt);var OO=function(e){var n=e.width,r=e.colors,i=e.onChange,o=e.onSwatchHover,s=e.triangle,a=e.styles,l=a===void 0?{}:a,u=e.className,c=u===void 0?"":u,d=jt(rs({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},l),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right","bottom-left-triangle":s==="bottom-left","bottom-right-triangle":s==="bottom-right"}),f=function(p,g){return i({hex:p,source:"hex"},g)};return ie.createElement("div",{style:d.card,className:"github-picker "+c},ie.createElement("div",{style:d.triangleShadow}),ie.createElement("div",{style:d.triangle}),gh(r,function(h){return ie.createElement(Itt,{color:h,key:h,onClick:f,onSwatchHover:o})}))};OO.propTypes={width:me.oneOfType([me.string,me.number]),colors:me.arrayOf(me.string),triangle:me.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:me.object};OO.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};is(OO);var Ntt=function(e){var n=e.direction,r=jt({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return ie.createElement("div",{style:r.picker})},Ftt=Object.assign||function(t){for(var e=1;e.5});return ie.createElement("div",{style:r.picker})},Btt=function(){var e=jt({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return ie.createElement("div",{style:e.pointer},ie.createElement("div",{style:e.left},ie.createElement("div",{style:e.leftInside})),ie.createElement("div",{style:e.right},ie.createElement("div",{style:e.rightInside})))},h9=function(e){var n=e.onClick,r=e.label,i=e.children,o=e.active,s=jt({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:o});return ie.createElement("div",{style:s.button,onClick:n},r||i)},$tt=function(e){var n=e.rgb,r=e.currentColor,i=jt({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return ie.createElement("div",null,ie.createElement("div",{style:i.label},"new"),ie.createElement("div",{style:i.swatches},ie.createElement("div",{style:i.new}),ie.createElement("div",{style:i.current})),ie.createElement("div",{style:i.label},"current"))},ztt=function(){function t(e,n){for(var r=0;r100&&(c.a=100),c.a/=100,n({h:i.h,s:i.s,l:i.l,a:c.a,source:"rgb"},d))};return ie.createElement("div",{style:a.fields,className:"flexbox-fix"},ie.createElement("div",{style:a.double},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"hex",value:o.replace("#",""),onChange:l})),ie.createElement("div",{style:a.single},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),ie.createElement("div",{style:a.single},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),ie.createElement("div",{style:a.single},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),ie.createElement("div",{style:a.alpha},ie.createElement(gn,{style:{input:a.input,label:a.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},jtt=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var Nw=24,Jtt=QZ.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,i=r===void 0?Nw:r,o=t.height,s=o===void 0?Nw:o,a=t.style,l=a===void 0?{}:a,u=Qtt(t,["fill","width","height","style"]);return m9.default.createElement("svg",p9({viewBox:"0 0 "+Nw+" "+Nw,style:p9({fill:n,width:i,height:s},l)},u),m9.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},ent=function(e){var n=e.color,r=e.onClick,i=r===void 0?function(){}:r,o=e.onSwatchHover,s=e.first,a=e.last,l=e.active,u=jt({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:TO(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:s,last:a,active:l,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return ie.createElement(mh,{color:n,style:u.color,onClick:i,onHover:o,focusStyle:{boxShadow:"0 0 4px "+n}},ie.createElement("div",{style:u.check},ie.createElement(Jtt,null)))},tnt=function(e){var n=e.onClick,r=e.onSwatchHover,i=e.group,o=e.active,s=jt({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return ie.createElement("div",{style:s.group},gh(i,function(a,l){return ie.createElement(ent,{key:a,color:a,active:a.toLowerCase()===o,first:l===0,last:l===i.length-1,onClick:n,onSwatchHover:r})}))},zO=function(e){var n=e.width,r=e.height,i=e.onChange,o=e.onSwatchHover,s=e.colors,a=e.hex,l=e.styles,u=l===void 0?{}:l,c=e.className,d=c===void 0?"":c,f=jt(rs({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},u)),h=function(g,b){return i({hex:g,source:"hex"},b)};return ie.createElement("div",{style:f.picker,className:"swatches-picker "+d},ie.createElement(Qb,null,ie.createElement("div",{style:f.overflow},ie.createElement("div",{style:f.body},gh(s,function(p){return ie.createElement(tnt,{key:p.toString(),group:p,active:a,onClick:h,onSwatchHover:o})}),ie.createElement("div",{style:f.clear})))))};zO.propTypes={width:me.oneOfType([me.string,me.number]),height:me.oneOfType([me.string,me.number]),colors:me.arrayOf(me.arrayOf(me.string)),styles:me.object};zO.defaultProps={width:320,height:240,colors:[[bp[900],bp[700],bp[500],bp[300],bp[100]],[xp[900],xp[700],xp[500],xp[300],xp[100]],[wp[900],wp[700],wp[500],wp[300],wp[100]],[_p[900],_p[700],_p[500],_p[300],_p[100]],[Sp[900],Sp[700],Sp[500],Sp[300],Sp[100]],[Cp[900],Cp[700],Cp[500],Cp[300],Cp[100]],[Ep[900],Ep[700],Ep[500],Ep[300],Ep[100]],[Mp[900],Mp[700],Mp[500],Mp[300],Mp[100]],[Tp[900],Tp[700],Tp[500],Tp[300],Tp[100]],["#194D33",tv[700],tv[500],tv[300],tv[100]],[Ap[900],Ap[700],Ap[500],Ap[300],Ap[100]],[Pp[900],Pp[700],Pp[500],Pp[300],Pp[100]],[Dp[900],Dp[700],Dp[500],Dp[300],Dp[100]],[Rp[900],Rp[700],Rp[500],Rp[300],Rp[100]],[Ip[900],Ip[700],Ip[500],Ip[300],Ip[100]],[Np[900],Np[700],Np[500],Np[300],Np[100]],[Fp[900],Fp[700],Fp[500],Fp[300],Fp[100]],[Op[900],Op[700],Op[500],Op[300],Op[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};is(zO);var UO=function(e){var n=e.onChange,r=e.onSwatchHover,i=e.hex,o=e.colors,s=e.width,a=e.triangle,l=e.styles,u=l===void 0?{}:l,c=e.className,d=c===void 0?"":c,f=jt(rs({default:{card:{width:s,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},u),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right"}),h=function(g,b){Pd(g)&&n({hex:g,source:"hex"},b)};return ie.createElement("div",{style:f.card,className:"twitter-picker "+d},ie.createElement("div",{style:f.triangleShadow}),ie.createElement("div",{style:f.triangle}),ie.createElement("div",{style:f.body},gh(o,function(p,g){return ie.createElement(mh,{key:g,color:p,hex:p,style:f.swatch,onClick:h,onHover:r,focusStyle:{boxShadow:"0 0 4px "+p}})}),ie.createElement("div",{style:f.hash},"#"),ie.createElement(gn,{label:null,style:{input:f.input},value:i.replace("#",""),onChange:h}),ie.createElement("div",{style:f.clear})))};UO.propTypes={width:me.oneOfType([me.string,me.number]),triangle:me.oneOf(["hide","top-left","top-right"]),colors:me.arrayOf(me.string),styles:me.object};UO.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};is(UO);var HO=function(e){var n=jt({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return ie.createElement("div",{style:n.picker})};HO.propTypes={hsl:me.shape({h:me.number,s:me.number,l:me.number,a:me.number})};HO.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var VO=function(e){var n=jt({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return ie.createElement("div",{style:n.picker})};VO.propTypes={hsl:me.shape({h:me.number,s:me.number,l:me.number,a:me.number})};VO.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var nnt=function(e){var n=e.onChange,r=e.rgb,i=e.hsl,o=e.hex,s=e.hsv,a=function(h,p){if(h.hex)Pd(h.hex)&&n({hex:h.hex,source:"hex"},p);else if(h.rgb){var g=h.rgb.split(",");nP(h.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},p)}else if(h.hsv){var b=h.hsv.split(",");nP(h.hsv,"hsv")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),b[1]==1?b[1]=.01:b[2]==1&&(b[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsv"},p))}else if(h.hsl){var m=h.hsl.split(",");nP(h.hsl,"hsl")&&(m[2]=m[2].replace("%",""),m[1]=m[1].replace("%",""),m[0]=m[0].replace("°",""),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),n({h:Number(m[0]),s:Number(m[1]),v:Number(m[2]),source:"hsl"},p))}},l=jt({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),u=r.r+", "+r.g+", "+r.b,c=Math.round(i.h)+"°, "+Math.round(i.s*100)+"%, "+Math.round(i.l*100)+"%",d=Math.round(s.h)+"°, "+Math.round(s.s*100)+"%, "+Math.round(s.v*100)+"%";return ie.createElement("div",{style:l.wrap,className:"flexbox-fix"},ie.createElement("div",{style:l.fields},ie.createElement("div",{style:l.double},ie.createElement(gn,{style:{input:l.input,label:l.label},label:"hex",value:o,onChange:a})),ie.createElement("div",{style:l.column},ie.createElement("div",{style:l.single},ie.createElement(gn,{style:{input:l.input2,label:l.label2},label:"rgb",value:u,onChange:a})),ie.createElement("div",{style:l.single},ie.createElement(gn,{style:{input:l.input2,label:l.label2},label:"hsv",value:d,onChange:a})),ie.createElement("div",{style:l.single},ie.createElement(gn,{style:{input:l.input2,label:l.label2},label:"hsl",value:c,onChange:a})))))},GO=function(e){var n=e.width,r=e.onChange,i=e.rgb,o=e.hsl,s=e.hsv,a=e.hex,l=e.header,u=e.styles,c=u===void 0?{}:u,d=e.className,f=d===void 0?"":d,h=jt(rs({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+i.r+", "+i.g+", "+i.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},c));return ie.createElement("div",{style:h.picker,className:"google-picker "+f},ie.createElement("div",{style:h.head},l),ie.createElement("div",{style:h.swatch}),ie.createElement("div",{style:h.saturation},ie.createElement(EM,{hsl:o,hsv:s,pointer:HO,onChange:r})),ie.createElement("div",{style:h.body},ie.createElement("div",{style:h.controls,className:"flexbox-fix"},ie.createElement("div",{style:h.hue},ie.createElement(Ig,{style:h.Hue,hsl:o,radius:"4px",pointer:VO,onChange:r}))),ie.createElement(nnt,{rgb:i,hsl:o,hex:a,hsv:s,onChange:r})))};GO.propTypes={width:me.oneOfType([me.string,me.number]),styles:me.object,header:me.string};GO.defaultProps={width:652,styles:{},header:"Color picker"};is(GO);const rnt=t=>{const e=t.upperBound.x>t.upperBound.y?t.upperBound.x:t.upperBound.y,n=t.lowerBound.x`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`;var jO={},int=YC;Object.defineProperty(jO,"__esModule",{value:!0});var JZ=jO.default=void 0,ont=int(TW()),snt=D;JZ=jO.default=(0,ont.default)((0,snt.jsx)("path",{d:"M3 3h18v18H3z"}),"Square");function Kd(t){const[e,n]=ie.useState(null),r=s=>{n(s.currentTarget)},i=()=>{n(null)},o=!!e;return D.jsxs("div",{children:[D.jsx(io,{style:{color:bc(t.color)},onClick:r,children:D.jsx(JZ,{})}),D.jsx(dG,{open:o,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:D.jsx(qtt,{color:t.color,onChangeComplete:t.onChangeComplete})})]})}function ant(){const t=VY();return D.jsx(xu,{sx:{flexGrow:1,overflow:"scroll"},variant:"outlined",children:D.jsx(GI,{children:D.jsxs(cn,{spacing:1,children:[D.jsx(xn,{variant:"h6",children:" Legend"}),D.jsx($l,{}),D.jsxs(aG,{children:[D.jsx(Bo,{control:D.jsx(vc,{checked:t.detector,onChange:(e,n)=>t.update({detector:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.detectorColor,onChangeComplete:e=>t.update({detectorColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Detector"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.cameraTube,onChange:(e,n)=>t.update({cameraTube:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.cameraTubeColor,onChangeComplete:e=>t.update({cameraTubeColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Camera Tube"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.beamstop,onChange:(e,n)=>{t.update({beamstop:n})}}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.beamstopColor,onChangeComplete:e=>t.update({beamstopColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Beamstop"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.clearance,onChange:(e,n)=>{t.update({clearance:n})}}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.clearanceColor,onChangeComplete:e=>t.update({clearanceColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Clearance"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.visibleRange,onChange:(e,n)=>t.update({visibleRange:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.visibleColor,onChangeComplete:e=>t.update({visibleColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Visible Range"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.requestedRange,onChange:(e,n)=>t.update({requestedRange:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.requestedRangeColor,onChangeComplete:e=>t.update({requestedRangeColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Requested Range"})]})}),D.jsx(Bo,{control:D.jsx(vc,{checked:t.inaccessibleRange,onChange:(e,n)=>t.update({inaccessibleRange:n})}),label:D.jsxs(cn,{direction:"row",children:[D.jsx(Kd,{color:t.inaccessibleRangeColor,onChangeComplete:e=>t.update({inaccessibleRangeColor:e.rgb})}),D.jsx(xn,{display:"flex",alignItems:"center",children:"Inaccessible Range"})]})})]}),D.jsxs(Ai,{children:[D.jsx(qI,{id:"demo-radio-buttons-group-label",children:"Axes:"}),D.jsxs(gG,{"aria-labelledby":"demo-radio-buttons-group-label",value:t.plotAxes,name:"radio-buttons-group",onChange:e=>t.update({plotAxes:e.target.value}),children:[D.jsx(Bo,{value:Su.milimeter,control:D.jsx(gm,{}),label:"Axes in mm"}),D.jsx(Bo,{value:Su.pixel,control:D.jsx(gm,{}),label:"Axes in pixels"}),D.jsx(Bo,{value:Su.reciprocal,control:D.jsx(gm,{}),label:"Axes in q(nm^-1)"})]})]}),D.jsx(cn,{direction:"row",spacing:1})]})})})}function iP(t){const{coords:e,...n}=t,[r,i,o]=e,s=i.distanceTo(r),a=o.distanceTo(r);return D.jsx("ellipse",{cx:r.x,cy:r.y,rx:s,ry:a,...n})}function lnt(){const t=VY(),e=gg(),n=mg(),r=gE(),i=vE(),o=unt(e.wavelength,e.cameraLength),{ptMin:s,ptMax:a,visibleQRange:l,fullQRange:u}=E.useMemo(()=>{Zp.UNITS.xpixel&&delete Zp.UNITS.xpixel,Zp.UNITS.ypixel&&delete Zp.UNITS.ypixel,n8("xpixel",n.detector.pixelSize.width.toString()),n8("ypixel",n.detector.pixelSize.height.toString());const A=g9(e.angle,e.cameraLength,e.wavelength,e.beamline);return sUe(n.detector,r.beamstop,i.cameraTube,A)},[n.detector,r.beamstop,i.cameraTube,e.angle,e.cameraLength,e.wavelength,e.beamline]),c=Ua.fromNumericRange(l,"m^-1").to("nm^-1");console.log(l);const d=Ua.fromNumericRange(u,"m^-1").to("nm^-1"),{beamstopCentre:f,cameraTubeCentre:h,minPoint:p,maxPoint:g}=cnt(s,a,r.beamstop,i.cameraTube),b=new XR(t.plotAxes,o),{plotDetector:m,plotBeamstop:w,plotClearance:x,plotCameraTube:_,plotVisibleRange:C}=dnt(b,f,r.beamstop,h,i.cameraTube,n.detector,p,g),S=yf(hnt());let M={start:new oe(0,0),end:new oe(0,0)};S&&e.cameraLength&&e.wavelength&&(M=fnt(S,g9(e.angle,e.cameraLength,e.wavelength,e.beamline),f,M,b));const P=rnt(m);return D.jsxs(cn,{direction:"column",spacing:1,flexGrow:1,children:[D.jsxs(cn,{direction:{sm:"column",md:"row"},spacing:1,flexGrow:1,children:[D.jsx(xu,{variant:"outlined",sx:{aspectRatio:1.05/1},children:D.jsx(GI,{sx:{width:"100%",height:"100%"},children:D.jsx("div",{style:{display:"grid",width:"100%",height:"100%",border:"solid black"},children:D.jsxs(sze,{abscissaConfig:{visDomain:[P.xAxis.min,P.xAxis.max],showGrid:!0},ordinateConfig:{visDomain:[P.yAxis.max,P.yAxis.min],showGrid:!0},children:[D.jsx(M$e,{}),D.jsx($$e,{}),D.jsx(rUe,{points:[w.centre,w.endPointX,w.endPointY,x.centre,x.endPointX,x.endPointY,_.centre,_.endPointX,_.endPointY,m.lowerBound,m.upperBound,C.start,C.end,M.start,M.end],children:(A,R,F,$,j,k,U,G,B,L,N,W,K,Q,J)=>D.jsxs(nO,{children:[t.cameraTube&&D.jsx(iP,{coords:[U,G,B],fill:bc(t.cameraTubeColor),id:"camera tube"}),t.detector&&D.jsx(US,{coords:[L,N],fill:bc(t.detectorColor),id:"detector"}),t.inaccessibleRange&&D.jsx(qA,{coords:[A,W],stroke:bc(t.inaccessibleRangeColor),strokeWidth:3,id:"inaccessible"}),t.clearance&&D.jsx(iP,{coords:[$,j,k],fill:bc(t.clearanceColor),id:"clearance"}),t.visibleRange&&D.jsx(qA,{coords:[W,K],stroke:bc(t.visibleColor),strokeWidth:3,id:"visible"}),t.requestedRange&&D.jsx(qA,{coords:[Q,J],stroke:bc(t.requestedRangeColor),strokeWidth:3,id:"requested"}),t.beamstop&&D.jsx(iP,{coords:[A,R,F],fill:bc(t.beamstopColor),id:"beamstop"})]})})]})})})}),D.jsx(ant,{})]}),D.jsx(mUe,{visableQRange:c,fullQrange:d})]})}function unt(t,e){let n=null;if(e&&t&&(n=_o(2*Math.PI,wi(Rt(e,"m"),t.to("m")))),n==null)return n;if(typeof n=="number"||!("units"in n))throw TypeError("scaleFactor should be a unit not a number");return n}function g9(t,e,n,r){return{angle:t,cameraLength:e,beamline:r,wavelength:n}}function cnt(t,e,n,r){const i={x:Rt(t.x,"m"),y:Rt(t.y,"m")},o={x:Rt(e.x,"m"),y:Rt(e.y,"m")},s={x:Rt(n.centre.x??NaN,"xpixel"),y:Rt(n.centre.y??NaN,"ypixel")},a={x:Rt(r.centre.x??NaN,"xpixel"),y:Rt(r.centre.y??NaN,"ypixel")};return{beamstopCentre:s,cameraTubeCentre:a,minPoint:i,maxPoint:o}}function dnt(t,e,n,r,i,o,s,a){const l=t.createPlotEllipse(e,n.diameter,e),u=t.createPlotEllipse(r,i.diameter,e),c=t.createPlotEllipseClearance(e,n.diameter,n.clearance??0,e),d=t.createPlotRectangle(o.resolution,e),f=t.createPlotRange(s,a,e);return{plotDetector:d,plotBeamstop:l,plotClearance:c,plotCameraTube:u,plotVisibleRange:f}}function fnt(t,e,n,r,i){const o=Uz(t.max,e.angle,Rt(e.cameraLength??NaN,"m"),e.wavelength,n),s=Uz(t.min,e.angle,Rt(e.cameraLength??NaN,"m"),e.wavelength,n);return r=i.createPlotRange(s,o,n),r}function hnt(){return t=>{if(!t.requestedMax||!t.requestedMin)return null;const e=n=>{let r;switch(t.requested){case Ho.d:r=GS(Rt(n,t.dUnits));break;case Ho.s:r=VS(Rt(n,t.sUnits));break;default:r=Rt(n,t.qUnits)}return r};return new Ua(e(t.requestedMin),e(t.requestedMax))}}function pnt(){const[t,e]=E.useState(Object.keys(yv)[0]),n=mg(),r=gg(),i=gE(),o=vE(),s=a=>{const{beamstop:l,cameraTube:u,detector:c,beamline:d}=yv[a];n.updateDetector(c),i.updateBeamstop(l),o.updateCameraTube(u),r.updateBeamline(d),i.updateDiameter(r.beamlineRecord[d].beamstopDiameter,bs.millimetre),o.updateDiameter(r.beamlineRecord[d].cameratubeDiameter,bs.millimetre),e(a)};return D.jsx(_se,{style:{position:"static",width:"100%"},children:D.jsxs(yG,{children:[D.jsx(xn,{variant:"h6",component:"div",sx:{flexGrow:1},children:"Dedi Web"}),D.jsx(ly,{size:"small",options:Object.keys(yv),value:t,sx:{width:250,color:"white"},renderInput:a=>D.jsx($n,{...a,label:"preset",sx:{color:"black"}}),onChange:(a,l)=>{l&&s(l)}})]})})}function mnt(){return D.jsx(D.Fragment,{children:D.jsx(ice,{children:D.jsxs(cn,{spacing:1,children:[D.jsx(pnt,{}),D.jsxs(cn,{direction:{md:"column",lg:"row"},spacing:1,justifyContent:"center",children:[D.jsx(QMe,{}),D.jsx(lnt,{})]})]})})})}sP.createRoot(document.getElementById("root")).render(D.jsx(ie.StrictMode,{children:D.jsx(mnt,{})}))});export default gnt(); diff --git a/index.html b/index.html index cb584dc..8e6f891 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ dedi-web - +